{ "version": 3, "sources": ["../../src/scripts/product.js"], "sourcesContent": ["/* eslint-disable no-mixed-spaces-and-tabs */\nconst colorRequestConfirmationMessage = \".confirmation-message\",\n\tcolorRequestConfirmationMessageClose = \".details__color-request__form .confirmation-message-close\",\n\tcolorRequestWrapper = \".details__color-request\",\n\tcolorRequestGFormWrapper = \".details__color-request__form .gform_wrapper\",\n\tcolorRequestFormWrapper = \".details__color-request__form__wrapper\",\n\tcolorRequestButton = \".download-button--colors\",\n\tcolorRequestInputSelect = \".select-item--color input[type=checkbox]\";\n\n/**\n * Gallery and Modal Constants\n */\nconst modalThumbnail = document.querySelectorAll(\".modal__gallery__thumbnail\");\nconst modalMainImage = document.querySelector(\".modal__gallery__mainimage\");\nconst modalOpeners = document.querySelectorAll(\"[data-open]\");\nconst thumbnailImageSourceReplace = \"-150x150\";\nconst thumbnailActiveClass = \"thumbnail--active\";\nconst thumbnailVideoClass = \"thumbnail--video\";\nconst mainImageVideoClass = \"mainimage--video\";\nlet thumbSrc;\n\n/**\n * Toogle Form\n */\nfunction toogleForm(status) {\n\tconst form = jQuery(colorRequestFormWrapper);\n\tif (status) {\n\t\tform.slideDown();\n\t} else {\n\t\tform.slideUp();\n\t}\n}\n/**\n * Product Download Button\n */\nwindow.productDownloadButton = function (selectItem, buttonClass) {\n\tconst downloadFileCheckboxes = document.querySelectorAll(selectItem);\n\tconst downloadButton = document.querySelector(buttonClass);\n\tif (downloadButton) {\n\t\tconst downloadButtonTextWrap = downloadButton.querySelector(\"span\");\n\t\tconst downloadButtonText = downloadButtonTextWrap.textContent;\n\t\t// const colorRequestWrapperE = jQuery(colorRequestWrapper)\n\t\tlet filesToDownload = [];\n\t\tlet colorSamplesToRequest = [];\n\n\t\tdownloadFileCheckboxes.forEach((checkbox) => {\n\t\t\tcheckbox.addEventListener(\"change\", () => {\n\t\t\t\tfilesToDownload = Array.from(downloadFileCheckboxes).filter((i) => i.checked);\n\n\t\t\t\tif (filesToDownload.length) {\n\t\t\t\t\t//If we have files selected\n\n\t\t\t\t\tif (downloadButton instanceof HTMLAnchorElement) {\n\t\t\t\t\t\t// prepare download files href\n\t\t\t\t\t\tdownloadButton.classList.remove(\"disabled\");\n\t\t\t\t\t\tdownloadButton.href = \"/wp-json/d6/v1/downloads/\" + filesToDownload.map((i) => i.dataset.id).join(\",\");\n\t\t\t\t\t} else if (downloadButton instanceof HTMLButtonElement) {\n\t\t\t\t\t\t//Color Sample Request\n\t\t\t\t\t\t//Set Selecoted Colors hidden field.\n\t\t\t\t\t\tcolorSamplesToRequest =\n\t\t\t\t\t\t\t\"
Color> | SKU | \" +\n\t\t\t\t\t\t\tfilesToDownload\n\t\t\t\t\t\t\t\t.map((i) => \"
\" + i.dataset.name + \" | \" + i.dataset.sku + \" |