PageSourceSearch

https://gigant.at/theme/1df75a6383325d8a673a2f90414185c7/js/dvsn-s…ator.dvsn-set-configurator.plugin.46db49.js

js gigant.at collected 2026-10-07 22:00:53 UTC 56,857 bytes, 135 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[11253],{253(t,e,i){i.r(e),i.d(e,{default:()=>W});let r="loader",s={BEFORE:"before",INNER:"inner"};class a{constructor(t,e=s.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}create(){if(!this.exists()){if(this.position===s.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=a.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),a.getTemplate())}}remove(){if(this.position===s.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${r}`).forEach(t=>t.remove())}exists(){return this.parent.querySelectorAll(`.${r}`).length>0}_getPosition(){return this.position===s.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${r}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return r}}class o{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return o.isIPhoneDevice()||o.isIPadDevice()}static isNativeWindowsBrowser(){return o.isIEBrowser()||o.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":o.isTouchDevice(),"is-ios":o.isIOSDevice(),"is-native-windows":o.isNativeWindowsBrowser(),"is-iphone":o.isIPhoneDevice(),"is-ipad":o.isIPadDevice(),"is-ie":o.isIEBrowser(),"is-edge":o.isEdgeBrowser()}}}let n="modal-backdrop",l="modal-backdrop-open",c="no-scroll",u={ON_CLICK:"backdrop/onclick"};class d{constructor(){return d.instance||(d.instance=this),d.instance}create(t){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let e=document.body.lastChild;document.documentElement.classList.add(c),setTimeout(function(){e.classList.add(l),"function"==typeof t&&t()},75),this._dispatchEvents()}remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;this._getBackdrops().forEach(t=>t.classList.remove(l)),setTimeout(this._removeExistingBackdrops.bind(this),t),document.documentElement.classList.remove(c)}_dispatchEvents(){let t=o.isTouchDevice()?"touchstart":"click";document.addEventListener(t,function(t){t.target.classList.contains(n)&&document.dispatchEvent(new CustomEvent(u.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${n}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(t=>t.remove())}_exists(){return document.querySelectorAll(`.${n}`).length>0}_getTemplate(){return`<div class="${n}"></div>`}}let p=Object.freeze(new d);class h{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;p.create(t)}static remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;p.remove(t)}static SELECTOR_CLASS(){return n}}let g=Object.freeze(new class extends a{constructor(){super(document.body)}create(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&t&&(h.create(),document.querySelector(`.${h.SELECTOR_CLASS()}`).insertAdjacentHTML("beforeend",a.getTemplate()))}remove(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),t&&h.remove()}});class m{static create(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];g.create(t)}static remove(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];g.remove(t)}}/**
4 * digitvision
5 *
6 * @category  digitvision
7 * @package   Shopware\Plugins\DvsnSetConfigurator
8 * @copyright (c) 2020 digitvision
9 */class v{constructor(){this.product={id:"",number:"",price:0,listPrice:0,weight:0,stock:0,hasDeliveryTime:!1,deliveryTime:null,restockTime:-1},this.configurator={rebate:0,rebateExcludeParent:void 0,rebateThresholdInfo:void 0,rebateThresholdType:"",rebateThresholdValueType:void 0,rebateThresholdValue:0,position:"",summary:void 0,free:void 0,collapsible:void 0},this.price={template:"",pre:"",post:""},this.number={decimalSeparator:"",thousandsSeparator:""},this.info={title:"",url:"",class:"dvsn-set-configurator--product-info"},this.variant={title:"",urlSimple:"",urlConfigurator:"",urlConfiguratorSwitchVariant:"",class:"dvsn-set-configurator--variant-selection"},this.inquiry={landingPageUrl:"",saveSelectionUrl:""},this.rebateInfo={alertSelector:".rebate-alert-container",barSelector:".rebate-bar-container",configurator:{selector:".dvsn-set-configurator-rebate-info-container.rebate-info-configurator"},stream:{selector:".dvsn-set-configurator-rebate-info-container.rebate-info-stream"}},this.snippets={selectable:"",selected:"",summaryEmpty:"",setInfo:"",setInfoRange:"",fromPrice:"",beforeListPrice:"",afterListPrice:"",listPriceSavedPre:"",listPriceSavedPost:"",rebateInfoAlert:{price:{stream
9:{incomplete:"",complete:""},configurator:{incomplete:"",complete:""}},quantity:{stream:{incomplete:"",complete:""},configurator:{incomplete:"",complete:""}},upTo:""}},this.config={hasStockIndicator:!1,showUnitPrices:!1,disableQuantitySelection:!1,disableInputFields:!1,nameOpensModal:!1,treatConfiguratorWithoutConfigurationAsDefaultProduct:!1,showListPrice:"no",showGlobalRebate:"percental",variantSelection:"single",autoChangeCollapsableStream:!1},this.templates={price:{default:'<p class="product-detail-price">{price}</p>',pseudo:'<p class="product-detail-price with-list-price">{price}</p><span class="list-price-badge">%</span><span class="product-detail-list-price-wrapper">{snippet.before-list-price}<span class="list-price-price">{pseudoPrice}</span>{snippet.after-list-price} <span class="list-price-percentage">({snippet.list-price-saved-pre}{rebate}{snippet.list-price-saved-post})</span></span>'}}}}/**
10 * digitvision
11 *
12 * @category  digitvision
13 * @package   Shopware\Plugins\DvsnSetConfigurator
14 * @copyright (c) 2020 digitvision
15 */class S{constructor(t,e){this._plugin=t,this._options=e}toggle(t){let e=t.closest("div.stream");if(!1===e.classList.contains("is--collapsed")){e.classList.add("is--collapsed");return}this._plugin.addClass(this._plugin.el.querySelectorAll("div.stream.is--collapsible:not(.is--collapsed)"),"is--collapsed"),e.classList.remove("is--collapsed"),this._plugin.scrollTo("div.stream.is--collapsible:not(.is--collapsed)")}next(t){if("true"===t.getAttribute("data-set-status")||"true"===t.getAttribute("data-multiple")||"true"===t.getAttribute("data-input-status")||null===t.nextElementSibling)return;let e=t.nextElementSibling;!1!==e.classList.contains("stream")&&!1!==e.classList.contains("is--collapsible")&&e.querySelector("div.header").click()}}/**
16 * digitvision
17 *
18 * @category  digitvision
19 * @package   Shopware\Plugins\DvsnSetConfigurator
20 * @copyright (c) 2020 digitvision
21 */class y{constructor(t,e){this._plugin=t,this._options=e}redirect(){let t=document.querySelectorAll("body .product-detail-buy .dvsn-set-configuration--product-inquiry")[0];fetch(this._options.inquiry.saveSelectionUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({"dvsn-set-configurator--selection":t.querySelector('input[name="dvsn-set-configurator--selection"]').value,"dvsn-set-configurator--product-id":t.querySelector('input[name="dvsn-set-configurator--product-id"]').value,"dvsn-set-configurator--configurator-id":t.querySelector('input[name="dvsn-set-configurator--configurator-id"]').value})}).then(t=>t.text()).then(t=>{let e=JSON.parse(t);if(!1===e.success){window.location.reload();return}window.location.href=this._options.inquiry.landingPageUrl.replace("___key___",e.key).replace("___qty___",this._plugin.getParentQuantity().toString())})}}/**
22 * digitvision
23 *
24 * @category  digitvision
25 * @package   Shopware\Plugins\DvsnSetConfigurator
26 * @copyright (c) 2020 digitvision
27 */class _{constructor(t,e){this._plugin=t,this._options=e}formatPrice(t){return this._options.price.pre+this._formatNumber(t,2)+this._options.price.post}roundPrice(t){return Math.round(100*t)/100}_formatNumber(t,e){t=this.roundPrice(t).toString();let i=(t+=0>t.indexOf(".")?".0":"").split("."),r=i[0],s=i[1];return void 0===s&&(s=""),r=r.toString(),s=(s=s.toString()).padEnd(e,"0"),(r=r.length>3?r.slice(0,r.length-3)+this._options.number.thousandsSeparator+r.slice(-3):r)+this._options.number.decimalSeparator+s}}/**
28 * digitvision
29 *
30 * @category  digitvision
31 * @package   Shopware\Plugins\DvsnSetConfigurator
32 * @copyright (c) 2020 digitvision
33 */class f{constructor(t,e){this._plugin=t,this._options=e}update(){if(1!==document.querySelectorAll("body .dvsn-set-configurator-availability-information").length)return;let t=this._plugin.el,e=document.querySelector("body .dvsn-set-configurator-availability-information");this._plugin.addClass(e.querySelectorAll(".delivery-information-status-container"),"is--hidden");let i=!0;this._options.configurator.stock<1&&(i=!1),t.querySelectorAll("div.product.is--selected").forEach(t=>{!1!==i&&this._plugin.getProductQuantity(t)>this._plugin.getProductStock(t)&&(i=!1)}),!0===i?e.querySelector(".is--available").classList.remove("is--hidden"):e.querySelector(".is--not-available").classList.remove("is--hidden")}}/**
34 * digitvision
35 *
36 * @category  digitvision
37 * @package   Shopware\Plugins\DvsnSetConfigurator
38 * @copyright (c) 2020 digitvision
39 */class b{constructor(t,e){this._plugin=t,this._options=e}update(){}}let A="js-pseudo-modal",q="js-pseudo-modal-template-root-element";class P{constructor(t,e=!0,i=".js-pseudo-modal-template",r=".js-pseudo-modal-template-content-element",s=".js-pseudo-modal-template-title-element"){this._content=t,this._useBackdrop=e,this._templateSelector=i,this._templateContentSelector=r,this._templateTitleSelector=s}open(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:350;this._hideExistingModal(),this._create(),setTimeout(this._open.bind(this,t),e)}close(){let t=this.getModal();this._modalInstance=bootstrap.Modal.getInstance(t),this._modalInstance.hide()}getModal(){return this._modal||this._create(),this._modal}updatePosition(){this._modalInstance.handleUpdate()}updateContent(t,e){this._content=t,this._setModalContent(t),this.updatePosition(),"function"==typeof e&&e.bind(this)()}_hideExistingModal(){try{let t=document.querySelector(`.${A} .modal`);if(!t)return;let e=bootstrap.Modal.getInstance(t);if(!e)return;e.hide()}catch(t){console.warn(`[PseudoModalUtil] Unable to hide existing pseudo modal before opening pseudo modal: ${t.message}`)}}_open(t){this.getModal(),this._modal.addEventListener("hidden.bs.modal",this._modalWrapper.remove),this._modal.addEventListener("shown.bs.modal",t),this._modal.addEventListener("hide.bs.modal",()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()}),this._modalInstance.show()}_create(){this._modalMarkupEl=document.querySelector(this._templateSelector),this._createModalWrapper(),this._modalWrapper.innerHTML=this._content,this._modal=this._createModalMar
39kup(),this._modalInstance=new bootstrap.Modal(this._modal,{backdrop:this._useBackdrop}),document.body.insertAdjacentElement("beforeend",this._modalWrapper)}_createModalWrapper(){this._modalWrapper=document.querySelector(`.${A}`),this._modalWrapper||(this._modalWrapper=document.createElement("div"),this._modalWrapper.classList.add(A))}_createModalMarkup(){let t=this._modalWrapper.querySelector(".modal");if(t)return t;let e=this._modalWrapper.innerHTML;return this._modalWrapper.innerHTML=this._modalMarkupEl.innerHTML,this._setModalContent(e),this._modalWrapper.querySelector(".modal")}_setModalTitle(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{this._modalWrapper.querySelector(this._templateTitleSelector).innerHTML=t}catch(t){}}_setModalContent(t){let e=this._modalWrapper.querySelector(this._templateContentSelector);e.innerHTML=t;let i=e.querySelector(`.${q}`);if(i){this._modalWrapper.querySelector(`.${q}`).replaceChildren(i);return}try{let t=e.querySelector(this._templateTitleSelector);t&&(this._setModalTitle(t.innerHTML),t.parentNode.removeChild(t))}catch(t){}}}/**
40 * digitvision
41 *
42 * @category  digitvision
43 * @package   Shopware\Plugins\DvsnSetConfigurator
44 * @copyright (c) 2020 digitvision
45 */class L{constructor(t,e){this._plugin=t,this._options=e}click(t){let e=t.closest(".stream");if(!t.classList.contains("is--fully-selectable")){if(e.classList.contains("is--template-list")){if("info"===e.getAttribute("data-display-list-click-behaviour")){if(t.classList.contains("is--empty-choice"))return;this.open(t.getAttribute("data-id"));return}t.querySelector(".selector input.is--selector-input").click();return}t.classList.contains("is--empty-choice")||this.open(t.getAttribute("data-id"))}}open(t){m.create(),fetch(this._options.info.url.replace("__productId__",t),{method:"GET",headers:{"Content-Type":"application/json"}}).then(t=>t.text()).then(e=>{this._openProductInfoModal(e,t)})}_openProductInfoModal(t,e){let i=new P(t);m.remove(),i.open(function(){}),i.getModal().classList.add(this._options.info.class)}}/**
46 * digitvision
47 *
48 * @category  digitvision
49 * @package   Shopware\Plugins\DvsnSetConfigurator
50 * @copyright (c) 2020 digitvision
51 */class E{constructor(t,e){this._plugin=t,this._options=e}has(t){return t.classList.contains("has--input")}get(t){return t.querySelectorAll("input.is--input").length<1?"":t.querySelector("input.is--input").value.toString().split(":").join("--colon--").split(",").join("--comma--")}update(){this._plugin.el.querySelectorAll("div.stream div.product div.input-container .is--input").forEach(t=>{t.disabled=!0}),this._plugin.el.querySelectorAll("div.stream div.product.is--selected div.input-container .is--input").forEach(t=>{t.disabled=!1})}change(t){let e=t.closest(".stream");t.classList.remove("has--input-warning"),0===e.querySelectorAll("div.product.has--input-warning").length&&e.classList.remove("has--input-warning")}}/**
52 * digitvision
53 *
54 * @category  digitvision
55 * @package   Shopware\Plugins\DvsnSetConfigurator
56 * @copyright (c) 2020 digitvision
57 */class w{constructor(t,e){this._plugin=t,this._options=e}update(){this._updatePrices(),this._updatePercentalSurchages(),this._updateRelativePrices()}getFlatSum(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0],e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i={price:0,pseudoPrice:0};return!0===t&&(i.price+=this._options.product.price*((100-this._plugin.getParentRebate())/100),i.pseudoPrice+=this._options.product.listPrice>0?this._options.product.listPrice:this._options.product.price),this._plugin.el.querySelectorAll("div.stream").forEach(t=>{let r=this.getFlatStreamSum(t,e);i.price+=r.price,i.pseudoPrice+=r.pseudoPrice}),i}getFlatStreamSum(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!1===this._plugin.isStreamVisible(t))return{price:0,pseudoPrice:0};let i=0,r=0;return t.querySelectorAll("div.product.is--selected").forEach(t=>{if("true"===t.getAttribute("data-is-percental-surcharge"))return;let s=t.closest("div.stream"),a=!0===e?this._plugin.getStreamRebate(s):0,o=this.getPrices(t),n=this._plugin.getProductQuantity(t);i+=this.getPrice(t,n,a);let l=this.getPrice(t,n,0);if("no"!==this._options.config.showListPrice){let t=this._plugin.getProductListPrice(o,n);t>0&&(l=t)}r+=l}),{price:i,pseudoPrice:r}}getSurchargeStreamSum(t,e){if(!1===this._plugin.isStreamVisible(t))return{price:0,pseudoPrice:0};let i=0,r=0;return t.querySelectorAll('div.product.is--selected[data-is-percental-surcharge="true"]').forEach(t=>{let s=this._plugin.getProductQuantity(t);i+=this._plugin.roundPrice(e.price*(parseInt(t.getAttribute("data-percental-surcharge-value"),10)/100))*s,r+=this._plugin.roundPrice(e.pseudoPrice*(parseInt(t.getAttribute("data-percental-surcharge-value"),10)/100))*s}),{price:i,pseudoPrice:r}}getSurchargeSum(t){let e={price:0,pseudoPrice:0};return this._plugin.el.querySelectorAll("div.stream").forEach(i=>
57{let r=this.getSurchargeStreamSum(i,t);e.price+=r.price,e.pseudoPrice+=r.pseudoPrice}),e}getPrice(t,e,i){return this._getPriceForQuantity(this.getPrices(t),e,i)}getDisplayPrice(t,e,i){return this._getPriceForQuantity(this.getDisplayPrices(t),e,i)}getPrices(t){return this._getPricesArray(t,"prices")}getDisplayPrices(t){return this._getPricesArray(t,"prices-display")}getListPrice(t,e){for(let i in t)if(0===t[i].to||e>=t[i].from&&e<=t[i].to)return this._plugin.roundPrice(e*this._plugin.roundPrice(parseFloat(t[i].listPrice)));return this._plugin.roundPrice(e*this._plugin.roundPrice(parseFloat(t[0].listPrice)))}_getPriceForQuantity(t,e,i){for(let r in t)if(0===t[r].to||e>=t[r].from&&e<=t[r].to)return this._plugin.roundPrice(e*this._plugin.roundPrice(parseFloat(t[r].price)*((100-i)/100)));return this._plugin.roundPrice(e*this._plugin.roundPrice(parseFloat(t[0].price)*((100-i)/100)))}_getPricesArray(t,e){return"string"==typeof t.getAttribute("data-"+e)?JSON.parse(t.getAttribute("data-"+e)):t.getAttribute("data-"+e)}_updatePrices(){this._plugin.el.querySelectorAll("div.stream div.product").forEach(t=>{if(!0===this._plugin.isPercentalSurcharge(t))return;let e=t.closest("div.stream"),i=this._plugin.getStreamRebate(e),r=!0===this._options.config.showUnitPrices?1:this._plugin.getProductQuantity(t),s=this.getDisplayPrices(t),a=this.getDisplayPrice(t,r,i),o=this._plugin.formatPrice(a);if("true"===t.getAttribute("data-is-variant")&&"true"===t.getAttribute("data-is-parent")&&!1===t.classList.contains("is--selected")&&(o=this._options.snippets.fromPrice+" "+o),t.querySelector(".price").innerHTML=o,"no"===this._options.config.showListPrice)return;let n=this._plugin.getProductListPrice(s,r);if(0===n&&"yesAlways"===this._options.config.showListPrice&&i>0&&(n=this._plugin.getProductPrice(s,r,0)),0===n){t.querySelector(".price").classList.remove("has--list-price");return}if("true"===t.getAttribute("data-is-variant")&&"true"===t.getAttribute("data-is-parent")&&!1===t.classList.contains("is--selected")){t.querySelector(".price").classList.remove("has--list-price"),t.querySelector(".list-price").innerHTML="";return}o=this._plugin.formatPrice(n),t.querySelector(".list-price").innerHTML=o,t.querySelector(".price").classList.add("has--list-price")})}_updatePercentalSurchages(){let t=this._plugin.el,e=this._plugin.getFlatSum();t.querySelectorAll('div.stream div.product[data-is-percental-surcharge="true"]').forEach(t=>{if("percental"===t.getAttribute("data-percental-surcharge-display")){let e="+ "+t.getAttribute("data-percental-surcharge-value").toString();"true"===t.getAttribute("data-is-variant")&&"true"===t.getAttribute("data-is-parent")&&!1===t.classList.contains("is--selected")&&(e=this._options.snippets.fromPrice+" "+e),t.querySelector(".price").innerHTML=e+"%";return}let i=!0===this._options.config.showUnitPrices?1:this._plugin.getProductQuantity(t),r=e.price*(parseInt(t.getAttribute("data-percental-surcharge-value"),10)/100)*i,s=this._plugin.formatPrice(r);"true"===t.getAttribute("data-is-variant")&&"true"===t.getAttribute("data-is-parent")&&!1===t.classList.contains("is--selected")&&(s=this._options.snippets.fromPrice+" "+s),t.querySelector(".price").innerHTML=s})}_updateRelativePrices(){this._plugin.el.querySelectorAll("div.stream").forEach(t=>{"false"!==t.getAttribute("data-relative-prices")&&this._recalculateStreamProductPricesForRelativePrices(t)})}_recalculateStreamProductPricesForRelativePrices(t){let e=this._plugin.getStreamRebate(t),i=!1;if(t.querySelectorAll("div.product").forEach(t=>{!0===this._plugin.isPercentalSurcharge(t)&&(i=!0)}),!0===i)return;let r=0;if("false"===t.getAttribute("data-multiple")&&t.querySelectorAll("div.product.is--selected").length>0){let i=t.querySelector("div.product.is--selected"),s=!0===this._options.config.showUnitPrices?1:this._plugin.getProductQuantity(i);r=this.getDisplayPrice(i,s,e)}t.querySelectorAll("div.product").forEach(i=>{if(!0===this._plugin.isPercentalSurcharge(i))return;if(i.classList.contains("is--selected")){this._plugin.addClass(i.querySelectorAll(".price"),"is--hidden"),(t.classList.contains("is--template-slider")||t.classList.contains("is--template-gallery"))&&this._plugin.addClass(i.querySelectorAll(".stock-indicator"),"is--hidden");return}this._plugin.removeClass(i.querySelectorAll(".price"),"is--hidden"),this._plugin.removeClass(i.querySelectorAll(".stock-indicator"),"is--hidden");let s=!0===this._options.config.showUnitPrices?1:this._plugin.getProductQuantity(i),a=this.getDisplayPrice(i,s,e)-r;i.querySelector(".price").innerHTML=a>0?"+ "+this._plugin.formatPrice(a):0===a?this._plugin.formatPrice(0):"- "+this._plugin.formatPrice(-1*a)})}}/**
58 * digitvision
59 *
60 * @category  digitvision
61 * @package   Shopware\Plugins\DvsnSetConfigurator
62 * @copyright (c) 2020 digitvision
63 */class C{constructor(t,e){this._plugin=t,this._options=e}toggle(t,e){let i=t.closest("div.product"),r=i.closest("div.stream");"false"===r.getAttribute("data-multiple")&&this._plugin.removeClass(r.querySelectorAll("div.product.is--selected"),"is--selected"),!0===e&&i.classList.add("is--selected"),!1===e&&i.classList.remove("is--selected"),this._options.config.autoChangeCollapsableStream&&r.classList.contains("is--collapsible")&&this._plugin.onNextCollapsibleStream(r)}fullySelectableProductClick(t,e){let i=t.target,r=e.closest(".stream"),s=e.querySelector(".selector input.is--selector-input");if(i.classList.contains("is--quantity-select")||i.classList.contains("is--input"))return;if(!0===this._options.config.nameOpensModal&&i.classList.contains("product-info")){if(e.classList.contains("is--empty-choice"))return;this._plugin.openProductInfo(e.getAttribute("data-id"));return}if(r.classList.contains("is--not-selectable"))return;if(r.classList.contains("has--mandatory-warning")&&r.classList.remove("has--mandatory-warning"),e.classList.contains("is--empty-choice")){this._plugin.removeClass(r.querySelectorAll("div.product.is--selected"),"is--selected"),r.querySelectorAll("div.product input.is--selector-input").forEach(function(t){t.checked=!1}
63),t.preventDefault(),this._plugin.updateEverything();return}if("true"===e.getAttribute("data-is-variant")&&"false"===r.getAttribute("data-multiple")&&!0===s.checked);else if("true"===e.getAttribute("data-is-variant")&&("false"===r.getAttribute("data-multiple")||!1===s.checked)){t.preventDefault(),this._plugin.openVariantSelection(r.getAttribute("data-id"),e.getAttribute("data-parent-id"));return}let a=s.checked;s.checked=!a,this._plugin.setInputSelected(s,s.checked),this._plugin.updateEverything()}inputClick(t,e){let i=e.closest(".product"),r=i.closest(".stream");if(r.classList.contains("has--mandatory-warning")&&r.classList.remove("has--mandatory-warning"),i.classList.contains("is--empty-choice")){this._plugin.removeClass(r.querySelectorAll("div.product.is--selected"),"is--selected"),r.querySelectorAll("div.product input.is--selector-input").forEach(function(t){t.checked=!1}),t.preventDefault(),this._plugin.updateEverything();return}if("true"===i.getAttribute("data-is-variant")&&("false"===r.getAttribute("data-multiple")||!0===e.checked)){t.preventDefault(),this._plugin.openVariantSelection(r.getAttribute("data-id"),i.getAttribute("data-parent-id"));return}this._plugin.setInputSelected(e,e.checked),this._plugin.updateEverything()}}/**
64 * digitvision
65 *
66 * @category  digitvision
67 * @package   Shopware\Plugins\DvsnSetConfigurator
68 * @copyright (c) 2020 digitvision
69 */class T{constructor(t,e){this._plugin=t,this._options=e}update(t){if(0===t.querySelectorAll(".stock-indicator").length)return;let e=t.querySelector(".stock-indicator"),i=this._plugin.getProductQuantity(t),r=this._plugin.getProductStock(t);e.classList.remove("bg-info"),e.classList.remove("bg-danger"),e.classList.remove("bg-success"),e.classList.add(r>=i?"bg-success":"bg-danger")}}/**
70 * digitvision
71 *
72 * @category  digitvision
73 * @package   Shopware\Plugins\DvsnSetConfigurator
74 * @copyright (c) 2020 digitvision
75 */class I{constructor(t,e){this._plugin=t,this._options=e}update(){if(!1!==this._options.configurator.rebateThresholdInfo&&!(this._options.configurator.rebateThresholdValue<=0)){if("configurator"===this._options.configurator.rebateThresholdType){this._updateConfigurator();return}this._updateStreams()}}_updateConfigurator(){document.querySelectorAll(this._options.rebateInfo.configurator.selector).length<1||this._updateContainer(document.querySelector(this._options.rebateInfo.configurator.selector),this._plugin.rebateService.isParentRebateTresholdComplete(),"quantity"===this._options.configurator.rebateThresholdValueType?this._plugin.rebateService._countSelectedProducts():this._plugin.productPriceService.getFlatSum(!1,!1).price,"configurator")}_updateStreams(){this._plugin.el.querySelectorAll("div.stream").forEach(t=>{t.querySelectorAll(this._options.rebateInfo.stream.selector).length<1||this._updateContainer(t.querySelector(this._options.rebateInfo.stream.selector),this._plugin.rebateService.isStreamRebateTresholdComplete(t),"quantity"===this._options.configurator.rebateThresholdValueType?this._plugin.rebateService._countStreamSelectedProducts(t):this._plugin.productPriceService.getFlatStreamSum(t,!1).price,"stream")})}_updateContainer(t,e,i,r){let s=t.getAttribute("data-rebate").toString(),a=this._options.configurator.rebateThresholdValue-i;if(t.querySelectorAll(this._options.rebateInfo.alertSelector).length>0){let i=t.querySelector(this._options.rebateInfo.alertSelector).querySelector(".alert");!0===e?(i.classList.remove("alert-info"),i.classList.add("alert-success")):(i.classList.remove("alert-success"),i.classList.add("alert-info"));let o=!0===e?this._options.snippets.rebateInfoAlert[this._options.configurator.rebateThresholdValueType][r].complete:this._options.snippets.rebateInfoAlert[this._options.configurator.rebateThresholdValueType][r].incomplete,n="true"===t.getAttribute("data-rebate-range")?this._options.snippets.rebateInfoAlert.upTo:"";o=o.replace("#rebate#",n+s),o="quantity"===this._options.configurator.rebateThresholdValueType?o.replace("#missing-value#",a.toString()):o.replace("#missing-value#",this._plugin.formatPrice(this._plugin.roundPrice(a.toString()))),i.querySelector(".alert-content-container").innerHTML=o}if(t.querySelectorAll(this._options.rebateInfo.barSelector).length>0){let i=t.querySelector(this._options.rebateInfo.barSelector).querySelector(".bar-progress"),r=100-Math.round(a/this._options.configurator.rebateThresholdValue*100);r<1&&(r=0),r>
7599&&(r=100),i.style.width=r+"%",!0===e?(i.classList.remove("is--incomplete"),i.classList.add("is--complete")):(i.classList.remove("is--complete"),i.classList.add("is--incomplete"))}}}/**
76 * digitvision
77 *
78 * @category  digitvision
79 * @package   Shopware\Plugins\DvsnSetConfigurator
80 * @copyright (c) 2020 digitvision
81 */class k{constructor(t,e){this._plugin=t,this._options=e}getParentRebate(){return!0===this._options.configurator.rebateExcludeParent?0:this._options.configurator.rebateThresholdValue<1||"stream"===this._options.configurator.rebateThresholdType?parseInt(this._options.configurator.rebate,10):!1===this.isParentRebateTresholdComplete()?0:parseInt(this._options.configurator.rebate,10)}isParentRebateTresholdComplete(){return!(("quantity"===this._options.configurator.rebateThresholdValueType?this._countSelectedProducts():this._plugin.productPriceService.getFlatSum(!1,!1).price)<this._options.configurator.rebateThresholdValue)}getStreamRebate(t){return this._options.configurator.rebateThresholdValue<1?parseInt(t.getAttribute("data-rebate"),10):!1===this.isStreamRebateTresholdComplete(t)?0:parseInt(t.getAttribute("data-rebate"),10)}isStreamRebateTresholdComplete(t){return"configurator"===this._options.configurator.rebateThresholdType?this.isParentRebateTresholdComplete():!(("quantity"===this._options.configurator.rebateThresholdValueType?this._countStreamSelectedProducts(t):this._plugin.productPriceService.getFlatStreamSum(t,!1).price)<this._options.configurator.rebateThresholdValue)}_countSelectedProducts(){let t=0;return this._plugin.el.querySelectorAll("div.stream").forEach(e=>{t+=this._countStreamSelectedProducts(e)}),t}_countStreamSelectedProducts(t){let e=0;return t.querySelectorAll("div.product.is--selected").forEach(t=>{this._plugin.isPercentalSurcharge(t)||(e+=this._plugin.getProductQuantity(t))}),e}}/**
82 * digitvision
83 *
84 * @category  digitvision
85 * @package   Shopware\Plugins\DvsnSetConfigurator
86 * @copyright (c) 2020 digitvision
87 */class M{constructor(t,e){this._plugin=t,this._options=e}get(){let t=this._plugin,e=this._plugin.el,i=[];return e.querySelectorAll("div.product input.is--selector-input:checked").forEach(function(e){let r=e.closest(".product"),s=r.closest(".stream");!1!==t.isStreamVisible(s)&&i.push(s.getAttribute("data-id").toString()+":"+r.getAttribute("data-parent-id").toString()+":"+r.getAttribute("data-id").toString()+":"+t.getProductQuantity(r).toString()+":"+(t.hasInput(s)?t.getProductInput(r):""))}),i.join(",")}set(t){let e=this._plugin;document.querySelectorAll("input.dvsn-set-configurator--selection").forEach(function(e){e.value=t}),document.querySelectorAll("input.dvsn-set-configurator--quantity").forEach(function(t){t.value=e.getParentQuantity()})}}class V{static debounce(t,e){let i,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var s=arguments.length,a=Array(s),o=0;o<s;o++)a[o]=arguments[o];r&&!i&&setTimeout(t.bind(t,...a),0),clearTimeout(i),i=setTimeout(t.bind(t,...a),e)}}}class D{constructor(){this.previousViewport=null,this.currentViewport=D.getCurrentViewport(),this._registerEvents()}_registerEvents(){window.addEventListener("DOMContentLoaded",this._onDOMContentLoaded.bind(this)),window.addEventListener("resize",V.debounce(this._onResize.bind(this),200),{capture:!0,passive:!0})}_onDOMContentLoaded(){this._dispatchEvents()}_onResize(){this._viewportHasChanged(D.getCurrentViewport())&&(this._dispatchEvents(),this._dispatchViewportEvent("Viewport/hasChanged"))}_dispatchEvents(){D.isXS()?this._dispatchViewportEvent("Viewport/isXS"):D.isSM()?this._dispatchViewportEvent("Viewport/isSM"):D.isMD()?this._dispatchViewportEvent("Viewport/isMD"):D.isLG()?this._dispatchViewportEvent("Viewport/isLG"):D.isXL()?this._dispatchViewportEvent("Viewport/isXL"):D.isXXL()&&this._dispatchViewportEvent("Viewport/isXXL")}_viewportHasChanged(t){let e=t!==this.currentViewport;return e&&(this.previousViewport=this.currentViewport,this.currentViewport=t),e}_dispatchViewportEvent(t){document.$emitter.publish(t,{previousViewport:this.previousViewport})}static isXS(){return"XS"===D.getCurrentViewport()}static isSM(){return"SM"===D.getCurrentViewport()}static isMD(){return"MD"===D.getCurrentViewport()}static isLG(){return"LG"===D.getCurrentViewport()}static isXL(){return"XL"===D.getCurrentViewport()}static isXXL(){return"XXL"===D.getCurrentViewport()}static getCurrentViewport(){return window.getComputedStyle(document.documentElement).getPropertyValue("--sw-current-breakpoint").replace(/['"]+/g,"").toUpperCase()}}/**
88 * digitvision
89 *
90 * @category  digitvision
91 * @package   Shopware\Plugins\DvsnSetConfigurator
92 * @copyright (c) 2020 digitvision
93 */class R{constructor(t,e){this._plugin=t,this._options=e}update(){let t=this._plugin.el;t.querySelectorAll('div.stream[data-condition-status="true"]').forEach(e
93=>{let i=e.getAttribute("data-condition-visibility"),r="string"==typeof e.getAttribute("data-condition-conditions")?JSON.parse(e.getAttribute("data-condition-conditions")):e.getAttribute("data-condition-conditions"),s=!1;if(r.forEach(function(i){!0!==s&&t.querySelectorAll("div.stream").forEach(t=>{if(t.classList.contains("is--visibility-disabled")||t.classList.contains("is--visibility-hidden")||t.getAttribute("data-id")===e.getAttribute("data-id")||null!==i.streamId&&i.streamId!==t.getAttribute("data-id"))return;let r=[];switch(i.type){case"any":t.querySelectorAll(".product.is--selected").length>0&&(s=!0);break;case"anyof":t.querySelectorAll(".product.is--selected").forEach(function(t){["id","variant-id","parent-id"].forEach(function(e){let i=t.getAttribute("data-"+e);r.includes(i)||r.push(i)})}),r.filter(t=>i.identifiers.includes(t)).length>0&&(s=!0);break;case"noneof":if(t.querySelectorAll(".product.is--selected").forEach(function(t){["id","variant-id","parent-id"].forEach(function(e){let i=t.getAttribute("data-"+e);r.includes(i)||r.push(i)})}),0===r.length)break;0===r.filter(t=>i.identifiers.includes(t)).length&&(s=!0);break;case"none":0===t.querySelectorAll(".product.is--selected").length&&(s=!0)}})}),!0===s){let r=e.classList.contains("is--visibility-"+i);e.classList.remove("is--visibility-"+i),t.querySelectorAll('div.summary .summary--stream[data-id="'+e.getAttribute("data-id")+'"]').forEach(function(t){t.classList.remove("is--hidden")}),!0===r&&e.classList.contains("is--template-slider")&&(window.PluginManager.getPluginInstanceFromElement(e.querySelector("div.base-slider"),"ProductSlider").rebuild(D.getCurrentViewport(),!0),this._plugin.bindProductEvents(e))}else e.classList.add("is--visibility-"+i),t.querySelectorAll('div.summary .summary--stream[data-id="'+e.getAttribute("data-id")+'"]').forEach(function(t){t.classList.add("is--hidden")})})}}/**
94 * digitvision
95 *
96 * @category  digitvision
97 * @package   Shopware\Plugins\DvsnSetConfigurator
98 * @copyright (c) 2020 digitvision
99 */class H{constructor(t,e){this._plugin=t,this._options=e}update(){let t=this._plugin.el;this._plugin.removeClass(t.querySelectorAll("div.stream.has--set-warning"),"has--set-warning"),this._plugin.removeClass(t.querySelectorAll('div.stream[data-set-status="true"] .set-icons > span'),"is--visible"),t.querySelectorAll('div.stream[data-set-status="true"]').forEach(t=>{let e=0;t.querySelectorAll("div.product.is--selected").forEach(t=>{e+=this._plugin.getProductQuantity(t)});let i="range"===t.getAttribute("data-set-behaviour")?this._options.snippets.setInfoRange:this._options.snippets.setInfo;t.querySelector(".set-info").innerHTML=i.replace("[x]",e.toString()).replace("[y]",t.getAttribute("data-set-quantity")).replace("[z]",t.getAttribute("data-set-quantity-y")),this._plugin.isSetValid(t)?this._plugin.addClass(t.querySelectorAll(".set-icons .checkmark"),"is--visible"):this._plugin.addClass(t.querySelectorAll(".set-icons .cross"),"is--visible")})}isValid(t){let e=0;switch(t.querySelectorAll("div.product.is--selected").forEach(t=>{e+=this._plugin.getProductQuantity(t)}),t.getAttribute("data-set-behaviour")){default:case"free":if(e>parseInt(t.getAttribute("data-set-quantity"),10))return!1;break;case"minimum":if(e<1||e>parseInt(t.getAttribute("data-set-quantity"),10))return!1;break;case"fixed":if(e!==parseInt(t.getAttribute("data-set-quantity"),10))return!1;break;case"range":if(e<parseInt(t.getAttribute("data-set-quantity"),10)||e>parseInt(t.getAttribute("data-set-quantity-y"),10))return!1}return!0}}/**
100 * digitvision
101 *
102 * @category  digitvision
103 * @package   Shopware\Plugins\DvsnSetConfigurator
104 * @copyright (c) 2020 digitvision
105 */class x{constructor(t,e){this._plugin=t,this._options=e}update(){let t=this._plugin.el;if(0===t.querySelectorAll("div.summary").length||t.querySelector("div.summary").classList.contains("is--hidden"))return;let e=t.querySelector("div.summary").classList.contains("is--extended");t.querySelectorAll("div.stream").forEach(i=>{let r=[];i.querySelectorAll("div.product.is--selected").forEach(t=>{let e=this._plugin.getProductQuantity(t),s="string"==typeof t.getAttribute("data-prices")?JSON.parse(t.getAttribute("data-prices")):t.getAttribute("data-prices"),a=t.querySelectorAll(".image img").length>0?t.querySelector(".image img").getAttribute("src"):t.getAttribute("data-cover"),o=this._plugin.getProductPrice(s,e,this._plugin.getStreamRebate(i)),n=0;"no"!==this._options.config.showListPrice&&0===(n=this._plugin.getProductListPrice(s,e))&&"yesAlways"===this._options.config.showListPrice&&this._plugin.getStreamRebate(i)>0&&(n=this._plugin.getProductPrice(s,e,0)),r.push({name:t.getAttribute("data-name"),quantity:e,price:o,listPrice:n,image:a})});let s=t.querySelector('div.summary div.summary--stream[data-id="'+i.getAttribute("data-id")+'"]');if(0===r.length){s.querySelector("div.products--column").innerHTML='<div class="product--empty-line">'+this._options.snippets.summaryEmpty+"</div>";return}let a="";r.forEach(t=>{let i="";i=!0===e?'<div class="product--line block-group"><div class="image-container block"><div class="product-image-wrapper">
105<span class="product-image-link is-minimal image">'+(t.image?'<img src="'+t.image+'" class="product-image is-minimal"/>':"")+'</span></div></div><div class="info-container block"><div class="name">'+(t.quantity>1?'<span class="quantity">'+t.quantity+"x</span> ":"")+t.name+'</div><div class="price-container"><span class="price'+(t.listPrice>0?" has--list-price":"")+'">'+this._plugin.formatPrice(t.price)+"</span>"+(t.listPrice>0?' <span class="list-price">'+this._plugin.formatPrice(t.listPrice)+"</span>":"")+"</div></div></div>":'<div class="product--line">'+(t.quantity>1?'<span class="quantity">'+t.quantity+"x</span> ":"")+t.name+"</div>",a+=i}),s.querySelector("div.products--column").innerHTML=a})}}/**
106 * digitvision
107 *
108 * @category  digitvision
109 * @package   Shopware\Plugins\DvsnSetConfigurator
110 * @copyright (c) 2020 digitvision
111 */class O{constructor(t,e){this._plugin=t,this._options=e}update(){this.updateStreamConditions(),this.parseProductPrices(),this.parseConfiguratorPrice(),this.updateSelectionLabels(),this.updateSummary(),this.updateMandatoryAndSets(),this.updateAvailabilityInformation(),this.updateDeliveryTime(),this.updateRebateInfo(),!0===this._options.config.disableQuantitySelection&&this.updateQuantitySelection(),!0===this._options.config.disableInputFields&&this._plugin.updateInputFields()}updateQuantitySelection(){this._plugin.el.querySelectorAll("div.stream div.product.has--quantity-selection div.quantity-selection select.is--quantity-select").forEach(t=>{t.disabled=!0}),this._plugin.el.querySelectorAll("div.stream div.product.has--quantity-selection.is--selected div.quantity-selection select.is--quantity-select").forEach(t=>{t.disabled=!1})}updateMandatoryAndSets(){let t=this._plugin.el;this._plugin.removeClass(t.querySelectorAll("div.stream.has--mandatory-warning"),"has--mandatory-warning"),this._plugin.removeClass(t.querySelectorAll("div.stream.has--input-warning"),"has--input-warning"),this._plugin.removeClass(t.querySelectorAll("div.product.has--input-warning"),"has--input-warning"),this._plugin.streamSetService.update(),this._plugin.removeClass(t.querySelectorAll("div.stream.is--mandatory .mandatory-icons > span"),"is--visible"),t.querySelectorAll("div.stream.is--mandatory").forEach(t=>{t.querySelectorAll("div.product.is--selected").length>0?this._plugin.addClass(t.querySelectorAll(".mandatory-icons .checkmark"),"is--visible"):this._plugin.addClass(t.querySelectorAll(".mandatory-icons .cross"),"is--visible")})}updateSelectionLabels(){this._plugin.el.querySelectorAll("div.stream.is--template-slider div.product div.selector label").forEach(t=>{t.innerHTML=this._options.snippets.selectable}),this._plugin.el.querySelectorAll("div.stream.is--template-slider div.product.is--selected div.selector label").forEach(t=>{t.innerHTML=this._options.snippets.selected}),this._plugin.el.querySelectorAll("div.stream.is--template-gallery div.product div.selector label").forEach(t=>{t.innerHTML=this._options.snippets.selectable}),this._plugin.el.querySelectorAll("div.stream.is--template-gallery div.product.is--selected div.selector label").forEach(t=>{t.innerHTML=this._options.snippets.selected})}updateSummary(){this._plugin.summaryService.update()}updateStreamConditions(){this._plugin.streamConditionsService.update()}updateDeliveryTime(){this._plugin.productDeliveryTimeService.update()}updateAvailabilityInformation(){this._plugin.productAvailabilityService.update()}parseProductPrices(){this._plugin.productPriceService.update()}parseConfiguratorPrice(){let t=0,e=0;if(!0===this._options.config.treatConfiguratorWithoutConfigurationAsDefaultProduct&&0===this._plugin.el.querySelectorAll("div.stream div.product.is--selected").length)t=this._options.product.price,e=0===this._options.product.listPrice?this._options.product.price:this._options.product.listPrice;else{let i=this._plugin.getFlatSum(),r=this._plugin.getSurchargeSum(i);t=i.price+r.price,e=i.pseudoPrice+r.pseudoPrice}let i="percental"===this._options.config.showGlobalRebate?Math.round(Math.abs(100-t/e*100))+"%":this._plugin.formatPrice(Math.abs(e-t)),r=e>t?this._options.templates.price.pseudo:this._options.templates.price.default;r=(r=(r=(r=r.replace("{price}",this._plugin.formatPrice(t))).replace("{priceNumeric}",this._plugin.roundPrice(t))).replace("{pseudoPrice}",this._plugin.formatPrice(e))).replace("{rebate}",i),document.querySelectorAll("body .product-detail-price-container").forEach(function(t){t.innerHTML=r})}
111updateRebateInfo(){this._plugin.rebateInfoService.update()}}/**
112 * digitvision
113 *
114 * @category  digitvision
115 * @package   Shopware\Plugins\DvsnSetConfigurator
116 * @copyright (c) 2020 digitvision
117 */class F{constructor(t,e){this._plugin=t,this._options=e}isValid(){let t=this._plugin,e=this._plugin.el;return(this._prepareMandatoryStreams(),this._prepareSetStreams(),this._prepareInputStreams(),e.querySelectorAll("div.stream.has--mandatory-warning").length>0)?(t.scrollTo("div.stream.has--mandatory-warning"),!1):e.querySelectorAll("div.stream.has--input-warning").length>0?(t.scrollTo("div.stream.has--input-warning"),!1):!(e.querySelectorAll("div.stream.has--set-warning").length>0)||(t.scrollTo("div.stream.has--set-warning"),!1)}_prepareMandatoryStreams(){let t=this._plugin,e=this._plugin.el;t.removeClass(e.querySelectorAll("div.stream.has--mandatory-warning"),"has--mandatory-warning"),e.querySelectorAll('div.stream[data-mandatory="true"]').forEach(function(e){!1!==t.isStreamVisible(e)&&0===e.querySelectorAll("div.product.is--selected").length&&e.classList.add("has--mandatory-warning")})}_prepareSetStreams(){let t=this._plugin,e=this._plugin.el;t.removeClass(e.querySelectorAll("div.stream.has--set-warning"),"has--set-warning"),e.querySelectorAll('div.stream[data-set-status="true"]').forEach(function(e){!1!==t.isStreamVisible(e)&&!1===t.isSetValid(e)&&e.classList.add("has--set-warning")})}_prepareInputStreams(){let t=this._plugin;this._plugin.el.querySelectorAll('div.stream[data-input-mandatory="true"] div.product.is--selected').forEach(function(e){""===t.getProductInput(e)&&(e.closest("div.stream").classList.add("has--input-warning"),e.classList.add("has--input-warning"))})}}let Q="element-loader-backdrop";class N extends a{static create(t){t.classList.add("has-element-loader"),N.exists(t)||(N.appendLoader(t),setTimeout(()=>{let e=t.querySelector(`.${Q}`);e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(`.${Q}`);e&&e.remove()}static exists(t){return t.querySelectorAll(`.${Q}`).length>0}static getTemplate(){return`
118        <div class="${Q}">
119            <div class="loader" role="status">
120                <span class="visually-hidden">Loading...</span>
121            </div>
122        </div>
123        `}static appendLoader(t){t.insertAdjacentHTML("beforeend",N.getTemplate())}}class j{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var i of t.entries())e(i[1],i[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(i=>{e(t[i],i)});throw Error(`The element type ${typeof t} is not iterable!`)}}/**
124 * digitvision
125 *
126 * @category  digitvision
127 * @package   Shopware\Plugins\DvsnSetConfigurator
128 * @copyright (c) 2020 digitvision
129 */class B{constructor(t,e){this._plugin=t,this._options=e}open(t,e){m.create(),fetch(("single"===this._options.config.variantSelection?this._options.variant.urlSimple:this._options.variant.urlConfigurator).replace("__productId__",e).replace("__streamId__",t),{method:"GET",headers:{"Content-Type":"application/json"}}).then(t=>t.text()).then(i=>{this._openVariantSelectionModal(i,t,e)})}_openVariantSelectionModal(t,e,i){let r=new P(t);m.remove(),"single"===this._options.config.variantSelection?r.open(this._onOpenVariantSelectionModalSimple.bind(this,r,e,i)):r.open(this._onOpenVariantSelectionModalConfigurator.bind(this,r,e,i)),r.getModal().classList.add(this._options.variant.class)}_onOpenVariantSelectionModalConfigurator(t,e,i){let r=this,s=document.querySelector("div.modal."+this._options.variant.class);s.querySelector("button.btn.btn-primary").addEventListener("click",t=>{let r=s.querySelector(".product-data-container");this._applyVariantData(e,i,r),s.querySelector(".btn-close.close").click()}),s.querySelectorAll("select").forEach(a=>{a.addEventListener("change",function(a){let o={};N.create(s.querySelector(".modal-body div."+r._options.variant.class)),j.iterate(s.querySelectorAll("select"),t=>{let e=[...t.options].find(t=>t.selected);o[t.name]=e.value});let n={switched:this.name,options:JSON.stringify(o)},l="switched="+encodeURIComponent(n.switched)+"&options="+encodeURIComponent(n.options);fetch(r._options.variant.urlConfiguratorSwitchVariant.replace("__productId__",i).replace("__streamId__",e)+"?"+l,{method:"GET",headers:{"Content-Type":"application/json"}}).then(t=>t.text()).then(a=>{N.remove(s.querySelector(".modal-body div."+r._options.variant.class)),t.updateContent(a,function(){r._onOpenVariantSelectionModalConfigurator(t,e,i)})})})})}_onOpenVariantSelectionModalSimple(t,e,i){let r=document.querySelector("div.modal."+this._options.variant.class);r.querySelectorAll(".cover img").length>0&&r.querySelector(".cover img").setAttribute("src",r.querySelectorAll("select option")[0].getAttribute("data-cover")),r.querySelector("button.btn.btn-primary").addEventListener("click",t=>{let s=r.querySelectorAll("select option")[r.querySelector("select").selectedIndex];this._applyVariantData(e,i,s),r.querySelector(".btn-close.close").click()}),r.querySelector("select").addEventListener("change",function(){let t=r.querySelectorAll("select option")[r.querySelector("select").selectedIndex];r.querySelectorAll(".cover img").length>0&&r.querySelector(".cover img").setAttribute("src",t.getAttribute("data-cover"))})}
129_applyVariantData(t,e,i){let r=this._getProduct(t,e),s=r.closest(".stream"),a=i.getAttribute("data-name");"false"===r.getAttribute("data-has-quantity-select")&&parseInt(r.getAttribute("data-quantity"),10)>1&&(a='<span class="quantity">'+r.getAttribute("data-quantity").toString()+"x</span> "+a),"list"===s.getAttribute("data-template")&&!0===this._options.config.hasStockIndicator&&(a='<span class="stock-indicator bg-info"></span> '+a),r.querySelector(".name").innerHTML=a,r.querySelector(".price").innerHTML="";let o="true"===s.getAttribute("data-free")?'[{"from":1,"to":0,"price":0,"listPrice":0}]':i.getAttribute("data-prices"),n="true"===s.getAttribute("data-free")&&"false"===s.getAttribute("data-free-and-show-prices")?'[{"from":1,"to":0,"price":0,"listPrice":0}]':i.getAttribute("data-prices");r.setAttribute("data-id",i.getAttribute("data-id")),r.setAttribute("data-number",i.getAttribute("data-number")),r.setAttribute("data-is-variant","true"),r.setAttribute("data-is-parent","false"),r.setAttribute("data-variant-id",i.getAttribute("data-id")),r.setAttribute("data-name",i.getAttribute("data-name")),r.setAttribute("data-weight",i.getAttribute("data-weight")),r.setAttribute("data-stock",i.getAttribute("data-stock")),r.setAttribute("data-prices",o),r.setAttribute("data-prices-display",n),r.setAttribute("data-is-percental-surcharge",i.getAttribute("data-is-percental-surcharge")),r.setAttribute("data-percental-surcharge-value",i.getAttribute("data-percental-surcharge-value")),r.setAttribute("data-percental-surcharge-display",i.getAttribute("data-percental-surcharge-display")),r.querySelectorAll(".product-image-placeholder").length>0&&r.querySelectorAll(".selector--overlay").length>0&&(r.querySelector(".selector--overlay").insertAdjacentHTML("afterend",'<img src="" srcset="" sizes="" class="product-image is-minimal" alt="" title="">'),r.querySelector(".product-image-placeholder").parentNode.removeChild(r.querySelector(".product-image-placeholder"))),r.querySelectorAll(".image img").length>0&&(r.querySelector(".image img").setAttribute("src",i.getAttribute("data-cover")),r.querySelector(".image img").setAttribute("srcset",i.getAttribute("data-cover")));let l=parseInt(i.getAttribute("data-stock").toString(),10),c=parseInt(r.getAttribute("data-quantity").toString(),10)>l?l:parseInt(r.getAttribute("data-quantity").toString(),10);if("true"===r.getAttribute("data-has-quantity-select")){let t=r.querySelector("select");for(;t.firstChild;)t.removeChild(t.firstChild);for(let e=1;e<=l;e++){let i=document.createElement("option");i.value=e.toString(),i.innerHTML=e.toString(),t.appendChild(i)}t.value=c.toString()}r.querySelector("input.is--selector-input").checked=!0,this._plugin.setInputSelected(r.querySelector("input.is--selector-input"),!0),this._plugin.updateEverything(),this._plugin.updateStockIndicator(r)}_getProduct(t,e){return this._plugin.el.querySelector('div.stream[data-id="'+t+'"] div.product[data-parent-id="'+e+'"]')}}/**
130 * digitvision
131 *
132 * @category  digitvision
133 * @package   Shopware\Plugins\DvsnSetConfigurator
134 * @copyright (c) 2020 digitvision
135 */class W extends window.PluginBaseClass{static #t=this.options=new v;init(){this.options.templates.price.pseudo=this.options.templates.price.pseudo.replace("{snippet.before-list-price}",this.options.snippets.beforeListPrice),this.options.templates.price.pseudo=this.options.templates.price.pseudo.replace("{snippet.after-list-price}",this.options.snippets.afterListPrice),this.options.templates.price.pseudo=this.options.templates.price.pseudo.replace("{snippet.list-price-saved-pre}",this.options.snippets.listPriceSavedPre),this.options.templates.price.pseudo=this.options.templates.price.pseudo.replace("{snippet.list-price-saved-post}",this.options.snippets.listPriceSavedPost),this.initPriceTemplate(this.options.price.template),this.initSelection(this.el),this.initCollapsed(this.el),this.initServices(),this.bindEvents(this.el),this.bindProductEvents(this.el),this.bindCustomEvents(),this.updateEverything()}initServices(){this.collapsibleStreamsService=new S(this,this.options),this.inquiryService=new y(this,this.options),this.priceService=new _(this,this.options),this.productAvailabilityService=new f(this,this.options),this.productDeliveryTimeService=new b(this,this.options),this.productInfoService=new L(this,this.options),this.productInputService=new E(this,this.options),this.productPriceService=new w(this,this.options),this.productSelectionService=new C(this,this.options),this.productStockIndicatorService=new T(this,this.options),this.rebateInfoService=new I(this,this.options),this.rebateService=new k(this,this.options),this.selectionService=new M(this,this.options),this.streamConditionsService=new R(this,this.options),this.streamSetService=new H(this,this.options),this.summaryService=new x(this,this.options),this.updaterService=new O(this,this.options),this.validationService=new F(this,this.options),this.variantSelectionService=new B(this,this.options)}initCollapsed(t){this.addClass(t.querySelectorAll("div.stream.is--collapsible.add--is--collapsed"),"is--collapsed"),this.removeClass(t.querySelectorAll("div.stream.is--collapsible.add--is--collapsed"),"add--is--collapsed")}initPriceTemplate(t){this.options.price.pre=t.toString().split("55")[0].split("222")[0].split("11")[0],this.options.price.post=t.toString().split("55")[1],this.options.number.decimalSeparator=t.toString().split("55")[0].split("222")[1],this.options.number.thousandsSeparator=t.toString().split("55")[0].split("222")[0].split("11")[1]}initSelection(t){t.querySelectorAll("div.product input.is--selector-input:checked").forEach(function(t){t.closest(".product").classList.add("is--selected")})}bindCustomEvents(){}bindEvents(t){let e=this;t.querySelectorAll("div.stream.is--collapsible div.header").forEach(t=>{t.addEventListener("click",function(t){e.onCollapsibleHeaderClick(t,this)})}),document.querySelectorAll("body .product-detail-buy .dvsn-set-configurator--save-selection").forEach(t=>{t.addEventListener("click",t=>{if(!1===this.validateSelection()){t.preventDefault();return}m.create(),this.setSelection(this.parseSelection())})}),document.querySelectorAll("body .product-detail-buy form.buy-widget button.btn.btn-buy").forEach(t=>{t.addEventListener("click",t=>{!1===this.validateSelection()&&t.preventDefault(),this.setSelection(this.parseSelection())})}),document.querySelectorAll("body .product-detail-buy .dvsn-set-configuration--product-inquiry .product-inquiry-action").forEach(t=>{t.addEventListener("click",t=>{if(!1===this.validateSelection()){t.preventDefault();return}m.create(),this.setSelection(this.parseSelection()),this.prepareInquiry()})})}bindProductEvents(t){let e=this;
135t.querySelectorAll("div.product input:not([type='text'])").forEach(function(t){t.addEventListener("click",function(t){e.onInputClick(t,this)})}),t.querySelectorAll("div.product.is--fully-selectable").forEach(function(t){t.addEventListener("click",function(t){e.onFullySelectableProductClick(t,this)})}),t.querySelectorAll("div.product div.quantity-selection select").forEach(function(t){t.addEventListener("change",function(t){e.onQuantityChange(t,this)})}),t.querySelectorAll("div.product.is--fully-selectable label").forEach(function(t){t.addEventListener("click",function(t){t.preventDefault()})}),t.querySelectorAll("div.product .name, div.product .price, div.product .image").forEach(function(t){t.addEventListener("click",function(t){e.onProductDataClick(t,this)})}),t.querySelectorAll("div.product input.is--input").forEach(function(t){t.addEventListener("keyup",function(t){e.onInputChange(t,this)})})}onQuantityChange(t,e){this.updateStockIndicator(e.closest(".product")),this.updateEverything()}scrollTo(t){let e=this.el.querySelector(t).getBoundingClientRect().top+window.pageYOffset+-100;window.scrollTo({top:e,behavior:"smooth"})}addClass(t,e){t.forEach(function(t){t.classList.add(e)})}removeClass(t,e){t.forEach(function(t){t.classList.remove(e)})}getParentQuantity(){return document.querySelectorAll("form.buy-widget .product-detail-quantity-input").length>0?document.querySelector("form.buy-widget .product-detail-quantity-input").value:document.querySelectorAll("form.buy-widget .quantity-selector-group-input").length>0?document.querySelector("form.buy-widget .quantity-selector-group-input").value:1}getProductQuantity(t){return"true"===t.getAttribute("data-has-quantity-select")?parseInt(t.querySelector("select").value,10):parseInt(t.getAttribute("data-quantity"),10)}getProductStock(t){return parseInt(t.getAttribute("data-stock"),10)}isPercentalSurcharge(t){return"true"===t.getAttribute("data-is-percental-surcharge")}getParentRebate(){return this.rebateService.getParentRebate()}getStreamRebate(t){return this.rebateService.getStreamRebate(t)}isStreamVisible(t){return!t.classList.contains("is--visibility-hidden")&&!t.classList.contains("is--visibility-disabled")}updateEverything(){this.updaterService.update()}getProductInput(t){return this.productInputService.get(t)}hasInput(t){return this.productInputService.has(t)}getProductPrice(t,e,i){return this.productPriceService._getPriceForQuantity(t,e,i)}getProductListPrice(t,e){return this.productPriceService.getListPrice(t,e)}updateInputFields(){this.productInputService.update()}onInputChange(t,e){this.productInputService.change(e.closest(".product"))}onFullySelectableProductClick(t,e){this.productSelectionService.fullySelectableProductClick(t,e)}onInputClick(t,e){this.productSelectionService.inputClick(t,e)}setInputSelected(t,e){this.productSelectionService.toggle(t,e)}getSurchargeSum(t){return this.productPriceService.getSurchargeSum(t)}getFlatSum(){return this.productPriceService.getFlatSum()}validateSelection(){return this.validationService.isValid()}parseSelection(){return this.selectionService.get()}setSelection(t){this.selectionService.set(t)}formatPrice(t){return this.priceService.formatPrice(t)}roundPrice(t){return this.priceService.roundPrice(t)}updateStockIndicator(t){this.productStockIndicatorService.update(t)}isSetValid(t){return this.streamSetService.isValid(t)}prepareInquiry(){this.inquiryService.redirect()}onCollapsibleHeaderClick(t,e){this.collapsibleStreamsService.toggle(e)}onNextCollapsibleStream(t){this.collapsibleStreamsService.next(t)}openVariantSelection(t,e){this.variantSelectionService.open(t,e)}onProductDataClick(t,e){this.productInfoService.click(e.closest(".product"))}openProductInfo(t){this.productInfoService.open(t)}}}}]);

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.