The image with the URL ${t} can not be loaded into the canvas.
Troubleshooting
@@ -55,7 +55,7 @@
/li>
- `)}}),this.toggleLock(Boolean(this.locked));const s=t=>{t.chargeAfterEditing&&(t._isPriced||(this.changePrice(t.price,"+"),t._isPriced=!0),t._initialText===t.text)&&t._isPriced&&(this.changePrice(t.price,"-"),t._isPriced=!1)};this.fabricCanvas.on({"object:added":t=>{let e=t.target,i=e.price;e._addToUZ&&""!=e._addToUZ&&(t=this.fabricCanvas.getElementByTitle(e._addToUZ),i=t&&t.price?t.price:i),void 0===i||0===i||e.uploadZone||e._ignore||e.chargeAfterEditing&&!e._isPriced||this.changePrice(i,"+")},"object:removed":t=>{t=t.target;void 0===t.price||0===t.price||t.uploadZone||t.chargeAfterEditing&&!t._isPriced||this.changePrice(t.price,"-")},"text:changed":t=>{s(t.target)},elementModify:t=>{this.elementsAdded&&t.options.hasOwnProperty("text")&&s(t.element)},elementFillChange:t=>{Qt(this,$t,ie).call(this,t.element)}})}init(){this.loadElements(this.viewData.elements,Qt(this,Kt,ee).bind(this))}loadElements(t,e){this.fabricCanvas.initialElementsLoaded&&this.fabricCanvas.reset(!1),this.fabricCanvas.offHistory(),this.fabricCanvas.addElements(t,e)}toDataURL(e){let i=1{t.excludeFromExport&&i.onlyExportable&&(t.visible=!1,n.push(t))}),t&&this.fabricCanvas.deselectElement(),this.fabricCanvas.setDimensions({width:this.options.stageWidth,height:this.options.stageHeight}).setZoom(1),this.fabricCanvas.setBackgroundColor(i.backgroundColor,()=>{i.watermarkImg&&(this.fabricCanvas.add(i.watermarkImg),i.watermarkImg.center(),i.watermarkImg.bringToFront()),e(this.fabricCanvas.toDataURL(i)),i.watermarkImg&&this.fabricCanvas.remove(i.watermarkImg),this.fabricCanvas.wrapperEl.offsetParent&&this.fabricCanvas.resetSize(),this.fabricCanvas.setBackgroundColor("transparent",()=>{this.fabricCanvas.renderAll()});for(var t=0;t{s.appendChild(t)});n=document.createElement("style");let r="",a="",o=(e.forEach(t=>{t.hasOwnProperty("url")&&("google"==t.url?r+=t.name.replace(/\s/g,"+")+":ital,wght@0,400;0,700;1,700&":a+=Zt(t))}),0this.options.maxPrice&&(this.truePrice=Number(this.options.maxPrice)),this.truePrice%1!=0&&(this.truePrice=Number(this.truePrice.toFixed(2))),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:t,truePrice:this.truePrice}})),this.truePrice}}function ee(){this.elementsAdded=!0,this.fabricCanvas._doHistory=!0,this.mask&&this.fabricCanvas.setMask(this.mask),this.onCreatedCallback&&this.onCreatedCallback(this),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:0,truePrice:this.truePrice}}))}function ie(t){var e;this.elementsAdded&&t.colorPrices&&"object"==typeof t.colors&&1{let t=e.url;e.params&&(t+="?"+new URLSearchParams(e.params).toString());const i=new XMLHttpRequest;return i.responseType="json",i.open("GET",t),i.onreadystatechange=t=>{4==i.readyState&&200==i.status?e.onSuccess&&e.onSuccess(i.response):200!==i.status&&e.onError&&e.onError(i)},i.send(),i},se=e=>{var t=e.url,i={Accept:"application/json"};return e.body instanceof FormData||(i["Content-Type"]="application/json"),fetch(t,{method:"POST",redirect:"follow",headers:i,body:e.body instanceof FormData?e.body:JSON.stringify(e.body)}).then(t=>t.json()).then(t=>{e.onSuccess&&e.onSuccess(t)}).catch(t=>{e.onError&&e.onError(t)})};class re extends EventTarget{langJSON=null;constructor(){super()}loadLangJSON(){let e=0{};!1!==e?"object"==typeof e?(this.langJSON=e,i.call(this)):ne({url:e,onSuccess:t=>{this.langJSON=t,i.call(this)},onError:t=>{alert('Language JSON "'+e+'" could not be loaded or is not valid. Make sure you set the correct URL in the options and the JSON is valid!'),i.call(this)}}):i.call(this)}translateElement(t){let e="";var i,n;return this.langJSON?(i="",!(i=t.getAttribute("placeholder")?t.getAttribute("placeholder"):t.getAttribute("title")?t.getAttribute("title"):t.dataset.title||t.innerHTML).includes(".")||/\s/.test(i)?e=i:(i=i.toLowerCase().split("."),(n=this.langJSON[i[0]])?void 0===(e=n[i[1]])&&(console.log("FPD label not found: "+t.dataset.defaulttext,i),e=t.dataset.defaulttext):e=t.dataset.defaulttext)):e=t.dataset.defaulttext,t.getAttribute("placeholder")?(t.setAttribute("placeholder",e),t.innerText=""):t.getAttribute("title")?t.setAttribute("title",e):t.dataset.title?t.dataset.title=e:t.innerHTML=e,e}getTranslation(t,e){let i=2{this.translateElement(t)})}}function ae(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function oe(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var le=new WeakSet;class ce extends HTMLElement{constructor(){super();var t=this,e=le;if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(this),ae(this,"placeholder",""),ae(this,"value",""),ae(this,"searchable",!1),ae(this,"inputElem",null),ae(this,"listElem",null)}connectedCallback(){this.innerHTML='
',this.inputElem=this.querySelector("input.fpd-dropdown-current"),this.listElem=this.querySelector(".fpd-dropdown-list"),document.addEventListener("click",t=>{this.contains(t.target)||this.classList.remove("fpd-active")}),this.addEventListener("click",()=>{oe(this,le,he).call(this),this.classList.toggle("fpd-active")}),this.querySelector(".fpd-dropdown-arrow").addEventListener("click",t=>{t.stopPropagation(),oe(this,le,he).call(this),this.classList.toggle("fpd-active")}),this.inputElem.addEventListener("keyup",t=>{if(this.searchable){const e=t.currentTarget.value;this.listElem.querySelectorAll(".fpd-item").forEach(t=>{0==e.length?t.classList.remove("fpd-hidden"):t.classList.toggle("fpd-hidden",!t.innerText.toLowerCase().includes(e.toLowerCase()))})}}),window.addEventListener("scroll",()=>{oe(this,le,he).call(this)});const i=t=>{var e=t.parentNode;e&&(t.addEventListener("scroll",()=>{oe(this,le,he).call(this)}),i(e))};i(this),this.inputElem.setAttribute("placeholder",this.getAttribute("placeholder")||""),oe(this,le,he).call(this)}static get observedAttributes(){return["searchable","placeholder","value"]}attributeChangedCallback(t,e,i){e!==i&&(this.inputElem&&("placeholder"===t?this.inputElem.setAttribute("placeholder",i):"value"===t&&(this.inputElem.value=i)),"searchable"===t)&&(this.searchable=this.hasAttribute("searchable"))}}function he(){var t=this.getBoundingClientRect();this.listElem.style.width=t.width+"px",this.listElem.style.left=t.left+"px",this.listElem.style.top=t.top+t.height+"px"}customElements.define("fpd-dropdown",ce),Zo(653);class de extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='
'}}customElements.define("fpd-module-qr-code",ue);function pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fe(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var i=t,n=e,s=[],r=!0,t=!1,e=void 0;try{for(var a,o=i[Symbol.iterator]();!(r=(a=o.next()).done)&&(s.push(a.value),!n||s.length!==n);r=!0);}catch(i){t=!0,e=i}finally{try{!r&&o.return&&o.return()}finally{if(t)throw e}}return s}throw new TypeError("Invalid attempt to destructure non-iterable instance")}e=function(t,e,i){return e&&ge(t.prototype,e),i&&ge(t,i),t};function ge(t,e){for(var i=0;ie&&(n=!0)):(Ae(t),n=!0):n=!0,n&&this.hide()&&(this.settings.parent.style.pointerEvents="",i!==Se&&this.settings.parent.focus(),this.onClose)&&this.onClose(this.colour)}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if(t="string"==typeof t?t.trim():t){e=e||{};var i,n=void 0;try{n=new be(t)}catch(t){if(e.failSilently)return;throw t}this.settings.alpha||((i=n.hsla)[3]=1,n.hsla=i),this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){var t,e,i;return!!this.settings.parent&&(this.domElement?(t=this._toggleDOM(!0),this._setPosition(),t):(t=this.settings.template||'
'}}function Le(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-save-load",De);var Be=new WeakSet;class Fe extends EventTarget{constructor(i,t){super();var e,n=this;if((e=Be).has(n))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(this),this.fpdInstance=i,this.container=document.createElement("fpd-module-save-load"),t.append(this.container),this.inputElem=this.container.querySelector("input"),this.gridElem=this.container.querySelector(".fpd-grid"),u(this.container.querySelector(".fpd-btn"),"click",t=>{var e=Vt(this.fpdInstance.currentViewInstance.options.stageWidth,this.fpdInstance.currentViewInstance.options.stageHeight,300,300,"cover");i.viewInstances[0].toDataURL(e=>{var t=this.fpdInstance.getProduct(),e={thumbnail:e,product:t,title:this.inputElem.value||""};if(t&&this.fpdInstance.mainOptions.saveActionBrowserStorage){let t=Le(this,Be,je).call(this);t=t||[],this.addSavedProduct(e),t.push(e),window.localStorage.setItem(this.fpdInstance.container.id,JSON.stringify(t)),l(this.fpdInstance.translator.getTranslation("misc","product_saved"))}t&&(this.fpdInstance.dispatchEvent(new CustomEvent("actionSave",{detail:e})),this.fpdInstance.doUnsavedAlert=!1)},{multiplier:e,format:"png",backgroundColor:"transparent"})}),this.fpdInstance.mainOptions.saveActionBrowserStorage&&(n=Le(this,Be,je).call(this))&&0{this.addSavedProduct(t)})}addSavedProduct(t){var{thumbnail:t,product:e,title:i=""}=t;const n=mt({url:t,title:i,removable:!0,disablePrice:!0,disableDraggable:!0});return this.fpdInstance.lazyBackgroundObserver.observe(n.querySelector("picture")),n.product=e,this.gridElem.append(n),u(n,"click",t=>{this.fpdInstance.loadProduct(n.product),this.fpdInstance.currentProductIndex=-1}),u(n.querySelector(".fpd-delete"),"click",t=>{t.stopPropagation();var e,t=t.currentTarget.parentNode,i=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t);this.fpdInstance.mainOptions.saveActionBrowserStorage&&((e=Le(this,Be,je).call(this)).splice(i,1),window.localStorage.setItem(this.fpdInstance.container.id,JSON.stringify(e))),this.fpdInstance.dispatchEvent(new CustomEvent("actionLoad:Remove",{detail:{index:i,item:t}})),t.remove()}),n}}function je(){return!!v()&&JSON.parse(window.localStorage.getItem(this.fpdInstance.container.id))}function Re(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}window.FPDSaveLoadModule=Fe;var Ne=new WeakSet;class He extends EventTarget{constructor(e){super();var t=this,i=Ne;if(i.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");i.add(this),Re(this,"currentActions",{}),this.fpdInstance=e,this.container=document.createElement("fpd-actions-bar"),e.container.append(this.container),this.leftActionsMenu=this.container.querySelector('[data-pos="left"] fpd-actions-menu'),this.leftActionsMenu.setAttribute("placeholder",this.fpdInstance.translator.getTranslation("actions","menu_file")),this.centerActionsMenu=this.container.querySelector('[data-pos="center"] fpd-actions-menu'),this.rightActionsMenu=this.container.querySelector('[data-pos="right"] fpd-actions-menu'),this.rightActionsMenu.setAttribute("placeholder",this.fpdInstance.translator.getTranslation("actions","menu_more")),u(e.container.querySelectorAll(".fpd-close"),"click",t=>{d(this.fpdInstance.modalWrapper,["fpd-show"]),this.fpdInstance.dispatchEvent(new CustomEvent("modalDesignerClose"))}),u(e.container.querySelector(".fpd-done"),"click",t=>{this.fpdInstance.dispatchEvent(new CustomEvent("modalDesignerDone"))}),u(e,["viewSelect"],t=>{this.reset()}),u(window,"resize",t=>{e.inTextField||this.reset()}),u(window,["resize","fpdModalDesignerOpen"],()=>{this.leftActionsMenu&&this.leftActionsMenu.toggleMenus(),this.rightActionsMenu&&this.rightActionsMenu.toggleMenus()}),this.setup(e.mainOptions.actions)}addActionBtn(t,e){let i=2{var e=t.currentTarget.querySelector(".fpd-switch");e&&!t.target.classList.contains("fpd-switch")&&(e.checked=!e.checked),this.doAction(t.currentTarget.dataset.action)},t.items=[...t.items,n];else{const i=document.createElement("div");i.className="fpd-btn fpd-tooltip",i.setAttribute("aria-label",s),i.dataset.action=e,i.innerHTML=`${s}`,He.toggleActions.includes(e)&&i.insertAdjacentHTML("beforeend",''),t.append(i),u(i,"click",t=>{var e=t.currentTarget.querySelector(".fpd-switch");e&&!t.target.classList.contains("fpd-switch")&&(e.checked=!e.checked),this.doAction(t.currentTarget.dataset.action)})}}}doAction(t){if(this.fpdInstance.currentViewInstance){if(this.fpdInstance.deselectElement(),"print"===t)this.fpdInstance.print();else if("reset-product"===t){var e=a(this.fpdInstance.translator.getTranslation("misc","reset_confirm"),!1,"confirm",this.fpdInstance.container);const t=e.querySelector(".fpd-confirm");t.innerText=this.fpdInstance.translator.getTranslation("actions","reset_product"),u(t,["click"],()=>{this.fpdInstance.loadProduct(this.fpdInstance.productViews),e.remove()})}else if("undo"===t)this.fpdInstance.currentViewInstance.fabricCanvas.undo();else if("redo"===t)this.fpdInstance.currentViewInstance.fabricCanvas.redo();else if("info"===t)a(this.fpdInstance.translator.getTranslation("actions","info_content"),!1,"",this.fpdInstance.container);else if("preview-lightbox"===t)this.fpdInstance.getProductDataURL(t=>{const e=new Image;e.src=t,e.onload=()=>{var t=a('',!0);o(this.fpdInstance,"actionPreviewModalOpen",{modal:t})}});else if("snap"===t)this.fpdInstance.currentViewInstance.fabricCanvas.snapToGrid=!this.fpdInstance.currentViewInstance.fabricCanvas.snapToGrid,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll();else if("zoom"===t){const a=this.fpdInstance.mainWrapper.container.querySelector(".fpd-zoom-wrapper");if(a)return void a.remove();const t=document.createElement("div"),e=(t.className="fpd-zoom-wrapper fpd-shadow-1",this.fpdInstance.currentViewInstance.fabricCanvas.getZoom()/this.fpdInstance.currentViewInstance.fabricCanvas.responsiveScale),i=document.createElement("fpd-range-slider"),n=(i.className="fpd-progress",i.setAttribute("value",e),i.setAttribute("step",.02),i.setAttribute("min",1),i.setAttribute("max",3),i.onInput=t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setResZoom(Number(t.currentTarget.value))},t.append(i),document.createElement("div"));n.className="fpd-stage-pan fpd-toggle",n.innerHTML='',t.append(n),u(n,"click",t=>{this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas=!this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas,g(n,["fpd-active"],this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas)}),this.fpdInstance.mainWrapper.container.append(t)}else if("download"===t){const t=`
+ `)}}),this.toggleLock(Boolean(this.locked));const s=t=>{t.chargeAfterEditing&&(t._isPriced||(this.changePrice(t.price,"+"),t._isPriced=!0),t._initialText===t.text)&&t._isPriced&&(this.changePrice(t.price,"-"),t._isPriced=!1)};this.fabricCanvas.on({"object:added":t=>{let e=t.target,i=e.price;e._addToUZ&&""!=e._addToUZ&&(t=this.fabricCanvas.getElementByTitle(e._addToUZ),i=t&&t.price?t.price:i),void 0===i||0===i||e.uploadZone||e._ignore||e.chargeAfterEditing&&!e._isPriced||this.changePrice(i,"+")},"object:removed":t=>{t=t.target;void 0===t.price||0===t.price||t.uploadZone||t.chargeAfterEditing&&!t._isPriced||this.changePrice(t.price,"-")},"text:changed":t=>{s(t.target)},elementModify:t=>{this.elementsAdded&&t.options.hasOwnProperty("text")&&s(t.element)},elementFillChange:t=>{Qt(this,$t,ie).call(this,t.element)}})}init(){this.loadElements(this.viewData.elements,Qt(this,Kt,ee).bind(this))}loadElements(t,e){this.fabricCanvas.initialElementsLoaded&&this.fabricCanvas.reset(!1),this.fabricCanvas.offHistory(),this.fabricCanvas.addElements(t,e)}toDataURL(e){let i=1{t.excludeFromExport&&i.onlyExportable&&(t.visible=!1,n.push(t))}),t&&this.fabricCanvas.deselectElement(),this.fabricCanvas.setDimensions({width:this.options.stageWidth,height:this.options.stageHeight}).setZoom(1),this.fabricCanvas.setBackgroundColor(i.backgroundColor,()=>{i.watermarkImg&&(this.fabricCanvas.add(i.watermarkImg),i.watermarkImg.center(),i.watermarkImg.bringToFront()),e(this.fabricCanvas.toDataURL(i)),i.watermarkImg&&this.fabricCanvas.remove(i.watermarkImg),this.fabricCanvas.wrapperEl.offsetParent&&this.fabricCanvas.resetSize(),this.fabricCanvas.setBackgroundColor("transparent",()=>{this.fabricCanvas.renderAll()});for(var t=0;t{s.appendChild(t)});n=document.createElement("style");let r="",a="",o=(e.forEach(t=>{t.hasOwnProperty("url")&&("google"==t.url?r+=t.name.replace(/\s/g,"+")+":ital,wght@0,400;0,700;1,700&":a+=Zt(t))}),0this.options.maxPrice&&(this.truePrice=Number(this.options.maxPrice)),this.truePrice%1!=0&&(this.truePrice=Number(this.truePrice.toFixed(2))),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:t,truePrice:this.truePrice}})),this.truePrice}}function ee(){this.elementsAdded=!0,this.fabricCanvas._doHistory=!0,this.mask&&this.fabricCanvas.setMask(this.mask),this.onCreatedCallback&&this.onCreatedCallback(this),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:0,truePrice:this.truePrice}}))}function ie(t){var e;this.elementsAdded&&t.colorPrices&&"object"==typeof t.colors&&1{let t=e.url;e.params&&(t+="?"+new URLSearchParams(e.params).toString());const i=new XMLHttpRequest;return i.responseType="json",i.open("GET",t),i.onreadystatechange=t=>{4==i.readyState&&200==i.status?e.onSuccess&&e.onSuccess(i.response):200!==i.status&&e.onError&&e.onError(i)},i.send(),i},se=e=>{var t=e.url,i={Accept:"application/json"};return e.body instanceof FormData||(i["Content-Type"]="application/json"),fetch(t,{method:"POST",redirect:"follow",headers:i,body:e.body instanceof FormData?e.body:JSON.stringify(e.body)}).then(t=>t.json()).then(t=>{e.onSuccess&&e.onSuccess(t)}).catch(t=>{e.onError&&e.onError(t)})};class re extends EventTarget{langJSON=null;constructor(){super()}loadLangJSON(){let e=0{};!1!==e?"object"==typeof e?(this.langJSON=e,i.call(this)):ne({url:e,onSuccess:t=>{this.langJSON=t,i.call(this)},onError:t=>{alert('Language JSON "'+e+'" could not be loaded or is not valid. Make sure you set the correct URL in the options and the JSON is valid!'),i.call(this)}}):i.call(this)}translateElement(t){let e="";var i,n;return this.langJSON?(i="",!(i=t.getAttribute("placeholder")?t.getAttribute("placeholder"):t.getAttribute("title")?t.getAttribute("title"):t.dataset.title||t.innerHTML).includes(".")||/\s/.test(i)?e=i:(i=i.toLowerCase().split("."),(n=this.langJSON[i[0]])?void 0===(e=n[i[1]])&&(console.log("FPD label not found: "+t.dataset.defaulttext,i),e=t.dataset.defaulttext):e=t.dataset.defaulttext)):e=t.dataset.defaulttext,t.getAttribute("placeholder")?(t.setAttribute("placeholder",e),t.innerText=""):t.getAttribute("title")?t.setAttribute("title",e):t.dataset.title?t.dataset.title=e:t.innerHTML=e,e}getTranslation(t,e){let i=2{this.translateElement(t)})}}function ae(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function oe(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var le=new WeakSet;class ce extends HTMLElement{constructor(){super();var t=this,e=le;if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(this),ae(this,"placeholder",""),ae(this,"value",""),ae(this,"searchable",!1),ae(this,"inputElem",null),ae(this,"listElem",null)}connectedCallback(){this.innerHTML='
',this.inputElem=this.querySelector("input.fpd-dropdown-current"),this.listElem=this.querySelector(".fpd-dropdown-list"),document.addEventListener("click",t=>{this.contains(t.target)||this.classList.remove("fpd-active")}),this.addEventListener("click",()=>{oe(this,le,he).call(this),this.classList.toggle("fpd-active")}),this.querySelector(".fpd-dropdown-arrow").addEventListener("click",t=>{t.stopPropagation(),oe(this,le,he).call(this),this.classList.toggle("fpd-active")}),this.inputElem.addEventListener("keyup",t=>{if(this.searchable){const e=t.currentTarget.value;this.listElem.querySelectorAll(".fpd-item").forEach(t=>{0==e.length?t.classList.remove("fpd-hidden"):t.classList.toggle("fpd-hidden",!t.innerText.toLowerCase().includes(e.toLowerCase()))})}}),window.addEventListener("scroll",()=>{oe(this,le,he).call(this)});const i=t=>{var e=t.parentNode;e&&(t.addEventListener("scroll",()=>{oe(this,le,he).call(this)}),i(e))};i(this),this.inputElem.setAttribute("placeholder",this.getAttribute("placeholder")||""),oe(this,le,he).call(this)}static get observedAttributes(){return["searchable","placeholder","value"]}attributeChangedCallback(t,e,i){e!==i&&(this.inputElem&&("placeholder"===t?this.inputElem.setAttribute("placeholder",i):"value"===t&&(this.inputElem.value=i)),"searchable"===t)&&(this.searchable=this.hasAttribute("searchable"))}}function he(){var t=this.getBoundingClientRect();this.listElem.style.width=t.width+"px",this.listElem.style.left=t.left+"px",this.listElem.style.top=t.top+t.height+"px"}customElements.define("fpd-dropdown",ce),Zo(653);class de extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='
'}}customElements.define("fpd-module-qr-code",ue);function pe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function fe(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var i=t,n=e,s=[],r=!0,t=!1,e=void 0;try{for(var a,o=i[Symbol.iterator]();!(r=(a=o.next()).done)&&(s.push(a.value),!n||s.length!==n);r=!0);}catch(i){t=!0,e=i}finally{try{!r&&o.return&&o.return()}finally{if(t)throw e}}return s}throw new TypeError("Invalid attempt to destructure non-iterable instance")}e=function(t,e,i){return e&&ge(t.prototype,e),i&&ge(t,i),t};function ge(t,e){for(var i=0;ie&&(n=!0)):(Ae(t),n=!0):n=!0,n&&this.hide()&&(this.settings.parent.style.pointerEvents="",i!==Se&&this.settings.parent.focus(),this.onClose)&&this.onClose(this.colour)}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if(t="string"==typeof t?t.trim():t){e=e||{};var i,n=void 0;try{n=new be(t)}catch(t){if(e.failSilently)return;throw t}this.settings.alpha||((i=n.hsla)[3]=1,n.hsla=i),this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){var t,e,i;return!!this.settings.parent&&(this.domElement?(t=this._toggleDOM(!0),this._setPosition(),t):(t=this.settings.template||'
'}}function Le(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-save-load",De);var Fe=new WeakSet;class Be extends EventTarget{constructor(i,t){super();var e,n=this;if((e=Fe).has(n))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(this),this.fpdInstance=i,this.container=document.createElement("fpd-module-save-load"),t.append(this.container),this.inputElem=this.container.querySelector("input"),this.gridElem=this.container.querySelector(".fpd-grid"),u(this.container.querySelector(".fpd-btn"),"click",t=>{var e=Vt(this.fpdInstance.currentViewInstance.options.stageWidth,this.fpdInstance.currentViewInstance.options.stageHeight,300,300,"cover");i.viewInstances[0].toDataURL(e=>{var t=this.fpdInstance.getProduct(),e={thumbnail:e,product:t,title:this.inputElem.value||""};if(t&&this.fpdInstance.mainOptions.saveActionBrowserStorage){let t=Le(this,Fe,je).call(this);t=t||[],this.addSavedProduct(e),t.push(e),window.localStorage.setItem(this.fpdInstance.container.id,JSON.stringify(t)),l(this.fpdInstance.translator.getTranslation("misc","product_saved"))}t&&(this.fpdInstance.dispatchEvent(new CustomEvent("actionSave",{detail:e})),this.fpdInstance.doUnsavedAlert=!1)},{multiplier:e,format:"png",backgroundColor:"transparent"})}),this.fpdInstance.mainOptions.saveActionBrowserStorage&&(n=Le(this,Fe,je).call(this))&&0{this.addSavedProduct(t)})}addSavedProduct(t){var{thumbnail:t,product:e,title:i=""}=t;const n=mt({url:t,title:i,removable:!0,disablePrice:!0,disableDraggable:!0});return this.fpdInstance.lazyBackgroundObserver.observe(n.querySelector("picture")),n.product=e,this.gridElem.append(n),u(n,"click",t=>{this.fpdInstance.loadProduct(n.product),this.fpdInstance.currentProductIndex=-1}),u(n.querySelector(".fpd-delete"),"click",t=>{t.stopPropagation();var e,t=t.currentTarget.parentNode,i=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t);this.fpdInstance.mainOptions.saveActionBrowserStorage&&((e=Le(this,Fe,je).call(this)).splice(i,1),window.localStorage.setItem(this.fpdInstance.container.id,JSON.stringify(e))),this.fpdInstance.dispatchEvent(new CustomEvent("actionLoad:Remove",{detail:{index:i,item:t}})),t.remove()}),n}}function je(){return!!m()&&JSON.parse(window.localStorage.getItem(this.fpdInstance.container.id))}function Re(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}window.FPDSaveLoadModule=Be;var Ne=new WeakSet;class He extends EventTarget{constructor(e){super();var t=this,i=Ne;if(i.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");i.add(this),Re(this,"currentActions",{}),this.fpdInstance=e,this.container=document.createElement("fpd-actions-bar"),e.container.append(this.container),this.leftActionsMenu=this.container.querySelector('[data-pos="left"] fpd-actions-menu'),this.leftActionsMenu.setAttribute("placeholder",this.fpdInstance.translator.getTranslation("actions","menu_file")),this.centerActionsMenu=this.container.querySelector('[data-pos="center"] fpd-actions-menu'),this.rightActionsMenu=this.container.querySelector('[data-pos="right"] fpd-actions-menu'),this.rightActionsMenu.setAttribute("placeholder",this.fpdInstance.translator.getTranslation("actions","menu_more")),u(e.container.querySelectorAll(".fpd-close"),"click",t=>{d(this.fpdInstance.modalWrapper,["fpd-show"]),this.fpdInstance.dispatchEvent(new CustomEvent("modalDesignerClose"))}),u(e.container.querySelector(".fpd-done"),"click",t=>{this.fpdInstance.dispatchEvent(new CustomEvent("modalDesignerDone"))}),u(e,["viewSelect"],t=>{this.reset()}),u(window,"resize",t=>{e.inTextField||this.reset()}),u(window,["resize","fpdModalDesignerOpen"],()=>{this.leftActionsMenu&&this.leftActionsMenu.toggleMenus(),this.rightActionsMenu&&this.rightActionsMenu.toggleMenus()}),this.setup(e.mainOptions.actions)}addActionBtn(t,e){let i=2{var e=t.currentTarget.querySelector(".fpd-switch");e&&!t.target.classList.contains("fpd-switch")&&(e.checked=!e.checked),this.doAction(t.currentTarget.dataset.action)},t.items=[...t.items,n];else{const i=document.createElement("div");i.className="fpd-btn fpd-tooltip",i.setAttribute("aria-label",s),i.dataset.action=e,i.innerHTML=`${s}`,He.toggleActions.includes(e)&&i.insertAdjacentHTML("beforeend",''),t.append(i),u(i,"click",t=>{var e=t.currentTarget.querySelector(".fpd-switch");e&&!t.target.classList.contains("fpd-switch")&&(e.checked=!e.checked),this.doAction(t.currentTarget.dataset.action)})}}}doAction(e){if(this.fpdInstance.currentViewInstance){if(this.fpdInstance.deselectElement(),"print"===e)this.fpdInstance.print();else if("reset-product"===e){var i=a(this.fpdInstance.translator.getTranslation("misc","reset_confirm"),!1,"confirm",this.fpdInstance.container);const e=i.querySelector(".fpd-confirm");e.innerText=this.fpdInstance.translator.getTranslation("actions","reset_product"),u(e,["click"],()=>{this.fpdInstance.loadProduct(this.fpdInstance.productViews),i.remove()})}else if("undo"===e)this.fpdInstance.currentViewInstance.fabricCanvas.undo();else if("redo"===e)this.fpdInstance.currentViewInstance.fabricCanvas.redo();else if("info"===e)a(this.fpdInstance.translator.getTranslation("actions","info_content"),!1,"",this.fpdInstance.container);else if("preview-lightbox"===e)this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=!1,this.fpdInstance.getProductDataURL(t=>{const e=new Image;e.src=t,e.onload=()=>{var t=a('',!0);o(this.fpdInstance,"actionPreviewModalOpen",{modal:t})},this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=this.fpdInstance.mainOptions.rulerFixed,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll()});else if("snap"===e)this.fpdInstance.currentViewInstance.fabricCanvas.snapToGrid=!this.fpdInstance.currentViewInstance.fabricCanvas.snapToGrid,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll();else if("zoom"===e){const a=this.fpdInstance.mainWrapper.container.querySelector(".fpd-zoom-wrapper");if(a)return void a.remove();const e=document.createElement("div"),i=(e.className="fpd-zoom-wrapper fpd-shadow-1",this.fpdInstance.currentViewInstance.fabricCanvas.getZoom()/this.fpdInstance.currentViewInstance.fabricCanvas.responsiveScale),n=document.createElement("fpd-range-slider"),s=(n.className="fpd-progress",n.setAttribute("value",i),n.setAttribute("step",.02),n.setAttribute("min",1),n.setAttribute("max",3),n.onInput=t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setResZoom(Number(t.currentTarget.value))},e.append(n),document.createElement("div"));s.className="fpd-stage-pan fpd-toggle",s.innerHTML='',e.append(s),u(s,"click",t=>{this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas=!this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas,f(s,["fpd-active"],this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas)});var t=document.createElement("div");t.className="fpd-close",t.innerHTML='',e.append(t),u(t,"click",t=>{e&&e.remove()}),this.fpdInstance.mainWrapper.container.append(e)}else if("download"===e){const e=`
@@ -72,16 +72,16 @@
- `,e=a(t,!1,"",this.fpdInstance.container);u(e.querySelectorAll("span[data-value]"),"click",t=>{this.downloadFile(t.currentTarget.dataset.value,e.querySelector(".fpd-switch").checked),e.remove()})}else if("ruler"===t)this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=!this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll();else if("previous-view"===t)this.fpdInstance.selectView(this.fpdInstance.currentViewIndex-1);else if("next-view"===t)this.fpdInstance.selectView(this.fpdInstance.currentViewIndex+1);else if("guided-tour"===t&&this.fpdInstance.guidedTour)this.fpdInstance.guidedTour.start();else if("qr-code"===t){const t=this.fpdInstance.container.querySelector(".fpd-modal-internal"),e=(t&&t.remove(),a("",!1,"",this.fpdInstance.container)),s=new Pe(this.fpdInstance,e.querySelector(".fpd-modal-content"));this.fpdInstance.translator.translateArea(e),u(s,"qrCodeModuleBtnClick",()=>{e.remove()})}else if("save-load"===t){const t=this.fpdInstance.container.querySelector(".fpd-modal-internal"),e=(t&&t.remove(),a("",!1,"",this.fpdInstance.container));new Fe(this.fpdInstance,e.querySelector(".fpd-modal-content")),this.fpdInstance.translator.translateArea(e)}o(this.fpdInstance,"actionClick",{action:t})}}downloadFile(e){let a=1{_e()(t,o+"."+e,"image/"+e)},{format:e,backgroundColor:t,watermarkImg:this.fpdInstance.watermarkImg}):this.fpdInstance.getProductDataURL(t=>{_e()(t,o+"."+e,"image/"+e)},{format:e,backgroundColor:t})):"svg"===e?_e()(this.fpdInstance.currentViewInstance.toSVG({suppressPreamble:!1,watermarkImg:this.fpdInstance.watermarkImg}),"Product_"+this.fpdInstance.currentViewIndex+".svg","image/svg+xml"):(n="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js",new Promise(function(t,e){var i;null===document.querySelector("script[src='"+n+"']")?((i=document.createElement("script")).onload=()=>{t()},i.onerror=()=>{e()},i.src=n,document.body.appendChild(i)):t()}).then(()=>{var t=e=>{let i;e="string"==typeof e?[e]:e;for(let t=0;t{t.checked=!1}),this.fpdInstance.mainWrapper.container.querySelector(".fpd-zoom-wrapper"));t&&t.remove(),this.fpdInstance.currentViewInstance&&this.fpdInstance.currentViewInstance.fabricCanvas.setResZoom(1)}setup(){var t=0{t.items=[]});for(const e in t)!function(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}(this,Ne,ze).call(this,e,t[e])}this.fpdInstance.translator.translateArea(this.container)}}function ze(i,t){Array.isArray(t)&&t.length?t.forEach(t=>{let e;"left"==i?e=this.leftActionsMenu:"center"==i?e=this.centerActionsMenu:"right"==i&&(e=this.rightActionsMenu),e&&this.addActionBtn(e,t,!0)}):"left"!=i&&"right"!=i||p(this.container.querySelector('[data-pos="'+i+'"]'),["fpd-visible-hidden"])}function We(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Ue(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}Re(He,"toggleActions",["snap","ruler","zoom"]),Re(He,"availableActions",{print:{icon:"fpd-icon-print",title:"Print"},"reset-product":{icon:"fpd-icon-reset",title:"Reset Product"},undo:{icon:"fpd-icon-undo",title:"Undo"},redo:{icon:"fpd-icon-redo",title:"Redo"},info:{icon:"fpd-icon-info",title:"Info"},zoom:{icon:"fpd-icon-zoom-in",title:"Zoom"},download:{icon:"fpd-icon-download",title:"Download"},"preview-lightbox":{icon:"fpd-icon-preview-lightbox",title:"Preview Lightbox"},ruler:{icon:"fpd-icon-ruler",title:"Ruler"},"previous-view":{icon:"fpd-icon-back",title:"Previous View"},"next-view":{icon:"fpd-icon-forward",title:"Next View"},"guided-tour":{icon:"fpd-icon-guided-tour",title:"Guided Tour"},"qr-code":{icon:"fpd-icon-qrcode",title:"QR-Code"},"save-load":{icon:"fpd-icon-save",title:"Saved Designs"}}),window.FPDActions=He;var Ve=new WeakSet,Ye=new WeakSet;class qe extends HTMLElement{constructor(){super(),We(this,Ye),We(this,Ve),this.items=[]}connectedCallback(){this.innerHTML='
',this.uncollapsedMenu=this.querySelector(".fpd-uncollapsed-menu"),this.collapsedMenu=this.querySelector(".fpd-collapsed-menu"),this.collapsedMenu.querySelector(".fpd-dropdown-btn > i").className=this.dataset.fontIcon||"",u(this.collapsedMenu.querySelectorAll(".fpd-dropdown-btn"),"click",t=>{t=t.currentTarget.querySelector(".fpd-dropdown-menu");g(t,["fpd-show"],!t.classList.contains("fpd-show"))})}static get observedAttributes(){return["items","placeholder"]}attributeChangedCallback(t,e,i){e!==i&&"placeholder"==t&&this.collapsedMenu&&(this.collapsedMenu.querySelector(".fpd-dropdown-btn > .fpd-label").innerText=i)}get items(){return this._items}set items(t){this._items=t,Ue(this,Ve,Ge).call(this)}toggleMenus(){this.isConnected&&this.uncollapsedMenu&&(d(this.uncollapsedMenu,["fpd-hidden"]),(this.uncollapsedMenu.offsetWidth>this.offsetWidth&&!this.classList.contains("fpd-only-uncollapsed")?(p(this.uncollapsedMenu,["fpd-visible-hidden"]),p(this.uncollapsedMenu,["fpd-hidden"]),d):(d(this.uncollapsedMenu,["fpd-visible-hidden"]),p))(this.collapsedMenu,["fpd-hidden"]))}}function Ge(){Ue(this,Ye,Xe).call(this),this._items.forEach(t=>{var e=document.createElement("div"),i=(e.className="fpd-btn fpd-tooltip",e.setAttribute("aria-label",t.title),e.dataset.action=t.type,e.innerHTML=`${t.title}`,He.toggleActions.includes(t.type)&&e.insertAdjacentHTML("beforeend",''),this.uncollapsedMenu.append(e),e.cloneNode(!0));this.collapsedMenu.querySelector(".fpd-dropdown-menu").append(i),u([e,i],"click",t.handler)}),this.toggleMenus()}function Xe(){this.isConnected&&this.uncollapsedMenu&&(this.uncollapsedMenu.innerHTML="",this.collapsedMenu.querySelector(".fpd-dropdown-menu").innerHTML="")}customElements.define("fpd-actions-menu",qe);class Ze extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='
'}}customElements.define("fpd-main-bar",Ze);class Je extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='
'}}function Qe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Ke(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-products",Je);var $e=new WeakSet,ti=new WeakSet;class ei extends EventTarget{constructor(t,e){var i,n;super(),Qe(this,ti),Qe(this,$e),n=i="currentCategoryIndex",(i=String(n))in this?Object.defineProperty(this,i,{value:0,enumerable:!0,configurable:!0,writable:!0}):this[i]=0,this.fpdInstance=t,this.container=document.createElement("fpd-module-products"),e.append(this.container),t.addEventListener("productsSet",t=>{const n=this.container.querySelector(".fpd-dropdown-list > .fpd-scroll-area");n.innerHTML="",this.fpdInstance.products&&0{var i=document.createElement("span");i.className="fpd-item",i.dataset.index=e,i.innerText=t.category,i.addEventListener("click",t=>{this.selectCategory(t.currentTarget.dataset.index)}),n.append(i)})),Ke(this,$e,ii).call(this),this.selectCategory(0))}),t.addEventListener("productAdd",(t,e,i,n)=>{n==this.currentCategoryIndex&&Ke(this,ti,ni).call(this,e)})}selectCategory(){var e=0{Ke(this,ti,ni).call(this,t,e)})}}}function ii(){if(!this.fpdInstance.mainOptions.editorMode){let t=this.fpdInstance.products[0],e=void 0===t;void 0!==t&&(e=!!(!t.hasOwnProperty("category")&&this.fpdInstance.products.length<2||t.hasOwnProperty("category")&&t.products.length<2&&this.fpdInstance.products.length<2)),this.fpdInstance.container.classList.toggle("fpd-products-module-hidden",e);var i=this.fpdInstance.mainBar.navElem.querySelector(".fpd-active");e&&i&&"products"==i.dataset.module&&i.nextSibling&&i.nextSibling.click()}}function ni(t,i){var e=t[0].productThumbnail||t[0].thumbnail,t=t[0].productTitle||t[0].title,n=document.createElement("div"),t=(n.className="fpd-item fpd-hover-thumbnail",n.dataset.title=t,n.dataset.source=e,n.dataset.index=i,n.addEventListener("click",t=>{if(t.preventDefault(),this.fpdInstance.mainOptions.swapProductConfirmation){var e=a(this.fpdInstance.translator.getTranslation("modules","products_confirm_replacement"),!1,"confirm",this.fpdInstance.container);const t=e.querySelector(".fpd-confirm");t.innerText=this.fpdInstance.translator.getTranslation("modules","products_confirm_button"),u(t,["click"],()=>{this.fpdInstance.selectProduct(i,this.currentCategoryIndex),e.remove()})}else this.fpdInstance.selectProduct(Number(t.currentTarget.dataset.index),this.currentCategoryIndex)}),this.container.querySelector(".fpd-grid").append(n),document.createElement("picture"));t.dataset.img=e,n.append(t),this.fpdInstance.lazyBackgroundObserver.observe(t)}window.FPDProductsModule=ei;class si extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='
'}}function oi(t,e){ci(t,e),e.add(t)}function li(t,e,i){ci(t,e),e.set(t,i)}function ci(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hi(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}function S(t,e){return(e=ui(t=t,e,"get")).get?e.get.call(t):e.value}function di(t,e,i){var n=t,t=ui(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function ui(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}customElements.define("fpd-module-designs",ai);var pi=new WeakMap,fi=new WeakMap,gi=new WeakMap,mi=new WeakMap,vi=new WeakMap,bi=new WeakSet,yi=new WeakSet,xi=new WeakSet,wi=new WeakSet;class Ci extends EventTarget{constructor(i,t){var e=2{var e=t.currentTarget,i=this.gridElem.querySelectorAll(".fpd-item");if(""==e.value)for(var n of i)n.classList.remove("fpd-hidden");else{const t=e.value.toLowerCase().trim();for(var s of i)s.classList.add("fpd-hidden"),s.dataset.search.includes(t)&&s.classList.remove("fpd-hidden")}}),u(this.headElem.querySelector(".fpd-back"),"click",t=>{0{e=i[t],i=e.category}),di(this,mi,i),i&&hi(this,bi,Si).call(this,S(this,mi),e),void 0===e&&this.toggleCategories()});let n=!1;u(i,["designsSet"],t=>{var e;n||(n=!0,e=i.designs,Array.isArray(e)&&0!==e.length&&(e[0].hasOwnProperty("source")?(this.container.classList.add("fpd-single-cat"),hi(this,xi,Ei).call(this,e)):1{this.toggleCategories()})}toggleCategories(){if(S(this,fi)){di(this,gi,[]),this.container.classList.remove("fpd-head-visible","fpd-single-cat"),di(this,mi,this.fpdInstance.designs),hi(this,bi,Si).call(this,S(this,mi));let t=[];if("string"==typeof S(this,vi))t=this.fpdInstance.mainOptions.dynamicDesigns[S(this,vi)].categories;else if(this.fpdInstance.currentViewInstance){const e=this.fpdInstance.currentElement;t=(e&&e.uploadZone&&e.designCategories?this.fpdInstance.currentElement:this.fpdInstance.currentViewInstance.options).designCategories}t=t.map(t=>t.toLowerCase());var e=this.container.querySelectorAll(".fpd-category");if(0{hi(this,yi,Ti).call(this,t)}),e&&(this.headElem.querySelector(".fpd-input-search input").setAttribute("placeholder",S(this,pi)+" "+e.title.toUpperCase()),this.container.classList.add("fpd-head-visible"))}function Ti(t){var e,i=document.createElement("div");i.className="fpd-category fpd-item",i.dataset.title=t.title,i.dataset.search=t.title.toLowerCase(),t.thumbnail?((e=document.createElement("picture")).dataset.img=t.thumbnail,i.append(e),this.fpdInstance.lazyBackgroundObserver.observe(e),(e=document.createElement("span")).innerText=t.title,i.append(e)):i.innerHTML=""+t.title+"",i.addEventListener("click",t=>{var t=t.currentTarget,e=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t),i=S(this,mi)[e];i.category?(S(this,gi).push(e),di(this,mi,i.category),hi(this,bi,Si).call(this,S(this,mi),i)):hi(this,xi,Ei).call(this,i.designs,i.parameters),this.headElem.querySelector(".fpd-input-search input").setAttribute("placeholder",S(this,pi)+" "+t.dataset.search.toUpperCase())}),this.gridElem.append(i)}function Ei(t){let e=1{t.parameters=h(e,t.parameters),hi(this,wi,Ai).call(this,t)})}function Ai(t){t.thumbnail=void 0===t.thumbnail?t.source:t.thumbnail;var e=vt(this.fpdInstance,this.container,t.parameters.price),e=mt({url:t.source,thumbnailUrl:t.thumbnail,title:t.title,price:e,disablePrice:!Boolean(e)});e.dataset.search=t.title.toLowerCase(),e.parameters=t.parameters,e.addEventListener("click",t=>{t=t.currentTarget;this.fpdInstance.addCanvasDesign(t.dataset.source,t.dataset.title,t.parameters)}),this.gridElem.append(e),this.fpdInstance.lazyBackgroundObserver.observe(e.querySelector("picture"))}window.FPDDesignsModule=Ci;class Oi extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='