1import{C as l,P as n}from"./oetztal-BUFsW861.js";import"./vendor-MwKjB1ew.js";import"./vendor-gsap-BSG2lN8u.js";import"./vendor-swiper-Cecjjgdk.js";import"./vendor-leaflet-CzxBtgpa.js";import"./[email protected]";class d extends l{run(){this.bind(),this.config.modalId&&this.config.productCollectionId&&this.setListeners()}bind(){this.config=JSON.parse(this.element.dataset.productConfiguratorToggle||"{}"),this.config={modalId:"modal:configurator",selector:".product-configurator",...this.config}}setListeners(){this.element.addEventListener("click",e=>{var i,s;e.preventDefault();const o=(s=(i=this.config.configurator)==null?void 0:i.update)==null?void 0:s.url;if(o){fetch(o,{method:"POST"}).then(t=>t.json()).then(t=>{var r,a;if(!t.success){console.error("Failed to fetch configurator data:",t.message),this.dispatchError(t.message);return}const c=t.configuratorData;window.dispatchEvent(new CustomEvent(n.UPDATE_CONFIGURATION,{detail:{configuration:c,options:(a=(r=this.config.configurator)==null?void 0:r.update)==null?void 0:a.options}})),requestAnimationFrame(()=>{this.openModal()})}).catch(t=>{console.log(t),this.dispatchError()});return}this.openModal()})}openModal(){window.App.ModalManager.openModal(this.config.modalId,null,d.closeValidationModal.bind(this)),window.setTimeout(()=>{window.dispatchEvent(new CustomEvent(n.CHANGE_ACTIVE_PRODUCT_COLLECTION,{detail:{id:String(this.config.productCollectionId)}}))},100)}static closeValidationModal(){window.dispatchEvent(new CustomEvent(n.CLOSE_ALL_MODAL_DIALOGS))}dispatchError(e=null){var o,i;window.dispatchEvent(new CustomEvent(n.UPDATE_CONFIGURATION_ERROR,{detail:{message:e,options:(i=(o=this.config.configurator)==null?void 0:o.update)==null?void 0:i.options}}))}}export{d as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.