@orderingstack/front-components-product-configurator 1.4.2-beta.29 → 1.4.2-beta.30

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.
@@ -5,7 +5,7 @@ export declare function useMenuProduct(product: IProduct, parentAttrs: IProductA
5
5
  isCheckbox: boolean;
6
6
  isCounter: boolean;
7
7
  isDecrementEnabled: boolean;
8
- isIncrementEnabled: {};
8
+ isIncrementEnabled: any;
9
9
  isChecked: boolean;
10
10
  isCheckboxEnabled: any;
11
11
  handleCounterIncrementQty: () => void;
package/dist/index.cjs.js CHANGED
@@ -8,7 +8,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */var bp=T.default,Sp=Symbol.for("react.element"),Op=Symbol.for("react.fragment"),wp=Object.prototype.hasOwnProperty,Ep=bp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xp={key:!0,ref:!0,__self:!0,__source:!0};function vs(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)wp.call(t,n)&&!xp.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Sp,type:e,key:a,ref:o,props:i,_owner:Ep.current}}kr.Fragment=Op;kr.jsx=vs;kr.jsxs=vs;Mr.exports=kr;const C=Mr.exports.jsx,B=Mr.exports.jsxs,Ge=Mr.exports.Fragment;function Ca(e){const{isOk:t,isErr:r,info:n}=e;return B("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&Pp,r&&Cp,n]})}const Pp=C("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:C("polyline",{points:"20 6 9 17 4 12"})}),Cp=C("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:C("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 Ap={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},_p={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 zt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zt=function(t){return typeof t}:zt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}function Aa(e){return Tp(e)||Np(e)||$p(e)||Ip()}function Tp(e){if(Array.isArray(e))return e}function Np(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function $p(e,t){if(!!e){if(typeof e=="string")return _a(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 _a(e,t)}}function _a(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ip(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Lp={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=Aa(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(t){var r=Aa(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function ys(e){return!isNaN(parseInt(e))&&isFinite(e)}function Rp(e){return ys(e)&&e<=100&&e>=0}function Fp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Ta(e){return e%2===0}function Na(e){return ys(e)&&!Number.isInteger(e)}function Dp(){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 kt(e){return Math.abs(e)%1===.5}function Mp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),kp(i,t.headers),i.send()})}function kp(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 bs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(zt(n[1])==="object"){var i=bs(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function jp(e){return Boolean(e)&&(zt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ss(){var e=function(n,i){var a=function(u){return Math.pow(10,Dp(u))},o=Math.max(a(n),a(i));return Math.round(n*o)*Math.round(i*o)/(o*o)},t={HALF_ODD:function(n){var i=Math.round(n);return kt(n)&&Ta(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return kt(n)?Ta(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return kt(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return kt(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return kt(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return Na(n)||Na(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var Vp=Ss();function Up(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Wt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Wt(this.getMatches().find(n))?0:this.getMatches()[Vp.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Wt(this.getMatches().find(function(n){return n===","}))}}}function Bp(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)i=i.replace("{{".concat(o,"}}"),a[o]);return i},r=function(i,a){return Mp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(jp(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return bs(o)[t(e.propertyPath,{from:i,to:a})]})}}}function Zt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Hp(e){Zt(Rp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Wp(e){Zt(Fp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function cn(e){Zt(Number.isInteger(e),"You must provide an integer.",TypeError)}var Z=Ss(),Gp=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,a=r.precision;cn(n),cn(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,f=e.globalFormatRoundingMode,c=Object.assign({},e.globalExchangeRatesApi),l=function(p){var y=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:y.amount,currency:y.currency,precision:y.precision}),{locale:y.locale})},d=function(p){Zt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;cn(p);var v=this.getPrecision(),b=p>v,h=b?Z.multiply:Z.divide,E=b?[p,v]:[v,p],A=Math.pow(10,Z.subtract.apply(Z,E));return l.call(this,{amount:Z.round(h(this.getAmount(),A),y),precision:p})},add:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:Z.add(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},subtract:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:Z.subtract(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},multiply:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Z.round(Z.multiply(this.getAmount(),p),y)})},divide:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Z.round(Z.divide(this.getAmount(),p),y)})},percentage:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Hp(p),this.multiply(Z.divide(p,100),y)},allocate:function(p){var y=this;Wp(p);for(var v=p.reduce(function(A,w){return Z.add(A,w)}),b=this.getAmount(),h=p.map(function(A){var w=Math.floor(Z.divide(Z.multiply(y.getAmount(),A),v));return b=Z.subtract(b,w),l.call(y,{amount:w})}),E=0;b>0;)p[E]>0&&(h[E]=h[E].add(l.call(this,{amount:1})),b=Z.subtract(b,1)),E+=1;return h},convert:function(p){var y=this,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=v.endpoint,h=b===void 0?c.endpoint:b,E=v.propertyPath,A=E===void 0?c.propertyPath||"rates.{{to}}":E,w=v.headers,P=w===void 0?c.headers:w,_=v.roundingMode,L=_===void 0?u:_,F=Object.assign({},{endpoint:h,propertyPath:A,headers:P,roundingMode:L});return Bp(F).getExchangeRate(this.getCurrency(),p).then(function(k){return Zt(!Wt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(y,{amount:Z.round(Z.multiply(y.getAmount(),parseFloat(k)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<y[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<=y[1].getAmount()},greaterThan:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>y[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>=y[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,a))!==0},hasCents:function(){return Z.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var y=e.normalizePrecision([this,p]);return y[0].getAmount()===y[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Up(p);return this.toRoundedUnit(v.getMinimumFractionDigits(),y).toLocaleString(this.getLocale(),{currencyDisplay:v.getCurrencyDisplay(),useGrouping:v.getUseGrouping(),minimumFractionDigits:v.getMinimumFractionDigits(),style:v.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Z.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Math.pow(10,p);return Z.divide(Z.round(Z.multiply(this.toUnit(),v),y),v)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},Kp=Object.assign(Gp,Ap,_p,Lp);const pr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":Kp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Yp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=pr(`${r*n}`);const o=`${pr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${pr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function jr(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=t>s?t:a,f=pr(`${u}`);return!t&&i===!1?null:r?B("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${f}`]}):t<s?B("span",{className:"",children:["\xA0",`od ${f}`]}):C("span",{className:"",children:f})}function zp(e,t){const{selCtx:r,id:n}=e,i=ie(s=>s.expanded),a=S.useMemo(()=>Qp(r,n,t,i),[r,n,t,i]),o=ie(s=>s.toggleExpanded);return{isExpanded:a,toggleExpanded:o}}const Qp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var qp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Jp={"&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;":"/"},Zp=function(t){return Jp[t]},Xp=function(t){return t.replace(qp,Zp)};function $a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$a(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$a(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _n={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Xp},Os,eh=S.createContext();function th(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n=Ia(Ia({},_n),e)}function rh(){return _n}var nh=function(){function e(){$e(this,e),this.usedNamespaces={}}return Ie(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function ih(e){Os=e}function ah(){return Os}var oh={type:"3rdParty",init:function(t){th(t.options.react),ih(t)}};function sh(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var La={};function Tn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&La[t[0]]||(typeof t[0]=="string"&&(La[t[0]]=new Date),sh.apply(void 0,t))}function Ra(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function uh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var o=function(u,f){var c=t.services.backendConnector.state["".concat(u,"|").concat(f)];return c===-1||c===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}function lh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Tn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(a,o){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}):uh(e,t,r)}function ch(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,f=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){f=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return s}}function fh(e,t){return Qa(e)||ch(e,t)||qa(e,t)||Ja()}function Fa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fa(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var dh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function ti(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(eh)||{},i=n.i18n,a=n.defaultNS,o=r||i||ah();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new nh),!o){Tn("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}o.options.react&&o.options.react.wait!==void 0&&Tn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=fn(fn(fn({},rh()),o.options.react),t),c=f.useSuspense,l=f.keyPrefix,d=e||a||o.options&&o.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(d);var g=(o.isInitialized||o.initializedStoreOnce)&&d.every(function(L){return lh(L,o,f)});function p(){return o.getFixedT(null,f.nsMode==="fallback"?d:d[0],l)}var y=S.useState(p),v=fh(y,2),b=v[0],h=v[1],E=d.join(),A=dh(E),w=S.useRef(!0);S.useEffect(function(){var L=f.bindI18n,F=f.bindI18nStore;w.current=!0,!g&&!c&&Ra(o,d,function(){w.current&&h(p)}),g&&A&&A!==E&&w.current&&h(p);function k(){w.current&&h(p)}return L&&o&&o.on(L,k),F&&o&&o.store.on(F,k),function(){w.current=!1,L&&o&&L.split(" ").forEach(function(W){return o.off(W,k)}),F&&o&&F.split(" ").forEach(function(W){return o.store.off(W,k)})}},[o,E]);var P=S.useRef(!0);S.useEffect(function(){w.current&&!P.current&&h(p),P.current=!1},[o,l]);var _=[b,o,g];if(_.t=b,_.i18n=o,_.ready=g,g||!g&&!c)return _;throw new Promise(function(L){Ra(o,d,function(){L()})})}var ws=[],gh=ws.forEach,ph=ws.slice;function hh(e){return gh.call(ph.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Da=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,mh=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o="".concat(t,"=").concat(a);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Da.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Da.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Ma={create:function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=mh(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var a=n[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},vh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=Ma.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&Ma.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},yh={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),a=i.split("&"),o=0;o<a.length;o++){var s=a[o].indexOf("=");if(s>0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(r=a[o].substring(s+1))}}}return r}},jt=null,ka=function(){if(jt!==null)return jt;try{jt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{jt=!1}return jt},bh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&ka()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&ka()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Vt=null,ja=function(){if(Vt!==null)return Vt;try{Vt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Vt=!1}return Vt},Sh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&ja()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&ja()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Oh={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},wh={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},Eh={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},xh={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function Ph(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Es=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$e(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Ie(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=hh(n,this.options||{},Ph()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(vh),this.addDetector(yh),this.addDetector(bh),this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh),this.addDetector(xh)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(r,i.options)}))}}]),e}();Es.type="languageDetector";const Ch={"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"},Ah={"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"},_h={"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"},Th={"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"};ve.use(Es).use(oh).init({resources:{pl:{translation:Ch},en:{translation:Ah},de:{translation:_h},cs:{translation:Th}}});const Nh=(e,t,r,n)=>{let i="",a="";const o=Number(e),s=Number(t);return o>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>r&&(a=Te.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Te.TOO_MUCH)),o>=0||s>=0&&r<o?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",a=Te.IGNORE),r>=o&&r<=s&&(a=Te.OK),{message:i,validationStatus:a}},$h=(e,t,r,n)=>{let i="",a="";const o=parseInt(e||"-1"),s=parseInt(t||"-1");return o>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>r&&(a=Te.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Te.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Te.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Te.OK),{message:i,validationStatus:a}},Ih=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:a,actualSelCnt:o,children:s}=e,{selCtx:u,details:f={},id:c,attrs:l={}}=t,{qtyMin:d,qtyMax:g,selMin:p,selMax:y}=l,{name:v,description:b}=f.literals||{},{t:h}=ti(),{isExpanded:E,toggleExpanded:A}=zp(t,r),{validationStatus:w,message:P}=$h(p,y,o,h),{validationStatus:_,message:L}=Nh(d,g,a,h),F=w===Te.OK,k=_===Te.OK,W=!F&&i&&!!P,D=!k&&i&&!!L;return B("div",{className:"pt-1 mb-3",id:ls(u),children:[B("div",{className:"flex text-xl font-semibold",children:[C("p",{className:"",children:v}),v&&v!==" "&&B(Ge,{children:[C("div",{className:"ml-auto",children:C(jr,{price:Gn(n,t)})}),C("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!E&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>A(u,c,r),children:C("polyline",{points:"18 15 12 9 6 15"})})]})]}),C("p",{className:`${b&&"mb-2"}`,children:b}),!1,C("div",{className:"flex",children:B("div",{children:[C(Ca,{isOk:F,isErr:W,info:P}),C(Ca,{isOk:k,isErr:D,info:L})]})}),C("div",{className:`${E?"block":"hidden"}`,children:s})]})},xs=T.default.createContext(null);function Vr(){const e=S.useContext(xs);if(!e)throw new Error("Missing ComponentsContext");return e}const Lh=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:a}=e,{isFilterValidated:o,selected:s,isOnSubmitted:u,selCnt:f,qtyCnt:c,currency:l}=ms(t,n,i,r),{MenuOptionsUI:d}=Vr();if(!o)return null;const g=C(ri,{productItems:t.items,parentProduct:t,rootProduct:a}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:c,actualSelCnt:f,currency:l};return d?C(d,{...p,children:g}):C(Ih,{...p,children:g})},Rh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:a="lg",children:o}=e,{details:{literals:s}={}}=t,{name:u="",description:f=""}=s||{},c=No(t),l=cs(t);return B("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[C("input",{type:"checkbox",className:`simple-checkbox checkbox-${a} mr-4`,id:r,disabled:n,value:"1",...i}),l&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:l})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:u}),C("p",{className:"text-sm text-gray-600",children:f})]})}),C("div",{className:"ml-auto",children:o}),C("label",{htmlFor:r,children:C(jr,{price:parseFloat(c),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Fh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:a,size:o="lg",children:s}=e,{details:{literals:u}={}}=t,{name:f="",description:c=""}=u||{},l=No(t),d=cs(t);return B("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[C("input",{type:"radio",className:`simple-radio radio-${o} mr-4`,id:r,...i,value:n,checked:a}),d&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:d})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:f}),C("p",{className:"text-sm text-gray-600",children:c})]})}),C("div",{className:"ml-auto",children:s}),C("label",{htmlFor:r,children:C(jr,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ps(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return B("div",{className:`counter counter-${o} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[C("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),C("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),C("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,children:B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Dh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=Ye(),{id:s,selCtx:u,emit:f={},fltCtx:c}=e,l=n(`selected.${u}.${s}`);return S.useEffect(()=>{var y,v,b;if(!r||r>1)return;const d=`filterWithCnt.${c}`,g=`filterWithCnt.${c}.${u}`,p=`filter.${c}`;if(t&&l&&c)if(Me(f)){const h=a(g);(y=Object.keys(h||{}))==null||y.forEach(E=>{o(`${g}.${E}`);const A=Object.keys(a(d)||{});Me(A)?o(`${p}.${E}`):A.forEach(w=>{w!==u&&!a(`${d}.${w}.${E}`)&&o(`${p}.${E}`)})});return}else{const h=a(g),E=a(d);(v=Object.keys(f))==null||v.forEach(A=>{var w;(w=Object.keys(h||{}))==null||w.forEach(P=>{f[P]||(o(`${p}.${P}`),o(`${g}.${P}`))}),Object.keys(E||{}).forEach(P=>{P!==u&&A in a(d==null?void 0:d[P])&&o(`${d}.${P}.${A}`)}),i(`${p}.${A}`,f[A]),i(`${g}.${A}`,{cnt:1,value:f[A]})});return}l&&c&&!Me(f)&&((b=Object.keys(f))==null||b.forEach(h=>{i(`filter.${c}.${h}`,f[h]);const E=a(`${g}.${h}.cnt`)||0;i(`${g}.${h}`,{cnt:E+1,value:f[h]})}))},[l]),{}}function Mh(){const e=ie(n=>n.getInvalidSelCtxArray),t=ie(n=>n.isInputEnabled),r=ie(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Va=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},Nn=(e,t,r)=>{const n=t(`selected.${e}`);r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},kh=(e,t,r,n,i,a)=>{var d,g;const{items:o,state:s,emit:u,fltCtx:f,selCtx:c}=r,{selected:l={}}=s||{};if(console.log("selected/unselected product",r,n),n){Va(l,e);const p=y=>{var v;!Array.isArray(y)||Me(s==null?void 0:s.selected)||(v=y==null?void 0:y.filter(b=>{var h,E;return!!((E=(h=s.selected)==null?void 0:h[`${b.selCtx}`])!=null&&E[`${b.id}`])}))==null||v.map(b=>{if(b.state&&"selected"in b.state){const{state:{selected:h}}=b;Va(h,e)}Array.isArray(b.items)&&p(b.items)})};p(o)}else{Object.keys(l).forEach(y=>{Nn(y,t,e)});const p=y=>{!Array.isArray(y)||y.map(v=>{const{selCtx:b}=v;t(`selected.${b}`)&&Nn(b,t,e),p(v.items)})};if(p(o),a&&a<2&&!Me(u)){(d=Object.keys(u))==null||d.forEach(h=>{const E=`filterWithCnt.${f}.${h}.${u[h]}`,A=t(E)||0;A<2?i(E):e(E,A-1)});const y=`filterWithCnt.${f}`,v=`filterWithCnt.${f}.${c}`,b=`filter.${f}`;(g=Object.keys(u))==null||g.forEach(h=>{var A,w,P;const E=t(`${v}.${h}`)||0;if(E)if(E>1)e(`${v}.${h}`,E-1);else{i(`${v}.${h}`);const _=t(y)||{},L=(A=Object.keys(_))==null?void 0:A.filter(F=>F!==c);if(!L)i(`${b}.${h}`);else{const F=L==null?void 0:L.find(k=>{var W;return!!((W=_==null?void 0:_[`${k}`])!=null&&W[`${h}`])});if(!F)i(`${b}.${h}`);else{const k=(P=(w=_==null?void 0:_[`${F}`])==null?void 0:w[`${h}`])==null?void 0:P.value;e(`${b}.${h}`,k)}}}})}}},Cs=(e,t)=>{var r;if(!e.items||Me(e.items))return null;for(let n=0;n<((r=e.items)==null?void 0:r.length);n++){const i=e.items[n];if(i.selCtx===t&&i.kind===Je.PRODUCT)return i;if(i.kind===Je.OPTIONS&&i.items&&i.items.length>0){const a=Cs(i,t);if(a)return a}}return null};function jh(e,t,r){var pe;const{id:n,selCtx:i,emit:a={},fltCtx:o}=e,{allowMultiple:s,selMin:u,selMax:f}=t,{isInputEnabled:c,isInputCounterIncrementEnabled:l}=Mh(),d=ie(ee=>ee.refreshForm),g=ie(ee=>ee.currency),{watch:p,getValues:y,setValue:v,register:b,unregister:h}=Ye(),E=p(`selected.${i}.${n}`),{selected:A={}}=y(),w=Number(E||0),P=u==="1"&&f==="1",_=!P,L=np(s),F=w>(P?1:0),k=Dh(e,P,r);l(e,A)&&c(e);const W=Number(((pe=A==null?void 0:A[i])==null?void 0:pe[n])||0)>0,D=c(e)||w,j=`${P?"radio":"selected"}.${i}.${n}`,V=b(j,{onChange:ee=>{G(ee)}}),H=()=>{v(`selected.${i}.${n}`,`${w+1}`)},Q=()=>{var ce,oe;const ee=w-1;if(v(`selected.${i}.${n}`,`${ee}`),_&&ee===0){v(`selected.${i}.${n}`,!1),(ce=Object.keys(a))==null||ce.forEach(te=>{const K=`filterWithCnt.${o}.${te}.${a[te]}`,he=y(K)||0;he<2?h(K):v(K,he-1)});const fe=te=>{!Array.isArray(te)||te.map(K=>{const{selCtx:he}=K;y(`selected.${he}`)&&Nn(he,y,v),fe(K.items)})};if(fe(e.items),r&&r<2&&!Me(a)){const te=`filterWithCnt.${o}`,K=`filterWithCnt.${o}.${i}`,he=`filter.${o}`;(oe=Object.keys(a))==null||oe.forEach(ae=>{var Ae,Re,je;const Ee=y(`${K}.${ae}`)||0;if(Ee)if(Ee>1)v(`${K}.${ae}`,Ee-1);else{h(`${K}.${ae}`);const U=y(te)||{},se=(Ae=Object.keys(U))==null?void 0:Ae.filter(ne=>ne!==i);if(!se)h(`${he}.${ae}`);else{const ne=se==null?void 0:se.find(Se=>{var Gr;return!!((Gr=U==null?void 0:U[`${Se}`])!=null&&Gr[`${ae}`])});if(!ne)h(`${he}.${ae}`);else{const Se=(je=(Re=U==null?void 0:U[`${ne}`])==null?void 0:Re[`${ae}`])==null?void 0:je.value;v(`${he}.${ae}`,Se)}}}})}}},G=ee=>{const{target:{checked:ce,name:oe,defaultValue:fe}}=ee;for(const te of Object.keys(A||{}))P&&te!==(e==null?void 0:e.selCtx)&&(te==null?void 0:te.includes(e.selCtx))&&Cs(e,te)&&v(`selected.${te}`,!1);if(kh(v,y,e,ce,h,r),P){console.log("handleOnInputChange radio",oe,fe);const te="selected."+oe.replace("radio.","").split(".")[0];v(te,{[fe]:"1"}),d()}};return{registerProps:V,isRadio:P,isCheckbox:_,isCounter:L,isDecrementEnabled:F,isIncrementEnabled:k,isChecked:W,isCheckboxEnabled:D,handleCounterIncrementQty:H,handleCounterDecrementQty:Q,counterValue:w,handleOnInputChange:G,inputId:`${i}.${n}`,radioInputValue:n,currency:g}}const Vh=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:a}=e,{registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:y,counterValue:v,handleCounterIncrementQty:b,handleCounterDecrementQty:h,currency:E}=jh(t,r,n),{MenuProductUI:A}=Vr(),w={product:t,nestedLvl:n,registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:y,counterValue:v,handleCounterIncrementQty:b,handleCounterDecrementQty:h,currency:E,parentProduct:i},P=C(ri,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return A?C(A,{...w,children:P}):C(Uh,{...w,children:P})},Uh=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:a,isRadio:o,isCheckbox:s,isCounter:u,isDecrementEnabled:f,isIncrementEnabled:c,isChecked:l,isCheckboxEnabled:d,counterValue:g,handleCounterIncrementQty:p,handleCounterDecrementQty:y,children:v}=e,b=C(Ps,{value:g,add:p,subtract:y,disabledSubtract:!f,disabledAdd:!c}),h=()=>o?C(Fh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:C(Ge,{children:u&&b})}):s?C(Rh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:C(Ge,{children:u&&b})}):null,E=!Me(t.items)&&g,A=ci.useTransition(E,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return B("div",{children:[h(),E?A((w,P)=>P&&C(ci.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:v},r+1)):null]})};function Bh(){return{isMenuProductToShow:r=>r.kind===Je.PRODUCT&&Ea(r),isMenuOptionsToShow:r=>[Je.OPTIONS,Je.CONFIG].includes(r.kind)&&Ea(r)}}function ri(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:f}=Bh(),{MenuItemsUI:c}=Vr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>f(g)?C(Lh,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?C(Vh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):C(Ge,{}),rootProduct:i};return c?C(c,{...d}):C(Hh,{...d})}function Hh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==Je.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:f}=ti(),c=()=>{u(a)},l=()=>{u(o)};return C(Ge,{children:t.map((d,g)=>{if(g<s)return B("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ua(f("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ua(f("OS.ProductConfigurator.ShowMore"),c,!0)})})}const Ua=(e,t,r)=>C("div",{className:"flex justify-center w-full",children:B("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("polyline",{points:"7 7 12 12 17 7"})," ",C("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),As=()=>{const{watch:e}=Ye(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=ie(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),B("div",{className:"flex flex-col items-center py-4",children:[C("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(a=>C("div",{children:Object.values(t[a]).filter(o=>o).length>0&&B(Ge,{children:[B("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>C(T.default.Fragment,{children:t[a][o]&&B("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ba(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:f}=ti();return B("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&B("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),C("span",{className:"uppercase",children:`${f("OS.ProductConfigurator.Back")}`})]}),C("div",{className:"px-3",children:C(Ps,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),B("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[B("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:[C("circle",{cx:"9",cy:"21",r:"1"})," ",C("circle",{cx:"20",cy:"21",r:"1"}),C("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?C("span",{children:`${f("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):C("span",{className:"uppercase",children:`${f("OS.ProductConfigurator.Add")} ${t}`})]})]})}const lr=640,_s=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=lr),[u,f]=S.useState(window.innerWidth>lr&&!t);function c(){n(window.innerWidth),a(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),S.useEffect(()=>{f(window.innerWidth>lr&&!t),s(window.innerWidth<=lr)},[r,e,t]),{isSm:u,isMobile:o,width:r,windowHeight:i}};function Ts(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ts(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ut(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ts(e))&&(n&&(n+=" "),n+=t);return n}var Wh=Object.defineProperty,Gh=(e,t,r)=>t in e?Wh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dn=(e,t,r)=>(Gh(e,typeof t!="symbol"?t+"":t,r),r);class Kh{constructor(){dn(this,"current",this.detect()),dn(this,"handoffState","pending"),dn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let Ze=new Kh,Ne=(e,t)=>{Ze.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Xe(e){let t=S.useRef(e);return Ne(()=>{t.current=e},[e]),t}let re=function(e){let t=Xe(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function Ur(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function wt(){let e=[],t={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),t.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Ur(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=wt();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let i of e.splice(n,1))i()}},dispose(){for(let r of e.splice(0))r()}};return t}function ni(){let[e]=S.useState(wt);return S.useEffect(()=>()=>e.dispose(),[e]),e}function Yh(){let e=typeof document=="undefined";return"useSyncExternalStore"in st?(t=>t.useSyncExternalStore)(st)(()=>()=>{},()=>!1,()=>!e):!1}function Lt(){let e=Yh(),[t,r]=st.useState(Ze.isHandoffComplete);return t&&Ze.isHandoffComplete===!1&&r(!1),st.useEffect(()=>{t!==!0&&r(!0)},[t]),st.useEffect(()=>Ze.handoff(),[]),e?!1:t}var Ha;let Rt=(Ha=T.default.useId)!=null?Ha:function(){let e=Lt(),[t,r]=T.default.useState(e?()=>Ze.nextId():null);return Ne(()=>{t===null&&r(Ze.nextId())},[t]),t!=null?""+t:void 0};function me(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,me),n}function Ns(e){return Ze.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let $n=["[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 gt=(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))(gt||{}),$s=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))($s||{}),zh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zh||{});function Qh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($n)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Is=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Is||{});function qh(e,t=0){var r;return e===((r=Ns(e))==null?void 0:r.body)?!1:me(t,{[0](){return e.matches($n)},[1](){let n=e;for(;n!==null;){if(n.matches($n))return!0;n=n.parentElement}return!1}})}var Jh=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Jh||{});typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mt(e){e==null||e.focus({preventScroll:!0})}let Zh=["textarea","input"].join(",");function Xh(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Zh))!=null?r:!1}function em(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function hr(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?em(e):e:Qh(e);i.length>0&&o.length>1&&(o=o.filter(g=>!i.includes(g))),n=n!=null?n:a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},c=0,l=o.length,d;do{if(c>=l||c+l<=0)return 0;let g=u+c;if(t&16)g=(g+l)%l;else{if(g<0)return 3;if(g>=l)return 1}d=o[g],d==null||d.focus(f),c+=s}while(d!==a.activeElement);return t&6&&Xh(d)&&d.select(),2}function Ls(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function tm(){return/Android/gi.test(window.navigator.userAgent)}function rm(){return Ls()||tm()}function cr(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Rs(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function nm(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,s){if(!n.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let f=function c(l){return typeof l=="function"?c(l()):Array.isArray(l)||l instanceof Set?l:[l]}(e);for(let c of f){if(c===null)continue;let l=c instanceof HTMLElement?c:c.current;if(l!=null&&l.contains(u)||o.composed&&o.composedPath().includes(l))return}return!qh(u,Is.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);cr("pointerdown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),cr("mousedown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),cr("click",o=>{rm()||a.current&&(i(o,()=>a.current),a.current=null)},!0),cr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Rs("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function rr(...e){return S.useMemo(()=>Ns(...e),[...e])}let Fs=Symbol();function im(e,t=!0){return Object.assign(e,{[Fs]:t})}function ke(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=re(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Fs]))?void 0:r}function ii(e,t){let r=S.useRef([]),n=re(e);S.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Cr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Ar=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ar||{}),ot=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ot||{});function Le({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:am;let u=Ds(t,e);if(a)return fr(u,r,n,o,s);let f=i!=null?i:0;if(f&2){let{static:c=!1,...l}=u;if(c)return fr(l,r,n,o,s)}if(f&1){let{unmount:c=!0,...l}=u;return me(c?0:1,{[0](){return null},[1](){return fr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return fr(u,r,n,o,s)}function fr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=gn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},c=typeof o=="function"?o(t):o;"className"in u&&u.className&&typeof u.className=="function"&&(u.className=u.className(t));let l={};if(t){let d=!1,g=[];for(let[p,y]of Object.entries(t))typeof y=="boolean"&&(d=!0),y===!0&&g.push(p);d&&(l["data-headlessui-state"]=g.join(" "))}if(a===S.Fragment&&Object.keys(Wa(u)).length>0){if(!S.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u).map(y=>` - ${y}`).join(`
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Lp={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=Aa(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(t){var r=Aa(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function ys(e){return!isNaN(parseInt(e))&&isFinite(e)}function Rp(e){return ys(e)&&e<=100&&e>=0}function Fp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Ta(e){return e%2===0}function Na(e){return ys(e)&&!Number.isInteger(e)}function Dp(){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 kt(e){return Math.abs(e)%1===.5}function Mp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),kp(i,t.headers),i.send()})}function kp(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 bs(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(zt(n[1])==="object"){var i=bs(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function jp(e){return Boolean(e)&&(zt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ss(){var e=function(n,i){var a=function(u){return Math.pow(10,Dp(u))},o=Math.max(a(n),a(i));return Math.round(n*o)*Math.round(i*o)/(o*o)},t={HALF_ODD:function(n){var i=Math.round(n);return kt(n)&&Ta(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return kt(n)?Ta(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return kt(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return kt(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return kt(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return Na(n)||Na(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var Vp=Ss();function Up(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Wt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Wt(this.getMatches().find(n))?0:this.getMatches()[Vp.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Wt(this.getMatches().find(function(n){return n===","}))}}}function Bp(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)i=i.replace("{{".concat(o,"}}"),a[o]);return i},r=function(i,a){return Mp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(jp(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return bs(o)[t(e.propertyPath,{from:i,to:a})]})}}}function Zt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Hp(e){Zt(Rp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Wp(e){Zt(Fp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function cn(e){Zt(Number.isInteger(e),"You must provide an integer.",TypeError)}var Z=Ss(),Gp=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,a=r.precision;cn(n),cn(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,f=e.globalFormatRoundingMode,c=Object.assign({},e.globalExchangeRatesApi),l=function(p){var y=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:y.amount,currency:y.currency,precision:y.precision}),{locale:y.locale})},d=function(p){Zt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f;cn(p);var v=this.getPrecision(),b=p>v,h=b?Z.multiply:Z.divide,E=b?[p,v]:[v,p],A=Math.pow(10,Z.subtract.apply(Z,E));return l.call(this,{amount:Z.round(h(this.getAmount(),A),y),precision:p})},add:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:Z.add(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},subtract:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return l.call(this,{amount:Z.subtract(y[0].getAmount(),y[1].getAmount()),precision:y[0].getPrecision()})},multiply:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Z.round(Z.multiply(this.getAmount(),p),y)})},divide:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:Z.round(Z.divide(this.getAmount(),p),y)})},percentage:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Hp(p),this.multiply(Z.divide(p,100),y)},allocate:function(p){var y=this;Wp(p);for(var v=p.reduce(function(A,w){return Z.add(A,w)}),b=this.getAmount(),h=p.map(function(A){var w=Math.floor(Z.divide(Z.multiply(y.getAmount(),A),v));return b=Z.subtract(b,w),l.call(y,{amount:w})}),E=0;b>0;)p[E]>0&&(h[E]=h[E].add(l.call(this,{amount:1})),b=Z.subtract(b,1)),E+=1;return h},convert:function(p){var y=this,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=v.endpoint,h=b===void 0?c.endpoint:b,E=v.propertyPath,A=E===void 0?c.propertyPath||"rates.{{to}}":E,w=v.headers,P=w===void 0?c.headers:w,_=v.roundingMode,L=_===void 0?u:_,F=Object.assign({},{endpoint:h,propertyPath:A,headers:P,roundingMode:L});return Bp(F).getExchangeRate(this.getCurrency(),p).then(function(k){return Zt(!Wt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(y,{amount:Z.round(Z.multiply(y.getAmount(),parseFloat(k)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<y[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()<=y[1].getAmount()},greaterThan:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>y[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var y=e.normalizePrecision([this,p]);return y[0].getAmount()>=y[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,a))!==0},hasCents:function(){return Z.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var y=e.normalizePrecision([this,p]);return y[0].getAmount()===y[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Up(p);return this.toRoundedUnit(v.getMinimumFractionDigits(),y).toLocaleString(this.getLocale(),{currencyDisplay:v.getCurrencyDisplay(),useGrouping:v.getUseGrouping(),minimumFractionDigits:v.getMinimumFractionDigits(),style:v.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Z.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,v=Math.pow(10,p);return Z.divide(Z.round(Z.multiply(this.toUnit(),v),y),v)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},Kp=Object.assign(Gp,Ap,_p,Lp);const pr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":Kp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},Yp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=pr(`${r*n}`);const o=`${pr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${pr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function jr(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=t>s?t:a,f=pr(`${u}`);return!t&&i===!1?null:r?B("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${f}`]}):t<s?B("span",{className:"",children:["\xA0",`od ${f}`]}):C("span",{className:"",children:f})}function zp(e,t){const{selCtx:r,id:n}=e,i=ie(s=>s.expanded),a=S.useMemo(()=>Qp(r,n,t,i),[r,n,t,i]),o=ie(s=>s.toggleExpanded);return{isExpanded:a,toggleExpanded:o}}const Qp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var qp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Jp={"&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;":"/"},Zp=function(t){return Jp[t]},Xp=function(t){return t.replace(qp,Zp)};function $a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ia(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$a(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$a(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var _n={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Xp},Os,eh=S.createContext();function th(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n=Ia(Ia({},_n),e)}function rh(){return _n}var nh=function(){function e(){$e(this,e),this.usedNamespaces={}}return Ie(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function ih(e){Os=e}function ah(){return Os}var oh={type:"3rdParty",init:function(t){th(t.options.react),ih(t)}};function sh(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var La={};function Tn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&La[t[0]]||(typeof t[0]=="string"&&(La[t[0]]=new Date),sh.apply(void 0,t))}function Ra(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function uh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var o=function(u,f){var c=t.services.backendConnector.state["".concat(u,"|").concat(f)];return c===-1||c===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}function lh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Tn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(a,o){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}):uh(e,t,r)}function ch(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,f=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(c){f=!0,i=c}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(f)throw i}}return s}}function fh(e,t){return Qa(e)||ch(e,t)||qa(e,t)||Ja()}function Fa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fa(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var dh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function ti(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(eh)||{},i=n.i18n,a=n.defaultNS,o=r||i||ah();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new nh),!o){Tn("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}o.options.react&&o.options.react.wait!==void 0&&Tn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=fn(fn(fn({},rh()),o.options.react),t),c=f.useSuspense,l=f.keyPrefix,d=e||a||o.options&&o.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(d);var g=(o.isInitialized||o.initializedStoreOnce)&&d.every(function(L){return lh(L,o,f)});function p(){return o.getFixedT(null,f.nsMode==="fallback"?d:d[0],l)}var y=S.useState(p),v=fh(y,2),b=v[0],h=v[1],E=d.join(),A=dh(E),w=S.useRef(!0);S.useEffect(function(){var L=f.bindI18n,F=f.bindI18nStore;w.current=!0,!g&&!c&&Ra(o,d,function(){w.current&&h(p)}),g&&A&&A!==E&&w.current&&h(p);function k(){w.current&&h(p)}return L&&o&&o.on(L,k),F&&o&&o.store.on(F,k),function(){w.current=!1,L&&o&&L.split(" ").forEach(function(W){return o.off(W,k)}),F&&o&&F.split(" ").forEach(function(W){return o.store.off(W,k)})}},[o,E]);var P=S.useRef(!0);S.useEffect(function(){w.current&&!P.current&&h(p),P.current=!1},[o,l]);var _=[b,o,g];if(_.t=b,_.i18n=o,_.ready=g,g||!g&&!c)return _;throw new Promise(function(L){Ra(o,d,function(){L()})})}var ws=[],gh=ws.forEach,ph=ws.slice;function hh(e){return gh.call(ph.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Da=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,mh=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o="".concat(t,"=").concat(a);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Da.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Da.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},Ma={create:function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=mh(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var a=n[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},vh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=Ma.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&Ma.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},yh={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),a=i.split("&"),o=0;o<a.length;o++){var s=a[o].indexOf("=");if(s>0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(r=a[o].substring(s+1))}}}return r}},jt=null,ka=function(){if(jt!==null)return jt;try{jt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{jt=!1}return jt},bh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&ka()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&ka()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Vt=null,ja=function(){if(Vt!==null)return Vt;try{Vt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Vt=!1}return Vt},Sh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&ja()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&ja()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Oh={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},wh={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},Eh={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},xh={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function Ph(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Es=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$e(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Ie(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=hh(n,this.options||{},Ph()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(vh),this.addDetector(yh),this.addDetector(bh),this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh),this.addDetector(xh)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(r,i.options)}))}}]),e}();Es.type="languageDetector";const Ch={"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"},Ah={"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"},_h={"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"},Th={"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"};ve.use(Es).use(oh).init({resources:{pl:{translation:Ch},en:{translation:Ah},de:{translation:_h},cs:{translation:Th}}});const Nh=(e,t,r,n)=>{let i="",a="";const o=Number(e),s=Number(t);return o>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>r&&(a=Te.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Te.TOO_MUCH)),o>=0||s>=0&&r<o?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",a=Te.IGNORE),r>=o&&r<=s&&(a=Te.OK),{message:i,validationStatus:a}},$h=(e,t,r,n)=>{let i="",a="";const o=parseInt(e||"-1"),s=parseInt(t||"-1");return o>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>r&&(a=Te.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Te.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Te.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Te.OK),{message:i,validationStatus:a}},Ih=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:a,actualSelCnt:o,children:s}=e,{selCtx:u,details:f={},id:c,attrs:l={}}=t,{qtyMin:d,qtyMax:g,selMin:p,selMax:y}=l,{name:v,description:b}=f.literals||{},{t:h}=ti(),{isExpanded:E,toggleExpanded:A}=zp(t,r),{validationStatus:w,message:P}=$h(p,y,o,h),{validationStatus:_,message:L}=Nh(d,g,a,h),F=w===Te.OK,k=_===Te.OK,W=!F&&i&&!!P,D=!k&&i&&!!L;return B("div",{className:"pt-1 mb-3",id:ls(u),children:[B("div",{className:"flex text-xl font-semibold",children:[C("p",{className:"",children:v}),v&&v!==" "&&B(Ge,{children:[C("div",{className:"ml-auto",children:C(jr,{price:Gn(n,t)})}),C("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!E&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>A(u,c,r),children:C("polyline",{points:"18 15 12 9 6 15"})})]})]}),C("p",{className:`${b&&"mb-2"}`,children:b}),!1,C("div",{className:"flex",children:B("div",{children:[C(Ca,{isOk:F,isErr:W,info:P}),C(Ca,{isOk:k,isErr:D,info:L})]})}),C("div",{className:`${E?"block":"hidden"}`,children:s})]})},xs=T.default.createContext(null);function Vr(){const e=S.useContext(xs);if(!e)throw new Error("Missing ComponentsContext");return e}const Lh=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:a}=e,{isFilterValidated:o,selected:s,isOnSubmitted:u,selCnt:f,qtyCnt:c,currency:l}=ms(t,n,i,r),{MenuOptionsUI:d}=Vr();if(!o)return null;const g=C(ri,{productItems:t.items,parentProduct:t,rootProduct:a}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:c,actualSelCnt:f,currency:l};return d?C(d,{...p,children:g}):C(Ih,{...p,children:g})},Rh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:a="lg",children:o}=e,{details:{literals:s}={}}=t,{name:u="",description:f=""}=s||{},c=No(t),l=cs(t);return B("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[C("input",{type:"checkbox",className:`simple-checkbox checkbox-${a} mr-4`,id:r,disabled:n,value:"1",...i}),l&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:l})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:u}),C("p",{className:"text-sm text-gray-600",children:f})]})}),C("div",{className:"ml-auto",children:o}),C("label",{htmlFor:r,children:C(jr,{price:parseFloat(c),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Fh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:a,size:o="lg",children:s}=e,{details:{literals:u}={}}=t,{name:f="",description:c=""}=u||{},l=No(t),d=cs(t);return B("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[C("input",{type:"radio",className:`simple-radio radio-${o} mr-4`,id:r,...i,value:n,checked:a}),d&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:d})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:B("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:f}),C("p",{className:"text-sm text-gray-600",children:c})]})}),C("div",{className:"ml-auto",children:s}),C("label",{htmlFor:r,children:C(jr,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Ps(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return B("div",{className:`counter counter-${o} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[C("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),C("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),C("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,children:B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Dh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=Ye(),{id:s,selCtx:u,emit:f={},fltCtx:c}=e,l=n(`selected.${u}.${s}`);return S.useEffect(()=>{var y,v,b;if(!r||r>1)return;const d=`filterWithCnt.${c}`,g=`filterWithCnt.${c}.${u}`,p=`filter.${c}`;if(t&&l&&c)if(Me(f)){const h=a(g);(y=Object.keys(h||{}))==null||y.forEach(E=>{o(`${g}.${E}`);const A=Object.keys(a(d)||{});Me(A)?o(`${p}.${E}`):A.forEach(w=>{w!==u&&!a(`${d}.${w}.${E}`)&&o(`${p}.${E}`)})});return}else{const h=a(g),E=a(d);(v=Object.keys(f))==null||v.forEach(A=>{var w;(w=Object.keys(h||{}))==null||w.forEach(P=>{f[P]||(o(`${p}.${P}`),o(`${g}.${P}`))}),Object.keys(E||{}).forEach(P=>{P!==u&&A in a(d==null?void 0:d[P])&&o(`${d}.${P}.${A}`)}),i(`${p}.${A}`,f[A]),i(`${g}.${A}`,{cnt:1,value:f[A]})});return}l&&c&&!Me(f)&&((b=Object.keys(f))==null||b.forEach(h=>{i(`filter.${c}.${h}`,f[h]);const E=a(`${g}.${h}.cnt`)||0;i(`${g}.${h}`,{cnt:E+1,value:f[h]})}))},[l]),{}}function Mh(){const e=ie(n=>n.getInvalidSelCtxArray),t=ie(n=>n.isInputEnabled),r=ie(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Va=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},Nn=(e,t,r)=>{const n=t(`selected.${e}`);r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},kh=(e,t,r,n,i,a)=>{var d,g;const{items:o,state:s,emit:u,fltCtx:f,selCtx:c}=r,{selected:l={}}=s||{};if(console.log("selected/unselected product",r,n),n){Va(l,e);const p=y=>{var v;!Array.isArray(y)||Me(s==null?void 0:s.selected)||(v=y==null?void 0:y.filter(b=>{var h,E;return!!((E=(h=s.selected)==null?void 0:h[`${b.selCtx}`])!=null&&E[`${b.id}`])}))==null||v.map(b=>{if(b.state&&"selected"in b.state){const{state:{selected:h}}=b;Va(h,e)}Array.isArray(b.items)&&p(b.items)})};p(o)}else{Object.keys(l).forEach(y=>{Nn(y,t,e)});const p=y=>{!Array.isArray(y)||y.map(v=>{const{selCtx:b}=v;t(`selected.${b}`)&&Nn(b,t,e),p(v.items)})};if(p(o),a&&a<2&&!Me(u)){(d=Object.keys(u))==null||d.forEach(h=>{const E=`filterWithCnt.${f}.${h}.${u[h]}`,A=t(E)||0;A<2?i(E):e(E,A-1)});const y=`filterWithCnt.${f}`,v=`filterWithCnt.${f}.${c}`,b=`filter.${f}`;(g=Object.keys(u))==null||g.forEach(h=>{var A,w,P;const E=t(`${v}.${h}`)||0;if(E)if(E>1)e(`${v}.${h}`,E-1);else{i(`${v}.${h}`);const _=t(y)||{},L=(A=Object.keys(_))==null?void 0:A.filter(F=>F!==c);if(!L)i(`${b}.${h}`);else{const F=L==null?void 0:L.find(k=>{var W;return!!((W=_==null?void 0:_[`${k}`])!=null&&W[`${h}`])});if(!F)i(`${b}.${h}`);else{const k=(P=(w=_==null?void 0:_[`${F}`])==null?void 0:w[`${h}`])==null?void 0:P.value;e(`${b}.${h}`,k)}}}})}}},Cs=(e,t)=>{var r;if(!e.items||Me(e.items))return null;for(let n=0;n<((r=e.items)==null?void 0:r.length);n++){const i=e.items[n];if(i.selCtx===t&&i.kind===Je.PRODUCT)return i;if(i.kind===Je.OPTIONS&&i.items&&i.items.length>0){const a=Cs(i,t);if(a)return a}}return null};function jh(e,t,r){var pe;const{id:n,selCtx:i,emit:a={},fltCtx:o}=e,{allowMultiple:s,selMin:u,selMax:f}=t,{isInputEnabled:c,isInputCounterIncrementEnabled:l}=Mh(),d=ie(ee=>ee.refreshForm),g=ie(ee=>ee.currency),{watch:p,getValues:y,setValue:v,register:b,unregister:h}=Ye(),E=p(`selected.${i}.${n}`),{selected:A={}}=y(),w=Number(E||0),P=u==="1"&&f==="1";Dh(e,P,r);const _=!P,L=np(s),F=w>(P?1:0),k=l(e,A)&&(c(e)||w),W=Number(((pe=A==null?void 0:A[i])==null?void 0:pe[n])||0)>0,D=c(e)||w,j=`${P?"radio":"selected"}.${i}.${n}`,V=b(j,{onChange:ee=>{G(ee)}}),H=()=>{v(`selected.${i}.${n}`,`${w+1}`)},Q=()=>{var ce,oe;const ee=w-1;if(v(`selected.${i}.${n}`,`${ee}`),_&&ee===0){v(`selected.${i}.${n}`,!1),(ce=Object.keys(a))==null||ce.forEach(te=>{const K=`filterWithCnt.${o}.${te}.${a[te]}`,he=y(K)||0;he<2?h(K):v(K,he-1)});const fe=te=>{!Array.isArray(te)||te.map(K=>{const{selCtx:he}=K;y(`selected.${he}`)&&Nn(he,y,v),fe(K.items)})};if(fe(e.items),r&&r<2&&!Me(a)){const te=`filterWithCnt.${o}`,K=`filterWithCnt.${o}.${i}`,he=`filter.${o}`;(oe=Object.keys(a))==null||oe.forEach(ae=>{var Ae,Re,je;const Ee=y(`${K}.${ae}`)||0;if(Ee)if(Ee>1)v(`${K}.${ae}`,Ee-1);else{h(`${K}.${ae}`);const U=y(te)||{},se=(Ae=Object.keys(U))==null?void 0:Ae.filter(ne=>ne!==i);if(!se)h(`${he}.${ae}`);else{const ne=se==null?void 0:se.find(Se=>{var Gr;return!!((Gr=U==null?void 0:U[`${Se}`])!=null&&Gr[`${ae}`])});if(!ne)h(`${he}.${ae}`);else{const Se=(je=(Re=U==null?void 0:U[`${ne}`])==null?void 0:Re[`${ae}`])==null?void 0:je.value;v(`${he}.${ae}`,Se)}}}})}}},G=ee=>{const{target:{checked:ce,name:oe,defaultValue:fe}}=ee;for(const te of Object.keys(A||{}))P&&te!==(e==null?void 0:e.selCtx)&&(te==null?void 0:te.includes(e.selCtx))&&Cs(e,te)&&v(`selected.${te}`,!1);if(kh(v,y,e,ce,h,r),P){console.log("handleOnInputChange radio",oe,fe);const te="selected."+oe.replace("radio.","").split(".")[0];v(te,{[fe]:"1"}),d()}};return{registerProps:V,isRadio:P,isCheckbox:_,isCounter:L,isDecrementEnabled:F,isIncrementEnabled:k,isChecked:W,isCheckboxEnabled:D,handleCounterIncrementQty:H,handleCounterDecrementQty:Q,counterValue:w,handleOnInputChange:G,inputId:`${i}.${n}`,radioInputValue:n,currency:g}}const Vh=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:a}=e,{registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:y,counterValue:v,handleCounterIncrementQty:b,handleCounterDecrementQty:h,currency:E}=jh(t,r,n),{MenuProductUI:A}=Vr(),w={product:t,nestedLvl:n,registerProps:o,inputId:s,radioInputValue:u,isRadio:f,isCheckbox:c,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:y,counterValue:v,handleCounterIncrementQty:b,handleCounterDecrementQty:h,currency:E,parentProduct:i},P=C(ri,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return A?C(A,{...w,children:P}):C(Uh,{...w,children:P})},Uh=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:a,isRadio:o,isCheckbox:s,isCounter:u,isDecrementEnabled:f,isIncrementEnabled:c,isChecked:l,isCheckboxEnabled:d,counterValue:g,handleCounterIncrementQty:p,handleCounterDecrementQty:y,children:v}=e,b=C(Ps,{value:g,add:p,subtract:y,disabledSubtract:!f,disabledAdd:!c}),h=()=>o?C(Fh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:C(Ge,{children:u&&b})}):s?C(Rh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:C(Ge,{children:u&&b})}):null,E=!Me(t.items)&&g,A=ci.useTransition(E,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return B("div",{children:[h(),E?A((w,P)=>P&&C(ci.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:w,children:v},r+1)):null]})};function Bh(){return{isMenuProductToShow:r=>r.kind===Je.PRODUCT&&Ea(r),isMenuOptionsToShow:r=>[Je.OPTIONS,Je.CONFIG].includes(r.kind)&&Ea(r)}}function ri(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:f}=Bh(),{MenuItemsUI:c}=Vr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>f(g)?C(Lh,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?C(Vh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):C(Ge,{}),rootProduct:i};return c?C(c,{...d}):C(Hh,{...d})}function Hh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==Je.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:f}=ti(),c=()=>{u(a)},l=()=>{u(o)};return C(Ge,{children:t.map((d,g)=>{if(g<s)return B("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ua(f("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ua(f("OS.ProductConfigurator.ShowMore"),c,!0)})})}const Ua=(e,t,r)=>C("div",{className:"flex justify-center w-full",children:B("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("polyline",{points:"7 7 12 12 17 7"})," ",C("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),As=()=>{const{watch:e}=Ye(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=ie(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),B("div",{className:"flex flex-col items-center py-4",children:[C("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(a=>C("div",{children:Object.values(t[a]).filter(o=>o).length>0&&B(Ge,{children:[B("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>C(T.default.Fragment,{children:t[a][o]&&B("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ba(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:f}=ti();return B("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&B("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[B("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:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),C("span",{className:"uppercase",children:`${f("OS.ProductConfigurator.Back")}`})]}),C("div",{className:"px-3",children:C(Ps,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),B("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[B("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:[C("circle",{cx:"9",cy:"21",r:"1"})," ",C("circle",{cx:"20",cy:"21",r:"1"}),C("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?C("span",{children:`${f("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):C("span",{className:"uppercase",children:`${f("OS.ProductConfigurator.Add")} ${t}`})]})]})}const lr=640,_s=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=lr),[u,f]=S.useState(window.innerWidth>lr&&!t);function c(){n(window.innerWidth),a(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)}),[]),S.useEffect(()=>{f(window.innerWidth>lr&&!t),s(window.innerWidth<=lr)},[r,e,t]),{isSm:u,isMobile:o,width:r,windowHeight:i}};function Ts(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ts(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ut(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ts(e))&&(n&&(n+=" "),n+=t);return n}var Wh=Object.defineProperty,Gh=(e,t,r)=>t in e?Wh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dn=(e,t,r)=>(Gh(e,typeof t!="symbol"?t+"":t,r),r);class Kh{constructor(){dn(this,"current",this.detect()),dn(this,"handoffState","pending"),dn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let Ze=new Kh,Ne=(e,t)=>{Ze.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Xe(e){let t=S.useRef(e);return Ne(()=>{t.current=e},[e]),t}let re=function(e){let t=Xe(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function Ur(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function wt(){let e=[],t={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),t.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Ur(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=wt();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let i of e.splice(n,1))i()}},dispose(){for(let r of e.splice(0))r()}};return t}function ni(){let[e]=S.useState(wt);return S.useEffect(()=>()=>e.dispose(),[e]),e}function Yh(){let e=typeof document=="undefined";return"useSyncExternalStore"in st?(t=>t.useSyncExternalStore)(st)(()=>()=>{},()=>!1,()=>!e):!1}function Lt(){let e=Yh(),[t,r]=st.useState(Ze.isHandoffComplete);return t&&Ze.isHandoffComplete===!1&&r(!1),st.useEffect(()=>{t!==!0&&r(!0)},[t]),st.useEffect(()=>Ze.handoff(),[]),e?!1:t}var Ha;let Rt=(Ha=T.default.useId)!=null?Ha:function(){let e=Lt(),[t,r]=T.default.useState(e?()=>Ze.nextId():null);return Ne(()=>{t===null&&r(Ze.nextId())},[t]),t!=null?""+t:void 0};function me(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,me),n}function Ns(e){return Ze.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let $n=["[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 gt=(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))(gt||{}),$s=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))($s||{}),zh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(zh||{});function Qh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($n)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Is=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Is||{});function qh(e,t=0){var r;return e===((r=Ns(e))==null?void 0:r.body)?!1:me(t,{[0](){return e.matches($n)},[1](){let n=e;for(;n!==null;){if(n.matches($n))return!0;n=n.parentElement}return!1}})}var Jh=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Jh||{});typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mt(e){e==null||e.focus({preventScroll:!0})}let Zh=["textarea","input"].join(",");function Xh(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Zh))!=null?r:!1}function em(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function hr(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?em(e):e:Qh(e);i.length>0&&o.length>1&&(o=o.filter(g=>!i.includes(g))),n=n!=null?n:a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},c=0,l=o.length,d;do{if(c>=l||c+l<=0)return 0;let g=u+c;if(t&16)g=(g+l)%l;else{if(g<0)return 3;if(g>=l)return 1}d=o[g],d==null||d.focus(f),c+=s}while(d!==a.activeElement);return t&6&&Xh(d)&&d.select(),2}function Ls(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function tm(){return/Android/gi.test(window.navigator.userAgent)}function rm(){return Ls()||tm()}function cr(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Rs(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function nm(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,s){if(!n.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let f=function c(l){return typeof l=="function"?c(l()):Array.isArray(l)||l instanceof Set?l:[l]}(e);for(let c of f){if(c===null)continue;let l=c instanceof HTMLElement?c:c.current;if(l!=null&&l.contains(u)||o.composed&&o.composedPath().includes(l))return}return!qh(u,Is.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);cr("pointerdown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),cr("mousedown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),cr("click",o=>{rm()||a.current&&(i(o,()=>a.current),a.current=null)},!0),cr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Rs("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function rr(...e){return S.useMemo(()=>Ns(...e),[...e])}let Fs=Symbol();function im(e,t=!0){return Object.assign(e,{[Fs]:t})}function ke(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=re(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Fs]))?void 0:r}function ii(e,t){let r=S.useRef([]),n=re(e);S.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Cr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Ar=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ar||{}),ot=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ot||{});function Le({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:am;let u=Ds(t,e);if(a)return fr(u,r,n,o,s);let f=i!=null?i:0;if(f&2){let{static:c=!1,...l}=u;if(c)return fr(l,r,n,o,s)}if(f&1){let{unmount:c=!0,...l}=u;return me(c?0:1,{[0](){return null},[1](){return fr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return fr(u,r,n,o,s)}function fr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=gn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},c=typeof o=="function"?o(t):o;"className"in u&&u.className&&typeof u.className=="function"&&(u.className=u.className(t));let l={};if(t){let d=!1,g=[];for(let[p,y]of Object.entries(t))typeof y=="boolean"&&(d=!0),y===!0&&g.push(p);d&&(l["data-headlessui-state"]=g.join(" "))}if(a===S.Fragment&&Object.keys(Wa(u)).length>0){if(!S.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u).map(y=>` - ${y}`).join(`
12
12
  `),"","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(y=>` - ${y}`).join(`
13
13
  `)].join(`
14
14
  `));let d=c.props,g=typeof(d==null?void 0:d.className)=="function"?(...y)=>Cr(d==null?void 0:d.className(...y),u.className):Cr(d==null?void 0:d.className,u.className),p=g?{className:g}:{};return S.cloneElement(c,Object.assign({},Ds(c.props,Wa(gn(u,["ref"]))),l,f,{ref:i(c.ref,f.ref)},p))}return S.createElement(a,Object.assign({},gn(u,["ref"]),a!==S.Fragment&&f,a!==S.Fragment&&l),c)}function am(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Ds(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...a){let o=r[n];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function Ce(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Wa(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function gn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let om="div";var _r=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(_r||{});function sm(e,t){var r;let{features:n=1,...i}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!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",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Le({ourProps:a,theirProps:i,slot:{},defaultTag:om,name:"Hidden"})}let In=Ce(sm),ai=S.createContext(null);ai.displayName="OpenClosedContext";var Pe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Pe||{});function oi(){return S.useContext(ai)}function um({value:e,children:t}){return T.default.createElement(ai.Provider,{value:e},t)}function lm(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",t),t())}let it=[];lm(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&it[0]!==t.target&&(it.unshift(t.target),it=it.filter(r=>r!=null&&r.isConnected),it.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function cm(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&fm(r)?!1:n}function fm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var Ms=(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))(Ms||{});function ks(e,t,r,n){let i=Xe(r);S.useEffect(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}function nr(){let e=S.useRef(!1);return Ne(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function js(e){let t=re(e),r=S.useRef(!1);S.useEffect(()=>(r.current=!1,()=>{r.current=!0,Ur(()=>{r.current&&t()})}),[t])}var Gt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Gt||{});function dm(){let e=S.useRef(0);return Rs("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Vs(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let gm="div";var Us=(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))(Us||{});function pm(e,t){let r=S.useRef(null),n=ke(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;Lt()||(o=1);let u=rr(r);vm({ownerDocument:u},Boolean(o&16));let f=ym({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));bm({ownerDocument:u,container:r,containers:a,previousActiveElement:f},Boolean(o&8));let c=dm(),l=re(y=>{let v=r.current;!v||(b=>b())(()=>{me(c.current,{[Gt.Forwards]:()=>{hr(v,gt.First,{skipElements:[y.relatedTarget]})},[Gt.Backwards]:()=>{hr(v,gt.Last,{skipElements:[y.relatedTarget]})}})})}),d=ni(),g=S.useRef(!1),p={ref:n,onKeyDown(y){y.key=="Tab"&&(g.current=!0,d.requestAnimationFrame(()=>{g.current=!1}))},onBlur(y){let v=Vs(a);r.current instanceof HTMLElement&&v.add(r.current);let b=y.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(Bs(v,b)||(g.current?hr(r.current,me(c.current,{[Gt.Forwards]:()=>gt.Next,[Gt.Backwards]:()=>gt.Previous})|gt.WrapAround,{relativeTo:y.target}):y.target instanceof HTMLElement&&mt(y.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(In,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:_r.Focusable}),Le({ourProps:p,theirProps:s,defaultTag:gm,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(In,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:_r.Focusable}))}let hm=Ce(pm),Bt=Object.assign(hm,{features:Us});function mm(e=!0){let t=S.useRef(it.slice());return ii(([r],[n])=>{n===!0&&r===!1&&Ur(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=it.slice())},[e,it,t]),re(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function vm({ownerDocument:e},t){let r=mm(t);ii(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&mt(r())},[t]),js(()=>{t&&mt(r())})}function ym({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),a=nr();return ii(()=>{if(!n)return;let o=t.current;o&&Ur(()=>{if(!a.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){i.current=s;return}}else if(o.contains(s)){i.current=s;return}r!=null&&r.current?mt(r.current):hr(o,gt.First)===$s.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function bm({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=nr();ks(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=Vs(r);t.current instanceof HTMLElement&&s.add(t.current);let u=n.current;if(!u)return;let f=o.target;f&&f instanceof HTMLElement?Bs(s,f)?(n.current=f,mt(f)):(o.preventDefault(),o.stopPropagation(),mt(u)):mt(n.current)},!0)}function Bs(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let Hs=S.createContext(!1);function Sm(){return S.useContext(Hs)}function Ln(e){return T.default.createElement(Hs.Provider,{value:e.force},e.children)}function Om(e){let t=Sm(),r=S.useContext(Ws),n=rr(e),[i,a]=S.useState(()=>{if(!t&&r!==null||Ze.isServer)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return S.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),S.useEffect(()=>{t||r!==null&&a(r.current)},[r,a,t]),i}let wm=S.Fragment;function Em(e,t){let r=e,n=S.useRef(null),i=ke(im(c=>{n.current=c}),t),a=rr(n),o=Om(n),[s]=S.useState(()=>{var c;return Ze.isServer?null:(c=a==null?void 0:a.createElement("div"))!=null?c:null}),u=S.useContext(Rn),f=Lt();return Ne(()=>{!o||!s||o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s))},[o,s]),Ne(()=>{if(s&&u)return u.register(s)},[u,s]),js(()=>{var c;!o||!s||(s instanceof Node&&o.contains(s)&&o.removeChild(s),o.childNodes.length<=0&&((c=o.parentElement)==null||c.removeChild(o)))}),f?!o||!s?null:eu.createPortal(Le({ourProps:{ref:i},theirProps:r,defaultTag:wm,name:"Portal"}),s):null}let xm=S.Fragment,Ws=S.createContext(null);function Pm(e,t){let{target:r,...n}=e,i={ref:ke(t)};return T.default.createElement(Ws.Provider,{value:r},Le({ourProps:i,theirProps:n,defaultTag:xm,name:"Popover.Group"}))}let Rn=S.createContext(null);function Cm(){let e=S.useContext(Rn),t=S.useRef([]),r=re(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=re(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),i=S.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,S.useMemo(()=>function({children:a}){return T.default.createElement(Rn.Provider,{value:i},a)},[i])]}let Am=Ce(Em),_m=Ce(Pm),Fn=Object.assign(Am,{Group:_m});function Tm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const Nm=typeof Object.is=="function"?Object.is:Tm,{useState:$m,useEffect:Im,useLayoutEffect:Lm,useDebugValue:Rm}=st;function Fm(e,t,r){const n=t(),[{inst:i},a]=$m({inst:{value:n,getSnapshot:t}});return Lm(()=>{i.value=n,i.getSnapshot=t,pn(i)&&a({inst:i})},[e,n,t]),Im(()=>(pn(i)&&a({inst:i}),e(()=>{pn(i)&&a({inst:i})})),[e]),Rm(n),n}function pn(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!Nm(r,n)}catch{return!0}}function Dm(e,t,r){return t()}const Mm=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",km=!Mm,jm=km?Dm:Fm,Vm="useSyncExternalStore"in st?(e=>e.useSyncExternalStore)(st):jm;function Um(e){return Vm(e.subscribe,e.getSnapshot,e.getSnapshot)}function Bm(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(i){return n.add(i),()=>n.delete(i)},dispatch(i,...a){let o=t[i].call(r,...a);o&&(r=o,n.forEach(s=>s()))}}}function Hm(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,i=n.clientWidth-n.offsetWidth,a=e-i;r.style(n,"paddingRight",`${a}px`)}}}function Wm(){return Ls()?{before({doc:e,d:t,meta:r}){function n(i){return r.containers.flatMap(a=>a()).some(a=>a.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=wt();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let a=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let u=s.target.closest("a");if(!u)return;let{hash:f}=new URL(u.href),c=e.querySelector(f);c&&!n(c)&&(o=c)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&n(u.parentElement);)u=u.parentElement;t.style(u,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&u.dataset.headlessuiPortal!==""&&!(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth);)u=u.parentElement;u.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()},{passive:!1}),t.add(()=>{var s;let u=(s=window.scrollY)!=null?s:window.pageYOffset;a!==u&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function Gm(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Km(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let ht=Bm(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:wt(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:Km(r)},i=[Wm(),Hm(),Gm()];i.forEach(({before:a})=>a==null?void 0:a(n)),i.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ht.subscribe(()=>{let e=ht.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",i=r.count!==0;(i&&!n||!i&&n)&&ht.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&ht.dispatch("TEARDOWN",r)}});function Ym(e,t,r){let n=Um(ht),i=e?n.get(e):void 0,a=i?i.count>0:!1;return Ne(()=>{if(!(!e||!t))return ht.dispatch("PUSH",e,r),()=>ht.dispatch("POP",e,r)},[t,e]),a}let hn=new Map,Ht=new Map;function Ga(e,t=!0){Ne(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function i(){var o;if(!n)return;let s=(o=Ht.get(n))!=null?o:1;if(s===1?Ht.delete(n):Ht.set(n,s-1),s!==1)return;let u=hn.get(n);u&&(u["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",u["aria-hidden"]),n.inert=u.inert,hn.delete(n))}let a=(r=Ht.get(n))!=null?r:0;return Ht.set(n,a+1),a!==0||(hn.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),i},[e,t])}function zm({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let i=S.useRef((n=r==null?void 0:r.current)!=null?n:null),a=rr(i),o=re(()=>{var s,u,f;let c=[];for(let l of e)l!==null&&(l instanceof HTMLElement?c.push(l):"current"in l&&l.current instanceof HTMLElement&&c.push(l.current));if(t!=null&&t.current)for(let l of t.current)c.push(l);for(let l of(s=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(i.current)||l.contains((f=(u=i.current)==null?void 0:u.getRootNode())==null?void 0:f.host)||c.some(d=>l.contains(d))||c.push(l));return c});return{resolveContainers:o,contains:re(s=>o().some(u=>u.contains(s))),mainTreeNodeRef:i,MainTreeNode:S.useMemo(()=>function(){return r!=null?null:T.default.createElement(In,{features:_r.Hidden,ref:i})},[i,r])}}let si=S.createContext(()=>{});si.displayName="StackContext";var Dn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Dn||{});function Qm(){return S.useContext(si)}function qm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=Qm(),o=re((...s)=>{t==null||t(...s),a(...s)});return Ne(()=>{let s=i===void 0||i===!0;return s&&o(0,r,n),()=>{s&&o(1,r,n)}},[o,r,n,i]),T.default.createElement(si.Provider,{value:o},e)}let Gs=S.createContext(null);function Ks(){let e=S.useContext(Gs);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,Ks),t}return e}function Jm(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=re(a=>(t(o=>[...o,a]),()=>t(o=>{let s=o.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s}))),i=S.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return T.default.createElement(Gs.Provider,{value:i},r.children)},[t])]}let Zm="p";function Xm(e,t){let r=Rt(),{id:n=`headlessui-description-${r}`,...i}=e,a=Ks(),o=ke(t);Ne(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return Le({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:Zm,name:a.name||"Description"})}let ev=Ce(Xm),tv=Object.assign(ev,{});var rv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(rv||{}),nv=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(nv||{});let iv={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Tr=S.createContext(null);Tr.displayName="DialogContext";function ir(e){let t=S.useContext(Tr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ir),r}return t}function av(e,t,r=()=>[document.body]){Ym(e,t,n=>{var i;return{containers:[...(i=n.containers)!=null?i:[],r]}})}function ov(e,t){return me(t.type,iv,e,t)}let sv="div",uv=Ar.RenderStrategy|Ar.Static;function lv(e,t){let r=Rt(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:a,initialFocus:o,role:s="dialog",__demoMode:u=!1,...f}=e,[c,l]=S.useState(0),d=S.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(d.current||(d.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=oi();i===void 0&&g!==null&&(i=(g&Pe.Open)===Pe.Open);let p=S.useRef(null),y=ke(p,t),v=rr(p),b=e.hasOwnProperty("open")||g!==null,h=e.hasOwnProperty("onClose");if(!b&&!h)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!b)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!h)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof a!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let E=i?0:1,[A,w]=S.useReducer(ov,{titleId:null,descriptionId:null,panelRef:S.createRef()}),P=re(()=>a(!1)),_=re(U=>w({type:0,id:U})),L=Lt()?u?!1:E===0:!1,F=c>1,k=S.useContext(Tr)!==null,[W,D]=Cm(),j={get current(){var U;return(U=A.panelRef.current)!=null?U:p.current}},{resolveContainers:V,mainTreeNodeRef:H,MainTreeNode:Q}=zm({portals:W,defaultContainers:[j]}),G=F?"parent":"leaf",pe=g!==null?(g&Pe.Closing)===Pe.Closing:!1,ee=(()=>k||pe?!1:L)(),ce=S.useCallback(()=>{var U,se;return(se=Array.from((U=v==null?void 0:v.querySelectorAll("body > *"))!=null?U:[]).find(ne=>ne.id==="headlessui-portal-root"?!1:ne.contains(H.current)&&ne instanceof HTMLElement))!=null?se:null},[H]);Ga(ce,ee);let oe=(()=>F?!0:L)(),fe=S.useCallback(()=>{var U,se;return(se=Array.from((U=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?U:[]).find(ne=>ne.contains(H.current)&&ne instanceof HTMLElement))!=null?se:null},[H]);Ga(fe,oe);let te=(()=>!(!L||F))();nm(V,U=>{U.preventDefault(),P()},te);let K=(()=>!(F||E!==0))();ks(v==null?void 0:v.defaultView,"keydown",U=>{K&&(U.defaultPrevented||U.key===Ms.Escape&&(U.preventDefault(),U.stopPropagation(),P()))});let he=(()=>!(pe||E!==0||k))();av(v,he,V),S.useEffect(()=>{if(E!==0||!p.current)return;let U=new ResizeObserver(se=>{for(let ne of se){let Se=ne.target.getBoundingClientRect();Se.x===0&&Se.y===0&&Se.width===0&&Se.height===0&&P()}});return U.observe(p.current),()=>U.disconnect()},[E,p,P]);let[ae,Ee]=Jm(),Ae=S.useMemo(()=>[{dialogState:E,close:P,setTitleId:_},A],[E,A,P,_]),Re=S.useMemo(()=>({open:E===0}),[E]),je={ref:y,id:n,role:s,"aria-modal":E===0?!0:void 0,"aria-labelledby":A.titleId,"aria-describedby":ae};return T.default.createElement(qm,{type:"Dialog",enabled:E===0,element:p,onUpdate:re((U,se)=>{se==="Dialog"&&me(U,{[Dn.Add]:()=>l(ne=>ne+1),[Dn.Remove]:()=>l(ne=>ne-1)})})},T.default.createElement(Ln,{force:!0},T.default.createElement(Fn,null,T.default.createElement(Tr.Provider,{value:Ae},T.default.createElement(Fn.Group,{target:p},T.default.createElement(Ln,{force:!1},T.default.createElement(Ee,{slot:Re,name:"Dialog.Description"},T.default.createElement(Bt,{initialFocus:o,containers:V,features:L?me(G,{parent:Bt.features.RestoreFocus,leaf:Bt.features.All&~Bt.features.FocusLock}):Bt.features.None},T.default.createElement(D,null,Le({ourProps:je,theirProps:f,slot:Re,defaultTag:sv,features:uv,visible:E===0,name:"Dialog"}))))))))),T.default.createElement(Q,null))}let cv="div";function fv(e,t){let r=Rt(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=ir("Dialog.Overlay"),s=ke(t),u=re(c=>{if(c.target===c.currentTarget){if(cm(c.currentTarget))return c.preventDefault();c.preventDefault(),c.stopPropagation(),o()}}),f=S.useMemo(()=>({open:a===0}),[a]);return Le({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:f,defaultTag:cv,name:"Dialog.Overlay"})}let dv="div";function gv(e,t){let r=Rt(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Backdrop"),s=ke(t);S.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let u=S.useMemo(()=>({open:a===0}),[a]);return T.default.createElement(Ln,{force:!0},T.default.createElement(Fn,null,Le({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:dv,name:"Dialog.Backdrop"})))}let pv="div";function hv(e,t){let r=Rt(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Panel"),s=ke(t,o.panelRef),u=S.useMemo(()=>({open:a===0}),[a]),f=re(c=>{c.stopPropagation()});return Le({ourProps:{ref:s,id:n,onClick:f},theirProps:i,slot:u,defaultTag:pv,name:"Dialog.Panel"})}let mv="h2";function vv(e,t){let r=Rt(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=ir("Dialog.Title"),s=ke(t);S.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=S.useMemo(()=>({open:a===0}),[a]);return Le({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:mv,name:"Dialog.Title"})}let yv=Ce(lv),bv=Ce(gv),Sv=Ce(hv),Ov=Ce(fv),wv=Ce(vv),Ka=Object.assign(yv,{Backdrop:bv,Panel:Sv,Overlay:Ov,Title:wv,Description:tv});function Ev(e=0){let[t,r]=S.useState(e),n=nr(),i=S.useCallback(u=>{n.current&&r(f=>f|u)},[t,n]),a=S.useCallback(u=>Boolean(t&u),[t]),o=S.useCallback(u=>{n.current&&r(f=>f&~u)},[r,n]),s=S.useCallback(u=>{n.current&&r(f=>f^u)},[r]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:s}}function xv(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function mn(e,...t){e&&t.length>0&&e.classList.add(...t)}function vn(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Pv(e,t){let r=wt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(u=>{let[f=0]=u.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,l)=>l-c);return f}),s=a+o;if(s!==0){r.group(f=>{f.setTimeout(()=>{t(),f.dispose()},s),f.addEventListener(e,"transitionrun",c=>{c.target===c.currentTarget&&f.dispose()})});let u=r.addEventListener(e,"transitionend",f=>{f.target===f.currentTarget&&(t(),u())})}else t();return r.add(()=>t()),r.dispose}function Cv(e,t,r,n){let i=r?"enter":"leave",a=wt(),o=n!==void 0?xv(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=me(i,{enter:()=>t.enter,leave:()=>t.leave}),u=me(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),f=me(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return vn(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),mn(e,...t.base,...s,...f),a.nextFrame(()=>{vn(e,...t.base,...s,...f),mn(e,...t.base,...s,...u),Pv(e,()=>(vn(e,...t.base,...s),mn(e,...t.base,...t.entered),o()))}),a.dispose}function Av({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let o=nr(),s=ni(),u=Xe(r);Ne(()=>{e&&(u.current="enter")},[e]),Ne(()=>{let f=wt();s.add(f.dispose);let c=t.current;if(c&&u.current!=="idle"&&o.current)return f.dispose(),i.current(u.current),f.add(Cv(c,n.current,u.current==="enter",()=>{f.dispose(),a.current(u.current)})),f.dispose},[r])}function nt(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Br=S.createContext(null);Br.displayName="TransitionContext";var _v=(e=>(e.Visible="visible",e.Hidden="hidden",e))(_v||{});function Tv(){let e=S.useContext(Br);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Nv(){let e=S.useContext(Hr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Hr=S.createContext(null);Hr.displayName="NestingContext";function Wr(e){return"children"in e?Wr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Ys(e,t){let r=Xe(e),n=S.useRef([]),i=nr(),a=ni(),o=re((g,p=ot.Hidden)=>{let y=n.current.findIndex(({el:v})=>v===g);y!==-1&&(me(p,{[ot.Unmount](){n.current.splice(y,1)},[ot.Hidden](){n.current[y].state="hidden"}}),a.microTask(()=>{var v;!Wr(n)&&i.current&&((v=r.current)==null||v.call(r))}))}),s=re(g=>{let p=n.current.find(({el:y})=>y===g);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:g,state:"visible"}),()=>o(g,ot.Unmount)}),u=S.useRef([]),f=S.useRef(Promise.resolve()),c=S.useRef({enter:[],leave:[],idle:[]}),l=re((g,p,y)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([v])=>v!==g)),t==null||t.chains.current[p].push([g,new Promise(v=>{u.current.push(v)})]),t==null||t.chains.current[p].push([g,new Promise(v=>{Promise.all(c.current[p].map(([b,h])=>h)).then(()=>v())})]),p==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(p)):y(p)}),d=re((g,p,y)=>{Promise.all(c.current[p].splice(0).map(([v,b])=>b)).then(()=>{var v;(v=u.current.shift())==null||v()}).then(()=>y(p))});return S.useMemo(()=>({children:n,register:s,unregister:o,onStart:l,onStop:d,wait:f,chains:c}),[s,o,n,l,d,c,f])}function $v(){}let Iv=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Ya(e){var t;let r={};for(let n of Iv)r[n]=(t=e[n])!=null?t:$v;return r}function Lv(e){let t=S.useRef(Ya(e));return S.useEffect(()=>{t.current=Ya(e)},[e]),t}let Rv="div",zs=Ar.RenderStrategy;function Fv(e,t){var r,n;let{beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:u,enterFrom:f,enterTo:c,entered:l,leave:d,leaveFrom:g,leaveTo:p,...y}=e,v=S.useRef(null),b=ke(v,t),h=(r=y.unmount)==null||r?ot.Unmount:ot.Hidden,{show:E,appear:A,initial:w}=Tv(),[P,_]=S.useState(E?"visible":"hidden"),L=Nv(),{register:F,unregister:k}=L;S.useEffect(()=>F(v),[F,v]),S.useEffect(()=>{if(h===ot.Hidden&&v.current){if(E&&P!=="visible"){_("visible");return}return me(P,{hidden:()=>k(v),visible:()=>F(v)})}},[P,v,F,k,E,h]);let W=Xe({base:nt(y.className),enter:nt(u),enterFrom:nt(f),enterTo:nt(c),entered:nt(l),leave:nt(d),leaveFrom:nt(g),leaveTo:nt(p)}),D=Lv({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),j=Lt();S.useEffect(()=>{if(j&&P==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,P,j]);let V=w&&!A,H=A&&E&&w,Q=(()=>!j||V?"idle":E?"enter":"leave")(),G=Ev(0),pe=re(K=>me(K,{enter:()=>{G.addFlag(Pe.Opening),D.current.beforeEnter()},leave:()=>{G.addFlag(Pe.Closing),D.current.beforeLeave()},idle:()=>{}})),ee=re(K=>me(K,{enter:()=>{G.removeFlag(Pe.Opening),D.current.afterEnter()},leave:()=>{G.removeFlag(Pe.Closing),D.current.afterLeave()},idle:()=>{}})),ce=Ys(()=>{_("hidden"),k(v)},L),oe=S.useRef(!1);Av({immediate:H,container:v,classes:W,direction:Q,onStart:Xe(K=>{oe.current=!0,ce.onStart(v,K,pe)}),onStop:Xe(K=>{oe.current=!1,ce.onStop(v,K,ee),K==="leave"&&!Wr(ce)&&(_("hidden"),k(v))})});let fe=y,te={ref:b};return H?fe={...fe,className:Cr(y.className,...W.current.enter,...W.current.enterFrom)}:oe.current&&(fe.className=Cr(y.className,(n=v.current)==null?void 0:n.className),fe.className===""&&delete fe.className),T.default.createElement(Hr.Provider,{value:ce},T.default.createElement(um,{value:me(P,{visible:Pe.Open,hidden:Pe.Closed})|G.flags},Le({ourProps:te,theirProps:fe,defaultTag:Rv,features:zs,visible:P==="visible",name:"Transition.Child"})))}function Dv(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,o=S.useRef(null),s=ke(o,t);Lt();let u=oi();if(r===void 0&&u!==null&&(r=(u&Pe.Open)===Pe.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[f,c]=S.useState(r?"visible":"hidden"),l=Ys(()=>{c("hidden")}),[d,g]=S.useState(!0),p=S.useRef([r]);Ne(()=>{d!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),g(!1))},[p,r]);let y=S.useMemo(()=>({show:r,appear:n,initial:d}),[r,n,d]);S.useEffect(()=>{if(r)c("visible");else if(!Wr(l))c("hidden");else{let E=o.current;if(!E)return;let A=E.getBoundingClientRect();A.x===0&&A.y===0&&A.width===0&&A.height===0&&c("hidden")}},[r,l]);let v={unmount:i},b=re(()=>{var E;d&&g(!1),(E=e.beforeEnter)==null||E.call(e)}),h=re(()=>{var E;d&&g(!1),(E=e.beforeLeave)==null||E.call(e)});return T.default.createElement(Hr.Provider,{value:l},T.default.createElement(Br.Provider,{value:y},Le({ourProps:{...v,as:S.Fragment,children:T.default.createElement(Qs,{ref:s,...v,...a,beforeEnter:b,beforeLeave:h})},theirProps:{},defaultTag:S.Fragment,features:zs,visible:f==="visible",name:"Transition"})))}function Mv(e,t){let r=S.useContext(Br)!==null,n=oi()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(Mn,{ref:t,...e}):T.default.createElement(Qs,{ref:t,...e}))}let Mn=Ce(Dv),Qs=Ce(Fv),kv=Ce(Mv),yn=Object.assign(Mn,{Child:kv,Root:Mn});function jv(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=_s({isModal:!0});return C(Ge,{children:C(yn,{appear:!0,show:r,as:S.Fragment,children:C(Ka,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:B("div",{className:"min-h-screen text-center sm:px-4",children:[C(yn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:C(Ka.Overlay,{className:"fixed inset-0"})}),C("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),C(yn.Child,{as:S.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:B("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:[C("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:C("div",{className:"",children:B("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",C("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),C("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function Vv(e){var V,H,Q,G;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:a,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:f,children:c}=e,{minPrice:l="0"}=t,[d,g]=S.useState("auto"),[p,y]=S.useState(0);S.useEffect(()=>{y(1);const pe=setTimeout(()=>{w||y(2)},250);return()=>{clearTimeout(pe)}},[]);const{displayPriceFrom:v,formattedEndPrice:b}=Yp(a,l,o),h=S.useRef(),E=S.useRef(),{isSm:A,isMobile:w,windowHeight:P}=_s({isModal:!0}),_=B(Ge,{children:[B("div",{className:Ut("px-4 w-full",A&&"sm:sticky sm:top-0 sm:w-2/5"),ref:h,children:[t.details.media&&t.details.media[0].url&&C("img",{className:Ut("mx-auto mt-2 mb-6 max-h-[250px]",A&&"max-h-[450px]"),alt:t.details.literals.name,src:(V=t.details)==null?void 0:V.media[0].url}),C("div",{className:Ut(!i&&"hidden"),children:C(As,{})})]}),B("div",{className:Ut("w-full",A&&"sm:w-3/5"),ref:E,children:[B("div",{className:"items-center w-full p-4",children:[B("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[B("span",{className:"",children:[t.details.literals.name," "]}),C(jr,{price:e.countedProductPrice,minPrice:l})]}),C("span",{className:"text-gray-600",children:(H=t.details.literals)==null?void 0:H.description})]}),B("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[c,C("div",{className:"sm:h-[64px]"})]}),A&&C("div",{className:"-mt-5 mb-2 bg-gray-100",children:C(Ba,{finalPrice:b,isBackIcon:!1,handleGoBack:n,displayPriceFrom:v})})]})]}),L=(Q=h==null?void 0:h.current)==null?void 0:Q.clientHeight,F=(G=E==null?void 0:E.current)==null?void 0:G.clientHeight,k=L+F;k>window.innerHeight*.8||isNaN(k)?d!=="80vh"&&g("80vh"):d!=="auto"&&g("auto");const W=`${P-64-56}px`,D=!A,j={"--mobile-submit-row-top":`${P-64-80}px`};return C(jv,{isOpen:Boolean(r),handleClose:n,children:B("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[C("div",{className:Ut("flex relative flex-col items-start w-full form-body stretch",!D&&"sm:flex-row-reverse sm:pb-0",!w&&"mobile-scrollbar"),style:{height:`${w?W:d}`,minHeight:"400px",overflowY:"scroll"},children:_}),D&&C("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${w?"submit-row-mobile":"submit-row"}`,style:j,children:C(Ba,{handleGoBack:n,finalPrice:b,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:f})})]})})}const Uv=e=>{const{product:t}=e,{MenuProductRootUI:r}=Vr(),n=Me(t.items)?C(Ge,{}):C(ri,{productItems:t.items,parentProduct:t,rootProduct:t});return r?C(r,{...e,children:n}):C(Vv,{...e,children:n})};const qs=T.default.createContext(null);function Bv({rootProduct:e,children:t}){return C(qs.Provider,{value:{rootProduct:e},children:t})}function Hv(){const e=S.useContext(qs);if(!e)throw new Error("Missing ComponentsContext");return e}function Wv(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:a,handleClose:o,currency:s,showDebugState:u=!1}=e,{price:f}=t,{encodedProduct:c,initSelected:l,initFilter:d,productQuantity:g,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:y,getValidationMap:v,increaseProductQuantity:b,decreaseProductQuantity:h,setCurrency:E}=vp(t),[A,w]=S.useState(v());S.useEffect(()=>{ve.changeLanguage(r)},[r]),S.useEffect(()=>{E(s)},[s]),S.useEffect(()=>{const W=v();Qg(W,A)||w(W)});const P=Eo({defaultValues:{selected:l,filter:d}}),{getValues:_}=P,L=Number((parseFloat(f||"0")+Gn(_("selected"),c)).toFixed(2)),F=()=>{var D;console.log("onSubmit"),p();const W=y();if(W.length)ip(ls(W[0])),console.log({invalidContextNames:W});else{console.log("selected",_("selected"));const j=rp(us(_("selected"))),V=_("filter");(D=Object.keys(j||{}))==null||D.forEach(H=>{const Q=fs(H,t);Q&&(ei(Q,V)||delete j[H])}),console.log("decodedCleanedSelected: ",j),n({price:L,quantity:g,selected:j,filter:V})}},k=()=>F();return C(Ge,{children:C(Bv,{rootProduct:t,children:C(xs.Provider,{value:e.components,children:C(oo,{...P,children:B("form",{children:[u&&C("div",{className:"hidden",children:C(As,{})}),C(Uv,{product:c,productQuantity:g,validationMap:A,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:k,countedProductPrice:L,countedProductTotalPrice:L*g,increaseProductQuantity:b,decreaseProductQuantity:h,currency:s})]})})})})})}exports.ContextType=Hn;exports.MainView=xo;exports.ProductConfigurator=Wv;exports.ProductKinds=Wn;exports.ProductTypes=Po;exports.SelMinSelMaxStatus=Te;exports.getProductToChangeInForm=ps;exports.hookForm=Zu;exports.selectProductsInForm=hs;exports.unselectProductsInForm=yp;exports.useMenuOptions=ms;exports.useProductData=Hv;exports.validateProductFilter=ei;