@orderingstack/front-components-product-configurator 1.0.2 → 1.0.3

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":"useMenuProduct.d.ts","sourceRoot":"","sources":["useMenuProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAOvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa;;;;;;;;;;;;6BAgD1C,GAAG;;;;EAiCpC"}
1
+ {"version":3,"file":"useMenuProduct.d.ts","sourceRoot":"","sources":["useMenuProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAOvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa;;;;;;;;;;;;6BAiD1C,GAAG;;;;EAiCpC"}
@@ -5,5 +5,5 @@ export declare enum ModalSetSizeStage {
5
5
  REFRESH_AGAIN = 2,
6
6
  BLOCKED = 3
7
7
  }
8
- export declare function MenuProductRootDefaultShitUI(props: IMenuProductRootUIProps): JSX.Element;
9
- //# sourceMappingURL=MenuProductRootDefaultShitUI.d.ts.map
8
+ export declare function MenuProductRootDefaultUI(props: IMenuProductRootUIProps): JSX.Element;
9
+ //# sourceMappingURL=MenuProductRootDefaultUI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuProductRootDefaultUI.d.ts","sourceRoot":"","sources":["MenuProductRootDefaultUI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAA;AAU/C,oBAAY,iBAAiB;IAC3B,IAAI,IAAA;IACJ,OAAO,IAAA;IACP,aAAa,IAAA;IACb,OAAO,IAAA;CACR;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,eAqKtE"}
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ children?: JSX.Element;
3
+ isOpen: boolean;
4
+ handleClose: () => void;
5
+ }
6
+ export declare function Modal(props: Props): JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=MenuProductRootDefaultUIModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuProductRootDefaultUIModal.d.ts","sourceRoot":"","sources":["MenuProductRootDefaultUIModal.tsx"],"names":[],"mappings":"AAIA,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,MAAM,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,KAAK,eAkFjC"}
@@ -1,3 +1,3 @@
1
1
  import { IProductConfiguratorProps } from '@orderingstack/ordering-types';
2
2
  export declare function ProductConfigurator(props: IProductConfiguratorProps): JSX.Element;
3
- //# sourceMappingURL=ProductConfiguratorNew.d.ts.map
3
+ //# sourceMappingURL=ProductConfigurator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductConfigurator.d.ts","sourceRoot":"","sources":["ProductConfigurator.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAEzE,OAAO,aAAa,CAAA;AAIpB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,yBAAyB,eA+GnE"}
@@ -0,0 +1,3 @@
1
+ import { ProductConfigurator } from './ProductConfigurator';
2
+ export default ProductConfigurator;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,eAAe,mBAAmB,CAAA"}
package/dist/index.cjs.js CHANGED
@@ -11,8 +11,8 @@ object-assign
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */var Rf=k.default,Zo=60103;Rt.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var ki=Symbol.for;Zo=ki("react.element"),Rt.Fragment=ki("react.fragment")}var Ff=Rf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,kf=Object.prototype.hasOwnProperty,Df={key:!0,ref:!0,__self:!0,__source:!0};function Xo(e,t,r){var i,n={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(i in t)kf.call(t,i)&&!Df.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:Zo,type:e,key:o,ref:a,props:n,_owner:Ff.current}}Rt.jsx=Xo;Rt.jsxs=Xo;pr.exports=Rt;const w=pr.exports.jsx,$=pr.exports.jsxs,xe=pr.exports.Fragment;function Di(e){const{isOk:t,isErr:r,info:i}=e;return $("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&Mf,r&&jf,i]})}const Mf=w("svg",{className:"w-6 h-6 text-green-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","data-testid":"form-check-mark",children:w("polyline",{points:"20 6 9 17 4 12"})}),jf=w("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:w("path",{strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})});var $f={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Uf={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function Pt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pt=function(t){return typeof t}:Pt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(e)}function Mi(e){return Vf(e)||Bf(e)||Hf(e)||Wf()}function Vf(e){if(Array.isArray(e))return e}function Bf(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function Hf(e,t){if(!!e){if(typeof e=="string")return ji(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ji(e,t)}}function ji(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function Wf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Kf={normalizePrecision:function(t){var r=t.reduce(function(i,n){return Math.max(i.getPrecision(),n.getPrecision())});return t.map(function(i){return i.getPrecision()!==r?i.convertPrecision(r):i})},minimum:function(t){var r=Mi(t),i=r[0],n=r.slice(1),o=i;return n.forEach(function(a){o=o.lessThan(a)?o:a}),o},maximum:function(t){var r=Mi(t),i=r[0],n=r.slice(1),o=i;return n.forEach(function(a){o=o.greaterThan(a)?o:a}),o}};function ea(e){return!isNaN(parseInt(e))&&isFinite(e)}function Gf(e){return ea(e)&&e<=100&&e>=0}function zf(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function $i(e){return e%2===0}function Ui(e){return ea(e)&&!Number.isInteger(e)}function Yf(){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 vt(e){return Math.abs(e)%1===.5}function Qf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,i){var n=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){n.readyState===4&&(n.status>=200&&n.status<400?r(JSON.parse(n.responseText)):i(new Error(n.statusText)))},onerror:function(){i(new Error("Network error"))}});n.open("GET",e,!0),qf(n,t.headers),n.send()})}function qf(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 wt(e){return typeof e=="undefined"}function ta(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(i){if(Pt(i[1])==="object"){var n=ta(i[1]);Object.entries(n).forEach(function(o){r[i[0]+t+o[0]]=o[1]})}else r[i[0]]=i[1]}),r}function Jf(e){return Boolean(e)&&(Pt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function ra(){var e=function(i,n){var o=function(u){return Math.pow(10,Yf(u))},a=Math.max(o(i),o(n));return Math.round(i*a)*Math.round(n*a)/(a*a)},t={HALF_ODD:function(i){var n=Math.round(i);return vt(i)&&$i(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return vt(i)?$i(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return vt(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return vt(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return vt(i)?Math.sign(i)*Math.ceil(Math.abs(i)):Math.round(i)},DOWN:function(i){return Math.floor(i)}};return{add:function(i,n){return i+n},subtract:function(i,n){return i-n},multiply:function(i,n){return Ui(i)||Ui(n)?e(i,n):i*n},divide:function(i,n){return i/n},modulo:function(i,n){return i%n},round:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[n](i)}}}var Zf=ra();function Xf(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(i){return!wt(i)}):[]},getMinimumFractionDigits:function(){var i=function(o){return o==="."};return wt(this.getMatches().find(i))?0:this.getMatches()[Zf.add(this.getMatches().findIndex(i),1)].split("").length},getCurrencyDisplay:function(){var i={USD:"code",dollar:"name",$:"symbol"};return i[this.getMatches().find(function(n){return n==="USD"||n==="dollar"||n==="$"})]},getStyle:function(){return wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!wt(this.getMatches().find(function(i){return i===","}))}}}function ed(e){var t=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var a in o)n=n.replace("{{".concat(a,"}}"),o[a]);return n},r=function(n,o){return Qf(t(e.endpoint,{from:n,to:o}),{headers:e.headers})};return{getExchangeRate:function(n,o){return(Jf(e.endpoint)?e.endpoint:r(n,o)).then(function(a){return ta(a)[t(e.propertyPath,{from:n,to:o})]})}}}function Tt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function td(e){Tt(Gf(e),"You must provide a numeric value between 0 and 100.",RangeError)}function rd(e){Tt(zf(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function Dr(e){Tt(Number.isInteger(e),"You must provide an integer.",TypeError)}var z=ra(),nd=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),i=r.amount,n=r.currency,o=r.precision;Dr(i),Dr(o);var a=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,l=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),c=function(p){var v=Object.assign({},Object.assign({},{amount:i,currency:n,precision:o},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){Tt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return i},getCurrency:function(){return n},getLocale:function(){return this.locale||a},setLocale:function(p){return c.call(this,{locale:p})},getPrecision:function(){return o},convertPrecision:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;Dr(p);var b=this.getPrecision(),m=p>b,S=m?z.multiply:z.divide,P=m?[p,b]:[b,p],x=Math.pow(10,z.subtract.apply(z,P));return c.call(this,{amount:z.round(S(this.getAmount(),x),v),precision:p})},add:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return c.call(this,{amount:z.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:z.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:z.round(z.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:z.round(z.divide(this.getAmount(),p),v)})},percentage:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return td(p),this.multiply(z.divide(p,100),v)},allocate:function(p){var v=this;rd(p);for(var b=p.reduce(function(x,_){return z.add(x,_)}),m=this.getAmount(),S=p.map(function(x){var _=Math.floor(z.divide(z.multiply(v.getAmount(),x),b));return m=z.subtract(m,_),c.call(v,{amount:_})}),P=0;m>0;)p[P]>0&&(S[P]=S[P].add(c.call(this,{amount:1})),m=z.subtract(m,1)),P+=1;return S},convert:function(p){var v=this,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=b.endpoint,S=m===void 0?d.endpoint:m,P=b.propertyPath,x=P===void 0?d.propertyPath||"rates.{{to}}":P,_=b.headers,M=_===void 0?d.headers:_,U=b.roundingMode,D=U===void 0?u:U,F=Object.assign({},{endpoint:S,propertyPath:x,headers:M,roundingMode:D});return ed(F).getExchangeRate(this.getCurrency(),p).then(function(V){return Tt(!wt(V),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),c.call(v,{amount:z.round(z.multiply(v.getAmount(),parseFloat(V)),F.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 z.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return z.modulo(this.getAmount(),Math.pow(10,o))!==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,b=Xf(p);return this.toRoundedUnit(b.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:b.getCurrencyDisplay(),useGrouping:b.getUseGrouping(),minimumFractionDigits:b.getMinimumFractionDigits(),style:b.getStyle(),currency:this.getCurrency()})},toUnit:function(){return z.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,b=Math.pow(10,p);return z.divide(z.round(z.multiply(this.toUnit(),b),v),b)},toObject:function(){return{amount:i,currency:n,precision:o}},toJSON:function(){return this.toObject()}}},id=Object.assign(nd,$f,Uf,Kf);const Gt=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),i=Number(r)*100;return isNaN(i)?"0.00":id({amount:Math.round(i),currency:t}).toFormat("0,0.00")},od=(e,t,r=1)=>{const i=parseFloat(e.toString());let n=!1,o=Gt(`${r*i}`);const a=`${Gt(`${o}`)}`;return i<parseFloat(t)&&(n=!0,o=`${Gt(`${t}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:o,formattedEndPrice:a}};function hr(e){const{price:t,addPlusBefore:r=!1,size:i="md",showIfPriceZero:n=!1,minPrice:o="0.00",hiddenIfPriceZero:a=!1}=e,s=parseFloat(o),u=t>s?t:o,l=Gt(`${u}`);return!t&&n===!1?null:r?$("span",{style:{visibility:`${!t&&a?"hidden":"visible"}`},className:"",children:["\xA0",`+${l}`]}):t<s?$("span",{className:"",children:["\xA0",`od ${l}`]}):w("span",{className:"",children:l})}function ad(e,t){const{selCtx:r,id:i}=e,n=J(s=>s.expanded),o=y.useMemo(()=>sd(r,i,t,n),[r,i,t,n]),a=J(s=>s.toggleExpanded);return{isExpanded:o,toggleExpanded:a}}const sd=(e,t,r,i)=>{const n=i[e+t+r];return n!==void 0?n:!0};var ud=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ld={"&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;":"/"},cd=function(t){return ld[t]},fd=function(t){return t.replace(ud,cd)};function Vi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Bi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vi(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vi(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var Jr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:fd},na,dd=y.createContext();function gd(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jr=Bi(Bi({},Jr),e)}function pd(){return Jr}var hd=function(){function e(){ge(this,e),this.usedNamespaces={}}return pe(e,[{key:"addUsedNamespaces",value:function(r){var i=this;r.forEach(function(n){i.usedNamespaces[n]||(i.usedNamespaces[n]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function md(e){na=e}function vd(){return na}var yd={type:"3rdParty",init:function(t){gd(t.options.react),md(t)}};function bd(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Hi={};function Zr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Hi[t[0]]||(typeof t[0]=="string"&&(Hi[t[0]]=new Date),bd.apply(void 0,t))}function Wi(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var i=function n(){setTimeout(function(){e.off("initialized",n)},0),r()};e.on("initialized",i)}})}function Sd(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.languages[0],n=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var a=function(u,l){var d=t.services.backendConnector.state["".concat(u,"|").concat(l)];return d===-1||d===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(i,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(i,e)&&(!n||a(o,e)))}function Od(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Zr("i18n.languages were undefined or empty",t.languages),!0;var i=t.options.ignoreJSONStructure!==void 0;return i?t.hasLoadedNamespace(e,{precheck:function(o,a){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Sd(e,t,r)}function wd(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=o.call(r)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(d){l=!0,n=d}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}function Ed(e,t){return ao(e)||wd(e,t)||so(e,t)||uo()}function Ki(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ki(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ki(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var xd=function(t,r){var i=y.useRef();return y.useEffect(function(){i.current=r?i.current:t},[t,r]),i.current};function pn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,i=y.useContext(dd)||{},n=i.i18n,o=i.defaultNS,a=r||n||vd();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new hd),!a){Zr("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&a.options.react.wait!==void 0&&Zr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=Mr(Mr(Mr({},pd()),a.options.react),t),d=l.useSuspense,c=l.keyPrefix,g=e||o||a.options&&a.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(g);var f=(a.isInitialized||a.initializedStoreOnce)&&g.every(function(D){return Od(D,a,l)});function p(){return a.getFixedT(null,l.nsMode==="fallback"?g:g[0],c)}var v=y.useState(p),b=Ed(v,2),m=b[0],S=b[1],P=g.join(),x=xd(P),_=y.useRef(!0);y.useEffect(function(){var D=l.bindI18n,F=l.bindI18nStore;_.current=!0,!f&&!d&&Wi(a,g,function(){_.current&&S(p)}),f&&x&&x!==P&&_.current&&S(p);function V(){_.current&&S(p)}return D&&a&&a.on(D,V),F&&a&&a.store.on(F,V),function(){_.current=!1,D&&a&&D.split(" ").forEach(function(L){return a.off(L,V)}),F&&a&&F.split(" ").forEach(function(L){return a.store.off(L,V)})}},[a,P]);var M=y.useRef(!0);y.useEffect(function(){_.current&&!M.current&&S(p),M.current=!1},[a,c]);var U=[m,a,f];if(U.t=m,U.i18n=a,U.ready=f,f||!f&&!d)return U;throw new Promise(function(D){Wi(a,g,function(){D()})})}var ia=[],Pd=ia.forEach,Cd=ia.slice;function Ad(e){return Pd.call(Cd.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Gi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Nd=function(t,r,i){var n=i||{};n.path=n.path||"/";var o=encodeURIComponent(r),a="".concat(t,"=").concat(o);if(n.maxAge>0){var s=n.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(n.domain){if(!Gi.test(n.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(n.domain)}if(n.path){if(!Gi.test(n.path))throw new TypeError("option path is invalid");a+="; Path=".concat(n.path)}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(n.expires.toUTCString())}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.sameSite){var u=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(u){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},zi={create:function(t,r,i,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+i*60*1e3)),n&&(o.domain=n),document.cookie=Nd(t,encodeURIComponent(r),o)},read:function(t){for(var r="".concat(t,"="),i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(r)===0)return o.substring(r.length,o.length)}return null},remove:function(t){this.create(t,"",-1)}},Td={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var i=zi.read(t.lookupCookie);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&zi.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},_d={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var i=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var n=i.substring(1),o=n.split("&"),a=0;a<o.length;a++){var s=o[a].indexOf("=");if(s>0){var u=o[a].substring(0,s);u===t.lookupQuerystring&&(r=o[a].substring(s+1))}}}return r}},yt=null,Yi=function(){if(yt!==null)return yt;try{yt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{yt=!1}return yt},Ld={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Yi()){var i=window.localStorage.getItem(t.lookupLocalStorage);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Yi()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},bt=null,Qi=function(){if(bt!==null)return bt;try{bt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{bt=!1}return bt},Id={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Qi()){var i=window.sessionStorage.getItem(t.lookupSessionStorage);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Qi()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Rd={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)r.push(navigator.languages[i]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},Fd={name:"htmlTag",lookup:function(t){var r,i=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(r=i.getAttribute("lang")),r}},kd={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof i[t.lookupFromPathIndex]!="string")return;r=i[t.lookupFromPathIndex].replace("/","")}else r=i[0].replace("/","")}return r}},Dd={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,i=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(!!i)return i[r]}};function Md(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var oa=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ge(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return pe(e,[{key:"init",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=Ad(i,this.options||{},Md()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Td),this.addDetector(_d),this.addDetector(Ld),this.addDetector(Id),this.addDetector(Rd),this.addDetector(Fd),this.addDetector(kd),this.addDetector(Dd)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var i=this;r||(r=this.options.order);var n=[];return r.forEach(function(o){if(i.detectors[o]){var a=i.detectors[o].lookup(i.options);a&&typeof a=="string"&&(a=[a]),a&&(n=n.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(r,i){var n=this;i||(i=this.options.caches),i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||i.forEach(function(o){n.detectors[o]&&n.detectors[o].cacheUserLanguage(r,n.options)}))}}]),e}();oa.type="languageDetector";const jd={"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"},$d={"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"},Ud={"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"},Vd={"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(oa).use(yd).init({resources:{pl:{translation:jd},en:{translation:$d},de:{translation:Ud},cs:{translation:Vd}}});const Bd=(e,t,r,i)=>{let n="",o="";const a=Number(e),s=Number(t);return a>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.From")} ${a}`,a>r&&(o=de.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(o=de.TOO_MUCH)),a>=0||s>=0&&r<a?(n=`${i("OS.ProductConfigurator.Quantity.Message.Max")}${n}`,n+=` ${i("OS.ProductConfigurator.Quantity.Message.Quantity")}`):a===1&&a===1?n=`${i("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(n="",o=de.IGNORE),r>=a&&r<=s&&(o=de.OK),{message:n,validationStatus:o}},Hd=(e,t,r,i)=>{let n="",o="";const a=parseInt(e||"-1"),s=parseInt(t||"-1");return a>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.From")} ${a}`,a>r&&(o=de.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(o=de.TOO_MUCH)),a>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",o=de.IGNORE),a===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=a&&r<=s&&(o=de.OK),{message:n,validationStatus:o}},Wd=e=>{const{optionsItem:t,parentSelCtx:r,selected:i,isOnSubmitted:n,actualQtyCnt:o,actualSelCnt:a,children:s}=e,{selCtx:u,details:l={},id:d,attrs:c={}}=t,{qtyMin:g,qtyMax:f,selMin:p,selMax:v}=c,{name:b,description:m}=l.literals||{},{t:S}=pn(),{isExpanded:P,toggleExpanded:x}=ad(t,r),{validationStatus:_,message:M}=Hd(p,v,a,S),{validationStatus:U,message:D}=Bd(g,f,o,S),F=_===de.OK,V=U===de.OK,L=!F&&n&&!!M,I=!V&&n&&!!D;return $("div",{className:"pt-1 mb-3",id:Ro(u),children:[$("div",{className:"flex text-xl font-semibold",children:[w("p",{className:"",children:b}),b&&b!==" "&&$(xe,{children:[w("div",{className:"ml-auto",children:w(hr,{price:dn(i,t)})}),w("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!P&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>x(u,d,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:$("div",{children:[w(Di,{isOk:F,isErr:L,info:M}),w(Di,{isOk:V,isErr:I,info:D})]})}),w("div",{className:`${P?"block":"hidden"}`,children:s})]})},aa=k.default.createContext(null);function mr(){const e=y.useContext(aa);if(!e)throw new Error("Missing ComponentsContext");return e}const Kd=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:i,parentKind:n}=e,{isFilterValidated:o,selected:a,isOnSubmitted:s,selCnt:u,qtyCnt:l,currency:d}=Nf(t,i,n,r),{MenuOptionsUI:c}=mr();if(!o)return null;const g=w(hn,{productItems:t.items,parentProduct:t}),f={optionsItem:t,parentSelCtx:r,selected:a,isOnSubmitted:s,actualQtyCnt:l,actualSelCnt:u,currency:d};return c?w(c,{...f,children:g}):w(Wd,{...f,children:g})},Gd=e=>{const{product:t,inputId:r,isDisabled:i,registerProps:n,size:o="lg",children:a}=e,{details:{literals:s}={}}=t,{name:u="",description:l=""}=s||{},d=No(t),c=Fo(t);return $("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${i&&"opacity-50"}`,children:[w("input",{type:"checkbox",className:`simple-checkbox checkbox-${o} mr-4`,id:r,disabled:i,value:"1",...n}),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:$("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:a}),w("label",{htmlFor:r,children:w(hr,{price:parseFloat(d),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},zd=e=>{const{product:t,inputId:r,inputValue:i,registerProps:n,isChecked:o,size:a="lg",children:s}=e,{details:{literals:u}={}}=t,{name:l="",description:d=""}=u||{},c=No(t),g=Fo(t);return $("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-${a} mr-4`,id:r,...n,value:i,checked:o}),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:$("div",{className:"relative",children:[w("p",{className:"w-full text-lg font-semibold",children:l}),w("p",{className:"text-sm text-gray-600",children:d})]})}),w("div",{className:"ml-auto",children:s}),w("label",{htmlFor:r,children:w(hr,{price:parseFloat(c||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function sa(e){const{value:t=0,add:r,subtract:i,disabledSubtract:n,disabledAdd:o,size:a="md"}=e;return $("div",{className:`counter counter-${a} 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:i,disabled:n,children:$("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:o,children:$("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 Yd(e){const{watch:t}=lr(),r=J(u=>u.setFilter),{id:i,selCtx:n,emit:o={},fltCtx:a}=e,s=t(`selected.${n}.${i}`);return y.useEffect(()=>{s&&a&&!gr(o)&&r(a,o)},[s]),{}}function Qd(){const e=J(i=>i.getInvalidSelCtxArray),t=J(i=>i.isInputEnabled),r=J(i=>i.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}function qd(e,t){var H;const{id:r,selCtx:i}=e,{allowMultiple:n,selMin:o,selMax:a}=t;Yd(e);const{isInputEnabled:s,isInputCounterIncrementEnabled:u}=Qd(),l=J(W=>W.refreshForm),d=J(W=>W.currency),{watch:c,getValues:g,setValue:f,register:p}=lr(),v=c(`selected.${i}.${r}`),{selected:b={}}=g(),m=Number(v||0),S=o==="1"&&a==="1",P=!S,x=Ws(n),_=m>1,M=u(e,b)&&(s(e)||m),U=Number(((H=b==null?void 0:b[i])==null?void 0:H[r])||0)>0,D=s(e)||m,F=`${S?"radio":"selected"}.${i}.${r}`,V=p(F,{onChange:W=>{j(W)}}),L=()=>{f(`selected.${i}.${r}`,`${m+1}`)},I=()=>{const W=m-1;f(`selected.${i}.${r}`,`${W}`)},j=W=>{const{target:{checked:G,name:Q,defaultValue:B}}=W;if(S){console.log("handleOnInputChange radio",Q,B);const te="selected."+Q.replace("radio.","").split(".")[0];f(te,{[B]:"1"}),l()}};return{registerProps:V,isRadio:S,isCheckbox:P,isCounter:x,isDecrementEnabled:_,isIncrementEnabled:M,isChecked:U,isCheckboxEnabled:D,handleCounterIncrementQty:L,handleCounterDecrementQty:I,counterValue:m,handleOnInputChange:j,inputId:`${i}.${r}`,radioInputValue:r,currency:d}}const Jd=e=>{const{product:t,parentAttrs:r,nestedLvl:i}=e,{registerProps:n,inputId:o,radioInputValue:a,isRadio:s,isCheckbox:u,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:c,isChecked:g,isCheckboxEnabled:f,counterValue:p,handleCounterIncrementQty:v,handleCounterDecrementQty:b,currency:m}=qd(t,r),{MenuProductUI:S}=mr(),P={product:t,nestedLvl:i,registerProps:n,inputId:o,radioInputValue:a,isRadio:s,isCheckbox:u,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:c,isChecked:g,isCheckboxEnabled:f,counterValue:p,handleCounterIncrementQty:v,handleCounterDecrementQty:b,currency:m},x=w(hn,{productItems:t.items,parentProduct:t,nestedLvl:i+1});return S?w(S,{...P,children:x}):w(Zd,{...P,children:x})},Zd=e=>{const{product:t,nestedLvl:r,registerProps:i,inputId:n,radioInputValue:o,isRadio:a,isCheckbox:s,isCounter:u,isDecrementEnabled:l,isIncrementEnabled:d,isChecked:c,isCheckboxEnabled:g,counterValue:f,handleCounterIncrementQty:p,handleCounterDecrementQty:v,children:b}=e,m=w(sa,{value:f,add:p,subtract:v,disabledSubtract:!l,disabledAdd:!d}),S=()=>a?w(zd,{product:t,inputId:n,inputValue:o,registerProps:i,isChecked:c,children:w(xe,{children:u&&m})}):s?w(Gd,{product:t,inputId:n,registerProps:i,isDisabled:!g,children:w(xe,{children:u&&m})}):null,P=!gr(t.items)&&f,x=xn.useTransition(P,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return $("div",{children:[S(),P?x((_,M)=>M&&w(xn.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:_,children:b},r+1)):null]})};function Xd(){return{isMenuProductToShow:r=>r.kind===at.PRODUCT&&Zn(r),isMenuOptionsToShow:r=>[at.OPTIONS,at.CONFIG].includes(r.kind)&&Zn(r)}}function hn(e){const{productItems:t,nestedLvl:r=1,parentProduct:i}=e,{attrs:n={},selCtx:o,kind:a}=i,{isMenuProductToShow:s,isMenuOptionsToShow:u}=Xd(),{MenuItemsUI:l}=mr(),c={productItems:t,parentProduct:i,renderMenuItem:g=>u(g)?w(Kd,{optionsItem:g,parentSelCtx:o,parentKind:a,nestedLvl:r}):s(g)?w(Jd,{product:g,parentAttrs:n,nestedLvl:r}):w(xe,{})};return l?w(l,{...c}):w(eg,{...c})}function eg(e){const{productItems:t,parentProduct:r,renderMenuItem:i}=e,n=r.kind!==at.PRODUCT,o=99,a=3,[s,u]=y.useState(n?a:o),{t:l}=pn(),d=()=>{u(o)},c=()=>{u(a)};return w(xe,{children:t.map((g,f)=>{if(f<s)return $("div",{children:[i(g),s===o&&n&&t.length===f+1&&qi(l("OS.ProductConfigurator.ShowLess"),c,!1)]},`${r.id}--${g.id}--${f}`);if(f===s)return qi(l("OS.ProductConfigurator.ShowMore"),d,!0)})})}const qi=(e,t,r)=>w("div",{className:"flex justify-center w-full",children:$("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,$("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}`),ua=()=>{const{watch:e}=lr(),t=e("selected"),r=J(i=>i.validationMap);return console.log({selected:t,validationMap:r}),$("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(i=>w("div",{children:Object.values(t[i]).filter(n=>n).length>0&&$(xe,{children:[$("p",{className:"text-lg font-semibold",children:[i,":"]}),Object.keys(t[i]).map(n=>w(k.default.Fragment,{children:t[i][n]&&$("p",{children:[n,":",t[i][n].toString()]})},n))]})},i))]})};function Ji(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:i,displayPriceFrom:n=!1,productQuantity:o,increaseProductQuantity:a,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:l}=pn();return $("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&$("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:i,children:[$("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(sa,{value:o,add:a,subtract:s,disabledSubtract:o===1,size:"lg"})}),$("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:`${n?"0.4":"1"}`},disabled:n,onClick:u,children:[$("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"})]}),n?w("span",{children:`${l("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):w("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Add")} ${t}`})]})]})}const Ht=640,la=e=>{const{isModal:t=!1}=e,[r,i]=y.useState(window.innerWidth),[n,o]=y.useState(window.innerHeight),[a,s]=y.useState(window.innerWidth<=Ht),[u,l]=y.useState(window.innerWidth>Ht&&!t);function d(){i(window.innerWidth),o(window.innerHeight)}return y.useEffect(()=>(window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[]),y.useEffect(()=>{l(window.innerWidth>Ht&&!t),s(window.innerWidth<=Ht)},[r,e,t]),{isSm:u,isMobile:a,width:r,windowHeight:n}};function ca(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ca(e[t]))&&(i&&(i+=" "),i+=r);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function St(){for(var e,t,r=0,i="";r<arguments.length;)(e=arguments[r++])&&(t=ca(e))&&(i&&(i+=" "),i+=t);return i}const vr=typeof window=="undefined"||typeof document=="undefined";let Re=vr?y.useEffect:y.useLayoutEffect;function _e(e){let t=y.useRef(e);return Re(()=>{t.current=e},[e]),t}function yr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ft(){let e=[],t=[],r={enqueue(i){t.push(i)},addEventListener(i,n,o,a){return i.addEventListener(n,o,a),r.add(()=>i.removeEventListener(n,o,a))},requestAnimationFrame(...i){let n=requestAnimationFrame(...i);return r.add(()=>cancelAnimationFrame(n))},nextFrame(...i){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...i))},setTimeout(...i){let n=setTimeout(...i);return r.add(()=>clearTimeout(n))},microTask(...i){let n={current:!0};return yr(()=>{n.current&&i[0]()}),r.add(()=>{n.current=!1})},add(i){return e.push(i),()=>{let n=e.indexOf(i);if(n>=0){let[o]=e.splice(n,1);o()}}},dispose(){for(let i of e.splice(0))i()},async workQueue(){for(let i of t.splice(0))await i()}};return r}function mn(){let[e]=y.useState(Ft);return y.useEffect(()=>()=>e.dispose(),[e]),e}let ie=function(e){let t=_e(e);return k.default.useCallback((...r)=>t.current(...r),[t])},jr={serverHandoffComplete:!1};function ft(){let[e,t]=y.useState(jr.serverHandoffComplete);return y.useEffect(()=>{e!==!0&&t(!0)},[e]),y.useEffect(()=>{jr.serverHandoffComplete===!1&&(jr.serverHandoffComplete=!0)},[]),e}var Zi;let tg=0;function Xi(){return++tg}let dt=(Zi=k.default.useId)!=null?Zi:function(){let e=ft(),[t,r]=k.default.useState(e?Xi:null);return Re(()=>{t===null&&r(Xi())},[t]),t!=null?""+t:void 0};function re(e,t,...r){if(e in t){let n=t[e];return typeof n=="function"?n(...r):n}let i=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,re),i}function vn(e){return vr?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Xr=["[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 We=(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))(We||{}),fa=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fa||{}),rg=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(rg||{});function ng(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Xr)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var da=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(da||{});function ig(e,t=0){var r;return e===((r=vn(e))==null?void 0:r.body)?!1:re(t,{[0](){return e.matches(Xr)},[1](){let i=e;for(;i!==null;){if(i.matches(Xr))return!0;i=i.parentElement}return!1}})}function Ge(e){e==null||e.focus({preventScroll:!0})}let og=["textarea","input"].join(",");function ag(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,og))!=null?r:!1}function sg(e,t=r=>r){return e.slice().sort((r,i)=>{let n=t(r),o=t(i);if(n===null||o===null)return 0;let a=n.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function zt(e,t,{sorted:r=!0,relativeTo:i=null,skipElements:n=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?sg(e):e:ng(e);n.length>0&&(a=a.filter(f=>!n.includes(f))),i=i!=null?i:o.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,a.indexOf(i))-1;if(t&4)return Math.max(0,a.indexOf(i))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},d=0,c=a.length,g;do{if(d>=c||d+c<=0)return 0;let f=u+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}g=a[f],g==null||g.focus(l),d+=s}while(g!==o.activeElement);return t&6&&ag(g)&&g.select(),g.hasAttribute("tabindex")||g.setAttribute("tabindex","0"),2}function $r(e,t,r){let i=_e(t);y.useEffect(()=>{function n(o){i.current(o)}return document.addEventListener(e,n,r),()=>document.removeEventListener(e,n,r)},[e,r])}function ug(e,t,r=!0){let i=y.useRef(!1);y.useEffect(()=>{requestAnimationFrame(()=>{i.current=r})},[r]);function n(a,s){if(!i.current||a.defaultPrevented)return;let u=function d(c){return typeof c=="function"?d(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),l=s(a);if(l!==null&&!!l.getRootNode().contains(l)){for(let d of u){if(d===null)continue;let c=d instanceof HTMLElement?d:d.current;if(c!=null&&c.contains(l)||a.composed&&a.composedPath().includes(c))return}return!ig(l,da.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}}let o=y.useRef(null);$r("mousedown",a=>{var s,u;i.current&&(o.current=((u=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:u[0])||a.target)},!0),$r("click",a=>{!o.current||(n(a,()=>o.current),o.current=null)},!0),$r("blur",a=>n(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let ga=Symbol();function lg(e,t=!0){return Object.assign(e,{[ga]:t})}function be(...e){let t=y.useRef(e);y.useEffect(()=>{t.current=e},[e]);let r=ie(i=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(i):n.current=i)});return e.every(i=>i==null||(i==null?void 0:i[ga]))?void 0:r}var ir=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ir||{}),Te=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Te||{});function he({ourProps:e,theirProps:t,slot:r,defaultTag:i,features:n,visible:o=!0,name:a}){let s=pa(t,e);if(o)return Wt(s,r,i,a);let u=n!=null?n:0;if(u&2){let{static:l=!1,...d}=s;if(l)return Wt(d,r,i,a)}if(u&1){let{unmount:l=!0,...d}=s;return re(l?0:1,{[0](){return null},[1](){return Wt({...d,hidden:!0,style:{display:"none"}},r,i,a)}})}return Wt(s,r,i,a)}function Wt(e,t={},r,i){let{as:n=r,children:o,refName:a="ref",...s}=Ur(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},l=typeof o=="function"?o(t):o;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let d={};if(t){let c=!1,g=[];for(let[f,p]of Object.entries(t))typeof p=="boolean"&&(c=!0),p===!0&&g.push(f);c&&(d["data-headlessui-state"]=g.join(" "))}if(n===y.Fragment&&Object.keys(eo(s)).length>0){if(!y.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(c=>` - ${c}`).join(`
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Kf={normalizePrecision:function(t){var r=t.reduce(function(i,n){return Math.max(i.getPrecision(),n.getPrecision())});return t.map(function(i){return i.getPrecision()!==r?i.convertPrecision(r):i})},minimum:function(t){var r=Mi(t),i=r[0],n=r.slice(1),o=i;return n.forEach(function(a){o=o.lessThan(a)?o:a}),o},maximum:function(t){var r=Mi(t),i=r[0],n=r.slice(1),o=i;return n.forEach(function(a){o=o.greaterThan(a)?o:a}),o}};function ea(e){return!isNaN(parseInt(e))&&isFinite(e)}function Gf(e){return ea(e)&&e<=100&&e>=0}function zf(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function $i(e){return e%2===0}function Ui(e){return ea(e)&&!Number.isInteger(e)}function Yf(){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 vt(e){return Math.abs(e)%1===.5}function Qf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,i){var n=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){n.readyState===4&&(n.status>=200&&n.status<400?r(JSON.parse(n.responseText)):i(new Error(n.statusText)))},onerror:function(){i(new Error("Network error"))}});n.open("GET",e,!0),qf(n,t.headers),n.send()})}function qf(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 wt(e){return typeof e=="undefined"}function ta(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(i){if(Pt(i[1])==="object"){var n=ta(i[1]);Object.entries(n).forEach(function(o){r[i[0]+t+o[0]]=o[1]})}else r[i[0]]=i[1]}),r}function Jf(e){return Boolean(e)&&(Pt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function ra(){var e=function(i,n){var o=function(u){return Math.pow(10,Yf(u))},a=Math.max(o(i),o(n));return Math.round(i*a)*Math.round(n*a)/(a*a)},t={HALF_ODD:function(i){var n=Math.round(i);return vt(i)&&$i(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return vt(i)?$i(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return vt(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return vt(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return vt(i)?Math.sign(i)*Math.ceil(Math.abs(i)):Math.round(i)},DOWN:function(i){return Math.floor(i)}};return{add:function(i,n){return i+n},subtract:function(i,n){return i-n},multiply:function(i,n){return Ui(i)||Ui(n)?e(i,n):i*n},divide:function(i,n){return i/n},modulo:function(i,n){return i%n},round:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[n](i)}}}var Zf=ra();function Xf(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(i){return!wt(i)}):[]},getMinimumFractionDigits:function(){var i=function(o){return o==="."};return wt(this.getMatches().find(i))?0:this.getMatches()[Zf.add(this.getMatches().findIndex(i),1)].split("").length},getCurrencyDisplay:function(){var i={USD:"code",dollar:"name",$:"symbol"};return i[this.getMatches().find(function(n){return n==="USD"||n==="dollar"||n==="$"})]},getStyle:function(){return wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!wt(this.getMatches().find(function(i){return i===","}))}}}function ed(e){var t=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var a in o)n=n.replace("{{".concat(a,"}}"),o[a]);return n},r=function(n,o){return Qf(t(e.endpoint,{from:n,to:o}),{headers:e.headers})};return{getExchangeRate:function(n,o){return(Jf(e.endpoint)?e.endpoint:r(n,o)).then(function(a){return ta(a)[t(e.propertyPath,{from:n,to:o})]})}}}function Tt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function td(e){Tt(Gf(e),"You must provide a numeric value between 0 and 100.",RangeError)}function rd(e){Tt(zf(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function Dr(e){Tt(Number.isInteger(e),"You must provide an integer.",TypeError)}var z=ra(),nd=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),i=r.amount,n=r.currency,o=r.precision;Dr(i),Dr(o);var a=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,l=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),c=function(p){var v=Object.assign({},Object.assign({},{amount:i,currency:n,precision:o},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){Tt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return i},getCurrency:function(){return n},getLocale:function(){return this.locale||a},setLocale:function(p){return c.call(this,{locale:p})},getPrecision:function(){return o},convertPrecision:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;Dr(p);var b=this.getPrecision(),m=p>b,S=m?z.multiply:z.divide,P=m?[p,b]:[b,p],x=Math.pow(10,z.subtract.apply(z,P));return c.call(this,{amount:z.round(S(this.getAmount(),x),v),precision:p})},add:function(p){g.call(this,p);var v=e.normalizePrecision([this,p]);return c.call(this,{amount:z.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:z.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:z.round(z.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:z.round(z.divide(this.getAmount(),p),v)})},percentage:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return td(p),this.multiply(z.divide(p,100),v)},allocate:function(p){var v=this;rd(p);for(var b=p.reduce(function(x,_){return z.add(x,_)}),m=this.getAmount(),S=p.map(function(x){var _=Math.floor(z.divide(z.multiply(v.getAmount(),x),b));return m=z.subtract(m,_),c.call(v,{amount:_})}),P=0;m>0;)p[P]>0&&(S[P]=S[P].add(c.call(this,{amount:1})),m=z.subtract(m,1)),P+=1;return S},convert:function(p){var v=this,b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=b.endpoint,S=m===void 0?d.endpoint:m,P=b.propertyPath,x=P===void 0?d.propertyPath||"rates.{{to}}":P,_=b.headers,M=_===void 0?d.headers:_,U=b.roundingMode,D=U===void 0?u:U,F=Object.assign({},{endpoint:S,propertyPath:x,headers:M,roundingMode:D});return ed(F).getExchangeRate(this.getCurrency(),p).then(function(V){return Tt(!wt(V),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),c.call(v,{amount:z.round(z.multiply(v.getAmount(),parseFloat(V)),F.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 z.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return z.modulo(this.getAmount(),Math.pow(10,o))!==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,b=Xf(p);return this.toRoundedUnit(b.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:b.getCurrencyDisplay(),useGrouping:b.getUseGrouping(),minimumFractionDigits:b.getMinimumFractionDigits(),style:b.getStyle(),currency:this.getCurrency()})},toUnit:function(){return z.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,b=Math.pow(10,p);return z.divide(z.round(z.multiply(this.toUnit(),b),v),b)},toObject:function(){return{amount:i,currency:n,precision:o}},toJSON:function(){return this.toObject()}}},id=Object.assign(nd,$f,Uf,Kf);const Gt=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),i=Number(r)*100;return isNaN(i)?"0.00":id({amount:Math.round(i),currency:t}).toFormat("0,0.00")},od=(e,t,r=1)=>{const i=parseFloat(e.toString());let n=!1,o=Gt(`${r*i}`);const a=`${Gt(`${o}`)}`;return i<parseFloat(t)&&(n=!0,o=`${Gt(`${t}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:o,formattedEndPrice:a}};function hr(e){const{price:t,addPlusBefore:r=!1,size:i="md",showIfPriceZero:n=!1,minPrice:o="0.00",hiddenIfPriceZero:a=!1}=e,s=parseFloat(o),u=t>s?t:o,l=Gt(`${u}`);return!t&&n===!1?null:r?$("span",{style:{visibility:`${!t&&a?"hidden":"visible"}`},className:"",children:["\xA0",`+${l}`]}):t<s?$("span",{className:"",children:["\xA0",`od ${l}`]}):w("span",{className:"",children:l})}function ad(e,t){const{selCtx:r,id:i}=e,n=J(s=>s.expanded),o=y.useMemo(()=>sd(r,i,t,n),[r,i,t,n]),a=J(s=>s.toggleExpanded);return{isExpanded:o,toggleExpanded:a}}const sd=(e,t,r,i)=>{const n=i[e+t+r];return n!==void 0?n:!0};var ud=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ld={"&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;":"/"},cd=function(t){return ld[t]},fd=function(t){return t.replace(ud,cd)};function Vi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Bi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vi(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vi(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var Jr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:fd},na,dd=y.createContext();function gd(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Jr=Bi(Bi({},Jr),e)}function pd(){return Jr}var hd=function(){function e(){ge(this,e),this.usedNamespaces={}}return pe(e,[{key:"addUsedNamespaces",value:function(r){var i=this;r.forEach(function(n){i.usedNamespaces[n]||(i.usedNamespaces[n]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function md(e){na=e}function vd(){return na}var yd={type:"3rdParty",init:function(t){gd(t.options.react),md(t)}};function bd(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Hi={};function Zr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Hi[t[0]]||(typeof t[0]=="string"&&(Hi[t[0]]=new Date),bd.apply(void 0,t))}function Wi(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var i=function n(){setTimeout(function(){e.off("initialized",n)},0),r()};e.on("initialized",i)}})}function Sd(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.languages[0],n=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var a=function(u,l){var d=t.services.backendConnector.state["".concat(u,"|").concat(l)];return d===-1||d===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(i,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(i,e)&&(!n||a(o,e)))}function Od(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Zr("i18n.languages were undefined or empty",t.languages),!0;var i=t.options.ignoreJSONStructure!==void 0;return i?t.hasLoadedNamespace(e,{precheck:function(o,a){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Sd(e,t,r)}function wd(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=o.call(r)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(d){l=!0,n=d}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}function Ed(e,t){return ao(e)||wd(e,t)||so(e,t)||uo()}function Ki(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Mr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ki(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ki(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var xd=function(t,r){var i=y.useRef();return y.useEffect(function(){i.current=r?i.current:t},[t,r]),i.current};function pn(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,i=y.useContext(dd)||{},n=i.i18n,o=i.defaultNS,a=r||n||vd();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new hd),!a){Zr("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&a.options.react.wait!==void 0&&Zr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=Mr(Mr(Mr({},pd()),a.options.react),t),d=l.useSuspense,c=l.keyPrefix,g=e||o||a.options&&a.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(g);var f=(a.isInitialized||a.initializedStoreOnce)&&g.every(function(D){return Od(D,a,l)});function p(){return a.getFixedT(null,l.nsMode==="fallback"?g:g[0],c)}var v=y.useState(p),b=Ed(v,2),m=b[0],S=b[1],P=g.join(),x=xd(P),_=y.useRef(!0);y.useEffect(function(){var D=l.bindI18n,F=l.bindI18nStore;_.current=!0,!f&&!d&&Wi(a,g,function(){_.current&&S(p)}),f&&x&&x!==P&&_.current&&S(p);function V(){_.current&&S(p)}return D&&a&&a.on(D,V),F&&a&&a.store.on(F,V),function(){_.current=!1,D&&a&&D.split(" ").forEach(function(L){return a.off(L,V)}),F&&a&&F.split(" ").forEach(function(L){return a.store.off(L,V)})}},[a,P]);var M=y.useRef(!0);y.useEffect(function(){_.current&&!M.current&&S(p),M.current=!1},[a,c]);var U=[m,a,f];if(U.t=m,U.i18n=a,U.ready=f,f||!f&&!d)return U;throw new Promise(function(D){Wi(a,g,function(){D()})})}var ia=[],Pd=ia.forEach,Cd=ia.slice;function Ad(e){return Pd.call(Cd.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Gi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Nd=function(t,r,i){var n=i||{};n.path=n.path||"/";var o=encodeURIComponent(r),a="".concat(t,"=").concat(o);if(n.maxAge>0){var s=n.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(n.domain){if(!Gi.test(n.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(n.domain)}if(n.path){if(!Gi.test(n.path))throw new TypeError("option path is invalid");a+="; Path=".concat(n.path)}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(n.expires.toUTCString())}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.sameSite){var u=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(u){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},zi={create:function(t,r,i,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+i*60*1e3)),n&&(o.domain=n),document.cookie=Nd(t,encodeURIComponent(r),o)},read:function(t){for(var r="".concat(t,"="),i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(r)===0)return o.substring(r.length,o.length)}return null},remove:function(t){this.create(t,"",-1)}},Td={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var i=zi.read(t.lookupCookie);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&zi.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},_d={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var i=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var n=i.substring(1),o=n.split("&"),a=0;a<o.length;a++){var s=o[a].indexOf("=");if(s>0){var u=o[a].substring(0,s);u===t.lookupQuerystring&&(r=o[a].substring(s+1))}}}return r}},yt=null,Yi=function(){if(yt!==null)return yt;try{yt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{yt=!1}return yt},Ld={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Yi()){var i=window.localStorage.getItem(t.lookupLocalStorage);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Yi()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},bt=null,Qi=function(){if(bt!==null)return bt;try{bt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{bt=!1}return bt},Id={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Qi()){var i=window.sessionStorage.getItem(t.lookupSessionStorage);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Qi()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Rd={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)r.push(navigator.languages[i]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},Fd={name:"htmlTag",lookup:function(t){var r,i=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(r=i.getAttribute("lang")),r}},kd={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof i[t.lookupFromPathIndex]!="string")return;r=i[t.lookupFromPathIndex].replace("/","")}else r=i[0].replace("/","")}return r}},Dd={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,i=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(!!i)return i[r]}};function Md(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var oa=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ge(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return pe(e,[{key:"init",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=Ad(i,this.options||{},Md()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Td),this.addDetector(_d),this.addDetector(Ld),this.addDetector(Id),this.addDetector(Rd),this.addDetector(Fd),this.addDetector(kd),this.addDetector(Dd)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var i=this;r||(r=this.options.order);var n=[];return r.forEach(function(o){if(i.detectors[o]){var a=i.detectors[o].lookup(i.options);a&&typeof a=="string"&&(a=[a]),a&&(n=n.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(r,i){var n=this;i||(i=this.options.caches),i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||i.forEach(function(o){n.detectors[o]&&n.detectors[o].cacheUserLanguage(r,n.options)}))}}]),e}();oa.type="languageDetector";const jd={"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"},$d={"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"},Ud={"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"},Vd={"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(oa).use(yd).init({resources:{pl:{translation:jd},en:{translation:$d},de:{translation:Ud},cs:{translation:Vd}}});const Bd=(e,t,r,i)=>{let n="",o="";const a=Number(e),s=Number(t);return a>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.From")} ${a}`,a>r&&(o=de.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(o=de.TOO_MUCH)),a>=0||s>=0&&r<a?(n=`${i("OS.ProductConfigurator.Quantity.Message.Max")}${n}`,n+=` ${i("OS.ProductConfigurator.Quantity.Message.Quantity")}`):a===1&&a===1?n=`${i("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(n="",o=de.IGNORE),r>=a&&r<=s&&(o=de.OK),{message:n,validationStatus:o}},Hd=(e,t,r,i)=>{let n="",o="";const a=parseInt(e||"-1"),s=parseInt(t||"-1");return a>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.From")} ${a}`,a>r&&(o=de.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(o=de.TOO_MUCH)),a>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",o=de.IGNORE),a===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=a&&r<=s&&(o=de.OK),{message:n,validationStatus:o}},Wd=e=>{const{optionsItem:t,parentSelCtx:r,selected:i,isOnSubmitted:n,actualQtyCnt:o,actualSelCnt:a,children:s}=e,{selCtx:u,details:l={},id:d,attrs:c={}}=t,{qtyMin:g,qtyMax:f,selMin:p,selMax:v}=c,{name:b,description:m}=l.literals||{},{t:S}=pn(),{isExpanded:P,toggleExpanded:x}=ad(t,r),{validationStatus:_,message:M}=Hd(p,v,a,S),{validationStatus:U,message:D}=Bd(g,f,o,S),F=_===de.OK,V=U===de.OK,L=!F&&n&&!!M,I=!V&&n&&!!D;return $("div",{className:"pt-1 mb-3",id:Ro(u),children:[$("div",{className:"flex text-xl font-semibold",children:[w("p",{className:"",children:b}),b&&b!==" "&&$(xe,{children:[w("div",{className:"ml-auto",children:w(hr,{price:dn(i,t)})}),w("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!P&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>x(u,d,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:$("div",{children:[w(Di,{isOk:F,isErr:L,info:M}),w(Di,{isOk:V,isErr:I,info:D})]})}),w("div",{className:`${P?"block":"hidden"}`,children:s})]})},aa=k.default.createContext(null);function mr(){const e=y.useContext(aa);if(!e)throw new Error("Missing ComponentsContext");return e}const Kd=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:i,parentKind:n}=e,{isFilterValidated:o,selected:a,isOnSubmitted:s,selCnt:u,qtyCnt:l,currency:d}=Nf(t,i,n,r),{MenuOptionsUI:c}=mr();if(!o)return null;const g=w(hn,{productItems:t.items,parentProduct:t}),f={optionsItem:t,parentSelCtx:r,selected:a,isOnSubmitted:s,actualQtyCnt:l,actualSelCnt:u,currency:d};return c?w(c,{...f,children:g}):w(Wd,{...f,children:g})},Gd=e=>{const{product:t,inputId:r,isDisabled:i,registerProps:n,size:o="lg",children:a}=e,{details:{literals:s}={}}=t,{name:u="",description:l=""}=s||{},d=No(t),c=Fo(t);return $("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${i&&"opacity-50"}`,children:[w("input",{type:"checkbox",className:`simple-checkbox checkbox-${o} mr-4`,id:r,disabled:i,value:"1",...n}),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:$("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:a}),w("label",{htmlFor:r,children:w(hr,{price:parseFloat(d),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},zd=e=>{const{product:t,inputId:r,inputValue:i,registerProps:n,isChecked:o,size:a="lg",children:s}=e,{details:{literals:u}={}}=t,{name:l="",description:d=""}=u||{},c=No(t),g=Fo(t);return $("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-${a} mr-4`,id:r,...n,value:i,checked:o}),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:$("div",{className:"relative",children:[w("p",{className:"w-full text-lg font-semibold",children:l}),w("p",{className:"text-sm text-gray-600",children:d})]})}),w("div",{className:"ml-auto",children:s}),w("label",{htmlFor:r,children:w(hr,{price:parseFloat(c||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function sa(e){const{value:t=0,add:r,subtract:i,disabledSubtract:n,disabledAdd:o,size:a="md"}=e;return $("div",{className:`counter counter-${a} 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:i,disabled:n,children:$("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:o,children:$("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 Yd(e){const{watch:t}=lr(),r=J(u=>u.setFilter),{id:i,selCtx:n,emit:o={},fltCtx:a}=e,s=t(`selected.${n}.${i}`);return y.useEffect(()=>{s&&a&&!gr(o)&&r(a,o)},[s]),{}}function Qd(){const e=J(i=>i.getInvalidSelCtxArray),t=J(i=>i.isInputEnabled),r=J(i=>i.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}function qd(e,t){var H;const{id:r,selCtx:i}=e,{allowMultiple:n,selMin:o,selMax:a}=t;Yd(e);const{isInputEnabled:s,isInputCounterIncrementEnabled:u}=Qd(),l=J(W=>W.refreshForm),d=J(W=>W.currency),{watch:c,getValues:g,setValue:f,register:p}=lr(),v=c(`selected.${i}.${r}`),{selected:b={}}=g(),m=Number(v||0),S=o==="1"&&a==="1",P=!S,x=Ws(n),_=m>(S?1:0),M=u(e,b)&&(s(e)||m),U=Number(((H=b==null?void 0:b[i])==null?void 0:H[r])||0)>0,D=s(e)||m,F=`${S?"radio":"selected"}.${i}.${r}`,V=p(F,{onChange:W=>{j(W)}}),L=()=>{f(`selected.${i}.${r}`,`${m+1}`)},I=()=>{const W=m-1;f(`selected.${i}.${r}`,`${W}`),P&&W===0&&f(`selected.${i}.${r}`,!1)},j=W=>{const{target:{checked:G,name:Q,defaultValue:B}}=W;if(S){console.log("handleOnInputChange radio",Q,B);const te="selected."+Q.replace("radio.","").split(".")[0];f(te,{[B]:"1"}),l()}};return{registerProps:V,isRadio:S,isCheckbox:P,isCounter:x,isDecrementEnabled:_,isIncrementEnabled:M,isChecked:U,isCheckboxEnabled:D,handleCounterIncrementQty:L,handleCounterDecrementQty:I,counterValue:m,handleOnInputChange:j,inputId:`${i}.${r}`,radioInputValue:r,currency:d}}const Jd=e=>{const{product:t,parentAttrs:r,nestedLvl:i}=e,{registerProps:n,inputId:o,radioInputValue:a,isRadio:s,isCheckbox:u,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:c,isChecked:g,isCheckboxEnabled:f,counterValue:p,handleCounterIncrementQty:v,handleCounterDecrementQty:b,currency:m}=qd(t,r),{MenuProductUI:S}=mr(),P={product:t,nestedLvl:i,registerProps:n,inputId:o,radioInputValue:a,isRadio:s,isCheckbox:u,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:c,isChecked:g,isCheckboxEnabled:f,counterValue:p,handleCounterIncrementQty:v,handleCounterDecrementQty:b,currency:m},x=w(hn,{productItems:t.items,parentProduct:t,nestedLvl:i+1});return S?w(S,{...P,children:x}):w(Zd,{...P,children:x})},Zd=e=>{const{product:t,nestedLvl:r,registerProps:i,inputId:n,radioInputValue:o,isRadio:a,isCheckbox:s,isCounter:u,isDecrementEnabled:l,isIncrementEnabled:d,isChecked:c,isCheckboxEnabled:g,counterValue:f,handleCounterIncrementQty:p,handleCounterDecrementQty:v,children:b}=e,m=w(sa,{value:f,add:p,subtract:v,disabledSubtract:!l,disabledAdd:!d}),S=()=>a?w(zd,{product:t,inputId:n,inputValue:o,registerProps:i,isChecked:c,children:w(xe,{children:u&&m})}):s?w(Gd,{product:t,inputId:n,registerProps:i,isDisabled:!g,children:w(xe,{children:u&&m})}):null,P=!gr(t.items)&&f,x=xn.useTransition(P,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return $("div",{children:[S(),P?x((_,M)=>M&&w(xn.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:_,children:b},r+1)):null]})};function Xd(){return{isMenuProductToShow:r=>r.kind===at.PRODUCT&&Zn(r),isMenuOptionsToShow:r=>[at.OPTIONS,at.CONFIG].includes(r.kind)&&Zn(r)}}function hn(e){const{productItems:t,nestedLvl:r=1,parentProduct:i}=e,{attrs:n={},selCtx:o,kind:a}=i,{isMenuProductToShow:s,isMenuOptionsToShow:u}=Xd(),{MenuItemsUI:l}=mr(),c={productItems:t,parentProduct:i,renderMenuItem:g=>u(g)?w(Kd,{optionsItem:g,parentSelCtx:o,parentKind:a,nestedLvl:r}):s(g)?w(Jd,{product:g,parentAttrs:n,nestedLvl:r}):w(xe,{})};return l?w(l,{...c}):w(eg,{...c})}function eg(e){const{productItems:t,parentProduct:r,renderMenuItem:i}=e,n=r.kind!==at.PRODUCT,o=99,a=3,[s,u]=y.useState(n?a:o),{t:l}=pn(),d=()=>{u(o)},c=()=>{u(a)};return w(xe,{children:t.map((g,f)=>{if(f<s)return $("div",{children:[i(g),s===o&&n&&t.length===f+1&&qi(l("OS.ProductConfigurator.ShowLess"),c,!1)]},`${r.id}--${g.id}--${f}`);if(f===s)return qi(l("OS.ProductConfigurator.ShowMore"),d,!0)})})}const qi=(e,t,r)=>w("div",{className:"flex justify-center w-full",children:$("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,$("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}`),ua=()=>{const{watch:e}=lr(),t=e("selected"),r=J(i=>i.validationMap);return console.log({selected:t,validationMap:r}),$("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(i=>w("div",{children:Object.values(t[i]).filter(n=>n).length>0&&$(xe,{children:[$("p",{className:"text-lg font-semibold",children:[i,":"]}),Object.keys(t[i]).map(n=>w(k.default.Fragment,{children:t[i][n]&&$("p",{children:[n,":",t[i][n].toString()]})},n))]})},i))]})};function Ji(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:i,displayPriceFrom:n=!1,productQuantity:o,increaseProductQuantity:a,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:l}=pn();return $("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&$("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:i,children:[$("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(sa,{value:o,add:a,subtract:s,disabledSubtract:o===1,size:"lg"})}),$("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:`${n?"0.4":"1"}`},disabled:n,onClick:u,children:[$("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"})]}),n?w("span",{children:`${l("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):w("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Add")} ${t}`})]})]})}const Ht=640,la=e=>{const{isModal:t=!1}=e,[r,i]=y.useState(window.innerWidth),[n,o]=y.useState(window.innerHeight),[a,s]=y.useState(window.innerWidth<=Ht),[u,l]=y.useState(window.innerWidth>Ht&&!t);function d(){i(window.innerWidth),o(window.innerHeight)}return y.useEffect(()=>(window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[]),y.useEffect(()=>{l(window.innerWidth>Ht&&!t),s(window.innerWidth<=Ht)},[r,e,t]),{isSm:u,isMobile:a,width:r,windowHeight:n}};function ca(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ca(e[t]))&&(i&&(i+=" "),i+=r);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function St(){for(var e,t,r=0,i="";r<arguments.length;)(e=arguments[r++])&&(t=ca(e))&&(i&&(i+=" "),i+=t);return i}const vr=typeof window=="undefined"||typeof document=="undefined";let Re=vr?y.useEffect:y.useLayoutEffect;function _e(e){let t=y.useRef(e);return Re(()=>{t.current=e},[e]),t}function yr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Ft(){let e=[],t=[],r={enqueue(i){t.push(i)},addEventListener(i,n,o,a){return i.addEventListener(n,o,a),r.add(()=>i.removeEventListener(n,o,a))},requestAnimationFrame(...i){let n=requestAnimationFrame(...i);return r.add(()=>cancelAnimationFrame(n))},nextFrame(...i){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...i))},setTimeout(...i){let n=setTimeout(...i);return r.add(()=>clearTimeout(n))},microTask(...i){let n={current:!0};return yr(()=>{n.current&&i[0]()}),r.add(()=>{n.current=!1})},add(i){return e.push(i),()=>{let n=e.indexOf(i);if(n>=0){let[o]=e.splice(n,1);o()}}},dispose(){for(let i of e.splice(0))i()},async workQueue(){for(let i of t.splice(0))await i()}};return r}function mn(){let[e]=y.useState(Ft);return y.useEffect(()=>()=>e.dispose(),[e]),e}let ie=function(e){let t=_e(e);return k.default.useCallback((...r)=>t.current(...r),[t])},jr={serverHandoffComplete:!1};function ft(){let[e,t]=y.useState(jr.serverHandoffComplete);return y.useEffect(()=>{e!==!0&&t(!0)},[e]),y.useEffect(()=>{jr.serverHandoffComplete===!1&&(jr.serverHandoffComplete=!0)},[]),e}var Zi;let tg=0;function Xi(){return++tg}let dt=(Zi=k.default.useId)!=null?Zi:function(){let e=ft(),[t,r]=k.default.useState(e?Xi:null);return Re(()=>{t===null&&r(Xi())},[t]),t!=null?""+t:void 0};function re(e,t,...r){if(e in t){let n=t[e];return typeof n=="function"?n(...r):n}let i=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,re),i}function vn(e){return vr?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Xr=["[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 We=(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))(We||{}),fa=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(fa||{}),rg=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(rg||{});function ng(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Xr)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var da=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(da||{});function ig(e,t=0){var r;return e===((r=vn(e))==null?void 0:r.body)?!1:re(t,{[0](){return e.matches(Xr)},[1](){let i=e;for(;i!==null;){if(i.matches(Xr))return!0;i=i.parentElement}return!1}})}function Ge(e){e==null||e.focus({preventScroll:!0})}let og=["textarea","input"].join(",");function ag(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,og))!=null?r:!1}function sg(e,t=r=>r){return e.slice().sort((r,i)=>{let n=t(r),o=t(i);if(n===null||o===null)return 0;let a=n.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function zt(e,t,{sorted:r=!0,relativeTo:i=null,skipElements:n=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?sg(e):e:ng(e);n.length>0&&(a=a.filter(f=>!n.includes(f))),i=i!=null?i:o.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,a.indexOf(i))-1;if(t&4)return Math.max(0,a.indexOf(i))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},d=0,c=a.length,g;do{if(d>=c||d+c<=0)return 0;let f=u+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}g=a[f],g==null||g.focus(l),d+=s}while(g!==o.activeElement);return t&6&&ag(g)&&g.select(),g.hasAttribute("tabindex")||g.setAttribute("tabindex","0"),2}function $r(e,t,r){let i=_e(t);y.useEffect(()=>{function n(o){i.current(o)}return document.addEventListener(e,n,r),()=>document.removeEventListener(e,n,r)},[e,r])}function ug(e,t,r=!0){let i=y.useRef(!1);y.useEffect(()=>{requestAnimationFrame(()=>{i.current=r})},[r]);function n(a,s){if(!i.current||a.defaultPrevented)return;let u=function d(c){return typeof c=="function"?d(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),l=s(a);if(l!==null&&!!l.getRootNode().contains(l)){for(let d of u){if(d===null)continue;let c=d instanceof HTMLElement?d:d.current;if(c!=null&&c.contains(l)||a.composed&&a.composedPath().includes(c))return}return!ig(l,da.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}}let o=y.useRef(null);$r("mousedown",a=>{var s,u;i.current&&(o.current=((u=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:u[0])||a.target)},!0),$r("click",a=>{!o.current||(n(a,()=>o.current),o.current=null)},!0),$r("blur",a=>n(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let ga=Symbol();function lg(e,t=!0){return Object.assign(e,{[ga]:t})}function be(...e){let t=y.useRef(e);y.useEffect(()=>{t.current=e},[e]);let r=ie(i=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(i):n.current=i)});return e.every(i=>i==null||(i==null?void 0:i[ga]))?void 0:r}var ir=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ir||{}),Te=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Te||{});function he({ourProps:e,theirProps:t,slot:r,defaultTag:i,features:n,visible:o=!0,name:a}){let s=pa(t,e);if(o)return Wt(s,r,i,a);let u=n!=null?n:0;if(u&2){let{static:l=!1,...d}=s;if(l)return Wt(d,r,i,a)}if(u&1){let{unmount:l=!0,...d}=s;return re(l?0:1,{[0](){return null},[1](){return Wt({...d,hidden:!0,style:{display:"none"}},r,i,a)}})}return Wt(s,r,i,a)}function Wt(e,t={},r,i){let{as:n=r,children:o,refName:a="ref",...s}=Ur(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},l=typeof o=="function"?o(t):o;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let d={};if(t){let c=!1,g=[];for(let[f,p]of Object.entries(t))typeof p=="boolean"&&(c=!0),p===!0&&g.push(f);c&&(d["data-headlessui-state"]=g.join(" "))}if(n===y.Fragment&&Object.keys(eo(s)).length>0){if(!y.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> 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 y.cloneElement(l,Object.assign({},pa(l.props,eo(Ur(s,["ref"]))),d,u,cg(l.ref,u.ref)))}return y.createElement(n,Object.assign({},Ur(s,["ref"]),n!==y.Fragment&&u,n!==y.Fragment&&d),l)}function cg(...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 pa(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let i of e)for(let n in i)n.startsWith("on")&&typeof i[n]=="function"?(r[n]!=null||(r[n]=[]),r[n].push(i[n])):t[n]=i[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(i=>[i,void 0])));for(let i in r)Object.assign(t,{[i](n,...o){let a=r[i];for(let s of a){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;s(n,...o)}}});return t}function le(e){var t;return Object.assign(y.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function eo(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Ur(e,t=[]){let r=Object.assign({},e);for(let i of t)i in r&&delete r[i];return r}function fg(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let i=(t==null?void 0:t.getAttribute("disabled"))==="";return i&&dg(r)?!1:i}function dg(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let gg="div";var or=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(or||{});let en=le(function(e,t){let{features:r=1,...i}=e,n={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 he({ourProps:n,theirProps:i,slot:{},defaultTag:gg,name:"Hidden"})}),yn=y.createContext(null);yn.displayName="OpenClosedContext";var Ye=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ye||{});function bn(){return y.useContext(yn)}function pg({value:e,children:t}){return k.default.createElement(yn.Provider,{value:e},t)}var ha=(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))(ha||{});function ma(e,t){let r=y.useRef([]),i=ie(e);y.useEffect(()=>{let n=[...r.current];for(let[o,a]of t.entries())if(r.current[o]!==a){let s=i(t,n);return r.current=t,s}},[i,...t])}function hg(e,t,r){let i=_e(t);y.useEffect(()=>{function n(o){i.current(o)}return window.addEventListener(e,n,r),()=>window.removeEventListener(e,n,r)},[e,r])}var Et=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Et||{});function mg(){let e=y.useRef(0);return hg("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function br(){let e=y.useRef(!1);return Re(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Sr(...e){return y.useMemo(()=>vn(...e),[...e])}function Sn(e,t,r,i){let n=_e(r);y.useEffect(()=>{e=e!=null?e:window;function o(a){n.current(a)}return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)},[e,t,i])}let vg="div";var va=(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))(va||{});let Ot=Object.assign(le(function(e,t){let r=y.useRef(null),i=be(r,t),{initialFocus:n,containers:o,features:a=30,...s}=e;ft()||(a=1);let u=Sr(r);yg({ownerDocument:u},Boolean(a&16));let l=bg({ownerDocument:u,container:r,initialFocus:n},Boolean(a&2));Sg({ownerDocument:u,container:r,containers:o,previousActiveElement:l},Boolean(a&8));let d=mg(),c=ie(v=>{let b=r.current;!b||(m=>m())(()=>{re(d.current,{[Et.Forwards]:()=>zt(b,We.First,{skipElements:[v.relatedTarget]}),[Et.Backwards]:()=>zt(b,We.Last,{skipElements:[v.relatedTarget]})})})}),g=mn(),f=y.useRef(!1),p={ref:i,onKeyDown(v){v.key=="Tab"&&(f.current=!0,g.requestAnimationFrame(()=>{f.current=!1}))},onBlur(v){let b=new Set(o==null?void 0:o.current);b.add(r);let m=v.relatedTarget;!m||m.dataset.headlessuiFocusGuard!=="true"&&(ya(b,m)||(f.current?zt(r.current,re(d.current,{[Et.Forwards]:()=>We.Next,[Et.Backwards]:()=>We.Previous})|We.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&Ge(v.target)))}};return k.default.createElement(k.default.Fragment,null,Boolean(a&4)&&k.default.createElement(en,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:or.Focusable}),he({ourProps:p,theirProps:s,defaultTag:vg,name:"FocusTrap"}),Boolean(a&4)&&k.default.createElement(en,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:or.Focusable}))}),{features:va});function yg({ownerDocument:e},t){let r=y.useRef(null);Sn(e==null?void 0:e.defaultView,"focusout",n=>{!t||r.current||(r.current=n.target)},!0),ma(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Ge(r.current),r.current=null)},[t]);let i=y.useRef(!1);y.useEffect(()=>(i.current=!1,()=>{i.current=!0,yr(()=>{!i.current||(Ge(r.current),r.current=null)})}),[])}function bg({ownerDocument:e,container:t,initialFocus:r},i){let n=y.useRef(null),o=br();return ma(()=>{if(!i)return;let a=t.current;!a||yr(()=>{if(!o.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){n.current=s;return}}else if(a.contains(s)){n.current=s;return}r!=null&&r.current?Ge(r.current):zt(a,We.First)===fa.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),n.current=e==null?void 0:e.activeElement})},[i]),n}function Sg({ownerDocument:e,container:t,containers:r,previousActiveElement:i},n){let o=br();Sn(e==null?void 0:e.defaultView,"focus",a=>{if(!n||!o.current)return;let s=new Set(r==null?void 0:r.current);s.add(t);let u=i.current;if(!u)return;let l=a.target;l&&l instanceof HTMLElement?ya(s,l)?(i.current=l,Ge(l)):(a.preventDefault(),a.stopPropagation(),Ge(u)):Ge(i.current)},!0)}function ya(e,t){var r;for(let i of e)if((r=i.current)!=null&&r.contains(t))return!0;return!1}let rt=new Set,De=new Map;function to(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function ro(e){let t=De.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Og(e,t=!0){Re(()=>{if(!t||!e.current)return;let r=e.current,i=vn(r);if(i){rt.add(r);for(let n of De.keys())n.contains(r)&&(ro(n),De.delete(n));return i.querySelectorAll("body > *").forEach(n=>{if(n instanceof HTMLElement){for(let o of rt)if(n.contains(o))return;rt.size===1&&(De.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),to(n))}}),()=>{if(rt.delete(r),rt.size>0)i.querySelectorAll("body > *").forEach(n=>{if(n instanceof HTMLElement&&!De.has(n)){for(let o of rt)if(n.contains(o))return;De.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),to(n)}});else for(let n of De.keys())ro(n),De.delete(n)}}},[t])}let ba=y.createContext(!1);function wg(){return y.useContext(ba)}function tn(e){return k.default.createElement(ba.Provider,{value:e.force},e.children)}function Eg(e){let t=wg(),r=y.useContext(Sa),i=Sr(e),[n,o]=y.useState(()=>{if(!t&&r!==null||vr)return null;let a=i==null?void 0:i.getElementById("headlessui-portal-root");if(a)return a;if(i===null)return null;let s=i.createElement("div");return s.setAttribute("id","headlessui-portal-root"),i.body.appendChild(s)});return y.useEffect(()=>{n!==null&&(i!=null&&i.body.contains(n)||i==null||i.body.appendChild(n))},[n,i]),y.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let xg=y.Fragment,Pg=le(function(e,t){let r=e,i=y.useRef(null),n=be(lg(d=>{i.current=d}),t),o=Sr(i),a=Eg(i),[s]=y.useState(()=>{var d;return vr?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),u=ft(),l=y.useRef(!1);return Re(()=>{if(l.current=!1,!(!a||!s))return a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s)),()=>{l.current=!0,yr(()=>{var d;!l.current||!a||!s||(a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))})}},[a,s]),u?!a||!s?null:Ta.createPortal(he({ourProps:{ref:n},theirProps:r,defaultTag:xg,name:"Portal"}),s):null}),Cg=y.Fragment,Sa=y.createContext(null),Ag=le(function(e,t){let{target:r,...i}=e,n={ref:be(t)};return k.default.createElement(Sa.Provider,{value:r},he({ourProps:n,theirProps:i,defaultTag:Cg,name:"Popover.Group"}))}),rn=Object.assign(Pg,{Group:Ag}),Oa=y.createContext(null);function wa(){let e=y.useContext(Oa);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,wa),t}return e}function Ng(){let[e,t]=y.useState([]);return[e.length>0?e.join(" "):void 0,y.useMemo(()=>function(r){let i=ie(o=>(t(a=>[...a,o]),()=>t(a=>{let s=a.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),n=y.useMemo(()=>({register:i,slot:r.slot,name:r.name,props:r.props}),[i,r.slot,r.name,r.props]);return k.default.createElement(Oa.Provider,{value:n},r.children)},[t])]}let Tg="p",_g=le(function(e,t){let r=dt(),{id:i=`headlessui-description-${r}`,...n}=e,o=wa(),a=be(t);Re(()=>o.register(i),[i,o.register]);let s={ref:a,...o.props,id:i};return he({ourProps:s,theirProps:n,slot:o.slot||{},defaultTag:Tg,name:o.name||"Description"})}),On=y.createContext(()=>{});On.displayName="StackContext";var nn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(nn||{});function Lg(){return y.useContext(On)}function Ig({children:e,onUpdate:t,type:r,element:i,enabled:n}){let o=Lg(),a=ie((...s)=>{t==null||t(...s),o(...s)});return Re(()=>{let s=n===void 0||n===!0;return s&&a(0,r,i),()=>{s&&a(1,r,i)}},[a,r,i,n]),k.default.createElement(On.Provider,{value:a},e)}function Rg(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Fg=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Fg||{}),kg=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(kg||{});let Dg={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},ar=y.createContext(null);ar.displayName="DialogContext";function kt(e){let t=y.useContext(ar);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,kt),r}return t}function Mg(e,t,r=()=>[document.body]){y.useEffect(()=>{var i;if(!t||!e)return;let n=Ft(),o=window.pageYOffset;function a(l,d,c){let g=l.style.getPropertyValue(d);return Object.assign(l.style,{[d]:c}),n.add(()=>{Object.assign(l.style,{[d]:g})})}let s=e.documentElement,u=((i=e.defaultView)!=null?i:window).innerWidth-s.clientWidth;if(a(s,"overflow","hidden"),u>0){let l=s.clientWidth-s.offsetWidth,d=u-l;a(s,"paddingRight",`${d}px`)}if(Rg()){a(e.body,"marginTop",`-${o}px`),window.scrollTo(0,0);let l=null;n.addEventListener(e,"click",d=>{if(d.target instanceof HTMLElement)try{let c=d.target.closest("a");if(!c)return;let{hash:g}=new URL(c.href),f=e.querySelector(g);f&&!r().some(p=>p.contains(f))&&(l=f)}catch{}},!0),n.addEventListener(e,"touchmove",d=>{d.target instanceof HTMLElement&&!r().some(c=>c.contains(d.target))&&d.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+o),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})}return n.dispose},[e,t])}function jg(e,t){return re(t.type,Dg,e,t)}let $g="div",Ug=ir.RenderStrategy|ir.Static,Vg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-${r}`,open:n,onClose:o,initialFocus:a,__demoMode:s=!1,...u}=e,[l,d]=y.useState(0),c=bn();n===void 0&&c!==null&&(n=re(c,{[Ye.Open]:!0,[Ye.Closed]:!1}));let g=y.useRef(new Set),f=y.useRef(null),p=be(f,t),v=y.useRef(null),b=Sr(f),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 n!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let P=n?0:1,[x,_]=y.useReducer(jg,{titleId:null,descriptionId:null,panelRef:y.createRef()}),M=ie(()=>o(!1)),U=ie(B=>_({type:0,id:B})),D=ft()?s?!1:P===0:!1,F=l>1,V=y.useContext(ar)!==null,L=F?"parent":"leaf";Og(f,F?D:!1);let I=ie(()=>{var B,te;return[...Array.from((B=b==null?void 0:b.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?B:[]).filter(K=>!(!(K instanceof HTMLElement)||K.contains(v.current)||x.panelRef.current&&K.contains(x.panelRef.current))),(te=x.panelRef.current)!=null?te:f.current]});ug(()=>I(),M,D&&!F),Sn(b==null?void 0:b.defaultView,"keydown",B=>{B.defaultPrevented||B.key===ha.Escape&&P===0&&(F||(B.preventDefault(),B.stopPropagation(),M()))}),Mg(b,P===0&&!V,I),y.useEffect(()=>{if(P!==0||!f.current)return;let B=new IntersectionObserver(te=>{for(let K of te)K.boundingClientRect.x===0&&K.boundingClientRect.y===0&&K.boundingClientRect.width===0&&K.boundingClientRect.height===0&&M()});return B.observe(f.current),()=>B.disconnect()},[P,f,M]);let[j,H]=Ng(),W=y.useMemo(()=>[{dialogState:P,close:M,setTitleId:U},x],[P,x,M,U]),G=y.useMemo(()=>({open:P===0}),[P]),Q={ref:p,id:i,role:"dialog","aria-modal":P===0?!0:void 0,"aria-labelledby":x.titleId,"aria-describedby":j};return k.default.createElement(Ig,{type:"Dialog",enabled:P===0,element:f,onUpdate:ie((B,te,K)=>{te==="Dialog"&&re(B,{[nn.Add](){g.current.add(K),d(ce=>ce+1)},[nn.Remove](){g.current.add(K),d(ce=>ce-1)}})})},k.default.createElement(tn,{force:!0},k.default.createElement(rn,null,k.default.createElement(ar.Provider,{value:W},k.default.createElement(rn.Group,{target:f},k.default.createElement(tn,{force:!1},k.default.createElement(H,{slot:G,name:"Dialog.Description"},k.default.createElement(Ot,{initialFocus:a,containers:g,features:D?re(L,{parent:Ot.features.RestoreFocus,leaf:Ot.features.All&~Ot.features.FocusLock}):Ot.features.None},he({ourProps:Q,theirProps:u,slot:G,defaultTag:$g,features:Ug,visible:P===0,name:"Dialog"})))))))),k.default.createElement(en,{features:or.Hidden,ref:v}))}),Bg="div",Hg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-overlay-${r}`,...n}=e,[{dialogState:o,close:a}]=kt("Dialog.Overlay"),s=be(t),u=ie(d=>{if(d.target===d.currentTarget){if(fg(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),a()}}),l=y.useMemo(()=>({open:o===0}),[o]);return he({ourProps:{ref:s,id:i,"aria-hidden":!0,onClick:u},theirProps:n,slot:l,defaultTag:Bg,name:"Dialog.Overlay"})}),Wg="div",Kg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-backdrop-${r}`,...n}=e,[{dialogState:o},a]=kt("Dialog.Backdrop"),s=be(t);y.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let u=y.useMemo(()=>({open:o===0}),[o]);return k.default.createElement(tn,{force:!0},k.default.createElement(rn,null,he({ourProps:{ref:s,id:i,"aria-hidden":!0},theirProps:n,slot:u,defaultTag:Wg,name:"Dialog.Backdrop"})))}),Gg="div",zg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-panel-${r}`,...n}=e,[{dialogState:o},a]=kt("Dialog.Panel"),s=be(t,a.panelRef),u=y.useMemo(()=>({open:o===0}),[o]),l=ie(d=>{d.stopPropagation()});return he({ourProps:{ref:s,id:i,onClick:l},theirProps:n,slot:u,defaultTag:Gg,name:"Dialog.Panel"})}),Yg="h2",Qg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-title-${r}`,...n}=e,[{dialogState:o,setTitleId:a}]=kt("Dialog.Title"),s=be(t);y.useEffect(()=>(a(i),()=>a(null)),[i,a]);let u=y.useMemo(()=>({open:o===0}),[o]);return he({ourProps:{ref:s,id:i},theirProps:n,slot:u,defaultTag:Yg,name:"Dialog.Title"})}),no=Object.assign(Vg,{Backdrop:Kg,Panel:zg,Overlay:Hg,Title:Qg,Description:_g});function qg(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function Vr(e,...t){e&&t.length>0&&e.classList.add(...t)}function Br(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Jg(e,t){let r=Ft();if(!e)return r.dispose;let{transitionDuration:i,transitionDelay:n}=getComputedStyle(e),[o,a]=[i,n].map(s=>{let[u=0]=s.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,d)=>d-l);return u});if(o+a!==0){let s=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),s())})}else t();return r.add(()=>t()),r.dispose}function Zg(e,t,r,i){let n=r?"enter":"leave",o=Ft(),a=i!==void 0?qg(i):()=>{};n==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=re(n,{enter:()=>t.enter,leave:()=>t.leave}),u=re(n,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=re(n,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Br(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Vr(e,...s,...l),o.nextFrame(()=>{Br(e,...l),Vr(e,...u),Jg(e,()=>(Br(e,...s),Vr(e,...t.entered),a()))}),o.dispose}function Xg({container:e,direction:t,classes:r,onStart:i,onStop:n}){let o=br(),a=mn(),s=_e(t);Re(()=>{let u=Ft();a.add(u.dispose);let l=e.current;if(!!l&&s.current!=="idle"&&!!o.current)return u.dispose(),i.current(s.current),u.add(Zg(l,r.current,s.current==="enter",()=>{u.dispose(),n.current(s.current)})),u.dispose},[t])}function ep(...e){return e.filter(Boolean).join(" ")}function Ve(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Or=y.createContext(null);Or.displayName="TransitionContext";var tp=(e=>(e.Visible="visible",e.Hidden="hidden",e))(tp||{});function rp(){let e=y.useContext(Or);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function np(){let e=y.useContext(wr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let wr=y.createContext(null);wr.displayName="NestingContext";function Er(e){return"children"in e?Er(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ea(e,t){let r=_e(e),i=y.useRef([]),n=br(),o=mn(),a=ie((f,p=Te.Hidden)=>{let v=i.current.findIndex(({el:b})=>b===f);v!==-1&&(re(p,{[Te.Unmount](){i.current.splice(v,1)},[Te.Hidden](){i.current[v].state="hidden"}}),o.microTask(()=>{var b;!Er(i)&&n.current&&((b=r.current)==null||b.call(r))}))}),s=ie(f=>{let p=i.current.find(({el:v})=>v===f);return p?p.state!=="visible"&&(p.state="visible"):i.current.push({el:f,state:"visible"}),()=>a(f,Te.Unmount)}),u=y.useRef([]),l=y.useRef(Promise.resolve()),d=y.useRef({enter:[],leave:[],idle:[]}),c=ie((f,p,v)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([b])=>b!==f)),t==null||t.chains.current[p].push([f,new Promise(b=>{u.current.push(b)})]),t==null||t.chains.current[p].push([f,new Promise(b=>{Promise.all(d.current[p].map(([m,S])=>S)).then(()=>b())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),g=ie((f,p,v)=>{Promise.all(d.current[p].splice(0).map(([b,m])=>m)).then(()=>{var b;(b=u.current.shift())==null||b()}).then(()=>v(p))});return y.useMemo(()=>({children:i,register:s,unregister:a,onStart:c,onStop:g,wait:l,chains:d}),[s,a,i,c,g,d,l])}function ip(){}let op=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function io(e){var t;let r={};for(let i of op)r[i]=(t=e[i])!=null?t:ip;return r}function ap(e){let t=y.useRef(io(e));return y.useEffect(()=>{t.current=io(e)},[e]),t}let sp="div",xa=ir.RenderStrategy,Pa=le(function(e,t){let{beforeEnter:r,afterEnter:i,beforeLeave:n,afterLeave:o,enter:a,enterFrom:s,enterTo:u,entered:l,leave:d,leaveFrom:c,leaveTo:g,...f}=e,p=y.useRef(null),v=be(p,t),b=f.unmount?Te.Unmount:Te.Hidden,{show:m,appear:S,initial:P}=rp(),[x,_]=y.useState(m?"visible":"hidden"),M=np(),{register:U,unregister:D}=M,F=y.useRef(null);y.useEffect(()=>U(p),[U,p]),y.useEffect(()=>{if(b===Te.Hidden&&!!p.current){if(m&&x!=="visible"){_("visible");return}return re(x,{hidden:()=>D(p),visible:()=>U(p)})}},[x,p,U,D,m,b]);let V=_e({enter:Ve(a),enterFrom:Ve(s),enterTo:Ve(u),entered:Ve(l),leave:Ve(d),leaveFrom:Ve(c),leaveTo:Ve(g)}),L=ap({beforeEnter:r,afterEnter:i,beforeLeave:n,afterLeave:o}),I=ft();y.useEffect(()=>{if(I&&x==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,x,I]);let j=P&&!S,H=(()=>!I||j||F.current===m?"idle":m?"enter":"leave")(),W=ie(K=>re(K,{enter:()=>L.current.beforeEnter(),leave:()=>L.current.beforeLeave(),idle:()=>{}})),G=ie(K=>re(K,{enter:()=>L.current.afterEnter(),leave:()=>L.current.afterLeave(),idle:()=>{}})),Q=Ea(()=>{_("hidden"),D(p)},M);Xg({container:p,classes:V,direction:H,onStart:_e(K=>{Q.onStart(p,K,W)}),onStop:_e(K=>{Q.onStop(p,K,G),K==="leave"&&!Er(Q)&&(_("hidden"),D(p))})}),y.useEffect(()=>{!j||(b===Te.Hidden?F.current=null:F.current=m)},[m,j,x]);let B=f,te={ref:v};return S&&m&&(typeof window=="undefined"||typeof document=="undefined")&&(B={...B,className:ep(f.className,...V.current.enter,...V.current.enterFrom)}),k.default.createElement(wr.Provider,{value:Q},k.default.createElement(pg,{value:re(x,{visible:Ye.Open,hidden:Ye.Closed})},he({ourProps:te,theirProps:B,defaultTag:sp,features:xa,visible:x==="visible",name:"Transition.Child"})))}),on=le(function(e,t){let{show:r,appear:i=!1,unmount:n,...o}=e,a=y.useRef(null),s=be(a,t);ft();let u=bn();if(r===void 0&&u!==null&&(r=re(u,{[Ye.Open]:!0,[Ye.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,d]=y.useState(r?"visible":"hidden"),c=Ea(()=>{d("hidden")}),[g,f]=y.useState(!0),p=y.useRef([r]);Re(()=>{g!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),f(!1))},[p,r]);let v=y.useMemo(()=>({show:r,appear:i,initial:g}),[r,i,g]);y.useEffect(()=>{if(r)d("visible");else if(!Er(c))d("hidden");else{let m=a.current;if(!m)return;let S=m.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&d("hidden")}},[r,c]);let b={unmount:n};return k.default.createElement(wr.Provider,{value:c},k.default.createElement(Or.Provider,{value:v},he({ourProps:{...b,as:y.Fragment,children:k.default.createElement(Pa,{ref:s,...b,...o})},theirProps:{},defaultTag:y.Fragment,features:xa,visible:l==="visible",name:"Transition"})))}),up=le(function(e,t){let r=y.useContext(Or)!==null,i=bn()!==null;return k.default.createElement(k.default.Fragment,null,!r&&i?k.default.createElement(on,{ref:t,...e}):k.default.createElement(Pa,{ref:t,...e}))}),Hr=Object.assign(on,{Child:up,Root:on});function lp(e){const{children:t,isOpen:r,handleClose:i}=e,{isMobile:n}=la({isModal:!0});return w(xe,{children:w(Hr,{appear:!0,show:r,as:y.Fragment,children:w(no,{as:"div",className:"overflow-y-auto fixed inset-0 z-10",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:i,children:$("div",{className:"min-h-screen text-center sm:px-4",children:[w(Hr.Child,{as:y.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(no.Overlay,{className:"fixed inset-0"})}),w("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),w(Hr.Child,{as:y.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:$("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:"flex sticky top-0 z-10 items-center px-3 w-full h-14 text-lg font-medium leading-6 text-gray-900 bg-white modal-header",children:w("div",{className:"",children:$("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:i,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:`${n?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function cp(e){var H,W,G,Q;const{product:t,isOpen:r,handleGoBack:i,showDebugState:n=!1,countedProductPrice:o,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l,children:d}=e,{minPrice:c="0"}=t,[g,f]=y.useState("auto"),[p,v]=y.useState(0);y.useEffect(()=>{v(1);const B=setTimeout(()=>{_||v(2)},250);return()=>{clearTimeout(B)}},[]);const{displayPriceFrom:b,formattedEndPrice:m}=od(o,c,a),S=y.useRef(),P=y.useRef(),{isSm:x,isMobile:_,windowHeight:M}=la({isModal:!0}),U=$(xe,{children:[$("div",{className:St("px-4 w-full",x&&"sm:sticky sm:top-0 sm:w-2/5"),ref:S,children:[t.details.media&&t.details.media[0].url&&w("img",{className:St("mx-auto mt-2 mb-6 max-h-[250px]",x&&"max-h-[450px]"),alt:t.details.literals.name,src:(H=t.details)==null?void 0:H.media[0].url}),w("div",{className:St(!n&&"hidden"),children:w(ua,{})})]}),$("div",{className:St("w-full",x&&"sm:w-3/5"),ref:P,children:[$("div",{className:"items-center w-full p-4",children:[$("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[$("span",{className:"",children:[t.details.literals.name," "]}),w(hr,{price:e.countedProductPrice,minPrice:c})]}),w("span",{className:"text-gray-600",children:(W=t.details.literals)==null?void 0:W.description})]}),$("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[d,w("div",{className:"sm:h-[64px]"})]}),x&&w("div",{className:"-mt-5 mb-2 bg-gray-100",children:w(Ji,{finalPrice:m,isBackIcon:!1,handleGoBack:i,displayPriceFrom:b})})]})]}),D=(G=S==null?void 0:S.current)==null?void 0:G.clientHeight,F=(Q=P==null?void 0:P.current)==null?void 0:Q.clientHeight,V=D+F;V>window.innerHeight*.8||isNaN(V)?g!=="80vh"&&f("80vh"):g!=="auto"&&f("auto");const L=`${M-64-56}px`,I=!x,j={"--mobile-submit-row-top":`${M-64-80}px`};return w(lp,{isOpen:Boolean(r),handleClose:i,children:$("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[w("div",{className:St("flex relative flex-col items-start w-full form-body stretch",!I&&"sm:flex-row-reverse sm:pb-0",!_&&"mobile-scrollbar"),style:{height:`${_?L:g}`,minHeight:"400px",overflowY:"scroll"},children:U}),I&&w("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${_?"submit-row-mobile":"submit-row"}`,style:j,children:w(Ji,{handleGoBack:i,finalPrice:m,isBackIcon:!1,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l})})]})})}const fp=e=>{const{product:t}=e,{MenuProductRootUI:r}=mr(),i=gr(t.items)?w(xe,{}):w(hn,{productItems:t.items,parentProduct:t});return r?w(r,{...e,children:i}):w(cp,{...e,children:i})};function dp(e){const{product:t,lang:r="en",handleAddToCart:i,handleGoBack:n,isOpen:o,handleClose:a,currency:s,showDebugState:u=!1}=e,{price:l}=t,{encodedProduct:d,initSelected:c,filter:g,productQuantity:f,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:v,getValidationMap:b,increaseProductQuantity:m,decreaseProductQuantity:S,setCurrency:P}=Ef(t),[x,_]=y.useState(b());y.useEffect(()=>{oe.changeLanguage(r)},[r]),y.useEffect(()=>{P(s)},[s]),y.useEffect(()=>{const I=b();mf(I,x)||_(I)});const M=_s({defaultValues:{selected:c}}),{handleSubmit:U,getValues:D}=M,F=Number((parseFloat(l||"0")+dn(D("selected"),t)).toFixed(2)),V=()=>{console.log("onSubmit"),p();const I=v();if(I.length)Ks(Ro(I[0])),console.log({invalidContextNames:I});else{console.log("selected",D("selected"));const j=Hs(Bs(D("selected")));console.log("decodedCleanedSelected: ",j),i({price:F,quantity:f,selected:j,filter:g})}},L=()=>V();return w(xe,{children:w(aa.Provider,{value:e.components,children:w(gs,{...M,children:$("form",{onSubmit:U(V),children:[u&&w("div",{className:"hidden",children:w(ua,{})}),w(fp,{product:d,productQuantity:f,validationMap:x,isOpen:o,handleClose:a,handleGoBack:n,handleOnSubmit:L,countedProductPrice:F,countedProductTotalPrice:F*f,increaseProductQuantity:m,decreaseProductQuantity:S,currency:s})]})})})})}exports.ContextType=fn;exports.MainView=wo;exports.ProductConfigurator=dp;exports.ProductKinds=cr;exports.ProductTypes=Eo;exports.SelMinSelMaxStatus=de;
17
+ `));return y.cloneElement(l,Object.assign({},pa(l.props,eo(Ur(s,["ref"]))),d,u,cg(l.ref,u.ref)))}return y.createElement(n,Object.assign({},Ur(s,["ref"]),n!==y.Fragment&&u,n!==y.Fragment&&d),l)}function cg(...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 pa(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let i of e)for(let n in i)n.startsWith("on")&&typeof i[n]=="function"?(r[n]!=null||(r[n]=[]),r[n].push(i[n])):t[n]=i[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(i=>[i,void 0])));for(let i in r)Object.assign(t,{[i](n,...o){let a=r[i];for(let s of a){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;s(n,...o)}}});return t}function le(e){var t;return Object.assign(y.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function eo(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Ur(e,t=[]){let r=Object.assign({},e);for(let i of t)i in r&&delete r[i];return r}function fg(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let i=(t==null?void 0:t.getAttribute("disabled"))==="";return i&&dg(r)?!1:i}function dg(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let gg="div";var or=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(or||{});let en=le(function(e,t){let{features:r=1,...i}=e,n={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 he({ourProps:n,theirProps:i,slot:{},defaultTag:gg,name:"Hidden"})}),yn=y.createContext(null);yn.displayName="OpenClosedContext";var Ye=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ye||{});function bn(){return y.useContext(yn)}function pg({value:e,children:t}){return k.default.createElement(yn.Provider,{value:e},t)}var ha=(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))(ha||{});function ma(e,t){let r=y.useRef([]),i=ie(e);y.useEffect(()=>{let n=[...r.current];for(let[o,a]of t.entries())if(r.current[o]!==a){let s=i(t,n);return r.current=t,s}},[i,...t])}function hg(e,t,r){let i=_e(t);y.useEffect(()=>{function n(o){i.current(o)}return window.addEventListener(e,n,r),()=>window.removeEventListener(e,n,r)},[e,r])}var Et=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Et||{});function mg(){let e=y.useRef(0);return hg("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function br(){let e=y.useRef(!1);return Re(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Sr(...e){return y.useMemo(()=>vn(...e),[...e])}function Sn(e,t,r,i){let n=_e(r);y.useEffect(()=>{e=e!=null?e:window;function o(a){n.current(a)}return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)},[e,t,i])}let vg="div";var va=(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))(va||{});let Ot=Object.assign(le(function(e,t){let r=y.useRef(null),i=be(r,t),{initialFocus:n,containers:o,features:a=30,...s}=e;ft()||(a=1);let u=Sr(r);yg({ownerDocument:u},Boolean(a&16));let l=bg({ownerDocument:u,container:r,initialFocus:n},Boolean(a&2));Sg({ownerDocument:u,container:r,containers:o,previousActiveElement:l},Boolean(a&8));let d=mg(),c=ie(v=>{let b=r.current;!b||(m=>m())(()=>{re(d.current,{[Et.Forwards]:()=>zt(b,We.First,{skipElements:[v.relatedTarget]}),[Et.Backwards]:()=>zt(b,We.Last,{skipElements:[v.relatedTarget]})})})}),g=mn(),f=y.useRef(!1),p={ref:i,onKeyDown(v){v.key=="Tab"&&(f.current=!0,g.requestAnimationFrame(()=>{f.current=!1}))},onBlur(v){let b=new Set(o==null?void 0:o.current);b.add(r);let m=v.relatedTarget;!m||m.dataset.headlessuiFocusGuard!=="true"&&(ya(b,m)||(f.current?zt(r.current,re(d.current,{[Et.Forwards]:()=>We.Next,[Et.Backwards]:()=>We.Previous})|We.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&Ge(v.target)))}};return k.default.createElement(k.default.Fragment,null,Boolean(a&4)&&k.default.createElement(en,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:or.Focusable}),he({ourProps:p,theirProps:s,defaultTag:vg,name:"FocusTrap"}),Boolean(a&4)&&k.default.createElement(en,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:or.Focusable}))}),{features:va});function yg({ownerDocument:e},t){let r=y.useRef(null);Sn(e==null?void 0:e.defaultView,"focusout",n=>{!t||r.current||(r.current=n.target)},!0),ma(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Ge(r.current),r.current=null)},[t]);let i=y.useRef(!1);y.useEffect(()=>(i.current=!1,()=>{i.current=!0,yr(()=>{!i.current||(Ge(r.current),r.current=null)})}),[])}function bg({ownerDocument:e,container:t,initialFocus:r},i){let n=y.useRef(null),o=br();return ma(()=>{if(!i)return;let a=t.current;!a||yr(()=>{if(!o.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){n.current=s;return}}else if(a.contains(s)){n.current=s;return}r!=null&&r.current?Ge(r.current):zt(a,We.First)===fa.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),n.current=e==null?void 0:e.activeElement})},[i]),n}function Sg({ownerDocument:e,container:t,containers:r,previousActiveElement:i},n){let o=br();Sn(e==null?void 0:e.defaultView,"focus",a=>{if(!n||!o.current)return;let s=new Set(r==null?void 0:r.current);s.add(t);let u=i.current;if(!u)return;let l=a.target;l&&l instanceof HTMLElement?ya(s,l)?(i.current=l,Ge(l)):(a.preventDefault(),a.stopPropagation(),Ge(u)):Ge(i.current)},!0)}function ya(e,t){var r;for(let i of e)if((r=i.current)!=null&&r.contains(t))return!0;return!1}let rt=new Set,De=new Map;function to(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function ro(e){let t=De.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Og(e,t=!0){Re(()=>{if(!t||!e.current)return;let r=e.current,i=vn(r);if(i){rt.add(r);for(let n of De.keys())n.contains(r)&&(ro(n),De.delete(n));return i.querySelectorAll("body > *").forEach(n=>{if(n instanceof HTMLElement){for(let o of rt)if(n.contains(o))return;rt.size===1&&(De.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),to(n))}}),()=>{if(rt.delete(r),rt.size>0)i.querySelectorAll("body > *").forEach(n=>{if(n instanceof HTMLElement&&!De.has(n)){for(let o of rt)if(n.contains(o))return;De.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),to(n)}});else for(let n of De.keys())ro(n),De.delete(n)}}},[t])}let ba=y.createContext(!1);function wg(){return y.useContext(ba)}function tn(e){return k.default.createElement(ba.Provider,{value:e.force},e.children)}function Eg(e){let t=wg(),r=y.useContext(Sa),i=Sr(e),[n,o]=y.useState(()=>{if(!t&&r!==null||vr)return null;let a=i==null?void 0:i.getElementById("headlessui-portal-root");if(a)return a;if(i===null)return null;let s=i.createElement("div");return s.setAttribute("id","headlessui-portal-root"),i.body.appendChild(s)});return y.useEffect(()=>{n!==null&&(i!=null&&i.body.contains(n)||i==null||i.body.appendChild(n))},[n,i]),y.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let xg=y.Fragment,Pg=le(function(e,t){let r=e,i=y.useRef(null),n=be(lg(d=>{i.current=d}),t),o=Sr(i),a=Eg(i),[s]=y.useState(()=>{var d;return vr?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),u=ft(),l=y.useRef(!1);return Re(()=>{if(l.current=!1,!(!a||!s))return a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s)),()=>{l.current=!0,yr(()=>{var d;!l.current||!a||!s||(a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))})}},[a,s]),u?!a||!s?null:Ta.createPortal(he({ourProps:{ref:n},theirProps:r,defaultTag:xg,name:"Portal"}),s):null}),Cg=y.Fragment,Sa=y.createContext(null),Ag=le(function(e,t){let{target:r,...i}=e,n={ref:be(t)};return k.default.createElement(Sa.Provider,{value:r},he({ourProps:n,theirProps:i,defaultTag:Cg,name:"Popover.Group"}))}),rn=Object.assign(Pg,{Group:Ag}),Oa=y.createContext(null);function wa(){let e=y.useContext(Oa);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,wa),t}return e}function Ng(){let[e,t]=y.useState([]);return[e.length>0?e.join(" "):void 0,y.useMemo(()=>function(r){let i=ie(o=>(t(a=>[...a,o]),()=>t(a=>{let s=a.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),n=y.useMemo(()=>({register:i,slot:r.slot,name:r.name,props:r.props}),[i,r.slot,r.name,r.props]);return k.default.createElement(Oa.Provider,{value:n},r.children)},[t])]}let Tg="p",_g=le(function(e,t){let r=dt(),{id:i=`headlessui-description-${r}`,...n}=e,o=wa(),a=be(t);Re(()=>o.register(i),[i,o.register]);let s={ref:a,...o.props,id:i};return he({ourProps:s,theirProps:n,slot:o.slot||{},defaultTag:Tg,name:o.name||"Description"})}),On=y.createContext(()=>{});On.displayName="StackContext";var nn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(nn||{});function Lg(){return y.useContext(On)}function Ig({children:e,onUpdate:t,type:r,element:i,enabled:n}){let o=Lg(),a=ie((...s)=>{t==null||t(...s),o(...s)});return Re(()=>{let s=n===void 0||n===!0;return s&&a(0,r,i),()=>{s&&a(1,r,i)}},[a,r,i,n]),k.default.createElement(On.Provider,{value:a},e)}function Rg(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Fg=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Fg||{}),kg=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(kg||{});let Dg={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},ar=y.createContext(null);ar.displayName="DialogContext";function kt(e){let t=y.useContext(ar);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,kt),r}return t}function Mg(e,t,r=()=>[document.body]){y.useEffect(()=>{var i;if(!t||!e)return;let n=Ft(),o=window.pageYOffset;function a(l,d,c){let g=l.style.getPropertyValue(d);return Object.assign(l.style,{[d]:c}),n.add(()=>{Object.assign(l.style,{[d]:g})})}let s=e.documentElement,u=((i=e.defaultView)!=null?i:window).innerWidth-s.clientWidth;if(a(s,"overflow","hidden"),u>0){let l=s.clientWidth-s.offsetWidth,d=u-l;a(s,"paddingRight",`${d}px`)}if(Rg()){a(e.body,"marginTop",`-${o}px`),window.scrollTo(0,0);let l=null;n.addEventListener(e,"click",d=>{if(d.target instanceof HTMLElement)try{let c=d.target.closest("a");if(!c)return;let{hash:g}=new URL(c.href),f=e.querySelector(g);f&&!r().some(p=>p.contains(f))&&(l=f)}catch{}},!0),n.addEventListener(e,"touchmove",d=>{d.target instanceof HTMLElement&&!r().some(c=>c.contains(d.target))&&d.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+o),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})}return n.dispose},[e,t])}function jg(e,t){return re(t.type,Dg,e,t)}let $g="div",Ug=ir.RenderStrategy|ir.Static,Vg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-${r}`,open:n,onClose:o,initialFocus:a,__demoMode:s=!1,...u}=e,[l,d]=y.useState(0),c=bn();n===void 0&&c!==null&&(n=re(c,{[Ye.Open]:!0,[Ye.Closed]:!1}));let g=y.useRef(new Set),f=y.useRef(null),p=be(f,t),v=y.useRef(null),b=Sr(f),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 n!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let P=n?0:1,[x,_]=y.useReducer(jg,{titleId:null,descriptionId:null,panelRef:y.createRef()}),M=ie(()=>o(!1)),U=ie(B=>_({type:0,id:B})),D=ft()?s?!1:P===0:!1,F=l>1,V=y.useContext(ar)!==null,L=F?"parent":"leaf";Og(f,F?D:!1);let I=ie(()=>{var B,te;return[...Array.from((B=b==null?void 0:b.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?B:[]).filter(K=>!(!(K instanceof HTMLElement)||K.contains(v.current)||x.panelRef.current&&K.contains(x.panelRef.current))),(te=x.panelRef.current)!=null?te:f.current]});ug(()=>I(),M,D&&!F),Sn(b==null?void 0:b.defaultView,"keydown",B=>{B.defaultPrevented||B.key===ha.Escape&&P===0&&(F||(B.preventDefault(),B.stopPropagation(),M()))}),Mg(b,P===0&&!V,I),y.useEffect(()=>{if(P!==0||!f.current)return;let B=new IntersectionObserver(te=>{for(let K of te)K.boundingClientRect.x===0&&K.boundingClientRect.y===0&&K.boundingClientRect.width===0&&K.boundingClientRect.height===0&&M()});return B.observe(f.current),()=>B.disconnect()},[P,f,M]);let[j,H]=Ng(),W=y.useMemo(()=>[{dialogState:P,close:M,setTitleId:U},x],[P,x,M,U]),G=y.useMemo(()=>({open:P===0}),[P]),Q={ref:p,id:i,role:"dialog","aria-modal":P===0?!0:void 0,"aria-labelledby":x.titleId,"aria-describedby":j};return k.default.createElement(Ig,{type:"Dialog",enabled:P===0,element:f,onUpdate:ie((B,te,K)=>{te==="Dialog"&&re(B,{[nn.Add](){g.current.add(K),d(ce=>ce+1)},[nn.Remove](){g.current.add(K),d(ce=>ce-1)}})})},k.default.createElement(tn,{force:!0},k.default.createElement(rn,null,k.default.createElement(ar.Provider,{value:W},k.default.createElement(rn.Group,{target:f},k.default.createElement(tn,{force:!1},k.default.createElement(H,{slot:G,name:"Dialog.Description"},k.default.createElement(Ot,{initialFocus:a,containers:g,features:D?re(L,{parent:Ot.features.RestoreFocus,leaf:Ot.features.All&~Ot.features.FocusLock}):Ot.features.None},he({ourProps:Q,theirProps:u,slot:G,defaultTag:$g,features:Ug,visible:P===0,name:"Dialog"})))))))),k.default.createElement(en,{features:or.Hidden,ref:v}))}),Bg="div",Hg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-overlay-${r}`,...n}=e,[{dialogState:o,close:a}]=kt("Dialog.Overlay"),s=be(t),u=ie(d=>{if(d.target===d.currentTarget){if(fg(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),a()}}),l=y.useMemo(()=>({open:o===0}),[o]);return he({ourProps:{ref:s,id:i,"aria-hidden":!0,onClick:u},theirProps:n,slot:l,defaultTag:Bg,name:"Dialog.Overlay"})}),Wg="div",Kg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-backdrop-${r}`,...n}=e,[{dialogState:o},a]=kt("Dialog.Backdrop"),s=be(t);y.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let u=y.useMemo(()=>({open:o===0}),[o]);return k.default.createElement(tn,{force:!0},k.default.createElement(rn,null,he({ourProps:{ref:s,id:i,"aria-hidden":!0},theirProps:n,slot:u,defaultTag:Wg,name:"Dialog.Backdrop"})))}),Gg="div",zg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-panel-${r}`,...n}=e,[{dialogState:o},a]=kt("Dialog.Panel"),s=be(t,a.panelRef),u=y.useMemo(()=>({open:o===0}),[o]),l=ie(d=>{d.stopPropagation()});return he({ourProps:{ref:s,id:i,onClick:l},theirProps:n,slot:u,defaultTag:Gg,name:"Dialog.Panel"})}),Yg="h2",Qg=le(function(e,t){let r=dt(),{id:i=`headlessui-dialog-title-${r}`,...n}=e,[{dialogState:o,setTitleId:a}]=kt("Dialog.Title"),s=be(t);y.useEffect(()=>(a(i),()=>a(null)),[i,a]);let u=y.useMemo(()=>({open:o===0}),[o]);return he({ourProps:{ref:s,id:i},theirProps:n,slot:u,defaultTag:Yg,name:"Dialog.Title"})}),no=Object.assign(Vg,{Backdrop:Kg,Panel:zg,Overlay:Hg,Title:Qg,Description:_g});function qg(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function Vr(e,...t){e&&t.length>0&&e.classList.add(...t)}function Br(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Jg(e,t){let r=Ft();if(!e)return r.dispose;let{transitionDuration:i,transitionDelay:n}=getComputedStyle(e),[o,a]=[i,n].map(s=>{let[u=0]=s.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,d)=>d-l);return u});if(o+a!==0){let s=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),s())})}else t();return r.add(()=>t()),r.dispose}function Zg(e,t,r,i){let n=r?"enter":"leave",o=Ft(),a=i!==void 0?qg(i):()=>{};n==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=re(n,{enter:()=>t.enter,leave:()=>t.leave}),u=re(n,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=re(n,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Br(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Vr(e,...s,...l),o.nextFrame(()=>{Br(e,...l),Vr(e,...u),Jg(e,()=>(Br(e,...s),Vr(e,...t.entered),a()))}),o.dispose}function Xg({container:e,direction:t,classes:r,onStart:i,onStop:n}){let o=br(),a=mn(),s=_e(t);Re(()=>{let u=Ft();a.add(u.dispose);let l=e.current;if(!!l&&s.current!=="idle"&&!!o.current)return u.dispose(),i.current(s.current),u.add(Zg(l,r.current,s.current==="enter",()=>{u.dispose(),n.current(s.current)})),u.dispose},[t])}function ep(...e){return e.filter(Boolean).join(" ")}function Ve(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Or=y.createContext(null);Or.displayName="TransitionContext";var tp=(e=>(e.Visible="visible",e.Hidden="hidden",e))(tp||{});function rp(){let e=y.useContext(Or);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function np(){let e=y.useContext(wr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let wr=y.createContext(null);wr.displayName="NestingContext";function Er(e){return"children"in e?Er(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ea(e,t){let r=_e(e),i=y.useRef([]),n=br(),o=mn(),a=ie((f,p=Te.Hidden)=>{let v=i.current.findIndex(({el:b})=>b===f);v!==-1&&(re(p,{[Te.Unmount](){i.current.splice(v,1)},[Te.Hidden](){i.current[v].state="hidden"}}),o.microTask(()=>{var b;!Er(i)&&n.current&&((b=r.current)==null||b.call(r))}))}),s=ie(f=>{let p=i.current.find(({el:v})=>v===f);return p?p.state!=="visible"&&(p.state="visible"):i.current.push({el:f,state:"visible"}),()=>a(f,Te.Unmount)}),u=y.useRef([]),l=y.useRef(Promise.resolve()),d=y.useRef({enter:[],leave:[],idle:[]}),c=ie((f,p,v)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([b])=>b!==f)),t==null||t.chains.current[p].push([f,new Promise(b=>{u.current.push(b)})]),t==null||t.chains.current[p].push([f,new Promise(b=>{Promise.all(d.current[p].map(([m,S])=>S)).then(()=>b())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),g=ie((f,p,v)=>{Promise.all(d.current[p].splice(0).map(([b,m])=>m)).then(()=>{var b;(b=u.current.shift())==null||b()}).then(()=>v(p))});return y.useMemo(()=>({children:i,register:s,unregister:a,onStart:c,onStop:g,wait:l,chains:d}),[s,a,i,c,g,d,l])}function ip(){}let op=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function io(e){var t;let r={};for(let i of op)r[i]=(t=e[i])!=null?t:ip;return r}function ap(e){let t=y.useRef(io(e));return y.useEffect(()=>{t.current=io(e)},[e]),t}let sp="div",xa=ir.RenderStrategy,Pa=le(function(e,t){let{beforeEnter:r,afterEnter:i,beforeLeave:n,afterLeave:o,enter:a,enterFrom:s,enterTo:u,entered:l,leave:d,leaveFrom:c,leaveTo:g,...f}=e,p=y.useRef(null),v=be(p,t),b=f.unmount?Te.Unmount:Te.Hidden,{show:m,appear:S,initial:P}=rp(),[x,_]=y.useState(m?"visible":"hidden"),M=np(),{register:U,unregister:D}=M,F=y.useRef(null);y.useEffect(()=>U(p),[U,p]),y.useEffect(()=>{if(b===Te.Hidden&&!!p.current){if(m&&x!=="visible"){_("visible");return}return re(x,{hidden:()=>D(p),visible:()=>U(p)})}},[x,p,U,D,m,b]);let V=_e({enter:Ve(a),enterFrom:Ve(s),enterTo:Ve(u),entered:Ve(l),leave:Ve(d),leaveFrom:Ve(c),leaveTo:Ve(g)}),L=ap({beforeEnter:r,afterEnter:i,beforeLeave:n,afterLeave:o}),I=ft();y.useEffect(()=>{if(I&&x==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,x,I]);let j=P&&!S,H=(()=>!I||j||F.current===m?"idle":m?"enter":"leave")(),W=ie(K=>re(K,{enter:()=>L.current.beforeEnter(),leave:()=>L.current.beforeLeave(),idle:()=>{}})),G=ie(K=>re(K,{enter:()=>L.current.afterEnter(),leave:()=>L.current.afterLeave(),idle:()=>{}})),Q=Ea(()=>{_("hidden"),D(p)},M);Xg({container:p,classes:V,direction:H,onStart:_e(K=>{Q.onStart(p,K,W)}),onStop:_e(K=>{Q.onStop(p,K,G),K==="leave"&&!Er(Q)&&(_("hidden"),D(p))})}),y.useEffect(()=>{!j||(b===Te.Hidden?F.current=null:F.current=m)},[m,j,x]);let B=f,te={ref:v};return S&&m&&(typeof window=="undefined"||typeof document=="undefined")&&(B={...B,className:ep(f.className,...V.current.enter,...V.current.enterFrom)}),k.default.createElement(wr.Provider,{value:Q},k.default.createElement(pg,{value:re(x,{visible:Ye.Open,hidden:Ye.Closed})},he({ourProps:te,theirProps:B,defaultTag:sp,features:xa,visible:x==="visible",name:"Transition.Child"})))}),on=le(function(e,t){let{show:r,appear:i=!1,unmount:n,...o}=e,a=y.useRef(null),s=be(a,t);ft();let u=bn();if(r===void 0&&u!==null&&(r=re(u,{[Ye.Open]:!0,[Ye.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,d]=y.useState(r?"visible":"hidden"),c=Ea(()=>{d("hidden")}),[g,f]=y.useState(!0),p=y.useRef([r]);Re(()=>{g!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),f(!1))},[p,r]);let v=y.useMemo(()=>({show:r,appear:i,initial:g}),[r,i,g]);y.useEffect(()=>{if(r)d("visible");else if(!Er(c))d("hidden");else{let m=a.current;if(!m)return;let S=m.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&d("hidden")}},[r,c]);let b={unmount:n};return k.default.createElement(wr.Provider,{value:c},k.default.createElement(Or.Provider,{value:v},he({ourProps:{...b,as:y.Fragment,children:k.default.createElement(Pa,{ref:s,...b,...o})},theirProps:{},defaultTag:y.Fragment,features:xa,visible:l==="visible",name:"Transition"})))}),up=le(function(e,t){let r=y.useContext(Or)!==null,i=bn()!==null;return k.default.createElement(k.default.Fragment,null,!r&&i?k.default.createElement(on,{ref:t,...e}):k.default.createElement(Pa,{ref:t,...e}))}),Hr=Object.assign(on,{Child:up,Root:on});function lp(e){const{children:t,isOpen:r,handleClose:i}=e,{isMobile:n}=la({isModal:!0});return w(xe,{children:w(Hr,{appear:!0,show:r,as:y.Fragment,children:w(no,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:i,children:$("div",{className:"min-h-screen text-center sm:px-4",children:[w(Hr.Child,{as:y.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(no.Overlay,{className:"fixed inset-0"})}),w("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),w(Hr.Child,{as:y.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:$("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:$("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:i,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:`${n?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function cp(e){var H,W,G,Q;const{product:t,isOpen:r,handleGoBack:i,showDebugState:n=!1,countedProductPrice:o,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l,children:d}=e,{minPrice:c="0"}=t,[g,f]=y.useState("auto"),[p,v]=y.useState(0);y.useEffect(()=>{v(1);const B=setTimeout(()=>{_||v(2)},250);return()=>{clearTimeout(B)}},[]);const{displayPriceFrom:b,formattedEndPrice:m}=od(o,c,a),S=y.useRef(),P=y.useRef(),{isSm:x,isMobile:_,windowHeight:M}=la({isModal:!0}),U=$(xe,{children:[$("div",{className:St("px-4 w-full",x&&"sm:sticky sm:top-0 sm:w-2/5"),ref:S,children:[t.details.media&&t.details.media[0].url&&w("img",{className:St("mx-auto mt-2 mb-6 max-h-[250px]",x&&"max-h-[450px]"),alt:t.details.literals.name,src:(H=t.details)==null?void 0:H.media[0].url}),w("div",{className:St(!n&&"hidden"),children:w(ua,{})})]}),$("div",{className:St("w-full",x&&"sm:w-3/5"),ref:P,children:[$("div",{className:"items-center w-full p-4",children:[$("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[$("span",{className:"",children:[t.details.literals.name," "]}),w(hr,{price:e.countedProductPrice,minPrice:c})]}),w("span",{className:"text-gray-600",children:(W=t.details.literals)==null?void 0:W.description})]}),$("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[d,w("div",{className:"sm:h-[64px]"})]}),x&&w("div",{className:"-mt-5 mb-2 bg-gray-100",children:w(Ji,{finalPrice:m,isBackIcon:!1,handleGoBack:i,displayPriceFrom:b})})]})]}),D=(G=S==null?void 0:S.current)==null?void 0:G.clientHeight,F=(Q=P==null?void 0:P.current)==null?void 0:Q.clientHeight,V=D+F;V>window.innerHeight*.8||isNaN(V)?g!=="80vh"&&f("80vh"):g!=="auto"&&f("auto");const L=`${M-64-56}px`,I=!x,j={"--mobile-submit-row-top":`${M-64-80}px`};return w(lp,{isOpen:Boolean(r),handleClose:i,children:$("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[w("div",{className:St("flex relative flex-col items-start w-full form-body stretch",!I&&"sm:flex-row-reverse sm:pb-0",!_&&"mobile-scrollbar"),style:{height:`${_?L:g}`,minHeight:"400px",overflowY:"scroll"},children:U}),I&&w("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${_?"submit-row-mobile":"submit-row"}`,style:j,children:w(Ji,{handleGoBack:i,finalPrice:m,isBackIcon:!1,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l})})]})})}const fp=e=>{const{product:t}=e,{MenuProductRootUI:r}=mr(),i=gr(t.items)?w(xe,{}):w(hn,{productItems:t.items,parentProduct:t});return r?w(r,{...e,children:i}):w(cp,{...e,children:i})};function dp(e){const{product:t,lang:r="en",handleAddToCart:i,handleGoBack:n,isOpen:o,handleClose:a,currency:s,showDebugState:u=!1}=e,{price:l}=t,{encodedProduct:d,initSelected:c,filter:g,productQuantity:f,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:v,getValidationMap:b,increaseProductQuantity:m,decreaseProductQuantity:S,setCurrency:P}=Ef(t),[x,_]=y.useState(b());y.useEffect(()=>{oe.changeLanguage(r)},[r]),y.useEffect(()=>{P(s)},[s]),y.useEffect(()=>{const I=b();mf(I,x)||_(I)});const M=_s({defaultValues:{selected:c}}),{handleSubmit:U,getValues:D}=M,F=Number((parseFloat(l||"0")+dn(D("selected"),t)).toFixed(2)),V=()=>{console.log("onSubmit"),p();const I=v();if(I.length)Ks(Ro(I[0])),console.log({invalidContextNames:I});else{console.log("selected",D("selected"));const j=Hs(Bs(D("selected")));console.log("decodedCleanedSelected: ",j),i({price:F,quantity:f,selected:j,filter:g})}},L=()=>V();return w(xe,{children:w(aa.Provider,{value:e.components,children:w(gs,{...M,children:$("form",{children:[u&&w("div",{className:"hidden",children:w(ua,{})}),w(fp,{product:d,productQuantity:f,validationMap:x,isOpen:o,handleClose:a,handleGoBack:n,handleOnSubmit:L,countedProductPrice:F,countedProductTotalPrice:F*f,increaseProductQuantity:m,decreaseProductQuantity:S,currency:s})]})})})})}exports.ContextType=fn;exports.MainView=wo;exports.ProductConfigurator=dp;exports.ProductKinds=cr;exports.ProductTypes=Eo;exports.SelMinSelMaxStatus=de;
18
18
  //# sourceMappingURL=index.cjs.js.map