@orderingstack/front-components-product-configurator 0.0.3 → 0.0.6

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 CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";var Mi=Object.defineProperty,Ii=Object.defineProperties;var _i=Object.getOwnPropertyDescriptors;var Fr=Object.getOwnPropertySymbols;var $i=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable;var Ar=(e,r,t)=>r in e?Mi(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ue=(e,r)=>{for(var t in r||(r={}))$i.call(r,t)&&Ar(e,t,r[t]);if(Fr)for(var t of Fr(r))Vi.call(r,t)&&Ar(e,t,r[t]);return e},Qe=(e,r)=>Ii(e,_i(r));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var y=require("react"),Rr=require("react-spring"),Ui=require("react-dom");function Hi(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var he=Hi(y);var vt=e=>e.type==="checkbox",et=e=>e instanceof Date,fe=e=>e==null;const Hn=e=>typeof e=="object";var ae=e=>!fe(e)&&!Array.isArray(e)&&Hn(e)&&!et(e),Bi=e=>ae(e)&&e.target?vt(e.target)?e.target.checked:e.target.value:e,Wi=e=>e.substring(0,e.search(/.\d/))||e,zi=(e,r)=>[...e].some(t=>Wi(r)===t),Vt=e=>e.filter(Boolean),ie=e=>e===void 0,j=(e,r,t)=>{if(!r||!ae(e))return t;const i=Vt(r.split(/[,[\].]+?/)).reduce((n,a)=>fe(n)?n:n[a],e);return ie(i)||i===e?ie(e[r])?t:e[r]:i};const Tr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},be={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};var Ut=(e,r)=>{const t=Object.assign({},e);return delete t[r],t};const Bn=he.default.createContext(null),mt=()=>he.default.useContext(Bn),qi=e=>he.default.createElement(Bn.Provider,{value:Ut(e,"children")},e.children);var Gi=(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},ge=e=>ae(e)&&!Object.keys(e).length,Ki=(e,r,t)=>{const i=Ut(e,"name");return ge(i)||Object.keys(i).length>=Object.keys(r).length||Object.keys(i).find(n=>r[n]===(!t||be.all))},er=e=>Array.isArray(e)?e:[e];function Qi(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",Ji=(e,r,t,i)=>{const n=Array.isArray(e);return Pe(e)?(i&&r.watch.add(e),j(t,e)):n?e.map(a=>(i&&r.watch.add(a),j(t,a))):(i&&(r.watchAll=!0),t)},Ht=e=>typeof e=="function",Wn=e=>{for(const r in e)if(Ht(e[r]))return!0;return!1},Yi=(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})}):{},yr=e=>/^\w*$/.test(e),zn=e=>Vt(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Y(e,r,t){let i=-1;const n=yr(r)?[r]:zn(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 dr=(e,r,t)=>{for(const i of t||Object.keys(e)){const n=j(e,i);if(n){const a=n._f,o=Ut(n,"_f");if(a&&r(a.name)){if(a.ref.focus&&ie(a.ref.focus()))break;if(a.refs){a.refs[0].focus();break}}else ae(o)&&dr(o,r)}}};var Dr=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));function Xe(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(Ht(e[i])){r=e;break}r[i]=Xe(e[i])}}else return e;return r}function tr(){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 jt=e=>fe(e)||!Hn(e);function tt(e,r){if(jt(e)||jt(r))return e===r;if(et(e)&&et(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(et(a)&&et(o)||ae(a)&&ae(o)||Array.isArray(a)&&Array.isArray(o)?!tt(a,o):a!==o)return!1}}return!0}var Mr=e=>({isOnSubmit:!e||e===be.onSubmit,isOnBlur:e===be.onBlur,isOnChange:e===be.onChange,isOnAll:e===be.all,isOnTouch:e===be.onTouched}),gt=e=>typeof e=="boolean",br=e=>e.type==="file",gr=e=>e instanceof HTMLElement,qn=e=>e.type==="select-multiple",Or=e=>e.type==="radio",Zi=e=>Or(e)||vt(e),Ir=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined",rr=e=>gr(e)&&e.isConnected;function Xi(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=ie(e)?i++:e[r[i++]];return e}function le(e,r){const t=yr(r)?[r]:zn(r),i=t.length==1?e:Xi(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)&&ge(u)||Array.isArray(u)&&!u.filter(d=>ae(d)&&!ge(d)||gt(d)).length)&&(a?delete a[l]:delete e[l]),a=u}}return e}function Ft(e,r={}){const t=Array.isArray(e);if(ae(e)||t)for(const i in e)Array.isArray(e[i])||ae(e[i])&&!Wn(e[i])?(r[i]=Array.isArray(e[i])?[]:{},Ft(e[i],r[i])):fe(e[i])||(r[i]=!0);return r}function Gn(e,r,t){const i=Array.isArray(e);if(ae(e)||i)for(const n in e)Array.isArray(e[n])||ae(e[n])&&!Wn(e[n])?ie(r)||jt(t[n])?t[n]=Array.isArray(e[n])?Ft(e[n],[]):Object.assign({},Ft(e[n])):Gn(e[n],fe(r)?{}:r[n],t[n]):t[n]=!tt(e[n],r[n]);return t}var _r=(e,r)=>Gn(e,r,Ft(r));const $r={value:!1,isValid:!1},Vr={value:!0,isValid:!0};var Kn=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&&!ie(e[0].attributes.value)?ie(e[0].value)||e[0].value===""?Vr:{value:e[0].value,isValid:!0}:Vr:$r}return $r},Qn=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>ie(e)?e:r?e===""?NaN:+e:t&&Pe(e)?new Date(e):i?i(e):e;const Ur={isValid:!1,value:null};var Jn=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Ur):Ur;function nr(e){const r=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):r.disabled))return br(r)?r.files:Or(r)?Jn(e.refs).value:qn(r)?[...r.selectedOptions].map(({value:t})=>t):vt(r)?Kn(e.refs).value:Qn(ie(r.value)?e.ref.value:r.value,e)}var ea=(e,r,t,i)=>{const n={};for(const a of e){const o=j(r,a);o&&Y(n,a,o._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},At=e=>e instanceof RegExp,it=e=>ie(e)?void 0:At(e)?e.source:ae(e)?At(e.value)?e.value.source:e.value:e,ta=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Hr(e,r,t){const i=j(e,t);if(i||yr(t))return{error:i,name:t};const n=t.split(".");for(;n.length;){const a=n.join("."),o=j(r,a),s=j(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 ra=(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,na=(e,r)=>!Vt(j(e,r)).length&&le(e,r),Et=e=>Pe(e)||he.default.isValidElement(e);function Br(e,r,t="validate"){if(Et(e)||Array.isArray(e)&&e.every(Et)||gt(e)&&!e)return{type:t,message:Et(e)?e:"",ref:r}}var Je=e=>ae(e)&&!At(e)?e:{value:e,message:""},Wr=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:p,mount:O,disabled:w}=e._f;if(!O||w)return{};const v=a?a[0]:n,P=E=>{i&&v.reportValidity&&(v.setCustomValidity(gt(E)?"":E||" "),v.reportValidity())},C={},k=Or(n),D=vt(n),T=k||D,R=(p||br(n))&&!n.value||r===""||Array.isArray(r)&&!r.length,M=Yi.bind(null,g,t,C),_=(E,A,$,U=je.maxLength,W=je.minLength)=>{const Q=E?A:$;C[g]=Object.assign({type:E?U:W,message:Q,ref:n},M(E?U:W,Q))};if(o&&(!T&&(R||fe(r))||gt(r)&&!r||D&&!Kn(a).isValid||k&&!Jn(a).isValid)){const{value:E,message:A}=Et(o)?{value:!!o,message:o}:Je(o);if(E&&(C[g]=Object.assign({type:je.required,message:A,ref:v},M(je.required,A)),!t))return P(A),C}if(!R&&(!fe(c)||!fe(f))){let E,A;const $=Je(f),U=Je(c);if(isNaN(r)){const W=n.valueAsDate||new Date(r);Pe($.value)&&(E=W>new Date($.value)),Pe(U.value)&&(A=W<new Date(U.value))}else{const W=n.valueAsNumber||+r;fe($.value)||(E=W>$.value),fe(U.value)||(A=W<U.value)}if((E||A)&&(_(!!E,$.message,U.message,je.max,je.min),!t))return P(C[g].message),C}if((s||u)&&!R&&Pe(r)){const E=Je(s),A=Je(u),$=!fe(E.value)&&r.length>E.value,U=!fe(A.value)&&r.length<A.value;if(($||U)&&(_($,E.message,A.message),!t))return P(C[g].message),C}if(l&&!R&&Pe(r)){const{value:E,message:A}=Je(l);if(At(E)&&!r.match(E)&&(C[g]=Object.assign({type:je.pattern,message:A,ref:n},M(je.pattern,A)),!t))return P(A),C}if(d){if(Ht(d)){const E=await d(r),A=Br(E,v);if(A&&(C[g]=Object.assign(Object.assign({},A),M(je.validate,A.message)),!t))return P(A.message),C}else if(ae(d)){let E={};for(const A in d){if(!ge(E)&&!t)break;const $=Br(await d[A](r),v,A);$&&(E=Object.assign(Object.assign({},$),M(A,$.message)),P($.message),t&&(C[g]=E))}if(!ge(E)&&(C[g]=Object.assign({ref:v},E),!t))return C}}return P(!0),C};const ia={mode:be.onSubmit,reValidateMode:be.onChange,shouldFocusError:!0};function aa(e={}){let r=Object.assign(Object.assign({},ia),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?{}:Xe(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:tr(),array:tr(),state:tr()},g=Mr(r.mode),p=Mr(r.reValidateMode),O=r.criteriaMode===be.all,w=(h,m)=>(...S)=>{clearTimeout(c),c=window.setTimeout(()=>h(...S),m)},v=async h=>{let m=!1;return l.isValid&&(m=r.resolver?ge((await R()).errors):await _(i,!0),!h&&m!==t.isValid&&(t.isValid=m,d.state.next({isValid:m}))),m},P=(h,m=[],S,N,L=!0,x=!0)=>{if(N&&S){if(o.action=!0,x&&Array.isArray(j(i,h))){const F=S(j(i,h),N.argA,N.argB);L&&Y(i,h,F)}if(l.errors&&x&&Array.isArray(j(t.errors,h))){const F=S(j(t.errors,h),N.argA,N.argB);L&&Y(t.errors,h,F),na(t.errors,h)}if(l.touchedFields&&Array.isArray(j(t.touchedFields,h))){const F=S(j(t.touchedFields,h),N.argA,N.argB);L&&Y(t.touchedFields,h,F)}l.dirtyFields&&(t.dirtyFields=_r(n,a)),d.state.next({isDirty:A(h,m),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else Y(a,h,m)},C=(h,m)=>(Y(t.errors,h,m),d.state.next({errors:t.errors})),k=(h,m,S,N)=>{const L=j(i,h);if(L){const x=j(a,h,ie(S)?j(n,h):S);ie(x)||N&&N.defaultChecked||m?Y(a,h,m?x:nr(L._f)):W(h,x),o.mount&&v()}},D=(h,m,S,N,L)=>{let x=!1;const F={name:h},z=j(t.touchedFields,h);if(l.isDirty){const Re=t.isDirty;t.isDirty=F.isDirty=A(),x=Re!==F.isDirty}if(l.dirtyFields&&(!S||N)){const Re=j(t.dirtyFields,h);tt(j(n,h),m)?le(t.dirtyFields,h):Y(t.dirtyFields,h,!0),F.dirtyFields=t.dirtyFields,x=x||Re!==j(t.dirtyFields,h)}return S&&!z&&(Y(t.touchedFields,h,S),F.touchedFields=t.touchedFields,x=x||l.touchedFields&&z!==S),x&&L&&d.state.next(F),x?F:{}},T=async(h,m,S,N,L)=>{const x=j(t.errors,m),F=l.isValid&&t.isValid!==S;if(e.delayError&&N?(u=u||w(C,e.delayError),u(m,N)):(clearTimeout(c),N?Y(t.errors,m,N):le(t.errors,m)),((N?!tt(x,N):x)||!ge(L)||F)&&!h){const z=Object.assign(Object.assign(Object.assign({},L),F?{isValid:S}:{}),{errors:t.errors,name:m});t=Object.assign(Object.assign({},t),z),d.state.next(z)}f[m]--,l.isValidating&&!Object.values(f).some(z=>z)&&(d.state.next({isValidating:!1}),f={})},R=async h=>r.resolver?await r.resolver(Object.assign({},a),r.context,ea(h||s.mount,i,r.criteriaMode,r.shouldUseNativeValidation)):{},M=async h=>{const{errors:m}=await R();if(h)for(const S of h){const N=j(m,S);N?Y(t.errors,S,N):le(t.errors,S)}else t.errors=m;return m},_=async(h,m,S={valid:!0})=>{for(const N in h){const L=h[N];if(L){const x=L._f,F=Ut(L,"_f");if(x){const z=await Wr(L,j(a,x.name),O,r.shouldUseNativeValidation);if(z[x.name]&&(S.valid=!1,m))break;m||(z[x.name]?Y(t.errors,x.name,z[x.name]):le(t.errors,x.name))}F&&await _(F,m,S)}}return S.valid},E=()=>{for(const h of s.unMount){const m=j(i,h);m&&(m._f.refs?m._f.refs.every(S=>!rr(S)):!rr(m._f.ref))&&ne(h)}s.unMount=new Set},A=(h,m)=>(h&&m&&Y(a,h,m),!tt(Z(),n)),$=(h,m,S)=>{const N=Object.assign({},o.mount?a:ie(m)?n:Pe(h)?{[h]:m}:m);return Ji(h,s,N,S)},U=h=>Vt(j(o.mount?a:n,h,e.shouldUnregister?j(n,h,[]):[])),W=(h,m,S={})=>{const N=j(i,h);let L=m;if(N){const x=N._f;x&&(!x.disabled&&Y(a,h,Qn(m,x)),L=Ir&&gr(x.ref)&&fe(m)?"":m,qn(x.ref)?[...x.ref.options].forEach(F=>F.selected=L.includes(F.value)):x.refs?vt(x.ref)?x.refs.length>1?x.refs.forEach(F=>F.checked=Array.isArray(L)?!!L.find(z=>z===F.value):L===F.value):x.refs[0]&&(x.refs[0].checked=!!L):x.refs.forEach(F=>F.checked=F.value===L):br(x.ref)?x.ref.value="":(x.ref.value=L,x.ref.type||d.watch.next({name:h})))}(S.shouldDirty||S.shouldTouch)&&D(h,L,S.shouldTouch,S.shouldDirty,!0),S.shouldValidate&&te(h)},Q=(h,m,S)=>{for(const N in m){const L=m[N],x=`${h}.${N}`,F=j(i,x);(s.array.has(h)||!jt(L)||F&&!F._f)&&!et(L)?Q(x,L,S):W(x,L,S)}},H=(h,m,S={})=>{const N=j(i,h),L=s.array.has(h),x=Xe(m);Y(a,h,x),L?(d.array.next({name:h,values:a}),(l.isDirty||l.dirtyFields)&&S.shouldDirty&&(t.dirtyFields=_r(n,a),d.state.next({name:h,dirtyFields:t.dirtyFields,isDirty:A(h,x)}))):N&&!N._f&&!fe(x)?Q(h,x,S):W(h,x,S),Dr(h,s)&&d.state.next({}),d.watch.next({name:h})},J=async h=>{const m=h.target;let S=m.name;const N=j(i,S);if(N){let L,x;const F=m.type?nr(N._f):Bi(h),z=h.type===Tr.BLUR||h.type===Tr.FOCUS_OUT,Re=!ta(N._f)&&!r.resolver&&!j(t.errors,S)&&!N._f.deps||ra(z,j(t.touchedFields,S),t.isSubmitted,p,g),wt=Dr(S,s,z);Y(a,S,F),z?N._f.onBlur&&N._f.onBlur(h):N._f.onChange&&N._f.onChange(h);const Xt=D(S,F,z,!1),Ti=!ge(Xt)||wt;if(!z&&d.watch.next({name:S,type:h.type}),Re)return Ti&&d.state.next(Object.assign({name:S},wt?{}:Xt));if(!z&&wt&&d.state.next({}),f[S]=(f[S],1),d.state.next({isValidating:!0}),r.resolver){const{errors:Lr}=await R([S]),Di=Hr(t.errors,i,S),jr=Hr(Lr,i,Di.name||S);L=jr.error,S=jr.name,x=ge(Lr)}else L=(await Wr(N,j(a,S),O,r.shouldUseNativeValidation))[S],x=await v(!0);N._f.deps&&te(N._f.deps),T(!1,S,x,L,Xt)}},te=async(h,m={})=>{let S,N;const L=er(h);if(d.state.next({isValidating:!0}),r.resolver){const x=await M(ie(h)?h:L);S=ge(x),N=h?!L.some(F=>j(x,F)):S}else h?(N=(await Promise.all(L.map(async x=>{const F=j(i,x);return await _(F&&F._f?{[x]:F}:F)}))).every(Boolean),!(!N&&!t.isValid)&&v()):N=S=await _(i);return d.state.next(Object.assign(Object.assign(Object.assign({},!Pe(h)||l.isValid&&S!==t.isValid?{}:{name:h}),r.resolver?{isValid:S}:{}),{errors:t.errors,isValidating:!1})),m.shouldFocus&&!N&&dr(i,x=>j(t.errors,x),h?L:s.mount),N},Z=h=>{const m=Object.assign(Object.assign({},n),o.mount?a:{});return ie(h)?m:Pe(h)?j(m,h):h.map(S=>j(m,S))},X=(h,m)=>({invalid:!!j((m||t).errors,h),isDirty:!!j((m||t).dirtyFields,h),isTouched:!!j((m||t).touchedFields,h),error:j((m||t).errors,h)}),I=h=>{h?er(h).forEach(m=>le(t.errors,m)):t.errors={},d.state.next({errors:t.errors})},B=(h,m,S)=>{const N=(j(i,h,{_f:{}})._f||{}).ref;Y(t.errors,h,Object.assign(Object.assign({},m),{ref:N})),d.state.next({name:h,errors:t.errors,isValid:!1}),S&&S.shouldFocus&&N&&N.focus&&N.focus()},re=(h,m)=>Ht(h)?d.watch.subscribe({next:S=>h($(void 0,m),S)}):$(h,m,!0),ne=(h,m={})=>{for(const S of h?er(h):s.mount)s.mount.delete(S),s.array.delete(S),j(i,S)&&(m.keepValue||(le(i,S),le(a,S)),!m.keepError&&le(t.errors,S),!m.keepDirty&&le(t.dirtyFields,S),!m.keepTouched&&le(t.touchedFields,S),!r.shouldUnregister&&!m.keepDefaultValue&&le(n,S));d.watch.next({}),d.state.next(Object.assign(Object.assign({},t),m.keepDirty?{isDirty:A()}:{})),!m.keepIsValid&&v()},q=(h,m={})=>{let S=j(i,h);const N=gt(m.disabled);return Y(i,h,{_f:Object.assign(Object.assign(Object.assign({},S&&S._f?S._f:{ref:{name:h}}),{name:h,mount:!0}),m)}),s.mount.add(h),S?N&&Y(a,h,m.disabled?void 0:j(a,h,nr(S._f))):k(h,!0,m.value),Object.assign(Object.assign(Object.assign({},N?{disabled:m.disabled}:{}),r.shouldUseNativeValidation?{required:!!m.required,min:it(m.min),max:it(m.max),minLength:it(m.minLength),maxLength:it(m.maxLength),pattern:it(m.pattern)}:{}),{name:h,onChange:J,onBlur:J,ref:L=>{if(L){q(h,m),S=j(i,h);const x=ie(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,F=Zi(x),z=S._f.refs||[];if(F?z.find(Re=>Re===x):x===S._f.ref)return;Y(i,h,{_f:Object.assign(Object.assign({},S._f),F?{refs:z.concat(x).filter(rr),ref:{type:x.type,name:h}}:{ref:x})}),k(h,!1,void 0,x)}else S=j(i,h,{}),S._f&&(S._f.mount=!1),(r.shouldUnregister||m.shouldUnregister)&&!(zi(s.array,h)&&o.action)&&s.unMount.add(h)}})};return{control:{register:q,unregister:ne,getFieldState:X,_executeSchema:R,_getWatch:$,_getDirty:A,_updateValid:v,_removeUnmounted:E,_updateFieldArray:P,_getFieldArray:U,_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:te,register:q,handleSubmit:(h,m)=>async S=>{S&&(S.preventDefault&&S.preventDefault(),S.persist&&S.persist());let N=!0,L=Xe(a);d.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:x,values:F}=await R();t.errors=x,L=F}else await _(i);ge(t.errors)&&Object.keys(t.errors).every(x=>j(L,x))?(d.state.next({errors:{},isSubmitting:!0}),await h(L,S)):(m&&await m(Object.assign({},t.errors),S),r.shouldFocusError&&dr(i,x=>j(t.errors,x),s.mount))}catch(x){throw N=!1,x}finally{t.isSubmitted=!0,d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ge(t.errors)&&N,submitCount:t.submitCount+1,errors:t.errors})}},watch:re,setValue:H,getValues:Z,reset:(h,m={})=>{const S=h||n,N=Xe(S),L=h&&!ge(h)?N:n;if(m.keepDefaultValues||(n=S),!m.keepValues){if(Ir&&ie(h))for(const x of s.mount){const F=j(i,x);if(F&&F._f){const z=Array.isArray(F._f.refs)?F._f.refs[0]:F._f.ref;try{gr(z)&&z.closest("form").reset();break}catch{}}}a=e.shouldUnregister?m.keepDefaultValues?Xe(n):{}:N,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||!!m.keepIsValid,o.watch=!!e.shouldUnregister,d.state.next({submitCount:m.keepSubmitCount?t.submitCount:0,isDirty:m.keepDirty?t.isDirty:m.keepDefaultValues?!tt(h,n):!1,isSubmitted:m.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:m.keepDirty?t.dirtyFields:m.keepDefaultValues&&h?Object.entries(h).reduce((x,[F,z])=>Object.assign(Object.assign({},x),{[F]:z!==j(n,F)}),{}):{},touchedFields:m.keepTouched?t.touchedFields:{},errors:m.keepErrors?t.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(h,m={})=>{j(i,h)&&(ie(m.defaultValue)?H(h,j(n,h)):(H(h,m.defaultValue),Y(n,h,m.defaultValue)),m.keepTouched||le(t.touchedFields,h),m.keepDirty||(le(t.dirtyFields,h),t.isDirty=m.defaultValue?A(h,j(n,h)):A()),m.keepError||(le(t.errors,h),l.isValid&&v()),d.state.next(Object.assign({},t)))},clearErrors:I,unregister:ne,setError:B,setFocus:(h,m={})=>{const S=j(i,h)._f,N=S.refs?S.refs[0]:S.ref;m.shouldSelect?N.select():N.focus()},getFieldState:X}}function oa(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({},aa(e)),{formState:t});const n=r.current.control,a=he.default.useCallback(o=>{Ki(o,n._proxyFormState,!0)&&(n._formState=Object.assign(Object.assign({},n._formState),o),i(Object.assign({},n._formState)))},[n]);return Qi({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=Gi(t,n._proxyFormState),r.current}function Ie(e){return Ie=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},Ie(e)}function Le(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ve(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function zr(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 me(e,r,t){return r&&zr(e.prototype,r),t&&zr(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qr(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 Gr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qr(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var hr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},Yn,sa=he.default.createContext();function ua(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hr=Gr(Gr({},hr),e)}function la(){return hr}var ca=function(){function e(){ve(this,e),this.usedNamespaces={}}return me(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 fa(e){Yn=e}function da(){return Yn}var ga={type:"3rdParty",init:function(r){ua(r.options.react),fa(r)}};function ha(){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 Kr={};function pr(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];typeof r[0]=="string"&&Kr[r[0]]||(typeof r[0]=="string"&&(Kr[r[0]]=new Date),ha.apply(void 0,r))}function Qr(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 pa(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!r.languages||!r.languages.length)return pr("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 Zn(e){if(Array.isArray(e))return e}function va(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 Jr(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 Xn(e,r){if(!!e){if(typeof e=="string")return Jr(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 Jr(e,r)}}function ei(){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 ma(e,r){return Zn(e)||va(e,r)||Xn(e,r)||ei()}function Yr(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 ir(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Yr(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Bt(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.i18n,i=y.useContext(sa)||{},n=i.i18n,a=i.defaultNS,o=t||n||da();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new ca),!o){pr("You will need to pass in an i18next instance by using initReactI18next");var s=function(R){return Array.isArray(R)?R[R.length-1]:R},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&pr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=ir(ir(ir({},la()),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(T){return pa(T,o,c)});function p(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var O=y.useState(p),w=ma(O,2),v=w[0],P=w[1],C=y.useRef(!0);y.useEffect(function(){var T=c.bindI18n,R=c.bindI18nStore;C.current=!0,!g&&!f&&Qr(o,d,function(){C.current&&P(p)});function M(){C.current&&P(p)}return T&&o&&o.on(T,M),R&&o&&o.store.on(R,M),function(){C.current=!1,T&&o&&T.split(" ").forEach(function(_){return o.off(_,M)}),R&&o&&R.split(" ").forEach(function(_){return o.store.off(_,M)})}},[o,d.join()]);var k=y.useRef(!0);y.useEffect(function(){C.current&&!k.current&&P(p),k.current=!1},[o]);var D=[v,o,g];if(D.t=v,D.i18n=o,D.ready=g,g||!g&&!f)return D;throw new Promise(function(T){Qr(o,d,function(){T()})})}function _e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vr(e,r){return vr=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},vr(e,r)}function Wt(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&&vr(e,r)}function yt(e,r){if(r&&(Ie(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _e(e)}function Ee(e){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ee(e)}function ya(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ba(e){return Zn(e)||ya(e)||Xn(e)||ei()}function Zr(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 Xr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Zr(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Oa={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)}},Sa=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.init(r,t)}return me(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||Oa,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,Xr(Xr({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}(),ke=new Sa,He=function(){function e(){ve(this,e),this.observers={}}return me(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 at(){var e,r,t=new Promise(function(i,n){e=i,r=n});return t.resolve=e,t.reject=r,t}function en(e){return e==null?"":""+e}function wa(e,r,t){e.forEach(function(i){r[i]&&(t[i]=r[i])})}function Sr(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 tn(e,r,t){var i=Sr(e,r,Object),n=i.obj,a=i.k;n[a]=t}function xa(e,r,t,i){var n=Sr(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 Rt(e,r){var t=Sr(e,r),i=t.obj,n=t.k;if(!!i)return i[n]}function rn(e,r,t){var i=Rt(e,t);return i!==void 0?i:Rt(r,t)}function ti(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]):ti(e[i],r[i],t):e[i]=r[i]);return e}function Ye(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ca={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Pa(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(r){return Ca[r]}):e}var zt=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ka=[" ",",","?","!",";"];function Na(e,r,t){r=r||"",t=t||"";var i=ka.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 nn(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?nn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ea(e){var r=La();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(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 ri(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?ri(u,c,t):void 0}n=n[i[a]]}return n}}var ja=function(e){Wt(t,e);var r=Ea(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ve(this,t),n=r.call(this),zt&&He.call(_e(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 me(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=Rt(this.data,f);return l||!c||typeof o!="string"?l:ri(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),tn(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=Rt(this.data,f)||{};s?ti(l,o,u):l=xt(xt({},l),o),tn(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}(He),ni={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 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 de(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){Le(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}function Fa(e){var r=Aa();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(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}}var on={},sn=function(e){Wt(t,e);var r=Fa(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ve(this,t),n=r.call(this),zt&&He.call(_e(n)),wa(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,_e(n)),n.options=a,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=ke.create("translator"),n}return me(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&&!Na(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(Ie(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,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(p){var O=a.nsSeparator||this.options.nsSeparator;return d+O+f}return f}var w=this.resolve(n,a),v=w&&w.res,P=w&&w.usedKey||f,C=w&&w.exactUsedKey||f,k=Object.prototype.toString.apply(v),D=["[object Number]","[object Function]","[object RegExp]"],T=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,M=typeof v!="string"&&typeof v!="boolean"&&typeof v!="number";if(R&&v&&M&&D.indexOf(k)<0&&!(typeof T=="string"&&k==="[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(P,v,de(de({},a),{},{ns:l})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(u){var _=k==="[object Array]",E=_?[]:{},A=_?C:P;for(var $ in v)if(Object.prototype.hasOwnProperty.call(v,$)){var U="".concat(A).concat(u).concat($);E[$]=this.translate(U,de(de({},a),{joinArrays:!1,ns:l})),E[$]===U&&(E[$]=v[$])}v=E}}else if(R&&typeof T=="string"&&k==="[object Array]")v=v.join(T),v&&(v=this.extendTranslation(v,n,a,o));else{var W=!1,Q=!1,H=a.count!==void 0&&typeof a.count!="string",J=t.hasDefaultValue(a),te=H?this.pluralResolver.getSuffix(g,a.count,a):"",Z=a["defaultValue".concat(te)]||a.defaultValue;!this.isValidLookup(v)&&J&&(W=!0,v=Z),this.isValidLookup(v)||(Q=!0,v=f);var X=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,I=X&&Q?void 0:v,B=J&&Z!==v&&this.options.updateMissing;if(Q||W||B){if(this.logger.log(B?"updateKey":"missingKey",g,d,f,B?Z:v),u){var re=this.resolve(f,de(de({},a),{},{keySeparator:!1}));re&&re.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 ne=[],q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(var Ae=0;Ae<q.length;Ae++)ne.push(q[Ae]);else this.options.saveMissingTo==="all"?ne=this.languageUtils.toResolveHierarchy(a.lng||this.language):ne.push(a.lng||this.language);var Zt=function(We,h,m){var S=J&&m!==v?m:I;s.options.missingKeyHandler?s.options.missingKeyHandler(We,d,h,S,B,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(We,d,h,S,B,a),s.emit("missingKey",We,d,h,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&H?ne.forEach(function(St){s.pluralResolver.getSuffixes(St).forEach(function(We){Zt([St],f+We,a["defaultValue".concat(We)]||Z)})}):Zt(ne,f,Z))}v=this.extendTranslation(v,n,a,w,o),Q&&v===f&&this.options.appendNamespaceToMissingKey&&(v="".concat(d,":").concat(f)),(Q||W)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(f,W?v:void 0):v=this.options.parseMissingKeyHandler(v))}return v}},{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(de(de({},o),{interpolation:de(de({},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=de(de({},this.options.interpolation.defaultVariables),g)),n=this.interpolator.interpolate(n,g,o.lng||this.language,o),f){var p=n.match(this.interpolator.nestingRegexp),O=p&&p.length;l<O&&(o.nest=!1)}o.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var P=arguments.length,C=new Array(P),k=0;k<P;k++)C[k]=arguments[k];return u&&u[0]===C[0]&&!o.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(C[0]," in key: ").concat(a[0])),null):c.translate.apply(c,C.concat([a]))},o)),o.interpolation&&this.interpolator.reset()}var w=o.postProcess||this.options.postProcess,v=typeof w=="string"?[w]:w;return n!=null&&v&&v.length&&o.applyPostProcessor!==!1&&(n=ni.handle(v,n,a,this.options&&this.options.postProcessPassResolved?de({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),p=g.key;u=p;var O=g.namespaces;a.options.fallbackNS&&(O=O.concat(a.options.fallbackNS));var w=o.count!==void 0&&typeof o.count!="string",v=w&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),P=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",C=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);O.forEach(function(k){a.isValidLookup(s)||(l=k,!on["".concat(C[0],"-").concat(k)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(on["".concat(C[0],"-").concat(k)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(C.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!!!")),C.forEach(function(D){if(!a.isValidLookup(s)){f=D;var T=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(T,p,D,k,o);else{var R;w&&(R=a.pluralResolver.getSuffix(D,o.count,o));var M="_zero";if(w&&(T.push(p+R),v&&T.push(p+M)),P){var _="".concat(p).concat(a.options.contextSeparator).concat(o.context);T.push(_),w&&(T.push(_+R),v&&T.push(_+M))}}for(var E;E=T.pop();)a.isValidLookup(s)||(c=E,s=a.getResource(D,k,E,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}(He);function ar(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ra=function(){function e(r){ve(this,e),this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ke.create("languageUtils")}return me(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]=ar(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]=ar(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=ar(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}(),Ta=[{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}],Da={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)}},Ma=["v1","v2","v3"],un={zero:0,one:1,two:2,few:3,many:4,other:5};function Ia(){var e={};return Ta.forEach(function(r){r.lngs.forEach(function(t){e[t]={numbers:r.nr,plurals:Da[r.fc]}})}),e}var _a=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.languageUtils=r,this.options=t,this.logger=ke.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=Ia()}return me(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 un[o]-un[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!Ma.includes(this.options.compatibilityJSON)}}]),e}();function ln(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?ln(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var $a=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=ke.create("interpolator"),this.options=r,this.format=r.interpolation&&r.interpolation.format||function(t){return t},this.init(r)}return me(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:Pa,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Ye(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Ye(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?Ye(i.nestingPrefix):i.nestingPrefixEscaped||Ye("$t("),this.nestingSuffix=i.nestingSuffix?Ye(i.nestingSuffix):i.nestingSuffixEscaped||Ye(")"),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(w){return w.replace(/\$/g,"$$$$")}var d=function(v){if(v.indexOf(o.formatSeparator)<0){var P=rn(i,f,v);return o.alwaysFormat?o.format(P,void 0,n,ye(ye(ye({},a),i),{},{interpolationkey:v})):P}var C=v.split(o.formatSeparator),k=C.shift().trim(),D=C.join(o.formatSeparator).trim();return o.format(rn(i,f,k),D,n,ye(ye(ye({},a),i),{},{interpolationkey:k}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,O=[{regex:this.regexpUnescape,safeValue:function(v){return l(v)}},{regex:this.regexp,safeValue:function(v){return o.escapeValue?l(o.escape(v)):l(v)}}];return O.forEach(function(w){for(c=0;s=w.regex.exec(t);){var v=s[1].trim();if(u=d(v),u===void 0)if(typeof g=="function"){var P=g(t,s,a);u=typeof P=="string"?P:""}else if(a&&a.hasOwnProperty(v))u="";else if(p){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(t)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=en(u));var C=w.safeValue(u);if(t=t.replace(s[0],C),p?(w.regex.lastIndex+=C.length,w.regex.lastIndex-=s[0].length):w.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,p){var O=this.nestingOptionsSeparator;if(g.indexOf(O)<0)return g;var w=g.split(new RegExp("".concat(O,"[ ]*{"))),v="{".concat(w[1]);g=w[0],v=this.interpolate(v,u),v=v.replace(/'/g,'"');try{u=JSON.parse(v),p&&(u=ye(ye({},p),u))}catch(P){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),P),"".concat(g).concat(O).concat(v)}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=en(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),l&&(s=f.reduce(function(g,p){return n.format(g,p,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 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 Te(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){Le(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 Va(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=ba(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 Ua=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=ke.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,Te(Te({},a),{},{style:"currency"})).format(i)},datetime:function(i,n,a){return new Intl.DateTimeFormat(n,Te({},a)).format(i)},relativetime:function(i,n,a){return new Intl.RelativeTimeFormat(n,Te({},a)).format(i,a.range||"day")},list:function(i,n,a){return new Intl.ListFormat(n,Te({},a)).format(i)}},this.init(r)}return me(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=Va(f),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var p=c;try{var O=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},w=O.locale||O.lng||a.locale||a.lng||n;p=o.formats[d](c,w,Te(Te(Te({},g),a),O))}catch(v){o.logger.warn(v)}return p}else o.logger.warn("there was no format function for ".concat(d));return c},t);return u}}]),e}();function fn(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 dn(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?fn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ha(e){var r=Ba();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Ba(){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 Wa(e,r){for(var t=e.indexOf(r);t!==-1;)e.splice(t,1),t=e.indexOf(r)}var za=function(e){Wt(t,e);var r=Ha(t);function t(i,n,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return ve(this,t),o=r.call(this),zt&&He.call(_e(o)),o.backend=i,o.store=n,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=ke.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return me(t,[{key:"queueLoad",value:function(n,a,o,s){var u=this,c=[],f=[],l=[],d=[];return n.forEach(function(g){var p=!0;a.forEach(function(O){var w="".concat(g,"|").concat(O);!o.reload&&u.store.hasResourceBundle(g,O)?u.state[w]=2:u.state[w]<0||(u.state[w]===1?f.indexOf(w)<0&&f.push(w):(u.state[w]=1,p=!1,f.indexOf(w)<0&&f.push(w),c.indexOf(w)<0&&c.push(w),d.indexOf(O)<0&&d.push(O)))}),p||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){xa(l.loaded,[u],c),Wa(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,dn(dn({},c),{},{isUpdate:u})),!(!n||!n[0])&&this.store.addResource(n[0],a,o,s))}}]),t}(He);function qa(){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(Ie(r[1])==="object"&&(t=r[1]),typeof r[1]=="string"&&(t.defaultValue=r[1]),typeof r[2]=="string"&&(t.tDescription=r[2]),Ie(r[2])==="object"||Ie(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 gn(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 hn(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 xe(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?hn(Object(t),!0).forEach(function(i){Le(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ga(e){var r=Ka();return function(){var i=Ee(e),n;if(r){var a=Ee(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(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}}function Ct(){}function Qa(e){var r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));r.forEach(function(t){typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}var Tt=function(e){Wt(t,e);var r=Ga(t);function t(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(ve(this,t),i=r.call(this),zt&&He.call(_e(i)),i.options=gn(n),i.services={},i.logger=ke,i.modules={external:[]},Qa(_e(i)),a&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,a),yt(i,_e(i));setTimeout(function(){i.init(n,a)},0)}return i}return me(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=qa();this.options=xe(xe(xe({},s),this.options),gn(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=xe(xe({},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(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?ke.init(u(this.modules.logger),this.options):ke.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=Ua);var f=new Ra(this.options);this.store=new ja(this.options.resources,this.options);var l=this.services;l.logger=ke,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new _a(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 $a(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new za(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(v){for(var P=arguments.length,C=new Array(P>1?P-1:0),k=1;k<P;k++)C[k-1]=arguments[k];n.emit.apply(n,[v].concat(C))}),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 sn(this.services,this.options),this.translator.on("*",function(v){for(var P=arguments.length,C=new Array(P>1?P-1:0),k=1;k<P;k++)C[k-1]=arguments[k];n.emit.apply(n,[v].concat(C))}),this.modules.external.forEach(function(v){v.init&&v.init(n)})}if(this.format=this.options.interpolation.format,o||(o=Ct),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(v){n[v]=function(){var P;return(P=n.store)[v].apply(P,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(v){n[v]=function(){var P;return(P=n.store)[v].apply(P,arguments),n}});var O=at(),w=function(){var P=function(k,D){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),O.resolve(D),o(k,D)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return P(null,n.t.bind(n));n.changeLanguage(n.options.lng,P)};return this.options.resources||!this.options.initImmediate?w():setTimeout(w,0),O}},{key:"loadResources",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,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 p=a.services.languageUtils.toResolveHierarchy(g);p.forEach(function(O){c.indexOf(O)<0&&c.push(O)})}};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=at();return n||(n=this.languages),a||(a=this.options.ns),o||(o=Ct),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"&&ni.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=at();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 p=o.languages[g];if(!(["cimode","dev"].indexOf(p)>-1)&&o.store.hasLanguageSomeTranslations(p)){o.resolvedLanguage=p;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(p){c(p,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(Ie(l)!=="object"){for(var g=arguments.length,p=new Array(g>2?g-2:0),O=2;O<g;O++)p[O-2]=arguments[O];d=s.options.overloadTranslationOptionHandler([f,l].concat(p))}else d=xe({},l);d.lng=d.lng||c.lng,d.lngs=d.lngs||c.lngs,d.ns=d.ns||c.ns;var w=s.options.keySeparator||".",v=o?"".concat(o).concat(w).concat(f):f;return s.t(v,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,p){var O=a.services.backendConnector.state["".concat(g,"|").concat(p)];return O===-1||O===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=at();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=at();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]:Ct,s=xe(xe(xe({},this.options),a),{isClone:!0}),u=new t(s),c=["store","services","language"];return c.forEach(function(f){u[f]=n[f]}),u.services=xe({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new sn(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}(He);Le(Tt,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Tt(e,r)});var oe=Tt.createInstance();oe.createInstance=Tt.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 ii=[],Ja=ii.forEach,Ya=ii.slice;function Za(e){return Ja.call(Ya.call(arguments,1),function(r){if(r)for(var t in r)e[t]===void 0&&(e[t]=r[t])}),e}var pn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Xa=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(!pn.test(n.domain))throw new TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!pn.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},vn={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=Xa(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)}},eo={name:"cookie",lookup:function(r){var t;if(r.lookupCookie&&typeof document!="undefined"){var i=vn.read(r.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupCookie&&typeof document!="undefined"&&vn.create(t.lookupCookie,r,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},to={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}},ot=null,mn=function(){if(ot!==null)return ot;try{ot=window!=="undefined"&&window.localStorage!==null;var r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{ot=!1}return ot},ro={name:"localStorage",lookup:function(r){var t;if(r.lookupLocalStorage&&mn()){var i=window.localStorage.getItem(r.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupLocalStorage&&mn()&&window.localStorage.setItem(t.lookupLocalStorage,r)}},st=null,yn=function(){if(st!==null)return st;try{st=window!=="undefined"&&window.sessionStorage!==null;var r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{st=!1}return st},no={name:"sessionStorage",lookup:function(r){var t;if(r.lookupSessionStorage&&yn()){var i=window.sessionStorage.getItem(r.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupSessionStorage&&yn()&&window.sessionStorage.setItem(t.lookupSessionStorage,r)}},io={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}},ao={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}},oo={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}},so={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 uo(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ai=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.type="languageDetector",this.detectors={},this.init(r,t)}return me(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=Za(i,this.options||{},uo()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(eo),this.addDetector(to),this.addDetector(ro),this.addDetector(no),this.addDetector(io),this.addDetector(ao),this.addDetector(oo),this.addDetector(so)}},{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}();ai.type="languageDetector";const lo={"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"},co={"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"},fo={"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"},go={"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(ai).use(ga).init({resources:{pl:{translation:lo},en:{translation:co},de:{translation:fo},cs:{translation:go}}});var oi=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(oi||{}),qe=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(qe||{}),Oe=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Oe||{});const wr=(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]},ho=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{qtyMin:n,qtyMax:a}=i,{t:o}=Bt(),[s,u]=wr(t,r,e.items),{status:c,information:f}=po(n,a,u,o);return{chosenQtyCnt:u,qtyMin:n,qtyMax:a,walidationStatus:c,informationText:f}},po=(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=Oe.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<t&&(a=Oe.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=Oe.IGNORE),t>=o&&t<=s&&(a=Oe.OK),{information:n,status:a}},vo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{selMin:n,selMax:a}=i,{t:o}=Bt(),[s,u]=wr(t,r,e.items),{status:c,information:f}=mo(n,a,s,o);return{chosenSelCnt:s,selMin:n,selMax:a,walidationStatus:c,informationText:f}},mo=(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=Oe.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<t&&(a=Oe.TOO_MUCH)),o>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",a=Oe.IGNORE),o===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),t>=o&&t<=s&&(a=Oe.OK),{information:n,status:a}},yo=(e,r,t)=>{if(e==="selected"||e==="filter")return[];if(t[r]===e)return[t];let i=ui(e,r,t.items);return(i==null?void 0:i.length)||(i=si(e,r,t.items),i.length===0),i},si=(e,r,t)=>{const i=bo(t),n=ui(e,r,i);return(n==null?void 0:n.length)?n:(i==null?void 0:i.length)?si(e,r,i):[]},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)},ui=(e,r,t)=>{let i=[];return Array.isArray(t)&&(i=t.filter(n=>{if(n&&n[r]===e)return!0})),i},Oo=(e,r,t,i)=>{const n=yo(r,t,i),a=So(e,n).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},So=(e,r)=>{let t=[];return Array.isArray(r)&&r.length&&(t=r.map(i=>wo(e,i))),t},wo=(e,r)=>{if(r.id===e)return r;let t=ci(e,r.items);return t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):(t=li(e,r.items),t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):null)},li=(e,r)=>{const t=xo(r),i=ci(e,t);return(i==null?void 0:i.length)?i:(t==null?void 0:t.length)?li(e,t):[]},xo=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)},ci=(e,r)=>Array.isArray(r)?r.filter(i=>{if(i&&i.id===e)return!0}):[],xr=(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=Oo(a,i,oi.SELECT,r);s&&(s==null?void 0:s.price)&&(t+=parseFloat(s.price)*o)}}return t};var qt={exports:{}},bt={};/*
1
+ "use strict";var $i=Object.defineProperty,Ui=Object.defineProperties;var Hi=Object.getOwnPropertyDescriptors;var Fr=Object.getOwnPropertySymbols;var Bi=Object.prototype.hasOwnProperty,Wi=Object.prototype.propertyIsEnumerable;var Ar=(e,r,t)=>r in e?$i(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ue=(e,r)=>{for(var t in r||(r={}))Bi.call(r,t)&&Ar(e,t,r[t]);if(Fr)for(var t of Fr(r))Wi.call(r,t)&&Ar(e,t,r[t]);return e},Qe=(e,r)=>Ui(e,Hi(r));Object.defineProperty(exports,"__esModule",{value:!0});exports[Symbol.toStringTag]="Module";var m=require("react"),Rr=require("react-spring"),zi=require("react-dom");function qi(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var he=qi(m);var vt=e=>e.type==="checkbox",et=e=>e instanceof Date,fe=e=>e==null;const Hn=e=>typeof e=="object";var ae=e=>!fe(e)&&!Array.isArray(e)&&Hn(e)&&!et(e),Gi=e=>ae(e)&&e.target?vt(e.target)?e.target.checked:e.target.value:e,Ki=e=>e.substring(0,e.search(/.\d/))||e,Qi=(e,r)=>[...e].some(t=>Ki(r)===t),$t=e=>e.filter(Boolean),ie=e=>e===void 0,F=(e,r,t)=>{if(!r||!ae(e))return t;const i=$t(r.split(/[,[\].]+?/)).reduce((n,a)=>fe(n)?n:n[a],e);return ie(i)||i===e?ie(e[r])?t:e[r]:i};const Tr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Oe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Fe={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};var Ut=(e,r)=>{const t=Object.assign({},e);return delete t[r],t};const Bn=he.default.createContext(null),mt=()=>he.default.useContext(Bn),Ji=e=>he.default.createElement(Bn.Provider,{value:Ut(e,"children")},e.children);var Yi=(e,r,t,i=!0)=>{const n={};for(const a in e)Object.defineProperty(n,a,{get:()=>{const o=a;return r[o]!==Oe.all&&(r[o]=!i||Oe.all),t&&(t[o]=!0),e[o]}});return n},ge=e=>ae(e)&&!Object.keys(e).length,Zi=(e,r,t)=>{const i=Ut(e,"name");return ge(i)||Object.keys(i).length>=Object.keys(r).length||Object.keys(i).find(n=>r[n]===(!t||Oe.all))},er=e=>Array.isArray(e)?e:[e];function Xi(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 Ne=e=>typeof e=="string",ea=(e,r,t,i)=>{const n=Array.isArray(e);return Ne(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)},Ht=e=>typeof e=="function",Wn=e=>{for(const r in e)if(Ht(e[r]))return!0;return!1},ta=(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})}):{},yr=e=>/^\w*$/.test(e),zn=e=>$t(e.replace(/["|']|\]/g,"").split(/\.|\[/));function X(e,r,t){let i=-1;const n=yr(r)?[r]:zn(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 dr=(e,r,t)=>{for(const i of t||Object.keys(e)){const n=F(e,i);if(n){const a=n._f,o=Ut(n,"_f");if(a&&r(a.name)){if(a.ref.focus&&ie(a.ref.focus()))break;if(a.refs){a.refs[0].focus();break}}else ae(o)&&dr(o,r)}}};var Mr=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(i=>e.startsWith(i)&&/^\.\w+/.test(e.slice(i.length))));function Xe(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(Ht(e[i])){r=e;break}r[i]=Xe(e[i])}}else return e;return r}function tr(){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 jt=e=>fe(e)||!Hn(e);function tt(e,r){if(jt(e)||jt(r))return e===r;if(et(e)&&et(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(et(a)&&et(o)||ae(a)&&ae(o)||Array.isArray(a)&&Array.isArray(o)?!tt(a,o):a!==o)return!1}}return!0}var Dr=e=>({isOnSubmit:!e||e===Oe.onSubmit,isOnBlur:e===Oe.onBlur,isOnChange:e===Oe.onChange,isOnAll:e===Oe.all,isOnTouch:e===Oe.onTouched}),gt=e=>typeof e=="boolean",br=e=>e.type==="file",gr=e=>e instanceof HTMLElement,qn=e=>e.type==="select-multiple",Or=e=>e.type==="radio",ra=e=>Or(e)||vt(e),Ir=typeof window!="undefined"&&typeof window.HTMLElement!="undefined"&&typeof document!="undefined",rr=e=>gr(e)&&e.isConnected;function na(e,r){const t=r.slice(0,-1).length;let i=0;for(;i<t;)e=ie(e)?i++:e[r[i++]];return e}function le(e,r){const t=yr(r)?[r]:zn(r),i=t.length==1?e:na(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)&&ge(u)||Array.isArray(u)&&!u.filter(d=>ae(d)&&!ge(d)||gt(d)).length)&&(a?delete a[l]:delete e[l]),a=u}}return e}function Ft(e,r={}){const t=Array.isArray(e);if(ae(e)||t)for(const i in e)Array.isArray(e[i])||ae(e[i])&&!Wn(e[i])?(r[i]=Array.isArray(e[i])?[]:{},Ft(e[i],r[i])):fe(e[i])||(r[i]=!0);return r}function Gn(e,r,t){const i=Array.isArray(e);if(ae(e)||i)for(const n in e)Array.isArray(e[n])||ae(e[n])&&!Wn(e[n])?ie(r)||jt(t[n])?t[n]=Array.isArray(e[n])?Ft(e[n],[]):Object.assign({},Ft(e[n])):Gn(e[n],fe(r)?{}:r[n],t[n]):t[n]=!tt(e[n],r[n]);return t}var _r=(e,r)=>Gn(e,r,Ft(r));const Vr={value:!1,isValid:!1},$r={value:!0,isValid:!0};var Kn=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&&!ie(e[0].attributes.value)?ie(e[0].value)||e[0].value===""?$r:{value:e[0].value,isValid:!0}:$r:Vr}return Vr},Qn=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:i})=>ie(e)?e:r?e===""?NaN:+e:t&&Ne(e)?new Date(e):i?i(e):e;const Ur={isValid:!1,value:null};var Jn=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,Ur):Ur;function nr(e){const r=e.ref;if(!(e.refs?e.refs.every(t=>t.disabled):r.disabled))return br(r)?r.files:Or(r)?Jn(e.refs).value:qn(r)?[...r.selectedOptions].map(({value:t})=>t):vt(r)?Kn(e.refs).value:Qn(ie(r.value)?e.ref.value:r.value,e)}var ia=(e,r,t,i)=>{const n={};for(const a of e){const o=F(r,a);o&&X(n,a,o._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:i}},At=e=>e instanceof RegExp,it=e=>ie(e)?void 0:At(e)?e.source:ae(e)?At(e.value)?e.value.source:e.value:e,aa=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Hr(e,r,t){const i=F(e,t);if(i||yr(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 oa=(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,sa=(e,r)=>!$t(F(e,r)).length&&le(e,r),Et=e=>Ne(e)||he.default.isValidElement(e);function Br(e,r,t="validate"){if(Et(e)||Array.isArray(e)&&e.every(Et)||gt(e)&&!e)return{type:t,message:Et(e)?e:"",ref:r}}var Je=e=>ae(e)&&!At(e)?e:{value:e,message:""},Wr=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:p,mount:O,disabled:w}=e._f;if(!O||w)return{};const v=a?a[0]:n,N=k=>{i&&v.reportValidity&&(v.setCustomValidity(gt(k)?"":k||" "),v.reportValidity())},C={},P=Or(n),M=vt(n),R=P||M,D=(p||br(n))&&!n.value||r===""||Array.isArray(r)&&!r.length,V=ta.bind(null,g,t,C),T=(k,L,_,z=Fe.maxLength,U=Fe.minLength)=>{const J=k?L:_;C[g]=Object.assign({type:k?z:U,message:J,ref:n},V(k?z:U,J))};if(o&&(!R&&(D||fe(r))||gt(r)&&!r||M&&!Kn(a).isValid||P&&!Jn(a).isValid)){const{value:k,message:L}=Et(o)?{value:!!o,message:o}:Je(o);if(k&&(C[g]=Object.assign({type:Fe.required,message:L,ref:v},V(Fe.required,L)),!t))return N(L),C}if(!D&&(!fe(c)||!fe(f))){let k,L;const _=Je(f),z=Je(c);if(isNaN(r)){const U=n.valueAsDate||new Date(r);Ne(_.value)&&(k=U>new Date(_.value)),Ne(z.value)&&(L=U<new Date(z.value))}else{const U=n.valueAsNumber||+r;fe(_.value)||(k=U>_.value),fe(z.value)||(L=U<z.value)}if((k||L)&&(T(!!k,_.message,z.message,Fe.max,Fe.min),!t))return N(C[g].message),C}if((s||u)&&!D&&Ne(r)){const k=Je(s),L=Je(u),_=!fe(k.value)&&r.length>k.value,z=!fe(L.value)&&r.length<L.value;if((_||z)&&(T(_,k.message,L.message),!t))return N(C[g].message),C}if(l&&!D&&Ne(r)){const{value:k,message:L}=Je(l);if(At(k)&&!r.match(k)&&(C[g]=Object.assign({type:Fe.pattern,message:L,ref:n},V(Fe.pattern,L)),!t))return N(L),C}if(d){if(Ht(d)){const k=await d(r),L=Br(k,v);if(L&&(C[g]=Object.assign(Object.assign({},L),V(Fe.validate,L.message)),!t))return N(L.message),C}else if(ae(d)){let k={};for(const L in d){if(!ge(k)&&!t)break;const _=Br(await d[L](r),v,L);_&&(k=Object.assign(Object.assign({},_),V(L,_.message)),N(_.message),t&&(C[g]=k))}if(!ge(k)&&(C[g]=Object.assign({ref:v},k),!t))return C}}return N(!0),C};const ua={mode:Oe.onSubmit,reValidateMode:Oe.onChange,shouldFocusError:!0};function la(e={}){let r=Object.assign(Object.assign({},ua),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?{}:Xe(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:tr(),array:tr(),state:tr()},g=Dr(r.mode),p=Dr(r.reValidateMode),O=r.criteriaMode===Oe.all,w=(h,y)=>(...S)=>{clearTimeout(c),c=window.setTimeout(()=>h(...S),y)},v=async h=>{let y=!1;return l.isValid&&(y=r.resolver?ge((await D()).errors):await T(i,!0),!h&&y!==t.isValid&&(t.isValid=y,d.state.next({isValid:y}))),y},N=(h,y=[],S,E,j=!0,x=!0)=>{if(E&&S){if(o.action=!0,x&&Array.isArray(F(i,h))){const A=S(F(i,h),E.argA,E.argB);j&&X(i,h,A)}if(l.errors&&x&&Array.isArray(F(t.errors,h))){const A=S(F(t.errors,h),E.argA,E.argB);j&&X(t.errors,h,A),sa(t.errors,h)}if(l.touchedFields&&Array.isArray(F(t.touchedFields,h))){const A=S(F(t.touchedFields,h),E.argA,E.argB);j&&X(t.touchedFields,h,A)}l.dirtyFields&&(t.dirtyFields=_r(n,a)),d.state.next({isDirty:L(h,y),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else X(a,h,y)},C=(h,y)=>(X(t.errors,h,y),d.state.next({errors:t.errors})),P=(h,y,S,E)=>{const j=F(i,h);if(j){const x=F(a,h,ie(S)?F(n,h):S);ie(x)||E&&E.defaultChecked||y?X(a,h,y?x:nr(j._f)):U(h,x),o.mount&&v()}},M=(h,y,S,E,j)=>{let x=!1;const A={name:h},q=F(t.touchedFields,h);if(l.isDirty){const Re=t.isDirty;t.isDirty=A.isDirty=L(),x=Re!==A.isDirty}if(l.dirtyFields&&(!S||E)){const Re=F(t.dirtyFields,h);tt(F(n,h),y)?le(t.dirtyFields,h):X(t.dirtyFields,h,!0),A.dirtyFields=t.dirtyFields,x=x||Re!==F(t.dirtyFields,h)}return S&&!q&&(X(t.touchedFields,h,S),A.touchedFields=t.touchedFields,x=x||l.touchedFields&&q!==S),x&&j&&d.state.next(A),x?A:{}},R=async(h,y,S,E,j)=>{const x=F(t.errors,y),A=l.isValid&&t.isValid!==S;if(e.delayError&&E?(u=u||w(C,e.delayError),u(y,E)):(clearTimeout(c),E?X(t.errors,y,E):le(t.errors,y)),((E?!tt(x,E):x)||!ge(j)||A)&&!h){const q=Object.assign(Object.assign(Object.assign({},j),A?{isValid:S}:{}),{errors:t.errors,name:y});t=Object.assign(Object.assign({},t),q),d.state.next(q)}f[y]--,l.isValidating&&!Object.values(f).some(q=>q)&&(d.state.next({isValidating:!1}),f={})},D=async h=>r.resolver?await r.resolver(Object.assign({},a),r.context,ia(h||s.mount,i,r.criteriaMode,r.shouldUseNativeValidation)):{},V=async h=>{const{errors:y}=await D();if(h)for(const S of h){const E=F(y,S);E?X(t.errors,S,E):le(t.errors,S)}else t.errors=y;return y},T=async(h,y,S={valid:!0})=>{for(const E in h){const j=h[E];if(j){const x=j._f,A=Ut(j,"_f");if(x){const q=await Wr(j,F(a,x.name),O,r.shouldUseNativeValidation);if(q[x.name]&&(S.valid=!1,y))break;y||(q[x.name]?X(t.errors,x.name,q[x.name]):le(t.errors,x.name))}A&&await T(A,y,S)}}return S.valid},k=()=>{for(const h of s.unMount){const y=F(i,h);y&&(y._f.refs?y._f.refs.every(S=>!rr(S)):!rr(y._f.ref))&&H(h)}s.unMount=new Set},L=(h,y)=>(h&&y&&X(a,h,y),!tt(re(),n)),_=(h,y,S)=>{const E=Object.assign({},o.mount?a:ie(y)?n:Ne(h)?{[h]:y}:y);return ea(h,s,E,S)},z=h=>$t(F(o.mount?a:n,h,e.shouldUnregister?F(n,h,[]):[])),U=(h,y,S={})=>{const E=F(i,h);let j=y;if(E){const x=E._f;x&&(!x.disabled&&X(a,h,Qn(y,x)),j=Ir&&gr(x.ref)&&fe(y)?"":y,qn(x.ref)?[...x.ref.options].forEach(A=>A.selected=j.includes(A.value)):x.refs?vt(x.ref)?x.refs.length>1?x.refs.forEach(A=>A.checked=Array.isArray(j)?!!j.find(q=>q===A.value):j===A.value):x.refs[0]&&(x.refs[0].checked=!!j):x.refs.forEach(A=>A.checked=A.value===j):br(x.ref)?x.ref.value="":(x.ref.value=j,x.ref.type||d.watch.next({name:h})))}(S.shouldDirty||S.shouldTouch)&&M(h,j,S.shouldTouch,S.shouldDirty,!0),S.shouldValidate&&Y(h)},J=(h,y,S)=>{for(const E in y){const j=y[E],x=`${h}.${E}`,A=F(i,x);(s.array.has(h)||!jt(j)||A&&!A._f)&&!et(j)?J(x,j,S):U(x,j,S)}},Z=(h,y,S={})=>{const E=F(i,h),j=s.array.has(h),x=Xe(y);X(a,h,x),j?(d.array.next({name:h,values:a}),(l.isDirty||l.dirtyFields)&&S.shouldDirty&&(t.dirtyFields=_r(n,a),d.state.next({name:h,dirtyFields:t.dirtyFields,isDirty:L(h,x)}))):E&&!E._f&&!fe(x)?J(h,x,S):U(h,x,S),Mr(h,s)&&d.state.next({}),d.watch.next({name:h})},W=async h=>{const y=h.target;let S=y.name;const E=F(i,S);if(E){let j,x;const A=y.type?nr(E._f):Gi(h),q=h.type===Tr.BLUR||h.type===Tr.FOCUS_OUT,Re=!aa(E._f)&&!r.resolver&&!F(t.errors,S)&&!E._f.deps||oa(q,F(t.touchedFields,S),t.isSubmitted,p,g),wt=Mr(S,s,q);X(a,S,A),q?E._f.onBlur&&E._f.onBlur(h):E._f.onChange&&E._f.onChange(h);const Xt=M(S,A,q,!1),_i=!ge(Xt)||wt;if(!q&&d.watch.next({name:S,type:h.type}),Re)return _i&&d.state.next(Object.assign({name:S},wt?{}:Xt));if(!q&&wt&&d.state.next({}),f[S]=(f[S],1),d.state.next({isValidating:!0}),r.resolver){const{errors:Lr}=await D([S]),Vi=Hr(t.errors,i,S),jr=Hr(Lr,i,Vi.name||S);j=jr.error,S=jr.name,x=ge(Lr)}else j=(await Wr(E,F(a,S),O,r.shouldUseNativeValidation))[S],x=await v(!0);E._f.deps&&Y(E._f.deps),R(!1,S,x,j,Xt)}},Y=async(h,y={})=>{let S,E;const j=er(h);if(d.state.next({isValidating:!0}),r.resolver){const x=await V(ie(h)?h:j);S=ge(x),E=h?!j.some(A=>F(x,A)):S}else h?(E=(await Promise.all(j.map(async x=>{const A=F(i,x);return await T(A&&A._f?{[x]:A}:A)}))).every(Boolean),!(!E&&!t.isValid)&&v()):E=S=await T(i);return d.state.next(Object.assign(Object.assign(Object.assign({},!Ne(h)||l.isValid&&S!==t.isValid?{}:{name:h}),r.resolver?{isValid:S}:{}),{errors:t.errors,isValidating:!1})),y.shouldFocus&&!E&&dr(i,x=>F(t.errors,x),h?j:s.mount),E},re=h=>{const y=Object.assign(Object.assign({},n),o.mount?a:{});return ie(h)?y:Ne(h)?F(y,h):h.map(S=>F(y,S))},ee=(h,y)=>({invalid:!!F((y||t).errors,h),isDirty:!!F((y||t).dirtyFields,h),isTouched:!!F((y||t).touchedFields,h),error:F((y||t).errors,h)}),I=h=>{h?er(h).forEach(y=>le(t.errors,y)):t.errors={},d.state.next({errors:t.errors})},K=(h,y,S)=>{const E=(F(i,h,{_f:{}})._f||{}).ref;X(t.errors,h,Object.assign(Object.assign({},y),{ref:E})),d.state.next({name:h,errors:t.errors,isValid:!1}),S&&S.shouldFocus&&E&&E.focus&&E.focus()},ne=(h,y)=>Ht(h)?d.watch.subscribe({next:S=>h(_(void 0,y),S)}):_(h,y,!0),H=(h,y={})=>{for(const S of h?er(h):s.mount)s.mount.delete(S),s.array.delete(S),F(i,S)&&(y.keepValue||(le(i,S),le(a,S)),!y.keepError&&le(t.errors,S),!y.keepDirty&&le(t.dirtyFields,S),!y.keepTouched&&le(t.touchedFields,S),!r.shouldUnregister&&!y.keepDefaultValue&&le(n,S));d.watch.next({}),d.state.next(Object.assign(Object.assign({},t),y.keepDirty?{isDirty:L()}:{})),!y.keepIsValid&&v()},B=(h,y={})=>{let S=F(i,h);const E=gt(y.disabled);return X(i,h,{_f:Object.assign(Object.assign(Object.assign({},S&&S._f?S._f:{ref:{name:h}}),{name:h,mount:!0}),y)}),s.mount.add(h),S?E&&X(a,h,y.disabled?void 0:F(a,h,nr(S._f))):P(h,!0,y.value),Object.assign(Object.assign(Object.assign({},E?{disabled:y.disabled}:{}),r.shouldUseNativeValidation?{required:!!y.required,min:it(y.min),max:it(y.max),minLength:it(y.minLength),maxLength:it(y.maxLength),pattern:it(y.pattern)}:{}),{name:h,onChange:W,onBlur:W,ref:j=>{if(j){B(h,y),S=F(i,h);const x=ie(j.value)&&j.querySelectorAll&&j.querySelectorAll("input,select,textarea")[0]||j,A=ra(x),q=S._f.refs||[];if(A?q.find(Re=>Re===x):x===S._f.ref)return;X(i,h,{_f:Object.assign(Object.assign({},S._f),A?{refs:q.concat(x).filter(rr),ref:{type:x.type,name:h}}:{ref:x})}),P(h,!1,void 0,x)}else S=F(i,h,{}),S._f&&(S._f.mount=!1),(r.shouldUnregister||y.shouldUnregister)&&!(Qi(s.array,h)&&o.action)&&s.unMount.add(h)}})};return{control:{register:B,unregister:H,getFieldState:ee,_executeSchema:D,_getWatch:_,_getDirty:L,_updateValid:v,_removeUnmounted:k,_updateFieldArray:N,_getFieldArray:z,_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:Y,register:B,handleSubmit:(h,y)=>async S=>{S&&(S.preventDefault&&S.preventDefault(),S.persist&&S.persist());let E=!0,j=Xe(a);d.state.next({isSubmitting:!0});try{if(r.resolver){const{errors:x,values:A}=await D();t.errors=x,j=A}else await T(i);ge(t.errors)&&Object.keys(t.errors).every(x=>F(j,x))?(d.state.next({errors:{},isSubmitting:!0}),await h(j,S)):(y&&await y(Object.assign({},t.errors),S),r.shouldFocusError&&dr(i,x=>F(t.errors,x),s.mount))}catch(x){throw E=!1,x}finally{t.isSubmitted=!0,d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ge(t.errors)&&E,submitCount:t.submitCount+1,errors:t.errors})}},watch:ne,setValue:Z,getValues:re,reset:(h,y={})=>{const S=h||n,E=Xe(S),j=h&&!ge(h)?E:n;if(y.keepDefaultValues||(n=S),!y.keepValues){if(Ir&&ie(h))for(const x of s.mount){const A=F(i,x);if(A&&A._f){const q=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;try{gr(q)&&q.closest("form").reset();break}catch{}}}a=e.shouldUnregister?y.keepDefaultValues?Xe(n):{}:E,i={},d.array.next({values:j}),d.watch.next({values:j})}s={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!l.isValid||!!y.keepIsValid,o.watch=!!e.shouldUnregister,d.state.next({submitCount:y.keepSubmitCount?t.submitCount:0,isDirty:y.keepDirty?t.isDirty:y.keepDefaultValues?!tt(h,n):!1,isSubmitted:y.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:y.keepDirty?t.dirtyFields:y.keepDefaultValues&&h?Object.entries(h).reduce((x,[A,q])=>Object.assign(Object.assign({},x),{[A]:q!==F(n,A)}),{}):{},touchedFields:y.keepTouched?t.touchedFields:{},errors:y.keepErrors?t.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},resetField:(h,y={})=>{F(i,h)&&(ie(y.defaultValue)?Z(h,F(n,h)):(Z(h,y.defaultValue),X(n,h,y.defaultValue)),y.keepTouched||le(t.touchedFields,h),y.keepDirty||(le(t.dirtyFields,h),t.isDirty=y.defaultValue?L(h,F(n,h)):L()),y.keepError||(le(t.errors,h),l.isValid&&v()),d.state.next(Object.assign({},t)))},clearErrors:I,unregister:H,setError:K,setFocus:(h,y={})=>{const S=F(i,h)._f,E=S.refs?S.refs[0]:S.ref;y.shouldSelect?E.select():E.focus()},getFieldState:ee}}function ca(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({},la(e)),{formState:t});const n=r.current.control,a=he.default.useCallback(o=>{Zi(o,n._proxyFormState,!0)&&(n._formState=Object.assign(Object.assign({},n._formState),o),i(Object.assign({},n._formState)))},[n]);return Xi({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=Yi(t,n._proxyFormState),r.current}function Ie(e){return Ie=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},Ie(e)}function je(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ve(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function zr(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 me(e,r,t){return r&&zr(e.prototype,r),t&&zr(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qr(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 Gr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qr(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var hr={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},Yn,fa=he.default.createContext();function da(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hr=Gr(Gr({},hr),e)}function ga(){return hr}var ha=function(){function e(){ve(this,e),this.usedNamespaces={}}return me(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 pa(e){Yn=e}function va(){return Yn}var ma={type:"3rdParty",init:function(r){da(r.options.react),pa(r)}};function ya(){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 Kr={};function pr(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];typeof r[0]=="string"&&Kr[r[0]]||(typeof r[0]=="string"&&(Kr[r[0]]=new Date),ya.apply(void 0,r))}function Qr(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 ba(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!r.languages||!r.languages.length)return pr("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 Zn(e){if(Array.isArray(e))return e}function Oa(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 Jr(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 Xn(e,r){if(!!e){if(typeof e=="string")return Jr(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 Jr(e,r)}}function ei(){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 Sa(e,r){return Zn(e)||Oa(e,r)||Xn(e,r)||ei()}function Yr(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 ir(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Yr(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Yr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Bt(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.i18n,i=m.useContext(fa)||{},n=i.i18n,a=i.defaultNS,o=t||n||va();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new ha),!o){pr("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&&pr("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=ir(ir(ir({},ga()),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(R){return ba(R,o,c)});function p(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var O=m.useState(p),w=Sa(O,2),v=w[0],N=w[1],C=m.useRef(!0);m.useEffect(function(){var R=c.bindI18n,D=c.bindI18nStore;C.current=!0,!g&&!f&&Qr(o,d,function(){C.current&&N(p)});function V(){C.current&&N(p)}return R&&o&&o.on(R,V),D&&o&&o.store.on(D,V),function(){C.current=!1,R&&o&&R.split(" ").forEach(function(T){return o.off(T,V)}),D&&o&&D.split(" ").forEach(function(T){return o.store.off(T,V)})}},[o,d.join()]);var P=m.useRef(!0);m.useEffect(function(){C.current&&!P.current&&N(p),P.current=!1},[o]);var M=[v,o,g];if(M.t=v,M.i18n=o,M.ready=g,g||!g&&!f)return M;throw new Promise(function(R){Qr(o,d,function(){R()})})}function _e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vr(e,r){return vr=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},vr(e,r)}function Wt(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&&vr(e,r)}function yt(e,r){if(r&&(Ie(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _e(e)}function Le(e){return Le=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Le(e)}function wa(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xa(e){return Zn(e)||wa(e)||Xn(e)||ei()}function Zr(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 Xr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Zr(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Zr(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Ca={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)}},Pa=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.init(r,t)}return me(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||Ca,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,Xr(Xr({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}}]),e}(),ke=new Pa,He=function(){function e(){ve(this,e),this.observers={}}return me(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 at(){var e,r,t=new Promise(function(i,n){e=i,r=n});return t.resolve=e,t.reject=r,t}function en(e){return e==null?"":""+e}function Na(e,r,t){e.forEach(function(i){r[i]&&(t[i]=r[i])})}function Sr(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 tn(e,r,t){var i=Sr(e,r,Object),n=i.obj,a=i.k;n[a]=t}function ka(e,r,t,i){var n=Sr(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 Rt(e,r){var t=Sr(e,r),i=t.obj,n=t.k;if(!!i)return i[n]}function rn(e,r,t){var i=Rt(e,t);return i!==void 0?i:Rt(r,t)}function ti(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]):ti(e[i],r[i],t):e[i]=r[i]);return e}function Ye(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ea={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function La(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(r){return Ea[r]}):e}var zt=typeof window!="undefined"&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,ja=[" ",",","?","!",";"];function Fa(e,r,t){r=r||"",t=t||"";var i=ja.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 nn(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?nn(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Aa(e){var r=Ra();return function(){var i=Le(e),n;if(r){var a=Le(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Ra(){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 ri(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?ri(u,c,t):void 0}n=n[i[a]]}return n}}var Ta=function(e){Wt(t,e);var r=Aa(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ve(this,t),n=r.call(this),zt&&He.call(_e(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 me(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=Rt(this.data,f);return l||!c||typeof o!="string"?l:ri(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),tn(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=Rt(this.data,f)||{};s?ti(l,o,u):l=xt(xt({},l),o),tn(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}(He),ni={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 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 de(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){je(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}function Ma(e){var r=Da();return function(){var i=Le(e),n;if(r){var a=Le(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Da(){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 on={},sn=function(e){Wt(t,e);var r=Ma(t);function t(i){var n,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ve(this,t),n=r.call(this),zt&&He.call(_e(n)),Na(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,_e(n)),n.options=a,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=ke.create("translator"),n}return me(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&&!Fa(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(Ie(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,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(p){var O=a.nsSeparator||this.options.nsSeparator;return d+O+f}return f}var w=this.resolve(n,a),v=w&&w.res,N=w&&w.usedKey||f,C=w&&w.exactUsedKey||f,P=Object.prototype.toString.apply(v),M=["[object Number]","[object Function]","[object RegExp]"],R=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,V=typeof v!="string"&&typeof v!="boolean"&&typeof v!="number";if(D&&v&&V&&M.indexOf(P)<0&&!(typeof R=="string"&&P==="[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(N,v,de(de({},a),{},{ns:l})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");if(u){var T=P==="[object Array]",k=T?[]:{},L=T?C:N;for(var _ in v)if(Object.prototype.hasOwnProperty.call(v,_)){var z="".concat(L).concat(u).concat(_);k[_]=this.translate(z,de(de({},a),{joinArrays:!1,ns:l})),k[_]===z&&(k[_]=v[_])}v=k}}else if(D&&typeof R=="string"&&P==="[object Array]")v=v.join(R),v&&(v=this.extendTranslation(v,n,a,o));else{var U=!1,J=!1,Z=a.count!==void 0&&typeof a.count!="string",W=t.hasDefaultValue(a),Y=Z?this.pluralResolver.getSuffix(g,a.count,a):"",re=a["defaultValue".concat(Y)]||a.defaultValue;!this.isValidLookup(v)&&W&&(U=!0,v=re),this.isValidLookup(v)||(J=!0,v=f);var ee=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,I=ee&&J?void 0:v,K=W&&re!==v&&this.options.updateMissing;if(J||U||K){if(this.logger.log(K?"updateKey":"missingKey",g,d,f,K?re:v),u){var ne=this.resolve(f,de(de({},a),{},{keySeparator:!1}));ne&&ne.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 H=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(var ye=0;ye<B.length;ye++)H.push(B[ye]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(a.lng||this.language):H.push(a.lng||this.language);var Zt=function(We,h,y){var S=W&&y!==v?y:I;s.options.missingKeyHandler?s.options.missingKeyHandler(We,d,h,S,K,a):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(We,d,h,S,K,a),s.emit("missingKey",We,d,h,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&Z?H.forEach(function(St){s.pluralResolver.getSuffixes(St).forEach(function(We){Zt([St],f+We,a["defaultValue".concat(We)]||re)})}):Zt(H,f,re))}v=this.extendTranslation(v,n,a,w,o),J&&v===f&&this.options.appendNamespaceToMissingKey&&(v="".concat(d,":").concat(f)),(J||U)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(f,U?v:void 0):v=this.options.parseMissingKeyHandler(v))}return v}},{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(de(de({},o),{interpolation:de(de({},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=de(de({},this.options.interpolation.defaultVariables),g)),n=this.interpolator.interpolate(n,g,o.lng||this.language,o),f){var p=n.match(this.interpolator.nestingRegexp),O=p&&p.length;l<O&&(o.nest=!1)}o.nest!==!1&&(n=this.interpolator.nest(n,function(){for(var N=arguments.length,C=new Array(N),P=0;P<N;P++)C[P]=arguments[P];return u&&u[0]===C[0]&&!o.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(C[0]," in key: ").concat(a[0])),null):c.translate.apply(c,C.concat([a]))},o)),o.interpolation&&this.interpolator.reset()}var w=o.postProcess||this.options.postProcess,v=typeof w=="string"?[w]:w;return n!=null&&v&&v.length&&o.applyPostProcessor!==!1&&(n=ni.handle(v,n,a,this.options&&this.options.postProcessPassResolved?de({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),p=g.key;u=p;var O=g.namespaces;a.options.fallbackNS&&(O=O.concat(a.options.fallbackNS));var w=o.count!==void 0&&typeof o.count!="string",v=w&&!o.ordinal&&o.count===0&&a.pluralResolver.shouldUseIntlApi(),N=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",C=o.lngs?o.lngs:a.languageUtils.toResolveHierarchy(o.lng||a.language,o.fallbackLng);O.forEach(function(P){a.isValidLookup(s)||(l=P,!on["".concat(C[0],"-").concat(P)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(l)&&(on["".concat(C[0],"-").concat(P)]=!0,a.logger.warn('key "'.concat(u,'" for languages "').concat(C.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!!!")),C.forEach(function(M){if(!a.isValidLookup(s)){f=M;var R=[p];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(R,p,M,P,o);else{var D;w&&(D=a.pluralResolver.getSuffix(M,o.count,o));var V="_zero";if(w&&(R.push(p+D),v&&R.push(p+V)),N){var T="".concat(p).concat(a.options.contextSeparator).concat(o.context);R.push(T),w&&(R.push(T+D),v&&R.push(T+V))}}for(var k;k=R.pop();)a.isValidLookup(s)||(c=k,s=a.getResource(M,P,k,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}(He);function ar(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ia=function(){function e(r){ve(this,e),this.options=r,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ke.create("languageUtils")}return me(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]=ar(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]=ar(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=ar(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}(),_a=[{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}],Va={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)}},$a=["v1","v2","v3"],un={zero:0,one:1,two:2,few:3,many:4,other:5};function Ua(){var e={};return _a.forEach(function(r){r.lngs.forEach(function(t){e[t]={numbers:r.nr,plurals:Va[r.fc]}})}),e}var Ha=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.languageUtils=r,this.options=t,this.logger=ke.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=Ua()}return me(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 un[o]-un[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!$a.includes(this.options.compatibilityJSON)}}]),e}();function ln(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 be(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?ln(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ln(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}var Ba=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=ke.create("interpolator"),this.options=r,this.format=r.interpolation&&r.interpolation.format||function(t){return t},this.init(r)}return me(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:La,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Ye(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Ye(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?Ye(i.nestingPrefix):i.nestingPrefixEscaped||Ye("$t("),this.nestingSuffix=i.nestingSuffix?Ye(i.nestingSuffix):i.nestingSuffixEscaped||Ye(")"),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(w){return w.replace(/\$/g,"$$$$")}var d=function(v){if(v.indexOf(o.formatSeparator)<0){var N=rn(i,f,v);return o.alwaysFormat?o.format(N,void 0,n,be(be(be({},a),i),{},{interpolationkey:v})):N}var C=v.split(o.formatSeparator),P=C.shift().trim(),M=C.join(o.formatSeparator).trim();return o.format(rn(i,f,P),M,n,be(be(be({},a),i),{},{interpolationkey:P}))};this.resetRegExp();var g=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,O=[{regex:this.regexpUnescape,safeValue:function(v){return l(v)}},{regex:this.regexp,safeValue:function(v){return o.escapeValue?l(o.escape(v)):l(v)}}];return O.forEach(function(w){for(c=0;s=w.regex.exec(t);){var v=s[1].trim();if(u=d(v),u===void 0)if(typeof g=="function"){var N=g(t,s,a);u=typeof N=="string"?N:""}else if(a&&a.hasOwnProperty(v))u="";else if(p){u=s[0];continue}else o.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(t)),u="";else typeof u!="string"&&!o.useRawValueToEscape&&(u=en(u));var C=w.safeValue(u);if(t=t.replace(s[0],C),p?(w.regex.lastIndex+=C.length,w.regex.lastIndex-=s[0].length):w.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=be({},a);u.applyPostProcessor=!1,delete u.defaultValue;function c(g,p){var O=this.nestingOptionsSeparator;if(g.indexOf(O)<0)return g;var w=g.split(new RegExp("".concat(O,"[ ]*{"))),v="{".concat(w[1]);g=w[0],v=this.interpolate(v,u),v=v.replace(/'/g,'"');try{u=JSON.parse(v),p&&(u=be(be({},p),u))}catch(N){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),N),"".concat(g).concat(O).concat(v)}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=en(s)),s||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(t)),s=""),l&&(s=f.reduce(function(g,p){return n.format(g,p,a.lng,be(be({},a),{},{interpolationkey:o[1].trim()}))},s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}]),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 Te(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){je(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 Wa(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=xa(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 za=function(){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(this,e),this.logger=ke.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,Te(Te({},a),{},{style:"currency"})).format(i)},datetime:function(i,n,a){return new Intl.DateTimeFormat(n,Te({},a)).format(i)},relativetime:function(i,n,a){return new Intl.RelativeTimeFormat(n,Te({},a)).format(i,a.range||"day")},list:function(i,n,a){return new Intl.ListFormat(n,Te({},a)).format(i)}},this.init(r)}return me(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=Wa(f),d=l.formatName,g=l.formatOptions;if(o.formats[d]){var p=c;try{var O=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},w=O.locale||O.lng||a.locale||a.lng||n;p=o.formats[d](c,w,Te(Te(Te({},g),a),O))}catch(v){o.logger.warn(v)}return p}else o.logger.warn("there was no format function for ".concat(d));return c},t);return u}}]),e}();function fn(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 dn(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?fn(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function qa(e){var r=Ga();return function(){var i=Le(e),n;if(r){var a=Le(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(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 Ka(e,r){for(var t=e.indexOf(r);t!==-1;)e.splice(t,1),t=e.indexOf(r)}var Qa=function(e){Wt(t,e);var r=qa(t);function t(i,n,a){var o,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return ve(this,t),o=r.call(this),zt&&He.call(_e(o)),o.backend=i,o.store=n,o.services=a,o.languageUtils=a.languageUtils,o.options=s,o.logger=ke.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(a,s.backend,s),o}return me(t,[{key:"queueLoad",value:function(n,a,o,s){var u=this,c=[],f=[],l=[],d=[];return n.forEach(function(g){var p=!0;a.forEach(function(O){var w="".concat(g,"|").concat(O);!o.reload&&u.store.hasResourceBundle(g,O)?u.state[w]=2:u.state[w]<0||(u.state[w]===1?f.indexOf(w)<0&&f.push(w):(u.state[w]=1,p=!1,f.indexOf(w)<0&&f.push(w),c.indexOf(w)<0&&c.push(w),d.indexOf(O)<0&&d.push(O)))}),p||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){ka(l.loaded,[u],c),Ka(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,dn(dn({},c),{},{isUpdate:u})),!(!n||!n[0])&&this.store.addResource(n[0],a,o,s))}}]),t}(He);function Ja(){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(Ie(r[1])==="object"&&(t=r[1]),typeof r[1]=="string"&&(t.defaultValue=r[1]),typeof r[2]=="string"&&(t.tDescription=r[2]),Ie(r[2])==="object"||Ie(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 gn(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 hn(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 Ce(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?hn(Object(t),!0).forEach(function(i){je(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hn(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Ya(e){var r=Za();return function(){var i=Le(e),n;if(r){var a=Le(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return yt(this,n)}}function Za(){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 Ct(){}function Xa(e){var r=Object.getOwnPropertyNames(Object.getPrototypeOf(e));r.forEach(function(t){typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}var Tt=function(e){Wt(t,e);var r=Ya(t);function t(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(ve(this,t),i=r.call(this),zt&&He.call(_e(i)),i.options=gn(n),i.services={},i.logger=ke,i.modules={external:[]},Xa(_e(i)),a&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,a),yt(i,_e(i));setTimeout(function(){i.init(n,a)},0)}return i}return me(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=Ja();this.options=Ce(Ce(Ce({},s),this.options),gn(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Ce(Ce({},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(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?ke.init(u(this.modules.logger),this.options):ke.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=za);var f=new Ia(this.options);this.store=new Ta(this.options.resources,this.options);var l=this.services;l.logger=ke,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new Ha(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 Ba(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Qa(u(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(v){for(var N=arguments.length,C=new Array(N>1?N-1:0),P=1;P<N;P++)C[P-1]=arguments[P];n.emit.apply(n,[v].concat(C))}),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 sn(this.services,this.options),this.translator.on("*",function(v){for(var N=arguments.length,C=new Array(N>1?N-1:0),P=1;P<N;P++)C[P-1]=arguments[P];n.emit.apply(n,[v].concat(C))}),this.modules.external.forEach(function(v){v.init&&v.init(n)})}if(this.format=this.options.interpolation.format,o||(o=Ct),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(v){n[v]=function(){var N;return(N=n.store)[v].apply(N,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(v){n[v]=function(){var N;return(N=n.store)[v].apply(N,arguments),n}});var O=at(),w=function(){var N=function(P,M){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),O.resolve(M),o(P,M)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return N(null,n.t.bind(n));n.changeLanguage(n.options.lng,N)};return this.options.resources||!this.options.initImmediate?w():setTimeout(w,0),O}},{key:"loadResources",value:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ct,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 p=a.services.languageUtils.toResolveHierarchy(g);p.forEach(function(O){c.indexOf(O)<0&&c.push(O)})}};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=at();return n||(n=this.languages),a||(a=this.options.ns),o||(o=Ct),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"&&ni.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=at();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 p=o.languages[g];if(!(["cimode","dev"].indexOf(p)>-1)&&o.store.hasLanguageSomeTranslations(p)){o.resolvedLanguage=p;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(p){c(p,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(Ie(l)!=="object"){for(var g=arguments.length,p=new Array(g>2?g-2:0),O=2;O<g;O++)p[O-2]=arguments[O];d=s.options.overloadTranslationOptionHandler([f,l].concat(p))}else d=Ce({},l);d.lng=d.lng||c.lng,d.lngs=d.lngs||c.lngs,d.ns=d.ns||c.ns;var w=s.options.keySeparator||".",v=o?"".concat(o).concat(w).concat(f):f;return s.t(v,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,p){var O=a.services.backendConnector.state["".concat(g,"|").concat(p)];return O===-1||O===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=at();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=at();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]:Ct,s=Ce(Ce(Ce({},this.options),a),{isClone:!0}),u=new t(s),c=["store","services","language"];return c.forEach(function(f){u[f]=n[f]}),u.services=Ce({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u.translator=new sn(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}(He);je(Tt,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Tt(e,r)});var oe=Tt.createInstance();oe.createInstance=Tt.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 ii=[],eo=ii.forEach,to=ii.slice;function ro(e){return eo.call(to.call(arguments,1),function(r){if(r)for(var t in r)e[t]===void 0&&(e[t]=r[t])}),e}var pn=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,no=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(!pn.test(n.domain))throw new TypeError("option domain is invalid");o+="; Domain="+n.domain}if(n.path){if(!pn.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},vn={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=no(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)}},io={name:"cookie",lookup:function(r){var t;if(r.lookupCookie&&typeof document!="undefined"){var i=vn.read(r.lookupCookie);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupCookie&&typeof document!="undefined"&&vn.create(t.lookupCookie,r,t.cookieMinutes,t.cookieDomain,t.cookieOptions)}},ao={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}},ot=null,mn=function(){if(ot!==null)return ot;try{ot=window!=="undefined"&&window.localStorage!==null;var r="i18next.translate.boo";window.localStorage.setItem(r,"foo"),window.localStorage.removeItem(r)}catch{ot=!1}return ot},oo={name:"localStorage",lookup:function(r){var t;if(r.lookupLocalStorage&&mn()){var i=window.localStorage.getItem(r.lookupLocalStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupLocalStorage&&mn()&&window.localStorage.setItem(t.lookupLocalStorage,r)}},st=null,yn=function(){if(st!==null)return st;try{st=window!=="undefined"&&window.sessionStorage!==null;var r="i18next.translate.boo";window.sessionStorage.setItem(r,"foo"),window.sessionStorage.removeItem(r)}catch{st=!1}return st},so={name:"sessionStorage",lookup:function(r){var t;if(r.lookupSessionStorage&&yn()){var i=window.sessionStorage.getItem(r.lookupSessionStorage);i&&(t=i)}return t},cacheUserLanguage:function(r,t){t.lookupSessionStorage&&yn()&&window.sessionStorage.setItem(t.lookupSessionStorage,r)}},uo={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}},lo={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}},co={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}},fo={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 go(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var ai=function(){function e(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ve(this,e),this.type="languageDetector",this.detectors={},this.init(r,t)}return me(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=ro(i,this.options||{},go()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(io),this.addDetector(ao),this.addDetector(oo),this.addDetector(so),this.addDetector(uo),this.addDetector(lo),this.addDetector(co),this.addDetector(fo)}},{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}();ai.type="languageDetector";const ho={"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"},po={"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"},vo={"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"},mo={"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(ai).use(ma).init({resources:{pl:{translation:ho},en:{translation:po},de:{translation:vo},cs:{translation:mo}}});var oi=(e=>(e.SELECT="selCtx",e.FILTER="fltCtx",e))(oi||{}),qe=(e=>(e.OPTIONS="3e/group/options",e.CONFIG="3e/group/config",e.PRODUCT="3e/product",e))(qe||{}),Se=(e=>(e.OK="OK",e.TOO_MUCH="TOO_MUCH",e.NOT_ENOUGHT="NOT_ENOUGHT",e.IGNORE="IGNORE",e))(Se||{});const wr=(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]},yo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{qtyMin:n,qtyMax:a}=i,{t:o}=Bt(),[s,u]=wr(t,r,e.items),{status:c,information:f}=bo(n,a,u,o);return{chosenQtyCnt:u,qtyMin:n,qtyMax:a,walidationStatus:c,informationText:f}},bo=(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=Se.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<t&&(a=Se.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=Se.IGNORE),t>=o&&t<=s&&(a=Se.OK),{information:n,status:a}},Oo=(e,r)=>{const{selCtx:t,attrs:i={}}=e,{selMin:n,selMax:a}=i,{t:o}=Bt(),[s,u]=wr(t,r,e.items),{status:c,information:f}=So(n,a,s,o);return{chosenSelCnt:s,selMin:n,selMax:a,walidationStatus:c,informationText:f}},So=(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=Se.NOT_ENOUGHT)),s>0&&(n+=` ${i("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<t&&(a=Se.TOO_MUCH)),o>=0||s>=0?(n=`${i("OS.ProductConfigurator.Selected.Message.Choose")}${n}`,n+=` ${i("OS.ProductConfigurator.Selected.Message.Options")}`):(n="",a=Se.IGNORE),o===1&&s===1&&(n=`${i("OS.ProductConfigurator.Selected.Message.OneOption")}`),t>=o&&t<=s&&(a=Se.OK),{information:n,status:a}},wo=(e,r,t)=>{if(e==="selected"||e==="filter")return[];if(t[r]===e)return[t];let i=ui(e,r,t.items);return(i==null?void 0:i.length)||(i=si(e,r,t.items),i.length===0),i},si=(e,r,t)=>{const i=xo(t),n=ui(e,r,i);return(n==null?void 0:n.length)?n:(i==null?void 0:i.length)?si(e,r,i):[]},xo=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)},ui=(e,r,t)=>{let i=[];return Array.isArray(t)&&(i=t.filter(n=>{if(n&&n[r]===e)return!0})),i},Co=(e,r,t,i)=>{const n=wo(r,t,i),a=Po(e,n).filter(o=>o!==null&&typeof o!="undefined");return a.length?a[0]:null},Po=(e,r)=>{let t=[];return Array.isArray(r)&&r.length&&(t=r.map(i=>No(e,i))),t},No=(e,r)=>{if(r.id===e)return r;let t=ci(e,r.items);return t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):(t=li(e,r.items),t.length?(t.length>1&&console.error(`More than one ${e} in context ${r.id}`),t[0]):null)},li=(e,r)=>{const t=ko(r),i=ci(e,t);return(i==null?void 0:i.length)?i:(t==null?void 0:t.length)?li(e,t):[]},ko=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)},ci=(e,r)=>Array.isArray(r)?r.filter(i=>{if(i&&i.id===e)return!0}):[],xr=(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=Co(a,i,oi.SELECT,r);s&&(s==null?void 0:s.price)&&(t+=parseFloat(s.price)*o)}}return t};var qt={exports:{}},bt={};/*
3
3
  object-assign
4
4
  (c) Sindre Sorhus
5
5
  @license MIT
6
- */var bn=Object.getOwnPropertySymbols,Co=Object.prototype.hasOwnProperty,Po=Object.prototype.propertyIsEnumerable;function ko(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function No(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(a){n[a]=a}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}No();/** @license React v17.0.2
6
+ */var bn=Object.getOwnPropertySymbols,Eo=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable;function jo(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Fo(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(r).map(function(a){return r[a]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(a){n[a]=a}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Fo();/** @license React v17.0.2
7
7
  * react-jsx-runtime.production.min.js
8
8
  *
9
9
  * Copyright (c) Facebook, Inc. and its affiliates.
10
10
  *
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
- */var Eo=he.default,fi=60103;bt.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var On=Symbol.for;fi=On("react.element"),bt.Fragment=On("react.fragment")}var Lo=Eo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,jo=Object.prototype.hasOwnProperty,Fo={key:!0,ref:!0,__self:!0,__source:!0};function di(e,r,t){var i,n={},a=null,o=null;t!==void 0&&(a=""+t),r.key!==void 0&&(a=""+r.key),r.ref!==void 0&&(o=r.ref);for(i in r)jo.call(r,i)&&!Fo.hasOwnProperty(i)&&(n[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps,r)n[i]===void 0&&(n[i]=r[i]);return{$$typeof:fi,type:e,key:a,ref:o,props:n,_owner:Lo.current}}bt.jsx=di;bt.jsxs=di;qt.exports=bt;const b=qt.exports.jsx,V=qt.exports.jsxs,nt=qt.exports.Fragment;function Sn(e){const{isOkk:r,isErr:t,info:i}=e;return V("p",{className:`${r?"text-green-600":t&&"text-red-600"} ml-1 flex`,children:[r&&Ao,t&&Ro,i]})}const Ao=b("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:b("polyline",{points:"20 6 9 17 4 12"})}),Ro=b("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:b("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 To={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Do={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 dt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dt=function(r){return typeof r}:dt=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},dt(e)}function wn(e){return Mo(e)||Io(e)||_o(e)||$o()}function Mo(e){if(Array.isArray(e))return e}function Io(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function _o(e,r){if(!!e){if(typeof e=="string")return xn(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 xn(e,r)}}function xn(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 $o(){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 Vo={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=wn(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=wn(r),i=t[0],n=t.slice(1),a=i;return n.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function gi(e){return!isNaN(parseInt(e))&&isFinite(e)}function Uo(e){return gi(e)&&e<=100&&e>=0}function Ho(e){return e.length>0&&e.every(function(r){return r>=0})&&e.some(function(r){return r>0})}function Cn(e){return e%2===0}function Pn(e){return gi(e)&&!Number.isInteger(e)}function Bo(){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 ut(e){return Math.abs(e)%1===.5}function Wo(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),zo(n,r.headers),n.send()})}function zo(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 ft(e){return typeof e=="undefined"}function hi(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(e).forEach(function(i){if(dt(i[1])==="object"){var n=hi(i[1]);Object.entries(n).forEach(function(a){t[i[0]+r+a[0]]=a[1]})}else t[i[0]]=i[1]}),t}function qo(e){return Boolean(e)&&(dt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function pi(){var e=function(i,n){var a=function(u){return Math.pow(10,Bo(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 ut(i)&&Cn(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return ut(i)?Cn(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return ut(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return ut(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return ut(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 Pn(i)||Pn(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 Go=pi();function Ko(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!ft(i)}):[]},getMinimumFractionDigits:function(){var i=function(a){return a==="."};return ft(this.getMatches().find(i))?0:this.getMatches()[Go.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 ft(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ft(this.getMatches().find(function(i){return i===","}))}}}function Qo(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 Wo(r(e.endpoint,{from:n,to:a}),{headers:e.headers})};return{getExchangeRate:function(n,a){return(qo(e.endpoint)?e.endpoint:t(n,a)).then(function(o){return hi(o)[r(e.propertyPath,{from:n,to:a})]})}}}function ht(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new t(r)}function Jo(e){ht(Uo(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Yo(e){ht(Ho(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function or(e){ht(Number.isInteger(e),"You must provide an integer.",TypeError)}var G=pi(),Zo=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;or(i),or(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(p){var O=Object.assign({},Object.assign({},{amount:i,currency:n,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:O.amount,currency:O.currency,precision:O.precision}),{locale:O.locale})},d=function(p){ht(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||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;or(p);var w=this.getPrecision(),v=p>w,P=v?G.multiply:G.divide,C=v?[p,w]:[w,p],k=Math.pow(10,G.subtract.apply(G,C));return l.call(this,{amount:G.round(P(this.getAmount(),k),O),precision:p})},add:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return l.call(this,{amount:G.add(O[0].getAmount(),O[1].getAmount()),precision:O[0].getPrecision()})},subtract:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return l.call(this,{amount:G.subtract(O[0].getAmount(),O[1].getAmount()),precision:O[0].getPrecision()})},multiply:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:G.round(G.multiply(this.getAmount(),p),O)})},divide:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:G.round(G.divide(this.getAmount(),p),O)})},percentage:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Jo(p),this.multiply(G.divide(p,100),O)},allocate:function(p){var O=this;Yo(p);for(var w=p.reduce(function(k,D){return G.add(k,D)}),v=this.getAmount(),P=p.map(function(k){var D=Math.floor(G.divide(G.multiply(O.getAmount(),k),w));return v=G.subtract(v,D),l.call(O,{amount:D})}),C=0;v>0;)p[C]>0&&(P[C]=P[C].add(l.call(this,{amount:1})),v=G.subtract(v,1)),C+=1;return P},convert:function(p){var O=this,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=w.endpoint,P=v===void 0?f.endpoint:v,C=w.propertyPath,k=C===void 0?f.propertyPath||"rates.{{to}}":C,D=w.headers,T=D===void 0?f.headers:D,R=w.roundingMode,M=R===void 0?u:R,_=Object.assign({},{endpoint:P,propertyPath:k,headers:T,roundingMode:M});return Qo(_).getExchangeRate(this.getCurrency(),p).then(function(E){return ht(!ft(E),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(O,{amount:G.round(G.multiply(O.getAmount(),parseFloat(E)),_.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()<O[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()<=O[1].getAmount()},greaterThan:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()>O[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()>=O[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return G.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return G.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var O=e.normalizePrecision([this,p]);return O[0].getAmount()===O[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Ko(p);return this.toRoundedUnit(w.getMinimumFractionDigits(),O).toLocaleString(this.getLocale(),{currencyDisplay:w.getCurrencyDisplay(),useGrouping:w.getUseGrouping(),minimumFractionDigits:w.getMinimumFractionDigits(),style:w.getStyle(),currency:this.getCurrency()})},toUnit:function(){return G.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Math.pow(10,p);return G.divide(G.round(G.multiply(this.toUnit(),w),O),w)},toObject:function(){return{amount:i,currency:n,precision:a}},toJSON:function(){return this.toObject()}}},Xo=Object.assign(Zo,To,Do,Vo);const Lt=(e,r="PLN")=>{e=e.toString();const t=e.replace(",","."),i=Number(t)*100;return isNaN(i)?"0.00":Xo({amount:Math.floor(i),currency:r}).toFormat("0,0.00")},es=(e,r,t=1)=>{const i=parseFloat(e.toString());let n=!1,a=Lt(`${t*i}`);const o=`${Lt(`${a}`)}`;return i<parseFloat(r)&&(n=!0,a=`${Lt(`${r}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Gt(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=Lt(`${u}`);return!r&&n===!1?null:t?V("span",{style:{visibility:`${!r&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${c}`]}):r<s?V("span",{className:"",children:["\xA0",`od ${c}`]}):b("span",{className:"",children:c})}const ts=(e,r,t)=>e==="1"&&r==="1"&&!t?"radio":t?"counter":"checkbox",rs=e=>{const r=document.getElementById(e);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},vi=e=>`group--${e}`;function ns(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 p=f(r);if(!l(d,p)){const O=d;c(d=p,O)}}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 is=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),kn=is?y.useEffect:y.useLayoutEffect;function as(e){const r=typeof e=="function"?ns(e):e,t=(i=r.getState,n=Object.is)=>{const[,a]=y.useReducer(w=>w+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)),kn(()=>{g&&(l.current=d),s.current=o,u.current=i,c.current=n,f.current=!1});const p=y.useRef(o);kn(()=>{const w=()=>{try{const P=r.getState(),C=u.current(P);c.current(l.current,C)||(s.current=P,l.current=C,a())}catch{f.current=!0,a()}},v=r.subscribe(w);return r.getState()!==p.current&&w(),v},[]);const O=g?d:l.current;return y.useDebugValue(O),O};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 os=(e,r)=>({filter:{},unseenGroupsByFilter:[],setInitialFilter:t=>{e(()=>({filter:ue({},t),unseenGroupsByFilter:[]}))},setFilter:(t,i)=>{e(({filter:n})=>({filter:Qe(ue({},n),{[t]:ue(ue({},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 O;const{selCtx:l,id:d,items:g=[]}=f,p=(O=s[l])==null?void 0:O[d];p&&o(`selected.${l}.${d}`,p.toString()),g.length>0&&u(g)})};u(i)}}),ss=(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}))}}),us=(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:Qe(ue({},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}}),ee=as((e,r)=>ue(ue(ue({},os(e,r)),ss(e)),us(e,r))),ls=e=>{const{productItem:r,selected:t,parentCtx:i,nestedLvl:n,parentKind:a}=e,{walidationStatus:o,informationText:s}=vo(r,t),{walidationStatus:u,informationText:c}=ho(r,t),{watch:f,setValue:l}=mt(),[d,g]=y.useState([]),[p,O]=y.useState(!0),{items:w,selCtx:v,attrs:P={},details:C={},filter:k,fltCtx:D}=r,{name:T,description:R}=C.literals,M=ee(I=>I.filter),_=ee(I=>I.validateFilter),E=ee(I=>I.uncheckFilteredProducts),A=ee(I=>I.checkFilteredProducts);y.useEffect(()=>{const I=_(k,D);E(k,w,I,f,l),A(k,w,I,f,l),g(I)},[M]);const $=ee(I=>I.setGroupsValidation),U=ee(I=>I.isOnSubmitted),[W,Q]=wr(r.selCtx,t,w),H=k&&Object.keys(k).length>0&&d.length===0;$(i,v,P,Q,W,a,n,!H);const J=o===Oe.OK,te=u===Oe.OK,Z=!J&&U&&!!s,X=!te&&U&&!!c;return H?null:V("div",{className:"pt-1 mb-3 configuration-group",id:vi(v),children:[V("div",{className:"flex text-xl font-semibold",children:[b("p",{className:"",children:T}),T&&T!==" "&&V(nt,{children:[b("div",{className:"ml-auto",children:b(Gt,{price:xr(t,r)})}),b("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!p&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>O(I=>!I),children:b("polyline",{points:"18 15 12 9 6 15"})})]})]}),b("p",{className:`${R&&"mb-2"}`,children:R}),b("div",{className:"flex",children:V("div",{children:[b(Sn,{isOkk:J,isErr:Z,info:s}),b(Sn,{isOkk:te,isErr:X,info:c})]})}),p&&b(Cr,{productItems:w,nestedLvl:n+1,context:r})]})};function mi(e){const{value:r=0,add:t,subtract:i,disabledSubtract:n,disabledAdd:a,size:o="md"}=e;return V("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:[b("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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),b("span",{className:"font-semibold text-gray-700 product-quantity-value",children:r}),b("button",{className:"quantity-button small",type:"button",onClick:t,disabled:a,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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function yi(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 V("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:[b("input",Qe(ue({type:"checkbox",className:`simple-checkbox checkbox-${i} mr-4`,id:d},s(`selected.${o}.${a}`,{onChange:g=>{u(g)}})),{disabled:f,value:"1"})),l&&b("div",{className:"flex mr-2 w-20 max-h-24",children:b("img",{alt:"Product image",className:"max-w-full h-auto",src:l})}),b("label",{htmlFor:d,className:"flex justify-between items-center w-full",children:V("div",{className:"relative",children:[b("p",{className:"w-full text-lg font-semibold",children:r}),b("p",{className:"text-sm text-gray-600",children:n})]})}),b("div",{className:"ml-auto",children:c}),b("label",{htmlFor:d,children:b(Gt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}function bi(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,p=`${o}---${a}`;return V("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:[b("input",Qe(ue({type:"radio",className:`simple-radio radio-${i} mr-4`,id:p},s(`radio.${o}`,{onChange:O=>{u(O)}})),{value:a,checked:c,disabled:l,readOnly:d})),g&&b("div",{className:"flex mr-2 w-20 max-h-24",children:b("img",{alt:"Product image",className:"max-w-full h-auto",src:g})}),b("label",{htmlFor:p,className:"flex justify-between items-center w-full",children:V("div",{className:"relative",children:[b("p",{className:"w-full text-lg font-semibold",children:r}),b("p",{className:"text-sm text-gray-600",children:n})]})}),b("div",{className:"ml-auto",children:f}),b("label",{htmlFor:p,children:b(Gt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}const cs=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:p,setValue:O,watch:w}=mt(),v=w(`selected.${u}.${s}`),P=ee(E=>E.isAddDisabled),C=ee(E=>E.isInputDisabled),k=()=>{O(`selected.${u}.${s}`,`${Number(v)+1}`)},D=()=>{O(`selected.${u}.${s}`,`${Number(v)-1}`)},T=Number(v)===0||!v,R=b(mi,{value:v?Number(v):0,add:k,subtract:D,disabledSubtract:T,disabledAdd:P(u,v,l==null?void 0:l.qtyMax)||C(u)&&!v}),{selMin:M="",selMax:_=""}=d;return b("div",{children:M==="1"&&_==="1"?b(bi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:p,handleOnChange:f,checked:g,isDisabled:!1,children:R}):b(yi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:p,handleOnChange:c,isDisabled:C(u)&&!v||P(u,v,l==null?void 0:l.qtyMax)&&!v,children:R})})},Nn=(e,r)=>{Object.keys(e).forEach(t=>{r(`selected.${t}`,e[t])})},En=(e,r,t)=>{const i=r(`selected.${e}`);t(`selected.${e}`,Object.keys(i).reduce((n,a)=>(n[a]=!1,n),{}))},Ln=(e,r,t,i,n)=>{const{target:{checked:a}}=i,{selected:o={}}=n;if(a){Nn(o,e);const s=u=>{!Array.isArray(u)||u.map(c=>{if(c.state&&"selected"in c.state){const{state:{selected:f}}=c;Nn(f,e)}Array.isArray(c.items)&&s(c.items)})};s(t)}else{Object.keys(o).forEach(u=>{En(u,r,e)});const s=u=>{!Array.isArray(u)||u.map(c=>{const{selCtx:f}=c;r(`selected.${f}`)&&En(f,r,e),s(c.items)})};s(t)}},fs=e=>{var Q;const{productItem:r,contextAttrs:t,selected:i,nestedLvl:n}=e,{register:a,watch:o,setValue:s,getValues:u}=mt(),{items:c,id:f,selCtx:l,state:d={},attrs:g={},emit:p={},fltCtx:O,details:{media:w=[],literals:v},price:P=""}=r,{name:C,description:k}=v,D=ee(H=>H.isInputDisabled),T=ee(H=>H.setFilter),R=i[l]&&i[l][r.id],M=w.find(H=>H.name==="MAIN_IMG")||w[0]||{},_=H=>{Ln(s,u,c,H,d)},E=H=>{Ln(s,u,c,H,d);const{target:J}=H,te=J.name,Z=J.defaultValue,X="selected."+te.replace("radio.","");s(X,{[Z]:"1"})},A=o(`selected.${l}.${f}`);y.useEffect(()=>{A&&Object.keys(p).length!==0&&T(O,p)},[A]);const $=Rr.useTransition(Array.isArray(r.items)&&r.items.length>0&&A,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});if(!r)return null;let U=P;return(!U||parseFloat(U||"1")===0)&&((Q=r==null?void 0:r.state)==null?void 0:Q.selected)&&(U=`${xr(r.state.selected,r)||"0"}`),V(nt,{children:[(()=>{switch(ts(t==null?void 0:t.selMin,t==null?void 0:t.selMax,t==null?void 0:t.allowMultiple)){case"counter":return b(cs,{description:k,productName:C,price:U,productId:f,selCtx:l,state:d,items:c,handleOnChangeCheckBox:_,handleOnChangeRadio:E,checked:!!R,contextAttrs:t,productAttrs:g});case"radio":return b(bi,{description:k,productName:C,price:U,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:E,checked:!!R,isDisabled:!1,imgSrc:(M==null?void 0:M.url)||""});case"checkbox":return b(yi,{description:k,productName:C,price:U,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:_,isDisabled:D(l)&&!A,imgSrc:(M==null?void 0:M.url)||""});default:return null}})(),$((H,J)=>J&&b(Rr.animated.div,{className:`border-l-[2px] border-gray-300 ${n>1&&"ml-4 pl-4"}`,style:H,children:b(Cr,{productItems:c,nestedLvl:n+1,context:r})},n+1))]})};function ds(e){var f,l;const{productItem:r,nestedLvl:t,context:{attrs:i={},selCtx:n,kind:a}}=e,{kind:o}=r,{getValues:s}=mt(),{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 b(ls,{productItem:r,parentCtx:n,selected:u,nestedLvl:t,parentKind:a});case qe.PRODUCT:return b(fs,{productItem:r,selected:u,nestedLvl:t,contextAttrs:i});default:return null}}const sr=99,jn=3;function Cr(e){const{productItems:r,nestedLvl:t=1,context:i}=e,n=i.kind!=="3e/product",[a,o]=y.useState(n?jn:sr),{t:s}=Bt(),u=()=>{o(sr)},c=()=>{o(jn)};return b("div",{children:r.map((f,l)=>{if(l<a)return V("div",{children:[b(ds,{productItem:f,nestedLvl:t,context:i},`${i.id}--${f.id}`),a===sr&&n&&r.length===l+1&&Fn(s("OS.ProductConfigurator.ShowLess"),c,!1)]},`${i.id}--${f.id}`);if(l===a)return Fn(s("OS.ProductConfigurator.ShowMore"),u,!0)})})}const Fn=(e,r,t)=>b("div",{className:"flex justify-center w-full",children:V("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:r,children:[e,V("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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",b("polyline",{points:"7 7 12 12 17 7"})," ",b("polyline",{points:"7 13 12 18 17 13"})]})]})}),gs=e=>{let r=JSON.parse(JSON.stringify(e));for(let[t,i]of Object.entries(r))if(i){const n=r[t];for(let[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},hs=()=>{const{watch:e}=mt(),r=e("selected");return console.log(r),V("div",{className:"flex flex-col items-center py-4",children:[b("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(r).map(t=>b("div",{children:Object.values(r[t]).filter(i=>i).length>0&&V(nt,{children:[V("p",{className:"text-lg font-semibold",children:[t,":"]}),Object.keys(r[t]).map(i=>b(he.default.Fragment,{children:r[t][i]&&V("p",{children:[i,":",r[t][i].toString()]})},i))]})},t))]})};function An(e){const{finalPrice:r,isBackIcon:t=!0,handleGoBack:i,displayPriceFrom:n=!1}=e,{t:a}=Bt(),o=ee(c=>c.mainProductCount),s=ee(c=>c.increaseCount),u=ee(c=>c.decreaseCount);return V("div",{className:"flex justify-around items-center px-4 w-full h-16",children:[t&&V("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:[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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),b("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),b("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),b("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Back")}`})]}),b("div",{className:"px-3",children:b(mi,{value:o,add:s,subtract:u,disabledSubtract:o===1,size:"lg"})}),V("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:[V("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:[b("circle",{cx:"9",cy:"21",r:"1"})," ",b("circle",{cx:"20",cy:"21",r:"1"}),b("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),n?b("span",{children:`${a("OS.ProductConfigurator.Selected.Message.From")} ${r}`}):b("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Add")} ${r}`})]})]})}const Pt=640,Oi=e=>{const{isModal:r=!1}=e,[t,i]=y.useState(window.innerWidth),[n,a]=y.useState(window.innerHeight),[o,s]=y.useState(window.innerWidth<=Pt),[u,c]=y.useState(window.innerWidth>Pt&&!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>Pt&&!r),s(window.innerWidth<=Pt)},[t,e,r]),{isSm:u,isMobile:o,width:t,windowHeight:n}};function Si(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=Si(e[r]))&&(i&&(i+=" "),i+=t);else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function lt(){for(var e=0,r,t,i="";e<arguments.length;)(r=arguments[e++])&&(t=Si(r))&&(i&&(i+=" "),i+=t);return i}function ps(e){var te,Z,X,I;const{product:r,handleAddToBasket:t,isModal:i,handleGoBack:n,showDebugState:a=!1}=e,{state:{selected:o={}}={},price:s,minPrice:u="0"}=r,c=oa({defaultValues:{selected:o}}),{handleSubmit:f,getValues:l}=c,d=ee(B=>B.setIsOnSubmittedOnTrue),[g,p]=y.useState("auto"),O=ee(B=>B.mainProductCount),w=ee(B=>B.getInvalidContextNames),v=ee(B=>B.filter),P=parseFloat(s)+xr(l("selected"),r),{displayPriceFrom:C,formattedEndPrice:k}=es(P,u,O),D=B=>{d();const re=w();re.length?(rs(vi(re[0])),console.log(re)):(console.log(l("selected")),t({price:P/O,quantity:O,selected:gs(l("selected")),filter:v}))},T=y.useRef(),R=y.useRef(),{isSm:M,isMobile:_,windowHeight:E}=Oi({isModal:i}),A=V(nt,{children:[V("div",{className:lt("px-4 w-full",M&&"sm:sticky sm:top-0 sm:w-2/5"),ref:T,children:[r.details.media&&r.details.media[0].url&&b("img",{className:lt("mx-auto mt-2 mb-6 max-h-[250px]",M&&"max-h-[450px]"),alt:r.details.literals.name,src:(te=r.details)==null?void 0:te.media[0].url}),b("div",{className:lt(!a&&"hidden"),children:b(hs,{})})]}),V("div",{className:lt("w-full",M&&"sm:w-3/5"),ref:R,children:[V("div",{className:"items-center p-4 w-full",children:[V("div",{className:"flex justify-between mb-4 w-full text-2xl font-semibold",children:[V("span",{className:"",children:[r.details.literals.name," "]}),b(Gt,{price:P,minPrice:u})]}),b("span",{className:"text-gray-600",children:(Z=r.details.literals)==null?void 0:Z.description})]}),V("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)&&b(Cr,{productItems:r.items,context:r}),b("div",{className:"sm:h-[64px]"})]}),M&&b("div",{className:"-mt-5 mb-2 bg-gray-100",children:b(An,{finalPrice:k,isBackIcon:!1,handleGoBack:n,displayPriceFrom:C})})]})]}),$=(X=T==null?void 0:T.current)==null?void 0:X.clientHeight,U=(I=R==null?void 0:R.current)==null?void 0:I.clientHeight,W=$+U;console.log(`modalContentHeight ${W} h1:${$} h1:${U}`),W>window.innerHeight*.7||isNaN(W)?g==="auto"&&p("80vh"):g!=="auto"&&p("auto");const Q=`${E-64-56}px`,H=!M,J={"--mobile-submit-row-top":`${E-64-80}px`};return b(qi,Qe(ue({},c),{children:V("form",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},onSubmit:f(D),children:[b("div",{className:lt("flex relative flex-col items-start w-full form-body stretch",!H&&"sm:flex-row-reverse sm:pb-0",!_&&"mobile-scrollbar"),style:{height:`${_?Q:g}`,minHeight:"50vh",overflowY:`${i?"scroll":"visible"}`},children:A}),H&&b("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${_?"submit-row-mobile":"submit-row"}`,style:J,children:b(An,{handleGoBack:n,finalPrice:k,isBackIcon:!1})})]})}))}function we(){return we=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},we.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 vs(e,r){if(!!e){if(typeof e=="string")return Rn(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 Rn(e,r)}}function Rn(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 Se(e,r){var t;if(typeof Symbol=="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(t=vs(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.
15
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return t=e[Symbol.iterator](),t.next.bind(t)}function Ne(e,r){if(e in r){for(var t=r[e],i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t}var o=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(r).map(function(s){return'"'+s+'"'}).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(o,Ne),o}var $e;(function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"})($e||($e={}));var pe;(function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"})(pe||(pe={}));function Be(e){var r=e.props,t=e.slot,i=e.defaultTag,n=e.features,a=e.visible,o=a===void 0?!0:a,s=e.name;if(o)return kt(r,t,i,s);var u=n!=null?n:$e.None;if(u&$e.Static){var c=r.static,f=c===void 0?!1:c,l=Ke(r,["static"]);if(f)return kt(l,t,i,s)}if(u&$e.RenderStrategy){var d,g=r.unmount,p=g===void 0?!0:g,O=Ke(r,["unmount"]),w=p?pe.Unmount:pe.Hidden;return Ne(w,(d={},d[pe.Unmount]=function(){return null},d[pe.Hidden]=function(){return kt(we({},O,{hidden:!0,style:{display:"none"}}),t,i,s)},d))}return kt(r,t,i,s)}function kt(e,r,t,i){var n;r===void 0&&(r={});var a=ur(e,["unmount","static"]),o=a.as,s=o===void 0?t:o,u=a.children,c=a.refName,f=c===void 0?"ref":c,l=Ke(a,["as","children","refName"]),d=e.ref!==void 0?(n={},n[f]=e.ref,n):{},g=typeof u=="function"?u(r):u;if(l.className&&typeof l.className=="function"&&(l.className=l.className(r)),s===y.Fragment&&Object.keys(l).length>0){if(!y.isValidElement(g)||Array.isArray(g)&&g.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(l).map(function(p){return" - "+p}).join(`
13
+ */var Ao=he.default,fi=60103;bt.Fragment=60107;if(typeof Symbol=="function"&&Symbol.for){var On=Symbol.for;fi=On("react.element"),bt.Fragment=On("react.fragment")}var Ro=Ao.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,To=Object.prototype.hasOwnProperty,Mo={key:!0,ref:!0,__self:!0,__source:!0};function di(e,r,t){var i,n={},a=null,o=null;t!==void 0&&(a=""+t),r.key!==void 0&&(a=""+r.key),r.ref!==void 0&&(o=r.ref);for(i in r)To.call(r,i)&&!Mo.hasOwnProperty(i)&&(n[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps,r)n[i]===void 0&&(n[i]=r[i]);return{$$typeof:fi,type:e,key:a,ref:o,props:n,_owner:Ro.current}}bt.jsx=di;bt.jsxs=di;qt.exports=bt;const b=qt.exports.jsx,$=qt.exports.jsxs,nt=qt.exports.Fragment;function Sn(e){const{isOkk:r,isErr:t,info:i}=e;return $("p",{className:`${r?"text-green-600":t&&"text-red-600"} ml-1 flex`,children:[r&&Do,t&&Io,i]})}const Do=b("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:b("polyline",{points:"20 6 9 17 4 12"})}),Io=b("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:b("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 _o={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Vo={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 dt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dt=function(r){return typeof r}:dt=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},dt(e)}function wn(e){return $o(e)||Uo(e)||Ho(e)||Bo()}function $o(e){if(Array.isArray(e))return e}function Uo(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function Ho(e,r){if(!!e){if(typeof e=="string")return xn(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 xn(e,r)}}function xn(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 Bo(){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 Wo={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=wn(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=wn(r),i=t[0],n=t.slice(1),a=i;return n.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function gi(e){return!isNaN(parseInt(e))&&isFinite(e)}function zo(e){return gi(e)&&e<=100&&e>=0}function qo(e){return e.length>0&&e.every(function(r){return r>=0})&&e.some(function(r){return r>0})}function Cn(e){return e%2===0}function Pn(e){return gi(e)&&!Number.isInteger(e)}function Go(){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 ut(e){return Math.abs(e)%1===.5}function Ko(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),Qo(n,r.headers),n.send()})}function Qo(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 ft(e){return typeof e=="undefined"}function hi(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(e).forEach(function(i){if(dt(i[1])==="object"){var n=hi(i[1]);Object.entries(n).forEach(function(a){t[i[0]+r+a[0]]=a[1]})}else t[i[0]]=i[1]}),t}function Jo(e){return Boolean(e)&&(dt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function pi(){var e=function(i,n){var a=function(u){return Math.pow(10,Go(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 ut(i)&&Cn(n)?n-1:n},HALF_EVEN:function(i){var n=Math.round(i);return ut(i)?Cn(n)?n:n-1:n},HALF_UP:function(i){return Math.round(i)},HALF_DOWN:function(i){return ut(i)?Math.floor(i):Math.round(i)},HALF_TOWARDS_ZERO:function(i){return ut(i)?Math.sign(i)*Math.floor(Math.abs(i)):Math.round(i)},HALF_AWAY_FROM_ZERO:function(i){return ut(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 Pn(i)||Pn(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 Yo=pi();function Zo(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!ft(i)}):[]},getMinimumFractionDigits:function(){var i=function(a){return a==="."};return ft(this.getMatches().find(i))?0:this.getMatches()[Yo.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 ft(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!ft(this.getMatches().find(function(i){return i===","}))}}}function Xo(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 Ko(r(e.endpoint,{from:n,to:a}),{headers:e.headers})};return{getExchangeRate:function(n,a){return(Jo(e.endpoint)?e.endpoint:t(n,a)).then(function(o){return hi(o)[r(e.propertyPath,{from:n,to:a})]})}}}function ht(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new t(r)}function es(e){ht(zo(e),"You must provide a numeric value between 0 and 100.",RangeError)}function ts(e){ht(qo(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function or(e){ht(Number.isInteger(e),"You must provide an integer.",TypeError)}var G=pi(),rs=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;or(i),or(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(p){var O=Object.assign({},Object.assign({},{amount:i,currency:n,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:O.amount,currency:O.currency,precision:O.precision}),{locale:O.locale})},d=function(p){ht(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||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;or(p);var w=this.getPrecision(),v=p>w,N=v?G.multiply:G.divide,C=v?[p,w]:[w,p],P=Math.pow(10,G.subtract.apply(G,C));return l.call(this,{amount:G.round(N(this.getAmount(),P),O),precision:p})},add:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return l.call(this,{amount:G.add(O[0].getAmount(),O[1].getAmount()),precision:O[0].getPrecision()})},subtract:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return l.call(this,{amount:G.subtract(O[0].getAmount(),O[1].getAmount()),precision:O[0].getPrecision()})},multiply:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:G.round(G.multiply(this.getAmount(),p),O)})},divide:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:G.round(G.divide(this.getAmount(),p),O)})},percentage:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return es(p),this.multiply(G.divide(p,100),O)},allocate:function(p){var O=this;ts(p);for(var w=p.reduce(function(P,M){return G.add(P,M)}),v=this.getAmount(),N=p.map(function(P){var M=Math.floor(G.divide(G.multiply(O.getAmount(),P),w));return v=G.subtract(v,M),l.call(O,{amount:M})}),C=0;v>0;)p[C]>0&&(N[C]=N[C].add(l.call(this,{amount:1})),v=G.subtract(v,1)),C+=1;return N},convert:function(p){var O=this,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=w.endpoint,N=v===void 0?f.endpoint:v,C=w.propertyPath,P=C===void 0?f.propertyPath||"rates.{{to}}":C,M=w.headers,R=M===void 0?f.headers:M,D=w.roundingMode,V=D===void 0?u:D,T=Object.assign({},{endpoint:N,propertyPath:P,headers:R,roundingMode:V});return Xo(T).getExchangeRate(this.getCurrency(),p).then(function(k){return ht(!ft(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(O,{amount:G.round(G.multiply(O.getAmount(),parseFloat(k)),T.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()<O[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()<=O[1].getAmount()},greaterThan:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()>O[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var O=e.normalizePrecision([this,p]);return O[0].getAmount()>=O[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return G.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return G.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var O=e.normalizePrecision([this,p]);return O[0].getAmount()===O[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Zo(p);return this.toRoundedUnit(w.getMinimumFractionDigits(),O).toLocaleString(this.getLocale(),{currencyDisplay:w.getCurrencyDisplay(),useGrouping:w.getUseGrouping(),minimumFractionDigits:w.getMinimumFractionDigits(),style:w.getStyle(),currency:this.getCurrency()})},toUnit:function(){return G.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,w=Math.pow(10,p);return G.divide(G.round(G.multiply(this.toUnit(),w),O),w)},toObject:function(){return{amount:i,currency:n,precision:a}},toJSON:function(){return this.toObject()}}},ns=Object.assign(rs,_o,Vo,Wo);const Lt=(e,r="PLN")=>{e=e.toString();const t=e.replace(",","."),i=Number(t)*100;return isNaN(i)?"0.00":ns({amount:Math.floor(i),currency:r}).toFormat("0,0.00")},is=(e,r,t=1)=>{const i=parseFloat(e.toString());let n=!1,a=Lt(`${t*i}`);const o=`${Lt(`${a}`)}`;return i<parseFloat(r)&&(n=!0,a=`${Lt(`${r}`)}`),{displayPriceFrom:n,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Gt(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=Lt(`${u}`);return!r&&n===!1?null:t?$("span",{style:{visibility:`${!r&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${c}`]}):r<s?$("span",{className:"",children:["\xA0",`od ${c}`]}):b("span",{className:"",children:c})}const as=(e,r,t)=>e==="1"&&r==="1"&&!t?"radio":t?"counter":"checkbox",os=e=>{const r=document.getElementById(e);r?r.scrollIntoView({behavior:"smooth"}):console.warn(`Error: scrollToId: id: ${e} not found in html structure`)},vi=e=>`group--${e}`;function ss(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 p=f(r);if(!l(d,p)){const O=d;c(d=p,O)}}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 us=typeof window=="undefined"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Nn=us?m.useEffect:m.useLayoutEffect;function ls(e){const r=typeof e=="function"?ss(e):e,t=(i=r.getState,n=Object.is)=>{const[,a]=m.useReducer(w=>w+1,0),o=r.getState(),s=m.useRef(o),u=m.useRef(i),c=m.useRef(n),f=m.useRef(!1),l=m.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)),Nn(()=>{g&&(l.current=d),s.current=o,u.current=i,c.current=n,f.current=!1});const p=m.useRef(o);Nn(()=>{const w=()=>{try{const N=r.getState(),C=u.current(N);c.current(l.current,C)||(s.current=N,l.current=C,a())}catch{f.current=!0,a()}},v=r.subscribe(w);return r.getState()!==p.current&&w(),v},[]);const O=g?d:l.current;return m.useDebugValue(O),O};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 cs=(e,r)=>({filter:{},unseenGroupsByFilter:[],setInitialFilter:t=>{e(()=>({filter:ue({},t),unseenGroupsByFilter:[]}))},setFilter:(t,i)=>{e(({filter:n})=>({filter:Qe(ue({},n),{[t]:ue(ue({},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 O;const{selCtx:l,id:d,items:g=[]}=f,p=(O=s[l])==null?void 0:O[d];p&&o(`selected.${l}.${d}`,p.toString()),g.length>0&&u(g)})};u(i)}}),fs=(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}))}}),ds=(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:Qe(ue({},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}}),te=ls((e,r)=>ue(ue(ue({},cs(e,r)),fs(e)),ds(e,r))),gs=e=>{const{productItem:r,selected:t,parentCtx:i,nestedLvl:n,parentKind:a}=e,{walidationStatus:o,informationText:s}=Oo(r,t),{walidationStatus:u,informationText:c}=yo(r,t),{watch:f,setValue:l}=mt(),[d,g]=m.useState([]),[p,O]=m.useState(!0),{items:w,selCtx:v,attrs:N={},details:C={},filter:P,fltCtx:M}=r,{name:R,description:D}=C.literals,V=te(I=>I.filter),T=te(I=>I.validateFilter),k=te(I=>I.uncheckFilteredProducts),L=te(I=>I.checkFilteredProducts);m.useEffect(()=>{const I=T(P,M);k(P,w,I,f,l),L(P,w,I,f,l),g(I)},[V]);const _=te(I=>I.setGroupsValidation),z=te(I=>I.isOnSubmitted),[U,J]=wr(r.selCtx,t,w),Z=P&&Object.keys(P).length>0&&d.length===0;_(i,v,N,J,U,a,n,!Z);const W=o===Se.OK,Y=u===Se.OK,re=!W&&z&&!!s,ee=!Y&&z&&!!c;return Z?null:$("div",{className:"pt-1 mb-3 configuration-group",id:vi(v),children:[$("div",{className:"flex text-xl font-semibold",children:[b("p",{className:"",children:R}),R&&R!==" "&&$(nt,{children:[b("div",{className:"ml-auto",children:b(Gt,{price:xr(t,r)})}),b("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!p&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>O(I=>!I),children:b("polyline",{points:"18 15 12 9 6 15"})})]})]}),b("p",{className:`${D&&"mb-2"}`,children:D}),b("div",{className:"flex",children:$("div",{children:[b(Sn,{isOkk:W,isErr:re,info:s}),b(Sn,{isOkk:Y,isErr:ee,info:c})]})}),p&&b(Cr,{productItems:w,nestedLvl:n+1,context:r})]})};function mi(e){const{value:r=0,add:t,subtract:i,disabledSubtract:n,disabledAdd:a,size:o="md"}=e;return $("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:[b("button",{type:"button",className:"quantity-button small",onClick:i,disabled:n,children:$("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),b("span",{className:"font-semibold text-gray-700 product-quantity-value",children:r}),b("button",{className:"quantity-button small",type:"button",onClick:t,disabled:a,children:$("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function yi(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 $("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:[b("input",Qe(ue({type:"checkbox",className:`simple-checkbox checkbox-${i} mr-4`,id:d},s(`selected.${o}.${a}`,{onChange:g=>{u(g)}})),{disabled:f,value:"1"})),l&&b("div",{className:"flex mr-2 w-20 max-h-24",children:b("img",{alt:"Product image",className:"max-w-full h-auto",src:l})}),b("label",{htmlFor:d,className:"flex justify-between items-center w-full",children:$("div",{className:"relative",children:[b("p",{className:"w-full text-lg font-semibold",children:r}),b("p",{className:"text-sm text-gray-600",children:n})]})}),b("div",{className:"ml-auto",children:c}),b("label",{htmlFor:d,children:b(Gt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}function bi(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,p=`${o}---${a}`;return $("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:[b("input",Qe(ue({type:"radio",className:`simple-radio radio-${i} mr-4`,id:p},s(`radio.${o}`,{onChange:O=>{u(O)}})),{value:a,checked:c,disabled:l,readOnly:d})),g&&b("div",{className:"flex mr-2 w-20 max-h-24",children:b("img",{alt:"Product image",className:"max-w-full h-auto",src:g})}),b("label",{htmlFor:p,className:"flex justify-between items-center w-full",children:$("div",{className:"relative",children:[b("p",{className:"w-full text-lg font-semibold",children:r}),b("p",{className:"text-sm text-gray-600",children:n})]})}),b("div",{className:"ml-auto",children:f}),b("label",{htmlFor:p,children:b(Gt,{price:parseFloat(t),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})}const hs=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:p,setValue:O,watch:w}=mt(),v=w(`selected.${u}.${s}`);let N=0;v&&!isNaN(v)&&(N=Number(v));const C=te(L=>L.isAddDisabled),P=te(L=>L.isInputDisabled),M=()=>{O(`selected.${u}.${s}`,`${N+1}`)},R=()=>{O(`selected.${u}.${s}`,`${N-1}`)},D=Number(v)===0||!v,V=b(mi,{value:N,add:M,subtract:R,disabledSubtract:D,disabledAdd:C(u,v,l==null?void 0:l.qtyMax)||P(u)&&!v}),{selMin:T="",selMax:k=""}=d;return b("div",{children:T==="1"&&k==="1"?b(bi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:p,handleOnChange:f,checked:g,isDisabled:!1,children:V}):b(yi,{description:o,productName:r,price:n,productId:s,selCtx:u,state:t,items:i,register:p,handleOnChange:c,isDisabled:P(u)&&!v||C(u,v,l==null?void 0:l.qtyMax)&&!v,children:V})})},kn=(e,r)=>{Object.keys(e).forEach(t=>{r(`selected.${t}`,e[t])})},En=(e,r,t)=>{const i=r(`selected.${e}`);t(`selected.${e}`,Object.keys(i).reduce((n,a)=>(n[a]=!1,n),{}))},Ln=(e,r,t,i,n)=>{const{target:{checked:a}}=i,{selected:o={}}=n;if(a){kn(o,e);const s=u=>{!Array.isArray(u)||u.map(c=>{if(c.state&&"selected"in c.state){const{state:{selected:f}}=c;kn(f,e)}Array.isArray(c.items)&&s(c.items)})};s(t)}else{Object.keys(o).forEach(u=>{En(u,r,e)});const s=u=>{!Array.isArray(u)||u.map(c=>{const{selCtx:f}=c;r(`selected.${f}`)&&En(f,r,e),s(c.items)})};s(t)}},ps=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}},vs=e=>{var Z;const{productItem:r,contextAttrs:t,selected:i,nestedLvl:n}=e,{register:a,watch:o,setValue:s,getValues:u}=mt(),{items:c,id:f,selCtx:l,state:d={},attrs:g={},emit:p={},fltCtx:O,details:{media:w=[],literals:v},price:N=""}=r,C=ps(r),{name:P,description:M}=v,R=te(W=>W.isInputDisabled),D=te(W=>W.setFilter),V=i[l]&&i[l][r.id]&&Number(i[l][r.id])>0,T=w.find(W=>W.name==="MAIN_IMG")||w[0]||{},k=W=>{Ln(s,u,c,W,d)},L=W=>{Ln(s,u,c,W,d);const{target:Y}=W,re=Y.name,ee=Y.defaultValue,I="selected."+re.replace("radio.","");s(I,{[ee]:"1"})},_=o(`selected.${l}.${f}`);m.useEffect(()=>{_&&Object.keys(p).length!==0&&D(O,p)},[_]);const z=Rr.useTransition(Array.isArray(r.items)&&r.items.length>0&&_,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});if(!r)return null;let U=N;return(!U||parseFloat(U||"1")===0)&&((Z=r==null?void 0:r.state)==null?void 0:Z.selected)&&(U=`${xr(r.state.selected,r)||"0"}`),$(nt,{children:[(()=>{switch(as(t==null?void 0:t.selMin,t==null?void 0:t.selMax,t==null?void 0:t.allowMultiple)){case"counter":return b(hs,{description:M,productName:P,price:U,productId:f,selCtx:l,state:d,items:c,handleOnChangeCheckBox:k,handleOnChangeRadio:L,checked:!!V,contextAttrs:t,productAttrs:C});case"radio":return b(bi,{description:M,productName:P,price:U,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:L,checked:!!V,isDisabled:!1,imgSrc:(T==null?void 0:T.url)||""});case"checkbox":return b(yi,{description:M,productName:P,price:U,productId:f,selCtx:l,state:d,items:c,register:a,handleOnChange:k,isDisabled:R(l)&&!_,imgSrc:(T==null?void 0:T.url)||""});default:return null}})(),z((W,Y)=>Y&&b(Rr.animated.div,{className:`border-l-[2px] border-gray-300 ${n>1&&"ml-4 pl-4"}`,style:W,children:b(Cr,{productItems:c,nestedLvl:n+1,context:r})},n+1))]})};function ms(e){var f,l;const{productItem:r,nestedLvl:t,context:{attrs:i={},selCtx:n,kind:a}}=e,{kind:o}=r,{getValues:s}=mt(),{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 b(gs,{productItem:r,parentCtx:n,selected:u,nestedLvl:t,parentKind:a});case qe.PRODUCT:return b(vs,{productItem:r,selected:u,nestedLvl:t,contextAttrs:i});default:return null}}const sr=99,jn=3;function Cr(e){const{productItems:r,nestedLvl:t=1,context:i}=e,n=i.kind!=="3e/product",[a,o]=m.useState(n?jn:sr),{t:s}=Bt(),u=()=>{o(sr)},c=()=>{o(jn)};return b("div",{children:r.map((f,l)=>{if(l<a)return $("div",{children:[b(ms,{productItem:f,nestedLvl:t,context:i},`${i.id}--${f.id}--${l}`),a===sr&&n&&r.length===l+1&&Fn(s("OS.ProductConfigurator.ShowLess"),c,!1)]},`${i.id}--${f.id}--${l}`);if(l===a)return Fn(s("OS.ProductConfigurator.ShowMore"),u,!0)})})}const Fn=(e,r,t)=>b("div",{className:"flex justify-center w-full",children:$("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:r,children:[e,$("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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",b("polyline",{points:"7 7 12 12 17 7"})," ",b("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),ys=["id","selCtx","fltCtx"],Oi=".",Si="#dot",bs=e=>e.replaceAll(Oi,Si),Os=e=>e.replaceAll(Si,Oi),Ss=(e,r)=>wi(e,r,bs),ws=(e,r)=>wi(e,r,Os),wi=(e,r,t)=>{let i=r;if(ys.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},xi=(e,r)=>(Object.keys(e).forEach(t=>{const i=e[t];e[t]=r(t,i),typeof i=="object"&&i!==null&&xi(i,r)}),e),xs=e=>{const r=JSON.parse(JSON.stringify(e));for(const[t,i]of Object.entries(r))if(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=>ws("selected",e),Ps=()=>{const{watch:e}=mt(),r=e("selected");return console.log("selected",r),$("div",{className:"flex flex-col items-center py-4",children:[b("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(r).map(t=>b("div",{children:Object.values(r[t]).filter(i=>i).length>0&&$(nt,{children:[$("p",{className:"text-lg font-semibold",children:[t,":"]}),Object.keys(r[t]).map(i=>b(he.default.Fragment,{children:r[t][i]&&$("p",{children:[i,":",r[t][i].toString()]})},i))]})},t))]})};function An(e){const{finalPrice:r,isBackIcon:t=!0,handleGoBack:i,displayPriceFrom:n=!1}=e,{t:a}=Bt(),o=te(c=>c.mainProductCount),s=te(c=>c.increaseCount),u=te(c=>c.decreaseCount);return $("div",{className:"flex justify-around items-center px-4 w-full h-16",children:[t&&$("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:[$("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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"}),b("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),b("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),b("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),b("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Back")}`})]}),b("div",{className:"px-3",children:b(mi,{value:o,add:s,subtract:u,disabledSubtract:o===1,size:"lg"})}),$("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:[$("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:[b("circle",{cx:"9",cy:"21",r:"1"})," ",b("circle",{cx:"20",cy:"21",r:"1"}),b("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),n?b("span",{children:`${a("OS.ProductConfigurator.Selected.Message.From")} ${r}`}):b("span",{className:"uppercase",children:`${a("OS.ProductConfigurator.Add")} ${r}`})]})]})}const Pt=640,Ci=e=>{const{isModal:r=!1}=e,[t,i]=m.useState(window.innerWidth),[n,a]=m.useState(window.innerHeight),[o,s]=m.useState(window.innerWidth<=Pt),[u,c]=m.useState(window.innerWidth>Pt&&!r);function f(){i(window.innerWidth),a(window.innerHeight)}return m.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),m.useEffect(()=>{c(window.innerWidth>Pt&&!r),s(window.innerWidth<=Pt)},[t,e,r]),{isSm:u,isMobile:o,width:t,windowHeight:n}};function Pi(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=Pi(e[r]))&&(i&&(i+=" "),i+=t);else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function lt(){for(var e=0,r,t,i="";e<arguments.length;)(r=arguments[e++])&&(t=Pi(r))&&(i&&(i+=" "),i+=t);return i}function Ns(e){var ee,I,K,ne;const{product:r,handleAddToBasket:t,isModal:i,handleGoBack:n,showDebugState:a=!1}=e,{state:{selected:o={}}={},price:s,minPrice:u="0"}=r,c=ca({defaultValues:{selected:o}}),{handleSubmit:f,getValues:l}=c,d=te(H=>H.setIsOnSubmittedOnTrue),[g,p]=m.useState("auto"),[O,w]=m.useState(0),v=te(H=>H.mainProductCount),N=te(H=>H.getInvalidContextNames),C=te(H=>H.filter);m.useEffect(()=>{w(1);const H=setTimeout(()=>{L||w(2)},250);return()=>{clearTimeout(H)}},[]),m.useEffect(()=>{console.log("filter",C)},[C]);const P=parseFloat(s)+xr(l("selected"),r),{displayPriceFrom:M,formattedEndPrice:R}=is(P,u,v),D=H=>{d();const B=N();if(B.length)os(vi(B[0])),console.log(B);else{console.log(l("selected"));const ye=Cs(xs(l("selected")));console.log("decodedCleanedSelected: ",ye),t({price:P/v,quantity:v,selected:ye,filter:C})}},V=m.useRef(),T=m.useRef(),{isSm:k,isMobile:L,windowHeight:_}=Ci({isModal:i}),z=$(nt,{children:[$("div",{className:lt("px-4 w-full",k&&"sm:sticky sm:top-0 sm:w-2/5"),ref:V,children:[r.details.media&&r.details.media[0].url&&b("img",{className:lt("mx-auto mt-2 mb-6 max-h-[250px]",k&&"max-h-[450px]"),alt:r.details.literals.name,src:(ee=r.details)==null?void 0:ee.media[0].url}),b("div",{className:lt(!a&&"hidden"),children:b(Ps,{})})]}),$("div",{className:lt("w-full",k&&"sm:w-3/5"),ref:T,children:[$("div",{className:"items-center p-4 w-full",children:[$("div",{className:"flex justify-between mb-4 w-full text-2xl font-semibold",children:[$("span",{className:"",children:[r.details.literals.name," "]}),b(Gt,{price:P,minPrice:u})]}),b("span",{className:"text-gray-600",children:(I=r.details.literals)==null?void 0:I.description})]}),$("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)&&b(Cr,{productItems:r.items,context:r}),b("div",{className:"sm:h-[64px]"})]}),k&&b("div",{className:"-mt-5 mb-2 bg-gray-100",children:b(An,{finalPrice:R,isBackIcon:!1,handleGoBack:n,displayPriceFrom:M})})]})]}),U=(K=V==null?void 0:V.current)==null?void 0:K.clientHeight,J=(ne=T==null?void 0:T.current)==null?void 0:ne.clientHeight,Z=U+J;Z>window.innerHeight*.8||isNaN(Z)?g!=="80vh"&&p("80vh"):g!=="auto"&&p("auto"),console.log({height:U,height2:J,modalContentHeight:Z,modalSizeStage:O});const W=`${_-64-56}px`,Y=!k,re={"--mobile-submit-row-top":`${_-64-80}px`};return b(Ji,Qe(ue({},c),{children:$("form",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},onSubmit:f(D),children:[b("div",{className:lt("flex relative flex-col items-start w-full form-body stretch",!Y&&"sm:flex-row-reverse sm:pb-0",!L&&"mobile-scrollbar"),style:{height:`${L?W:g}`,minHeight:"400px",overflowY:`${i?"scroll":"visible"}`},children:z}),Y&&b("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${L?"submit-row-mobile":"submit-row"}`,style:re,children:b(An,{handleGoBack:n,finalPrice:R,isBackIcon:!1})})]})}))}function xe(){return xe=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},xe.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 ks(e,r){if(!!e){if(typeof e=="string")return Rn(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 Rn(e,r)}}function Rn(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 we(e,r){var t;if(typeof Symbol=="undefined"||e[Symbol.iterator]==null){if(Array.isArray(e)||(t=ks(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.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return t=e[Symbol.iterator](),t.next.bind(t)}function Ee(e,r){if(e in r){for(var t=r[e],i=arguments.length,n=new Array(i>2?i-2:0),a=2;a<i;a++)n[a-2]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t}var o=new Error('Tried to handle "'+e+'" but there is no handler defined. Only defined handlers are: '+Object.keys(r).map(function(s){return'"'+s+'"'}).join(", ")+".");throw Error.captureStackTrace&&Error.captureStackTrace(o,Ee),o}var Ve;(function(e){e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static"})(Ve||(Ve={}));var pe;(function(e){e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden"})(pe||(pe={}));function Be(e){var r=e.props,t=e.slot,i=e.defaultTag,n=e.features,a=e.visible,o=a===void 0?!0:a,s=e.name;if(o)return Nt(r,t,i,s);var u=n!=null?n:Ve.None;if(u&Ve.Static){var c=r.static,f=c===void 0?!1:c,l=Ke(r,["static"]);if(f)return Nt(l,t,i,s)}if(u&Ve.RenderStrategy){var d,g=r.unmount,p=g===void 0?!0:g,O=Ke(r,["unmount"]),w=p?pe.Unmount:pe.Hidden;return Ee(w,(d={},d[pe.Unmount]=function(){return null},d[pe.Hidden]=function(){return Nt(xe({},O,{hidden:!0,style:{display:"none"}}),t,i,s)},d))}return Nt(r,t,i,s)}function Nt(e,r,t,i){var n;r===void 0&&(r={});var a=ur(e,["unmount","static"]),o=a.as,s=o===void 0?t:o,u=a.children,c=a.refName,f=c===void 0?"ref":c,l=Ke(a,["as","children","refName"]),d=e.ref!==void 0?(n={},n[f]=e.ref,n):{},g=typeof u=="function"?u(r):u;if(l.className&&typeof l.className=="function"&&(l.className=l.className(r)),s===m.Fragment&&Object.keys(l).length>0){if(!m.isValidElement(g)||Array.isArray(g)&&g.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(l).map(function(p){return" - "+p}).join(`
16
16
  `),"","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(function(p){return" - "+p}).join(`
17
17
  `)].join(`
18
- `));return y.cloneElement(g,Object.assign({},ms(ys(ur(l,["ref"])),g.props,["onClick"]),d))}return y.createElement(s,Object.assign({},ur(l,["ref"]),s!==y.Fragment&&d),g)}function ms(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=Se(t),o;!(o=a()).done;)n();return i}function wi(e){var r;return Object.assign(y.forwardRef(e),{displayName:(r=e.displayName)!=null?r:e.name})}function ys(e){var r=Object.assign({},e);for(var t in r)r[t]===void 0&&delete r[t];return r}function ur(e,r){r===void 0&&(r=[]);for(var t=Object.assign({},e),i=Se(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,lr={serverHandoffComplete:!1};function Kt(){var e=y.useState(lr.serverHandoffComplete),r=e[0],t=e[1];return y.useEffect(function(){r!==!0&&t(!0)},[r]),y.useEffect(function(){lr.serverHandoffComplete===!1&&(lr.serverHandoffComplete=!0)},[]),r}var xi=y.createContext(!1);function bs(){return y.useContext(xi)}function Tn(e){return b(xi.Provider,{value:e.force,children:e.children})}function Os(){var e=bs(),r=y.useContext(Ci),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 Ss=y.Fragment;function mr(e){var r=e,t=Os(),i=y.useState(function(){return typeof window=="undefined"?null:document.createElement("div")}),n=i[0],a=Kt();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:Ui.createPortal(Be({props:r,defaultTag:Ss,name:"Portal"}),n):null}var ws=y.Fragment,Ci=y.createContext(null);function xs(e){var r=e.target,t=Ke(e,["target"]);return b(Ci.Provider,{value:r,children:Be({props:t,defaultTag:ws,name:"Popover.Group"})})}mr.Group=xs;function Pi(){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=Se(i.current),o;!(o=a()).done;){var s=o.value;s!=null&&(typeof s=="function"?s(n):s.current=n)}},[i])}var Dt;(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"})(Dt||(Dt={}));function Cs(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&&Ps(n)?!1:a}function Ps(e){if(!e)return!1;for(var r=e.previousElementSibling;r!==null;){if(r instanceof HTMLLegendElement)return!1;r=r.previousElementSibling}return!0}var ks=0;function Dn(){return++ks}function Ot(){var e=Kt(),r=y.useState(e?Dn:null),t=r[0],i=r[1];return Ve(function(){t===null&&i(Dn())},[t]),t!=null?""+t:void 0}function Mt(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 Ns=["[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 It;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(It||(It={}));function Es(e){return e===void 0&&(e=document.body),e==null?[]:Array.from(e.querySelectorAll(Ns))}var Mn;(function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"})(Mn||(Mn={}));function ct(e){e==null||e.focus({preventScroll:!0})}function In(e,r){var t=Array.isArray(e)?e.slice().sort(function(d,g){var p=d.compareDocumentPosition(g);return p&Node.DOCUMENT_POSITION_FOLLOWING?-1:p&Node.DOCUMENT_POSITION_PRECEDING?1:0}):Es(e),i=document.activeElement,n=function(){if(r&(se.First|se.Next))return It.Next;if(r&(se.Previous|se.Last))return It.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 ki(){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 Ls(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=ki(),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(){ct(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)?ct(n.current):In(e.current,se.First)===Me.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=document.activeElement}},[e,n,f]),Mt("keydown",function(l){!(r&Ce.TabLock)||!e.current||l.key===Dt.Tab&&(l.preventDefault(),In(e.current,(l.shiftKey?se.Previous:se.Next)|se.WrapAround)===Me.Success&&(s.current=document.activeElement))}),Mt("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 p=l.target;p&&p instanceof HTMLElement?js(d,p)?(s.current=p,ct(p)):(l.preventDefault(),l.stopPropagation(),ct(g)):ct(s.current)}}}},!0)}function js(e,r){for(var t=Se(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 Ze=new Set,De=new Map;function _n(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function $n(e){var r=De.get(e);!r||(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert)}function Fs(e,r){r===void 0&&(r=!0),Ve(function(){if(!!r&&!!e.current){var t=e.current;Ze.add(t);for(var i=Se(De.keys()),n;!(n=i()).done;){var a=n.value;a.contains(t)&&($n(a),De.delete(a))}return document.querySelectorAll("body > *").forEach(function(o){if(o instanceof HTMLElement){for(var s=Se(Ze),u;!(u=s()).done;){var c=u.value;if(o.contains(c))return}Ze.size===1&&(De.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),_n(o))}}),function(){if(Ze.delete(t),Ze.size>0)document.querySelectorAll("body > *").forEach(function(c){if(c instanceof HTMLElement&&!De.has(c)){for(var f=Se(Ze),l;!(l=f()).done;){var d=l.value;if(c.contains(d))return}De.set(c,{"aria-hidden":c.getAttribute("aria-hidden"),inert:c.inert}),_n(c)}});else for(var o=Se(De.keys()),s;!(s=o()).done;){var u=s.value;$n(u),De.delete(u)}}}},[r])}var Ni=y.createContext(null);function Ei(){var e=y.useContext(Ni);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,Ei),r}return e}function As(){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 b(Ni.Provider,{value:o,children:n.children})}},[t])]}var Rs="p";function Ts(e){var r=Ei(),t="headlessui-description-"+Ot();Ve(function(){return r.register(t)},[t,r.register]);var i=e,n=we({},r.props,{id:t});return Be({props:we({},i,n),slot:r.slot||{},defaultTag:Rs,name:r.name||"Description"})}var Pr=y.createContext(null);Pr.displayName="OpenClosedContext";var Fe;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(Fe||(Fe={}));function kr(){return y.useContext(Pr)}function Ds(e){var r=e.value,t=e.children;return b(Pr.Provider,{value:r,children:t})}var Nr=y.createContext(function(){});Nr.displayName="StackContext";var rt;(function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"})(rt||(rt={}));function Ms(){return y.useContext(Nr)}function Is(e){var r=e.children,t=e.onUpdate,i=e.type,n=e.element,a=Ms(),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(rt.Add,i,n),function(){return o(rt.Remove,i,n)}},[o,i,n]),b(Nr.Provider,{value:o,children:r})}var cr,ce;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(ce||(ce={}));var _t;(function(e){e[e.SetTitleId=0]="SetTitleId"})(_t||(_t={}));var _s=(cr={},cr[_t.SetTitleId]=function(e,r){return e.titleId===r.id?e:we({},e,{titleId:r.id})},cr),$t=y.createContext(null);$t.displayName="DialogContext";function Er(e){var r=y.useContext($t);if(r===null){var t=new Error("<"+e+" /> is missing a parent <"+pt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Er),t}return r}function $s(e,r){return Ne(r.type,_s,e,r)}var Vs="div",Us=$e.RenderStrategy|$e.Static,Hs=wi(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=kr();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),p=Pi(g,t),O=r.hasOwnProperty("open")||f!==null,w=r.hasOwnProperty("onClose");if(!O&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!O)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)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 v=i?ce.Open:ce.Closed,P=function(){return f!==null?f===Fe.Open:v===ce.Open}(),C=y.useReducer($s,{titleId:null,descriptionId:null}),k=C[0],D=C[1],T=y.useCallback(function(){return n(!1)},[n]),R=y.useCallback(function(I){return D({type:_t.SetTitleId,id:I})},[D]),M=Kt(),_=M&&v===ce.Open,E=u>1,A=y.useContext($t)!==null,$=E?"parent":"leaf";Ls(g,_?Ne($,{parent:Ce.RestoreFocus,leaf:Ce.All}):Ce.None,{initialFocus:a,containers:d}),Fs(g,E?_:!1),Mt("mousedown",function(I){var B,re=I.target;v===ce.Open&&(E||((B=g.current)==null?void 0:B.contains(re))||T())}),Mt("keydown",function(I){I.key===Dt.Escape&&v===ce.Open&&(E||(I.preventDefault(),I.stopPropagation(),T()))}),y.useEffect(function(){if(v===ce.Open&&!A){var I=document.documentElement.style.overflow,B=document.documentElement.style.paddingRight,re=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=re+"px",function(){document.documentElement.style.overflow=I,document.documentElement.style.paddingRight=B}}},[v,A]),y.useEffect(function(){if(v===ce.Open&&!!g.current){var I=new IntersectionObserver(function(B){for(var re=Se(B),ne;!(ne=re()).done;){var q=ne.value;q.boundingClientRect.x===0&&q.boundingClientRect.y===0&&q.boundingClientRect.width===0&&q.boundingClientRect.height===0&&T()}});return I.observe(g.current),function(){return I.disconnect()}}},[v,g,T]);var U=As(),W=U[0],Q=U[1],H="headlessui-dialog-"+Ot(),J=y.useMemo(function(){return[{dialogState:v,close:T,setTitleId:R},k]},[v,k,T,R]),te=y.useMemo(function(){return{open:v===ce.Open}},[v]),Z={ref:p,id:H,role:"dialog","aria-modal":v===ce.Open?!0:void 0,"aria-labelledby":k.titleId,"aria-describedby":W,onClick:function(B){B.stopPropagation()}},X=o;return b(Is,{type:"Dialog",element:g,onUpdate:y.useCallback(function(I,B,re){var ne;B==="Dialog"&&Ne(I,(ne={},ne[rt.Add]=function(){d.current.add(re),c(function(q){return q+1})},ne[rt.Remove]=function(){d.current.add(re),c(function(q){return q-1})},ne))},[]),children:b(Tn,{force:!0,children:b(mr,{children:b($t.Provider,{value:J,children:b(mr.Group,{target:g,children:b(Tn,{force:!1,children:b(Q,{slot:te,name:"Dialog.Description",children:Be({props:we({},X,Z),slot:te,defaultTag:Vs,features:Us,visible:P,name:"Dialog"})})})})})})})})}),Bs="div",Ws=wi(function e(r,t){var i=Er([pt.displayName,e.name].join(".")),n=i[0],a=n.dialogState,o=n.close,s=Pi(t),u="headlessui-dialog-overlay-"+Ot(),c=y.useCallback(function(g){if(g.target===g.currentTarget){if(Cs(g.currentTarget))return g.preventDefault();g.preventDefault(),g.stopPropagation(),o()}},[o]),f=y.useMemo(function(){return{open:a===ce.Open}},[a]),l={ref:s,id:u,"aria-hidden":!0,onClick:c},d=r;return Be({props:we({},d,l),slot:f,defaultTag:Bs,name:"Dialog.Overlay"})}),zs="h2";function Li(e){var r=Er([pt.displayName,Li.name].join(".")),t=r[0],i=t.dialogState,n=t.setTitleId,a="headlessui-dialog-title-"+Ot();y.useEffect(function(){return n(a),function(){return n(null)}},[a,n]);var o=y.useMemo(function(){return{open:i===ce.Open}},[i]),s={id:a},u=e;return Be({props:we({},u,s),slot:o,defaultTag:zs,name:"Dialog.Title"})}var pt=Object.assign(Hs,{Overlay:Ws,Title:Li,Description:Ts});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=Se(e.splice(0)),n;!(n=i()).done;){var a=n.value;a()}}};return r}function qs(){var e=y.useRef(!0);return y.useEffect(function(){e.current=!1},[]),e.current}function Gs(e){var r={called:!1};return function(){if(!r.called)return r.called=!0,e.apply(void 0,arguments)}}function fr(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 Nt(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 Ue;(function(e){e.Finished="finished",e.Cancelled="cancelled"})(Ue||(Ue={}));function Ks(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,p){return p-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(Ue.Finished)},s+u):r(Ue.Finished),t.add(function(){return r(Ue.Cancelled)}),t.dispose}function Vn(e,r,t,i,n,a){var o=ji(),s=a!==void 0?Gs(a):function(){};return Nt.apply(void 0,[e].concat(n)),fr.apply(void 0,[e].concat(r,t)),o.nextFrame(function(){Nt.apply(void 0,[e].concat(t)),fr.apply(void 0,[e].concat(i)),o.add(Ks(e,function(u){return Nt.apply(void 0,[e].concat(i,r)),fr.apply(void 0,[e].concat(n)),s(u)}))}),o.add(function(){return Nt.apply(void 0,[e].concat(r,t,i,n))}),o.add(function(){return s(Ue.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 Qt=y.createContext(null);Qt.displayName="TransitionContext";var K;(function(e){e.Visible="visible",e.Hidden="hidden"})(K||(K={}));function Qs(){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}function Js(){var e=y.useContext(Jt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}var Jt=y.createContext(null);Jt.displayName="NestingContext";function Yt(e){return"children"in e?Yt(e.children):e.current.filter(function(r){var t=r.state;return t===K.Visible}).length>0}function Fi(e){var r=y.useRef(e),t=y.useRef([]),i=ki();y.useEffect(function(){r.current=e},[e]);var n=y.useCallback(function(o,s){var u;s===void 0&&(s=pe.Hidden);var c=t.current.findIndex(function(f){var l=f.id;return l===o});c!==-1&&(Ne(s,(u={},u[pe.Unmount]=function(){t.current.splice(c,1)},u[pe.Hidden]=function(){t.current[c].state=K.Hidden},u)),!Yt(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!==K.Visible&&(s.state=K.Visible):t.current.push({id:o,state:K.Visible}),function(){return n(o,pe.Unmount)}},[t,n]);return y.useMemo(function(){return{children:t,register:a,unregister:n}},[a,n,t])}function Ys(){}var Zs=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Un(e){for(var r={},t=Se(Zs),i;!(i=t()).done;){var n,a=i.value;r[a]=(n=e[a])!=null?n:Ys}return r}function Xs(e){var r=y.useRef(Un(e));return y.useEffect(function(){r.current=Un(e)},[e]),r}var eu="div",Ai=$e.RenderStrategy;function Ri(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"]),p=y.useRef(null),O=y.useState(K.Visible),w=O[0],v=O[1],P=g.unmount?pe.Unmount:pe.Hidden,C=Qs(),k=C.show,D=C.appear,T=C.initial,R=Js(),M=R.register,_=R.unregister,E=Ot(),A=y.useRef(!1),$=Fi(function(){A.current||(v(K.Hidden),_(E),X.current.afterLeave())});Ve(function(){if(!!E)return M(E)},[M,E]),Ve(function(){var q;if(P===pe.Hidden&&!!E){if(k&&w!==K.Visible){v(K.Visible);return}Ne(w,(q={},q[K.Hidden]=function(){return _(E)},q[K.Visible]=function(){return M(E)},q))}},[w,E,M,_,k,P]);var U=ze(o),W=ze(s),Q=ze(u),H=ze(c),J=ze(f),te=ze(l),Z=ze(d),X=Xs({beforeEnter:t,afterEnter:i,beforeLeave:n,afterLeave:a}),I=Kt();y.useEffect(function(){if(I&&w===K.Visible&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,w,I]);var B=T&&!D;Ve(function(){var q=p.current;if(!!q&&!B)return A.current=!0,k&&X.current.beforeEnter(),k||X.current.beforeLeave(),k?Vn(q,U,W,Q,H,function(Ae){A.current=!1,Ae===Ue.Finished&&X.current.afterEnter()}):Vn(q,J,te,Z,H,function(Ae){A.current=!1,Ae===Ue.Finished&&(Yt($)||(v(K.Hidden),_(E),X.current.afterLeave()))})},[X,E,A,_,$,p,B,k,U,W,Q,J,te,Z]);var re={ref:p},ne=g;return b(Jt.Provider,{value:$,children:b(Ds,{value:Ne(w,(r={},r[K.Visible]=Fe.Open,r[K.Hidden]=Fe.Closed,r)),children:Be({props:we({},ne,re),defaultTag:eu,features:Ai,visible:w===K.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=kr();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?K.Visible:K.Hidden),c=u[0],f=u[1],l=Fi(function(){f(K.Hidden)}),d=qs(),g=y.useMemo(function(){return{show:r,appear:i||!d,initial:d}},[r,i,d]);y.useEffect(function(){r?f(K.Visible):Yt(l)||f(K.Hidden)},[r,l]);var p={unmount:n};return b(Jt.Provider,{value:l,children:b(Qt.Provider,{value:g,children:Be({props:we({},p,{as:y.Fragment,children:b(Ri,ue({},Object.assign({},p,a)))}),defaultTag:y.Fragment,features:Ai,visible:c===K.Visible,name:"Transition"})})})}Ge.Child=function(r){var t=y.useContext(Qt)!==null,i=kr()!==null;return!t&&i?b(Ge,ue({},Object.assign({},r))):b(Ri,ue({},Object.assign({},r)))};Ge.Root=Ge;function tu(e){const{children:r,isModalOpen:t,handleCloseModal:i}=e,{isMobile:n}=Oi({isModal:!0});return b(nt,{children:b(Ge,{appear:!0,show:t,as:y.Fragment,children:b(pt,{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:[b(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:b(pt.Overlay,{className:"fixed inset-0"})}),b("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),b(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:V("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:[b("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:b("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:[b("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",b("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",b("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),b("div",{className:"w-full",style:{height:`${n?"calc(100% - 56px)":"auto"}`},children:r})]})})]})})})})}function ru(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=ee(w=>w.setInitialFilter),l=ee(w=>w.setInitialSelectedState),d=ee(w=>w.setInitialValidate),{state:{filter:g={},selected:p={}}={}}=r;y.useEffect(()=>{console.log("cleared"),d(),f(g),l(p),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 O=b(ps,{product:r,handleAddToBasket:n,handleGoBack:a,isModal:o,showDebugState:u});return b(nt,{children:o===!0?b(tu,{isModalOpen:s,handleCloseModal:c,children:O}):O})}exports.ProductConfigurator=ru;
18
+ `));return m.cloneElement(g,Object.assign({},Es(Ls(ur(l,["ref"])),g.props,["onClick"]),d))}return m.createElement(s,Object.assign({},ur(l,["ref"]),s!==m.Fragment&&d),g)}function Es(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=we(t),o;!(o=a()).done;)n();return i}function Ni(e){var r;return Object.assign(m.forwardRef(e),{displayName:(r=e.displayName)!=null?r:e.name})}function Ls(e){var r=Object.assign({},e);for(var t in r)r[t]===void 0&&delete r[t];return r}function ur(e,r){r===void 0&&(r=[]);for(var t=Object.assign({},e),i=we(r),n;!(n=i()).done;){var a=n.value;a in t&&delete t[a]}return t}var $e=typeof window!="undefined"?m.useLayoutEffect:m.useEffect,lr={serverHandoffComplete:!1};function Kt(){var e=m.useState(lr.serverHandoffComplete),r=e[0],t=e[1];return m.useEffect(function(){r!==!0&&t(!0)},[r]),m.useEffect(function(){lr.serverHandoffComplete===!1&&(lr.serverHandoffComplete=!0)},[]),r}var ki=m.createContext(!1);function js(){return m.useContext(ki)}function Tn(e){return b(ki.Provider,{value:e.force,children:e.children})}function Fs(){var e=js(),r=m.useContext(Ei),t=m.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 m.useEffect(function(){i!==null&&(document.body.contains(i)||document.body.appendChild(i))},[i]),m.useEffect(function(){e||r!==null&&n(r.current)},[r,n,e]),i}var As=m.Fragment;function mr(e){var r=e,t=Fs(),i=m.useState(function(){return typeof window=="undefined"?null:document.createElement("div")}),n=i[0],a=Kt();return $e(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:zi.createPortal(Be({props:r,defaultTag:As,name:"Portal"}),n):null}var Rs=m.Fragment,Ei=m.createContext(null);function Ts(e){var r=e.target,t=Ke(e,["target"]);return b(Ei.Provider,{value:r,children:Be({props:t,defaultTag:Rs,name:"Popover.Group"})})}mr.Group=Ts;function Li(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var i=m.useRef(r);return m.useEffect(function(){i.current=r},[r]),m.useCallback(function(n){for(var a=we(i.current),o;!(o=a()).done;){var s=o.value;s!=null&&(typeof s=="function"?s(n):s.current=n)}},[i])}var Mt;(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"})(Mt||(Mt={}));function Ms(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&&Ds(n)?!1:a}function Ds(e){if(!e)return!1;for(var r=e.previousElementSibling;r!==null;){if(r instanceof HTMLLegendElement)return!1;r=r.previousElementSibling}return!0}var Is=0;function Mn(){return++Is}function Ot(){var e=Kt(),r=m.useState(e?Mn:null),t=r[0],i=r[1];return $e(function(){t===null&&i(Mn())},[t]),t!=null?""+t:void 0}function Dt(e,r,t){var i=m.useRef(r);i.current=r,m.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 _s=["[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 De;(function(e){e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow"})(De||(De={}));var It;(function(e){e[e.Previous=-1]="Previous",e[e.Next=1]="Next"})(It||(It={}));function Vs(e){return e===void 0&&(e=document.body),e==null?[]:Array.from(e.querySelectorAll(_s))}var Dn;(function(e){e[e.Strict=0]="Strict",e[e.Loose=1]="Loose"})(Dn||(Dn={}));function ct(e){e==null||e.focus({preventScroll:!0})}function In(e,r){var t=Array.isArray(e)?e.slice().sort(function(d,g){var p=d.compareDocumentPosition(g);return p&Node.DOCUMENT_POSITION_FOLLOWING?-1:p&Node.DOCUMENT_POSITION_PRECEDING?1:0}):Vs(e),i=document.activeElement,n=function(){if(r&(se.First|se.Next))return It.Next;if(r&(se.Previous|se.Last))return It.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 De.Error;var l=a+s;if(r&se.WrapAround)l=(l+u)%u;else{if(l<0)return De.Underflow;if(l>=u)return De.Overflow}c=t[l],(f=c)==null||f.focus(o),s+=n}while(c!==document.activeElement);return c.hasAttribute("tabindex")||c.setAttribute("tabindex","0"),De.Success}function ji(){var e=m.useRef(!1);return m.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e}var Pe;(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"})(Pe||(Pe={}));function $s(e,r,t){r===void 0&&(r=Pe.All);var i=t===void 0?{}:t,n=i.initialFocus,a=i.containers,o=m.useRef(typeof window!="undefined"?document.activeElement:null),s=m.useRef(null),u=ji(),c=Boolean(r&Pe.RestoreFocus),f=Boolean(r&Pe.InitialFocus);m.useEffect(function(){!c||(o.current=document.activeElement)},[c]),m.useEffect(function(){if(!!c)return function(){ct(o.current),o.current=null}},[c]),m.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)?ct(n.current):In(e.current,se.First)===De.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=document.activeElement}},[e,n,f]),Dt("keydown",function(l){!(r&Pe.TabLock)||!e.current||l.key===Mt.Tab&&(l.preventDefault(),In(e.current,(l.shiftKey?se.Previous:se.Next)|se.WrapAround)===De.Success&&(s.current=document.activeElement))}),Dt("focus",function(l){if(!!(r&Pe.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 p=l.target;p&&p instanceof HTMLElement?Us(d,p)?(s.current=p,ct(p)):(l.preventDefault(),l.stopPropagation(),ct(g)):ct(s.current)}}}},!0)}function Us(e,r){for(var t=we(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 Ze=new Set,Me=new Map;function _n(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function Vn(e){var r=Me.get(e);!r||(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert)}function Hs(e,r){r===void 0&&(r=!0),$e(function(){if(!!r&&!!e.current){var t=e.current;Ze.add(t);for(var i=we(Me.keys()),n;!(n=i()).done;){var a=n.value;a.contains(t)&&(Vn(a),Me.delete(a))}return document.querySelectorAll("body > *").forEach(function(o){if(o instanceof HTMLElement){for(var s=we(Ze),u;!(u=s()).done;){var c=u.value;if(o.contains(c))return}Ze.size===1&&(Me.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),_n(o))}}),function(){if(Ze.delete(t),Ze.size>0)document.querySelectorAll("body > *").forEach(function(c){if(c instanceof HTMLElement&&!Me.has(c)){for(var f=we(Ze),l;!(l=f()).done;){var d=l.value;if(c.contains(d))return}Me.set(c,{"aria-hidden":c.getAttribute("aria-hidden"),inert:c.inert}),_n(c)}});else for(var o=we(Me.keys()),s;!(s=o()).done;){var u=s.value;Vn(u),Me.delete(u)}}}},[r])}var Fi=m.createContext(null);function Ai(){var e=m.useContext(Fi);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,Ai),r}return e}function Bs(){var e=m.useState([]),r=e[0],t=e[1];return[r.length>0?r.join(" "):void 0,m.useMemo(function(){return function(n){var a=m.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=m.useMemo(function(){return{register:a,slot:n.slot,name:n.name,props:n.props}},[a,n.slot,n.name,n.props]);return b(Fi.Provider,{value:o,children:n.children})}},[t])]}var Ws="p";function zs(e){var r=Ai(),t="headlessui-description-"+Ot();$e(function(){return r.register(t)},[t,r.register]);var i=e,n=xe({},r.props,{id:t});return Be({props:xe({},i,n),slot:r.slot||{},defaultTag:Ws,name:r.name||"Description"})}var Pr=m.createContext(null);Pr.displayName="OpenClosedContext";var Ae;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(Ae||(Ae={}));function Nr(){return m.useContext(Pr)}function qs(e){var r=e.value,t=e.children;return b(Pr.Provider,{value:r,children:t})}var kr=m.createContext(function(){});kr.displayName="StackContext";var rt;(function(e){e[e.Add=0]="Add",e[e.Remove=1]="Remove"})(rt||(rt={}));function Gs(){return m.useContext(kr)}function Ks(e){var r=e.children,t=e.onUpdate,i=e.type,n=e.element,a=Gs(),o=m.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 $e(function(){return o(rt.Add,i,n),function(){return o(rt.Remove,i,n)}},[o,i,n]),b(kr.Provider,{value:o,children:r})}var cr,ce;(function(e){e[e.Open=0]="Open",e[e.Closed=1]="Closed"})(ce||(ce={}));var _t;(function(e){e[e.SetTitleId=0]="SetTitleId"})(_t||(_t={}));var Qs=(cr={},cr[_t.SetTitleId]=function(e,r){return e.titleId===r.id?e:xe({},e,{titleId:r.id})},cr),Vt=m.createContext(null);Vt.displayName="DialogContext";function Er(e){var r=m.useContext(Vt);if(r===null){var t=new Error("<"+e+" /> is missing a parent <"+pt.displayName+" /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Er),t}return r}function Js(e,r){return Ee(r.type,Qs,e,r)}var Ys="div",Zs=Ve.RenderStrategy|Ve.Static,Xs=Ni(function(r,t){var i=r.open,n=r.onClose,a=r.initialFocus,o=Ke(r,["open","onClose","initialFocus"]),s=m.useState(0),u=s[0],c=s[1],f=Nr();if(i===void 0&&f!==null){var l;i=Ee(f,(l={},l[Ae.Open]=!0,l[Ae.Closed]=!1,l))}var d=m.useRef(new Set),g=m.useRef(null),p=Li(g,t),O=r.hasOwnProperty("open")||f!==null,w=r.hasOwnProperty("onClose");if(!O&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!O)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)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 v=i?ce.Open:ce.Closed,N=function(){return f!==null?f===Ae.Open:v===ce.Open}(),C=m.useReducer(Js,{titleId:null,descriptionId:null}),P=C[0],M=C[1],R=m.useCallback(function(){return n(!1)},[n]),D=m.useCallback(function(I){return M({type:_t.SetTitleId,id:I})},[M]),V=Kt(),T=V&&v===ce.Open,k=u>1,L=m.useContext(Vt)!==null,_=k?"parent":"leaf";$s(g,T?Ee(_,{parent:Pe.RestoreFocus,leaf:Pe.All}):Pe.None,{initialFocus:a,containers:d}),Hs(g,k?T:!1),Dt("mousedown",function(I){var K,ne=I.target;v===ce.Open&&(k||((K=g.current)==null?void 0:K.contains(ne))||R())}),Dt("keydown",function(I){I.key===Mt.Escape&&v===ce.Open&&(k||(I.preventDefault(),I.stopPropagation(),R()))}),m.useEffect(function(){if(v===ce.Open&&!L){var I=document.documentElement.style.overflow,K=document.documentElement.style.paddingRight,ne=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=ne+"px",function(){document.documentElement.style.overflow=I,document.documentElement.style.paddingRight=K}}},[v,L]),m.useEffect(function(){if(v===ce.Open&&!!g.current){var I=new IntersectionObserver(function(K){for(var ne=we(K),H;!(H=ne()).done;){var B=H.value;B.boundingClientRect.x===0&&B.boundingClientRect.y===0&&B.boundingClientRect.width===0&&B.boundingClientRect.height===0&&R()}});return I.observe(g.current),function(){return I.disconnect()}}},[v,g,R]);var z=Bs(),U=z[0],J=z[1],Z="headlessui-dialog-"+Ot(),W=m.useMemo(function(){return[{dialogState:v,close:R,setTitleId:D},P]},[v,P,R,D]),Y=m.useMemo(function(){return{open:v===ce.Open}},[v]),re={ref:p,id:Z,role:"dialog","aria-modal":v===ce.Open?!0:void 0,"aria-labelledby":P.titleId,"aria-describedby":U,onClick:function(K){K.stopPropagation()}},ee=o;return b(Ks,{type:"Dialog",element:g,onUpdate:m.useCallback(function(I,K,ne){var H;K==="Dialog"&&Ee(I,(H={},H[rt.Add]=function(){d.current.add(ne),c(function(B){return B+1})},H[rt.Remove]=function(){d.current.add(ne),c(function(B){return B-1})},H))},[]),children:b(Tn,{force:!0,children:b(mr,{children:b(Vt.Provider,{value:W,children:b(mr.Group,{target:g,children:b(Tn,{force:!1,children:b(J,{slot:Y,name:"Dialog.Description",children:Be({props:xe({},ee,re),slot:Y,defaultTag:Ys,features:Zs,visible:N,name:"Dialog"})})})})})})})})}),eu="div",tu=Ni(function e(r,t){var i=Er([pt.displayName,e.name].join(".")),n=i[0],a=n.dialogState,o=n.close,s=Li(t),u="headlessui-dialog-overlay-"+Ot(),c=m.useCallback(function(g){if(g.target===g.currentTarget){if(Ms(g.currentTarget))return g.preventDefault();g.preventDefault(),g.stopPropagation(),o()}},[o]),f=m.useMemo(function(){return{open:a===ce.Open}},[a]),l={ref:s,id:u,"aria-hidden":!0,onClick:c},d=r;return Be({props:xe({},d,l),slot:f,defaultTag:eu,name:"Dialog.Overlay"})}),ru="h2";function Ri(e){var r=Er([pt.displayName,Ri.name].join(".")),t=r[0],i=t.dialogState,n=t.setTitleId,a="headlessui-dialog-title-"+Ot();m.useEffect(function(){return n(a),function(){return n(null)}},[a,n]);var o=m.useMemo(function(){return{open:i===ce.Open}},[i]),s={id:a},u=e;return Be({props:xe({},u,s),slot:o,defaultTag:ru,name:"Dialog.Title"})}var pt=Object.assign(Xs,{Overlay:tu,Title:Ri,Description:zs});function Ti(){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=we(e.splice(0)),n;!(n=i()).done;){var a=n.value;a()}}};return r}function nu(){var e=m.useRef(!0);return m.useEffect(function(){e.current=!1},[]),e.current}function iu(e){var r={called:!1};return function(){if(!r.called)return r.called=!0,e.apply(void 0,arguments)}}function fr(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 kt(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 Ue;(function(e){e.Finished="finished",e.Cancelled="cancelled"})(Ue||(Ue={}));function au(e,r){var t=Ti();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,p){return p-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(Ue.Finished)},s+u):r(Ue.Finished),t.add(function(){return r(Ue.Cancelled)}),t.dispose}function $n(e,r,t,i,n,a){var o=Ti(),s=a!==void 0?iu(a):function(){};return kt.apply(void 0,[e].concat(n)),fr.apply(void 0,[e].concat(r,t)),o.nextFrame(function(){kt.apply(void 0,[e].concat(t)),fr.apply(void 0,[e].concat(i)),o.add(au(e,function(u){return kt.apply(void 0,[e].concat(i,r)),fr.apply(void 0,[e].concat(n)),s(u)}))}),o.add(function(){return kt.apply(void 0,[e].concat(r,t,i,n))}),o.add(function(){return s(Ue.Cancelled)}),o.dispose}function ze(e){return e===void 0&&(e=""),m.useMemo(function(){return e.split(" ").filter(function(r){return r.trim().length>1})},[e])}var Qt=m.createContext(null);Qt.displayName="TransitionContext";var Q;(function(e){e.Visible="visible",e.Hidden="hidden"})(Q||(Q={}));function ou(){var e=m.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}function su(){var e=m.useContext(Jt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}var Jt=m.createContext(null);Jt.displayName="NestingContext";function Yt(e){return"children"in e?Yt(e.children):e.current.filter(function(r){var t=r.state;return t===Q.Visible}).length>0}function Mi(e){var r=m.useRef(e),t=m.useRef([]),i=ji();m.useEffect(function(){r.current=e},[e]);var n=m.useCallback(function(o,s){var u;s===void 0&&(s=pe.Hidden);var c=t.current.findIndex(function(f){var l=f.id;return l===o});c!==-1&&(Ee(s,(u={},u[pe.Unmount]=function(){t.current.splice(c,1)},u[pe.Hidden]=function(){t.current[c].state=Q.Hidden},u)),!Yt(t)&&i.current&&(r.current==null||r.current()))},[r,i,t]),a=m.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,pe.Unmount)}},[t,n]);return m.useMemo(function(){return{children:t,register:a,unregister:n}},[a,n,t])}function uu(){}var lu=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Un(e){for(var r={},t=we(lu),i;!(i=t()).done;){var n,a=i.value;r[a]=(n=e[a])!=null?n:uu}return r}function cu(e){var r=m.useRef(Un(e));return m.useEffect(function(){r.current=Un(e)},[e]),r}var fu="div",Di=Ve.RenderStrategy;function Ii(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"]),p=m.useRef(null),O=m.useState(Q.Visible),w=O[0],v=O[1],N=g.unmount?pe.Unmount:pe.Hidden,C=ou(),P=C.show,M=C.appear,R=C.initial,D=su(),V=D.register,T=D.unregister,k=Ot(),L=m.useRef(!1),_=Mi(function(){L.current||(v(Q.Hidden),T(k),ee.current.afterLeave())});$e(function(){if(!!k)return V(k)},[V,k]),$e(function(){var B;if(N===pe.Hidden&&!!k){if(P&&w!==Q.Visible){v(Q.Visible);return}Ee(w,(B={},B[Q.Hidden]=function(){return T(k)},B[Q.Visible]=function(){return V(k)},B))}},[w,k,V,T,P,N]);var z=ze(o),U=ze(s),J=ze(u),Z=ze(c),W=ze(f),Y=ze(l),re=ze(d),ee=cu({beforeEnter:t,afterEnter:i,beforeLeave:n,afterLeave:a}),I=Kt();m.useEffect(function(){if(I&&w===Q.Visible&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,w,I]);var K=R&&!M;$e(function(){var B=p.current;if(!!B&&!K)return L.current=!0,P&&ee.current.beforeEnter(),P||ee.current.beforeLeave(),P?$n(B,z,U,J,Z,function(ye){L.current=!1,ye===Ue.Finished&&ee.current.afterEnter()}):$n(B,W,Y,re,Z,function(ye){L.current=!1,ye===Ue.Finished&&(Yt(_)||(v(Q.Hidden),T(k),ee.current.afterLeave()))})},[ee,k,L,T,_,p,K,P,z,U,J,W,Y,re]);var ne={ref:p},H=g;return b(Jt.Provider,{value:_,children:b(qs,{value:Ee(w,(r={},r[Q.Visible]=Ae.Open,r[Q.Hidden]=Ae.Closed,r)),children:Be({props:xe({},H,ne),defaultTag:fu,features:Di,visible:w===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=Nr();if(r===void 0&&o!==null){var s;r=Ee(o,(s={},s[Ae.Open]=!0,s[Ae.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=m.useState(r?Q.Visible:Q.Hidden),c=u[0],f=u[1],l=Mi(function(){f(Q.Hidden)}),d=nu(),g=m.useMemo(function(){return{show:r,appear:i||!d,initial:d}},[r,i,d]);m.useEffect(function(){r?f(Q.Visible):Yt(l)||f(Q.Hidden)},[r,l]);var p={unmount:n};return b(Jt.Provider,{value:l,children:b(Qt.Provider,{value:g,children:Be({props:xe({},p,{as:m.Fragment,children:b(Ii,ue({},Object.assign({},p,a)))}),defaultTag:m.Fragment,features:Di,visible:c===Q.Visible,name:"Transition"})})})}Ge.Child=function(r){var t=m.useContext(Qt)!==null,i=Nr()!==null;return!t&&i?b(Ge,ue({},Object.assign({},r))):b(Ii,ue({},Object.assign({},r)))};Ge.Root=Ge;function du(e){const{children:r,isModalOpen:t,handleCloseModal:i}=e,{isMobile:n}=Ci({isModal:!0});return b(nt,{children:b(Ge,{appear:!0,show:t,as:m.Fragment,children:b(pt,{as:"div",className:"overflow-y-auto fixed inset-0 z-10",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:i,children:$("div",{className:"min-h-screen text-center sm:px-4",children:[b(Ge.Child,{as:m.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:b(pt.Overlay,{className:"fixed inset-0"})}),b("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),b(Ge.Child,{as:m.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:$("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all transform bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[b("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:b("div",{className:"",children:$("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:i,children:[b("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",b("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",b("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",b("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),b("div",{className:"w-full",style:{height:`${n?"calc(100% - 56px)":"auto"}`},children:r})]})})]})})})})}function gu(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=te(v=>v.setInitialFilter),l=te(v=>v.setInitialSelectedState),d=te(v=>v.setInitialValidate),g=xi(r,Ss),{state:{filter:p={},selected:O={}}={}}=g;m.useEffect(()=>{console.log("cleared"),d(),f(p),l(O),oe.changeLanguage(i)},[r]),m.useEffect(()=>{console.log("lang: ",i),oe.changeLanguage(i)},[i]),m.useEffect(()=>{t&&document.documentElement.style.setProperty("--color-primary",t)},[t]);const w=b(Ns,{product:g,handleAddToBasket:n,handleGoBack:a,isModal:o,showDebugState:u});return b(nt,{children:o===!0?b(du,{isModalOpen:s,handleCloseModal:c,children:w}):w})}exports.ProductConfigurator=gu;
19
19
  //# sourceMappingURL=index.cjs.js.map