@orderingstack/front-components-product-configurator 0.0.11 → 1.0.0
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.
- package/dist/index.cjs.js +16 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +9145 -0
- package/dist/index.es.js.map +1 -0
- package/dist/style.css +1 -1
- package/package.json +84 -80
- package/dist/index.umd.js +0 -8
- package/dist/index.umd.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
"use strict";var Ai=Object.defineProperty,Ri=Object.defineProperties;var Ti=Object.getOwnPropertyDescriptors;var Nr=Object.getOwnPropertySymbols;var Mi=Object.prototype.hasOwnProperty,Di=Object.prototype.propertyIsEnumerable;var kr=(e,r,t)=>r in e?Ai(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ie=(e,r)=>{for(var t in r||(r={}))Mi.call(r,t)&&kr(e,t,r[t]);if(Nr)for(var t of Nr(r))Di.call(r,t)&&kr(e,t,r[t]);return e},We=(e,r)=>Ri(e,Ti(r));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var y=require("react"),p=require("react/jsx-runtime"),Er=require("react-spring"),Ii=require("react-dom");function _i(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var he=_i(y);var ht=e=>e.type==="checkbox",Xe=e=>e instanceof Date,ce=e=>e==null;const Dn=e=>typeof e=="object";var ae=e=>!ce(e)&&!Array.isArray(e)&&Dn(e)&&!Xe(e),Vi=e=>ae(e)&&e.target?ht(e.target)?e.target.checked:e.target.value:e,$i=e=>e.substring(0,e.search(/.\d/))||e,Ui=(e,r)=>[...e].some(t=>$i(r)===t),It=e=>e.filter(Boolean),ne=e=>e===void 0,F=(e,r,t)=>{if(!r||!ae(e))return t;const i=It(r.split(/[,[\].]+?/)).reduce((n,a)=>ce(n)?n:n[a],e);return ne(i)||i===e?ne(e[r])?t:e[r]:i};const Lr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},be={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Le={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};var _t=(e,r)=>{const t=Object.assign({},e);return delete t[r],t};const In=he.default.createContext(null),pt=()=>he.default.useContext(In),Hi=e=>he.default.createElement(In.Provider,{value:_t(e,"children")},e.children);var Bi=(e,r,t,i=!0)=>{const n={};for(const a in e)Object.defineProperty(n,a,{get:()=>{const o=a;return r[o]!==be.all&&(r[o]=!i||be.all),t&&(t[o]=!0),e[o]}});return n},de=e=>ae(e)&&!Object.keys(e).length,Wi=(e,r,t)=>{const i=_t(e,"name");return de(i)||Object.keys(i).length>=Object.keys(r).length||Object.keys(i).find(n=>r[n]===(!t||be.all))},Jt=e=>Array.isArray(e)?e:[e];function zi(e){const r=he.default.useRef(e);r.current=e,he.default.useEffect(()=>{const t=n=>{n&&n.unsubscribe()},i=!e.disabled&&r.current.subject.subscribe({next:r.current.callback});return()=>t(i)},[e.disabled])}var Pe=e=>typeof e=="string",qi=(e,r,t,i)=>{const n=Array.isArray(e);return Pe(e)?(i&&r.watch.add(e),F(t,e)):n?e.map(a=>(i&&r.watch.add(a),F(t,a))):(i&&(r.watchAll=!0),t)},Vt=e=>typeof e=="function",_n=e=>{for(const r in e)if(Vt(e[r]))return!0;return!1},Gi=(e,r,t,i,n)=>r?Object.assign(Object.assign({},t[e]),{types:Object.assign(Object.assign({},t[e]&&t[e].types?t[e].types:{}),{[i]:n||!0})}):{},hr=e=>/^\w*$/.test(e),Vn=e=>It(e.replace(/["|']|\]/g,"").split(/\.|\[/));function ee(e,r,t){let i=-1;const n=hr(r)?[r]:Vn(r),a=n.length,o=a-1;for(;++i<a;){const s=n[i];let u=t;if(i!==o){const c=e[s];u=ae(c)||Array.isArray(c)?c:isNaN(+n[i+1])?{}:[]}e[s]=u,e=e[s]}return e}const ur=(e,r,t)=>{for(const i of t||Object.keys(e)){const n=F(e,i);if(n){const a=n._f,o=_t(n,"_f");if(a&&r(a.name)){if(a.ref.focus&&ne(a.ref.focus()))break;if(a.refs){a.refs[0].focus();break}}else ae(o)&&ur(o,r)}}};var Fr=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));function Ze(e){let r;const t=Array.isArray(e);if(e instanceof Date)r=new Date(e);else if(e instanceof Set)r=new Set(e);else if(t||ae(e)){r=t?[]:{};for(const i in e){if(Vt(e[i])){r=e;break}r[i]=Ze(e[i])}}else return e;return r}function Yt(){let e=[];return{get observers(){return e},next:n=>{for(const a of e)a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}}var Nt=e=>ce(e)||!Dn(e);function et(e,r){if(Nt(e)||Nt(r))return e===r;if(Xe(e)&&Xe(r))return e.getTime()===r.getTime();const t=Object.keys(e),i=Object.keys(r);if(t.length!==i.length)return!1;for(const n of t){const a=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const o=r[n];if(Xe(a)&&Xe(o)||ae(a)&&ae(o)||Array.isArray(a)&&Array.isArray(o)?!et(a,o):a!==o)return!1}}return!0}var Ar=e=>({isOnSubmit:!e||e===be.onSubmit,isOnBlur:e===be.onBlur,isOnChange:e===be.onChange,isOnAll:e===be.all,isOnTouch:e===be.onTouched}),ft=e=>typeof e=="boolean",pr=e=>e.type==="file",lr=e=>e instanceof HTMLElement,$n=e=>e.type==="select-multiple",vr=e=>e.type==="radio",Ki=e=>vr(e)||ht(e),Rr=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined",Zt=e=>lr(e)&&e.isConnected;function Qi(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=ne(e)?i++:e[r[i++]];return e}function ue(e,r){const t=hr(r)?[r]:Vn(r),i=t.length==1?e:Qi(e,t),n=t[t.length-1];let a;i&&delete i[n];for(let o=0;o<t.slice(0,-1).length;o++){let s=-1,u;const c=t.slice(0,-(o+1)),f=c.length-1;for(o>0&&(a=e);++s<c.length;){const l=c[s];u=u?u[l]:e[l],f===s&&(ae(u)&&de(u)||Array.isArray(u)&&!u.filter(d=>ae(d)&&!de(d)||ft(d)).length)&&(a?delete a[l]:delete e[l]),a=u}}return e}function kt(e,r={}){const t=Array.isArray(e);if(ae(e)||t)for(const i in e)Array.isArray(e[i])||ae(e[i])&&!_n(e[i])?(r[i]=Array.isArray(e[i])?[]:{},kt(e[i],r[i])):ce(e[i])||(r[i]=!0);return r}function Un(e,r,t){const i=Array.isArray(e);if(ae(e)||i)for(const n in e)Array.isArray(e[n])||ae(e[n])&&!_n(e[n])?ne(r)||Nt(t[n])?t[n]=Array.isArray(e[n])?kt(e[n],[]):Object.assign({},kt(e[n])):Un(e[n],ce(r)?{}:r[n],t[n]):t[n]=!et(e[n],r[n]);return t}var Tr=(e,r)=>Un(e,r,kt(r));const Mr={value:!1,isValid:!1},Dr={value:!0,isValid:!0};var Hn=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ne(e[0].attributes.value)?ne(e[0].value)||e[0].value===""?Dr:{value:e[0].value,isValid:!0}:Dr:Mr}return Mr},Bn=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>ne(e)?e:r?e===""?NaN:+e:t&&Pe(e)?new Date(e):i?i(e):e;const Ir={isValid:!1,value:null};var Wn=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Ir):Ir;function Xt(e){const r=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):r.disabled))return pr(r)?r.files:vr(r)?Wn(e.refs).value:$n(r)?[...r.selectedOptions].map(({value:t})=>t):ht(r)?Hn(e.refs).value:Bn(ne(r.value)?e.ref.value:r.value,e)}var Ji=(e,r,t,i)=>{const n={};for(const a of e){const o=F(r,a);o&&ee(n,a,o._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},Et=e=>e instanceof RegExp,rt=e=>ne(e)?void 0:Et(e)?e.source:ae(e)?Et(e.value)?e.value.source:e.value:e,Yi=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _r(e,r,t){const i=F(e,t);if(i||hr(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),o=F(r,a),s=F(e,a);if(o&&!Array.isArray(o)&&t!==a)return{name:t};if(s&&s.type)return{name:a,error:s};n.pop()}return{name:t}}var Zi=(e,r,t,i,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(r||e):(t?i.isOnBlur:n.isOnBlur)?!e:(t?i.isOnChange:n.isOnChange)?e:!0,Xi=(e,r)=>!It(F(e,r)).length&&ue(e,r),Pt=e=>Pe(e)||he.default.isValidElement(e);function Vr(e,r,t="validate"){if(Pt(e)||Array.isArray(e)&&e.every(Pt)||ft(e)&&!e)return{type:t,message:Pt(e)?e:"",ref:r}}var Qe=e=>ae(e)&&!Et(e)?e:{value:e,message:""},$r=async(e,r,t,i)=>{const{ref:n,refs:a,required:o,maxLength:s,minLength:u,min:c,max:f,pattern:l,validate:d,name:g,valueAsNumber:v,mount:x,disabled:S}=e._f;if(!x||S)return{};const m=a?a[0]:n,w=N=>{i&&m.reportValidity&&(m.setCustomValidity(ft(N)?"":N||" "),m.reportValidity())},P={},j=vr(n),R=ht(n),M=j||R,D=(v||pr(n))&&!n.value||r===""||Array.isArray(r)&&!r.length,_=Gi.bind(null,g,t,P),T=(N,E,I,q=Le.maxLength,$=Le.minLength)=>{const J=N?E:I;P[g]=Object.assign({type:N?q:$,message:J,ref:n},_(N?q:$,J))};if(o&&(!M&&(D||ce(r))||ft(r)&&!r||R&&!Hn(a).isValid||j&&!Wn(a).isValid)){const{value:N,message:E}=Pt(o)?{value:!!o,message:o}:Qe(o);if(N&&(P[g]=Object.assign({type:Le.required,message:E,ref:m},_(Le.required,E)),!t))return w(E),P}if(!D&&(!ce(c)||!ce(f))){let N,E;const I=Qe(f),q=Qe(c);if(isNaN(r)){const $=n.valueAsDate||new Date(r);Pe(I.value)&&(N=$>new Date(I.value)),Pe(q.value)&&(E=$<new Date(q.value))}else{const $=n.valueAsNumber||+r;ce(I.value)||(N=$>I.value),ce(q.value)||(E=$<q.value)}if((N||E)&&(T(!!N,I.message,q.message,Le.max,Le.min),!t))return w(P[g].message),P}if((s||u)&&!D&&Pe(r)){const N=Qe(s),E=Qe(u),I=!ce(N.value)&&r.length>N.value,q=!ce(E.value)&&r.length<E.value;if((I||q)&&(T(I,N.message,E.message),!t))return w(P[g].message),P}if(l&&!D&&Pe(r)){const{value:N,message:E}=Qe(l);if(Et(N)&&!r.match(N)&&(P[g]=Object.assign({type:Le.pattern,message:E,ref:n},_(Le.pattern,E)),!t))return w(E),P}if(d){if(Vt(d)){const N=await d(r),E=Vr(N,m);if(E&&(P[g]=Object.assign(Object.assign({},E),_(Le.validate,E.message)),!t))return w(E.message),P}else if(ae(d)){let N={};for(const E in d){if(!de(N)&&!t)break;const I=Vr(await d[E](r),m,E);I&&(N=Object.assign(Object.assign({},I),_(E,I.message)),w(I.message),t&&(P[g]=N))}if(!de(N)&&(P[g]=Object.assign({ref:m},N),!t))return P}}return w(!0),P};const ea={mode:be.onSubmit,reValidateMode:be.onChange,shouldFocusError:!0};function ta(e={}){let r=Object.assign(Object.assign({},ea),e),t={isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}},i={},n=r.defaultValues||{},a=r.shouldUnregister?{}:Ze(n),o={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},u,c=0,f={};const l={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={watch:Yt(),array:Yt(),state:Yt()},g=Ar(r.mode),v=Ar(r.reValidateMode),x=r.criteriaMode===be.all,S=(h,b)=>(...O)=>{clearTimeout(c),c=window.setTimeout(()=>h(...O),b)},m=async h=>{let b=!1;return l.isValid&&(b=r.resolver?de((await D()).errors):await T(i,!0),!h&&b!==t.isValid&&(t.isValid=b,d.state.next({isValid:b}))),b},w=(h,b=[],O,k,L=!0,C=!0)=>{if(k&&O){if(o.action=!0,C&&Array.isArray(F(i,h))){const A=O(F(i,h),k.argA,k.argB);L&&ee(i,h,A)}if(l.errors&&C&&Array.isArray(F(t.errors,h))){const A=O(F(t.errors,h),k.argA,k.argB);L&&ee(t.errors,h,A),Xi(t.errors,h)}if(l.touchedFields&&Array.isArray(F(t.touchedFields,h))){const A=O(F(t.touchedFields,h),k.argA,k.argB);L&&ee(t.touchedFields,h,A)}l.dirtyFields&&(t.dirtyFields=Tr(n,a)),d.state.next({isDirty:E(h,b),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else ee(a,h,b)},P=(h,b)=>(ee(t.errors,h,b),d.state.next({errors:t.errors})),j=(h,b,O,k)=>{const L=F(i,h);if(L){const C=F(a,h,ne(O)?F(n,h):O);ne(C)||k&&k.defaultChecked||b?ee(a,h,b?C:Xt(L._f)):$(h,C),o.mount&&m()}},R=(h,b,O,k,L)=>{let C=!1;const A={name:h},z=F(t.touchedFields,h);if(l.isDirty){const Ae=t.isDirty;t.isDirty=A.isDirty=E(),C=Ae!==A.isDirty}if(l.dirtyFields&&(!O||k)){const Ae=F(t.dirtyFields,h);et(F(n,h),b)?ue(t.dirtyFields,h):ee(t.dirtyFields,h,!0),A.dirtyFields=t.dirtyFields,C=C||Ae!==F(t.dirtyFields,h)}return O&&!z&&(ee(t.touchedFields,h,O),A.touchedFields=t.touchedFields,C=C||l.touchedFields&&z!==O),C&&L&&d.state.next(A),C?A:{}},M=async(h,b,O,k,L)=>{const C=F(t.errors,b),A=l.isValid&&t.isValid!==O;if(e.delayError&&k?(u=u||S(P,e.delayError),u(b,k)):(clearTimeout(c),k?ee(t.errors,b,k):ue(t.errors,b)),((k?!et(C,k):C)||!de(L)||A)&&!h){const z=Object.assign(Object.assign(Object.assign({},L),A?{isValid:O}:{}),{errors:t.errors,name:b});t=Object.assign(Object.assign({},t),z),d.state.next(z)}f[b]--,l.isValidating&&!Object.values(f).some(z=>z)&&(d.state.next({isValidating:!1}),f={})},D=async h=>r.resolver?await r.resolver(Object.assign({},a),r.context,Ji(h||s.mount,i,r.criteriaMode,r.shouldUseNativeValidation)):{},_=async h=>{const{errors:b}=await D();if(h)for(const O of h){const k=F(b,O);k?ee(t.errors,O,k):ue(t.errors,O)}else t.errors=b;return b},T=async(h,b,O={valid:!0})=>{for(const k in h){const L=h[k];if(L){const C=L._f,A=_t(L,"_f");if(C){const z=await $r(L,F(a,C.name),x,r.shouldUseNativeValidation);if(z[C.name]&&(O.valid=!1,b))break;b||(z[C.name]?ee(t.errors,C.name,z[C.name]):ue(t.errors,C.name))}A&&await T(A,b,O)}}return O.valid},N=()=>{for(const h of s.unMount){const b=F(i,h);b&&(b._f.refs?b._f.refs.every(O=>!Zt(O)):!Zt(b._f.ref))&&U(h)}s.unMount=new Set},E=(h,b)=>(h&&b&&ee(a,h,b),!et(te(),n)),I=(h,b,O)=>{const k=Object.assign({},o.mount?a:ne(b)?n:Pe(h)?{[h]:b}:b);return qi(h,s,k,O)},q=h=>It(F(o.mount?a:n,h,e.shouldUnregister?F(n,h,[]):[])),$=(h,b,O={})=>{const k=F(i,h);let L=b;if(k){const C=k._f;C&&(!C.disabled&&ee(a,h,Bn(b,C)),L=Rr&&lr(C.ref)&&ce(b)?"":b,$n(C.ref)?[...C.ref.options].forEach(A=>A.selected=L.includes(A.value)):C.refs?ht(C.ref)?C.refs.length>1?C.refs.forEach(A=>A.checked=Array.isArray(L)?!!L.find(z=>z===A.value):L===A.value):C.refs[0]&&(C.refs[0].checked=!!L):C.refs.forEach(A=>A.checked=A.value===L):pr(C.ref)?C.ref.value="":(C.ref.value=L,C.ref.type||d.watch.next({name:h})))}(O.shouldDirty||O.shouldTouch)&&R(h,L,O.shouldTouch,O.shouldDirty,!0),O.shouldValidate&&Z(h)},J=(h,b,O)=>{for(const k in b){const L=b[k],C=`${h}.${k}`,A=F(i,C);(s.array.has(h)||!Nt(L)||A&&!A._f)&&!Xe(L)?J(C,L,O):$(C,L,O)}},re=(h,b,O={})=>{const k=F(i,h),L=s.array.has(h),C=Ze(b);ee(a,h,C),L?(d.array.next({name:h,values:a}),(l.isDirty||l.dirtyFields)&&O.shouldDirty&&(t.dirtyFields=Tr(n,a),d.state.next({name:h,dirtyFields:t.dirtyFields,isDirty:E(h,C)}))):k&&!k._f&&!ce(C)?J(h,C,O):$(h,C,O),Fr(h,s)&&d.state.next({}),d.watch.next({name:h})},W=async h=>{const b=h.target;let O=b.name;const k=F(i,O);if(k){let L,C;const A=b.type?Xt(k._f):Vi(h),z=h.type===Lr.BLUR||h.type===Lr.FOCUS_OUT,Ae=!Yi(k._f)&&!r.resolver&&!F(t.errors,O)&&!k._f.deps||Zi(z,F(t.touchedFields,O),t.isSubmitted,v,g),bt=Fr(O,s,z);ee(a,O,A),z?k._f.onBlur&&k._f.onBlur(h):k._f.onChange&&k._f.onChange(h);const Qt=R(O,A,z,!1),Li=!de(Qt)||bt;if(!z&&d.watch.next({name:O,type:h.type}),Ae)return Li&&d.state.next(Object.assign({name:O},bt?{}:Qt));if(!z&&bt&&d.state.next({}),f[O]=(f[O],1),d.state.next({isValidating:!0}),r.resolver){const{errors:Pr}=await D([O]),Fi=_r(t.errors,i,O),jr=_r(Pr,i,Fi.name||O);L=jr.error,O=jr.name,C=de(Pr)}else L=(await $r(k,F(a,O),x,r.shouldUseNativeValidation))[O],C=await m(!0);k._f.deps&&Z(k._f.deps),M(!1,O,C,L,Qt)}},Z=async(h,b={})=>{let O,k;const L=Jt(h);if(d.state.next({isValidating:!0}),r.resolver){const C=await _(ne(h)?h:L);O=de(C),k=h?!L.some(A=>F(C,A)):O}else h?(k=(await Promise.all(L.map(async C=>{const A=F(i,C);return await T(A&&A._f?{[C]:A}:A)}))).every(Boolean),!(!k&&!t.isValid)&&m()):k=O=await T(i);return d.state.next(Object.assign(Object.assign(Object.assign({},!Pe(h)||l.isValid&&O!==t.isValid?{}:{name:h}),r.resolver?{isValid:O}:{}),{errors:t.errors,isValidating:!1})),b.shouldFocus&&!k&&ur(i,C=>F(t.errors,C),h?L:s.mount),k},te=h=>{const b=Object.assign(Object.assign({},n),o.mount?a:{});return ne(h)?b:Pe(h)?F(b,h):h.map(O=>F(b,O))},X=(h,b)=>({invalid:!!F((b||t).errors,h),isDirty:!!F((b||t).dirtyFields,h),isTouched:!!F((b||t).touchedFields,h),error:F((b||t).errors,h)}),B=h=>{h?Jt(h).forEach(b=>ue(t.errors,b)):t.errors={},d.state.next({errors:t.errors})},G=(h,b,O)=>{const k=(F(i,h,{_f:{}})._f||{}).ref;ee(t.errors,h,Object.assign(Object.assign({},b),{ref:k})),d.state.next({name:h,errors:t.errors,isValid:!1}),O&&O.shouldFocus&&k&&k.focus&&k.focus()},V=(h,b)=>Vt(h)?d.watch.subscribe({next:O=>h(I(void 0,b),O)}):I(h,b,!0),U=(h,b={})=>{for(const O of h?Jt(h):s.mount)s.mount.delete(O),s.array.delete(O),F(i,O)&&(b.keepValue||(ue(i,O),ue(a,O)),!b.keepError&&ue(t.errors,O),!b.keepDirty&&ue(t.dirtyFields,O),!b.keepTouched&&ue(t.touchedFields,O),!r.shouldUnregister&&!b.keepDefaultValue&&ue(n,O));d.watch.next({}),d.state.next(Object.assign(Object.assign({},t),b.keepDirty?{isDirty:E()}:{})),!b.keepIsValid&&m()},H=(h,b={})=>{let O=F(i,h);const k=ft(b.disabled);return ee(i,h,{_f:Object.assign(Object.assign(Object.assign({},O&&O._f?O._f:{ref:{name:h}}),{name:h,mount:!0}),b)}),s.mount.add(h),O?k&&ee(a,h,b.disabled?void 0:F(a,h,Xt(O._f))):j(h,!0,b.value),Object.assign(Object.assign(Object.assign({},k?{disabled:b.disabled}:{}),r.shouldUseNativeValidation?{required:!!b.required,min:rt(b.min),max:rt(b.max),minLength:rt(b.minLength),maxLength:rt(b.maxLength),pattern:rt(b.pattern)}:{}),{name:h,onChange:W,onBlur:W,ref:L=>{if(L){H(h,b),O=F(i,h);const C=ne(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,A=Ki(C),z=O._f.refs||[];if(A?z.find(Ae=>Ae===C):C===O._f.ref)return;ee(i,h,{_f:Object.assign(Object.assign({},O._f),A?{refs:z.concat(C).filter(Zt),ref:{type:C.type,name:h}}:{ref:C})}),j(h,!1,void 0,C)}else O=F(i,h,{}),O._f&&(O._f.mount=!1),(r.shouldUnregister||b.shouldUnregister)&&!(Ui(s.array,h)&&o.action)&&s.unMount.add(h)}})};return{control:{register:H,unregister:U,getFieldState:X,_executeSchema:D,_getWatch:I,_getDirty:E,_updateValid:m,_removeUnmounted:N,_updateFieldArray:w,_getFieldArray:q,_subjects:d,_proxyFormState:l,get _fields(){return i},get _formValues(){return a},get _stateFlags(){return o},set _stateFlags(h){o=h},get _defaultValues(){return n},get _names(){return s},set _names(h){s=h},get _formState(){return t},set _formState(h){t=h},get _options(){return r},set _options(h){r=Object.assign(Object.assign({},r),h)}},trigger:Z,register:H,handleSubmit:(h,b)=>async O=>{O&&(O.preventDefault&&O.preventDefault(),O.persist&&O.persist());let k=!0,L=Ze(a);d.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:C,values:A}=await D();t.errors=C,L=A}else await T(i);de(t.errors)&&Object.keys(t.errors).every(C=>F(L,C))?(d.state.next({errors:{},isSubmitting:!0}),await h(L,O)):(b&&await b(Object.assign({},t.errors),O),r.shouldFocusError&&ur(i,C=>F(t.errors,C),s.mount))}catch(C){throw k=!1,C}finally{t.isSubmitted=!0,d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:de(t.errors)&&k,submitCount:t.submitCount+1,errors:t.errors})}},watch:V,setValue:re,getValues:te,reset:(h,b={})=>{const O=h||n,k=Ze(O),L=h&&!de(h)?k:n;if(b.keepDefaultValues||(n=O),!b.keepValues){if(Rr&&ne(h))for(const C of s.mount){const A=F(i,C);if(A&&A._f){const z=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;try{lr(z)&&z.closest("form").reset();break}catch{}}}a=e.shouldUnregister?b.keepDefaultValues?Ze(n):{}:k,i={},d.array.next({values:L}),d.watch.next({values:L})}s={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!b.keepIsValid,o.watch=!!e.shouldUnregister,d.state.next({submitCount:b.keepSubmitCount?t.submitCount:0,isDirty:b.keepDirty?t.isDirty:b.keepDefaultValues?!et(h,n):!1,isSubmitted:b.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:b.keepDirty?t.dirtyFields:b.keepDefaultValues&&h?Object.entries(h).reduce((C,[A,z])=>Object.assign(Object.assign({},C),{[A]:z!==F(n,A)}),{}):{},touchedFields:b.keepTouched?t.touchedFields:{},errors:b.keepErrors?t.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(h,b={})=>{F(i,h)&&(ne(b.defaultValue)?re(h,F(n,h)):(re(h,b.defaultValue),ee(n,h,b.defaultValue)),b.keepTouched||ue(t.touchedFields,h),b.keepDirty||(ue(t.dirtyFields,h),t.isDirty=b.defaultValue?E(h,F(n,h)):E()),b.keepError||(ue(t.errors,h),l.isValid&&m()),d.state.next(Object.assign({},t)))},clearErrors:B,unregister:U,setError:G,setFocus:(h,b={})=>{const O=F(i,h)._f,k=O.refs?O.refs[0]:O.ref;b.shouldSelect?k.select():k.focus()},getFieldState:X}}function ra(e={}){const r=he.default.useRef(),[t,i]=he.default.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touchedFields:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,errors:{}});r.current?r.current.control._options=e:r.current=Object.assign(Object.assign({},ta(e)),{formState:t});const n=r.current.control,a=he.default.useCallback(o=>{Wi(o,n._proxyFormState,!0)&&(n._formState=Object.assign(Object.assign({},n._formState),o),i(Object.assign({},n._formState)))},[n]);return zi({subject:n._subjects.state,callback:a}),he.default.useEffect(()=>{n._stateFlags.mount||(n._proxyFormState.isValid&&n._updateValid(),n._stateFlags.mount=!0),n._stateFlags.watch&&(n._stateFlags.watch=!1,n._subjects.state.next({})),n._removeUnmounted()}),r.current.formState=Bi(t,n._proxyFormState),r.current}function De(e){return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},De(e)}function Ee(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function pe(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ur(e,r){for(var t=0;t<r.length;t++){var i=r[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ve(e,r,t){return r&&Ur(e.prototype,r),t&&Ur(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Br(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Hr(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Hr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var cr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},zn,na=he.default.createContext();function ia(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cr=Br(Br({},cr),e)}function aa(){return cr}var oa=function(){function e(){pe(this,e),this.usedNamespaces={}}return ve(e,[{key:"addUsedNamespaces",value:function(t){var i=this;t.forEach(function(n){i.usedNamespaces[n]||(i.usedNamespaces[n]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function sa(e){zn=e}function ua(){return zn}var la={type:"3rdParty",init:function(r){ia(r.options.react),sa(r)}};function ca(){if(console&&console.warn){for(var e,r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(e=console).warn.apply(e,t)}}var Wr={};function fr(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];typeof r[0]=="string"&&Wr[r[0]]||(typeof r[0]=="string"&&(Wr[r[0]]=new Date),ca.apply(void 0,r))}function zr(e,r,t){e.loadNamespaces(r,function(){if(e.isInitialized)t();else{var i=function n(){setTimeout(function(){e.off("initialized",n)},0),t()};e.on("initialized",i)}})}function fa(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!r.languages||!r.languages.length)return fr("i18n.languages were undefined or empty",r.languages),!0;var i=r.languages[0],n=r.options?r.options.fallbackLng:!1,a=r.languages[r.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var o=function(u,c){var f=r.services.backendConnector.state["".concat(u,"|").concat(c)];return f===-1||f===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!o(r.isLanguageChangingTo,e)?!1:!!(r.hasResourceBundle(i,e)||!r.services.backendConnector.backend||o(i,e)&&(!n||o(a,e)))}function qn(e){if(Array.isArray(e))return e}function da(e,r){var t=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var i=[],n=!0,a=!1,o,s;try{for(t=t.call(e);!(n=(o=t.next()).done)&&(i.push(o.value),!(r&&i.length===r));n=!0);}catch(u){a=!0,s=u}finally{try{!n&&t.return!=null&&t.return()}finally{if(a)throw s}}return i}}function qr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function Gn(e,r){if(!!e){if(typeof e=="string")return qr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qr(e,r)}}function Kn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ga(e,r){return qn(e)||da(e,r)||Gn(e,r)||Kn()}function Gr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function er(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Gr(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Gr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function $t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.i18n,i=y.useContext(na)||{},n=i.i18n,a=i.defaultNS,o=t||n||ua();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new oa),!o){fr("You will need to pass in an i18next instance by using initReactI18next");var s=function(D){return Array.isArray(D)?D[D.length-1]:D},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&fr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=er(er(er({},aa()),o.options.react),r),f=c.useSuspense,l=c.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(M){return fa(M,o,c)});function v(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var x=y.useState(v),S=ga(x,2),m=S[0],w=S[1],P=y.useRef(!0);y.useEffect(function(){var M=c.bindI18n,D=c.bindI18nStore;P.current=!0,!g&&!f&&zr(o,d,function(){P.current&&w(v)});function _(){P.current&&w(v)}return M&&o&&o.on(M,_),D&&o&&o.store.on(D,_),function(){P.current=!1,M&&o&&M.split(" ").forEach(function(T){return o.off(T,_)}),D&&o&&D.split(" ").forEach(function(T){return o.store.off(T,_)})}},[o,d.join()]);var j=y.useRef(!0);y.useEffect(function(){P.current&&!j.current&&w(v),j.current=!1},[o]);var R=[m,o,g];if(R.t=m,R.i18n=o,R.ready=g,g||!g&&!f)return R;throw new Promise(function(M){zr(o,d,function(){M()})})}function Ie(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dr(e,r){return dr=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},dr(e,r)}function Ut(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&dr(e,r)}function vt(e,r){if(r&&(De(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ie(e)}function ke(e){return ke=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ke(e)}function ha(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pa(e){return qn(e)||ha(e)||Gn(e)||Kn()}function Kr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Qr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Kr(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var va={type:"logger",log:function(r){this.output("log",r)},warn:function(r){this.output("warn",r)},error:function(r){this.output("error",r)},output:function(r,t){console&&console[r]&&console[r].apply(console,t)}},ma=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};pe(this,e),this.init(r,t)}return ve(e,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||va,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,i,n,a){return a&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[i](t))}},{key:"create",value:function(t){return new e(this.logger,Qr(Qr({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}(),je=new ma,Ue=function(){function e(){pe(this,e),this.observers={}}return ve(e,[{key:"on",value:function(t,i){var n=this;return t.split(" ").forEach(function(a){n.observers[a]=n.observers[a]||[],n.observers[a].push(i)}),this}},{key:"off",value:function(t,i){if(!!this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(function(n){return n!==i})}}},{key:"emit",value:function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];if(this.observers[t]){var o=[].concat(this.observers[t]);o.forEach(function(u){u.apply(void 0,n)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[t].concat(n))})}}}]),e}();function nt(){var e,r,t=new Promise(function(i,n){e=i,r=n});return t.resolve=e,t.reject=r,t}function Jr(e){return e==null?"":""+e}function ya(e,r,t){e.forEach(function(i){r[i]&&(t[i]=r[i])})}function mr(e,r,t){function i(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function n(){return!e||typeof e=="string"}for(var a=typeof r!="string"?[].concat(r):r.split(".");a.length>1;){if(n())return{};var o=i(a.shift());!e[o]&&t&&(e[o]=new t),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={}}return n()?{}:{obj:e,k:i(a.shift())}}function Yr(e,r,t){var i=mr(e,r,Object),n=i.obj,a=i.k;n[a]=t}function ba(e,r,t,i){var n=mr(e,r,Object),a=n.obj,o=n.k;a[o]=a[o]||[],i&&(a[o]=a[o].concat(t)),i||a[o].push(t)}function Lt(e,r){var t=mr(e,r),i=t.obj,n=t.k;if(!!i)return i[n]}function Zr(e,r,t){var i=Lt(e,t);return i!==void 0?i:Lt(r,t)}function Qn(e,r,t){for(var i in r)i!=="__proto__"&&i!=="constructor"&&(i in e?typeof e[i]=="string"||e[i]instanceof String||typeof r[i]=="string"||r[i]instanceof String?t&&(e[i]=r[i]):Qn(e[i],r[i],t):e[i]=r[i]);return e}function Je(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var xa={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Oa(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(r){return xa[r]}):e}var Ht=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Sa=[" ",",","?","!",";"];function wa(e,r,t){r=r||"",t=t||"";var i=Sa.filter(function(s){return r.indexOf(s)<0&&t.indexOf(s)<0});if(i.length===0)return!0;var n=new RegExp("(".concat(i.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),a=!n.test(e);if(!a){var o=e.indexOf(t);o>0&&!n.test(e.substring(0,o))&&(a=!0)}return a}function Xr(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function xt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Xr(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ca(e){var r=Pa();return function(){var i=ke(e),n;if(r){var a=ke(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return vt(this,n)}}function Pa(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jn(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[r])return e[r];for(var i=r.split(t),n=e,a=0;a<i.length;++a){if(!n||typeof n[i[a]]=="string"&&a+1<i.length)return;if(n[i[a]]===void 0){for(var o=2,s=i.slice(a,a+o).join(t),u=n[s];u===void 0&&i.length>a+o;)o++,s=i.slice(a,a+o).join(t),u=n[s];if(u===void 0)return;if(r.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var c=i.slice(a+o).join(t);return c?Jn(u,c,t):void 0}n=n[i[a]]}return n}}var ja=function(e){Ut(t,e);var r=Ca(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return pe(this,t),n=r.call(this),Ht&&Ue.call(Ie(n)),n.data=i||{},n.options=a,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return ve(t,[{key:"addNamespaces",value:function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}},{key:"removeNamespaces",value:function(n){var a=this.options.ns.indexOf(n);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(n,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,f=[n,a];o&&typeof o!="string"&&(f=f.concat(o)),o&&typeof o=="string"&&(f=f.concat(u?o.split(u):o)),n.indexOf(".")>-1&&(f=n.split("."));var l=Lt(this.data,f);return l||!c||typeof o!="string"?l:Jn(this.data&&this.data[n]&&this.data[n][a],o,u)}},{key:"addResource",value:function(n,a,o,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var f=[n,a];o&&(f=f.concat(c?o.split(c):o)),n.indexOf(".")>-1&&(f=n.split("."),s=a,a=f[1]),this.addNamespaces(a),Yr(this.data,f,s),u.silent||this.emit("added",n,a,o,s)}},{key:"addResources",value:function(n,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in o)(typeof o[u]=="string"||Object.prototype.toString.apply(o[u])==="[object Array]")&&this.addResource(n,a,u,o[u],{silent:!0});s.silent||this.emit("added",n,a,o)}},{key:"addResourceBundle",value:function(n,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},f=[n,a];n.indexOf(".")>-1&&(f=n.split("."),s=o,o=a,a=f[1]),this.addNamespaces(a);var l=Lt(this.data,f)||{};s?Qn(l,o,u):l=xt(xt({},l),o),Yr(this.data,f,l),c.silent||this.emit("added",n,a,o)}},{key:"removeResourceBundle",value:function(n,a){this.hasResourceBundle(n,a)&&delete this.data[n][a],this.removeNamespaces(a),this.emit("removed",n,a)}},{key:"hasResourceBundle",value:function(n,a){return this.getResource(n,a)!==void 0}},{key:"getResourceBundle",value:function(n,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?xt(xt({},{}),this.getResource(n,a)):this.getResource(n,a)}},{key:"getDataByLanguage",value:function(n){return this.data[n]}},{key:"hasLanguageSomeTranslations",value:function(n){var a=this.getDataByLanguage(n),o=a&&Object.keys(a)||[];return!!o.find(function(s){return a[s]&&Object.keys(a[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(Ue),Yn={processors:{},addPostProcessor:function(r){this.processors[r.name]=r},handle:function(r,t,i,n,a){var o=this;return r.forEach(function(s){o.processors[s]&&(t=o.processors[s].process(t,i,n,a))}),t}};function en(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function fe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?en(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):en(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Na(e){var r=ka();return function(){var i=ke(e),n;if(r){var a=ke(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return vt(this,n)}}function ka(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var tn={},rn=function(e){Ut(t,e);var r=Na(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return pe(this,t),n=r.call(this),Ht&&Ue.call(Ie(n)),ya(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Ie(n)),n.options=a,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=je.create("translator"),n}return ve(t,[{key:"changeLanguage",value:function(n){n&&(this.language=n)}},{key:"exists",value:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;var o=this.resolve(n,a);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(n,a){var o=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,u=a.ns||this.options.defaultNS||[],c=o&&n.indexOf(o)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!wa(n,o,s);if(c&&!f){var l=n.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:n,namespaces:u};var d=n.split(o);(o!==s||o===s&&this.options.ns.indexOf(d[0])>-1)&&(u=d.shift()),n=d.join(s)}return typeof u=="string"&&(u=[u]),{key:n,namespaces:u}}},{key:"translate",value:function(n,a,o){var s=this;if(De(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);var u=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=this.extractFromKey(n[n.length-1],a),f=c.key,l=c.namespaces,d=l[l.length-1],g=a.lng||this.language,v=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(v){var x=a.nsSeparator||this.options.nsSeparator;return d+x+f}return f}var S=this.resolve(n,a),m=S&&S.res,w=S&&S.usedKey||f,P=S&&S.exactUsedKey||f,j=Object.prototype.toString.apply(m),R=["[object Number]","[object Function]","[object RegExp]"],M=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,_=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(D&&m&&_&&R.indexOf(j)<0&&!(typeof M=="string"&&j==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,m,fe(fe({},a),{},{ns:l})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(u){var T=j==="[object Array]",N=T?[]:{},E=T?P:w;for(var I in m)if(Object.prototype.hasOwnProperty.call(m,I)){var q="".concat(E).concat(u).concat(I);N[I]=this.translate(q,fe(fe({},a),{joinArrays:!1,ns:l})),N[I]===q&&(N[I]=m[I])}m=N}}else if(D&&typeof M=="string"&&j==="[object Array]")m=m.join(M),m&&(m=this.extendTranslation(m,n,a,o));else{var $=!1,J=!1,re=a.count!==void 0&&typeof a.count!="string",W=t.hasDefaultValue(a),Z=re?this.pluralResolver.getSuffix(g,a.count,a):"",te=a["defaultValue".concat(Z)]||a.defaultValue;!this.isValidLookup(m)&&W&&($=!0,m=te),this.isValidLookup(m)||(J=!0,m=f);var X=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,B=X&&J?void 0:m,G=W&&te!==m&&this.options.updateMissing;if(J||$||G){if(this.logger.log(G?"updateKey":"missingKey",g,d,f,G?te:m),u){var V=this.resolve(f,fe(fe({},a),{},{keySeparator:!1}));V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var U=[],H=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&H&&H[0])for(var me=0;me<H.length;me++)U.push(H[me]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(a.lng||this.language):U.push(a.lng||this.language);var Kt=function(Be,h,b){var O=W&&b!==m?b:B;s.options.missingKeyHandler?s.options.missingKeyHandler(Be,d,h,O,G,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(Be,d,h,O,G,a),s.emit("missingKey",Be,d,h,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&re?U.forEach(function(yt){s.pluralResolver.getSuffixes(yt).forEach(function(Be){Kt([yt],f+Be,a["defaultValue".concat(Be)]||te)})}):Kt(U,f,te))}m=this.extendTranslation(m,n,a,S,o),J&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(f)),(J||$)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(f,$?m:void 0):m=this.options.parseMissingKeyHandler(m))}return m}},{key:"extendTranslation",value:function(n,a,o,s,u){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,o,s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init(fe(fe({},o),{interpolation:fe(fe({},this.options.interpolation),o.interpolation)}));var f=typeof n=="string"&&(o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),l;if(f){var d=n.match(this.interpolator.nestingRegexp);l=d&&d.length}var g=o.replace&&typeof o.replace!="string"?o.replace:o;if(this.options.interpolation.defaultVariables&&(g=fe(fe({},this.options.interpolation.defaultVariables),g)),n=this.interpolator.interpolate(n,g,o.lng||this.language,o),f){var v=n.match(this.interpolator.nestingRegexp),x=v&&v.length;l<x&&(o.nest=!1)}o.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var w=arguments.length,P=new Array(w),j=0;j<w;j++)P[j]=arguments[j];return u&&u[0]===P[0]&&!o.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(P[0]," in key: ").concat(a[0])),null):c.translate.apply(c,P.concat([a]))},o)),o.interpolation&&this.interpolator.reset()}var S=o.postProcess||this.options.postProcess,m=typeof S=="string"?[S]:S;return n!=null&&m&&m.length&&o.applyPostProcessor!==!1&&(n=Yn.handle(m,n,a,this.options&&this.options.postProcessPassResolved?fe({i18nResolved:s},o):o,this)),n}},{key:"resolve",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,u,c,f,l;return typeof n=="string"&&(n=[n]),n.forEach(function(d){if(!a.isValidLookup(s)){var g=a.extractFromKey(d,o),v=g.key;u=v;var x=g.namespaces;a.options.fallbackNS&&(x=x.concat(a.options.fallbackNS));var S=o.count!==void 0&&typeof o.count!="string",m=S&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),w=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",P=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);x.forEach(function(j){a.isValidLookup(s)||(l=j,!tn["".concat(P[0],"-").concat(j)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(tn["".concat(P[0],"-").concat(j)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(P.join(", "),`" won't get resolved as namespace "`).concat(l,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),P.forEach(function(R){if(!a.isValidLookup(s)){f=R;var M=[v];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(M,v,R,j,o);else{var D;S&&(D=a.pluralResolver.getSuffix(R,o.count,o));var _="_zero";if(S&&(M.push(v+D),m&&M.push(v+_)),w){var T="".concat(v).concat(a.options.contextSeparator).concat(o.context);M.push(T),S&&(M.push(T+D),m&&M.push(T+_))}}for(var N;N=M.pop();)a.isValidLookup(s)||(c=N,s=a.getResource(R,j,N,o))}}))})}}),{res:s,usedKey:u,exactUsedKey:c,usedLng:f,usedNS:l}}},{key:"isValidLookup",value:function(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}},{key:"getResource",value:function(n,a,o){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,a,o,s):this.resourceStore.getResource(n,a,o,s)}}],[{key:"hasDefaultValue",value:function(n){var a="defaultValue";for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&a===o.substring(0,a.length)&&n[o]!==void 0)return!0;return!1}}]),t}(Ue);function tr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ea=function(){function e(r){pe(this,e),this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=je.create("languageUtils")}return ve(e,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var i=t.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map(function(a){return a.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=tr(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=tr(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=tr(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var i=this;if(!t)return null;var n;return t.forEach(function(a){if(!n){var o=i.formatLanguageCode(a);(!i.options.supportedLngs||i.isSupportedCode(o))&&(n=o)}}),!n&&this.options.supportedLngs&&t.forEach(function(a){if(!n){var o=i.getLanguagePartFromCode(a);if(i.isSupportedCode(o))return n=o;n=i.options.supportedLngs.find(function(s){if(s.indexOf(o)===0)return s})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}},{key:"getFallbackCodes",value:function(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];var n=t[i];return n||(n=t[this.getScriptPartFromCode(i)]),n||(n=t[this.formatLanguageCode(i)]),n||(n=t[this.getLanguagePartFromCode(i)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,i){var n=this,a=this.getFallbackCodes(i||this.options.fallbackLng||[],t),o=[],s=function(c){!c||(n.isSupportedCode(c)?o.push(c):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):typeof t=="string"&&s(this.formatLanguageCode(t)),a.forEach(function(u){o.indexOf(u)<0&&s(n.formatLanguageCode(u))}),o}}]),e}(),La=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Fa={1:function(r){return Number(r>1)},2:function(r){return Number(r!=1)},3:function(r){return 0},4:function(r){return Number(r%10==1&&r%100!=11?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2)},5:function(r){return Number(r==0?0:r==1?1:r==2?2:r%100>=3&&r%100<=10?3:r%100>=11?4:5)},6:function(r){return Number(r==1?0:r>=2&&r<=4?1:2)},7:function(r){return Number(r==1?0:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?1:2)},8:function(r){return Number(r==1?0:r==2?1:r!=8&&r!=11?2:3)},9:function(r){return Number(r>=2)},10:function(r){return Number(r==1?0:r==2?1:r<7?2:r<11?3:4)},11:function(r){return Number(r==1||r==11?0:r==2||r==12?1:r>2&&r<20?2:3)},12:function(r){return Number(r%10!=1||r%100==11)},13:function(r){return Number(r!==0)},14:function(r){return Number(r==1?0:r==2?1:r==3?2:3)},15:function(r){return Number(r%10==1&&r%100!=11?0:r%10>=2&&(r%100<10||r%100>=20)?1:2)},16:function(r){return Number(r%10==1&&r%100!=11?0:r!==0?1:2)},17:function(r){return Number(r==1||r%10==1&&r%100!=11?0:1)},18:function(r){return Number(r==0?0:r==1?1:2)},19:function(r){return Number(r==1?0:r==0||r%100>1&&r%100<11?1:r%100>10&&r%100<20?2:3)},20:function(r){return Number(r==1?0:r==0||r%100>0&&r%100<20?1:2)},21:function(r){return Number(r%100==1?1:r%100==2?2:r%100==3||r%100==4?3:0)},22:function(r){return Number(r==1?0:r==2?1:(r<0||r>10)&&r%10==0?2:3)}},Aa=["v1","v2","v3"],nn={zero:0,one:1,two:2,few:3,many:4,other:5};function Ra(){var e={};return La.forEach(function(r){r.lngs.forEach(function(t){e[t]={numbers:r.nr,plurals:Fa[r.fc]}})}),e}var Ta=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};pe(this,e),this.languageUtils=r,this.options=t,this.logger=je.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Ra()}return ve(e,[{key:"addRule",value:function(t,i){this.rules[t]=i}},{key:"getRule",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(function(a){return"".concat(i).concat(a)})}},{key:"getSuffixes",value:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(t,n);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(o,s){return nn[o]-nn[s]}).map(function(o){return"".concat(i.options.prepend).concat(o)}):a.numbers.map(function(o){return i.getSuffix(t,o,n)}):[]}},{key:"getSuffix",value:function(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(t,n);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(i)):this.getSuffixRetroCompatible(a,i):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,i){var n=this,a=t.noAbs?t.plurals(i):t.plurals(Math.abs(i)),o=t.numbers[a];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!Aa.includes(this.options.compatibilityJSON)}}]),e}();function an(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function ye(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?an(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):an(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Ma=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pe(this,e),this.logger=je.create("interpolator"),this.options=r,this.format=r.interpolation&&r.interpolation.format||function(t){return t},this.init(r)}return ve(e,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var i=t.interpolation;this.escape=i.escape!==void 0?i.escape:Oa,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Je(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Je(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Je(i.nestingPrefix):i.nestingPrefixEscaped||Je("$t("),this.nestingSuffix=i.nestingSuffix?Je(i.nestingSuffix):i.nestingSuffixEscaped||Je(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,i,n,a){var o=this,s,u,c,f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(S){return S.replace(/\$/g,"$$$$")}var d=function(m){if(m.indexOf(o.formatSeparator)<0){var w=Zr(i,f,m);return o.alwaysFormat?o.format(w,void 0,n,ye(ye(ye({},a),i),{},{interpolationkey:m})):w}var P=m.split(o.formatSeparator),j=P.shift().trim(),R=P.join(o.formatSeparator).trim();return o.format(Zr(i,f,j),R,n,ye(ye(ye({},a),i),{},{interpolationkey:j}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,v=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,x=[{regex:this.regexpUnescape,safeValue:function(m){return l(m)}},{regex:this.regexp,safeValue:function(m){return o.escapeValue?l(o.escape(m)):l(m)}}];return x.forEach(function(S){for(c=0;s=S.regex.exec(t);){var m=s[1].trim();if(u=d(m),u===void 0)if(typeof g=="function"){var w=g(t,s,a);u=typeof w=="string"?w:""}else if(a&&a.hasOwnProperty(m))u="";else if(v){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(m," for interpolating ").concat(t)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=Jr(u));var P=S.safeValue(u);if(t=t.replace(s[0],P),v?(S.regex.lastIndex+=P.length,S.regex.lastIndex-=s[0].length):S.regex.lastIndex=0,c++,c>=o.maxReplaces)break}}),t}},{key:"nest",value:function(t,i){var n=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,u=ye({},a);u.applyPostProcessor=!1,delete u.defaultValue;function c(g,v){var x=this.nestingOptionsSeparator;if(g.indexOf(x)<0)return g;var S=g.split(new RegExp("".concat(x,"[ ]*{"))),m="{".concat(S[1]);g=S[0],m=this.interpolate(m,u),m=m.replace(/'/g,'"');try{u=JSON.parse(m),v&&(u=ye(ye({},v),u))}catch(w){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),w),"".concat(g).concat(x).concat(m)}return delete u.defaultValue,g}for(;o=this.nestingRegexp.exec(t);){var f=[],l=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var d=o[1].split(this.formatSeparator).map(function(g){return g.trim()});o[1]=d.shift(),f=d,l=!0}if(s=i(c.call(this,o[1].trim(),u),u),s&&o[0]===t&&typeof s!="string")return s;typeof s!="string"&&(s=Jr(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),l&&(s=f.reduce(function(g,v){return n.format(g,v,a.lng,ye(ye({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}]),e}();function on(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function Re(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?on(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Da(e){var r=e.toLowerCase().trim(),t={};if(e.indexOf("(")>-1){var i=e.split("(");r=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if(r==="currency"&&n.indexOf(":")<0)t.currency||(t.currency=n.trim());else if(r==="relativetime"&&n.indexOf(":")<0)t.range||(t.range=n.trim());else{var a=n.split(";");a.forEach(function(o){if(!!o){var s=o.split(":"),u=pa(s),c=u[0],f=u.slice(1),l=f.join(":");l.trim()==="false"&&(t[c.trim()]=!1),l.trim()==="true"&&(t[c.trim()]=!0),isNaN(l.trim())||(t[c.trim()]=parseInt(l.trim(),10)),t[c.trim()]||(t[c.trim()]=l.trim())}})}}return{formatName:r,formatOptions:t}}var Ia=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pe(this,e),this.logger=je.create("formatter"),this.options=r,this.formats={number:function(i,n,a){return new Intl.NumberFormat(n,a).format(i)},currency:function(i,n,a){return new Intl.NumberFormat(n,Re(Re({},a),{},{style:"currency"})).format(i)},datetime:function(i,n,a){return new Intl.DateTimeFormat(n,Re({},a)).format(i)},relativetime:function(i,n,a){return new Intl.RelativeTimeFormat(n,Re({},a)).format(i,a.range||"day")},list:function(i,n,a){return new Intl.ListFormat(n,Re({},a)).format(i)}},this.init(r)}return ve(e,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},n=i.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(t,i){this.formats[t.toLowerCase().trim()]=i}},{key:"format",value:function(t,i,n,a){var o=this,s=i.split(this.formatSeparator),u=s.reduce(function(c,f){var l=Da(f),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var v=c;try{var x=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},S=x.locale||x.lng||a.locale||a.lng||n;v=o.formats[d](c,S,Re(Re(Re({},g),a),x))}catch(m){o.logger.warn(m)}return v}else o.logger.warn("there was no format function for ".concat(d));return c},t);return u}}]),e}();function sn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function un(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?sn(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function _a(e){var r=Va();return function(){var i=ke(e),n;if(r){var a=ke(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return vt(this,n)}}function Va(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $a(e,r){for(var t=e.indexOf(r);t!==-1;)e.splice(t,1),t=e.indexOf(r)}var Ua=function(e){Ut(t,e);var r=_a(t);function t(i,n,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return pe(this,t),o=r.call(this),Ht&&Ue.call(Ie(o)),o.backend=i,o.store=n,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=je.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return ve(t,[{key:"queueLoad",value:function(n,a,o,s){var u=this,c=[],f=[],l=[],d=[];return n.forEach(function(g){var v=!0;a.forEach(function(x){var S="".concat(g,"|").concat(x);!o.reload&&u.store.hasResourceBundle(g,x)?u.state[S]=2:u.state[S]<0||(u.state[S]===1?f.indexOf(S)<0&&f.push(S):(u.state[S]=1,v=!1,f.indexOf(S)<0&&f.push(S),c.indexOf(S)<0&&c.push(S),d.indexOf(x)<0&&d.push(x)))}),v||l.push(g)}),(c.length||f.length)&&this.queue.push({pending:f,loaded:{},errors:[],callback:s}),{toLoad:c,pending:f,toLoadLanguages:l,toLoadNamespaces:d}}},{key:"loaded",value:function(n,a,o){var s=n.split("|"),u=s[0],c=s[1];a&&this.emit("failedLoading",u,c,a),o&&this.store.addResourceBundle(u,c,o),this.state[n]=a?-1:2;var f={};this.queue.forEach(function(l){ba(l.loaded,[u],c),$a(l.pending,n),a&&l.errors.push(a),l.pending.length===0&&!l.done&&(Object.keys(l.loaded).forEach(function(d){f[d]||(f[d]=[]),l.loaded[d].length&&l.loaded[d].forEach(function(g){f[d].indexOf(g)<0&&f[d].push(g)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(function(l){return!l.done})}},{key:"read",value:function(n,a,o){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,f=arguments.length>5?arguments[5]:void 0;return n.length?this.backend[o](n,a,function(l,d){if(l&&d&&u<5){setTimeout(function(){s.read.call(s,n,a,o,u+1,c*2,f)},c);return}f(l,d)}):f(null,{})}},{key:"prepareLoading",value:function(n,a){var o=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof a=="string"&&(a=[a]);var c=this.queueLoad(n,a,s,u);if(!c.toLoad.length)return c.pending.length||u(),null;c.toLoad.forEach(function(f){o.loadOne(f)})}},{key:"load",value:function(n,a,o){this.prepareLoading(n,a,{},o)}},{key:"reload",value:function(n,a,o){this.prepareLoading(n,a,{reload:!0},o)}},{key:"loadOne",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=n.split("|"),u=s[0],c=s[1];this.read(u,c,"read",void 0,void 0,function(f,l){f&&a.logger.warn("".concat(o,"loading namespace ").concat(c," for language ").concat(u," failed"),f),!f&&l&&a.logger.log("".concat(o,"loaded namespace ").concat(c," for language ").concat(u),l),a.loaded(n,f,l)})}},{key:"saveMissing",value:function(n,a,o,s,u){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(n,a,o,s,null,un(un({},c),{},{isUpdate:u})),!(!n||!n[0])&&this.store.addResource(n[0],a,o,s))}}]),t}(Ue);function Ha(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(r){var t={};if(De(r[1])==="object"&&(t=r[1]),typeof r[1]=="string"&&(t.defaultValue=r[1]),typeof r[2]=="string"&&(t.tDescription=r[2]),De(r[2])==="object"||De(r[3])==="object"){var i=r[3]||r[2];Object.keys(i).forEach(function(n){t[n]=i[n]})}return t},interpolation:{escapeValue:!0,format:function(r,t,i,n){return r},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ln(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function cn(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,i)}return t}function we(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?cn(Object(t),!0).forEach(function(i){Ee(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):cn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ba(e){var r=Wa();return function(){var i=ke(e),n;if(r){var a=ke(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return vt(this,n)}}function Wa(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ot(){}function za(e){var r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));r.forEach(function(t){typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}var Ft=function(e){Ut(t,e);var r=Ba(t);function t(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(pe(this,t),i=r.call(this),Ht&&Ue.call(Ie(i)),i.options=ln(n),i.services={},i.logger=je,i.modules={external:[]},za(Ie(i)),a&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,a),vt(i,Ie(i));setTimeout(function(){i.init(n,a)},0)}return i}return ve(t,[{key:"init",value:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(o=a,a={}),!a.defaultNS&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var s=Ha();this.options=we(we(we({},s),this.options),ln(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=we(we({},s.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function u(m){return m?typeof m=="function"?new m:m:null}if(!this.options.isClone){this.modules.logger?je.init(u(this.modules.logger),this.options):je.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=Ia);var f=new Ea(this.options);this.store=new ja(this.options.resources,this.options);var l=this.services;l.logger=je,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new Ta(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(l.formatter=u(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Ma(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Ua(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(m){for(var w=arguments.length,P=new Array(w>1?w-1:0),j=1;j<w;j++)P[j-1]=arguments[j];n.emit.apply(n,[m].concat(P))}),this.modules.languageDetector&&(l.languageDetector=u(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=u(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new rn(this.services,this.options),this.translator.on("*",function(m){for(var w=arguments.length,P=new Array(w>1?w-1:0),j=1;j<w;j++)P[j-1]=arguments[j];n.emit.apply(n,[m].concat(P))}),this.modules.external.forEach(function(m){m.init&&m.init(n)})}if(this.format=this.options.interpolation.format,o||(o=Ot),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var g=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];g.forEach(function(m){n[m]=function(){var w;return(w=n.store)[m].apply(w,arguments)}});var v=["addResource","addResources","addResourceBundle","removeResourceBundle"];v.forEach(function(m){n[m]=function(){var w;return(w=n.store)[m].apply(w,arguments),n}});var x=nt(),S=function(){var w=function(j,R){n.isInitialized&&!n.initializedStoreOnce&&n.logger.warn("init: i18next is already initialized. You should call init just once!"),n.isInitialized=!0,n.options.isClone||n.logger.log("initialized",n.options),n.emit("initialized",n.options),x.resolve(R),o(j,R)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return w(null,n.t.bind(n));n.changeLanguage(n.options.lng,w)};return this.options.resources||!this.options.initImmediate?S():setTimeout(S,0),x}},{key:"loadResources",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ot,s=o,u=typeof n=="string"?n:this.language;if(typeof n=="function"&&(s=n),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var c=[],f=function(g){if(!!g){var v=a.services.languageUtils.toResolveHierarchy(g);v.forEach(function(x){c.indexOf(x)<0&&c.push(x)})}};if(u)f(u);else{var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.forEach(function(d){return f(d)})}this.options.preload&&this.options.preload.forEach(function(d){return f(d)}),this.services.backendConnector.load(c,this.options.ns,s)}else s(null)}},{key:"reloadResources",value:function(n,a,o){var s=nt();return n||(n=this.languages),a||(a=this.options.ns),o||(o=Ot),this.services.backendConnector.reload(n,a,function(u){s.resolve(),o(u)}),s}},{key:"use",value:function(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&Yn.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}},{key:"changeLanguage",value:function(n,a){var o=this;this.isLanguageChangingTo=n;var s=nt();this.emit("languageChanging",n);var u=function(d){if(o.language=d,o.languages=o.services.languageUtils.toResolveHierarchy(d),o.resolvedLanguage=void 0,!(["cimode","dev"].indexOf(d)>-1))for(var g=0;g<o.languages.length;g++){var v=o.languages[g];if(!(["cimode","dev"].indexOf(v)>-1)&&o.store.hasLanguageSomeTranslations(v)){o.resolvedLanguage=v;break}}},c=function(d,g){g?(u(g),o.translator.changeLanguage(g),o.isLanguageChangingTo=void 0,o.emit("languageChanged",g),o.logger.log("languageChanged",g)):o.isLanguageChangingTo=void 0,s.resolve(function(){return o.t.apply(o,arguments)}),a&&a(d,function(){return o.t.apply(o,arguments)})},f=function(d){!n&&!d&&o.services.languageDetector&&(d=[]);var g=typeof d=="string"?d:o.services.languageUtils.getBestMatchFromCodes(d);g&&(o.language||u(g),o.translator.language||o.translator.changeLanguage(g),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(g)),o.loadResources(g,function(v){c(v,g)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(f):f(n),s}},{key:"getFixedT",value:function(n,a,o){var s=this,u=function c(f,l){var d;if(De(l)!=="object"){for(var g=arguments.length,v=new Array(g>2?g-2:0),x=2;x<g;x++)v[x-2]=arguments[x];d=s.options.overloadTranslationOptionHandler([f,l].concat(v))}else d=we({},l);d.lng=d.lng||c.lng,d.lngs=d.lngs||c.lngs,d.ns=d.ns||c.ns;var S=s.options.keySeparator||".",m=o?"".concat(o).concat(S).concat(f):f;return s.t(m,d)};return typeof n=="string"?u.lng=n:u.lngs=n,u.ns=a,u.keyPrefix=o,u}},{key:"t",value:function(){var n;return this.translator&&(n=this.translator).translate.apply(n,arguments)}},{key:"exists",value:function(){var n;return this.translator&&(n=this.translator).exists.apply(n,arguments)}},{key:"setDefaultNamespace",value:function(n){this.options.defaultNS=n}},{key:"hasLoadedNamespace",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var f=function(g,v){var x=a.services.backendConnector.state["".concat(g,"|").concat(v)];return x===-1||x===2};if(o.precheck){var l=o.precheck(this,f);if(l!==void 0)return l}return!!(this.hasResourceBundle(s,n)||!this.services.backendConnector.backend||f(s,n)&&(!u||f(c,n)))}},{key:"loadNamespaces",value:function(n,a){var o=this,s=nt();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(function(u){o.options.ns.indexOf(u)<0&&o.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),a&&a(u)}),s):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(n,a){var o=nt();typeof n=="string"&&(n=[n]);var s=this.options.preload||[],u=n.filter(function(c){return s.indexOf(c)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(c){o.resolve(),a&&a(c)}),o):(a&&a(),Promise.resolve())}},{key:"dir",value:function(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return a.indexOf(this.services.languageUtils.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ot,s=we(we(we({},this.options),a),{isClone:!0}),u=new t(s),c=["store","services","language"];return c.forEach(function(f){u[f]=n[f]}),u.services=we({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new rn(u.services,u.options),u.translator.on("*",function(f){for(var l=arguments.length,d=new Array(l>1?l-1:0),g=1;g<l;g++)d[g-1]=arguments[g];u.emit.apply(u,[f].concat(d))}),u.init(s,o),u.translator.options=u.options,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}(Ue);Ee(Ft,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Ft(e,r)});var oe=Ft.createInstance();oe.createInstance=Ft.createInstance;oe.createInstance;oe.init;oe.loadResources;oe.reloadResources;oe.use;oe.changeLanguage;oe.getFixedT;oe.t;oe.exists;oe.setDefaultNamespace;oe.hasLoadedNamespace;oe.loadNamespaces;oe.loadLanguages;var Zn=[],qa=Zn.forEach,Ga=Zn.slice;function Ka(e){return qa.call(Ga.call(arguments,1),function(r){if(r)for(var t in r)e[t]===void 0&&(e[t]=r[t])}),e}var fn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Qa=function(r,t,i){var n=i||{};n.path=n.path||"/";var a=encodeURIComponent(t),o=r+"="+a;if(n.maxAge>0){var s=n.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age="+Math.floor(s)}if(n.domain){if(!fn.test(n.domain))throw new TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!fn.test(n.path))throw new TypeError("option path is invalid");o+="; Path="+n.path}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(o+="; HttpOnly"),n.secure&&(o+="; Secure"),n.sameSite){var u=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.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},dn={create:function(r,t,i,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+i*60*1e3)),n&&(a.domain=n),document.cookie=Qa(r,encodeURIComponent(t),a)},read:function(r){for(var t=r+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var a=i[n];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove:function(r){this.create(r,"",-1)}},Ja={name:"cookie",lookup:function(r){var t;if(r.lookupCookie&&typeof document!="undefined"){var i=dn.read(r.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupCookie&&typeof document!="undefined"&&dn.create(t.lookupCookie,r,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},Ya={name:"querystring",lookup:function(r){var t;if(typeof window!="undefined")for(var i=window.location.search.substring(1),n=i.split("&"),a=0;a<n.length;a++){var o=n[a].indexOf("=");if(o>0){var s=n[a].substring(0,o);s===r.lookupQuerystring&&(t=n[a].substring(o+1))}}return t}},it=null,gn=function(){if(it!==null)return it;try{it=window!=="undefined"&&window.localStorage!==null;var r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{it=!1}return it},Za={name:"localStorage",lookup:function(r){var t;if(r.lookupLocalStorage&&gn()){var i=window.localStorage.getItem(r.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupLocalStorage&&gn()&&window.localStorage.setItem(t.lookupLocalStorage,r)}},at=null,hn=function(){if(at!==null)return at;try{at=window!=="undefined"&&window.sessionStorage!==null;var r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{at=!1}return at},Xa={name:"sessionStorage",lookup:function(r){var t;if(r.lookupSessionStorage&&hn()){var i=window.sessionStorage.getItem(r.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupSessionStorage&&hn()&&window.sessionStorage.setItem(t.lookupSessionStorage,r)}},eo={name:"navigator",lookup:function(r){var t=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)t.push(navigator.languages[i]);navigator.userLanguage&&t.push(navigator.userLanguage),navigator.language&&t.push(navigator.language)}return t.length>0?t:void 0}},to={name:"htmlTag",lookup:function(r){var t,i=r.htmlTag||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(t=i.getAttribute("lang")),t}},ro={name:"path",lookup:function(r){var t;if(typeof window!="undefined"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof r.lookupFromPathIndex=="number"){if(typeof i[r.lookupFromPathIndex]!="string")return;t=i[r.lookupFromPathIndex].replace("/","")}else t=i[0].replace("/","")}return t}},no={name:"subdomain",lookup:function(r){var t;if(typeof window!="undefined"){var i=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);i instanceof Array&&(typeof r.lookupFromSubdomainIndex=="number"?t=i[r.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):t=i[0].replace("http://","").replace("https://","").replace(".",""))}return t}};function io(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Xn=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};pe(this,e),this.type="languageDetector",this.detectors={},this.init(r,t)}return ve(e,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Ka(i,this.options||{},io()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Ja),this.addDetector(Ya),this.addDetector(Za),this.addDetector(Xa),this.addDetector(eo),this.addDetector(to),this.addDetector(ro),this.addDetector(no)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var i=this;t||(t=this.options.order);var n=[];return t.forEach(function(a){if(i.detectors[a]){var o=i.detectors[a].lookup(i.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(t,i){var n=this;i||(i=this.options.caches),!!i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach(function(a){n.detectors[a]&&n.detectors[a].cacheUserLanguage(t,n.options)}))}}]),e}();Xn.type="languageDetector";const ao={"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"},oo={"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"},so={"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"},uo={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};oe.use(Xn).use(la).init({resources:{pl:{translation:ao},en:{translation:oo},de:{translation:so},cs:{translation:uo}}});var ei=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(ei||{}),qe=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(qe||{}),xe=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(xe||{});const yr=(e,r,t)=>{const i=r[e];let n=0,a=0;if(i)for(let[o,s]of Object.entries(i))parseInt(s)>0&&(n+=1,a+=Number(s));else t&&t.forEach(o=>{if(r[o.selCtx])for(let[s,u]of Object.entries(r[o.selCtx]))parseInt(u)>0&&(n+=1,a+=Number(u))});return[n,a]},lo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{qtyMin:n,qtyMax:a}=i,{t:o}=$t(),[s,u]=yr(t,r,e.items),{status:c,information:f}=co(n,a,u,o);return{chosenQtyCnt:u,qtyMin:n,qtyMax:a,walidationStatus:c,informationText:f}},co=(e,r,t,i)=>{let n="",a="";const o=Number(e),s=Number(r);return o>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>t&&(a=xe.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<t&&(a=xe.TOO_MUCH)),o>=0||s>=0&&t<o?(n=`${i("OS.ProductConfigurator.Quantity.Message.Max")}${n}`,n+=` ${i("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?n=`${i("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(n="",a=xe.IGNORE),t>=o&&t<=s&&(a=xe.OK),{information:n,status:a}},fo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{selMin:n,selMax:a}=i,{t:o}=$t(),[s,u]=yr(t,r,e.items),{status:c,information:f}=go(n,a,s,o);return{chosenSelCnt:s,selMin:n,selMax:a,walidationStatus:c,informationText:f}},go=(e,r,t,i)=>{let n="",a="";const o=parseInt(e||"-1"),s=parseInt(r||"-1");return o>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>t&&(a=xe.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<t&&(a=xe.TOO_MUCH)),o>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",a=xe.IGNORE),o===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),t>=o&&t<=s&&(a=xe.OK),{information:n,status:a}},ho=(e,r,t)=>{if(e==="selected"||e==="filter")return[];if(t[r]===e)return[t];let i=ri(e,r,t.items);return(i==null?void 0:i.length)||(i=ti(e,r,t.items),i.length===0),i},ti=(e,r,t)=>{const i=po(t),n=ri(e,r,i);return(n==null?void 0:n.length)?n:(i==null?void 0:i.length)?ti(e,r,i):[]},po=e=>{let r=[];return Array.isArray(e)&&(r=e.map(t=>{if(Array.isArray(t==null?void 0:t.items))return t.items}).filter(t=>t!==void 0)),r.flat(1)},ri=(e,r,t)=>{let i=[];return Array.isArray(t)&&(i=t.filter(n=>{if(n&&n[r]===e)return!0})),i},vo=(e,r,t,i)=>{const n=ho(r,t,i),a=mo(e,n).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},mo=(e,r)=>{let t=[];return Array.isArray(r)&&r.length&&(t=r.map(i=>yo(e,i))),t},yo=(e,r)=>{if(r.id===e)return r;let t=ii(e,r.items);return t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):(t=ni(e,r.items),t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):null)},ni=(e,r)=>{const t=bo(r),i=ii(e,t);return(i==null?void 0:i.length)?i:(t==null?void 0:t.length)?ni(e,t):[]},bo=e=>{let r=[];return Array.isArray(e)&&(r=e.map(t=>{if(Array.isArray(t==null?void 0:t.items))return t.items}).filter(t=>t!==void 0)),r.flat(1)},ii=(e,r)=>Array.isArray(r)?r.filter(i=>{if(i&&i.id===e)return!0}):[],br=(e,r)=>{let t=0;for(const[i,n]of Object.entries(e))if(n){for(const[a,o]of Object.entries(n))if(o){const s=vo(a,i,ei.SELECT,r);s&&(s==null?void 0:s.price)&&(t+=parseFloat(s.price)*o)}}return t};function pn(e){const{isOkk:r,isErr:t,info:i}=e;return p.jsxs("p",{className:`${r?"text-green-600":t&&"text-red-600"} ml-1 flex`,children:[r&&xo,t&&Oo,i]})}const xo=p.jsx("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:p.jsx("polyline",{points:"20 6 9 17 4 12"})}),Oo=p.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:p.jsx("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 So={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},wo={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 ct(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ct=function(r){return typeof r}:ct=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ct(e)}function vn(e){return Co(e)||Po(e)||jo(e)||No()}function Co(e){if(Array.isArray(e))return e}function Po(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function jo(e,r){if(!!e){if(typeof e=="string")return mn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mn(e,r)}}function mn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function No(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ko={normalizePrecision:function(r){var t=r.reduce(function(i,n){return Math.max(i.getPrecision(),n.getPrecision())});return r.map(function(i){return i.getPrecision()!==t?i.convertPrecision(t):i})},minimum:function(r){var t=vn(r),i=t[0],n=t.slice(1),a=i;return n.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(r){var t=vn(r),i=t[0],n=t.slice(1),a=i;return n.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function ai(e){return!isNaN(parseInt(e))&&isFinite(e)}function Eo(e){return ai(e)&&e<=100&&e>=0}function Lo(e){return e.length>0&&e.every(function(r){return r>=0})&&e.some(function(r){return r>0})}function yn(e){return e%2===0}function bn(e){return ai(e)&&!Number.isInteger(e)}function Fo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=e.toString();if(r.indexOf("e-")>0)return parseInt(r.split("e-")[1]);var t=r.split(".")[1];return t?t.length:0}function ot(e){return Math.abs(e)%1===.5}function Ao(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,i){var n=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){n.readyState===4&&(n.status>=200&&n.status<400?t(JSON.parse(n.responseText)):i(new Error(n.statusText)))},onerror:function(){i(new Error("Network error"))}});n.open("GET",e,!0),Ro(n,r.headers),n.send()})}function Ro(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in r)e.setRequestHeader(t,r[t]);return e}function lt(e){return typeof e=="undefined"}function oi(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(e).forEach(function(i){if(ct(i[1])==="object"){var n=oi(i[1]);Object.entries(n).forEach(function(a){t[i[0]+r+a[0]]=a[1]})}else t[i[0]]=i[1]}),t}function To(e){return Boolean(e)&&(ct(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function si(){var e=function(i,n){var a=function(u){return Math.pow(10,Fo(u))},o=Math.max(a(i),a(n));return Math.round(i*o)*Math.round(n*o)/(o*o)},r={HALF_ODD:function(i){var n=Math.round(i);return ot(i)&&yn(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return ot(i)?yn(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return ot(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return ot(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return ot(i)?Math.sign(i)*Math.ceil(Math.abs(i)):Math.round(i)},DOWN:function(i){return Math.floor(i)}};return{add:function(i,n){return i+n},subtract:function(i,n){return i-n},multiply:function(i,n){return bn(i)||bn(n)?e(i,n):i*n},divide:function(i,n){return i/n},modulo:function(i,n){return i%n},round:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return r[n](i)}}}var Mo=si();function Do(e){var r=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return r!==null?r.slice(1).filter(function(i){return!lt(i)}):[]},getMinimumFractionDigits:function(){var i=function(a){return a==="."};return lt(this.getMatches().find(i))?0:this.getMatches()[Mo.add(this.getMatches().findIndex(i),1)].split("").length},getCurrencyDisplay:function(){var i={USD:"code",dollar:"name",$:"symbol"};return i[this.getMatches().find(function(n){return n==="USD"||n==="dollar"||n==="$"})]},getStyle:function(){return lt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!lt(this.getMatches().find(function(i){return i===","}))}}}function Io(e){var r=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)n=n.replace("{{".concat(o,"}}"),a[o]);return n},t=function(n,a){return Ao(r(e.endpoint,{from:n,to:a}),{headers:e.headers})};return{getExchangeRate:function(n,a){return(To(e.endpoint)?e.endpoint:t(n,a)).then(function(o){return oi(o)[r(e.propertyPath,{from:n,to:a})]})}}}function dt(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new t(r)}function _o(e){dt(Eo(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Vo(e){dt(Lo(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function rr(e){dt(Number.isInteger(e),"You must provide an integer.",TypeError)}var K=si(),$o=function e(r){var t=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},r),i=t.amount,n=t.currency,a=t.precision;rr(i),rr(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(v){var x=Object.assign({},Object.assign({},{amount:i,currency:n,precision:a},v),Object.assign({},{locale:this.locale},v));return Object.assign(e({amount:x.amount,currency:x.currency,precision:x.precision}),{locale:x.locale})},d=function(v){dt(this.hasSameCurrency(v),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return i},getCurrency:function(){return n},getLocale:function(){return this.locale||o},setLocale:function(v){return l.call(this,{locale:v})},getPrecision:function(){return a},convertPrecision:function(v){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;rr(v);var S=this.getPrecision(),m=v>S,w=m?K.multiply:K.divide,P=m?[v,S]:[S,v],j=Math.pow(10,K.subtract.apply(K,P));return l.call(this,{amount:K.round(w(this.getAmount(),j),x),precision:v})},add:function(v){d.call(this,v);var x=e.normalizePrecision([this,v]);return l.call(this,{amount:K.add(x[0].getAmount(),x[1].getAmount()),precision:x[0].getPrecision()})},subtract:function(v){d.call(this,v);var x=e.normalizePrecision([this,v]);return l.call(this,{amount:K.subtract(x[0].getAmount(),x[1].getAmount()),precision:x[0].getPrecision()})},multiply:function(v){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:K.round(K.multiply(this.getAmount(),v),x)})},divide:function(v){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:K.round(K.divide(this.getAmount(),v),x)})},percentage:function(v){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return _o(v),this.multiply(K.divide(v,100),x)},allocate:function(v){var x=this;Vo(v);for(var S=v.reduce(function(j,R){return K.add(j,R)}),m=this.getAmount(),w=v.map(function(j){var R=Math.floor(K.divide(K.multiply(x.getAmount(),j),S));return m=K.subtract(m,R),l.call(x,{amount:R})}),P=0;m>0;)v[P]>0&&(w[P]=w[P].add(l.call(this,{amount:1})),m=K.subtract(m,1)),P+=1;return w},convert:function(v){var x=this,S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=S.endpoint,w=m===void 0?f.endpoint:m,P=S.propertyPath,j=P===void 0?f.propertyPath||"rates.{{to}}":P,R=S.headers,M=R===void 0?f.headers:R,D=S.roundingMode,_=D===void 0?u:D,T=Object.assign({},{endpoint:w,propertyPath:j,headers:M,roundingMode:_});return Io(T).getExchangeRate(this.getCurrency(),v).then(function(N){return dt(!lt(N),'No rate was found for the destination currency "'.concat(v,'".'),TypeError),l.call(x,{amount:K.round(K.multiply(x.getAmount(),parseFloat(N)),T.roundingMode),currency:v})})},equalsTo:function(v){return this.hasSameAmount(v)&&this.hasSameCurrency(v)},lessThan:function(v){d.call(this,v);var x=e.normalizePrecision([this,v]);return x[0].getAmount()<x[1].getAmount()},lessThanOrEqual:function(v){d.call(this,v);var x=e.normalizePrecision([this,v]);return x[0].getAmount()<=x[1].getAmount()},greaterThan:function(v){d.call(this,v);var x=e.normalizePrecision([this,v]);return x[0].getAmount()>x[1].getAmount()},greaterThanOrEqual:function(v){d.call(this,v);var x=e.normalizePrecision([this,v]);return x[0].getAmount()>=x[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return K.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return K.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(v){return this.getCurrency()===v.getCurrency()},hasSameAmount:function(v){var x=e.normalizePrecision([this,v]);return x[0].getAmount()===x[1].getAmount()},toFormat:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,S=Do(v);return this.toRoundedUnit(S.getMinimumFractionDigits(),x).toLocaleString(this.getLocale(),{currencyDisplay:S.getCurrencyDisplay(),useGrouping:S.getUseGrouping(),minimumFractionDigits:S.getMinimumFractionDigits(),style:S.getStyle(),currency:this.getCurrency()})},toUnit:function(){return K.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(v){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,S=Math.pow(10,v);return K.divide(K.round(K.multiply(this.toUnit(),S),x),S)},toObject:function(){return{amount:i,currency:n,precision:a}},toJSON:function(){return this.toObject()}}},Uo=Object.assign($o,So,wo,ko);const jt=(e,r="PLN")=>{e=e.toString();const t=e.replace(",","."),i=Number(t)*100;return isNaN(i)?"0.00":Uo({amount:Math.round(i),currency:r}).toFormat("0,0.00")},Ho=(e,r,t=1)=>{const i=parseFloat(e.toString());let n=!1,a=jt(`${t*i}`);const o=`${jt(`${a}`)}`;return i<parseFloat(r)&&(n=!0,a=`${jt(`${r}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Bt(e){const{price:r,addPlusBefore:t=!1,size:i="md",showIfPriceZero:n=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=r>s?r:a,c=jt(`${u}`);return!r&&n===!1?null:t?p.jsxs("span",{style:{visibility:`${!r&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${c}`]}):r<s?p.jsxs("span",{className:"",children:["\xA0",`od ${c}`]}):p.jsx("span",{className:"",children:c})}const Bo=(e,r,t)=>e==="1"&&r==="1"&&!t?"radio":t?"counter":"checkbox",Wo=e=>{const r=document.getElementById(e);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},ui=e=>`group--${e}`;function zo(e){let r;const t=new Set,i=(c,f)=>{const l=typeof c=="function"?c(r):c;if(l!==r){const d=r;r=f?l:Object.assign({},r,l),t.forEach(g=>g(r,d))}},n=()=>r,a=(c,f=n,l=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=f(r);function g(){const v=f(r);if(!l(d,v)){const x=d;c(d=v,x)}}return t.add(g),()=>t.delete(g)},u={setState:i,getState:n,subscribe:(c,f,l)=>f||l?a(c,f,l):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return r=e(i,n,u),u}const qo=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),xn=qo?y.useEffect:y.useLayoutEffect;function Go(e){const r=typeof e=="function"?zo(e):e,t=(i=r.getState,n=Object.is)=>{const[,a]=y.useReducer(S=>S+1,0),o=r.getState(),s=y.useRef(o),u=y.useRef(i),c=y.useRef(n),f=y.useRef(!1),l=y.useRef();l.current===void 0&&(l.current=i(o));let d,g=!1;(s.current!==o||u.current!==i||c.current!==n||f.current)&&(d=i(o),g=!n(l.current,d)),xn(()=>{g&&(l.current=d),s.current=o,u.current=i,c.current=n,f.current=!1});const v=y.useRef(o);xn(()=>{const S=()=>{try{const w=r.getState(),P=u.current(w);c.current(l.current,P)||(s.current=w,l.current=P,a())}catch{f.current=!0,a()}},m=r.subscribe(S);return r.getState()!==v.current&&S(),m},[]);const x=g?d:l.current;return y.useDebugValue(x),x};return Object.assign(t,r),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[t,r];return{next(){const n=i.length<=0;return{value:i.shift(),done:n}}}},t}const Ko=(e,r)=>({filter:{},unseenGroupsByFilter:[],setInitialFilter:t=>{e(()=>({filter:ie({},t),unseenGroupsByFilter:[]}))},setFilter:(t,i)=>{e(({filter:n})=>({filter:We(ie({},n),{[t]:ie(ie({},n[t]),i)})}))},validateFilter:(t,i)=>{const n=r().filter;return t&&n[i]?Object.keys(n[i]).filter(o=>Object.keys(t).includes(o)&&t[o].includes(n[i][o])):[]},uncheckFilteredProducts:(t,i,n,a,o)=>{r().initialSelectedState;const s=u=>{t&&Object.keys(t).length>0&&n.length===0&&u.forEach(c=>{const{selCtx:f,id:l,items:d=[]}=c;o(`selected.${f}.${l}`,!1),d.length>0&&s(d)})};s(i)},checkFilteredProducts:(t,i,n,a,o)=>{const s=r().initialSelectedState,u=c=>{t&&Object.keys(t).length>0&&n.length!==0&&c.forEach(f=>{var x;const{selCtx:l,id:d,items:g=[]}=f,v=(x=s[l])==null?void 0:x[d];v&&o(`selected.${l}.${d}`,v.toString()),g.length>0&&u(g)})};u(i)}}),Qo=(e,r)=>({initialSelectedState:{},mainProductCount:1,setInitialSelectedState:t=>{e(()=>({initialSelectedState:t,mainProductCount:1}))},increaseCount:()=>{e(({mainProductCount:t})=>({mainProductCount:t+1}))},decreaseCount:()=>{e(({mainProductCount:t})=>({mainProductCount:t-1}))}}),Jo=(e,r)=>({groupsValidation:{},isOnSubmitted:!1,setInitialValidate:()=>{e(()=>({groupsValidation:{},isOnSubmitted:!1}))},setGroupsValidation:(t,i,n,a,o,s,u,c)=>{((n==null?void 0:n.qtyMax)||(n==null?void 0:n.selMax))&&e(({groupsValidation:f})=>({groupsValidation:We(ie({},f),{[i]:{parentContext:t,disableAddCounter:a===Number(n==null?void 0:n.qtyMax),disableInput:o===Number(n==null?void 0:n.selMax),parentKind:s,nestedLvl:u,isValid:a>=(Number(n==null?void 0:n.qtyMin)||0)&&o>=(Number(n==null?void 0:n.selMin)||0),isPassedFiltering:c,debug:{qtyCnt:a,selCnt:o,productAttrs:n,productSelCtx:i}}})}))},getParentsCtxValidation:(t,i)=>{const n=r().groupsValidation,a=r().getParentsCtxValidation;let o=!1;const s=n[t].parentContext,u=n[s];return Object.keys(n).map(c=>{u?o=Boolean(u==null?void 0:u[i]):o=!1,u&&!u[i]&&u.parentKind!==qe.PRODUCT&&t!==t&&a(c,i)}),o},getCtxValidation:(t,i)=>{const n=r().groupsValidation;return n[t]?n[t][i]:!1},validateSingleProductQty:(t,i)=>t&&i?Number(t)===Number(i):!1,isAddDisabled:(t,i,n)=>{const a=r().groupsValidation;return a&&a[t]&&a[t].parentKind!==qe.PRODUCT?r().getCtxValidation(t,"disableAddCounter")||r().getParentsCtxValidation(t,"disableAddCounter")||r().validateSingleProductQty(i,n):r().getCtxValidation(t,"disableAddCounter")||r().validateSingleProductQty(i,n)},isInputDisabled:t=>{const i=r().groupsValidation;return i&&i[t]&&i[t].parentKind!==qe.PRODUCT&&r().getParentsCtxValidation(t,"disableInput")||r().getCtxValidation(t,"disableInput")},setIsOnSubmittedOnTrue:()=>{console.log("isOnSubmitted"),e(()=>({isOnSubmitted:!0}))},getInvalidContextNames:()=>{var n;const t=r().groupsValidation,i=[];for(const[a,o]of Object.entries(t))t[a].isValid===!1&&t[a].isPassedFiltering===!0&&(console.log("inValidGroup debug"),console.log((n=t[a])==null?void 0:n.debug),i.push(a));return i}}),Yo=(e,r)=>({expanded:{},toggleExpanded:(t,i,n)=>{const a=r().expanded[t+i+n];e(()=>({expanded:We(ie({},r().expanded),{[t+i+n]:a!==void 0?!a:!1})}))},resetExpanded:()=>{e(()=>({expanded:{}}))}}),Y=Go((e,r)=>ie(ie(ie(ie({},Ko(e,r)),Qo(e)),Jo(e,r)),Yo(e,r))),Zo=(e,r,t,i)=>{const n=i[e+r+t];return n!==void 0?n:!0},Xo=e=>{const{productItem:r,selected:t,parentCtx:i,nestedLvl:n,parentKind:a}=e,{walidationStatus:o,informationText:s}=fo(r,t),{walidationStatus:u,informationText:c}=lo(r,t),{watch:f,setValue:l}=pt(),[d,g]=y.useState([]),{items:v,selCtx:x,attrs:S={},details:m={},filter:w,fltCtx:P,id:j}=r,{name:R,description:M}=m.literals,D=Y(V=>V.filter),_=Y(V=>V.validateFilter),T=Y(V=>V.uncheckFilteredProducts),N=Y(V=>V.expanded),E=y.useMemo(()=>Zo(x,j,i,N),[x,j,i,N]),I=Y(V=>V.toggleExpanded),q=Y(V=>V.checkFilteredProducts);y.useEffect(()=>{const V=_(w,P);T(w,v,V,f,l),q(w,v,V,f,l),g(V)},[D]);const $=Y(V=>V.setGroupsValidation),J=Y(V=>V.isOnSubmitted),[re,W]=yr(r.selCtx,t,v),Z=w&&Object.keys(w).length>0&&d.length===0;$(i,x,S,W,re,a,n,!Z);const te=o===xe.OK,X=u===xe.OK,B=!te&&J&&!!s,G=!X&&J&&!!c;return Z?null:p.jsxs("div",{className:"pt-1 mb-3 configuration-group",id:ui(x),children:[p.jsxs("div",{className:"flex text-xl font-semibold",children:[p.jsx("p",{className:"",children:R}),R&&R!==" "&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"ml-auto",children:p.jsx(Bt,{price:br(t,r)})}),p.jsx("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:()=>I(x,j,i),children:p.jsx("polyline",{points:"18 15 12 9 6 15"})})]})]}),p.jsx("p",{className:`${M&&"mb-2"}`,children:M}),p.jsx("div",{className:"flex",children:p.jsxs("div",{children:[p.jsx(pn,{isOkk:te,isErr:B,info:s}),p.jsx(pn,{isOkk:X,isErr:G,info:c})]})}),p.jsx("div",{className:`${E?"block":"hidden"}`,children:p.jsx(xr,{productItems:v,nestedLvl:n+1,context:r})})]})};function li(e){const{value:r=0,add:t,subtract:i,disabledSubtract:n,disabledAdd:a,size:o="md"}=e;return p.jsxs("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:[p.jsx("button",{type:"button",className:"quantity-button small",onClick:i,disabled:n,children:p.jsxs("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:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),p.jsx("span",{className:"font-semibold text-gray-700 product-quantity-value",children:r}),p.jsx("button",{className:"quantity-button small",type:"button",onClick:t,disabled:a,children:p.jsxs("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:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),p.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function ci(e){const{productName:r,price:t,size:i="lg",description:n="",productId:a,selCtx:o,register:s,handleOnChange:u,children:c,isDisabled:f=!1,imgSrc:l=""}=e,d=`${o}---${a}`;return p.jsxs("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${f&&"opacity-50"}`,children:[p.jsx("input",We(ie({type:"checkbox",className:`simple-checkbox checkbox-${i} mr-4`,id:d},s(`selected.${o}.${a}`,{onChange:g=>{u(g)}})),{disabled:f,value:"1"})),l&&p.jsx("div",{className:"flex mr-2 w-20 max-h-24",children:p.jsx("img",{alt:"Product image",className:"max-w-full h-auto",src:l})}),p.jsx("label",{htmlFor:d,className:"flex justify-between items-center w-full",children:p.jsxs("div",{className:"relative",children:[p.jsx("p",{className:"w-full text-lg font-semibold",children:r}),p.jsx("p",{className:"text-sm text-gray-600",children:n})]})}),p.jsx("div",{className:"ml-auto",children:c}),p.jsx("label",{htmlFor:d,children:p.jsx(Bt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}function fi(e){const{productName:r,price:t,size:i="lg",description:n="",productId:a,selCtx:o,register:s,handleOnChange:u,checked:c,children:f,isDisabled:l,readOnly:d=!1,imgSrc:g=""}=e,v=`${o}---${a}`;return p.jsxs("div",{className:`flex items-center justify-between p-2 pl-3 mt-1 mb-1 bg-white rounded-xl border-2 border-gray-200 ${l&&"opacity-50"}`,children:[p.jsx("input",We(ie({type:"radio",className:`simple-radio radio-${i} mr-4`,id:v},s(`radio.${v}`,{onChange:x=>{u(x)}})),{value:a,checked:c,disabled:l,readOnly:d})),g&&p.jsx("div",{className:"flex w-20 mr-2 max-h-24",children:p.jsx("img",{alt:"Product image",className:"h-auto max-w-full",src:g})}),p.jsx("label",{htmlFor:v,className:"flex items-center justify-between w-full",children:p.jsxs("div",{className:"relative",children:[p.jsx("p",{className:"w-full text-lg font-semibold",children:r}),p.jsx("p",{className:"text-sm text-gray-600",children:n})]})}),p.jsx("div",{className:"ml-auto",children:f}),p.jsx("label",{htmlFor:v,children:p.jsx(Bt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}const es=e=>{const{productName:r,state:t,items:i,price:n,size:a="lg",description:o="",productId:s,selCtx:u,handleOnChangeCheckBox:c,handleOnChangeRadio:f,productAttrs:l,contextAttrs:d,checked:g}=e,{register:v,setValue:x,watch:S}=pt(),m=S(`selected.${u}.${s}`);let w=0;m&&!isNaN(m)&&(w=Number(m));const P=Y(E=>E.isAddDisabled),j=Y(E=>E.isInputDisabled),R=()=>{x(`selected.${u}.${s}`,`${w+1}`)},M=()=>{x(`selected.${u}.${s}`,`${w-1}`)},D=Number(m)===0||!m,_=p.jsx(li,{value:w,add:R,subtract:M,disabledSubtract:D,disabledAdd:P(u,m,l==null?void 0:l.qtyMax)||j(u)&&!m}),{selMin:T="",selMax:N=""}=d;return p.jsx("div",{children:T==="1"&&N==="1"?p.jsx(fi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:v,handleOnChange:f,checked:g,isDisabled:!1,children:_}):p.jsx(ci,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:v,handleOnChange:c,isDisabled:j(u)&&!m||P(u,m,l==null?void 0:l.qtyMax)&&!m,children:_})})},On=(e,r)=>{Object.keys(e).forEach(t=>{r(`selected.${t}`,e[t])})},Sn=(e,r,t)=>{const i=r(`selected.${e}`);t(`selected.${e}`,Object.keys(i).reduce((n,a)=>(n[a]=!1,n),{}))},wn=(e,r,t,i,n)=>{const{target:{checked:a}}=i,{selected:o={}}=n;if(a){On(o,e);const s=u=>{!Array.isArray(u)||u.map(c=>{if(c.state&&"selected"in c.state){const{state:{selected:f}}=c;On(f,e)}Array.isArray(c.items)&&s(c.items)})};s(t)}else{Object.keys(o).forEach(u=>{Sn(u,r,e)});const s=u=>{!Array.isArray(u)||u.map(c=>{const{selCtx:f}=c;r(`selected.${f}`)&&Sn(f,r,e),s(c.items)})};s(t)}},ts=e=>{const{attrs:r}=e;if(r)return r;{const t=["selMin","selMax","qtyMin","qtyMax","vital","allowMultiple","hidden"],i={};return Object.keys(e).forEach(n=>{t.includes(n)&&(i[n]=e[n])}),i}},rs=e=>{var re;const{productItem:r,contextAttrs:t,selected:i,nestedLvl:n}=e,{register:a,watch:o,setValue:s,getValues:u}=pt(),{items:c,id:f,selCtx:l,state:d={},attrs:g={},emit:v={},fltCtx:x,details:{media:S=[],literals:m},price:w=""}=r,P=ts(r),{name:j,description:R}=m,M=Y(W=>W.isInputDisabled),D=Y(W=>W.setFilter),_=i[l]&&i[l][r.id]&&Number(i[l][r.id])>0,T=S.find(W=>W.name==="MAIN_IMG")||S[0]||{},N=W=>{wn(s,u,c,W,d)},E=W=>{wn(s,u,c,W,d);const{target:Z}=W,te=Z.name,X=Z.defaultValue,B="selected."+te.replace("radio.","").split("---")[0];s(B,{[X]:"1"})},I=o(`selected.${l}.${f}`);y.useEffect(()=>{I&&Object.keys(v).length!==0&&D(x,v)},[I]);const q=Er.useTransition(Array.isArray(r.items)&&r.items.length>0&&I,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});if(!r)return null;let $=w;(!$||parseFloat($||"1")===0)&&((re=r==null?void 0:r.state)==null?void 0:re.selected)&&($=`${br(r.state.selected,r)||"0"}`);const J=()=>{switch(Bo(t==null?void 0:t.selMin,t==null?void 0:t.selMax,t==null?void 0:t.allowMultiple)){case"counter":return p.jsx(es,{description:R,productName:j,price:$,productId:f,selCtx:l,state:d,items:c,handleOnChangeCheckBox:N,handleOnChangeRadio:E,checked:!!_,contextAttrs:t,productAttrs:P});case"radio":return p.jsx(fi,{description:R,productName:j,price:$,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:E,checked:!!_,isDisabled:!1,imgSrc:(T==null?void 0:T.url)||""});case"checkbox":return p.jsx(ci,{description:R,productName:j,price:$,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:N,isDisabled:M(l)&&!I,imgSrc:(T==null?void 0:T.url)||""});default:return null}};return p.jsxs(p.Fragment,{children:[J(),q((W,Z)=>Z&&p.jsx(Er.animated.div,{className:`border-l-[2px] border-gray-300 ${n>1&&"ml-4 pl-4"}`,style:W,children:p.jsx(xr,{productItems:c,nestedLvl:n+1,context:r})},n+1))]})};function ns(e){var f,l;const{productItem:r,nestedLvl:t,context:{attrs:i={},selCtx:n,kind:a}}=e,{kind:o}=r,{getValues:s}=pt(),{selected:u={}}=s();if(((f=r==null?void 0:r.attrs)==null?void 0:f.hidden)===!0||((l=r==null?void 0:r._)==null?void 0:l.hidden)==="true")return null;switch(o){case qe.OPTIONS:case qe.CONFIG:return p.jsx(Xo,{productItem:r,parentCtx:n,selected:u,nestedLvl:t,parentKind:a});case qe.PRODUCT:return p.jsx(rs,{productItem:r,selected:u,nestedLvl:t,contextAttrs:i});default:return null}}const nr=99,Cn=3;function xr(e){const{productItems:r,nestedLvl:t=1,context:i}=e,n=i.kind!=="3e/product",[a,o]=y.useState(n?Cn:nr),{t:s}=$t(),u=()=>{o(nr)},c=()=>{o(Cn)};return p.jsx("div",{children:r.map((f,l)=>{if(l<a)return p.jsxs("div",{children:[p.jsx(ns,{productItem:f,nestedLvl:t,context:i},`${i.id}--${f.id}--${l}`),a===nr&&n&&r.length===l+1&&Pn(s("OS.ProductConfigurator.ShowLess"),c,!1)]},`${i.id}--${f.id}--${l}`);if(l===a)return Pn(s("OS.ProductConfigurator.ShowMore"),u,!0)})})}const Pn=(e,r,t)=>p.jsx("div",{className:"flex justify-center w-full",children:p.jsxs("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:r,children:[e,p.jsxs("svg",{className:`-mr-2 w-7 h-7 ${!t&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",p.jsx("polyline",{points:"7 7 12 12 17 7"})," ",p.jsx("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),is=["id","selCtx","fltCtx"],di=".",gi="#dot",as=e=>e.replaceAll(di,gi),os=e=>e.replaceAll(gi,di),ss=(e,r)=>hi(e,r,as),us=(e,r)=>hi(e,r,os),hi=(e,r,t)=>{let i=r;if(is.includes(e)&&(typeof r=="string"||r instanceof String)&&(i=t(r)),e==="selected"||e==="filter"){const n=JSON.stringify(r),a=t(n);i=JSON.parse(a)}return i},pi=(e,r)=>(Object.keys(e).forEach(t=>{const i=e[t];e[t]=r(t,i),typeof i=="object"&&i!==null&&pi(i,r)}),e),ls=e=>{const r=JSON.parse(JSON.stringify(e));for(const[t,i]of Object.entries(r))if(i&&!Array.isArray(i)){const n=r[t];for(const[a,o]of Object.entries(n))o===!1&&delete n[a];Object.keys(n).length===0&&delete r[t]}else delete r[t];return r},cs=e=>us("selected",e),fs=()=>{const{watch:e}=pt(),r=e("selected");return console.log("selected",r),p.jsxs("div",{className:"flex flex-col items-center py-4",children:[p.jsx("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(r).map(t=>p.jsx("div",{children:Object.values(r[t]).filter(i=>i).length>0&&p.jsxs(p.Fragment,{children:[p.jsxs("p",{className:"text-lg font-semibold",children:[t,":"]}),Object.keys(r[t]).map(i=>p.jsx(he.default.Fragment,{children:r[t][i]&&p.jsxs("p",{children:[i,":",r[t][i].toString()]})},i))]})},t))]})};function jn(e){const{finalPrice:r,isBackIcon:t=!0,handleGoBack:i,displayPriceFrom:n=!1}=e,{t:a}=$t(),o=Y(c=>c.mainProductCount),s=Y(c=>c.increaseCount),u=Y(c=>c.decreaseCount);return p.jsxs("div",{className:"flex justify-around items-center px-4 w-full h-16",children:[t&&p.jsxs("button",{className:"inline-flex items-center py-1 px-2 font-bold text-red-600 hover:bg-red-200 rounded border-2 border-red-600 border-solid",onClick:i,children:[p.jsxs("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:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"}),p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),p.jsx("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),p.jsx("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),p.jsx("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Back")}`})]}),p.jsx("div",{className:"px-3",children:p.jsx(li,{value:o,add:s,subtract:u,disabledSubtract:o===1,size:"lg"})}),p.jsxs("button",{type:"submit",className:"flex justify-center items-center py-1 px-2 w-2/4 font-bold text-white bg-green-600 hover:bg-green-800 rounded border-2 border-green-600 border-solid sm:w-3/5",style:{opacity:`${n?"0.4":"1"}`},disabled:n,children:[p.jsxs("svg",{className:"mr-2 w-5 h-5 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[p.jsx("circle",{cx:"9",cy:"21",r:"1"})," ",p.jsx("circle",{cx:"20",cy:"21",r:"1"}),p.jsx("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),n?p.jsx("span",{children:`${a("OS.ProductConfigurator.Selected.Message.From")} ${r}`}):p.jsx("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Add")} ${r}`})]})]})}const St=640,vi=e=>{const{isModal:r=!1}=e,[t,i]=y.useState(window.innerWidth),[n,a]=y.useState(window.innerHeight),[o,s]=y.useState(window.innerWidth<=St),[u,c]=y.useState(window.innerWidth>St&&!r);function f(){i(window.innerWidth),a(window.innerHeight)}return y.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),y.useEffect(()=>{c(window.innerWidth>St&&!r),s(window.innerWidth<=St)},[t,e,r]),{isSm:u,isMobile:o,width:t,windowHeight:n}};function mi(e){var r,t,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=mi(e[r]))&&(i&&(i+=" "),i+=t);else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function st(){for(var e=0,r,t,i="";e<arguments.length;)(r=arguments[e++])&&(t=mi(r))&&(i&&(i+=" "),i+=t);return i}function ds(e){var X,B,G,V;const{product:r,handleAddToBasket:t,isModal:i,handleGoBack:n,showDebugState:a=!1}=e,{state:{selected:o={}}={},price:s,minPrice:u="0"}=r,c=ra({defaultValues:{selected:o}}),{handleSubmit:f,getValues:l}=c,d=Y(U=>U.setIsOnSubmittedOnTrue),[g,v]=y.useState("auto"),[x,S]=y.useState(0),m=Y(U=>U.mainProductCount),w=Y(U=>U.getInvalidContextNames),P=Y(U=>U.filter);y.useEffect(()=>{S(1);const U=setTimeout(()=>{E||S(2)},250);return()=>{clearTimeout(U)}},[]),y.useEffect(()=>{console.log("filter",P)},[P]);const j=parseFloat(s)+br(l("selected"),r),{displayPriceFrom:R,formattedEndPrice:M}=Ho(j,u,m),D=U=>{d();const H=w();if(H.length)Wo(ui(H[0])),console.log(H);else{console.log(l("selected"));const me=cs(ls(l("selected")));console.log("decodedCleanedSelected: ",me),t({price:j/m,quantity:m,selected:me,filter:P})}},_=y.useRef(),T=y.useRef(),{isSm:N,isMobile:E,windowHeight:I}=vi({isModal:i}),q=p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:st("px-4 w-full",N&&"sm:sticky sm:top-0 sm:w-2/5"),ref:_,children:[r.details.media&&r.details.media[0].url&&p.jsx("img",{className:st("mx-auto mt-2 mb-6 max-h-[250px]",N&&"max-h-[450px]"),alt:r.details.literals.name,src:(X=r.details)==null?void 0:X.media[0].url}),p.jsx("div",{className:st(!a&&"hidden"),children:p.jsx(fs,{})})]}),p.jsxs("div",{className:st("w-full",N&&"sm:w-3/5"),ref:T,children:[p.jsxs("div",{className:"items-center w-full p-4",children:[p.jsxs("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[p.jsxs("span",{className:"",children:[r.details.literals.name," "]}),p.jsx(Bt,{price:j,minPrice:u})]}),p.jsx("span",{className:"text-gray-600",children:(B=r.details.literals)==null?void 0:B.description})]}),p.jsxs("div",{className:`items-center justify-center w-full px-4 product-configuration ${(r==null?void 0:r.items)&&"py-2 bg-gray-100"}`,children:[(r==null?void 0:r.items)&&p.jsx(xr,{productItems:r.items,context:r}),p.jsx("div",{className:"sm:h-[64px]"})]}),N&&p.jsx("div",{className:"-mt-5 mb-2 bg-gray-100",children:p.jsx(jn,{finalPrice:M,isBackIcon:!1,handleGoBack:n,displayPriceFrom:R})})]})]}),$=(G=_==null?void 0:_.current)==null?void 0:G.clientHeight,J=(V=T==null?void 0:T.current)==null?void 0:V.clientHeight,re=$+J;re>window.innerHeight*.8||isNaN(re)?g!=="80vh"&&v("80vh"):g!=="auto"&&v("auto");const W=`${I-64-56}px`,Z=!N,te={"--mobile-submit-row-top":`${I-64-80}px`};return p.jsx(Hi,We(ie({},c),{children:p.jsxs("form",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},onSubmit:f(D),children:[p.jsx("div",{className:st("flex relative flex-col items-start w-full form-body stretch",!Z&&"sm:flex-row-reverse sm:pb-0",!E&&"mobile-scrollbar"),style:{height:`${E?W:g}`,minHeight:"400px",overflowY:`${i?"scroll":"visible"}`},children:q}),Z&&p.jsx("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${E?"submit-row-mobile":"submit-row"}`,style:te,children:p.jsx(jn,{handleGoBack:n,finalPrice:M,isBackIcon:!1})})]})}))}function Se(){return Se=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Se.apply(this,arguments)}function Ke(e,r){if(e==null)return{};var t={},i=Object.keys(e),n,a;for(a=0;a<i.length;a++)n=i[a],!(r.indexOf(n)>=0)&&(t[n]=e[n]);return t}function gs(e,r){if(!!e){if(typeof e=="string")return Nn(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Nn(e,r)}}function Nn(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function Oe(e,r){var t;if(typeof Symbol=="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(t=gs(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var y=require("react"),ln=require("react-spring"),Xo=require("react-dom");function ea(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var j=ea(y);function ye(e){return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function de(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ta(e,t){if(ye(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||"default");if(ye(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _i(e){var t=ta(e,"string");return ye(t)==="symbol"?t:String(t)}function cn(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_i(i.key),i)}}function ge(e,t,r){return t&&cn(e.prototype,t),r&&cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function je(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tr(e,t){return Tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,n){return i.__proto__=n,i},Tr(e,t)}function qt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tr(e,t)}function St(e,t){if(t&&(ye(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return je(e)}function Ee(e){return Ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ee(e)}function Pe(e,t,r){return t=_i(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mi(e){if(Array.isArray(e))return e}function ra(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function $i(e,t){if(!!e){if(typeof e=="string")return fn(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 fn(e,t)}}function Ui(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function na(e){return Mi(e)||ra(e)||$i(e)||Ui()}function dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dn(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var ia={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,r){console&&console[t]&&console[t].apply(console,r)}},oa=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de(this,e),this.init(t,r)}return ge(e,[{key:"init",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=r||ia,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(r){this.debug=r}},{key:"log",value:function(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return this.forward(i,"log","",!0)}},{key:"warn",value:function(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return this.forward(i,"warn","",!0)}},{key:"error",value:function(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return this.forward(i,"error","")}},{key:"deprecate",value:function(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(r,i,n,o){return o&&!this.debug?null:(typeof r[0]=="string"&&(r[0]="".concat(n).concat(this.prefix," ").concat(r[0])),this.logger[i](r))}},{key:"create",value:function(r){return new e(this.logger,gn(gn({},{prefix:"".concat(this.prefix,":").concat(r,":")}),this.options))}},{key:"clone",value:function(r){return r=r||this.options,r.prefix=r.prefix||this.prefix,new e(this.logger,r)}}]),e}(),Oe=new oa,De=function(){function e(){de(this,e),this.observers={}}return ge(e,[{key:"on",value:function(r,i){var n=this;return r.split(" ").forEach(function(o){n.observers[o]=n.observers[o]||[],n.observers[o].push(i)}),this}},{key:"off",value:function(r,i){if(!!this.observers[r]){if(!i){delete this.observers[r];return}this.observers[r]=this.observers[r].filter(function(n){return n!==i})}}},{key:"emit",value:function(r){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];if(this.observers[r]){var a=[].concat(this.observers[r]);a.forEach(function(u){u.apply(void 0,n)})}if(this.observers["*"]){var s=[].concat(this.observers["*"]);s.forEach(function(u){u.apply(u,[r].concat(n))})}}}]),e}();function st(){var e,t,r=new Promise(function(i,n){e=i,t=n});return r.resolve=e,r.reject=t,r}function pn(e){return e==null?"":""+e}function aa(e,t,r){e.forEach(function(i){t[i]&&(r[i]=t[i])})}function Kr(e,t,r){function i(s){return s&&s.indexOf("###")>-1?s.replace(/###/g,"."):s}function n(){return!e||typeof e=="string"}for(var o=typeof t!="string"?[].concat(t):t.split(".");o.length>1;){if(n())return{};var a=i(o.shift());!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return n()?{}:{obj:e,k:i(o.shift())}}function hn(e,t,r){var i=Kr(e,t,Object),n=i.obj,o=i.k;n[o]=r}function sa(e,t,r,i){var n=Kr(e,t,Object),o=n.obj,a=n.k;o[a]=o[a]||[],i&&(o[a]=o[a].concat(r)),i||o[a].push(r)}function Mt(e,t){var r=Kr(e,t),i=r.obj,n=r.k;if(!!i)return i[n]}function mn(e,t,r){var i=Mt(e,r);return i!==void 0?i:Mt(t,r)}function Vi(e,t,r){for(var i in t)i!=="__proto__"&&i!=="constructor"&&(i in e?typeof e[i]=="string"||e[i]instanceof String||typeof t[i]=="string"||t[i]instanceof String?r&&(e[i]=t[i]):Vi(e[i],t[i],r):e[i]=t[i]);return e}function Qe(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var ua={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function la(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return ua[t]}):e}var Jt=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ca=[" ",",","?","!",";"];function fa(e,t,r){t=t||"",r=r||"";var i=ca.filter(function(s){return t.indexOf(s)<0&&r.indexOf(s)<0});if(i.length===0)return!0;var n=new RegExp("(".concat(i.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),o=!n.test(e);if(!o){var a=e.indexOf(r);a>0&&!n.test(e.substring(0,a))&&(o=!0)}return o}function vn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vn(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vn(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function da(e){var t=ga();return function(){var i=Ee(e),n;if(t){var o=Ee(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return St(this,n)}}function ga(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bi(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var i=t.split(r),n=e,o=0;o<i.length;++o){if(!n||typeof n[i[o]]=="string"&&o+1<i.length)return;if(n[i[o]]===void 0){for(var a=2,s=i.slice(o,o+a).join(r),u=n[s];u===void 0&&i.length>o+a;)a++,s=i.slice(o,o+a).join(r),u=n[s];if(u===void 0)return;if(u===null)return null;if(t.endsWith(s)){if(typeof u=="string")return u;if(s&&typeof u[s]=="string")return u[s]}var l=i.slice(o+a).join(r);return l?Bi(u,l,r):void 0}n=n[i[o]]}return n}}var pa=function(e){qt(r,e);var t=da(r);function r(i){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return de(this,r),n=t.call(this),Jt&&De.call(je(n)),n.data=i||{},n.options=o,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return ge(r,[{key:"addNamespaces",value:function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}},{key:"removeNamespaces",value:function(n){var o=this.options.ns.indexOf(n);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(n,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,l=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[n,o];a&&typeof a!="string"&&(d=d.concat(a)),a&&typeof a=="string"&&(d=d.concat(u?a.split(u):a)),n.indexOf(".")>-1&&(d=n.split("."));var c=Mt(this.data,d);return c||!l||typeof a!="string"?c:Bi(this.data&&this.data[n]&&this.data[n][o],a,u)}},{key:"addResource",value:function(n,o,a,s){var u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},l=this.options.keySeparator;l===void 0&&(l=".");var d=[n,o];a&&(d=d.concat(l?a.split(l):a)),n.indexOf(".")>-1&&(d=n.split("."),s=o,o=d[1]),this.addNamespaces(o),hn(this.data,d,s),u.silent||this.emit("added",n,o,a,s)}},{key:"addResources",value:function(n,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var u in a)(typeof a[u]=="string"||Object.prototype.toString.apply(a[u])==="[object Array]")&&this.addResource(n,o,u,a[u],{silent:!0});s.silent||this.emit("added",n,o,a)}},{key:"addResourceBundle",value:function(n,o,a,s,u){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[n,o];n.indexOf(".")>-1&&(d=n.split("."),s=a,a=o,o=d[1]),this.addNamespaces(o);var c=Mt(this.data,d)||{};s?Vi(c,a,u):c=Rt(Rt({},c),a),hn(this.data,d,c),l.silent||this.emit("added",n,o,a)}},{key:"removeResourceBundle",value:function(n,o){this.hasResourceBundle(n,o)&&delete this.data[n][o],this.removeNamespaces(o),this.emit("removed",n,o)}},{key:"hasResourceBundle",value:function(n,o){return this.getResource(n,o)!==void 0}},{key:"getResourceBundle",value:function(n,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Rt(Rt({},{}),this.getResource(n,o)):this.getResource(n,o)}},{key:"getDataByLanguage",value:function(n){return this.data[n]}},{key:"hasLanguageSomeTranslations",value:function(n){var o=this.getDataByLanguage(n),a=o&&Object.keys(o)||[];return!!a.find(function(s){return o[s]&&Object.keys(o[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(De),Hi={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,r,i,n,o){var a=this;return t.forEach(function(s){a.processors[s]&&(r=a.processors[s].process(r,i,n,o))}),r}};function yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yn(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function ha(e){var t=ma();return function(){var i=Ee(e),n;if(t){var o=Ee(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return St(this,n)}}function ma(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bn={},Sn=function(e){qt(r,e);var t=ha(r);function r(i){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return de(this,r),n=t.call(this),Jt&&De.call(je(n)),aa(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,je(n)),n.options=o,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=Oe.create("translator"),n}return ge(r,[{key:"changeLanguage",value:function(n){n&&(this.language=n)}},{key:"exists",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;var a=this.resolve(n,o);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(n,o){var a=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=o.ns||this.options.defaultNS||[],l=a&&n.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!fa(n,a,s);if(l&&!d){var c=n.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:n,namespaces:u};var g=n.split(a);(a!==s||a===s&&this.options.ns.indexOf(g[0])>-1)&&(u=g.shift()),n=g.join(s)}return typeof u=="string"&&(u=[u]),{key:n,namespaces:u}}},{key:"translate",value:function(n,o,a){var s=this;if(ye(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);var u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,d=this.extractFromKey(n[n.length-1],o),c=d.key,g=d.namespaces,f=g[g.length-1],p=o.lng||this.language,m=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(m){var v=o.nsSeparator||this.options.nsSeparator;return u?(b.res="".concat(f).concat(v).concat(c),b):"".concat(f).concat(v).concat(c)}return u?(b.res=c,b):c}var b=this.resolve(n,o),S=b&&b.res,x=b&&b.usedKey||c,P=b&&b.exactUsedKey||c,L=Object.prototype.toString.apply(S),D=["[object Number]","[object Function]","[object RegExp]"],M=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject,F=typeof S!="string"&&typeof S!="boolean"&&typeof S!="number";if(_&&S&&F&&D.indexOf(L)<0&&!(typeof M=="string"&&L==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,S,ae(ae({},o),{},{ns:g})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return u?(b.res=B,b):B}if(l){var T=L==="[object Array]",I=T?[]:{},$=T?P:x;for(var U in S)if(Object.prototype.hasOwnProperty.call(S,U)){var J="".concat($).concat(l).concat(U);I[U]=this.translate(J,ae(ae({},o),{joinArrays:!1,ns:g})),I[U]===J&&(I[U]=S[U])}S=I}}else if(_&&typeof M=="string"&&L==="[object Array]")S=S.join(M),S&&(S=this.extendTranslation(S,n,o,a));else{var W=!1,z=!1,H=o.count!==void 0&&typeof o.count!="string",ne=r.hasDefaultValue(o),K=H?this.pluralResolver.getSuffix(p,o.count,o):"",ce=o["defaultValue".concat(K)]||o.defaultValue;!this.isValidLookup(S)&&ne&&(W=!0,S=ce),this.isValidLookup(S)||(z=!0,S=c);var At=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,fr=At&&z?void 0:S,Me=ne&&ce!==S&&this.options.updateMissing;if(z||W||Me){if(this.logger.log(Me?"updateKey":"missingKey",p,f,c,Me?ce:S),l){var Nt=this.resolve(c,ae(ae({},o),{},{keySeparator:!1}));Nt&&Nt.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Ce=[],Le=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Le&&Le[0])for(var Ge=0;Ge<Le.length;Ge++)Ce.push(Le[Ge]);else this.options.saveMissingTo==="all"?Ce=this.languageUtils.toResolveHierarchy(o.lng||this.language):Ce.push(o.lng||this.language);var kt=function(Ae,ze,Tt){var h=ne&&Tt!==S?Tt:fr;s.options.missingKeyHandler?s.options.missingKeyHandler(Ae,f,ze,h,Me,o):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(Ae,f,ze,h,Me,o),s.emit("missingKey",Ae,f,ze,S)};this.options.saveMissing&&(this.options.saveMissingPlurals&&H?Ce.forEach(function(at){s.pluralResolver.getSuffixes(at,o).forEach(function(Ae){kt([at],c+Ae,o["defaultValue".concat(Ae)]||ce)})}):kt(Ce,c,ce))}S=this.extendTranslation(S,n,o,b,a),z&&S===c&&this.options.appendNamespaceToMissingKey&&(S="".concat(f,":").concat(c)),(z||W)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(f,":").concat(c):c,W?S:void 0):S=this.options.parseMissingKeyHandler(S))}return u?(b.res=S,b):S}},{key:"extendTranslation",value:function(n,o,a,s,u){var l=this;if(this.i18nFormat&&this.i18nFormat.parse)n=this.i18nFormat.parse(n,ae(ae({},this.options.interpolation.defaultVariables),a),s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init(ae(ae({},a),{interpolation:ae(ae({},this.options.interpolation),a.interpolation)}));var d=typeof n=="string"&&(a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),c;if(d){var g=n.match(this.interpolator.nestingRegexp);c=g&&g.length}var f=a.replace&&typeof a.replace!="string"?a.replace:a;if(this.options.interpolation.defaultVariables&&(f=ae(ae({},this.options.interpolation.defaultVariables),f)),n=this.interpolator.interpolate(n,f,a.lng||this.language,a),d){var p=n.match(this.interpolator.nestingRegexp),m=p&&p.length;c<m&&(a.nest=!1)}a.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var S=arguments.length,x=new Array(S),P=0;P<S;P++)x[P]=arguments[P];return u&&u[0]===x[0]&&!a.context?(l.logger.warn("It seems you are nesting recursively key: ".concat(x[0]," in key: ").concat(o[0])),null):l.translate.apply(l,x.concat([o]))},a)),a.interpolation&&this.interpolator.reset()}var v=a.postProcess||this.options.postProcess,b=typeof v=="string"?[v]:v;return n!=null&&b&&b.length&&a.applyPostProcessor!==!1&&(n=Hi.handle(b,n,o,this.options&&this.options.postProcessPassResolved?ae({i18nResolved:s},a):a,this)),n}},{key:"resolve",value:function(n){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s,u,l,d,c;return typeof n=="string"&&(n=[n]),n.forEach(function(g){if(!o.isValidLookup(s)){var f=o.extractFromKey(g,a),p=f.key;u=p;var m=f.namespaces;o.options.fallbackNS&&(m=m.concat(o.options.fallbackNS));var v=a.count!==void 0&&typeof a.count!="string",b=v&&!a.ordinal&&a.count===0&&o.pluralResolver.shouldUseIntlApi(),S=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",x=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);m.forEach(function(P){o.isValidLookup(s)||(c=P,!bn["".concat(x[0],"-").concat(P)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(c)&&(bn["".concat(x[0],"-").concat(P)]=!0,o.logger.warn('key "'.concat(u,'" for languages "').concat(x.join(", "),`" won't get resolved as namespace "`).concat(c,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(function(L){if(!o.isValidLookup(s)){d=L;var D=[p];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(D,p,L,P,a);else{var M;v&&(M=o.pluralResolver.getSuffix(L,a.count,a));var _="".concat(o.options.pluralSeparator,"zero");if(v&&(D.push(p+M),b&&D.push(p+_)),S){var F="".concat(p).concat(o.options.contextSeparator).concat(a.context);D.push(F),v&&(D.push(F+M),b&&D.push(F+_))}}for(var B;B=D.pop();)o.isValidLookup(s)||(l=B,s=o.getResource(L,P,B,a))}}))})}}),{res:s,usedKey:u,exactUsedKey:l,usedLng:d,usedNS:c}}},{key:"isValidLookup",value:function(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}},{key:"getResource",value:function(n,o,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,o,a,s):this.resourceStore.getResource(n,o,a,s)}}],[{key:"hasDefaultValue",value:function(n){var o="defaultValue";for(var a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&o===a.substring(0,o.length)&&n[a]!==void 0)return!0;return!1}}]),r}(De);function pr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=function(){function e(t){de(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Oe.create("languageUtils")}return ge(e,[{key:"getScriptPartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return null;var i=r.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(r){if(!r||r.indexOf("-")<0)return r;var i=r.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(r){if(typeof r=="string"&&r.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],n=r.split("-");return this.options.lowerCaseLng?n=n.map(function(o){return o.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=pr(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=pr(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=pr(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?r.toLowerCase():r}},{key:"isSupportedCode",value:function(r){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(r=this.getLanguagePartFromCode(r)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(r)>-1}},{key:"getBestMatchFromCodes",value:function(r){var i=this;if(!r)return null;var n;return r.forEach(function(o){if(!n){var a=i.formatLanguageCode(o);(!i.options.supportedLngs||i.isSupportedCode(a))&&(n=a)}}),!n&&this.options.supportedLngs&&r.forEach(function(o){if(!n){var a=i.getLanguagePartFromCode(o);if(i.isSupportedCode(a))return n=a;n=i.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}},{key:"getFallbackCodes",value:function(r,i){if(!r)return[];if(typeof r=="function"&&(r=r(i)),typeof r=="string"&&(r=[r]),Object.prototype.toString.apply(r)==="[object Array]")return r;if(!i)return r.default||[];var n=r[i];return n||(n=r[this.getScriptPartFromCode(i)]),n||(n=r[this.formatLanguageCode(i)]),n||(n=r[this.getLanguagePartFromCode(i)]),n||(n=r.default),n||[]}},{key:"toResolveHierarchy",value:function(r,i){var n=this,o=this.getFallbackCodes(i||this.options.fallbackLng||[],r),a=[],s=function(l){!l||(n.isSupportedCode(l)?a.push(l):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(l)))};return typeof r=="string"&&r.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(r)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(r)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(r))):typeof r=="string"&&s(this.formatLanguageCode(r)),o.forEach(function(u){a.indexOf(u)<0&&s(n.formatLanguageCode(u))}),a}}]),e}(),ya=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ba={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Sa=["v1","v2","v3"],On={zero:0,one:1,two:2,few:3,many:4,other:5};function Oa(){var e={};return ya.forEach(function(t){t.lngs.forEach(function(r){e[r]={numbers:t.nr,plurals:ba[t.fc]}})}),e}var wa=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de(this,e),this.languageUtils=t,this.options=r,this.logger=Oe.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Oa()}return ge(e,[{key:"addRule",value:function(r,i){this.rules[r]=i}},{key:"getRule",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(r,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[r]||this.rules[this.languageUtils.getLanguagePartFromCode(r)]}},{key:"needsPlural",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(r,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(r,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(r,n).map(function(o){return"".concat(i).concat(o)})}},{key:"getSuffixes",value:function(r){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(r,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(a,s){return On[a]-On[s]}).map(function(a){return"".concat(i.options.prepend).concat(a)}):o.numbers.map(function(a){return i.getSuffix(r,a,n)}):[]}},{key:"getSuffix",value:function(r,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(r,n);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(i)):this.getSuffixRetroCompatible(o,i):(this.logger.warn("no plural rule found for: ".concat(r)),"")}},{key:"getSuffixRetroCompatible",value:function(r,i){var n=this,o=r.noAbs?r.plurals(i):r.plurals(Math.abs(i)),a=r.numbers[o];this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return n.options.prepend&&a.toString()?n.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&r.numbers.length===2&&r.numbers[0]===1?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Sa.includes(this.options.compatibilityJSON)}}]),e}();function wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function he(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wn(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wn(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var Ea=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};de(this,e),this.logger=Oe.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(r){return r},this.init(t)}return ge(e,[{key:"init",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};r.interpolation||(r.interpolation={escapeValue:!0});var i=r.interpolation;this.escape=i.escape!==void 0?i.escape:la,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Qe(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Qe(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Qe(i.nestingPrefix):i.nestingPrefixEscaped||Qe("$t("),this.nestingSuffix=i.nestingSuffix?Qe(i.nestingSuffix):i.nestingSuffixEscaped||Qe(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var r="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(r,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(r,i,n,o){var a=this,s,u,l,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(v){return v.replace(/\$/g,"$$$$")}var g=function(b){if(b.indexOf(a.formatSeparator)<0){var S=mn(i,d,b);return a.alwaysFormat?a.format(S,void 0,n,he(he(he({},o),i),{},{interpolationkey:b})):S}var x=b.split(a.formatSeparator),P=x.shift().trim(),L=x.join(a.formatSeparator).trim();return a.format(mn(i,d,P),L,n,he(he(he({},o),i),{},{interpolationkey:P}))};this.resetRegExp();var f=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(b){return c(b)}},{regex:this.regexp,safeValue:function(b){return a.escapeValue?c(a.escape(b)):c(b)}}];return m.forEach(function(v){for(l=0;s=v.regex.exec(r);){var b=s[1].trim();if(u=g(b),u===void 0)if(typeof f=="function"){var S=f(r,s,o);u=typeof S=="string"?S:""}else if(o&&o.hasOwnProperty(b))u="";else if(p){u=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(b," for interpolating ").concat(r)),u="";else typeof u!="string"&&!a.useRawValueToEscape&&(u=pn(u));var x=v.safeValue(u);if(r=r.replace(s[0],x),p?(v.regex.lastIndex+=u.length,v.regex.lastIndex-=s[0].length):v.regex.lastIndex=0,l++,l>=a.maxReplaces)break}}),r}},{key:"nest",value:function(r,i){var n=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,u=he({},o);u.applyPostProcessor=!1,delete u.defaultValue;function l(f,p){var m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;var v=f.split(new RegExp("".concat(m,"[ ]*{"))),b="{".concat(v[1]);f=v[0],b=this.interpolate(b,u);var S=b.match(/'/g),x=b.match(/"/g);(S&&S.length%2===0&&!x||x.length%2!==0)&&(b=b.replace(/'/g,'"'));try{u=JSON.parse(b),p&&(u=he(he({},p),u))}catch(P){return this.logger.warn("failed parsing options string in nesting for key ".concat(f),P),"".concat(f).concat(m).concat(b)}return delete u.defaultValue,f}for(;a=this.nestingRegexp.exec(r);){var d=[],c=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var g=a[1].split(this.formatSeparator).map(function(f){return f.trim()});a[1]=g.shift(),d=g,c=!0}if(s=i(l.call(this,a[1].trim(),u),u),s&&a[0]===r&&typeof s!="string")return s;typeof s!="string"&&(s=pn(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(r)),s=""),c&&(s=d.reduce(function(f,p){return n.format(f,p,o.lng,he(he({},o),{},{interpolationkey:a[1].trim()}))},s.trim())),r=r.replace(a[0],s),this.regexp.lastIndex=0}return r}}]),e}();function En(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?En(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function xa(e){var t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){var i=e.split("(");t=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if(t==="currency"&&n.indexOf(":")<0)r.currency||(r.currency=n.trim());else if(t==="relativetime"&&n.indexOf(":")<0)r.range||(r.range=n.trim());else{var o=n.split(";");o.forEach(function(a){if(!!a){var s=a.split(":"),u=na(s),l=u[0],d=u.slice(1),c=d.join(":").trim().replace(/^'+|'+$/g,"");r[l.trim()]||(r[l.trim()]=c),c==="false"&&(r[l.trim()]=!1),c==="true"&&(r[l.trim()]=!0),isNaN(c)||(r[l.trim()]=parseInt(c,10))}})}}return{formatName:t,formatOptions:r}}function qe(e){var t={};return function(i,n,o){var a=n+JSON.stringify(o),s=t[a];return s||(s=e(n,o),t[a]=s),s(i)}}var Pa=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};de(this,e),this.logger=Oe.create("formatter"),this.options=t,this.formats={number:qe(function(r,i){var n=new Intl.NumberFormat(r,i);return function(o){return n.format(o)}}),currency:qe(function(r,i){var n=new Intl.NumberFormat(r,Ie(Ie({},i),{},{style:"currency"}));return function(o){return n.format(o)}}),datetime:qe(function(r,i){var n=new Intl.DateTimeFormat(r,Ie({},i));return function(o){return n.format(o)}}),relativetime:qe(function(r,i){var n=new Intl.RelativeTimeFormat(r,Ie({},i));return function(o){return n.format(o,i.range||"day")}}),list:qe(function(r,i){var n=new Intl.ListFormat(r,Ie({},i));return function(o){return n.format(o)}})},this.init(t)}return ge(e,[{key:"init",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},n=i.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(r,i){this.formats[r.toLowerCase().trim()]=i}},{key:"addCached",value:function(r,i){this.formats[r.toLowerCase().trim()]=qe(i)}},{key:"format",value:function(r,i,n,o){var a=this,s=i.split(this.formatSeparator),u=s.reduce(function(l,d){var c=xa(d),g=c.formatName,f=c.formatOptions;if(a.formats[g]){var p=l;try{var m=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},v=m.locale||m.lng||o.locale||o.lng||n;p=a.formats[g](l,v,Ie(Ie(Ie({},f),o),m))}catch(b){a.logger.warn(b)}return p}else a.logger.warn("there was no format function for ".concat(g));return l},r);return u}}]),e}();function xn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Pn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xn(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xn(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ca(e){var t=Aa();return function(){var i=Ee(e),n;if(t){var o=Ee(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return St(this,n)}}function Aa(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Na(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var ka=function(e){qt(r,e);var t=Ca(r);function r(i,n,o){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return de(this,r),a=t.call(this),Jt&&De.call(je(a)),a.backend=i,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=Oe.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return ge(r,[{key:"queueLoad",value:function(n,o,a,s){var u=this,l={},d={},c={},g={};return n.forEach(function(f){var p=!0;o.forEach(function(m){var v="".concat(f,"|").concat(m);!a.reload&&u.store.hasResourceBundle(f,m)?u.state[v]=2:u.state[v]<0||(u.state[v]===1?d[v]===void 0&&(d[v]=!0):(u.state[v]=1,p=!1,d[v]===void 0&&(d[v]=!0),l[v]===void 0&&(l[v]=!0),g[m]===void 0&&(g[m]=!0)))}),p||(c[f]=!0)}),(Object.keys(l).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(l),pending:Object.keys(d),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(g)}}},{key:"loaded",value:function(n,o,a){var s=n.split("|"),u=s[0],l=s[1];o&&this.emit("failedLoading",u,l,o),a&&this.store.addResourceBundle(u,l,a),this.state[n]=o?-1:2;var d={};this.queue.forEach(function(c){sa(c.loaded,[u],l),Na(c,n),o&&c.errors.push(o),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(function(g){d[g]||(d[g]={});var f=c.loaded[g];f.length&&f.forEach(function(p){d[g][p]===void 0&&(d[g][p]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(c){return!c.done})}},{key:"read",value:function(n,o,a){var s=this,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!n.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:o,fcName:a,tried:u,wait:l,callback:d});return}return this.readingCalls++,this.backend[a](n,o,function(c,g){if(s.readingCalls--,s.waitingReads.length>0){var f=s.waitingReads.shift();s.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&g&&u<s.maxRetries){setTimeout(function(){s.read.call(s,n,o,a,u+1,l*2,d)},l);return}d(c,g)})}},{key:"prepareLoading",value:function(n,o){var a=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof o=="string"&&(o=[o]);var l=this.queueLoad(n,o,s,u);if(!l.toLoad.length)return l.pending.length||u(),null;l.toLoad.forEach(function(d){a.loadOne(d)})}},{key:"load",value:function(n,o,a){this.prepareLoading(n,o,{},a)}},{key:"reload",value:function(n,o,a){this.prepareLoading(n,o,{reload:!0},a)}},{key:"loadOne",value:function(n){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=n.split("|"),u=s[0],l=s[1];this.read(u,l,"read",void 0,void 0,function(d,c){d&&o.logger.warn("".concat(a,"loading namespace ").concat(l," for language ").concat(u," failed"),d),!d&&c&&o.logger.log("".concat(a,"loaded namespace ").concat(l," for language ").concat(u),c),o.loaded(n,d,c)})}},{key:"saveMissing",value:function(n,o,a,s,u){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}a==null||a===""||(this.backend&&this.backend.create&&this.backend.create(n,o,a,s,null,Pn(Pn({},l),{},{isUpdate:u})),!(!n||!n[0])&&this.store.addResource(n[0],o,a,s))}}]),r}(De);function Ta(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var r={};if(ye(t[1])==="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),ye(t[2])==="object"||ye(t[3])==="object"){var i=t[3]||t[2];Object.keys(i).forEach(function(n){r[n]=i[n]})}return r},interpolation:{escapeValue:!0,format:function(t,r,i,n){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Cn(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function An(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?An(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):An(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Ra(e){var t=La();return function(){var i=Ee(e),n;if(t){var o=Ee(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return St(this,n)}}function La(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lt(){}function Ia(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(r){typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}var $t=function(e){qt(r,e);var t=Ra(r);function r(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(de(this,r),i=t.call(this),Jt&&De.call(je(i)),i.options=Cn(n),i.services={},i.logger=Oe,i.modules={external:[]},Ia(je(i)),o&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,o),St(i,je(i));setTimeout(function(){i.init(n,o)},0)}return i}return ge(r,[{key:"init",value:function(){var n=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(a=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var s=Ta();this.options=Se(Se(Se({},s),this.options),Cn(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Se(Se({},s.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function u(b){return b?typeof b=="function"?new b:b:null}if(!this.options.isClone){this.modules.logger?Oe.init(u(this.modules.logger),this.options):Oe.init(null,this.options);var l;this.modules.formatter?l=this.modules.formatter:typeof Intl!="undefined"&&(l=Pa);var d=new va(this.options);this.store=new pa(this.options.resources,this.options);var c=this.services;c.logger=Oe,c.resourceStore=this.store,c.languageUtils=d,c.pluralResolver=new wa(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(c.formatter=u(l),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Ea(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new ka(u(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(b){for(var S=arguments.length,x=new Array(S>1?S-1:0),P=1;P<S;P++)x[P-1]=arguments[P];n.emit.apply(n,[b].concat(x))}),this.modules.languageDetector&&(c.languageDetector=u(this.modules.languageDetector),c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=u(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new Sn(this.services,this.options),this.translator.on("*",function(b){for(var S=arguments.length,x=new Array(S>1?S-1:0),P=1;P<S;P++)x[P-1]=arguments[P];n.emit.apply(n,[b].concat(x))}),this.modules.external.forEach(function(b){b.init&&b.init(n)})}if(this.format=this.options.interpolation.format,a||(a=Lt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var f=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];f.forEach(function(b){n[b]=function(){var S;return(S=n.store)[b].apply(S,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(b){n[b]=function(){var S;return(S=n.store)[b].apply(S,arguments),n}});var m=st(),v=function(){var S=function(P,L){n.isInitialized&&!n.initializedStoreOnce&&n.logger.warn("init: i18next is already initialized. You should call init just once!"),n.isInitialized=!0,n.options.isClone||n.logger.log("initialized",n.options),n.emit("initialized",n.options),m.resolve(L),a(P,L)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return S(null,n.t.bind(n));n.changeLanguage(n.options.lng,S)};return this.options.resources||!this.options.initImmediate?v():setTimeout(v,0),m}},{key:"loadResources",value:function(n){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt,s=a,u=typeof n=="string"?n:this.language;if(typeof n=="function"&&(s=n),!this.options.resources||this.options.partialBundledLanguages){if(u&&u.toLowerCase()==="cimode")return s();var l=[],d=function(f){if(!!f){var p=o.services.languageUtils.toResolveHierarchy(f);p.forEach(function(m){l.indexOf(m)<0&&l.push(m)})}};if(u)d(u);else{var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.forEach(function(g){return d(g)})}this.options.preload&&this.options.preload.forEach(function(g){return d(g)}),this.services.backendConnector.load(l,this.options.ns,function(g){!g&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),s(g)})}else s(null)}},{key:"reloadResources",value:function(n,o,a){var s=st();return n||(n=this.languages),o||(o=this.options.ns),a||(a=Lt),this.services.backendConnector.reload(n,o,function(u){s.resolve(),a(u)}),s}},{key:"use",value:function(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&Hi.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}},{key:"setResolvedLanguage",value:function(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1))for(var o=0;o<this.languages.length;o++){var a=this.languages[o];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(n,o){var a=this;this.isLanguageChangingTo=n;var s=st();this.emit("languageChanging",n);var u=function(g){a.language=g,a.languages=a.services.languageUtils.toResolveHierarchy(g),a.resolvedLanguage=void 0,a.setResolvedLanguage(g)},l=function(g,f){f?(u(f),a.translator.changeLanguage(f),a.isLanguageChangingTo=void 0,a.emit("languageChanged",f),a.logger.log("languageChanged",f)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),o&&o(g,function(){return a.t.apply(a,arguments)})},d=function(g){!n&&!g&&a.services.languageDetector&&(g=[]);var f=typeof g=="string"?g:a.services.languageUtils.getBestMatchFromCodes(g);f&&(a.language||u(f),a.translator.language||a.translator.changeLanguage(f),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage(f)),a.loadResources(f,function(p){l(p,f)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(d):d(n),s}},{key:"getFixedT",value:function(n,o,a){var s=this,u=function l(d,c){var g;if(ye(c)!=="object"){for(var f=arguments.length,p=new Array(f>2?f-2:0),m=2;m<f;m++)p[m-2]=arguments[m];g=s.options.overloadTranslationOptionHandler([d,c].concat(p))}else g=Se({},c);g.lng=g.lng||l.lng,g.lngs=g.lngs||l.lngs,g.ns=g.ns||l.ns,g.keyPrefix=g.keyPrefix||a||l.keyPrefix;var v=s.options.keySeparator||".",b=g.keyPrefix?"".concat(g.keyPrefix).concat(v).concat(d):d;return s.t(b,g)};return typeof n=="string"?u.lng=n:u.lngs=n,u.ns=o,u.keyPrefix=a,u}},{key:"t",value:function(){var n;return this.translator&&(n=this.translator).translate.apply(n,arguments)}},{key:"exists",value:function(){var n;return this.translator&&(n=this.translator).exists.apply(n,arguments)}},{key:"setDefaultNamespace",value:function(n){this.options.defaultNS=n}},{key:"hasLoadedNamespace",value:function(n){var o=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],u=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var d=function(f,p){var m=o.services.backendConnector.state["".concat(f,"|").concat(p)];return m===-1||m===2};if(a.precheck){var c=a.precheck(this,d);if(c!==void 0)return c}return!!(this.hasResourceBundle(s,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,n)&&(!u||d(l,n)))}},{key:"loadNamespaces",value:function(n,o){var a=this,s=st();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(function(u){a.options.ns.indexOf(u)<0&&a.options.ns.push(u)}),this.loadResources(function(u){s.resolve(),o&&o(u)}),s):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(n,o){var a=st();typeof n=="string"&&(n=[n]);var s=this.options.preload||[],u=n.filter(function(l){return s.indexOf(l)<0});return u.length?(this.options.preload=s.concat(u),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"dir",value:function(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var n=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Lt,s=Se(Se(Se({},this.options),o),{isClone:!0}),u=new r(s);(o.debug!==void 0||o.prefix!==void 0)&&(u.logger=u.logger.clone(o));var l=["store","services","language"];return l.forEach(function(d){u[d]=n[d]}),u.services=Se({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new Sn(u.services,u.options),u.translator.on("*",function(d){for(var c=arguments.length,g=new Array(c>1?c-1:0),f=1;f<c;f++)g[f-1]=arguments[f];u.emit.apply(u,[d].concat(g))}),u.init(s,a),u.translator.options=u.options,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(De);Pe($t,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new $t(e,t)});var oe=$t.createInstance();oe.createInstance=$t.createInstance;oe.createInstance;oe.init;oe.loadResources;oe.reloadResources;oe.use;oe.changeLanguage;oe.getFixedT;oe.t;oe.exists;oe.setDefaultNamespace;oe.hasLoadedNamespace;oe.loadNamespaces;oe.loadLanguages;var Ot=e=>e.type==="checkbox",Xe=e=>e instanceof Date,ue=e=>e==null;const Wi=e=>typeof e=="object";var re=e=>!ue(e)&&!Array.isArray(e)&&Wi(e)&&!Xe(e),Fa=e=>re(e)&&e.target?Ot(e.target)?e.target.checked:e.target.value:e,ja=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Da=(e,t)=>e.has(ja(t)),wt=e=>Array.isArray(e)?e.filter(Boolean):[],X=e=>e===void 0,N=(e,t,r)=>{if(!t||!re(e))return r;const i=wt(t.split(/[,[\].]+?/)).reduce((n,o)=>ue(n)?n:n[o],e);return X(i)||i===e?X(e[t])?r:e[t]:i};const Nn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},me={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ne={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Ki=j.default.createContext(null),Zt=()=>j.default.useContext(Ki),_a=e=>{const{children:t,...r}=e;return j.default.createElement(Ki.Provider,{value:r},t)};var Ma=(e,t,r,i=!0)=>{const n={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(n,o,{get:()=>{const a=o;return t._proxyFormState[a]!==me.all&&(t._proxyFormState[a]=!i||me.all),r&&(r[a]=!0),e[a]}});return n},fe=e=>re(e)&&!Object.keys(e).length,$a=(e,t,r)=>{const{name:i,...n}=e;return fe(n)||Object.keys(n).length>=Object.keys(t).length||Object.keys(n).find(o=>t[o]===(!r||me.all))},hr=e=>Array.isArray(e)?e:[e];function Ua(e){const t=j.default.useRef(e);t.current=e,j.default.useEffect(()=>{const r=!e.disabled&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}var we=e=>typeof e=="string",Va=(e,t,r,i,n)=>we(e)?(i&&t.watch.add(e),N(r,e,n)):Array.isArray(e)?e.map(o=>(i&&t.watch.add(o),N(r,o))):(i&&(t.watchAll=!0),r),Ba=e=>{const t=e.constructor&&e.constructor.prototype;return re(t)&&t.hasOwnProperty("isPrototypeOf")},Yr=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined";function Ue(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Yr&&(e instanceof Blob||e instanceof FileList))&&(r||re(e)))if(t=r?[]:{},!Array.isArray(e)&&!Ba(e))t=e;else for(const i in e)t[i]=Ue(e[i]);else return e;return t}var Ha=(e,t,r,i,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[i]:n||!0}}:{},Gr=e=>/^\w*$/.test(e),Yi=e=>wt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Q(e,t,r){let i=-1;const n=Gr(t)?[t]:Yi(t),o=n.length,a=o-1;for(;++i<o;){const s=n[i];let u=r;if(i!==a){const l=e[s];u=re(l)||Array.isArray(l)?l:isNaN(+n[i+1])?{}:[]}e[s]=u,e=e[s]}return e}const Rr=(e,t,r)=>{for(const i of r||Object.keys(e)){const n=N(e,i);if(n){const{_f:o,...a}=n;if(o&&t(o.name)){if(o.ref.focus){o.ref.focus();break}else if(o.refs&&o.refs[0].focus){o.refs[0].focus();break}}else re(a)&&Rr(a,t)}}};var kn=e=>({isOnSubmit:!e||e===me.onSubmit,isOnBlur:e===me.onBlur,isOnChange:e===me.onChange,isOnAll:e===me.all,isOnTouch:e===me.onTouched}),Tn=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length)))),Wa=(e,t,r)=>{const i=wt(N(e,r));return Q(i,"root",t[r]),Q(e,r,i),e},et=e=>typeof e=="boolean",zr=e=>e.type==="file",tt=e=>typeof e=="function",Ut=e=>{if(!Yr)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},jt=e=>we(e)||j.default.isValidElement(e),Qr=e=>e.type==="radio",Vt=e=>e instanceof RegExp;const Rn={value:!1,isValid:!1},Ln={value:!0,isValid:!0};var Gi=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!X(e[0].attributes.value)?X(e[0].value)||e[0].value===""?Ln:{value:e[0].value,isValid:!0}:Ln:Rn}return Rn};const In={isValid:!1,value:null};var zi=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,In):In;function Fn(e,t,r="validate"){if(jt(e)||Array.isArray(e)&&e.every(jt)||et(e)&&!e)return{type:r,message:jt(e)?e:"",ref:t}}var Je=e=>re(e)&&!Vt(e)?e:{value:e,message:""},jn=async(e,t,r,i,n)=>{const{ref:o,refs:a,required:s,maxLength:u,minLength:l,min:d,max:c,pattern:g,validate:f,name:p,valueAsNumber:m,mount:v,disabled:b}=e._f;if(!v||b)return{};const S=a?a[0]:o,x=T=>{i&&S.reportValidity&&(S.setCustomValidity(et(T)?"":T||""),S.reportValidity())},P={},L=Qr(o),D=Ot(o),M=L||D,_=(m||zr(o))&&X(o.value)&&X(t)||Ut(o)&&o.value===""||t===""||Array.isArray(t)&&!t.length,F=Ha.bind(null,p,r,P),B=(T,I,$,U=Ne.maxLength,J=Ne.minLength)=>{const W=T?I:$;P[p]={type:T?U:J,message:W,ref:o,...F(T?U:J,W)}};if(n?!Array.isArray(t)||!t.length:s&&(!M&&(_||ue(t))||et(t)&&!t||D&&!Gi(a).isValid||L&&!zi(a).isValid)){const{value:T,message:I}=jt(s)?{value:!!s,message:s}:Je(s);if(T&&(P[p]={type:Ne.required,message:I,ref:S,...F(Ne.required,I)},!r))return x(I),P}if(!_&&(!ue(d)||!ue(c))){let T,I;const $=Je(c),U=Je(d);if(!ue(t)&&!isNaN(t)){const J=o.valueAsNumber||t&&+t;ue($.value)||(T=J>$.value),ue(U.value)||(I=J<U.value)}else{const J=o.valueAsDate||new Date(t),W=ne=>new Date(new Date().toDateString()+" "+ne),z=o.type=="time",H=o.type=="week";we($.value)&&t&&(T=z?W(t)>W($.value):H?t>$.value:J>new Date($.value)),we(U.value)&&t&&(I=z?W(t)<W(U.value):H?t<U.value:J<new Date(U.value))}if((T||I)&&(B(!!T,$.message,U.message,Ne.max,Ne.min),!r))return x(P[p].message),P}if((u||l)&&!_&&(we(t)||n&&Array.isArray(t))){const T=Je(u),I=Je(l),$=!ue(T.value)&&t.length>T.value,U=!ue(I.value)&&t.length<I.value;if(($||U)&&(B($,T.message,I.message),!r))return x(P[p].message),P}if(g&&!_&&we(t)){const{value:T,message:I}=Je(g);if(Vt(T)&&!t.match(T)&&(P[p]={type:Ne.pattern,message:I,ref:o,...F(Ne.pattern,I)},!r))return x(I),P}if(f){if(tt(f)){const T=await f(t),I=Fn(T,S);if(I&&(P[p]={...I,...F(Ne.validate,I.message)},!r))return x(I.message),P}else if(re(f)){let T={};for(const I in f){if(!fe(T)&&!r)break;const $=Fn(await f[I](t),S,I);$&&(T={...$,...F(I,$.message)},x($.message),r&&(P[p]=T))}if(!fe(T)&&(P[p]={ref:S,...T},!r))return P}}return x(!0),P};function Ka(e,t){const r=t.slice(0,-1).length;let i=0;for(;i<r;)e=X(e)?i++:e[t[i++]];return e}function Ya(e){for(const t in e)if(!X(e[t]))return!1;return!0}function se(e,t){const r=Gr(t)?[t]:Yi(t),i=r.length==1?e:Ka(e,r),n=r[r.length-1];let o;i&&delete i[n];for(let a=0;a<r.slice(0,-1).length;a++){let s=-1,u;const l=r.slice(0,-(a+1)),d=l.length-1;for(a>0&&(o=e);++s<l.length;){const c=l[s];u=u?u[c]:e[c],d===s&&(re(u)&&fe(u)||Array.isArray(u)&&Ya(u))&&(o?delete o[c]:delete e[c]),o=u}}return e}function mr(){let e=[];return{get observers(){return e},next:n=>{for(const o of e)o.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(o=>o!==n)}}),unsubscribe:()=>{e=[]}}}var Bt=e=>ue(e)||!Wi(e);function He(e,t){if(Bt(e)||Bt(t))return e===t;if(Xe(e)&&Xe(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const n of r){const o=e[n];if(!i.includes(n))return!1;if(n!=="ref"){const a=t[n];if(Xe(o)&&Xe(a)||re(o)&&re(a)||Array.isArray(o)&&Array.isArray(a)?!He(o,a):o!==a)return!1}}return!0}var Qi=e=>e.type==="select-multiple",Ga=e=>Qr(e)||Ot(e),vr=e=>Ut(e)&&e.isConnected,qi=e=>{for(const t in e)if(tt(e[t]))return!0;return!1};function Ht(e,t={}){const r=Array.isArray(e);if(re(e)||r)for(const i in e)Array.isArray(e[i])||re(e[i])&&!qi(e[i])?(t[i]=Array.isArray(e[i])?[]:{},Ht(e[i],t[i])):ue(e[i])||(t[i]=!0);return t}function Ji(e,t,r){const i=Array.isArray(e);if(re(e)||i)for(const n in e)Array.isArray(e[n])||re(e[n])&&!qi(e[n])?X(t)||Bt(r[n])?r[n]=Array.isArray(e[n])?Ht(e[n],[]):{...Ht(e[n])}:Ji(e[n],ue(t)?{}:t[n],r[n]):He(e[n],t[n])?delete r[n]:r[n]=!0;return r}var yr=(e,t)=>Ji(e,t,Ht(t)),Zi=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:i})=>X(e)?e:t?e===""?NaN:e&&+e:r&&we(e)?new Date(e):i?i(e):e;function br(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return zr(t)?t.files:Qr(t)?zi(e.refs).value:Qi(t)?[...t.selectedOptions].map(({value:r})=>r):Ot(t)?Gi(e.refs).value:Zi(X(t.value)?e.ref.value:t.value,e)}var za=(e,t,r,i)=>{const n={};for(const o of e){const a=N(t,o);a&&Q(n,o,a._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:i}},ut=e=>X(e)?e:Vt(e)?e.source:re(e)?Vt(e.value)?e.value.source:e.value:e,Qa=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Dn(e,t,r){const i=N(e,r);if(i||Gr(r))return{error:i,name:r};const n=r.split(".");for(;n.length;){const o=n.join("."),a=N(t,o),s=N(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(s&&s.type)return{name:o,error:s};n.pop()}return{name:r}}var qa=(e,t,r,i,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(t||e):(r?i.isOnBlur:n.isOnBlur)?!e:(r?i.isOnChange:n.isOnChange)?e:!0,Ja=(e,t)=>!wt(N(e,t)).length&&se(e,t);const Za={mode:me.onSubmit,reValidateMode:me.onChange,shouldFocusError:!0};function Xa(e={},t){let r={...Za,...e};const i=e.resetOptions&&e.resetOptions.keepDirtyValues;let n={submitCount:0,isDirty:!1,isLoading:!0,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},a=re(r.defaultValues)?Ue(r.defaultValues)||{}:{},s=r.shouldUnregister?{}:Ue(a),u={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},d,c=0;const g={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={watch:mr(),array:mr(),state:mr()},p=kn(r.mode),m=kn(r.reValidateMode),v=r.criteriaMode===me.all,b=h=>O=>{clearTimeout(c),c=window.setTimeout(h,O)},S=async()=>{if(g.isValid){const h=r.resolver?fe((await F()).errors):await T(o,!0);h!==n.isValid&&(n.isValid=h,f.state.next({isValid:h}))}},x=h=>g.isValidating&&f.state.next({isValidating:h}),P=(h,O=[],E,A,k=!0,C=!0)=>{if(A&&E){if(u.action=!0,C&&Array.isArray(N(o,h))){const R=E(N(o,h),A.argA,A.argB);k&&Q(o,h,R)}if(C&&Array.isArray(N(n.errors,h))){const R=E(N(n.errors,h),A.argA,A.argB);k&&Q(n.errors,h,R),Ja(n.errors,h)}if(g.touchedFields&&C&&Array.isArray(N(n.touchedFields,h))){const R=E(N(n.touchedFields,h),A.argA,A.argB);k&&Q(n.touchedFields,h,R)}g.dirtyFields&&(n.dirtyFields=yr(a,s)),f.state.next({name:h,isDirty:$(h,O),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Q(s,h,O)},L=(h,O)=>{Q(n.errors,h,O),f.state.next({errors:n.errors})},D=(h,O,E,A)=>{const k=N(o,h);if(k){const C=N(s,h,X(E)?N(a,h):E);X(C)||A&&A.defaultChecked||O?Q(s,h,O?C:br(k._f)):W(h,C),u.mount&&S()}},M=(h,O,E,A,k)=>{let C=!1,R=!1;const Z={name:h};if(!E||A){g.isDirty&&(R=n.isDirty,n.isDirty=Z.isDirty=$(),C=R!==Z.isDirty);const q=He(N(a,h),O);R=N(n.dirtyFields,h),q?se(n.dirtyFields,h):Q(n.dirtyFields,h,!0),Z.dirtyFields=n.dirtyFields,C=C||g.dirtyFields&&R!==!q}if(E){const q=N(n.touchedFields,h);q||(Q(n.touchedFields,h,E),Z.touchedFields=n.touchedFields,C=C||g.touchedFields&&q!==E)}return C&&k&&f.state.next(Z),C?Z:{}},_=(h,O,E,A)=>{const k=N(n.errors,h),C=g.isValid&&et(O)&&n.isValid!==O;if(e.delayError&&E?(d=b(()=>L(h,E)),d(e.delayError)):(clearTimeout(c),d=null,E?Q(n.errors,h,E):se(n.errors,h)),(E?!He(k,E):k)||!fe(A)||C){const R={...A,...C&&et(O)?{isValid:O}:{},errors:n.errors,name:h};n={...n,...R},f.state.next(R)}x(!1)},F=async h=>await r.resolver(s,r.context,za(h||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),B=async h=>{const{errors:O}=await F();if(h)for(const E of h){const A=N(O,E);A?Q(n.errors,E,A):se(n.errors,E)}else n.errors=O;return O},T=async(h,O,E={valid:!0})=>{for(const A in h){const k=h[A];if(k){const{_f:C,...R}=k;if(C){const Z=l.array.has(C.name),q=await jn(k,N(s,C.name),v,r.shouldUseNativeValidation,Z);if(q[C.name]&&(E.valid=!1,O))break;!O&&(N(q,C.name)?Z?Wa(n.errors,q,C.name):Q(n.errors,C.name,q[C.name]):se(n.errors,C.name))}R&&await T(R,O,E)}}return E.valid},I=()=>{for(const h of l.unMount){const O=N(o,h);O&&(O._f.refs?O._f.refs.every(E=>!vr(E)):!vr(O._f.ref))&&Ce(h)}l.unMount=new Set},$=(h,O)=>(h&&O&&Q(s,h,O),!He(ce(),a)),U=(h,O,E)=>Va(h,l,{...u.mount?s:X(O)?a:we(h)?{[h]:O}:O},E,O),J=h=>wt(N(u.mount?s:a,h,e.shouldUnregister?N(a,h,[]):[])),W=(h,O,E={})=>{const A=N(o,h);let k=O;if(A){const C=A._f;C&&(!C.disabled&&Q(s,h,Zi(O,C)),k=Ut(C.ref)&&ue(O)?"":O,Qi(C.ref)?[...C.ref.options].forEach(R=>R.selected=k.includes(R.value)):C.refs?Ot(C.ref)?C.refs.length>1?C.refs.forEach(R=>(!R.defaultChecked||!R.disabled)&&(R.checked=Array.isArray(k)?!!k.find(Z=>Z===R.value):k===R.value)):C.refs[0]&&(C.refs[0].checked=!!k):C.refs.forEach(R=>R.checked=R.value===k):zr(C.ref)?C.ref.value="":(C.ref.value=k,C.ref.type||f.watch.next({name:h})))}(E.shouldDirty||E.shouldTouch)&&M(h,k,E.shouldTouch,E.shouldDirty,!0),E.shouldValidate&&K(h)},z=(h,O,E)=>{for(const A in O){const k=O[A],C=`${h}.${A}`,R=N(o,C);(l.array.has(h)||!Bt(k)||R&&!R._f)&&!Xe(k)?z(C,k,E):W(C,k,E)}},H=(h,O,E={})=>{const A=N(o,h),k=l.array.has(h),C=Ue(O);Q(s,h,C),k?(f.array.next({name:h,values:s}),(g.isDirty||g.dirtyFields)&&E.shouldDirty&&(n.dirtyFields=yr(a,s),f.state.next({name:h,dirtyFields:n.dirtyFields,isDirty:$(h,C)}))):A&&!A._f&&!ue(C)?z(h,C,E):W(h,C,E),Tn(h,l)&&f.state.next({}),f.watch.next({name:h}),!u.mount&&t()},ne=async h=>{const O=h.target;let E=O.name;const A=N(o,E),k=()=>O.type?br(A._f):Fa(h);if(A){let C,R;const Z=k(),q=h.type===Nn.BLUR||h.type===Nn.FOCUS_OUT,qo=!Qa(A._f)&&!r.resolver&&!N(n.errors,E)&&!A._f.deps||qa(q,N(n.touchedFields,E),n.isSubmitted,m,p),dr=Tn(E,l,q);Q(s,E,Z),q?(A._f.onBlur&&A._f.onBlur(h),d&&d(0)):A._f.onChange&&A._f.onChange(h);const gr=M(E,Z,q,!1),Jo=!fe(gr)||dr;if(!q&&f.watch.next({name:E,type:h.type}),qo)return g.isValid&&S(),Jo&&f.state.next({name:E,...dr?{}:gr});if(!q&&dr&&f.state.next({}),x(!0),r.resolver){const{errors:sn}=await F([E]),Zo=Dn(n.errors,o,E),un=Dn(sn,o,Zo.name||E);C=un.error,E=un.name,R=fe(sn)}else C=(await jn(A,N(s,E),v,r.shouldUseNativeValidation))[E],C?R=!1:g.isValid&&(R=await T(o,!0));A._f.deps&&K(A._f.deps),_(E,R,C,gr)}},K=async(h,O={})=>{let E,A;const k=hr(h);if(x(!0),r.resolver){const C=await B(X(h)?h:k);E=fe(C),A=h?!k.some(R=>N(C,R)):E}else h?(A=(await Promise.all(k.map(async C=>{const R=N(o,C);return await T(R&&R._f?{[C]:R}:R)}))).every(Boolean),!(!A&&!n.isValid)&&S()):A=E=await T(o);return f.state.next({...!we(h)||g.isValid&&E!==n.isValid?{}:{name:h},...r.resolver||!h?{isValid:E}:{},errors:n.errors,isValidating:!1}),O.shouldFocus&&!A&&Rr(o,C=>C&&N(n.errors,C),h?k:l.mount),A},ce=h=>{const O={...a,...u.mount?s:{}};return X(h)?O:we(h)?N(O,h):h.map(E=>N(O,E))},At=(h,O)=>({invalid:!!N((O||n).errors,h),isDirty:!!N((O||n).dirtyFields,h),isTouched:!!N((O||n).touchedFields,h),error:N((O||n).errors,h)}),fr=h=>{h?hr(h).forEach(O=>se(n.errors,O)):n.errors={},f.state.next({errors:n.errors})},Me=(h,O,E)=>{const A=(N(o,h,{_f:{}})._f||{}).ref;Q(n.errors,h,{...O,ref:A}),f.state.next({name:h,errors:n.errors,isValid:!1}),E&&E.shouldFocus&&A&&A.focus&&A.focus()},Nt=(h,O)=>tt(h)?f.watch.subscribe({next:E=>h(U(void 0,O),E)}):U(h,O,!0),Ce=(h,O={})=>{for(const E of h?hr(h):l.mount)l.mount.delete(E),l.array.delete(E),N(o,E)&&(O.keepValue||(se(o,E),se(s,E)),!O.keepError&&se(n.errors,E),!O.keepDirty&&se(n.dirtyFields,E),!O.keepTouched&&se(n.touchedFields,E),!r.shouldUnregister&&!O.keepDefaultValue&&se(a,E));f.watch.next({}),f.state.next({...n,...O.keepDirty?{isDirty:$()}:{}}),!O.keepIsValid&&S()},Le=(h,O={})=>{let E=N(o,h);const A=et(O.disabled);return Q(o,h,{...E||{},_f:{...E&&E._f?E._f:{ref:{name:h}},name:h,mount:!0,...O}}),l.mount.add(h),E?A&&Q(s,h,O.disabled?void 0:N(s,h,br(E._f))):D(h,!0,O.value),{...A?{disabled:O.disabled}:{},...r.shouldUseNativeValidation?{required:!!O.required,min:ut(O.min),max:ut(O.max),minLength:ut(O.minLength),maxLength:ut(O.maxLength),pattern:ut(O.pattern)}:{},name:h,onChange:ne,onBlur:ne,ref:k=>{if(k){Le(h,O),E=N(o,h);const C=X(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,R=Ga(C),Z=E._f.refs||[];if(R?Z.find(q=>q===C):C===E._f.ref)return;Q(o,h,{_f:{...E._f,...R?{refs:[...Z.filter(vr),C,...Array.isArray(N(a,h))?[{}]:[]],ref:{type:C.type,name:h}}:{ref:C}}}),D(h,!1,void 0,C)}else E=N(o,h,{}),E._f&&(E._f.mount=!1),(r.shouldUnregister||O.shouldUnregister)&&!(Da(l.array,h)&&u.action)&&l.unMount.add(h)}}},Ge=()=>r.shouldFocusError&&Rr(o,h=>h&&N(n.errors,h),l.mount),kt=(h,O)=>async E=>{E&&(E.preventDefault&&E.preventDefault(),E.persist&&E.persist());let A=!0,k=Ue(s);f.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:C,values:R}=await F();n.errors=C,k=R}else await T(o);fe(n.errors)?(f.state.next({errors:{},isSubmitting:!0}),await h(k,E)):(O&&await O({...n.errors},E),Ge())}catch(C){throw A=!1,C}finally{n.isSubmitted=!0,f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fe(n.errors)&&A,submitCount:n.submitCount+1,errors:n.errors})}},at=(h,O={})=>{N(o,h)&&(X(O.defaultValue)?H(h,N(a,h)):(H(h,O.defaultValue),Q(a,h,O.defaultValue)),O.keepTouched||se(n.touchedFields,h),O.keepDirty||(se(n.dirtyFields,h),n.isDirty=O.defaultValue?$(h,N(a,h)):$()),O.keepError||(se(n.errors,h),g.isValid&&S()),f.state.next({...n}))},Ae=(h,O={})=>{const E=h||a,A=Ue(E),k=h&&!fe(h)?A:a;if(O.keepDefaultValues||(a=E),!O.keepValues){if(O.keepDirtyValues||i)for(const C of l.mount)N(n.dirtyFields,C)?Q(k,C,N(s,C)):H(C,N(k,C));else{if(Yr&&X(h))for(const C of l.mount){const R=N(o,C);if(R&&R._f){const Z=Array.isArray(R._f.refs)?R._f.refs[0]:R._f.ref;if(Ut(Z)){const q=Z.closest("form");if(q){q.reset();break}}}}o={}}s=e.shouldUnregister?O.keepDefaultValues?Ue(a):{}:A,f.array.next({values:k}),f.watch.next({values:k})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!u.mount&&t(),u.mount=!g.isValid||!!O.keepIsValid,u.watch=!!e.shouldUnregister,f.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:O.keepDirty||O.keepDirtyValues?n.isDirty:!!(O.keepDefaultValues&&!He(h,a)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:O.keepDirty||O.keepDirtyValues?n.dirtyFields:O.keepDefaultValues&&h?yr(a,h):{},touchedFields:O.keepTouched?n.touchedFields:{},errors:O.keepErrors?n.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},ze=(h,O)=>Ae(tt(h)?h(s):h,O),Tt=(h,O={})=>{const E=N(o,h),A=E&&E._f;if(A){const k=A.refs?A.refs[0]:A.ref;k.focus&&(k.focus(),O.shouldSelect&&k.select())}};return tt(r.defaultValues)&&r.defaultValues().then(h=>{ze(h,r.resetOptions),f.state.next({isLoading:!1})}),{control:{register:Le,unregister:Ce,getFieldState:At,_executeSchema:F,_focusError:Ge,_getWatch:U,_getDirty:$,_updateValid:S,_removeUnmounted:I,_updateFieldArray:P,_getFieldArray:J,_reset:Ae,_subjects:f,_proxyFormState:g,get _fields(){return o},get _formValues(){return s},get _stateFlags(){return u},set _stateFlags(h){u=h},get _defaultValues(){return a},get _names(){return l},set _names(h){l=h},get _formState(){return n},set _formState(h){n=h},get _options(){return r},set _options(h){r={...r,...h}}},trigger:K,register:Le,handleSubmit:kt,watch:Nt,setValue:H,getValues:ce,reset:ze,resetField:at,clearErrors:fr,unregister:Ce,setError:Me,setFocus:Tt,getFieldState:At}}function es(e={}){const t=j.default.useRef(),[r,i]=j.default.useState({isDirty:!1,isValidating:!1,isLoading:!0,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:tt(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Xa(e,()=>i(o=>({...o}))),formState:r});const n=t.current.control;return n._options=e,Ua({subject:n._subjects.state,next:o=>{$a(o,n._proxyFormState,!0)&&(n._formState={...n._formState,...o},i({...n._formState}))}}),j.default.useEffect(()=>{n._stateFlags.mount||(n._proxyFormState.isValid&&n._updateValid(),n._stateFlags.mount=!0),n._stateFlags.watch&&(n._stateFlags.watch=!1,n._subjects.state.next({})),n._removeUnmounted()}),j.default.useEffect(()=>{e.values&&!He(e.values,n._defaultValues)&&n._reset(e.values,n._options.resetOptions)},[e.values,n]),j.default.useEffect(()=>{r.submitCount&&n._focusError()},[n,r.submitCount]),t.current.formState=Ma(r,n),t.current}var Xi=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(Xi||{}),qr=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(qr||{}),ve=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(ve||{});const ts=(e,t,r)=>{if(e==="selected"||e==="filter")return[];if(r[t]===e)return[r];let i=to(e,t,r.items);return i!=null&&i.length||(i=eo(e,t,r.items),i.length),i},eo=(e,t,r)=>{const i=rs(r),n=to(e,t,i);return n!=null&&n.length?n:i!=null&&i.length?eo(e,t,i):[]},rs=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},to=(e,t,r)=>{let i=[];return Array.isArray(r)&&(i=r.filter(n=>{if(n&&n[t]===e)return!0})),i},ns=(e,t,r,i)=>{const n=ts(t,r,i),o=is(e,n).filter(a=>a!==null&&typeof a!="undefined");return o.length?o[0]:null},is=(e,t)=>{let r=[];return Array.isArray(t)&&t.length&&(r=t.map(i=>os(e,i))),r},os=(e,t)=>{if(t.id===e)return t;let r=no(e,t.items);return r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):(r=ro(e,t.items),r.length?(r.length>1&&console.error(`More than one ${e} in context ${t.id}`),r[0]):null)},ro=(e,t)=>{const r=as(t),i=no(e,r);return i!=null&&i.length?i:r!=null&&r.length?ro(e,r):[]},as=e=>{let t=[];return Array.isArray(e)&&(t=e.map(r=>{if(Array.isArray(r==null?void 0:r.items))return r.items}).filter(r=>r!==void 0)),t.flat(1)},no=(e,t)=>Array.isArray(t)?t.filter(i=>{if(i&&i.id===e)return!0}):[],Jr=(e,t)=>{let r=0;for(const[i,n]of Object.entries(e))if(n){for(const[o,a]of Object.entries(n))if(a){const s=ns(o,i,Xi.SELECT,t);s&&(s==null?void 0:s.price)&&(r+=parseFloat(s.price)*a)}}return r},io=e=>{const{price:t,state:{selected:r}={}}=e;return(!t||parseFloat(t||"1")===0)&&r?`${Jr(r,e)||"0"}`:t},ss=["id","selCtx","fltCtx"],oo=".",ao="#dot",us=e=>e.replaceAll(oo,ao),ls=e=>e.replaceAll(ao,oo),cs=(e,t)=>so(e,t,us),fs=(e,t)=>so(e,t,ls),so=(e,t,r)=>{let i=t;if(ss.includes(e)&&(typeof t=="string"||t instanceof String)&&(i=r(t)),e==="selected"||e==="filter"){const n=JSON.stringify(t),o=r(n);i=JSON.parse(o)}return i},uo=(e,t)=>(Object.keys(e).forEach(r=>{const i=e[r];e[r]=t(r,i),typeof i=="object"&&i!==null&&uo(i,t)}),e),ds=e=>{const t=JSON.parse(JSON.stringify(e));for(const[r,i]of Object.entries(t))if(i&&!Array.isArray(i)){const n=t[r];for(const[o,a]of Object.entries(n))a===!1&&delete n[o];Object.keys(n).length===0&&delete t[r]}else delete t[r];return t},gs=e=>fs("selected",e),ps=e=>e==="true"||e===!0,hs=e=>{const t=document.getElementById(e);t?t.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},lo=e=>`options--${e}`,co=e=>{const{details:{media:t=[]}={}}=e,r=t.find(i=>i.name==="MAIN_IMG")||t[0]||{};return(r==null?void 0:r.url)||""},_n=e=>{var r,i;return!(((r=e==null?void 0:e.attrs)==null?void 0:r.hidden)===!0||((i=e==null?void 0:e._)==null?void 0:i.hidden)==="true")};function ms(e){let t;const r=new Set,i=(l,d)=>{const c=typeof l=="function"?l(t):l;if(c!==t){const g=t;t=d?c:Object.assign({},t,c),r.forEach(f=>f(t,g))}},n=()=>t,o=(l,d=n,c=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let g=d(t);function f(){const p=d(t);if(!c(g,p)){const m=g;l(g=p,m)}}return r.add(f),()=>r.delete(f)},u={setState:i,getState:n,subscribe:(l,d,c)=>d||c?o(l,d,c):(r.add(l),()=>r.delete(l)),destroy:()=>r.clear()};return t=e(i,n,u),u}const vs=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Mn=vs?y.useEffect:y.useLayoutEffect;function ys(e){const t=typeof e=="function"?ms(e):e,r=(i=t.getState,n=Object.is)=>{const[,o]=y.useReducer(v=>v+1,0),a=t.getState(),s=y.useRef(a),u=y.useRef(i),l=y.useRef(n),d=y.useRef(!1),c=y.useRef();c.current===void 0&&(c.current=i(a));let g,f=!1;(s.current!==a||u.current!==i||l.current!==n||d.current)&&(g=i(a),f=!n(c.current,g)),Mn(()=>{f&&(c.current=g),s.current=a,u.current=i,l.current=n,d.current=!1});const p=y.useRef(a);Mn(()=>{const v=()=>{try{const S=t.getState(),x=u.current(S);l.current(c.current,x)||(s.current=S,c.current=x,o())}catch{d.current=!0,o()}},b=t.subscribe(v);return t.getState()!==p.current&&v(),b},[]);const m=f?g:c.current;return y.useDebugValue(m),m};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const i=[r,t];return{next(){const n=i.length<=0;return{value:i.shift(),done:n}}}},r}const bs=e=>({filter:{},initialSelected:{},setInitialFilter:t=>{e(()=>({filter:{...t}}))},setInitialSelected:t=>{e(()=>({initialSelected:t}))},setFilter:(t,r)=>{e(({filter:i})=>({filter:{...i,[t]:{...i[t],...r}}}))}});var Ss=typeof global=="object"&&global&&global.Object===Object&&global,fo=Ss,Os=typeof self=="object"&&self&&self.Object===Object&&self,ws=fo||Os||Function("return this")(),_e=ws,Es=_e.Symbol,Wt=Es,go=Object.prototype,xs=go.hasOwnProperty,Ps=go.toString,lt=Wt?Wt.toStringTag:void 0;function Cs(e){var t=xs.call(e,lt),r=e[lt];try{e[lt]=void 0;var i=!0}catch{}var n=Ps.call(e);return i&&(t?e[lt]=r:delete e[lt]),n}var As=Object.prototype,Ns=As.toString;function ks(e){return Ns.call(e)}var Ts="[object Null]",Rs="[object Undefined]",$n=Wt?Wt.toStringTag:void 0;function nt(e){return e==null?e===void 0?Rs:Ts:$n&&$n in Object(e)?Cs(e):ks(e)}function Xt(e){return e!=null&&typeof e=="object"}var Ls="[object Symbol]";function Is(e){return typeof e=="symbol"||Xt(e)&&nt(e)==Ls}var Fs=Array.isArray,js=Fs,Ds=/\s/;function _s(e){for(var t=e.length;t--&&Ds.test(e.charAt(t)););return t}var Ms=/^\s+/;function $s(e){return e&&e.slice(0,_s(e)+1).replace(Ms,"")}function Kt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Un=0/0,Us=/^[-+]0x[0-9a-f]+$/i,Vs=/^0b[01]+$/i,Bs=/^0o[0-7]+$/i,Hs=parseInt;function po(e){if(typeof e=="number")return e;if(Is(e))return Un;if(Kt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$s(e);var r=Vs.test(e);return r||Bs.test(e)?Hs(e.slice(2),r?2:8):Us.test(e)?Un:+e}var Vn=1/0,Ws=17976931348623157e292;function Bn(e){if(!e)return e===0?e:0;if(e=po(e),e===Vn||e===-Vn){var t=e<0?-1:1;return t*Ws}return e===e?e:0}var Ks="[object AsyncFunction]",Ys="[object Function]",Gs="[object GeneratorFunction]",zs="[object Proxy]";function ho(e){if(!Kt(e))return!1;var t=nt(e);return t==Ys||t==Gs||t==Ks||t==zs}var Qs=_e["__core-js_shared__"],Sr=Qs,Hn=function(){var e=/[^.]+$/.exec(Sr&&Sr.keys&&Sr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function qs(e){return!!Hn&&Hn in e}var Js=Function.prototype,Zs=Js.toString;function Ye(e){if(e!=null){try{return Zs.call(e)}catch{}try{return e+""}catch{}}return""}var Xs=/[\\^$.*+?()[\]{}|]/g,eu=/^\[object .+?Constructor\]$/,tu=Function.prototype,ru=Object.prototype,nu=tu.toString,iu=ru.hasOwnProperty,ou=RegExp("^"+nu.call(iu).replace(Xs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function au(e){if(!Kt(e)||qs(e))return!1;var t=ho(e)?ou:eu;return t.test(Ye(e))}function su(e,t){return e==null?void 0:e[t]}function Et(e,t){var r=su(e,t);return au(r)?r:void 0}var uu=Et(_e,"WeakMap"),Lr=uu,lu=9007199254740991;function mo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lu}function cu(e){return e!=null&&mo(e.length)&&!ho(e)}var fu=Object.prototype;function vo(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fu;return e===r}var du="[object Arguments]";function Wn(e){return Xt(e)&&nt(e)==du}var yo=Object.prototype,gu=yo.hasOwnProperty,pu=yo.propertyIsEnumerable,hu=Wn(function(){return arguments}())?Wn:function(e){return Xt(e)&&gu.call(e,"callee")&&!pu.call(e,"callee")},mu=hu;function vu(){return!1}var bo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Kn=bo&&typeof module=="object"&&module&&!module.nodeType&&module,yu=Kn&&Kn.exports===bo,Yn=yu?_e.Buffer:void 0,bu=Yn?Yn.isBuffer:void 0,Su=bu||vu,Ou=Su,wu="[object Arguments]",Eu="[object Array]",xu="[object Boolean]",Pu="[object Date]",Cu="[object Error]",Au="[object Function]",Nu="[object Map]",ku="[object Number]",Tu="[object Object]",Ru="[object RegExp]",Lu="[object Set]",Iu="[object String]",Fu="[object WeakMap]",ju="[object ArrayBuffer]",Du="[object DataView]",_u="[object Float32Array]",Mu="[object Float64Array]",$u="[object Int8Array]",Uu="[object Int16Array]",Vu="[object Int32Array]",Bu="[object Uint8Array]",Hu="[object Uint8ClampedArray]",Wu="[object Uint16Array]",Ku="[object Uint32Array]",G={};G[_u]=G[Mu]=G[$u]=G[Uu]=G[Vu]=G[Bu]=G[Hu]=G[Wu]=G[Ku]=!0;G[wu]=G[Eu]=G[ju]=G[xu]=G[Du]=G[Pu]=G[Cu]=G[Au]=G[Nu]=G[ku]=G[Tu]=G[Ru]=G[Lu]=G[Iu]=G[Fu]=!1;function Yu(e){return Xt(e)&&mo(e.length)&&!!G[nt(e)]}function Gu(e){return function(t){return e(t)}}var So=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vt=So&&typeof module=="object"&&module&&!module.nodeType&&module,zu=vt&&vt.exports===So,Or=zu&&fo.process,Qu=function(){try{var e=vt&&vt.require&&vt.require("util").types;return e||Or&&Or.binding&&Or.binding("util")}catch{}}(),Gn=Qu,zn=Gn&&Gn.isTypedArray,qu=zn?Gu(zn):Yu,Ju=qu;function Zu(e,t){return function(r){return e(t(r))}}var Xu=Zu(Object.keys,Object),el=Xu,tl=Object.prototype,rl=tl.hasOwnProperty;function nl(e){if(!vo(e))return el(e);var t=[];for(var r in Object(e))rl.call(e,r)&&r!="constructor"&&t.push(r);return t}var il=Et(_e,"Map"),Ir=il,ol=Et(_e,"DataView"),Fr=ol,al=Et(_e,"Promise"),jr=al,sl=Et(_e,"Set"),Dr=sl,Qn="[object Map]",ul="[object Object]",qn="[object Promise]",Jn="[object Set]",Zn="[object WeakMap]",Xn="[object DataView]",ll=Ye(Fr),cl=Ye(Ir),fl=Ye(jr),dl=Ye(Dr),gl=Ye(Lr),Ve=nt;(Fr&&Ve(new Fr(new ArrayBuffer(1)))!=Xn||Ir&&Ve(new Ir)!=Qn||jr&&Ve(jr.resolve())!=qn||Dr&&Ve(new Dr)!=Jn||Lr&&Ve(new Lr)!=Zn)&&(Ve=function(e){var t=nt(e),r=t==ul?e.constructor:void 0,i=r?Ye(r):"";if(i)switch(i){case ll:return Xn;case cl:return Qn;case fl:return qn;case dl:return Jn;case gl:return Zn}return t});var pl=Ve,hl=Math.max,ml=Math.min;function vl(e,t,r){return e>=ml(t,r)&&e<hl(t,r)}function ei(e,t,r){return t=Bn(t),r===void 0?(r=t,t=0):r=Bn(r),e=po(e),vl(e,t,r)}var yl="[object Map]",bl="[object Set]",Sl=Object.prototype,Ol=Sl.hasOwnProperty;function er(e){if(e==null)return!0;if(cu(e)&&(js(e)||typeof e=="string"||typeof e.splice=="function"||Ou(e)||Ju(e)||mu(e)))return!e.length;var t=pl(e);if(t==yl||t==bl)return!e.size;if(vo(e))return!nl(e).length;for(var r in e)if(Ol.call(e,r))return!1;return!0}const wl=(e,t)=>{var n;const{selCtx:r}=e;return((n=t==null?void 0:t[r])==null?void 0:n.parentKind)===qr.PRODUCT?Yt(e,t,"isSelCntAllowedToIncrement"):Yt(e,t,"isSelCntAllowedToIncrement")&&Oo(e,t,"isSelCntAllowedToIncrement")},El=(e,t,r)=>{var o;const{selCtx:i}=e;return((o=r==null?void 0:r[i])==null?void 0:o.parentKind)===qr.PRODUCT?ti(e,t)&&Yt(e,r,"isQtyCntAllowedToIncrement"):ti(e,t)&&Yt(e,r,"isQtyCntAllowedToIncrement")&&Oo(e,r,"isQtyCntAllowedToIncrement")},ti=(e,t)=>{const{attrs:{qtyMax:r}={}}=e;return Number(t)<Number(r||Number.MAX_SAFE_INTEGER)},Yt=(e,t,r)=>{var o;const{selCtx:i}=e,n=(o=t==null?void 0:t[i])==null?void 0:o[r];return wo(n)?!0:n},Oo=(e,t,r)=>{var s;const{selCtx:i}=e,n=(s=t==null?void 0:t[i])==null?void 0:s.parentSelCtx,o=t==null?void 0:t[n],a=o==null?void 0:o[r];return wo(a)?!0:a},wo=e=>typeof e=="undefined",xl=(e,t,r)=>{const i=t[e];let n=0,o=0;if(i)for(const[,a]of Object.entries(i))parseInt(a)>0&&(n+=1,o+=Number(a));else r&&r.forEach(a=>{if(t[a.selCtx])for(const[,s]of Object.entries(t[a.selCtx]))parseInt(s)>0&&(n+=1,o+=Number(s))});return[n,o]},Pl=(e,t)=>{var n;const{id:r,selCtx:i}=e;return Number(((n=t==null?void 0:t[i])==null?void 0:n[r])||0)},Cl=(e,t)=>({validationMap:{},isOnSubmitted:!1,refreshFormDt:"",setInitialValidate:()=>{e(()=>({validationMap:{},isOnSubmitted:!1}))},setValidationMap:r=>{const{productSelCtx:i,attrs:n,actualSelCnt:o,actualQtyCnt:a,isPassedFiltering:s,nestedLvl:u,parentSelCtx:l,parentKind:d}=r,{qtyMin:c,qtyMax:g,selMin:f,selMax:p}=n||{};(g||p)&&e(({validationMap:v})=>({validationMap:{...v,[i]:{parentSelCtx:l,isSelCntAllowedToIncrement:o<Number(p||Number.MAX_SAFE_INTEGER),isQtyCntAllowedToIncrement:a<Number(g||Number.MAX_SAFE_INTEGER),parentKind:d,nestedLvl:u,isValid:ei(o,Number(f||0),Number(p||Number.MAX_SAFE_INTEGER)+1)&&ei(a,Number(c||0),Number(g||Number.MAX_SAFE_INTEGER)+1),isPassedFiltering:s}}}))},isInputEnabled:r=>{const i=t().validationMap;return wl(r,i)},isInputCounterIncrementEnabled:(r,i)=>{const n=t().validationMap,o=Pl(r,i);return El(r,o,n)},getInvalidSelCtxArray:()=>{const r=t().validationMap,i=[];for(const[n]of Object.entries(r)){const{isValid:o,isPassedFiltering:a}=r[n];o===!1&&a===!0&&i.push(n)}return i},setIsOnSubmittedOnTrue:()=>{console.log("isOnSubmitted"),e(()=>({isOnSubmitted:!0}))},refreshForm:()=>{e(()=>({refreshFormDt:`${new Date}`}))}}),Al=(e,t)=>({expanded:{},toggleExpanded:(r,i,n)=>{const o=t().expanded[r+i+n];e(()=>({expanded:{...t().expanded,[r+i+n]:o!==void 0?!o:!1}}))},resetExpanded:()=>{e(()=>({expanded:{}}))}}),ee=ys((e,t)=>({...bs(e),...Cl(e,t),...Al(e,t)}));function Nl(e){const[t,r]=y.useState(1),i=uo(e,cs),{state:{filter:n={},selected:o={}}={}}=i,a=ee(m=>m.setInitialFilter),s=ee(m=>m.setInitialSelected),u=ee(m=>m.setInitialValidate),l=ee(m=>m.resetExpanded),d=ee(m=>m.filter),c=ee(m=>m.setIsOnSubmittedOnTrue);ee(m=>m.refreshFormDt);const g=ee(m=>m.getInvalidSelCtxArray),f=()=>{r(m=>m+1)},p=()=>{t>1&&r(m=>m-1)};return y.useEffect(()=>{u(),a(n),s(o),l()},[e]),{encodedProduct:i,initSelected:o,filter:d,setIsOnSubmittedOnTrue:c,getInvalidSelCtxArray:g,productQuantity:t,increaseProductQuantity:f,decreaseProductQuantity:p}}var ri;(function(e){e.UNINITIALIZED="UNINITIALIZED",e.PROCESSING="PROCESSING",e.PAID="PAID",e.PRINTING_RECEIPT="PRINTING_RECEIPT",e.PRINTING_RECEIPT_SUCCESS="PRINTING_RECEIPT_SUCCESS",e.SENDING_RECEIPT="SENDING_RECEIPT",e.SENDING_RECEIPT_SUCCESS="SENDING_RECEIPT_SUCCESS",e.ERROR="ERROR"})(ri||(ri={}));var ni;(function(e){e.CAROUSEL="carousel",e.NORMAL="normal",e.IMAGE="image"})(ni||(ni={}));var rt;(function(e){e.GROUP="3e/group",e.PRODUCT="3e/product",e.CATEGORY="3e/group/category",e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.STATIC="3e/static",e.REF="3e/ref",e.QUERY="3e/query"})(rt||(rt={}));var ii;(function(e){e.GROUP="group",e.PRODUCT="product"})(ii||(ii={}));var oi;(function(e){e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.DINE_IN="DINE_IN",e.DINE_IN_OPEN="DINE_IN_OPEN",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.GLOVO_TAKE_AWAY="GLOVO_TAKE_AWAY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.JUSTEAT_TAKE_AWAY="JUSTEAT_TAKE_AWAY",e.UBER_DELIVERY="UBER_DELIVERY",e.UBER_TAKE_AWAY="UBER_TAKE_AWAY",e.UBER_DINE_IN="UBER_DINE_IN",e.BOLT_DELIVERY="BOLT_DELIVERY",e.BOLT_TAKE_AWAY="BOLT_TAKE_AWAY",e.WOLT_DELIVERY="WOLT_DELIVERY",e.WOLT_TAKE_AWAY="WOLT_TAKE_AWAY",e.WOLT_DINE_IN="WOLT_DINE_IN"})(oi||(oi={}));var ai;(function(e){e.NEW="NEW",e.COMPLETED="COMPLETED",e.VERIFIED="VERIFIED",e.DELIVER="DELIVER",e.DELIVERED="DELIVERED",e.CLOSED="CLOSED",e.ABANDONED="ABANDONED",e.CANCELLED="CANCELLED",e.PICKED="PICKED"})(ai||(ai={}));var si;(function(e){e.CASH="CASH",e.CARD="CARD",e.COD="COD",e.TERMINAL="TERMINAL",e.EPAYMENT="EPAYMENT",e.COUPON="COUPON",e.WALLET="WALLET",e.PREAUTHORIZED="PREAUTHORIZED",e.RETURN="RETURN",e.EXTERNAL="EXTERNAL"})(si||(si={}));var ui;(function(e){e.KIOSK="KIOSK",e.WEB="WEB",e.JUST_EAT_TAKE_AWAY="JUSTEATTAKEAWAY",e.GLOVO="GLOVO",e.PYSZNE="PYSZNE",e.WOLT="WOLT",e.UBER="UBER",e.BOLT="BOLT"})(ui||(ui={}));var li;(function(e){e.NEW="NEW",e.TECHNICAL="TECHNICAL",e.CONFIRMED="CONFIRMED",e.PROCESSING="PROCESSING",e.PROCESSED="PROCESSED",e.VOID="VOID",e.WASTE="WASTE"})(li||(li={}));var ci;(function(e){e.GROUP="group",e.PRODUCT="product"})(ci||(ci={}));var fi;(function(e){e.DINE_IN="DINE_IN",e.TAKE_AWAY="TAKE_AWAY",e.DELIVERY="DELIVERY",e.GLOVO_DELIVERY="GLOVO_DELIVERY",e.JUSTEAT_DELIVERY="JUSTEAT_DELIVERY",e.UBER_DELIVERY="UBER_DELIVERY",e.BOLT_DELIVERY="BOLT_DELIVERY",e.WOLT_DELIVERY="WOLT_DELIVERY"})(fi||(fi={}));const kl=(e,t)=>{const{filter:r={},fltCtx:i=""}=e,n=t[i];return!!Object.keys(r).length&&n?Object.keys(n).filter(s=>Object.keys(r).includes(s)&&r[s].includes(n[s])).length>0:!0},Tl=(e,t)=>{const{items:r,filter:i}=e,n=[],o=[],a=s=>{s&&!er(i)&&s.forEach(u=>{const{items:l=[]}=u;t?n.push(u):o.push(u),l.length>0&&a(l)})};return a(r),{productsToSelect:n,productsToUnselect:o}},Rl=(e,t)=>{e.map(({selCtx:r,id:i})=>{t(`selected.${r}.${i}`,!1)})},Ll=(e,t,r)=>{e.map(({selCtx:i,id:n})=>{var a;const o=(a=r[i])==null?void 0:a[n];o&&t(`selected.${i}.${n}`,o.toString())})};function Il(e,t,r,i){const{selCtx:n,attrs:o={}}=e,a=ee(v=>v.filter),s=ee(v=>v.initialSelected),{setValue:u,getValues:l}=Zt(),{selected:d={}}=l(),c=kl(e,a),g=ee(v=>v.isOnSubmitted),f=ee(v=>v.setValidationMap),[p,m]=xl(e.selCtx,d,e.items);return f({productSelCtx:n,attrs:o,actualQtyCnt:m,actualSelCnt:p,nestedLvl:t,isPassedFiltering:c,parentSelCtx:i,parentKind:r}),y.useEffect(()=>{const{productsToSelect:v,productsToUnselect:b}=Tl(e,c);Rl(b,u),Ll(v,u,s)},[a]),{isFilterValidated:c,selected:d,isOnSubmitted:g,selCnt:p,qtyCnt:m}}var tr={exports:{}},xt={};/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/var di=Object.getOwnPropertySymbols,Fl=Object.prototype.hasOwnProperty,jl=Object.prototype.propertyIsEnumerable;function Dl(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function _l(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(o){n[o]=o}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}_l();/** @license React v17.0.2
|
|
7
|
+
* react-jsx-runtime.production.min.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/var Ml=j.default,Eo=60103;xt.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var gi=Symbol.for;Eo=gi("react.element"),xt.Fragment=gi("react.fragment")}var $l=Ml.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ul=Object.prototype.hasOwnProperty,Vl={key:!0,ref:!0,__self:!0,__source:!0};function xo(e,t,r){var i,n={},o=null,a=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(i in t)Ul.call(t,i)&&!Vl.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:Eo,type:e,key:o,ref:a,props:n,_owner:$l.current}}xt.jsx=xo;xt.jsxs=xo;tr.exports=xt;const w=tr.exports.jsx,V=tr.exports.jsxs,xe=tr.exports.Fragment;function pi(e){const{isOk:t,isErr:r,info:i}=e;return V("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&Bl,r&&Hl,i]})}const Bl=w("svg",{className:"w-6 h-6 text-green-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","data-testid":"form-check-mark",children:w("polyline",{points:"20 6 9 17 4 12"})}),Hl=w("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:w("path",{strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})});var Wl={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Kl={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 yt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yt=function(t){return typeof t}:yt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(e)}function hi(e){return Yl(e)||Gl(e)||zl(e)||Ql()}function Yl(e){if(Array.isArray(e))return e}function Gl(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function zl(e,t){if(!!e){if(typeof e=="string")return mi(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 mi(e,t)}}function mi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function Ql(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
14
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ql={normalizePrecision:function(t){var r=t.reduce(function(i,n){return Math.max(i.getPrecision(),n.getPrecision())});return t.map(function(i){return i.getPrecision()!==r?i.convertPrecision(r):i})},minimum:function(t){var r=hi(t),i=r[0],n=r.slice(1),o=i;return n.forEach(function(a){o=o.lessThan(a)?o:a}),o},maximum:function(t){var r=hi(t),i=r[0],n=r.slice(1),o=i;return n.forEach(function(a){o=o.greaterThan(a)?o:a}),o}};function Po(e){return!isNaN(parseInt(e))&&isFinite(e)}function Jl(e){return Po(e)&&e<=100&&e>=0}function Zl(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function vi(e){return e%2===0}function yi(e){return Po(e)&&!Number.isInteger(e)}function Xl(){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 ct(e){return Math.abs(e)%1===.5}function ec(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,i){var n=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){n.readyState===4&&(n.status>=200&&n.status<400?r(JSON.parse(n.responseText)):i(new Error(n.statusText)))},onerror:function(){i(new Error("Network error"))}});n.open("GET",e,!0),tc(n,t.headers),n.send()})}function tc(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 ht(e){return typeof e=="undefined"}function Co(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(i){if(yt(i[1])==="object"){var n=Co(i[1]);Object.entries(n).forEach(function(o){r[i[0]+t+o[0]]=o[1]})}else r[i[0]]=i[1]}),r}function rc(e){return Boolean(e)&&(yt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Ao(){var e=function(i,n){var o=function(u){return Math.pow(10,Xl(u))},a=Math.max(o(i),o(n));return Math.round(i*a)*Math.round(n*a)/(a*a)},t={HALF_ODD:function(i){var n=Math.round(i);return ct(i)&&vi(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return ct(i)?vi(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return ct(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return ct(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return ct(i)?Math.sign(i)*Math.ceil(Math.abs(i)):Math.round(i)},DOWN:function(i){return Math.floor(i)}};return{add:function(i,n){return i+n},subtract:function(i,n){return i-n},multiply:function(i,n){return yi(i)||yi(n)?e(i,n):i*n},divide:function(i,n){return i/n},modulo:function(i,n){return i%n},round:function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[n](i)}}}var nc=Ao();function ic(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(i){return!ht(i)}):[]},getMinimumFractionDigits:function(){var i=function(o){return o==="."};return ht(this.getMatches().find(i))?0:this.getMatches()[nc.add(this.getMatches().findIndex(i),1)].split("").length},getCurrencyDisplay:function(){var i={USD:"code",dollar:"name",$:"symbol"};return i[this.getMatches().find(function(n){return n==="USD"||n==="dollar"||n==="$"})]},getStyle:function(){return ht(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ht(this.getMatches().find(function(i){return i===","}))}}}function oc(e){var t=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var a in o)n=n.replace("{{".concat(a,"}}"),o[a]);return n},r=function(n,o){return ec(t(e.endpoint,{from:n,to:o}),{headers:e.headers})};return{getExchangeRate:function(n,o){return(rc(e.endpoint)?e.endpoint:r(n,o)).then(function(a){return Co(a)[t(e.propertyPath,{from:n,to:o})]})}}}function bt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function ac(e){bt(Jl(e),"You must provide a numeric value between 0 and 100.",RangeError)}function sc(e){bt(Zl(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function wr(e){bt(Number.isInteger(e),"You must provide an integer.",TypeError)}var Y=Ao(),uc=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),i=r.amount,n=r.currency,o=r.precision;wr(i),wr(o);var a=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,l=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),c=function(p){var m=Object.assign({},Object.assign({},{amount:i,currency:n,precision:o},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},g=function(p){bt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return i},getCurrency:function(){return n},getLocale:function(){return this.locale||a},setLocale:function(p){return c.call(this,{locale:p})},getPrecision:function(){return o},convertPrecision:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;wr(p);var v=this.getPrecision(),b=p>v,S=b?Y.multiply:Y.divide,x=b?[p,v]:[v,p],P=Math.pow(10,Y.subtract.apply(Y,x));return c.call(this,{amount:Y.round(S(this.getAmount(),P),m),precision:p})},add:function(p){g.call(this,p);var m=e.normalizePrecision([this,p]);return c.call(this,{amount:Y.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(p){g.call(this,p);var m=e.normalizePrecision([this,p]);return c.call(this,{amount:Y.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Y.round(Y.multiply(this.getAmount(),p),m)})},divide:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return c.call(this,{amount:Y.round(Y.divide(this.getAmount(),p),m)})},percentage:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return ac(p),this.multiply(Y.divide(p,100),m)},allocate:function(p){var m=this;sc(p);for(var v=p.reduce(function(P,L){return Y.add(P,L)}),b=this.getAmount(),S=p.map(function(P){var L=Math.floor(Y.divide(Y.multiply(m.getAmount(),P),v));return b=Y.subtract(b,L),c.call(m,{amount:L})}),x=0;b>0;)p[x]>0&&(S[x]=S[x].add(c.call(this,{amount:1})),b=Y.subtract(b,1)),x+=1;return S},convert:function(p){var m=this,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=v.endpoint,S=b===void 0?d.endpoint:b,x=v.propertyPath,P=x===void 0?d.propertyPath||"rates.{{to}}":x,L=v.headers,D=L===void 0?d.headers:L,M=v.roundingMode,_=M===void 0?u:M,F=Object.assign({},{endpoint:S,propertyPath:P,headers:D,roundingMode:_});return oc(F).getExchangeRate(this.getCurrency(),p).then(function(B){return bt(!ht(B),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),c.call(m,{amount:Y.round(Y.multiply(m.getAmount(),parseFloat(B)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){g.call(this,p);var m=e.normalizePrecision([this,p]);return m[0].getAmount()<m[1].getAmount()},lessThanOrEqual:function(p){g.call(this,p);var m=e.normalizePrecision([this,p]);return m[0].getAmount()<=m[1].getAmount()},greaterThan:function(p){g.call(this,p);var m=e.normalizePrecision([this,p]);return m[0].getAmount()>m[1].getAmount()},greaterThanOrEqual:function(p){g.call(this,p);var m=e.normalizePrecision([this,p]);return m[0].getAmount()>=m[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Y.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return Y.modulo(this.getAmount(),Math.pow(10,o))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var m=e.normalizePrecision([this,p]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,v=ic(p);return this.toRoundedUnit(v.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:v.getCurrencyDisplay(),useGrouping:v.getUseGrouping(),minimumFractionDigits:v.getMinimumFractionDigits(),style:v.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Y.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l,v=Math.pow(10,p);return Y.divide(Y.round(Y.multiply(this.toUnit(),v),m),v)},toObject:function(){return{amount:i,currency:n,precision:o}},toJSON:function(){return this.toObject()}}},lc=Object.assign(uc,Wl,Kl,ql);const Dt=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),i=Number(r)*100;return isNaN(i)?"0.00":lc({amount:Math.round(i),currency:t}).toFormat("0,0.00")},cc=(e,t,r=1)=>{const i=parseFloat(e.toString());let n=!1,o=Dt(`${r*i}`);const a=`${Dt(`${o}`)}`;return i<parseFloat(t)&&(n=!0,o=`${Dt(`${t}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:o,formattedEndPrice:a}};function rr(e){const{price:t,addPlusBefore:r=!1,size:i="md",showIfPriceZero:n=!1,minPrice:o="0.00",hiddenIfPriceZero:a=!1}=e,s=parseFloat(o),u=t>s?t:o,l=Dt(`${u}`);return!t&&n===!1?null:r?V("span",{style:{visibility:`${!t&&a?"hidden":"visible"}`},className:"",children:["\xA0",`+${l}`]}):t<s?V("span",{className:"",children:["\xA0",`od ${l}`]}):w("span",{className:"",children:l})}function fc(e,t){const{selCtx:r,id:i}=e,n=ee(s=>s.expanded),o=y.useMemo(()=>dc(r,i,t,n),[r,i,t,n]),a=ee(s=>s.toggleExpanded);return{isExpanded:o,toggleExpanded:a}}const dc=(e,t,r,i)=>{const n=i[e+t+r];return n!==void 0?n:!0};var gc=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pc={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},hc=function(t){return pc[t]},mc=function(t){return t.replace(gc,hc)};function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Si(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bi(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bi(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var _r={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:mc},No,vc=y.createContext();function yc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_r=Si(Si({},_r),e)}function bc(){return _r}var Sc=function(){function e(){de(this,e),this.usedNamespaces={}}return ge(e,[{key:"addUsedNamespaces",value:function(r){var i=this;r.forEach(function(n){i.usedNamespaces[n]||(i.usedNamespaces[n]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function Oc(e){No=e}function wc(){return No}var Ec={type:"3rdParty",init:function(t){yc(t.options.react),Oc(t)}};function xc(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Oi={};function Mr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Oi[t[0]]||(typeof t[0]=="string"&&(Oi[t[0]]=new Date),xc.apply(void 0,t))}function wi(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var i=function n(){setTimeout(function(){e.off("initialized",n)},0),r()};e.on("initialized",i)}})}function Pc(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.languages[0],n=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var a=function(u,l){var d=t.services.backendConnector.state["".concat(u,"|").concat(l)];return d===-1||d===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(i,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(i,e)&&(!n||a(o,e)))}function Cc(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Mr("i18n.languages were undefined or empty",t.languages),!0;var i=t.options.ignoreJSONStructure!==void 0;return i?t.hasLoadedNamespace(e,{precheck:function(o,a){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!a(o.isLanguageChangingTo,e))return!1}}):Pc(e,t,r)}function Ac(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=o.call(r)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(d){l=!0,n=d}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}function Nc(e,t){return Mi(e)||Ac(e,t)||$i(e,t)||Ui()}function Ei(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ei(Object(r),!0).forEach(function(i){Pe(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ei(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var kc=function(t,r){var i=y.useRef();return y.useEffect(function(){i.current=r?i.current:t},[t,r]),i.current};function Zr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,i=y.useContext(vc)||{},n=i.i18n,o=i.defaultNS,a=r||n||wc();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new Sc),!a){Mr("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}a.options.react&&a.options.react.wait!==void 0&&Mr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var l=Er(Er(Er({},bc()),a.options.react),t),d=l.useSuspense,c=l.keyPrefix,g=e||o||a.options&&a.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(g);var f=(a.isInitialized||a.initializedStoreOnce)&&g.every(function(_){return Cc(_,a,l)});function p(){return a.getFixedT(null,l.nsMode==="fallback"?g:g[0],c)}var m=y.useState(p),v=Nc(m,2),b=v[0],S=v[1],x=g.join(),P=kc(x),L=y.useRef(!0);y.useEffect(function(){var _=l.bindI18n,F=l.bindI18nStore;L.current=!0,!f&&!d&&wi(a,g,function(){L.current&&S(p)}),f&&P&&P!==x&&L.current&&S(p);function B(){L.current&&S(p)}return _&&a&&a.on(_,B),F&&a&&a.store.on(F,B),function(){L.current=!1,_&&a&&_.split(" ").forEach(function(T){return a.off(T,B)}),F&&a&&F.split(" ").forEach(function(T){return a.store.off(T,B)})}},[a,x]);var D=y.useRef(!0);y.useEffect(function(){L.current&&!D.current&&S(p),D.current=!1},[a,c]);var M=[b,a,f];if(M.t=b,M.i18n=a,M.ready=f,f||!f&&!d)return M;throw new Promise(function(_){wi(a,g,function(){_()})})}var ko=[],Tc=ko.forEach,Rc=ko.slice;function Lc(e){return Tc.call(Rc.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var xi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ic=function(t,r,i){var n=i||{};n.path=n.path||"/";var o=encodeURIComponent(r),a="".concat(t,"=").concat(o);if(n.maxAge>0){var s=n.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(n.domain){if(!xi.test(n.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(n.domain)}if(n.path){if(!xi.test(n.path))throw new TypeError("option path is invalid");a+="; Path=".concat(n.path)}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(n.expires.toUTCString())}if(n.httpOnly&&(a+="; HttpOnly"),n.secure&&(a+="; Secure"),n.sameSite){var u=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(u){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},Pi={create:function(t,r,i,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+i*60*1e3)),n&&(o.domain=n),document.cookie=Ic(t,encodeURIComponent(r),o)},read:function(t){for(var r="".concat(t,"="),i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(r)===0)return o.substring(r.length,o.length)}return null},remove:function(t){this.create(t,"",-1)}},Fc={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var i=Pi.read(t.lookupCookie);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&Pi.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},jc={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var i=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));for(var n=i.substring(1),o=n.split("&"),a=0;a<o.length;a++){var s=o[a].indexOf("=");if(s>0){var u=o[a].substring(0,s);u===t.lookupQuerystring&&(r=o[a].substring(s+1))}}}return r}},ft=null,Ci=function(){if(ft!==null)return ft;try{ft=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ft=!1}return ft},Dc={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&Ci()){var i=window.localStorage.getItem(t.lookupLocalStorage);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&Ci()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},dt=null,Ai=function(){if(dt!==null)return dt;try{dt=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{dt=!1}return dt},_c={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Ai()){var i=window.sessionStorage.getItem(t.lookupSessionStorage);i&&(r=i)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Ai()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},Mc={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var i=0;i<navigator.languages.length;i++)r.push(navigator.languages[i]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},$c={name:"htmlTag",lookup:function(t){var r,i=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(r=i.getAttribute("lang")),r}},Uc={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(i instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof i[t.lookupFromPathIndex]!="string")return;r=i[t.lookupFromPathIndex].replace("/","")}else r=i[0].replace("/","")}return r}},Vc={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,i=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!i)return i[r]}};function Bc(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var To=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};de(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return ge(e,[{key:"init",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=Lc(i,this.options||{},Bc()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Fc),this.addDetector(jc),this.addDetector(Dc),this.addDetector(_c),this.addDetector(Mc),this.addDetector($c),this.addDetector(Uc),this.addDetector(Vc)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var i=this;r||(r=this.options.order);var n=[];return r.forEach(function(o){if(i.detectors[o]){var a=i.detectors[o].lookup(i.options);a&&typeof a=="string"&&(a=[a]),a&&(n=n.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(r,i){var n=this;i||(i=this.options.caches),i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||i.forEach(function(o){n.detectors[o]&&n.detectors[o].cacheUserLanguage(r,n.options)}))}}]),e}();To.type="languageDetector";const Hc={"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"},Wc={"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"},Kc={"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"},Yc={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};oe.use(To).use(Ec).init({resources:{pl:{translation:Hc},en:{translation:Wc},de:{translation:Kc},cs:{translation:Yc}}});const Gc=(e,t,r,i)=>{let n="",o="";const a=Number(e),s=Number(t);return a>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.From")} ${a}`,a>r&&(o=ve.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(o=ve.TOO_MUCH)),a>=0||s>=0&&r<a?(n=`${i("OS.ProductConfigurator.Quantity.Message.Max")}${n}`,n+=` ${i("OS.ProductConfigurator.Quantity.Message.Quantity")}`):a===1&&a===1?n=`${i("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(n="",o=ve.IGNORE),r>=a&&r<=s&&(o=ve.OK),{message:n,validationStatus:o}},zc=(e,t,r,i)=>{let n="",o="";const a=parseInt(e||"-1"),s=parseInt(t||"-1");return a>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.From")} ${a}`,a>r&&(o=ve.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(o=ve.TOO_MUCH)),a>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",o=ve.IGNORE),a===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=a&&r<=s&&(o=ve.OK),{message:n,validationStatus:o}},Qc=e=>{const{optionsItem:t,parentSelCtx:r,selected:i,isOnSubmitted:n,actualQtyCnt:o,actualSelCnt:a,children:s}=e,{selCtx:u,details:l={},id:d,attrs:c={}}=t,{qtyMin:g,qtyMax:f,selMin:p,selMax:m}=c,{name:v,description:b}=l.literals||{},{t:S}=Zr(),{isExpanded:x,toggleExpanded:P}=fc(t,r),{validationStatus:L,message:D}=zc(p,m,a,S),{validationStatus:M,message:_}=Gc(g,f,o,S),F=L===ve.OK,B=M===ve.OK,T=!F&&n&&!!D,I=!B&&n&&!!_;return V("div",{className:"pt-1 mb-3",id:lo(u),children:[V("div",{className:"flex text-xl font-semibold",children:[w("p",{className:"",children:v}),v&&v!==" "&&V(xe,{children:[w("div",{className:"ml-auto",children:w(rr,{price:Jr(i,t)})}),w("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!x&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>P(u,d,r),children:w("polyline",{points:"18 15 12 9 6 15"})})]})]}),w("p",{className:`${b&&"mb-2"}`,children:b}),!1,w("div",{className:"flex",children:V("div",{children:[w(pi,{isOk:F,isErr:T,info:D}),w(pi,{isOk:B,isErr:I,info:_})]})}),w("div",{className:`${x?"block":"hidden"}`,children:s})]})},Ro=j.default.createContext(null);function nr(){const e=y.useContext(Ro);if(!e)throw new Error("Missing ComponentsContext");return e}const qc=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:i,parentKind:n}=e,{isFilterValidated:o,selected:a,isOnSubmitted:s,selCnt:u,qtyCnt:l}=Il(t,i,n,r),{MenuOptionsUI:d}=nr();if(!o)return null;const c=w(Xr,{productItems:t.items,parentProduct:t}),g={optionsItem:t,parentSelCtx:r,selected:a,isOnSubmitted:s,actualQtyCnt:l,actualSelCnt:u};return d?w(d,{...g,children:c}):w(Qc,{...g,children:c})},Jc=e=>{const{product:t,inputId:r,isDisabled:i,registerProps:n,size:o="lg",children:a}=e,{details:{literals:s}={}}=t,{name:u="",description:l=""}=s||{},d=io(t),c=co(t);return V("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${i&&"opacity-50"}`,children:[w("input",{type:"checkbox",className:`simple-checkbox checkbox-${o} mr-4`,id:r,disabled:i,value:"1",...n}),c&&w("div",{className:"flex w-20 mr-2 max-h-24",children:w("img",{alt:"Product image",className:"h-auto max-w-full",src:c})}),w("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:V("div",{className:"relative",children:[w("p",{className:"w-full text-lg font-semibold",children:u}),w("p",{className:"text-sm text-gray-600",children:l})]})}),w("div",{className:"ml-auto",children:a}),w("label",{htmlFor:r,children:w(rr,{price:parseFloat(d),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Zc=e=>{const{product:t,inputId:r,inputValue:i,registerProps:n,isChecked:o,size:a="lg",children:s}=e,{details:{literals:u}={}}=t,{name:l="",description:d=""}=u||{},c=io(t),g=co(t);return V("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[w("input",{type:"radio",className:`simple-radio radio-${a} mr-4`,id:r,...n,value:i,checked:o}),g&&w("div",{className:"flex w-20 mr-2 max-h-24",children:w("img",{alt:"Product image",className:"h-auto max-w-full",src:g})}),w("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:V("div",{className:"relative",children:[w("p",{className:"w-full text-lg font-semibold",children:l}),w("p",{className:"text-sm text-gray-600",children:d})]})}),w("div",{className:"ml-auto",children:s}),w("label",{htmlFor:r,children:w(rr,{price:parseFloat(c||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Lo(e){const{value:t=0,add:r,subtract:i,disabledSubtract:n,disabledAdd:o,size:a="md"}=e;return V("div",{className:`counter counter-${a} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[w("button",{type:"button",className:"quantity-button small",onClick:i,disabled:n,children:V("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"}),w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),w("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),w("button",{className:"quantity-button small",type:"button",onClick:r,disabled:o,children:V("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"}),w("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Xc(e){const{watch:t}=Zt(),r=ee(u=>u.setFilter),{id:i,selCtx:n,emit:o={},fltCtx:a}=e,s=t(`selected.${n}.${i}`);return y.useEffect(()=>{s&&a&&!er(o)&&r(a,o)},[s]),{}}function ef(){const e=ee(i=>i.getInvalidSelCtxArray),t=ee(i=>i.isInputEnabled),r=ee(i=>i.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}function tf(e,t){var $;const{id:r,selCtx:i}=e,{allowMultiple:n,selMin:o,selMax:a}=t;Xc(e);const{isInputEnabled:s,isInputCounterIncrementEnabled:u}=ef(),l=ee(U=>U.refreshForm),{watch:d,getValues:c,setValue:g,register:f}=Zt(),p=d(`selected.${i}.${r}`),{selected:m={}}=c(),v=Number(p||0),b=o==="1"&&a==="1",S=!b,x=ps(n),P=v>1,L=u(e,m)&&(s(e)||v),D=Number((($=m==null?void 0:m[i])==null?void 0:$[r])||0)>0,M=s(e)||v,_=`${b?"radio":"selected"}.${i}.${r}`,F=f(_,{onChange:U=>{I(U)}}),B=()=>{g(`selected.${i}.${r}`,`${v+1}`)},T=()=>{const U=v-1;g(`selected.${i}.${r}`,`${U}`)},I=U=>{const{target:{checked:J,name:W,defaultValue:z}}=U;if(b){console.log("handleOnInputChange radio",W,z);const H="selected."+W.replace("radio.","").split(".")[0];g(H,{[z]:"1"}),l()}};return{registerProps:F,isRadio:b,isCheckbox:S,isCounter:x,isDecrementEnabled:P,isIncrementEnabled:L,isChecked:D,isCheckboxEnabled:M,handleCounterIncrementQty:B,handleCounterDecrementQty:T,counterValue:v,handleOnInputChange:I,inputId:`${i}.${r}`,radioInputValue:r}}const rf=e=>{const{product:t,parentAttrs:r,nestedLvl:i}=e,{registerProps:n,inputId:o,radioInputValue:a,isRadio:s,isCheckbox:u,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:c,isChecked:g,isCheckboxEnabled:f,counterValue:p,handleCounterIncrementQty:m,handleCounterDecrementQty:v}=tf(t,r),{MenuProductUI:b}=nr(),S={product:t,nestedLvl:i,registerProps:n,inputId:o,radioInputValue:a,isRadio:s,isCheckbox:u,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:c,isChecked:g,isCheckboxEnabled:f,counterValue:p,handleCounterIncrementQty:m,handleCounterDecrementQty:v},x=w(Xr,{productItems:t.items,parentProduct:t,nestedLvl:i+1});return b?w(b,{...S,children:x}):w(nf,{...S,children:x})},nf=e=>{const{product:t,nestedLvl:r,registerProps:i,inputId:n,radioInputValue:o,isRadio:a,isCheckbox:s,isCounter:u,isDecrementEnabled:l,isIncrementEnabled:d,isChecked:c,isCheckboxEnabled:g,counterValue:f,handleCounterIncrementQty:p,handleCounterDecrementQty:m,children:v}=e,b=w(Lo,{value:f,add:p,subtract:m,disabledSubtract:!l,disabledAdd:!d}),S=()=>a?w(Zc,{product:t,inputId:n,inputValue:o,registerProps:i,isChecked:c,children:w(xe,{children:u&&b})}):s?w(Jc,{product:t,inputId:n,registerProps:i,isDisabled:!g,children:w(xe,{children:u&&b})}):null,x=!er(t.items)&&f,P=ln.useTransition(x,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return V("div",{children:[S(),x?P((L,D)=>D&&w(ln.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:L,children:v},r+1)):null]})};function of(){return{isMenuProductToShow:r=>r.kind===rt.PRODUCT&&_n(r),isMenuOptionsToShow:r=>[rt.OPTIONS,rt.CONFIG].includes(r.kind)&&_n(r)}}function Xr(e){const{productItems:t,nestedLvl:r=1,parentProduct:i}=e,{attrs:n={},selCtx:o,kind:a}=i,{isMenuProductToShow:s,isMenuOptionsToShow:u}=of(),{MenuItemsUI:l}=nr(),c={productItems:t,parentProduct:i,renderMenuItem:g=>u(g)?w(qc,{optionsItem:g,parentSelCtx:o,parentKind:a,nestedLvl:r}):s(g)?w(rf,{product:g,parentAttrs:n,nestedLvl:r}):w(xe,{})};return l?w(l,{...c}):w(af,{...c})}function af(e){const{productItems:t,parentProduct:r,renderMenuItem:i}=e,n=r.kind!==rt.PRODUCT,o=99,a=3,[s,u]=y.useState(n?a:o),{t:l}=Zr(),d=()=>{u(o)},c=()=>{u(a)};return w(xe,{children:t.map((g,f)=>{if(f<s)return V("div",{children:[i(g),s===o&&n&&t.length===f+1&&Ni(l("OS.ProductConfigurator.ShowLess"),c,!1)]},`${r.id}--${g.id}--${f}`);if(f===s)return Ni(l("OS.ProductConfigurator.ShowMore"),d,!0)})})}const Ni=(e,t,r)=>w("div",{className:"flex justify-center w-full",children:V("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,V("svg",{className:`-mr-2 w-7 h-7 ${!r&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",w("polyline",{points:"7 7 12 12 17 7"})," ",w("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),sf=()=>{const{watch:e}=Zt(),t=e("selected"),r=ee(i=>i.validationMap);return console.log({validationMap:r}),V("div",{className:"flex flex-col items-center py-4",children:[w("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(i=>w("div",{children:Object.values(t[i]).filter(n=>n).length>0&&V(xe,{children:[V("p",{className:"text-lg font-semibold",children:[i,":"]}),Object.keys(t[i]).map(n=>w(j.default.Fragment,{children:t[i][n]&&V("p",{children:[n,":",t[i][n].toString()]})},n))]})},i))]})};function ki(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:i,displayPriceFrom:n=!1,productQuantity:o,increaseProductQuantity:a,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:l}=Zr();return V("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&V("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:i,children:[V("svg",{className:"w-5 h-5 text-red-600",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"}),w("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),w("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),w("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),w("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Back")}`})]}),w("div",{className:"px-3",children:w(Lo,{value:o,add:a,subtract:s,disabledSubtract:o===1,size:"lg"})}),V("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${n?"0.4":"1"}`},disabled:n,onClick:u,children:[V("svg",{className:"w-5 h-5 mr-2 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w("circle",{cx:"9",cy:"21",r:"1"})," ",w("circle",{cx:"20",cy:"21",r:"1"}),w("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),n?w("span",{children:`${l("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):w("span",{className:"uppercase",children:`${l("OS.ProductConfigurator.Add")} ${t}`})]})]})}const It=640,Io=e=>{const{isModal:t=!1}=e,[r,i]=y.useState(window.innerWidth),[n,o]=y.useState(window.innerHeight),[a,s]=y.useState(window.innerWidth<=It),[u,l]=y.useState(window.innerWidth>It&&!t);function d(){i(window.innerWidth),o(window.innerHeight)}return y.useEffect(()=>(window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[]),y.useEffect(()=>{l(window.innerWidth>It&&!t),s(window.innerWidth<=It)},[r,e,t]),{isSm:u,isMobile:a,width:r,windowHeight:n}};function Fo(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Fo(e[t]))&&(i&&(i+=" "),i+=r);else for(t in e)e[t]&&(i&&(i+=" "),i+=t);return i}function gt(){for(var e,t,r=0,i="";r<arguments.length;)(e=arguments[r++])&&(t=Fo(e))&&(i&&(i+=" "),i+=t);return i}const ir=typeof window=="undefined"||typeof document=="undefined";let Re=ir?y.useEffect:y.useLayoutEffect;function Te(e){let t=y.useRef(e);return Re(()=>{t.current=e},[e]),t}function or(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Pt(){let e=[],t=[],r={enqueue(i){t.push(i)},addEventListener(i,n,o,a){return i.addEventListener(n,o,a),r.add(()=>i.removeEventListener(n,o,a))},requestAnimationFrame(...i){let n=requestAnimationFrame(...i);return r.add(()=>cancelAnimationFrame(n))},nextFrame(...i){return r.requestAnimationFrame(()=>r.requestAnimationFrame(...i))},setTimeout(...i){let n=setTimeout(...i);return r.add(()=>clearTimeout(n))},microTask(...i){let n={current:!0};return or(()=>{n.current&&i[0]()}),r.add(()=>{n.current=!1})},add(i){return e.push(i),()=>{let n=e.indexOf(i);if(n>=0){let[o]=e.splice(n,1);o()}}},dispose(){for(let i of e.splice(0))i()},async workQueue(){for(let i of t.splice(0))await i()}};return r}function en(){let[e]=y.useState(Pt);return y.useEffect(()=>()=>e.dispose(),[e]),e}let ie=function(e){let t=Te(e);return j.default.useCallback((...r)=>t.current(...r),[t])},xr={serverHandoffComplete:!1};function it(){let[e,t]=y.useState(xr.serverHandoffComplete);return y.useEffect(()=>{e!==!0&&t(!0)},[e]),y.useEffect(()=>{xr.serverHandoffComplete===!1&&(xr.serverHandoffComplete=!0)},[]),e}var Ti;let uf=0;function Ri(){return++uf}let ot=(Ti=j.default.useId)!=null?Ti:function(){let e=it(),[t,r]=j.default.useState(e?Ri:null);return Re(()=>{t===null&&r(Ri())},[t]),t!=null?""+t:void 0};function te(e,t,...r){if(e in t){let n=t[e];return typeof n=="function"?n(...r):n}let i=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,te),i}function tn(e){return ir?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let $r=["[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 Be=(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))(Be||{}),jo=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(jo||{}),lf=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(lf||{});function cf(e=document.body){return e==null?[]:Array.from(e.querySelectorAll($r)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Do=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Do||{});function ff(e,t=0){var r;return e===((r=tn(e))==null?void 0:r.body)?!1:te(t,{[0](){return e.matches($r)},[1](){let i=e;for(;i!==null;){if(i.matches($r))return!0;i=i.parentElement}return!1}})}function We(e){e==null||e.focus({preventScroll:!0})}let df=["textarea","input"].join(",");function gf(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,df))!=null?r:!1}function pf(e,t=r=>r){return e.slice().sort((r,i)=>{let n=t(r),o=t(i);if(n===null||o===null)return 0;let a=n.compareDocumentPosition(o);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function _t(e,t,{sorted:r=!0,relativeTo:i=null,skipElements:n=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?pf(e):e:cf(e);n.length>0&&(a=a.filter(f=>!n.includes(f))),i=i!=null?i:o.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,a.indexOf(i))-1;if(t&4)return Math.max(0,a.indexOf(i))+1;if(t&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},d=0,c=a.length,g;do{if(d>=c||d+c<=0)return 0;let f=u+d;if(t&16)f=(f+c)%c;else{if(f<0)return 3;if(f>=c)return 1}g=a[f],g==null||g.focus(l),d+=s}while(g!==o.activeElement);return t&6&&gf(g)&&g.select(),g.hasAttribute("tabindex")||g.setAttribute("tabindex","0"),2}function Pr(e,t,r){let i=Te(t);y.useEffect(()=>{function n(o){i.current(o)}return document.addEventListener(e,n,r),()=>document.removeEventListener(e,n,r)},[e,r])}function hf(e,t,r=!0){let i=y.useRef(!1);y.useEffect(()=>{requestAnimationFrame(()=>{i.current=r})},[r]);function n(a,s){if(!i.current||a.defaultPrevented)return;let u=function d(c){return typeof c=="function"?d(c()):Array.isArray(c)||c instanceof Set?c:[c]}(e),l=s(a);if(l!==null&&!!l.getRootNode().contains(l)){for(let d of u){if(d===null)continue;let c=d instanceof HTMLElement?d:d.current;if(c!=null&&c.contains(l)||a.composed&&a.composedPath().includes(c))return}return!ff(l,Do.Loose)&&l.tabIndex!==-1&&a.preventDefault(),t(a,l)}}let o=y.useRef(null);Pr("mousedown",a=>{var s,u;i.current&&(o.current=((u=(s=a.composedPath)==null?void 0:s.call(a))==null?void 0:u[0])||a.target)},!0),Pr("click",a=>{!o.current||(n(a,()=>o.current),o.current=null)},!0),Pr("blur",a=>n(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let _o=Symbol();function mf(e,t=!0){return Object.assign(e,{[_o]:t})}function be(...e){let t=y.useRef(e);y.useEffect(()=>{t.current=e},[e]);let r=ie(i=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(i):n.current=i)});return e.every(i=>i==null||(i==null?void 0:i[_o]))?void 0:r}var Gt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Gt||{}),ke=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ke||{});function pe({ourProps:e,theirProps:t,slot:r,defaultTag:i,features:n,visible:o=!0,name:a}){let s=Mo(t,e);if(o)return Ft(s,r,i,a);let u=n!=null?n:0;if(u&2){let{static:l=!1,...d}=s;if(l)return Ft(d,r,i,a)}if(u&1){let{unmount:l=!0,...d}=s;return te(l?0:1,{[0](){return null},[1](){return Ft({...d,hidden:!0,style:{display:"none"}},r,i,a)}})}return Ft(s,r,i,a)}function Ft(e,t={},r,i){let{as:n=r,children:o,refName:a="ref",...s}=Cr(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},l=typeof o=="function"?o(t):o;s.className&&typeof s.className=="function"&&(s.className=s.className(t));let d={};if(t){let c=!1,g=[];for(let[f,p]of Object.entries(t))typeof p=="boolean"&&(c=!0),p===!0&&g.push(f);c&&(d["data-headlessui-state"]=g.join(" "))}if(n===y.Fragment&&Object.keys(Li(s)).length>0){if(!y.isValidElement(l)||Array.isArray(l)&&l.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(c=>` - ${c}`).join(`
|
|
15
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(c=>` - ${c}`).join(`
|
|
6
16
|
`)].join(`
|
|
7
|
-
`));return y.cloneElement(g,Object.assign({},hs(ps(ir(l,["ref"])),g.props,["onClick"]),d))}return y.createElement(s,Object.assign({},ir(l,["ref"]),s!==y.Fragment&&d),g)}function hs(e,r,t){for(var i=Object.assign({},e),n=function(){var u=o.value;if(e[u]!==void 0&&r[u]!==void 0){var c;Object.assign(i,(c={},c[u]=function(f){f.defaultPrevented||e[u](f),f.defaultPrevented||r[u](f)},c))}},a=Oe(t),o;!(o=a()).done;)n();return i}function yi(e){var r;return Object.assign(y.forwardRef(e),{displayName:(r=e.displayName)!=null?r:e.name})}function ps(e){var r=Object.assign({},e);for(var t in r)r[t]===void 0&&delete r[t];return r}function ir(e,r){r===void 0&&(r=[]);for(var t=Object.assign({},e),i=Oe(r),n;!(n=i()).done;){var a=n.value;a in t&&delete t[a]}return t}var Ve=typeof window!="undefined"?y.useLayoutEffect:y.useEffect,ar={serverHandoffComplete:!1};function Wt(){var e=y.useState(ar.serverHandoffComplete),r=e[0],t=e[1];return y.useEffect(function(){r!==!0&&t(!0)},[r]),y.useEffect(function(){ar.serverHandoffComplete===!1&&(ar.serverHandoffComplete=!0)},[]),r}var bi=y.createContext(!1);function vs(){return y.useContext(bi)}function kn(e){return p.jsx(bi.Provider,{value:e.force,children:e.children})}function ms(){var e=vs(),r=y.useContext(xi),t=y.useState(function(){if(!e&&r!==null||typeof window=="undefined")return null;var a=document.getElementById("headlessui-portal-root");if(a)return a;var o=document.createElement("div");return o.setAttribute("id","headlessui-portal-root"),document.body.appendChild(o)}),i=t[0],n=t[1];return y.useEffect(function(){i!==null&&(document.body.contains(i)||document.body.appendChild(i))},[i]),y.useEffect(function(){e||r!==null&&n(r.current)},[r,n,e]),i}var ys=y.Fragment;function gr(e){var r=e,t=ms(),i=y.useState(function(){return typeof window=="undefined"?null:document.createElement("div")}),n=i[0],a=Wt();return Ve(function(){if(!!t&&!!n)return t.appendChild(n),function(){if(!!t&&!!n&&(t.removeChild(n),t.childNodes.length<=0)){var o;(o=t.parentElement)==null||o.removeChild(t)}}},[t,n]),a?!t||!n?null:Ii.createPortal(He({props:r,defaultTag:ys,name:"Portal"}),n):null}var bs=y.Fragment,xi=y.createContext(null);function xs(e){var r=e.target,t=Ke(e,["target"]);return p.jsx(xi.Provider,{value:r,children:He({props:t,defaultTag:bs,name:"Popover.Group"})})}gr.Group=xs;function Oi(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var i=y.useRef(r);return y.useEffect(function(){i.current=r},[r]),y.useCallback(function(n){for(var a=Oe(i.current),o;!(o=a()).done;){var s=o.value;s!=null&&(typeof s=="function"?s(n):s.current=n)}},[i])}var At;(function(e){e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",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"})(At||(At={}));function Os(e){for(var r,t,i=e.parentElement,n=null;i&&!(i instanceof HTMLFieldSetElement);)i instanceof HTMLLegendElement&&(n=i),i=i.parentElement;var a=(r=((t=i)==null?void 0:t.getAttribute("disabled"))==="")!=null?r:!1;return a&&Ss(n)?!1:a}function Ss(e){if(!e)return!1;for(var r=e.previousElementSibling;r!==null;){if(r instanceof HTMLLegendElement)return!1;r=r.previousElementSibling}return!0}var ws=0;function En(){return++ws}function mt(){var e=Wt(),r=y.useState(e?En:null),t=r[0],i=r[1];return Ve(function(){t===null&&i(En())},[t]),t!=null?""+t:void 0}function Rt(e,r,t){var i=y.useRef(r);i.current=r,y.useEffect(function(){function n(a){i.current.call(window,a)}return window.addEventListener(e,n,t),function(){return window.removeEventListener(e,n,t)}},[e,t])}var Cs=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(function(e){return e+":not([tabindex='-1'])"}).join(","),se;(function(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"})(se||(se={}));var Me;(function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"})(Me||(Me={}));var Tt;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(Tt||(Tt={}));function Ps(e){return e===void 0&&(e=document.body),e==null?[]:Array.from(e.querySelectorAll(Cs))}var Ln;(function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"})(Ln||(Ln={}));function ut(e){e==null||e.focus({preventScroll:!0})}function Fn(e,r){var t=Array.isArray(e)?e.slice().sort(function(d,g){var v=d.compareDocumentPosition(g);return v&Node.DOCUMENT_POSITION_FOLLOWING?-1:v&Node.DOCUMENT_POSITION_PRECEDING?1:0}):Ps(e),i=document.activeElement,n=function(){if(r&(se.First|se.Next))return Tt.Next;if(r&(se.Previous|se.Last))return Tt.Previous;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),a=function(){if(r&se.First)return 0;if(r&se.Previous)return Math.max(0,t.indexOf(i))-1;if(r&se.Next)return Math.max(0,t.indexOf(i))+1;if(r&se.Last)return t.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")}(),o=r&se.NoScroll?{preventScroll:!0}:{},s=0,u=t.length,c=void 0;do{var f;if(s>=u||s+u<=0)return Me.Error;var l=a+s;if(r&se.WrapAround)l=(l+u)%u;else{if(l<0)return Me.Underflow;if(l>=u)return Me.Overflow}c=t[l],(f=c)==null||f.focus(o),s+=n}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),Me.Success}function Si(){var e=y.useRef(!1);return y.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e}var Ce;(function(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"})(Ce||(Ce={}));function js(e,r,t){r===void 0&&(r=Ce.All);var i=t===void 0?{}:t,n=i.initialFocus,a=i.containers,o=y.useRef(typeof window!="undefined"?document.activeElement:null),s=y.useRef(null),u=Si(),c=Boolean(r&Ce.RestoreFocus),f=Boolean(r&Ce.InitialFocus);y.useEffect(function(){!c||(o.current=document.activeElement)},[c]),y.useEffect(function(){if(!!c)return function(){ut(o.current),o.current=null}},[c]),y.useEffect(function(){if(!!f&&!!e.current){var l=document.activeElement;if(n==null?void 0:n.current){if((n==null?void 0:n.current)===l){s.current=l;return}}else if(e.current.contains(l)){s.current=l;return}(n==null?void 0:n.current)?ut(n.current):Fn(e.current,se.First)===Me.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=document.activeElement}},[e,n,f]),Rt("keydown",function(l){!(r&Ce.TabLock)||!e.current||l.key===At.Tab&&(l.preventDefault(),Fn(e.current,(l.shiftKey?se.Previous:se.Next)|se.WrapAround)===Me.Success&&(s.current=document.activeElement))}),Rt("focus",function(l){if(!!(r&Ce.FocusLock)){var d=new Set(a==null?void 0:a.current);if(d.add(e),!!d.size){var g=s.current;if(!!g&&!!u.current){var v=l.target;v&&v instanceof HTMLElement?Ns(d,v)?(s.current=v,ut(v)):(l.preventDefault(),l.stopPropagation(),ut(g)):ut(s.current)}}}},!0)}function Ns(e,r){for(var t=Oe(e),i;!(i=t()).done;){var n,a=i.value;if((n=a.current)==null?void 0:n.contains(r))return!0}return!1}var Ye=new Set,Te=new Map;function An(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Rn(e){var r=Te.get(e);!r||(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert)}function ks(e,r){r===void 0&&(r=!0),Ve(function(){if(!!r&&!!e.current){var t=e.current;Ye.add(t);for(var i=Oe(Te.keys()),n;!(n=i()).done;){var a=n.value;a.contains(t)&&(Rn(a),Te.delete(a))}return document.querySelectorAll("body > *").forEach(function(o){if(o instanceof HTMLElement){for(var s=Oe(Ye),u;!(u=s()).done;){var c=u.value;if(o.contains(c))return}Ye.size===1&&(Te.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),An(o))}}),function(){if(Ye.delete(t),Ye.size>0)document.querySelectorAll("body > *").forEach(function(c){if(c instanceof HTMLElement&&!Te.has(c)){for(var f=Oe(Ye),l;!(l=f()).done;){var d=l.value;if(c.contains(d))return}Te.set(c,{"aria-hidden":c.getAttribute("aria-hidden"),inert:c.inert}),An(c)}});else for(var o=Oe(Te.keys()),s;!(s=o()).done;){var u=s.value;Rn(u),Te.delete(u)}}}},[r])}var wi=y.createContext(null);function Ci(){var e=y.useContext(wi);if(e===null){var r=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(r,Ci),r}return e}function Es(){var e=y.useState([]),r=e[0],t=e[1];return[r.length>0?r.join(" "):void 0,y.useMemo(function(){return function(n){var a=y.useCallback(function(s){return t(function(u){return[].concat(u,[s])}),function(){return t(function(u){var c=u.slice(),f=c.indexOf(s);return f!==-1&&c.splice(f,1),c})}},[]),o=y.useMemo(function(){return{register:a,slot:n.slot,name:n.name,props:n.props}},[a,n.slot,n.name,n.props]);return p.jsx(wi.Provider,{value:o,children:n.children})}},[t])]}var Ls="p";function Fs(e){var r=Ci(),t="headlessui-description-"+mt();Ve(function(){return r.register(t)},[t,r.register]);var i=e,n=Se({},r.props,{id:t});return He({props:Se({},i,n),slot:r.slot||{},defaultTag:Ls,name:r.name||"Description"})}var Or=y.createContext(null);Or.displayName="OpenClosedContext";var Fe;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(Fe||(Fe={}));function Sr(){return y.useContext(Or)}function As(e){var r=e.value,t=e.children;return p.jsx(Or.Provider,{value:r,children:t})}var wr=y.createContext(function(){});wr.displayName="StackContext";var tt;(function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"})(tt||(tt={}));function Rs(){return y.useContext(wr)}function Ts(e){var r=e.children,t=e.onUpdate,i=e.type,n=e.element,a=Rs(),o=y.useCallback(function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];t==null||t.apply(void 0,u),a.apply(void 0,u)},[a,t]);return Ve(function(){return o(tt.Add,i,n),function(){return o(tt.Remove,i,n)}},[o,i,n]),p.jsx(wr.Provider,{value:o,children:r})}var or,le;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(le||(le={}));var Mt;(function(e){e[e.SetTitleId=0]="SetTitleId"})(Mt||(Mt={}));var Ms=(or={},or[Mt.SetTitleId]=function(e,r){return e.titleId===r.id?e:Se({},e,{titleId:r.id})},or),Dt=y.createContext(null);Dt.displayName="DialogContext";function Cr(e){var r=y.useContext(Dt);if(r===null){var t=new Error("<"+e+" /> is missing a parent <"+gt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Cr),t}return r}function Ds(e,r){return Ne(r.type,Ms,e,r)}var Is="div",_s=_e.RenderStrategy|_e.Static,Vs=yi(function(r,t){var i=r.open,n=r.onClose,a=r.initialFocus,o=Ke(r,["open","onClose","initialFocus"]),s=y.useState(0),u=s[0],c=s[1],f=Sr();if(i===void 0&&f!==null){var l;i=Ne(f,(l={},l[Fe.Open]=!0,l[Fe.Closed]=!1,l))}var d=y.useRef(new Set),g=y.useRef(null),v=Oi(g,t),x=r.hasOwnProperty("open")||f!==null,S=r.hasOwnProperty("onClose");if(!x&&!S)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!x)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!S)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: "+i);if(typeof n!="function")throw new Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: "+n);var m=i?le.Open:le.Closed,w=function(){return f!==null?f===Fe.Open:m===le.Open}(),P=y.useReducer(Ds,{titleId:null,descriptionId:null}),j=P[0],R=P[1],M=y.useCallback(function(){return n(!1)},[n]),D=y.useCallback(function(B){return R({type:Mt.SetTitleId,id:B})},[R]),_=Wt(),T=_&&m===le.Open,N=u>1,E=y.useContext(Dt)!==null,I=N?"parent":"leaf";js(g,T?Ne(I,{parent:Ce.RestoreFocus,leaf:Ce.All}):Ce.None,{initialFocus:a,containers:d}),ks(g,N?T:!1),Rt("mousedown",function(B){var G,V=B.target;m===le.Open&&(N||((G=g.current)==null?void 0:G.contains(V))||M())}),Rt("keydown",function(B){B.key===At.Escape&&m===le.Open&&(N||(B.preventDefault(),B.stopPropagation(),M()))}),y.useEffect(function(){if(m===le.Open&&!E){var B=document.documentElement.style.overflow,G=document.documentElement.style.paddingRight,V=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=V+"px",function(){document.documentElement.style.overflow=B,document.documentElement.style.paddingRight=G}}},[m,E]),y.useEffect(function(){if(m===le.Open&&!!g.current){var B=new IntersectionObserver(function(G){for(var V=Oe(G),U;!(U=V()).done;){var H=U.value;H.boundingClientRect.x===0&&H.boundingClientRect.y===0&&H.boundingClientRect.width===0&&H.boundingClientRect.height===0&&M()}});return B.observe(g.current),function(){return B.disconnect()}}},[m,g,M]);var q=Es(),$=q[0],J=q[1],re="headlessui-dialog-"+mt(),W=y.useMemo(function(){return[{dialogState:m,close:M,setTitleId:D},j]},[m,j,M,D]),Z=y.useMemo(function(){return{open:m===le.Open}},[m]),te={ref:v,id:re,role:"dialog","aria-modal":m===le.Open?!0:void 0,"aria-labelledby":j.titleId,"aria-describedby":$,onClick:function(G){G.stopPropagation()}},X=o;return p.jsx(Ts,{type:"Dialog",element:g,onUpdate:y.useCallback(function(B,G,V){var U;G==="Dialog"&&Ne(B,(U={},U[tt.Add]=function(){d.current.add(V),c(function(H){return H+1})},U[tt.Remove]=function(){d.current.add(V),c(function(H){return H-1})},U))},[]),children:p.jsx(kn,{force:!0,children:p.jsx(gr,{children:p.jsx(Dt.Provider,{value:W,children:p.jsx(gr.Group,{target:g,children:p.jsx(kn,{force:!1,children:p.jsx(J,{slot:Z,name:"Dialog.Description",children:He({props:Se({},X,te),slot:Z,defaultTag:Is,features:_s,visible:w,name:"Dialog"})})})})})})})})}),$s="div",Us=yi(function e(r,t){var i=Cr([gt.displayName,e.name].join(".")),n=i[0],a=n.dialogState,o=n.close,s=Oi(t),u="headlessui-dialog-overlay-"+mt(),c=y.useCallback(function(g){if(g.target===g.currentTarget){if(Os(g.currentTarget))return g.preventDefault();g.preventDefault(),g.stopPropagation(),o()}},[o]),f=y.useMemo(function(){return{open:a===le.Open}},[a]),l={ref:s,id:u,"aria-hidden":!0,onClick:c},d=r;return He({props:Se({},d,l),slot:f,defaultTag:$s,name:"Dialog.Overlay"})}),Hs="h2";function Pi(e){var r=Cr([gt.displayName,Pi.name].join(".")),t=r[0],i=t.dialogState,n=t.setTitleId,a="headlessui-dialog-title-"+mt();y.useEffect(function(){return n(a),function(){return n(null)}},[a,n]);var o=y.useMemo(function(){return{open:i===le.Open}},[i]),s={id:a},u=e;return He({props:Se({},u,s),slot:o,defaultTag:Hs,name:"Dialog.Title"})}var gt=Object.assign(Vs,{Overlay:Us,Title:Pi,Description:Fs});function ji(){var e=[],r={requestAnimationFrame:function(t){function i(){return t.apply(this,arguments)}return i.toString=function(){return t.toString()},i}(function(){var t=requestAnimationFrame.apply(void 0,arguments);r.add(function(){return cancelAnimationFrame(t)})}),nextFrame:function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];r.requestAnimationFrame(function(){r.requestAnimationFrame.apply(r,n)})},setTimeout:function(t){function i(){return t.apply(this,arguments)}return i.toString=function(){return t.toString()},i}(function(){var t=setTimeout.apply(void 0,arguments);r.add(function(){return clearTimeout(t)})}),add:function(i){e.push(i)},dispose:function(){for(var i=Oe(e.splice(0)),n;!(n=i()).done;){var a=n.value;a()}}};return r}function Bs(){var e=y.useRef(!0);return y.useEffect(function(){e.current=!1},[]),e.current}function Ws(e){var r={called:!1};return function(){if(!r.called)return r.called=!0,e.apply(void 0,arguments)}}function sr(e){for(var r,t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];e&&i.length>0&&(r=e.classList).add.apply(r,i)}function Ct(e){for(var r,t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];e&&i.length>0&&(r=e.classList).remove.apply(r,i)}var $e;(function(e){e.Finished="finished",e.Cancelled="cancelled"})($e||($e={}));function zs(e,r){var t=ji();if(!e)return t.dispose;var i=getComputedStyle(e),n=i.transitionDuration,a=i.transitionDelay,o=[n,a].map(function(c){var f=c.split(",").filter(Boolean).map(function(g){return g.includes("ms")?parseFloat(g):parseFloat(g)*1e3}).sort(function(g,v){return v-g}),l=f[0],d=l===void 0?0:l;return d}),s=o[0],u=o[1];return s!==0?t.setTimeout(function(){r($e.Finished)},s+u):r($e.Finished),t.add(function(){return r($e.Cancelled)}),t.dispose}function Tn(e,r,t,i,n,a){var o=ji(),s=a!==void 0?Ws(a):function(){};return Ct.apply(void 0,[e].concat(n)),sr.apply(void 0,[e].concat(r,t)),o.nextFrame(function(){Ct.apply(void 0,[e].concat(t)),sr.apply(void 0,[e].concat(i)),o.add(zs(e,function(u){return Ct.apply(void 0,[e].concat(i,r)),sr.apply(void 0,[e].concat(n)),s(u)}))}),o.add(function(){return Ct.apply(void 0,[e].concat(r,t,i,n))}),o.add(function(){return s($e.Cancelled)}),o.dispose}function ze(e){return e===void 0&&(e=""),y.useMemo(function(){return e.split(" ").filter(function(r){return r.trim().length>1})},[e])}var zt=y.createContext(null);zt.displayName="TransitionContext";var Q;(function(e){e.Visible="visible",e.Hidden="hidden"})(Q||(Q={}));function qs(){var e=y.useContext(zt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Gs(){var e=y.useContext(qt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}var qt=y.createContext(null);qt.displayName="NestingContext";function Gt(e){return"children"in e?Gt(e.children):e.current.filter(function(r){var t=r.state;return t===Q.Visible}).length>0}function Ni(e){var r=y.useRef(e),t=y.useRef([]),i=Si();y.useEffect(function(){r.current=e},[e]);var n=y.useCallback(function(o,s){var u;s===void 0&&(s=ge.Hidden);var c=t.current.findIndex(function(f){var l=f.id;return l===o});c!==-1&&(Ne(s,(u={},u[ge.Unmount]=function(){t.current.splice(c,1)},u[ge.Hidden]=function(){t.current[c].state=Q.Hidden},u)),!Gt(t)&&i.current&&(r.current==null||r.current()))},[r,i,t]),a=y.useCallback(function(o){var s=t.current.find(function(u){var c=u.id;return c===o});return s?s.state!==Q.Visible&&(s.state=Q.Visible):t.current.push({id:o,state:Q.Visible}),function(){return n(o,ge.Unmount)}},[t,n]);return y.useMemo(function(){return{children:t,register:a,unregister:n}},[a,n,t])}function Ks(){}var Qs=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Mn(e){for(var r={},t=Oe(Qs),i;!(i=t()).done;){var n,a=i.value;r[a]=(n=e[a])!=null?n:Ks}return r}function Js(e){var r=y.useRef(Mn(e));return y.useEffect(function(){r.current=Mn(e)},[e]),r}var Ys="div",ki=_e.RenderStrategy;function Ei(e){var r,t=e.beforeEnter,i=e.afterEnter,n=e.beforeLeave,a=e.afterLeave,o=e.enter,s=e.enterFrom,u=e.enterTo,c=e.entered,f=e.leave,l=e.leaveFrom,d=e.leaveTo,g=Ke(e,["beforeEnter","afterEnter","beforeLeave","afterLeave","enter","enterFrom","enterTo","entered","leave","leaveFrom","leaveTo"]),v=y.useRef(null),x=y.useState(Q.Visible),S=x[0],m=x[1],w=g.unmount?ge.Unmount:ge.Hidden,P=qs(),j=P.show,R=P.appear,M=P.initial,D=Gs(),_=D.register,T=D.unregister,N=mt(),E=y.useRef(!1),I=Ni(function(){E.current||(m(Q.Hidden),T(N),X.current.afterLeave())});Ve(function(){if(!!N)return _(N)},[_,N]),Ve(function(){var H;if(w===ge.Hidden&&!!N){if(j&&S!==Q.Visible){m(Q.Visible);return}Ne(S,(H={},H[Q.Hidden]=function(){return T(N)},H[Q.Visible]=function(){return _(N)},H))}},[S,N,_,T,j,w]);var q=ze(o),$=ze(s),J=ze(u),re=ze(c),W=ze(f),Z=ze(l),te=ze(d),X=Js({beforeEnter:t,afterEnter:i,beforeLeave:n,afterLeave:a}),B=Wt();y.useEffect(function(){if(B&&S===Q.Visible&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,S,B]);var G=M&&!R;Ve(function(){var H=v.current;if(!!H&&!G)return E.current=!0,j&&X.current.beforeEnter(),j||X.current.beforeLeave(),j?Tn(H,q,$,J,re,function(me){E.current=!1,me===$e.Finished&&X.current.afterEnter()}):Tn(H,W,Z,te,re,function(me){E.current=!1,me===$e.Finished&&(Gt(I)||(m(Q.Hidden),T(N),X.current.afterLeave()))})},[X,N,E,T,I,v,G,j,q,$,J,W,Z,te]);var V={ref:v},U=g;return p.jsx(qt.Provider,{value:I,children:p.jsx(As,{value:Ne(S,(r={},r[Q.Visible]=Fe.Open,r[Q.Hidden]=Fe.Closed,r)),children:He({props:Se({},U,V),defaultTag:Ys,features:ki,visible:S===Q.Visible,name:"Transition.Child"})})})}function Ge(e){var r=e.show,t=e.appear,i=t===void 0?!1:t,n=e.unmount,a=Ke(e,["show","appear","unmount"]),o=Sr();if(r===void 0&&o!==null){var s;r=Ne(o,(s={},s[Fe.Open]=!0,s[Fe.Closed]=!1,s))}if(![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");var u=y.useState(r?Q.Visible:Q.Hidden),c=u[0],f=u[1],l=Ni(function(){f(Q.Hidden)}),d=Bs(),g=y.useMemo(function(){return{show:r,appear:i||!d,initial:d}},[r,i,d]);y.useEffect(function(){r?f(Q.Visible):Gt(l)||f(Q.Hidden)},[r,l]);var v={unmount:n};return p.jsx(qt.Provider,{value:l,children:p.jsx(zt.Provider,{value:g,children:He({props:Se({},v,{as:y.Fragment,children:p.jsx(Ei,ie({},Object.assign({},v,a)))}),defaultTag:y.Fragment,features:ki,visible:c===Q.Visible,name:"Transition"})})})}Ge.Child=function(r){var t=y.useContext(zt)!==null,i=Sr()!==null;return!t&&i?p.jsx(Ge,ie({},Object.assign({},r))):p.jsx(Ei,ie({},Object.assign({},r)))};Ge.Root=Ge;function Zs(e){const{children:r,isModalOpen:t,handleCloseModal:i}=e,{isMobile:n}=vi({isModal:!0});return p.jsx(p.Fragment,{children:p.jsx(Ge,{appear:!0,show:t,as:y.Fragment,children:p.jsx(gt,{as:"div",className:"overflow-y-auto fixed inset-0 z-10",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:i,children:p.jsxs("div",{className:"min-h-screen text-center sm:px-4",children:[p.jsx(Ge.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:p.jsx(gt.Overlay,{className:"fixed inset-0"})}),p.jsx("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),p.jsx(Ge.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:p.jsxs("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all transform bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[p.jsx("div",{className:"flex sticky top-0 z-10 items-center px-3 w-full h-14 text-lg font-medium leading-6 text-gray-900 bg-white modal-header",children:p.jsx("div",{className:"",children:p.jsxs("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:i,children:[p.jsx("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",p.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",p.jsx("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",p.jsx("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),p.jsx("div",{className:"w-full",style:{height:`${n?"calc(100% - 56px)":"auto"}`},children:r})]})})]})})})})}function Xs(e){const{product:r,primaryColor:t,lang:i="en",handleAddToBasket:n,handleGoBack:a,isModal:o=!1,isModalOpen:s=!0,showDebugState:u=!1,handleCloseModal:c=()=>alert("ERROR: handleCloseModal not implemented")}=e,f=Y(w=>w.setInitialFilter),l=Y(w=>w.setInitialSelectedState),d=Y(w=>w.setInitialValidate),g=Y(w=>w.resetExpanded),v=pi(r,ss),{state:{filter:x={},selected:S={}}={}}=v;y.useEffect(()=>{console.log("cleared"),d(),f(x),l(S),g(),oe.changeLanguage(i)},[r]),y.useEffect(()=>{console.log("lang: ",i),oe.changeLanguage(i)},[i]),y.useEffect(()=>{t&&document.documentElement.style.setProperty("--color-primary",t)},[t]);const m=p.jsx(ds,{product:v,handleAddToBasket:n,handleGoBack:a,isModal:o,showDebugState:u});return p.jsx(p.Fragment,{children:o===!0?p.jsx(Zs,{isModalOpen:s,handleCloseModal:c,children:m}):m})}exports.ProductConfigurator=Xs;
|
|
17
|
+
`));return y.cloneElement(l,Object.assign({},Mo(l.props,Li(Cr(s,["ref"]))),d,u,vf(l.ref,u.ref)))}return y.createElement(n,Object.assign({},Cr(s,["ref"]),n!==y.Fragment&&u,n!==y.Fragment&&d),l)}function vf(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}}function Mo(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let i of e)for(let n in i)n.startsWith("on")&&typeof i[n]=="function"?(r[n]!=null||(r[n]=[]),r[n].push(i[n])):t[n]=i[n];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(i=>[i,void 0])));for(let i in r)Object.assign(t,{[i](n,...o){let a=r[i];for(let s of a){if((n instanceof Event||(n==null?void 0:n.nativeEvent)instanceof Event)&&n.defaultPrevented)return;s(n,...o)}}});return t}function le(e){var t;return Object.assign(y.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Li(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function Cr(e,t=[]){let r=Object.assign({},e);for(let i of t)i in r&&delete r[i];return r}function yf(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let i=(t==null?void 0:t.getAttribute("disabled"))==="";return i&&bf(r)?!1:i}function bf(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let Sf="div";var zt=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(zt||{});let Ur=le(function(e,t){let{features:r=1,...i}=e,n={ref:t,"aria-hidden":(r&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return pe({ourProps:n,theirProps:i,slot:{},defaultTag:Sf,name:"Hidden"})}),rn=y.createContext(null);rn.displayName="OpenClosedContext";var Ke=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ke||{});function nn(){return y.useContext(rn)}function Of({value:e,children:t}){return j.default.createElement(rn.Provider,{value:e},t)}var $o=(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))($o||{});function Uo(e,t){let r=y.useRef([]),i=ie(e);y.useEffect(()=>{let n=[...r.current];for(let[o,a]of t.entries())if(r.current[o]!==a){let s=i(t,n);return r.current=t,s}},[i,...t])}function wf(e,t,r){let i=Te(t);y.useEffect(()=>{function n(o){i.current(o)}return window.addEventListener(e,n,r),()=>window.removeEventListener(e,n,r)},[e,r])}var mt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(mt||{});function Ef(){let e=y.useRef(0);return wf("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function ar(){let e=y.useRef(!1);return Re(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function sr(...e){return y.useMemo(()=>tn(...e),[...e])}function on(e,t,r,i){let n=Te(r);y.useEffect(()=>{e=e!=null?e:window;function o(a){n.current(a)}return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)},[e,t,i])}let xf="div";var Vo=(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))(Vo||{});let pt=Object.assign(le(function(e,t){let r=y.useRef(null),i=be(r,t),{initialFocus:n,containers:o,features:a=30,...s}=e;it()||(a=1);let u=sr(r);Pf({ownerDocument:u},Boolean(a&16));let l=Cf({ownerDocument:u,container:r,initialFocus:n},Boolean(a&2));Af({ownerDocument:u,container:r,containers:o,previousActiveElement:l},Boolean(a&8));let d=Ef(),c=ie(m=>{let v=r.current;!v||(b=>b())(()=>{te(d.current,{[mt.Forwards]:()=>_t(v,Be.First,{skipElements:[m.relatedTarget]}),[mt.Backwards]:()=>_t(v,Be.Last,{skipElements:[m.relatedTarget]})})})}),g=en(),f=y.useRef(!1),p={ref:i,onKeyDown(m){m.key=="Tab"&&(f.current=!0,g.requestAnimationFrame(()=>{f.current=!1}))},onBlur(m){let v=new Set(o==null?void 0:o.current);v.add(r);let b=m.relatedTarget;!b||b.dataset.headlessuiFocusGuard!=="true"&&(Bo(v,b)||(f.current?_t(r.current,te(d.current,{[mt.Forwards]:()=>Be.Next,[mt.Backwards]:()=>Be.Previous})|Be.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&We(m.target)))}};return j.default.createElement(j.default.Fragment,null,Boolean(a&4)&&j.default.createElement(Ur,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:zt.Focusable}),pe({ourProps:p,theirProps:s,defaultTag:xf,name:"FocusTrap"}),Boolean(a&4)&&j.default.createElement(Ur,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:c,features:zt.Focusable}))}),{features:Vo});function Pf({ownerDocument:e},t){let r=y.useRef(null);on(e==null?void 0:e.defaultView,"focusout",n=>{!t||r.current||(r.current=n.target)},!0),Uo(()=>{t||((e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&We(r.current),r.current=null)},[t]);let i=y.useRef(!1);y.useEffect(()=>(i.current=!1,()=>{i.current=!0,or(()=>{!i.current||(We(r.current),r.current=null)})}),[])}function Cf({ownerDocument:e,container:t,initialFocus:r},i){let n=y.useRef(null),o=ar();return Uo(()=>{if(!i)return;let a=t.current;!a||or(()=>{if(!o.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){n.current=s;return}}else if(a.contains(s)){n.current=s;return}r!=null&&r.current?We(r.current):_t(a,Be.First)===jo.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),n.current=e==null?void 0:e.activeElement})},[i]),n}function Af({ownerDocument:e,container:t,containers:r,previousActiveElement:i},n){let o=ar();on(e==null?void 0:e.defaultView,"focus",a=>{if(!n||!o.current)return;let s=new Set(r==null?void 0:r.current);s.add(t);let u=i.current;if(!u)return;let l=a.target;l&&l instanceof HTMLElement?Bo(s,l)?(i.current=l,We(l)):(a.preventDefault(),a.stopPropagation(),We(u)):We(i.current)},!0)}function Bo(e,t){var r;for(let i of e)if((r=i.current)!=null&&r.contains(t))return!0;return!1}let Ze=new Set,Fe=new Map;function Ii(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Fi(e){let t=Fe.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Nf(e,t=!0){Re(()=>{if(!t||!e.current)return;let r=e.current,i=tn(r);if(i){Ze.add(r);for(let n of Fe.keys())n.contains(r)&&(Fi(n),Fe.delete(n));return i.querySelectorAll("body > *").forEach(n=>{if(n instanceof HTMLElement){for(let o of Ze)if(n.contains(o))return;Ze.size===1&&(Fe.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),Ii(n))}}),()=>{if(Ze.delete(r),Ze.size>0)i.querySelectorAll("body > *").forEach(n=>{if(n instanceof HTMLElement&&!Fe.has(n)){for(let o of Ze)if(n.contains(o))return;Fe.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),Ii(n)}});else for(let n of Fe.keys())Fi(n),Fe.delete(n)}}},[t])}let Ho=y.createContext(!1);function kf(){return y.useContext(Ho)}function Vr(e){return j.default.createElement(Ho.Provider,{value:e.force},e.children)}function Tf(e){let t=kf(),r=y.useContext(Wo),i=sr(e),[n,o]=y.useState(()=>{if(!t&&r!==null||ir)return null;let a=i==null?void 0:i.getElementById("headlessui-portal-root");if(a)return a;if(i===null)return null;let s=i.createElement("div");return s.setAttribute("id","headlessui-portal-root"),i.body.appendChild(s)});return y.useEffect(()=>{n!==null&&(i!=null&&i.body.contains(n)||i==null||i.body.appendChild(n))},[n,i]),y.useEffect(()=>{t||r!==null&&o(r.current)},[r,o,t]),n}let Rf=y.Fragment,Lf=le(function(e,t){let r=e,i=y.useRef(null),n=be(mf(d=>{i.current=d}),t),o=sr(i),a=Tf(i),[s]=y.useState(()=>{var d;return ir?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),u=it(),l=y.useRef(!1);return Re(()=>{if(l.current=!1,!(!a||!s))return a.contains(s)||(s.setAttribute("data-headlessui-portal",""),a.appendChild(s)),()=>{l.current=!0,or(()=>{var d;!l.current||!a||!s||(a.removeChild(s),a.childNodes.length<=0&&((d=a.parentElement)==null||d.removeChild(a)))})}},[a,s]),u?!a||!s?null:Xo.createPortal(pe({ourProps:{ref:n},theirProps:r,defaultTag:Rf,name:"Portal"}),s):null}),If=y.Fragment,Wo=y.createContext(null),Ff=le(function(e,t){let{target:r,...i}=e,n={ref:be(t)};return j.default.createElement(Wo.Provider,{value:r},pe({ourProps:n,theirProps:i,defaultTag:If,name:"Popover.Group"}))}),Br=Object.assign(Lf,{Group:Ff}),Ko=y.createContext(null);function Yo(){let e=y.useContext(Ko);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Yo),t}return e}function jf(){let[e,t]=y.useState([]);return[e.length>0?e.join(" "):void 0,y.useMemo(()=>function(r){let i=ie(o=>(t(a=>[...a,o]),()=>t(a=>{let s=a.slice(),u=s.indexOf(o);return u!==-1&&s.splice(u,1),s}))),n=y.useMemo(()=>({register:i,slot:r.slot,name:r.name,props:r.props}),[i,r.slot,r.name,r.props]);return j.default.createElement(Ko.Provider,{value:n},r.children)},[t])]}let Df="p",_f=le(function(e,t){let r=ot(),{id:i=`headlessui-description-${r}`,...n}=e,o=Yo(),a=be(t);Re(()=>o.register(i),[i,o.register]);let s={ref:a,...o.props,id:i};return pe({ourProps:s,theirProps:n,slot:o.slot||{},defaultTag:Df,name:o.name||"Description"})}),an=y.createContext(()=>{});an.displayName="StackContext";var Hr=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Hr||{});function Mf(){return y.useContext(an)}function $f({children:e,onUpdate:t,type:r,element:i,enabled:n}){let o=Mf(),a=ie((...s)=>{t==null||t(...s),o(...s)});return Re(()=>{let s=n===void 0||n===!0;return s&&a(0,r,i),()=>{s&&a(1,r,i)}},[a,r,i,n]),j.default.createElement(an.Provider,{value:a},e)}function Uf(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}var Vf=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Vf||{}),Bf=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Bf||{});let Hf={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Qt=y.createContext(null);Qt.displayName="DialogContext";function Ct(e){let t=y.useContext(Qt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ct),r}return t}function Wf(e,t,r=()=>[document.body]){y.useEffect(()=>{var i;if(!t||!e)return;let n=Pt(),o=window.pageYOffset;function a(l,d,c){let g=l.style.getPropertyValue(d);return Object.assign(l.style,{[d]:c}),n.add(()=>{Object.assign(l.style,{[d]:g})})}let s=e.documentElement,u=((i=e.defaultView)!=null?i:window).innerWidth-s.clientWidth;if(a(s,"overflow","hidden"),u>0){let l=s.clientWidth-s.offsetWidth,d=u-l;a(s,"paddingRight",`${d}px`)}if(Uf()){a(e.body,"marginTop",`-${o}px`),window.scrollTo(0,0);let l=null;n.addEventListener(e,"click",d=>{if(d.target instanceof HTMLElement)try{let c=d.target.closest("a");if(!c)return;let{hash:g}=new URL(c.href),f=e.querySelector(g);f&&!r().some(p=>p.contains(f))&&(l=f)}catch{}},!0),n.addEventListener(e,"touchmove",d=>{d.target instanceof HTMLElement&&!r().some(c=>c.contains(d.target))&&d.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+o),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})}return n.dispose},[e,t])}function Kf(e,t){return te(t.type,Hf,e,t)}let Yf="div",Gf=Gt.RenderStrategy|Gt.Static,zf=le(function(e,t){let r=ot(),{id:i=`headlessui-dialog-${r}`,open:n,onClose:o,initialFocus:a,__demoMode:s=!1,...u}=e,[l,d]=y.useState(0),c=nn();n===void 0&&c!==null&&(n=te(c,{[Ke.Open]:!0,[Ke.Closed]:!1}));let g=y.useRef(new Set),f=y.useRef(null),p=be(f,t),m=y.useRef(null),v=sr(f),b=e.hasOwnProperty("open")||c!==null,S=e.hasOwnProperty("onClose");if(!b&&!S)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(!S)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof n!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${n}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let x=n?0:1,[P,L]=y.useReducer(Kf,{titleId:null,descriptionId:null,panelRef:y.createRef()}),D=ie(()=>o(!1)),M=ie(H=>L({type:0,id:H})),_=it()?s?!1:x===0:!1,F=l>1,B=y.useContext(Qt)!==null,T=F?"parent":"leaf";Nf(f,F?_:!1);let I=ie(()=>{var H,ne;return[...Array.from((H=v==null?void 0:v.querySelectorAll("body > *, [data-headlessui-portal]"))!=null?H:[]).filter(K=>!(!(K instanceof HTMLElement)||K.contains(m.current)||P.panelRef.current&&K.contains(P.panelRef.current))),(ne=P.panelRef.current)!=null?ne:f.current]});hf(()=>I(),D,_&&!F),on(v==null?void 0:v.defaultView,"keydown",H=>{H.defaultPrevented||H.key===$o.Escape&&x===0&&(F||(H.preventDefault(),H.stopPropagation(),D()))}),Wf(v,x===0&&!B,I),y.useEffect(()=>{if(x!==0||!f.current)return;let H=new IntersectionObserver(ne=>{for(let K of ne)K.boundingClientRect.x===0&&K.boundingClientRect.y===0&&K.boundingClientRect.width===0&&K.boundingClientRect.height===0&&D()});return H.observe(f.current),()=>H.disconnect()},[x,f,D]);let[$,U]=jf(),J=y.useMemo(()=>[{dialogState:x,close:D,setTitleId:M},P],[x,P,D,M]),W=y.useMemo(()=>({open:x===0}),[x]),z={ref:p,id:i,role:"dialog","aria-modal":x===0?!0:void 0,"aria-labelledby":P.titleId,"aria-describedby":$};return j.default.createElement($f,{type:"Dialog",enabled:x===0,element:f,onUpdate:ie((H,ne,K)=>{ne==="Dialog"&&te(H,{[Hr.Add](){g.current.add(K),d(ce=>ce+1)},[Hr.Remove](){g.current.add(K),d(ce=>ce-1)}})})},j.default.createElement(Vr,{force:!0},j.default.createElement(Br,null,j.default.createElement(Qt.Provider,{value:J},j.default.createElement(Br.Group,{target:f},j.default.createElement(Vr,{force:!1},j.default.createElement(U,{slot:W,name:"Dialog.Description"},j.default.createElement(pt,{initialFocus:a,containers:g,features:_?te(T,{parent:pt.features.RestoreFocus,leaf:pt.features.All&~pt.features.FocusLock}):pt.features.None},pe({ourProps:z,theirProps:u,slot:W,defaultTag:Yf,features:Gf,visible:x===0,name:"Dialog"})))))))),j.default.createElement(Ur,{features:zt.Hidden,ref:m}))}),Qf="div",qf=le(function(e,t){let r=ot(),{id:i=`headlessui-dialog-overlay-${r}`,...n}=e,[{dialogState:o,close:a}]=Ct("Dialog.Overlay"),s=be(t),u=ie(d=>{if(d.target===d.currentTarget){if(yf(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),a()}}),l=y.useMemo(()=>({open:o===0}),[o]);return pe({ourProps:{ref:s,id:i,"aria-hidden":!0,onClick:u},theirProps:n,slot:l,defaultTag:Qf,name:"Dialog.Overlay"})}),Jf="div",Zf=le(function(e,t){let r=ot(),{id:i=`headlessui-dialog-backdrop-${r}`,...n}=e,[{dialogState:o},a]=Ct("Dialog.Backdrop"),s=be(t);y.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let u=y.useMemo(()=>({open:o===0}),[o]);return j.default.createElement(Vr,{force:!0},j.default.createElement(Br,null,pe({ourProps:{ref:s,id:i,"aria-hidden":!0},theirProps:n,slot:u,defaultTag:Jf,name:"Dialog.Backdrop"})))}),Xf="div",ed=le(function(e,t){let r=ot(),{id:i=`headlessui-dialog-panel-${r}`,...n}=e,[{dialogState:o},a]=Ct("Dialog.Panel"),s=be(t,a.panelRef),u=y.useMemo(()=>({open:o===0}),[o]),l=ie(d=>{d.stopPropagation()});return pe({ourProps:{ref:s,id:i,onClick:l},theirProps:n,slot:u,defaultTag:Xf,name:"Dialog.Panel"})}),td="h2",rd=le(function(e,t){let r=ot(),{id:i=`headlessui-dialog-title-${r}`,...n}=e,[{dialogState:o,setTitleId:a}]=Ct("Dialog.Title"),s=be(t);y.useEffect(()=>(a(i),()=>a(null)),[i,a]);let u=y.useMemo(()=>({open:o===0}),[o]);return pe({ourProps:{ref:s,id:i},theirProps:n,slot:u,defaultTag:td,name:"Dialog.Title"})}),ji=Object.assign(zf,{Backdrop:Zf,Panel:ed,Overlay:qf,Title:rd,Description:_f});function nd(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function Ar(e,...t){e&&t.length>0&&e.classList.add(...t)}function Nr(e,...t){e&&t.length>0&&e.classList.remove(...t)}function id(e,t){let r=Pt();if(!e)return r.dispose;let{transitionDuration:i,transitionDelay:n}=getComputedStyle(e),[o,a]=[i,n].map(s=>{let[u=0]=s.split(",").filter(Boolean).map(l=>l.includes("ms")?parseFloat(l):parseFloat(l)*1e3).sort((l,d)=>d-l);return u});if(o+a!==0){let s=r.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),s())})}else t();return r.add(()=>t()),r.dispose}function od(e,t,r,i){let n=r?"enter":"leave",o=Pt(),a=i!==void 0?nd(i):()=>{};n==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=te(n,{enter:()=>t.enter,leave:()=>t.leave}),u=te(n,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),l=te(n,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Nr(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Ar(e,...s,...l),o.nextFrame(()=>{Nr(e,...l),Ar(e,...u),id(e,()=>(Nr(e,...s),Ar(e,...t.entered),a()))}),o.dispose}function ad({container:e,direction:t,classes:r,onStart:i,onStop:n}){let o=ar(),a=en(),s=Te(t);Re(()=>{let u=Pt();a.add(u.dispose);let l=e.current;if(!!l&&s.current!=="idle"&&!!o.current)return u.dispose(),i.current(s.current),u.add(od(l,r.current,s.current==="enter",()=>{u.dispose(),n.current(s.current)})),u.dispose},[t])}function sd(...e){return e.filter(Boolean).join(" ")}function $e(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let ur=y.createContext(null);ur.displayName="TransitionContext";var ud=(e=>(e.Visible="visible",e.Hidden="hidden",e))(ud||{});function ld(){let e=y.useContext(ur);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function cd(){let e=y.useContext(lr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let lr=y.createContext(null);lr.displayName="NestingContext";function cr(e){return"children"in e?cr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Go(e,t){let r=Te(e),i=y.useRef([]),n=ar(),o=en(),a=ie((f,p=ke.Hidden)=>{let m=i.current.findIndex(({el:v})=>v===f);m!==-1&&(te(p,{[ke.Unmount](){i.current.splice(m,1)},[ke.Hidden](){i.current[m].state="hidden"}}),o.microTask(()=>{var v;!cr(i)&&n.current&&((v=r.current)==null||v.call(r))}))}),s=ie(f=>{let p=i.current.find(({el:m})=>m===f);return p?p.state!=="visible"&&(p.state="visible"):i.current.push({el:f,state:"visible"}),()=>a(f,ke.Unmount)}),u=y.useRef([]),l=y.useRef(Promise.resolve()),d=y.useRef({enter:[],leave:[],idle:[]}),c=ie((f,p,m)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([v])=>v!==f)),t==null||t.chains.current[p].push([f,new Promise(v=>{u.current.push(v)})]),t==null||t.chains.current[p].push([f,new Promise(v=>{Promise.all(d.current[p].map(([b,S])=>S)).then(()=>v())})]),p==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(p)):m(p)}),g=ie((f,p,m)=>{Promise.all(d.current[p].splice(0).map(([v,b])=>b)).then(()=>{var v;(v=u.current.shift())==null||v()}).then(()=>m(p))});return y.useMemo(()=>({children:i,register:s,unregister:a,onStart:c,onStop:g,wait:l,chains:d}),[s,a,i,c,g,d,l])}function fd(){}let dd=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Di(e){var t;let r={};for(let i of dd)r[i]=(t=e[i])!=null?t:fd;return r}function gd(e){let t=y.useRef(Di(e));return y.useEffect(()=>{t.current=Di(e)},[e]),t}let pd="div",zo=Gt.RenderStrategy,Qo=le(function(e,t){let{beforeEnter:r,afterEnter:i,beforeLeave:n,afterLeave:o,enter:a,enterFrom:s,enterTo:u,entered:l,leave:d,leaveFrom:c,leaveTo:g,...f}=e,p=y.useRef(null),m=be(p,t),v=f.unmount?ke.Unmount:ke.Hidden,{show:b,appear:S,initial:x}=ld(),[P,L]=y.useState(b?"visible":"hidden"),D=cd(),{register:M,unregister:_}=D,F=y.useRef(null);y.useEffect(()=>M(p),[M,p]),y.useEffect(()=>{if(v===ke.Hidden&&!!p.current){if(b&&P!=="visible"){L("visible");return}return te(P,{hidden:()=>_(p),visible:()=>M(p)})}},[P,p,M,_,b,v]);let B=Te({enter:$e(a),enterFrom:$e(s),enterTo:$e(u),entered:$e(l),leave:$e(d),leaveFrom:$e(c),leaveTo:$e(g)}),T=gd({beforeEnter:r,afterEnter:i,beforeLeave:n,afterLeave:o}),I=it();y.useEffect(()=>{if(I&&P==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,P,I]);let $=x&&!S,U=(()=>!I||$||F.current===b?"idle":b?"enter":"leave")(),J=ie(K=>te(K,{enter:()=>T.current.beforeEnter(),leave:()=>T.current.beforeLeave(),idle:()=>{}})),W=ie(K=>te(K,{enter:()=>T.current.afterEnter(),leave:()=>T.current.afterLeave(),idle:()=>{}})),z=Go(()=>{L("hidden"),_(p)},D);ad({container:p,classes:B,direction:U,onStart:Te(K=>{z.onStart(p,K,J)}),onStop:Te(K=>{z.onStop(p,K,W),K==="leave"&&!cr(z)&&(L("hidden"),_(p))})}),y.useEffect(()=>{!$||(v===ke.Hidden?F.current=null:F.current=b)},[b,$,P]);let H=f,ne={ref:m};return S&&b&&(typeof window=="undefined"||typeof document=="undefined")&&(H={...H,className:sd(f.className,...B.current.enter,...B.current.enterFrom)}),j.default.createElement(lr.Provider,{value:z},j.default.createElement(Of,{value:te(P,{visible:Ke.Open,hidden:Ke.Closed})},pe({ourProps:ne,theirProps:H,defaultTag:pd,features:zo,visible:P==="visible",name:"Transition.Child"})))}),Wr=le(function(e,t){let{show:r,appear:i=!1,unmount:n,...o}=e,a=y.useRef(null),s=be(a,t);it();let u=nn();if(r===void 0&&u!==null&&(r=te(u,{[Ke.Open]:!0,[Ke.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[l,d]=y.useState(r?"visible":"hidden"),c=Go(()=>{d("hidden")}),[g,f]=y.useState(!0),p=y.useRef([r]);Re(()=>{g!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),f(!1))},[p,r]);let m=y.useMemo(()=>({show:r,appear:i,initial:g}),[r,i,g]);y.useEffect(()=>{if(r)d("visible");else if(!cr(c))d("hidden");else{let b=a.current;if(!b)return;let S=b.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&d("hidden")}},[r,c]);let v={unmount:n};return j.default.createElement(lr.Provider,{value:c},j.default.createElement(ur.Provider,{value:m},pe({ourProps:{...v,as:y.Fragment,children:j.default.createElement(Qo,{ref:s,...v,...o})},theirProps:{},defaultTag:y.Fragment,features:zo,visible:l==="visible",name:"Transition"})))}),hd=le(function(e,t){let r=y.useContext(ur)!==null,i=nn()!==null;return j.default.createElement(j.default.Fragment,null,!r&&i?j.default.createElement(Wr,{ref:t,...e}):j.default.createElement(Qo,{ref:t,...e}))}),kr=Object.assign(Wr,{Child:hd,Root:Wr});function md(e){const{children:t,isOpen:r,handleClose:i}=e,{isMobile:n}=Io({isModal:!0});return w(xe,{children:w(kr,{appear:!0,show:r,as:y.Fragment,children:w(ji,{as:"div",className:"overflow-y-auto fixed inset-0 z-10",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:i,children:V("div",{className:"min-h-screen text-center sm:px-4",children:[w(kr.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:w(ji.Overlay,{className:"fixed inset-0"})}),w("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),w(kr.Child,{as:y.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:V("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[w("div",{className:"flex sticky top-0 z-10 items-center px-3 w-full h-14 text-lg font-medium leading-6 text-gray-900 bg-white modal-header",children:w("div",{className:"",children:V("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:i,children:[w("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",w("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",w("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",w("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),w("div",{className:"w-full",style:{height:`${n?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function vd(e){var U,J,W,z;const{product:t,isOpen:r,handleGoBack:i,showDebugState:n=!1,countedProductPrice:o,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l,children:d}=e,{minPrice:c="0"}=t,[g,f]=y.useState("auto"),[p,m]=y.useState(0);y.useEffect(()=>{m(1);const H=setTimeout(()=>{L||m(2)},250);return()=>{clearTimeout(H)}},[]);const{displayPriceFrom:v,formattedEndPrice:b}=cc(o,c,a),S=y.useRef(),x=y.useRef(),{isSm:P,isMobile:L,windowHeight:D}=Io({isModal:!0}),M=V(xe,{children:[V("div",{className:gt("px-4 w-full",P&&"sm:sticky sm:top-0 sm:w-2/5"),ref:S,children:[t.details.media&&t.details.media[0].url&&w("img",{className:gt("mx-auto mt-2 mb-6 max-h-[250px]",P&&"max-h-[450px]"),alt:t.details.literals.name,src:(U=t.details)==null?void 0:U.media[0].url}),w("div",{className:gt(!n&&"hidden"),children:w(sf,{})})]}),V("div",{className:gt("w-full",P&&"sm:w-3/5"),ref:x,children:[V("div",{className:"items-center w-full p-4",children:[V("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[V("span",{className:"",children:[t.details.literals.name," "]}),w(rr,{price:e.countedProductPrice,minPrice:c})]}),w("span",{className:"text-gray-600",children:(J=t.details.literals)==null?void 0:J.description})]}),V("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[d,w("div",{className:"sm:h-[64px]"})]}),P&&w("div",{className:"-mt-5 mb-2 bg-gray-100",children:w(ki,{finalPrice:b,isBackIcon:!1,handleGoBack:i,displayPriceFrom:v})})]})]}),_=(W=S==null?void 0:S.current)==null?void 0:W.clientHeight,F=(z=x==null?void 0:x.current)==null?void 0:z.clientHeight,B=_+F;B>window.innerHeight*.8||isNaN(B)?g!=="80vh"&&f("80vh"):g!=="auto"&&f("auto");const T=`${D-64-56}px`,I=!P,$={"--mobile-submit-row-top":`${D-64-80}px`};return w(md,{isOpen:Boolean(r),handleClose:i,children:V("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[w("div",{className:gt("flex relative flex-col items-start w-full form-body stretch",!I&&"sm:flex-row-reverse sm:pb-0",!L&&"mobile-scrollbar"),style:{height:`${L?T:g}`,minHeight:"400px",overflowY:"scroll"},children:M}),I&&w("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${L?"submit-row-mobile":"submit-row"}`,style:$,children:w(ki,{handleGoBack:i,finalPrice:b,isBackIcon:!1,productQuantity:a,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:l})})]})})}const yd=e=>{const{product:t}=e,{MenuProductRootUI:r}=nr(),i=er(t.items)?w(xe,{}):w(Xr,{productItems:t.items,parentProduct:t});return r?w(r,{...e,children:i}):w(vd,{...e,children:i})};function bd(e){const{product:t,lang:r="en",handleAddToCart:i,handleGoBack:n,isOpen:o,handleClose:a}=e,{price:s}=t,{encodedProduct:u,initSelected:l,filter:d,productQuantity:c,setIsOnSubmittedOnTrue:g,getInvalidSelCtxArray:f,increaseProductQuantity:p,decreaseProductQuantity:m}=Nl(t);y.useEffect(()=>{oe.changeLanguage(r)},[r]);const v=es({defaultValues:{selected:l}}),{handleSubmit:b,getValues:S}=v,x=(parseFloat(s||"0")+Jr(S("selected"),t)).toFixed(2),P=()=>{console.log("onSubmit"),g();const D=f();if(D.length)hs(lo(D[0])),console.log({invalidContextNames:D});else{console.log("selected",S("selected"));const M=gs(ds(S("selected")));console.log("decodedCleanedSelected: ",M),i({price:x,quantity:c,selected:M,filter:d})}},L=()=>P();return w(xe,{children:w(Ro.Provider,{value:e.components,children:w(_a,{...v,children:w("form",{onSubmit:b(P),children:w(yd,{product:u,productQuantity:c,isOpen:o,handleClose:a,handleGoBack:n,handleOnSubmit:L,countedProductPrice:Number(x),increaseProductQuantity:p,decreaseProductQuantity:m})})})})})}exports.ProductConfigurator=bd;
|
|
8
18
|
//# sourceMappingURL=index.cjs.js.map
|