@orderingstack/front-components-product-configurator 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"MenuProductRoot.d.ts","sourceRoot":"","sources":["MenuProductRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAA;AAG/C,eAAO,MAAM,eAAe,UACnB,KAAK,uBAAuB,EAAE,UAAU,CAAC,gBAyBjD,CAAA"}
1
+ {"version":3,"file":"MenuProductRoot.d.ts","sourceRoot":"","sources":["MenuProductRoot.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAA;AAG/C,eAAO,MAAM,eAAe,UACnB,KAAK,uBAAuB,EAAE,UAAU,CAAC,gBA6BjD,CAAA"}
package/dist/index.cjs.js CHANGED
@@ -14,5 +14,5 @@ object-assign
14
14
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var cd={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=Yi(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(t){var r=Yi(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function Po(e){return!isNaN(parseInt(e))&&isFinite(e)}function fd(e){return Po(e)&&e<=100&&e>=0}function dd(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Ji(e){return e%2===0}function Zi(e){return Po(e)&&!Number.isInteger(e)}function gd(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var r=t.split(".")[1];return r?r.length:0}function Ot(e){return Math.abs(e)%1===.5}function pd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),hd(i,t.headers),i.send()})}function hd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r]);return e}function Ct(e){return typeof e=="undefined"}function Co(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(Nt(n[1])==="object"){var i=Co(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function md(e){return Boolean(e)&&(Nt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ao(){var e=function(n,i){var a=function(u){return Math.pow(10,gd(u))},o=Math.max(a(n),a(i));return Math.round(n*o)*Math.round(i*o)/(o*o)},t={HALF_ODD:function(n){var i=Math.round(n);return Ot(n)&&Ji(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Ot(n)?Ji(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Ot(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Ot(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Ot(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return Zi(n)||Zi(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var vd=Ao();function yd(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Ct(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Ct(this.getMatches().find(n))?0:this.getMatches()[vd.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Ct(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Ct(this.getMatches().find(function(n){return n===","}))}}}function bd(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)i=i.replace("{{".concat(o,"}}"),a[o]);return i},r=function(i,a){return pd(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(md(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return Co(o)[t(e.propertyPath,{from:i,to:a})]})}}}function It(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Sd(e){It(fd(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Od(e){It(dd(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function Qr(e){It(Number.isInteger(e),"You must provide an integer.",TypeError)}var Q=Ao(),wd=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,a=r.precision;Qr(n),Qr(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,l=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),c=function(p){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},g=function(p){It(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||o},setLocale:function(p){return c.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;Qr(p);var y=this.getPrecision(),m=p>y,S=m?Q.multiply:Q.divide,C=m?[p,y]:[y,p],P=Math.pow(10,Q.subtract.apply(Q,C));return c.call(this,{amount:Q.round(S(this.getAmount(),P),v),precision:p})},add:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return c.call(this,{amount:Q.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return c.call(this,{amount:Q.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Q.round(Q.multiply(this.getAmount(),p),v)})},divide:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Q.round(Q.divide(this.getAmount(),p),v)})},percentage:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Sd(p),this.multiply(Q.divide(p,100),v)},allocate:function(p){var v=this;Od(p);for(var y=p.reduce(function(P,E){return Q.add(P,E)}),m=this.getAmount(),S=p.map(function(P){var E=Math.floor(Q.divide(Q.multiply(v.getAmount(),P),y));return m=Q.subtract(m,E),c.call(v,{amount:E})}),C=0;m>0;)p[C]>0&&(S[C]=S[C].add(c.call(this,{amount:1})),m=Q.subtract(m,1)),C+=1;return S},convert:function(p){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=y.endpoint,S=m===void 0?f.endpoint:m,C=y.propertyPath,P=C===void 0?f.propertyPath||"rates.{{to}}":C,E=y.headers,_=E===void 0?f.headers:E,R=y.roundingMode,I=R===void 0?u:R,D=Object.assign({},{endpoint:S,propertyPath:P,headers:_,roundingMode:I});return bd(D).getExchangeRate(this.getCurrency(),p).then(function(V){return It(!Ct(V),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),c.call(v,{amount:Q.round(Q.multiply(v.getAmount(),parseFloat(V)),D.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Q.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return Q.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var v=e.normalizePrecision([this,p]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,y=yd(p);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Q.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,y=Math.pow(10,p);return Q.divide(Q.round(Q.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},xd=Object.assign(wd,id,ad,cd);const Yt=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":xd({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Ed=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=Yt(`${r*n}`);const o=`${Yt(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${Yt(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Sr(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=t>s?t:a,l=Yt(`${u}`);return!t&&i===!1?null:r?U("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${l}`]}):t<s?U("span",{className:"",children:["\xA0",`od ${l}`]}):w("span",{className:"",children:l})}function Pd(e,t){const{selCtx:r,id:n}=e,i=J(s=>s.expanded),a=b.useMemo(()=>Cd(r,n,t,i),[r,n,t,i]),o=J(s=>s.toggleExpanded);return{isExpanded:a,toggleExpanded:o}}const Cd=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var Ad=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,_d={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Nd=function(t){return _d[t]},Td=function(t){return t.replace(Ad,Nd)};function Xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ea(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xi(Object(r),!0).forEach(function(n){Ae(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var dn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Td},_o,Rd=b.createContext();function Ld(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn=ea(ea({},dn),e)}function Id(){return dn}var Fd=function(){function e(){me(this,e),this.usedNamespaces={}}return ve(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function kd(e){_o=e}function Dd(){return _o}var jd={type:"3rdParty",init:function(t){Ld(t.options.react),kd(t)}};function Md(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var ta={};function gn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&ta[t[0]]||(typeof t[0]=="string"&&(ta[t[0]]=new Date),Md.apply(void 0,t))}function ra(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function $d(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var o=function(u,l){var f=t.services.backendConnector.state["".concat(u,"|").concat(l)];return f===-1||f===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}function Ud(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return gn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(a,o){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}):$d(e,t,r)}function Vd(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){l=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Bd(e,t){return ya(e)||Vd(e,t)||ba(e,t)||Sa()}function na(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?na(Object(r),!0).forEach(function(n){Ae(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):na(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Hd=function(t,r){var n=b.useRef();return b.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function _n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=b.useContext(Rd)||{},i=n.i18n,a=n.defaultNS,o=r||i||Dd();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new Fd),!o){gn("You will need to pass in an i18next instance by using initReactI18next");var s=function(D){return Array.isArray(D)?D[D.length-1]:D},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&gn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=Yr(Yr(Yr({},Id()),o.options.react),t),f=l.useSuspense,c=l.keyPrefix,g=e||a||o.options&&o.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(g);var d=(o.isInitialized||o.initializedStoreOnce)&&g.every(function(I){return Ud(I,o,l)});function p(){return o.getFixedT(null,l.nsMode==="fallback"?g:g[0],c)}var v=b.useState(p),y=Bd(v,2),m=y[0],S=y[1],C=g.join(),P=Hd(C),E=b.useRef(!0);b.useEffect(function(){var I=l.bindI18n,D=l.bindI18nStore;E.current=!0,!d&&!f&&ra(o,g,function(){E.current&&S(p)}),d&&P&&P!==C&&E.current&&S(p);function V(){E.current&&S(p)}return I&&o&&o.on(I,V),D&&o&&o.store.on(D,V),function(){E.current=!1,I&&o&&I.split(" ").forEach(function(k){return o.off(k,V)}),D&&o&&D.split(" ").forEach(function(k){return o.store.off(k,V)})}},[o,C]);var _=b.useRef(!0);b.useEffect(function(){E.current&&!_.current&&S(p),_.current=!1},[o,c]);var R=[m,o,d];if(R.t=m,R.i18n=o,R.ready=d,d||!d&&!f)return R;throw new Promise(function(I){ra(o,g,function(){I()})})}var No=[],Wd=No.forEach,Gd=No.slice;function Kd(e){return Wd.call(Gd.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var ia=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,zd=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o="".concat(t,"=").concat(a);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!ia.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!ia.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},aa={create:function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=zd(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var a=n[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},Qd={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=aa.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&aa.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},Yd={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),a=i.split("&"),o=0;o<a.length;o++){var s=a[o].indexOf("=");if(s>0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(r=a[o].substring(s+1))}}}return r}},wt=null,oa=function(){if(wt!==null)return wt;try{wt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{wt=!1}return wt},qd={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&oa()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&oa()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},xt=null,sa=function(){if(xt!==null)return xt;try{xt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{xt=!1}return xt},Jd={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&sa()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&sa()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Zd={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},Xd={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},eg={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},tg={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function rg(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var To=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};me(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return ve(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=Kd(n,this.options||{},rg()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(Qd),this.addDetector(Yd),this.addDetector(qd),this.addDetector(Jd),this.addDetector(Zd),this.addDetector(Xd),this.addDetector(eg),this.addDetector(tg)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(r,i.options)}))}}]),e}();To.type="languageDetector";const ng={"OS.ProductConfigurator.Selected.Message.From":"od","OS.ProductConfigurator.Selected.Message.UpTo":"do","OS.ProductConfigurator.Selected.Message.Choose":"Wybierz","OS.ProductConfigurator.Selected.Message.Options":"opcji","OS.ProductConfigurator.Selected.Message.OneOption":"Wybierz 1 opcj\u0119","OS.ProductConfigurator.Quantity.Message.UpTo":"do","OS.ProductConfigurator.Quantity.Message.From":"od","OS.ProductConfigurator.Quantity.Message.Max":"maksymalnie","OS.ProductConfigurator.Quantity.Message.Quantity":"ilo\u015Bci","OS.ProductConfigurator.Quantity.Message.OneOption":"Wybierz maksymalnie jedn\u0105 opcj\u0119","OS.ProductConfigurator.Add":"Dodaj","OS.ProductConfigurator.Back":"Wr\xF3\u0107","OS.ProductConfigurator.ShowMore":"Poka\u017C wi\u0119cej","OS.ProductConfigurator.ShowLess":"Poka\u017C mniej"},ig={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"},ag={"OS.ProductConfigurator.Selected.Message.From":"ab","OS.ProductConfigurator.Selected.Message.UpTo":"bis","OS.ProductConfigurator.Selected.Message.Choose":"W\xE4hle","OS.ProductConfigurator.Selected.Message.Options":"Optionen","OS.ProductConfigurator.Selected.Message.OneOption":"W\xE4hle eine Option","OS.ProductConfigurator.Quantity.Message.UpTo":"ab","OS.ProductConfigurator.Quantity.Message.From":"aus","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"Menge","OS.ProductConfigurator.Quantity.Message.OneOption":"W\xE4hle bis zu 1 Option aus","OS.ProductConfigurator.Add":"Hinzuf\xFCgen","OS.ProductConfigurator.Back":"Zur\xFCck","OS.ProductConfigurator.ShowMore":"Zeig mehr","OS.ProductConfigurator.ShowLess":"Zeig weniger"},og={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};oe.use(To).use(jd).init({resources:{pl:{translation:ng},en:{translation:ig},de:{translation:ag},cs:{translation:og}}});const sg=(e,t,r,n)=>{let i="",a="";const o=Number(e),s=Number(t);return o>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>r&&(a=he.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=he.TOO_MUCH)),o>=0||s>=0&&r<o?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",a=he.IGNORE),r>=o&&r<=s&&(a=he.OK),{message:i,validationStatus:a}},ug=(e,t,r,n)=>{let i="",a="";const o=parseInt(e||"-1"),s=parseInt(t||"-1");return o>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>r&&(a=he.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=he.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=he.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=he.OK),{message:i,validationStatus:a}},lg=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:a,actualSelCnt:o,children:s}=e,{selCtx:u,details:l={},id:f,attrs:c={}}=t,{qtyMin:g,qtyMax:d,selMin:p,selMax:v}=c,{name:y,description:m}=l.literals||{},{t:S}=_n(),{isExpanded:C,toggleExpanded:P}=Pd(t,r),{validationStatus:E,message:_}=ug(p,v,o,S),{validationStatus:R,message:I}=sg(g,d,a,S),D=E===he.OK,V=R===he.OK,k=!D&&i&&!!_,j=!V&&i&&!!I;return U("div",{className:"pt-1 mb-3",id:no(u),children:[U("div",{className:"flex text-xl font-semibold",children:[w("p",{className:"",children:y}),y&&y!==" "&&U(Ce,{children:[w("div",{className:"ml-auto",children:w(Sr,{price:Cn(n,t)})}),w("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!C&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>P(u,f,r),children:w("polyline",{points:"18 15 12 9 6 15"})})]})]}),w("p",{className:`${m&&"mb-2"}`,children:m}),!1,w("div",{className:"flex",children:U("div",{children:[w(Qi,{isOk:D,isErr:k,info:_}),w(Qi,{isOk:V,isErr:j,info:I})]})}),w("div",{className:`${C?"block":"hidden"}`,children:s})]})},Ro=T.default.createContext(null);function Or(){const e=b.useContext(Ro);if(!e)throw new Error("Missing ComponentsContext");return e}const cg=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i}=e,{isFilterValidated:a,selected:o,isOnSubmitted:s,selCnt:u,qtyCnt:l,currency:f}=zf(t,n,i,r),{MenuOptionsUI:c}=Or();if(!a)return null;const g=w(Nn,{productItems:t.items,parentProduct:t}),d={optionsItem:t,parentSelCtx:r,selected:o,isOnSubmitted:s,actualQtyCnt:l,actualSelCnt:u,currency:f};return c?w(c,{...d,children:g}):w(lg,{...d,children:g})},fg=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:a="lg",children:o}=e,{details:{literals:s}={}}=t,{name:u="",description:l=""}=s||{},f=Za(t),c=io(t);return U("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[w("input",{type:"checkbox",className:`simple-checkbox checkbox-${a} mr-4`,id:r,disabled:n,value:"1",...i}),c&&w("div",{className:"flex w-20 mr-2 max-h-24",children:w("img",{alt:"Product image",className:"h-auto max-w-full",src:c})}),w("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:U("div",{className:"relative",children:[w("p",{className:"w-full text-lg font-semibold",children:u}),w("p",{className:"text-sm text-gray-600",children:l})]})}),w("div",{className:"ml-auto",children:o}),w("label",{htmlFor:r,children:w(Sr,{price:parseFloat(f),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},dg=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:a,size:o="lg",children:s}=e,{details:{literals:u}={}}=t,{name:l="",description:f=""}=u||{},c=Za(t),g=io(t);return U("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[w("input",{type:"radio",className:`simple-radio radio-${o} mr-4`,id:r,...i,value:n,checked:a}),g&&w("div",{className:"flex w-20 mr-2 max-h-24",children:w("img",{alt:"Product image",className:"h-auto max-w-full",src:g})}),w("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:U("div",{className:"relative",children:[w("p",{className:"w-full text-lg font-semibold",children:l}),w("p",{className:"text-sm text-gray-600",children:f})]})}),w("div",{className:"ml-auto",children:s}),w("label",{htmlFor:r,children:w(Sr,{price:parseFloat(c||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Lo(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return U("div",{className:`counter counter-${o} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[w("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:U("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"}),w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),w("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),w("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,children:U("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"}),w("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function gg(e){const{watch:t}=Ie(),r=J(u=>u.setFilter),{id:n,selCtx:i,emit:a={},fltCtx:o}=e,s=t(`selected.${i}.${n}`);return b.useEffect(()=>{s&&o&&!yr(a)&&r(o,a)},[s]),{}}function pg(){const e=J(n=>n.getInvalidSelCtxArray),t=J(n=>n.isInputEnabled),r=J(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}function hg(e,t){var H;const{id:r,selCtx:n}=e,{allowMultiple:i,selMin:a,selMax:o}=t;gg(e);const{isInputEnabled:s,isInputCounterIncrementEnabled:u}=pg(),l=J(W=>W.refreshForm),f=J(W=>W.currency),{watch:c,getValues:g,setValue:d,register:p}=Ie(),v=c(`selected.${n}.${r}`),{selected:y={}}=g(),m=Number(v||0),S=a==="1"&&o==="1",C=!S,P=lu(i),E=m>(S?1:0),_=u(e,y)&&(s(e)||m),R=Number(((H=y==null?void 0:y[n])==null?void 0:H[r])||0)>0,I=s(e)||m,D=`${S?"radio":"selected"}.${n}.${r}`,V=p(D,{onChange:W=>{$(W)}}),k=()=>{d(`selected.${n}.${r}`,`${m+1}`)},j=()=>{const W=m-1;d(`selected.${n}.${r}`,`${W}`),C&&W===0&&d(`selected.${n}.${r}`,!1)},$=W=>{const{target:{checked:z,name:q,defaultValue:B}}=W;if(S){console.log("handleOnInputChange radio",q,B);const te="selected."+q.replace("radio.","").split(".")[0];d(te,{[B]:"1"}),l()}};return{registerProps:V,isRadio:S,isCheckbox:C,isCounter:P,isDecrementEnabled:E,isIncrementEnabled:_,isChecked:R,isCheckboxEnabled:I,handleCounterIncrementQty:k,handleCounterDecrementQty:j,counterValue:m,handleOnInputChange:$,inputId:`${n}.${r}`,radioInputValue:r,currency:f}}const mg=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i}=e,{registerProps:a,inputId:o,radioInputValue:s,isRadio:u,isCheckbox:l,isCounter:f,isDecrementEnabled:c,isIncrementEnabled:g,isChecked:d,isCheckboxEnabled:p,counterValue:v,handleCounterIncrementQty:y,handleCounterDecrementQty:m,currency:S}=hg(t,r),{MenuProductUI:C}=Or(),P={product:t,nestedLvl:n,registerProps:a,inputId:o,radioInputValue:s,isRadio:u,isCheckbox:l,isCounter:f,isDecrementEnabled:c,isIncrementEnabled:g,isChecked:d,isCheckboxEnabled:p,counterValue:v,handleCounterIncrementQty:y,handleCounterDecrementQty:m,currency:S,parentProduct:i},E=w(Nn,{productItems:t.items,parentProduct:t,nestedLvl:n+1});return C?w(C,{...P,children:E}):w(vg,{...P,children:E})},vg=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:a,isRadio:o,isCheckbox:s,isCounter:u,isDecrementEnabled:l,isIncrementEnabled:f,isChecked:c,isCheckboxEnabled:g,counterValue:d,handleCounterIncrementQty:p,handleCounterDecrementQty:v,children:y,parentProduct:m}=e,S=w(Lo,{value:d,add:p,subtract:v,disabledSubtract:!l,disabledAdd:!f}),C=()=>o?w(dg,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:c,children:w(Ce,{children:u&&S})}):s?w(fg,{product:t,inputId:i,registerProps:n,isDisabled:!g,children:w(Ce,{children:u&&S})}):null,P=!yr(t.items)&&d,E=Mn.useTransition(P,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return U("div",{children:[C(),P?E((_,R)=>R&&w(Mn.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:_,children:y},r+1)):null]})};function yg(){return{isMenuProductToShow:r=>r.kind===lt.PRODUCT&&li(r),isMenuOptionsToShow:r=>[lt.OPTIONS,lt.CONFIG].includes(r.kind)&&li(r)}}function Nn(e){const{productItems:t,nestedLvl:r=1,parentProduct:n}=e,{attrs:i={},selCtx:a,kind:o}=n,{isMenuProductToShow:s,isMenuOptionsToShow:u}=yg(),{MenuItemsUI:l}=Or(),c={productItems:t,parentProduct:n,renderMenuItem:g=>u(g)?w(cg,{optionsItem:g,parentSelCtx:a,parentKind:o,nestedLvl:r}):s(g)?w(mg,{product:g,parentAttrs:i,parentProduct:n,nestedLvl:r}):w(Ce,{}),rootParentProduct:n};return l?w(l,{...c}):w(bg,{...c})}function bg(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==lt.PRODUCT,a=99,o=3,[s,u]=b.useState(i?o:a),{t:l}=_n(),f=()=>{u(a)},c=()=>{u(o)};return w(Ce,{children:t.map((g,d)=>{if(d<s)return U("div",{children:[n(g),s===a&&i&&t.length===d+1&&ua(l("OS.ProductConfigurator.ShowLess"),c,!1)]},`${r.id}--${g.id}--${d}`);if(d===s)return ua(l("OS.ProductConfigurator.ShowMore"),f,!0)})})}const ua=(e,t,r)=>w("div",{className:"flex justify-center w-full",children:U("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,U("svg",{className:`-mr-2 w-7 h-7 ${!r&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",w("polyline",{points:"7 7 12 12 17 7"})," ",w("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),Io=()=>{const{watch:e}=Ie(),t=e("selected"),r=J(n=>n.validationMap);return console.log({selected:t,validationMap:r}),U("div",{className:"flex flex-col items-center py-4",children:[w("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(n=>w("div",{children:Object.values(t[n]).filter(i=>i).length>0&&U(Ce,{children:[U("p",{className:"text-lg font-semibold",children:[n,":"]}),Object.keys(t[n]).map(i=>w(T.default.Fragment,{children:t[n][i]&&U("p",{children:[i,":",t[n][i].toString()]})},i))]})},n))]})};function la(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:l}=_n();return U("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&U("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[U("svg",{className:"w-5 h-5 text-red-600",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"}),w("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),w("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),w("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),w("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Back")}`})]}),w("div",{className:"px-3",children:w(Lo,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),U("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[U("svg",{className:"w-5 h-5 mr-2 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w("circle",{cx:"9",cy:"21",r:"1"})," ",w("circle",{cx:"20",cy:"21",r:"1"}),w("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?w("span",{children:`${l("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):w("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Add")} ${t}`})]})]})}const Kt=640,Fo=e=>{const{isModal:t=!1}=e,[r,n]=b.useState(window.innerWidth),[i,a]=b.useState(window.innerHeight),[o,s]=b.useState(window.innerWidth<=Kt),[u,l]=b.useState(window.innerWidth>Kt&&!t);function f(){n(window.innerWidth),a(window.innerHeight)}return b.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),b.useEffect(()=>{l(window.innerWidth>Kt&&!t),s(window.innerWidth<=Kt)},[r,e,t]),{isSm:u,isMobile:o,width:r,windowHeight:i}};function ko(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ko(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Et(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=ko(e))&&(n&&(n+=" "),n+=t);return n}const wr=typeof window=="undefined"||typeof document=="undefined";let De=wr?b.useEffect:b.useLayoutEffect;function Le(e){let t=b.useRef(e);return De(()=>{t.current=e},[e]),t}function xr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function jt(){let e=[],t=[],r={enqueue(n){t.push(n)},addEventListener(n,i,a,o){return n.addEventListener(i,a,o),r.add(()=>n.removeEventListener(i,a,o))},requestAnimationFrame(...n){let i=requestAnimationFrame(...n);return r.add(()=>cancelAnimationFrame(i))},nextFrame(...n){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...n))},setTimeout(...n){let i=setTimeout(...n);return r.add(()=>clearTimeout(i))},microTask(...n){let i={current:!0};return xr(()=>{i.current&&n[0]()}),r.add(()=>{i.current=!1})},add(n){return e.push(n),()=>{let i=e.indexOf(n);if(i>=0){let[a]=e.splice(i,1);a()}}},dispose(){for(let n of e.splice(0))n()},async workQueue(){for(let n of t.splice(0))await n()}};return r}function Tn(){let[e]=b.useState(jt);return b.useEffect(()=>()=>e.dispose(),[e]),e}let ie=function(e){let t=Le(e);return T.default.useCallback((...r)=>t.current(...r),[t])},qr={serverHandoffComplete:!1};function ht(){let[e,t]=b.useState(qr.serverHandoffComplete);return b.useEffect(()=>{e!==!0&&t(!0)},[e]),b.useEffect(()=>{qr.serverHandoffComplete===!1&&(qr.serverHandoffComplete=!0)},[]),e}var ca;let Sg=0;function fa(){return++Sg}let mt=(ca=T.default.useId)!=null?ca:function(){let e=ht(),[t,r]=T.default.useState(e?fa:null);return De(()=>{t===null&&r(fa())},[t]),t!=null?""+t:void 0};function re(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,re),n}function Rn(e){return wr?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let pn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ze=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(ze||{}),Do=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Do||{}),Og=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Og||{});function wg(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(pn)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var jo=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(jo||{});function xg(e,t=0){var r;return e===((r=Rn(e))==null?void 0:r.body)?!1:re(t,{[0](){return e.matches(pn)},[1](){let n=e;for(;n!==null;){if(n.matches(pn))return!0;n=n.parentElement}return!1}})}function Ye(e){e==null||e.focus({preventScroll:!0})}let Eg=["textarea","input"].join(",");function Pg(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Eg))!=null?r:!1}function Cg(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function qt(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?Cg(e):e:wg(e);i.length>0&&(o=o.filter(d=>!i.includes(d))),n=n!=null?n:a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},f=0,c=o.length,g;do{if(f>=c||f+c<=0)return 0;let d=u+f;if(t&16)d=(d+c)%c;else{if(d<0)return 3;if(d>=c)return 1}g=o[d],g==null||g.focus(l),f+=s}while(g!==a.activeElement);return t&6&&Pg(g)&&g.select(),g.hasAttribute("tabindex")||g.setAttribute("tabindex","0"),2}function Jr(e,t,r){let n=Le(t);b.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Ag(e,t,r=!0){let n=b.useRef(!1);b.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,s){if(!n.current||o.defaultPrevented)return;let u=function f(c){return typeof c=="function"?f(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),l=s(o);if(l!==null&&!!l.getRootNode().contains(l)){for(let f of u){if(f===null)continue;let c=f instanceof HTMLElement?f:f.current;if(c!=null&&c.contains(l)||o.composed&&o.composedPath().includes(c))return}return!xg(l,jo.Loose)&&l.tabIndex!==-1&&o.preventDefault(),t(o,l)}}let a=b.useRef(null);Jr("mousedown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),Jr("click",o=>{!a.current||(i(o,()=>a.current),a.current=null)},!0),Jr("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let Mo=Symbol();function _g(e,t=!0){return Object.assign(e,{[Mo]:t})}function Oe(...e){let t=b.useRef(e);b.useEffect(()=>{t.current=e},[e]);let r=ie(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Mo]))?void 0:r}var lr=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(lr||{}),Re=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Re||{});function ye({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o}){let s=$o(t,e);if(a)return zt(s,r,n,o);let u=i!=null?i:0;if(u&2){let{static:l=!1,...f}=s;if(l)return zt(f,r,n,o)}if(u&1){let{unmount:l=!0,...f}=s;return re(l?0:1,{[0](){return null},[1](){return zt({...f,hidden:!0,style:{display:"none"}},r,n,o)}})}return zt(s,r,n,o)}function zt(e,t={},r,n){let{as:i=r,children:a,refName:o="ref",...s}=Zr(e,["unmount","static"]),u=e.ref!==void 0?{[o]:e.ref}:{},l=typeof a=="function"?a(t):a;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let f={};if(t){let c=!1,g=[];for(let[d,p]of Object.entries(t))typeof p=="boolean"&&(c=!0),p===!0&&g.push(d);c&&(f["data-headlessui-state"]=g.join(" "))}if(i===b.Fragment&&Object.keys(da(s)).length>0){if(!b.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(c=>` - ${c}`).join(`
15
15
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(c=>` - ${c}`).join(`
16
16
  `)].join(`
17
- `));return b.cloneElement(l,Object.assign({},$o(l.props,da(Zr(s,["ref"]))),f,u,Ng(l.ref,u.ref)))}return b.createElement(i,Object.assign({},Zr(s,["ref"]),i!==b.Fragment&&u,i!==b.Fragment&&f),l)}function Ng(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function $o(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...a){let o=r[n];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function de(e){var t;return Object.assign(b.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function da(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Zr(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Tg(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&Rg(r)?!1:n}function Rg(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Lg="div";var cr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(cr||{});let hn=de(function(e,t){let{features:r=1,...n}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ye({ourProps:i,theirProps:n,slot:{},defaultTag:Lg,name:"Hidden"})}),Ln=b.createContext(null);Ln.displayName="OpenClosedContext";var Je=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Je||{});function In(){return b.useContext(Ln)}function Ig({value:e,children:t}){return T.default.createElement(Ln.Provider,{value:e},t)}var Uo=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Uo||{});function Vo(e,t){let r=b.useRef([]),n=ie(e);b.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Fg(e,t,r){let n=Le(t);b.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}var At=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(At||{});function kg(){let e=b.useRef(0);return Fg("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Er(){let e=b.useRef(!1);return De(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Pr(...e){return b.useMemo(()=>Rn(...e),[...e])}function Fn(e,t,r,n){let i=Le(r);b.useEffect(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}let Dg="div";var Bo=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Bo||{});let Pt=Object.assign(de(function(e,t){let r=b.useRef(null),n=Oe(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;ht()||(o=1);let u=Pr(r);jg({ownerDocument:u},Boolean(o&16));let l=Mg({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));$g({ownerDocument:u,container:r,containers:a,previousActiveElement:l},Boolean(o&8));let f=kg(),c=ie(v=>{let y=r.current;!y||(m=>m())(()=>{re(f.current,{[At.Forwards]:()=>qt(y,ze.First,{skipElements:[v.relatedTarget]}),[At.Backwards]:()=>qt(y,ze.Last,{skipElements:[v.relatedTarget]})})})}),g=Tn(),d=b.useRef(!1),p={ref:n,onKeyDown(v){v.key=="Tab"&&(d.current=!0,g.requestAnimationFrame(()=>{d.current=!1}))},onBlur(v){let y=new Set(a==null?void 0:a.current);y.add(r);let m=v.relatedTarget;!m||m.dataset.headlessuiFocusGuard!=="true"&&(Ho(y,m)||(d.current?qt(r.current,re(f.current,{[At.Forwards]:()=>ze.Next,[At.Backwards]:()=>ze.Previous})|ze.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&Ye(v.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(hn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:cr.Focusable}),ye({ourProps:p,theirProps:s,defaultTag:Dg,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(hn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:cr.Focusable}))}),{features:Bo});function jg({ownerDocument:e},t){let r=b.useRef(null);Fn(e==null?void 0:e.defaultView,"focusout",i=>{!t||r.current||(r.current=i.target)},!0),Vo(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Ye(r.current),r.current=null)},[t]);let n=b.useRef(!1);b.useEffect(()=>(n.current=!1,()=>{n.current=!0,xr(()=>{!n.current||(Ye(r.current),r.current=null)})}),[])}function Mg({ownerDocument:e,container:t,initialFocus:r},n){let i=b.useRef(null),a=Er();return Vo(()=>{if(!n)return;let o=t.current;!o||xr(()=>{if(!a.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){i.current=s;return}}else if(o.contains(s)){i.current=s;return}r!=null&&r.current?Ye(r.current):qt(o,ze.First)===Do.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function $g({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=Er();Fn(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=new Set(r==null?void 0:r.current);s.add(t);let u=n.current;if(!u)return;let l=o.target;l&&l instanceof HTMLElement?Ho(s,l)?(n.current=l,Ye(l)):(o.preventDefault(),o.stopPropagation(),Ye(u)):Ye(n.current)},!0)}function Ho(e,t){var r;for(let n of e)if((r=n.current)!=null&&r.contains(t))return!0;return!1}let at=new Set,Ue=new Map;function ga(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function pa(e){let t=Ue.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Ug(e,t=!0){De(()=>{if(!t||!e.current)return;let r=e.current,n=Rn(r);if(n){at.add(r);for(let i of Ue.keys())i.contains(r)&&(pa(i),Ue.delete(i));return n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement){for(let a of at)if(i.contains(a))return;at.size===1&&(Ue.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),ga(i))}}),()=>{if(at.delete(r),at.size>0)n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement&&!Ue.has(i)){for(let a of at)if(i.contains(a))return;Ue.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),ga(i)}});else for(let i of Ue.keys())pa(i),Ue.delete(i)}}},[t])}let Wo=b.createContext(!1);function Vg(){return b.useContext(Wo)}function mn(e){return T.default.createElement(Wo.Provider,{value:e.force},e.children)}function Bg(e){let t=Vg(),r=b.useContext(Go),n=Pr(e),[i,a]=b.useState(()=>{if(!t&&r!==null||wr)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return b.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),b.useEffect(()=>{t||r!==null&&a(r.current)},[r,a,t]),i}let Hg=b.Fragment,Wg=de(function(e,t){let r=e,n=b.useRef(null),i=Oe(_g(f=>{n.current=f}),t),a=Pr(n),o=Bg(n),[s]=b.useState(()=>{var f;return wr?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),u=ht(),l=b.useRef(!1);return De(()=>{if(l.current=!1,!(!o||!s))return o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s)),()=>{l.current=!0,xr(()=>{var f;!l.current||!o||!s||(o.removeChild(s),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))})}},[o,s]),u?!o||!s?null:es.createPortal(ye({ourProps:{ref:i},theirProps:r,defaultTag:Hg,name:"Portal"}),s):null}),Gg=b.Fragment,Go=b.createContext(null),Kg=de(function(e,t){let{target:r,...n}=e,i={ref:Oe(t)};return T.default.createElement(Go.Provider,{value:r},ye({ourProps:i,theirProps:n,defaultTag:Gg,name:"Popover.Group"}))}),vn=Object.assign(Wg,{Group:Kg}),Ko=b.createContext(null);function zo(){let e=b.useContext(Ko);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,zo),t}return e}function zg(){let[e,t]=b.useState([]);return[e.length>0?e.join(" "):void 0,b.useMemo(()=>function(r){let n=ie(a=>(t(o=>[...o,a]),()=>t(o=>{let s=o.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s}))),i=b.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return T.default.createElement(Ko.Provider,{value:i},r.children)},[t])]}let Qg="p",Yg=de(function(e,t){let r=mt(),{id:n=`headlessui-description-${r}`,...i}=e,a=zo(),o=Oe(t);De(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return ye({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:Qg,name:a.name||"Description"})}),kn=b.createContext(()=>{});kn.displayName="StackContext";var yn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(yn||{});function qg(){return b.useContext(kn)}function Jg({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=qg(),o=ie((...s)=>{t==null||t(...s),a(...s)});return De(()=>{let s=i===void 0||i===!0;return s&&o(0,r,n),()=>{s&&o(1,r,n)}},[o,r,n,i]),T.default.createElement(kn.Provider,{value:o},e)}function Zg(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Xg=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Xg||{}),ep=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ep||{});let tp={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},fr=b.createContext(null);fr.displayName="DialogContext";function Mt(e){let t=b.useContext(fr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Mt),r}return t}function rp(e,t,r=()=>[document.body]){b.useEffect(()=>{var n;if(!t||!e)return;let i=jt(),a=window.pageYOffset;function o(l,f,c){let g=l.style.getPropertyValue(f);return Object.assign(l.style,{[f]:c}),i.add(()=>{Object.assign(l.style,{[f]:g})})}let s=e.documentElement,u=((n=e.defaultView)!=null?n:window).innerWidth-s.clientWidth;if(o(s,"overflow","hidden"),u>0){let l=s.clientWidth-s.offsetWidth,f=u-l;o(s,"paddingRight",`${f}px`)}if(Zg()){o(e.body,"marginTop",`-${a}px`),window.scrollTo(0,0);let l=null;i.addEventListener(e,"click",f=>{if(f.target instanceof HTMLElement)try{let c=f.target.closest("a");if(!c)return;let{hash:g}=new URL(c.href),d=e.querySelector(g);d&&!r().some(p=>p.contains(d))&&(l=d)}catch{}},!0),i.addEventListener(e,"touchmove",f=>{f.target instanceof HTMLElement&&!r().some(c=>c.contains(f.target))&&f.preventDefault()},{passive:!1}),i.add(()=>{window.scrollTo(0,window.pageYOffset+a),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})}return i.dispose},[e,t])}function np(e,t){return re(t.type,tp,e,t)}let ip="div",ap=lr.RenderStrategy|lr.Static,op=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:a,initialFocus:o,__demoMode:s=!1,...u}=e,[l,f]=b.useState(0),c=In();i===void 0&&c!==null&&(i=re(c,{[Je.Open]:!0,[Je.Closed]:!1}));let g=b.useRef(new Set),d=b.useRef(null),p=Oe(d,t),v=b.useRef(null),y=Pr(d),m=e.hasOwnProperty("open")||c!==null,S=e.hasOwnProperty("onClose");if(!m&&!S)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!m)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!S)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof a!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let C=i?0:1,[P,E]=b.useReducer(np,{titleId:null,descriptionId:null,panelRef:b.createRef()}),_=ie(()=>a(!1)),R=ie(B=>E({type:0,id:B})),I=ht()?s?!1:C===0:!1,D=l>1,V=b.useContext(fr)!==null,k=D?"parent":"leaf";Ug(d,D?I:!1);let j=ie(()=>{var B,te;return[...Array.from((B=y==null?void 0:y.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?B:[]).filter(G=>!(!(G instanceof HTMLElement)||G.contains(v.current)||P.panelRef.current&&G.contains(P.panelRef.current))),(te=P.panelRef.current)!=null?te:d.current]});Ag(()=>j(),_,I&&!D),Fn(y==null?void 0:y.defaultView,"keydown",B=>{B.defaultPrevented||B.key===Uo.Escape&&C===0&&(D||(B.preventDefault(),B.stopPropagation(),_()))}),rp(y,C===0&&!V,j),b.useEffect(()=>{if(C!==0||!d.current)return;let B=new IntersectionObserver(te=>{for(let G of te)G.boundingClientRect.x===0&&G.boundingClientRect.y===0&&G.boundingClientRect.width===0&&G.boundingClientRect.height===0&&_()});return B.observe(d.current),()=>B.disconnect()},[C,d,_]);let[$,H]=zg(),W=b.useMemo(()=>[{dialogState:C,close:_,setTitleId:R},P],[C,P,_,R]),z=b.useMemo(()=>({open:C===0}),[C]),q={ref:p,id:n,role:"dialog","aria-modal":C===0?!0:void 0,"aria-labelledby":P.titleId,"aria-describedby":$};return T.default.createElement(Jg,{type:"Dialog",enabled:C===0,element:d,onUpdate:ie((B,te,G)=>{te==="Dialog"&&re(B,{[yn.Add](){g.current.add(G),f(ge=>ge+1)},[yn.Remove](){g.current.add(G),f(ge=>ge-1)}})})},T.default.createElement(mn,{force:!0},T.default.createElement(vn,null,T.default.createElement(fr.Provider,{value:W},T.default.createElement(vn.Group,{target:d},T.default.createElement(mn,{force:!1},T.default.createElement(H,{slot:z,name:"Dialog.Description"},T.default.createElement(Pt,{initialFocus:o,containers:g,features:I?re(k,{parent:Pt.features.RestoreFocus,leaf:Pt.features.All&~Pt.features.FocusLock}):Pt.features.None},ye({ourProps:q,theirProps:u,slot:z,defaultTag:ip,features:ap,visible:C===0,name:"Dialog"})))))))),T.default.createElement(hn,{features:cr.Hidden,ref:v}))}),sp="div",up=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=Mt("Dialog.Overlay"),s=Oe(t),u=ie(f=>{if(f.target===f.currentTarget){if(Tg(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),o()}}),l=b.useMemo(()=>({open:a===0}),[a]);return ye({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:l,defaultTag:sp,name:"Dialog.Overlay"})}),lp="div",cp=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=Mt("Dialog.Backdrop"),s=Oe(t);b.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let u=b.useMemo(()=>({open:a===0}),[a]);return T.default.createElement(mn,{force:!0},T.default.createElement(vn,null,ye({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:lp,name:"Dialog.Backdrop"})))}),fp="div",dp=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=Mt("Dialog.Panel"),s=Oe(t,o.panelRef),u=b.useMemo(()=>({open:a===0}),[a]),l=ie(f=>{f.stopPropagation()});return ye({ourProps:{ref:s,id:n,onClick:l},theirProps:i,slot:u,defaultTag:fp,name:"Dialog.Panel"})}),gp="h2",pp=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=Mt("Dialog.Title"),s=Oe(t);b.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=b.useMemo(()=>({open:a===0}),[a]);return ye({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:gp,name:"Dialog.Title"})}),ha=Object.assign(op,{Backdrop:cp,Panel:dp,Overlay:up,Title:pp,Description:Yg});function hp(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function Xr(e,...t){e&&t.length>0&&e.classList.add(...t)}function en(e,...t){e&&t.length>0&&e.classList.remove(...t)}function mp(e,t){let r=jt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(s=>{let[u=0]=s.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,f)=>f-l);return u});if(a+o!==0){let s=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),s())})}else t();return r.add(()=>t()),r.dispose}function vp(e,t,r,n){let i=r?"enter":"leave",a=jt(),o=n!==void 0?hp(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=re(i,{enter:()=>t.enter,leave:()=>t.leave}),u=re(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=re(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return en(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Xr(e,...s,...l),a.nextFrame(()=>{en(e,...l),Xr(e,...u),mp(e,()=>(en(e,...s),Xr(e,...t.entered),o()))}),a.dispose}function yp({container:e,direction:t,classes:r,onStart:n,onStop:i}){let a=Er(),o=Tn(),s=Le(t);De(()=>{let u=jt();o.add(u.dispose);let l=e.current;if(!!l&&s.current!=="idle"&&!!a.current)return u.dispose(),n.current(s.current),u.add(vp(l,r.current,s.current==="enter",()=>{u.dispose(),i.current(s.current)})),u.dispose},[t])}function bp(...e){return e.filter(Boolean).join(" ")}function Ge(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Cr=b.createContext(null);Cr.displayName="TransitionContext";var Sp=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Sp||{});function Op(){let e=b.useContext(Cr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function wp(){let e=b.useContext(Ar);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ar=b.createContext(null);Ar.displayName="NestingContext";function _r(e){return"children"in e?_r(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Qo(e,t){let r=Le(e),n=b.useRef([]),i=Er(),a=Tn(),o=ie((d,p=Re.Hidden)=>{let v=n.current.findIndex(({el:y})=>y===d);v!==-1&&(re(p,{[Re.Unmount](){n.current.splice(v,1)},[Re.Hidden](){n.current[v].state="hidden"}}),a.microTask(()=>{var y;!_r(n)&&i.current&&((y=r.current)==null||y.call(r))}))}),s=ie(d=>{let p=n.current.find(({el:v})=>v===d);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:d,state:"visible"}),()=>o(d,Re.Unmount)}),u=b.useRef([]),l=b.useRef(Promise.resolve()),f=b.useRef({enter:[],leave:[],idle:[]}),c=ie((d,p,v)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([y])=>y!==d)),t==null||t.chains.current[p].push([d,new Promise(y=>{u.current.push(y)})]),t==null||t.chains.current[p].push([d,new Promise(y=>{Promise.all(f.current[p].map(([m,S])=>S)).then(()=>y())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),g=ie((d,p,v)=>{Promise.all(f.current[p].splice(0).map(([y,m])=>m)).then(()=>{var y;(y=u.current.shift())==null||y()}).then(()=>v(p))});return b.useMemo(()=>({children:n,register:s,unregister:o,onStart:c,onStop:g,wait:l,chains:f}),[s,o,n,c,g,f,l])}function xp(){}let Ep=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ma(e){var t;let r={};for(let n of Ep)r[n]=(t=e[n])!=null?t:xp;return r}function Pp(e){let t=b.useRef(ma(e));return b.useEffect(()=>{t.current=ma(e)},[e]),t}let Cp="div",Yo=lr.RenderStrategy,qo=de(function(e,t){let{beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a,enter:o,enterFrom:s,enterTo:u,entered:l,leave:f,leaveFrom:c,leaveTo:g,...d}=e,p=b.useRef(null),v=Oe(p,t),y=d.unmount?Re.Unmount:Re.Hidden,{show:m,appear:S,initial:C}=Op(),[P,E]=b.useState(m?"visible":"hidden"),_=wp(),{register:R,unregister:I}=_,D=b.useRef(null);b.useEffect(()=>R(p),[R,p]),b.useEffect(()=>{if(y===Re.Hidden&&!!p.current){if(m&&P!=="visible"){E("visible");return}return re(P,{hidden:()=>I(p),visible:()=>R(p)})}},[P,p,R,I,m,y]);let V=Le({enter:Ge(o),enterFrom:Ge(s),enterTo:Ge(u),entered:Ge(l),leave:Ge(f),leaveFrom:Ge(c),leaveTo:Ge(g)}),k=Pp({beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a}),j=ht();b.useEffect(()=>{if(j&&P==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,P,j]);let $=C&&!S,H=(()=>!j||$||D.current===m?"idle":m?"enter":"leave")(),W=ie(G=>re(G,{enter:()=>k.current.beforeEnter(),leave:()=>k.current.beforeLeave(),idle:()=>{}})),z=ie(G=>re(G,{enter:()=>k.current.afterEnter(),leave:()=>k.current.afterLeave(),idle:()=>{}})),q=Qo(()=>{E("hidden"),I(p)},_);yp({container:p,classes:V,direction:H,onStart:Le(G=>{q.onStart(p,G,W)}),onStop:Le(G=>{q.onStop(p,G,z),G==="leave"&&!_r(q)&&(E("hidden"),I(p))})}),b.useEffect(()=>{!$||(y===Re.Hidden?D.current=null:D.current=m)},[m,$,P]);let B=d,te={ref:v};return S&&m&&(typeof window=="undefined"||typeof document=="undefined")&&(B={...B,className:bp(d.className,...V.current.enter,...V.current.enterFrom)}),T.default.createElement(Ar.Provider,{value:q},T.default.createElement(Ig,{value:re(P,{visible:Je.Open,hidden:Je.Closed})},ye({ourProps:te,theirProps:B,defaultTag:Cp,features:Yo,visible:P==="visible",name:"Transition.Child"})))}),bn=de(function(e,t){let{show:r,appear:n=!1,unmount:i,...a}=e,o=b.useRef(null),s=Oe(o,t);ht();let u=In();if(r===void 0&&u!==null&&(r=re(u,{[Je.Open]:!0,[Je.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,f]=b.useState(r?"visible":"hidden"),c=Qo(()=>{f("hidden")}),[g,d]=b.useState(!0),p=b.useRef([r]);De(()=>{g!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),d(!1))},[p,r]);let v=b.useMemo(()=>({show:r,appear:n,initial:g}),[r,n,g]);b.useEffect(()=>{if(r)f("visible");else if(!_r(c))f("hidden");else{let m=o.current;if(!m)return;let S=m.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&f("hidden")}},[r,c]);let y={unmount:i};return T.default.createElement(Ar.Provider,{value:c},T.default.createElement(Cr.Provider,{value:v},ye({ourProps:{...y,as:b.Fragment,children:T.default.createElement(qo,{ref:s,...y,...a})},theirProps:{},defaultTag:b.Fragment,features:Yo,visible:l==="visible",name:"Transition"})))}),Ap=de(function(e,t){let r=b.useContext(Cr)!==null,n=In()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(bn,{ref:t,...e}):T.default.createElement(qo,{ref:t,...e}))}),tn=Object.assign(bn,{Child:Ap,Root:bn});function _p(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Fo({isModal:!0});return w(Ce,{children:w(tn,{appear:!0,show:r,as:b.Fragment,children:w(ha,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:U("div",{className:"min-h-screen text-center sm:px-4",children:[w(tn.Child,{as:b.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:w(ha.Overlay,{className:"fixed inset-0"})}),w("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),w(tn.Child,{as:b.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:U("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[w("div",{className:"sticky top-0 z-10 flex items-center w-full px-3 text-lg font-medium leading-6 text-gray-900 bg-white h-14 modal-header",children:w("div",{className:"",children:U("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",w("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",w("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),w("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function Np(e){var H,W,z,q;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:a,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l,children:f}=e,{minPrice:c="0"}=t,[g,d]=b.useState("auto"),[p,v]=b.useState(0);b.useEffect(()=>{v(1);const B=setTimeout(()=>{E||v(2)},250);return()=>{clearTimeout(B)}},[]);const{displayPriceFrom:y,formattedEndPrice:m}=Ed(a,c,o),S=b.useRef(),C=b.useRef(),{isSm:P,isMobile:E,windowHeight:_}=Fo({isModal:!0}),R=U(Ce,{children:[U("div",{className:Et("px-4 w-full",P&&"sm:sticky sm:top-0 sm:w-2/5"),ref:S,children:[t.details.media&&t.details.media[0].url&&w("img",{className:Et("mx-auto mt-2 mb-6 max-h-[250px]",P&&"max-h-[450px]"),alt:t.details.literals.name,src:(H=t.details)==null?void 0:H.media[0].url}),w("div",{className:Et(!i&&"hidden"),children:w(Io,{})})]}),U("div",{className:Et("w-full",P&&"sm:w-3/5"),ref:C,children:[U("div",{className:"items-center w-full p-4",children:[U("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[U("span",{className:"",children:[t.details.literals.name," "]}),w(Sr,{price:e.countedProductPrice,minPrice:c})]}),w("span",{className:"text-gray-600",children:(W=t.details.literals)==null?void 0:W.description})]}),U("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[f,w("div",{className:"sm:h-[64px]"})]}),P&&w("div",{className:"-mt-5 mb-2 bg-gray-100",children:w(la,{finalPrice:m,isBackIcon:!1,handleGoBack:n,displayPriceFrom:y})})]})]}),I=(z=S==null?void 0:S.current)==null?void 0:z.clientHeight,D=(q=C==null?void 0:C.current)==null?void 0:q.clientHeight,V=I+D;V>window.innerHeight*.8||isNaN(V)?g!=="80vh"&&d("80vh"):g!=="auto"&&d("auto");const k=`${_-64-56}px`,j=!P,$={"--mobile-submit-row-top":`${_-64-80}px`};return w(_p,{isOpen:Boolean(r),handleClose:n,children:U("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[w("div",{className:Et("flex relative flex-col items-start w-full form-body stretch",!j&&"sm:flex-row-reverse sm:pb-0",!E&&"mobile-scrollbar"),style:{height:`${E?k:g}`,minHeight:"400px",overflowY:"scroll"},children:R}),j&&w("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${E?"submit-row-mobile":"submit-row"}`,style:$,children:w(la,{handleGoBack:n,finalPrice:m,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l})})]})})}const Tp=e=>{const{product:t}=e,{MenuProductRootUI:r}=Or(),n=yr(t.items)?w(Ce,{}):w(Nn,{productItems:t.items,parentProduct:t});return r?w(r,{...e,children:n}):w(Np,{...e,children:n})};function Rp(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:a,handleClose:o,currency:s,showDebugState:u=!1}=e,{price:l}=t,{encodedProduct:f,initSelected:c,filter:g,productQuantity:d,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:v,getValidationMap:y,increaseProductQuantity:m,decreaseProductQuantity:S,setCurrency:C}=Bf(t),[P,E]=b.useState(y());b.useEffect(()=>{oe.changeLanguage(r)},[r]),b.useEffect(()=>{C(s)},[s]),b.useEffect(()=>{const j=y();kf(j,P)||E(j)});const _=Ga({defaultValues:{selected:c}}),{handleSubmit:R,getValues:I}=_,D=Number((parseFloat(l||"0")+Cn(I("selected"),t)).toFixed(2)),V=()=>{console.log("onSubmit"),p();const j=v();if(j.length)cu(no(j[0])),console.log({invalidContextNames:j});else{console.log("selected",I("selected"));const $=uu(su(I("selected")));console.log("decodedCleanedSelected: ",$),n({price:D,quantity:d,selected:$,filter:g})}},k=()=>V();return w(Ce,{children:w(Ro.Provider,{value:e.components,children:w(_a,{..._,children:U("form",{children:[u&&w("div",{className:"hidden",children:w(Io,{})}),w(Tp,{product:f,productQuantity:d,validationMap:P,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:k,countedProductPrice:D,countedProductTotalPrice:D*d,increaseProductQuantity:m,decreaseProductQuantity:S,currency:s})]})})})})}exports.ContextType=Pn;exports.MainView=Ka;exports.ProductConfigurator=Rp;exports.ProductKinds=hr;exports.ProductTypes=za;exports.SelMinSelMaxStatus=he;exports.hookForm=Ys;
17
+ `));return b.cloneElement(l,Object.assign({},$o(l.props,da(Zr(s,["ref"]))),f,u,Ng(l.ref,u.ref)))}return b.createElement(i,Object.assign({},Zr(s,["ref"]),i!==b.Fragment&&u,i!==b.Fragment&&f),l)}function Ng(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function $o(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...a){let o=r[n];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function de(e){var t;return Object.assign(b.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function da(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Zr(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}function Tg(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&Rg(r)?!1:n}function Rg(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Lg="div";var cr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(cr||{});let hn=de(function(e,t){let{features:r=1,...n}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ye({ourProps:i,theirProps:n,slot:{},defaultTag:Lg,name:"Hidden"})}),Ln=b.createContext(null);Ln.displayName="OpenClosedContext";var Je=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Je||{});function In(){return b.useContext(Ln)}function Ig({value:e,children:t}){return T.default.createElement(Ln.Provider,{value:e},t)}var Uo=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Uo||{});function Vo(e,t){let r=b.useRef([]),n=ie(e);b.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Fg(e,t,r){let n=Le(t);b.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}var At=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(At||{});function kg(){let e=b.useRef(0);return Fg("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Er(){let e=b.useRef(!1);return De(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Pr(...e){return b.useMemo(()=>Rn(...e),[...e])}function Fn(e,t,r,n){let i=Le(r);b.useEffect(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}let Dg="div";var Bo=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Bo||{});let Pt=Object.assign(de(function(e,t){let r=b.useRef(null),n=Oe(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;ht()||(o=1);let u=Pr(r);jg({ownerDocument:u},Boolean(o&16));let l=Mg({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));$g({ownerDocument:u,container:r,containers:a,previousActiveElement:l},Boolean(o&8));let f=kg(),c=ie(v=>{let y=r.current;!y||(m=>m())(()=>{re(f.current,{[At.Forwards]:()=>qt(y,ze.First,{skipElements:[v.relatedTarget]}),[At.Backwards]:()=>qt(y,ze.Last,{skipElements:[v.relatedTarget]})})})}),g=Tn(),d=b.useRef(!1),p={ref:n,onKeyDown(v){v.key=="Tab"&&(d.current=!0,g.requestAnimationFrame(()=>{d.current=!1}))},onBlur(v){let y=new Set(a==null?void 0:a.current);y.add(r);let m=v.relatedTarget;!m||m.dataset.headlessuiFocusGuard!=="true"&&(Ho(y,m)||(d.current?qt(r.current,re(f.current,{[At.Forwards]:()=>ze.Next,[At.Backwards]:()=>ze.Previous})|ze.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&Ye(v.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(hn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:cr.Focusable}),ye({ourProps:p,theirProps:s,defaultTag:Dg,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(hn,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:cr.Focusable}))}),{features:Bo});function jg({ownerDocument:e},t){let r=b.useRef(null);Fn(e==null?void 0:e.defaultView,"focusout",i=>{!t||r.current||(r.current=i.target)},!0),Vo(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Ye(r.current),r.current=null)},[t]);let n=b.useRef(!1);b.useEffect(()=>(n.current=!1,()=>{n.current=!0,xr(()=>{!n.current||(Ye(r.current),r.current=null)})}),[])}function Mg({ownerDocument:e,container:t,initialFocus:r},n){let i=b.useRef(null),a=Er();return Vo(()=>{if(!n)return;let o=t.current;!o||xr(()=>{if(!a.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){i.current=s;return}}else if(o.contains(s)){i.current=s;return}r!=null&&r.current?Ye(r.current):qt(o,ze.First)===Do.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function $g({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=Er();Fn(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=new Set(r==null?void 0:r.current);s.add(t);let u=n.current;if(!u)return;let l=o.target;l&&l instanceof HTMLElement?Ho(s,l)?(n.current=l,Ye(l)):(o.preventDefault(),o.stopPropagation(),Ye(u)):Ye(n.current)},!0)}function Ho(e,t){var r;for(let n of e)if((r=n.current)!=null&&r.contains(t))return!0;return!1}let at=new Set,Ue=new Map;function ga(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function pa(e){let t=Ue.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Ug(e,t=!0){De(()=>{if(!t||!e.current)return;let r=e.current,n=Rn(r);if(n){at.add(r);for(let i of Ue.keys())i.contains(r)&&(pa(i),Ue.delete(i));return n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement){for(let a of at)if(i.contains(a))return;at.size===1&&(Ue.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),ga(i))}}),()=>{if(at.delete(r),at.size>0)n.querySelectorAll("body > *").forEach(i=>{if(i instanceof HTMLElement&&!Ue.has(i)){for(let a of at)if(i.contains(a))return;Ue.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),ga(i)}});else for(let i of Ue.keys())pa(i),Ue.delete(i)}}},[t])}let Wo=b.createContext(!1);function Vg(){return b.useContext(Wo)}function mn(e){return T.default.createElement(Wo.Provider,{value:e.force},e.children)}function Bg(e){let t=Vg(),r=b.useContext(Go),n=Pr(e),[i,a]=b.useState(()=>{if(!t&&r!==null||wr)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return b.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),b.useEffect(()=>{t||r!==null&&a(r.current)},[r,a,t]),i}let Hg=b.Fragment,Wg=de(function(e,t){let r=e,n=b.useRef(null),i=Oe(_g(f=>{n.current=f}),t),a=Pr(n),o=Bg(n),[s]=b.useState(()=>{var f;return wr?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),u=ht(),l=b.useRef(!1);return De(()=>{if(l.current=!1,!(!o||!s))return o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s)),()=>{l.current=!0,xr(()=>{var f;!l.current||!o||!s||(o.removeChild(s),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))})}},[o,s]),u?!o||!s?null:es.createPortal(ye({ourProps:{ref:i},theirProps:r,defaultTag:Hg,name:"Portal"}),s):null}),Gg=b.Fragment,Go=b.createContext(null),Kg=de(function(e,t){let{target:r,...n}=e,i={ref:Oe(t)};return T.default.createElement(Go.Provider,{value:r},ye({ourProps:i,theirProps:n,defaultTag:Gg,name:"Popover.Group"}))}),vn=Object.assign(Wg,{Group:Kg}),Ko=b.createContext(null);function zo(){let e=b.useContext(Ko);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,zo),t}return e}function zg(){let[e,t]=b.useState([]);return[e.length>0?e.join(" "):void 0,b.useMemo(()=>function(r){let n=ie(a=>(t(o=>[...o,a]),()=>t(o=>{let s=o.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s}))),i=b.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return T.default.createElement(Ko.Provider,{value:i},r.children)},[t])]}let Qg="p",Yg=de(function(e,t){let r=mt(),{id:n=`headlessui-description-${r}`,...i}=e,a=zo(),o=Oe(t);De(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return ye({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:Qg,name:a.name||"Description"})}),kn=b.createContext(()=>{});kn.displayName="StackContext";var yn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(yn||{});function qg(){return b.useContext(kn)}function Jg({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=qg(),o=ie((...s)=>{t==null||t(...s),a(...s)});return De(()=>{let s=i===void 0||i===!0;return s&&o(0,r,n),()=>{s&&o(1,r,n)}},[o,r,n,i]),T.default.createElement(kn.Provider,{value:o},e)}function Zg(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Xg=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Xg||{}),ep=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(ep||{});let tp={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},fr=b.createContext(null);fr.displayName="DialogContext";function Mt(e){let t=b.useContext(fr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Mt),r}return t}function rp(e,t,r=()=>[document.body]){b.useEffect(()=>{var n;if(!t||!e)return;let i=jt(),a=window.pageYOffset;function o(l,f,c){let g=l.style.getPropertyValue(f);return Object.assign(l.style,{[f]:c}),i.add(()=>{Object.assign(l.style,{[f]:g})})}let s=e.documentElement,u=((n=e.defaultView)!=null?n:window).innerWidth-s.clientWidth;if(o(s,"overflow","hidden"),u>0){let l=s.clientWidth-s.offsetWidth,f=u-l;o(s,"paddingRight",`${f}px`)}if(Zg()){o(e.body,"marginTop",`-${a}px`),window.scrollTo(0,0);let l=null;i.addEventListener(e,"click",f=>{if(f.target instanceof HTMLElement)try{let c=f.target.closest("a");if(!c)return;let{hash:g}=new URL(c.href),d=e.querySelector(g);d&&!r().some(p=>p.contains(d))&&(l=d)}catch{}},!0),i.addEventListener(e,"touchmove",f=>{f.target instanceof HTMLElement&&!r().some(c=>c.contains(f.target))&&f.preventDefault()},{passive:!1}),i.add(()=>{window.scrollTo(0,window.pageYOffset+a),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})}return i.dispose},[e,t])}function np(e,t){return re(t.type,tp,e,t)}let ip="div",ap=lr.RenderStrategy|lr.Static,op=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:a,initialFocus:o,__demoMode:s=!1,...u}=e,[l,f]=b.useState(0),c=In();i===void 0&&c!==null&&(i=re(c,{[Je.Open]:!0,[Je.Closed]:!1}));let g=b.useRef(new Set),d=b.useRef(null),p=Oe(d,t),v=b.useRef(null),y=Pr(d),m=e.hasOwnProperty("open")||c!==null,S=e.hasOwnProperty("onClose");if(!m&&!S)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!m)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!S)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof a!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let C=i?0:1,[P,E]=b.useReducer(np,{titleId:null,descriptionId:null,panelRef:b.createRef()}),_=ie(()=>a(!1)),R=ie(B=>E({type:0,id:B})),I=ht()?s?!1:C===0:!1,D=l>1,V=b.useContext(fr)!==null,k=D?"parent":"leaf";Ug(d,D?I:!1);let j=ie(()=>{var B,te;return[...Array.from((B=y==null?void 0:y.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?B:[]).filter(G=>!(!(G instanceof HTMLElement)||G.contains(v.current)||P.panelRef.current&&G.contains(P.panelRef.current))),(te=P.panelRef.current)!=null?te:d.current]});Ag(()=>j(),_,I&&!D),Fn(y==null?void 0:y.defaultView,"keydown",B=>{B.defaultPrevented||B.key===Uo.Escape&&C===0&&(D||(B.preventDefault(),B.stopPropagation(),_()))}),rp(y,C===0&&!V,j),b.useEffect(()=>{if(C!==0||!d.current)return;let B=new IntersectionObserver(te=>{for(let G of te)G.boundingClientRect.x===0&&G.boundingClientRect.y===0&&G.boundingClientRect.width===0&&G.boundingClientRect.height===0&&_()});return B.observe(d.current),()=>B.disconnect()},[C,d,_]);let[$,H]=zg(),W=b.useMemo(()=>[{dialogState:C,close:_,setTitleId:R},P],[C,P,_,R]),z=b.useMemo(()=>({open:C===0}),[C]),q={ref:p,id:n,role:"dialog","aria-modal":C===0?!0:void 0,"aria-labelledby":P.titleId,"aria-describedby":$};return T.default.createElement(Jg,{type:"Dialog",enabled:C===0,element:d,onUpdate:ie((B,te,G)=>{te==="Dialog"&&re(B,{[yn.Add](){g.current.add(G),f(ge=>ge+1)},[yn.Remove](){g.current.add(G),f(ge=>ge-1)}})})},T.default.createElement(mn,{force:!0},T.default.createElement(vn,null,T.default.createElement(fr.Provider,{value:W},T.default.createElement(vn.Group,{target:d},T.default.createElement(mn,{force:!1},T.default.createElement(H,{slot:z,name:"Dialog.Description"},T.default.createElement(Pt,{initialFocus:o,containers:g,features:I?re(k,{parent:Pt.features.RestoreFocus,leaf:Pt.features.All&~Pt.features.FocusLock}):Pt.features.None},ye({ourProps:q,theirProps:u,slot:z,defaultTag:ip,features:ap,visible:C===0,name:"Dialog"})))))))),T.default.createElement(hn,{features:cr.Hidden,ref:v}))}),sp="div",up=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=Mt("Dialog.Overlay"),s=Oe(t),u=ie(f=>{if(f.target===f.currentTarget){if(Tg(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),o()}}),l=b.useMemo(()=>({open:a===0}),[a]);return ye({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:l,defaultTag:sp,name:"Dialog.Overlay"})}),lp="div",cp=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=Mt("Dialog.Backdrop"),s=Oe(t);b.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let u=b.useMemo(()=>({open:a===0}),[a]);return T.default.createElement(mn,{force:!0},T.default.createElement(vn,null,ye({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:lp,name:"Dialog.Backdrop"})))}),fp="div",dp=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=Mt("Dialog.Panel"),s=Oe(t,o.panelRef),u=b.useMemo(()=>({open:a===0}),[a]),l=ie(f=>{f.stopPropagation()});return ye({ourProps:{ref:s,id:n,onClick:l},theirProps:i,slot:u,defaultTag:fp,name:"Dialog.Panel"})}),gp="h2",pp=de(function(e,t){let r=mt(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=Mt("Dialog.Title"),s=Oe(t);b.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=b.useMemo(()=>({open:a===0}),[a]);return ye({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:gp,name:"Dialog.Title"})}),ha=Object.assign(op,{Backdrop:cp,Panel:dp,Overlay:up,Title:pp,Description:Yg});function hp(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function Xr(e,...t){e&&t.length>0&&e.classList.add(...t)}function en(e,...t){e&&t.length>0&&e.classList.remove(...t)}function mp(e,t){let r=jt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(s=>{let[u=0]=s.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,f)=>f-l);return u});if(a+o!==0){let s=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),s())})}else t();return r.add(()=>t()),r.dispose}function vp(e,t,r,n){let i=r?"enter":"leave",a=jt(),o=n!==void 0?hp(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=re(i,{enter:()=>t.enter,leave:()=>t.leave}),u=re(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=re(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return en(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Xr(e,...s,...l),a.nextFrame(()=>{en(e,...l),Xr(e,...u),mp(e,()=>(en(e,...s),Xr(e,...t.entered),o()))}),a.dispose}function yp({container:e,direction:t,classes:r,onStart:n,onStop:i}){let a=Er(),o=Tn(),s=Le(t);De(()=>{let u=jt();o.add(u.dispose);let l=e.current;if(!!l&&s.current!=="idle"&&!!a.current)return u.dispose(),n.current(s.current),u.add(vp(l,r.current,s.current==="enter",()=>{u.dispose(),i.current(s.current)})),u.dispose},[t])}function bp(...e){return e.filter(Boolean).join(" ")}function Ge(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Cr=b.createContext(null);Cr.displayName="TransitionContext";var Sp=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Sp||{});function Op(){let e=b.useContext(Cr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function wp(){let e=b.useContext(Ar);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ar=b.createContext(null);Ar.displayName="NestingContext";function _r(e){return"children"in e?_r(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Qo(e,t){let r=Le(e),n=b.useRef([]),i=Er(),a=Tn(),o=ie((d,p=Re.Hidden)=>{let v=n.current.findIndex(({el:y})=>y===d);v!==-1&&(re(p,{[Re.Unmount](){n.current.splice(v,1)},[Re.Hidden](){n.current[v].state="hidden"}}),a.microTask(()=>{var y;!_r(n)&&i.current&&((y=r.current)==null||y.call(r))}))}),s=ie(d=>{let p=n.current.find(({el:v})=>v===d);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:d,state:"visible"}),()=>o(d,Re.Unmount)}),u=b.useRef([]),l=b.useRef(Promise.resolve()),f=b.useRef({enter:[],leave:[],idle:[]}),c=ie((d,p,v)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([y])=>y!==d)),t==null||t.chains.current[p].push([d,new Promise(y=>{u.current.push(y)})]),t==null||t.chains.current[p].push([d,new Promise(y=>{Promise.all(f.current[p].map(([m,S])=>S)).then(()=>y())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),g=ie((d,p,v)=>{Promise.all(f.current[p].splice(0).map(([y,m])=>m)).then(()=>{var y;(y=u.current.shift())==null||y()}).then(()=>v(p))});return b.useMemo(()=>({children:n,register:s,unregister:o,onStart:c,onStop:g,wait:l,chains:f}),[s,o,n,c,g,f,l])}function xp(){}let Ep=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ma(e){var t;let r={};for(let n of Ep)r[n]=(t=e[n])!=null?t:xp;return r}function Pp(e){let t=b.useRef(ma(e));return b.useEffect(()=>{t.current=ma(e)},[e]),t}let Cp="div",Yo=lr.RenderStrategy,qo=de(function(e,t){let{beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a,enter:o,enterFrom:s,enterTo:u,entered:l,leave:f,leaveFrom:c,leaveTo:g,...d}=e,p=b.useRef(null),v=Oe(p,t),y=d.unmount?Re.Unmount:Re.Hidden,{show:m,appear:S,initial:C}=Op(),[P,E]=b.useState(m?"visible":"hidden"),_=wp(),{register:R,unregister:I}=_,D=b.useRef(null);b.useEffect(()=>R(p),[R,p]),b.useEffect(()=>{if(y===Re.Hidden&&!!p.current){if(m&&P!=="visible"){E("visible");return}return re(P,{hidden:()=>I(p),visible:()=>R(p)})}},[P,p,R,I,m,y]);let V=Le({enter:Ge(o),enterFrom:Ge(s),enterTo:Ge(u),entered:Ge(l),leave:Ge(f),leaveFrom:Ge(c),leaveTo:Ge(g)}),k=Pp({beforeEnter:r,afterEnter:n,beforeLeave:i,afterLeave:a}),j=ht();b.useEffect(()=>{if(j&&P==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,P,j]);let $=C&&!S,H=(()=>!j||$||D.current===m?"idle":m?"enter":"leave")(),W=ie(G=>re(G,{enter:()=>k.current.beforeEnter(),leave:()=>k.current.beforeLeave(),idle:()=>{}})),z=ie(G=>re(G,{enter:()=>k.current.afterEnter(),leave:()=>k.current.afterLeave(),idle:()=>{}})),q=Qo(()=>{E("hidden"),I(p)},_);yp({container:p,classes:V,direction:H,onStart:Le(G=>{q.onStart(p,G,W)}),onStop:Le(G=>{q.onStop(p,G,z),G==="leave"&&!_r(q)&&(E("hidden"),I(p))})}),b.useEffect(()=>{!$||(y===Re.Hidden?D.current=null:D.current=m)},[m,$,P]);let B=d,te={ref:v};return S&&m&&(typeof window=="undefined"||typeof document=="undefined")&&(B={...B,className:bp(d.className,...V.current.enter,...V.current.enterFrom)}),T.default.createElement(Ar.Provider,{value:q},T.default.createElement(Ig,{value:re(P,{visible:Je.Open,hidden:Je.Closed})},ye({ourProps:te,theirProps:B,defaultTag:Cp,features:Yo,visible:P==="visible",name:"Transition.Child"})))}),bn=de(function(e,t){let{show:r,appear:n=!1,unmount:i,...a}=e,o=b.useRef(null),s=Oe(o,t);ht();let u=In();if(r===void 0&&u!==null&&(r=re(u,{[Je.Open]:!0,[Je.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,f]=b.useState(r?"visible":"hidden"),c=Qo(()=>{f("hidden")}),[g,d]=b.useState(!0),p=b.useRef([r]);De(()=>{g!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),d(!1))},[p,r]);let v=b.useMemo(()=>({show:r,appear:n,initial:g}),[r,n,g]);b.useEffect(()=>{if(r)f("visible");else if(!_r(c))f("hidden");else{let m=o.current;if(!m)return;let S=m.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&f("hidden")}},[r,c]);let y={unmount:i};return T.default.createElement(Ar.Provider,{value:c},T.default.createElement(Cr.Provider,{value:v},ye({ourProps:{...y,as:b.Fragment,children:T.default.createElement(qo,{ref:s,...y,...a})},theirProps:{},defaultTag:b.Fragment,features:Yo,visible:l==="visible",name:"Transition"})))}),Ap=de(function(e,t){let r=b.useContext(Cr)!==null,n=In()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(bn,{ref:t,...e}):T.default.createElement(qo,{ref:t,...e}))}),tn=Object.assign(bn,{Child:Ap,Root:bn});function _p(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Fo({isModal:!0});return w(Ce,{children:w(tn,{appear:!0,show:r,as:b.Fragment,children:w(ha,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:U("div",{className:"min-h-screen text-center sm:px-4",children:[w(tn.Child,{as:b.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:w(ha.Overlay,{className:"fixed inset-0"})}),w("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),w(tn.Child,{as:b.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:U("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[w("div",{className:"sticky top-0 z-10 flex items-center w-full px-3 text-lg font-medium leading-6 text-gray-900 bg-white h-14 modal-header",children:w("div",{className:"",children:U("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",w("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",w("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),w("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function Np(e){var H,W,z,q;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:a,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l,children:f}=e,{minPrice:c="0"}=t,[g,d]=b.useState("auto"),[p,v]=b.useState(0);b.useEffect(()=>{v(1);const B=setTimeout(()=>{E||v(2)},250);return()=>{clearTimeout(B)}},[]);const{displayPriceFrom:y,formattedEndPrice:m}=Ed(a,c,o),S=b.useRef(),C=b.useRef(),{isSm:P,isMobile:E,windowHeight:_}=Fo({isModal:!0}),R=U(Ce,{children:[U("div",{className:Et("px-4 w-full",P&&"sm:sticky sm:top-0 sm:w-2/5"),ref:S,children:[t.details.media&&t.details.media[0].url&&w("img",{className:Et("mx-auto mt-2 mb-6 max-h-[250px]",P&&"max-h-[450px]"),alt:t.details.literals.name,src:(H=t.details)==null?void 0:H.media[0].url}),w("div",{className:Et(!i&&"hidden"),children:w(Io,{})})]}),U("div",{className:Et("w-full",P&&"sm:w-3/5"),ref:C,children:[U("div",{className:"items-center w-full p-4",children:[U("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[U("span",{className:"",children:[t.details.literals.name," "]}),w(Sr,{price:e.countedProductPrice,minPrice:c})]}),w("span",{className:"text-gray-600",children:(W=t.details.literals)==null?void 0:W.description})]}),U("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[f,w("div",{className:"sm:h-[64px]"})]}),P&&w("div",{className:"-mt-5 mb-2 bg-gray-100",children:w(la,{finalPrice:m,isBackIcon:!1,handleGoBack:n,displayPriceFrom:y})})]})]}),I=(z=S==null?void 0:S.current)==null?void 0:z.clientHeight,D=(q=C==null?void 0:C.current)==null?void 0:q.clientHeight,V=I+D;V>window.innerHeight*.8||isNaN(V)?g!=="80vh"&&d("80vh"):g!=="auto"&&d("auto");const k=`${_-64-56}px`,j=!P,$={"--mobile-submit-row-top":`${_-64-80}px`};return w(_p,{isOpen:Boolean(r),handleClose:n,children:U("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[w("div",{className:Et("flex relative flex-col items-start w-full form-body stretch",!j&&"sm:flex-row-reverse sm:pb-0",!E&&"mobile-scrollbar"),style:{height:`${E?k:g}`,minHeight:"400px",overflowY:"scroll"},children:R}),j&&w("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${E?"submit-row-mobile":"submit-row"}`,style:$,children:w(la,{handleGoBack:n,finalPrice:m,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l})})]})})}const Tp=e=>{const{product:t}=e,{MenuProductRootUI:r}=Or(),n=yr(t.items)?w(Ce,{}):w(Nn,{productItems:t.items,parentProduct:t,rootProduct:t});return r?w(r,{...e,children:n}):w(Np,{...e,children:n})};function Rp(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:a,handleClose:o,currency:s,showDebugState:u=!1}=e,{price:l}=t,{encodedProduct:f,initSelected:c,filter:g,productQuantity:d,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:v,getValidationMap:y,increaseProductQuantity:m,decreaseProductQuantity:S,setCurrency:C}=Bf(t),[P,E]=b.useState(y());b.useEffect(()=>{oe.changeLanguage(r)},[r]),b.useEffect(()=>{C(s)},[s]),b.useEffect(()=>{const j=y();kf(j,P)||E(j)});const _=Ga({defaultValues:{selected:c}}),{handleSubmit:R,getValues:I}=_,D=Number((parseFloat(l||"0")+Cn(I("selected"),t)).toFixed(2)),V=()=>{console.log("onSubmit"),p();const j=v();if(j.length)cu(no(j[0])),console.log({invalidContextNames:j});else{console.log("selected",I("selected"));const $=uu(su(I("selected")));console.log("decodedCleanedSelected: ",$),n({price:D,quantity:d,selected:$,filter:g})}},k=()=>V();return w(Ce,{children:w(Ro.Provider,{value:e.components,children:w(_a,{..._,children:U("form",{children:[u&&w("div",{className:"hidden",children:w(Io,{})}),w(Tp,{product:f,productQuantity:d,validationMap:P,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:k,countedProductPrice:D,countedProductTotalPrice:D*d,increaseProductQuantity:m,decreaseProductQuantity:S,currency:s})]})})})})}exports.ContextType=Pn;exports.MainView=Ka;exports.ProductConfigurator=Rp;exports.ProductKinds=hr;exports.ProductTypes=za;exports.SelMinSelMaxStatus=he;exports.hookForm=Ys;
18
18
  //# sourceMappingURL=index.cjs.js.map