@nizza/core 0.7.0-beta.0 → 0.7.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var ug=Object.defineProperty;var lg=(t,e,n)=>e in t?ug(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ae=(t,e,n)=>lg(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ue=require("react"),cg=require("react/jsx-runtime"),dg=require("react-dom");function fg(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const qt={};let hg=0;function Ia(t,e){const n=`atom${++hg}`,r={toString(){return(qt?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?r.read=t:(r.init=t,r.read=pg,r.write=mg),r}function pg(t){return t(this)}function mg(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const cc=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,Js=t=>"init"in t,Ys=t=>!!t.write,ha=new WeakMap,bu=t=>{var e;return ku(t)&&!((e=ha.get(t))!=null&&e[1])},gg=(t,e)=>{const n=ha.get(t);if(n)n[1]=!0,n[0].forEach(r=>r(e));else if((qt?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},yg=t=>{if(ha.has(t))return;const e=[new Set,!1];ha.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=r=>{e[0].add(r)}},ku=t=>typeof(t==null?void 0:t.then)=="function",dc=t=>"v"in t||"e"in t,Wi=t=>{if("e"in t)throw t.e;if((qt?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},$f=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},fc=(t,e,n,r,i)=>{var a;if((qt?"production":void 0)!=="production"&&r===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),bu(n.v)&&$f(e,n.v,i),(a=i.m)==null||a.t.add(e),t&&vg(t,r,e)},or=()=>[new Map,new Map,new Set],Qs=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},vg=(t,e,n)=>{const r=t[0].get(e);r&&r.add(n)},bg=(t,e)=>t[0].get(e),hc=(t,e)=>{t[2].add(e)},$n=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(r=>{var i;return(i=r.m)==null?void 0:i.l.forEach(a=>a())}),n.forEach(r=>r())}},jf=t=>{let e;(qt?"production":void 0)!=="production"&&(e=new Set);const n=(E,b,k)=>{const C="v"in b,S=b.v,R=bu(b.v)?b.v:null;if(ku(k)){yg(k);for(const x of b.d.keys())$f(E,k,t(x,b));b.v=k,delete b.e}else b.v=k,delete b.e;(!C||!Object.is(S,b.v))&&(++b.n,R&&gg(R,k))},r=(E,b,k,C)=>{var S;if(!(C!=null&&C(b))&&dc(k)&&(k.m||Array.from(k.d).every(([ie,ke])=>r(E,ie,t(ie,k),C).n===ke)))return k;k.d.clear();let R=!0;const x=ie=>{if(cc(b,ie)){const he=t(ie,k);if(!dc(he))if(Js(ie))n(ie,he,ie.init);else throw new Error("no atom init");return Wi(he)}const ke=r(E,ie,t(ie,k),C);if(R)fc(E,b,k,ie,ke);else{const he=or();fc(he,b,k,ie,ke),f(he,b,k),$n(he)}return Wi(ke)};let z,I;const re={get signal(){return z||(z=new AbortController),z.signal},get setSelf(){return(qt?"production":void 0)!=="production"&&!Ys(b)&&console.warn("setSelf function cannot be used with read-only atom"),!I&&Ys(b)&&(I=(...ie)=>{if((qt?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)return c(b,...ie)}),I}};try{const ie=b.read(x,re);if(n(b,k,ie),ku(ie)){(S=ie.onCancel)==null||S.call(ie,()=>z==null?void 0:z.abort());const ke=()=>{if(k.m){const he=or();f(he,b,k),$n(he)}};ie.then(ke,ke)}return k}catch(ie){return delete k.v,k.e=ie,++k.n,k}finally{R=!1}},i=E=>Wi(r(void 0,E,t(E))),a=(E,b,k)=>{var C,S;const R=new Map;for(const x of((C=k.m)==null?void 0:C.t)||[])R.set(x,t(x,k));for(const x of k.p)R.set(x,t(x,k));return(S=bg(E,b))==null||S.forEach(x=>{R.set(x,t(x,k))}),R},o=(E,b,k)=>{const C=[],S=new Set,R=(I,re)=>{if(!S.has(I)){S.add(I);for(const[ie,ke]of a(E,I,re))I!==ie&&R(ie,ke);C.push([I,re,re.n])}};R(b,k);const x=new Set([b]),z=I=>S.has(I);for(let I=C.length-1;I>=0;--I){const[re,ie,ke]=C[I];let he=!1;for(const Ee of ie.d.keys())if(Ee!==re&&x.has(Ee)){he=!0;break}he&&(r(E,re,ie,z),f(E,re,ie),ke!==ie.n&&(Qs(E,re,ie),x.add(re))),S.delete(re)}},l=(E,b,k,...C)=>{const S=z=>Wi(r(E,z,t(z,k))),R=(z,...I)=>{const re=t(z,k);let ie;if(cc(b,z)){if(!Js(z))throw new Error("atom not writable");const ke="v"in re,he=re.v,Ee=I[0];n(z,re,Ee),f(E,z,re),(!ke||!Object.is(he,re.v))&&(Qs(E,z,re),o(E,z,re))}else ie=l(E,z,re,...I);return $n(E),ie};return b.write(S,R,...C)},c=(E,...b)=>{const k=or(),C=l(k,E,t(E),...b);return $n(k),C},f=(E,b,k)=>{if(k.m&&!bu(k.v)){for(const C of k.d.keys())k.m.d.has(C)||(h(E,C,t(C,k)).t.add(b),k.m.d.add(C));for(const C of k.m.d||[])if(!k.d.has(C)){k.m.d.delete(C);const S=y(E,C,t(C,k));S==null||S.t.delete(b)}}},h=(E,b,k)=>{if(!k.m){r(E,b,k);for(const C of k.d.keys())h(E,C,t(C,k)).t.add(b);if(k.m={l:new Set,d:new Set(k.d.keys()),t:new Set},(qt?"production":void 0)!=="production"&&e.add(b),Ys(b)&&b.onMount){const C=k.m,{onMount:S}=b;hc(E,()=>{const R=S((...x)=>l(E,b,k,...x));R&&(C.u=R)})}}return k.m},y=(E,b,k)=>{if(k.m&&!k.m.l.size&&!Array.from(k.m.t).some(C=>{var S;return(S=t(C,k).m)==null?void 0:S.d.has(b)})){const C=k.m.u;C&&hc(E,C),delete k.m,(qt?"production":void 0)!=="production"&&e.delete(b);for(const S of k.d.keys()){const R=y(E,S,t(S,k));R==null||R.t.delete(b)}return}return k.m},A={get:i,set:c,sub:(E,b)=>{const k=or(),C=t(E),S=h(k,E,C);$n(k);const R=S.l;return R.add(b),()=>{R.delete(b);const x=or();y(x,E,C),$n(x)}},unstable_derive:E=>jf(...E(t))};return(qt?"production":void 0)!=="production"&&Object.assign(A,{dev4_get_internal_weak_map:()=>({get:b=>{const k=t(b);if(k.n!==0)return k}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:b=>{const k=or();for(const[C,S]of b)if(Js(C)){const R=t(C),x="v"in R,z=R.v;n(C,R,S),f(k,C,R),(!x||!Object.is(z,R.v))&&(Qs(k,C,R),o(k,C,R))}$n(k)}}),A},kg=()=>{const t=new WeakMap;return jf(n=>{let r=t.get(n);return r||(r={d:new Map,p:new Set,n:0},t.set(n,r)),r})};let Ur;const _g=()=>(Ur||(Ur=kg(),(qt?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Ur),globalThis.__JOTAI_DEFAULT_STORE__!==Ur&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Ur),Bf={},Sg=Ue.createContext(void 0),Mf=t=>Ue.useContext(Sg)||_g(),Uf=t=>typeof(t==null?void 0:t.then)=="function",Ag=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},Eg=Ue.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ag(t),t)}),Xs=new WeakMap,wg=t=>{let e=Xs.get(t);return e||(e=new Promise((n,r)=>{let i=t;const a=c=>f=>{i===c&&n(f)},o=c=>f=>{i===c&&r(f)},l=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(f=>{if((Bf?"production":void 0)!=="production"&&f===c)throw new Error("[Bug] p is not updated even after cancelation");Uf(f)?(Xs.set(f,e),i=f,f.then(a(f),o(f)),l(f)):n(f)})};t.then(a(t),o(t)),l(t)}),Xs.set(t,e)),e};function _u(t,e){const n=Mf(),[[r,i,a],o]=Ue.useReducer(f=>{const h=n.get(t);return Object.is(f[0],h)&&f[1]===n&&f[2]===t?f:[h,n,t]},void 0,()=>[n.get(t),n,t]);let l=r;if((i!==n||a!==t)&&(o(),l=n.get(t)),Ue.useEffect(()=>{const f=n.sub(t,()=>{o()});return o(),f},[n,t,void 0]),Ue.useDebugValue(l),Uf(l)){const f=wg(l);return Eg(f)}return l}function Xu(t,e){const n=Mf();return Ue.useCallback((...i)=>{if((Bf?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...i)},[n,t])}function Zs(t,e){return[_u(t),Xu(t)]}const Vf=Ia(null);Vf.debugLabel="accountAtom";const Ng={},{NZ_BACKOFFICE_BACK_URL:Og,NZ_CORE_SERVICES_GRAPHQL_URL:Rg,NZ_CORE_SERVICES_REST_URL:Tg}=Ng,_r={apiUrls:{restV1:Og||"https://pabprg32bj.execute-api.us-east-1.amazonaws.com",restV2:Tg||"https://core-services-dev.nizza.com/api",graphql:Rg||"https://core-services-dev.nizza.com/graphql"},publicUrls:{wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};async function qn(t){const{url:e,method:n="GET",body:r,raw:i=!1,contentTypeJson:a=!0,timeout:o,...l}=t,c=new Headers({...a?{"content-type":"application/json"}:{},...t.headers}),f=new AbortController,{signal:h}=f;let y;const m=fetch(e,{method:n,headers:c,body:r,signal:h,...l});o&&(y=setTimeout(()=>{f.abort()},o));const O=await m;if(i)return O;const A=await O.json();if(clearTimeout(y),!O.ok){const E=A?JSON.stringify(A):O.statusText;throw new Error(E)}return A}const Cg=t=>qn({...t,contentTypeJson:!1,raw:!1});function xg(t,e,n){fetch(e).then(r=>r.blob()).then(r=>qf(r,`${t}.${n}`))}const qf=(t,e,n)=>{const r=[t],i=new Blob(r,{type:n!=null?n:"application/octet-stream"});if(typeof window.navigator.msSaveBlob!="undefined")return window.navigator.msSaveBlob(i,e);const a=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(i):window.webkitURL.createObjectURL(i),o=document.createElement("a");return o.style.display="none",o.href=a,o.setAttribute("download",e),typeof o.download=="undefined"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o),window.URL.revokeObjectURL(a)},200)};function fr(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function ia(t){return function e(n){return arguments.length===0||fr(n)?e:t.apply(this,arguments)}}function Pg(t){return function e(n,r){switch(arguments.length){case 0:return e;case 1:return fr(n)?e:ia(function(i){return t(n,i)});default:return fr(n)&&fr(r)?e:fr(n)?ia(function(i){return t(i,r)}):fr(r)?ia(function(i){return t(n,i)}):t(n,r)}}}const Fg=Number.isInteger||function(e){return e<<0===e};function Ig(t){return Object.prototype.toString.call(t)==="[object String]"}function Dg(t,e){var n=t<0?e.length+t:t;return Ig(e)?e.charAt(n):e[n]}var Lg=ia(function(e){return e==null});function $g(t,e){for(var n=e,r=0;r<t.length;r+=1){if(n==null)return;var i=t[r];Fg(i)?n=Dg(i,n):n=n[i]}return n}var jg=Pg($g);class dn extends Error{constructor(e,n,r){super(n),this.value=r,this.name=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toDTO(){return{name:this.name,message:this.message,...this.value&&{value:this.value},...this.stack&&{stack:this.formatStack()}}}formatStack(){return this.stack?this.stack.split(`
2
- `).map(e=>e.trim()).join(" | "):""}}class Bg extends dn{constructor(e){super("RESOURCE_NOT_FOUND_ERROR",`Resource with id '${e}' not found.`,e)}}class Zu extends dn{constructor(e){var n;super("APP_UNEXPECTED_ERROR",(n=e.message)!=null?n:"An unexpected error occurred.",e)}}class Hf extends dn{constructor(){super("APP_ACCOUNT_INVALID_ERROR","Account not defined")}}class Kf extends dn{constructor(e){super("INVALID_NIZZA_GLOBAL_OBJECT_ERROR",`
1
+ "use strict";var lp=Object.defineProperty;var cp=(t,e,n)=>e in t?lp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var fe=(t,e,n)=>cp(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pe=require("react"),dp=require("react/jsx-runtime"),fp=require("react-dom");function hp(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const Ut={};let pp=0;function Fa(t,e){const n=`atom${++pp}`,i={toString(){return(Ut?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?i.read=t:(i.init=t,i.read=mp,i.write=gp),i}function mp(t){return t(this)}function gp(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}const ll=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,zs=t=>"init"in t,Gs=t=>!!t.write,da=new WeakMap,Ao=t=>{var e;return Oo(t)&&!((e=da.get(t))!=null&&e[1])},vp=(t,e)=>{const n=da.get(t);if(n)n[1]=!0,n[0].forEach(i=>i(e));else if((Ut?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},yp=t=>{if(da.has(t))return;const e=[new Set,!1];da.set(t,e);const n=()=>{e[1]=!0};t.then(n,n),t.onCancel=i=>{e[0].add(i)}},Oo=t=>typeof(t==null?void 0:t.then)=="function",cl=t=>"v"in t||"e"in t,Gr=t=>{if("e"in t)throw t.e;if((Ut?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},Hc=(t,e,n)=>{n.p.has(t)||(n.p.add(t),e.then(()=>{n.p.delete(t)},()=>{n.p.delete(t)}))},dl=(t,e,n,i,r)=>{var a;if((Ut?"production":void 0)!=="production"&&i===e)throw new Error("[Bug] atom cannot depend on itself");n.d.set(i,r.n),Ao(n.v)&&Hc(e,n.v,r),(a=r.m)==null||a.t.add(e),t&&bp(t,i,e)},oi=()=>[new Map,new Map,new Set],Ws=(t,e,n)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,n)},bp=(t,e,n)=>{const i=t[0].get(e);i&&i.add(n)},kp=(t,e)=>t[0].get(e),fl=(t,e)=>{t[2].add(e)},$n=t=>{for(;t[1].size||t[2].size;){t[0].clear();const e=new Set(t[1].values());t[1].clear();const n=new Set(t[2]);t[2].clear(),e.forEach(i=>{var r;return(r=i.m)==null?void 0:r.l.forEach(a=>a())}),n.forEach(i=>i())}},Kc=t=>{let e;(Ut?"production":void 0)!=="production"&&(e=new Set);const n=(N,E,F)=>{const V="v"in E,J=E.v,K=Ao(E.v)?E.v:null;if(Oo(F)){yp(F);for(const Y of E.d.keys())Hc(N,F,t(Y,E));E.v=F,delete E.e}else E.v=F,delete E.e;(!V||!Object.is(J,E.v))&&(++E.n,K&&vp(K,F))},i=(N,E,F,V)=>{var J;if(!(V!=null&&V(E))&&cl(F)&&(F.m||Array.from(F.d).every(([de,je])=>i(N,de,t(de,F),V).n===je)))return F;F.d.clear();let K=!0;const Y=de=>{if(ll(E,de)){const ke=t(de,F);if(!cl(ke))if(zs(de))n(de,ke,de.init);else throw new Error("no atom init");return Gr(ke)}const je=i(N,de,t(de,F),V);if(K)dl(N,E,F,de,je);else{const ke=oi();dl(ke,E,F,de,je),h(ke,E,F),$n(ke)}return Gr(je)};let X,ne;const ye={get signal(){return X||(X=new AbortController),X.signal},get setSelf(){return(Ut?"production":void 0)!=="production"&&!Gs(E)&&console.warn("setSelf function cannot be used with read-only atom"),!ne&&Gs(E)&&(ne=(...de)=>{if((Ut?"production":void 0)!=="production"&&K&&console.warn("setSelf function cannot be called in sync"),!K)return d(E,...de)}),ne}};try{const de=E.read(Y,ye);if(n(E,F,de),Oo(de)){(J=de.onCancel)==null||J.call(de,()=>X==null?void 0:X.abort());const je=()=>{if(F.m){const ke=oi();h(ke,E,F),$n(ke)}};de.then(je,je)}return F}catch(de){return delete F.v,F.e=de,++F.n,F}finally{K=!1}},r=N=>Gr(i(void 0,N,t(N))),a=(N,E,F)=>{var V,J;const K=new Map;for(const Y of((V=F.m)==null?void 0:V.t)||[])K.set(Y,t(Y,F));for(const Y of F.p)K.set(Y,t(Y,F));return(J=kp(N,E))==null||J.forEach(Y=>{K.set(Y,t(Y,F))}),K},o=(N,E,F)=>{const V=[],J=new Set,K=(ne,ye)=>{if(!J.has(ne)){J.add(ne);for(const[de,je]of a(N,ne,ye))ne!==de&&K(de,je);V.push([ne,ye,ye.n])}};K(E,F);const Y=new Set([E]),X=ne=>J.has(ne);for(let ne=V.length-1;ne>=0;--ne){const[ye,de,je]=V[ne];let ke=!1;for(const Ae of de.d.keys())if(Ae!==ye&&Y.has(Ae)){ke=!0;break}ke&&(i(N,ye,de,X),h(N,ye,de),je!==de.n&&(Ws(N,ye,de),Y.add(ye))),J.delete(ye)}},l=(N,E,F,...V)=>{const J=X=>Gr(i(N,X,t(X,F))),K=(X,...ne)=>{const ye=t(X,F);let de;if(ll(E,X)){if(!zs(X))throw new Error("atom not writable");const je="v"in ye,ke=ye.v,Ae=ne[0];n(X,ye,Ae),h(N,X,ye),(!je||!Object.is(ke,ye.v))&&(Ws(N,X,ye),o(N,X,ye))}else de=l(N,X,ye,...ne);return $n(N),de};return E.write(J,K,...V)},d=(N,...E)=>{const F=oi(),V=l(F,N,t(N),...E);return $n(F),V},h=(N,E,F)=>{if(F.m&&!Ao(F.v)){for(const V of F.d.keys())F.m.d.has(V)||(m(N,V,t(V,F)).t.add(E),F.m.d.add(V));for(const V of F.m.d||[])if(!F.d.has(V)){F.m.d.delete(V);const J=y(N,V,t(V,F));J==null||J.t.delete(E)}}},m=(N,E,F)=>{if(!F.m){i(N,E,F);for(const V of F.d.keys())m(N,V,t(V,F)).t.add(E);if(F.m={l:new Set,d:new Set(F.d.keys()),t:new Set},(Ut?"production":void 0)!=="production"&&e.add(E),Gs(E)&&E.onMount){const V=F.m,{onMount:J}=E;fl(N,()=>{const K=J((...Y)=>l(N,E,F,...Y));K&&(V.u=K)})}}return F.m},y=(N,E,F)=>{if(F.m&&!F.m.l.size&&!Array.from(F.m.t).some(V=>{var J;return(J=t(V,F).m)==null?void 0:J.d.has(E)})){const V=F.m.u;V&&fl(N,V),delete F.m,(Ut?"production":void 0)!=="production"&&e.delete(E);for(const J of F.d.keys()){const K=y(N,J,t(J,F));K==null||K.t.delete(E)}return}return F.m},_={get:r,set:d,sub:(N,E)=>{const F=oi(),V=t(N),J=m(F,N,V);$n(F);const K=J.l;return K.add(E),()=>{K.delete(E);const Y=oi();y(Y,N,V),$n(Y)}},unstable_derive:N=>Kc(...N(t))};return(Ut?"production":void 0)!=="production"&&Object.assign(_,{dev4_get_internal_weak_map:()=>({get:E=>{const F=t(E);if(F.n!==0)return F}}),dev4_get_mounted_atoms:()=>e,dev4_restore_atoms:E=>{const F=oi();for(const[V,J]of E)if(zs(V)){const K=t(V),Y="v"in K,X=K.v;n(V,K,J),h(F,V,K),(!Y||!Object.is(X,K.v))&&(Ws(F,V,K),o(F,V,K))}$n(F)}}),_},_p=()=>{const t=new WeakMap;return Kc(n=>{let i=t.get(n);return i||(i={d:new Map,p:new Set,n:0},t.set(n,i)),i})};let Ui;const Sp=()=>(Ui||(Ui=_p(),(Ut?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Ui),globalThis.__JOTAI_DEFAULT_STORE__!==Ui&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Ui),zc={},Np=Pe.createContext(void 0),Gc=t=>Pe.useContext(Np)||Sp(),Wc=t=>typeof(t==null?void 0:t.then)=="function",Ep=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},wp=Pe.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(Ep(t),t)}),Js=new WeakMap,Ap=t=>{let e=Js.get(t);return e||(e=new Promise((n,i)=>{let r=t;const a=d=>h=>{r===d&&n(h)},o=d=>h=>{r===d&&i(h)},l=d=>{"onCancel"in d&&typeof d.onCancel=="function"&&d.onCancel(h=>{if((zc?"production":void 0)!=="production"&&h===d)throw new Error("[Bug] p is not updated even after cancelation");Wc(h)?(Js.set(h,e),r=h,h.then(a(h),o(h)),l(h)):n(h)})};t.then(a(t),o(t)),l(t)}),Js.set(t,e)),e};function xo(t,e){const n=Gc(),[[i,r,a],o]=Pe.useReducer(h=>{const m=n.get(t);return Object.is(h[0],m)&&h[1]===n&&h[2]===t?h:[m,n,t]},void 0,()=>[n.get(t),n,t]);let l=i;if((r!==n||a!==t)&&(o(),l=n.get(t)),Pe.useEffect(()=>{const h=n.sub(t,()=>{o()});return o(),h},[n,t,void 0]),Pe.useDebugValue(l),Wc(l)){const h=Ap(l);return wp(h)}return l}function au(t,e){const n=Gc();return Pe.useCallback((...r)=>{if((zc?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...r)},[n,t])}function Ys(t,e){return[xo(t),au(t)]}const Jc=Fa(null);Jc.debugLabel="accountAtom";const Op={},{NZ_BACKOFFICE_BACK_URL:xp,NZ_CORE_SERVICES_GRAPHQL_URL:Tp,NZ_CORE_SERVICES_REST_URL:Cp}=Op,_i={apiUrls:{restV1:xp||"https://pabprg32bj.execute-api.us-east-1.amazonaws.com",restV2:Cp||"https://core-services-dev.nizza.com/api",graphql:Tp||"https://core-services-dev.nizza.com/graphql"},publicUrls:{wssIVSChat:"wss://edge.ivschat.us-east-1.amazonaws.com"}};async function qn(t){const{url:e,method:n="GET",body:i,raw:r=!1,contentTypeJson:a=!0,timeout:o,...l}=t,d=new Headers({...a?{"content-type":"application/json"}:{},...t.headers}),h=new AbortController,{signal:m}=h;let y;const v=fetch(e,{method:n,headers:d,body:i,signal:m,...l});o&&(y=setTimeout(()=>{h.abort()},o));const x=await v;if(r)return x;const _=await x.json();if(clearTimeout(y),!x.ok){const N=_?JSON.stringify(_):x.statusText;throw new Error(N)}return _}const Rp=t=>qn({...t,contentTypeJson:!1,raw:!1});function Fp(t,e,n){fetch(e).then(i=>i.blob()).then(i=>Yc(i,`${t}.${n}`))}const Yc=(t,e,n)=>{const i=[t],r=new Blob(i,{type:n!=null?n:"application/octet-stream"});if(typeof window.navigator.msSaveBlob!="undefined")return window.navigator.msSaveBlob(r,e);const a=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(r):window.webkitURL.createObjectURL(r),o=document.createElement("a");return o.style.display="none",o.href=a,o.setAttribute("download",e),typeof o.download=="undefined"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),setTimeout(()=>{document.body.removeChild(o),window.URL.revokeObjectURL(a)},200)};function fi(t){return t!=null&&typeof t=="object"&&t["@@functional/placeholder"]===!0}function na(t){return function e(n){return arguments.length===0||fi(n)?e:t.apply(this,arguments)}}function Dp(t){return function e(n,i){switch(arguments.length){case 0:return e;case 1:return fi(n)?e:na(function(r){return t(n,r)});default:return fi(n)&&fi(i)?e:fi(n)?na(function(r){return t(r,i)}):fi(i)?na(function(r){return t(n,r)}):t(n,i)}}}const Ip=Number.isInteger||function(e){return e<<0===e};function Pp(t){return Object.prototype.toString.call(t)==="[object String]"}function Lp(t,e){var n=t<0?e.length+t:t;return Pp(e)?e.charAt(n):e[n]}var $p=na(function(e){return e==null});function Mp(t,e){for(var n=e,i=0;i<t.length;i+=1){if(n==null)return;var r=t[i];Ip(r)?n=Lp(r,n):n=n[r]}return n}var jp=Dp(Mp);class cn extends Error{constructor(e,n,i){super(n),this.value=i,this.name=e,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toDTO(){return{name:this.name,message:this.message,...this.value&&{value:this.value},...this.stack&&{stack:this.formatStack()}}}formatStack(){return this.stack?this.stack.split(`
2
+ `).map(e=>e.trim()).join(" | "):""}}class Bp extends cn{constructor(e){super("RESOURCE_NOT_FOUND_ERROR",`Resource with id '${e}' not found.`,e)}}class su extends cn{constructor(e){var n;super("APP_UNEXPECTED_ERROR",(n=e.message)!=null?n:"An unexpected error occurred.",e)}}class Xc extends cn{constructor(){super("APP_ACCOUNT_INVALID_ERROR","Account not defined")}}class Qc extends cn{constructor(e){super("INVALID_NIZZA_GLOBAL_OBJECT_ERROR",`
3
3
  Configuration property invalid: "${e}".
4
4
 
5
5
  It looks like you are trying to use a configuration property that is required but is "undefined", make sure you have initialized the global object "nizza".
@@ -21,54 +21,29 @@
21
21
  account: env.account,
22
22
  ...
23
23
  });
24
- `)}}function Mg(t,e){e.forEach(n=>{if(Lg(jg(n.split("."),t)))throw new Kf(n)})}function Ge(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Ug={};function zf(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:Ug}var Gf=Object.assign,pa=Object.getOwnPropertyDescriptor,en=Object.defineProperty,Da=Object.prototype,Su=[];Object.freeze(Su);var el={};Object.freeze(el);var Vg=typeof Proxy!="undefined",qg=Object.toString();function Wf(){Vg||Ge("Proxy not available")}function Jf(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var pr=function(){};function zt(t){return typeof t=="function"}function Hn(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function La(t){return t!==null&&typeof t=="object"}function wn(t){if(!La(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===qg}function Yf(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function $a(t,e,n){en(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Qf(t,e,n){en(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Jn(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return La(r)&&r[n]===!0}}function Sr(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function Hg(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(n);return r===null}function sn(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var Xf=typeof Object.getOwnPropertySymbols!="undefined";function Kg(t){var e=Object.keys(t);if(!Xf)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(r){return Da.propertyIsEnumerable.call(t,r)})):e}var ja=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Xf?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Zf(t){return t===null?null:typeof t=="object"?""+t:t}function un(t,e){return Da.hasOwnProperty.call(t,e)}var zg=Object.getOwnPropertyDescriptors||function(e){var n={};return ja(e).forEach(function(r){n[r]=pa(e,r)}),n};function Tt(t,e){return!!(t&e)}function Ct(t,e,n){return n?t|=e:t&=~e,t}function pc(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Gg(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jg(r.key),r)}}function Ar(t,e,n){return e&&Gg(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function mr(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Yg(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nn(){return Nn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Nn.apply(null,arguments)}function eh(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Au(t,e)}function Au(t,e){return Au=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Au(t,e)}function Wg(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Jg(t){var e=Wg(t,"string");return typeof e=="symbol"?e:e+""}function Yg(t,e){if(t){if(typeof t=="string")return pc(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pc(t,e):void 0}}var Xt=Symbol("mobx-stored-annotations");function tn(t){function e(n,r){if(hi(r))return t.decorate_20223_(n,r);Er(n,r,t)}return Object.assign(e,t)}function Er(t,e,n){un(t,Xt)||$a(t,Xt,Nn({},t[Xt])),ry(n)||(t[Xt][e]=n)}function Qg(t){return un(t,Xt)||$a(t,Xt,Nn({},t[Xt])),t[Xt]}function hi(t){return typeof t=="object"&&typeof t.kind=="string"}var Ie=Symbol("mobx administration"),Rn=function(){function t(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=ze.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.reportObserved=function(){return gh(this)},e.reportChanged=function(){Bt(),yh(this),Mt()},e.toString=function(){return this.name_},Ar(t,[{key:"isBeingObserved",get:function(){return Tt(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Tt(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Tt(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=Ct(this.flags_,t.diffValueMask_,r===1)}}])}();Rn.isBeingObservedMask_=1;Rn.isPendingUnobservationMask_=2;Rn.diffValueMask_=4;var tl=Jn("Atom",Rn);function th(t,e,n){e===void 0&&(e=pr),n===void 0&&(n=pr);var r=new Rn(t);return e!==pr&&sv(r,e),n!==pr&&Ah(r,n),r}function Xg(t,e){return Dh(t,e)}function Zg(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var yr={structural:Xg,default:Zg};function Kn(t,e,n){return Nh(t)?t:Array.isArray(t)?ot.array(t,{name:n}):wn(t)?ot.object(t,void 0,{name:n}):Sr(t)?ot.map(t,{name:n}):sn(t)?ot.set(t,{name:n}):typeof t=="function"&&!Ha(t)&&!ai(t)?Yf(t)?vr(t):ii(n,t):t}function ey(t,e,n){if(t==null||Ga(t)||za(t)||Qn(t)||wr(t))return t;if(Array.isArray(t))return ot.array(t,{name:n,deep:!1});if(wn(t))return ot.object(t,void 0,{name:n,deep:!1});if(Sr(t))return ot.map(t,{name:n,deep:!1});if(sn(t))return ot.set(t,{name:n,deep:!1})}function Ba(t){return t}function ty(t,e){return Dh(t,e)?e:t}var ny="override";function ry(t){return t.annotationType_===ny}function pi(t,e){return{annotationType_:t,options_:e,make_:iy,extend_:ay,decorate_20223_:sy}}function iy(t,e,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(t,e,n,!1)===null?0:1;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(Ha(n.value))return 1;var a=nh(t,this,e,n,!1);return en(r,e,a),2}function ay(t,e,n,r){var i=nh(t,this,e,n);return t.defineProperty_(e,i,r)}function sy(t,e){var n=e.kind,r=e.name,i=e.addInitializer,a=this,o=function(f){var h,y,m,O;return On((h=(y=a.options_)==null?void 0:y.name)!=null?h:r.toString(),f,(m=(O=a.options_)==null?void 0:O.autoAction)!=null?m:!1)};if(n=="field"){i(function(){Er(this,r,a)});return}if(n=="method"){var l;return Ha(t)||(t=o(t)),(l=this.options_)!=null&&l.bound&&i(function(){var c=this,f=c[r].bind(c);f.isMobxAction=!0,c[r]=f}),t}Ge("Cannot apply '"+a.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
26
- '`+a.annotationType_+"' can only be used on properties with a function value."))}function oy(t,e,n,r){e.annotationType_,r.value}function nh(t,e,n,r,i){var a,o,l,c,f,h,y;i===void 0&&(i=Oe.safeDescriptors),oy(t,e,n,r);var m=r.value;if((a=e.options_)!=null&&a.bound){var O;m=m.bind((O=t.proxy_)!=null?O:t.target_)}return{value:On((o=(l=e.options_)==null?void 0:l.name)!=null?o:n.toString(),m,(c=(f=e.options_)==null?void 0:f.autoAction)!=null?c:!1,(h=e.options_)!=null&&h.bound?(y=t.proxy_)!=null?y:t.target_:void 0),configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function rh(t,e){return{annotationType_:t,options_:e,make_:uy,extend_:ly,decorate_20223_:cy}}function uy(t,e,n,r){var i;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!un(t.target_,e)||!ai(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(ai(n.value))return 1;var a=ih(t,this,e,n,!1,!1);return en(r,e,a),2}function ly(t,e,n,r){var i,a=ih(t,this,e,n,(i=this.options_)==null?void 0:i.bound);return t.defineProperty_(e,a,r)}function cy(t,e){var n,r=e.name,i=e.addInitializer;return ai(t)||(t=vr(t)),(n=this.options_)!=null&&n.bound&&i(function(){var a=this,o=a[r].bind(a);o.isMobXFlow=!0,a[r]=o}),t}function dy(t,e,n,r){e.annotationType_,r.value}function ih(t,e,n,r,i,a){a===void 0&&(a=Oe.safeDescriptors),dy(t,e,n,r);var o=r.value;if(ai(o)||(o=vr(o)),i){var l;o=o.bind((l=t.proxy_)!=null?l:t.target_),o.isMobXFlow=!0}return{value:o,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function nl(t,e){return{annotationType_:t,options_:e,make_:fy,extend_:hy,decorate_20223_:py}}function fy(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function hy(t,e,n,r){return my(t,this,e,n),t.defineComputedProperty_(e,Nn({},this.options_,{get:n.get,set:n.set}),r)}function py(t,e){var n=this,r=e.name,i=e.addInitializer;return i(function(){var a=Nr(this)[Ie],o=Nn({},n.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+r.toString()),a.values_.set(r,new Gt(o))}),function(){return this[Ie].getObservablePropValue_(r)}}function my(t,e,n,r){e.annotationType_,r.get}function Ma(t,e){return{annotationType_:t,options_:e,make_:gy,extend_:yy,decorate_20223_:vy}}function gy(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function yy(t,e,n,r){var i,a;return by(t,this),t.defineObservableProperty_(e,n.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:Kn,r)}function vy(t,e){var n=this,r=e.kind,i=e.name,a=new WeakSet;function o(l,c){var f,h,y=Nr(l)[Ie],m=new Un(c,(f=(h=n.options_)==null?void 0:h.enhancer)!=null?f:Kn,"ObservableObject."+i.toString(),!1);y.values_.set(i,m),a.add(l)}if(r=="accessor")return{get:function(){return a.has(this)||o(this,t.get.call(this)),this[Ie].getObservablePropValue_(i)},set:function(c){return a.has(this)||o(this,c),this[Ie].setObservablePropValue_(i,c)},init:function(c){return a.has(this)||o(this,c),c}}}function by(t,e,n,r){e.annotationType_}var ky="true",_y=ah();function ah(t){return{annotationType_:ky,options_:t,make_:Sy,extend_:Ay,decorate_20223_:Ey}}function Sy(t,e,n,r){var i,a;if(n.get)return Sn.make_(t,e,n,r);if(n.set){var o=On(e.toString(),n.set);return r===t.target_?t.defineProperty_(e,{configurable:Oe.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(en(r,e,{configurable:!0,set:o}),2)}if(r!==t.target_&&typeof n.value=="function"){var l;if(Yf(n.value)){var c,f=(c=this.options_)!=null&&c.autoBind?vr.bound:vr;return f.make_(t,e,n,r)}var h=(l=this.options_)!=null&&l.autoBind?ii.bound:ii;return h.make_(t,e,n,r)}var y=((i=this.options_)==null?void 0:i.deep)===!1?ot.ref:ot;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var m;n.value=n.value.bind((m=t.proxy_)!=null?m:t.target_)}return y.make_(t,e,n,r)}function Ay(t,e,n,r){var i,a;if(n.get)return Sn.extend_(t,e,n,r);if(n.set)return t.defineProperty_(e,{configurable:Oe.safeDescriptors?t.isPlainObject_:!0,set:On(e.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;n.value=n.value.bind((o=t.proxy_)!=null?o:t.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?ot.ref:ot;return l.extend_(t,e,n,r)}function Ey(t,e){Ge("'"+this.annotationType_+"' cannot be used as a decorator")}var wy="observable",Ny="observable.ref",Oy="observable.shallow",Ry="observable.struct",sh={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(sh);function Ji(t){return t||sh}var Eu=Ma(wy),Ty=Ma(Ny,{enhancer:Ba}),Cy=Ma(Oy,{enhancer:ey}),xy=Ma(Ry,{enhancer:ty}),oh=tn(Eu);function Yi(t){return t.deep===!0?Kn:t.deep===!1?Ba:Fy(t.defaultDecorator)}function Py(t){var e;return t?(e=t.defaultDecorator)!=null?e:ah(t):void 0}function Fy(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:Kn}function uh(t,e,n){if(hi(e))return Eu.decorate_20223_(t,e);if(Hn(e)){Er(t,e,Eu);return}return Nh(t)?t:wn(t)?ot.object(t,e,n):Array.isArray(t)?ot.array(t,e):Sr(t)?ot.map(t,e):sn(t)?ot.set(t,e):typeof t=="object"&&t!==null?t:ot.box(t,e)}Gf(uh,oh);var Iy={box:function(e,n){var r=Ji(n);return new Un(e,Yi(r),r.name,!0,r.equals)},array:function(e,n){var r=Ji(n);return(Oe.useProxies===!1||r.proxy===!1?Rv:vv)(e,Yi(r),r.name)},map:function(e,n){var r=Ji(n);return new Th(e,Yi(r),r.name)},set:function(e,n){var r=Ji(n);return new Ch(e,Yi(r),r.name)},object:function(e,n,r){return Xn(function(){return ov(Oe.useProxies===!1||(r==null?void 0:r.proxy)===!1?Nr({},r):pv({},r),e,n)})},ref:tn(Ty),shallow:tn(Cy),deep:oh,struct:tn(xy)},ot=Gf(uh,Iy),lh="computed",Dy="computed.struct",wu=nl(lh),Ly=nl(Dy,{equals:yr.structural}),Sn=function(e,n){if(hi(n))return wu.decorate_20223_(e,n);if(Hn(n))return Er(e,n,wu);if(wn(e))return tn(nl(lh,e));var r=wn(n)?n:{};return r.get=e,r.name||(r.name=e.name||""),new Gt(r)};Object.assign(Sn,wu);Sn.struct=tn(Ly);var mc,gc,ma=0,$y=1,jy=(mc=(gc=pa(function(){},"name"))==null?void 0:gc.configurable)!=null?mc:!1,yc={value:"action",configurable:!0,writable:!1,enumerable:!1};function On(t,e,n,r){n===void 0&&(n=!1);function i(){return By(t,n,e,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},jy&&(yc.value=t,en(i,"name",yc)),i}function By(t,e,n,r,i){var a=My(t,e);try{return n.apply(r,i)}catch(o){throw a.error_=o,o}finally{Uy(a)}}function My(t,e,n,r){var i=!1,a=0,o=Oe.trackingDerivation,l=!e||!o;Bt();var c=Oe.allowStateChanges;l&&(Yn(),c=Ua(!0));var f=rl(!0),h={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:c,prevAllowStateReads_:f,notifySpy_:i,startTime_:a,actionId_:$y++,parentActionId_:ma};return ma=h.actionId_,h}function Uy(t){ma!==t.actionId_&&Ge(30),ma=t.parentActionId_,t.error_!==void 0&&(Oe.suppressReactionErrors=!0),Va(t.prevAllowStateChanges_),Yr(t.prevAllowStateReads_),Mt(),t.runAsAction_&&ln(t.prevDerivation_),Oe.suppressReactionErrors=!1}function ch(t,e){var n=Ua(t);try{return e()}finally{Va(n)}}function Ua(t){var e=Oe.allowStateChanges;return Oe.allowStateChanges=t,e}function Va(t){Oe.allowStateChanges=t}var Un=function(t){function e(r,i,a,o,l){var c;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=yr.default),c=t.call(this,a)||this,c.enhancer=void 0,c.name_=void 0,c.equals=void 0,c.hasUnreportedChange_=!1,c.interceptors_=void 0,c.changeListeners_=void 0,c.value_=void 0,c.dehancer=void 0,c.enhancer=i,c.name_=a,c.equals=l,c.value_=i(r,void 0,a),c}eh(e,t);var n=e.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==Oe.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if($t(this)){var a=jt(this,{object:this,type:nn,newValue:i});if(!a)return Oe.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?Oe.UNCHANGED:i},n.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Ht(this)&&Kt(this,{type:nn,object:this,newValue:i,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return mi(this,i)},n.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:nn,newValue:this.value_,oldValue:void 0}),gi(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return Zf(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(Rn),Gt=function(){function t(n){this.dependenciesState_=ze.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=ze.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ya(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=ga.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||Ge(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=On("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?yr.structural:yr.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){Ky(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.get=function(){if(this.isComputing&&Ge(32,this.name_,this.derivation),Oe.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Nu(this)&&(this.warnAboutUntrackedRead_(),Bt(),this.value_=this.computeValue_(!1),Mt());else if(gh(this),Nu(this)){var r=Oe.trackingContext;this.keepAlive_&&!r&&(Oe.trackingContext=this),this.trackAndCompute()&&Hy(this),Oe.trackingContext=r}var i=this.value_;if(aa(i))throw i.cause;return i},e.set=function(r){if(this.setter_){this.isRunningSetter&&Ge(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else Ge(34,this.name_)},e.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===ze.NOT_TRACKING_,a=this.computeValue_(!0),o=i||aa(r)||aa(a)||!this.equals_(r,a);return o&&(this.value_=a),o},e.computeValue_=function(r){this.isComputing=!0;var i=Ua(!1),a;if(r)a=dh(this,this.derivation,this.scope_);else if(Oe.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new ya(o)}return Va(i),this.isComputing=!1,a},e.suspend_=function(){this.keepAlive_||(Ou(this),this.value_=void 0)},e.observe_=function(r,i){var a=this,o=!0,l=void 0;return Ka(function(){var c=a.get();if(!o||i){var f=Yn();r({observableKind:"computed",debugObjectName:a.name_,type:nn,object:a,newValue:c,oldValue:l}),ln(f)}o=!1,l=c})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return Zf(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},Ar(t,[{key:"isComputing",get:function(){return Tt(this.flags_,t.isComputingMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Tt(this.flags_,t.isRunningSetterMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Tt(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Tt(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Tt(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=Ct(this.flags_,t.diffValueMask_,r===1)}}])}();Gt.isComputingMask_=1;Gt.isRunningSetterMask_=2;Gt.isBeingObservedMask_=4;Gt.isPendingUnobservationMask_=8;Gt.diffValueMask_=16;var qa=Jn("ComputedValue",Gt),ze;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(ze||(ze={}));var ga;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(ga||(ga={}));var ya=function(e){this.cause=void 0,this.cause=e};function aa(t){return t instanceof ya}function Nu(t){switch(t.dependenciesState_){case ze.UP_TO_DATE_:return!1;case ze.NOT_TRACKING_:case ze.STALE_:return!0;case ze.POSSIBLY_STALE_:{for(var e=rl(!0),n=Yn(),r=t.observing_,i=r.length,a=0;a<i;a++){var o=r[a];if(qa(o)){if(Oe.disableErrorBoundaries)o.get();else try{o.get()}catch{return ln(n),Yr(e),!0}if(t.dependenciesState_===ze.STALE_)return ln(n),Yr(e),!0}}return hh(t),ln(n),Yr(e),!1}}}function dh(t,e,n){var r=rl(!0);hh(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Oe.runId;var i=Oe.trackingDerivation;Oe.trackingDerivation=t,Oe.inBatch++;var a;if(Oe.disableErrorBoundaries===!0)a=e.call(n);else try{a=e.call(n)}catch(o){a=new ya(o)}return Oe.inBatch--,Oe.trackingDerivation=i,Vy(t),Yr(r),a}function Vy(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,r=ze.UP_TO_DATE_,i=0,a=t.unboundDepsCount_,o=0;o<a;o++){var l=n[o];l.diffValue===0&&(l.diffValue=1,i!==o&&(n[i]=l),i++),l.dependenciesState_>r&&(r=l.dependenciesState_)}for(n.length=i,t.newObserving_=null,a=e.length;a--;){var c=e[a];c.diffValue===0&&ph(c,t),c.diffValue=0}for(;i--;){var f=n[i];f.diffValue===1&&(f.diffValue=0,qy(f,t))}r!==ze.UP_TO_DATE_&&(t.dependenciesState_=r,t.onBecomeStale_())}function Ou(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)ph(e[n],t);t.dependenciesState_=ze.NOT_TRACKING_}function fh(t){var e=Yn();try{return t()}finally{ln(e)}}function Yn(){var t=Oe.trackingDerivation;return Oe.trackingDerivation=null,t}function ln(t){Oe.trackingDerivation=t}function rl(t){var e=Oe.allowStateReads;return Oe.allowStateReads=t,e}function Yr(t){Oe.allowStateReads=t}function hh(t){if(t.dependenciesState_!==ze.UP_TO_DATE_){t.dependenciesState_=ze.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=ze.UP_TO_DATE_}}var eo=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},to=!0,Oe=function(){var t=zf();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(to=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new eo().version&&(to=!1),to?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new eo):(setTimeout(function(){Ge(35)},1),new eo)}();function qy(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function ph(t,e){t.observers_.delete(e),t.observers_.size===0&&mh(t)}function mh(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Oe.pendingUnobservations.push(t))}function Bt(){Oe.inBatch++}function Mt(){if(--Oe.inBatch===0){vh();for(var t=Oe.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Gt&&n.suspend_())}Oe.pendingUnobservations=[]}}function gh(t){var e=Oe.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Oe.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Oe.inBatch>0&&mh(t),!1)}function yh(t){t.lowestObserverState_!==ze.STALE_&&(t.lowestObserverState_=ze.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===ze.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=ze.STALE_}))}function Hy(t){t.lowestObserverState_!==ze.STALE_&&(t.lowestObserverState_=ze.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===ze.POSSIBLY_STALE_?e.dependenciesState_=ze.STALE_:e.dependenciesState_===ze.UP_TO_DATE_&&(t.lowestObserverState_=ze.UP_TO_DATE_)}))}function Ky(t){t.lowestObserverState_===ze.UP_TO_DATE_&&(t.lowestObserverState_=ze.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===ze.UP_TO_DATE_&&(e.dependenciesState_=ze.POSSIBLY_STALE_,e.onBecomeStale_())}))}var cn=function(){function t(n,r,i,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=ze.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=ga.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Oe.pendingReactions.push(this),vh())},e.runReaction_=function(){if(!this.isDisposed){Bt(),this.isScheduled=!1;var r=Oe.trackingContext;if(Oe.trackingContext=this,Nu(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}Oe.trackingContext=r,Mt()}},e.track=function(r){if(!this.isDisposed){Bt(),this.isRunning=!0;var i=Oe.trackingContext;Oe.trackingContext=this;var a=dh(this,r,void 0);Oe.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Ou(this),aa(a)&&this.reportExceptionInDerivation_(a.cause),Mt()}},e.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Oe.disableErrorBoundaries)throw r;var a="[mobx] uncaught error in '"+this+"'";Oe.suppressReactionErrors||console.error(a,r),Oe.globalReactionErrorHandlers.forEach(function(o){return o(r,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Bt(),Ou(this),Mt()))},e.getDisposer_=function(r){var i=this,a=function o(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",o)};return r==null||r.addEventListener==null||r.addEventListener("abort",a),a[Ie]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(r){},Ar(t,[{key:"isDisposed",get:function(){return Tt(this.flags_,t.isDisposedMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Tt(this.flags_,t.isScheduledMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Tt(this.flags_,t.isTrackPendingMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Tt(this.flags_,t.isRunningMask_)},set:function(r){this.flags_=Ct(this.flags_,t.isRunningMask_,r)}},{key:"diffValue",get:function(){return Tt(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=Ct(this.flags_,t.diffValueMask_,r===1)}}])}();cn.isDisposedMask_=1;cn.isScheduledMask_=2;cn.isTrackPendingMask_=4;cn.isRunningMask_=8;cn.diffValueMask_=16;var zy=100,Gy=function(e){return e()};function vh(){Oe.inBatch>0||Oe.isRunningReactions||Gy(Wy)}function Wy(){Oe.isRunningReactions=!0;for(var t=Oe.pendingReactions,e=0;t.length>0;){++e===zy&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}Oe.isRunningReactions=!1}var va=Jn("Reaction",cn);function Qr(){return!1}function Jy(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var bh="action",Yy="action.bound",kh="autoAction",Qy="autoAction.bound",Xy="<unnamed action>",Ru=pi(bh),Zy=pi(Yy,{bound:!0}),Tu=pi(kh,{autoAction:!0}),ev=pi(Qy,{autoAction:!0,bound:!0});function _h(t){var e=function(r,i){if(zt(r))return On(r.name||Xy,r,t);if(zt(i))return On(r,i,t);if(hi(i))return(t?Tu:Ru).decorate_20223_(r,i);if(Hn(i))return Er(r,i,t?Tu:Ru);if(Hn(r))return tn(pi(t?kh:bh,{name:r,autoAction:t}))};return e}var Rt=_h(!1);Object.assign(Rt,Ru);var ii=_h(!0);Object.assign(ii,Tu);Rt.bound=tn(Zy);ii.bound=tn(ev);function Ha(t){return zt(t)&&t.isMobxAction===!0}function Ka(t,e){var n,r,i,a;e===void 0&&(e=el);var o=(n=(r=e)==null?void 0:r.name)!=null?n:"Autorun",l=!e.scheduler&&!e.delay,c;if(l)c=new cn(o,function(){this.track(y)},e.onError,e.requiresObservable);else{var f=Sh(e),h=!1;c=new cn(o,function(){h||(h=!0,f(function(){h=!1,c.isDisposed||c.track(y)}))},e.onError,e.requiresObservable)}function y(){t(c)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||c.schedule_(),c.getDisposer_((a=e)==null?void 0:a.signal)}var tv=function(e){return e()};function Sh(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:tv}function nv(t,e,n){var r,i,a;n===void 0&&(n=el);var o=(r=n.name)!=null?r:"Reaction",l=Rt(o,n.onError?rv(n.onError,e):e),c=!n.scheduler&&!n.delay,f=Sh(n),h=!0,y=!1,m,O=n.compareStructural?yr.structural:n.equals||yr.default,A=new cn(o,function(){h||c?E():y||(y=!0,f(E))},n.onError,n.requiresObservable);function E(){if(y=!1,!A.isDisposed){var b=!1,k=m;A.track(function(){var C=ch(!1,function(){return t(A)});b=h||!O(m,C),m=C}),(h&&n.fireImmediately||!h&&b)&&l(m,k,A),h=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||A.schedule_(),A.getDisposer_((a=n)==null?void 0:a.signal)}function rv(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}var iv="onBO",av="onBUO";function sv(t,e,n){return Eh(iv,t,e,n)}function Ah(t,e,n){return Eh(av,t,e,n)}function Eh(t,e,n,r){var i=Cu(e),a=zt(r)?r:n,o=t+"L";return i[o]?i[o].add(a):i[o]=new Set([a]),function(){var l=i[o];l&&(l.delete(a),l.size===0&&delete i[o])}}function ov(t,e,n,r){var i=zg(e);return Xn(function(){var a=Nr(t,r)[Ie];ja(i).forEach(function(o){a.extend_(o,i[o],n&&o in n?n[o]:!0)})}),t}var uv=0;function wh(){this.message="FLOW_CANCELLED"}wh.prototype=Object.create(Error.prototype);var no=rh("flow"),lv=rh("flow.bound",{bound:!0}),vr=Object.assign(function(e,n){if(hi(n))return no.decorate_20223_(e,n);if(Hn(n))return Er(e,n,no);var r=e,i=r.name||"<unnamed flow>",a=function(){var l=this,c=arguments,f=++uv,h=Rt(i+" - runid: "+f+" - init",r).apply(l,c),y,m=void 0,O=new Promise(function(A,E){var b=0;y=E;function k(R){m=void 0;var x;try{x=Rt(i+" - runid: "+f+" - yield "+b++,h.next).call(h,R)}catch(z){return E(z)}S(x)}function C(R){m=void 0;var x;try{x=Rt(i+" - runid: "+f+" - yield "+b++,h.throw).call(h,R)}catch(z){return E(z)}S(x)}function S(R){if(zt(R==null?void 0:R.then)){R.then(S,E);return}return R.done?A(R.value):(m=Promise.resolve(R.value),m.then(k,C))}k(void 0)});return O.cancel=Rt(i+" - runid: "+f+" - cancel",function(){try{m&&vc(m);var A=h.return(void 0),E=Promise.resolve(A.value);E.then(pr,pr),vc(E),y(new wh)}catch(b){y(b)}}),O};return a.isMobXFlow=!0,a},no);vr.bound=tn(lv);function vc(t){zt(t.cancel)&&t.cancel()}function ai(t){return(t==null?void 0:t.isMobXFlow)===!0}function cv(t,e){return t?Ga(t)||!!t[Ie]||tl(t)||va(t)||qa(t):!1}function Nh(t){return cv(t)}function on(t,e){e===void 0&&(e=void 0),Bt();try{return t.apply(e)}finally{Mt()}}function dv(t,e,n){return arguments.length===1||e&&typeof e=="object"?fv(t,e):Oh(t,e,{})}function Oh(t,e,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!o[Ie].isDisposed)if(o(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var a=On("When-effect",e),o=Ka(function(l){var c=ch(!1,t);c&&(l.dispose(),r&&clearTimeout(r),a())},n);return o}function fv(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,i,a=new Promise(function(o,l){var c,f=Oh(t,o,Nn({},e,{onError:l}));r=function(){f(),l(new Error("WHEN_CANCELLED"))},i=function(){f(),l(new Error("WHEN_ABORTED"))},e==null||(c=e.signal)==null||c.addEventListener==null||c.addEventListener("abort",i)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",i)});return a.cancel=r,a}function ur(t){return t[Ie]}var hv={has:function(e,n){return ur(e).has_(n)},get:function(e,n){return ur(e).get_(n)},set:function(e,n,r){var i;return Hn(n)?(i=ur(e).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(e,n){var r;return Hn(n)?(r=ur(e).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(e,n,r){var i;return(i=ur(e).defineProperty_(n,r))!=null?i:!0},ownKeys:function(e){return ur(e).ownKeys_()},preventExtensions:function(e){Ge(13)}};function pv(t,e){var n,r;return Wf(),t=Nr(t,e),(r=(n=t[Ie]).proxy_)!=null?r:n.proxy_=new Proxy(t,hv)}function $t(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function mi(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Jf(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function jt(t,e){var n=Yn();try{for(var r=[].concat(t.interceptors_||[]),i=0,a=r.length;i<a&&(e=r[i](e),e&&!e.type&&Ge(14),!!e);i++);return e}finally{ln(n)}}function Ht(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function gi(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Jf(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Kt(t,e){var n=Yn(),r=t.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](e);ln(n)}}function mv(t,e,n){return Xn(function(){var r,i=Nr(t,n)[Ie];(r=e)!=null||(e=Qg(t)),ja(e).forEach(function(a){return i.make_(a,e[a])})}),t}var bc="splice",nn="update",gv=1e4,yv={get:function(e,n){var r=e[Ie];return n===Ie?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):un(ba,n)?ba[n]:e[n]},set:function(e,n,r){var i=e[Ie];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?e[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){Ge(15)}},il=function(){function t(n,r,i,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Rn(n),this.enhancer_=function(o,l){return r(o,l,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},e.intercept_=function(r){return mi(this,r)},e.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),gi(this,r)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&Ge("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var a=new Array(r-i),o=0;o<r-i;o++)a[o]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(r,i-r)},e.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&Ge(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&Ih(r+i+1)},e.spliceWithArray_=function(r,i,a){var o=this;this.atom_;var l=this.values_.length;if(r===void 0?r=0:r>l?r=l:r<0&&(r=Math.max(0,l+r)),arguments.length===1?i=l-r:i==null?i=0:i=Math.max(0,Math.min(i,l-r)),a===void 0&&(a=Su),$t(this)){var c=jt(this,{object:this.proxy_,type:bc,index:r,removedCount:i,added:a});if(!c)return Su;i=c.removedCount,a=c.added}if(a=a.length===0?a:a.map(function(y){return o.enhancer_(y,void 0)}),this.legacyMode_){var f=a.length-i;this.updateArrayLength_(l,f)}var h=this.spliceItemsIntoValues_(r,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(r,a,h),this.dehanceValues_(h)},e.spliceItemsIntoValues_=function(r,i,a){if(a.length<gv){var o;return(o=this.values_).splice.apply(o,[r,i].concat(a))}else{var l=this.values_.slice(r,r+i),c=this.values_.slice(r+i);this.values_.length+=a.length-i;for(var f=0;f<a.length;f++)this.values_[r+f]=a[f];for(var h=0;h<c.length;h++)this.values_[r+a.length+h]=c[h];return l}},e.notifyArrayChildUpdate_=function(r,i,a){var o=!this.owned_&&Qr(),l=Ht(this),c=l||o?{observableKind:"array",object:this.proxy_,type:nn,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),l&&Kt(this,c)},e.notifyArraySplice_=function(r,i,a){var o=!this.owned_&&Qr(),l=Ht(this),c=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:bc,index:r,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),l&&Kt(this,c)},e.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},e.set_=function(r,i){var a=this.values_;if(this.legacyMode_&&r>a.length&&Ge(17,r,a.length),r<a.length){this.atom_;var o=a[r];if($t(this)){var l=jt(this,{type:nn,object:this.proxy_,index:r,newValue:i});if(!l)return;i=l.newValue}i=this.enhancer_(i,o);var c=i!==o;c&&(a[r]=i,this.notifyArrayChildUpdate_(r,i,o))}else{for(var f=new Array(r+1-a.length),h=0;h<f.length-1;h++)f[h]=void 0;f[f.length-1]=i,this.spliceWithArray_(a.length,0,f)}},t}();function vv(t,e,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),Wf(),Xn(function(){var i=new il(n,e,r,!1);Qf(i.values_,Ie,i);var a=new Proxy(i.values_,yv);return i.proxy_=a,t&&t.length&&i.spliceWithArray_(0,0,t),a})}var ba={clear:function(){return this.splice(0)},replace:function(e){var n=this[Ie];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];var o=this[Ie];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,n)}return o.spliceWithArray_(e,n,i)},spliceWithArray:function(e,n,r){return this[Ie].spliceWithArray_(e,n,r)},push:function(){for(var e=this[Ie],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[Ie].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[Ie],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return Oe.trackingDerivation&&Ge(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Oe.trackingDerivation&&Ge(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[Ie],r=n.dehanceValues_(n.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};Xe("at",Pt);Xe("concat",Pt);Xe("flat",Pt);Xe("includes",Pt);Xe("indexOf",Pt);Xe("join",Pt);Xe("lastIndexOf",Pt);Xe("slice",Pt);Xe("toString",Pt);Xe("toLocaleString",Pt);Xe("toSorted",Pt);Xe("toSpliced",Pt);Xe("with",Pt);Xe("every",Wt);Xe("filter",Wt);Xe("find",Wt);Xe("findIndex",Wt);Xe("findLast",Wt);Xe("findLastIndex",Wt);Xe("flatMap",Wt);Xe("forEach",Wt);Xe("map",Wt);Xe("some",Wt);Xe("toReversed",Wt);Xe("reduce",Rh);Xe("reduceRight",Rh);function Xe(t,e){typeof Array.prototype[t]=="function"&&(ba[t]=e(t))}function Pt(t){return function(){var e=this[Ie];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function Wt(t){return function(e,n){var r=this,i=this[Ie];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[t](function(o,l){return e.call(n,o,l,r)})}}function Rh(t){return function(){var e=this,n=this[Ie];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(a,o,l){return i(a,o,l,e)},r[t].apply(r,arguments)}}var bv=Jn("ObservableArrayAdministration",il);function za(t){return La(t)&&bv(t[Ie])}var kv={},An="add",ka="delete",Th=function(){function t(n,r,i){var a=this;r===void 0&&(r=Kn),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ie]=kv,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,zt(Map)||Ge(18),Xn(function(){a.keysAtom_=th("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var e=t.prototype;return e.has_=function(r){return this.data_.has(r)},e.has=function(r){var i=this;if(!Oe.trackingDerivation)return this.has_(r);var a=this.hasMap_.get(r);if(!a){var o=a=new Un(this.has_(r),Ba,"ObservableMap.key?",!1);this.hasMap_.set(r,o),Ah(o,function(){return i.hasMap_.delete(r)})}return a.get()},e.set=function(r,i){var a=this.has_(r);if($t(this)){var o=jt(this,{type:a?nn:An,object:this,newValue:i,name:r});if(!o)return this;i=o.newValue}return a?this.updateValue_(r,i):this.addValue_(r,i),this},e.delete=function(r){var i=this;if(this.keysAtom_,$t(this)){var a=jt(this,{type:ka,object:this,name:r});if(!a)return!1}if(this.has_(r)){var o=Qr(),l=Ht(this),c=l||o?{observableKind:"map",debugObjectName:this.name_,type:ka,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return on(function(){var f;i.keysAtom_.reportChanged(),(f=i.hasMap_.get(r))==null||f.setNewValue_(!1);var h=i.data_.get(r);h.setNewValue_(void 0),i.data_.delete(r)}),l&&Kt(this,c),!0}return!1},e.updateValue_=function(r,i){var a=this.data_.get(r);if(i=a.prepareNewValue_(i),i!==Oe.UNCHANGED){var o=Qr(),l=Ht(this),c=l||o?{observableKind:"map",debugObjectName:this.name_,type:nn,object:this,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),l&&Kt(this,c)}},e.addValue_=function(r,i){var a=this;this.keysAtom_,on(function(){var f,h=new Un(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(r,h),i=h.value_,(f=a.hasMap_.get(r))==null||f.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Qr(),l=Ht(this),c=l||o?{observableKind:"map",debugObjectName:this.name_,type:An,object:this,name:r,newValue:i}:null;l&&Kt(this,c)},e.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var r=this,i=this.keys();return si({next:function(){var o=i.next(),l=o.done,c=o.value;return{done:l,value:l?void 0:r.get(c)}}})},e.entries=function(){var r=this,i=this.keys();return si({next:function(){var o=i.next(),l=o.done,c=o.value;return{done:l,value:l?void 0:[c,r.get(c)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(r,i){for(var a=mr(this),o;!(o=a()).done;){var l=o.value,c=l[0],f=l[1];r.call(i,f,c,this)}},e.merge=function(r){var i=this;return Qn(r)&&(r=new Map(r)),on(function(){wn(r)?Kg(r).forEach(function(a){return i.set(a,r[a])}):Array.isArray(r)?r.forEach(function(a){var o=a[0],l=a[1];return i.set(o,l)}):Sr(r)?(Hg(r)||Ge(19,r),r.forEach(function(a,o){return i.set(o,a)})):r!=null&&Ge(20,r)}),this},e.clear=function(){var r=this;on(function(){fh(function(){for(var i=mr(r.keys()),a;!(a=i()).done;){var o=a.value;r.delete(o)}})})},e.replace=function(r){var i=this;return on(function(){for(var a=_v(r),o=new Map,l=!1,c=mr(i.data_.keys()),f;!(f=c()).done;){var h=f.value;if(!a.has(h)){var y=i.delete(h);if(y)l=!0;else{var m=i.data_.get(h);o.set(h,m)}}}for(var O=mr(a.entries()),A;!(A=O()).done;){var E=A.value,b=E[0],k=E[1],C=i.data_.has(b);if(i.set(b,k),i.data_.has(b)){var S=i.data_.get(b);o.set(b,S),C||(l=!0)}}if(!l)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var R=i.data_.keys(),x=o.keys(),z=R.next(),I=x.next();!z.done;){if(z.value!==I.value){i.keysAtom_.reportChanged();break}z=R.next(),I=x.next()}i.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(r,i){return gi(this,r)},e.intercept_=function(r){return mi(this,r)},Ar(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Qn=Jn("ObservableMap",Th);function _v(t){if(Sr(t)||Qn(t))return t;if(Array.isArray(t))return new Map(t);if(wn(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return Ge(21,t)}var Sv={},Ch=function(){function t(n,r,i){var a=this;r===void 0&&(r=Kn),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Ie]=Sv,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,zt(Set)||Ge(22),this.enhancer_=function(o,l){return r(o,l,i)},Xn(function(){a.atom_=th(a.name_),n&&a.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.clear=function(){var r=this;on(function(){fh(function(){for(var i=mr(r.data_.values()),a;!(a=i()).done;){var o=a.value;r.delete(o)}})})},e.forEach=function(r,i){for(var a=mr(this),o;!(o=a()).done;){var l=o.value;r.call(i,l,l,this)}},e.add=function(r){var i=this;if(this.atom_,$t(this)){var a=jt(this,{type:An,object:this,newValue:r});if(!a)return this}if(!this.has(r)){on(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var o=!1,l=Ht(this),c=l||o?{observableKind:"set",debugObjectName:this.name_,type:An,object:this,newValue:r}:null;l&&Kt(this,c)}return this},e.delete=function(r){var i=this;if($t(this)){var a=jt(this,{type:ka,object:this,oldValue:r});if(!a)return!1}if(this.has(r)){var o=!1,l=Ht(this),c=l||o?{observableKind:"set",debugObjectName:this.name_,type:ka,object:this,oldValue:r}:null;return on(function(){i.atom_.reportChanged(),i.data_.delete(r)}),l&&Kt(this,c),!0}return!1},e.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},e.entries=function(){var r=0,i=Array.from(this.keys()),a=Array.from(this.values());return si({next:function(){var l=r;return r+=1,l<a.length?{value:[i[l],a[l]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var r=this,i=0,a=Array.from(this.data_.values());return si({next:function(){return i<a.length?{value:r.dehanceValue_(a[i++]),done:!1}:{done:!0}}})},e.intersection=function(r){if(sn(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},e.union=function(r){if(sn(r))return r.union(this);var i=new Set(this);return i.union(r)},e.difference=function(r){return new Set(this).difference(r)},e.symmetricDifference=function(r){if(sn(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},e.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},e.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},e.isDisjointFrom=function(r){if(sn(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},e.replace=function(r){var i=this;return wr(r)&&(r=new Set(r)),on(function(){Array.isArray(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):sn(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):r!=null&&Ge("Cannot initialize set from "+r)}),this},e.observe_=function(r,i){return gi(this,r)},e.intercept_=function(r){return mi(this,r)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},Ar(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),wr=Jn("ObservableSet",Ch),kc=Object.create(null),_c="remove",xh=function(){function t(n,r,i,a){r===void 0&&(r=new Map),a===void 0&&(a=_y),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new Rn("ObservableObject.keys"),this.isPlainObject_=wn(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(r){return this.values_.get(r).get()},e.setObservablePropValue_=function(r,i){var a=this.values_.get(r);if(a instanceof Gt)return a.set(i),!0;if($t(this)){var o=jt(this,{type:nn,object:this.proxy_||this.target_,name:r,newValue:i});if(!o)return null;i=o.newValue}if(i=a.prepareNewValue_(i),i!==Oe.UNCHANGED){var l=Ht(this),c=!1,f=l||c?{type:nn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),l&&Kt(this,f)}return!0},e.get_=function(r){return Oe.trackingDerivation&&!un(this.target_,r)&&this.has_(r),this.target_[r]},e.set_=function(r,i,a){return a===void 0&&(a=!1),un(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):a?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},e.has_=function(r){if(!Oe.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new Un(r in this.target_,Ba,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},e.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var a;if((a=this.target_[Xt])!=null&&a[r])return;Ge(1,i.annotationType_,this.name_+"."+r.toString())}for(var o=this.target_;o&&o!==Da;){var l=pa(o,r);if(l){var c=i.make_(this,r,l,o);if(c===0)return;if(c===1)break}o=Object.getPrototypeOf(o)}Ac(this,i,r)}},e.extend_=function(r,i,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(r,i,o);var l=a.extend_(this,r,i,o);return l&&Ac(this,a,r),l},e.defineProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Bt();var o=this.delete_(r);if(!o)return o;if($t(this)){var l=jt(this,{object:this.proxy_||this.target_,name:r,type:An,newValue:i.value});if(!l)return null;var c=l.newValue;i.value!==c&&(i=Nn({},i,{value:c}))}if(a){if(!Reflect.defineProperty(this.target_,r,i))return!1}else en(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{Mt()}return!0},e.defineObservableProperty_=function(r,i,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Bt();var l=this.delete_(r);if(!l)return l;if($t(this)){var c=jt(this,{object:this.proxy_||this.target_,name:r,type:An,newValue:i});if(!c)return null;i=c.newValue}var f=Sc(r),h={configurable:Oe.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:f.get,set:f.set};if(o){if(!Reflect.defineProperty(this.target_,r,h))return!1}else en(this.target_,r,h);var y=new Un(i,a,"ObservableObject.key",!1);this.values_.set(r,y),this.notifyPropertyAddition_(r,y.value_)}finally{Mt()}return!0},e.defineComputedProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Bt();var o=this.delete_(r);if(!o)return o;if($t(this)){var l=jt(this,{object:this.proxy_||this.target_,name:r,type:An,newValue:void 0});if(!l)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var c=Sc(r),f={configurable:Oe.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:c.get,set:c.set};if(a){if(!Reflect.defineProperty(this.target_,r,f))return!1}else en(this.target_,r,f);this.values_.set(r,new Gt(i)),this.notifyPropertyAddition_(r,void 0)}finally{Mt()}return!0},e.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!un(this.target_,r))return!0;if($t(this)){var a=jt(this,{object:this.proxy_||this.target_,name:r,type:_c});if(!a)return null}try{var o;Bt();var l=Ht(this),c=!1,f=this.values_.get(r),h=void 0;if(!f&&(l||c)){var y;h=(y=pa(this.target_,r))==null?void 0:y.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(f&&(this.values_.delete(r),f instanceof Un&&(h=f.value_),yh(f)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(r in this.target_),l||c){var m={type:_c,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:h,name:r};l&&Kt(this,m)}}finally{Mt()}return!0},e.observe_=function(r,i){return gi(this,r)},e.intercept_=function(r){return mi(this,r)},e.notifyPropertyAddition_=function(r,i){var a,o=Ht(this),l=!1;if(o||l){var c=o||l?{type:An,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;o&&Kt(this,c)}(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),ja(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function Nr(t,e){var n;if(un(t,Ie))return t;var r=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",i=new xh(t,new Map,String(r),Py(e));return $a(t,Ie,i),t}var Av=Jn("ObservableObjectAdministration",xh);function Sc(t){return kc[t]||(kc[t]={get:function(){return this[Ie].getObservablePropValue_(t)},set:function(n){return this[Ie].setObservablePropValue_(t,n)}})}function Ga(t){return La(t)?Av(t[Ie]):!1}function Ac(t,e,n){var r;(r=t.target_[Xt])==null||delete r[n]}var Ev=Fh(0),wv=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),ro=0,Ph=function(){};function Nv(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}Nv(Ph,Array.prototype);var al=function(t){function e(r,i,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=t.call(this)||this,Xn(function(){var c=new il(a,i,o,!0);c.proxy_=l,Qf(l,Ie,c),r&&r.length&&l.spliceWithArray(0,0,r),wv&&Object.defineProperty(l,"0",Ev)}),l}eh(e,t);var n=e.prototype;return n.concat=function(){this[Ie].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return za(l)?l.slice():l}))},n[Symbol.iterator]=function(){var r=this,i=0;return si({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Ar(e,[{key:"length",get:function(){return this[Ie].getArrayLength_()},set:function(i){this[Ie].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(Ph);Object.entries(ba).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&$a(al.prototype,e,n)});function Fh(t){return{enumerable:!1,configurable:!0,get:function(){return this[Ie].get_(t)},set:function(n){this[Ie].set_(t,n)}}}function Ov(t){en(al.prototype,""+t,Fh(t))}function Ih(t){if(t>ro){for(var e=ro;e<t+100;e++)Ov(e);ro=t}}Ih(1e3);function Rv(t,e,n){return new al(t,e,n)}function Cu(t,e){if(typeof t=="object"&&t!==null){if(za(t))return e!==void 0&&Ge(23),t[Ie].atom_;if(wr(t))return t.atom_;if(Qn(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||Ge(25,e,xu(t)),n}if(Ga(t)){if(!e)return Ge(26);var r=t[Ie].values_.get(e);return r||Ge(27,e,xu(t)),r}if(tl(t)||qa(t)||va(t))return t}else if(zt(t)&&va(t[Ie]))return t[Ie];Ge(28)}function Tv(t,e){if(t||Ge(29),tl(t)||qa(t)||va(t)||Qn(t)||wr(t))return t;if(t[Ie])return t[Ie];Ge(24,t)}function xu(t,e){var n;if(e!==void 0)n=Cu(t,e);else{if(Ha(t))return t.name;Ga(t)||Qn(t)||wr(t)?n=Tv(t):n=Cu(t)}return n.name_}function Xn(t){var e=Yn(),n=Ua(!0);Bt();try{return t()}finally{Mt(),Va(n),ln(e)}}var Ec=Da.toString;function Dh(t,e,n){return n===void 0&&(n=-1),Pu(t,e,n)}function Pu(t,e,n,r,i){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var o=Ec.call(t);if(o!==Ec.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol!="undefined"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=wc(t),e=wc(e);var l=o==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var c=t.constructor,f=e.constructor;if(c!==f&&!(zt(c)&&c instanceof c&&zt(f)&&f instanceof f)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var h=r.length;h--;)if(r[h]===t)return i[h]===e;if(r.push(t),i.push(e),l){if(h=t.length,h!==e.length)return!1;for(;h--;)if(!Pu(t[h],e[h],n-1,r,i))return!1}else{var y=Object.keys(t),m;if(h=y.length,Object.keys(e).length!==h)return!1;for(;h--;)if(m=y[h],!(un(e,m)&&Pu(t[m],e[m],n-1,r,i)))return!1}return r.pop(),i.pop(),!0}function wc(t){return za(t)?t.slice():Sr(t)||Qn(t)||sn(t)||wr(t)?Array.from(t.entries()):t}function si(t){return t[Symbol.iterator]=Cv,t}function Cv(){return this}["Symbol","Map","Set"].forEach(function(t){var e=zf();typeof e[t]=="undefined"&&Ge("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Jy,extras:{getDebugName:xu},$mobx:Ie});function xv(t,e=[]){Ue.useEffect(()=>{const n=Ka(t);return()=>n()},e)}function Lh(t,e={}){const{defaultValue:n,deps:r=[]}=e,i=Ue.useMemo(()=>t,r),[a,o]=Ue.useState(()=>i()||n);return Ue.useEffect(()=>{const l=Ka(()=>o(i()));return()=>l()},[i,...r]),a}function Pv(t,e,n=[]){const r=Ue.useMemo(()=>t,n),i=Ue.useMemo(()=>e,n);Ue.useEffect(()=>{const a=nv(r,i);return()=>a()},[r,i])}let sl=new Map;const Fu=Ue.createContext(sl),Fv=({children:t,stores:e})=>{const n=Ue.useContext(Fu),r=Ue.useMemo(()=>{const i=new Map;return e.forEach(a=>i.set(a.class,a.value)),sl=new Map([...n,...i])},[]);return cg.jsx(Fu.Provider,{value:r,children:t})};function Iv(t){return Ue.useContext(Fu).get(t)}function Dv(t){return sl.get(t)}var ol=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Wa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lv(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var sa={exports:{}},$v=sa.exports,Nc;function jv(){return Nc||(Nc=1,function(t,e){(function(n,r){t.exports=r()})($v,function(){var n=function(s,u){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var g in p)Object.prototype.hasOwnProperty.call(p,g)&&(d[g]=p[g])})(s,u)},r=function(){return(r=Object.assign||function(s){for(var u,d=1,p=arguments.length;d<p;d++)for(var g in u=arguments[d])Object.prototype.hasOwnProperty.call(u,g)&&(s[g]=u[g]);return s}).apply(this,arguments)};function i(s,u,d){for(var p,g=0,v=u.length;g<v;g++)!p&&g in u||((p=p||Array.prototype.slice.call(u,0,g))[g]=u[g]);return s.concat(p||Array.prototype.slice.call(u))}var a=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:ol,o=Object.keys,l=Array.isArray;function c(s,u){return typeof u!="object"||o(u).forEach(function(d){s[d]=u[d]}),s}typeof Promise=="undefined"||a.Promise||(a.Promise=Promise);var f=Object.getPrototypeOf,h={}.hasOwnProperty;function y(s,u){return h.call(s,u)}function m(s,u){typeof u=="function"&&(u=u(f(s))),(typeof Reflect=="undefined"?o:Reflect.ownKeys)(u).forEach(function(d){A(s,d,u[d])})}var O=Object.defineProperty;function A(s,u,d,p){O(s,u,c(d&&y(d,"get")&&typeof d.get=="function"?{get:d.get,set:d.set,configurable:!0}:{value:d,configurable:!0,writable:!0},p))}function E(s){return{from:function(u){return s.prototype=Object.create(u.prototype),A(s.prototype,"constructor",s),{extend:m.bind(null,s.prototype)}}}}var b=Object.getOwnPropertyDescriptor,k=[].slice;function C(s,u,d){return k.call(s,u,d)}function S(s,u){return u(s)}function R(s){if(!s)throw new Error("Assertion Failed")}function x(s){a.setImmediate?setImmediate(s):setTimeout(s,0)}function z(s,u){if(typeof u=="string"&&y(s,u))return s[u];if(!u)return s;if(typeof u!="string"){for(var d=[],p=0,g=u.length;p<g;++p){var v=z(s,u[p]);d.push(v)}return d}var _=u.indexOf(".");if(_!==-1){var N=s[u.substr(0,_)];return N==null?void 0:z(N,u.substr(_+1))}}function I(s,u,d){if(s&&u!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof u!="string"&&"length"in u){R(typeof d!="string"&&"length"in d);for(var p=0,g=u.length;p<g;++p)I(s,u[p],d[p])}else{var v,_,N=u.indexOf(".");N!==-1?(v=u.substr(0,N),(_=u.substr(N+1))===""?d===void 0?l(s)&&!isNaN(parseInt(v))?s.splice(v,1):delete s[v]:s[v]=d:I(N=!(N=s[v])||!y(s,v)?s[v]={}:N,_,d)):d===void 0?l(s)&&!isNaN(parseInt(u))?s.splice(u,1):delete s[u]:s[u]=d}}function re(s){var u,d={};for(u in s)y(s,u)&&(d[u]=s[u]);return d}var ie=[].concat;function ke(s){return ie.apply([],s)}var Ut="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ke([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(u){return u+s+"Array"})}))).filter(function(s){return a[s]}),he=new Set(Ut.map(function(s){return a[s]})),Ee=null;function le(s){return Ee=new WeakMap,s=function u(d){if(!d||typeof d!="object")return d;var p=Ee.get(d);if(p)return p;if(l(d)){p=[],Ee.set(d,p);for(var g=0,v=d.length;g<v;++g)p.push(u(d[g]))}else if(he.has(d.constructor))p=d;else{var _,N=f(d);for(_ in p=N===Object.prototype?{}:Object.create(N),Ee.set(d,p),d)y(d,_)&&(p[_]=u(d[_]))}return p}(s),Ee=null,s}var j={}.toString;function w(s){return j.call(s).slice(8,-1)}var J=typeof Symbol!="undefined"?Symbol.iterator:"@@iterator",te=typeof J=="symbol"?function(s){var u;return s!=null&&(u=s[J])&&u.apply(s)}:function(){return null};function ne(s,u){return u=s.indexOf(u),0<=u&&s.splice(u,1),0<=u}var se={};function me(s){var u,d,p,g;if(arguments.length===1){if(l(s))return s.slice();if(this===se&&typeof s=="string")return[s];if(g=te(s)){for(d=[];!(p=g.next()).done;)d.push(p.value);return d}if(s==null)return[s];if(typeof(u=s.length)!="number")return[s];for(d=new Array(u);u--;)d[u]=s[u];return d}for(u=arguments.length,d=new Array(u);u--;)d[u]=arguments[u];return d}var G=typeof Symbol!="undefined"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},et=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Dt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(et),D={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Q(s,u){this.name=s,this.message=u}function q(s,u){return s+". Errors: "+Object.keys(u).map(function(d){return u[d].toString()}).filter(function(d,p,g){return g.indexOf(d)===p}).join(`
27
- `)}function B(s,u,d,p){this.failures=u,this.failedKeys=p,this.successCount=d,this.message=q(s,u)}function W(s,u){this.name="BulkError",this.failures=Object.keys(u).map(function(d){return u[d]}),this.failuresByPos=u,this.message=q(s,this.failures)}E(Q).from(Error).extend({toString:function(){return this.name+": "+this.message}}),E(B).from(Q),E(W).from(Q);var ge=Dt.reduce(function(s,u){return s[u]=u+"Error",s},{}),ce=Q,oe=Dt.reduce(function(s,u){var d=u+"Error";function p(g,v){this.name=d,g?typeof g=="string"?(this.message="".concat(g).concat(v?`
28
- `+v:""),this.inner=v||null):typeof g=="object"&&(this.message="".concat(g.name," ").concat(g.message),this.inner=g):(this.message=D[u]||d,this.inner=null)}return E(p).from(ce),s[u]=p,s},{});oe.Syntax=SyntaxError,oe.Type=TypeError,oe.Range=RangeError;var Ce=et.reduce(function(s,u){return s[u+"Error"]=oe[u],s},{}),xe=Dt.reduce(function(s,u){return["Syntax","Type","Range"].indexOf(u)===-1&&(s[u+"Error"]=oe[u]),s},{});function we(){}function ct(s){return s}function Ze(s,u){return s==null||s===ct?u:function(d){return u(s(d))}}function We(s,u){return function(){s.apply(this,arguments),u.apply(this,arguments)}}function Pe(s,u){return s===we?u:function(){var d=s.apply(this,arguments);d!==void 0&&(arguments[0]=d);var p=this.onsuccess,g=this.onerror;this.onsuccess=null,this.onerror=null;var v=u.apply(this,arguments);return p&&(this.onsuccess=this.onsuccess?We(p,this.onsuccess):p),g&&(this.onerror=this.onerror?We(g,this.onerror):g),v!==void 0?v:d}}function Je(s,u){return s===we?u:function(){s.apply(this,arguments);var d=this.onsuccess,p=this.onerror;this.onsuccess=this.onerror=null,u.apply(this,arguments),d&&(this.onsuccess=this.onsuccess?We(d,this.onsuccess):d),p&&(this.onerror=this.onerror?We(p,this.onerror):p)}}function Ft(s,u){return s===we?u:function(d){var p=s.apply(this,arguments);c(d,p);var g=this.onsuccess,v=this.onerror;return this.onsuccess=null,this.onerror=null,d=u.apply(this,arguments),g&&(this.onsuccess=this.onsuccess?We(g,this.onsuccess):g),v&&(this.onerror=this.onerror?We(v,this.onerror):v),p===void 0?d===void 0?void 0:d:c(p,d)}}function V(s,u){return s===we?u:function(){return u.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function qe(s,u){return s===we?u:function(){var d=s.apply(this,arguments);if(d&&typeof d.then=="function"){for(var p=this,g=arguments.length,v=new Array(g);g--;)v[g]=arguments[g];return d.then(function(){return u.apply(p,v)})}return u.apply(this,arguments)}}xe.ModifyError=B,xe.DexieError=Q,xe.BulkError=W;var pe=typeof location!="undefined"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function je(s){pe=s}var Ye={},dt=100,Ut=typeof Promise=="undefined"?[]:function(){var s=Promise.resolve();if(typeof crypto=="undefined"||!crypto.subtle)return[s,f(s),s];var u=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[u,f(u),s]}(),et=Ut[0],Dt=Ut[1],Ut=Ut[2],Dt=Dt&&Dt.then,It=et&&et.constructor,ps=!!Ut,Cr=function(s,u){xr.push([s,u]),Si&&(queueMicrotask(jm),Si=!1)},ms=!0,Si=!0,Tn=[],Ai=[],gs=ct,hn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:we,pgp:!1,env:{},finalize:we},Te=hn,xr=[],Cn=0,Ei=[];function Se(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var u=this._PSD=Te;if(typeof s!="function"){if(s!==Ye)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&vs(this,this._value))}this._state=null,this._value=null,++u.ref,function d(p,g){try{g(function(v){if(p._state===null){if(v===p)throw new TypeError("A promise cannot be resolved with itself.");var _=p._lib&&er();v&&typeof v.then=="function"?d(p,function(N,P){v instanceof Se?v._then(N,P):v.then(N,P)}):(p._state=!0,p._value=v,Il(p)),_&&tr()}},vs.bind(null,p))}catch(v){vs(p,v)}}(this,s)}var ys={get:function(){var s=Te,u=Ri;function d(p,g){var v=this,_=!s.global&&(s!==Te||u!==Ri),N=_&&!mn(),P=new Se(function(L,U){bs(v,new Fl(Ll(p,s,_,N),Ll(g,s,_,N),L,U,s))});return this._consoleTask&&(P._consoleTask=this._consoleTask),P}return d.prototype=Ye,d},set:function(s){A(this,"then",s&&s.prototype===Ye?ys:{get:function(){return s},set:ys.set})}};function Fl(s,u,d,p,g){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof u=="function"?u:null,this.resolve=d,this.reject=p,this.psd=g}function vs(s,u){var d,p;Ai.push(u),s._state===null&&(d=s._lib&&er(),u=gs(u),s._state=!1,s._value=u,p=s,Tn.some(function(g){return g._value===p._value})||Tn.push(p),Il(s),d&&tr())}function Il(s){var u=s._listeners;s._listeners=[];for(var d=0,p=u.length;d<p;++d)bs(s,u[d]);var g=s._PSD;--g.ref||g.finalize(),Cn===0&&(++Cn,Cr(function(){--Cn==0&&ks()},[]))}function bs(s,u){if(s._state!==null){var d=s._state?u.onFulfilled:u.onRejected;if(d===null)return(s._state?u.resolve:u.reject)(s._value);++u.psd.ref,++Cn,Cr($m,[d,s,u])}else s._listeners.push(u)}function $m(s,u,d){try{var p,g=u._value;!u._state&&Ai.length&&(Ai=[]),p=pe&&u._consoleTask?u._consoleTask.run(function(){return s(g)}):s(g),u._state||Ai.indexOf(g)!==-1||function(v){for(var _=Tn.length;_;)if(Tn[--_]._value===v._value)return Tn.splice(_,1)}(u),d.resolve(p)}catch(v){d.reject(v)}finally{--Cn==0&&ks(),--d.psd.ref||d.psd.finalize()}}function jm(){xn(hn,function(){er()&&tr()})}function er(){var s=ms;return Si=ms=!1,s}function tr(){var s,u,d;do for(;0<xr.length;)for(s=xr,xr=[],d=s.length,u=0;u<d;++u){var p=s[u];p[0].apply(null,p[1])}while(0<xr.length);Si=ms=!0}function ks(){var s=Tn;Tn=[],s.forEach(function(p){p._PSD.onunhandled.call(null,p._value,p)});for(var u=Ei.slice(0),d=u.length;d;)u[--d]()}function wi(s){return new Se(Ye,!1,s)}function nt(s,u){var d=Te;return function(){var p=er(),g=Te;try{return gn(d,!0),s.apply(this,arguments)}catch(v){u&&u(v)}finally{gn(g,!1),p&&tr()}}}m(Se.prototype,{then:ys,_then:function(s,u){bs(this,new Fl(null,null,s,u,Te))},catch:function(s){if(arguments.length===1)return this.then(null,s);var u=s,d=arguments[1];return typeof u=="function"?this.then(null,function(p){return(p instanceof u?d:wi)(p)}):this.then(null,function(p){return(p&&p.name===u?d:wi)(p)})},finally:function(s){return this.then(function(u){return Se.resolve(s()).then(function(){return u})},function(u){return Se.resolve(s()).then(function(){return wi(u)})})},timeout:function(s,u){var d=this;return s<1/0?new Se(function(p,g){var v=setTimeout(function(){return g(new oe.Timeout(u))},s);d.then(p,g).finally(clearTimeout.bind(null,v))}):this}}),typeof Symbol!="undefined"&&Symbol.toStringTag&&A(Se.prototype,Symbol.toStringTag,"Dexie.Promise"),hn.env=Dl(),m(Se,{all:function(){var s=me.apply(null,arguments).map(Ti);return new Se(function(u,d){s.length===0&&u([]);var p=s.length;s.forEach(function(g,v){return Se.resolve(g).then(function(_){s[v]=_,--p||u(s)},d)})})},resolve:function(s){return s instanceof Se?s:s&&typeof s.then=="function"?new Se(function(u,d){s.then(u,d)}):new Se(Ye,!0,s)},reject:wi,race:function(){var s=me.apply(null,arguments).map(Ti);return new Se(function(u,d){s.map(function(p){return Se.resolve(p).then(u,d)})})},PSD:{get:function(){return Te},set:function(s){return Te=s}},totalEchoes:{get:function(){return Ri}},newPSD:pn,usePSD:xn,scheduler:{get:function(){return Cr},set:function(s){Cr=s}},rejectionMapper:{get:function(){return gs},set:function(s){gs=s}},follow:function(s,u){return new Se(function(d,p){return pn(function(g,v){var _=Te;_.unhandleds=[],_.onunhandled=v,_.finalize=We(function(){var N,P=this;N=function(){P.unhandleds.length===0?g():v(P.unhandleds[0])},Ei.push(function L(){N(),Ei.splice(Ei.indexOf(L),1)}),++Cn,Cr(function(){--Cn==0&&ks()},[])},_.finalize),s()},u,d,p)})}}),It&&(It.allSettled&&A(Se,"allSettled",function(){var s=me.apply(null,arguments).map(Ti);return new Se(function(u){s.length===0&&u([]);var d=s.length,p=new Array(d);s.forEach(function(g,v){return Se.resolve(g).then(function(_){return p[v]={status:"fulfilled",value:_}},function(_){return p[v]={status:"rejected",reason:_}}).then(function(){return--d||u(p)})})})}),It.any&&typeof AggregateError!="undefined"&&A(Se,"any",function(){var s=me.apply(null,arguments).map(Ti);return new Se(function(u,d){s.length===0&&d(new AggregateError([]));var p=s.length,g=new Array(p);s.forEach(function(v,_){return Se.resolve(v).then(function(N){return u(N)},function(N){g[_]=N,--p||d(new AggregateError(g))})})})}),It.withResolvers&&(Se.withResolvers=It.withResolvers));var ft={awaits:0,echoes:0,id:0},Bm=0,Ni=[],Oi=0,Ri=0,Mm=0;function pn(s,u,d,p){var g=Te,v=Object.create(g);return v.parent=g,v.ref=0,v.global=!1,v.id=++Mm,hn.env,v.env=ps?{Promise:Se,PromiseProp:{value:Se,configurable:!0,writable:!0},all:Se.all,race:Se.race,allSettled:Se.allSettled,any:Se.any,resolve:Se.resolve,reject:Se.reject}:{},u&&c(v,u),++g.ref,v.finalize=function(){--this.parent.ref||this.parent.finalize()},p=xn(v,s,d,p),v.ref===0&&v.finalize(),p}function nr(){return ft.id||(ft.id=++Bm),++ft.awaits,ft.echoes+=dt,ft.id}function mn(){return!!ft.awaits&&(--ft.awaits==0&&(ft.id=0),ft.echoes=ft.awaits*dt,!0)}function Ti(s){return ft.echoes&&s&&s.constructor===It?(nr(),s.then(function(u){return mn(),u},function(u){return mn(),at(u)})):s}function Um(){var s=Ni[Ni.length-1];Ni.pop(),gn(s,!1)}function gn(s,u){var d,p=Te;(u?!ft.echoes||Oi++&&s===Te:!Oi||--Oi&&s===Te)||queueMicrotask(u?function(g){++Ri,ft.echoes&&--ft.echoes!=0||(ft.echoes=ft.awaits=ft.id=0),Ni.push(Te),gn(g,!0)}.bind(null,s):Um),s!==Te&&(Te=s,p===hn&&(hn.env=Dl()),ps&&(d=hn.env.Promise,u=s.env,(p.global||s.global)&&(Object.defineProperty(a,"Promise",u.PromiseProp),d.all=u.all,d.race=u.race,d.resolve=u.resolve,d.reject=u.reject,u.allSettled&&(d.allSettled=u.allSettled),u.any&&(d.any=u.any))))}function Dl(){var s=a.Promise;return ps?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function xn(s,u,d,p,g){var v=Te;try{return gn(s,!0),u(d,p,g)}finally{gn(v,!1)}}function Ll(s,u,d,p){return typeof s!="function"?s:function(){var g=Te;d&&nr(),gn(u,!0);try{return s.apply(this,arguments)}finally{gn(g,!1),p&&queueMicrotask(mn)}}}function _s(s){Promise===It&&ft.echoes===0?Oi===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+Dt).indexOf("[native code]")===-1&&(nr=mn=we);var at=Se.reject,Pn="￿",rn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",$l="String expected.",rr=[],Ci="__dbnames",Ss="readonly",As="readwrite";function Fn(s,u){return s?u?function(){return s.apply(this,arguments)&&u.apply(this,arguments)}:s:u}var jl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function xi(s){return typeof s!="string"||/\./.test(s)?function(u){return u}:function(u){return u[s]===void 0&&s in u&&delete(u=le(u))[s],u}}function Bl(){throw oe.Type()}function He(s,u){try{var d=Ml(s),p=Ml(u);if(d!==p)return d==="Array"?1:p==="Array"?-1:d==="binary"?1:p==="binary"?-1:d==="string"?1:p==="string"?-1:d==="Date"?1:p!=="Date"?NaN:-1;switch(d){case"number":case"Date":case"string":return u<s?1:s<u?-1:0;case"binary":return function(g,v){for(var _=g.length,N=v.length,P=_<N?_:N,L=0;L<P;++L)if(g[L]!==v[L])return g[L]<v[L]?-1:1;return _===N?0:_<N?-1:1}(Ul(s),Ul(u));case"Array":return function(g,v){for(var _=g.length,N=v.length,P=_<N?_:N,L=0;L<P;++L){var U=He(g[L],v[L]);if(U!==0)return U}return _===N?0:_<N?-1:1}(s,u)}}catch{}return NaN}function Ml(s){var u=typeof s;return u!="object"?u:ArrayBuffer.isView(s)?"binary":(s=w(s),s==="ArrayBuffer"?"binary":s)}function Ul(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}var Vl=(tt.prototype._trans=function(s,u,d){var p=this._tx||Te.trans,g=this.name,v=pe&&typeof console!="undefined"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function _(L,U,T){if(!T.schema[g])throw new oe.NotFound("Table "+g+" not part of transaction");return u(T.idbtrans,T)}var N=er();try{var P=p&&p.db._novip===this.db._novip?p===Te.trans?p._promise(s,_,d):pn(function(){return p._promise(s,_,d)},{trans:p,transless:Te.transless||Te}):function L(U,T,K,F){if(U.idbdb&&(U._state.openComplete||Te.letThrough||U._vip)){var M=U._createTransaction(T,K,U._dbSchema);try{M.create(),U._state.PR1398_maxLoop=3}catch(H){return H.name===ge.InvalidState&&U.isOpen()&&0<--U._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),U.close({disableAutoOpen:!1}),U.open().then(function(){return L(U,T,K,F)})):at(H)}return M._promise(T,function(H,$){return pn(function(){return Te.trans=M,F(H,$,M)})}).then(function(H){if(T==="readwrite")try{M.idbtrans.commit()}catch{}return T==="readonly"?H:M._completion.then(function(){return H})})}if(U._state.openComplete)return at(new oe.DatabaseClosed(U._state.dbOpenError));if(!U._state.isBeingOpened){if(!U._state.autoOpen)return at(new oe.DatabaseClosed);U.open().catch(we)}return U._state.dbReadyPromise.then(function(){return L(U,T,K,F)})}(this.db,s,[this.name],_);return v&&(P._consoleTask=v,P=P.catch(function(L){return console.trace(L),at(L)})),P}finally{N&&tr()}},tt.prototype.get=function(s,u){var d=this;return s&&s.constructor===Object?this.where(s).first(u):s==null?at(new oe.Type("Invalid argument to Table.get()")):this._trans("readonly",function(p){return d.core.get({trans:p,key:s}).then(function(g){return d.hook.reading.fire(g)})}).then(u)},tt.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(l(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var u=o(s);if(u.length===1)return this.where(u[0]).equals(s[u[0]]);var d=this.schema.indexes.concat(this.schema.primKey).filter(function(N){if(N.compound&&u.every(function(L){return 0<=N.keyPath.indexOf(L)})){for(var P=0;P<u.length;++P)if(u.indexOf(N.keyPath[P])===-1)return!1;return!0}return!1}).sort(function(N,P){return N.keyPath.length-P.keyPath.length})[0];if(d&&this.db._maxKey!==Pn){var v=d.keyPath.slice(0,u.length);return this.where(v).equals(v.map(function(P){return s[P]}))}!d&&pe&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(u.join("+"),"]"));var p=this.schema.idxByName;function g(N,P){return He(N,P)===0}var _=u.reduce(function(T,P){var L=T[0],U=T[1],T=p[P],K=s[P];return[L||T,L||!T?Fn(U,T&&T.multi?function(F){return F=z(F,P),l(F)&&F.some(function(M){return g(K,M)})}:function(F){return g(K,z(F,P))}):U]},[null,null]),v=_[0],_=_[1];return v?this.where(v.name).equals(s[v.keyPath]).filter(_):d?this.filter(_):this.where(u).equals("")},tt.prototype.filter=function(s){return this.toCollection().and(s)},tt.prototype.count=function(s){return this.toCollection().count(s)},tt.prototype.offset=function(s){return this.toCollection().offset(s)},tt.prototype.limit=function(s){return this.toCollection().limit(s)},tt.prototype.each=function(s){return this.toCollection().each(s)},tt.prototype.toArray=function(s){return this.toCollection().toArray(s)},tt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},tt.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,l(s)?"[".concat(s.join("+"),"]"):s))},tt.prototype.reverse=function(){return this.toCollection().reverse()},tt.prototype.mapToClass=function(s){var u,d=this.db,p=this.name;function g(){return u!==null&&u.apply(this,arguments)||this}(this.schema.mappedClass=s).prototype instanceof Bl&&(function(P,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");function U(){this.constructor=P}n(P,L),P.prototype=L===null?Object.create(L):(U.prototype=L.prototype,new U)}(g,u=s),Object.defineProperty(g.prototype,"db",{get:function(){return d},enumerable:!1,configurable:!0}),g.prototype.table=function(){return p},s=g);for(var v=new Set,_=s.prototype;_;_=f(_))Object.getOwnPropertyNames(_).forEach(function(P){return v.add(P)});function N(P){if(!P)return P;var L,U=Object.create(s.prototype);for(L in P)if(!v.has(L))try{U[L]=P[L]}catch{}return U}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),s},tt.prototype.defineClass=function(){return this.mapToClass(function(s){c(this,s)})},tt.prototype.add=function(s,u){var d=this,p=this.schema.primKey,g=p.auto,v=p.keyPath,_=s;return v&&g&&(_=xi(v)(s)),this._trans("readwrite",function(N){return d.core.mutate({trans:N,type:"add",keys:u!=null?[u]:null,values:[_]})}).then(function(N){return N.numFailures?Se.reject(N.failures[0]):N.lastResult}).then(function(N){if(v)try{I(s,v,N)}catch{}return N})},tt.prototype.update=function(s,u){return typeof s!="object"||l(s)?this.where(":id").equals(s).modify(u):(s=z(s,this.schema.primKey.keyPath),s===void 0?at(new oe.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(u))},tt.prototype.put=function(s,u){var d=this,p=this.schema.primKey,g=p.auto,v=p.keyPath,_=s;return v&&g&&(_=xi(v)(s)),this._trans("readwrite",function(N){return d.core.mutate({trans:N,type:"put",values:[_],keys:u!=null?[u]:null})}).then(function(N){return N.numFailures?Se.reject(N.failures[0]):N.lastResult}).then(function(N){if(v)try{I(s,v,N)}catch{}return N})},tt.prototype.delete=function(s){var u=this;return this._trans("readwrite",function(d){return u.core.mutate({trans:d,type:"delete",keys:[s]})}).then(function(d){return d.numFailures?Se.reject(d.failures[0]):void 0})},tt.prototype.clear=function(){var s=this;return this._trans("readwrite",function(u){return s.core.mutate({trans:u,type:"deleteRange",range:jl})}).then(function(u){return u.numFailures?Se.reject(u.failures[0]):void 0})},tt.prototype.bulkGet=function(s){var u=this;return this._trans("readonly",function(d){return u.core.getMany({keys:s,trans:d}).then(function(p){return p.map(function(g){return u.hook.reading.fire(g)})})})},tt.prototype.bulkAdd=function(s,u,d){var p=this,g=Array.isArray(u)?u:void 0,v=(d=d||(g?void 0:u))?d.allKeys:void 0;return this._trans("readwrite",function(_){var L=p.schema.primKey,N=L.auto,L=L.keyPath;if(L&&g)throw new oe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(g&&g.length!==s.length)throw new oe.InvalidArgument("Arguments objects and keys must have the same length");var P=s.length,L=L&&N?s.map(xi(L)):s;return p.core.mutate({trans:_,type:"add",keys:g,values:L,wantResults:v}).then(function(M){var T=M.numFailures,K=M.results,F=M.lastResult,M=M.failures;if(T===0)return v?K:F;throw new W("".concat(p.name,".bulkAdd(): ").concat(T," of ").concat(P," operations failed"),M)})})},tt.prototype.bulkPut=function(s,u,d){var p=this,g=Array.isArray(u)?u:void 0,v=(d=d||(g?void 0:u))?d.allKeys:void 0;return this._trans("readwrite",function(_){var L=p.schema.primKey,N=L.auto,L=L.keyPath;if(L&&g)throw new oe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(g&&g.length!==s.length)throw new oe.InvalidArgument("Arguments objects and keys must have the same length");var P=s.length,L=L&&N?s.map(xi(L)):s;return p.core.mutate({trans:_,type:"put",keys:g,values:L,wantResults:v}).then(function(M){var T=M.numFailures,K=M.results,F=M.lastResult,M=M.failures;if(T===0)return v?K:F;throw new W("".concat(p.name,".bulkPut(): ").concat(T," of ").concat(P," operations failed"),M)})})},tt.prototype.bulkUpdate=function(s){var u=this,d=this.core,p=s.map(function(_){return _.key}),g=s.map(function(_){return _.changes}),v=[];return this._trans("readwrite",function(_){return d.getMany({trans:_,keys:p,cache:"clone"}).then(function(N){var P=[],L=[];s.forEach(function(T,K){var F=T.key,M=T.changes,H=N[K];if(H){for(var $=0,Y=Object.keys(M);$<Y.length;$++){var X=Y[$],Z=M[X];if(X===u.schema.primKey.keyPath){if(He(Z,F)!==0)throw new oe.Constraint("Cannot update primary key in bulkUpdate()")}else I(H,X,Z)}v.push(K),P.push(F),L.push(H)}});var U=P.length;return d.mutate({trans:_,type:"put",keys:P,values:L,updates:{keys:p,changeSpecs:g}}).then(function(T){var K=T.numFailures,F=T.failures;if(K===0)return U;for(var M=0,H=Object.keys(F);M<H.length;M++){var $,Y=H[M],X=v[Number(Y)];X!=null&&($=F[Y],delete F[Y],F[X]=$)}throw new W("".concat(u.name,".bulkUpdate(): ").concat(K," of ").concat(U," operations failed"),F)})})})},tt.prototype.bulkDelete=function(s){var u=this,d=s.length;return this._trans("readwrite",function(p){return u.core.mutate({trans:p,type:"delete",keys:s})}).then(function(_){var g=_.numFailures,v=_.lastResult,_=_.failures;if(g===0)return v;throw new W("".concat(u.name,".bulkDelete(): ").concat(g," of ").concat(d," operations failed"),_)})},tt);function tt(){}function Pr(s){function u(_,N){if(N){for(var P=arguments.length,L=new Array(P-1);--P;)L[P-1]=arguments[P];return d[_].subscribe.apply(null,L),s}if(typeof _=="string")return d[_]}var d={};u.addEventType=v;for(var p=1,g=arguments.length;p<g;++p)v(arguments[p]);return u;function v(_,N,P){if(typeof _!="object"){var L;N=N||V;var U={subscribers:[],fire:P=P||we,subscribe:function(T){U.subscribers.indexOf(T)===-1&&(U.subscribers.push(T),U.fire=N(U.fire,T))},unsubscribe:function(T){U.subscribers=U.subscribers.filter(function(K){return K!==T}),U.fire=U.subscribers.reduce(N,P)}};return d[_]=u[_]=U}o(L=_).forEach(function(T){var K=L[T];if(l(K))v(T,L[T][0],L[T][1]);else{if(K!=="asap")throw new oe.InvalidArgument("Invalid event config");var F=v(T,ct,function(){for(var M=arguments.length,H=new Array(M);M--;)H[M]=arguments[M];F.subscribers.forEach(function($){x(function(){$.apply(null,H)})})})}})}}function Fr(s,u){return E(u).from({prototype:s}),u}function ir(s,u){return!(s.filter||s.algorithm||s.or)&&(u?s.justLimit:!s.replayFilter)}function Es(s,u){s.filter=Fn(s.filter,u)}function ws(s,u,d){var p=s.replayFilter;s.replayFilter=p?function(){return Fn(p(),u())}:u,s.justLimit=d&&!p}function Pi(s,u){if(s.isPrimKey)return u.primaryKey;var d=u.getIndexByKeyPath(s.index);if(!d)throw new oe.Schema("KeyPath "+s.index+" on object store "+u.name+" is not indexed");return d}function ql(s,u,d){var p=Pi(s,u.schema);return u.openCursor({trans:d,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:p,range:s.range}})}function Fi(s,u,d,p){var g=s.replayFilter?Fn(s.filter,s.replayFilter()):s.filter;if(s.or){var v={},_=function(N,P,L){var U,T;g&&!g(P,L,function(K){return P.stop(K)},function(K){return P.fail(K)})||((T=""+(U=P.primaryKey))=="[object ArrayBuffer]"&&(T=""+new Uint8Array(U)),y(v,T)||(v[T]=!0,u(N,P,L)))};return Promise.all([s.or._iterate(_,d),Hl(ql(s,p,d),s.algorithm,_,!s.keysOnly&&s.valueMapper)])}return Hl(ql(s,p,d),Fn(s.algorithm,g),u,!s.keysOnly&&s.valueMapper)}function Hl(s,u,d,p){var g=nt(p?function(v,_,N){return d(p(v),_,N)}:d);return s.then(function(v){if(v)return v.start(function(){var _=function(){return v.continue()};u&&!u(v,function(N){return _=N},function(N){v.stop(N),_=we},function(N){v.fail(N),_=we})||g(v.value,v,function(N){return _=N}),_()})})}var Ir=(Kl.prototype.execute=function(s){var u=this["@@propmod"];if(u.add!==void 0){var d=u.add;if(l(d))return i(i([],l(s)?s:[],!0),d).sort();if(typeof d=="number")return(Number(s)||0)+d;if(typeof d=="bigint")try{return BigInt(s)+d}catch{return BigInt(0)+d}throw new TypeError("Invalid term ".concat(d))}if(u.remove!==void 0){var p=u.remove;if(l(p))return l(s)?s.filter(function(g){return!p.includes(g)}).sort():[];if(typeof p=="number")return Number(s)-p;if(typeof p=="bigint")try{return BigInt(s)-p}catch{return BigInt(0)-p}throw new TypeError("Invalid subtrahend ".concat(p))}return d=(d=u.replacePrefix)===null||d===void 0?void 0:d[0],d&&typeof s=="string"&&s.startsWith(d)?u.replacePrefix[1]+s.substring(d.length):s},Kl);function Kl(s){this["@@propmod"]=s}var Vm=(Ke.prototype._read=function(s,u){var d=this._ctx;return d.error?d.table._trans(null,at.bind(null,d.error)):d.table._trans("readonly",s).then(u)},Ke.prototype._write=function(s){var u=this._ctx;return u.error?u.table._trans(null,at.bind(null,u.error)):u.table._trans("readwrite",s,"locked")},Ke.prototype._addAlgorithm=function(s){var u=this._ctx;u.algorithm=Fn(u.algorithm,s)},Ke.prototype._iterate=function(s,u){return Fi(this._ctx,s,u,this._ctx.table.core)},Ke.prototype.clone=function(s){var u=Object.create(this.constructor.prototype),d=Object.create(this._ctx);return s&&c(d,s),u._ctx=d,u},Ke.prototype.raw=function(){return this._ctx.valueMapper=null,this},Ke.prototype.each=function(s){var u=this._ctx;return this._read(function(d){return Fi(u,s,d,u.table.core)})},Ke.prototype.count=function(s){var u=this;return this._read(function(d){var p=u._ctx,g=p.table.core;if(ir(p,!0))return g.count({trans:d,query:{index:Pi(p,g.schema),range:p.range}}).then(function(_){return Math.min(_,p.limit)});var v=0;return Fi(p,function(){return++v,!1},d,g).then(function(){return v})}).then(s)},Ke.prototype.sortBy=function(s,u){var d=s.split(".").reverse(),p=d[0],g=d.length-1;function v(P,L){return L?v(P[d[L]],L-1):P[p]}var _=this._ctx.dir==="next"?1:-1;function N(P,L){return He(v(P,g),v(L,g))*_}return this.toArray(function(P){return P.sort(N)}).then(u)},Ke.prototype.toArray=function(s){var u=this;return this._read(function(d){var p=u._ctx;if(p.dir==="next"&&ir(p,!0)&&0<p.limit){var g=p.valueMapper,v=Pi(p,p.table.core.schema);return p.table.core.query({trans:d,limit:p.limit,values:!0,query:{index:v,range:p.range}}).then(function(N){return N=N.result,g?N.map(g):N})}var _=[];return Fi(p,function(N){return _.push(N)},d,p.table.core).then(function(){return _})},s)},Ke.prototype.offset=function(s){var u=this._ctx;return s<=0||(u.offset+=s,ir(u)?ws(u,function(){var d=s;return function(p,g){return d===0||(d===1?--d:g(function(){p.advance(d),d=0}),!1)}}):ws(u,function(){var d=s;return function(){return--d<0}})),this},Ke.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),ws(this._ctx,function(){var u=s;return function(d,p,g){return--u<=0&&p(g),0<=u}},!0),this},Ke.prototype.until=function(s,u){return Es(this._ctx,function(d,p,g){return!s(d.value)||(p(g),u)}),this},Ke.prototype.first=function(s){return this.limit(1).toArray(function(u){return u[0]}).then(s)},Ke.prototype.last=function(s){return this.reverse().first(s)},Ke.prototype.filter=function(s){var u;return Es(this._ctx,function(d){return s(d.value)}),(u=this._ctx).isMatch=Fn(u.isMatch,s),this},Ke.prototype.and=function(s){return this.filter(s)},Ke.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},Ke.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Ke.prototype.desc=function(){return this.reverse()},Ke.prototype.eachKey=function(s){var u=this._ctx;return u.keysOnly=!u.isMatch,this.each(function(d,p){s(p.key,p)})},Ke.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},Ke.prototype.eachPrimaryKey=function(s){var u=this._ctx;return u.keysOnly=!u.isMatch,this.each(function(d,p){s(p.primaryKey,p)})},Ke.prototype.keys=function(s){var u=this._ctx;u.keysOnly=!u.isMatch;var d=[];return this.each(function(p,g){d.push(g.key)}).then(function(){return d}).then(s)},Ke.prototype.primaryKeys=function(s){var u=this._ctx;if(u.dir==="next"&&ir(u,!0)&&0<u.limit)return this._read(function(p){var g=Pi(u,u.table.core.schema);return u.table.core.query({trans:p,values:!1,limit:u.limit,query:{index:g,range:u.range}})}).then(function(p){return p.result}).then(s);u.keysOnly=!u.isMatch;var d=[];return this.each(function(p,g){d.push(g.primaryKey)}).then(function(){return d}).then(s)},Ke.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},Ke.prototype.firstKey=function(s){return this.limit(1).keys(function(u){return u[0]}).then(s)},Ke.prototype.lastKey=function(s){return this.reverse().firstKey(s)},Ke.prototype.distinct=function(){var s=this._ctx,s=s.index&&s.table.schema.idxByName[s.index];if(!s||!s.multi)return this;var u={};return Es(this._ctx,function(g){var p=g.primaryKey.toString(),g=y(u,p);return u[p]=!0,!g}),this},Ke.prototype.modify=function(s){var u=this,d=this._ctx;return this._write(function(p){var g,v,_;_=typeof s=="function"?s:(g=o(s),v=g.length,function($){for(var Y=!1,X=0;X<v;++X){var Z=g[X],ae=s[Z],de=z($,Z);ae instanceof Ir?(I($,Z,ae.execute(de)),Y=!0):de!==ae&&(I($,Z,ae),Y=!0)}return Y});var N=d.table.core,T=N.schema.primaryKey,P=T.outbound,L=T.extractKey,U=200,T=u.db._options.modifyChunkSize;T&&(U=typeof T=="object"?T[N.name]||T["*"]||200:T);function K($,Z){var X=Z.failures,Z=Z.numFailures;M+=$-Z;for(var ae=0,de=o(X);ae<de.length;ae++){var be=de[ae];F.push(X[be])}}var F=[],M=0,H=[];return u.clone().primaryKeys().then(function($){function Y(Z){var ae=Math.min(U,$.length-Z);return N.getMany({trans:p,keys:$.slice(Z,Z+ae),cache:"immutable"}).then(function(de){for(var be=[],fe=[],ye=P?[]:null,_e=[],ve=0;ve<ae;++ve){var Ne=de[ve],Le={value:le(Ne),primKey:$[Z+ve]};_.call(Le,Le.value,Le)!==!1&&(Le.value==null?_e.push($[Z+ve]):P||He(L(Ne),L(Le.value))===0?(fe.push(Le.value),P&&ye.push($[Z+ve])):(_e.push($[Z+ve]),be.push(Le.value)))}return Promise.resolve(0<be.length&&N.mutate({trans:p,type:"add",values:be}).then(function(Be){for(var Me in Be.failures)_e.splice(parseInt(Me),1);K(be.length,Be)})).then(function(){return(0<fe.length||X&&typeof s=="object")&&N.mutate({trans:p,type:"put",keys:ye,values:fe,criteria:X,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<Z}).then(function(Be){return K(fe.length,Be)})}).then(function(){return(0<_e.length||X&&s===Ns)&&N.mutate({trans:p,type:"delete",keys:_e,criteria:X,isAdditionalChunk:0<Z}).then(function(Be){return K(_e.length,Be)})}).then(function(){return $.length>Z+ae&&Y(Z+U)})})}var X=ir(d)&&d.limit===1/0&&(typeof s!="function"||s===Ns)&&{index:d.index,range:d.range};return Y(0).then(function(){if(0<F.length)throw new B("Error modifying one or more objects",F,M,H);return $.length})})})},Ke.prototype.delete=function(){var s=this._ctx,u=s.range;return ir(s)&&(s.isPrimKey||u.type===3)?this._write(function(d){var p=s.table.core.schema.primaryKey,g=u;return s.table.core.count({trans:d,query:{index:p,range:g}}).then(function(v){return s.table.core.mutate({trans:d,type:"deleteRange",range:g}).then(function(_){var N=_.failures;if(_.lastResult,_.results,_=_.numFailures,_)throw new B("Could not delete some values",Object.keys(N).map(function(P){return N[P]}),v-_);return v-_})})}):this.modify(Ns)},Ke);function Ke(){}var Ns=function(s,u){return u.value=null};function qm(s,u){return s<u?-1:s===u?0:1}function Hm(s,u){return u<s?-1:s===u?0:1}function Nt(s,u,d){return s=s instanceof Gl?new s.Collection(s):s,s._ctx.error=new(d||TypeError)(u),s}function ar(s){return new s.Collection(s,function(){return zl("")}).limit(0)}function Ii(s,u,d,p){var g,v,_,N,P,L,U,T=d.length;if(!d.every(function(M){return typeof M=="string"}))return Nt(s,$l);function K(M){g=M==="next"?function($){return $.toUpperCase()}:function($){return $.toLowerCase()},v=M==="next"?function($){return $.toLowerCase()}:function($){return $.toUpperCase()},_=M==="next"?qm:Hm;var H=d.map(function($){return{lower:v($),upper:g($)}}).sort(function($,Y){return _($.lower,Y.lower)});N=H.map(function($){return $.upper}),P=H.map(function($){return $.lower}),U=(L=M)==="next"?"":p}K("next"),s=new s.Collection(s,function(){return yn(N[0],P[T-1]+p)}),s._ondirectionchange=function(M){K(M)};var F=0;return s._addAlgorithm(function(M,H,$){var Y=M.key;if(typeof Y!="string")return!1;var X=v(Y);if(u(X,P,F))return!0;for(var Z=null,ae=F;ae<T;++ae){var de=function(be,fe,ye,_e,ve,Ne){for(var Le=Math.min(be.length,_e.length),Be=-1,Me=0;Me<Le;++Me){var Ot=fe[Me];if(Ot!==_e[Me])return ve(be[Me],ye[Me])<0?be.substr(0,Me)+ye[Me]+ye.substr(Me+1):ve(be[Me],_e[Me])<0?be.substr(0,Me)+_e[Me]+ye.substr(Me+1):0<=Be?be.substr(0,Be)+fe[Be]+ye.substr(Be+1):null;ve(be[Me],Ot)<0&&(Be=Me)}return Le<_e.length&&Ne==="next"?be+ye.substr(be.length):Le<be.length&&Ne==="prev"?be.substr(0,ye.length):Be<0?null:be.substr(0,Be)+_e[Be]+ye.substr(Be+1)}(Y,X,N[ae],P[ae],_,L);de===null&&Z===null?F=ae+1:(Z===null||0<_(Z,de))&&(Z=de)}return H(Z!==null?function(){M.continue(Z+U)}:$),!1}),s}function yn(s,u,d,p){return{type:2,lower:s,upper:u,lowerOpen:d,upperOpen:p}}function zl(s){return{type:1,lower:s,upper:s}}var Gl=(Object.defineProperty(ht.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),ht.prototype.between=function(s,u,d,p){d=d!==!1,p=p===!0;try{return 0<this._cmp(s,u)||this._cmp(s,u)===0&&(d||p)&&(!d||!p)?ar(this):new this.Collection(this,function(){return yn(s,u,!d,!p)})}catch{return Nt(this,rn)}},ht.prototype.equals=function(s){return s==null?Nt(this,rn):new this.Collection(this,function(){return zl(s)})},ht.prototype.above=function(s){return s==null?Nt(this,rn):new this.Collection(this,function(){return yn(s,void 0,!0)})},ht.prototype.aboveOrEqual=function(s){return s==null?Nt(this,rn):new this.Collection(this,function(){return yn(s,void 0,!1)})},ht.prototype.below=function(s){return s==null?Nt(this,rn):new this.Collection(this,function(){return yn(void 0,s,!1,!0)})},ht.prototype.belowOrEqual=function(s){return s==null?Nt(this,rn):new this.Collection(this,function(){return yn(void 0,s)})},ht.prototype.startsWith=function(s){return typeof s!="string"?Nt(this,$l):this.between(s,s+Pn,!0,!0)},ht.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):Ii(this,function(u,d){return u.indexOf(d[0])===0},[s],Pn)},ht.prototype.equalsIgnoreCase=function(s){return Ii(this,function(u,d){return u===d[0]},[s],"")},ht.prototype.anyOfIgnoreCase=function(){var s=me.apply(se,arguments);return s.length===0?ar(this):Ii(this,function(u,d){return d.indexOf(u)!==-1},s,"")},ht.prototype.startsWithAnyOfIgnoreCase=function(){var s=me.apply(se,arguments);return s.length===0?ar(this):Ii(this,function(u,d){return d.some(function(p){return u.indexOf(p)===0})},s,Pn)},ht.prototype.anyOf=function(){var s=this,u=me.apply(se,arguments),d=this._cmp;try{u.sort(d)}catch{return Nt(this,rn)}if(u.length===0)return ar(this);var p=new this.Collection(this,function(){return yn(u[0],u[u.length-1])});p._ondirectionchange=function(v){d=v==="next"?s._ascending:s._descending,u.sort(d)};var g=0;return p._addAlgorithm(function(v,_,N){for(var P=v.key;0<d(P,u[g]);)if(++g===u.length)return _(N),!1;return d(P,u[g])===0||(_(function(){v.continue(u[g])}),!1)}),p},ht.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},ht.prototype.noneOf=function(){var s=me.apply(se,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return Nt(this,rn)}var u=s.reduce(function(d,p){return d?d.concat([[d[d.length-1][1],p]]):[[-1/0,p]]},null);return u.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(u,{includeLowers:!1,includeUppers:!1})},ht.prototype.inAnyRange=function(Y,u){var d=this,p=this._cmp,g=this._ascending,v=this._descending,_=this._min,N=this._max;if(Y.length===0)return ar(this);if(!Y.every(function(X){return X[0]!==void 0&&X[1]!==void 0&&g(X[0],X[1])<=0}))return Nt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",oe.InvalidArgument);var P=!u||u.includeLowers!==!1,L=u&&u.includeUppers===!0,U,T=g;function K(X,Z){return T(X[0],Z[0])}try{(U=Y.reduce(function(X,Z){for(var ae=0,de=X.length;ae<de;++ae){var be=X[ae];if(p(Z[0],be[1])<0&&0<p(Z[1],be[0])){be[0]=_(be[0],Z[0]),be[1]=N(be[1],Z[1]);break}}return ae===de&&X.push(Z),X},[])).sort(K)}catch{return Nt(this,rn)}var F=0,M=L?function(X){return 0<g(X,U[F][1])}:function(X){return 0<=g(X,U[F][1])},H=P?function(X){return 0<v(X,U[F][0])}:function(X){return 0<=v(X,U[F][0])},$=M,Y=new this.Collection(this,function(){return yn(U[0][0],U[U.length-1][1],!P,!L)});return Y._ondirectionchange=function(X){T=X==="next"?($=M,g):($=H,v),U.sort(K)},Y._addAlgorithm(function(X,Z,ae){for(var de,be=X.key;$(be);)if(++F===U.length)return Z(ae),!1;return!M(de=be)&&!H(de)||(d._cmp(be,U[F][1])===0||d._cmp(be,U[F][0])===0||Z(function(){T===g?X.continue(U[F][0]):X.continue(U[F][1])}),!1)}),Y},ht.prototype.startsWithAnyOf=function(){var s=me.apply(se,arguments);return s.every(function(u){return typeof u=="string"})?s.length===0?ar(this):this.inAnyRange(s.map(function(u){return[u,u+Pn]})):Nt(this,"startsWithAnyOf() only works with strings")},ht);function ht(){}function Yt(s){return nt(function(u){return Dr(u),s(u.target.error),!1})}function Dr(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var Lr="storagemutated",Os="x-storagemutated-1",vn=Pr(null,Lr),Km=(Qt.prototype._lock=function(){return R(!Te.global),++this._reculock,this._reculock!==1||Te.global||(Te.lockOwnerFor=this),this},Qt.prototype._unlock=function(){if(R(!Te.global),--this._reculock==0)for(Te.global||(Te.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{xn(s[1],s[0])}catch{}}return this},Qt.prototype._locked=function(){return this._reculock&&Te.lockOwnerFor!==this},Qt.prototype.create=function(s){var u=this;if(!this.mode)return this;var d=this.db.idbdb,p=this.db._state.dbOpenError;if(R(!this.idbtrans),!s&&!d)switch(p&&p.name){case"DatabaseClosedError":throw new oe.DatabaseClosed(p);case"MissingAPIError":throw new oe.MissingAPI(p.message,p);default:throw new oe.OpenFailed(p)}if(!this.active)throw new oe.TransactionInactive;return R(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||d).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=nt(function(g){Dr(g),u._reject(s.error)}),s.onabort=nt(function(g){Dr(g),u.active&&u._reject(new oe.Abort(s.error)),u.active=!1,u.on("abort").fire(g)}),s.oncomplete=nt(function(){u.active=!1,u._resolve(),"mutatedParts"in s&&vn.storagemutated.fire(s.mutatedParts)}),this},Qt.prototype._promise=function(s,u,d){var p=this;if(s==="readwrite"&&this.mode!=="readwrite")return at(new oe.ReadOnly("Transaction is readonly"));if(!this.active)return at(new oe.TransactionInactive);if(this._locked())return new Se(function(v,_){p._blockedFuncs.push([function(){p._promise(s,u,d).then(v,_)},Te])});if(d)return pn(function(){var v=new Se(function(_,N){p._lock();var P=u(_,N,p);P&&P.then&&P.then(_,N)});return v.finally(function(){return p._unlock()}),v._lib=!0,v});var g=new Se(function(v,_){var N=u(v,_,p);N&&N.then&&N.then(v,_)});return g._lib=!0,g},Qt.prototype._root=function(){return this.parent?this.parent._root():this},Qt.prototype.waitFor=function(s){var u,d=this._root(),p=Se.resolve(s);d._waitingFor?d._waitingFor=d._waitingFor.then(function(){return p}):(d._waitingFor=p,d._waitingQueue=[],u=d.idbtrans.objectStore(d.storeNames[0]),function v(){for(++d._spinCount;d._waitingQueue.length;)d._waitingQueue.shift()();d._waitingFor&&(u.get(-1/0).onsuccess=v)}());var g=d._waitingFor;return new Se(function(v,_){p.then(function(N){return d._waitingQueue.push(nt(v.bind(null,N)))},function(N){return d._waitingQueue.push(nt(_.bind(null,N)))}).finally(function(){d._waitingFor===g&&(d._waitingFor=null)})})},Qt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new oe.Abort))},Qt.prototype.table=function(s){var u=this._memoizedTables||(this._memoizedTables={});if(y(u,s))return u[s];var d=this.schema[s];if(!d)throw new oe.NotFound("Table "+s+" not part of transaction");return d=new this.db.Table(s,d,this),d.core=this.db.core.table(s),u[s]=d},Qt);function Qt(){}function Rs(s,u,d,p,g,v,_){return{name:s,keyPath:u,unique:d,multi:p,auto:g,compound:v,src:(d&&!_?"&":"")+(p?"*":"")+(g?"++":"")+Wl(u)}}function Wl(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function Ts(s,u,d){return{name:s,primKey:u,indexes:d,mappedClass:null,idxByName:(p=function(g){return[g.name,g]},d.reduce(function(g,v,_){return _=p(v,_),_&&(g[_[0]]=_[1]),g},{}))};var p}var $r=function(s){try{return s.only([[]]),$r=function(){return[[]]},[[]]}catch{return $r=function(){return Pn},Pn}};function Cs(s){return s==null?function(){}:typeof s=="string"?(u=s).split(".").length===1?function(d){return d[u]}:function(d){return z(d,u)}:function(d){return z(d,s)};var u}function Jl(s){return[].slice.call(s)}var zm=0;function jr(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function Gm(s,u,P){function p($){if($.type===3)return null;if($.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var F=$.lower,M=$.upper,H=$.lowerOpen,$=$.upperOpen;return F===void 0?M===void 0?null:u.upperBound(M,!!$):M===void 0?u.lowerBound(F,!!H):u.bound(F,M,!!H,!!$)}function g(K){var F,M=K.name;return{name:M,schema:K,mutate:function(H){var $=H.trans,Y=H.type,X=H.keys,Z=H.values,ae=H.range;return new Promise(function(de,be){de=nt(de);var fe=$.objectStore(M),ye=fe.keyPath==null,_e=Y==="put"||Y==="add";if(!_e&&Y!=="delete"&&Y!=="deleteRange")throw new Error("Invalid operation type: "+Y);var ve,Ne=(X||Z||{length:1}).length;if(X&&Z&&X.length!==Z.length)throw new Error("Given keys array must have same length as given values array.");if(Ne===0)return de({numFailures:0,failures:{},results:[],lastResult:void 0});function Le(St){++Ot,Dr(St)}var Be=[],Me=[],Ot=0;if(Y==="deleteRange"){if(ae.type===4)return de({numFailures:Ot,failures:Me,results:[],lastResult:void 0});ae.type===3?Be.push(ve=fe.clear()):Be.push(ve=fe.delete(p(ae)))}else{var ye=_e?ye?[Z,X]:[Z,null]:[X,null],De=ye[0],vt=ye[1];if(_e)for(var bt=0;bt<Ne;++bt)Be.push(ve=vt&&vt[bt]!==void 0?fe[Y](De[bt],vt[bt]):fe[Y](De[bt])),ve.onerror=Le;else for(bt=0;bt<Ne;++bt)Be.push(ve=fe[Y](De[bt])),ve.onerror=Le}function Gi(St){St=St.target.result,Be.forEach(function(Ln,Ws){return Ln.error!=null&&(Me[Ws]=Ln.error)}),de({numFailures:Ot,failures:Me,results:Y==="delete"?X:Be.map(function(Ln){return Ln.result}),lastResult:St})}ve.onerror=function(St){Le(St),Gi(St)},ve.onsuccess=Gi})},getMany:function(H){var $=H.trans,Y=H.keys;return new Promise(function(X,Z){X=nt(X);for(var ae,de=$.objectStore(M),be=Y.length,fe=new Array(be),ye=0,_e=0,ve=function(Be){Be=Be.target,fe[Be._pos]=Be.result,++_e===ye&&X(fe)},Ne=Yt(Z),Le=0;Le<be;++Le)Y[Le]!=null&&((ae=de.get(Y[Le]))._pos=Le,ae.onsuccess=ve,ae.onerror=Ne,++ye);ye===0&&X(fe)})},get:function(H){var $=H.trans,Y=H.key;return new Promise(function(X,Z){X=nt(X);var ae=$.objectStore(M).get(Y);ae.onsuccess=function(de){return X(de.target.result)},ae.onerror=Yt(Z)})},query:(F=L,function(H){return new Promise(function($,Y){$=nt($);var X,Z,ae,ye=H.trans,de=H.values,be=H.limit,ve=H.query,fe=be===1/0?void 0:be,_e=ve.index,ve=ve.range,ye=ye.objectStore(M),_e=_e.isPrimaryKey?ye:ye.index(_e.name),ve=p(ve);if(be===0)return $({result:[]});F?((fe=de?_e.getAll(ve,fe):_e.getAllKeys(ve,fe)).onsuccess=function(Ne){return $({result:Ne.target.result})},fe.onerror=Yt(Y)):(X=0,Z=!de&&"openKeyCursor"in _e?_e.openKeyCursor(ve):_e.openCursor(ve),ae=[],Z.onsuccess=function(Ne){var Le=Z.result;return Le?(ae.push(de?Le.value:Le.primaryKey),++X===be?$({result:ae}):void Le.continue()):$({result:ae})},Z.onerror=Yt(Y))})}),openCursor:function(H){var $=H.trans,Y=H.values,X=H.query,Z=H.reverse,ae=H.unique;return new Promise(function(de,be){de=nt(de);var _e=X.index,fe=X.range,ye=$.objectStore(M),ye=_e.isPrimaryKey?ye:ye.index(_e.name),_e=Z?ae?"prevunique":"prev":ae?"nextunique":"next",ve=!Y&&"openKeyCursor"in ye?ye.openKeyCursor(p(fe),_e):ye.openCursor(p(fe),_e);ve.onerror=Yt(be),ve.onsuccess=nt(function(Ne){var Le,Be,Me,Ot,De=ve.result;De?(De.___id=++zm,De.done=!1,Le=De.continue.bind(De),Be=(Be=De.continuePrimaryKey)&&Be.bind(De),Me=De.advance.bind(De),Ot=function(){throw new Error("Cursor not stopped")},De.trans=$,De.stop=De.continue=De.continuePrimaryKey=De.advance=function(){throw new Error("Cursor not started")},De.fail=nt(be),De.next=function(){var vt=this,bt=1;return this.start(function(){return bt--?vt.continue():vt.stop()}).then(function(){return vt})},De.start=function(vt){function bt(){if(ve.result)try{vt()}catch(St){De.fail(St)}else De.done=!0,De.start=function(){throw new Error("Cursor behind last entry")},De.stop()}var Gi=new Promise(function(St,Ln){St=nt(St),ve.onerror=Yt(Ln),De.fail=Ln,De.stop=function(Ws){De.stop=De.continue=De.continuePrimaryKey=De.advance=Ot,St(Ws)}});return ve.onsuccess=nt(function(St){ve.onsuccess=bt,bt()}),De.continue=Le,De.continuePrimaryKey=Be,De.advance=Me,bt(),Gi},de(De)):de(null)},be)})},count:function(H){var $=H.query,Y=H.trans,X=$.index,Z=$.range;return new Promise(function(ae,de){var be=Y.objectStore(M),fe=X.isPrimaryKey?be:be.index(X.name),be=p(Z),fe=be?fe.count(be):fe.count();fe.onsuccess=nt(function(ye){return ae(ye.target.result)}),fe.onerror=Yt(de)})}}}var v,_,N,U=(_=P,N=Jl((v=s).objectStoreNames),{schema:{name:v.name,tables:N.map(function(K){return _.objectStore(K)}).map(function(K){var F=K.keyPath,$=K.autoIncrement,M=l(F),H={},$={name:K.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:F==null,compound:M,keyPath:F,autoIncrement:$,unique:!0,extractKey:Cs(F)},indexes:Jl(K.indexNames).map(function(Y){return K.index(Y)}).map(function(ae){var X=ae.name,Z=ae.unique,de=ae.multiEntry,ae=ae.keyPath,de={name:X,compound:l(ae),keyPath:ae,unique:Z,multiEntry:de,extractKey:Cs(ae)};return H[jr(ae)]=de}),getIndexByKeyPath:function(Y){return H[jr(Y)]}};return H[":id"]=$.primaryKey,F!=null&&(H[jr(F)]=$.primaryKey),$})},hasGetAll:0<N.length&&"getAll"in _.objectStore(N[0])&&!(typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),P=U.schema,L=U.hasGetAll,U=P.tables.map(g),T={};return U.forEach(function(K){return T[K.name]=K}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(K){if(!T[K])throw new Error("Table '".concat(K,"' not found"));return T[K]},MIN_KEY:-1/0,MAX_KEY:$r(u),schema:P}}function Wm(s,u,d,p){var g=d.IDBKeyRange;return d.indexedDB,{dbcore:(p=Gm(u,g,p),s.dbcore.reduce(function(v,_){return _=_.create,r(r({},v),_(v))},p))}}function Di(s,p){var d=p.db,p=Wm(s._middlewares,d,s._deps,p);s.core=p.dbcore,s.tables.forEach(function(g){var v=g.name;s.core.schema.tables.some(function(_){return _.name===v})&&(g.core=s.core.table(v),s[v]instanceof s.Table&&(s[v].core=g.core))})}function Li(s,u,d,p){d.forEach(function(g){var v=p[g];u.forEach(function(_){var N=function P(L,U){return b(L,U)||(L=f(L))&&P(L,U)}(_,g);(!N||"value"in N&&N.value===void 0)&&(_===s.Transaction.prototype||_ instanceof s.Transaction?A(_,g,{get:function(){return this.table(g)},set:function(P){O(this,g,{value:P,writable:!0,configurable:!0,enumerable:!0})}}):_[g]=new s.Table(g,v))})})}function xs(s,u){u.forEach(function(d){for(var p in d)d[p]instanceof s.Table&&delete d[p]})}function Jm(s,u){return s._cfg.version-u._cfg.version}function Ym(s,u,d,p){var g=s._dbSchema;d.objectStoreNames.contains("$meta")&&!g.$meta&&(g.$meta=Ts("$meta",Ql("")[0],[]),s._storeNames.push("$meta"));var v=s._createTransaction("readwrite",s._storeNames,g);v.create(d),v._completion.catch(p);var _=v._reject.bind(v),N=Te.transless||Te;pn(function(){return Te.trans=v,Te.transless=N,u!==0?(Di(s,d),L=u,((P=v).storeNames.includes("$meta")?P.table("$meta").get("version").then(function(U){return U!=null?U:L}):Se.resolve(L)).then(function(U){return K=U,F=v,M=d,H=[],U=(T=s)._versions,$=T._dbSchema=ji(0,T.idbdb,M),(U=U.filter(function(Y){return Y._cfg.version>=K})).length!==0?(U.forEach(function(Y){H.push(function(){var X=$,Z=Y._cfg.dbschema;Bi(T,X,M),Bi(T,Z,M),$=T._dbSchema=Z;var ae=Ps(X,Z);ae.add.forEach(function(_e){Fs(M,_e[0],_e[1].primKey,_e[1].indexes)}),ae.change.forEach(function(_e){if(_e.recreate)throw new oe.Upgrade("Not yet support for changing primary key");var ve=M.objectStore(_e.name);_e.add.forEach(function(Ne){return $i(ve,Ne)}),_e.change.forEach(function(Ne){ve.deleteIndex(Ne.name),$i(ve,Ne)}),_e.del.forEach(function(Ne){return ve.deleteIndex(Ne)})});var de=Y._cfg.contentUpgrade;if(de&&Y._cfg.version>K){Di(T,M),F._memoizedTables={};var be=re(Z);ae.del.forEach(function(_e){be[_e]=X[_e]}),xs(T,[T.Transaction.prototype]),Li(T,[T.Transaction.prototype],o(be),be),F.schema=be;var fe,ye=G(de);return ye&&nr(),ae=Se.follow(function(){var _e;(fe=de(F))&&ye&&(_e=mn.bind(null,null),fe.then(_e,_e))}),fe&&typeof fe.then=="function"?Se.resolve(fe):ae.then(function(){return fe})}}),H.push(function(X){var Z,ae,de=Y._cfg.dbschema;Z=de,ae=X,[].slice.call(ae.db.objectStoreNames).forEach(function(be){return Z[be]==null&&ae.db.deleteObjectStore(be)}),xs(T,[T.Transaction.prototype]),Li(T,[T.Transaction.prototype],T._storeNames,T._dbSchema),F.schema=T._dbSchema}),H.push(function(X){T.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(T.idbdb.version/10)===Y._cfg.version?(T.idbdb.deleteObjectStore("$meta"),delete T._dbSchema.$meta,T._storeNames=T._storeNames.filter(function(Z){return Z!=="$meta"})):X.objectStore("$meta").put(Y._cfg.version,"version"))})}),function Y(){return H.length?Se.resolve(H.shift()(F.idbtrans)).then(Y):Se.resolve()}().then(function(){Yl($,M)})):Se.resolve();var T,K,F,M,H,$}).catch(_)):(o(g).forEach(function(U){Fs(d,U,g[U].primKey,g[U].indexes)}),Di(s,d),void Se.follow(function(){return s.on.populate.fire(v)}).catch(_));var P,L})}function Qm(s,u){Yl(s._dbSchema,u),u.db.version%10!=0||u.objectStoreNames.contains("$meta")||u.db.createObjectStore("$meta").add(Math.ceil(u.db.version/10-1),"version");var d=ji(0,s.idbdb,u);Bi(s,s._dbSchema,u);for(var p=0,g=Ps(d,s._dbSchema).change;p<g.length;p++){var v=function(_){if(_.change.length||_.recreate)return console.warn("Unable to patch indexes of table ".concat(_.name," because it has changes on the type of index or primary key.")),{value:void 0};var N=u.objectStore(_.name);_.add.forEach(function(P){pe&&console.debug("Dexie upgrade patch: Creating missing index ".concat(_.name,".").concat(P.src)),$i(N,P)})}(g[p]);if(typeof v=="object")return v.value}}function Ps(s,u){var d,p={del:[],add:[],change:[]};for(d in s)u[d]||p.del.push(d);for(d in u){var g=s[d],v=u[d];if(g){var _={name:d,def:v,recreate:!1,del:[],add:[],change:[]};if(""+(g.primKey.keyPath||"")!=""+(v.primKey.keyPath||"")||g.primKey.auto!==v.primKey.auto)_.recreate=!0,p.change.push(_);else{var N=g.idxByName,P=v.idxByName,L=void 0;for(L in N)P[L]||_.del.push(L);for(L in P){var U=N[L],T=P[L];U?U.src!==T.src&&_.change.push(T):_.add.push(T)}(0<_.del.length||0<_.add.length||0<_.change.length)&&p.change.push(_)}}else p.add.push([d,v])}return p}function Fs(s,u,d,p){var g=s.db.createObjectStore(u,d.keyPath?{keyPath:d.keyPath,autoIncrement:d.auto}:{autoIncrement:d.auto});return p.forEach(function(v){return $i(g,v)}),g}function Yl(s,u){o(s).forEach(function(d){u.db.objectStoreNames.contains(d)||(pe&&console.debug("Dexie: Creating missing table",d),Fs(u,d,s[d].primKey,s[d].indexes))})}function $i(s,u){s.createIndex(u.name,u.keyPath,{unique:u.unique,multiEntry:u.multi})}function ji(s,u,d){var p={};return C(u.objectStoreNames,0).forEach(function(g){for(var v=d.objectStore(g),_=Rs(Wl(L=v.keyPath),L||"",!0,!1,!!v.autoIncrement,L&&typeof L!="string",!0),N=[],P=0;P<v.indexNames.length;++P){var U=v.index(v.indexNames[P]),L=U.keyPath,U=Rs(U.name,L,!!U.unique,!!U.multiEntry,!1,L&&typeof L!="string",!1);N.push(U)}p[g]=Ts(g,_,N)}),p}function Bi(s,u,d){for(var p=d.db.objectStoreNames,g=0;g<p.length;++g){var v=p[g],_=d.objectStore(v);s._hasGetAll="getAll"in _;for(var N=0;N<_.indexNames.length;++N){var P=_.indexNames[N],L=_.index(P).keyPath,U=typeof L=="string"?L:"["+C(L).join("+")+"]";!u[v]||(L=u[v].idxByName[U])&&(L.name=P,delete u[v].idxByName[U],u[v].idxByName[P]=L)}}typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Ql(s){return s.split(",").map(function(u,d){var p=(u=u.trim()).replace(/([&*]|\+\+)/g,""),g=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Rs(p,g||null,/\&/.test(u),/\*/.test(u),/\+\+/.test(u),l(g),d===0)})}var Xm=(Mi.prototype._parseStoresSpec=function(s,u){o(s).forEach(function(d){if(s[d]!==null){var p=Ql(s[d]),g=p.shift();if(g.unique=!0,g.multi)throw new oe.Schema("Primary key cannot be multi-valued");p.forEach(function(v){if(v.auto)throw new oe.Schema("Only primary key can be marked as autoIncrement (++)");if(!v.keyPath)throw new oe.Schema("Index must have a name and cannot be an empty string")}),u[d]=Ts(d,g,p)}})},Mi.prototype.stores=function(d){var u=this.db;this._cfg.storesSource=this._cfg.storesSource?c(this._cfg.storesSource,d):d;var d=u._versions,p={},g={};return d.forEach(function(v){c(p,v._cfg.storesSource),g=v._cfg.dbschema={},v._parseStoresSpec(p,g)}),u._dbSchema=g,xs(u,[u._allTables,u,u.Transaction.prototype]),Li(u,[u._allTables,u,u.Transaction.prototype,this._cfg.tables],o(g),g),u._storeNames=o(g),this},Mi.prototype.upgrade=function(s){return this._cfg.contentUpgrade=qe(this._cfg.contentUpgrade||we,s),this},Mi);function Mi(){}function Is(s,u){var d=s._dbNamesDB;return d||(d=s._dbNamesDB=new an(Ci,{addons:[],indexedDB:s,IDBKeyRange:u})).version(1).stores({dbnames:"name"}),d.table("dbnames")}function Ds(s){return s&&typeof s.databases=="function"}function Ls(s){return pn(function(){return Te.letThrough=!0,s()})}function $s(s){return!("from"in s)}var yt=function(s,u){if(!this){var d=new yt;return s&&"d"in s&&c(d,s),d}c(this,arguments.length?{d:1,from:s,to:1<arguments.length?u:s}:{d:0})};function Br(s,u,d){var p=He(u,d);if(!isNaN(p)){if(0<p)throw RangeError();if($s(s))return c(s,{from:u,to:d,d:1});var g=s.l,p=s.r;if(He(d,s.from)<0)return g?Br(g,u,d):s.l={from:u,to:d,d:1,l:null,r:null},Zl(s);if(0<He(u,s.to))return p?Br(p,u,d):s.r={from:u,to:d,d:1,l:null,r:null},Zl(s);He(u,s.from)<0&&(s.from=u,s.l=null,s.d=p?p.d+1:1),0<He(d,s.to)&&(s.to=d,s.r=null,s.d=s.l?s.l.d+1:1),d=!s.r,g&&!s.l&&Mr(s,g),p&&d&&Mr(s,p)}}function Mr(s,u){$s(u)||function d(p,P){var v=P.from,_=P.to,N=P.l,P=P.r;Br(p,v,_),N&&d(p,N),P&&d(p,P)}(s,u)}function Xl(s,u){var d=Ui(u),p=d.next();if(p.done)return!1;for(var g=p.value,v=Ui(s),_=v.next(g.from),N=_.value;!p.done&&!_.done;){if(He(N.from,g.to)<=0&&0<=He(N.to,g.from))return!0;He(g.from,N.from)<0?g=(p=d.next(N.from)).value:N=(_=v.next(g.from)).value}return!1}function Ui(s){var u=$s(s)?null:{s:0,n:s};return{next:function(d){for(var p=0<arguments.length;u;)switch(u.s){case 0:if(u.s=1,p)for(;u.n.l&&He(d,u.n.from)<0;)u={up:u,n:u.n.l,s:1};else for(;u.n.l;)u={up:u,n:u.n.l,s:1};case 1:if(u.s=2,!p||He(d,u.n.to)<=0)return{value:u.n,done:!1};case 2:if(u.n.r){u.s=3,u={up:u,n:u.n.r,s:0};continue}case 3:u=u.up}return{done:!0}}}}function Zl(s){var u,d,p=(((u=s.r)===null||u===void 0?void 0:u.d)||0)-(((d=s.l)===null||d===void 0?void 0:d.d)||0),g=1<p?"r":p<-1?"l":"";g&&(u=g=="r"?"l":"r",d=r({},s),p=s[g],s.from=p.from,s.to=p.to,s[g]=p[g],d[g]=p[u],(s[u]=d).d=ec(d)),s.d=ec(s)}function ec(d){var u=d.r,d=d.l;return(u?d?Math.max(u.d,d.d):u.d:d?d.d:0)+1}function Vi(s,u){return o(u).forEach(function(d){s[d]?Mr(s[d],u[d]):s[d]=function p(g){var v,_,N={};for(v in g)y(g,v)&&(_=g[v],N[v]=!_||typeof _!="object"||he.has(_.constructor)?_:p(_));return N}(u[d])}),s}function js(s,u){return s.all||u.all||Object.keys(s).some(function(d){return u[d]&&Xl(u[d],s[d])})}m(yt.prototype,((Dt={add:function(s){return Mr(this,s),this},addKey:function(s){return Br(this,s,s),this},addKeys:function(s){var u=this;return s.forEach(function(d){return Br(u,d,d)}),this},hasKey:function(s){var u=Ui(this).next(s).value;return u&&He(u.from,s)<=0&&0<=He(u.to,s)}})[J]=function(){return Ui(this)},Dt));var In={},Bs={},Ms=!1;function qi(s){Vi(Bs,s),Ms||(Ms=!0,setTimeout(function(){Ms=!1,Us(Bs,!(Bs={}))},0))}function Us(s,u){u===void 0&&(u=!1);var d=new Set;if(s.all)for(var p=0,g=Object.values(In);p<g.length;p++)tc(_=g[p],s,d,u);else for(var v in s){var _,N=/^idb\:\/\/(.*)\/(.*)\//.exec(v);N&&(v=N[1],N=N[2],(_=In["idb://".concat(v,"/").concat(N)])&&tc(_,s,d,u))}d.forEach(function(P){return P()})}function tc(s,u,d,p){for(var g=[],v=0,_=Object.entries(s.queries.query);v<_.length;v++){for(var N=_[v],P=N[0],L=[],U=0,T=N[1];U<T.length;U++){var K=T[U];js(u,K.obsSet)?K.subscribers.forEach(function($){return d.add($)}):p&&L.push(K)}p&&g.push([P,L])}if(p)for(var F=0,M=g;F<M.length;F++){var H=M[F],P=H[0],L=H[1];s.queries.query[P]=L}}function Zm(s){var u=s._state,d=s._deps.indexedDB;if(u.isBeingOpened||s.idbdb)return u.dbReadyPromise.then(function(){return u.dbOpenError?at(u.dbOpenError):s});u.isBeingOpened=!0,u.dbOpenError=null,u.openComplete=!1;var p=u.openCanceller,g=Math.round(10*s.verno),v=!1;function _(){if(u.openCanceller!==p)throw new oe.DatabaseClosed("db.open() was cancelled")}function N(){return new Se(function(K,F){if(_(),!d)throw new oe.MissingAPI;var M=s.name,H=u.autoSchema||!g?d.open(M):d.open(M,g);if(!H)throw new oe.MissingAPI;H.onerror=Yt(F),H.onblocked=nt(s._fireOnBlocked),H.onupgradeneeded=nt(function($){var Y;U=H.transaction,u.autoSchema&&!s._options.allowEmptyDB?(H.onerror=Dr,U.abort(),H.result.close(),(Y=d.deleteDatabase(M)).onsuccess=Y.onerror=nt(function(){F(new oe.NoSuchDatabase("Database ".concat(M," doesnt exist")))})):(U.onerror=Yt(F),$=$.oldVersion>Math.pow(2,62)?0:$.oldVersion,T=$<1,s.idbdb=H.result,v&&Qm(s,U),Ym(s,$/10,U,F))},F),H.onsuccess=nt(function(){U=null;var $,Y,X,Z,ae,de=s.idbdb=H.result,be=C(de.objectStoreNames);if(0<be.length)try{var fe=de.transaction((Z=be).length===1?Z[0]:Z,"readonly");if(u.autoSchema)Y=de,X=fe,($=s).verno=Y.version/10,X=$._dbSchema=ji(0,Y,X),$._storeNames=C(Y.objectStoreNames,0),Li($,[$._allTables],o(X),X);else if(Bi(s,s._dbSchema,fe),((ae=Ps(ji(0,(ae=s).idbdb,fe),ae._dbSchema)).add.length||ae.change.some(function(ye){return ye.add.length||ye.change.length}))&&!v)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),de.close(),g=de.version+1,v=!0,K(N());Di(s,fe)}catch{}rr.push(s),de.onversionchange=nt(function(ye){u.vcFired=!0,s.on("versionchange").fire(ye)}),de.onclose=nt(function(ye){s.on("close").fire(ye)}),T&&(ae=s._deps,fe=M,de=ae.indexedDB,ae=ae.IDBKeyRange,Ds(de)||fe===Ci||Is(de,ae).put({name:fe}).catch(we)),K()},F)}).catch(function(K){switch(K==null?void 0:K.name){case"UnknownError":if(0<u.PR1398_maxLoop)return u.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),N();break;case"VersionError":if(0<g)return g=0,N()}return Se.reject(K)})}var P,L=u.dbReadyResolve,U=null,T=!1;return Se.race([p,(typeof navigator=="undefined"?Se.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(K){function F(){return indexedDB.databases().finally(K)}P=setInterval(F,100),F()}).finally(function(){return clearInterval(P)}):Promise.resolve()).then(N)]).then(function(){return _(),u.onReadyBeingFired=[],Se.resolve(Ls(function(){return s.on.ready.fire(s.vip)})).then(function K(){if(0<u.onReadyBeingFired.length){var F=u.onReadyBeingFired.reduce(qe,we);return u.onReadyBeingFired=[],Se.resolve(Ls(function(){return F(s.vip)})).then(K)}})}).finally(function(){u.openCanceller===p&&(u.onReadyBeingFired=null,u.isBeingOpened=!1)}).catch(function(K){u.dbOpenError=K;try{U&&U.abort()}catch{}return p===u.openCanceller&&s._close(),at(K)}).finally(function(){u.openComplete=!0,L()}).then(function(){var K;return T&&(K={},s.tables.forEach(function(F){F.schema.indexes.forEach(function(M){M.name&&(K["idb://".concat(s.name,"/").concat(F.name,"/").concat(M.name)]=new yt(-1/0,[[[]]]))}),K["idb://".concat(s.name,"/").concat(F.name,"/")]=K["idb://".concat(s.name,"/").concat(F.name,"/:dels")]=new yt(-1/0,[[[]]])}),vn(Lr).fire(K),Us(K,!0)),s})}function Vs(s){function u(v){return s.next(v)}var d=g(u),p=g(function(v){return s.throw(v)});function g(v){return function(P){var N=v(P),P=N.value;return N.done?P:P&&typeof P.then=="function"?P.then(d,p):l(P)?Promise.all(P).then(d,p):d(P)}}return g(u)()}function Hi(s,u,d){for(var p=l(s)?s.slice():[s],g=0;g<d;++g)p.push(u);return p}var eg={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return r(r({},s),{table:function(u){var d=s.table(u),p=d.schema,g={},v=[];function _(T,K,F){var M=jr(T),H=g[M]=g[M]||[],$=T==null?0:typeof T=="string"?1:T.length,Y=0<K,Y=r(r({},F),{name:Y?"".concat(M,"(virtual-from:").concat(F.name,")"):F.name,lowLevelIndex:F,isVirtual:Y,keyTail:K,keyLength:$,extractKey:Cs(T),unique:!Y&&F.unique});return H.push(Y),Y.isPrimaryKey||v.push(Y),1<$&&_($===2?T[0]:T.slice(0,$-1),K+1,F),H.sort(function(X,Z){return X.keyTail-Z.keyTail}),Y}u=_(p.primaryKey.keyPath,0,p.primaryKey),g[":id"]=[u];for(var N=0,P=p.indexes;N<P.length;N++){var L=P[N];_(L.keyPath,0,L)}function U(T){var K,F=T.query.index;return F.isVirtual?r(r({},T),{query:{index:F.lowLevelIndex,range:(K=T.query.range,F=F.keyTail,{type:K.type===1?2:K.type,lower:Hi(K.lower,K.lowerOpen?s.MAX_KEY:s.MIN_KEY,F),lowerOpen:!0,upper:Hi(K.upper,K.upperOpen?s.MIN_KEY:s.MAX_KEY,F),upperOpen:!0})}}):T}return r(r({},d),{schema:r(r({},p),{primaryKey:u,indexes:v,getIndexByKeyPath:function(T){return(T=g[jr(T)])&&T[0]}}),count:function(T){return d.count(U(T))},query:function(T){return d.query(U(T))},openCursor:function(T){var K=T.query.index,F=K.keyTail,M=K.isVirtual,H=K.keyLength;return M?d.openCursor(U(T)).then(function(Y){return Y&&$(Y)}):d.openCursor(T);function $(Y){return Object.create(Y,{continue:{value:function(X){X!=null?Y.continue(Hi(X,T.reverse?s.MAX_KEY:s.MIN_KEY,F)):T.unique?Y.continue(Y.key.slice(0,H).concat(T.reverse?s.MIN_KEY:s.MAX_KEY,F)):Y.continue()}},continuePrimaryKey:{value:function(X,Z){Y.continuePrimaryKey(Hi(X,s.MAX_KEY,F),Z)}},primaryKey:{get:function(){return Y.primaryKey}},key:{get:function(){var X=Y.key;return H===1?X[0]:X.slice(0,H)}},value:{get:function(){return Y.value}}})}}})}})}};function qs(s,u,d,p){return d=d||{},p=p||"",o(s).forEach(function(g){var v,_,N;y(u,g)?(v=s[g],_=u[g],typeof v=="object"&&typeof _=="object"&&v&&_?(N=w(v))!==w(_)?d[p+g]=u[g]:N==="Object"?qs(v,_,d,p+g+"."):v!==_&&(d[p+g]=u[g]):v!==_&&(d[p+g]=u[g])):d[p+g]=void 0}),o(u).forEach(function(g){y(s,g)||(d[p+g]=u[g])}),d}function Hs(s,u){return u.type==="delete"?u.keys:u.keys||u.values.map(s.extractKey)}var tg={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return r(r({},s),{table:function(u){var d=s.table(u),p=d.schema.primaryKey;return r(r({},d),{mutate:function(g){var v=Te.trans,_=v.table(u).hook,N=_.deleting,P=_.creating,L=_.updating;switch(g.type){case"add":if(P.fire===we)break;return v._promise("readwrite",function(){return U(g)},!0);case"put":if(P.fire===we&&L.fire===we)break;return v._promise("readwrite",function(){return U(g)},!0);case"delete":if(N.fire===we)break;return v._promise("readwrite",function(){return U(g)},!0);case"deleteRange":if(N.fire===we)break;return v._promise("readwrite",function(){return function T(K,F,M){return d.query({trans:K,values:!1,query:{index:p,range:F},limit:M}).then(function(H){var $=H.result;return U({type:"delete",keys:$,trans:K}).then(function(Y){return 0<Y.numFailures?Promise.reject(Y.failures[0]):$.length<M?{failures:[],numFailures:0,lastResult:void 0}:T(K,r(r({},F),{lower:$[$.length-1],lowerOpen:!0}),M)})})}(g.trans,g.range,1e4)},!0)}return d.mutate(g);function U(T){var K,F,M,H=Te.trans,$=T.keys||Hs(p,T);if(!$)throw new Error("Keys missing");return(T=T.type==="add"||T.type==="put"?r(r({},T),{keys:$}):r({},T)).type!=="delete"&&(T.values=i([],T.values)),T.keys&&(T.keys=i([],T.keys)),K=d,M=$,((F=T).type==="add"?Promise.resolve([]):K.getMany({trans:F.trans,keys:M,cache:"immutable"})).then(function(Y){var X=$.map(function(Z,ae){var de,be,fe,ye=Y[ae],_e={onerror:null,onsuccess:null};return T.type==="delete"?N.fire.call(_e,Z,ye,H):T.type==="add"||ye===void 0?(de=P.fire.call(_e,Z,T.values[ae],H),Z==null&&de!=null&&(T.keys[ae]=Z=de,p.outbound||I(T.values[ae],p.keyPath,Z))):(de=qs(ye,T.values[ae]),(be=L.fire.call(_e,de,Z,ye,H))&&(fe=T.values[ae],Object.keys(be).forEach(function(ve){y(fe,ve)?fe[ve]=be[ve]:I(fe,ve,be[ve])}))),_e});return d.mutate(T).then(function(Z){for(var ae=Z.failures,de=Z.results,be=Z.numFailures,Z=Z.lastResult,fe=0;fe<$.length;++fe){var ye=(de||$)[fe],_e=X[fe];ye==null?_e.onerror&&_e.onerror(ae[fe]):_e.onsuccess&&_e.onsuccess(T.type==="put"&&Y[fe]?T.values[fe]:ye)}return{failures:ae,results:de,numFailures:be,lastResult:Z}}).catch(function(Z){return X.forEach(function(ae){return ae.onerror&&ae.onerror(Z)}),Promise.reject(Z)})})}}})}})}};function nc(s,u,d){try{if(!u||u.keys.length<s.length)return null;for(var p=[],g=0,v=0;g<u.keys.length&&v<s.length;++g)He(u.keys[g],s[v])===0&&(p.push(d?le(u.values[g]):u.values[g]),++v);return p.length===s.length?p:null}catch{return null}}var ng={stack:"dbcore",level:-1,create:function(s){return{table:function(u){var d=s.table(u);return r(r({},d),{getMany:function(p){if(!p.cache)return d.getMany(p);var g=nc(p.keys,p.trans._cache,p.cache==="clone");return g?Se.resolve(g):d.getMany(p).then(function(v){return p.trans._cache={keys:p.keys,values:p.cache==="clone"?le(v):v},v})},mutate:function(p){return p.type!=="add"&&(p.trans._cache=null),d.mutate(p)}})}}}};function rc(s,u){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!u.schema.primaryKey.outbound}function ic(s,u){switch(s){case"query":return u.values&&!u.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var rg={stack:"dbcore",level:0,name:"Observability",create:function(s){var u=s.schema.name,d=new yt(s.MIN_KEY,s.MAX_KEY);return r(r({},s),{transaction:function(p,g,v){if(Te.subscr&&g!=="readonly")throw new oe.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Te.querier));return s.transaction(p,g,v)},table:function(p){var g=s.table(p),v=g.schema,_=v.primaryKey,T=v.indexes,N=_.extractKey,P=_.outbound,L=_.autoIncrement&&T.filter(function(F){return F.compound&&F.keyPath.includes(_.keyPath)}),U=r(r({},g),{mutate:function(F){function M(ve){return ve="idb://".concat(u,"/").concat(p,"/").concat(ve),Z[ve]||(Z[ve]=new yt)}var H,$,Y,X=F.trans,Z=F.mutatedParts||(F.mutatedParts={}),ae=M(""),de=M(":dels"),be=F.type,_e=F.type==="deleteRange"?[F.range]:F.type==="delete"?[F.keys]:F.values.length<50?[Hs(_,F).filter(function(ve){return ve}),F.values]:[],fe=_e[0],ye=_e[1],_e=F.trans._cache;return l(fe)?(ae.addKeys(fe),(_e=be==="delete"||fe.length===ye.length?nc(fe,_e):null)||de.addKeys(fe),(_e||ye)&&(H=M,$=_e,Y=ye,v.indexes.forEach(function(ve){var Ne=H(ve.name||"");function Le(Me){return Me!=null?ve.extractKey(Me):null}function Be(Me){return ve.multiEntry&&l(Me)?Me.forEach(function(Ot){return Ne.addKey(Ot)}):Ne.addKey(Me)}($||Y).forEach(function(Me,vt){var De=$&&Le($[vt]),vt=Y&&Le(Y[vt]);He(De,vt)!==0&&(De!=null&&Be(De),vt!=null&&Be(vt))})}))):fe?(ye={from:(ye=fe.lower)!==null&&ye!==void 0?ye:s.MIN_KEY,to:(ye=fe.upper)!==null&&ye!==void 0?ye:s.MAX_KEY},de.add(ye),ae.add(ye)):(ae.add(d),de.add(d),v.indexes.forEach(function(ve){return M(ve.name).add(d)})),g.mutate(F).then(function(ve){return!fe||F.type!=="add"&&F.type!=="put"||(ae.addKeys(ve.results),L&&L.forEach(function(Ne){for(var Le=F.values.map(function(De){return Ne.extractKey(De)}),Be=Ne.keyPath.findIndex(function(De){return De===_.keyPath}),Me=0,Ot=ve.results.length;Me<Ot;++Me)Le[Me][Be]=ve.results[Me];M(Ne.name).addKeys(Le)})),X.mutatedParts=Vi(X.mutatedParts||{},Z),ve})}}),T=function(M){var H=M.query,M=H.index,H=H.range;return[M,new yt((M=H.lower)!==null&&M!==void 0?M:s.MIN_KEY,(H=H.upper)!==null&&H!==void 0?H:s.MAX_KEY)]},K={get:function(F){return[_,new yt(F.key)]},getMany:function(F){return[_,new yt().addKeys(F.keys)]},count:T,query:T,openCursor:T};return o(K).forEach(function(F){U[F]=function(M){var H=Te.subscr,$=!!H,Y=rc(Te,g)&&ic(F,M)?M.obsSet={}:H;if($){var X=function(ye){return ye="idb://".concat(u,"/").concat(p,"/").concat(ye),Y[ye]||(Y[ye]=new yt)},Z=X(""),ae=X(":dels"),H=K[F](M),$=H[0],H=H[1];if((F==="query"&&$.isPrimaryKey&&!M.values?ae:X($.name||"")).add(H),!$.isPrimaryKey){if(F!=="count"){var de=F==="query"&&P&&M.values&&g.query(r(r({},M),{values:!1}));return g[F].apply(this,arguments).then(function(ye){if(F==="query"){if(P&&M.values)return de.then(function(Le){return Le=Le.result,Z.addKeys(Le),ye});var _e=M.values?ye.result.map(N):ye.result;(M.values?Z:ae).addKeys(_e)}else if(F==="openCursor"){var ve=ye,Ne=M.values;return ve&&Object.create(ve,{key:{get:function(){return ae.addKey(ve.primaryKey),ve.key}},primaryKey:{get:function(){var Le=ve.primaryKey;return ae.addKey(Le),Le}},value:{get:function(){return Ne&&Z.addKey(ve.primaryKey),ve.value}}})}return ye})}ae.add(d)}}return g[F].apply(this,arguments)}}),U}})}};function ac(s,u,d){if(d.numFailures===0)return u;if(u.type==="deleteRange")return null;var p=u.keys?u.keys.length:"values"in u&&u.values?u.values.length:1;return d.numFailures===p?null:(u=r({},u),l(u.keys)&&(u.keys=u.keys.filter(function(g,v){return!(v in d.failures)})),"values"in u&&l(u.values)&&(u.values=u.values.filter(function(g,v){return!(v in d.failures)})),u)}function Ks(s,u){return d=s,((p=u).lower===void 0||(p.lowerOpen?0<He(d,p.lower):0<=He(d,p.lower)))&&(s=s,(u=u).upper===void 0||(u.upperOpen?He(s,u.upper)<0:He(s,u.upper)<=0));var d,p}function sc(s,u,K,p,g,v){if(!K||K.length===0)return s;var _=u.query.index,N=_.multiEntry,P=u.query.range,L=p.schema.primaryKey.extractKey,U=_.extractKey,T=(_.lowLevelIndex||_).extractKey,K=K.reduce(function(F,M){var H=F,$=[];if(M.type==="add"||M.type==="put")for(var Y=new yt,X=M.values.length-1;0<=X;--X){var Z,ae=M.values[X],de=L(ae);Y.hasKey(de)||(Z=U(ae),(N&&l(Z)?Z.some(function(ve){return Ks(ve,P)}):Ks(Z,P))&&(Y.addKey(de),$.push(ae)))}switch(M.type){case"add":var be=new yt().addKeys(u.values?F.map(function(Ne){return L(Ne)}):F),H=F.concat(u.values?$.filter(function(Ne){return Ne=L(Ne),!be.hasKey(Ne)&&(be.addKey(Ne),!0)}):$.map(function(Ne){return L(Ne)}).filter(function(Ne){return!be.hasKey(Ne)&&(be.addKey(Ne),!0)}));break;case"put":var fe=new yt().addKeys(M.values.map(function(Ne){return L(Ne)}));H=F.filter(function(Ne){return!fe.hasKey(u.values?L(Ne):Ne)}).concat(u.values?$:$.map(function(Ne){return L(Ne)}));break;case"delete":var ye=new yt().addKeys(M.keys);H=F.filter(function(Ne){return!ye.hasKey(u.values?L(Ne):Ne)});break;case"deleteRange":var _e=M.range;H=F.filter(function(Ne){return!Ks(L(Ne),_e)})}return H},s);return K===s?s:(K.sort(function(F,M){return He(T(F),T(M))||He(L(F),L(M))}),u.limit&&u.limit<1/0&&(K.length>u.limit?K.length=u.limit:s.length===u.limit&&K.length<u.limit&&(g.dirty=!0)),v?Object.freeze(K):K)}function oc(s,u){return He(s.lower,u.lower)===0&&He(s.upper,u.upper)===0&&!!s.lowerOpen==!!u.lowerOpen&&!!s.upperOpen==!!u.upperOpen}function ig(s,u){return function(d,p,g,v){if(d===void 0)return p!==void 0?-1:0;if(p===void 0)return 1;if((p=He(d,p))===0){if(g&&v)return 0;if(g)return 1;if(v)return-1}return p}(s.lower,u.lower,s.lowerOpen,u.lowerOpen)<=0&&0<=function(d,p,g,v){if(d===void 0)return p!==void 0?1:0;if(p===void 0)return-1;if((p=He(d,p))===0){if(g&&v)return 0;if(g)return-1;if(v)return 1}return p}(s.upper,u.upper,s.upperOpen,u.upperOpen)}function ag(s,u,d,p){s.subscribers.add(d),p.addEventListener("abort",function(){var g,v;s.subscribers.delete(d),s.subscribers.size===0&&(g=s,v=u,setTimeout(function(){g.subscribers.size===0&&ne(v,g)},3e3))})}var sg={stack:"dbcore",level:0,name:"Cache",create:function(s){var u=s.schema.name;return r(r({},s),{transaction:function(d,p,g){var v,_,N=s.transaction(d,p,g);return p==="readwrite"&&(_=(v=new AbortController).signal,g=function(P){return function(){if(v.abort(),p==="readwrite"){for(var L=new Set,U=0,T=d;U<T.length;U++){var K=T[U],F=In["idb://".concat(u,"/").concat(K)];if(F){var M=s.table(K),H=F.optimisticOps.filter(function(Ne){return Ne.trans===N});if(N._explicit&&P&&N.mutatedParts)for(var $=0,Y=Object.values(F.queries.query);$<Y.length;$++)for(var X=0,Z=(be=Y[$]).slice();X<Z.length;X++)js((fe=Z[X]).obsSet,N.mutatedParts)&&(ne(be,fe),fe.subscribers.forEach(function(Ne){return L.add(Ne)}));else if(0<H.length){F.optimisticOps=F.optimisticOps.filter(function(Ne){return Ne.trans!==N});for(var ae=0,de=Object.values(F.queries.query);ae<de.length;ae++)for(var be,fe,ye,_e=0,ve=(be=de[ae]).slice();_e<ve.length;_e++)(fe=ve[_e]).res!=null&&N.mutatedParts&&(P&&!fe.dirty?(ye=Object.isFrozen(fe.res),ye=sc(fe.res,fe.req,H,M,fe,ye),fe.dirty?(ne(be,fe),fe.subscribers.forEach(function(Ne){return L.add(Ne)})):ye!==fe.res&&(fe.res=ye,fe.promise=Se.resolve({result:ye}))):(fe.dirty&&ne(be,fe),fe.subscribers.forEach(function(Ne){return L.add(Ne)})))}}}L.forEach(function(Ne){return Ne()})}}},N.addEventListener("abort",g(!1),{signal:_}),N.addEventListener("error",g(!1),{signal:_}),N.addEventListener("complete",g(!0),{signal:_})),N},table:function(d){var p=s.table(d),g=p.schema.primaryKey;return r(r({},p),{mutate:function(v){var _=Te.trans;if(g.outbound||_.db._options.cache==="disabled"||_.explicit||_.idbtrans.mode!=="readwrite")return p.mutate(v);var N=In["idb://".concat(u,"/").concat(d)];return N?(_=p.mutate(v),v.type!=="add"&&v.type!=="put"||!(50<=v.values.length||Hs(g,v).some(function(P){return P==null}))?(N.optimisticOps.push(v),v.mutatedParts&&qi(v.mutatedParts),_.then(function(P){0<P.numFailures&&(ne(N.optimisticOps,v),(P=ac(0,v,P))&&N.optimisticOps.push(P),v.mutatedParts&&qi(v.mutatedParts))}),_.catch(function(){ne(N.optimisticOps,v),v.mutatedParts&&qi(v.mutatedParts)})):_.then(function(P){var L=ac(0,r(r({},v),{values:v.values.map(function(U,T){var K;return P.failures[T]?U:(U=(K=g.keyPath)!==null&&K!==void 0&&K.includes(".")?le(U):r({},U),I(U,g.keyPath,P.results[T]),U)})}),P);N.optimisticOps.push(L),queueMicrotask(function(){return v.mutatedParts&&qi(v.mutatedParts)})}),_):p.mutate(v)},query:function(v){if(!rc(Te,p)||!ic("query",v))return p.query(v);var _=((L=Te.trans)===null||L===void 0?void 0:L.db._options.cache)==="immutable",T=Te,N=T.requery,P=T.signal,L=function(M,H,$,Y){var X=In["idb://".concat(M,"/").concat(H)];if(!X)return[];if(!(H=X.queries[$]))return[null,!1,X,null];var Z=H[(Y.query?Y.query.index.name:null)||""];if(!Z)return[null,!1,X,null];switch($){case"query":var ae=Z.find(function(de){return de.req.limit===Y.limit&&de.req.values===Y.values&&oc(de.req.query.range,Y.query.range)});return ae?[ae,!0,X,Z]:[Z.find(function(de){return("limit"in de.req?de.req.limit:1/0)>=Y.limit&&(!Y.values||de.req.values)&&ig(de.req.query.range,Y.query.range)}),!1,X,Z];case"count":return ae=Z.find(function(de){return oc(de.req.query.range,Y.query.range)}),[ae,!!ae,X,Z]}}(u,d,"query",v),U=L[0],T=L[1],K=L[2],F=L[3];return U&&T?U.obsSet=v.obsSet:(T=p.query(v).then(function(M){var H=M.result;if(U&&(U.res=H),_){for(var $=0,Y=H.length;$<Y;++$)Object.freeze(H[$]);Object.freeze(H)}else M.result=le(H);return M}).catch(function(M){return F&&U&&ne(F,U),Promise.reject(M)}),U={obsSet:v.obsSet,promise:T,subscribers:new Set,type:"query",req:v,dirty:!1},F?F.push(U):(F=[U],(K=K||(In["idb://".concat(u,"/").concat(d)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[v.query.index.name||""]=F)),ag(U,F,N,P),U.promise.then(function(M){return{result:sc(M.result,v,K==null?void 0:K.optimisticOps,p,U,_)}})}})}})}};function Ki(s,u){return new Proxy(s,{get:function(d,p,g){return p==="db"?u:Reflect.get(d,p,g)}})}var an=(st.prototype.version=function(s){if(isNaN(s)||s<.1)throw new oe.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new oe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var u=this._versions,d=u.filter(function(p){return p._cfg.version===s})[0];return d||(d=new this.Version(s),u.push(d),u.sort(Jm),d.stores({}),this._state.autoSchema=!1,d)},st.prototype._whenReady=function(s){var u=this;return this.idbdb&&(this._state.openComplete||Te.letThrough||this._vip)?s():new Se(function(d,p){if(u._state.openComplete)return p(new oe.DatabaseClosed(u._state.dbOpenError));if(!u._state.isBeingOpened){if(!u._state.autoOpen)return void p(new oe.DatabaseClosed);u.open().catch(we)}u._state.dbReadyPromise.then(d,p)}).then(s)},st.prototype.use=function(s){var u=s.stack,d=s.create,p=s.level,g=s.name;return g&&this.unuse({stack:u,name:g}),s=this._middlewares[u]||(this._middlewares[u]=[]),s.push({stack:u,create:d,level:p==null?10:p,name:g}),s.sort(function(v,_){return v.level-_.level}),this},st.prototype.unuse=function(s){var u=s.stack,d=s.name,p=s.create;return u&&this._middlewares[u]&&(this._middlewares[u]=this._middlewares[u].filter(function(g){return p?g.create!==p:!!d&&g.name!==d})),this},st.prototype.open=function(){var s=this;return xn(hn,function(){return Zm(s)})},st.prototype._close=function(){var s=this._state,u=rr.indexOf(this);if(0<=u&&rr.splice(u,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new Se(function(d){s.dbReadyResolve=d}),s.openCanceller=new Se(function(d,p){s.cancelOpen=p}))},st.prototype.close=function(d){var u=(d===void 0?{disableAutoOpen:!0}:d).disableAutoOpen,d=this._state;u?(d.isBeingOpened&&d.cancelOpen(new oe.DatabaseClosed),this._close(),d.autoOpen=!1,d.dbOpenError=new oe.DatabaseClosed):(this._close(),d.autoOpen=this._options.autoOpen||d.isBeingOpened,d.openComplete=!1,d.dbOpenError=null)},st.prototype.delete=function(s){var u=this;s===void 0&&(s={disableAutoOpen:!0});var d=0<arguments.length&&typeof arguments[0]!="object",p=this._state;return new Se(function(g,v){function _(){u.close(s);var N=u._deps.indexedDB.deleteDatabase(u.name);N.onsuccess=nt(function(){var P,L,U;P=u._deps,L=u.name,U=P.indexedDB,P=P.IDBKeyRange,Ds(U)||L===Ci||Is(U,P).delete(L).catch(we),g()}),N.onerror=Yt(v),N.onblocked=u._fireOnBlocked}if(d)throw new oe.InvalidArgument("Invalid closeOptions argument to db.delete()");p.isBeingOpened?p.dbReadyPromise.then(_):_()})},st.prototype.backendDB=function(){return this.idbdb},st.prototype.isOpen=function(){return this.idbdb!==null},st.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},st.prototype.hasFailed=function(){return this._state.dbOpenError!==null},st.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(st.prototype,"tables",{get:function(){var s=this;return o(this._allTables).map(function(u){return s._allTables[u]})},enumerable:!1,configurable:!0}),st.prototype.transaction=function(){var s=function(u,d,p){var g=arguments.length;if(g<2)throw new oe.InvalidArgument("Too few arguments");for(var v=new Array(g-1);--g;)v[g-1]=arguments[g];return p=v.pop(),[u,ke(v),p]}.apply(this,arguments);return this._transaction.apply(this,s)},st.prototype._transaction=function(s,u,d){var p=this,g=Te.trans;g&&g.db===this&&s.indexOf("!")===-1||(g=null);var v,_,N=s.indexOf("?")!==-1;s=s.replace("!","").replace("?","");try{if(_=u.map(function(L){if(L=L instanceof p.Table?L.name:L,typeof L!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return L}),s=="r"||s===Ss)v=Ss;else{if(s!="rw"&&s!=As)throw new oe.InvalidArgument("Invalid transaction mode: "+s);v=As}if(g){if(g.mode===Ss&&v===As){if(!N)throw new oe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");g=null}g&&_.forEach(function(L){if(g&&g.storeNames.indexOf(L)===-1){if(!N)throw new oe.SubTransaction("Table "+L+" not included in parent transaction.");g=null}}),N&&g&&!g.active&&(g=null)}}catch(L){return g?g._promise(null,function(U,T){T(L)}):at(L)}var P=function L(U,T,K,F,M){return Se.resolve().then(function(){var H=Te.transless||Te,$=U._createTransaction(T,K,U._dbSchema,F);if($.explicit=!0,H={trans:$,transless:H},F)$.idbtrans=F.idbtrans;else try{$.create(),$.idbtrans._explicit=!0,U._state.PR1398_maxLoop=3}catch(Z){return Z.name===ge.InvalidState&&U.isOpen()&&0<--U._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),U.close({disableAutoOpen:!1}),U.open().then(function(){return L(U,T,K,null,M)})):at(Z)}var Y,X=G(M);return X&&nr(),H=Se.follow(function(){var Z;(Y=M.call($,$))&&(X?(Z=mn.bind(null,null),Y.then(Z,Z)):typeof Y.next=="function"&&typeof Y.throw=="function"&&(Y=Vs(Y)))},H),(Y&&typeof Y.then=="function"?Se.resolve(Y).then(function(Z){return $.active?Z:at(new oe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):H.then(function(){return Y})).then(function(Z){return F&&$._resolve(),$._completion.then(function(){return Z})}).catch(function(Z){return $._reject(Z),at(Z)})})}.bind(null,this,v,_,g,d);return g?g._promise(v,P,"lock"):Te.trans?xn(Te.transless,function(){return p._whenReady(P)}):this._whenReady(P)},st.prototype.table=function(s){if(!y(this._allTables,s))throw new oe.InvalidTable("Table ".concat(s," does not exist"));return this._allTables[s]},st);function st(s,u){var d=this;this._middlewares={},this.verno=0;var p=st.dependencies;this._options=u=r({addons:st.addons,autoOpen:!0,indexedDB:p.indexedDB,IDBKeyRange:p.IDBKeyRange,cache:"cloned"},u),this._deps={indexedDB:u.indexedDB,IDBKeyRange:u.IDBKeyRange},p=u.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var g,v,_,N,P,L={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:we,dbReadyPromise:null,cancelOpen:we,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:u.autoOpen};L.dbReadyPromise=new Se(function(T){L.dbReadyResolve=T}),L.openCanceller=new Se(function(T,K){L.cancelOpen=K}),this._state=L,this.name=s,this.on=Pr(this,"populate","blocked","versionchange","close",{ready:[qe,we]}),this.on.ready.subscribe=S(this.on.ready.subscribe,function(T){return function(K,F){st.vip(function(){var M,H=d._state;H.openComplete?(H.dbOpenError||Se.resolve().then(K),F&&T(K)):H.onReadyBeingFired?(H.onReadyBeingFired.push(K),F&&T(K)):(T(K),M=d,F||T(function $(){M.on.ready.unsubscribe(K),M.on.ready.unsubscribe($)}))})}}),this.Collection=(g=this,Fr(Vm.prototype,function(Y,$){this.db=g;var F=jl,M=null;if($)try{F=$()}catch(X){M=X}var H=Y._ctx,$=H.table,Y=$.hook.reading.fire;this._ctx={table:$,index:H.index,isPrimKey:!H.index||$.schema.primKey.keyPath&&H.index===$.schema.primKey.name,range:F,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:M,or:H.or,valueMapper:Y!==ct?Y:null}})),this.Table=(v=this,Fr(Vl.prototype,function(T,K,F){this.db=v,this._tx=F,this.name=T,this.schema=K,this.hook=v._allTables[T]?v._allTables[T].hook:Pr(null,{creating:[Pe,we],reading:[Ze,ct],updating:[Ft,we],deleting:[Je,we]})})),this.Transaction=(_=this,Fr(Km.prototype,function(T,K,F,M,H){var $=this;this.db=_,this.mode=T,this.storeNames=K,this.schema=F,this.chromeTransactionDurability=M,this.idbtrans=null,this.on=Pr(this,"complete","error","abort"),this.parent=H||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Se(function(Y,X){$._resolve=Y,$._reject=X}),this._completion.then(function(){$.active=!1,$.on.complete.fire()},function(Y){var X=$.active;return $.active=!1,$.on.error.fire(Y),$.parent?$.parent._reject(Y):X&&$.idbtrans&&$.idbtrans.abort(),at(Y)})})),this.Version=(N=this,Fr(Xm.prototype,function(T){this.db=N,this._cfg={version:T,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(P=this,Fr(Gl.prototype,function(T,K,F){if(this.db=P,this._ctx={table:T,index:K===":id"?null:K,or:F},this._cmp=this._ascending=He,this._descending=function(M,H){return He(H,M)},this._max=function(M,H){return 0<He(M,H)?M:H},this._min=function(M,H){return He(M,H)<0?M:H},this._IDBKeyRange=P._deps.IDBKeyRange,!this._IDBKeyRange)throw new oe.MissingAPI})),this.on("versionchange",function(T){0<T.newVersion?console.warn("Another connection wants to upgrade database '".concat(d.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(d.name,"'. Closing db now to resume the delete request.")),d.close({disableAutoOpen:!1})}),this.on("blocked",function(T){!T.newVersion||T.newVersion<T.oldVersion?console.warn("Dexie.delete('".concat(d.name,"') was blocked")):console.warn("Upgrade '".concat(d.name,"' blocked by other connection holding version ").concat(T.oldVersion/10))}),this._maxKey=$r(u.IDBKeyRange),this._createTransaction=function(T,K,F,M){return new d.Transaction(T,K,F,d._options.chromeTransactionDurability,M)},this._fireOnBlocked=function(T){d.on("blocked").fire(T),rr.filter(function(K){return K.name===d.name&&K!==d&&!K._state.vcFired}).map(function(K){return K.on("versionchange").fire(T)})},this.use(ng),this.use(sg),this.use(rg),this.use(eg),this.use(tg);var U=new Proxy(this,{get:function(T,K,F){if(K==="_vip")return!0;if(K==="table")return function(H){return Ki(d.table(H),U)};var M=Reflect.get(T,K,F);return M instanceof Vl?Ki(M,U):K==="tables"?M.map(function(H){return Ki(H,U)}):K==="_createTransaction"?function(){return Ki(M.apply(this,arguments),U)}:M}});this.vip=U,p.forEach(function(T){return T(d)})}var zi,Dt=typeof Symbol!="undefined"&&"observable"in Symbol?Symbol.observable:"@@observable",og=(zs.prototype.subscribe=function(s,u,d){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:u,complete:d})},zs.prototype[Dt]=function(){return this},zs);function zs(s){this._subscribe=s}try{zi={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{zi={indexedDB:null,IDBKeyRange:null}}function uc(s){var u,d=!1,p=new og(function(g){var v=G(s),_,N=!1,P={},L={},U={get closed(){return N},unsubscribe:function(){N||(N=!0,_&&_.abort(),T&&vn.storagemutated.unsubscribe(F))}};g.start&&g.start(U);var T=!1,K=function(){return _s(M)},F=function(H){Vi(P,H),js(L,P)&&K()},M=function(){var H,$,Y;!N&&zi.indexedDB&&(P={},H={},_&&_.abort(),_=new AbortController,Y=function(X){var Z=er();try{v&&nr();var ae=pn(s,X);return ae=v?ae.finally(mn):ae}finally{Z&&tr()}}($={subscr:H,signal:_.signal,requery:K,querier:s,trans:null}),Promise.resolve(Y).then(function(X){d=!0,u=X,N||$.signal.aborted||(P={},function(Z){for(var ae in Z)if(y(Z,ae))return;return 1}(L=H)||T||(vn(Lr,F),T=!0),_s(function(){return!N&&g.next&&g.next(X)}))},function(X){d=!1,["DatabaseClosedError","AbortError"].includes(X==null?void 0:X.name)||N||_s(function(){N||g.error&&g.error(X)})}))};return setTimeout(K,0),U});return p.hasValue=function(){return d},p.getValue=function(){return u},p}var Dn=an;function Gs(s){var u=bn;try{bn=!0,vn.storagemutated.fire(s),Us(s,!0)}finally{bn=u}}m(Dn,r(r({},xe),{delete:function(s){return new Dn(s,{addons:[]}).delete()},exists:function(s){return new Dn(s,{addons:[]}).open().then(function(u){return u.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return u=Dn.dependencies,d=u.indexedDB,u=u.IDBKeyRange,(Ds(d)?Promise.resolve(d.databases()).then(function(p){return p.map(function(g){return g.name}).filter(function(g){return g!==Ci})}):Is(d,u).toCollection().primaryKeys()).then(s)}catch{return at(new oe.MissingAPI)}var u,d},defineClass:function(){return function(s){c(this,s)}},ignoreTransaction:function(s){return Te.trans?xn(Te.transless,s):s()},vip:Ls,async:function(s){return function(){try{var u=Vs(s.apply(this,arguments));return u&&typeof u.then=="function"?u:Se.resolve(u)}catch(d){return at(d)}}},spawn:function(s,u,d){try{var p=Vs(s.apply(d,u||[]));return p&&typeof p.then=="function"?p:Se.resolve(p)}catch(g){return at(g)}},currentTransaction:{get:function(){return Te.trans||null}},waitFor:function(s,u){return u=Se.resolve(typeof s=="function"?Dn.ignoreTransaction(s):s).timeout(u||6e4),Te.trans?Te.trans.waitFor(u):u},Promise:Se,debug:{get:function(){return pe},set:function(s){je(s)}},derive:E,extend:c,props:m,override:S,Events:Pr,on:vn,liveQuery:uc,extendObservabilitySet:Vi,getByKeyPath:z,setByKeyPath:I,delByKeyPath:function(s,u){typeof u=="string"?I(s,u,void 0):"length"in u&&[].map.call(u,function(d){I(s,d,void 0)})},shallowClone:re,deepClone:le,getObjectDiff:qs,cmp:He,asap:x,minKey:-1/0,addons:[],connections:rr,errnames:ge,dependencies:zi,cache:In,semVer:"4.0.11",version:"4.0.11".split(".").map(function(s){return parseInt(s)}).reduce(function(s,u,d){return s+u/Math.pow(10,2*d)})})),Dn.maxKey=$r(Dn.dependencies.IDBKeyRange),typeof dispatchEvent!="undefined"&&typeof addEventListener!="undefined"&&(vn(Lr,function(s){bn||(s=new CustomEvent(Os,{detail:s}),bn=!0,dispatchEvent(s),bn=!1)}),addEventListener(Os,function(s){s=s.detail,bn||Gs(s)}));var sr,bn=!1,lc=function(){};return typeof BroadcastChannel!="undefined"&&((lc=function(){(sr=new BroadcastChannel(Os)).onmessage=function(s){return s.data&&Gs(s.data)}})(),typeof sr.unref=="function"&&sr.unref(),vn(Lr,function(s){bn||sr.postMessage(s)})),typeof addEventListener!="undefined"&&(addEventListener("pagehide",function(s){if(!an.disableBfCache&&s.persisted){pe&&console.debug("Dexie: handling persisted pagehide"),sr!=null&&sr.close();for(var u=0,d=rr;u<d.length;u++)d[u].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!an.disableBfCache&&s.persisted&&(pe&&console.debug("Dexie: handling persisted pageshow"),lc(),Gs({all:new yt(-1/0,[[]])}))})),Se.rejectionMapper=function(s,u){return!s||s instanceof Q||s instanceof TypeError||s instanceof SyntaxError||!s.name||!Ce[s.name]?s:(u=new Ce[s.name](u||s.message,s),"stack"in s&&A(u,"stack",{get:function(){return this.inner.stack}}),u)},je(pe),r(an,Object.freeze({__proto__:null,Dexie:an,liveQuery:uc,Entity:Bl,cmp:He,PropModification:Ir,replacePrefix:function(s,u){return new Ir({replacePrefix:[s,u]})},add:function(s){return new Ir({add:s})},remove:function(s){return new Ir({remove:s})},default:an,RangeSet:yt,mergeRanges:Mr,rangesOverlap:Xl}),{default:an}),an})}(sa)),sa.exports}var Bv=jv();const Iu=Wa(Bv),Oc=Symbol.for("Dexie"),_a=globalThis[Oc]||(globalThis[Oc]=Iu);if(Iu.semVer!==_a.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Iu.semVer} and ${_a.semVer}`);const{liveQuery:iw,mergeRanges:aw,rangesOverlap:sw,RangeSet:ow,cmp:uw,Entity:lw,PropModification:cw,replacePrefix:dw,add:fw,remove:hw}=_a;class $h extends _a{constructor(n,r,i={}){super(n);Ae(this,"logs");const a={logs:"id, level, time, source, account"};this.version(r).stores({...a,...i})}}class Mv extends $h{constructor(){super("nizza",1)}}const jh=new Mv;class Bh{constructor(e,n){Ae(this,"logger");Ae(this,"channel");Ae(this,"listeners",new Map);Ae(this,"eventQueue",new Map);this.logger=n.child("EventBus");try{this.logger.debug(`Creating BroadcastChannel with name "${e}"`),this.channel=new BroadcastChannel(e),this.channel.onmessage=r=>this.handleMessage(r),this.channel.onmessageerror=r=>this.logger.error("NizzaBroadcastChannel error:",r)}catch(r){throw this.logger.error("Failed to create NizzaBroadcastChannel:",r),r}}on(e,n){return this.logger.debug(`Subscribing to pattern "${e}"`),this.subscribeToEvent(e,n),{off:()=>this.unsubscribeFromEvent(e,n)}}emit(e,n,r={}){this.logger.debug(`Emitting event "${e}" with data`,n),this.emitEvent(e,n,r)}handleMessage(e){const n=e.data,{name:r}=n;this.logger.debug(`Received message "${r}" with data`,n);for(const[i,a]of this.listeners.entries())this.matchWildcard(i,r)&&(this.logger.debug(`Matching pattern "${i}" for event "${r}"`),a.forEach(o=>o({...n,wildcard:i})))}subscribeToEvent(e,n){if(typeof e!="string"||typeof n!="function"){const i=new Error("Invalid arguments");throw this.logger.error(i),i}this.listeners.has(e)||(this.logger.debug(`Adding new pattern "${e}"`),this.listeners.set(e,new Set));const r=Array.from(this.eventQueue).filter(([i])=>{const a=this.matchWildcard(e,i);return a&&(this.eventQueue.delete(i),this.logger.debug(`Dequeued pending events for "${i}".`)),a}).flatMap(([,i])=>i);for(const[i,a]of this.listeners.entries())this.matchWildcard(i,e)&&(this.logger.debug(`Adding listener to pattern "${i}"`),a.add(n),r.length&&(this.logger.debug(`Delivering pending events for "${e}".`),r.forEach(o=>{n({...o,wildcard:i})})))}emitEvent(e,n,r){if(typeof e!="string"){const o=new Error("Invalid arguments");throw this.logger.error(o),o}const i={name:e,data:n,attrs:r},a=Array.from(this.getMatchingListeners(e));if(a.length){this.logger.debug(`Delivering event "${e}" to listeners`);for(const[o,l]of a)l({...i,wildcard:o})}else this.logger.debug(`No listeners for event "${e}", enqueuing`),this.eventQueue.has(e)||this.eventQueue.set(e,[]),this.eventQueue.get(e).push(i);this.logger.debug("Posting message to channel",i),this.channel.postMessage(i)}*getMatchingListeners(e){this.logger.debug(`Getting matching listeners for event "${e}"`);for(const[n,r]of this.listeners.entries())if(this.matchWildcard(n,e))for(const i of r)yield[n,i]}unsubscribeFromEvent(e,n){if(this.listeners.has(e)){this.logger.debug(`Unsubscribing from event "${e}"`);const r=this.listeners.get(e);r.delete(n),r.size===0&&(this.logger.debug(`No more listeners for event "${e}", deleting`),this.listeners.delete(e))}}matchWildcard(e,n){const r=e.replace(/\*/g,"[^:]*").replace(/\*\*/g,".*"),a=new RegExp(`^${r}$`).test(n);return this.logger.debug(`Wildcard "${e}" matches with pattern "${n}": ${a}`),a}}var Vr={exports:{}},io,Rc;function Uv(){if(Rc)return io;Rc=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}io=e;function e(n,r,i){var a=i&&i.stringify||t,o=1;if(typeof n=="object"&&n!==null){var l=r.length+o;if(l===1)return n;var c=new Array(l);c[0]=a(n);for(var f=1;f<l;f++)c[f]=a(r[f]);return c.join(" ")}if(typeof n!="string")return n;var h=r.length;if(h===0)return n;for(var y="",m=1-o,O=-1,A=n&&n.length||0,E=0;E<A;){if(n.charCodeAt(E)===37&&E+1<A){switch(O=O>-1?O:0,n.charCodeAt(E+1)){case 100:case 102:if(m>=h||r[m]==null)break;O<E&&(y+=n.slice(O,E)),y+=Number(r[m]),O=E+2,E++;break;case 105:if(m>=h||r[m]==null)break;O<E&&(y+=n.slice(O,E)),y+=Math.floor(Number(r[m])),O=E+2,E++;break;case 79:case 111:case 106:if(m>=h||r[m]===void 0)break;O<E&&(y+=n.slice(O,E));var b=typeof r[m];if(b==="string"){y+="'"+r[m]+"'",O=E+2,E++;break}if(b==="function"){y+=r[m].name||"<anonymous>",O=E+2,E++;break}y+=a(r[m]),O=E+2,E++;break;case 115:if(m>=h)break;O<E&&(y+=n.slice(O,E)),y+=String(r[m]),O=E+2,E++;break;case 37:O<E&&(y+=n.slice(O,E)),y+="%",O=E+2,E++,m--;break}++m}++E}return O===-1?n:(O<A&&(y+=n.slice(O)),y)}return io}var Tc;function Vv(){if(Tc)return Vr.exports;Tc=1;const t=Uv();Vr.exports=h;const e=j().console||{},n={mapHttpRequest:I,mapHttpResponse:I,wrapRequestSerializer:re,wrapResponseSerializer:re,wrapErrorSerializer:re,req:I,res:I,err:x,errWithCause:x};function r(w,J){return w==="silent"?1/0:J.levels.values[w]}const i=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function l(w,J){const te={logger:J,parent:w[a]};J[a]=te}function c(w,J,te){const ne={};J.forEach(se=>{ne[se]=te[se]?te[se]:e[se]||e[o[se]||"log"]||ie}),w[i]=ne}function f(w,J){return Array.isArray(w)?w.filter(function(ne){return ne!=="!stdSerializers.err"}):w===!0?Object.keys(J):!1}function h(w){w=w||{},w.browser=w.browser||{};const J=w.browser.transmit;if(J&&typeof J.send!="function")throw Error("pino: transmit option must have a send function");const te=w.browser.write||e;w.browser.write&&(w.browser.asObject=!0);const ne=w.serializers||{},se=f(w.browser.serialize,ne);let me=w.browser.serialize;Array.isArray(w.browser.serialize)&&w.browser.serialize.indexOf("!stdSerializers.err")>-1&&(me=!1);const G=Object.keys(w.customLevels||{}),D=["error","fatal","warn","info","debug","trace"].concat(G);typeof te=="function"&&D.forEach(function(Ce){te[Ce]=te}),(w.enabled===!1||w.browser.disabled)&&(w.level="silent");const Q=w.level||"info",q=Object.create(te);q.log||(q.log=ie),c(q,D,te),l({},q),Object.defineProperty(q,"levelVal",{get:W}),Object.defineProperty(q,"level",{get:ge,set:ce});const B={transmit:J,serialize:se,asObject:w.browser.asObject,formatters:w.browser.formatters,levels:D,timestamp:z(w),messageKey:w.messageKey||"msg",onChild:w.onChild||ie};q.levels=y(w),q.level=Q,q.setMaxListeners=q.getMaxListeners=q.emit=q.addListener=q.on=q.prependListener=q.once=q.prependOnceListener=q.removeListener=q.removeAllListeners=q.listeners=q.listenerCount=q.eventNames=q.write=q.flush=ie,q.serializers=ne,q._serialize=se,q._stdErrSerialize=me,q.child=function(...Ce){return oe.call(this,B,...Ce)},J&&(q._logEvent=R());function W(){return r(this.level,this)}function ge(){return this._level}function ce(Ce){if(Ce!=="silent"&&!this.levels.values[Ce])throw Error("unknown level "+Ce);this._level=Ce,A(this,B,q,"error"),A(this,B,q,"fatal"),A(this,B,q,"warn"),A(this,B,q,"info"),A(this,B,q,"debug"),A(this,B,q,"trace"),G.forEach(xe=>{A(this,B,q,xe)})}function oe(Ce,xe,we){if(!xe)throw new Error("missing bindings for child Pino");we=we||{},se&&xe.serializers&&(we.serializers=xe.serializers);const ct=we.serializers;if(se&&ct){var Ze=Object.assign({},ne,ct),We=w.browser.serialize===!0?Object.keys(Ze):se;delete xe.serializers,C([xe],We,Ze,this._stdErrSerialize)}function Pe(Ft){this._childLevel=(Ft._childLevel|0)+1,this.bindings=xe,Ze&&(this.serializers=Ze,this._serialize=We),J&&(this._logEvent=R([].concat(Ft._logEvent.bindings,xe)))}Pe.prototype=this;const Je=new Pe(this);return l(this,Je),Je.child=function(...Ft){return oe.call(this,Ce,...Ft)},Je.level=we.level||this.level,Ce.onChild(Je),Je}return q}function y(w){const J=w.customLevels||{},te=Object.assign({},h.levels.values,J),ne=Object.assign({},h.levels.labels,m(J));return{values:te,labels:ne}}function m(w){const J={};return Object.keys(w).forEach(function(te){J[w[te]]=te}),J}h.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},h.stdSerializers=n,h.stdTimeFunctions=Object.assign({},{nullTime:ke,epochTime:he,unixTime:Ee,isoTime:le});function O(w){const J=[];w.bindings&&J.push(w.bindings);let te=w[a];for(;te.parent;)te=te.parent,te.logger.bindings&&J.push(te.logger.bindings);return J.reverse()}function A(w,J,te,ne){if(Object.defineProperty(w,ne,{value:r(w.level,te)>r(ne,te)?ie:te[i][ne],writable:!0,enumerable:!0,configurable:!0}),w[ne]===ie){if(!J.transmit)return;const me=J.transmit.level||w.level,G=r(me,te);if(r(ne,te)<G)return}w[ne]=b(w,J,te,ne);const se=O(w);se.length!==0&&(w[ne]=E(se,w[ne]))}function E(w,J){return function(){return J.apply(this,[...w,...arguments])}}function b(w,J,te,ne){return function(se){return function(){const G=J.timestamp(),D=new Array(arguments.length),Q=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var q=0;q<D.length;q++)D[q]=arguments[q];var B=!1;if(J.serialize&&(C(D,this._serialize,this.serializers,this._stdErrSerialize),B=!0),J.asObject||J.formatters?se.call(Q,k(this,ne,D,G,J)):se.apply(Q,D),J.transmit){const W=J.transmit.level||w._level,ge=r(W,te),ce=r(ne,te);if(ce<ge)return;S(this,{ts:G,methodLevel:ne,methodValue:ce,transmitValue:te.levels.values[J.transmit.level||w._level],send:J.transmit.send,val:r(w._level,te)},D,B)}}}(w[i][ne])}function k(w,J,te,ne,se){const{level:me,log:G=ge=>ge}=se.formatters||{},D=te.slice();let Q=D[0];const q={};if(ne&&(q.time=ne),me){const ge=me(J,w.levels.values[J]);Object.assign(q,ge)}else q.level=w.levels.values[J];let B=(w._childLevel|0)+1;if(B<1&&(B=1),Q!==null&&typeof Q=="object"){for(;B--&&typeof D[0]=="object";)Object.assign(q,D.shift());Q=D.length?t(D.shift(),D):void 0}else typeof Q=="string"&&(Q=t(D.shift(),D));return Q!==void 0&&(q[se.messageKey]=Q),G(q)}function C(w,J,te,ne){for(const se in w)if(ne&&w[se]instanceof Error)w[se]=h.stdSerializers.err(w[se]);else if(typeof w[se]=="object"&&!Array.isArray(w[se])&&J)for(const me in w[se])J.indexOf(me)>-1&&me in te&&(w[se][me]=te[me](w[se][me]))}function S(w,J,te,ne=!1){const se=J.send,me=J.ts,G=J.methodLevel,D=J.methodValue,Q=J.val,q=w._logEvent.bindings;ne||C(te,w._serialize||Object.keys(w.serializers),w.serializers,w._stdErrSerialize===void 0?!0:w._stdErrSerialize),w._logEvent.ts=me,w._logEvent.messages=te.filter(function(B){return q.indexOf(B)===-1}),w._logEvent.level.label=G,w._logEvent.level.value=D,se(G,w._logEvent,Q),w._logEvent=R(q)}function R(w){return{ts:0,messages:[],bindings:w||[],level:{label:"",value:0}}}function x(w){const J={type:w.constructor.name,msg:w.message,stack:w.stack};for(const te in w)J[te]===void 0&&(J[te]=w[te]);return J}function z(w){return typeof w.timestamp=="function"?w.timestamp:w.timestamp===!1?ke:he}function I(){return{}}function re(w){return w}function ie(){}function ke(){return!1}function he(){return Date.now()}function Ee(){return Math.round(Date.now()/1e3)}function le(){return new Date(Date.now()).toISOString()}function j(){function w(J){return typeof J!="undefined"&&J}try{return typeof globalThis!="undefined"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return w(self)||w(window)||w(this)||{}}}return Vr.exports.default=h,Vr.exports.pino=h,Vr.exports}var qv=Vv();const Hv=Wa(qv),mt=[];for(let t=0;t<256;++t)mt.push((t+256).toString(16).slice(1));function Kv(t,e=0){return(mt[t[e+0]]+mt[t[e+1]]+mt[t[e+2]]+mt[t[e+3]]+"-"+mt[t[e+4]]+mt[t[e+5]]+"-"+mt[t[e+6]]+mt[t[e+7]]+"-"+mt[t[e+8]]+mt[t[e+9]]+"-"+mt[t[e+10]]+mt[t[e+11]]+mt[t[e+12]]+mt[t[e+13]]+mt[t[e+14]]+mt[t[e+15]]).toLowerCase()}let ao;const zv=new Uint8Array(16);function Gv(){if(!ao){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ao=crypto.getRandomValues.bind(crypto)}return ao(zv)}const Wv=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Cc={randomUUID:Wv};function Jv(t,e,n){var i,a,o;if(Cc.randomUUID&&!t)return Cc.randomUUID();t=t||{};const r=(o=(a=t.random)!=null?a:(i=t.rng)==null?void 0:i.call(t))!=null?o:Gv();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Kv(r)}const Yv=4;var Mh=(t=>(t.CREATED="CREATED",t.STARTING="STARTING",t.LIVE="LIVE",t.FINALIZED="FINALIZED",t))(Mh||{});const Qv={ALL:"*",CORE:"core:**",ADD_TO_CART_HOOKS:"core:addToCartHooks:**",LIVE_STREAMING_EVENT:"event:**",EVENT_CHAT:"event:chat:**",EVENT_PRODUCTS:"event:products:**",CUSTOMIZE_LIVE:"customize-live:**",PLAYER:"player:**",SNACK_SIZE_VIDEO:"ssv:**",SNACK_SIZE_VIDEO_ADMIN:"ssv-admin:**",UI:"ui:**",UTILS:"utils:**"},Uh={EVENT_STATUS_CHANGED:"event:statusChanged",ATCH_ACTION_EXECUTED:"core:addToCartHooks:actionExecuted"};var Vh=(t=>(t.English="en",t.Spanish="es",t.Portuguese="pt",t))(Vh||{}),it=(t=>(t.TRACE="trace",t.DEBUG="debug",t.INFO="info",t.WARN="warn",t.ERROR="error",t.FATAL="fatal",t))(it||{});const Qe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},qh={[Qe.trace]:"trace",[Qe.debug]:"debug",[Qe.info]:"info",[Qe.warn]:"warn",[Qe.error]:"error",[Qe.fatal]:"fatal"};var Hh=(t=>(t.COMBO="Combo",t.BADGE="Badged",t))(Hh||{}),Kh=(t=>(t.VTEX="VTEX",t.PLATFORM="platform",t.CACE="CACE",t.GLOBAL_PAGE="globalPage",t.CUSTOMIZATION="customization",t.FAST_STORE="faststore",t.UNKNOWN="unknown",t))(Kh||{});function zh(t){return Object.values(it).includes(String(t).toLowerCase())}class ul extends Error{constructor(e){super(`Invalid log level: ${e}`),this.name="InvalidLogLevelError"}}const _t=class _t{constructor(e){Ae(this,"instance");Ae(this,"httpLogger");Ae(this,"consoleLogger");Ae(this,"config");var l;this.config=e;const{source:n,levelService:r,metadata:i={},consoleLogger:a,httpLogger:o}=e;(l=_t.root)!=null||(_t.root=_t.createRootLogger(a,o)),_t.mergeGlobalMetadata(i),this.instance=_t.root.child({source:n}),this.consoleLogger=a,this.httpLogger=o,this.setLevel(r.getLevel(n))}static createRootLogger(e,n){return Hv({customLevels:Qe,browser:{write:r=>{const{payload:i,options:a,stack:o,...l}=r,c={...l,...i};a.silent||e.print(c,o),c.level>=Qe[it.WARN]&&n.save(c)}}})}static mergeGlobalMetadata(e={}){_t.globalMetadata={..._t.globalMetadata,...e}}child(e,n={}){return _t.mergeGlobalMetadata(n),new _t({source:`${this.config.source}:${e}`,levelService:this.config.levelService,consoleLogger:this.consoleLogger,httpLogger:this.httpLogger})}setLevel(e){this.instance.level=e}setMetadata(e){_t.mergeGlobalMetadata(e)}formatLogEntry(e){const{content:n,stack:r,options:i={}}=e,{message:a,args:o=[]}=n,l=Jv(),c={};let f;return a instanceof Error?(c.error={name:a.name,message:a.message,stack:a.stack},f=a.message):f=typeof a=="object"?JSON.stringify(a):String(a),o.forEach((y,m)=>this.formatArg(y,m,c)),{payload:{id:l,msg:f,data:c,..._t.globalMetadata},options:i,stack:r}}formatArg(e,n,r){if(e instanceof Error){const i=r.error?`error${n+1}`:"error";r[i]={message:e.message,stack:e.stack,name:e.name}}else typeof e=="object"&&e!==null?Object.assign(r,e):r[`$${n}`]=String(e)}log(e,n){if(typeof this.instance[e]!="function")throw new ul(e);const r=this.formatLogEntry(n);this.instance[e](r)}trace(e){this.log("trace",e)}debug(e){this.log("debug",e)}info(e){this.log("info",e)}warn(e){this.log("warn",e)}error(e){this.log("error",e)}fatal(e){this.log("fatal",e)}get source(){return this.config.source}};Ae(_t,"globalMetadata",{}),Ae(_t,"root",null);let Du=_t;const xc={stackExclusionPatterns:/\b(PinoAdapter|ConsoleLogger|LoggerChain|Logger|Proxy|Child|pino\.js)\b/,themes:{dark:{baseStyles:{timestamp:"color: #A9A9A9; font-weight: normal;",source:"color: #B0B0B0; font-weight: normal;",context:"color: #FFFFFF; font-weight: bold;",defaultMessage:"color: #E5E5E5; font-weight: normal;"},levels:{[Qe[it.TRACE]]:"color: #778899; font-weight: bold;",[Qe[it.DEBUG]]:"color: #008B8B; font-weight: bold;",[Qe[it.INFO]]:"color: #00FFFF; font-weight: bold;",[Qe[it.WARN]]:"color: #FFD700; font-weight: bold;",[Qe[it.ERROR]]:"color: #FF4500; font-weight: bold;",[Qe[it.FATAL]]:"color: #FF0000; font-weight: bold; text-shadow: 1px 1px 1px black;"},messages:{[Qe[it.WARN]]:"color: #FFD700; font-weight: normal;",[Qe[it.ERROR]]:"color: #FF4500; font-weight: normal;",[Qe[it.FATAL]]:"color: #FF0000; font-weight: bold;"}},light:{baseStyles:{timestamp:"color: #4D4D4D; font-weight: normal;",source:"color: #666666; font-weight: normal;",context:"color: #000000; font-weight: bold;",defaultMessage:"color: #333333; font-weight: normal;"},levels:{[Qe[it.TRACE]]:"color: #6A5ACD; font-weight: bold;",[Qe[it.DEBUG]]:"color: #00509E; font-weight: bold;",[Qe[it.INFO]]:"color: #1E90FF; font-weight: bold;",[Qe[it.WARN]]:"color: #FFA500; font-weight: bold;",[Qe[it.ERROR]]:"color: #ff0033; font-weight: bold;",[Qe[it.FATAL]]:"color: #D80000; font-weight: bold; text-shadow: 1px 1px 1px #660000;"},messages:{[Qe[it.WARN]]:"color: #FFA500; font-weight: normal;",[Qe[it.ERROR]]:"color: #ff0033; font-weight: normal;",[Qe[it.FATAL]]:"color: #D80000; font-weight: bold;"}}}};class Xv{constructor(){Ae(this,"theme");this.theme=this.initializeTheme(),this.setupThemeChangeListener()}initializeTheme(){const e=localStorage.getItem("log-theme");return e==="light"||e==="dark"?e:this.detectTheme()}detectTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}setupThemeChangeListener(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{this.theme=e.matches?"dark":"light"})}static setTheme(e){localStorage.setItem("consoleLoggerTheme",e)}formatStack(e){return e.split(`
29
- `).filter(n=>!xc.stackExclusionPatterns.test(n)).map(n=>n.replace(/^Error\s*/,"").trim())}getStyles(e){const n=xc.themes[this.theme];return{...n.baseStyles,level:n.levels[e]||n.baseStyles.defaultMessage,message:n.messages[e]||n.baseStyles.defaultMessage}}getTime(){return new Date().toLocaleTimeString("en-US",{hour12:!1})+`.${new Date().getMilliseconds().toString().padStart(3,"0")}`}print({level:e,source:n,msg:r,data:i},a){const[o,l,c]=n.split(":"),f=(qh[e]||"UNKNOWN").toUpperCase(),h=c?`${c}: `:"",y=l?`:${l}`:"",m=this.getStyles(e);console.groupCollapsed(`%c${this.getTime()} %c${f} %c[${o}${y}] %c${h}%c${r}`,m.timestamp,m.level,m.source,m.context,m.message),i&&Object.keys(i).length&&console.log("Data:",i);const O=this.formatStack(a||new Error().stack);O.length&&console.log("Stack:",O.join(`
30
- `)),console.groupEnd()}}const Zv={endpoint:`${_r.apiUrls.restV2}/v1/telemetry/logs`,batchSize:500,flushInterval:10,maxRetries:5,retryBackoffFactor:2,maxPayloadSize:500};class ll{constructor(e){Ae(this,"config");Ae(this,"isFlushing",!1);Ae(this,"retryCount",0);Ae(this,"isFlushScheduled",!1);this.config=e,this.setupUnloadListener()}static create(e){const n={...Zv,...e};if(!n.db)throw new Error("Invalid Dixie DB");if(!n.project)throw new Error("Project name is required");return new ll(n)}async save(e){const n=JSON.parse(JSON.stringify(e));await this.config.db.logs.add(n),this.scheduleFlush()}scheduleFlush(e=this.config.flushInterval*1e3){this.isFlushScheduled||this.isFlushing||(this.isFlushScheduled=!0,setTimeout(()=>{this.isFlushScheduled=!1,this.flush()},e))}async flush(){if(this.isFlushing)return;this.isFlushing=!0;let e=!1;try{await this.processLogsBatch(async r=>{await this.sendLogs(r),await this.deleteLogs(r)}),this.retryCount=0,e=!0}catch(r){this.logError("flush",r)}this.isFlushing=!1;const n=await this.hasPendingLogs();!e&&n?this.handleRetry():e&&n&&this.scheduleFlush()}async processLogsBatch(e){const n=await this.getLogsBatch(),r=this.splitLogsByPayloadSize(n);for(const i of r)await e(i)}async getLogsBatch(e=this.config.batchSize){return this.config.db.logs.orderBy("time").limit(e).toArray()}splitLogsByPayloadSize(e){let n=[],r=0;const i=[];return e.forEach(a=>{const o=JSON.stringify(a).length/1024;r+o>this.config.maxPayloadSize&&(i.push(n),n=[],r=0),n.push(a),r+=o}),n.length>0&&i.push(n),i}async sendLogs(e){const n=this.buildPayload(e);await qn({url:this.config.endpoint,method:"POST",body:n})}buildPayload(e){return JSON.stringify({project:this.config.project,logs:e})}async deleteLogs(e){const n=e.map(r=>r.id);await this.config.db.logs.bulkDelete(n)}logError(e,n){console.error(`[${e}]`,n)}handleRetry(){if(this.retryCount>=this.config.maxRetries)return;this.retryCount++;const e=this.config.flushInterval*Math.pow(this.config.retryBackoffFactor,this.retryCount)*1e3;this.scheduleFlush(e)}async hasPendingLogs(){return await this.config.db.logs.count()>0}setupUnloadListener(){window.addEventListener("beforeunload",async()=>{this.isFlushing||!await this.hasPendingLogs()||await this.processLogsBatch(async e=>{const n=this.buildPayload(e);navigator.sendBeacon(this.config.endpoint,n)?await this.deleteLogs(e):console.warn("Failed to send logs via sendBeacon; logs will remain in the database.")})})}}var so={},oo={},uo,Pc;function Gh(){return Pc||(Pc=1,uo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,n);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),uo}var lo,Fc;function cl(){if(Fc)return lo;Fc=1;var t=Gh();return lo=function(){return t()&&!!Symbol.toStringTag},lo}var co,Ic;function eb(){return Ic||(Ic=1,co=Error),co}var fo,Dc;function tb(){return Dc||(Dc=1,fo=EvalError),fo}var ho,Lc;function nb(){return Lc||(Lc=1,ho=RangeError),ho}var po,$c;function rb(){return $c||($c=1,po=ReferenceError),po}var mo,jc;function Wh(){return jc||(jc=1,mo=SyntaxError),mo}var go,Bc;function Ja(){return Bc||(Bc=1,go=TypeError),go}var yo,Mc;function ib(){return Mc||(Mc=1,yo=URIError),yo}var vo,Uc;function ab(){if(Uc)return vo;Uc=1;var t=typeof Symbol!="undefined"&&Symbol,e=Gh();return vo=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},vo}var bo,Vc;function sb(){if(Vc)return bo;Vc=1;var t={__proto__:null,foo:{}},e=Object;return bo=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},bo}var ko,qc;function ob(){if(qc)return ko;qc=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",i=function(c,f){for(var h=[],y=0;y<c.length;y+=1)h[y]=c[y];for(var m=0;m<f.length;m+=1)h[m+c.length]=f[m];return h},a=function(c,f){for(var h=[],y=f,m=0;y<c.length;y+=1,m+=1)h[m]=c[y];return h},o=function(l,c){for(var f="",h=0;h<l.length;h+=1)f+=l[h],h+1<l.length&&(f+=c);return f};return ko=function(c){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var h=a(arguments,1),y,m=function(){if(this instanceof y){var k=f.apply(this,i(h,arguments));return Object(k)===k?k:this}return f.apply(c,i(h,arguments))},O=n(0,f.length-h.length),A=[],E=0;E<O;E++)A[E]="$"+E;if(y=Function("binder","return function ("+o(A,",")+"){ return binder.apply(this,arguments); }")(m),f.prototype){var b=function(){};b.prototype=f.prototype,y.prototype=new b,b.prototype=null}return y},ko}var _o,Hc;function dl(){if(Hc)return _o;Hc=1;var t=ob();return _o=Function.prototype.bind||t,_o}var So,Kc;function ub(){if(Kc)return So;Kc=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=dl();return So=n.call(t,e),So}var Ao,zc;function yi(){if(zc)return Ao;zc=1;var t,e=eb(),n=tb(),r=nb(),i=rb(),a=Wh(),o=Ja(),l=ib(),c=Function,f=function(te){try{return c('"use strict"; return ('+te+").constructor;")()}catch{}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch{h=null}var y=function(){throw new o},m=h?function(){try{return arguments.callee,y}catch{try{return h(arguments,"callee").get}catch{return y}}}():y,O=ab()(),A=sb()(),E=Object.getPrototypeOf||(A?function(te){return te.__proto__}:null),b={},k=typeof Uint8Array=="undefined"||!E?t:E(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?t:ArrayBuffer,"%ArrayIteratorPrototype%":O&&E?E([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics=="undefined"?t:Atomics,"%BigInt%":typeof BigInt=="undefined"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array=="undefined"?t:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?t:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array=="undefined"?t:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?t:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O&&E?E(E([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map=="undefined"?t:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!O||!E?t:E(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?t:Promise,"%Proxy%":typeof Proxy=="undefined"?t:Proxy,"%RangeError%":r,"%ReferenceError%":i,"%Reflect%":typeof Reflect=="undefined"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?t:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!O||!E?t:E(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&E?E(""[Symbol.iterator]()):t,"%Symbol%":O?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":m,"%TypedArray%":k,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array=="undefined"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap=="undefined"?t:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?t:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?t:WeakSet};if(E)try{null.error}catch(te){var S=E(E(te));C["%Error.prototype%"]=S}var R=function te(ne){var se;if(ne==="%AsyncFunction%")se=f("async function () {}");else if(ne==="%GeneratorFunction%")se=f("function* () {}");else if(ne==="%AsyncGeneratorFunction%")se=f("async function* () {}");else if(ne==="%AsyncGenerator%"){var me=te("%AsyncGeneratorFunction%");me&&(se=me.prototype)}else if(ne==="%AsyncIteratorPrototype%"){var G=te("%AsyncGenerator%");G&&E&&(se=E(G.prototype))}return C[ne]=se,se},x={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},z=dl(),I=ub(),re=z.call(Function.call,Array.prototype.concat),ie=z.call(Function.apply,Array.prototype.splice),ke=z.call(Function.call,String.prototype.replace),he=z.call(Function.call,String.prototype.slice),Ee=z.call(Function.call,RegExp.prototype.exec),le=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,w=function(ne){var se=he(ne,0,1),me=he(ne,-1);if(se==="%"&&me!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(me==="%"&&se!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var G=[];return ke(ne,le,function(D,Q,q,B){G[G.length]=q?ke(B,j,"$1"):Q||D}),G},J=function(ne,se){var me=ne,G;if(I(x,me)&&(G=x[me],me="%"+G[0]+"%"),I(C,me)){var D=C[me];if(D===b&&(D=R(me)),typeof D=="undefined"&&!se)throw new o("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:G,name:me,value:D}}throw new a("intrinsic "+ne+" does not exist!")};return Ao=function(ne,se){if(typeof ne!="string"||ne.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof se!="boolean")throw new o('"allowMissing" argument must be a boolean');if(Ee(/^%?[^%]*%?$/,ne)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var me=w(ne),G=me.length>0?me[0]:"",D=J("%"+G+"%",se),Q=D.name,q=D.value,B=!1,W=D.alias;W&&(G=W[0],ie(me,re([0,1],W)));for(var ge=1,ce=!0;ge<me.length;ge+=1){var oe=me[ge],Ce=he(oe,0,1),xe=he(oe,-1);if((Ce==='"'||Ce==="'"||Ce==="`"||xe==='"'||xe==="'"||xe==="`")&&Ce!==xe)throw new a("property names with quotes must have matching quotes");if((oe==="constructor"||!ce)&&(B=!0),G+="."+oe,Q="%"+G+"%",I(C,Q))q=C[Q];else if(q!=null){if(!(oe in q)){if(!se)throw new o("base intrinsic for "+ne+" exists, but the property is not available.");return}if(h&&ge+1>=me.length){var we=h(q,oe);ce=!!we,ce&&"get"in we&&!("originalValue"in we.get)?q=we.get:q=q[oe]}else ce=I(q,oe),q=q[oe];ce&&!B&&(C[Q]=q)}}return q},Ao}var Eo={exports:{}},wo,Gc;function fl(){if(Gc)return wo;Gc=1;var t=yi(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return wo=e,wo}var No,Wc;function hl(){if(Wc)return No;Wc=1;var t=yi(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return No=e,No}var Oo,Jc;function lb(){if(Jc)return Oo;Jc=1;var t=fl(),e=Wh(),n=Ja(),r=hl();return Oo=function(a,o,l){if(!a||typeof a!="object"&&typeof a!="function")throw new n("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,m=!!r&&r(a,o);if(t)t(a,o,{configurable:h===null&&m?m.configurable:!h,enumerable:c===null&&m?m.enumerable:!c,value:l,writable:f===null&&m?m.writable:!f});else if(y||!c&&!f&&!h)a[o]=l;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Oo}var Ro,Yc;function cb(){if(Yc)return Ro;Yc=1;var t=fl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Ro=e,Ro}var To,Qc;function db(){if(Qc)return To;Qc=1;var t=yi(),e=lb(),n=cb()(),r=hl(),i=Ja(),a=t("%Math.floor%");return To=function(l,c){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||a(c)!==c)throw new i("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],h=!0,y=!0;if("length"in l&&r){var m=r(l,"length");m&&!m.configurable&&(h=!1),m&&!m.writable&&(y=!1)}return(h||y||!f)&&(n?e(l,"length",c,!0,!0):e(l,"length",c)),l},To}var Xc;function Jh(){return Xc||(Xc=1,function(t){var e=dl(),n=yi(),r=db(),i=Ja(),a=n("%Function.prototype.apply%"),o=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||e.call(o,a),c=fl(),f=n("%Math.max%");t.exports=function(m){if(typeof m!="function")throw new i("a function is required");var O=l(e,o,arguments);return r(O,1+f(0,m.length-(arguments.length-1)),!0)};var h=function(){return l(e,a,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h}(Eo)),Eo.exports}var Co,Zc;function Yh(){if(Zc)return Co;Zc=1;var t=yi(),e=Jh(),n=e(t("String.prototype.indexOf"));return Co=function(i,a){var o=t(i,!!a);return typeof o=="function"&&n(i,".prototype.")>-1?e(o):o},Co}var xo,ed;function fb(){if(ed)return xo;ed=1;var t=cl()(),e=Yh(),n=e("Object.prototype.toString"),r=function(l){return t&&l&&typeof l=="object"&&Symbol.toStringTag in l?!1:n(l)==="[object Arguments]"},i=function(l){return r(l)?!0:l!==null&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&n(l)!=="[object Array]"&&n(l.callee)==="[object Function]"},a=function(){return r(arguments)}();return r.isLegacyArguments=i,xo=a?r:i,xo}var Po,td;function hb(){if(td)return Po;td=1;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=cl()(),i=Object.getPrototypeOf,a=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},o;return Po=function(c){if(typeof c!="function")return!1;if(n.test(e.call(c)))return!0;if(!r){var f=t.call(c);return f==="[object GeneratorFunction]"}if(!i)return!1;if(typeof o=="undefined"){var h=a();o=h?i(h):!1}return i(c)===o},Po}var Fo,nd;function pb(){if(nd)return Fo;nd=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(C){C!==r&&(e=null)}else e=null;var i=/^\s*class\b/,a=function(S){try{var R=t.call(S);return i.test(R)}catch{return!1}},o=function(S){try{return a(S)?!1:(t.call(S),!0)}catch{return!1}},l=Object.prototype.toString,c="[object Object]",f="[object Function]",h="[object GeneratorFunction]",y="[object HTMLAllCollection]",m="[object HTML document.all class]",O="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,E=!(0 in[,]),b=function(){return!1};if(typeof document=="object"){var k=document.all;l.call(k)===l.call(document.all)&&(b=function(S){if((E||!S)&&(typeof S=="undefined"||typeof S=="object"))try{var R=l.call(S);return(R===y||R===m||R===O||R===c)&&S("")==null}catch{}return!1})}return Fo=e?function(S){if(b(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;try{e(S,null,n)}catch(R){if(R!==r)return!1}return!a(S)&&o(S)}:function(S){if(b(S))return!0;if(!S||typeof S!="function"&&typeof S!="object")return!1;if(A)return o(S);if(a(S))return!1;var R=l.call(S);return R!==f&&R!==h&&!/^\[object HTML/.test(R)?!1:o(S)},Fo}var Io,rd;function mb(){if(rd)return Io;rd=1;var t=pb(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(c,f,h){for(var y=0,m=c.length;y<m;y++)n.call(c,y)&&(h==null?f(c[y],y,c):f.call(h,c[y],y,c))},i=function(c,f,h){for(var y=0,m=c.length;y<m;y++)h==null?f(c.charAt(y),y,c):f.call(h,c.charAt(y),y,c)},a=function(c,f,h){for(var y in c)n.call(c,y)&&(h==null?f(c[y],y,c):f.call(h,c[y],y,c))},o=function(c,f,h){if(!t(f))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=h),e.call(c)==="[object Array]"?r(c,f,y):typeof c=="string"?i(c,f,y):a(c,f,y)};return Io=o,Io}var Do,id;function gb(){return id||(id=1,Do=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Do}var Lo,ad;function yb(){if(ad)return Lo;ad=1;var t=gb(),e=typeof globalThis=="undefined"?ol:globalThis;return Lo=function(){for(var r=[],i=0;i<t.length;i++)typeof e[t[i]]=="function"&&(r[r.length]=t[i]);return r},Lo}var $o,sd;function Qh(){if(sd)return $o;sd=1;var t=mb(),e=yb(),n=Jh(),r=Yh(),i=hl(),a=r("Object.prototype.toString"),o=cl()(),l=typeof globalThis=="undefined"?ol:globalThis,c=e(),f=r("String.prototype.slice"),h=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(b,k){for(var C=0;C<b.length;C+=1)if(b[C]===k)return C;return-1},m={__proto__:null};o&&i&&h?t(c,function(E){var b=new l[E];if(Symbol.toStringTag in b){var k=h(b),C=i(k,Symbol.toStringTag);if(!C){var S=h(k);C=i(S,Symbol.toStringTag)}m["$"+E]=n(C.get)}}):t(c,function(E){var b=new l[E],k=b.slice||b.set;k&&(m["$"+E]=n(k))});var O=function(b){var k=!1;return t(m,function(C,S){if(!k)try{"$"+C(b)===S&&(k=f(S,1))}catch{}}),k},A=function(b){var k=!1;return t(m,function(C,S){if(!k)try{C(b),k=f(S,1)}catch{}}),k};return $o=function(b){if(!b||typeof b!="object")return!1;if(!o){var k=f(a(b),8,-1);return y(c,k)>-1?k:k!=="Object"?!1:A(b)}return i?O(b):null},$o}var jo,od;function vb(){if(od)return jo;od=1;var t=Qh();return jo=function(n){return!!t(n)},jo}var ud;function bb(){return ud||(ud=1,function(t){var e=fb(),n=hb(),r=Qh(),i=vb();function a(V){return V.call.bind(V)}var o=typeof BigInt!="undefined",l=typeof Symbol!="undefined",c=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),y=a(Boolean.prototype.valueOf);if(o)var m=a(BigInt.prototype.valueOf);if(l)var O=a(Symbol.prototype.valueOf);function A(V,qe){if(typeof V!="object")return!1;try{return qe(V),!0}catch{return!1}}t.isArgumentsObject=e,t.isGeneratorFunction=n,t.isTypedArray=i;function E(V){return typeof Promise!="undefined"&&V instanceof Promise||V!==null&&typeof V=="object"&&typeof V.then=="function"&&typeof V.catch=="function"}t.isPromise=E;function b(V){return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?ArrayBuffer.isView(V):i(V)||Q(V)}t.isArrayBufferView=b;function k(V){return r(V)==="Uint8Array"}t.isUint8Array=k;function C(V){return r(V)==="Uint8ClampedArray"}t.isUint8ClampedArray=C;function S(V){return r(V)==="Uint16Array"}t.isUint16Array=S;function R(V){return r(V)==="Uint32Array"}t.isUint32Array=R;function x(V){return r(V)==="Int8Array"}t.isInt8Array=x;function z(V){return r(V)==="Int16Array"}t.isInt16Array=z;function I(V){return r(V)==="Int32Array"}t.isInt32Array=I;function re(V){return r(V)==="Float32Array"}t.isFloat32Array=re;function ie(V){return r(V)==="Float64Array"}t.isFloat64Array=ie;function ke(V){return r(V)==="BigInt64Array"}t.isBigInt64Array=ke;function he(V){return r(V)==="BigUint64Array"}t.isBigUint64Array=he;function Ee(V){return c(V)==="[object Map]"}Ee.working=typeof Map!="undefined"&&Ee(new Map);function le(V){return typeof Map=="undefined"?!1:Ee.working?Ee(V):V instanceof Map}t.isMap=le;function j(V){return c(V)==="[object Set]"}j.working=typeof Set!="undefined"&&j(new Set);function w(V){return typeof Set=="undefined"?!1:j.working?j(V):V instanceof Set}t.isSet=w;function J(V){return c(V)==="[object WeakMap]"}J.working=typeof WeakMap!="undefined"&&J(new WeakMap);function te(V){return typeof WeakMap=="undefined"?!1:J.working?J(V):V instanceof WeakMap}t.isWeakMap=te;function ne(V){return c(V)==="[object WeakSet]"}ne.working=typeof WeakSet!="undefined"&&ne(new WeakSet);function se(V){return ne(V)}t.isWeakSet=se;function me(V){return c(V)==="[object ArrayBuffer]"}me.working=typeof ArrayBuffer!="undefined"&&me(new ArrayBuffer);function G(V){return typeof ArrayBuffer=="undefined"?!1:me.working?me(V):V instanceof ArrayBuffer}t.isArrayBuffer=G;function D(V){return c(V)==="[object DataView]"}D.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&D(new DataView(new ArrayBuffer(1),0,1));function Q(V){return typeof DataView=="undefined"?!1:D.working?D(V):V instanceof DataView}t.isDataView=Q;var q=typeof SharedArrayBuffer!="undefined"?SharedArrayBuffer:void 0;function B(V){return c(V)==="[object SharedArrayBuffer]"}function W(V){return typeof q=="undefined"?!1:(typeof B.working=="undefined"&&(B.working=B(new q)),B.working?B(V):V instanceof q)}t.isSharedArrayBuffer=W;function ge(V){return c(V)==="[object AsyncFunction]"}t.isAsyncFunction=ge;function ce(V){return c(V)==="[object Map Iterator]"}t.isMapIterator=ce;function oe(V){return c(V)==="[object Set Iterator]"}t.isSetIterator=oe;function Ce(V){return c(V)==="[object Generator]"}t.isGeneratorObject=Ce;function xe(V){return c(V)==="[object WebAssembly.Module]"}t.isWebAssemblyCompiledModule=xe;function we(V){return A(V,f)}t.isNumberObject=we;function ct(V){return A(V,h)}t.isStringObject=ct;function Ze(V){return A(V,y)}t.isBooleanObject=Ze;function We(V){return o&&A(V,m)}t.isBigIntObject=We;function Pe(V){return l&&A(V,O)}t.isSymbolObject=Pe;function Je(V){return we(V)||ct(V)||Ze(V)||We(V)||Pe(V)}t.isBoxedPrimitive=Je;function Ft(V){return typeof Uint8Array!="undefined"&&(G(V)||W(V))}t.isAnyArrayBuffer=Ft,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(V){Object.defineProperty(t,V,{enumerable:!1,value:function(){throw new Error(V+" is not supported in userland")}})})}(oo)),oo}var Bo,ld;function kb(){return ld||(ld=1,Bo=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Bo}var Qi={exports:{}},cd;function _b(){return cd||(cd=1,typeof Object.create=="function"?Qi.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qi.exports=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),Qi.exports}var dd;function Xh(){return dd||(dd=1,function(t){var e=Object.getOwnPropertyDescriptors||function(Q){for(var q=Object.keys(Q),B={},W=0;W<q.length;W++)B[q[W]]=Object.getOwnPropertyDescriptor(Q,q[W]);return B},n=/%[sdj%]/g;t.format=function(D){if(!x(D)){for(var Q=[],q=0;q<arguments.length;q++)Q.push(o(arguments[q]));return Q.join(" ")}for(var q=1,B=arguments,W=B.length,ge=String(D).replace(n,function(oe){if(oe==="%%")return"%";if(q>=W)return oe;switch(oe){case"%s":return String(B[q++]);case"%d":return Number(B[q++]);case"%j":try{return JSON.stringify(B[q++])}catch{return"[Circular]"}default:return oe}}),ce=B[q];q<W;ce=B[++q])C(ce)||!ie(ce)?ge+=" "+ce:ge+=" "+o(ce);return ge},t.deprecate=function(D,Q){if(typeof process!="undefined"&&process.noDeprecation===!0)return D;if(typeof process=="undefined")return function(){return t.deprecate(D,Q).apply(this,arguments)};var q=!1;function B(){if(!q){if(process.throwDeprecation)throw new Error(Q);process.traceDeprecation?console.trace(Q):console.error(Q),q=!0}return D.apply(this,arguments)}return B};var r={},i=/^$/;if(process.env.NODE_DEBUG){var a=process.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+a+"$","i")}t.debuglog=function(D){if(D=D.toUpperCase(),!r[D])if(i.test(D)){var Q=process.pid;r[D]=function(){var q=t.format.apply(t,arguments);console.error("%s %d: %s",D,Q,q)}}else r[D]=function(){};return r[D]};function o(D,Q){var q={seen:[],stylize:c};return arguments.length>=3&&(q.depth=arguments[2]),arguments.length>=4&&(q.colors=arguments[3]),k(Q)?q.showHidden=Q:Q&&t._extend(q,Q),I(q.showHidden)&&(q.showHidden=!1),I(q.depth)&&(q.depth=2),I(q.colors)&&(q.colors=!1),I(q.customInspect)&&(q.customInspect=!0),q.colors&&(q.stylize=l),h(q,D,q.depth)}t.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function l(D,Q){var q=o.styles[Q];return q?"\x1B["+o.colors[q][0]+"m"+D+"\x1B["+o.colors[q][1]+"m":D}function c(D,Q){return D}function f(D){var Q={};return D.forEach(function(q,B){Q[q]=!0}),Q}function h(D,Q,q){if(D.customInspect&&Q&&Ee(Q.inspect)&&Q.inspect!==t.inspect&&!(Q.constructor&&Q.constructor.prototype===Q)){var B=Q.inspect(q,D);return x(B)||(B=h(D,B,q)),B}var W=y(D,Q);if(W)return W;var ge=Object.keys(Q),ce=f(ge);if(D.showHidden&&(ge=Object.getOwnPropertyNames(Q)),he(Q)&&(ge.indexOf("message")>=0||ge.indexOf("description")>=0))return m(Q);if(ge.length===0){if(Ee(Q)){var oe=Q.name?": "+Q.name:"";return D.stylize("[Function"+oe+"]","special")}if(re(Q))return D.stylize(RegExp.prototype.toString.call(Q),"regexp");if(ke(Q))return D.stylize(Date.prototype.toString.call(Q),"date");if(he(Q))return m(Q)}var Ce="",xe=!1,we=["{","}"];if(b(Q)&&(xe=!0,we=["[","]"]),Ee(Q)){var ct=Q.name?": "+Q.name:"";Ce=" [Function"+ct+"]"}if(re(Q)&&(Ce=" "+RegExp.prototype.toString.call(Q)),ke(Q)&&(Ce=" "+Date.prototype.toUTCString.call(Q)),he(Q)&&(Ce=" "+m(Q)),ge.length===0&&(!xe||Q.length==0))return we[0]+Ce+we[1];if(q<0)return re(Q)?D.stylize(RegExp.prototype.toString.call(Q),"regexp"):D.stylize("[Object]","special");D.seen.push(Q);var Ze;return xe?Ze=O(D,Q,q,ce,ge):Ze=ge.map(function(We){return A(D,Q,q,ce,We,xe)}),D.seen.pop(),E(Ze,Ce,we)}function y(D,Q){if(I(Q))return D.stylize("undefined","undefined");if(x(Q)){var q="'"+JSON.stringify(Q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return D.stylize(q,"string")}if(R(Q))return D.stylize(""+Q,"number");if(k(Q))return D.stylize(""+Q,"boolean");if(C(Q))return D.stylize("null","null")}function m(D){return"["+Error.prototype.toString.call(D)+"]"}function O(D,Q,q,B,W){for(var ge=[],ce=0,oe=Q.length;ce<oe;++ce)ne(Q,String(ce))?ge.push(A(D,Q,q,B,String(ce),!0)):ge.push("");return W.forEach(function(Ce){Ce.match(/^\d+$/)||ge.push(A(D,Q,q,B,Ce,!0))}),ge}function A(D,Q,q,B,W,ge){var ce,oe,Ce;if(Ce=Object.getOwnPropertyDescriptor(Q,W)||{value:Q[W]},Ce.get?Ce.set?oe=D.stylize("[Getter/Setter]","special"):oe=D.stylize("[Getter]","special"):Ce.set&&(oe=D.stylize("[Setter]","special")),ne(B,W)||(ce="["+W+"]"),oe||(D.seen.indexOf(Ce.value)<0?(C(q)?oe=h(D,Ce.value,null):oe=h(D,Ce.value,q-1),oe.indexOf(`
31
- `)>-1&&(ge?oe=oe.split(`
32
- `).map(function(xe){return" "+xe}).join(`
33
- `).slice(2):oe=`
34
- `+oe.split(`
35
- `).map(function(xe){return" "+xe}).join(`
36
- `))):oe=D.stylize("[Circular]","special")),I(ce)){if(ge&&W.match(/^\d+$/))return oe;ce=JSON.stringify(""+W),ce.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ce=ce.slice(1,-1),ce=D.stylize(ce,"name")):(ce=ce.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ce=D.stylize(ce,"string"))}return ce+": "+oe}function E(D,Q,q){var B=D.reduce(function(W,ge){return ge.indexOf(`
37
- `)>=0,W+ge.replace(/\u001b\[\d\d?m/g,"").length+1},0);return B>60?q[0]+(Q===""?"":Q+`
38
- `)+" "+D.join(`,
39
- `)+" "+q[1]:q[0]+Q+" "+D.join(", ")+" "+q[1]}t.types=bb();function b(D){return Array.isArray(D)}t.isArray=b;function k(D){return typeof D=="boolean"}t.isBoolean=k;function C(D){return D===null}t.isNull=C;function S(D){return D==null}t.isNullOrUndefined=S;function R(D){return typeof D=="number"}t.isNumber=R;function x(D){return typeof D=="string"}t.isString=x;function z(D){return typeof D=="symbol"}t.isSymbol=z;function I(D){return D===void 0}t.isUndefined=I;function re(D){return ie(D)&&j(D)==="[object RegExp]"}t.isRegExp=re,t.types.isRegExp=re;function ie(D){return typeof D=="object"&&D!==null}t.isObject=ie;function ke(D){return ie(D)&&j(D)==="[object Date]"}t.isDate=ke,t.types.isDate=ke;function he(D){return ie(D)&&(j(D)==="[object Error]"||D instanceof Error)}t.isError=he,t.types.isNativeError=he;function Ee(D){return typeof D=="function"}t.isFunction=Ee;function le(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D=="undefined"}t.isPrimitive=le,t.isBuffer=kb();function j(D){return Object.prototype.toString.call(D)}function w(D){return D<10?"0"+D.toString(10):D.toString(10)}var J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function te(){var D=new Date,Q=[w(D.getHours()),w(D.getMinutes()),w(D.getSeconds())].join(":");return[D.getDate(),J[D.getMonth()],Q].join(" ")}t.log=function(){console.log("%s - %s",te(),t.format.apply(t,arguments))},t.inherits=_b(),t._extend=function(D,Q){if(!Q||!ie(Q))return D;for(var q=Object.keys(Q),B=q.length;B--;)D[q[B]]=Q[q[B]];return D};function ne(D,Q){return Object.prototype.hasOwnProperty.call(D,Q)}var se=typeof Symbol!="undefined"?Symbol("util.promisify.custom"):void 0;t.promisify=function(Q){if(typeof Q!="function")throw new TypeError('The "original" argument must be of type Function');if(se&&Q[se]){var q=Q[se];if(typeof q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,se,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(){for(var B,W,ge=new Promise(function(Ce,xe){B=Ce,W=xe}),ce=[],oe=0;oe<arguments.length;oe++)ce.push(arguments[oe]);ce.push(function(Ce,xe){Ce?W(Ce):B(xe)});try{Q.apply(this,ce)}catch(Ce){W(Ce)}return ge}return Object.setPrototypeOf(q,Object.getPrototypeOf(Q)),se&&Object.defineProperty(q,se,{value:q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(q,e(Q))},t.promisify.custom=se;function me(D,Q){if(!D){var q=new Error("Promise was rejected with a falsy value");q.reason=D,D=q}return Q(D)}function G(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function Q(){for(var q=[],B=0;B<arguments.length;B++)q.push(arguments[B]);var W=q.pop();if(typeof W!="function")throw new TypeError("The last argument must be of type Function");var ge=this,ce=function(){return W.apply(ge,arguments)};D.apply(this,q).then(function(oe){process.nextTick(ce.bind(null,null,oe))},function(oe){process.nextTick(me.bind(null,oe,ce))})}return Object.setPrototypeOf(Q,Object.getPrototypeOf(D)),Object.defineProperties(Q,e(D)),Q}t.callbackify=G}(so)),so}var Mo={},fd;function pl(){return fd||(fd=1,function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,n)=>e.nodes.find(r=>r.type===n),t.exceedsLimit=(e,n,r=1,i)=>i===!1||!t.isInteger(e)||!t.isInteger(n)?!1:(Number(n)-Number(e))/Number(r)>=i,t.escapeNode=(e,n=0,r)=>{const i=e.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),t.flatten=(...e)=>{const n=[],r=i=>{for(let a=0;a<i.length;a++){const o=i[a];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(e),n}}(Mo)),Mo}var Uo,hd;function ml(){if(hd)return Uo;hd=1;const t=pl();return Uo=(e,n={})=>{const r=(i,a={})=>{const o=n.escapeInvalid&&t.isInvalidBrace(a),l=i.invalid===!0&&n.escapeInvalid===!0;let c="";if(i.value)return(o||l)&&t.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const f of i.nodes)c+=r(f);return c};return r(e)},Uo}/*!
40
- * is-number <https://github.com/jonschlinkert/is-number>
41
- *
42
- * Copyright (c) 2014-present, Jon Schlinkert.
43
- * Released under the MIT License.
44
- */var Vo,pd;function Sb(){return pd||(pd=1,Vo=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}),Vo}/*!
45
- * to-regex-range <https://github.com/micromatch/to-regex-range>
46
- *
47
- * Copyright (c) 2015-present, Jon Schlinkert.
48
- * Released under the MIT License.
49
- */var qo,md;function Ab(){if(md)return qo;md=1;const t=Sb(),e=(b,k,C)=>{if(t(b)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(k===void 0||b===k)return String(b);if(t(k)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let S={relaxZeros:!0,...C};typeof S.strictZeros=="boolean"&&(S.relaxZeros=S.strictZeros===!1);let R=String(S.relaxZeros),x=String(S.shorthand),z=String(S.capture),I=String(S.wrap),re=b+":"+k+"="+R+x+z+I;if(e.cache.hasOwnProperty(re))return e.cache[re].result;let ie=Math.min(b,k),ke=Math.max(b,k);if(Math.abs(ie-ke)===1){let w=b+"|"+k;return S.capture?`(${w})`:S.wrap===!1?w:`(?:${w})`}let he=A(b)||A(k),Ee={min:b,max:k,a:ie,b:ke},le=[],j=[];if(he&&(Ee.isPadded=he,Ee.maxLen=String(Ee.max).length),ie<0){let w=ke<0?Math.abs(ke):1;j=a(w,Math.abs(ie),Ee,S),ie=Ee.a=0}return ke>=0&&(le=a(ie,ke,Ee,S)),Ee.negatives=j,Ee.positives=le,Ee.result=n(j,le),S.capture===!0?Ee.result=`(${Ee.result})`:S.wrap!==!1&&le.length+j.length>1&&(Ee.result=`(?:${Ee.result})`),e.cache[re]=Ee,Ee.result};function n(b,k,C){let S=o(b,k,"-",!1)||[],R=o(k,b,"",!1)||[],x=o(b,k,"-?",!0)||[];return S.concat(x).concat(R).join("|")}function r(b,k){let C=1,S=1,R=h(b,C),x=new Set([k]);for(;b<=R&&R<=k;)x.add(R),C+=1,R=h(b,C);for(R=y(k+1,S)-1;b<R&&R<=k;)x.add(R),S+=1,R=y(k+1,S)-1;return x=[...x],x.sort(c),x}function i(b,k,C){if(b===k)return{pattern:b,count:[],digits:0};let S=l(b,k),R=S.length,x="",z=0;for(let I=0;I<R;I++){let[re,ie]=S[I];re===ie?x+=re:re!=="0"||ie!=="9"?x+=O(re,ie):z++}return z&&(x+=C.shorthand===!0?"\\d":"[0-9]"),{pattern:x,count:[z],digits:R}}function a(b,k,C,S){let R=r(b,k),x=[],z=b,I;for(let re=0;re<R.length;re++){let ie=R[re],ke=i(String(z),String(ie),S),he="";if(!C.isPadded&&I&&I.pattern===ke.pattern){I.count.length>1&&I.count.pop(),I.count.push(ke.count[0]),I.string=I.pattern+m(I.count),z=ie+1;continue}C.isPadded&&(he=E(ie,C,S)),ke.string=he+ke.pattern+m(ke.count),x.push(ke),z=ie+1,I=ke}return x}function o(b,k,C,S,R){let x=[];for(let z of b){let{string:I}=z;!S&&!f(k,"string",I)&&x.push(C+I),S&&f(k,"string",I)&&x.push(C+I)}return x}function l(b,k){let C=[];for(let S=0;S<b.length;S++)C.push([b[S],k[S]]);return C}function c(b,k){return b>k?1:k>b?-1:0}function f(b,k,C){return b.some(S=>S[k]===C)}function h(b,k){return Number(String(b).slice(0,-k)+"9".repeat(k))}function y(b,k){return b-b%Math.pow(10,k)}function m(b){let[k=0,C=""]=b;return C||k>1?`{${k+(C?","+C:"")}}`:""}function O(b,k,C){return`[${b}${k-b===1?"":"-"}${k}]`}function A(b){return/^-?(0+)\d/.test(b)}function E(b,k,C){if(!k.isPadded)return b;let S=Math.abs(k.maxLen-String(b).length),R=C.relaxZeros!==!1;switch(S){case 0:return"";case 1:return R?"0?":"0";case 2:return R?"0{0,2}":"00";default:return R?`0{0,${S}}`:`0{${S}}`}}return e.cache={},e.clearCache=()=>e.cache={},qo=e,qo}/*!
50
- * fill-range <https://github.com/jonschlinkert/fill-range>
51
- *
52
- * Copyright (c) 2014-present, Jon Schlinkert.
53
- * Licensed under the MIT License.
54
- */var Ho,gd;function Zh(){if(gd)return Ho;gd=1;const t=Xh(),e=Ab(),n=S=>S!==null&&typeof S=="object"&&!Array.isArray(S),r=S=>R=>S===!0?Number(R):String(R),i=S=>typeof S=="number"||typeof S=="string"&&S!=="",a=S=>Number.isInteger(+S),o=S=>{let R=`${S}`,x=-1;if(R[0]==="-"&&(R=R.slice(1)),R==="0")return!1;for(;R[++x]==="0";);return x>0},l=(S,R,x)=>typeof S=="string"||typeof R=="string"?!0:x.stringify===!0,c=(S,R,x)=>{if(R>0){let z=S[0]==="-"?"-":"";z&&(S=S.slice(1)),S=z+S.padStart(z?R-1:R,"0")}return x===!1?String(S):S},f=(S,R)=>{let x=S[0]==="-"?"-":"";for(x&&(S=S.slice(1),R--);S.length<R;)S="0"+S;return x?"-"+S:S},h=(S,R,x)=>{S.negatives.sort((ke,he)=>ke<he?-1:ke>he?1:0),S.positives.sort((ke,he)=>ke<he?-1:ke>he?1:0);let z=R.capture?"":"?:",I="",re="",ie;return S.positives.length&&(I=S.positives.map(ke=>f(String(ke),x)).join("|")),S.negatives.length&&(re=`-(${z}${S.negatives.map(ke=>f(String(ke),x)).join("|")})`),I&&re?ie=`${I}|${re}`:ie=I||re,R.wrap?`(${z}${ie})`:ie},y=(S,R,x,z)=>{if(x)return e(S,R,{wrap:!1,...z});let I=String.fromCharCode(S);if(S===R)return I;let re=String.fromCharCode(R);return`[${I}-${re}]`},m=(S,R,x)=>{if(Array.isArray(S)){let z=x.wrap===!0,I=x.capture?"":"?:";return z?`(${I}${S.join("|")})`:S.join("|")}return e(S,R,x)},O=(...S)=>new RangeError("Invalid range arguments: "+t.inspect(...S)),A=(S,R,x)=>{if(x.strictRanges===!0)throw O([S,R]);return[]},E=(S,R)=>{if(R.strictRanges===!0)throw new TypeError(`Expected step "${S}" to be a number`);return[]},b=(S,R,x=1,z={})=>{let I=Number(S),re=Number(R);if(!Number.isInteger(I)||!Number.isInteger(re)){if(z.strictRanges===!0)throw O([S,R]);return[]}I===0&&(I=0),re===0&&(re=0);let ie=I>re,ke=String(S),he=String(R),Ee=String(x);x=Math.max(Math.abs(x),1);let le=o(ke)||o(he)||o(Ee),j=le?Math.max(ke.length,he.length,Ee.length):0,w=le===!1&&l(S,R,z)===!1,J=z.transform||r(w);if(z.toRegex&&x===1)return y(f(S,j),f(R,j),!0,z);let te={negatives:[],positives:[]},ne=G=>te[G<0?"negatives":"positives"].push(Math.abs(G)),se=[],me=0;for(;ie?I>=re:I<=re;)z.toRegex===!0&&x>1?ne(I):se.push(c(J(I,me),j,w)),I=ie?I-x:I+x,me++;return z.toRegex===!0?x>1?h(te,z,j):m(se,null,{wrap:!1,...z}):se},k=(S,R,x=1,z={})=>{if(!a(S)&&S.length>1||!a(R)&&R.length>1)return A(S,R,z);let I=z.transform||(w=>String.fromCharCode(w)),re=`${S}`.charCodeAt(0),ie=`${R}`.charCodeAt(0),ke=re>ie,he=Math.min(re,ie),Ee=Math.max(re,ie);if(z.toRegex&&x===1)return y(he,Ee,!1,z);let le=[],j=0;for(;ke?re>=ie:re<=ie;)le.push(I(re,j)),re=ke?re-x:re+x,j++;return z.toRegex===!0?m(le,null,{wrap:!1,options:z}):le},C=(S,R,x,z={})=>{if(R==null&&i(S))return[S];if(!i(S)||!i(R))return A(S,R,z);if(typeof x=="function")return C(S,R,1,{transform:x});if(n(x))return C(S,R,0,x);let I={...z};return I.capture===!0&&(I.wrap=!0),x=x||I.step||1,a(x)?a(S)&&a(R)?b(S,R,x,I):k(S,R,Math.max(Math.abs(x),1),I):x!=null&&!n(x)?E(x,I):C(S,R,1,x)};return Ho=C,Ho}var Ko,yd;function Eb(){if(yd)return Ko;yd=1;const t=Zh(),e=pl();return Ko=(r,i={})=>{const a=(o,l={})=>{const c=e.isInvalidBrace(l),f=o.invalid===!0&&i.escapeInvalid===!0,h=c===!0||f===!0,y=i.escapeInvalid===!0?"\\":"";let m="";if(o.isOpen===!0)return y+o.value;if(o.isClose===!0)return console.log("node.isClose",y,o.value),y+o.value;if(o.type==="open")return h?y+o.value:"(";if(o.type==="close")return h?y+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":h?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const O=e.reduce(o.nodes),A=t(...O,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if(A.length!==0)return O.length>1&&A.length>1?`(${A})`:A}if(o.nodes)for(const O of o.nodes)m+=a(O,o);return m};return a(r)},Ko}var zo,vd;function wb(){if(vd)return zo;vd=1;const t=Zh(),e=ml(),n=pl(),r=(a="",o="",l=!1)=>{const c=[];if(a=[].concat(a),o=[].concat(o),!o.length)return a;if(!a.length)return l?n.flatten(o).map(f=>`{${f}}`):o;for(const f of a)if(Array.isArray(f))for(const h of f)c.push(r(h,o,l));else for(let h of o)l===!0&&typeof h=="string"&&(h=`{${h}}`),c.push(Array.isArray(h)?r(f,h,l):f+h);return n.flatten(c)};return zo=(a,o={})=>{const l=o.rangeLimit===void 0?1e3:o.rangeLimit,c=(f,h={})=>{f.queue=[];let y=h,m=h.queue;for(;y.type!=="brace"&&y.type!=="root"&&y.parent;)y=y.parent,m=y.queue;if(f.invalid||f.dollar){m.push(r(m.pop(),e(f,o)));return}if(f.type==="brace"&&f.invalid!==!0&&f.nodes.length===2){m.push(r(m.pop(),["{}"]));return}if(f.nodes&&f.ranges>0){const b=n.reduce(f.nodes);if(n.exceedsLimit(...b,o.step,l))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let k=t(...b,o);k.length===0&&(k=e(f,o)),m.push(r(m.pop(),k)),f.nodes=[];return}const O=n.encloseBrace(f);let A=f.queue,E=f;for(;E.type!=="brace"&&E.type!=="root"&&E.parent;)E=E.parent,A=E.queue;for(let b=0;b<f.nodes.length;b++){const k=f.nodes[b];if(k.type==="comma"&&f.type==="brace"){b===1&&A.push(""),A.push("");continue}if(k.type==="close"){m.push(r(m.pop(),A,O));continue}if(k.value&&k.type!=="open"){A.push(r(A.pop(),k.value));continue}k.nodes&&c(k,f)}return A};return n.flatten(c(a))},zo}var Go,bd;function Nb(){return bd||(bd=1,Go={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
55
- `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),Go}var Wo,kd;function Ob(){if(kd)return Wo;kd=1;const t=ml(),{MAX_LENGTH:e,CHAR_BACKSLASH:n,CHAR_BACKTICK:r,CHAR_COMMA:i,CHAR_DOT:a,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:c,CHAR_RIGHT_CURLY_BRACE:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_RIGHT_SQUARE_BRACKET:y,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:O,CHAR_NO_BREAK_SPACE:A,CHAR_ZERO_WIDTH_NOBREAK_SPACE:E}=Nb();return Wo=(k,C={})=>{if(typeof k!="string")throw new TypeError("Expected a string");const S=C||{},R=typeof S.maxLength=="number"?Math.min(e,S.maxLength):e;if(k.length>R)throw new SyntaxError(`Input length (${k.length}), exceeds max characters (${R})`);const x={type:"root",input:k,nodes:[]},z=[x];let I=x,re=x,ie=0;const ke=k.length;let he=0,Ee=0,le;const j=()=>k[he++],w=J=>{if(J.type==="text"&&re.type==="dot"&&(re.type="text"),re&&re.type==="text"&&J.type==="text"){re.value+=J.value;return}return I.nodes.push(J),J.parent=I,J.prev=re,re=J,J};for(w({type:"bos"});he<ke;)if(I=z[z.length-1],le=j(),!(le===E||le===A)){if(le===n){w({type:"text",value:(C.keepEscaping?le:"")+j()});continue}if(le===y){w({type:"text",value:"\\"+le});continue}if(le===h){ie++;let J;for(;he<ke&&(J=j());){if(le+=J,J===h){ie++;continue}if(J===n){le+=j();continue}if(J===y&&(ie--,ie===0))break}w({type:"text",value:le});continue}if(le===o){I=w({type:"paren",nodes:[]}),z.push(I),w({type:"text",value:le});continue}if(le===l){if(I.type!=="paren"){w({type:"text",value:le});continue}I=z.pop(),w({type:"text",value:le}),I=z[z.length-1];continue}if(le===m||le===O||le===r){const J=le;let te;for(C.keepQuotes!==!0&&(le="");he<ke&&(te=j());){if(te===n){le+=te+j();continue}if(te===J){C.keepQuotes===!0&&(le+=te);break}le+=te}w({type:"text",value:le});continue}if(le===c){Ee++;const te={type:"brace",open:!0,close:!1,dollar:re.value&&re.value.slice(-1)==="$"||I.dollar===!0,depth:Ee,commas:0,ranges:0,nodes:[]};I=w(te),z.push(I),w({type:"open",value:le});continue}if(le===f){if(I.type!=="brace"){w({type:"text",value:le});continue}const J="close";I=z.pop(),I.close=!0,w({type:J,value:le}),Ee--,I=z[z.length-1];continue}if(le===i&&Ee>0){if(I.ranges>0){I.ranges=0;const J=I.nodes.shift();I.nodes=[J,{type:"text",value:t(I)}]}w({type:"comma",value:le}),I.commas++;continue}if(le===a&&Ee>0&&I.commas===0){const J=I.nodes;if(Ee===0||J.length===0){w({type:"text",value:le});continue}if(re.type==="dot"){if(I.range=[],re.value+=le,re.type="range",I.nodes.length!==3&&I.nodes.length!==5){I.invalid=!0,I.ranges=0,re.type="text";continue}I.ranges++,I.args=[];continue}if(re.type==="range"){J.pop();const te=J[J.length-1];te.value+=re.value+le,re=te,I.ranges--;continue}w({type:"dot",value:le});continue}w({type:"text",value:le})}do if(I=z.pop(),I.type!=="root"){I.nodes.forEach(ne=>{ne.nodes||(ne.type==="open"&&(ne.isOpen=!0),ne.type==="close"&&(ne.isClose=!0),ne.nodes||(ne.type="text"),ne.invalid=!0)});const J=z[z.length-1],te=J.nodes.indexOf(I);J.nodes.splice(te,1,...I.nodes)}while(z.length>0);return w({type:"eos"}),x},Wo}var Jo,_d;function Rb(){if(_d)return Jo;_d=1;const t=ml(),e=Eb(),n=wb(),r=Ob(),i=(a,o={})=>{let l=[];if(Array.isArray(a))for(const c of a){const f=i.create(c,o);Array.isArray(f)?l.push(...f):l.push(f)}else l=[].concat(i.create(a,o));return o&&o.expand===!0&&o.nodupes===!0&&(l=[...new Set(l)]),l};return i.parse=(a,o={})=>r(a,o),i.stringify=(a,o={})=>t(typeof a=="string"?i.parse(a,o):a,o),i.compile=(a,o={})=>(typeof a=="string"&&(a=i.parse(a,o)),e(a,o)),i.expand=(a,o={})=>{typeof a=="string"&&(a=i.parse(a,o));let l=n(a,o);return o.noempty===!0&&(l=l.filter(Boolean)),o.nodupes===!0&&(l=[...new Set(l)]),l},i.create=(a,o={})=>a===""||a.length<3?[a]:o.expand!==!0?i.compile(a,o):i.expand(a,o),Jo=i,Jo}const Tb={},Cb=Object.freeze(Object.defineProperty({__proto__:null,default:Tb},Symbol.toStringTag,{value:"Module"})),gl=Lv(Cb);var Yo={},Qo,Sd;function Ya(){if(Sd)return Qo;Sd=1;const t=gl,e="\\\\/",n=`[^${e}]`,r="\\.",i="\\+",a="\\?",o="\\/",l="(?=.)",c="[^/]",f=`(?:${o}|$)`,h=`(?:^|${o})`,y=`${r}{1,2}${f}`,m=`(?!${r})`,O=`(?!${h}${y})`,A=`(?!${r}{0,1}${f})`,E=`(?!${y})`,b=`[^.${o}]`,k=`${c}*?`,C={DOT_LITERAL:r,PLUS_LITERAL:i,QMARK_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:l,QMARK:c,END_ANCHOR:f,DOTS_SLASH:y,NO_DOT:m,NO_DOTS:O,NO_DOT_SLASH:A,NO_DOTS_SLASH:E,QMARK_NO_DOT:b,STAR:k,START_ANCHOR:h},S={...C,SLASH_LITERAL:`[${e}]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`${r}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[${e}])${r}{1,2}(?:[${e}]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},R={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Qo={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:R,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t.sep,extglobChars(x){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${x.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(x){return x===!0?S:C}},Qo}var Ad;function Qa(){return Ad||(Ad=1,function(t){const e=gl,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Ya();t.isObject=l=>l!==null&&typeof l=="object"&&!Array.isArray(l),t.hasRegexChars=l=>a.test(l),t.isRegexChar=l=>l.length===1&&t.hasRegexChars(l),t.escapeRegex=l=>l.replace(o,"\\$1"),t.toPosixSlashes=l=>l.replace(r,"/"),t.removeBackslashes=l=>l.replace(i,c=>c==="\\"?"":c),t.supportsLookbehinds=()=>{const l=process.version.slice(1).split(".").map(Number);return l.length===3&&l[0]>=9||l[0]===8&&l[1]>=10},t.isWindows=l=>l&&typeof l.windows=="boolean"?l.windows:n===!0||e.sep==="\\",t.escapeLast=(l,c,f)=>{const h=l.lastIndexOf(c,f);return h===-1?l:l[h-1]==="\\"?t.escapeLast(l,c,h-1):`${l.slice(0,h)}\\${l.slice(h)}`},t.removePrefix=(l,c={})=>{let f=l;return f.startsWith("./")&&(f=f.slice(2),c.prefix="./"),f},t.wrapOutput=(l,c={},f={})=>{const h=f.contains?"":"^",y=f.contains?"":"$";let m=`${h}(?:${l})${y}`;return c.negated===!0&&(m=`(?:^(?!${m}).*$)`),m}}(Yo)),Yo}var Xo,Ed;function xb(){if(Ed)return Xo;Ed=1;const t=Qa(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:f,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:y,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:O,CHAR_RIGHT_PARENTHESES:A,CHAR_RIGHT_SQUARE_BRACKET:E}=Ya(),b=S=>S===l||S===r,k=S=>{S.isPrefix!==!0&&(S.depth=S.isGlobstar?1/0:1)};return Xo=(S,R)=>{const x=R||{},z=S.length-1,I=x.parts===!0||x.scanToEnd===!0,re=[],ie=[],ke=[];let he=S,Ee=-1,le=0,j=0,w=!1,J=!1,te=!1,ne=!1,se=!1,me=!1,G=!1,D=!1,Q=!1,q=!1,B=0,W,ge,ce={value:"",depth:0,isGlob:!1};const oe=()=>Ee>=z,Ce=()=>he.charCodeAt(Ee+1),xe=()=>(W=ge,he.charCodeAt(++Ee));for(;Ee<z;){ge=xe();let Pe;if(ge===r){G=ce.backslashes=!0,ge=xe(),ge===c&&(me=!0);continue}if(me===!0||ge===c){for(B++;oe()!==!0&&(ge=xe());){if(ge===r){G=ce.backslashes=!0,xe();continue}if(ge===c){B++;continue}if(me!==!0&&ge===a&&(ge=xe())===a){if(w=ce.isBrace=!0,te=ce.isGlob=!0,q=!0,I===!0)continue;break}if(me!==!0&&ge===i){if(w=ce.isBrace=!0,te=ce.isGlob=!0,q=!0,I===!0)continue;break}if(ge===O&&(B--,B===0)){me=!1,w=ce.isBrace=!0,q=!0;break}}if(I===!0)continue;break}if(ge===l){if(re.push(Ee),ie.push(ce),ce={value:"",depth:0,isGlob:!1},q===!0)continue;if(W===a&&Ee===le+1){le+=2;continue}j=Ee+1;continue}if(x.noext!==!0&&(ge===y||ge===n||ge===e||ge===m||ge===o)===!0&&Ce()===f){if(te=ce.isGlob=!0,ne=ce.isExtglob=!0,q=!0,ge===o&&Ee===le&&(Q=!0),I===!0){for(;oe()!==!0&&(ge=xe());){if(ge===r){G=ce.backslashes=!0,ge=xe();continue}if(ge===A){te=ce.isGlob=!0,q=!0;break}}continue}break}if(ge===e){if(W===e&&(se=ce.isGlobstar=!0),te=ce.isGlob=!0,q=!0,I===!0)continue;break}if(ge===m){if(te=ce.isGlob=!0,q=!0,I===!0)continue;break}if(ge===h){for(;oe()!==!0&&(Pe=xe());){if(Pe===r){G=ce.backslashes=!0,xe();continue}if(Pe===E){J=ce.isBracket=!0,te=ce.isGlob=!0,q=!0;break}}if(I===!0)continue;break}if(x.nonegate!==!0&&ge===o&&Ee===le){D=ce.negated=!0,le++;continue}if(x.noparen!==!0&&ge===f){if(te=ce.isGlob=!0,I===!0){for(;oe()!==!0&&(ge=xe());){if(ge===f){G=ce.backslashes=!0,ge=xe();continue}if(ge===A){q=!0;break}}continue}break}if(te===!0){if(q=!0,I===!0)continue;break}}x.noext===!0&&(ne=!1,te=!1);let we=he,ct="",Ze="";le>0&&(ct=he.slice(0,le),he=he.slice(le),j-=le),we&&te===!0&&j>0?(we=he.slice(0,j),Ze=he.slice(j)):te===!0?(we="",Ze=he):we=he,we&&we!==""&&we!=="/"&&we!==he&&b(we.charCodeAt(we.length-1))&&(we=we.slice(0,-1)),x.unescape===!0&&(Ze&&(Ze=t.removeBackslashes(Ze)),we&&G===!0&&(we=t.removeBackslashes(we)));const We={prefix:ct,input:S,start:le,base:we,glob:Ze,isBrace:w,isBracket:J,isGlob:te,isExtglob:ne,isGlobstar:se,negated:D,negatedExtglob:Q};if(x.tokens===!0&&(We.maxDepth=0,b(ge)||ie.push(ce),We.tokens=ie),x.parts===!0||x.tokens===!0){let Pe;for(let Je=0;Je<re.length;Je++){const Ft=Pe?Pe+1:le,V=re[Je],qe=S.slice(Ft,V);x.tokens&&(Je===0&&le!==0?(ie[Je].isPrefix=!0,ie[Je].value=ct):ie[Je].value=qe,k(ie[Je]),We.maxDepth+=ie[Je].depth),(Je!==0||qe!=="")&&ke.push(qe),Pe=V}if(Pe&&Pe+1<S.length){const Je=S.slice(Pe+1);ke.push(Je),x.tokens&&(ie[ie.length-1].value=Je,k(ie[ie.length-1]),We.maxDepth+=ie[ie.length-1].depth)}We.slashes=re,We.parts=ke}return We},Xo}var Zo,wd;function Pb(){if(wd)return Zo;wd=1;const t=Ya(),e=Qa(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:o}=t,l=(h,y)=>{if(typeof y.expandRange=="function")return y.expandRange(...h,y);h.sort();const m=`[${h.join("-")}]`;try{new RegExp(m)}catch{return h.map(A=>e.escapeRegex(A)).join("..")}return m},c=(h,y)=>`Missing ${h}: "${y}" - use "\\\\${y}" to match literal characters`,f=(h,y)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=o[h]||h;const m={...y},O=typeof m.maxLength=="number"?Math.min(n,m.maxLength):n;let A=h.length;if(A>O)throw new SyntaxError(`Input length: ${A}, exceeds maximum allowed length: ${O}`);const E={type:"bos",value:"",output:m.prepend||""},b=[E],k=m.capture?"":"?:",C=e.isWindows(y),S=t.globChars(C),R=t.extglobChars(S),{DOT_LITERAL:x,PLUS_LITERAL:z,SLASH_LITERAL:I,ONE_CHAR:re,DOTS_SLASH:ie,NO_DOT:ke,NO_DOT_SLASH:he,NO_DOTS_SLASH:Ee,QMARK:le,QMARK_NO_DOT:j,STAR:w,START_ANCHOR:J}=S,te=V=>`(${k}(?:(?!${J}${V.dot?ie:x}).)*?)`,ne=m.dot?"":ke,se=m.dot?le:j;let me=m.bash===!0?te(m):w;m.capture&&(me=`(${me})`),typeof m.noext=="boolean"&&(m.noextglob=m.noext);const G={input:h,index:-1,start:0,dot:m.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};h=e.removePrefix(h,G),A=h.length;const D=[],Q=[],q=[];let B=E,W;const ge=()=>G.index===A-1,ce=G.peek=(V=1)=>h[G.index+V],oe=G.advance=()=>h[++G.index]||"",Ce=()=>h.slice(G.index+1),xe=(V="",qe=0)=>{G.consumed+=V,G.index+=qe},we=V=>{G.output+=V.output!=null?V.output:V.value,xe(V.value)},ct=()=>{let V=1;for(;ce()==="!"&&(ce(2)!=="("||ce(3)==="?");)oe(),G.start++,V++;return V%2===0?!1:(G.negated=!0,G.start++,!0)},Ze=V=>{G[V]++,q.push(V)},We=V=>{G[V]--,q.pop()},Pe=V=>{if(B.type==="globstar"){const qe=G.braces>0&&(V.type==="comma"||V.type==="brace"),pe=V.extglob===!0||D.length&&(V.type==="pipe"||V.type==="paren");V.type!=="slash"&&V.type!=="paren"&&!qe&&!pe&&(G.output=G.output.slice(0,-B.output.length),B.type="star",B.value="*",B.output=me,G.output+=B.output)}if(D.length&&V.type!=="paren"&&(D[D.length-1].inner+=V.value),(V.value||V.output)&&we(V),B&&B.type==="text"&&V.type==="text"){B.value+=V.value,B.output=(B.output||"")+V.value;return}V.prev=B,b.push(V),B=V},Je=(V,qe)=>{const pe={...R[qe],conditions:1,inner:""};pe.prev=B,pe.parens=G.parens,pe.output=G.output;const je=(m.capture?"(":"")+pe.open;Ze("parens"),Pe({type:V,value:qe,output:G.output?"":re}),Pe({type:"paren",extglob:!0,value:oe(),output:je}),D.push(pe)},Ft=V=>{let qe=V.close+(m.capture?")":""),pe;if(V.type==="negate"){let je=me;if(V.inner&&V.inner.length>1&&V.inner.includes("/")&&(je=te(m)),(je!==me||ge()||/^\)+$/.test(Ce()))&&(qe=V.close=`)$))${je}`),V.inner.includes("*")&&(pe=Ce())&&/^\.[^\\/.]+$/.test(pe)){const Ye=f(pe,{...y,fastpaths:!1}).output;qe=V.close=`)${Ye})${je})`}V.prev.type==="bos"&&(G.negatedExtglob=!0)}Pe({type:"paren",extglob:!0,value:W,output:qe}),We("parens")};if(m.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let V=!1,qe=h.replace(a,(pe,je,Ye,dt,et,Ut)=>dt==="\\"?(V=!0,pe):dt==="?"?je?je+dt+(et?le.repeat(et.length):""):Ut===0?se+(et?le.repeat(et.length):""):le.repeat(Ye.length):dt==="."?x.repeat(Ye.length):dt==="*"?je?je+dt+(et?me:""):me:je?pe:`\\${pe}`);return V===!0&&(m.unescape===!0?qe=qe.replace(/\\/g,""):qe=qe.replace(/\\+/g,pe=>pe.length%2===0?"\\\\":pe?"\\":"")),qe===h&&m.contains===!0?(G.output=h,G):(G.output=e.wrapOutput(qe,G,y),G)}for(;!ge();){if(W=oe(),W==="\0")continue;if(W==="\\"){const pe=ce();if(pe==="/"&&m.bash!==!0||pe==="."||pe===";")continue;if(!pe){W+="\\",Pe({type:"text",value:W});continue}const je=/^\\+/.exec(Ce());let Ye=0;if(je&&je[0].length>2&&(Ye=je[0].length,G.index+=Ye,Ye%2!==0&&(W+="\\")),m.unescape===!0?W=oe():W+=oe(),G.brackets===0){Pe({type:"text",value:W});continue}}if(G.brackets>0&&(W!=="]"||B.value==="["||B.value==="[^")){if(m.posix!==!1&&W===":"){const pe=B.value.slice(1);if(pe.includes("[")&&(B.posix=!0,pe.includes(":"))){const je=B.value.lastIndexOf("["),Ye=B.value.slice(0,je),dt=B.value.slice(je+2),et=r[dt];if(et){B.value=Ye+et,G.backtrack=!0,oe(),!E.output&&b.indexOf(B)===1&&(E.output=re);continue}}}(W==="["&&ce()!==":"||W==="-"&&ce()==="]")&&(W=`\\${W}`),W==="]"&&(B.value==="["||B.value==="[^")&&(W=`\\${W}`),m.posix===!0&&W==="!"&&B.value==="["&&(W="^"),B.value+=W,we({value:W});continue}if(G.quotes===1&&W!=='"'){W=e.escapeRegex(W),B.value+=W,we({value:W});continue}if(W==='"'){G.quotes=G.quotes===1?0:1,m.keepQuotes===!0&&Pe({type:"text",value:W});continue}if(W==="("){Ze("parens"),Pe({type:"paren",value:W});continue}if(W===")"){if(G.parens===0&&m.strictBrackets===!0)throw new SyntaxError(c("opening","("));const pe=D[D.length-1];if(pe&&G.parens===pe.parens+1){Ft(D.pop());continue}Pe({type:"paren",value:W,output:G.parens?")":"\\)"}),We("parens");continue}if(W==="["){if(m.nobracket===!0||!Ce().includes("]")){if(m.nobracket!==!0&&m.strictBrackets===!0)throw new SyntaxError(c("closing","]"));W=`\\${W}`}else Ze("brackets");Pe({type:"bracket",value:W});continue}if(W==="]"){if(m.nobracket===!0||B&&B.type==="bracket"&&B.value.length===1){Pe({type:"text",value:W,output:`\\${W}`});continue}if(G.brackets===0){if(m.strictBrackets===!0)throw new SyntaxError(c("opening","["));Pe({type:"text",value:W,output:`\\${W}`});continue}We("brackets");const pe=B.value.slice(1);if(B.posix!==!0&&pe[0]==="^"&&!pe.includes("/")&&(W=`/${W}`),B.value+=W,we({value:W}),m.literalBrackets===!1||e.hasRegexChars(pe))continue;const je=e.escapeRegex(B.value);if(G.output=G.output.slice(0,-B.value.length),m.literalBrackets===!0){G.output+=je,B.value=je;continue}B.value=`(${k}${je}|${B.value})`,G.output+=B.value;continue}if(W==="{"&&m.nobrace!==!0){Ze("braces");const pe={type:"brace",value:W,output:"(",outputIndex:G.output.length,tokensIndex:G.tokens.length};Q.push(pe),Pe(pe);continue}if(W==="}"){const pe=Q[Q.length-1];if(m.nobrace===!0||!pe){Pe({type:"text",value:W,output:W});continue}let je=")";if(pe.dots===!0){const Ye=b.slice(),dt=[];for(let et=Ye.length-1;et>=0&&(b.pop(),Ye[et].type!=="brace");et--)Ye[et].type!=="dots"&&dt.unshift(Ye[et].value);je=l(dt,m),G.backtrack=!0}if(pe.comma!==!0&&pe.dots!==!0){const Ye=G.output.slice(0,pe.outputIndex),dt=G.tokens.slice(pe.tokensIndex);pe.value=pe.output="\\{",W=je="\\}",G.output=Ye;for(const et of dt)G.output+=et.output||et.value}Pe({type:"brace",value:W,output:je}),We("braces"),Q.pop();continue}if(W==="|"){D.length>0&&D[D.length-1].conditions++,Pe({type:"text",value:W});continue}if(W===","){let pe=W;const je=Q[Q.length-1];je&&q[q.length-1]==="braces"&&(je.comma=!0,pe="|"),Pe({type:"comma",value:W,output:pe});continue}if(W==="/"){if(B.type==="dot"&&G.index===G.start+1){G.start=G.index+1,G.consumed="",G.output="",b.pop(),B=E;continue}Pe({type:"slash",value:W,output:I});continue}if(W==="."){if(G.braces>0&&B.type==="dot"){B.value==="."&&(B.output=x);const pe=Q[Q.length-1];B.type="dots",B.output+=W,B.value+=W,pe.dots=!0;continue}if(G.braces+G.parens===0&&B.type!=="bos"&&B.type!=="slash"){Pe({type:"text",value:W,output:x});continue}Pe({type:"dot",value:W,output:x});continue}if(W==="?"){if(!(B&&B.value==="(")&&m.noextglob!==!0&&ce()==="("&&ce(2)!=="?"){Je("qmark",W);continue}if(B&&B.type==="paren"){const je=ce();let Ye=W;if(je==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(B.value==="("&&!/[!=<:]/.test(je)||je==="<"&&!/<([!=]|\w+>)/.test(Ce()))&&(Ye=`\\${W}`),Pe({type:"text",value:W,output:Ye});continue}if(m.dot!==!0&&(B.type==="slash"||B.type==="bos")){Pe({type:"qmark",value:W,output:j});continue}Pe({type:"qmark",value:W,output:le});continue}if(W==="!"){if(m.noextglob!==!0&&ce()==="("&&(ce(2)!=="?"||!/[!=<:]/.test(ce(3)))){Je("negate",W);continue}if(m.nonegate!==!0&&G.index===0){ct();continue}}if(W==="+"){if(m.noextglob!==!0&&ce()==="("&&ce(2)!=="?"){Je("plus",W);continue}if(B&&B.value==="("||m.regex===!1){Pe({type:"plus",value:W,output:z});continue}if(B&&(B.type==="bracket"||B.type==="paren"||B.type==="brace")||G.parens>0){Pe({type:"plus",value:W});continue}Pe({type:"plus",value:z});continue}if(W==="@"){if(m.noextglob!==!0&&ce()==="("&&ce(2)!=="?"){Pe({type:"at",extglob:!0,value:W,output:""});continue}Pe({type:"text",value:W});continue}if(W!=="*"){(W==="$"||W==="^")&&(W=`\\${W}`);const pe=i.exec(Ce());pe&&(W+=pe[0],G.index+=pe[0].length),Pe({type:"text",value:W});continue}if(B&&(B.type==="globstar"||B.star===!0)){B.type="star",B.star=!0,B.value+=W,B.output=me,G.backtrack=!0,G.globstar=!0,xe(W);continue}let V=Ce();if(m.noextglob!==!0&&/^\([^?]/.test(V)){Je("star",W);continue}if(B.type==="star"){if(m.noglobstar===!0){xe(W);continue}const pe=B.prev,je=pe.prev,Ye=pe.type==="slash"||pe.type==="bos",dt=je&&(je.type==="star"||je.type==="globstar");if(m.bash===!0&&(!Ye||V[0]&&V[0]!=="/")){Pe({type:"star",value:W,output:""});continue}const et=G.braces>0&&(pe.type==="comma"||pe.type==="brace"),Ut=D.length&&(pe.type==="pipe"||pe.type==="paren");if(!Ye&&pe.type!=="paren"&&!et&&!Ut){Pe({type:"star",value:W,output:""});continue}for(;V.slice(0,3)==="/**";){const It=h[G.index+4];if(It&&It!=="/")break;V=V.slice(3),xe("/**",3)}if(pe.type==="bos"&&ge()){B.type="globstar",B.value+=W,B.output=te(m),G.output=B.output,G.globstar=!0,xe(W);continue}if(pe.type==="slash"&&pe.prev.type!=="bos"&&!dt&&ge()){G.output=G.output.slice(0,-(pe.output+B.output).length),pe.output=`(?:${pe.output}`,B.type="globstar",B.output=te(m)+(m.strictSlashes?")":"|$)"),B.value+=W,G.globstar=!0,G.output+=pe.output+B.output,xe(W);continue}if(pe.type==="slash"&&pe.prev.type!=="bos"&&V[0]==="/"){const It=V[1]!==void 0?"|$":"";G.output=G.output.slice(0,-(pe.output+B.output).length),pe.output=`(?:${pe.output}`,B.type="globstar",B.output=`${te(m)}${I}|${I}${It})`,B.value+=W,G.output+=pe.output+B.output,G.globstar=!0,xe(W+oe()),Pe({type:"slash",value:"/",output:""});continue}if(pe.type==="bos"&&V[0]==="/"){B.type="globstar",B.value+=W,B.output=`(?:^|${I}|${te(m)}${I})`,G.output=B.output,G.globstar=!0,xe(W+oe()),Pe({type:"slash",value:"/",output:""});continue}G.output=G.output.slice(0,-B.output.length),B.type="globstar",B.output=te(m),B.value+=W,G.output+=B.output,G.globstar=!0,xe(W);continue}const qe={type:"star",value:W,output:me};if(m.bash===!0){qe.output=".*?",(B.type==="bos"||B.type==="slash")&&(qe.output=ne+qe.output),Pe(qe);continue}if(B&&(B.type==="bracket"||B.type==="paren")&&m.regex===!0){qe.output=W,Pe(qe);continue}(G.index===G.start||B.type==="slash"||B.type==="dot")&&(B.type==="dot"?(G.output+=he,B.output+=he):m.dot===!0?(G.output+=Ee,B.output+=Ee):(G.output+=ne,B.output+=ne),ce()!=="*"&&(G.output+=re,B.output+=re)),Pe(qe)}for(;G.brackets>0;){if(m.strictBrackets===!0)throw new SyntaxError(c("closing","]"));G.output=e.escapeLast(G.output,"["),We("brackets")}for(;G.parens>0;){if(m.strictBrackets===!0)throw new SyntaxError(c("closing",")"));G.output=e.escapeLast(G.output,"("),We("parens")}for(;G.braces>0;){if(m.strictBrackets===!0)throw new SyntaxError(c("closing","}"));G.output=e.escapeLast(G.output,"{"),We("braces")}if(m.strictSlashes!==!0&&(B.type==="star"||B.type==="bracket")&&Pe({type:"maybe_slash",value:"",output:`${I}?`}),G.backtrack===!0){G.output="";for(const V of G.tokens)G.output+=V.output!=null?V.output:V.value,V.suffix&&(G.output+=V.suffix)}return G};return f.fastpaths=(h,y)=>{const m={...y},O=typeof m.maxLength=="number"?Math.min(n,m.maxLength):n,A=h.length;if(A>O)throw new SyntaxError(`Input length: ${A}, exceeds maximum allowed length: ${O}`);h=o[h]||h;const E=e.isWindows(y),{DOT_LITERAL:b,SLASH_LITERAL:k,ONE_CHAR:C,DOTS_SLASH:S,NO_DOT:R,NO_DOTS:x,NO_DOTS_SLASH:z,STAR:I,START_ANCHOR:re}=t.globChars(E),ie=m.dot?x:R,ke=m.dot?z:R,he=m.capture?"":"?:",Ee={negated:!1,prefix:""};let le=m.bash===!0?".*?":I;m.capture&&(le=`(${le})`);const j=ne=>ne.noglobstar===!0?le:`(${he}(?:(?!${re}${ne.dot?S:b}).)*?)`,w=ne=>{switch(ne){case"*":return`${ie}${C}${le}`;case".*":return`${b}${C}${le}`;case"*.*":return`${ie}${le}${b}${C}${le}`;case"*/*":return`${ie}${le}${k}${C}${ke}${le}`;case"**":return ie+j(m);case"**/*":return`(?:${ie}${j(m)}${k})?${ke}${C}${le}`;case"**/*.*":return`(?:${ie}${j(m)}${k})?${ke}${le}${b}${C}${le}`;case"**/.*":return`(?:${ie}${j(m)}${k})?${b}${C}${le}`;default:{const se=/^(.*?)\.(\w+)$/.exec(ne);if(!se)return;const me=w(se[1]);return me?me+b+se[2]:void 0}}},J=e.removePrefix(h,Ee);let te=w(J);return te&&m.strictSlashes!==!0&&(te+=`${k}?`),te},Zo=f,Zo}var eu,Nd;function Fb(){if(Nd)return eu;Nd=1;const t=gl,e=xb(),n=Pb(),r=Qa(),i=Ya(),a=l=>l&&typeof l=="object"&&!Array.isArray(l),o=(l,c,f=!1)=>{if(Array.isArray(l)){const k=l.map(S=>o(S,c,f));return S=>{for(const R of k){const x=R(S);if(x)return x}return!1}}const h=a(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!h)throw new TypeError("Expected pattern to be a non-empty string");const y=c||{},m=r.isWindows(c),O=h?o.compileRe(l,c):o.makeRe(l,c,!1,!0),A=O.state;delete O.state;let E=()=>!1;if(y.ignore){const k={...c,ignore:null,onMatch:null,onResult:null};E=o(y.ignore,k,f)}const b=(k,C=!1)=>{const{isMatch:S,match:R,output:x}=o.test(k,O,c,{glob:l,posix:m}),z={glob:l,state:A,regex:O,posix:m,input:k,output:x,match:R,isMatch:S};return typeof y.onResult=="function"&&y.onResult(z),S===!1?(z.isMatch=!1,C?z:!1):E(k)?(typeof y.onIgnore=="function"&&y.onIgnore(z),z.isMatch=!1,C?z:!1):(typeof y.onMatch=="function"&&y.onMatch(z),C?z:!0)};return f&&(b.state=A),b};return o.test=(l,c,f,{glob:h,posix:y}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const m=f||{},O=m.format||(y?r.toPosixSlashes:null);let A=l===h,E=A&&O?O(l):l;return A===!1&&(E=O?O(l):l,A=E===h),(A===!1||m.capture===!0)&&(m.matchBase===!0||m.basename===!0?A=o.matchBase(l,c,f,y):A=c.exec(E)),{isMatch:!!A,match:A,output:E}},o.matchBase=(l,c,f,h=r.isWindows(f))=>(c instanceof RegExp?c:o.makeRe(c,f)).test(t.basename(l)),o.isMatch=(l,c,f)=>o(c,f)(l),o.parse=(l,c)=>Array.isArray(l)?l.map(f=>o.parse(f,c)):n(l,{...c,fastpaths:!1}),o.scan=(l,c)=>e(l,c),o.compileRe=(l,c,f=!1,h=!1)=>{if(f===!0)return l.output;const y=c||{},m=y.contains?"":"^",O=y.contains?"":"$";let A=`${m}(?:${l.output})${O}`;l&&l.negated===!0&&(A=`^(?!${A}).*$`);const E=o.toRegex(A,c);return h===!0&&(E.state=l),E},o.makeRe=(l,c={},f=!1,h=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let y={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(y.output=n.fastpaths(l,c)),y.output||(y=n(l,c)),o.compileRe(y,c,f,h)},o.toRegex=(l,c)=>{try{const f=c||{};return new RegExp(l,f.flags||(f.nocase?"i":""))}catch(f){if(c&&c.debug===!0)throw f;return/$^/}},o.constants=i,eu=o,eu}var tu,Od;function Ib(){return Od||(Od=1,tu=Fb()),tu}var nu,Rd;function Db(){if(Rd)return nu;Rd=1;const t=Xh(),e=Rb(),n=Ib(),r=Qa(),i=l=>l===""||l==="./",a=l=>{const c=l.indexOf("{");return c>-1&&l.indexOf("}",c)>-1},o=(l,c,f)=>{c=[].concat(c),l=[].concat(l);let h=new Set,y=new Set,m=new Set,O=0,A=k=>{m.add(k.output),f&&f.onResult&&f.onResult(k)};for(let k=0;k<c.length;k++){let C=n(String(c[k]),{...f,onResult:A},!0),S=C.state.negated||C.state.negatedExtglob;S&&O++;for(let R of l){let x=C(R,!0);(S?!x.isMatch:x.isMatch)&&(S?h.add(x.output):(h.delete(x.output),y.add(x.output)))}}let b=(O===c.length?[...m]:[...y]).filter(k=>!h.has(k));if(f&&b.length===0){if(f.failglob===!0)throw new Error(`No matches found for "${c.join(", ")}"`);if(f.nonull===!0||f.nullglob===!0)return f.unescape?c.map(k=>k.replace(/\\/g,"")):c}return b};return o.match=o,o.matcher=(l,c)=>n(l,c),o.isMatch=(l,c,f)=>n(c,f)(l),o.any=o.isMatch,o.not=(l,c,f={})=>{c=[].concat(c).map(String);let h=new Set,y=[],m=A=>{f.onResult&&f.onResult(A),y.push(A.output)},O=new Set(o(l,c,{...f,onResult:m}));for(let A of y)O.has(A)||h.add(A);return[...h]},o.contains=(l,c,f)=>{if(typeof l!="string")throw new TypeError(`Expected a string: "${t.inspect(l)}"`);if(Array.isArray(c))return c.some(h=>o.contains(l,h,f));if(typeof c=="string"){if(i(l)||i(c))return!1;if(l.includes(c)||l.startsWith("./")&&l.slice(2).includes(c))return!0}return o.isMatch(l,c,{...f,contains:!0})},o.matchKeys=(l,c,f)=>{if(!r.isObject(l))throw new TypeError("Expected the first argument to be an object");let h=o(Object.keys(l),c,f),y={};for(let m of h)y[m]=l[m];return y},o.some=(l,c,f)=>{let h=[].concat(l);for(let y of[].concat(c)){let m=n(String(y),f);if(h.some(O=>m(O)))return!0}return!1},o.every=(l,c,f)=>{let h=[].concat(l);for(let y of[].concat(c)){let m=n(String(y),f);if(!h.every(O=>m(O)))return!1}return!0},o.all=(l,c,f)=>{if(typeof l!="string")throw new TypeError(`Expected a string: "${t.inspect(l)}"`);return[].concat(c).every(h=>n(h,f)(l))},o.capture=(l,c,f)=>{let h=r.isWindows(f),m=n.makeRe(String(l),{...f,capture:!0}).exec(h?r.toPosixSlashes(c):c);if(m)return m.slice(1).map(O=>O===void 0?"":O)},o.makeRe=(...l)=>n.makeRe(...l),o.scan=(...l)=>n.scan(...l),o.parse=(l,c)=>{let f=[];for(let h of[].concat(l||[]))for(let y of e(String(h),c))f.push(n.parse(y,c));return f},o.braces=(l,c)=>{if(typeof l!="string")throw new TypeError("Expected a string");return c&&c.nobrace===!0||!a(l)?[l]:e(l,c)},o.braceExpand=(l,c)=>{if(typeof l!="string")throw new TypeError("Expected a string");return o.braces(l,{...c,expand:!0})},o.hasBraces=a,nu=o,nu}var Lb=Db();const Td=Wa(Lb),Cd="loglevel-patterns",Xi="loglevel:",ru="!",$b=it.INFO;class jb{constructor(e){Ae(this,"projectPrefix");Ae(this,"patternsCache",null);this.projectPrefix=`${Xi}${e}:`}getLevel(e){const n=this.loadAndUnifyPatterns();return this.resolveLogLevelFromPatterns(e,n)||$b}setLevel(e,n){const{level:r,override:i}=this.parseLogLevel(n),a=`${Xi}${e}`,o=i?`${r}${ru}`:r;localStorage.setItem(a,o),this.patternsCache=null}loadAndUnifyPatterns(){if(this.patternsCache)return this.patternsCache;const e=this.readPatternsFromJSON(),n=this.unifyWithIndividualKeys(e);return this.patternsCache=n,n}resolveLogLevelFromPatterns(e,n){let r;for(const[i,{level:a,override:o}]of Object.entries(n))if(Td.isMatch(e.toLowerCase(),i.toLowerCase())){if(o)return a;(!r||Td.matcher(i)(e))&&(r=a)}return r}readPatternsFromJSON(){try{const e=localStorage.getItem(Cd);return e?JSON.parse(e):{}}catch{return console.error("Failed to parse loglevel-patterns from localStorage"),{}}}unifyWithIndividualKeys(e){const n={...e};for(let r=0;r<localStorage.length;r++){const i=localStorage.key(r);if(!i||!i.startsWith(Xi)||i===Cd)continue;const a=i.replace(Xi,"").toLowerCase(),o=localStorage.getItem(i);if(!o)continue;const{level:l,override:c}=this.parseLogLevel(o);n[a]={level:l,override:c}}return n}parseLogLevel(e){const n=e.endsWith(ru),r=n?e.slice(0,-ru.length):e;if(!zh(r))throw new ul(r);return{level:r,override:n}}}class Bb{constructor(e,n){Ae(this,"committed",!1);Ae(this,"chainOptions",{});Ae(this,"method",null);Ae(this,"stack","");Ae(this,"args",[]);this.adapter=e,n&&(this.chainOptions={...n}),Promise.resolve().then(()=>this.commit())}options(e){return this.chainOptions={...this.chainOptions,...e},this}trace(...e){return this.log("trace",e)}debug(...e){return this.log("debug",e)}info(...e){return this.log("info",e)}warn(...e){return this.log("warn",e)}error(...e){return this.log("error",e)}fatal(...e){return this.log("fatal",e)}log(e,n){var r;return this.method=e,this.args=n,this.stack=(r=new Error().stack)!=null?r:"",this}commit(){if(!this.committed&&(this.committed=!0,this.method)){const e=this.args[0],n=this.args.slice(1),r={stack:this.stack,content:{message:e,args:n},options:this.chainOptions};this.adapter[this.method](r)}}}let ep=class Lu{constructor(e){Ae(this,"adapter");this.adapter=e}static create(e){const n=new Lu(e);return n.setMetadata({account:null,client:op()}),n}child(e,n={}){return new Lu(this.adapter.child(e,n))}lazyChild(e,n={}){let r;return new Proxy({},{get:(i,a,o)=>(r||(r=this.child(e,n)),Reflect.get(r,a,o))})}setMetadata(e){this.adapter.setMetadata(e)}setLevel(e){if(!zh(e))throw new ul(e);this.adapter.setLevel(e)}createChain(e){return new Bb(this.adapter,e)}trace(...e){return this.createChain().trace(...e)}debug(...e){return this.createChain().debug(...e)}info(...e){return this.createChain().info(...e)}warn(...e){return this.createChain().warn(...e)}error(...e){return this.createChain().error(...e)}fatal(...e){return this.createChain().fatal(...e)}options(e){return this.createChain(e)}};function Mb(t){return Zn().logger.lazyChild(t)}function tp(t,e){return ep.create(new Du({source:t,levelService:new jb(t),consoleLogger:new Xv,httpLogger:ll.create({db:e,project:t})}))}const Ub="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Vb=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=Ub[n[t]&63];return e};const Sa=(t=8)=>Vb(t),np=(t,e=!1)=>{const n=Object.entries(t).reduce((r,[i,a])=>a!==void 0&&(!e||a!==null)?`${r}${r?"&":""}${i}=${a}`:r,"");return n?`?${n}`:""},rp=t=>{const e=document.getElementById(t);return e?new URL(e.src).searchParams:new URLSearchParams};function qb(){const t=new Error().stack.split(`
56
- `);return t.length<3?"":t[2].trim().substring(3)}function Hb(t){return new Promise(e=>setTimeout(e,t))}const Lt=class Lt{constructor(){Ae(this,"projectName","nizza");Ae(this,"instanceId",Sa());Ae(this,"logger",tp(this.projectName,jh));Ae(this,"coreLogger",this.logger.child("core"));Ae(this,"_logger",this.coreLogger.child("NizzaStore"));Ae(this,"_config",null);Ae(this,"_account");Ae(this,"_accountStatus","idle");Ae(this,"_productDataSource");Ae(this,"_eventBus",new Bh("nizza",this.coreLogger));Ae(this,"activeAccountFetchId",null);mv(this,{_config:ot,_account:ot,_productDataSource:ot,_accountStatus:ot,config:Sn,account:Sn,accountName:Sn,accountStatus:Sn,setAccount:Rt,configure:Rt,refetchAccount:Rt,setProductDataSource:Rt,setAddToCartConfig:Rt,setProductId:Rt},{name:"NizzaStore",autoBind:!0}),this.refetchAccount=this.refetchAccount.bind(this)}static instance(){var n;if(!!((n=window==null?void 0:window.nizza)!=null&&n.store))Lt._instance=window.nizza.store;else{const r=new Lt;Lt._instance=r,Lt._instance.coreLogger.debug("Created new NizzaStore instance")}return window.nizza||(window.nizza={},window.nz={},Lt._instance.coreLogger.debug("Initialized nizza window object")),window.nizza.store=Lt._instance,window.nz=window.nizza,Lt._instance}async configure(e){try{this._logger.debug("Running configure with config:",e),await this.updateConfig(e)}catch(n){this.setAccountStatus("error"),this._logger.error("Error running configure",n)}}async updateConfig(e={}){var i,a;const{account:n,authToken:r}=(i=this._config)!=null?i:{};this._config={...this._config,...e},(a=this._config)!=null&&a.account&&(n!==this._config.account||r!==this._config.authToken)?(this._logger.debug(`Fetching account data for account: ${this._config.account}, authToken provided: ${!!this._config.authToken}`),this.logger.setMetadata({account:this._config.account}),await this.fetchAccount(this._config.account,this._config.authToken)):this._logger.debug("Skipped fetching account data as the account or authToken did not change"),e.getProductDataSource&&this.setProductDataSource(await e.getProductDataSource())}async fetchAccount(e,n){this.setAccountStatus("loading");const r=Sa();this.activeAccountFetchId=r;try{const i=await _p(e,n);if(this.activeAccountFetchId!==r){this._logger.debug("Fetch account request was superseded by a newer request");return}this.setAccount(i),this.setAccountStatus("success"),this._logger.debug("Account fetched and set successfully:",i)}catch(i){this.activeAccountFetchId===r&&(this.setAccountStatus("error"),i instanceof yl?this._logger.fatal("Nizza account not found",e).options({silent:!0}):this._logger.fatal("Unexpected error fetching account",i))}}setAccount(e){this._account=e}setAccountStatus(e){this._accountStatus=e}setProductDataSource(e){this._productDataSource=e}setProductId(e){this._config&&(this._config.productId=e)}setOrderFormId(e){this._config&&(this._config.orderFormId=e)}setAddToCartConfig(e){if(!this._config){const n="You cannot set addToCartConfig before running configure()";throw this._logger.error(n),new Error(n)}this._config.addToCartConfig=e}setAuthToken(e){this.updateConfig({authToken:e})}async refetchAccount(){var e;(e=this._config)!=null&&e.account&&await this.fetchAccount(this._config.account,this._config.authToken)}get version(){return Lt.version}get config(){return this._config}get account(){return this._account}get accountStatus(){return this._accountStatus}get accountName(){var e;return(e=this._config)==null?void 0:e.account}isPvtAccount(e){var n;return!!(e&&((n=this._config)!=null&&n.authToken))}isPubAccount(e){var n;return!!(e&&!((n=this._config)!=null&&n.authToken))}get productDataSource(){return this._productDataSource}get eventBus(){return this._eventBus}};Ae(Lt,"version","8"),Ae(Lt,"_instance");let Aa=Lt;const Zn=t=>{const e=Aa.instance();return dv(()=>!!e.account,()=>t==null?void 0:t(e)),e};function ip(){return Ue.useMemo(()=>Zn(),[])}function ap(t,e){const n=ip();return Lh(()=>t(n),e)}const{coreLogger:Kb}=Zn(),zb=Kb.child("getClientTimeZone");function sp(t=!1){var a,o,l;let e=null,n=null,r=null;try{e=(l=(o=(a=Intl.DateTimeFormat())==null?void 0:a.resolvedOptions())==null?void 0:o.timeZone)!=null?l:null;const c=-new Date().getTimezoneOffset();r=c;const f=c>=0?"+":"-",h=String(Math.floor(Math.abs(c)/60)).padStart(2,"0"),y=String(Math.abs(c)%60).padStart(2,"0");n=`${f}${h}:${y}`}catch(c){zb.error("Error obtaining time zone or offset",c)}const i={offset:n,offsetValue:r,value:e,country:null,included:null,label:null};if(t){const{country:c,included:f,label:h,...y}=i;return y}return i}function op(){const t=typeof navigator!="undefined",e=t?navigator.userAgent:"server",{browser:n,os:r,device:i}=Gb(e),a=t?navigator.language:"server",o=t&&navigator.languages?navigator.languages:[],l=typeof window!="undefined"&&window.screen?{width:window.screen.width,height:window.screen.height,colorDepth:window.screen.colorDepth}:null,c=t&&"connection"in navigator?{downlink:navigator.connection.downlink,effectiveType:navigator.connection.effectiveType,rtt:navigator.connection.rtt,saveData:navigator.connection.saveData}:null,f=t?navigator.hardwareConcurrency:null,h=t&&"deviceMemory"in navigator?navigator.deviceMemory:null,y=sp(!0);return{userAgent:e,browser:n,os:r,device:i,language:a,languages:o,screen:l,connection:c,hardwareConcurrency:f,deviceMemory:h,timezone:y}}function Gb(t){var r;const e={browser:[{name:"Edge",regex:/Edg\/([\d.]+)/},{name:"Chrome",regex:/Chrome\/([\d.]+)/},{name:"Firefox",regex:/Firefox\/([\d.]+)/},{name:"Safari",regex:/Version\/([\d.]+).*Safari/},{name:"Opera",regex:/OPR\/([\d.]+)/}],os:[{name:"Windows",regex:/Windows NT ([\d.]+)/},{name:"macOS",regex:/Mac OS X ([\d_]+)/},{name:"iOS",regex:/iPhone OS ([\d_]+)/},{name:"Android",regex:/Android ([\d.]+)/},{name:"Linux",regex:/Linux/}],device:[{name:"iPhone",regex:/iPhone/},{name:"iPad",regex:/iPad/},{name:"Android",regex:/Android/}]},n=i=>{var o;const a=e[i].find(l=>l.regex.test(t));return{name:a?a.name:"Unknown",version:a&&((o=t.match(a.regex))==null?void 0:o[1].replace(/_/g,"."))||"Unknown"}};return{browser:n("browser"),os:n("os"),device:{model:n("device").name,type:n("device").name!=="Unknown"?"Mobile":"Desktop",vendor:((r=t.match(/; (\w+) Build/))==null?void 0:r[1])||"Unknown"}}}var up=(t=>(t.VTEX="VTEX",t.VTEX_IO="VTEX-IO",t.VTEX_CMS="PORTAL-VTEX",t.PLATFORM="PLATFORM",t.UNKNOWN="UNKNOWN",t))(up||{}),lp=(t=>(t.PLATFORM="platform_module",t.ADENDA="subscription_module",t.APP_STORE="app_store",t))(lp||{}),cp=(t=>(t.ACTIVE="active_contract",t.INACTIVE="inactive_contract",t))(cp||{}),dp=(t=>(t.LITE="lite",t.STANDARD="standard",t.PRO="pro",t))(dp||{}),fp=(t=>(t.LITE="PLAN_LITE",t.STANDARD="PLAN_ESTANDAR",t.PRO="PLAN_PRO",t.NONE="NO_PLAN",t))(fp||{}),hp=(t=>(t.PAST="past",t.LIVE="live",t.FUTURE="future",t))(hp||{});class yl extends dn{constructor(e){super("NIZZA_ACCOUNT_NOT_FOUND_ERROR",`Error finding account: ${e}`)}}class pp extends dn{constructor(e){super("NIZZA_PLAN_NOT_FOUND_ERROR",`Error finding plan: ${e}`)}}class mp extends dn{constructor(e){super("NIZZA_CREATE_PLAN_ERROR",`Error creating plan: ${e.plan}`,e)}}const xd=`${_r.apiUrls.restV1}/plans`;class gp{async get(e){const r=`/info${np({planType:e})}`,i=xd+r,{data:a}=await qn({url:i});return a}async create(e){const n=`${xd}/create`,{success:r}=await qn({url:n,method:"POST",body:JSON.stringify(e)});if(!r)throw new mp(e)}}function Wb(t){const{host:e,account:n,username:r,createdAt:i,subscriptionType:a,installationDateApp:o,...l}=t;return{...l,account:n,host:e!=null?e:null,username:r!=null?r:n,createdAt:new Date(i),subscriptionType:a!=null?a:null,installationDateApp:new Date(o)}}function Jb(t){const{host:e,...n}=t;return{...n,host:e!=null?e:null,plan:{}}}const Yb=`${_r.apiUrls.restV1}/accounts/v2`;class yp{async get(e){const n=`${Yb}/${e}`,{data:r}=await qn({url:n});return r?Jb(r):null}}const Qb=`${_r.apiUrls.restV1}/accounts/v2/pvt`;class Xb{async get(e,n){const r=`${Qb}/${e}`,{data:i}=await qn({url:r,headers:{authorization:`Bearer ${n}`}});return i?Wb(i):null}}class vp{constructor(e,n,r){this.publicAccountRepo=e,this.privateAccountRepo=n,this.accountPlanRepo=r}async get(e,n){try{const r=n?await this.privateAccountRepo.get(e,n):await this.publicAccountRepo.get(e);if(!r)throw new yl(e);const i=await this.accountPlanRepo.get(r.descriptionPlan);if(!i)throw new pp(r.descriptionPlan);return{...r,plan:i}}catch(r){throw new Zu(r)}}}const Zb=new yp,ek=new Xb,tk=new gp,bp=new vp(Zb,ek,tk),kp=()=>{const{account:t,accountName:e,accountStatus:n,refetchAccount:r,isPvtAccount:i,isPubAccount:a}=ap(f=>({account:f.account,accountName:f.accountName,accountStatus:f.accountStatus,refetchAccount:f.refetchAccount,isPvtAccount:f.isPvtAccount,isPubAccount:f.isPubAccount})),o=["idle","loading"].includes(n);return{account:t,accountName:e,isLoading:o,isError:n==="error",isSuccess:n==="success",accountStatus:n,refetchAccount:r,isPvtAccount:i,isPubAccount:a}};async function _p(t,e){return bp.get(t,e)}var Sp=(t=>(t.Created="CREATED",t.Finalized="FINALIZED",t.Live="LIVE",t.Starting="STARTING",t))(Sp||{}),Ap=(t=>(t.Add="add",t.Remove="remove",t))(Ap||{}),Ep=(t=>(t.Active="active",t.Inactive="inactive",t))(Ep||{});const nk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},rk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},ik={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},ak={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},sk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ManageCollectionProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ManageCollectionProductInInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"manageCollectionProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},ok={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},uk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},lk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindMinimalEvent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EventData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"thumbnailsPath"}},{kind:"Field",name:{kind:"Name",value:"recordVideoPath"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"thumbnails"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},ck={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchMinimalEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EventArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"thumbnailsPath"}},{kind:"Field",name:{kind:"Name",value:"recordVideoPath"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},dk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BlockUser"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BlockUserInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"blockUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BlockUserSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},fk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ChangeAccountUsername"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ChangeUsernameInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"changeAccountUsername"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChangeUsernameSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},hk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DeleteChatInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DeleteChatMessageSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},pk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetAllChatMessageInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChatMessageArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"connectionId"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"idEvent"}},{kind:"Field",name:{kind:"Name",value:"sendDate"}},{kind:"Field",name:{kind:"Name",value:"sessionId"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"username"}},{kind:"Field",name:{kind:"Name",value:"isAdmin"}},{kind:"Field",name:{kind:"Name",value:"urlGif"}},{kind:"Field",name:{kind:"Name",value:"second"}},{kind:"Field",name:{kind:"Name",value:"ip"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},wp={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetChatRoomToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetChatRoomInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getChatRoomToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChatRoomTokenData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},mk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PinChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PinChatInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pinChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PinChatMessageSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},gk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"highlightProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"HighlightProductInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highlightProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"HighlightProductSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},yk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteAllCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerInputAccount"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAllCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},vk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getAllCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"section"}},{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},bk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},kk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"sendAddToCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddToCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sendAddToCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AddToCartSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},_k={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetTimeLine"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetTimeLineInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getTimeLine"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TimeLineArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"time"}},{kind:"Field",name:{kind:"Name",value:"likes"}},{kind:"Field",name:{kind:"Name",value:"comments"}},{kind:"Field",name:{kind:"Name",value:"viewers"}},{kind:"Field",name:{kind:"Name",value:"orders"}},{kind:"Field",name:{kind:"Name",value:"minute"}},{kind:"Field",name:{kind:"Name",value:"hour"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Sk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AppendProductsToSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"RelateToProductsSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appendProductsSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Ak={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreatePlayListInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createPlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CreatePlayListSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Ek={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateSnackVideoBatch"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},wk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteRelationshipWithSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoRelationshipKeys"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteRelationshipSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}}]}}]}}]}}]},Nk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DeleteSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Ok={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindManySnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindManySnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findManySnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Rk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllSnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoCreatedArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"snackVideos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"created"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"totalItems"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Tk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPlayLists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getPlayLists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlayListArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"created"}},{kind:"Field",name:{kind:"Name",value:"videoAmount"}},{kind:"Field",name:{kind:"Name",value:"productAmount"}},{kind:"Field",name:{kind:"Name",value:"updated"}},{kind:"Field",name:{kind:"Name",value:"videos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Ck={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSnackVideoRelationships"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoRelationshipInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getRelationshipSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"RelationshipSnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sourceEntity"}},{kind:"Field",name:{kind:"Name",value:"attributeId"}}]}}]}}]}}]}}]},xk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchSnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoCreatedArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"snackVideos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"created"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"totalItems"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Pk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdatePlayListInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updatePlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UpdatePlayListSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Fk={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindByProductSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindByProductSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findByProductSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Ik={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetPlayListQueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getPlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlayListData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"videos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productId"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"productName"}},{kind:"Field",name:{kind:"Name",value:"productImageUrl"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Dk=Object.freeze(Object.defineProperty({__proto__:null,AddCollectionDocument:nk,AppendProductsToSnackVideoDocument:Sk,BlockUserDocument:dk,ChangeAccountUsernameDocument:fk,CreatePlayListDocument:Ak,CreateSnackVideoBatchDocument:Ek,DeleteAllCustomizationDocument:yk,DeleteChatMessageDocument:hk,DeleteCollectionDocument:rk,DeleteRelationshipWithSnackVideoDocument:wk,DeleteSnackVideoDocument:Nk,EventStatus:Sp,FindByProductSnackVideoDocument:Fk,FindCollectionDocument:ik,FindManySnackVideosDocument:Ok,FindMinimalEventDocument:lk,GetAllChatMessageDocument:pk,GetAllCollectionsDocument:ak,GetAllCustomizationDocument:vk,GetAllSnackVideosDocument:Rk,GetChatRoomTokenDocument:wp,GetPlayListDocument:Ik,GetPlayListsDocument:Tk,GetSnackVideoRelationshipsDocument:Ck,GetTimeLineDocument:_k,HighlightProductDocument:gk,ManageCollectionProductDocument:sk,Methods:Ap,PinChatMessageDocument:mk,SearchCollectionsDocument:ok,SearchMinimalEventsDocument:ck,SearchSnackVideosDocument:xk,SendAddToCartDocument:kk,Status:Ep,UpdateCollectionDocument:uk,UpdateCustomizationDocument:bk,UpdatePlayListDocument:Pk},Symbol.toStringTag,{value:"Module"}));var Xa=(t=>(t.OPEN_TAB="openTab",t.OPEN_VARIATION_SELECTOR="openVariationSelector",t.ADD_TO_CART="addToCart",t))(Xa||{});function Lk(t){return{class:t,_value:null,get value(){return this._value||(this._value=new t,Object.freeze(this)),this._value}}}var fn=(t=>(t.Local="local",t.VtexLegacy="vtexlegacy",t.VtexIO="vtexio",t.VtexFastStore="faststore",t.Platform="platform",t.External="external",t))(fn||{}),vl=(t=>(t.PROD="prod",t.DEV="dev",t.LOCAL="local",t))(vl||{});const{coreLogger:$k}=Zn(),$u=$k.child("addToCartHooks"),ju={errorAddingToCart:"addToCartHooks.notification.error",errorOpeningVariationSelector:"addToCartHooks.notification.error",errorOpeningNewTab:"addToCartHooks.notification.error",successAddingToCart:"addToCartHooks.notification.success"};async function jk(t){const e={...t,action:{type:Xa.ADD_TO_CART,exec:()=>$u.error("action no implemented in validate hook")}};try{const n=await Bk(e),r=await Mk(n);await Uk(r)}catch(n){$u.error("error unhandled",n)}}async function Bk(t){var a,o;const{context:e,userAddToCartConfig:n}=t,r=(a=n==null?void 0:n.hooks)==null?void 0:a.transform;let i=t.product;if(r)try{i=await r({product:{...i},data:(o=e.data)!=null?o:{}})}catch(l){Ea("transform",l)}return{...t,product:i}}async function Mk(t){var c,f;const{context:e,hookStrategy:n,userAddToCartConfig:r,product:i}=t,a=Np(t),o=(c=r==null?void 0:r.hooks)==null?void 0:c.validate;let l=n.validate({...t,actionFactory:a});if(o)try{l=await o({product:{...i},defaultAction:{...l},action:a,data:(f=e.data)!=null?f:{}})}catch(h){Ea("validate",h)}return{...t,action:l,actionFactory:a}}async function Uk(t){var b;const{eventBus:e}=Zn(),{product:n,userAddToCartConfig:r,notifyFactory:i,action:a,actionFactory:o}=t,{isVariationSelectorOpen:l,data:c={}}=t.context,f=(b=r==null?void 0:r.hooks)==null?void 0:b.end,h=a.type===Xa.ADD_TO_CART;let y=null,m=!1;const O=()=>{!h||!l||o.openVariationSelector(!1).exec()},A=()=>{!h||m||(y?i.error(ju.errorAddingToCart):i.success(ju.successAddingToCart))},E=()=>{const k={product:n,actionType:a.type,success:!y,error:y};e.emit(Uh.ATCH_ACTION_EXECUTED,k)};try{if(!a.type||!a.exec)throw new Error("Invalid action object, missing keys 'type' or 'exec'");await a.exec()}catch(k){Ea("end",k),y=k}if(f)try{m=!!await f({data:c,error:y,notify:i,actionExecuted:a})}catch(k){Ea("end",k)}O(),A(),E()}function Np(t){const{actionFactory:e,userAddToCartConfig:n}=t,r=i=>Object.entries(i!=null?i:{}).reduce((a,[o,l])=>({...a,[o]:c=>({type:o,exec:()=>l(c)})}),{});return{...r(e),...r(n==null?void 0:n.actionFactory)}}function Ea(t,e){$u.error(`addToCartHooks error running ${t}: `,e)}class Op{constructor(e){Ae(this,"aggregate");Ae(this,"_numSetPropsApplied",0);this.aggregate=e}setProps(e){for(const[n,r]of Object.entries(e))n in this.aggregate&&(this.aggregate[n]=r);this._numSetPropsApplied++}get isFirstSetProps(){return this._numSetPropsApplied===1}}function Rp(t){return new Op(t)}class Vk{constructor(e){Ae(this,"_value");e!==void 0&&(this._value=e)}get value(){return this._value}}var kt=(t=>(t.GENERAL_ERROR="GENERAL_ERROR",t.AXIOS_ERROR="AXIOS_ERROR",t.NETWORK_ERROR="NETWORK_ERROR",t.CONFIG_ERROR="CONFIG_ERROR",t.TIMEOUT_ERROR="TIMEOUT_ERROR",t.AUTH_ERROR="AUTH_ERROR",t.NOT_FOUND="NOT_FOUND",t.VALIDATION_ERROR="VALIDATION_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.BAD_REQUEST="BAD_REQUEST",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.CONFLICT="CONFLICT",t.GONE="GONE",t.UNSUPPORTED_MEDIA_TYPE="UNSUPPORTED_MEDIA_TYPE",t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",t.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",t))(kt||{});function Tp(t,e){return function(){return t.apply(e,arguments)}}const{toString:qk}=Object.prototype,{getPrototypeOf:bl}=Object,Za=(t=>e=>{const n=qk.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Jt=t=>(t=t.toLowerCase(),e=>Za(e)===t),es=t=>e=>typeof e===t,{isArray:Or}=Array,oi=es("undefined");function Hk(t){return t!==null&&!oi(t)&&t.constructor!==null&&!oi(t.constructor)&&xt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Cp=Jt("ArrayBuffer");function Kk(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Cp(t.buffer),e}const zk=es("string"),xt=es("function"),xp=es("number"),ts=t=>t!==null&&typeof t=="object",Gk=t=>t===!0||t===!1,oa=t=>{if(Za(t)!=="object")return!1;const e=bl(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Wk=Jt("Date"),Jk=Jt("File"),Yk=Jt("Blob"),Qk=Jt("FileList"),Xk=t=>ts(t)&&xt(t.pipe),Zk=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||xt(t.append)&&((e=Za(t))==="formdata"||e==="object"&&xt(t.toString)&&t.toString()==="[object FormData]"))},e_=Jt("URLSearchParams"),[t_,n_,r_,i_]=["ReadableStream","Request","Response","Headers"].map(Jt),a_=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vi(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let r,i;if(typeof t!="object"&&(t=[t]),Or(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const a=n?Object.getOwnPropertyNames(t):Object.keys(t),o=a.length;let l;for(r=0;r<o;r++)l=a[r],e.call(null,t[l],l,t)}}function Pp(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Bn=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,Fp=t=>!oi(t)&&t!==Bn;function Bu(){const{caseless:t}=Fp(this)&&this||{},e={},n=(r,i)=>{const a=t&&Pp(e,i)||i;oa(e[a])&&oa(r)?e[a]=Bu(e[a],r):oa(r)?e[a]=Bu({},r):Or(r)?e[a]=r.slice():e[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&vi(arguments[r],n);return e}const s_=(t,e,n,{allOwnKeys:r}={})=>(vi(e,(i,a)=>{n&&xt(i)?t[a]=Tp(i,n):t[a]=i},{allOwnKeys:r}),t),o_=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),u_=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},l_=(t,e,n,r)=>{let i,a,o;const l={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),a=i.length;a-- >0;)o=i[a],(!r||r(o,t,e))&&!l[o]&&(e[o]=t[o],l[o]=!0);t=n!==!1&&bl(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},c_=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},d_=t=>{if(!t)return null;if(Or(t))return t;let e=t.length;if(!xp(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},f_=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&bl(Uint8Array)),h_=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let i;for(;(i=r.next())&&!i.done;){const a=i.value;e.call(t,a[0],a[1])}},p_=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},m_=Jt("HTMLFormElement"),g_=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Pd=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),y_=Jt("RegExp"),Ip=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};vi(n,(i,a)=>{let o;(o=e(i,a,t))!==!1&&(r[a]=o||i)}),Object.defineProperties(t,r)},v_=t=>{Ip(t,(e,n)=>{if(xt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(xt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},b_=(t,e)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return Or(t)?r(t):r(String(t).split(e)),n},k_=()=>{},__=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,iu="abcdefghijklmnopqrstuvwxyz",Fd="0123456789",Dp={DIGIT:Fd,ALPHA:iu,ALPHA_DIGIT:iu+iu.toUpperCase()+Fd},S_=(t=16,e=Dp.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function A_(t){return!!(t&&xt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const E_=t=>{const e=new Array(10),n=(r,i)=>{if(ts(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[i]=r;const a=Or(r)?[]:{};return vi(r,(o,l)=>{const c=n(o,i+1);!oi(c)&&(a[l]=c)}),e[i]=void 0,a}}return r};return n(t,0)},w_=Jt("AsyncFunction"),N_=t=>t&&(ts(t)||xt(t))&&xt(t.then)&&xt(t.catch),Lp=((t,e)=>t?setImmediate:e?((n,r)=>(Bn.addEventListener("message",({source:i,data:a})=>{i===Bn&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Bn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xt(Bn.postMessage)),O_=typeof queueMicrotask!="undefined"?queueMicrotask.bind(Bn):typeof process!="undefined"&&process.nextTick||Lp,ee={isArray:Or,isArrayBuffer:Cp,isBuffer:Hk,isFormData:Zk,isArrayBufferView:Kk,isString:zk,isNumber:xp,isBoolean:Gk,isObject:ts,isPlainObject:oa,isReadableStream:t_,isRequest:n_,isResponse:r_,isHeaders:i_,isUndefined:oi,isDate:Wk,isFile:Jk,isBlob:Yk,isRegExp:y_,isFunction:xt,isStream:Xk,isURLSearchParams:e_,isTypedArray:f_,isFileList:Qk,forEach:vi,merge:Bu,extend:s_,trim:a_,stripBOM:o_,inherits:u_,toFlatObject:l_,kindOf:Za,kindOfTest:Jt,endsWith:c_,toArray:d_,forEachEntry:h_,matchAll:p_,isHTMLForm:m_,hasOwnProperty:Pd,hasOwnProp:Pd,reduceDescriptors:Ip,freezeMethods:v_,toObjectSet:b_,toCamelCase:g_,noop:k_,toFiniteNumber:__,findKey:Pp,global:Bn,isContextDefined:Fp,ALPHABET:Dp,generateString:S_,isSpecCompliantForm:A_,toJSONObject:E_,isAsyncFn:w_,isThenable:N_,setImmediate:Lp,asap:O_};function $e(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}ee.inherits($e,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.status}}});const $p=$e.prototype,jp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{jp[t]={value:t}});Object.defineProperties($e,jp);Object.defineProperty($p,"isAxiosError",{value:!0});$e.from=(t,e,n,r,i,a)=>{const o=Object.create($p);return ee.toFlatObject(t,o,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),$e.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,a&&Object.assign(o,a),o};const R_=null;function Mu(t){return ee.isPlainObject(t)||ee.isArray(t)}function Bp(t){return ee.endsWith(t,"[]")?t.slice(0,-2):t}function Id(t,e,n){return t?t.concat(e).map(function(i,a){return i=Bp(i),!n&&a?"["+i+"]":i}).join(n?".":""):e}function T_(t){return ee.isArray(t)&&!t.some(Mu)}const C_=ee.toFlatObject(ee,{},null,function(e){return/^is[A-Z]/.test(e)});function ns(t,e,n){if(!ee.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ee.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,b){return!ee.isUndefined(b[E])});const r=n.metaTokens,i=n.visitor||h,a=n.dots,o=n.indexes,c=(n.Blob||typeof Blob!="undefined"&&Blob)&&ee.isSpecCompliantForm(e);if(!ee.isFunction(i))throw new TypeError("visitor must be a function");function f(A){if(A===null)return"";if(ee.isDate(A))return A.toISOString();if(!c&&ee.isBlob(A))throw new $e("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(A)||ee.isTypedArray(A)?c&&typeof Blob=="function"?new Blob([A]):Buffer.from(A):A}function h(A,E,b){let k=A;if(A&&!b&&typeof A=="object"){if(ee.endsWith(E,"{}"))E=r?E:E.slice(0,-2),A=JSON.stringify(A);else if(ee.isArray(A)&&T_(A)||(ee.isFileList(A)||ee.endsWith(E,"[]"))&&(k=ee.toArray(A)))return E=Bp(E),k.forEach(function(S,R){!(ee.isUndefined(S)||S===null)&&e.append(o===!0?Id([E],R,a):o===null?E:E+"[]",f(S))}),!1}return Mu(A)?!0:(e.append(Id(b,E,a),f(A)),!1)}const y=[],m=Object.assign(C_,{defaultVisitor:h,convertValue:f,isVisitable:Mu});function O(A,E){if(!ee.isUndefined(A)){if(y.indexOf(A)!==-1)throw Error("Circular reference detected in "+E.join("."));y.push(A),ee.forEach(A,function(k,C){(!(ee.isUndefined(k)||k===null)&&i.call(e,k,ee.isString(C)?C.trim():C,E,m))===!0&&O(k,E?E.concat(C):[C])}),y.pop()}}if(!ee.isObject(t))throw new TypeError("data must be an object");return O(t),e}function Dd(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function kl(t,e){this._pairs=[],t&&ns(t,this,e)}const Mp=kl.prototype;Mp.append=function(e,n){this._pairs.push([e,n])};Mp.toString=function(e){const n=e?function(r){return e.call(this,r,Dd)}:Dd;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function x_(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Up(t,e,n){if(!e)return t;const r=n&&n.encode||x_,i=n&&n.serialize;let a;if(i?a=i(e,n):a=ee.isURLSearchParams(e)?e.toString():new kl(e,n).toString(r),a){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class Ld{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ee.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Vp={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},P_=typeof URLSearchParams!="undefined"?URLSearchParams:kl,F_=typeof FormData!="undefined"?FormData:null,I_=typeof Blob!="undefined"?Blob:null,D_={isBrowser:!0,classes:{URLSearchParams:P_,FormData:F_,Blob:I_},protocols:["http","https","file","blob","url","data"]},_l=typeof window!="undefined"&&typeof document!="undefined",Uu=typeof navigator=="object"&&navigator||void 0,L_=_l&&(!Uu||["ReactNative","NativeScript","NS"].indexOf(Uu.product)<0),$_=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",j_=_l&&window.location.href||"http://localhost",B_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_l,hasStandardBrowserEnv:L_,hasStandardBrowserWebWorkerEnv:$_,navigator:Uu,origin:j_},Symbol.toStringTag,{value:"Module"})),Et={...B_,...D_};function M_(t,e){return ns(t,new Et.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return Et.isNode&&ee.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function U_(t){return ee.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function V_(t){const e={},n=Object.keys(t);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],e[a]=t[a];return e}function qp(t){function e(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=a>=n.length;return o=!o&&ee.isArray(i)?i.length:o,c?(ee.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!l):((!i[o]||!ee.isObject(i[o]))&&(i[o]=[]),e(n,r,i[o],a)&&ee.isArray(i[o])&&(i[o]=V_(i[o])),!l)}if(ee.isFormData(t)&&ee.isFunction(t.entries)){const n={};return ee.forEachEntry(t,(r,i)=>{e(U_(r),i,n,0)}),n}return null}function q_(t,e,n){if(ee.isString(t))try{return(e||JSON.parse)(t),ee.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const bi={transitional:Vp,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=ee.isObject(e);if(a&&ee.isHTMLForm(e)&&(e=new FormData(e)),ee.isFormData(e))return i?JSON.stringify(qp(e)):e;if(ee.isArrayBuffer(e)||ee.isBuffer(e)||ee.isStream(e)||ee.isFile(e)||ee.isBlob(e)||ee.isReadableStream(e))return e;if(ee.isArrayBufferView(e))return e.buffer;if(ee.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return M_(e,this.formSerializer).toString();if((l=ee.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return ns(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),q_(e)):e}],transformResponse:[function(e){const n=this.transitional||bi.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(ee.isResponse(e)||ee.isReadableStream(e))return e;if(e&&ee.isString(e)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(l){if(o)throw l.name==="SyntaxError"?$e.from(l,$e.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Et.classes.FormData,Blob:Et.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],t=>{bi.headers[t]={}});const H_=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),K_=t=>{const e={};let n,r,i;return t&&t.split(`
57
- `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||e[n]&&H_[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},$d=Symbol("internals");function qr(t){return t&&String(t).trim().toLowerCase()}function ua(t){return t===!1||t==null?t:ee.isArray(t)?t.map(ua):String(t)}function z_(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const G_=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function au(t,e,n,r,i){if(ee.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!ee.isString(e)){if(ee.isString(r))return e.indexOf(r)!==-1;if(ee.isRegExp(r))return r.test(e)}}function W_(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function J_(t,e){const n=ee.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,a,o){return this[r].call(this,e,i,a,o)},configurable:!0})})}let wt=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function a(l,c,f){const h=qr(c);if(!h)throw new Error("header name must be a non-empty string");const y=ee.findKey(i,h);(!y||i[y]===void 0||f===!0||f===void 0&&i[y]!==!1)&&(i[y||c]=ua(l))}const o=(l,c)=>ee.forEach(l,(f,h)=>a(f,h,c));if(ee.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(ee.isString(e)&&(e=e.trim())&&!G_(e))o(K_(e),n);else if(ee.isHeaders(e))for(const[l,c]of e.entries())a(c,l,r);else e!=null&&a(n,e,r);return this}get(e,n){if(e=qr(e),e){const r=ee.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return z_(i);if(ee.isFunction(n))return n.call(this,i,r);if(ee.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=qr(e),e){const r=ee.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||au(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function a(o){if(o=qr(o),o){const l=ee.findKey(r,o);l&&(!n||au(r,r[l],l,n))&&(delete r[l],i=!0)}}return ee.isArray(e)?e.forEach(a):a(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!e||au(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){const n=this,r={};return ee.forEach(this,(i,a)=>{const o=ee.findKey(r,a);if(o){n[o]=ua(i),delete n[a];return}const l=e?W_(a):String(a).trim();l!==a&&delete n[a],n[l]=ua(i),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ee.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&ee.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
58
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[$d]=this[$d]={accessors:{}}).accessors,i=this.prototype;function a(o){const l=qr(o);r[l]||(J_(i,o),r[l]=!0)}return ee.isArray(e)?e.forEach(a):a(e),this}};wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ee.reduceDescriptors(wt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});ee.freezeMethods(wt);function su(t,e){const n=this||bi,r=e||n,i=wt.from(r.headers);let a=r.data;return ee.forEach(t,function(l){a=l.call(n,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function Hp(t){return!!(t&&t.__CANCEL__)}function Rr(t,e,n){$e.call(this,t==null?"canceled":t,$e.ERR_CANCELED,e,n),this.name="CanceledError"}ee.inherits(Rr,$e,{__CANCEL__:!0});function Kp(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new $e("Request failed with status code "+n.status,[$e.ERR_BAD_REQUEST,$e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Y_(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Q_(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,a=0,o;return e=e!==void 0?e:1e3,function(c){const f=Date.now(),h=r[a];o||(o=f),n[i]=c,r[i]=f;let y=a,m=0;for(;y!==i;)m+=n[y++],y=y%t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),f-o<e)return;const O=h&&f-h;return O?Math.round(m*1e3/O):void 0}}function X_(t,e){let n=0,r=1e3/e,i,a;const o=(f,h=Date.now())=>{n=h,i=null,a&&(clearTimeout(a),a=null),t.apply(null,f)};return[(...f)=>{const h=Date.now(),y=h-n;y>=r?o(f,h):(i=f,a||(a=setTimeout(()=>{a=null,o(i)},r-y)))},()=>i&&o(i)]}const wa=(t,e,n=3)=>{let r=0;const i=Q_(50,250);return X_(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,c=o-r,f=i(c),h=o<=l;r=o;const y={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:f||void 0,estimated:f&&l&&h?(l-o)/f:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(y)},n)},jd=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Bd=t=>(...e)=>ee.asap(()=>t(...e)),Z_=Et.hasStandardBrowserEnv?function(){const e=Et.navigator&&/(msie|trident)/i.test(Et.navigator.userAgent),n=document.createElement("a");let r;function i(a){let o=a;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const l=ee.isString(o)?i(o):o;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),eS=Et.hasStandardBrowserEnv?{write(t,e,n,r,i,a){const o=[t+"="+encodeURIComponent(e)];ee.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),ee.isString(r)&&o.push("path="+r),ee.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tS(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function nS(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function zp(t,e){return t&&!tS(e)?nS(t,e):e}const Md=t=>t instanceof wt?{...t}:t;function zn(t,e){e=e||{};const n={};function r(f,h,y){return ee.isPlainObject(f)&&ee.isPlainObject(h)?ee.merge.call({caseless:y},f,h):ee.isPlainObject(h)?ee.merge({},h):ee.isArray(h)?h.slice():h}function i(f,h,y){if(ee.isUndefined(h)){if(!ee.isUndefined(f))return r(void 0,f,y)}else return r(f,h,y)}function a(f,h){if(!ee.isUndefined(h))return r(void 0,h)}function o(f,h){if(ee.isUndefined(h)){if(!ee.isUndefined(f))return r(void 0,f)}else return r(void 0,h)}function l(f,h,y){if(y in e)return r(f,h);if(y in t)return r(void 0,f)}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(f,h)=>i(Md(f),Md(h),!0)};return ee.forEach(Object.keys(Object.assign({},t,e)),function(h){const y=c[h]||i,m=y(t[h],e[h],h);ee.isUndefined(m)&&y!==l||(n[h]=m)}),n}const Gp=t=>{const e=zn({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:l}=e;e.headers=o=wt.from(o),e.url=Up(zp(e.baseURL,e.url),t.params,t.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(ee.isFormData(n)){if(Et.hasStandardBrowserEnv||Et.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[f,...h]=c?c.split(";").map(y=>y.trim()).filter(Boolean):[];o.setContentType([f||"multipart/form-data",...h].join("; "))}}if(Et.hasStandardBrowserEnv&&(r&&ee.isFunction(r)&&(r=r(e)),r||r!==!1&&Z_(e.url))){const f=i&&a&&eS.read(a);f&&o.set(i,f)}return e},rS=typeof XMLHttpRequest!="undefined",iS=rS&&function(t){return new Promise(function(n,r){const i=Gp(t);let a=i.data;const o=wt.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:f}=i,h,y,m,O,A;function E(){O&&O(),A&&A(),i.cancelToken&&i.cancelToken.unsubscribe(h),i.signal&&i.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function k(){if(!b)return;const S=wt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),x={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:S,config:t,request:b};Kp(function(I){n(I),E()},function(I){r(I),E()},x),b=null}"onloadend"in b?b.onloadend=k:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(k)},b.onabort=function(){b&&(r(new $e("Request aborted",$e.ECONNABORTED,t,b)),b=null)},b.onerror=function(){r(new $e("Network Error",$e.ERR_NETWORK,t,b)),b=null},b.ontimeout=function(){let R=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||Vp;i.timeoutErrorMessage&&(R=i.timeoutErrorMessage),r(new $e(R,x.clarifyTimeoutError?$e.ETIMEDOUT:$e.ECONNABORTED,t,b)),b=null},a===void 0&&o.setContentType(null),"setRequestHeader"in b&&ee.forEach(o.toJSON(),function(R,x){b.setRequestHeader(x,R)}),ee.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),l&&l!=="json"&&(b.responseType=i.responseType),f&&([m,A]=wa(f,!0),b.addEventListener("progress",m)),c&&b.upload&&([y,O]=wa(c),b.upload.addEventListener("progress",y),b.upload.addEventListener("loadend",O)),(i.cancelToken||i.signal)&&(h=S=>{b&&(r(!S||S.type?new Rr(null,t,b):S),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(h),i.signal&&(i.signal.aborted?h():i.signal.addEventListener("abort",h)));const C=Y_(i.url);if(C&&Et.protocols.indexOf(C)===-1){r(new $e("Unsupported protocol "+C+":",$e.ERR_BAD_REQUEST,t));return}b.send(a||null)})},aS=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const a=function(f){if(!i){i=!0,l();const h=f instanceof Error?f:this.reason;r.abort(h instanceof $e?h:new Rr(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,a(new $e(`timeout ${e} of ms exceeded`,$e.ETIMEDOUT))},e);const l=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(a):f.removeEventListener("abort",a)}),t=null)};t.forEach(f=>f.addEventListener("abort",a));const{signal:c}=r;return c.unsubscribe=()=>ee.asap(l),c}},sS=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},oS=async function*(t,e){for await(const n of uS(t))yield*sS(n,e)},uS=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Ud=(t,e,n,r)=>{const i=oS(t,e);let a=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:f,value:h}=await i.next();if(f){l(),c.close();return}let y=h.byteLength;if(n){let m=a+=y;n(m)}c.enqueue(new Uint8Array(h))}catch(f){throw l(f),f}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},rs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Wp=rs&&typeof ReadableStream=="function",lS=rs&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Jp=(t,...e)=>{try{return!!t(...e)}catch{return!1}},cS=Wp&&Jp(()=>{let t=!1;const e=new Request(Et.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Vd=64*1024,Vu=Wp&&Jp(()=>ee.isReadableStream(new Response("").body)),Na={stream:Vu&&(t=>t.body)};rs&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Na[e]&&(Na[e]=ee.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new $e(`Response type '${e}' is not supported`,$e.ERR_NOT_SUPPORT,r)})})})(new Response);const dS=async t=>{if(t==null)return 0;if(ee.isBlob(t))return t.size;if(ee.isSpecCompliantForm(t))return(await new Request(Et.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(ee.isArrayBufferView(t)||ee.isArrayBuffer(t))return t.byteLength;if(ee.isURLSearchParams(t)&&(t=t+""),ee.isString(t))return(await lS(t)).byteLength},fS=async(t,e)=>{const n=ee.toFiniteNumber(t.getContentLength());return n==null?dS(e):n},hS=rs&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:c,responseType:f,headers:h,withCredentials:y="same-origin",fetchOptions:m}=Gp(t);f=f?(f+"").toLowerCase():"text";let O=aS([i,a&&a.toAbortSignal()],o),A;const E=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let b;try{if(c&&cS&&n!=="get"&&n!=="head"&&(b=await fS(h,r))!==0){let x=new Request(e,{method:"POST",body:r,duplex:"half"}),z;if(ee.isFormData(r)&&(z=x.headers.get("content-type"))&&h.setContentType(z),x.body){const[I,re]=jd(b,wa(Bd(c)));r=Ud(x.body,Vd,I,re)}}ee.isString(y)||(y=y?"include":"omit");const k="credentials"in Request.prototype;A=new Request(e,{...m,signal:O,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:k?y:void 0});let C=await fetch(A);const S=Vu&&(f==="stream"||f==="response");if(Vu&&(l||S&&E)){const x={};["status","statusText","headers"].forEach(ie=>{x[ie]=C[ie]});const z=ee.toFiniteNumber(C.headers.get("content-length")),[I,re]=l&&jd(z,wa(Bd(l),!0))||[];C=new Response(Ud(C.body,Vd,I,()=>{re&&re(),E&&E()}),x)}f=f||"text";let R=await Na[ee.findKey(Na,f)||"text"](C,t);return!S&&E&&E(),await new Promise((x,z)=>{Kp(x,z,{data:R,headers:wt.from(C.headers),status:C.status,statusText:C.statusText,config:t,request:A})})}catch(k){throw E&&E(),k&&k.name==="TypeError"&&/fetch/i.test(k.message)?Object.assign(new $e("Network Error",$e.ERR_NETWORK,t,A),{cause:k.cause||k}):$e.from(k,k&&k.code,t,A)}}),qu={http:R_,xhr:iS,fetch:hS};ee.forEach(qu,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const qd=t=>`- ${t}`,pS=t=>ee.isFunction(t)||t===null||t===!1,Yp={getAdapter:t=>{t=ee.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let a=0;a<e;a++){n=t[a];let o;if(r=n,!pS(n)&&(r=qu[(o=String(n)).toLowerCase()],r===void 0))throw new $e(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?a.length>1?`since :
59
- `+a.map(qd).join(`
60
- `):" "+qd(a[0]):"as no adapter specified";throw new $e("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:qu};function ou(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Rr(null,t)}function Hd(t){return ou(t),t.headers=wt.from(t.headers),t.data=su.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Yp.getAdapter(t.adapter||bi.adapter)(t).then(function(r){return ou(t),r.data=su.call(t,t.transformResponse,r),r.headers=wt.from(r.headers),r},function(r){return Hp(r)||(ou(t),r&&r.response&&(r.response.data=su.call(t,t.transformResponse,r.response),r.response.headers=wt.from(r.response.headers))),Promise.reject(r)})}const Qp="1.7.7",Sl={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Sl[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Kd={};Sl.transitional=function(e,n,r){function i(a,o){return"[Axios v"+Qp+"] Transitional option '"+a+"'"+o+(r?". "+r:"")}return(a,o,l)=>{if(e===!1)throw new $e(i(o," has been removed"+(n?" in "+n:"")),$e.ERR_DEPRECATED);return n&&!Kd[o]&&(Kd[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,o,l):!0}};function mS(t,e,n){if(typeof t!="object")throw new $e("options must be an object",$e.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const a=r[i],o=e[a];if(o){const l=t[a],c=l===void 0||o(l,a,t);if(c!==!0)throw new $e("option "+a+" must be "+c,$e.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $e("Unknown option "+a,$e.ERR_BAD_OPTION)}}const Hu={assertOptions:mS,validators:Sl},kn=Hu.validators;let Vn=class{constructor(e){this.defaults=e,this.interceptors={request:new Ld,response:new Ld}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
61
- `+a):r.stack=a}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=zn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:a}=n;r!==void 0&&Hu.assertOptions(r,{silentJSONParsing:kn.transitional(kn.boolean),forcedJSONParsing:kn.transitional(kn.boolean),clarifyTimeoutError:kn.transitional(kn.boolean)},!1),i!=null&&(ee.isFunction(i)?n.paramsSerializer={serialize:i}:Hu.assertOptions(i,{encode:kn.function,serialize:kn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&ee.merge(a.common,a[n.method]);a&&ee.forEach(["delete","get","head","post","put","patch","common"],A=>{delete a[A]}),n.headers=wt.concat(o,a);const l=[];let c=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(n)===!1||(c=c&&E.synchronous,l.unshift(E.fulfilled,E.rejected))});const f=[];this.interceptors.response.forEach(function(E){f.push(E.fulfilled,E.rejected)});let h,y=0,m;if(!c){const A=[Hd.bind(this),void 0];for(A.unshift.apply(A,l),A.push.apply(A,f),m=A.length,h=Promise.resolve(n);y<m;)h=h.then(A[y++],A[y++]);return h}m=l.length;let O=n;for(y=0;y<m;){const A=l[y++],E=l[y++];try{O=A(O)}catch(b){E.call(this,b);break}}try{h=Hd.call(this,O)}catch(A){return Promise.reject(A)}for(y=0,m=f.length;y<m;)h=h.then(f[y++],f[y++]);return h}getUri(e){e=zn(this.defaults,e);const n=zp(e.baseURL,e.url);return Up(n,e.params,e.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(e){Vn.prototype[e]=function(n,r){return this.request(zn(r||{},{method:e,url:n,data:(r||{}).data}))}});ee.forEach(["post","put","patch"],function(e){function n(r){return function(a,o,l){return this.request(zn(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Vn.prototype[e]=n(),Vn.prototype[e+"Form"]=n(!0)});let gS=class Xp{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(i=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](i);r._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(l=>{r.subscribe(l),a=l}).then(i);return o.cancel=function(){r.unsubscribe(a)},o},e(function(a,o,l){r.reason||(r.reason=new Rr(a,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Xp(function(i){e=i}),cancel:e}}};function yS(t){return function(n){return t.apply(null,n)}}function vS(t){return ee.isObject(t)&&t.isAxiosError===!0}const Ku={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ku).forEach(([t,e])=>{Ku[e]=t});function Zp(t){const e=new Vn(t),n=Tp(Vn.prototype.request,e);return ee.extend(n,Vn.prototype,e,{allOwnKeys:!0}),ee.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Zp(zn(t,i))},n}const rt=Zp(bi);rt.Axios=Vn;rt.CanceledError=Rr;rt.CancelToken=gS;rt.isCancel=Hp;rt.VERSION=Qp;rt.toFormData=ns;rt.AxiosError=$e;rt.Cancel=rt.CanceledError;rt.all=function(e){return Promise.all(e)};rt.spread=yS;rt.isAxiosError=vS;rt.mergeConfig=zn;rt.AxiosHeaders=wt;rt.formToJSON=t=>qp(ee.isHTMLForm(t)?new FormData(t):t);rt.getAdapter=Yp.getAdapter;rt.HttpStatusCode=Ku;rt.default=rt;const{Axios:gw,AxiosError:yw,CanceledError:vw,isCancel:bw,CancelToken:kw,VERSION:_w,all:Sw,Cancel:Aw,isAxiosError:Ew,spread:ww,toFormData:Nw,AxiosHeaders:Ow,HttpStatusCode:Rw,formToJSON:Tw,getAdapter:Cw,mergeConfig:xw}=rt,bS={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class Oa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||bS,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Oa(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Oa(this.logger,e)}}var Zt=new Oa;class is{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[l,c]=o;for(let f=0;f<c;f++)l(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,c]=o;for(let f=0;f<c;f++)l.apply(l,[e,...r])})}}const Hr=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},zd=t=>t==null?"":""+t,kS=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},_S=/###/g,Gd=t=>t&&t.indexOf("###")>-1?t.replace(_S,"."):t,Wd=t=>!t||typeof t=="string",Xr=(t,e,n)=>{const r=typeof e!="string"?e:e.split(".");let i=0;for(;i<r.length-1;){if(Wd(t))return{};const a=Gd(r[i]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++i}return Wd(t)?{}:{obj:t,k:Gd(r[i])}},Jd=(t,e,n)=>{const{obj:r,k:i}=Xr(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let a=e[e.length-1],o=e.slice(0,e.length-1),l=Xr(t,o,Object);for(;l.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),l=Xr(t,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${a}`]!="undefined"&&(l.obj=void 0);l.obj[`${l.k}.${a}`]=n},SS=(t,e,n,r)=>{const{obj:i,k:a}=Xr(t,e,Object);i[a]=i[a]||[],i[a].push(n)},Ra=(t,e)=>{const{obj:n,k:r}=Xr(t,e);if(n)return n[r]},AS=(t,e,n)=>{const r=Ra(t,n);return r!==void 0?r:Ra(e,n)},em=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):em(t[r],e[r],n):t[r]=e[r]);return t},lr=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ES={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const wS=t=>typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>ES[e]):t;class NS{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const OS=[" ",",","?","!",";"],RS=new NS(20),TS=(t,e,n)=>{e=e||"",n=n||"";const r=OS.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const i=RS.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!i.test(t);if(!a){const o=t.indexOf(n);o>0&&!i.test(t.substring(0,o))&&(a=!0)}return a},zu=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let i=t;for(let a=0;a<r.length;){if(!i||typeof i!="object")return;let o,l="";for(let c=a;c<r.length;++c)if(c!==a&&(l+=n),l+=r[c],o=i[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;a+=c-a+1;break}i=o}return i},Ta=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class Yd extends is{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,o=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,n],r&&(Array.isArray(r)?l.push(...r):typeof r=="string"&&a?l.push(...r.split(a)):l.push(r)));const c=Ra(this.data,l);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=l[0],n=l[1],r=l.slice(2).join(".")),c||!o||typeof r!="string"?c:zu(this.data&&this.data[e]&&this.data[e][n],r,a)}addResource(e,n,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let l=[e,n];r&&(l=l.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(l=e.split("."),i=n,n=l[1]),this.addNamespaces(n),Jd(this.data,l,i),a.silent||this.emit("added",e,n,r,i)}addResources(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in r)(typeof r[a]=="string"||Array.isArray(r[a]))&&this.addResource(e,n,a,r[a],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[e,n];e.indexOf(".")>-1&&(l=e.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let c=Ra(this.data,l)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?em(c,r,a):c={...c,...r},Jd(this.data,l,c),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var tm={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(a=>{this.processors[a]&&(e=this.processors[a].process(e,n,r,i))}),e}};const Qd={};class Ca extends is{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),kS(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Zt.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!TS(e,r,i);if(o&&!l){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:a};const f=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(f[0])>-1)&&(a=f.shift()),e=f.join(i)}return typeof a=="string"&&(a=[a]),{key:e,namespaces:a}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),c=l[l.length-1],f=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&f.toLowerCase()==="cimode"){if(h){const R=n.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${R}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${R}${o}`}return i?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:o}const y=this.resolve(e,n);let m=y&&y.res;const O=y&&y.usedKey||o,A=y&&y.exactUsedKey||o,E=Object.prototype.toString.apply(m),b=["[object Number]","[object Function]","[object RegExp]"],k=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject;if(C&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&b.indexOf(E)<0&&!(typeof k=="string"&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(O,m,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return i?(y.res=R,y.usedParams=this.getUsedParamsDetails(n),y):R}if(a){const R=Array.isArray(m),x=R?[]:{},z=R?A:O;for(const I in m)if(Object.prototype.hasOwnProperty.call(m,I)){const re=`${z}${a}${I}`;x[I]=this.translate(re,{...n,joinArrays:!1,ns:l}),x[I]===re&&(x[I]=m[I])}m=x}}else if(C&&typeof k=="string"&&Array.isArray(m))m=m.join(k),m&&(m=this.extendTranslation(m,e,n,r));else{let R=!1,x=!1;const z=n.count!==void 0&&typeof n.count!="string",I=Ca.hasDefaultValue(n),re=z?this.pluralResolver.getSuffix(f,n.count,n):"",ie=n.ordinal&&z?this.pluralResolver.getSuffix(f,n.count,{ordinal:!1}):"",ke=z&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),he=ke&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${re}`]||n[`defaultValue${ie}`]||n.defaultValue;!this.isValidLookup(m)&&I&&(R=!0,m=he),this.isValidLookup(m)||(x=!0,m=o);const le=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&x?void 0:m,j=I&&he!==m&&this.options.updateMissing;if(x||R||j){if(this.logger.log(j?"updateKey":"missingKey",f,c,o,j?he:m),a){const ne=this.resolve(o,{...n,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.")}let w=[];const J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(let ne=0;ne<J.length;ne++)w.push(J[ne]);else this.options.saveMissingTo==="all"?w=this.languageUtils.toResolveHierarchy(n.lng||this.language):w.push(n.lng||this.language);const te=(ne,se,me)=>{const G=I&&me!==m?me:le;this.options.missingKeyHandler?this.options.missingKeyHandler(ne,c,se,G,j,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(ne,c,se,G,j,n),this.emit("missingKey",ne,c,se,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&z?w.forEach(ne=>{const se=this.pluralResolver.getSuffixes(ne,n);ke&&n[`defaultValue${this.options.pluralSeparator}zero`]&&se.indexOf(`${this.options.pluralSeparator}zero`)<0&&se.push(`${this.options.pluralSeparator}zero`),se.forEach(me=>{te([ne],o+me,n[`defaultValue${me}`]||he)})}):te(w,o,he))}m=this.extendTranslation(m,e,n,y,r),x&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${o}`),(x||R)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,R?m:void 0):m=this.options.parseMissingKeyHandler(m))}return i?(y.res=m,y.usedParams=this.getUsedParamsDetails(n),y):m}extendTranslation(e,n,r,i,a){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const f=typeof e=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(f){const m=e.match(this.interpolator.nestingRegexp);h=m&&m.length}let y=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),e=this.interpolator.interpolate(e,y,r.lng||this.language||i.usedLng,r),f){const m=e.match(this.interpolator.nestingRegexp),O=m&&m.length;h<O&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,O=new Array(m),A=0;A<m;A++)O[A]=arguments[A];return a&&a[0]===O[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${O[0]} in key: ${n[0]}`),null):o.translate(...O,n)},r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=typeof l=="string"?[l]:l;return e!=null&&c&&c.length&&r.applyPostProcessor!==!1&&(e=tm.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,a,o,l;return typeof e=="string"&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(c,n),h=f.key;i=h;let y=f.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const m=n.count!==void 0&&typeof n.count!="string",O=m&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),A=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(b=>{this.isValidLookup(r)||(l=b,!Qd[`${E[0]}-${b}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(Qd[`${E[0]}-${b}`]=!0,this.logger.warn(`key "${i}" for languages "${E.join(", ")}" won't get resolved as namespace "${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!!!")),E.forEach(k=>{if(this.isValidLookup(r))return;o=k;const C=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(C,h,k,b,n);else{let R;m&&(R=this.pluralResolver.getSuffix(k,n.count,n));const x=`${this.options.pluralSeparator}zero`,z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(C.push(h+R),n.ordinal&&R.indexOf(z)===0&&C.push(h+R.replace(z,this.options.pluralSeparator)),O&&C.push(h+x)),A){const I=`${h}${this.options.contextSeparator}${n.context}`;C.push(I),m&&(C.push(I+R),n.ordinal&&R.indexOf(z)===0&&C.push(I+R.replace(z,this.options.pluralSeparator)),O&&C.push(I+x))}}let S;for(;S=C.pop();)this.isValidLookup(r)||(a=S,r=this.getResource(k,b,S,n))}))})}),{res:r,usedKey:i,exactUsedKey:a,usedLng:o,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&typeof e.replace!="string";let i=r?e.replace:e;if(r&&typeof e.count!="undefined"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const a of n)delete i[a]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}const uu=t=>t.charAt(0).toUpperCase()+t.slice(1);class Xd{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Zt.create("languageUtils")}getScriptPartFromCode(e){if(e=Ta(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Ta(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=uu(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=uu(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=uu(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(a=>{if(a===i)return a;if(!(a.indexOf("-")<0&&i.indexOf("-")<0)&&(a.indexOf("-")>0&&i.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===i||a.indexOf(i)===0&&i.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),i=[],a=o=>{o&&(this.isSupportedCode(o)?i.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):typeof e=="string"&&a(this.formatLanguageCode(e)),r.forEach(o=>{i.indexOf(o)<0&&a(this.formatLanguageCode(o))}),i}}let CS=[{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}],xS={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const PS=["v1","v2","v3"],FS=["v4"],Zd={zero:0,one:1,two:2,few:3,many:4,other:5},IS=()=>{const t={};return CS.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:xS[e.fc]}})}),t};class DS{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=Zt.create("pluralResolver"),(!this.options.compatibilityJSON||FS.includes(this.options.compatibilityJSON))&&(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=IS(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const r=Ta(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:i});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const o=new Intl.PluralRules(r,{type:i});return this.pluralRulesCache[a]=o,o}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,a)=>Zd[i]-Zd[a]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(e,i,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let i=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const a=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!PS.includes(this.options.compatibilityJSON)}}const ef=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=AS(t,e,n);return!a&&i&&typeof n=="string"&&(a=zu(t,n,r),a===void 0&&(a=zu(e,n,r))),a},lu=t=>t.replace(/\$/g,"$$$$");class LS{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Zt.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:a,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:f,unescapeSuffix:h,unescapePrefix:y,nestingPrefix:m,nestingPrefixEscaped:O,nestingSuffix:A,nestingSuffixEscaped:E,nestingOptionsSeparator:b,maxReplaces:k,alwaysFormat:C}=e.interpolation;this.escape=n!==void 0?n:wS,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=a?lr(a):o||"{{",this.suffix=l?lr(l):c||"}}",this.formatSeparator=f||",",this.unescapePrefix=h?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=m?lr(m):O||lr("$t("),this.nestingSuffix=A?lr(A):E||lr(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=k||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,i){let a,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=O=>{if(O.indexOf(this.formatSeparator)<0){const k=ef(n,c,O,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...i,...n,interpolationkey:O}):k}const A=O.split(this.formatSeparator),E=A.shift().trim(),b=A.join(this.formatSeparator).trim();return this.format(ef(n,c,E,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:E})};this.resetRegExp();const h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,y=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:O=>lu(O)},{regex:this.regexp,safeValue:O=>this.escapeValue?lu(this.escape(O)):lu(O)}].forEach(O=>{for(l=0;a=O.regex.exec(e);){const A=a[1].trim();if(o=f(A),o===void 0)if(typeof h=="function"){const b=h(e,a,i);o=typeof b=="string"?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,A))o="";else if(y){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${A} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=zd(o));const E=O.safeValue(o);if(e=e.replace(a[0],E),y?(O.regex.lastIndex+=o.length,O.regex.lastIndex-=a[0].length):O.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,a,o;const l=(c,f)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const y=c.split(new RegExp(`${h}[ ]*{`));let m=`{${y[1]}`;c=y[0],m=this.interpolate(m,o);const O=m.match(/'/g),A=m.match(/"/g);(O&&O.length%2===0&&!A||A.length%2!==0)&&(m=m.replace(/'/g,'"'));try{o=JSON.parse(m),f&&(o={...f,...o})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,E),`${c}${h}${m}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let f=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const h=i[1].split(this.formatSeparator).map(y=>y.trim());i[1]=h.shift(),c=h,f=!0}if(a=n(l.call(this,i[1].trim(),o),o),a&&i[0]===e&&typeof a!="string")return a;typeof a!="string"&&(a=zd(a)),a||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),a=""),f&&(a=c.reduce((h,y)=>this.format(h,y,r.lng,{...r,interpolationkey:i[1].trim()}),a.trim())),e=e.replace(i[0],a),this.regexp.lastIndex=0}return e}}const $S=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),f=c.join(":").trim().replace(/^'+|'+$/g,""),h=l.trim();n[h]||(n[h]=f),f==="false"&&(n[h]=!1),f==="true"&&(n[h]=!0),isNaN(f)||(n[h]=parseInt(f,10))}})}return{formatName:e,formatOptions:n}},cr=t=>{const e={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});const o=r+JSON.stringify(a);let l=e[o];return l||(l=t(Ta(r),i),e[o]=l),l(n)}};class jS{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Zt.create("formatter"),this.options=e,this.formats={number:cr((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return a=>i.format(a)}),currency:cr((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return a=>i.format(a)}),datetime:cr((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return a=>i.format(a)}),relativetime:cr((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return a=>i.format(a,r.range||"day")}),list:cr((n,r)=>{const i=new Intl.ListFormat(n,{...r});return a=>i.format(a)})},this.init(e)}init(e){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=cr(n)}format(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(l=>l.indexOf(")")>-1)){const l=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,l)].join(this.formatSeparator)}return a.reduce((l,c)=>{const{formatName:f,formatOptions:h}=$S(c);if(this.formats[f]){let y=l;try{const m=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},O=m.locale||m.lng||i.locale||i.lng||r;y=this.formats[f](l,O,{...h,...i,...m})}catch(m){this.logger.warn(m)}return y}else this.logger.warn(`there was no format function for ${f}`);return l},e)}}const BS=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class MS extends is{constructor(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Zt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(e,n,r,i){const a={},o={},l={},c={};return e.forEach(f=>{let h=!0;n.forEach(y=>{const m=`${f}|${y}`;!r.reload&&this.store.hasResourceBundle(f,y)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?o[m]===void 0&&(o[m]=!0):(this.state[m]=1,h=!1,o[m]===void 0&&(o[m]=!0),a[m]===void 0&&(a[m]=!0),c[y]===void 0&&(c[y]=!0)))}),h||(l[f]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const i=e.split("|"),a=i[0],o=i[1];n&&this.emit("failedLoading",a,o,n),!n&&r&&this.store.addResourceBundle(a,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const l={};this.queue.forEach(c=>{SS(c.loaded,[a],o),BS(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(f=>{l[f]||(l[f]={});const h=c.loaded[f];h.length&&h.forEach(y=>{l[f][y]===void 0&&(l[f][y]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:a,callback:o});return}this.readingCalls++;const l=(f,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(f&&h&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,a*2,o)},a);return}o(f,h)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const f=c(e,n);f&&typeof f.then=="function"?f.then(h=>l(null,h)).catch(l):l(null,f)}catch(f){l(f)}return}return c(e,n,l)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const a=this.queueLoad(e,n,r,i);if(!a.toLoad.length)return a.pending.length||i(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),i=r[0],a=r[1];this.read(i,a,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${i} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${a} for language ${i}`,l),this.loaded(e,o,l)})}saveMissing(e,n,r,i,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:a},f=this.backend.create.bind(this.backend);if(f.length<6)try{let h;f.length===5?h=f(e,n,r,i,c):h=f(e,n,r,i),h&&typeof h.then=="function"?h.then(y=>l(null,y)).catch(l):l(null,h)}catch(h){l(h)}else f(e,n,r,i,l,c)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const tf=()=>({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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),nf=t=>(typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Zi=()=>{},US=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class ui extends is{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=nf(e),this.services={},this.logger=Zt,this.modules={external:[]},US(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=tf();this.options={...i,...this.options,...nf(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Zt.init(a(this.modules.logger),this.options):Zt.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl!="undefined"&&(h=jS);const y=new Xd(this.options);this.store=new Yd(this.options.resources,this.options);const m=this.services;m.logger=Zt,m.resourceStore=this.store,m.languageUtils=y,m.pluralResolver=new DS(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(m.formatter=a(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new LS(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new MS(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(O){for(var A=arguments.length,E=new Array(A>1?A-1:0),b=1;b<A;b++)E[b-1]=arguments[b];e.emit(O,...E)}),this.modules.languageDetector&&(m.languageDetector=a(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=a(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Ca(this.services,this.options),this.translator.on("*",function(O){for(var A=arguments.length,E=new Array(A>1?A-1:0),b=1;b<A;b++)E[b-1]=arguments[b];e.emit(O,...E)}),this.modules.external.forEach(O=>{O.init&&O.init(this)})}if(this.format=this.options.interpolation.format,r||(r=Zi),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return e.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return e.store[h](...arguments),e}});const c=Hr(),f=()=>{const h=(y,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),r(y,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zi;const i=typeof e=="string"?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&a.indexOf(f)<0&&a.push(f)})};i?o(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(a,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(e,n,r){const i=Hr();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Zi),this.services.backendConnector.reload(e,n,a=>{i.resolve(),r(a)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&tm.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const i=Hr();this.emit("languageChanging",e);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,f)=>{f?(a(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},l=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const f=typeof c=="string"?c:this.services.languageUtils.getBestMatchFromCodes(c);f&&(this.language||a(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(f)),this.loadResources(f,h=>{o(h,f)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),i}getFixedT(e,n,r){var i=this;const a=function(o,l){let c;if(typeof l!="object"){for(var f=arguments.length,h=new Array(f>2?f-2:0),y=2;y<f;y++)h[y-2]=arguments[y];c=i.options.overloadTranslationOptionHandler([o,l].concat(h))}else c={...l};c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const m=i.options.keySeparator||".";let O;return c.keyPrefix&&Array.isArray(o)?O=o.map(A=>`${c.keyPrefix}${m}${A}`):O=c.keyPrefix?`${c.keyPrefix}${m}${o}`:o,i.t(O,c)};return typeof e=="string"?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=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;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const f=this.services.backendConnector.state[`${l}|${c}`];return f===-1||f===0||f===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!i||o(a,e)))}loadNamespaces(e,n){const r=Hr();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Hr();typeof e=="string"&&(e=[e]);const i=this.options.preload||[],a=e.filter(o=>i.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=i.concat(a),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new Xd(tf());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ui(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zi;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},a=new ui(i);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(l=>{a[l]=this[l]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new Yd(this.store.data,i),a.services.resourceStore=a.store),a.translator=new Ca(a.services,i),a.translator.on("*",function(l){for(var c=arguments.length,f=new Array(c>1?c-1:0),h=1;h<c;h++)f[h-1]=arguments[h];a.emit(l,...f)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const gt=ui.createInstance();gt.createInstance=ui.createInstance;gt.createInstance;gt.dir;gt.init;gt.loadResources;gt.reloadResources;gt.use;gt.changeLanguage;gt.getFixedT;const rf=gt.t;gt.exists;gt.setDefaultNamespace;gt.hasLoadedNamespace;gt.loadNamespaces;gt.loadLanguages;const nm=t=>rf(t?`errorCodes.${t}`:"errorCodes.DEFAULT");class VS{constructor(e){Ae(this,"logger");Ae(this,"axiosInstance");this.logger=e.logger,this.axiosInstance=rt.create({baseURL:e.baseUrl,headers:e.accessToken?{Authorization:`Bearer ${e.accessToken}`}:{}})}async get(e){try{return(await this.axiosInstance.get(e)).data}catch(n){throw this.handleError(n)}}async post(e,n){var a;const{data:r={},ignoreError:i=!1}=n;try{return(await this.axiosInstance.post(e,r)).data}catch(o){if(i&&rt.isAxiosError(o))return(a=o.response)==null?void 0:a.data;throw this.handleError(o)}}async put(e,n){var a;const{data:r={},ignoreError:i=!1}=n;try{return(await this.axiosInstance.put(e,r)).data}catch(o){if(i&&rt.isAxiosError(o))return(a=o.response)==null?void 0:a.data;throw this.handleError(o)}}async delete(e){try{return(await this.axiosInstance.delete(e)).data}catch(n){throw this.handleError(n)}}handleError(e){var i;let n=kt.GENERAL_ERROR;if(rt.isAxiosError(e))if(e.response)switch(e.response.status){case 400:n=kt.BAD_REQUEST;break;case 401:n=kt.UNAUTHORIZED;break;case 403:n=kt.FORBIDDEN;break;case 404:n=kt.NOT_FOUND;break;case 409:n=kt.CONFLICT;break;case 410:n=kt.GONE;break;case 415:n=kt.UNSUPPORTED_MEDIA_TYPE;break;case 429:n=kt.TOO_MANY_REQUESTS;break;case 500:n=kt.INTERNAL_SERVER_ERROR;break;case 503:n=kt.SERVICE_UNAVAILABLE;break;default:n=kt.SERVER_ERROR}else e.request?n=kt.NETWORK_ERROR:n=kt.CONFIG_ERROR;const r=nm(n);return this.logger.error("Error Code:",n,"Message:",r),this.logger.error("Result Data:",(i=e.response)==null?void 0:i.data),new Error(r)}}function rm(t){const e=Object.values(t);return Object.assign({},...e)}function im(t){return Object.entries(t).reduce((e,[n,r])=>{const i=rm(r);return{...e,[n]:i}},{})}function am(t,e){const n=im(e);Object.entries(n).forEach(([r,i])=>{t.addResourceBundle(r,"translation",i,!0)})}const{slice:qS,forEach:HS}=[];function KS(t){return HS.call(qS.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const af=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,zS=(t,e,n)=>{const r=n||{};r.path=r.path||"/";const i=encodeURIComponent(e);let a=`${t}=${i}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");a+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!af.test(r.domain))throw new TypeError("option domain is invalid");a+=`; Domain=${r.domain}`}if(r.path){if(!af.test(r.path))throw new TypeError("option path is invalid");a+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(a+="; HttpOnly"),r.secure&&(a+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return a},sf={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=zS(t,encodeURIComponent(e),i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t){this.create(t,"",-1)}};var GS={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document!="undefined")return sf.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=e;n&&typeof document!="undefined"&&sf.create(n,t,r,i,a)}},WS={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window!="undefined"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const o=i.substring(1).split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===e&&(n=o[l].substring(c+1))}}return n}};let Kr=null;const of=()=>{if(Kr!==null)return Kr;try{Kr=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Kr=!1}return Kr};var JS={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&of())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&of()&&window.localStorage.setItem(n,t)}};let zr=null;const uf=()=>{if(zr!==null)return zr;try{zr=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{zr=!1}return zr};var YS={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&uf())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&uf()&&window.sessionStorage.setItem(n,t)}},QS={name:"navigator",lookup(t){const e=[];if(typeof navigator!="undefined"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let a=0;a<n.length;a++)e.push(n[a]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},XS={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document!="undefined"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},ZS={name:"path",lookup(t){var i;let{lookupFromPathIndex:e}=t;if(typeof window=="undefined")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},eA={name:"subdomain",lookup(t){var i,a;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window!="undefined"&&((a=(i=window.location)==null?void 0:i.hostname)==null?void 0:a.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function tA(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class sm{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=KS(n,this.options||{},tA()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(GS),this.addDetector(WS),this.addDetector(JS),this.addDetector(YS),this.addDetector(QS),this.addDetector(XS),this.addDetector(ZS),this.addDetector(eA)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}sm.type="languageDetector";function om(t,e){t.use(e).use(sm).init({resources:{},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(n,r,i)=>{if(r){const[a,...o]=r.split(",").map(l=>l.trim());if(a==="number")return new Intl.NumberFormat(i).format(n);if(a==="date")return new Intl.DateTimeFormat(i).format(n);if(a==="currency")return new Intl.NumberFormat(i,{style:"currency",currency:o[0]||"USD",currencyDisplay:"narrowSymbol"}).format(n).replace("$","").trim()}return n}},detection:{order:["navigator","cookie","localStorage","sessionStorage","querystring","htmlTag","path","subdomain"]}})}const nA=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,rA={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},iA=t=>rA[t],aA=t=>t.replace(nA,iA);let lf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:aA};function sA(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lf={...lf,...t}}const oA={type:"3rdParty",init(t){sA(t.options.react)}};om(gt,oA);const uA=t=>am(gt,t),cf={startTime:"UNKNOWN",viewerCount:0,status:"UNKNOWN"},lA=()=>{const[t,e]=Ue.useState([]),[n,r]=Ue.useState(cf);return{realTimeStreamInfo:n,productsInCart:t,onTextMetadataCue:o=>{const{action:l,data:c,startTime:f,viewerCount:h,status:y}=JSON.parse(o==null?void 0:o.text);switch(l){case"sendivsdatarealtime":{r({startTime:f,viewerCount:h,status:y});break}case"sendaddtocart":{const{id:m,sessionId:O,productId:A,productImageUrl:E,productName:b}=c;e(k=>[...k,{id:m,sessionId:O,productId:A,productImageUrl:E,productName:b}])}break}},resetRealTimeStreamInfo:()=>{r(cf)},setProductsInCart:e}},Al=JSON,cA=t=>t.toUpperCase(),dA=t=>{const e={};return t.forEach((n,r)=>{e[r]=n}),e},fA=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},hA=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},pA=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};function la(t,e){if(!!!t)throw new Error(e)}function mA(t){return typeof t=="object"&&t!==null}function gA(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const yA=/\r\n|[\n\r]/g;function Gu(t,e){let n=0,r=1;for(const i of t.body.matchAll(yA)){if(typeof i.index=="number"||gA(!1),i.index>=e)break;n=i.index+i[0].length,r+=1}return{line:r,column:e+1-n}}function vA(t){return um(t.source,Gu(t.source,t.start))}function um(t,e){const n=t.locationOffset.column-1,r="".padStart(n)+t.body,i=e.line-1,a=t.locationOffset.line-1,o=e.line+a,l=e.line===1?n:0,c=e.column+l,f=`${t.name}:${o}:${c}
62
- `,h=r.split(/\r\n|[\n\r]/g),y=h[i];if(y.length>120){const m=Math.floor(c/80),O=c%80,A=[];for(let E=0;E<y.length;E+=80)A.push(y.slice(E,E+80));return f+df([[`${o} |`,A[0]],...A.slice(1,m+1).map(E=>["|",E]),["|","^".padStart(O)],["|",A[m+1]]])}return f+df([[`${o-1} |`,h[i-1]],[`${o} |`,y],["|","^".padStart(c)],[`${o+1} |`,h[i+1]]])}function df(t){const e=t.filter(([r,i])=>i!==void 0),n=Math.max(...e.map(([r])=>r.length));return e.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
63
- `)}function bA(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class El extends Error{constructor(e,...n){var r,i,a;const{nodes:o,source:l,positions:c,path:f,originalError:h,extensions:y}=bA(n);super(e),this.name="GraphQLError",this.path=f!=null?f:void 0,this.originalError=h!=null?h:void 0,this.nodes=ff(Array.isArray(o)?o:o?[o]:void 0);const m=ff((r=this.nodes)===null||r===void 0?void 0:r.map(A=>A.loc).filter(A=>A!=null));this.source=l!=null?l:m==null||(i=m[0])===null||i===void 0?void 0:i.source,this.positions=c!=null?c:m==null?void 0:m.map(A=>A.start),this.locations=c&&l?c.map(A=>Gu(l,A)):m==null?void 0:m.map(A=>Gu(A.source,A.start));const O=mA(h==null?void 0:h.extensions)?h==null?void 0:h.extensions:void 0;this.extensions=(a=y!=null?y:O)!==null&&a!==void 0?a:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),h!=null&&h.stack?Object.defineProperty(this,"stack",{value:h.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,El):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
24
+ `)}}function Up(t,e){e.forEach(n=>{if($p(jp(n.split("."),t)))throw new Qc(n)})}function Ve(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var Vp={};function Zc(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:Vp}var ed=Object.assign,fa=Object.getOwnPropertyDescriptor,Qt=Object.defineProperty,Da=Object.prototype,To=[];Object.freeze(To);var ou={};Object.freeze(ou);var qp=typeof Proxy!="undefined",Hp=Object.toString();function td(){qp||Ve("Proxy not available")}function nd(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var pi=function(){};function Ht(t){return typeof t=="function"}function Hn(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function Ia(t){return t!==null&&typeof t=="object"}function En(t){if(!Ia(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===Hp}function id(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function Pa(t,e,n){Qt(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function rd(t,e,n){Qt(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Jn(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(i){return Ia(i)&&i[n]===!0}}function Si(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function Kp(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),i=Object.getPrototypeOf(n);return i===null}function an(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var ad=typeof Object.getOwnPropertySymbols!="undefined";function zp(t){var e=Object.keys(t);if(!ad)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(i){return Da.propertyIsEnumerable.call(t,i)})):e}var La=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:ad?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function sd(t){return t===null?null:typeof t=="object"?""+t:t}function on(t,e){return Da.hasOwnProperty.call(t,e)}var Gp=Object.getOwnPropertyDescriptors||function(e){var n={};return La(e).forEach(function(i){n[i]=fa(e,i)}),n};function Tt(t,e){return!!(t&e)}function Ct(t,e,n){return n?t|=e:t&=~e,t}function hl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Wp(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Yp(i.key),i)}}function Ni(t,e,n){return e&&Wp(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function mi(t,e){var n=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=Xp(t))||e){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wn(){return wn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},wn.apply(null,arguments)}function od(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Co(t,e)}function Co(t,e){return Co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Co(t,e)}function Jp(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Yp(t){var e=Jp(t,"string");return typeof e=="symbol"?e:e+""}function Xp(t,e){if(t){if(typeof t=="string")return hl(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hl(t,e):void 0}}var Yt=Symbol("mobx-stored-annotations");function Zt(t){function e(n,i){if(hr(i))return t.decorate_20223_(n,i);Ei(n,i,t)}return Object.assign(e,t)}function Ei(t,e,n){on(t,Yt)||Pa(t,Yt,wn({},t[Yt])),rm(n)||(t[Yt][e]=n)}function Qp(t){return on(t,Yt)||Pa(t,Yt,wn({},t[Yt])),t[Yt]}function hr(t){return typeof t=="object"&&typeof t.kind=="string"}var we=Symbol("mobx administration"),On=function(){function t(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Ue.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.reportObserved=function(){return Nd(this)},e.reportChanged=function(){Mt(),Ed(this),jt()},e.toString=function(){return this.name_},Ni(t,[{key:"isBeingObserved",get:function(){return Tt(this.flags_,t.isBeingObservedMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return Tt(this.flags_,t.isPendingUnobservationMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return Tt(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=Ct(this.flags_,t.diffValueMask_,i===1)}}])}();On.isBeingObservedMask_=1;On.isPendingUnobservationMask_=2;On.diffValueMask_=4;var uu=Jn("Atom",On);function ud(t,e,n){e===void 0&&(e=pi),n===void 0&&(n=pi);var i=new On(t);return e!==pi&&og(i,e),n!==pi&&Cd(i,n),i}function Zp(t,e){return Vd(t,e)}function em(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var vi={structural:Zp,default:em};function Kn(t,e,n){return Dd(t)?t:Array.isArray(t)?st.array(t,{name:n}):En(t)?st.object(t,void 0,{name:n}):Si(t)?st.map(t,{name:n}):an(t)?st.set(t,{name:n}):typeof t=="function"&&!Va(t)&&!ar(t)?id(t)?yi(t):rr(n,t):t}function tm(t,e,n){if(t==null||Ka(t)||Ha(t)||Xn(t)||wi(t))return t;if(Array.isArray(t))return st.array(t,{name:n,deep:!1});if(En(t))return st.object(t,void 0,{name:n,deep:!1});if(Si(t))return st.map(t,{name:n,deep:!1});if(an(t))return st.set(t,{name:n,deep:!1})}function $a(t){return t}function nm(t,e){return Vd(t,e)?e:t}var im="override";function rm(t){return t.annotationType_===im}function pr(t,e){return{annotationType_:t,options_:e,make_:am,extend_:sm,decorate_20223_:om}}function am(t,e,n,i){var r;if((r=this.options_)!=null&&r.bound)return this.extend_(t,e,n,!1)===null?0:1;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(Va(n.value))return 1;var a=ld(t,this,e,n,!1);return Qt(i,e,a),2}function sm(t,e,n,i){var r=ld(t,this,e,n);return t.defineProperty_(e,r,i)}function om(t,e){var n=e.kind,i=e.name,r=e.addInitializer,a=this,o=function(h){var m,y,v,x;return An((m=(y=a.options_)==null?void 0:y.name)!=null?m:i.toString(),h,(v=(x=a.options_)==null?void 0:x.autoAction)!=null?v:!1)};if(n=="field"){r(function(){Ei(this,i,a)});return}if(n=="method"){var l;return Va(t)||(t=o(t)),(l=this.options_)!=null&&l.bound&&r(function(){var d=this,h=d[i].bind(d);h.isMobxAction=!0,d[i]=h}),t}Ve("Cannot apply '"+a.annotationType_+"' to '"+String(i)+"' (kind: "+n+"):"+(`
26
+ '`+a.annotationType_+"' can only be used on properties with a function value."))}function um(t,e,n,i){e.annotationType_,i.value}function ld(t,e,n,i,r){var a,o,l,d,h,m,y;r===void 0&&(r=me.safeDescriptors),um(t,e,n,i);var v=i.value;if((a=e.options_)!=null&&a.bound){var x;v=v.bind((x=t.proxy_)!=null?x:t.target_)}return{value:An((o=(l=e.options_)==null?void 0:l.name)!=null?o:n.toString(),v,(d=(h=e.options_)==null?void 0:h.autoAction)!=null?d:!1,(m=e.options_)!=null&&m.bound?(y=t.proxy_)!=null?y:t.target_:void 0),configurable:r?t.isPlainObject_:!0,enumerable:!1,writable:!r}}function cd(t,e){return{annotationType_:t,options_:e,make_:lm,extend_:cm,decorate_20223_:dm}}function lm(t,e,n,i){var r;if(i===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((r=this.options_)!=null&&r.bound&&(!on(t.target_,e)||!ar(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(ar(n.value))return 1;var a=dd(t,this,e,n,!1,!1);return Qt(i,e,a),2}function cm(t,e,n,i){var r,a=dd(t,this,e,n,(r=this.options_)==null?void 0:r.bound);return t.defineProperty_(e,a,i)}function dm(t,e){var n,i=e.name,r=e.addInitializer;return ar(t)||(t=yi(t)),(n=this.options_)!=null&&n.bound&&r(function(){var a=this,o=a[i].bind(a);o.isMobXFlow=!0,a[i]=o}),t}function fm(t,e,n,i){e.annotationType_,i.value}function dd(t,e,n,i,r,a){a===void 0&&(a=me.safeDescriptors),fm(t,e,n,i);var o=i.value;if(ar(o)||(o=yi(o)),r){var l;o=o.bind((l=t.proxy_)!=null?l:t.target_),o.isMobXFlow=!0}return{value:o,configurable:a?t.isPlainObject_:!0,enumerable:!1,writable:!a}}function lu(t,e){return{annotationType_:t,options_:e,make_:hm,extend_:pm,decorate_20223_:mm}}function hm(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function pm(t,e,n,i){return gm(t,this,e,n),t.defineComputedProperty_(e,wn({},this.options_,{get:n.get,set:n.set}),i)}function mm(t,e){var n=this,i=e.name,r=e.addInitializer;return r(function(){var a=Ai(this)[we],o=wn({},n.options_,{get:t,context:this});o.name||(o.name="ObservableObject."+i.toString()),a.values_.set(i,new Kt(o))}),function(){return this[we].getObservablePropValue_(i)}}function gm(t,e,n,i){e.annotationType_,i.get}function Ma(t,e){return{annotationType_:t,options_:e,make_:vm,extend_:ym,decorate_20223_:bm}}function vm(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function ym(t,e,n,i){var r,a;return km(t,this),t.defineObservableProperty_(e,n.value,(r=(a=this.options_)==null?void 0:a.enhancer)!=null?r:Kn,i)}function bm(t,e){var n=this,i=e.kind,r=e.name,a=new WeakSet;function o(l,d){var h,m,y=Ai(l)[we],v=new Un(d,(h=(m=n.options_)==null?void 0:m.enhancer)!=null?h:Kn,"ObservableObject."+r.toString(),!1);y.values_.set(r,v),a.add(l)}if(i=="accessor")return{get:function(){return a.has(this)||o(this,t.get.call(this)),this[we].getObservablePropValue_(r)},set:function(d){return a.has(this)||o(this,d),this[we].setObservablePropValue_(r,d)},init:function(d){return a.has(this)||o(this,d),d}}}function km(t,e,n,i){e.annotationType_}var _m="true",Sm=fd();function fd(t){return{annotationType_:_m,options_:t,make_:Nm,extend_:Em,decorate_20223_:wm}}function Nm(t,e,n,i){var r,a;if(n.get)return _n.make_(t,e,n,i);if(n.set){var o=An(e.toString(),n.set);return i===t.target_?t.defineProperty_(e,{configurable:me.safeDescriptors?t.isPlainObject_:!0,set:o})===null?0:2:(Qt(i,e,{configurable:!0,set:o}),2)}if(i!==t.target_&&typeof n.value=="function"){var l;if(id(n.value)){var d,h=(d=this.options_)!=null&&d.autoBind?yi.bound:yi;return h.make_(t,e,n,i)}var m=(l=this.options_)!=null&&l.autoBind?rr.bound:rr;return m.make_(t,e,n,i)}var y=((r=this.options_)==null?void 0:r.deep)===!1?st.ref:st;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var v;n.value=n.value.bind((v=t.proxy_)!=null?v:t.target_)}return y.make_(t,e,n,i)}function Em(t,e,n,i){var r,a;if(n.get)return _n.extend_(t,e,n,i);if(n.set)return t.defineProperty_(e,{configurable:me.safeDescriptors?t.isPlainObject_:!0,set:An(e.toString(),n.set)},i);if(typeof n.value=="function"&&(r=this.options_)!=null&&r.autoBind){var o;n.value=n.value.bind((o=t.proxy_)!=null?o:t.target_)}var l=((a=this.options_)==null?void 0:a.deep)===!1?st.ref:st;return l.extend_(t,e,n,i)}function wm(t,e){Ve("'"+this.annotationType_+"' cannot be used as a decorator")}var Am="observable",Om="observable.ref",xm="observable.shallow",Tm="observable.struct",hd={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(hd);function Wr(t){return t||hd}var Ro=Ma(Am),Cm=Ma(Om,{enhancer:$a}),Rm=Ma(xm,{enhancer:tm}),Fm=Ma(Tm,{enhancer:nm}),pd=Zt(Ro);function Jr(t){return t.deep===!0?Kn:t.deep===!1?$a:Im(t.defaultDecorator)}function Dm(t){var e;return t?(e=t.defaultDecorator)!=null?e:fd(t):void 0}function Im(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:Kn}function md(t,e,n){if(hr(e))return Ro.decorate_20223_(t,e);if(Hn(e)){Ei(t,e,Ro);return}return Dd(t)?t:En(t)?st.object(t,e,n):Array.isArray(t)?st.array(t,e):Si(t)?st.map(t,e):an(t)?st.set(t,e):typeof t=="object"&&t!==null?t:st.box(t,e)}ed(md,pd);var Pm={box:function(e,n){var i=Wr(n);return new Un(e,Jr(i),i.name,!0,i.equals)},array:function(e,n){var i=Wr(n);return(me.useProxies===!1||i.proxy===!1?Tg:bg)(e,Jr(i),i.name)},map:function(e,n){var i=Wr(n);return new Ld(e,Jr(i),i.name)},set:function(e,n){var i=Wr(n);return new $d(e,Jr(i),i.name)},object:function(e,n,i){return Qn(function(){return ug(me.useProxies===!1||(i==null?void 0:i.proxy)===!1?Ai({},i):mg({},i),e,n)})},ref:Zt(Cm),shallow:Zt(Rm),deep:pd,struct:Zt(Fm)},st=ed(md,Pm),gd="computed",Lm="computed.struct",Fo=lu(gd),$m=lu(Lm,{equals:vi.structural}),_n=function(e,n){if(hr(n))return Fo.decorate_20223_(e,n);if(Hn(n))return Ei(e,n,Fo);if(En(e))return Zt(lu(gd,e));var i=En(n)?n:{};return i.get=e,i.name||(i.name=e.name||""),new Kt(i)};Object.assign(_n,Fo);_n.struct=Zt($m);var pl,ml,ha=0,Mm=1,jm=(pl=(ml=fa(function(){},"name"))==null?void 0:ml.configurable)!=null?pl:!1,gl={value:"action",configurable:!0,writable:!1,enumerable:!1};function An(t,e,n,i){n===void 0&&(n=!1);function r(){return Bm(t,n,e,i||this,arguments)}return r.isMobxAction=!0,r.toString=function(){return e.toString()},jm&&(gl.value=t,Qt(r,"name",gl)),r}function Bm(t,e,n,i,r){var a=Um(t,e);try{return n.apply(i,r)}catch(o){throw a.error_=o,o}finally{Vm(a)}}function Um(t,e,n,i){var r=!1,a=0,o=me.trackingDerivation,l=!e||!o;Mt();var d=me.allowStateChanges;l&&(Yn(),d=ja(!0));var h=cu(!0),m={runAsAction_:l,prevDerivation_:o,prevAllowStateChanges_:d,prevAllowStateReads_:h,notifySpy_:r,startTime_:a,actionId_:Mm++,parentActionId_:ha};return ha=m.actionId_,m}function Vm(t){ha!==t.actionId_&&Ve(30),ha=t.parentActionId_,t.error_!==void 0&&(me.suppressReactionErrors=!0),Ba(t.prevAllowStateChanges_),Yi(t.prevAllowStateReads_),jt(),t.runAsAction_&&un(t.prevDerivation_),me.suppressReactionErrors=!1}function vd(t,e){var n=ja(t);try{return e()}finally{Ba(n)}}function ja(t){var e=me.allowStateChanges;return me.allowStateChanges=t,e}function Ba(t){me.allowStateChanges=t}var Un=function(t){function e(i,r,a,o,l){var d;return a===void 0&&(a="ObservableValue"),l===void 0&&(l=vi.default),d=t.call(this,a)||this,d.enhancer=void 0,d.name_=void 0,d.equals=void 0,d.hasUnreportedChange_=!1,d.interceptors_=void 0,d.changeListeners_=void 0,d.value_=void 0,d.dehancer=void 0,d.enhancer=r,d.name_=a,d.equals=l,d.value_=r(i,void 0,a),d}od(e,t);var n=e.prototype;return n.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.set=function(r){this.value_,r=this.prepareNewValue_(r),r!==me.UNCHANGED&&this.setNewValue_(r)},n.prepareNewValue_=function(r){if(Lt(this)){var a=$t(this,{object:this,type:en,newValue:r});if(!a)return me.UNCHANGED;r=a.newValue}return r=this.enhancer(r,this.value_,this.name_),this.equals(this.value_,r)?me.UNCHANGED:r},n.setNewValue_=function(r){var a=this.value_;this.value_=r,this.reportChanged(),Vt(this)&&qt(this,{type:en,object:this,newValue:r,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(r){return mr(this,r)},n.observe_=function(r,a){return a&&r({observableKind:"value",debugObjectName:this.name_,object:this,type:en,newValue:this.value_,oldValue:void 0}),gr(this,r)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return sd(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(On),Kt=function(){function t(n){this.dependenciesState_=Ue.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ue.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ma(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=pa.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||Ve(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=An("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?vi.structural:vi.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){zm(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(i){return i()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(i){return i()})},e.get=function(){if(this.isComputing&&Ve(32,this.name_,this.derivation),me.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Do(this)&&(this.warnAboutUntrackedRead_(),Mt(),this.value_=this.computeValue_(!1),jt());else if(Nd(this),Do(this)){var i=me.trackingContext;this.keepAlive_&&!i&&(me.trackingContext=this),this.trackAndCompute()&&Km(this),me.trackingContext=i}var r=this.value_;if(ia(r))throw r.cause;return r},e.set=function(i){if(this.setter_){this.isRunningSetter&&Ve(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,i)}finally{this.isRunningSetter=!1}}else Ve(34,this.name_)},e.trackAndCompute=function(){var i=this.value_,r=this.dependenciesState_===Ue.NOT_TRACKING_,a=this.computeValue_(!0),o=r||ia(i)||ia(a)||!this.equals_(i,a);return o&&(this.value_=a),o},e.computeValue_=function(i){this.isComputing=!0;var r=ja(!1),a;if(i)a=yd(this,this.derivation,this.scope_);else if(me.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(o){a=new ma(o)}return Ba(r),this.isComputing=!1,a},e.suspend_=function(){this.keepAlive_||(Io(this),this.value_=void 0)},e.observe_=function(i,r){var a=this,o=!0,l=void 0;return qa(function(){var d=a.get();if(!o||r){var h=Yn();i({observableKind:"computed",debugObjectName:a.name_,type:en,object:a,newValue:d,oldValue:l}),un(h)}o=!1,l=d})},e.warnAboutUntrackedRead_=function(){},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return sd(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},Ni(t,[{key:"isComputing",get:function(){return Tt(this.flags_,t.isComputingMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isComputingMask_,i)}},{key:"isRunningSetter",get:function(){return Tt(this.flags_,t.isRunningSetterMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isRunningSetterMask_,i)}},{key:"isBeingObserved",get:function(){return Tt(this.flags_,t.isBeingObservedMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isBeingObservedMask_,i)}},{key:"isPendingUnobservation",get:function(){return Tt(this.flags_,t.isPendingUnobservationMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isPendingUnobservationMask_,i)}},{key:"diffValue",get:function(){return Tt(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=Ct(this.flags_,t.diffValueMask_,i===1)}}])}();Kt.isComputingMask_=1;Kt.isRunningSetterMask_=2;Kt.isBeingObservedMask_=4;Kt.isPendingUnobservationMask_=8;Kt.diffValueMask_=16;var Ua=Jn("ComputedValue",Kt),Ue;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(Ue||(Ue={}));var pa;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(pa||(pa={}));var ma=function(e){this.cause=void 0,this.cause=e};function ia(t){return t instanceof ma}function Do(t){switch(t.dependenciesState_){case Ue.UP_TO_DATE_:return!1;case Ue.NOT_TRACKING_:case Ue.STALE_:return!0;case Ue.POSSIBLY_STALE_:{for(var e=cu(!0),n=Yn(),i=t.observing_,r=i.length,a=0;a<r;a++){var o=i[a];if(Ua(o)){if(me.disableErrorBoundaries)o.get();else try{o.get()}catch{return un(n),Yi(e),!0}if(t.dependenciesState_===Ue.STALE_)return un(n),Yi(e),!0}}return kd(t),un(n),Yi(e),!1}}}function yd(t,e,n){var i=cu(!0);kd(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++me.runId;var r=me.trackingDerivation;me.trackingDerivation=t,me.inBatch++;var a;if(me.disableErrorBoundaries===!0)a=e.call(n);else try{a=e.call(n)}catch(o){a=new ma(o)}return me.inBatch--,me.trackingDerivation=r,qm(t),Yi(i),a}function qm(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,i=Ue.UP_TO_DATE_,r=0,a=t.unboundDepsCount_,o=0;o<a;o++){var l=n[o];l.diffValue===0&&(l.diffValue=1,r!==o&&(n[r]=l),r++),l.dependenciesState_>i&&(i=l.dependenciesState_)}for(n.length=r,t.newObserving_=null,a=e.length;a--;){var d=e[a];d.diffValue===0&&_d(d,t),d.diffValue=0}for(;r--;){var h=n[r];h.diffValue===1&&(h.diffValue=0,Hm(h,t))}i!==Ue.UP_TO_DATE_&&(t.dependenciesState_=i,t.onBecomeStale_())}function Io(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)_d(e[n],t);t.dependenciesState_=Ue.NOT_TRACKING_}function bd(t){var e=Yn();try{return t()}finally{un(e)}}function Yn(){var t=me.trackingDerivation;return me.trackingDerivation=null,t}function un(t){me.trackingDerivation=t}function cu(t){var e=me.allowStateReads;return me.allowStateReads=t,e}function Yi(t){me.allowStateReads=t}function kd(t){if(t.dependenciesState_!==Ue.UP_TO_DATE_){t.dependenciesState_=Ue.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=Ue.UP_TO_DATE_}}var Xs=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Qs=!0,me=function(){var t=Zc();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Qs=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Xs().version&&(Qs=!1),Qs?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Xs):(setTimeout(function(){Ve(35)},1),new Xs)}();function Hm(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function _d(t,e){t.observers_.delete(e),t.observers_.size===0&&Sd(t)}function Sd(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,me.pendingUnobservations.push(t))}function Mt(){me.inBatch++}function jt(){if(--me.inBatch===0){wd();for(var t=me.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Kt&&n.suspend_())}me.pendingUnobservations=[]}}function Nd(t){var e=me.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&me.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&me.inBatch>0&&Sd(t),!1)}function Ed(t){t.lowestObserverState_!==Ue.STALE_&&(t.lowestObserverState_=Ue.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ue.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=Ue.STALE_}))}function Km(t){t.lowestObserverState_!==Ue.STALE_&&(t.lowestObserverState_=Ue.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ue.POSSIBLY_STALE_?e.dependenciesState_=Ue.STALE_:e.dependenciesState_===Ue.UP_TO_DATE_&&(t.lowestObserverState_=Ue.UP_TO_DATE_)}))}function zm(t){t.lowestObserverState_===Ue.UP_TO_DATE_&&(t.lowestObserverState_=Ue.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ue.UP_TO_DATE_&&(e.dependenciesState_=Ue.POSSIBLY_STALE_,e.onBecomeStale_())}))}var ln=function(){function t(n,i,r,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ue.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=pa.NONE,this.name_=n,this.onInvalidate_=i,this.errorHandler_=r,this.requiresObservable_=a}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,me.pendingReactions.push(this),wd())},e.runReaction_=function(){if(!this.isDisposed){Mt(),this.isScheduled=!1;var i=me.trackingContext;if(me.trackingContext=this,Do(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(r){this.reportExceptionInDerivation_(r)}}me.trackingContext=i,jt()}},e.track=function(i){if(!this.isDisposed){Mt(),this.isRunning=!0;var r=me.trackingContext;me.trackingContext=this;var a=yd(this,i,void 0);me.trackingContext=r,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Io(this),ia(a)&&this.reportExceptionInDerivation_(a.cause),jt()}},e.reportExceptionInDerivation_=function(i){var r=this;if(this.errorHandler_){this.errorHandler_(i,this);return}if(me.disableErrorBoundaries)throw i;var a="[mobx] uncaught error in '"+this+"'";me.suppressReactionErrors||console.error(a,i),me.globalReactionErrorHandlers.forEach(function(o){return o(i,r)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Mt(),Io(this),jt()))},e.getDisposer_=function(i){var r=this,a=function o(){r.dispose(),i==null||i.removeEventListener==null||i.removeEventListener("abort",o)};return i==null||i.addEventListener==null||i.addEventListener("abort",a),a[we]=this,a},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(i){},Ni(t,[{key:"isDisposed",get:function(){return Tt(this.flags_,t.isDisposedMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isDisposedMask_,i)}},{key:"isScheduled",get:function(){return Tt(this.flags_,t.isScheduledMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isScheduledMask_,i)}},{key:"isTrackPending",get:function(){return Tt(this.flags_,t.isTrackPendingMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isTrackPendingMask_,i)}},{key:"isRunning",get:function(){return Tt(this.flags_,t.isRunningMask_)},set:function(i){this.flags_=Ct(this.flags_,t.isRunningMask_,i)}},{key:"diffValue",get:function(){return Tt(this.flags_,t.diffValueMask_)?1:0},set:function(i){this.flags_=Ct(this.flags_,t.diffValueMask_,i===1)}}])}();ln.isDisposedMask_=1;ln.isScheduledMask_=2;ln.isTrackPendingMask_=4;ln.isRunningMask_=8;ln.diffValueMask_=16;var Gm=100,Wm=function(e){return e()};function wd(){me.inBatch>0||me.isRunningReactions||Wm(Jm)}function Jm(){me.isRunningReactions=!0;for(var t=me.pendingReactions,e=0;t.length>0;){++e===Gm&&(console.error("[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),i=0,r=n.length;i<r;i++)n[i].runReaction_()}me.isRunningReactions=!1}var ga=Jn("Reaction",ln);function Xi(){return!1}function Ym(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Ad="action",Xm="action.bound",Od="autoAction",Qm="autoAction.bound",Zm="<unnamed action>",Po=pr(Ad),eg=pr(Xm,{bound:!0}),Lo=pr(Od,{autoAction:!0}),tg=pr(Qm,{autoAction:!0,bound:!0});function xd(t){var e=function(i,r){if(Ht(i))return An(i.name||Zm,i,t);if(Ht(r))return An(i,r,t);if(hr(r))return(t?Lo:Po).decorate_20223_(i,r);if(Hn(r))return Ei(i,r,t?Lo:Po);if(Hn(i))return Zt(pr(t?Od:Ad,{name:i,autoAction:t}))};return e}var xt=xd(!1);Object.assign(xt,Po);var rr=xd(!0);Object.assign(rr,Lo);xt.bound=Zt(eg);rr.bound=Zt(tg);function Va(t){return Ht(t)&&t.isMobxAction===!0}function qa(t,e){var n,i,r,a;e===void 0&&(e=ou);var o=(n=(i=e)==null?void 0:i.name)!=null?n:"Autorun",l=!e.scheduler&&!e.delay,d;if(l)d=new ln(o,function(){this.track(y)},e.onError,e.requiresObservable);else{var h=Td(e),m=!1;d=new ln(o,function(){m||(m=!0,h(function(){m=!1,d.isDisposed||d.track(y)}))},e.onError,e.requiresObservable)}function y(){t(d)}return(r=e)!=null&&(r=r.signal)!=null&&r.aborted||d.schedule_(),d.getDisposer_((a=e)==null?void 0:a.signal)}var ng=function(e){return e()};function Td(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:ng}function ig(t,e,n){var i,r,a;n===void 0&&(n=ou);var o=(i=n.name)!=null?i:"Reaction",l=xt(o,n.onError?rg(n.onError,e):e),d=!n.scheduler&&!n.delay,h=Td(n),m=!0,y=!1,v,x=n.compareStructural?vi.structural:n.equals||vi.default,_=new ln(o,function(){m||d?N():y||(y=!0,h(N))},n.onError,n.requiresObservable);function N(){if(y=!1,!_.isDisposed){var E=!1,F=v;_.track(function(){var V=vd(!1,function(){return t(_)});E=m||!x(v,V),v=V}),(m&&n.fireImmediately||!m&&E)&&l(v,F,_),m=!1}}return(r=n)!=null&&(r=r.signal)!=null&&r.aborted||_.schedule_(),_.getDisposer_((a=n)==null?void 0:a.signal)}function rg(t,e){return function(){try{return e.apply(this,arguments)}catch(n){t.call(this,n)}}}var ag="onBO",sg="onBUO";function og(t,e,n){return Rd(ag,t,e,n)}function Cd(t,e,n){return Rd(sg,t,e,n)}function Rd(t,e,n,i){var r=$o(e),a=Ht(i)?i:n,o=t+"L";return r[o]?r[o].add(a):r[o]=new Set([a]),function(){var l=r[o];l&&(l.delete(a),l.size===0&&delete r[o])}}function ug(t,e,n,i){var r=Gp(e);return Qn(function(){var a=Ai(t,i)[we];La(r).forEach(function(o){a.extend_(o,r[o],n&&o in n?n[o]:!0)})}),t}var lg=0;function Fd(){this.message="FLOW_CANCELLED"}Fd.prototype=Object.create(Error.prototype);var Zs=cd("flow"),cg=cd("flow.bound",{bound:!0}),yi=Object.assign(function(e,n){if(hr(n))return Zs.decorate_20223_(e,n);if(Hn(n))return Ei(e,n,Zs);var i=e,r=i.name||"<unnamed flow>",a=function(){var l=this,d=arguments,h=++lg,m=xt(r+" - runid: "+h+" - init",i).apply(l,d),y,v=void 0,x=new Promise(function(_,N){var E=0;y=N;function F(K){v=void 0;var Y;try{Y=xt(r+" - runid: "+h+" - yield "+E++,m.next).call(m,K)}catch(X){return N(X)}J(Y)}function V(K){v=void 0;var Y;try{Y=xt(r+" - runid: "+h+" - yield "+E++,m.throw).call(m,K)}catch(X){return N(X)}J(Y)}function J(K){if(Ht(K==null?void 0:K.then)){K.then(J,N);return}return K.done?_(K.value):(v=Promise.resolve(K.value),v.then(F,V))}F(void 0)});return x.cancel=xt(r+" - runid: "+h+" - cancel",function(){try{v&&vl(v);var _=m.return(void 0),N=Promise.resolve(_.value);N.then(pi,pi),vl(N),y(new Fd)}catch(E){y(E)}}),x};return a.isMobXFlow=!0,a},Zs);yi.bound=Zt(cg);function vl(t){Ht(t.cancel)&&t.cancel()}function ar(t){return(t==null?void 0:t.isMobXFlow)===!0}function dg(t,e){return t?Ka(t)||!!t[we]||uu(t)||ga(t)||Ua(t):!1}function Dd(t){return dg(t)}function sn(t,e){e===void 0&&(e=void 0),Mt();try{return t.apply(e)}finally{jt()}}function fg(t,e,n){return arguments.length===1||e&&typeof e=="object"?hg(t,e):Id(t,e,{})}function Id(t,e,n){var i;if(typeof n.timeout=="number"){var r=new Error("WHEN_TIMEOUT");i=setTimeout(function(){if(!o[we].isDisposed)if(o(),n.onError)n.onError(r);else throw r},n.timeout)}n.name="When";var a=An("When-effect",e),o=qa(function(l){var d=vd(!1,t);d&&(l.dispose(),i&&clearTimeout(i),a())},n);return o}function hg(t,e){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var i,r,a=new Promise(function(o,l){var d,h=Id(t,o,wn({},e,{onError:l}));i=function(){h(),l(new Error("WHEN_CANCELLED"))},r=function(){h(),l(new Error("WHEN_ABORTED"))},e==null||(d=e.signal)==null||d.addEventListener==null||d.addEventListener("abort",r)}).finally(function(){var o;return e==null||(o=e.signal)==null||o.removeEventListener==null?void 0:o.removeEventListener("abort",r)});return a.cancel=i,a}function ui(t){return t[we]}var pg={has:function(e,n){return ui(e).has_(n)},get:function(e,n){return ui(e).get_(n)},set:function(e,n,i){var r;return Hn(n)?(r=ui(e).set_(n,i,!0))!=null?r:!0:!1},deleteProperty:function(e,n){var i;return Hn(n)?(i=ui(e).delete_(n,!0))!=null?i:!0:!1},defineProperty:function(e,n,i){var r;return(r=ui(e).defineProperty_(n,i))!=null?r:!0},ownKeys:function(e){return ui(e).ownKeys_()},preventExtensions:function(e){Ve(13)}};function mg(t,e){var n,i;return td(),t=Ai(t,e),(i=(n=t[we]).proxy_)!=null?i:n.proxy_=new Proxy(t,pg)}function Lt(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function mr(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),nd(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function $t(t,e){var n=Yn();try{for(var i=[].concat(t.interceptors_||[]),r=0,a=i.length;r<a&&(e=i[r](e),e&&!e.type&&Ve(14),!!e);r++);return e}finally{un(n)}}function Vt(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function gr(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),nd(function(){var i=n.indexOf(e);i!==-1&&n.splice(i,1)})}function qt(t,e){var n=Yn(),i=t.changeListeners_;if(i){i=i.slice();for(var r=0,a=i.length;r<a;r++)i[r](e);un(n)}}function gg(t,e,n){return Qn(function(){var i,r=Ai(t,n)[we];(i=e)!=null||(e=Qp(t)),La(e).forEach(function(a){return r.make_(a,e[a])})}),t}var yl="splice",en="update",vg=1e4,yg={get:function(e,n){var i=e[we];return n===we?i:n==="length"?i.getArrayLength_():typeof n=="string"&&!isNaN(n)?i.get_(parseInt(n)):on(va,n)?va[n]:e[n]},set:function(e,n,i){var r=e[we];return n==="length"&&r.setArrayLength_(i),typeof n=="symbol"||isNaN(n)?e[n]=i:r.set_(parseInt(n),i),!0},preventExtensions:function(){Ve(15)}},du=function(){function t(n,i,r,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=r,this.legacyMode_=a,this.atom_=new On(n),this.enhancer_=function(o,l){return i(o,l,"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.dehanceValues_=function(i){return this.dehancer!==void 0&&i.length>0?i.map(this.dehancer):i},e.intercept_=function(i){return mr(this,i)},e.observe_=function(i,r){return r===void 0&&(r=!1),r&&i({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),gr(this,i)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(i){(typeof i!="number"||isNaN(i)||i<0)&&Ve("Out of range: "+i);var r=this.values_.length;if(i!==r)if(i>r){for(var a=new Array(i-r),o=0;o<i-r;o++)a[o]=void 0;this.spliceWithArray_(r,0,a)}else this.spliceWithArray_(i,r-i)},e.updateArrayLength_=function(i,r){i!==this.lastKnownLength_&&Ve(16),this.lastKnownLength_+=r,this.legacyMode_&&r>0&&Ud(i+r+1)},e.spliceWithArray_=function(i,r,a){var o=this;this.atom_;var l=this.values_.length;if(i===void 0?i=0:i>l?i=l:i<0&&(i=Math.max(0,l+i)),arguments.length===1?r=l-i:r==null?r=0:r=Math.max(0,Math.min(r,l-i)),a===void 0&&(a=To),Lt(this)){var d=$t(this,{object:this.proxy_,type:yl,index:i,removedCount:r,added:a});if(!d)return To;r=d.removedCount,a=d.added}if(a=a.length===0?a:a.map(function(y){return o.enhancer_(y,void 0)}),this.legacyMode_){var h=a.length-r;this.updateArrayLength_(l,h)}var m=this.spliceItemsIntoValues_(i,r,a);return(r!==0||a.length!==0)&&this.notifyArraySplice_(i,a,m),this.dehanceValues_(m)},e.spliceItemsIntoValues_=function(i,r,a){if(a.length<vg){var o;return(o=this.values_).splice.apply(o,[i,r].concat(a))}else{var l=this.values_.slice(i,i+r),d=this.values_.slice(i+r);this.values_.length+=a.length-r;for(var h=0;h<a.length;h++)this.values_[i+h]=a[h];for(var m=0;m<d.length;m++)this.values_[i+a.length+m]=d[m];return l}},e.notifyArrayChildUpdate_=function(i,r,a){var o=!this.owned_&&Xi(),l=Vt(this),d=l||o?{observableKind:"array",object:this.proxy_,type:en,debugObjectName:this.atom_.name_,index:i,newValue:r,oldValue:a}:null;this.atom_.reportChanged(),l&&qt(this,d)},e.notifyArraySplice_=function(i,r,a){var o=!this.owned_&&Xi(),l=Vt(this),d=l||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:yl,index:i,removed:a,added:r,removedCount:a.length,addedCount:r.length}:null;this.atom_.reportChanged(),l&&qt(this,d)},e.get_=function(i){if(this.legacyMode_&&i>=this.values_.length){console.warn("[mobx] Out of bounds read: "+i);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[i])},e.set_=function(i,r){var a=this.values_;if(this.legacyMode_&&i>a.length&&Ve(17,i,a.length),i<a.length){this.atom_;var o=a[i];if(Lt(this)){var l=$t(this,{type:en,object:this.proxy_,index:i,newValue:r});if(!l)return;r=l.newValue}r=this.enhancer_(r,o);var d=r!==o;d&&(a[i]=r,this.notifyArrayChildUpdate_(i,r,o))}else{for(var h=new Array(i+1-a.length),m=0;m<h.length-1;m++)h[m]=void 0;h[h.length-1]=r,this.spliceWithArray_(a.length,0,h)}},t}();function bg(t,e,n,i){return n===void 0&&(n="ObservableArray"),i===void 0&&(i=!1),td(),Qn(function(){var r=new du(n,e,i,!1);rd(r.values_,we,r);var a=new Proxy(r.values_,yg);return r.proxy_=a,t&&t.length&&r.spliceWithArray_(0,0,t),a})}var va={clear:function(){return this.splice(0)},replace:function(e){var n=this[we];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];var o=this[we];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,n)}return o.spliceWithArray_(e,n,r)},spliceWithArray:function(e,n,i){return this[we].spliceWithArray_(e,n,i)},push:function(){for(var e=this[we],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(e.values_.length,0,i),e.values_.length},pop:function(){return this.splice(Math.max(this[we].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[we],n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return e.spliceWithArray_(0,0,i),e.values_.length},reverse:function(){return me.trackingDerivation&&Ve(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){me.trackingDerivation&&Ve(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[we],i=n.dehanceValues_(n.values_).indexOf(e);return i>-1?(this.splice(i,1),!0):!1}};Je("at",Ft);Je("concat",Ft);Je("flat",Ft);Je("includes",Ft);Je("indexOf",Ft);Je("join",Ft);Je("lastIndexOf",Ft);Je("slice",Ft);Je("toString",Ft);Je("toLocaleString",Ft);Je("toSorted",Ft);Je("toSpliced",Ft);Je("with",Ft);Je("every",zt);Je("filter",zt);Je("find",zt);Je("findIndex",zt);Je("findLast",zt);Je("findLastIndex",zt);Je("flatMap",zt);Je("forEach",zt);Je("map",zt);Je("some",zt);Je("toReversed",zt);Je("reduce",Pd);Je("reduceRight",Pd);function Je(t,e){typeof Array.prototype[t]=="function"&&(va[t]=e(t))}function Ft(t){return function(){var e=this[we];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function zt(t){return function(e,n){var i=this,r=this[we];r.atom_.reportObserved();var a=r.dehanceValues_(r.values_);return a[t](function(o,l){return e.call(n,o,l,i)})}}function Pd(t){return function(){var e=this,n=this[we];n.atom_.reportObserved();var i=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(a,o,l){return r(a,o,l,e)},i[t].apply(i,arguments)}}var kg=Jn("ObservableArrayAdministration",du);function Ha(t){return Ia(t)&&kg(t[we])}var _g={},Sn="add",ya="delete",Ld=function(){function t(n,i,r){var a=this;i===void 0&&(i=Kn),r===void 0&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[we]=_g,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=i,this.name_=r,Ht(Map)||Ve(18),Qn(function(){a.keysAtom_=ud("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var e=t.prototype;return e.has_=function(i){return this.data_.has(i)},e.has=function(i){var r=this;if(!me.trackingDerivation)return this.has_(i);var a=this.hasMap_.get(i);if(!a){var o=a=new Un(this.has_(i),$a,"ObservableMap.key?",!1);this.hasMap_.set(i,o),Cd(o,function(){return r.hasMap_.delete(i)})}return a.get()},e.set=function(i,r){var a=this.has_(i);if(Lt(this)){var o=$t(this,{type:a?en:Sn,object:this,newValue:r,name:i});if(!o)return this;r=o.newValue}return a?this.updateValue_(i,r):this.addValue_(i,r),this},e.delete=function(i){var r=this;if(this.keysAtom_,Lt(this)){var a=$t(this,{type:ya,object:this,name:i});if(!a)return!1}if(this.has_(i)){var o=Xi(),l=Vt(this),d=l||o?{observableKind:"map",debugObjectName:this.name_,type:ya,object:this,oldValue:this.data_.get(i).value_,name:i}:null;return sn(function(){var h;r.keysAtom_.reportChanged(),(h=r.hasMap_.get(i))==null||h.setNewValue_(!1);var m=r.data_.get(i);m.setNewValue_(void 0),r.data_.delete(i)}),l&&qt(this,d),!0}return!1},e.updateValue_=function(i,r){var a=this.data_.get(i);if(r=a.prepareNewValue_(r),r!==me.UNCHANGED){var o=Xi(),l=Vt(this),d=l||o?{observableKind:"map",debugObjectName:this.name_,type:en,object:this,oldValue:a.value_,name:i,newValue:r}:null;a.setNewValue_(r),l&&qt(this,d)}},e.addValue_=function(i,r){var a=this;this.keysAtom_,sn(function(){var h,m=new Un(r,a.enhancer_,"ObservableMap.key",!1);a.data_.set(i,m),r=m.value_,(h=a.hasMap_.get(i))==null||h.setNewValue_(!0),a.keysAtom_.reportChanged()});var o=Xi(),l=Vt(this),d=l||o?{observableKind:"map",debugObjectName:this.name_,type:Sn,object:this,name:i,newValue:r}:null;l&&qt(this,d)},e.get=function(i){return this.has(i)?this.dehanceValue_(this.data_.get(i).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var i=this,r=this.keys();return sr({next:function(){var o=r.next(),l=o.done,d=o.value;return{done:l,value:l?void 0:i.get(d)}}})},e.entries=function(){var i=this,r=this.keys();return sr({next:function(){var o=r.next(),l=o.done,d=o.value;return{done:l,value:l?void 0:[d,i.get(d)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(i,r){for(var a=mi(this),o;!(o=a()).done;){var l=o.value,d=l[0],h=l[1];i.call(r,h,d,this)}},e.merge=function(i){var r=this;return Xn(i)&&(i=new Map(i)),sn(function(){En(i)?zp(i).forEach(function(a){return r.set(a,i[a])}):Array.isArray(i)?i.forEach(function(a){var o=a[0],l=a[1];return r.set(o,l)}):Si(i)?(Kp(i)||Ve(19,i),i.forEach(function(a,o){return r.set(o,a)})):i!=null&&Ve(20,i)}),this},e.clear=function(){var i=this;sn(function(){bd(function(){for(var r=mi(i.keys()),a;!(a=r()).done;){var o=a.value;i.delete(o)}})})},e.replace=function(i){var r=this;return sn(function(){for(var a=Sg(i),o=new Map,l=!1,d=mi(r.data_.keys()),h;!(h=d()).done;){var m=h.value;if(!a.has(m)){var y=r.delete(m);if(y)l=!0;else{var v=r.data_.get(m);o.set(m,v)}}}for(var x=mi(a.entries()),_;!(_=x()).done;){var N=_.value,E=N[0],F=N[1],V=r.data_.has(E);if(r.set(E,F),r.data_.has(E)){var J=r.data_.get(E);o.set(E,J),V||(l=!0)}}if(!l)if(r.data_.size!==o.size)r.keysAtom_.reportChanged();else for(var K=r.data_.keys(),Y=o.keys(),X=K.next(),ne=Y.next();!X.done;){if(X.value!==ne.value){r.keysAtom_.reportChanged();break}X=K.next(),ne=Y.next()}r.data_=o}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(i,r){return gr(this,i)},e.intercept_=function(i){return mr(this,i)},Ni(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Xn=Jn("ObservableMap",Ld);function Sg(t){if(Si(t)||Xn(t))return t;if(Array.isArray(t))return new Map(t);if(En(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return Ve(21,t)}var Ng={},$d=function(){function t(n,i,r){var a=this;i===void 0&&(i=Kn),r===void 0&&(r="ObservableSet"),this.name_=void 0,this[we]=Ng,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,Ht(Set)||Ve(22),this.enhancer_=function(o,l){return i(o,l,r)},Qn(function(){a.atom_=ud(a.name_),n&&a.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(i){return this.dehancer!==void 0?this.dehancer(i):i},e.clear=function(){var i=this;sn(function(){bd(function(){for(var r=mi(i.data_.values()),a;!(a=r()).done;){var o=a.value;i.delete(o)}})})},e.forEach=function(i,r){for(var a=mi(this),o;!(o=a()).done;){var l=o.value;i.call(r,l,l,this)}},e.add=function(i){var r=this;if(this.atom_,Lt(this)){var a=$t(this,{type:Sn,object:this,newValue:i});if(!a)return this}if(!this.has(i)){sn(function(){r.data_.add(r.enhancer_(i,void 0)),r.atom_.reportChanged()});var o=!1,l=Vt(this),d=l||o?{observableKind:"set",debugObjectName:this.name_,type:Sn,object:this,newValue:i}:null;l&&qt(this,d)}return this},e.delete=function(i){var r=this;if(Lt(this)){var a=$t(this,{type:ya,object:this,oldValue:i});if(!a)return!1}if(this.has(i)){var o=!1,l=Vt(this),d=l||o?{observableKind:"set",debugObjectName:this.name_,type:ya,object:this,oldValue:i}:null;return sn(function(){r.atom_.reportChanged(),r.data_.delete(i)}),l&&qt(this,d),!0}return!1},e.has=function(i){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(i))},e.entries=function(){var i=0,r=Array.from(this.keys()),a=Array.from(this.values());return sr({next:function(){var l=i;return i+=1,l<a.length?{value:[r[l],a[l]],done:!1}:{done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var i=this,r=0,a=Array.from(this.data_.values());return sr({next:function(){return r<a.length?{value:i.dehanceValue_(a[r++]),done:!1}:{done:!0}}})},e.intersection=function(i){if(an(i))return i.intersection(this);var r=new Set(this);return r.intersection(i)},e.union=function(i){if(an(i))return i.union(this);var r=new Set(this);return r.union(i)},e.difference=function(i){return new Set(this).difference(i)},e.symmetricDifference=function(i){if(an(i))return i.symmetricDifference(this);var r=new Set(this);return r.symmetricDifference(i)},e.isSubsetOf=function(i){return new Set(this).isSubsetOf(i)},e.isSupersetOf=function(i){return new Set(this).isSupersetOf(i)},e.isDisjointFrom=function(i){if(an(i))return i.isDisjointFrom(this);var r=new Set(this);return r.isDisjointFrom(i)},e.replace=function(i){var r=this;return wi(i)&&(i=new Set(i)),sn(function(){Array.isArray(i)?(r.clear(),i.forEach(function(a){return r.add(a)})):an(i)?(r.clear(),i.forEach(function(a){return r.add(a)})):i!=null&&Ve("Cannot initialize set from "+i)}),this},e.observe_=function(i,r){return gr(this,i)},e.intercept_=function(i){return mr(this,i)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},Ni(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),wi=Jn("ObservableSet",$d),bl=Object.create(null),kl="remove",Md=function(){function t(n,i,r,a){i===void 0&&(i=new Map),a===void 0&&(a=Sm),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=i,this.name_=r,this.defaultAnnotation_=a,this.keysAtom_=new On("ObservableObject.keys"),this.isPlainObject_=En(this.target_)}var e=t.prototype;return e.getObservablePropValue_=function(i){return this.values_.get(i).get()},e.setObservablePropValue_=function(i,r){var a=this.values_.get(i);if(a instanceof Kt)return a.set(r),!0;if(Lt(this)){var o=$t(this,{type:en,object:this.proxy_||this.target_,name:i,newValue:r});if(!o)return null;r=o.newValue}if(r=a.prepareNewValue_(r),r!==me.UNCHANGED){var l=Vt(this),d=!1,h=l||d?{type:en,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:i,newValue:r}:null;a.setNewValue_(r),l&&qt(this,h)}return!0},e.get_=function(i){return me.trackingDerivation&&!on(this.target_,i)&&this.has_(i),this.target_[i]},e.set_=function(i,r,a){return a===void 0&&(a=!1),on(this.target_,i)?this.values_.has(i)?this.setObservablePropValue_(i,r):a?Reflect.set(this.target_,i,r):(this.target_[i]=r,!0):this.extend_(i,{value:r,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},e.has_=function(i){if(!me.trackingDerivation)return i in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var r=this.pendingKeys_.get(i);return r||(r=new Un(i in this.target_,$a,"ObservableObject.key?",!1),this.pendingKeys_.set(i,r)),r.get()},e.make_=function(i,r){if(r===!0&&(r=this.defaultAnnotation_),r!==!1){if(!(i in this.target_)){var a;if((a=this.target_[Yt])!=null&&a[i])return;Ve(1,r.annotationType_,this.name_+"."+i.toString())}for(var o=this.target_;o&&o!==Da;){var l=fa(o,i);if(l){var d=r.make_(this,i,l,o);if(d===0)return;if(d===1)break}o=Object.getPrototypeOf(o)}Sl(this,r,i)}},e.extend_=function(i,r,a,o){if(o===void 0&&(o=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(i,r,o);var l=a.extend_(this,i,r,o);return l&&Sl(this,a,i),l},e.defineProperty_=function(i,r,a){a===void 0&&(a=!1),this.keysAtom_;try{Mt();var o=this.delete_(i);if(!o)return o;if(Lt(this)){var l=$t(this,{object:this.proxy_||this.target_,name:i,type:Sn,newValue:r.value});if(!l)return null;var d=l.newValue;r.value!==d&&(r=wn({},r,{value:d}))}if(a){if(!Reflect.defineProperty(this.target_,i,r))return!1}else Qt(this.target_,i,r);this.notifyPropertyAddition_(i,r.value)}finally{jt()}return!0},e.defineObservableProperty_=function(i,r,a,o){o===void 0&&(o=!1),this.keysAtom_;try{Mt();var l=this.delete_(i);if(!l)return l;if(Lt(this)){var d=$t(this,{object:this.proxy_||this.target_,name:i,type:Sn,newValue:r});if(!d)return null;r=d.newValue}var h=_l(i),m={configurable:me.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:h.get,set:h.set};if(o){if(!Reflect.defineProperty(this.target_,i,m))return!1}else Qt(this.target_,i,m);var y=new Un(r,a,"ObservableObject.key",!1);this.values_.set(i,y),this.notifyPropertyAddition_(i,y.value_)}finally{jt()}return!0},e.defineComputedProperty_=function(i,r,a){a===void 0&&(a=!1),this.keysAtom_;try{Mt();var o=this.delete_(i);if(!o)return o;if(Lt(this)){var l=$t(this,{object:this.proxy_||this.target_,name:i,type:Sn,newValue:void 0});if(!l)return null}r.name||(r.name="ObservableObject.key"),r.context=this.proxy_||this.target_;var d=_l(i),h={configurable:me.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:d.get,set:d.set};if(a){if(!Reflect.defineProperty(this.target_,i,h))return!1}else Qt(this.target_,i,h);this.values_.set(i,new Kt(r)),this.notifyPropertyAddition_(i,void 0)}finally{jt()}return!0},e.delete_=function(i,r){if(r===void 0&&(r=!1),this.keysAtom_,!on(this.target_,i))return!0;if(Lt(this)){var a=$t(this,{object:this.proxy_||this.target_,name:i,type:kl});if(!a)return null}try{var o;Mt();var l=Vt(this),d=!1,h=this.values_.get(i),m=void 0;if(!h&&(l||d)){var y;m=(y=fa(this.target_,i))==null?void 0:y.value}if(r){if(!Reflect.deleteProperty(this.target_,i))return!1}else delete this.target_[i];if(h&&(this.values_.delete(i),h instanceof Un&&(m=h.value_),Ed(h)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(i))==null||o.set(i in this.target_),l||d){var v={type:kl,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:m,name:i};l&&qt(this,v)}}finally{jt()}return!0},e.observe_=function(i,r){return gr(this,i)},e.intercept_=function(i){return mr(this,i)},e.notifyPropertyAddition_=function(i,r){var a,o=Vt(this),l=!1;if(o||l){var d=o||l?{type:Sn,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:i,newValue:r}:null;o&&qt(this,d)}(a=this.pendingKeys_)==null||(a=a.get(i))==null||a.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),La(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function Ai(t,e){var n;if(on(t,we))return t;var i=(n=e==null?void 0:e.name)!=null?n:"ObservableObject",r=new Md(t,new Map,String(i),Dm(e));return Pa(t,we,r),t}var Eg=Jn("ObservableObjectAdministration",Md);function _l(t){return bl[t]||(bl[t]={get:function(){return this[we].getObservablePropValue_(t)},set:function(n){return this[we].setObservablePropValue_(t,n)}})}function Ka(t){return Ia(t)?Eg(t[we]):!1}function Sl(t,e,n){var i;(i=t.target_[Yt])==null||delete i[n]}var wg=Bd(0),Ag=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),eo=0,jd=function(){};function Og(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}Og(jd,Array.prototype);var fu=function(t){function e(i,r,a,o){var l;return a===void 0&&(a="ObservableArray"),o===void 0&&(o=!1),l=t.call(this)||this,Qn(function(){var d=new du(a,r,o,!0);d.proxy_=l,rd(l,we,d),i&&i.length&&l.spliceWithArray(0,0,i),Ag&&Object.defineProperty(l,"0",wg)}),l}od(e,t);var n=e.prototype;return n.concat=function(){this[we].atom_.reportObserved();for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),a.map(function(l){return Ha(l)?l.slice():l}))},n[Symbol.iterator]=function(){var i=this,r=0;return sr({next:function(){return r<i.length?{value:i[r++],done:!1}:{done:!0,value:void 0}}})},Ni(e,[{key:"length",get:function(){return this[we].getArrayLength_()},set:function(r){this[we].setArrayLength_(r)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(jd);Object.entries(va).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&Pa(fu.prototype,e,n)});function Bd(t){return{enumerable:!1,configurable:!0,get:function(){return this[we].get_(t)},set:function(n){this[we].set_(t,n)}}}function xg(t){Qt(fu.prototype,""+t,Bd(t))}function Ud(t){if(t>eo){for(var e=eo;e<t+100;e++)xg(e);eo=t}}Ud(1e3);function Tg(t,e,n){return new fu(t,e,n)}function $o(t,e){if(typeof t=="object"&&t!==null){if(Ha(t))return e!==void 0&&Ve(23),t[we].atom_;if(wi(t))return t.atom_;if(Xn(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||Ve(25,e,Mo(t)),n}if(Ka(t)){if(!e)return Ve(26);var i=t[we].values_.get(e);return i||Ve(27,e,Mo(t)),i}if(uu(t)||Ua(t)||ga(t))return t}else if(Ht(t)&&ga(t[we]))return t[we];Ve(28)}function Cg(t,e){if(t||Ve(29),uu(t)||Ua(t)||ga(t)||Xn(t)||wi(t))return t;if(t[we])return t[we];Ve(24,t)}function Mo(t,e){var n;if(e!==void 0)n=$o(t,e);else{if(Va(t))return t.name;Ka(t)||Xn(t)||wi(t)?n=Cg(t):n=$o(t)}return n.name_}function Qn(t){var e=Yn(),n=ja(!0);Mt();try{return t()}finally{jt(),Ba(n),un(e)}}var Nl=Da.toString;function Vd(t,e,n){return n===void 0&&(n=-1),jo(t,e,n)}function jo(t,e,n,i,r){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;if(a!=="function"&&a!=="object"&&typeof e!="object")return!1;var o=Nl.call(t);if(o!==Nl.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol!="undefined"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=El(t),e=El(e);var l=o==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var d=t.constructor,h=e.constructor;if(d!==h&&!(Ht(d)&&d instanceof d&&Ht(h)&&h instanceof h)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),i=i||[],r=r||[];for(var m=i.length;m--;)if(i[m]===t)return r[m]===e;if(i.push(t),r.push(e),l){if(m=t.length,m!==e.length)return!1;for(;m--;)if(!jo(t[m],e[m],n-1,i,r))return!1}else{var y=Object.keys(t),v;if(m=y.length,Object.keys(e).length!==m)return!1;for(;m--;)if(v=y[m],!(on(e,v)&&jo(t[v],e[v],n-1,i,r)))return!1}return i.pop(),r.pop(),!0}function El(t){return Ha(t)?t.slice():Si(t)||Xn(t)||an(t)||wi(t)?Array.from(t.entries()):t}function sr(t){return t[Symbol.iterator]=Rg,t}function Rg(){return this}["Symbol","Map","Set"].forEach(function(t){var e=Zc();typeof e[t]=="undefined"&&Ve("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Ym,extras:{getDebugName:Mo},$mobx:we});function Fg(t,e=[]){Pe.useEffect(()=>{const n=qa(t);return()=>n()},e)}function qd(t,e={}){const{defaultValue:n,deps:i=[]}=e,r=Pe.useMemo(()=>t,i),[a,o]=Pe.useState(()=>r()||n);return Pe.useEffect(()=>{const l=qa(()=>o(r()));return()=>l()},[r,...i]),a}function Dg(t,e,n=[]){const i=Pe.useMemo(()=>t,n),r=Pe.useMemo(()=>e,n);Pe.useEffect(()=>{const a=ig(i,r);return()=>a()},[i,r])}let hu=new Map;const Bo=Pe.createContext(hu),Ig=({children:t,stores:e})=>{const n=Pe.useContext(Bo),i=Pe.useMemo(()=>{const r=new Map;return e.forEach(a=>r.set(a.class,a.value)),hu=new Map([...n,...r])},[]);return dp.jsx(Bo.Provider,{value:i,children:t})};function Pg(t){return Pe.useContext(Bo).get(t)}function Lg(t){return hu.get(t)}var $g=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function za(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ra={exports:{}},Mg=ra.exports,wl;function jg(){return wl||(wl=1,function(t,e){(function(n,i){t.exports=i()})(Mg,function(){var n=function(s,u){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(c[p]=f[p])})(s,u)},i=function(){return(i=Object.assign||function(s){for(var u,c=1,f=arguments.length;c<f;c++)for(var p in u=arguments[c])Object.prototype.hasOwnProperty.call(u,p)&&(s[p]=u[p]);return s}).apply(this,arguments)};function r(s,u,c){for(var f,p=0,g=u.length;p<g;p++)!f&&p in u||((f=f||Array.prototype.slice.call(u,0,p))[p]=u[p]);return s.concat(f||Array.prototype.slice.call(u))}var a=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:$g,o=Object.keys,l=Array.isArray;function d(s,u){return typeof u!="object"||o(u).forEach(function(c){s[c]=u[c]}),s}typeof Promise=="undefined"||a.Promise||(a.Promise=Promise);var h=Object.getPrototypeOf,m={}.hasOwnProperty;function y(s,u){return m.call(s,u)}function v(s,u){typeof u=="function"&&(u=u(h(s))),(typeof Reflect=="undefined"?o:Reflect.ownKeys)(u).forEach(function(c){_(s,c,u[c])})}var x=Object.defineProperty;function _(s,u,c,f){x(s,u,d(c&&y(c,"get")&&typeof c.get=="function"?{get:c.get,set:c.set,configurable:!0}:{value:c,configurable:!0,writable:!0},f))}function N(s){return{from:function(u){return s.prototype=Object.create(u.prototype),_(s.prototype,"constructor",s),{extend:v.bind(null,s.prototype)}}}}var E=Object.getOwnPropertyDescriptor,F=[].slice;function V(s,u,c){return F.call(s,u,c)}function J(s,u){return u(s)}function K(s){if(!s)throw new Error("Assertion Failed")}function Y(s){a.setImmediate?setImmediate(s):setTimeout(s,0)}function X(s,u){if(typeof u=="string"&&y(s,u))return s[u];if(!u)return s;if(typeof u!="string"){for(var c=[],f=0,p=u.length;f<p;++f){var g=X(s,u[f]);c.push(g)}return c}var b=u.indexOf(".");if(b!==-1){var k=s[u.substr(0,b)];return k==null?void 0:X(k,u.substr(b+1))}}function ne(s,u,c){if(s&&u!==void 0&&!("isFrozen"in Object&&Object.isFrozen(s)))if(typeof u!="string"&&"length"in u){K(typeof c!="string"&&"length"in c);for(var f=0,p=u.length;f<p;++f)ne(s,u[f],c[f])}else{var g,b,k=u.indexOf(".");k!==-1?(g=u.substr(0,k),(b=u.substr(k+1))===""?c===void 0?l(s)&&!isNaN(parseInt(g))?s.splice(g,1):delete s[g]:s[g]=c:ne(k=!(k=s[g])||!y(s,g)?s[g]={}:k,b,c)):c===void 0?l(s)&&!isNaN(parseInt(u))?s.splice(u,1):delete s[u]:s[u]=c}}function ye(s){var u,c={};for(u in s)y(s,u)&&(c[u]=s[u]);return c}var de=[].concat;function je(s){return de.apply([],s)}var Dt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(je([8,16,32,64].map(function(s){return["Int","Uint","Float"].map(function(u){return u+s+"Array"})}))).filter(function(s){return a[s]}),ke=new Set(Dt.map(function(s){return a[s]})),Ae=null;function Le(s){return Ae=new WeakMap,s=function u(c){if(!c||typeof c!="object")return c;var f=Ae.get(c);if(f)return f;if(l(c)){f=[],Ae.set(c,f);for(var p=0,g=c.length;p<g;++p)f.push(u(c[p]))}else if(ke.has(c.constructor))f=c;else{var b,k=h(c);for(b in f=k===Object.prototype?{}:Object.create(k),Ae.set(c,f),c)y(c,b)&&(f[b]=u(c[b]))}return f}(s),Ae=null,s}var M={}.toString;function w(s){return M.call(s).slice(8,-1)}var z=typeof Symbol!="undefined"?Symbol.iterator:"@@iterator",Q=typeof z=="symbol"?function(s){var u;return s!=null&&(u=s[z])&&u.apply(s)}:function(){return null};function ae(s,u){return u=s.indexOf(u),0<=u&&s.splice(u,1),0<=u}var te={};function j(s){var u,c,f,p;if(arguments.length===1){if(l(s))return s.slice();if(this===te&&typeof s=="string")return[s];if(p=Q(s)){for(c=[];!(f=p.next()).done;)c.push(f.value);return c}if(s==null)return[s];if(typeof(u=s.length)!="number")return[s];for(c=new Array(u);u--;)c[u]=s[u];return c}for(u=arguments.length,c=new Array(u);u--;)c[u]=arguments[u];return c}var Oe=typeof Symbol!="undefined"?function(s){return s[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},tn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],It=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(tn),Re={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function Ke(s,u){this.name=s,this.message=u}function I(s,u){return s+". Errors: "+Object.keys(u).map(function(c){return u[c].toString()}).filter(function(c,f,p){return p.indexOf(c)===f}).join(`
27
+ `)}function q(s,u,c,f){this.failures=u,this.failedKeys=f,this.successCount=c,this.message=I(s,u)}function ot(s,u){this.name="BulkError",this.failures=Object.keys(u).map(function(c){return u[c]}),this.failuresByPos=u,this.message=I(s,this.failures)}N(Ke).from(Error).extend({toString:function(){return this.name+": "+this.message}}),N(q).from(Ke),N(ot).from(Ke);var ge=It.reduce(function(s,u){return s[u]=u+"Error",s},{}),Fe=Ke,he=It.reduce(function(s,u){var c=u+"Error";function f(p,g){this.name=c,p?typeof p=="string"?(this.message="".concat(p).concat(g?`
28
+ `+g:""),this.inner=g||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=Re[u]||c,this.inner=null)}return N(f).from(Fe),s[u]=f,s},{});he.Syntax=SyntaxError,he.Type=TypeError,he.Range=RangeError;var Ge=tn.reduce(function(s,u){return s[u+"Error"]=he[u],s},{}),qe=It.reduce(function(s,u){return["Syntax","Type","Range"].indexOf(u)===-1&&(s[u+"Error"]=he[u]),s},{});function Se(){}function pt(s){return s}function nt(s,u){return s==null||s===pt?u:function(c){return u(s(c))}}function _e(s,u){return function(){s.apply(this,arguments),u.apply(this,arguments)}}function ut(s,u){return s===Se?u:function(){var c=s.apply(this,arguments);c!==void 0&&(arguments[0]=c);var f=this.onsuccess,p=this.onerror;this.onsuccess=null,this.onerror=null;var g=u.apply(this,arguments);return f&&(this.onsuccess=this.onsuccess?_e(f,this.onsuccess):f),p&&(this.onerror=this.onerror?_e(p,this.onerror):p),g!==void 0?g:c}}function Xe(s,u){return s===Se?u:function(){s.apply(this,arguments);var c=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,u.apply(this,arguments),c&&(this.onsuccess=this.onsuccess?_e(c,this.onsuccess):c),f&&(this.onerror=this.onerror?_e(f,this.onerror):f)}}function ue(s,u){return s===Se?u:function(c){var f=s.apply(this,arguments);d(c,f);var p=this.onsuccess,g=this.onerror;return this.onsuccess=null,this.onerror=null,c=u.apply(this,arguments),p&&(this.onsuccess=this.onsuccess?_e(p,this.onsuccess):p),g&&(this.onerror=this.onerror?_e(g,this.onerror):g),f===void 0?c===void 0?void 0:c:d(f,c)}}function He(s,u){return s===Se?u:function(){return u.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function ie(s,u){return s===Se?u:function(){var c=s.apply(this,arguments);if(c&&typeof c.then=="function"){for(var f=this,p=arguments.length,g=new Array(p);p--;)g[p]=arguments[p];return c.then(function(){return u.apply(f,g)})}return u.apply(this,arguments)}}qe.ModifyError=q,qe.DexieError=Ke,qe.BulkError=ot;var Ee=typeof location!="undefined"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function We(s){Ee=s}var it={},tt=100,Dt=typeof Promise=="undefined"?[]:function(){var s=Promise.resolve();if(typeof crypto=="undefined"||!crypto.subtle)return[s,h(s),s];var u=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[u,h(u),s]}(),tn=Dt[0],It=Dt[1],Dt=Dt[2],It=It&&It.then,xn=tn&&tn.constructor,ds=!!Dt,Ci=function(s,u){Ri.push([s,u]),_r&&(queueMicrotask(jh),_r=!1)},fs=!0,_r=!0,Tn=[],Sr=[],hs=pt,fn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Se,pgp:!1,env:{},finalize:Se},be=fn,Ri=[],Cn=0,Nr=[];function ce(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var u=this._PSD=be;if(typeof s!="function"){if(s!==it)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&ms(this,this._value))}this._state=null,this._value=null,++u.ref,function c(f,p){try{p(function(g){if(f._state===null){if(g===f)throw new TypeError("A promise cannot be resolved with itself.");var b=f._lib&&ei();g&&typeof g.then=="function"?c(f,function(k,A){g instanceof ce?g._then(k,A):g.then(k,A)}):(f._state=!0,f._value=g,Du(f)),b&&ti()}},ms.bind(null,f))}catch(g){ms(f,g)}}(this,s)}var ps={get:function(){var s=be,u=Or;function c(f,p){var g=this,b=!s.global&&(s!==be||u!==Or),k=b&&!pn(),A=new ce(function(T,D){gs(g,new Fu(Pu(f,s,b,k),Pu(p,s,b,k),T,D,s))});return this._consoleTask&&(A._consoleTask=this._consoleTask),A}return c.prototype=it,c},set:function(s){_(this,"then",s&&s.prototype===it?ps:{get:function(){return s},set:ps.set})}};function Fu(s,u,c,f,p){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof u=="function"?u:null,this.resolve=c,this.reject=f,this.psd=p}function ms(s,u){var c,f;Sr.push(u),s._state===null&&(c=s._lib&&ei(),u=hs(u),s._state=!1,s._value=u,f=s,Tn.some(function(p){return p._value===f._value})||Tn.push(f),Du(s),c&&ti())}function Du(s){var u=s._listeners;s._listeners=[];for(var c=0,f=u.length;c<f;++c)gs(s,u[c]);var p=s._PSD;--p.ref||p.finalize(),Cn===0&&(++Cn,Ci(function(){--Cn==0&&vs()},[]))}function gs(s,u){if(s._state!==null){var c=s._state?u.onFulfilled:u.onRejected;if(c===null)return(s._state?u.resolve:u.reject)(s._value);++u.psd.ref,++Cn,Ci(Mh,[c,s,u])}else s._listeners.push(u)}function Mh(s,u,c){try{var f,p=u._value;!u._state&&Sr.length&&(Sr=[]),f=Ee&&u._consoleTask?u._consoleTask.run(function(){return s(p)}):s(p),u._state||Sr.indexOf(p)!==-1||function(g){for(var b=Tn.length;b;)if(Tn[--b]._value===g._value)return Tn.splice(b,1)}(u),c.resolve(f)}catch(g){c.reject(g)}finally{--Cn==0&&vs(),--c.psd.ref||c.psd.finalize()}}function jh(){Rn(fn,function(){ei()&&ti()})}function ei(){var s=fs;return _r=fs=!1,s}function ti(){var s,u,c;do for(;0<Ri.length;)for(s=Ri,Ri=[],c=s.length,u=0;u<c;++u){var f=s[u];f[0].apply(null,f[1])}while(0<Ri.length);_r=fs=!0}function vs(){var s=Tn;Tn=[],s.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)});for(var u=Nr.slice(0),c=u.length;c;)u[--c]()}function Er(s){return new ce(it,!1,s)}function Qe(s,u){var c=be;return function(){var f=ei(),p=be;try{return mn(c,!0),s.apply(this,arguments)}catch(g){u&&u(g)}finally{mn(p,!1),f&&ti()}}}v(ce.prototype,{then:ps,_then:function(s,u){gs(this,new Fu(null,null,s,u,be))},catch:function(s){if(arguments.length===1)return this.then(null,s);var u=s,c=arguments[1];return typeof u=="function"?this.then(null,function(f){return(f instanceof u?c:Er)(f)}):this.then(null,function(f){return(f&&f.name===u?c:Er)(f)})},finally:function(s){return this.then(function(u){return ce.resolve(s()).then(function(){return u})},function(u){return ce.resolve(s()).then(function(){return Er(u)})})},timeout:function(s,u){var c=this;return s<1/0?new ce(function(f,p){var g=setTimeout(function(){return p(new he.Timeout(u))},s);c.then(f,p).finally(clearTimeout.bind(null,g))}):this}}),typeof Symbol!="undefined"&&Symbol.toStringTag&&_(ce.prototype,Symbol.toStringTag,"Dexie.Promise"),fn.env=Iu(),v(ce,{all:function(){var s=j.apply(null,arguments).map(xr);return new ce(function(u,c){s.length===0&&u([]);var f=s.length;s.forEach(function(p,g){return ce.resolve(p).then(function(b){s[g]=b,--f||u(s)},c)})})},resolve:function(s){return s instanceof ce?s:s&&typeof s.then=="function"?new ce(function(u,c){s.then(u,c)}):new ce(it,!0,s)},reject:Er,race:function(){var s=j.apply(null,arguments).map(xr);return new ce(function(u,c){s.map(function(f){return ce.resolve(f).then(u,c)})})},PSD:{get:function(){return be},set:function(s){return be=s}},totalEchoes:{get:function(){return Or}},newPSD:hn,usePSD:Rn,scheduler:{get:function(){return Ci},set:function(s){Ci=s}},rejectionMapper:{get:function(){return hs},set:function(s){hs=s}},follow:function(s,u){return new ce(function(c,f){return hn(function(p,g){var b=be;b.unhandleds=[],b.onunhandled=g,b.finalize=_e(function(){var k,A=this;k=function(){A.unhandleds.length===0?p():g(A.unhandleds[0])},Nr.push(function T(){k(),Nr.splice(Nr.indexOf(T),1)}),++Cn,Ci(function(){--Cn==0&&vs()},[])},b.finalize),s()},u,c,f)})}}),xn&&(xn.allSettled&&_(ce,"allSettled",function(){var s=j.apply(null,arguments).map(xr);return new ce(function(u){s.length===0&&u([]);var c=s.length,f=new Array(c);s.forEach(function(p,g){return ce.resolve(p).then(function(b){return f[g]={status:"fulfilled",value:b}},function(b){return f[g]={status:"rejected",reason:b}}).then(function(){return--c||u(f)})})})}),xn.any&&typeof AggregateError!="undefined"&&_(ce,"any",function(){var s=j.apply(null,arguments).map(xr);return new ce(function(u,c){s.length===0&&c(new AggregateError([]));var f=s.length,p=new Array(f);s.forEach(function(g,b){return ce.resolve(g).then(function(k){return u(k)},function(k){p[b]=k,--f||c(new AggregateError(p))})})})}),xn.withResolvers&&(ce.withResolvers=xn.withResolvers));var dt={awaits:0,echoes:0,id:0},Bh=0,wr=[],Ar=0,Or=0,Uh=0;function hn(s,u,c,f){var p=be,g=Object.create(p);return g.parent=p,g.ref=0,g.global=!1,g.id=++Uh,fn.env,g.env=ds?{Promise:ce,PromiseProp:{value:ce,configurable:!0,writable:!0},all:ce.all,race:ce.race,allSettled:ce.allSettled,any:ce.any,resolve:ce.resolve,reject:ce.reject}:{},u&&d(g,u),++p.ref,g.finalize=function(){--this.parent.ref||this.parent.finalize()},f=Rn(g,s,c,f),g.ref===0&&g.finalize(),f}function ni(){return dt.id||(dt.id=++Bh),++dt.awaits,dt.echoes+=tt,dt.id}function pn(){return!!dt.awaits&&(--dt.awaits==0&&(dt.id=0),dt.echoes=dt.awaits*tt,!0)}function xr(s){return dt.echoes&&s&&s.constructor===xn?(ni(),s.then(function(u){return pn(),u},function(u){return pn(),rt(u)})):s}function Vh(){var s=wr[wr.length-1];wr.pop(),mn(s,!1)}function mn(s,u){var c,f=be;(u?!dt.echoes||Ar++&&s===be:!Ar||--Ar&&s===be)||queueMicrotask(u?function(p){++Or,dt.echoes&&--dt.echoes!=0||(dt.echoes=dt.awaits=dt.id=0),wr.push(be),mn(p,!0)}.bind(null,s):Vh),s!==be&&(be=s,f===fn&&(fn.env=Iu()),ds&&(c=fn.env.Promise,u=s.env,(f.global||s.global)&&(Object.defineProperty(a,"Promise",u.PromiseProp),c.all=u.all,c.race=u.race,c.resolve=u.resolve,c.reject=u.reject,u.allSettled&&(c.allSettled=u.allSettled),u.any&&(c.any=u.any))))}function Iu(){var s=a.Promise;return ds?{Promise:s,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:s.all,race:s.race,allSettled:s.allSettled,any:s.any,resolve:s.resolve,reject:s.reject}:{}}function Rn(s,u,c,f,p){var g=be;try{return mn(s,!0),u(c,f,p)}finally{mn(g,!1)}}function Pu(s,u,c,f){return typeof s!="function"?s:function(){var p=be;c&&ni(),mn(u,!0);try{return s.apply(this,arguments)}finally{mn(p,!1),f&&queueMicrotask(pn)}}}function ys(s){Promise===xn&&dt.echoes===0?Ar===0?s():enqueueNativeMicroTask(s):setTimeout(s,0)}(""+It).indexOf("[native code]")===-1&&(ni=pn=Se);var rt=ce.reject,Fn="￿",nn="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Lu="String expected.",ii=[],Tr="__dbnames",bs="readonly",ks="readwrite";function Dn(s,u){return s?u?function(){return s.apply(this,arguments)&&u.apply(this,arguments)}:s:u}var $u={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Cr(s){return typeof s!="string"||/\./.test(s)?function(u){return u}:function(u){return u[s]===void 0&&s in u&&delete(u=Le(u))[s],u}}function Mu(){throw he.Type()}function Me(s,u){try{var c=ju(s),f=ju(u);if(c!==f)return c==="Array"?1:f==="Array"?-1:c==="binary"?1:f==="binary"?-1:c==="string"?1:f==="string"?-1:c==="Date"?1:f!=="Date"?NaN:-1;switch(c){case"number":case"Date":case"string":return u<s?1:s<u?-1:0;case"binary":return function(p,g){for(var b=p.length,k=g.length,A=b<k?b:k,T=0;T<A;++T)if(p[T]!==g[T])return p[T]<g[T]?-1:1;return b===k?0:b<k?-1:1}(Bu(s),Bu(u));case"Array":return function(p,g){for(var b=p.length,k=g.length,A=b<k?b:k,T=0;T<A;++T){var D=Me(p[T],g[T]);if(D!==0)return D}return b===k?0:b<k?-1:1}(s,u)}}catch{}return NaN}function ju(s){var u=typeof s;return u!="object"?u:ArrayBuffer.isView(s)?"binary":(s=w(s),s==="ArrayBuffer"?"binary":s)}function Bu(s){return s instanceof Uint8Array?s:ArrayBuffer.isView(s)?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s)}var Uu=(Ye.prototype._trans=function(s,u,c){var f=this._tx||be.trans,p=this.name,g=Ee&&typeof console!="undefined"&&console.createTask&&console.createTask("Dexie: ".concat(s==="readonly"?"read":"write"," ").concat(this.name));function b(T,D,S){if(!S.schema[p])throw new he.NotFound("Table "+p+" not part of transaction");return u(S.idbtrans,S)}var k=ei();try{var A=f&&f.db._novip===this.db._novip?f===be.trans?f._promise(s,b,c):hn(function(){return f._promise(s,b,c)},{trans:f,transless:be.transless||be}):function T(D,S,L,O){if(D.idbdb&&(D._state.openComplete||be.letThrough||D._vip)){var R=D._createTransaction(S,L,D._dbSchema);try{R.create(),D._state.PR1398_maxLoop=3}catch(P){return P.name===ge.InvalidState&&D.isOpen()&&0<--D._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),D.close({disableAutoOpen:!1}),D.open().then(function(){return T(D,S,L,O)})):rt(P)}return R._promise(S,function(P,C){return hn(function(){return be.trans=R,O(P,C,R)})}).then(function(P){if(S==="readwrite")try{R.idbtrans.commit()}catch{}return S==="readonly"?P:R._completion.then(function(){return P})})}if(D._state.openComplete)return rt(new he.DatabaseClosed(D._state.dbOpenError));if(!D._state.isBeingOpened){if(!D._state.autoOpen)return rt(new he.DatabaseClosed);D.open().catch(Se)}return D._state.dbReadyPromise.then(function(){return T(D,S,L,O)})}(this.db,s,[this.name],b);return g&&(A._consoleTask=g,A=A.catch(function(T){return console.trace(T),rt(T)})),A}finally{k&&ti()}},Ye.prototype.get=function(s,u){var c=this;return s&&s.constructor===Object?this.where(s).first(u):s==null?rt(new he.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return c.core.get({trans:f,key:s}).then(function(p){return c.hook.reading.fire(p)})}).then(u)},Ye.prototype.where=function(s){if(typeof s=="string")return new this.db.WhereClause(this,s);if(l(s))return new this.db.WhereClause(this,"[".concat(s.join("+"),"]"));var u=o(s);if(u.length===1)return this.where(u[0]).equals(s[u[0]]);var c=this.schema.indexes.concat(this.schema.primKey).filter(function(k){if(k.compound&&u.every(function(T){return 0<=k.keyPath.indexOf(T)})){for(var A=0;A<u.length;++A)if(u.indexOf(k.keyPath[A])===-1)return!1;return!0}return!1}).sort(function(k,A){return k.keyPath.length-A.keyPath.length})[0];if(c&&this.db._maxKey!==Fn){var g=c.keyPath.slice(0,u.length);return this.where(g).equals(g.map(function(A){return s[A]}))}!c&&Ee&&console.warn("The query ".concat(JSON.stringify(s)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(u.join("+"),"]"));var f=this.schema.idxByName;function p(k,A){return Me(k,A)===0}var b=u.reduce(function(S,A){var T=S[0],D=S[1],S=f[A],L=s[A];return[T||S,T||!S?Dn(D,S&&S.multi?function(O){return O=X(O,A),l(O)&&O.some(function(R){return p(L,R)})}:function(O){return p(L,X(O,A))}):D]},[null,null]),g=b[0],b=b[1];return g?this.where(g.name).equals(s[g.keyPath]).filter(b):c?this.filter(b):this.where(u).equals("")},Ye.prototype.filter=function(s){return this.toCollection().and(s)},Ye.prototype.count=function(s){return this.toCollection().count(s)},Ye.prototype.offset=function(s){return this.toCollection().offset(s)},Ye.prototype.limit=function(s){return this.toCollection().limit(s)},Ye.prototype.each=function(s){return this.toCollection().each(s)},Ye.prototype.toArray=function(s){return this.toCollection().toArray(s)},Ye.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Ye.prototype.orderBy=function(s){return new this.db.Collection(new this.db.WhereClause(this,l(s)?"[".concat(s.join("+"),"]"):s))},Ye.prototype.reverse=function(){return this.toCollection().reverse()},Ye.prototype.mapToClass=function(s){var u,c=this.db,f=this.name;function p(){return u!==null&&u.apply(this,arguments)||this}(this.schema.mappedClass=s).prototype instanceof Mu&&(function(A,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");function D(){this.constructor=A}n(A,T),A.prototype=T===null?Object.create(T):(D.prototype=T.prototype,new D)}(p,u=s),Object.defineProperty(p.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),p.prototype.table=function(){return f},s=p);for(var g=new Set,b=s.prototype;b;b=h(b))Object.getOwnPropertyNames(b).forEach(function(A){return g.add(A)});function k(A){if(!A)return A;var T,D=Object.create(s.prototype);for(T in A)if(!g.has(T))try{D[T]=A[T]}catch{}return D}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=k,this.hook("reading",k),s},Ye.prototype.defineClass=function(){return this.mapToClass(function(s){d(this,s)})},Ye.prototype.add=function(s,u){var c=this,f=this.schema.primKey,p=f.auto,g=f.keyPath,b=s;return g&&p&&(b=Cr(g)(s)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"add",keys:u!=null?[u]:null,values:[b]})}).then(function(k){return k.numFailures?ce.reject(k.failures[0]):k.lastResult}).then(function(k){if(g)try{ne(s,g,k)}catch{}return k})},Ye.prototype.update=function(s,u){return typeof s!="object"||l(s)?this.where(":id").equals(s).modify(u):(s=X(s,this.schema.primKey.keyPath),s===void 0?rt(new he.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(u))},Ye.prototype.put=function(s,u){var c=this,f=this.schema.primKey,p=f.auto,g=f.keyPath,b=s;return g&&p&&(b=Cr(g)(s)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"put",values:[b],keys:u!=null?[u]:null})}).then(function(k){return k.numFailures?ce.reject(k.failures[0]):k.lastResult}).then(function(k){if(g)try{ne(s,g,k)}catch{}return k})},Ye.prototype.delete=function(s){var u=this;return this._trans("readwrite",function(c){return u.core.mutate({trans:c,type:"delete",keys:[s]})}).then(function(c){return c.numFailures?ce.reject(c.failures[0]):void 0})},Ye.prototype.clear=function(){var s=this;return this._trans("readwrite",function(u){return s.core.mutate({trans:u,type:"deleteRange",range:$u})}).then(function(u){return u.numFailures?ce.reject(u.failures[0]):void 0})},Ye.prototype.bulkGet=function(s){var u=this;return this._trans("readonly",function(c){return u.core.getMany({keys:s,trans:c}).then(function(f){return f.map(function(p){return u.hook.reading.fire(p)})})})},Ye.prototype.bulkAdd=function(s,u,c){var f=this,p=Array.isArray(u)?u:void 0,g=(c=c||(p?void 0:u))?c.allKeys:void 0;return this._trans("readwrite",function(b){var T=f.schema.primKey,k=T.auto,T=T.keyPath;if(T&&p)throw new he.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new he.InvalidArgument("Arguments objects and keys must have the same length");var A=s.length,T=T&&k?s.map(Cr(T)):s;return f.core.mutate({trans:b,type:"add",keys:p,values:T,wantResults:g}).then(function(R){var S=R.numFailures,L=R.results,O=R.lastResult,R=R.failures;if(S===0)return g?L:O;throw new ot("".concat(f.name,".bulkAdd(): ").concat(S," of ").concat(A," operations failed"),R)})})},Ye.prototype.bulkPut=function(s,u,c){var f=this,p=Array.isArray(u)?u:void 0,g=(c=c||(p?void 0:u))?c.allKeys:void 0;return this._trans("readwrite",function(b){var T=f.schema.primKey,k=T.auto,T=T.keyPath;if(T&&p)throw new he.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new he.InvalidArgument("Arguments objects and keys must have the same length");var A=s.length,T=T&&k?s.map(Cr(T)):s;return f.core.mutate({trans:b,type:"put",keys:p,values:T,wantResults:g}).then(function(R){var S=R.numFailures,L=R.results,O=R.lastResult,R=R.failures;if(S===0)return g?L:O;throw new ot("".concat(f.name,".bulkPut(): ").concat(S," of ").concat(A," operations failed"),R)})})},Ye.prototype.bulkUpdate=function(s){var u=this,c=this.core,f=s.map(function(b){return b.key}),p=s.map(function(b){return b.changes}),g=[];return this._trans("readwrite",function(b){return c.getMany({trans:b,keys:f,cache:"clone"}).then(function(k){var A=[],T=[];s.forEach(function(S,L){var O=S.key,R=S.changes,P=k[L];if(P){for(var C=0,$=Object.keys(R);C<$.length;C++){var B=$[C],U=R[B];if(B===u.schema.primKey.keyPath){if(Me(U,O)!==0)throw new he.Constraint("Cannot update primary key in bulkUpdate()")}else ne(P,B,U)}g.push(L),A.push(O),T.push(P)}});var D=A.length;return c.mutate({trans:b,type:"put",keys:A,values:T,updates:{keys:f,changeSpecs:p}}).then(function(S){var L=S.numFailures,O=S.failures;if(L===0)return D;for(var R=0,P=Object.keys(O);R<P.length;R++){var C,$=P[R],B=g[Number($)];B!=null&&(C=O[$],delete O[$],O[B]=C)}throw new ot("".concat(u.name,".bulkUpdate(): ").concat(L," of ").concat(D," operations failed"),O)})})})},Ye.prototype.bulkDelete=function(s){var u=this,c=s.length;return this._trans("readwrite",function(f){return u.core.mutate({trans:f,type:"delete",keys:s})}).then(function(b){var p=b.numFailures,g=b.lastResult,b=b.failures;if(p===0)return g;throw new ot("".concat(u.name,".bulkDelete(): ").concat(p," of ").concat(c," operations failed"),b)})},Ye);function Ye(){}function Fi(s){function u(b,k){if(k){for(var A=arguments.length,T=new Array(A-1);--A;)T[A-1]=arguments[A];return c[b].subscribe.apply(null,T),s}if(typeof b=="string")return c[b]}var c={};u.addEventType=g;for(var f=1,p=arguments.length;f<p;++f)g(arguments[f]);return u;function g(b,k,A){if(typeof b!="object"){var T;k=k||He;var D={subscribers:[],fire:A=A||Se,subscribe:function(S){D.subscribers.indexOf(S)===-1&&(D.subscribers.push(S),D.fire=k(D.fire,S))},unsubscribe:function(S){D.subscribers=D.subscribers.filter(function(L){return L!==S}),D.fire=D.subscribers.reduce(k,A)}};return c[b]=u[b]=D}o(T=b).forEach(function(S){var L=T[S];if(l(L))g(S,T[S][0],T[S][1]);else{if(L!=="asap")throw new he.InvalidArgument("Invalid event config");var O=g(S,pt,function(){for(var R=arguments.length,P=new Array(R);R--;)P[R]=arguments[R];O.subscribers.forEach(function(C){Y(function(){C.apply(null,P)})})})}})}}function Di(s,u){return N(u).from({prototype:s}),u}function ri(s,u){return!(s.filter||s.algorithm||s.or)&&(u?s.justLimit:!s.replayFilter)}function _s(s,u){s.filter=Dn(s.filter,u)}function Ss(s,u,c){var f=s.replayFilter;s.replayFilter=f?function(){return Dn(f(),u())}:u,s.justLimit=c&&!f}function Rr(s,u){if(s.isPrimKey)return u.primaryKey;var c=u.getIndexByKeyPath(s.index);if(!c)throw new he.Schema("KeyPath "+s.index+" on object store "+u.name+" is not indexed");return c}function Vu(s,u,c){var f=Rr(s,u.schema);return u.openCursor({trans:c,values:!s.keysOnly,reverse:s.dir==="prev",unique:!!s.unique,query:{index:f,range:s.range}})}function Fr(s,u,c,f){var p=s.replayFilter?Dn(s.filter,s.replayFilter()):s.filter;if(s.or){var g={},b=function(k,A,T){var D,S;p&&!p(A,T,function(L){return A.stop(L)},function(L){return A.fail(L)})||((S=""+(D=A.primaryKey))=="[object ArrayBuffer]"&&(S=""+new Uint8Array(D)),y(g,S)||(g[S]=!0,u(k,A,T)))};return Promise.all([s.or._iterate(b,c),qu(Vu(s,f,c),s.algorithm,b,!s.keysOnly&&s.valueMapper)])}return qu(Vu(s,f,c),Dn(s.algorithm,p),u,!s.keysOnly&&s.valueMapper)}function qu(s,u,c,f){var p=Qe(f?function(g,b,k){return c(f(g),b,k)}:c);return s.then(function(g){if(g)return g.start(function(){var b=function(){return g.continue()};u&&!u(g,function(k){return b=k},function(k){g.stop(k),b=Se},function(k){g.fail(k),b=Se})||p(g.value,g,function(k){return b=k}),b()})})}var Ii=(Hu.prototype.execute=function(s){var u=this["@@propmod"];if(u.add!==void 0){var c=u.add;if(l(c))return r(r([],l(s)?s:[],!0),c).sort();if(typeof c=="number")return(Number(s)||0)+c;if(typeof c=="bigint")try{return BigInt(s)+c}catch{return BigInt(0)+c}throw new TypeError("Invalid term ".concat(c))}if(u.remove!==void 0){var f=u.remove;if(l(f))return l(s)?s.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(s)-f;if(typeof f=="bigint")try{return BigInt(s)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return c=(c=u.replacePrefix)===null||c===void 0?void 0:c[0],c&&typeof s=="string"&&s.startsWith(c)?u.replacePrefix[1]+s.substring(c.length):s},Hu);function Hu(s){this["@@propmod"]=s}var qh=(Be.prototype._read=function(s,u){var c=this._ctx;return c.error?c.table._trans(null,rt.bind(null,c.error)):c.table._trans("readonly",s).then(u)},Be.prototype._write=function(s){var u=this._ctx;return u.error?u.table._trans(null,rt.bind(null,u.error)):u.table._trans("readwrite",s,"locked")},Be.prototype._addAlgorithm=function(s){var u=this._ctx;u.algorithm=Dn(u.algorithm,s)},Be.prototype._iterate=function(s,u){return Fr(this._ctx,s,u,this._ctx.table.core)},Be.prototype.clone=function(s){var u=Object.create(this.constructor.prototype),c=Object.create(this._ctx);return s&&d(c,s),u._ctx=c,u},Be.prototype.raw=function(){return this._ctx.valueMapper=null,this},Be.prototype.each=function(s){var u=this._ctx;return this._read(function(c){return Fr(u,s,c,u.table.core)})},Be.prototype.count=function(s){var u=this;return this._read(function(c){var f=u._ctx,p=f.table.core;if(ri(f,!0))return p.count({trans:c,query:{index:Rr(f,p.schema),range:f.range}}).then(function(b){return Math.min(b,f.limit)});var g=0;return Fr(f,function(){return++g,!1},c,p).then(function(){return g})}).then(s)},Be.prototype.sortBy=function(s,u){var c=s.split(".").reverse(),f=c[0],p=c.length-1;function g(A,T){return T?g(A[c[T]],T-1):A[f]}var b=this._ctx.dir==="next"?1:-1;function k(A,T){return Me(g(A,p),g(T,p))*b}return this.toArray(function(A){return A.sort(k)}).then(u)},Be.prototype.toArray=function(s){var u=this;return this._read(function(c){var f=u._ctx;if(f.dir==="next"&&ri(f,!0)&&0<f.limit){var p=f.valueMapper,g=Rr(f,f.table.core.schema);return f.table.core.query({trans:c,limit:f.limit,values:!0,query:{index:g,range:f.range}}).then(function(k){return k=k.result,p?k.map(p):k})}var b=[];return Fr(f,function(k){return b.push(k)},c,f.table.core).then(function(){return b})},s)},Be.prototype.offset=function(s){var u=this._ctx;return s<=0||(u.offset+=s,ri(u)?Ss(u,function(){var c=s;return function(f,p){return c===0||(c===1?--c:p(function(){f.advance(c),c=0}),!1)}}):Ss(u,function(){var c=s;return function(){return--c<0}})),this},Be.prototype.limit=function(s){return this._ctx.limit=Math.min(this._ctx.limit,s),Ss(this._ctx,function(){var u=s;return function(c,f,p){return--u<=0&&f(p),0<=u}},!0),this},Be.prototype.until=function(s,u){return _s(this._ctx,function(c,f,p){return!s(c.value)||(f(p),u)}),this},Be.prototype.first=function(s){return this.limit(1).toArray(function(u){return u[0]}).then(s)},Be.prototype.last=function(s){return this.reverse().first(s)},Be.prototype.filter=function(s){var u;return _s(this._ctx,function(c){return s(c.value)}),(u=this._ctx).isMatch=Dn(u.isMatch,s),this},Be.prototype.and=function(s){return this.filter(s)},Be.prototype.or=function(s){return new this.db.WhereClause(this._ctx.table,s,this)},Be.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Be.prototype.desc=function(){return this.reverse()},Be.prototype.eachKey=function(s){var u=this._ctx;return u.keysOnly=!u.isMatch,this.each(function(c,f){s(f.key,f)})},Be.prototype.eachUniqueKey=function(s){return this._ctx.unique="unique",this.eachKey(s)},Be.prototype.eachPrimaryKey=function(s){var u=this._ctx;return u.keysOnly=!u.isMatch,this.each(function(c,f){s(f.primaryKey,f)})},Be.prototype.keys=function(s){var u=this._ctx;u.keysOnly=!u.isMatch;var c=[];return this.each(function(f,p){c.push(p.key)}).then(function(){return c}).then(s)},Be.prototype.primaryKeys=function(s){var u=this._ctx;if(u.dir==="next"&&ri(u,!0)&&0<u.limit)return this._read(function(f){var p=Rr(u,u.table.core.schema);return u.table.core.query({trans:f,values:!1,limit:u.limit,query:{index:p,range:u.range}})}).then(function(f){return f.result}).then(s);u.keysOnly=!u.isMatch;var c=[];return this.each(function(f,p){c.push(p.primaryKey)}).then(function(){return c}).then(s)},Be.prototype.uniqueKeys=function(s){return this._ctx.unique="unique",this.keys(s)},Be.prototype.firstKey=function(s){return this.limit(1).keys(function(u){return u[0]}).then(s)},Be.prototype.lastKey=function(s){return this.reverse().firstKey(s)},Be.prototype.distinct=function(){var s=this._ctx,s=s.index&&s.table.schema.idxByName[s.index];if(!s||!s.multi)return this;var u={};return _s(this._ctx,function(p){var f=p.primaryKey.toString(),p=y(u,f);return u[f]=!0,!p}),this},Be.prototype.modify=function(s){var u=this,c=this._ctx;return this._write(function(f){var p,g,b;b=typeof s=="function"?s:(p=o(s),g=p.length,function(C){for(var $=!1,B=0;B<g;++B){var U=p[B],G=s[U],Z=X(C,U);G instanceof Ii?(ne(C,U,G.execute(Z)),$=!0):Z!==G&&(ne(C,U,G),$=!0)}return $});var k=c.table.core,S=k.schema.primaryKey,A=S.outbound,T=S.extractKey,D=200,S=u.db._options.modifyChunkSize;S&&(D=typeof S=="object"?S[k.name]||S["*"]||200:S);function L(C,U){var B=U.failures,U=U.numFailures;R+=C-U;for(var G=0,Z=o(B);G<Z.length;G++){var oe=Z[G];O.push(B[oe])}}var O=[],R=0,P=[];return u.clone().primaryKeys().then(function(C){function $(U){var G=Math.min(D,C.length-U);return k.getMany({trans:f,keys:C.slice(U,U+G),cache:"immutable"}).then(function(Z){for(var oe=[],ee=[],re=A?[]:null,le=[],se=0;se<G;++se){var pe=Z[se],Te={value:Le(pe),primKey:C[U+se]};b.call(Te,Te.value,Te)!==!1&&(Te.value==null?le.push(C[U+se]):A||Me(T(pe),T(Te.value))===0?(ee.push(Te.value),A&&re.push(C[U+se])):(le.push(C[U+se]),oe.push(Te.value)))}return Promise.resolve(0<oe.length&&k.mutate({trans:f,type:"add",values:oe}).then(function(De){for(var Ie in De.failures)le.splice(parseInt(Ie),1);L(oe.length,De)})).then(function(){return(0<ee.length||B&&typeof s=="object")&&k.mutate({trans:f,type:"put",keys:re,values:ee,criteria:B,changeSpec:typeof s!="function"&&s,isAdditionalChunk:0<U}).then(function(De){return L(ee.length,De)})}).then(function(){return(0<le.length||B&&s===Ns)&&k.mutate({trans:f,type:"delete",keys:le,criteria:B,isAdditionalChunk:0<U}).then(function(De){return L(le.length,De)})}).then(function(){return C.length>U+G&&$(U+D)})})}var B=ri(c)&&c.limit===1/0&&(typeof s!="function"||s===Ns)&&{index:c.index,range:c.range};return $(0).then(function(){if(0<O.length)throw new q("Error modifying one or more objects",O,R,P);return C.length})})})},Be.prototype.delete=function(){var s=this._ctx,u=s.range;return ri(s)&&(s.isPrimKey||u.type===3)?this._write(function(c){var f=s.table.core.schema.primaryKey,p=u;return s.table.core.count({trans:c,query:{index:f,range:p}}).then(function(g){return s.table.core.mutate({trans:c,type:"deleteRange",range:p}).then(function(b){var k=b.failures;if(b.lastResult,b.results,b=b.numFailures,b)throw new q("Could not delete some values",Object.keys(k).map(function(A){return k[A]}),g-b);return g-b})})}):this.modify(Ns)},Be);function Be(){}var Ns=function(s,u){return u.value=null};function Hh(s,u){return s<u?-1:s===u?0:1}function Kh(s,u){return u<s?-1:s===u?0:1}function At(s,u,c){return s=s instanceof zu?new s.Collection(s):s,s._ctx.error=new(c||TypeError)(u),s}function ai(s){return new s.Collection(s,function(){return Ku("")}).limit(0)}function Dr(s,u,c,f){var p,g,b,k,A,T,D,S=c.length;if(!c.every(function(R){return typeof R=="string"}))return At(s,Lu);function L(R){p=R==="next"?function(C){return C.toUpperCase()}:function(C){return C.toLowerCase()},g=R==="next"?function(C){return C.toLowerCase()}:function(C){return C.toUpperCase()},b=R==="next"?Hh:Kh;var P=c.map(function(C){return{lower:g(C),upper:p(C)}}).sort(function(C,$){return b(C.lower,$.lower)});k=P.map(function(C){return C.upper}),A=P.map(function(C){return C.lower}),D=(T=R)==="next"?"":f}L("next"),s=new s.Collection(s,function(){return gn(k[0],A[S-1]+f)}),s._ondirectionchange=function(R){L(R)};var O=0;return s._addAlgorithm(function(R,P,C){var $=R.key;if(typeof $!="string")return!1;var B=g($);if(u(B,A,O))return!0;for(var U=null,G=O;G<S;++G){var Z=function(oe,ee,re,le,se,pe){for(var Te=Math.min(oe.length,le.length),De=-1,Ie=0;Ie<Te;++Ie){var Ot=ee[Ie];if(Ot!==le[Ie])return se(oe[Ie],re[Ie])<0?oe.substr(0,Ie)+re[Ie]+re.substr(Ie+1):se(oe[Ie],le[Ie])<0?oe.substr(0,Ie)+le[Ie]+re.substr(Ie+1):0<=De?oe.substr(0,De)+ee[De]+re.substr(De+1):null;se(oe[Ie],Ot)<0&&(De=Ie)}return Te<le.length&&pe==="next"?oe+re.substr(oe.length):Te<oe.length&&pe==="prev"?oe.substr(0,re.length):De<0?null:oe.substr(0,De)+le[De]+re.substr(De+1)}($,B,k[G],A[G],b,T);Z===null&&U===null?O=G+1:(U===null||0<b(U,Z))&&(U=Z)}return P(U!==null?function(){R.continue(U+D)}:C),!1}),s}function gn(s,u,c,f){return{type:2,lower:s,upper:u,lowerOpen:c,upperOpen:f}}function Ku(s){return{type:1,lower:s,upper:s}}var zu=(Object.defineProperty(ft.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),ft.prototype.between=function(s,u,c,f){c=c!==!1,f=f===!0;try{return 0<this._cmp(s,u)||this._cmp(s,u)===0&&(c||f)&&(!c||!f)?ai(this):new this.Collection(this,function(){return gn(s,u,!c,!f)})}catch{return At(this,nn)}},ft.prototype.equals=function(s){return s==null?At(this,nn):new this.Collection(this,function(){return Ku(s)})},ft.prototype.above=function(s){return s==null?At(this,nn):new this.Collection(this,function(){return gn(s,void 0,!0)})},ft.prototype.aboveOrEqual=function(s){return s==null?At(this,nn):new this.Collection(this,function(){return gn(s,void 0,!1)})},ft.prototype.below=function(s){return s==null?At(this,nn):new this.Collection(this,function(){return gn(void 0,s,!1,!0)})},ft.prototype.belowOrEqual=function(s){return s==null?At(this,nn):new this.Collection(this,function(){return gn(void 0,s)})},ft.prototype.startsWith=function(s){return typeof s!="string"?At(this,Lu):this.between(s,s+Fn,!0,!0)},ft.prototype.startsWithIgnoreCase=function(s){return s===""?this.startsWith(s):Dr(this,function(u,c){return u.indexOf(c[0])===0},[s],Fn)},ft.prototype.equalsIgnoreCase=function(s){return Dr(this,function(u,c){return u===c[0]},[s],"")},ft.prototype.anyOfIgnoreCase=function(){var s=j.apply(te,arguments);return s.length===0?ai(this):Dr(this,function(u,c){return c.indexOf(u)!==-1},s,"")},ft.prototype.startsWithAnyOfIgnoreCase=function(){var s=j.apply(te,arguments);return s.length===0?ai(this):Dr(this,function(u,c){return c.some(function(f){return u.indexOf(f)===0})},s,Fn)},ft.prototype.anyOf=function(){var s=this,u=j.apply(te,arguments),c=this._cmp;try{u.sort(c)}catch{return At(this,nn)}if(u.length===0)return ai(this);var f=new this.Collection(this,function(){return gn(u[0],u[u.length-1])});f._ondirectionchange=function(g){c=g==="next"?s._ascending:s._descending,u.sort(c)};var p=0;return f._addAlgorithm(function(g,b,k){for(var A=g.key;0<c(A,u[p]);)if(++p===u.length)return b(k),!1;return c(A,u[p])===0||(b(function(){g.continue(u[p])}),!1)}),f},ft.prototype.notEqual=function(s){return this.inAnyRange([[-1/0,s],[s,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},ft.prototype.noneOf=function(){var s=j.apply(te,arguments);if(s.length===0)return new this.Collection(this);try{s.sort(this._ascending)}catch{return At(this,nn)}var u=s.reduce(function(c,f){return c?c.concat([[c[c.length-1][1],f]]):[[-1/0,f]]},null);return u.push([s[s.length-1],this.db._maxKey]),this.inAnyRange(u,{includeLowers:!1,includeUppers:!1})},ft.prototype.inAnyRange=function($,u){var c=this,f=this._cmp,p=this._ascending,g=this._descending,b=this._min,k=this._max;if($.length===0)return ai(this);if(!$.every(function(B){return B[0]!==void 0&&B[1]!==void 0&&p(B[0],B[1])<=0}))return At(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",he.InvalidArgument);var A=!u||u.includeLowers!==!1,T=u&&u.includeUppers===!0,D,S=p;function L(B,U){return S(B[0],U[0])}try{(D=$.reduce(function(B,U){for(var G=0,Z=B.length;G<Z;++G){var oe=B[G];if(f(U[0],oe[1])<0&&0<f(U[1],oe[0])){oe[0]=b(oe[0],U[0]),oe[1]=k(oe[1],U[1]);break}}return G===Z&&B.push(U),B},[])).sort(L)}catch{return At(this,nn)}var O=0,R=T?function(B){return 0<p(B,D[O][1])}:function(B){return 0<=p(B,D[O][1])},P=A?function(B){return 0<g(B,D[O][0])}:function(B){return 0<=g(B,D[O][0])},C=R,$=new this.Collection(this,function(){return gn(D[0][0],D[D.length-1][1],!A,!T)});return $._ondirectionchange=function(B){S=B==="next"?(C=R,p):(C=P,g),D.sort(L)},$._addAlgorithm(function(B,U,G){for(var Z,oe=B.key;C(oe);)if(++O===D.length)return U(G),!1;return!R(Z=oe)&&!P(Z)||(c._cmp(oe,D[O][1])===0||c._cmp(oe,D[O][0])===0||U(function(){S===p?B.continue(D[O][0]):B.continue(D[O][1])}),!1)}),$},ft.prototype.startsWithAnyOf=function(){var s=j.apply(te,arguments);return s.every(function(u){return typeof u=="string"})?s.length===0?ai(this):this.inAnyRange(s.map(function(u){return[u,u+Fn]})):At(this,"startsWithAnyOf() only works with strings")},ft);function ft(){}function Wt(s){return Qe(function(u){return Pi(u),s(u.target.error),!1})}function Pi(s){s.stopPropagation&&s.stopPropagation(),s.preventDefault&&s.preventDefault()}var Li="storagemutated",Es="x-storagemutated-1",vn=Fi(null,Li),zh=(Jt.prototype._lock=function(){return K(!be.global),++this._reculock,this._reculock!==1||be.global||(be.lockOwnerFor=this),this},Jt.prototype._unlock=function(){if(K(!be.global),--this._reculock==0)for(be.global||(be.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var s=this._blockedFuncs.shift();try{Rn(s[1],s[0])}catch{}}return this},Jt.prototype._locked=function(){return this._reculock&&be.lockOwnerFor!==this},Jt.prototype.create=function(s){var u=this;if(!this.mode)return this;var c=this.db.idbdb,f=this.db._state.dbOpenError;if(K(!this.idbtrans),!s&&!c)switch(f&&f.name){case"DatabaseClosedError":throw new he.DatabaseClosed(f);case"MissingAPIError":throw new he.MissingAPI(f.message,f);default:throw new he.OpenFailed(f)}if(!this.active)throw new he.TransactionInactive;return K(this._completion._state===null),(s=this.idbtrans=s||(this.db.core||c).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Qe(function(p){Pi(p),u._reject(s.error)}),s.onabort=Qe(function(p){Pi(p),u.active&&u._reject(new he.Abort(s.error)),u.active=!1,u.on("abort").fire(p)}),s.oncomplete=Qe(function(){u.active=!1,u._resolve(),"mutatedParts"in s&&vn.storagemutated.fire(s.mutatedParts)}),this},Jt.prototype._promise=function(s,u,c){var f=this;if(s==="readwrite"&&this.mode!=="readwrite")return rt(new he.ReadOnly("Transaction is readonly"));if(!this.active)return rt(new he.TransactionInactive);if(this._locked())return new ce(function(g,b){f._blockedFuncs.push([function(){f._promise(s,u,c).then(g,b)},be])});if(c)return hn(function(){var g=new ce(function(b,k){f._lock();var A=u(b,k,f);A&&A.then&&A.then(b,k)});return g.finally(function(){return f._unlock()}),g._lib=!0,g});var p=new ce(function(g,b){var k=u(g,b,f);k&&k.then&&k.then(g,b)});return p._lib=!0,p},Jt.prototype._root=function(){return this.parent?this.parent._root():this},Jt.prototype.waitFor=function(s){var u,c=this._root(),f=ce.resolve(s);c._waitingFor?c._waitingFor=c._waitingFor.then(function(){return f}):(c._waitingFor=f,c._waitingQueue=[],u=c.idbtrans.objectStore(c.storeNames[0]),function g(){for(++c._spinCount;c._waitingQueue.length;)c._waitingQueue.shift()();c._waitingFor&&(u.get(-1/0).onsuccess=g)}());var p=c._waitingFor;return new ce(function(g,b){f.then(function(k){return c._waitingQueue.push(Qe(g.bind(null,k)))},function(k){return c._waitingQueue.push(Qe(b.bind(null,k)))}).finally(function(){c._waitingFor===p&&(c._waitingFor=null)})})},Jt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new he.Abort))},Jt.prototype.table=function(s){var u=this._memoizedTables||(this._memoizedTables={});if(y(u,s))return u[s];var c=this.schema[s];if(!c)throw new he.NotFound("Table "+s+" not part of transaction");return c=new this.db.Table(s,c,this),c.core=this.db.core.table(s),u[s]=c},Jt);function Jt(){}function ws(s,u,c,f,p,g,b){return{name:s,keyPath:u,unique:c,multi:f,auto:p,compound:g,src:(c&&!b?"&":"")+(f?"*":"")+(p?"++":"")+Gu(u)}}function Gu(s){return typeof s=="string"?s:s?"["+[].join.call(s,"+")+"]":""}function As(s,u,c){return{name:s,primKey:u,indexes:c,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},c.reduce(function(p,g,b){return b=f(g,b),b&&(p[b[0]]=b[1]),p},{}))};var f}var $i=function(s){try{return s.only([[]]),$i=function(){return[[]]},[[]]}catch{return $i=function(){return Fn},Fn}};function Os(s){return s==null?function(){}:typeof s=="string"?(u=s).split(".").length===1?function(c){return c[u]}:function(c){return X(c,u)}:function(c){return X(c,s)};var u}function Wu(s){return[].slice.call(s)}var Gh=0;function Mi(s){return s==null?":id":typeof s=="string"?s:"[".concat(s.join("+"),"]")}function Wh(s,u,A){function f(C){if(C.type===3)return null;if(C.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var O=C.lower,R=C.upper,P=C.lowerOpen,C=C.upperOpen;return O===void 0?R===void 0?null:u.upperBound(R,!!C):R===void 0?u.lowerBound(O,!!P):u.bound(O,R,!!P,!!C)}function p(L){var O,R=L.name;return{name:R,schema:L,mutate:function(P){var C=P.trans,$=P.type,B=P.keys,U=P.values,G=P.range;return new Promise(function(Z,oe){Z=Qe(Z);var ee=C.objectStore(R),re=ee.keyPath==null,le=$==="put"||$==="add";if(!le&&$!=="delete"&&$!=="deleteRange")throw new Error("Invalid operation type: "+$);var se,pe=(B||U||{length:1}).length;if(B&&U&&B.length!==U.length)throw new Error("Given keys array must have same length as given values array.");if(pe===0)return Z({numFailures:0,failures:{},results:[],lastResult:void 0});function Te(St){++Ot,Pi(St)}var De=[],Ie=[],Ot=0;if($==="deleteRange"){if(G.type===4)return Z({numFailures:Ot,failures:Ie,results:[],lastResult:void 0});G.type===3?De.push(se=ee.clear()):De.push(se=ee.delete(f(G)))}else{var re=le?re?[U,B]:[U,null]:[B,null],xe=re[0],yt=re[1];if(le)for(var bt=0;bt<pe;++bt)De.push(se=yt&&yt[bt]!==void 0?ee[$](xe[bt],yt[bt]):ee[$](xe[bt])),se.onerror=Te;else for(bt=0;bt<pe;++bt)De.push(se=ee[$](xe[bt])),se.onerror=Te}function zr(St){St=St.target.result,De.forEach(function(Ln,Ks){return Ln.error!=null&&(Ie[Ks]=Ln.error)}),Z({numFailures:Ot,failures:Ie,results:$==="delete"?B:De.map(function(Ln){return Ln.result}),lastResult:St})}se.onerror=function(St){Te(St),zr(St)},se.onsuccess=zr})},getMany:function(P){var C=P.trans,$=P.keys;return new Promise(function(B,U){B=Qe(B);for(var G,Z=C.objectStore(R),oe=$.length,ee=new Array(oe),re=0,le=0,se=function(De){De=De.target,ee[De._pos]=De.result,++le===re&&B(ee)},pe=Wt(U),Te=0;Te<oe;++Te)$[Te]!=null&&((G=Z.get($[Te]))._pos=Te,G.onsuccess=se,G.onerror=pe,++re);re===0&&B(ee)})},get:function(P){var C=P.trans,$=P.key;return new Promise(function(B,U){B=Qe(B);var G=C.objectStore(R).get($);G.onsuccess=function(Z){return B(Z.target.result)},G.onerror=Wt(U)})},query:(O=T,function(P){return new Promise(function(C,$){C=Qe(C);var B,U,G,re=P.trans,Z=P.values,oe=P.limit,se=P.query,ee=oe===1/0?void 0:oe,le=se.index,se=se.range,re=re.objectStore(R),le=le.isPrimaryKey?re:re.index(le.name),se=f(se);if(oe===0)return C({result:[]});O?((ee=Z?le.getAll(se,ee):le.getAllKeys(se,ee)).onsuccess=function(pe){return C({result:pe.target.result})},ee.onerror=Wt($)):(B=0,U=!Z&&"openKeyCursor"in le?le.openKeyCursor(se):le.openCursor(se),G=[],U.onsuccess=function(pe){var Te=U.result;return Te?(G.push(Z?Te.value:Te.primaryKey),++B===oe?C({result:G}):void Te.continue()):C({result:G})},U.onerror=Wt($))})}),openCursor:function(P){var C=P.trans,$=P.values,B=P.query,U=P.reverse,G=P.unique;return new Promise(function(Z,oe){Z=Qe(Z);var le=B.index,ee=B.range,re=C.objectStore(R),re=le.isPrimaryKey?re:re.index(le.name),le=U?G?"prevunique":"prev":G?"nextunique":"next",se=!$&&"openKeyCursor"in re?re.openKeyCursor(f(ee),le):re.openCursor(f(ee),le);se.onerror=Wt(oe),se.onsuccess=Qe(function(pe){var Te,De,Ie,Ot,xe=se.result;xe?(xe.___id=++Gh,xe.done=!1,Te=xe.continue.bind(xe),De=(De=xe.continuePrimaryKey)&&De.bind(xe),Ie=xe.advance.bind(xe),Ot=function(){throw new Error("Cursor not stopped")},xe.trans=C,xe.stop=xe.continue=xe.continuePrimaryKey=xe.advance=function(){throw new Error("Cursor not started")},xe.fail=Qe(oe),xe.next=function(){var yt=this,bt=1;return this.start(function(){return bt--?yt.continue():yt.stop()}).then(function(){return yt})},xe.start=function(yt){function bt(){if(se.result)try{yt()}catch(St){xe.fail(St)}else xe.done=!0,xe.start=function(){throw new Error("Cursor behind last entry")},xe.stop()}var zr=new Promise(function(St,Ln){St=Qe(St),se.onerror=Wt(Ln),xe.fail=Ln,xe.stop=function(Ks){xe.stop=xe.continue=xe.continuePrimaryKey=xe.advance=Ot,St(Ks)}});return se.onsuccess=Qe(function(St){se.onsuccess=bt,bt()}),xe.continue=Te,xe.continuePrimaryKey=De,xe.advance=Ie,bt(),zr},Z(xe)):Z(null)},oe)})},count:function(P){var C=P.query,$=P.trans,B=C.index,U=C.range;return new Promise(function(G,Z){var oe=$.objectStore(R),ee=B.isPrimaryKey?oe:oe.index(B.name),oe=f(U),ee=oe?ee.count(oe):ee.count();ee.onsuccess=Qe(function(re){return G(re.target.result)}),ee.onerror=Wt(Z)})}}}var g,b,k,D=(b=A,k=Wu((g=s).objectStoreNames),{schema:{name:g.name,tables:k.map(function(L){return b.objectStore(L)}).map(function(L){var O=L.keyPath,C=L.autoIncrement,R=l(O),P={},C={name:L.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:O==null,compound:R,keyPath:O,autoIncrement:C,unique:!0,extractKey:Os(O)},indexes:Wu(L.indexNames).map(function($){return L.index($)}).map(function(G){var B=G.name,U=G.unique,Z=G.multiEntry,G=G.keyPath,Z={name:B,compound:l(G),keyPath:G,unique:U,multiEntry:Z,extractKey:Os(G)};return P[Mi(G)]=Z}),getIndexByKeyPath:function($){return P[Mi($)]}};return P[":id"]=C.primaryKey,O!=null&&(P[Mi(O)]=C.primaryKey),C})},hasGetAll:0<k.length&&"getAll"in b.objectStore(k[0])&&!(typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),A=D.schema,T=D.hasGetAll,D=A.tables.map(p),S={};return D.forEach(function(L){return S[L.name]=L}),{stack:"dbcore",transaction:s.transaction.bind(s),table:function(L){if(!S[L])throw new Error("Table '".concat(L,"' not found"));return S[L]},MIN_KEY:-1/0,MAX_KEY:$i(u),schema:A}}function Jh(s,u,c,f){var p=c.IDBKeyRange;return c.indexedDB,{dbcore:(f=Wh(u,p,f),s.dbcore.reduce(function(g,b){return b=b.create,i(i({},g),b(g))},f))}}function Ir(s,f){var c=f.db,f=Jh(s._middlewares,c,s._deps,f);s.core=f.dbcore,s.tables.forEach(function(p){var g=p.name;s.core.schema.tables.some(function(b){return b.name===g})&&(p.core=s.core.table(g),s[g]instanceof s.Table&&(s[g].core=p.core))})}function Pr(s,u,c,f){c.forEach(function(p){var g=f[p];u.forEach(function(b){var k=function A(T,D){return E(T,D)||(T=h(T))&&A(T,D)}(b,p);(!k||"value"in k&&k.value===void 0)&&(b===s.Transaction.prototype||b instanceof s.Transaction?_(b,p,{get:function(){return this.table(p)},set:function(A){x(this,p,{value:A,writable:!0,configurable:!0,enumerable:!0})}}):b[p]=new s.Table(p,g))})})}function xs(s,u){u.forEach(function(c){for(var f in c)c[f]instanceof s.Table&&delete c[f]})}function Yh(s,u){return s._cfg.version-u._cfg.version}function Xh(s,u,c,f){var p=s._dbSchema;c.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=As("$meta",Yu("")[0],[]),s._storeNames.push("$meta"));var g=s._createTransaction("readwrite",s._storeNames,p);g.create(c),g._completion.catch(f);var b=g._reject.bind(g),k=be.transless||be;hn(function(){return be.trans=g,be.transless=k,u!==0?(Ir(s,c),T=u,((A=g).storeNames.includes("$meta")?A.table("$meta").get("version").then(function(D){return D!=null?D:T}):ce.resolve(T)).then(function(D){return L=D,O=g,R=c,P=[],D=(S=s)._versions,C=S._dbSchema=$r(0,S.idbdb,R),(D=D.filter(function($){return $._cfg.version>=L})).length!==0?(D.forEach(function($){P.push(function(){var B=C,U=$._cfg.dbschema;Mr(S,B,R),Mr(S,U,R),C=S._dbSchema=U;var G=Ts(B,U);G.add.forEach(function(le){Cs(R,le[0],le[1].primKey,le[1].indexes)}),G.change.forEach(function(le){if(le.recreate)throw new he.Upgrade("Not yet support for changing primary key");var se=R.objectStore(le.name);le.add.forEach(function(pe){return Lr(se,pe)}),le.change.forEach(function(pe){se.deleteIndex(pe.name),Lr(se,pe)}),le.del.forEach(function(pe){return se.deleteIndex(pe)})});var Z=$._cfg.contentUpgrade;if(Z&&$._cfg.version>L){Ir(S,R),O._memoizedTables={};var oe=ye(U);G.del.forEach(function(le){oe[le]=B[le]}),xs(S,[S.Transaction.prototype]),Pr(S,[S.Transaction.prototype],o(oe),oe),O.schema=oe;var ee,re=Oe(Z);return re&&ni(),G=ce.follow(function(){var le;(ee=Z(O))&&re&&(le=pn.bind(null,null),ee.then(le,le))}),ee&&typeof ee.then=="function"?ce.resolve(ee):G.then(function(){return ee})}}),P.push(function(B){var U,G,Z=$._cfg.dbschema;U=Z,G=B,[].slice.call(G.db.objectStoreNames).forEach(function(oe){return U[oe]==null&&G.db.deleteObjectStore(oe)}),xs(S,[S.Transaction.prototype]),Pr(S,[S.Transaction.prototype],S._storeNames,S._dbSchema),O.schema=S._dbSchema}),P.push(function(B){S.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(S.idbdb.version/10)===$._cfg.version?(S.idbdb.deleteObjectStore("$meta"),delete S._dbSchema.$meta,S._storeNames=S._storeNames.filter(function(U){return U!=="$meta"})):B.objectStore("$meta").put($._cfg.version,"version"))})}),function $(){return P.length?ce.resolve(P.shift()(O.idbtrans)).then($):ce.resolve()}().then(function(){Ju(C,R)})):ce.resolve();var S,L,O,R,P,C}).catch(b)):(o(p).forEach(function(D){Cs(c,D,p[D].primKey,p[D].indexes)}),Ir(s,c),void ce.follow(function(){return s.on.populate.fire(g)}).catch(b));var A,T})}function Qh(s,u){Ju(s._dbSchema,u),u.db.version%10!=0||u.objectStoreNames.contains("$meta")||u.db.createObjectStore("$meta").add(Math.ceil(u.db.version/10-1),"version");var c=$r(0,s.idbdb,u);Mr(s,s._dbSchema,u);for(var f=0,p=Ts(c,s._dbSchema).change;f<p.length;f++){var g=function(b){if(b.change.length||b.recreate)return console.warn("Unable to patch indexes of table ".concat(b.name," because it has changes on the type of index or primary key.")),{value:void 0};var k=u.objectStore(b.name);b.add.forEach(function(A){Ee&&console.debug("Dexie upgrade patch: Creating missing index ".concat(b.name,".").concat(A.src)),Lr(k,A)})}(p[f]);if(typeof g=="object")return g.value}}function Ts(s,u){var c,f={del:[],add:[],change:[]};for(c in s)u[c]||f.del.push(c);for(c in u){var p=s[c],g=u[c];if(p){var b={name:c,def:g,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(g.primKey.keyPath||"")||p.primKey.auto!==g.primKey.auto)b.recreate=!0,f.change.push(b);else{var k=p.idxByName,A=g.idxByName,T=void 0;for(T in k)A[T]||b.del.push(T);for(T in A){var D=k[T],S=A[T];D?D.src!==S.src&&b.change.push(S):b.add.push(S)}(0<b.del.length||0<b.add.length||0<b.change.length)&&f.change.push(b)}}else f.add.push([c,g])}return f}function Cs(s,u,c,f){var p=s.db.createObjectStore(u,c.keyPath?{keyPath:c.keyPath,autoIncrement:c.auto}:{autoIncrement:c.auto});return f.forEach(function(g){return Lr(p,g)}),p}function Ju(s,u){o(s).forEach(function(c){u.db.objectStoreNames.contains(c)||(Ee&&console.debug("Dexie: Creating missing table",c),Cs(u,c,s[c].primKey,s[c].indexes))})}function Lr(s,u){s.createIndex(u.name,u.keyPath,{unique:u.unique,multiEntry:u.multi})}function $r(s,u,c){var f={};return V(u.objectStoreNames,0).forEach(function(p){for(var g=c.objectStore(p),b=ws(Gu(T=g.keyPath),T||"",!0,!1,!!g.autoIncrement,T&&typeof T!="string",!0),k=[],A=0;A<g.indexNames.length;++A){var D=g.index(g.indexNames[A]),T=D.keyPath,D=ws(D.name,T,!!D.unique,!!D.multiEntry,!1,T&&typeof T!="string",!1);k.push(D)}f[p]=As(p,b,k)}),f}function Mr(s,u,c){for(var f=c.db.objectStoreNames,p=0;p<f.length;++p){var g=f[p],b=c.objectStore(g);s._hasGetAll="getAll"in b;for(var k=0;k<b.indexNames.length;++k){var A=b.indexNames[k],T=b.index(A).keyPath,D=typeof T=="string"?T:"["+V(T).join("+")+"]";!u[g]||(T=u[g].idxByName[D])&&(T.name=A,delete u[g].idxByName[D],u[g].idxByName[A]=T)}}typeof navigator!="undefined"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(s._hasGetAll=!1)}function Yu(s){return s.split(",").map(function(u,c){var f=(u=u.trim()).replace(/([&*]|\+\+)/g,""),p=/^\[/.test(f)?f.match(/^\[(.*)\]$/)[1].split("+"):f;return ws(f,p||null,/\&/.test(u),/\*/.test(u),/\+\+/.test(u),l(p),c===0)})}var Zh=(jr.prototype._parseStoresSpec=function(s,u){o(s).forEach(function(c){if(s[c]!==null){var f=Yu(s[c]),p=f.shift();if(p.unique=!0,p.multi)throw new he.Schema("Primary key cannot be multi-valued");f.forEach(function(g){if(g.auto)throw new he.Schema("Only primary key can be marked as autoIncrement (++)");if(!g.keyPath)throw new he.Schema("Index must have a name and cannot be an empty string")}),u[c]=As(c,p,f)}})},jr.prototype.stores=function(c){var u=this.db;this._cfg.storesSource=this._cfg.storesSource?d(this._cfg.storesSource,c):c;var c=u._versions,f={},p={};return c.forEach(function(g){d(f,g._cfg.storesSource),p=g._cfg.dbschema={},g._parseStoresSpec(f,p)}),u._dbSchema=p,xs(u,[u._allTables,u,u.Transaction.prototype]),Pr(u,[u._allTables,u,u.Transaction.prototype,this._cfg.tables],o(p),p),u._storeNames=o(p),this},jr.prototype.upgrade=function(s){return this._cfg.contentUpgrade=ie(this._cfg.contentUpgrade||Se,s),this},jr);function jr(){}function Rs(s,u){var c=s._dbNamesDB;return c||(c=s._dbNamesDB=new rn(Tr,{addons:[],indexedDB:s,IDBKeyRange:u})).version(1).stores({dbnames:"name"}),c.table("dbnames")}function Fs(s){return s&&typeof s.databases=="function"}function Ds(s){return hn(function(){return be.letThrough=!0,s()})}function Is(s){return!("from"in s)}var vt=function(s,u){if(!this){var c=new vt;return s&&"d"in s&&d(c,s),c}d(this,arguments.length?{d:1,from:s,to:1<arguments.length?u:s}:{d:0})};function ji(s,u,c){var f=Me(u,c);if(!isNaN(f)){if(0<f)throw RangeError();if(Is(s))return d(s,{from:u,to:c,d:1});var p=s.l,f=s.r;if(Me(c,s.from)<0)return p?ji(p,u,c):s.l={from:u,to:c,d:1,l:null,r:null},Qu(s);if(0<Me(u,s.to))return f?ji(f,u,c):s.r={from:u,to:c,d:1,l:null,r:null},Qu(s);Me(u,s.from)<0&&(s.from=u,s.l=null,s.d=f?f.d+1:1),0<Me(c,s.to)&&(s.to=c,s.r=null,s.d=s.l?s.l.d+1:1),c=!s.r,p&&!s.l&&Bi(s,p),f&&c&&Bi(s,f)}}function Bi(s,u){Is(u)||function c(f,A){var g=A.from,b=A.to,k=A.l,A=A.r;ji(f,g,b),k&&c(f,k),A&&c(f,A)}(s,u)}function Xu(s,u){var c=Br(u),f=c.next();if(f.done)return!1;for(var p=f.value,g=Br(s),b=g.next(p.from),k=b.value;!f.done&&!b.done;){if(Me(k.from,p.to)<=0&&0<=Me(k.to,p.from))return!0;Me(p.from,k.from)<0?p=(f=c.next(k.from)).value:k=(b=g.next(p.from)).value}return!1}function Br(s){var u=Is(s)?null:{s:0,n:s};return{next:function(c){for(var f=0<arguments.length;u;)switch(u.s){case 0:if(u.s=1,f)for(;u.n.l&&Me(c,u.n.from)<0;)u={up:u,n:u.n.l,s:1};else for(;u.n.l;)u={up:u,n:u.n.l,s:1};case 1:if(u.s=2,!f||Me(c,u.n.to)<=0)return{value:u.n,done:!1};case 2:if(u.n.r){u.s=3,u={up:u,n:u.n.r,s:0};continue}case 3:u=u.up}return{done:!0}}}}function Qu(s){var u,c,f=(((u=s.r)===null||u===void 0?void 0:u.d)||0)-(((c=s.l)===null||c===void 0?void 0:c.d)||0),p=1<f?"r":f<-1?"l":"";p&&(u=p=="r"?"l":"r",c=i({},s),f=s[p],s.from=f.from,s.to=f.to,s[p]=f[p],c[p]=f[u],(s[u]=c).d=Zu(c)),s.d=Zu(s)}function Zu(c){var u=c.r,c=c.l;return(u?c?Math.max(u.d,c.d):u.d:c?c.d:0)+1}function Ur(s,u){return o(u).forEach(function(c){s[c]?Bi(s[c],u[c]):s[c]=function f(p){var g,b,k={};for(g in p)y(p,g)&&(b=p[g],k[g]=!b||typeof b!="object"||ke.has(b.constructor)?b:f(b));return k}(u[c])}),s}function Ps(s,u){return s.all||u.all||Object.keys(s).some(function(c){return u[c]&&Xu(u[c],s[c])})}v(vt.prototype,((It={add:function(s){return Bi(this,s),this},addKey:function(s){return ji(this,s,s),this},addKeys:function(s){var u=this;return s.forEach(function(c){return ji(u,c,c)}),this},hasKey:function(s){var u=Br(this).next(s).value;return u&&Me(u.from,s)<=0&&0<=Me(u.to,s)}})[z]=function(){return Br(this)},It));var In={},Ls={},$s=!1;function Vr(s){Ur(Ls,s),$s||($s=!0,setTimeout(function(){$s=!1,Ms(Ls,!(Ls={}))},0))}function Ms(s,u){u===void 0&&(u=!1);var c=new Set;if(s.all)for(var f=0,p=Object.values(In);f<p.length;f++)el(b=p[f],s,c,u);else for(var g in s){var b,k=/^idb\:\/\/(.*)\/(.*)\//.exec(g);k&&(g=k[1],k=k[2],(b=In["idb://".concat(g,"/").concat(k)])&&el(b,s,c,u))}c.forEach(function(A){return A()})}function el(s,u,c,f){for(var p=[],g=0,b=Object.entries(s.queries.query);g<b.length;g++){for(var k=b[g],A=k[0],T=[],D=0,S=k[1];D<S.length;D++){var L=S[D];Ps(u,L.obsSet)?L.subscribers.forEach(function(C){return c.add(C)}):f&&T.push(L)}f&&p.push([A,T])}if(f)for(var O=0,R=p;O<R.length;O++){var P=R[O],A=P[0],T=P[1];s.queries.query[A]=T}}function ep(s){var u=s._state,c=s._deps.indexedDB;if(u.isBeingOpened||s.idbdb)return u.dbReadyPromise.then(function(){return u.dbOpenError?rt(u.dbOpenError):s});u.isBeingOpened=!0,u.dbOpenError=null,u.openComplete=!1;var f=u.openCanceller,p=Math.round(10*s.verno),g=!1;function b(){if(u.openCanceller!==f)throw new he.DatabaseClosed("db.open() was cancelled")}function k(){return new ce(function(L,O){if(b(),!c)throw new he.MissingAPI;var R=s.name,P=u.autoSchema||!p?c.open(R):c.open(R,p);if(!P)throw new he.MissingAPI;P.onerror=Wt(O),P.onblocked=Qe(s._fireOnBlocked),P.onupgradeneeded=Qe(function(C){var $;D=P.transaction,u.autoSchema&&!s._options.allowEmptyDB?(P.onerror=Pi,D.abort(),P.result.close(),($=c.deleteDatabase(R)).onsuccess=$.onerror=Qe(function(){O(new he.NoSuchDatabase("Database ".concat(R," doesnt exist")))})):(D.onerror=Wt(O),C=C.oldVersion>Math.pow(2,62)?0:C.oldVersion,S=C<1,s.idbdb=P.result,g&&Qh(s,D),Xh(s,C/10,D,O))},O),P.onsuccess=Qe(function(){D=null;var C,$,B,U,G,Z=s.idbdb=P.result,oe=V(Z.objectStoreNames);if(0<oe.length)try{var ee=Z.transaction((U=oe).length===1?U[0]:U,"readonly");if(u.autoSchema)$=Z,B=ee,(C=s).verno=$.version/10,B=C._dbSchema=$r(0,$,B),C._storeNames=V($.objectStoreNames,0),Pr(C,[C._allTables],o(B),B);else if(Mr(s,s._dbSchema,ee),((G=Ts($r(0,(G=s).idbdb,ee),G._dbSchema)).add.length||G.change.some(function(re){return re.add.length||re.change.length}))&&!g)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),Z.close(),p=Z.version+1,g=!0,L(k());Ir(s,ee)}catch{}ii.push(s),Z.onversionchange=Qe(function(re){u.vcFired=!0,s.on("versionchange").fire(re)}),Z.onclose=Qe(function(re){s.on("close").fire(re)}),S&&(G=s._deps,ee=R,Z=G.indexedDB,G=G.IDBKeyRange,Fs(Z)||ee===Tr||Rs(Z,G).put({name:ee}).catch(Se)),L()},O)}).catch(function(L){switch(L==null?void 0:L.name){case"UnknownError":if(0<u.PR1398_maxLoop)return u.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),k();break;case"VersionError":if(0<p)return p=0,k()}return ce.reject(L)})}var A,T=u.dbReadyResolve,D=null,S=!1;return ce.race([f,(typeof navigator=="undefined"?ce.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(L){function O(){return indexedDB.databases().finally(L)}A=setInterval(O,100),O()}).finally(function(){return clearInterval(A)}):Promise.resolve()).then(k)]).then(function(){return b(),u.onReadyBeingFired=[],ce.resolve(Ds(function(){return s.on.ready.fire(s.vip)})).then(function L(){if(0<u.onReadyBeingFired.length){var O=u.onReadyBeingFired.reduce(ie,Se);return u.onReadyBeingFired=[],ce.resolve(Ds(function(){return O(s.vip)})).then(L)}})}).finally(function(){u.openCanceller===f&&(u.onReadyBeingFired=null,u.isBeingOpened=!1)}).catch(function(L){u.dbOpenError=L;try{D&&D.abort()}catch{}return f===u.openCanceller&&s._close(),rt(L)}).finally(function(){u.openComplete=!0,T()}).then(function(){var L;return S&&(L={},s.tables.forEach(function(O){O.schema.indexes.forEach(function(R){R.name&&(L["idb://".concat(s.name,"/").concat(O.name,"/").concat(R.name)]=new vt(-1/0,[[[]]]))}),L["idb://".concat(s.name,"/").concat(O.name,"/")]=L["idb://".concat(s.name,"/").concat(O.name,"/:dels")]=new vt(-1/0,[[[]]])}),vn(Li).fire(L),Ms(L,!0)),s})}function js(s){function u(g){return s.next(g)}var c=p(u),f=p(function(g){return s.throw(g)});function p(g){return function(A){var k=g(A),A=k.value;return k.done?A:A&&typeof A.then=="function"?A.then(c,f):l(A)?Promise.all(A).then(c,f):c(A)}}return p(u)()}function qr(s,u,c){for(var f=l(s)?s.slice():[s],p=0;p<c;++p)f.push(u);return f}var tp={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(s){return i(i({},s),{table:function(u){var c=s.table(u),f=c.schema,p={},g=[];function b(S,L,O){var R=Mi(S),P=p[R]=p[R]||[],C=S==null?0:typeof S=="string"?1:S.length,$=0<L,$=i(i({},O),{name:$?"".concat(R,"(virtual-from:").concat(O.name,")"):O.name,lowLevelIndex:O,isVirtual:$,keyTail:L,keyLength:C,extractKey:Os(S),unique:!$&&O.unique});return P.push($),$.isPrimaryKey||g.push($),1<C&&b(C===2?S[0]:S.slice(0,C-1),L+1,O),P.sort(function(B,U){return B.keyTail-U.keyTail}),$}u=b(f.primaryKey.keyPath,0,f.primaryKey),p[":id"]=[u];for(var k=0,A=f.indexes;k<A.length;k++){var T=A[k];b(T.keyPath,0,T)}function D(S){var L,O=S.query.index;return O.isVirtual?i(i({},S),{query:{index:O.lowLevelIndex,range:(L=S.query.range,O=O.keyTail,{type:L.type===1?2:L.type,lower:qr(L.lower,L.lowerOpen?s.MAX_KEY:s.MIN_KEY,O),lowerOpen:!0,upper:qr(L.upper,L.upperOpen?s.MIN_KEY:s.MAX_KEY,O),upperOpen:!0})}}):S}return i(i({},c),{schema:i(i({},f),{primaryKey:u,indexes:g,getIndexByKeyPath:function(S){return(S=p[Mi(S)])&&S[0]}}),count:function(S){return c.count(D(S))},query:function(S){return c.query(D(S))},openCursor:function(S){var L=S.query.index,O=L.keyTail,R=L.isVirtual,P=L.keyLength;return R?c.openCursor(D(S)).then(function($){return $&&C($)}):c.openCursor(S);function C($){return Object.create($,{continue:{value:function(B){B!=null?$.continue(qr(B,S.reverse?s.MAX_KEY:s.MIN_KEY,O)):S.unique?$.continue($.key.slice(0,P).concat(S.reverse?s.MIN_KEY:s.MAX_KEY,O)):$.continue()}},continuePrimaryKey:{value:function(B,U){$.continuePrimaryKey(qr(B,s.MAX_KEY,O),U)}},primaryKey:{get:function(){return $.primaryKey}},key:{get:function(){var B=$.key;return P===1?B[0]:B.slice(0,P)}},value:{get:function(){return $.value}}})}}})}})}};function Bs(s,u,c,f){return c=c||{},f=f||"",o(s).forEach(function(p){var g,b,k;y(u,p)?(g=s[p],b=u[p],typeof g=="object"&&typeof b=="object"&&g&&b?(k=w(g))!==w(b)?c[f+p]=u[p]:k==="Object"?Bs(g,b,c,f+p+"."):g!==b&&(c[f+p]=u[p]):g!==b&&(c[f+p]=u[p])):c[f+p]=void 0}),o(u).forEach(function(p){y(s,p)||(c[f+p]=u[p])}),c}function Us(s,u){return u.type==="delete"?u.keys:u.keys||u.values.map(s.extractKey)}var np={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(s){return i(i({},s),{table:function(u){var c=s.table(u),f=c.schema.primaryKey;return i(i({},c),{mutate:function(p){var g=be.trans,b=g.table(u).hook,k=b.deleting,A=b.creating,T=b.updating;switch(p.type){case"add":if(A.fire===Se)break;return g._promise("readwrite",function(){return D(p)},!0);case"put":if(A.fire===Se&&T.fire===Se)break;return g._promise("readwrite",function(){return D(p)},!0);case"delete":if(k.fire===Se)break;return g._promise("readwrite",function(){return D(p)},!0);case"deleteRange":if(k.fire===Se)break;return g._promise("readwrite",function(){return function S(L,O,R){return c.query({trans:L,values:!1,query:{index:f,range:O},limit:R}).then(function(P){var C=P.result;return D({type:"delete",keys:C,trans:L}).then(function($){return 0<$.numFailures?Promise.reject($.failures[0]):C.length<R?{failures:[],numFailures:0,lastResult:void 0}:S(L,i(i({},O),{lower:C[C.length-1],lowerOpen:!0}),R)})})}(p.trans,p.range,1e4)},!0)}return c.mutate(p);function D(S){var L,O,R,P=be.trans,C=S.keys||Us(f,S);if(!C)throw new Error("Keys missing");return(S=S.type==="add"||S.type==="put"?i(i({},S),{keys:C}):i({},S)).type!=="delete"&&(S.values=r([],S.values)),S.keys&&(S.keys=r([],S.keys)),L=c,R=C,((O=S).type==="add"?Promise.resolve([]):L.getMany({trans:O.trans,keys:R,cache:"immutable"})).then(function($){var B=C.map(function(U,G){var Z,oe,ee,re=$[G],le={onerror:null,onsuccess:null};return S.type==="delete"?k.fire.call(le,U,re,P):S.type==="add"||re===void 0?(Z=A.fire.call(le,U,S.values[G],P),U==null&&Z!=null&&(S.keys[G]=U=Z,f.outbound||ne(S.values[G],f.keyPath,U))):(Z=Bs(re,S.values[G]),(oe=T.fire.call(le,Z,U,re,P))&&(ee=S.values[G],Object.keys(oe).forEach(function(se){y(ee,se)?ee[se]=oe[se]:ne(ee,se,oe[se])}))),le});return c.mutate(S).then(function(U){for(var G=U.failures,Z=U.results,oe=U.numFailures,U=U.lastResult,ee=0;ee<C.length;++ee){var re=(Z||C)[ee],le=B[ee];re==null?le.onerror&&le.onerror(G[ee]):le.onsuccess&&le.onsuccess(S.type==="put"&&$[ee]?S.values[ee]:re)}return{failures:G,results:Z,numFailures:oe,lastResult:U}}).catch(function(U){return B.forEach(function(G){return G.onerror&&G.onerror(U)}),Promise.reject(U)})})}}})}})}};function tl(s,u,c){try{if(!u||u.keys.length<s.length)return null;for(var f=[],p=0,g=0;p<u.keys.length&&g<s.length;++p)Me(u.keys[p],s[g])===0&&(f.push(c?Le(u.values[p]):u.values[p]),++g);return f.length===s.length?f:null}catch{return null}}var ip={stack:"dbcore",level:-1,create:function(s){return{table:function(u){var c=s.table(u);return i(i({},c),{getMany:function(f){if(!f.cache)return c.getMany(f);var p=tl(f.keys,f.trans._cache,f.cache==="clone");return p?ce.resolve(p):c.getMany(f).then(function(g){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?Le(g):g},g})},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),c.mutate(f)}})}}}};function nl(s,u){return s.trans.mode==="readonly"&&!!s.subscr&&!s.trans.explicit&&s.trans.db._options.cache!=="disabled"&&!u.schema.primaryKey.outbound}function il(s,u){switch(s){case"query":return u.values&&!u.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var rp={stack:"dbcore",level:0,name:"Observability",create:function(s){var u=s.schema.name,c=new vt(s.MIN_KEY,s.MAX_KEY);return i(i({},s),{transaction:function(f,p,g){if(be.subscr&&p!=="readonly")throw new he.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(be.querier));return s.transaction(f,p,g)},table:function(f){var p=s.table(f),g=p.schema,b=g.primaryKey,S=g.indexes,k=b.extractKey,A=b.outbound,T=b.autoIncrement&&S.filter(function(O){return O.compound&&O.keyPath.includes(b.keyPath)}),D=i(i({},p),{mutate:function(O){function R(se){return se="idb://".concat(u,"/").concat(f,"/").concat(se),U[se]||(U[se]=new vt)}var P,C,$,B=O.trans,U=O.mutatedParts||(O.mutatedParts={}),G=R(""),Z=R(":dels"),oe=O.type,le=O.type==="deleteRange"?[O.range]:O.type==="delete"?[O.keys]:O.values.length<50?[Us(b,O).filter(function(se){return se}),O.values]:[],ee=le[0],re=le[1],le=O.trans._cache;return l(ee)?(G.addKeys(ee),(le=oe==="delete"||ee.length===re.length?tl(ee,le):null)||Z.addKeys(ee),(le||re)&&(P=R,C=le,$=re,g.indexes.forEach(function(se){var pe=P(se.name||"");function Te(Ie){return Ie!=null?se.extractKey(Ie):null}function De(Ie){return se.multiEntry&&l(Ie)?Ie.forEach(function(Ot){return pe.addKey(Ot)}):pe.addKey(Ie)}(C||$).forEach(function(Ie,yt){var xe=C&&Te(C[yt]),yt=$&&Te($[yt]);Me(xe,yt)!==0&&(xe!=null&&De(xe),yt!=null&&De(yt))})}))):ee?(re={from:(re=ee.lower)!==null&&re!==void 0?re:s.MIN_KEY,to:(re=ee.upper)!==null&&re!==void 0?re:s.MAX_KEY},Z.add(re),G.add(re)):(G.add(c),Z.add(c),g.indexes.forEach(function(se){return R(se.name).add(c)})),p.mutate(O).then(function(se){return!ee||O.type!=="add"&&O.type!=="put"||(G.addKeys(se.results),T&&T.forEach(function(pe){for(var Te=O.values.map(function(xe){return pe.extractKey(xe)}),De=pe.keyPath.findIndex(function(xe){return xe===b.keyPath}),Ie=0,Ot=se.results.length;Ie<Ot;++Ie)Te[Ie][De]=se.results[Ie];R(pe.name).addKeys(Te)})),B.mutatedParts=Ur(B.mutatedParts||{},U),se})}}),S=function(R){var P=R.query,R=P.index,P=P.range;return[R,new vt((R=P.lower)!==null&&R!==void 0?R:s.MIN_KEY,(P=P.upper)!==null&&P!==void 0?P:s.MAX_KEY)]},L={get:function(O){return[b,new vt(O.key)]},getMany:function(O){return[b,new vt().addKeys(O.keys)]},count:S,query:S,openCursor:S};return o(L).forEach(function(O){D[O]=function(R){var P=be.subscr,C=!!P,$=nl(be,p)&&il(O,R)?R.obsSet={}:P;if(C){var B=function(re){return re="idb://".concat(u,"/").concat(f,"/").concat(re),$[re]||($[re]=new vt)},U=B(""),G=B(":dels"),P=L[O](R),C=P[0],P=P[1];if((O==="query"&&C.isPrimaryKey&&!R.values?G:B(C.name||"")).add(P),!C.isPrimaryKey){if(O!=="count"){var Z=O==="query"&&A&&R.values&&p.query(i(i({},R),{values:!1}));return p[O].apply(this,arguments).then(function(re){if(O==="query"){if(A&&R.values)return Z.then(function(Te){return Te=Te.result,U.addKeys(Te),re});var le=R.values?re.result.map(k):re.result;(R.values?U:G).addKeys(le)}else if(O==="openCursor"){var se=re,pe=R.values;return se&&Object.create(se,{key:{get:function(){return G.addKey(se.primaryKey),se.key}},primaryKey:{get:function(){var Te=se.primaryKey;return G.addKey(Te),Te}},value:{get:function(){return pe&&U.addKey(se.primaryKey),se.value}}})}return re})}G.add(c)}}return p[O].apply(this,arguments)}}),D}})}};function rl(s,u,c){if(c.numFailures===0)return u;if(u.type==="deleteRange")return null;var f=u.keys?u.keys.length:"values"in u&&u.values?u.values.length:1;return c.numFailures===f?null:(u=i({},u),l(u.keys)&&(u.keys=u.keys.filter(function(p,g){return!(g in c.failures)})),"values"in u&&l(u.values)&&(u.values=u.values.filter(function(p,g){return!(g in c.failures)})),u)}function Vs(s,u){return c=s,((f=u).lower===void 0||(f.lowerOpen?0<Me(c,f.lower):0<=Me(c,f.lower)))&&(s=s,(u=u).upper===void 0||(u.upperOpen?Me(s,u.upper)<0:Me(s,u.upper)<=0));var c,f}function al(s,u,L,f,p,g){if(!L||L.length===0)return s;var b=u.query.index,k=b.multiEntry,A=u.query.range,T=f.schema.primaryKey.extractKey,D=b.extractKey,S=(b.lowLevelIndex||b).extractKey,L=L.reduce(function(O,R){var P=O,C=[];if(R.type==="add"||R.type==="put")for(var $=new vt,B=R.values.length-1;0<=B;--B){var U,G=R.values[B],Z=T(G);$.hasKey(Z)||(U=D(G),(k&&l(U)?U.some(function(se){return Vs(se,A)}):Vs(U,A))&&($.addKey(Z),C.push(G)))}switch(R.type){case"add":var oe=new vt().addKeys(u.values?O.map(function(pe){return T(pe)}):O),P=O.concat(u.values?C.filter(function(pe){return pe=T(pe),!oe.hasKey(pe)&&(oe.addKey(pe),!0)}):C.map(function(pe){return T(pe)}).filter(function(pe){return!oe.hasKey(pe)&&(oe.addKey(pe),!0)}));break;case"put":var ee=new vt().addKeys(R.values.map(function(pe){return T(pe)}));P=O.filter(function(pe){return!ee.hasKey(u.values?T(pe):pe)}).concat(u.values?C:C.map(function(pe){return T(pe)}));break;case"delete":var re=new vt().addKeys(R.keys);P=O.filter(function(pe){return!re.hasKey(u.values?T(pe):pe)});break;case"deleteRange":var le=R.range;P=O.filter(function(pe){return!Vs(T(pe),le)})}return P},s);return L===s?s:(L.sort(function(O,R){return Me(S(O),S(R))||Me(T(O),T(R))}),u.limit&&u.limit<1/0&&(L.length>u.limit?L.length=u.limit:s.length===u.limit&&L.length<u.limit&&(p.dirty=!0)),g?Object.freeze(L):L)}function sl(s,u){return Me(s.lower,u.lower)===0&&Me(s.upper,u.upper)===0&&!!s.lowerOpen==!!u.lowerOpen&&!!s.upperOpen==!!u.upperOpen}function ap(s,u){return function(c,f,p,g){if(c===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((f=Me(c,f))===0){if(p&&g)return 0;if(p)return 1;if(g)return-1}return f}(s.lower,u.lower,s.lowerOpen,u.lowerOpen)<=0&&0<=function(c,f,p,g){if(c===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((f=Me(c,f))===0){if(p&&g)return 0;if(p)return-1;if(g)return 1}return f}(s.upper,u.upper,s.upperOpen,u.upperOpen)}function sp(s,u,c,f){s.subscribers.add(c),f.addEventListener("abort",function(){var p,g;s.subscribers.delete(c),s.subscribers.size===0&&(p=s,g=u,setTimeout(function(){p.subscribers.size===0&&ae(g,p)},3e3))})}var op={stack:"dbcore",level:0,name:"Cache",create:function(s){var u=s.schema.name;return i(i({},s),{transaction:function(c,f,p){var g,b,k=s.transaction(c,f,p);return f==="readwrite"&&(b=(g=new AbortController).signal,p=function(A){return function(){if(g.abort(),f==="readwrite"){for(var T=new Set,D=0,S=c;D<S.length;D++){var L=S[D],O=In["idb://".concat(u,"/").concat(L)];if(O){var R=s.table(L),P=O.optimisticOps.filter(function(pe){return pe.trans===k});if(k._explicit&&A&&k.mutatedParts)for(var C=0,$=Object.values(O.queries.query);C<$.length;C++)for(var B=0,U=(oe=$[C]).slice();B<U.length;B++)Ps((ee=U[B]).obsSet,k.mutatedParts)&&(ae(oe,ee),ee.subscribers.forEach(function(pe){return T.add(pe)}));else if(0<P.length){O.optimisticOps=O.optimisticOps.filter(function(pe){return pe.trans!==k});for(var G=0,Z=Object.values(O.queries.query);G<Z.length;G++)for(var oe,ee,re,le=0,se=(oe=Z[G]).slice();le<se.length;le++)(ee=se[le]).res!=null&&k.mutatedParts&&(A&&!ee.dirty?(re=Object.isFrozen(ee.res),re=al(ee.res,ee.req,P,R,ee,re),ee.dirty?(ae(oe,ee),ee.subscribers.forEach(function(pe){return T.add(pe)})):re!==ee.res&&(ee.res=re,ee.promise=ce.resolve({result:re}))):(ee.dirty&&ae(oe,ee),ee.subscribers.forEach(function(pe){return T.add(pe)})))}}}T.forEach(function(pe){return pe()})}}},k.addEventListener("abort",p(!1),{signal:b}),k.addEventListener("error",p(!1),{signal:b}),k.addEventListener("complete",p(!0),{signal:b})),k},table:function(c){var f=s.table(c),p=f.schema.primaryKey;return i(i({},f),{mutate:function(g){var b=be.trans;if(p.outbound||b.db._options.cache==="disabled"||b.explicit||b.idbtrans.mode!=="readwrite")return f.mutate(g);var k=In["idb://".concat(u,"/").concat(c)];return k?(b=f.mutate(g),g.type!=="add"&&g.type!=="put"||!(50<=g.values.length||Us(p,g).some(function(A){return A==null}))?(k.optimisticOps.push(g),g.mutatedParts&&Vr(g.mutatedParts),b.then(function(A){0<A.numFailures&&(ae(k.optimisticOps,g),(A=rl(0,g,A))&&k.optimisticOps.push(A),g.mutatedParts&&Vr(g.mutatedParts))}),b.catch(function(){ae(k.optimisticOps,g),g.mutatedParts&&Vr(g.mutatedParts)})):b.then(function(A){var T=rl(0,i(i({},g),{values:g.values.map(function(D,S){var L;return A.failures[S]?D:(D=(L=p.keyPath)!==null&&L!==void 0&&L.includes(".")?Le(D):i({},D),ne(D,p.keyPath,A.results[S]),D)})}),A);k.optimisticOps.push(T),queueMicrotask(function(){return g.mutatedParts&&Vr(g.mutatedParts)})}),b):f.mutate(g)},query:function(g){if(!nl(be,f)||!il("query",g))return f.query(g);var b=((T=be.trans)===null||T===void 0?void 0:T.db._options.cache)==="immutable",S=be,k=S.requery,A=S.signal,T=function(R,P,C,$){var B=In["idb://".concat(R,"/").concat(P)];if(!B)return[];if(!(P=B.queries[C]))return[null,!1,B,null];var U=P[($.query?$.query.index.name:null)||""];if(!U)return[null,!1,B,null];switch(C){case"query":var G=U.find(function(Z){return Z.req.limit===$.limit&&Z.req.values===$.values&&sl(Z.req.query.range,$.query.range)});return G?[G,!0,B,U]:[U.find(function(Z){return("limit"in Z.req?Z.req.limit:1/0)>=$.limit&&(!$.values||Z.req.values)&&ap(Z.req.query.range,$.query.range)}),!1,B,U];case"count":return G=U.find(function(Z){return sl(Z.req.query.range,$.query.range)}),[G,!!G,B,U]}}(u,c,"query",g),D=T[0],S=T[1],L=T[2],O=T[3];return D&&S?D.obsSet=g.obsSet:(S=f.query(g).then(function(R){var P=R.result;if(D&&(D.res=P),b){for(var C=0,$=P.length;C<$;++C)Object.freeze(P[C]);Object.freeze(P)}else R.result=Le(P);return R}).catch(function(R){return O&&D&&ae(O,D),Promise.reject(R)}),D={obsSet:g.obsSet,promise:S,subscribers:new Set,type:"query",req:g,dirty:!1},O?O.push(D):(O=[D],(L=L||(In["idb://".concat(u,"/").concat(c)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[g.query.index.name||""]=O)),sp(D,O,k,A),D.promise.then(function(R){return{result:al(R.result,g,L==null?void 0:L.optimisticOps,f,D,b)}})}})}})}};function Hr(s,u){return new Proxy(s,{get:function(c,f,p){return f==="db"?u:Reflect.get(c,f,p)}})}var rn=(at.prototype.version=function(s){if(isNaN(s)||s<.1)throw new he.Type("Given version is not a positive number");if(s=Math.round(10*s)/10,this.idbdb||this._state.isBeingOpened)throw new he.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,s);var u=this._versions,c=u.filter(function(f){return f._cfg.version===s})[0];return c||(c=new this.Version(s),u.push(c),u.sort(Yh),c.stores({}),this._state.autoSchema=!1,c)},at.prototype._whenReady=function(s){var u=this;return this.idbdb&&(this._state.openComplete||be.letThrough||this._vip)?s():new ce(function(c,f){if(u._state.openComplete)return f(new he.DatabaseClosed(u._state.dbOpenError));if(!u._state.isBeingOpened){if(!u._state.autoOpen)return void f(new he.DatabaseClosed);u.open().catch(Se)}u._state.dbReadyPromise.then(c,f)}).then(s)},at.prototype.use=function(s){var u=s.stack,c=s.create,f=s.level,p=s.name;return p&&this.unuse({stack:u,name:p}),s=this._middlewares[u]||(this._middlewares[u]=[]),s.push({stack:u,create:c,level:f==null?10:f,name:p}),s.sort(function(g,b){return g.level-b.level}),this},at.prototype.unuse=function(s){var u=s.stack,c=s.name,f=s.create;return u&&this._middlewares[u]&&(this._middlewares[u]=this._middlewares[u].filter(function(p){return f?p.create!==f:!!c&&p.name!==c})),this},at.prototype.open=function(){var s=this;return Rn(fn,function(){return ep(s)})},at.prototype._close=function(){var s=this._state,u=ii.indexOf(this);if(0<=u&&ii.splice(u,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}s.isBeingOpened||(s.dbReadyPromise=new ce(function(c){s.dbReadyResolve=c}),s.openCanceller=new ce(function(c,f){s.cancelOpen=f}))},at.prototype.close=function(c){var u=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,c=this._state;u?(c.isBeingOpened&&c.cancelOpen(new he.DatabaseClosed),this._close(),c.autoOpen=!1,c.dbOpenError=new he.DatabaseClosed):(this._close(),c.autoOpen=this._options.autoOpen||c.isBeingOpened,c.openComplete=!1,c.dbOpenError=null)},at.prototype.delete=function(s){var u=this;s===void 0&&(s={disableAutoOpen:!0});var c=0<arguments.length&&typeof arguments[0]!="object",f=this._state;return new ce(function(p,g){function b(){u.close(s);var k=u._deps.indexedDB.deleteDatabase(u.name);k.onsuccess=Qe(function(){var A,T,D;A=u._deps,T=u.name,D=A.indexedDB,A=A.IDBKeyRange,Fs(D)||T===Tr||Rs(D,A).delete(T).catch(Se),p()}),k.onerror=Wt(g),k.onblocked=u._fireOnBlocked}if(c)throw new he.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(b):b()})},at.prototype.backendDB=function(){return this.idbdb},at.prototype.isOpen=function(){return this.idbdb!==null},at.prototype.hasBeenClosed=function(){var s=this._state.dbOpenError;return s&&s.name==="DatabaseClosed"},at.prototype.hasFailed=function(){return this._state.dbOpenError!==null},at.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(at.prototype,"tables",{get:function(){var s=this;return o(this._allTables).map(function(u){return s._allTables[u]})},enumerable:!1,configurable:!0}),at.prototype.transaction=function(){var s=function(u,c,f){var p=arguments.length;if(p<2)throw new he.InvalidArgument("Too few arguments");for(var g=new Array(p-1);--p;)g[p-1]=arguments[p];return f=g.pop(),[u,je(g),f]}.apply(this,arguments);return this._transaction.apply(this,s)},at.prototype._transaction=function(s,u,c){var f=this,p=be.trans;p&&p.db===this&&s.indexOf("!")===-1||(p=null);var g,b,k=s.indexOf("?")!==-1;s=s.replace("!","").replace("?","");try{if(b=u.map(function(T){if(T=T instanceof f.Table?T.name:T,typeof T!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return T}),s=="r"||s===bs)g=bs;else{if(s!="rw"&&s!=ks)throw new he.InvalidArgument("Invalid transaction mode: "+s);g=ks}if(p){if(p.mode===bs&&g===ks){if(!k)throw new he.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");p=null}p&&b.forEach(function(T){if(p&&p.storeNames.indexOf(T)===-1){if(!k)throw new he.SubTransaction("Table "+T+" not included in parent transaction.");p=null}}),k&&p&&!p.active&&(p=null)}}catch(T){return p?p._promise(null,function(D,S){S(T)}):rt(T)}var A=function T(D,S,L,O,R){return ce.resolve().then(function(){var P=be.transless||be,C=D._createTransaction(S,L,D._dbSchema,O);if(C.explicit=!0,P={trans:C,transless:P},O)C.idbtrans=O.idbtrans;else try{C.create(),C.idbtrans._explicit=!0,D._state.PR1398_maxLoop=3}catch(U){return U.name===ge.InvalidState&&D.isOpen()&&0<--D._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),D.close({disableAutoOpen:!1}),D.open().then(function(){return T(D,S,L,null,R)})):rt(U)}var $,B=Oe(R);return B&&ni(),P=ce.follow(function(){var U;($=R.call(C,C))&&(B?(U=pn.bind(null,null),$.then(U,U)):typeof $.next=="function"&&typeof $.throw=="function"&&($=js($)))},P),($&&typeof $.then=="function"?ce.resolve($).then(function(U){return C.active?U:rt(new he.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):P.then(function(){return $})).then(function(U){return O&&C._resolve(),C._completion.then(function(){return U})}).catch(function(U){return C._reject(U),rt(U)})})}.bind(null,this,g,b,p,c);return p?p._promise(g,A,"lock"):be.trans?Rn(be.transless,function(){return f._whenReady(A)}):this._whenReady(A)},at.prototype.table=function(s){if(!y(this._allTables,s))throw new he.InvalidTable("Table ".concat(s," does not exist"));return this._allTables[s]},at);function at(s,u){var c=this;this._middlewares={},this.verno=0;var f=at.dependencies;this._options=u=i({addons:at.addons,autoOpen:!0,indexedDB:f.indexedDB,IDBKeyRange:f.IDBKeyRange,cache:"cloned"},u),this._deps={indexedDB:u.indexedDB,IDBKeyRange:u.IDBKeyRange},f=u.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var p,g,b,k,A,T={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Se,dbReadyPromise:null,cancelOpen:Se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:u.autoOpen};T.dbReadyPromise=new ce(function(S){T.dbReadyResolve=S}),T.openCanceller=new ce(function(S,L){T.cancelOpen=L}),this._state=T,this.name=s,this.on=Fi(this,"populate","blocked","versionchange","close",{ready:[ie,Se]}),this.on.ready.subscribe=J(this.on.ready.subscribe,function(S){return function(L,O){at.vip(function(){var R,P=c._state;P.openComplete?(P.dbOpenError||ce.resolve().then(L),O&&S(L)):P.onReadyBeingFired?(P.onReadyBeingFired.push(L),O&&S(L)):(S(L),R=c,O||S(function C(){R.on.ready.unsubscribe(L),R.on.ready.unsubscribe(C)}))})}}),this.Collection=(p=this,Di(qh.prototype,function($,C){this.db=p;var O=$u,R=null;if(C)try{O=C()}catch(B){R=B}var P=$._ctx,C=P.table,$=C.hook.reading.fire;this._ctx={table:C,index:P.index,isPrimKey:!P.index||C.schema.primKey.keyPath&&P.index===C.schema.primKey.name,range:O,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:R,or:P.or,valueMapper:$!==pt?$:null}})),this.Table=(g=this,Di(Uu.prototype,function(S,L,O){this.db=g,this._tx=O,this.name=S,this.schema=L,this.hook=g._allTables[S]?g._allTables[S].hook:Fi(null,{creating:[ut,Se],reading:[nt,pt],updating:[ue,Se],deleting:[Xe,Se]})})),this.Transaction=(b=this,Di(zh.prototype,function(S,L,O,R,P){var C=this;this.db=b,this.mode=S,this.storeNames=L,this.schema=O,this.chromeTransactionDurability=R,this.idbtrans=null,this.on=Fi(this,"complete","error","abort"),this.parent=P||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ce(function($,B){C._resolve=$,C._reject=B}),this._completion.then(function(){C.active=!1,C.on.complete.fire()},function($){var B=C.active;return C.active=!1,C.on.error.fire($),C.parent?C.parent._reject($):B&&C.idbtrans&&C.idbtrans.abort(),rt($)})})),this.Version=(k=this,Di(Zh.prototype,function(S){this.db=k,this._cfg={version:S,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(A=this,Di(zu.prototype,function(S,L,O){if(this.db=A,this._ctx={table:S,index:L===":id"?null:L,or:O},this._cmp=this._ascending=Me,this._descending=function(R,P){return Me(P,R)},this._max=function(R,P){return 0<Me(R,P)?R:P},this._min=function(R,P){return Me(R,P)<0?R:P},this._IDBKeyRange=A._deps.IDBKeyRange,!this._IDBKeyRange)throw new he.MissingAPI})),this.on("versionchange",function(S){0<S.newVersion?console.warn("Another connection wants to upgrade database '".concat(c.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(c.name,"'. Closing db now to resume the delete request.")),c.close({disableAutoOpen:!1})}),this.on("blocked",function(S){!S.newVersion||S.newVersion<S.oldVersion?console.warn("Dexie.delete('".concat(c.name,"') was blocked")):console.warn("Upgrade '".concat(c.name,"' blocked by other connection holding version ").concat(S.oldVersion/10))}),this._maxKey=$i(u.IDBKeyRange),this._createTransaction=function(S,L,O,R){return new c.Transaction(S,L,O,c._options.chromeTransactionDurability,R)},this._fireOnBlocked=function(S){c.on("blocked").fire(S),ii.filter(function(L){return L.name===c.name&&L!==c&&!L._state.vcFired}).map(function(L){return L.on("versionchange").fire(S)})},this.use(ip),this.use(op),this.use(rp),this.use(tp),this.use(np);var D=new Proxy(this,{get:function(S,L,O){if(L==="_vip")return!0;if(L==="table")return function(P){return Hr(c.table(P),D)};var R=Reflect.get(S,L,O);return R instanceof Uu?Hr(R,D):L==="tables"?R.map(function(P){return Hr(P,D)}):L==="_createTransaction"?function(){return Hr(R.apply(this,arguments),D)}:R}});this.vip=D,f.forEach(function(S){return S(c)})}var Kr,It=typeof Symbol!="undefined"&&"observable"in Symbol?Symbol.observable:"@@observable",up=(qs.prototype.subscribe=function(s,u,c){return this._subscribe(s&&typeof s!="function"?s:{next:s,error:u,complete:c})},qs.prototype[It]=function(){return this},qs);function qs(s){this._subscribe=s}try{Kr={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{Kr={indexedDB:null,IDBKeyRange:null}}function ol(s){var u,c=!1,f=new up(function(p){var g=Oe(s),b,k=!1,A={},T={},D={get closed(){return k},unsubscribe:function(){k||(k=!0,b&&b.abort(),S&&vn.storagemutated.unsubscribe(O))}};p.start&&p.start(D);var S=!1,L=function(){return ys(R)},O=function(P){Ur(A,P),Ps(T,A)&&L()},R=function(){var P,C,$;!k&&Kr.indexedDB&&(A={},P={},b&&b.abort(),b=new AbortController,$=function(B){var U=ei();try{g&&ni();var G=hn(s,B);return G=g?G.finally(pn):G}finally{U&&ti()}}(C={subscr:P,signal:b.signal,requery:L,querier:s,trans:null}),Promise.resolve($).then(function(B){c=!0,u=B,k||C.signal.aborted||(A={},function(U){for(var G in U)if(y(U,G))return;return 1}(T=P)||S||(vn(Li,O),S=!0),ys(function(){return!k&&p.next&&p.next(B)}))},function(B){c=!1,["DatabaseClosedError","AbortError"].includes(B==null?void 0:B.name)||k||ys(function(){k||p.error&&p.error(B)})}))};return setTimeout(L,0),D});return f.hasValue=function(){return c},f.getValue=function(){return u},f}var Pn=rn;function Hs(s){var u=yn;try{yn=!0,vn.storagemutated.fire(s),Ms(s,!0)}finally{yn=u}}v(Pn,i(i({},qe),{delete:function(s){return new Pn(s,{addons:[]}).delete()},exists:function(s){return new Pn(s,{addons:[]}).open().then(function(u){return u.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return u=Pn.dependencies,c=u.indexedDB,u=u.IDBKeyRange,(Fs(c)?Promise.resolve(c.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==Tr})}):Rs(c,u).toCollection().primaryKeys()).then(s)}catch{return rt(new he.MissingAPI)}var u,c},defineClass:function(){return function(s){d(this,s)}},ignoreTransaction:function(s){return be.trans?Rn(be.transless,s):s()},vip:Ds,async:function(s){return function(){try{var u=js(s.apply(this,arguments));return u&&typeof u.then=="function"?u:ce.resolve(u)}catch(c){return rt(c)}}},spawn:function(s,u,c){try{var f=js(s.apply(c,u||[]));return f&&typeof f.then=="function"?f:ce.resolve(f)}catch(p){return rt(p)}},currentTransaction:{get:function(){return be.trans||null}},waitFor:function(s,u){return u=ce.resolve(typeof s=="function"?Pn.ignoreTransaction(s):s).timeout(u||6e4),be.trans?be.trans.waitFor(u):u},Promise:ce,debug:{get:function(){return Ee},set:function(s){We(s)}},derive:N,extend:d,props:v,override:J,Events:Fi,on:vn,liveQuery:ol,extendObservabilitySet:Ur,getByKeyPath:X,setByKeyPath:ne,delByKeyPath:function(s,u){typeof u=="string"?ne(s,u,void 0):"length"in u&&[].map.call(u,function(c){ne(s,c,void 0)})},shallowClone:ye,deepClone:Le,getObjectDiff:Bs,cmp:Me,asap:Y,minKey:-1/0,addons:[],connections:ii,errnames:ge,dependencies:Kr,cache:In,semVer:"4.0.11",version:"4.0.11".split(".").map(function(s){return parseInt(s)}).reduce(function(s,u,c){return s+u/Math.pow(10,2*c)})})),Pn.maxKey=$i(Pn.dependencies.IDBKeyRange),typeof dispatchEvent!="undefined"&&typeof addEventListener!="undefined"&&(vn(Li,function(s){yn||(s=new CustomEvent(Es,{detail:s}),yn=!0,dispatchEvent(s),yn=!1)}),addEventListener(Es,function(s){s=s.detail,yn||Hs(s)}));var si,yn=!1,ul=function(){};return typeof BroadcastChannel!="undefined"&&((ul=function(){(si=new BroadcastChannel(Es)).onmessage=function(s){return s.data&&Hs(s.data)}})(),typeof si.unref=="function"&&si.unref(),vn(Li,function(s){yn||si.postMessage(s)})),typeof addEventListener!="undefined"&&(addEventListener("pagehide",function(s){if(!rn.disableBfCache&&s.persisted){Ee&&console.debug("Dexie: handling persisted pagehide"),si!=null&&si.close();for(var u=0,c=ii;u<c.length;u++)c[u].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(s){!rn.disableBfCache&&s.persisted&&(Ee&&console.debug("Dexie: handling persisted pageshow"),ul(),Hs({all:new vt(-1/0,[[]])}))})),ce.rejectionMapper=function(s,u){return!s||s instanceof Ke||s instanceof TypeError||s instanceof SyntaxError||!s.name||!Ge[s.name]?s:(u=new Ge[s.name](u||s.message,s),"stack"in s&&_(u,"stack",{get:function(){return this.inner.stack}}),u)},We(Ee),i(rn,Object.freeze({__proto__:null,Dexie:rn,liveQuery:ol,Entity:Mu,cmp:Me,PropModification:Ii,replacePrefix:function(s,u){return new Ii({replacePrefix:[s,u]})},add:function(s){return new Ii({add:s})},remove:function(s){return new Ii({remove:s})},default:rn,RangeSet:vt,mergeRanges:Bi,rangesOverlap:Xu}),{default:rn}),rn})}(ra)),ra.exports}var Bg=jg();const Uo=za(Bg),Al=Symbol.for("Dexie"),ba=globalThis[Al]||(globalThis[Al]=Uo);if(Uo.semVer!==ba.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Uo.semVer} and ${ba.semVer}`);const{liveQuery:OS,mergeRanges:xS,rangesOverlap:TS,RangeSet:CS,cmp:RS,Entity:FS,PropModification:DS,replacePrefix:IS,add:PS,remove:LS}=ba;class Hd extends ba{constructor(n,i,r={}){super(n);fe(this,"logs");const a={logs:"id, level, time, source, account"};this.version(i).stores({...a,...r})}}class Ug extends Hd{constructor(){super("nizza",1)}}const Kd=new Ug;class zd{constructor(e,n){fe(this,"logger");fe(this,"channel");fe(this,"listeners",new Map);fe(this,"eventQueue",new Map);this.logger=n.child("EventBus");try{this.logger.debug(`Creating BroadcastChannel with name "${e}"`),this.channel=new BroadcastChannel(e),this.channel.onmessage=i=>this.handleMessage(i),this.channel.onmessageerror=i=>this.logger.error("NizzaBroadcastChannel error:",i)}catch(i){throw this.logger.error("Failed to create NizzaBroadcastChannel:",i),i}}on(e,n){return this.logger.debug(`Subscribing to pattern "${e}"`),this.subscribeToEvent(e,n),{off:()=>this.unsubscribeFromEvent(e,n)}}emit(e,n,i={}){this.logger.debug(`Emitting event "${e}" with data`,n),this.emitEvent(e,n,i)}handleMessage(e){const n=e.data,{name:i}=n;this.logger.debug(`Received message "${i}" with data`,n);for(const[r,a]of this.listeners.entries())this.matchWildcard(r,i)&&(this.logger.debug(`Matching pattern "${r}" for event "${i}"`),a.forEach(o=>o({...n,wildcard:r})))}subscribeToEvent(e,n){if(typeof e!="string"||typeof n!="function"){const r=new Error("Invalid arguments");throw this.logger.error(r),r}this.listeners.has(e)||(this.logger.debug(`Adding new pattern "${e}"`),this.listeners.set(e,new Set));const i=Array.from(this.eventQueue).filter(([r])=>{const a=this.matchWildcard(e,r);return a&&(this.eventQueue.delete(r),this.logger.debug(`Dequeued pending events for "${r}".`)),a}).flatMap(([,r])=>r);for(const[r,a]of this.listeners.entries())this.matchWildcard(r,e)&&(this.logger.debug(`Adding listener to pattern "${r}"`),a.add(n),i.length&&(this.logger.debug(`Delivering pending events for "${e}".`),i.forEach(o=>{n({...o,wildcard:r})})))}emitEvent(e,n,i){if(typeof e!="string"){const o=new Error("Invalid arguments");throw this.logger.error(o),o}const r={name:e,data:n,attrs:i},a=Array.from(this.getMatchingListeners(e));if(a.length){this.logger.debug(`Delivering event "${e}" to listeners`);for(const[o,l]of a)l({...r,wildcard:o})}else this.logger.debug(`No listeners for event "${e}", enqueuing`),this.eventQueue.has(e)||this.eventQueue.set(e,[]),this.eventQueue.get(e).push(r);this.logger.debug("Posting message to channel",r),this.channel.postMessage(r)}*getMatchingListeners(e){this.logger.debug(`Getting matching listeners for event "${e}"`);for(const[n,i]of this.listeners.entries())if(this.matchWildcard(n,e))for(const r of i)yield[n,r]}unsubscribeFromEvent(e,n){if(this.listeners.has(e)){this.logger.debug(`Unsubscribing from event "${e}"`);const i=this.listeners.get(e);i.delete(n),i.size===0&&(this.logger.debug(`No more listeners for event "${e}", deleting`),this.listeners.delete(e))}}matchWildcard(e,n){const i=e.replace(/\*/g,"[^:]*").replace(/\*\*/g,".*"),a=new RegExp(`^${i}$`).test(n);return this.logger.debug(`Wildcard "${e}" matches with pattern "${n}": ${a}`),a}}var Vi={exports:{}},to,Ol;function Vg(){if(Ol)return to;Ol=1;function t(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}to=e;function e(n,i,r){var a=r&&r.stringify||t,o=1;if(typeof n=="object"&&n!==null){var l=i.length+o;if(l===1)return n;var d=new Array(l);d[0]=a(n);for(var h=1;h<l;h++)d[h]=a(i[h]);return d.join(" ")}if(typeof n!="string")return n;var m=i.length;if(m===0)return n;for(var y="",v=1-o,x=-1,_=n&&n.length||0,N=0;N<_;){if(n.charCodeAt(N)===37&&N+1<_){switch(x=x>-1?x:0,n.charCodeAt(N+1)){case 100:case 102:if(v>=m||i[v]==null)break;x<N&&(y+=n.slice(x,N)),y+=Number(i[v]),x=N+2,N++;break;case 105:if(v>=m||i[v]==null)break;x<N&&(y+=n.slice(x,N)),y+=Math.floor(Number(i[v])),x=N+2,N++;break;case 79:case 111:case 106:if(v>=m||i[v]===void 0)break;x<N&&(y+=n.slice(x,N));var E=typeof i[v];if(E==="string"){y+="'"+i[v]+"'",x=N+2,N++;break}if(E==="function"){y+=i[v].name||"<anonymous>",x=N+2,N++;break}y+=a(i[v]),x=N+2,N++;break;case 115:if(v>=m)break;x<N&&(y+=n.slice(x,N)),y+=String(i[v]),x=N+2,N++;break;case 37:x<N&&(y+=n.slice(x,N)),y+="%",x=N+2,N++,v--;break}++v}++N}return x===-1?n:(x<_&&(y+=n.slice(x)),y)}return to}var xl;function qg(){if(xl)return Vi.exports;xl=1;const t=Vg();Vi.exports=m;const e=M().console||{},n={mapHttpRequest:ne,mapHttpResponse:ne,wrapRequestSerializer:ye,wrapResponseSerializer:ye,wrapErrorSerializer:ye,req:ne,res:ne,err:Y,errWithCause:Y};function i(w,z){return w==="silent"?1/0:z.levels.values[w]}const r=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function l(w,z){const Q={logger:z,parent:w[a]};z[a]=Q}function d(w,z,Q){const ae={};z.forEach(te=>{ae[te]=Q[te]?Q[te]:e[te]||e[o[te]||"log"]||de}),w[r]=ae}function h(w,z){return Array.isArray(w)?w.filter(function(ae){return ae!=="!stdSerializers.err"}):w===!0?Object.keys(z):!1}function m(w){w=w||{},w.browser=w.browser||{};const z=w.browser.transmit;if(z&&typeof z.send!="function")throw Error("pino: transmit option must have a send function");const Q=w.browser.write||e;w.browser.write&&(w.browser.asObject=!0);const ae=w.serializers||{},te=h(w.browser.serialize,ae);let j=w.browser.serialize;Array.isArray(w.browser.serialize)&&w.browser.serialize.indexOf("!stdSerializers.err")>-1&&(j=!1);const Oe=Object.keys(w.customLevels||{}),Re=["error","fatal","warn","info","debug","trace"].concat(Oe);typeof Q=="function"&&Re.forEach(function(Ge){Q[Ge]=Q}),(w.enabled===!1||w.browser.disabled)&&(w.level="silent");const Ke=w.level||"info",I=Object.create(Q);I.log||(I.log=de),d(I,Re,Q),l({},I),Object.defineProperty(I,"levelVal",{get:ot}),Object.defineProperty(I,"level",{get:ge,set:Fe});const q={transmit:z,serialize:te,asObject:w.browser.asObject,formatters:w.browser.formatters,levels:Re,timestamp:X(w),messageKey:w.messageKey||"msg",onChild:w.onChild||de};I.levels=y(w),I.level=Ke,I.setMaxListeners=I.getMaxListeners=I.emit=I.addListener=I.on=I.prependListener=I.once=I.prependOnceListener=I.removeListener=I.removeAllListeners=I.listeners=I.listenerCount=I.eventNames=I.write=I.flush=de,I.serializers=ae,I._serialize=te,I._stdErrSerialize=j,I.child=function(...Ge){return he.call(this,q,...Ge)},z&&(I._logEvent=K());function ot(){return i(this.level,this)}function ge(){return this._level}function Fe(Ge){if(Ge!=="silent"&&!this.levels.values[Ge])throw Error("unknown level "+Ge);this._level=Ge,_(this,q,I,"error"),_(this,q,I,"fatal"),_(this,q,I,"warn"),_(this,q,I,"info"),_(this,q,I,"debug"),_(this,q,I,"trace"),Oe.forEach(qe=>{_(this,q,I,qe)})}function he(Ge,qe,Se){if(!qe)throw new Error("missing bindings for child Pino");Se=Se||{},te&&qe.serializers&&(Se.serializers=qe.serializers);const pt=Se.serializers;if(te&&pt){var nt=Object.assign({},ae,pt),_e=w.browser.serialize===!0?Object.keys(nt):te;delete qe.serializers,V([qe],_e,nt,this._stdErrSerialize)}function ut(ue){this._childLevel=(ue._childLevel|0)+1,this.bindings=qe,nt&&(this.serializers=nt,this._serialize=_e),z&&(this._logEvent=K([].concat(ue._logEvent.bindings,qe)))}ut.prototype=this;const Xe=new ut(this);return l(this,Xe),Xe.child=function(...ue){return he.call(this,Ge,...ue)},Xe.level=Se.level||this.level,Ge.onChild(Xe),Xe}return I}function y(w){const z=w.customLevels||{},Q=Object.assign({},m.levels.values,z),ae=Object.assign({},m.levels.labels,v(z));return{values:Q,labels:ae}}function v(w){const z={};return Object.keys(w).forEach(function(Q){z[w[Q]]=Q}),z}m.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},m.stdSerializers=n,m.stdTimeFunctions=Object.assign({},{nullTime:je,epochTime:ke,unixTime:Ae,isoTime:Le});function x(w){const z=[];w.bindings&&z.push(w.bindings);let Q=w[a];for(;Q.parent;)Q=Q.parent,Q.logger.bindings&&z.push(Q.logger.bindings);return z.reverse()}function _(w,z,Q,ae){if(Object.defineProperty(w,ae,{value:i(w.level,Q)>i(ae,Q)?de:Q[r][ae],writable:!0,enumerable:!0,configurable:!0}),w[ae]===de){if(!z.transmit)return;const j=z.transmit.level||w.level,Oe=i(j,Q);if(i(ae,Q)<Oe)return}w[ae]=E(w,z,Q,ae);const te=x(w);te.length!==0&&(w[ae]=N(te,w[ae]))}function N(w,z){return function(){return z.apply(this,[...w,...arguments])}}function E(w,z,Q,ae){return function(te){return function(){const Oe=z.timestamp(),Re=new Array(arguments.length),Ke=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var I=0;I<Re.length;I++)Re[I]=arguments[I];var q=!1;if(z.serialize&&(V(Re,this._serialize,this.serializers,this._stdErrSerialize),q=!0),z.asObject||z.formatters?te.call(Ke,F(this,ae,Re,Oe,z)):te.apply(Ke,Re),z.transmit){const ot=z.transmit.level||w._level,ge=i(ot,Q),Fe=i(ae,Q);if(Fe<ge)return;J(this,{ts:Oe,methodLevel:ae,methodValue:Fe,transmitValue:Q.levels.values[z.transmit.level||w._level],send:z.transmit.send,val:i(w._level,Q)},Re,q)}}}(w[r][ae])}function F(w,z,Q,ae,te){const{level:j,log:Oe=ge=>ge}=te.formatters||{},Re=Q.slice();let Ke=Re[0];const I={};if(ae&&(I.time=ae),j){const ge=j(z,w.levels.values[z]);Object.assign(I,ge)}else I.level=w.levels.values[z];let q=(w._childLevel|0)+1;if(q<1&&(q=1),Ke!==null&&typeof Ke=="object"){for(;q--&&typeof Re[0]=="object";)Object.assign(I,Re.shift());Ke=Re.length?t(Re.shift(),Re):void 0}else typeof Ke=="string"&&(Ke=t(Re.shift(),Re));return Ke!==void 0&&(I[te.messageKey]=Ke),Oe(I)}function V(w,z,Q,ae){for(const te in w)if(ae&&w[te]instanceof Error)w[te]=m.stdSerializers.err(w[te]);else if(typeof w[te]=="object"&&!Array.isArray(w[te])&&z)for(const j in w[te])z.indexOf(j)>-1&&j in Q&&(w[te][j]=Q[j](w[te][j]))}function J(w,z,Q,ae=!1){const te=z.send,j=z.ts,Oe=z.methodLevel,Re=z.methodValue,Ke=z.val,I=w._logEvent.bindings;ae||V(Q,w._serialize||Object.keys(w.serializers),w.serializers,w._stdErrSerialize===void 0?!0:w._stdErrSerialize),w._logEvent.ts=j,w._logEvent.messages=Q.filter(function(q){return I.indexOf(q)===-1}),w._logEvent.level.label=Oe,w._logEvent.level.value=Re,te(Oe,w._logEvent,Ke),w._logEvent=K(I)}function K(w){return{ts:0,messages:[],bindings:w||[],level:{label:"",value:0}}}function Y(w){const z={type:w.constructor.name,msg:w.message,stack:w.stack};for(const Q in w)z[Q]===void 0&&(z[Q]=w[Q]);return z}function X(w){return typeof w.timestamp=="function"?w.timestamp:w.timestamp===!1?je:ke}function ne(){return{}}function ye(w){return w}function de(){}function je(){return!1}function ke(){return Date.now()}function Ae(){return Math.round(Date.now()/1e3)}function Le(){return new Date(Date.now()).toISOString()}function M(){function w(z){return typeof z!="undefined"&&z}try{return typeof globalThis!="undefined"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return w(self)||w(window)||w(this)||{}}}return Vi.exports.default=m,Vi.exports.pino=m,Vi.exports}var Hg=qg();const Kg=za(Hg),mt=[];for(let t=0;t<256;++t)mt.push((t+256).toString(16).slice(1));function zg(t,e=0){return(mt[t[e+0]]+mt[t[e+1]]+mt[t[e+2]]+mt[t[e+3]]+"-"+mt[t[e+4]]+mt[t[e+5]]+"-"+mt[t[e+6]]+mt[t[e+7]]+"-"+mt[t[e+8]]+mt[t[e+9]]+"-"+mt[t[e+10]]+mt[t[e+11]]+mt[t[e+12]]+mt[t[e+13]]+mt[t[e+14]]+mt[t[e+15]]).toLowerCase()}let no;const Gg=new Uint8Array(16);function Wg(){if(!no){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");no=crypto.getRandomValues.bind(crypto)}return no(Gg)}const Jg=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Tl={randomUUID:Jg};function Yg(t,e,n){var r,a,o;if(Tl.randomUUID&&!t)return Tl.randomUUID();t=t||{};const i=(o=(a=t.random)!=null?a:(r=t.rng)==null?void 0:r.call(t))!=null?o:Wg();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,zg(i)}const Xg=4;var Gd=(t=>(t.CREATED="CREATED",t.STARTING="STARTING",t.LIVE="LIVE",t.FINALIZED="FINALIZED",t))(Gd||{});const Qg={ALL:"*",CORE:"core:**",ADD_TO_CART_HOOKS:"core:addToCartHooks:**",LIVE_STREAMING_EVENT:"event:**",EVENT_CHAT:"event:chat:**",EVENT_PRODUCTS:"event:products:**",CUSTOMIZE_LIVE:"customize-live:**",PLAYER:"player:**",SNACK_SIZE_VIDEO:"ssv:**",SNACK_SIZE_VIDEO_ADMIN:"ssv-admin:**",UI:"ui:**",UTILS:"utils:**"},Wd={EVENT_STATUS_CHANGED:"event:statusChanged",ATCH_ACTION_EXECUTED:"core:addToCartHooks:actionExecuted"};var Jd=(t=>(t.English="en",t.Spanish="es",t.Portuguese="pt",t))(Jd||{}),et=(t=>(t.TRACE="trace",t.DEBUG="debug",t.INFO="info",t.WARN="warn",t.ERROR="error",t.FATAL="fatal",t))(et||{});const ze={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Yd={[ze.trace]:"trace",[ze.debug]:"debug",[ze.info]:"info",[ze.warn]:"warn",[ze.error]:"error",[ze.fatal]:"fatal"};var Xd=(t=>(t.COMBO="Combo",t.BADGE="Badged",t))(Xd||{}),Qd=(t=>(t.VTEX="VTEX",t.PLATFORM="platform",t.CACE="CACE",t.GLOBAL_PAGE="globalPage",t.CUSTOMIZATION="customization",t.FAST_STORE="faststore",t.UNKNOWN="unknown",t))(Qd||{});function Zd(t){return Object.values(et).includes(String(t).toLowerCase())}class pu extends Error{constructor(e){super(`Invalid log level: ${e}`),this.name="InvalidLogLevelError"}}const _t=class _t{constructor(e){fe(this,"instance");fe(this,"httpLogger");fe(this,"consoleLogger");fe(this,"config");var l;this.config=e;const{source:n,levelService:i,metadata:r={},consoleLogger:a,httpLogger:o}=e;(l=_t.root)!=null||(_t.root=_t.createRootLogger(a,o)),_t.mergeGlobalMetadata(r),this.instance=_t.root.child({source:n}),this.consoleLogger=a,this.httpLogger=o,this.setLevel(i.getLevel(n))}static createRootLogger(e,n){return Kg({customLevels:ze,browser:{write:i=>{const{payload:r,options:a,stack:o,...l}=i,d={...l,...r};a.silent||e.print(d,o),d.level>=ze[et.WARN]&&n.save(d)}}})}static mergeGlobalMetadata(e={}){_t.globalMetadata={..._t.globalMetadata,...e}}child(e,n={}){return _t.mergeGlobalMetadata(n),new _t({source:`${this.config.source}:${e}`,levelService:this.config.levelService,consoleLogger:this.consoleLogger,httpLogger:this.httpLogger})}setLevel(e){this.instance.level=e}setMetadata(e){_t.mergeGlobalMetadata(e)}formatLogEntry(e){const{content:n,stack:i,options:r={}}=e,{message:a,args:o=[]}=n,l=Yg(),d={};let h;return a instanceof Error?(d.error={name:a.name,message:a.message,stack:a.stack},h=a.message):h=typeof a=="object"?JSON.stringify(a):String(a),o.forEach((y,v)=>this.formatArg(y,v,d)),{payload:{id:l,msg:h,data:d,..._t.globalMetadata},options:r,stack:i}}formatArg(e,n,i){if(e instanceof Error){const r=i.error?`error${n+1}`:"error";i[r]={message:e.message,stack:e.stack,name:e.name}}else typeof e=="object"&&e!==null?Object.assign(i,e):i[`$${n}`]=String(e)}log(e,n){if(typeof this.instance[e]!="function")throw new pu(e);const i=this.formatLogEntry(n);this.instance[e](i)}trace(e){this.log("trace",e)}debug(e){this.log("debug",e)}info(e){this.log("info",e)}warn(e){this.log("warn",e)}error(e){this.log("error",e)}fatal(e){this.log("fatal",e)}get source(){return this.config.source}};fe(_t,"globalMetadata",{}),fe(_t,"root",null);let Vo=_t;const Cl={stackExclusionPatterns:/\b(PinoAdapter|ConsoleLogger|LoggerChain|Logger|Proxy|Child|pino\.js)\b/,themes:{dark:{baseStyles:{timestamp:"color: #A9A9A9; font-weight: normal;",source:"color: #B0B0B0; font-weight: normal;",context:"color: #FFFFFF; font-weight: bold;",defaultMessage:"color: #E5E5E5; font-weight: normal;"},levels:{[ze[et.TRACE]]:"color: #778899; font-weight: bold;",[ze[et.DEBUG]]:"color: #008B8B; font-weight: bold;",[ze[et.INFO]]:"color: #00FFFF; font-weight: bold;",[ze[et.WARN]]:"color: #FFD700; font-weight: bold;",[ze[et.ERROR]]:"color: #FF4500; font-weight: bold;",[ze[et.FATAL]]:"color: #FF0000; font-weight: bold; text-shadow: 1px 1px 1px black;"},messages:{[ze[et.WARN]]:"color: #FFD700; font-weight: normal;",[ze[et.ERROR]]:"color: #FF4500; font-weight: normal;",[ze[et.FATAL]]:"color: #FF0000; font-weight: bold;"}},light:{baseStyles:{timestamp:"color: #4D4D4D; font-weight: normal;",source:"color: #666666; font-weight: normal;",context:"color: #000000; font-weight: bold;",defaultMessage:"color: #333333; font-weight: normal;"},levels:{[ze[et.TRACE]]:"color: #6A5ACD; font-weight: bold;",[ze[et.DEBUG]]:"color: #00509E; font-weight: bold;",[ze[et.INFO]]:"color: #1E90FF; font-weight: bold;",[ze[et.WARN]]:"color: #FFA500; font-weight: bold;",[ze[et.ERROR]]:"color: #ff0033; font-weight: bold;",[ze[et.FATAL]]:"color: #D80000; font-weight: bold; text-shadow: 1px 1px 1px #660000;"},messages:{[ze[et.WARN]]:"color: #FFA500; font-weight: normal;",[ze[et.ERROR]]:"color: #ff0033; font-weight: normal;",[ze[et.FATAL]]:"color: #D80000; font-weight: bold;"}}}};class Zg{constructor(){fe(this,"theme");this.theme=this.initializeTheme(),this.setupThemeChangeListener()}initializeTheme(){const e=localStorage.getItem("log-theme");return e==="light"||e==="dark"?e:this.detectTheme()}detectTheme(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}setupThemeChangeListener(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{this.theme=e.matches?"dark":"light"})}static setTheme(e){localStorage.setItem("consoleLoggerTheme",e)}formatStack(e){return e.split(`
29
+ `).filter(n=>!Cl.stackExclusionPatterns.test(n)).map(n=>n.replace(/^Error\s*/,"").trim())}getStyles(e){const n=Cl.themes[this.theme];return{...n.baseStyles,level:n.levels[e]||n.baseStyles.defaultMessage,message:n.messages[e]||n.baseStyles.defaultMessage}}getTime(){return new Date().toLocaleTimeString("en-US",{hour12:!1})+`.${new Date().getMilliseconds().toString().padStart(3,"0")}`}print({level:e,source:n,msg:i,data:r},a){const[o,l,d]=n.split(":"),h=(Yd[e]||"UNKNOWN").toUpperCase(),m=d?`${d}: `:"",y=l?`:${l}`:"",v=this.getStyles(e);console.groupCollapsed(`%c${this.getTime()} %c${h} %c[${o}${y}] %c${m}%c${i}`,v.timestamp,v.level,v.source,v.context,v.message),r&&Object.keys(r).length&&console.log("Data:",r);const x=this.formatStack(a||new Error().stack);x.length&&console.log("Stack:",x.join(`
30
+ `)),console.groupEnd()}}const ev={endpoint:`${_i.apiUrls.restV2}/v1/telemetry/logs`,batchSize:500,flushInterval:10,maxRetries:5,retryBackoffFactor:2,maxPayloadSize:500};class mu{constructor(e){fe(this,"config");fe(this,"isFlushing",!1);fe(this,"retryCount",0);fe(this,"isFlushScheduled",!1);this.config=e,this.setupUnloadListener()}static create(e){const n={...ev,...e};if(!n.db)throw new Error("Invalid Dixie DB");if(!n.project)throw new Error("Project name is required");return new mu(n)}async save(e){const n=JSON.parse(JSON.stringify(e));await this.config.db.logs.add(n),this.scheduleFlush()}scheduleFlush(e=this.config.flushInterval*1e3){this.isFlushScheduled||this.isFlushing||(this.isFlushScheduled=!0,setTimeout(()=>{this.isFlushScheduled=!1,this.flush()},e))}async flush(){if(this.isFlushing)return;this.isFlushing=!0;let e=!1;try{await this.processLogsBatch(async i=>{await this.sendLogs(i),await this.deleteLogs(i)}),this.retryCount=0,e=!0}catch(i){this.logError("flush",i)}this.isFlushing=!1;const n=await this.hasPendingLogs();!e&&n?this.handleRetry():e&&n&&this.scheduleFlush()}async processLogsBatch(e){const n=await this.getLogsBatch(),i=this.splitLogsByPayloadSize(n);for(const r of i)await e(r)}async getLogsBatch(e=this.config.batchSize){return this.config.db.logs.orderBy("time").limit(e).toArray()}splitLogsByPayloadSize(e){let n=[],i=0;const r=[];return e.forEach(a=>{const o=JSON.stringify(a).length/1024;i+o>this.config.maxPayloadSize&&(r.push(n),n=[],i=0),n.push(a),i+=o}),n.length>0&&r.push(n),r}async sendLogs(e){const n=this.buildPayload(e);await qn({url:this.config.endpoint,method:"POST",body:n})}buildPayload(e){return JSON.stringify({project:this.config.project,logs:e})}async deleteLogs(e){const n=e.map(i=>i.id);await this.config.db.logs.bulkDelete(n)}logError(e,n){console.error(`[${e}]`,n)}handleRetry(){if(this.retryCount>=this.config.maxRetries)return;this.retryCount++;const e=this.config.flushInterval*Math.pow(this.config.retryBackoffFactor,this.retryCount)*1e3;this.scheduleFlush(e)}async hasPendingLogs(){return await this.config.db.logs.count()>0}setupUnloadListener(){window.addEventListener("beforeunload",async()=>{this.isFlushing||!await this.hasPendingLogs()||await this.processLogsBatch(async e=>{const n=this.buildPayload(e);navigator.sendBeacon(this.config.endpoint,n)?await this.deleteLogs(e):console.warn("Failed to send logs via sendBeacon; logs will remain in the database.")})})}}var io={},ro,Rl;function Ga(){if(Rl)return ro;Rl=1;const t="\\\\/",e=`[^${t}]`,n="\\.",i="\\+",r="\\?",a="\\/",o="(?=.)",l="[^/]",d=`(?:${a}|$)`,h=`(?:^|${a})`,m=`${n}{1,2}${d}`,y=`(?!${n})`,v=`(?!${h}${m})`,x=`(?!${n}{0,1}${d})`,_=`(?!${m})`,N=`[^.${a}]`,E=`${l}*?`,V={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:r,SLASH_LITERAL:a,ONE_CHAR:o,QMARK:l,END_ANCHOR:d,DOTS_SLASH:m,NO_DOT:y,NO_DOTS:v,NO_DOT_SLASH:x,NO_DOTS_SLASH:_,QMARK_NO_DOT:N,STAR:E,START_ANCHOR:h,SEP:"/"},J={...V,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},K={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ro={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:K,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(Y){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${Y.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(Y){return Y===!0?J:V}},ro}var Fl;function Wa(){return Fl||(Fl=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:r}=Ga();t.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),t.hasRegexChars=a=>i.test(a),t.isRegexChar=a=>a.length===1&&t.hasRegexChars(a),t.escapeRegex=a=>a.replace(r,"\\$1"),t.toPosixSlashes=a=>a.replace(e,"/"),t.isWindows=()=>{if(typeof navigator!="undefined"&&navigator.platform){const a=navigator.platform.toLowerCase();return a==="win32"||a==="windows"}return typeof process!="undefined"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=a=>a.replace(n,o=>o==="\\"?"":o),t.escapeLast=(a,o,l)=>{const d=a.lastIndexOf(o,l);return d===-1?a:a[d-1]==="\\"?t.escapeLast(a,o,d-1):`${a.slice(0,d)}\\${a.slice(d)}`},t.removePrefix=(a,o={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),o.prefix="./"),l},t.wrapOutput=(a,o={},l={})=>{const d=l.contains?"":"^",h=l.contains?"":"$";let m=`${d}(?:${a})${h}`;return o.negated===!0&&(m=`(?:^(?!${m}).*$)`),m},t.basename=(a,{windows:o}={})=>{const l=a.split(o?/[\\/]/:"/"),d=l[l.length-1];return d===""?l[l.length-2]:d}}(io)),io}var ao,Dl;function tv(){if(Dl)return ao;Dl=1;const t=Wa(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:r,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:d,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:m,CHAR_PLUS:y,CHAR_QUESTION_MARK:v,CHAR_RIGHT_CURLY_BRACE:x,CHAR_RIGHT_PARENTHESES:_,CHAR_RIGHT_SQUARE_BRACKET:N}=Ga(),E=J=>J===l||J===i,F=J=>{J.isPrefix!==!0&&(J.depth=J.isGlobstar?1/0:1)};return ao=(J,K)=>{const Y=K||{},X=J.length-1,ne=Y.parts===!0||Y.scanToEnd===!0,ye=[],de=[],je=[];let ke=J,Ae=-1,Le=0,M=0,w=!1,z=!1,Q=!1,ae=!1,te=!1,j=!1,Oe=!1,Re=!1,Ke=!1,I=!1,q=0,ot,ge,Fe={value:"",depth:0,isGlob:!1};const he=()=>Ae>=X,Ge=()=>ke.charCodeAt(Ae+1),qe=()=>(ot=ge,ke.charCodeAt(++Ae));for(;Ae<X;){ge=qe();let ut;if(ge===i){Oe=Fe.backslashes=!0,ge=qe(),ge===d&&(j=!0);continue}if(j===!0||ge===d){for(q++;he()!==!0&&(ge=qe());){if(ge===i){Oe=Fe.backslashes=!0,qe();continue}if(ge===d){q++;continue}if(j!==!0&&ge===a&&(ge=qe())===a){if(w=Fe.isBrace=!0,Q=Fe.isGlob=!0,I=!0,ne===!0)continue;break}if(j!==!0&&ge===r){if(w=Fe.isBrace=!0,Q=Fe.isGlob=!0,I=!0,ne===!0)continue;break}if(ge===x&&(q--,q===0)){j=!1,w=Fe.isBrace=!0,I=!0;break}}if(ne===!0)continue;break}if(ge===l){if(ye.push(Ae),de.push(Fe),Fe={value:"",depth:0,isGlob:!1},I===!0)continue;if(ot===a&&Ae===Le+1){Le+=2;continue}M=Ae+1;continue}if(Y.noext!==!0&&(ge===y||ge===n||ge===e||ge===v||ge===o)===!0&&Ge()===h){if(Q=Fe.isGlob=!0,ae=Fe.isExtglob=!0,I=!0,ge===o&&Ae===Le&&(Ke=!0),ne===!0){for(;he()!==!0&&(ge=qe());){if(ge===i){Oe=Fe.backslashes=!0,ge=qe();continue}if(ge===_){Q=Fe.isGlob=!0,I=!0;break}}continue}break}if(ge===e){if(ot===e&&(te=Fe.isGlobstar=!0),Q=Fe.isGlob=!0,I=!0,ne===!0)continue;break}if(ge===v){if(Q=Fe.isGlob=!0,I=!0,ne===!0)continue;break}if(ge===m){for(;he()!==!0&&(ut=qe());){if(ut===i){Oe=Fe.backslashes=!0,qe();continue}if(ut===N){z=Fe.isBracket=!0,Q=Fe.isGlob=!0,I=!0;break}}if(ne===!0)continue;break}if(Y.nonegate!==!0&&ge===o&&Ae===Le){Re=Fe.negated=!0,Le++;continue}if(Y.noparen!==!0&&ge===h){if(Q=Fe.isGlob=!0,ne===!0){for(;he()!==!0&&(ge=qe());){if(ge===h){Oe=Fe.backslashes=!0,ge=qe();continue}if(ge===_){I=!0;break}}continue}break}if(Q===!0){if(I=!0,ne===!0)continue;break}}Y.noext===!0&&(ae=!1,Q=!1);let Se=ke,pt="",nt="";Le>0&&(pt=ke.slice(0,Le),ke=ke.slice(Le),M-=Le),Se&&Q===!0&&M>0?(Se=ke.slice(0,M),nt=ke.slice(M)):Q===!0?(Se="",nt=ke):Se=ke,Se&&Se!==""&&Se!=="/"&&Se!==ke&&E(Se.charCodeAt(Se.length-1))&&(Se=Se.slice(0,-1)),Y.unescape===!0&&(nt&&(nt=t.removeBackslashes(nt)),Se&&Oe===!0&&(Se=t.removeBackslashes(Se)));const _e={prefix:pt,input:J,start:Le,base:Se,glob:nt,isBrace:w,isBracket:z,isGlob:Q,isExtglob:ae,isGlobstar:te,negated:Re,negatedExtglob:Ke};if(Y.tokens===!0&&(_e.maxDepth=0,E(ge)||de.push(Fe),_e.tokens=de),Y.parts===!0||Y.tokens===!0){let ut;for(let Xe=0;Xe<ye.length;Xe++){const ue=ut?ut+1:Le,He=ye[Xe],ie=J.slice(ue,He);Y.tokens&&(Xe===0&&Le!==0?(de[Xe].isPrefix=!0,de[Xe].value=pt):de[Xe].value=ie,F(de[Xe]),_e.maxDepth+=de[Xe].depth),(Xe!==0||ie!=="")&&je.push(ie),ut=He}if(ut&&ut+1<J.length){const Xe=J.slice(ut+1);je.push(Xe),Y.tokens&&(de[de.length-1].value=Xe,F(de[de.length-1]),_e.maxDepth+=de[de.length-1].depth)}_e.slashes=ye,_e.parts=je}return _e},ao}var so,Il;function nv(){if(Il)return so;Il=1;const t=Ga(),e=Wa(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:o}=t,l=(m,y)=>{if(typeof y.expandRange=="function")return y.expandRange(...m,y);m.sort();const v=`[${m.join("-")}]`;try{new RegExp(v)}catch{return m.map(_=>e.escapeRegex(_)).join("..")}return v},d=(m,y)=>`Missing ${m}: "${y}" - use "\\\\${y}" to match literal characters`,h=(m,y)=>{if(typeof m!="string")throw new TypeError("Expected a string");m=o[m]||m;const v={...y},x=typeof v.maxLength=="number"?Math.min(n,v.maxLength):n;let _=m.length;if(_>x)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${x}`);const N={type:"bos",value:"",output:v.prepend||""},E=[N],F=v.capture?"":"?:",V=t.globChars(v.windows),J=t.extglobChars(V),{DOT_LITERAL:K,PLUS_LITERAL:Y,SLASH_LITERAL:X,ONE_CHAR:ne,DOTS_SLASH:ye,NO_DOT:de,NO_DOT_SLASH:je,NO_DOTS_SLASH:ke,QMARK:Ae,QMARK_NO_DOT:Le,STAR:M,START_ANCHOR:w}=V,z=ue=>`(${F}(?:(?!${w}${ue.dot?ye:K}).)*?)`,Q=v.dot?"":de,ae=v.dot?Ae:Le;let te=v.bash===!0?z(v):M;v.capture&&(te=`(${te})`),typeof v.noext=="boolean"&&(v.noextglob=v.noext);const j={input:m,index:-1,start:0,dot:v.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:E};m=e.removePrefix(m,j),_=m.length;const Oe=[],Re=[],Ke=[];let I=N,q;const ot=()=>j.index===_-1,ge=j.peek=(ue=1)=>m[j.index+ue],Fe=j.advance=()=>m[++j.index]||"",he=()=>m.slice(j.index+1),Ge=(ue="",He=0)=>{j.consumed+=ue,j.index+=He},qe=ue=>{j.output+=ue.output!=null?ue.output:ue.value,Ge(ue.value)},Se=()=>{let ue=1;for(;ge()==="!"&&(ge(2)!=="("||ge(3)==="?");)Fe(),j.start++,ue++;return ue%2===0?!1:(j.negated=!0,j.start++,!0)},pt=ue=>{j[ue]++,Ke.push(ue)},nt=ue=>{j[ue]--,Ke.pop()},_e=ue=>{if(I.type==="globstar"){const He=j.braces>0&&(ue.type==="comma"||ue.type==="brace"),ie=ue.extglob===!0||Oe.length&&(ue.type==="pipe"||ue.type==="paren");ue.type!=="slash"&&ue.type!=="paren"&&!He&&!ie&&(j.output=j.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=te,j.output+=I.output)}if(Oe.length&&ue.type!=="paren"&&(Oe[Oe.length-1].inner+=ue.value),(ue.value||ue.output)&&qe(ue),I&&I.type==="text"&&ue.type==="text"){I.output=(I.output||I.value)+ue.value,I.value+=ue.value;return}ue.prev=I,E.push(ue),I=ue},ut=(ue,He)=>{const ie={...J[He],conditions:1,inner:""};ie.prev=I,ie.parens=j.parens,ie.output=j.output;const Ee=(v.capture?"(":"")+ie.open;pt("parens"),_e({type:ue,value:He,output:j.output?"":ne}),_e({type:"paren",extglob:!0,value:Fe(),output:Ee}),Oe.push(ie)},Xe=ue=>{let He=ue.close+(v.capture?")":""),ie;if(ue.type==="negate"){let Ee=te;if(ue.inner&&ue.inner.length>1&&ue.inner.includes("/")&&(Ee=z(v)),(Ee!==te||ot()||/^\)+$/.test(he()))&&(He=ue.close=`)$))${Ee}`),ue.inner.includes("*")&&(ie=he())&&/^\.[^\\/.]+$/.test(ie)){const We=h(ie,{...y,fastpaths:!1}).output;He=ue.close=`)${We})${Ee})`}ue.prev.type==="bos"&&(j.negatedExtglob=!0)}_e({type:"paren",extglob:!0,value:q,output:He}),nt("parens")};if(v.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(m)){let ue=!1,He=m.replace(a,(ie,Ee,We,it,tt,tn)=>it==="\\"?(ue=!0,ie):it==="?"?Ee?Ee+it+(tt?Ae.repeat(tt.length):""):tn===0?ae+(tt?Ae.repeat(tt.length):""):Ae.repeat(We.length):it==="."?K.repeat(We.length):it==="*"?Ee?Ee+it+(tt?te:""):te:Ee?ie:`\\${ie}`);return ue===!0&&(v.unescape===!0?He=He.replace(/\\/g,""):He=He.replace(/\\+/g,ie=>ie.length%2===0?"\\\\":ie?"\\":"")),He===m&&v.contains===!0?(j.output=m,j):(j.output=e.wrapOutput(He,j,y),j)}for(;!ot();){if(q=Fe(),q==="\0")continue;if(q==="\\"){const ie=ge();if(ie==="/"&&v.bash!==!0||ie==="."||ie===";")continue;if(!ie){q+="\\",_e({type:"text",value:q});continue}const Ee=/^\\+/.exec(he());let We=0;if(Ee&&Ee[0].length>2&&(We=Ee[0].length,j.index+=We,We%2!==0&&(q+="\\")),v.unescape===!0?q=Fe():q+=Fe(),j.brackets===0){_e({type:"text",value:q});continue}}if(j.brackets>0&&(q!=="]"||I.value==="["||I.value==="[^")){if(v.posix!==!1&&q===":"){const ie=I.value.slice(1);if(ie.includes("[")&&(I.posix=!0,ie.includes(":"))){const Ee=I.value.lastIndexOf("["),We=I.value.slice(0,Ee),it=I.value.slice(Ee+2),tt=i[it];if(tt){I.value=We+tt,j.backtrack=!0,Fe(),!N.output&&E.indexOf(I)===1&&(N.output=ne);continue}}}(q==="["&&ge()!==":"||q==="-"&&ge()==="]")&&(q=`\\${q}`),q==="]"&&(I.value==="["||I.value==="[^")&&(q=`\\${q}`),v.posix===!0&&q==="!"&&I.value==="["&&(q="^"),I.value+=q,qe({value:q});continue}if(j.quotes===1&&q!=='"'){q=e.escapeRegex(q),I.value+=q,qe({value:q});continue}if(q==='"'){j.quotes=j.quotes===1?0:1,v.keepQuotes===!0&&_e({type:"text",value:q});continue}if(q==="("){pt("parens"),_e({type:"paren",value:q});continue}if(q===")"){if(j.parens===0&&v.strictBrackets===!0)throw new SyntaxError(d("opening","("));const ie=Oe[Oe.length-1];if(ie&&j.parens===ie.parens+1){Xe(Oe.pop());continue}_e({type:"paren",value:q,output:j.parens?")":"\\)"}),nt("parens");continue}if(q==="["){if(v.nobracket===!0||!he().includes("]")){if(v.nobracket!==!0&&v.strictBrackets===!0)throw new SyntaxError(d("closing","]"));q=`\\${q}`}else pt("brackets");_e({type:"bracket",value:q});continue}if(q==="]"){if(v.nobracket===!0||I&&I.type==="bracket"&&I.value.length===1){_e({type:"text",value:q,output:`\\${q}`});continue}if(j.brackets===0){if(v.strictBrackets===!0)throw new SyntaxError(d("opening","["));_e({type:"text",value:q,output:`\\${q}`});continue}nt("brackets");const ie=I.value.slice(1);if(I.posix!==!0&&ie[0]==="^"&&!ie.includes("/")&&(q=`/${q}`),I.value+=q,qe({value:q}),v.literalBrackets===!1||e.hasRegexChars(ie))continue;const Ee=e.escapeRegex(I.value);if(j.output=j.output.slice(0,-I.value.length),v.literalBrackets===!0){j.output+=Ee,I.value=Ee;continue}I.value=`(${F}${Ee}|${I.value})`,j.output+=I.value;continue}if(q==="{"&&v.nobrace!==!0){pt("braces");const ie={type:"brace",value:q,output:"(",outputIndex:j.output.length,tokensIndex:j.tokens.length};Re.push(ie),_e(ie);continue}if(q==="}"){const ie=Re[Re.length-1];if(v.nobrace===!0||!ie){_e({type:"text",value:q,output:q});continue}let Ee=")";if(ie.dots===!0){const We=E.slice(),it=[];for(let tt=We.length-1;tt>=0&&(E.pop(),We[tt].type!=="brace");tt--)We[tt].type!=="dots"&&it.unshift(We[tt].value);Ee=l(it,v),j.backtrack=!0}if(ie.comma!==!0&&ie.dots!==!0){const We=j.output.slice(0,ie.outputIndex),it=j.tokens.slice(ie.tokensIndex);ie.value=ie.output="\\{",q=Ee="\\}",j.output=We;for(const tt of it)j.output+=tt.output||tt.value}_e({type:"brace",value:q,output:Ee}),nt("braces"),Re.pop();continue}if(q==="|"){Oe.length>0&&Oe[Oe.length-1].conditions++,_e({type:"text",value:q});continue}if(q===","){let ie=q;const Ee=Re[Re.length-1];Ee&&Ke[Ke.length-1]==="braces"&&(Ee.comma=!0,ie="|"),_e({type:"comma",value:q,output:ie});continue}if(q==="/"){if(I.type==="dot"&&j.index===j.start+1){j.start=j.index+1,j.consumed="",j.output="",E.pop(),I=N;continue}_e({type:"slash",value:q,output:X});continue}if(q==="."){if(j.braces>0&&I.type==="dot"){I.value==="."&&(I.output=K);const ie=Re[Re.length-1];I.type="dots",I.output+=q,I.value+=q,ie.dots=!0;continue}if(j.braces+j.parens===0&&I.type!=="bos"&&I.type!=="slash"){_e({type:"text",value:q,output:K});continue}_e({type:"dot",value:q,output:K});continue}if(q==="?"){if(!(I&&I.value==="(")&&v.noextglob!==!0&&ge()==="("&&ge(2)!=="?"){ut("qmark",q);continue}if(I&&I.type==="paren"){const Ee=ge();let We=q;(I.value==="("&&!/[!=<:]/.test(Ee)||Ee==="<"&&!/<([!=]|\w+>)/.test(he()))&&(We=`\\${q}`),_e({type:"text",value:q,output:We});continue}if(v.dot!==!0&&(I.type==="slash"||I.type==="bos")){_e({type:"qmark",value:q,output:Le});continue}_e({type:"qmark",value:q,output:Ae});continue}if(q==="!"){if(v.noextglob!==!0&&ge()==="("&&(ge(2)!=="?"||!/[!=<:]/.test(ge(3)))){ut("negate",q);continue}if(v.nonegate!==!0&&j.index===0){Se();continue}}if(q==="+"){if(v.noextglob!==!0&&ge()==="("&&ge(2)!=="?"){ut("plus",q);continue}if(I&&I.value==="("||v.regex===!1){_e({type:"plus",value:q,output:Y});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||j.parens>0){_e({type:"plus",value:q});continue}_e({type:"plus",value:Y});continue}if(q==="@"){if(v.noextglob!==!0&&ge()==="("&&ge(2)!=="?"){_e({type:"at",extglob:!0,value:q,output:""});continue}_e({type:"text",value:q});continue}if(q!=="*"){(q==="$"||q==="^")&&(q=`\\${q}`);const ie=r.exec(he());ie&&(q+=ie[0],j.index+=ie[0].length),_e({type:"text",value:q});continue}if(I&&(I.type==="globstar"||I.star===!0)){I.type="star",I.star=!0,I.value+=q,I.output=te,j.backtrack=!0,j.globstar=!0,Ge(q);continue}let ue=he();if(v.noextglob!==!0&&/^\([^?]/.test(ue)){ut("star",q);continue}if(I.type==="star"){if(v.noglobstar===!0){Ge(q);continue}const ie=I.prev,Ee=ie.prev,We=ie.type==="slash"||ie.type==="bos",it=Ee&&(Ee.type==="star"||Ee.type==="globstar");if(v.bash===!0&&(!We||ue[0]&&ue[0]!=="/")){_e({type:"star",value:q,output:""});continue}const tt=j.braces>0&&(ie.type==="comma"||ie.type==="brace"),tn=Oe.length&&(ie.type==="pipe"||ie.type==="paren");if(!We&&ie.type!=="paren"&&!tt&&!tn){_e({type:"star",value:q,output:""});continue}for(;ue.slice(0,3)==="/**";){const Dt=m[j.index+4];if(Dt&&Dt!=="/")break;ue=ue.slice(3),Ge("/**",3)}if(ie.type==="bos"&&ot()){I.type="globstar",I.value+=q,I.output=z(v),j.output=I.output,j.globstar=!0,Ge(q);continue}if(ie.type==="slash"&&ie.prev.type!=="bos"&&!it&&ot()){j.output=j.output.slice(0,-(ie.output+I.output).length),ie.output=`(?:${ie.output}`,I.type="globstar",I.output=z(v)+(v.strictSlashes?")":"|$)"),I.value+=q,j.globstar=!0,j.output+=ie.output+I.output,Ge(q);continue}if(ie.type==="slash"&&ie.prev.type!=="bos"&&ue[0]==="/"){const Dt=ue[1]!==void 0?"|$":"";j.output=j.output.slice(0,-(ie.output+I.output).length),ie.output=`(?:${ie.output}`,I.type="globstar",I.output=`${z(v)}${X}|${X}${Dt})`,I.value+=q,j.output+=ie.output+I.output,j.globstar=!0,Ge(q+Fe()),_e({type:"slash",value:"/",output:""});continue}if(ie.type==="bos"&&ue[0]==="/"){I.type="globstar",I.value+=q,I.output=`(?:^|${X}|${z(v)}${X})`,j.output=I.output,j.globstar=!0,Ge(q+Fe()),_e({type:"slash",value:"/",output:""});continue}j.output=j.output.slice(0,-I.output.length),I.type="globstar",I.output=z(v),I.value+=q,j.output+=I.output,j.globstar=!0,Ge(q);continue}const He={type:"star",value:q,output:te};if(v.bash===!0){He.output=".*?",(I.type==="bos"||I.type==="slash")&&(He.output=Q+He.output),_e(He);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&v.regex===!0){He.output=q,_e(He);continue}(j.index===j.start||I.type==="slash"||I.type==="dot")&&(I.type==="dot"?(j.output+=je,I.output+=je):v.dot===!0?(j.output+=ke,I.output+=ke):(j.output+=Q,I.output+=Q),ge()!=="*"&&(j.output+=ne,I.output+=ne)),_e(He)}for(;j.brackets>0;){if(v.strictBrackets===!0)throw new SyntaxError(d("closing","]"));j.output=e.escapeLast(j.output,"["),nt("brackets")}for(;j.parens>0;){if(v.strictBrackets===!0)throw new SyntaxError(d("closing",")"));j.output=e.escapeLast(j.output,"("),nt("parens")}for(;j.braces>0;){if(v.strictBrackets===!0)throw new SyntaxError(d("closing","}"));j.output=e.escapeLast(j.output,"{"),nt("braces")}if(v.strictSlashes!==!0&&(I.type==="star"||I.type==="bracket")&&_e({type:"maybe_slash",value:"",output:`${X}?`}),j.backtrack===!0){j.output="";for(const ue of j.tokens)j.output+=ue.output!=null?ue.output:ue.value,ue.suffix&&(j.output+=ue.suffix)}return j};return h.fastpaths=(m,y)=>{const v={...y},x=typeof v.maxLength=="number"?Math.min(n,v.maxLength):n,_=m.length;if(_>x)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${x}`);m=o[m]||m;const{DOT_LITERAL:N,SLASH_LITERAL:E,ONE_CHAR:F,DOTS_SLASH:V,NO_DOT:J,NO_DOTS:K,NO_DOTS_SLASH:Y,STAR:X,START_ANCHOR:ne}=t.globChars(v.windows),ye=v.dot?K:J,de=v.dot?Y:J,je=v.capture?"":"?:",ke={negated:!1,prefix:""};let Ae=v.bash===!0?".*?":X;v.capture&&(Ae=`(${Ae})`);const Le=Q=>Q.noglobstar===!0?Ae:`(${je}(?:(?!${ne}${Q.dot?V:N}).)*?)`,M=Q=>{switch(Q){case"*":return`${ye}${F}${Ae}`;case".*":return`${N}${F}${Ae}`;case"*.*":return`${ye}${Ae}${N}${F}${Ae}`;case"*/*":return`${ye}${Ae}${E}${F}${de}${Ae}`;case"**":return ye+Le(v);case"**/*":return`(?:${ye}${Le(v)}${E})?${de}${F}${Ae}`;case"**/*.*":return`(?:${ye}${Le(v)}${E})?${de}${Ae}${N}${F}${Ae}`;case"**/.*":return`(?:${ye}${Le(v)}${E})?${N}${F}${Ae}`;default:{const ae=/^(.*?)\.(\w+)$/.exec(Q);if(!ae)return;const te=M(ae[1]);return te?te+N+ae[2]:void 0}}},w=e.removePrefix(m,ke);let z=M(w);return z&&v.strictSlashes!==!0&&(z+=`${E}?`),z},so=h,so}var oo,Pl;function iv(){if(Pl)return oo;Pl=1;const t=tv(),e=nv(),n=Wa(),i=Ga(),r=o=>o&&typeof o=="object"&&!Array.isArray(o),a=(o,l,d=!1)=>{if(Array.isArray(o)){const E=o.map(V=>a(V,l,d));return V=>{for(const J of E){const K=J(V);if(K)return K}return!1}}const h=r(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!h)throw new TypeError("Expected pattern to be a non-empty string");const m=l||{},y=m.windows,v=h?a.compileRe(o,l):a.makeRe(o,l,!1,!0),x=v.state;delete v.state;let _=()=>!1;if(m.ignore){const E={...l,ignore:null,onMatch:null,onResult:null};_=a(m.ignore,E,d)}const N=(E,F=!1)=>{const{isMatch:V,match:J,output:K}=a.test(E,v,l,{glob:o,posix:y}),Y={glob:o,state:x,regex:v,posix:y,input:E,output:K,match:J,isMatch:V};return typeof m.onResult=="function"&&m.onResult(Y),V===!1?(Y.isMatch=!1,F?Y:!1):_(E)?(typeof m.onIgnore=="function"&&m.onIgnore(Y),Y.isMatch=!1,F?Y:!1):(typeof m.onMatch=="function"&&m.onMatch(Y),F?Y:!0)};return d&&(N.state=x),N};return a.test=(o,l,d,{glob:h,posix:m}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const y=d||{},v=y.format||(m?n.toPosixSlashes:null);let x=o===h,_=x&&v?v(o):o;return x===!1&&(_=v?v(o):o,x=_===h),(x===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?x=a.matchBase(o,l,d,m):x=l.exec(_)),{isMatch:!!x,match:x,output:_}},a.matchBase=(o,l,d)=>(l instanceof RegExp?l:a.makeRe(l,d)).test(n.basename(o)),a.isMatch=(o,l,d)=>a(l,d)(o),a.parse=(o,l)=>Array.isArray(o)?o.map(d=>a.parse(d,l)):e(o,{...l,fastpaths:!1}),a.scan=(o,l)=>t(o,l),a.compileRe=(o,l,d=!1,h=!1)=>{if(d===!0)return o.output;const m=l||{},y=m.contains?"":"^",v=m.contains?"":"$";let x=`${y}(?:${o.output})${v}`;o&&o.negated===!0&&(x=`^(?!${x}).*$`);const _=a.toRegex(x,l);return h===!0&&(_.state=o),_},a.makeRe=(o,l={},d=!1,h=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let m={negated:!1,fastpaths:!0};return l.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&(m.output=e.fastpaths(o,l)),m.output||(m=e(o,l)),a.compileRe(m,l,d,h)},a.toRegex=(o,l)=>{try{const d=l||{};return new RegExp(o,d.flags||(d.nocase?"i":""))}catch(d){if(l&&l.debug===!0)throw d;return/$^/}},a.constants=i,oo=a,oo}var uo,Ll;function rv(){if(Ll)return uo;Ll=1;const t=iv(),e=Wa();function n(i,r,a=!1){return r&&(r.windows===null||r.windows===void 0)&&(r={...r,windows:e.isWindows()}),t(i,r,a)}return Object.assign(n,t),uo=n,uo}var av=rv();const $l=za(av),Ml="loglevel-patterns",Yr="loglevel:",lo="!",sv=et.INFO;class ov{constructor(e){fe(this,"projectPrefix");fe(this,"patternsCache",null);this.projectPrefix=`${Yr}${e}:`}getLevel(e){const n=this.loadAndUnifyPatterns();return this.resolveLogLevelFromPatterns(e,n)||sv}setLevel(e,n){const{level:i,override:r}=this.parseLogLevel(n),a=`${Yr}${e}`,o=r?`${i}${lo}`:i;localStorage.setItem(a,o),this.patternsCache=null}loadAndUnifyPatterns(){if(this.patternsCache)return this.patternsCache;const e=this.readPatternsFromJSON(),n=this.unifyWithIndividualKeys(e);return this.patternsCache=n,n}resolveLogLevelFromPatterns(e,n){let i;for(const[r,{level:a,override:o}]of Object.entries(n))if($l(r.toLowerCase())(e.toLowerCase())){if(o)return a;(!i||$l(r)(e))&&(i=a)}return i}readPatternsFromJSON(){try{const e=localStorage.getItem(Ml);return e?JSON.parse(e):{}}catch{return console.error("Failed to parse loglevel-patterns from localStorage"),{}}}unifyWithIndividualKeys(e){const n={...e};for(let i=0;i<localStorage.length;i++){const r=localStorage.key(i);if(!r||!r.startsWith(Yr)||r===Ml)continue;const a=r.replace(Yr,"").toLowerCase(),o=localStorage.getItem(r);if(!o)continue;const{level:l,override:d}=this.parseLogLevel(o);n[a]={level:l,override:d}}return n}parseLogLevel(e){const n=e.endsWith(lo),i=n?e.slice(0,-lo.length):e;if(!Zd(i))throw new pu(i);return{level:i,override:n}}}class uv{constructor(e,n){fe(this,"committed",!1);fe(this,"chainOptions",{});fe(this,"method",null);fe(this,"stack","");fe(this,"args",[]);this.adapter=e,n&&(this.chainOptions={...n}),Promise.resolve().then(()=>this.commit())}options(e){return this.chainOptions={...this.chainOptions,...e},this}trace(...e){return this.log("trace",e)}debug(...e){return this.log("debug",e)}info(...e){return this.log("info",e)}warn(...e){return this.log("warn",e)}error(...e){return this.log("error",e)}fatal(...e){return this.log("fatal",e)}log(e,n){var i;return this.method=e,this.args=n,this.stack=(i=new Error().stack)!=null?i:"",this}commit(){if(!this.committed&&(this.committed=!0,this.method)){const e=this.args[0],n=this.args.slice(1),i={stack:this.stack,content:{message:e,args:n},options:this.chainOptions};this.adapter[this.method](i)}}}let ef=class qo{constructor(e){fe(this,"adapter");this.adapter=e}static create(e){const n=new qo(e);return n.setMetadata({account:null,client:uf()}),n}child(e,n={}){return new qo(this.adapter.child(e,n))}lazyChild(e,n={}){let i;return new Proxy({},{get:(r,a,o)=>(i||(i=this.child(e,n)),Reflect.get(i,a,o))})}setMetadata(e){this.adapter.setMetadata(e)}setLevel(e){if(!Zd(e))throw new pu(e);this.adapter.setLevel(e)}createChain(e){return new uv(this.adapter,e)}trace(...e){return this.createChain().trace(...e)}debug(...e){return this.createChain().debug(...e)}info(...e){return this.createChain().info(...e)}warn(...e){return this.createChain().warn(...e)}error(...e){return this.createChain().error(...e)}fatal(...e){return this.createChain().fatal(...e)}options(e){return this.createChain(e)}};function lv(t){return Zn().logger.lazyChild(t)}function tf(t,e){return ef.create(new Vo({source:t,levelService:new ov(t),consoleLogger:new Zg,httpLogger:mu.create({db:e,project:t})}))}const cv="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let dv=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t));for(;t--;)e+=cv[n[t]&63];return e};const ka=(t=8)=>dv(t),nf=(t,e=!1)=>{const n=Object.entries(t).reduce((i,[r,a])=>a!==void 0&&(!e||a!==null)?`${i}${i?"&":""}${r}=${a}`:i,"");return n?`?${n}`:""},rf=t=>{const e=document.getElementById(t);return e?new URL(e.src).searchParams:new URLSearchParams};function fv(){const t=new Error().stack.split(`
31
+ `);return t.length<3?"":t[2].trim().substring(3)}function hv(t){return new Promise(e=>setTimeout(e,t))}const Pt=class Pt{constructor(){fe(this,"projectName","nizza");fe(this,"instanceId",ka());fe(this,"logger",tf(this.projectName,Kd));fe(this,"coreLogger",this.logger.child("core"));fe(this,"_logger",this.coreLogger.child("NizzaStore"));fe(this,"_config",null);fe(this,"_account");fe(this,"_accountStatus","idle");fe(this,"_productDataSource");fe(this,"_eventBus",new zd("nizza",this.coreLogger));fe(this,"activeAccountFetchId",null);gg(this,{_config:st,_account:st,_productDataSource:st,_accountStatus:st,config:_n,account:_n,accountName:_n,accountStatus:_n,setAccount:xt,configure:xt,refetchAccount:xt,setProductDataSource:xt,setAddToCartConfig:xt,setProductId:xt},{name:"NizzaStore",autoBind:!0}),this.refetchAccount=this.refetchAccount.bind(this)}static instance(){var n;if(!!((n=window==null?void 0:window.nizza)!=null&&n.store))Pt._instance=window.nizza.store;else{const i=new Pt;Pt._instance=i,Pt._instance.coreLogger.debug("Created new NizzaStore instance")}return window.nizza||(window.nizza={},window.nz={},Pt._instance.coreLogger.debug("Initialized nizza window object")),window.nizza.store=Pt._instance,window.nz=window.nizza,Pt._instance}async configure(e){try{this._logger.debug("Running configure with config:",e),await this.updateConfig(e)}catch(n){this.setAccountStatus("error"),this._logger.error("Error running configure",n)}}async updateConfig(e={}){var r,a;const{account:n,authToken:i}=(r=this._config)!=null?r:{};this._config={...this._config,...e},(a=this._config)!=null&&a.account&&(n!==this._config.account||i!==this._config.authToken)?(this._logger.debug(`Fetching account data for account: ${this._config.account}, authToken provided: ${!!this._config.authToken}`),this.logger.setMetadata({account:this._config.account}),await this.fetchAccount(this._config.account,this._config.authToken)):this._logger.debug("Skipped fetching account data as the account or authToken did not change"),e.getProductDataSource&&this.setProductDataSource(await e.getProductDataSource())}async fetchAccount(e,n){this.setAccountStatus("loading");const i=ka();this.activeAccountFetchId=i;try{const r=await Sf(e,n);if(this.activeAccountFetchId!==i){this._logger.debug("Fetch account request was superseded by a newer request");return}this.setAccount(r),this.setAccountStatus("success"),this._logger.debug("Account fetched and set successfully:",r)}catch(r){this.activeAccountFetchId===i&&(this.setAccountStatus("error"),r instanceof gu?this._logger.fatal("Nizza account not found",e).options({silent:!0}):this._logger.fatal("Unexpected error fetching account",r))}}setAccount(e){this._account=e}setAccountStatus(e){this._accountStatus=e}setProductDataSource(e){this._productDataSource=e}setProductId(e){this._config&&(this._config.productId=e)}setOrderFormId(e){this._config&&(this._config.orderFormId=e)}setAddToCartConfig(e){if(!this._config){const n="You cannot set addToCartConfig before running configure()";throw this._logger.error(n),new Error(n)}this._config.addToCartConfig=e}setAuthToken(e){this.updateConfig({authToken:e})}async refetchAccount(){var e;(e=this._config)!=null&&e.account&&await this.fetchAccount(this._config.account,this._config.authToken)}get version(){return Pt.version}get config(){return this._config}get account(){return this._account}get accountStatus(){return this._accountStatus}get accountName(){var e;return(e=this._config)==null?void 0:e.account}isPvtAccount(e){var n;return!!(e&&((n=this._config)!=null&&n.authToken))}isPubAccount(e){var n;return!!(e&&!((n=this._config)!=null&&n.authToken))}get productDataSource(){return this._productDataSource}get eventBus(){return this._eventBus}};fe(Pt,"version","8"),fe(Pt,"_instance");let _a=Pt;const Zn=t=>{const e=_a.instance();return fg(()=>!!e.account,()=>t==null?void 0:t(e)),e};function af(){return Pe.useMemo(()=>Zn(),[])}function sf(t,e){const n=af();return qd(()=>t(n),e)}const{coreLogger:pv}=Zn(),mv=pv.child("getClientTimeZone");function of(t=!1){var a,o,l;let e=null,n=null,i=null;try{e=(l=(o=(a=Intl.DateTimeFormat())==null?void 0:a.resolvedOptions())==null?void 0:o.timeZone)!=null?l:null;const d=-new Date().getTimezoneOffset();i=d;const h=d>=0?"+":"-",m=String(Math.floor(Math.abs(d)/60)).padStart(2,"0"),y=String(Math.abs(d)%60).padStart(2,"0");n=`${h}${m}:${y}`}catch(d){mv.error("Error obtaining time zone or offset",d)}const r={offset:n,offsetValue:i,value:e,country:null,included:null,label:null};if(t){const{country:d,included:h,label:m,...y}=r;return y}return r}function uf(){const t=typeof navigator!="undefined",e=t?navigator.userAgent:"server",{browser:n,os:i,device:r}=gv(e),a=t?navigator.language:"server",o=t&&navigator.languages?navigator.languages:[],l=typeof window!="undefined"&&window.screen?{width:window.screen.width,height:window.screen.height,colorDepth:window.screen.colorDepth}:null,d=t&&"connection"in navigator?{downlink:navigator.connection.downlink,effectiveType:navigator.connection.effectiveType,rtt:navigator.connection.rtt,saveData:navigator.connection.saveData}:null,h=t?navigator.hardwareConcurrency:null,m=t&&"deviceMemory"in navigator?navigator.deviceMemory:null,y=of(!0);return{userAgent:e,browser:n,os:i,device:r,language:a,languages:o,screen:l,connection:d,hardwareConcurrency:h,deviceMemory:m,timezone:y}}function gv(t){var i;const e={browser:[{name:"Edge",regex:/Edg\/([\d.]+)/},{name:"Chrome",regex:/Chrome\/([\d.]+)/},{name:"Firefox",regex:/Firefox\/([\d.]+)/},{name:"Safari",regex:/Version\/([\d.]+).*Safari/},{name:"Opera",regex:/OPR\/([\d.]+)/}],os:[{name:"Windows",regex:/Windows NT ([\d.]+)/},{name:"macOS",regex:/Mac OS X ([\d_]+)/},{name:"iOS",regex:/iPhone OS ([\d_]+)/},{name:"Android",regex:/Android ([\d.]+)/},{name:"Linux",regex:/Linux/}],device:[{name:"iPhone",regex:/iPhone/},{name:"iPad",regex:/iPad/},{name:"Android",regex:/Android/}]},n=r=>{var o;const a=e[r].find(l=>l.regex.test(t));return{name:a?a.name:"Unknown",version:a&&((o=t.match(a.regex))==null?void 0:o[1].replace(/_/g,"."))||"Unknown"}};return{browser:n("browser"),os:n("os"),device:{model:n("device").name,type:n("device").name!=="Unknown"?"Mobile":"Desktop",vendor:((i=t.match(/; (\w+) Build/))==null?void 0:i[1])||"Unknown"}}}var lf=(t=>(t.VTEX="VTEX",t.VTEX_IO="VTEX-IO",t.VTEX_CMS="PORTAL-VTEX",t.PLATFORM="PLATFORM",t.UNKNOWN="UNKNOWN",t))(lf||{}),cf=(t=>(t.PLATFORM="platform_module",t.ADENDA="subscription_module",t.APP_STORE="app_store",t))(cf||{}),df=(t=>(t.ACTIVE="active_contract",t.INACTIVE="inactive_contract",t))(df||{}),ff=(t=>(t.LITE="lite",t.STANDARD="standard",t.PRO="pro",t))(ff||{}),hf=(t=>(t.LITE="PLAN_LITE",t.STANDARD="PLAN_ESTANDAR",t.PRO="PLAN_PRO",t.NONE="NO_PLAN",t))(hf||{}),pf=(t=>(t.PAST="past",t.LIVE="live",t.FUTURE="future",t))(pf||{});class gu extends cn{constructor(e){super("NIZZA_ACCOUNT_NOT_FOUND_ERROR",`Error finding account: ${e}`)}}class mf extends cn{constructor(e){super("NIZZA_PLAN_NOT_FOUND_ERROR",`Error finding plan: ${e}`)}}class gf extends cn{constructor(e){super("NIZZA_CREATE_PLAN_ERROR",`Error creating plan: ${e.plan}`,e)}}const jl=`${_i.apiUrls.restV1}/plans`;class vf{async get(e){const i=`/info${nf({planType:e})}`,r=jl+i,{data:a}=await qn({url:r});return a}async create(e){const n=`${jl}/create`,{success:i}=await qn({url:n,method:"POST",body:JSON.stringify(e)});if(!i)throw new gf(e)}}function vv(t){const{host:e,account:n,username:i,createdAt:r,subscriptionType:a,installationDateApp:o,...l}=t;return{...l,account:n,host:e!=null?e:null,username:i!=null?i:n,createdAt:new Date(r),subscriptionType:a!=null?a:null,installationDateApp:new Date(o)}}function yv(t){const{host:e,...n}=t;return{...n,host:e!=null?e:null,plan:{}}}const bv=`${_i.apiUrls.restV1}/accounts/v2`;class yf{async get(e){const n=`${bv}/${e}`,{data:i}=await qn({url:n});return i?yv(i):null}}const kv=`${_i.apiUrls.restV1}/accounts/v2/pvt`;class _v{async get(e,n){const i=`${kv}/${e}`,{data:r}=await qn({url:i,headers:{authorization:`Bearer ${n}`}});return r?vv(r):null}}class bf{constructor(e,n,i){this.publicAccountRepo=e,this.privateAccountRepo=n,this.accountPlanRepo=i}async get(e,n){try{const i=n?await this.privateAccountRepo.get(e,n):await this.publicAccountRepo.get(e);if(!i)throw new gu(e);const r=await this.accountPlanRepo.get(i.descriptionPlan);if(!r)throw new mf(i.descriptionPlan);return{...i,plan:r}}catch(i){throw new su(i)}}}const Sv=new yf,Nv=new _v,Ev=new vf,kf=new bf(Sv,Nv,Ev),_f=()=>{const{account:t,accountName:e,accountStatus:n,refetchAccount:i,isPvtAccount:r,isPubAccount:a}=sf(h=>({account:h.account,accountName:h.accountName,accountStatus:h.accountStatus,refetchAccount:h.refetchAccount,isPvtAccount:h.isPvtAccount,isPubAccount:h.isPubAccount})),o=["idle","loading"].includes(n);return{account:t,accountName:e,isLoading:o,isError:n==="error",isSuccess:n==="success",accountStatus:n,refetchAccount:i,isPvtAccount:r,isPubAccount:a}};async function Sf(t,e){return kf.get(t,e)}var Nf=(t=>(t.Created="CREATED",t.Finalized="FINALIZED",t.Live="LIVE",t.Starting="STARTING",t))(Nf||{}),Ef=(t=>(t.Add="add",t.Remove="remove",t))(Ef||{}),wf=(t=>(t.Active="active",t.Inactive="inactive",t))(wf||{});const wv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Av={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Ov={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},xv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Tv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ManageCollectionProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ManageCollectionProductInInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"manageCollectionProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Cv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchCollections"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}},{kind:"Field",name:{kind:"Name",value:"products"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"link"}},{kind:"Field",name:{kind:"Name",value:"pictures"}},{kind:"Field",name:{kind:"Name",value:"price"}},{kind:"Field",name:{kind:"Name",value:"salesprice"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"createdat"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Rv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateCollection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdateCollectionInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCollection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Fv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindMinimalEvent"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EventData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"thumbnailsPath"}},{kind:"Field",name:{kind:"Name",value:"recordVideoPath"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"thumbnails"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Dv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchMinimalEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchEventInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchEvent"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"EventArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"thumbnailsPath"}},{kind:"Field",name:{kind:"Name",value:"recordVideoPath"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"status"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Iv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"BlockUser"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BlockUserInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"blockUser"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BlockUserSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Pv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ChangeAccountUsername"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ChangeUsernameInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"changeAccountUsername"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChangeUsernameSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Lv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DeleteChatInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DeleteChatMessageSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},$v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetAllChatMessageInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChatMessageArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"connectionId"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"email"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"idEvent"}},{kind:"Field",name:{kind:"Name",value:"sendDate"}},{kind:"Field",name:{kind:"Name",value:"sessionId"}},{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"username"}},{kind:"Field",name:{kind:"Name",value:"isAdmin"}},{kind:"Field",name:{kind:"Name",value:"urlGif"}},{kind:"Field",name:{kind:"Name",value:"second"}},{kind:"Field",name:{kind:"Name",value:"ip"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Af={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetChatRoomToken"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetChatRoomInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getChatRoomToken"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ChatRoomTokenData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"token"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Mv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"PinChatMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"PinChatInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pinChatMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PinChatMessageSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},jv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"highlightProduct"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"HighlightProductInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"highlightProduct"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"HighlightProductSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Bv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"deleteAllCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerInputAccount"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteAllCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Uv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getAllCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerSuccessArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"account"}},{kind:"Field",name:{kind:"Name",value:"data"}},{kind:"Field",name:{kind:"Name",value:"section"}},{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Vv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateCustomization"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CustomPlayerInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateCustomPlayer"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},qv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"sendAddToCart"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddToCartInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sendAddToCart"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"AddToCartSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Hv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetTimeLine"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetTimeLineInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getTimeLine"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"TimeLineArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"time"}},{kind:"Field",name:{kind:"Name",value:"likes"}},{kind:"Field",name:{kind:"Name",value:"comments"}},{kind:"Field",name:{kind:"Name",value:"viewers"}},{kind:"Field",name:{kind:"Name",value:"orders"}},{kind:"Field",name:{kind:"Name",value:"minute"}},{kind:"Field",name:{kind:"Name",value:"hour"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Kv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AppendProductsToSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"RelateToProductsSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"appendProductsSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},zv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreatePlayListInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createPlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CreatePlayListSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Gv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateSnackVideoBatch"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Wv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteRelationshipWithSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoRelationshipKeys"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteRelationshipSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Error"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}}]}}]}}]}}]},Jv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"DeleteSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deleteSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ActionSnackVideoSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},Yv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindManySnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindManySnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findManySnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Xv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetAllSnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getAllSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoCreatedArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"snackVideos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"created"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"totalItems"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Qv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPlayLists"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"QueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getPlayLists"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlayListArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"created"}},{kind:"Field",name:{kind:"Name",value:"videoAmount"}},{kind:"Field",name:{kind:"Name",value:"productAmount"}},{kind:"Field",name:{kind:"Name",value:"updated"}},{kind:"Field",name:{kind:"Name",value:"videos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},Zv={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSnackVideoRelationships"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoRelationshipInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getRelationshipSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"RelationshipSnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sourceEntity"}},{kind:"Field",name:{kind:"Name",value:"attributeId"}}]}}]}}]}}]}}]},ey={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchSnackVideos"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"SearchInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"searchSnackVideos"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoCreatedArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"snackVideos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"uploadProgress"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"eventId"}},{kind:"Field",name:{kind:"Name",value:"eventName"}},{kind:"Field",name:{kind:"Name",value:"created"}}]}},{kind:"Field",name:{kind:"Name",value:"cursor"}},{kind:"Field",name:{kind:"Name",value:"totalItems"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},ty={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdatePlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UpdatePlayListInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updatePlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"UpdatePlayListSuccess"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}}]}}]}}]}}]},ny={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"FindByProductSnackVideo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FindByProductSnackVideoInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"findByProductSnackVideo"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"SnackVideoArray"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},iy={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPlayList"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"data"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"GetPlayListQueryInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getPlayList"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"Variable",name:{kind:"Name",value:"data"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PlayListData"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"videos"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"productId"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"thumbnailUrl"}},{kind:"Field",name:{kind:"Name",value:"duration"}},{kind:"Field",name:{kind:"Name",value:"transmitionType"}},{kind:"Field",name:{kind:"Name",value:"order"}},{kind:"Field",name:{kind:"Name",value:"productName"}},{kind:"Field",name:{kind:"Name",value:"productImageUrl"}}]}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ErrorGeneral"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"statusCode"}},{kind:"Field",name:{kind:"Name",value:"timestamp"}}]}}]}}]}}]},ry=Object.freeze(Object.defineProperty({__proto__:null,AddCollectionDocument:wv,AppendProductsToSnackVideoDocument:Kv,BlockUserDocument:Iv,ChangeAccountUsernameDocument:Pv,CreatePlayListDocument:zv,CreateSnackVideoBatchDocument:Gv,DeleteAllCustomizationDocument:Bv,DeleteChatMessageDocument:Lv,DeleteCollectionDocument:Av,DeleteRelationshipWithSnackVideoDocument:Wv,DeleteSnackVideoDocument:Jv,EventStatus:Nf,FindByProductSnackVideoDocument:ny,FindCollectionDocument:Ov,FindManySnackVideosDocument:Yv,FindMinimalEventDocument:Fv,GetAllChatMessageDocument:$v,GetAllCollectionsDocument:xv,GetAllCustomizationDocument:Uv,GetAllSnackVideosDocument:Xv,GetChatRoomTokenDocument:Af,GetPlayListDocument:iy,GetPlayListsDocument:Qv,GetSnackVideoRelationshipsDocument:Zv,GetTimeLineDocument:Hv,HighlightProductDocument:jv,ManageCollectionProductDocument:Tv,Methods:Ef,PinChatMessageDocument:Mv,SearchCollectionsDocument:Cv,SearchMinimalEventsDocument:Dv,SearchSnackVideosDocument:ey,SendAddToCartDocument:qv,Status:wf,UpdateCollectionDocument:Rv,UpdateCustomizationDocument:Vv,UpdatePlayListDocument:ty},Symbol.toStringTag,{value:"Module"}));var Ja=(t=>(t.OPEN_TAB="openTab",t.OPEN_VARIATION_SELECTOR="openVariationSelector",t.ADD_TO_CART="addToCart",t))(Ja||{});function ay(t){return{class:t,_value:null,get value(){return this._value||(this._value=new t,Object.freeze(this)),this._value}}}var dn=(t=>(t.Local="local",t.VtexLegacy="vtexlegacy",t.VtexIO="vtexio",t.VtexFastStore="faststore",t.Platform="platform",t.External="external",t))(dn||{}),vu=(t=>(t.PROD="prod",t.DEV="dev",t.LOCAL="local",t))(vu||{});const{coreLogger:sy}=Zn(),Ho=sy.child("addToCartHooks"),Ko={errorAddingToCart:"addToCartHooks.notification.error",errorOpeningVariationSelector:"addToCartHooks.notification.error",errorOpeningNewTab:"addToCartHooks.notification.error",successAddingToCart:"addToCartHooks.notification.success"};async function oy(t){const e={...t,action:{type:Ja.ADD_TO_CART,exec:()=>Ho.error("action no implemented in validate hook")}};try{const n=await uy(e),i=await ly(n);await cy(i)}catch(n){Ho.error("error unhandled",n)}}async function uy(t){var a,o;const{context:e,userAddToCartConfig:n}=t,i=(a=n==null?void 0:n.hooks)==null?void 0:a.transform;let r=t.product;if(i)try{r=await i({product:{...r},data:(o=e.data)!=null?o:{}})}catch(l){Sa("transform",l)}return{...t,product:r}}async function ly(t){var d,h;const{context:e,hookStrategy:n,userAddToCartConfig:i,product:r}=t,a=Of(t),o=(d=i==null?void 0:i.hooks)==null?void 0:d.validate;let l=n.validate({...t,actionFactory:a});if(o)try{l=await o({product:{...r},defaultAction:{...l},action:a,data:(h=e.data)!=null?h:{}})}catch(m){Sa("validate",m)}return{...t,action:l,actionFactory:a}}async function cy(t){var E;const{eventBus:e}=Zn(),{product:n,userAddToCartConfig:i,notifyFactory:r,action:a,actionFactory:o}=t,{isVariationSelectorOpen:l,data:d={}}=t.context,h=(E=i==null?void 0:i.hooks)==null?void 0:E.end,m=a.type===Ja.ADD_TO_CART;let y=null,v=!1;const x=()=>{!m||!l||o.openVariationSelector(!1).exec()},_=()=>{!m||v||(y?r.error(Ko.errorAddingToCart):r.success(Ko.successAddingToCart))},N=()=>{const F={product:n,actionType:a.type,success:!y,error:y};e.emit(Wd.ATCH_ACTION_EXECUTED,F)};try{if(!a.type||!a.exec)throw new Error("Invalid action object, missing keys 'type' or 'exec'");await a.exec()}catch(F){Sa("end",F),y=F}if(h)try{v=!!await h({data:d,error:y,notify:r,actionExecuted:a})}catch(F){Sa("end",F)}x(),_(),N()}function Of(t){const{actionFactory:e,userAddToCartConfig:n}=t,i=r=>Object.entries(r!=null?r:{}).reduce((a,[o,l])=>({...a,[o]:d=>({type:o,exec:()=>l(d)})}),{});return{...i(e),...i(n==null?void 0:n.actionFactory)}}function Sa(t,e){Ho.error(`addToCartHooks error running ${t}: `,e)}class xf{constructor(e){fe(this,"aggregate");fe(this,"_numSetPropsApplied",0);this.aggregate=e}setProps(e){for(const[n,i]of Object.entries(e))n in this.aggregate&&(this.aggregate[n]=i);this._numSetPropsApplied++}get isFirstSetProps(){return this._numSetPropsApplied===1}}function Tf(t){return new xf(t)}class dy{constructor(e){fe(this,"_value");e!==void 0&&(this._value=e)}get value(){return this._value}}var kt=(t=>(t.GENERAL_ERROR="GENERAL_ERROR",t.AXIOS_ERROR="AXIOS_ERROR",t.NETWORK_ERROR="NETWORK_ERROR",t.CONFIG_ERROR="CONFIG_ERROR",t.TIMEOUT_ERROR="TIMEOUT_ERROR",t.AUTH_ERROR="AUTH_ERROR",t.NOT_FOUND="NOT_FOUND",t.VALIDATION_ERROR="VALIDATION_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.BAD_REQUEST="BAD_REQUEST",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.CONFLICT="CONFLICT",t.GONE="GONE",t.UNSUPPORTED_MEDIA_TYPE="UNSUPPORTED_MEDIA_TYPE",t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.INTERNAL_SERVER_ERROR="INTERNAL_SERVER_ERROR",t.SERVICE_UNAVAILABLE="SERVICE_UNAVAILABLE",t))(kt||{});function Cf(t,e){return function(){return t.apply(e,arguments)}}const{toString:fy}=Object.prototype,{getPrototypeOf:yu}=Object,Ya=(t=>e=>{const n=fy.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Gt=t=>(t=t.toLowerCase(),e=>Ya(e)===t),Xa=t=>e=>typeof e===t,{isArray:Oi}=Array,or=Xa("undefined");function hy(t){return t!==null&&!or(t)&&t.constructor!==null&&!or(t.constructor)&&Rt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Rf=Gt("ArrayBuffer");function py(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Rf(t.buffer),e}const my=Xa("string"),Rt=Xa("function"),Ff=Xa("number"),Qa=t=>t!==null&&typeof t=="object",gy=t=>t===!0||t===!1,aa=t=>{if(Ya(t)!=="object")return!1;const e=yu(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},vy=Gt("Date"),yy=Gt("File"),by=Gt("Blob"),ky=Gt("FileList"),_y=t=>Qa(t)&&Rt(t.pipe),Sy=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Rt(t.append)&&((e=Ya(t))==="formdata"||e==="object"&&Rt(t.toString)&&t.toString()==="[object FormData]"))},Ny=Gt("URLSearchParams"),[Ey,wy,Ay,Oy]=["ReadableStream","Request","Response","Headers"].map(Gt),xy=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vr(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let i,r;if(typeof t!="object"&&(t=[t]),Oi(t))for(i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else{const a=n?Object.getOwnPropertyNames(t):Object.keys(t),o=a.length;let l;for(i=0;i<o;i++)l=a[i],e.call(null,t[l],l,t)}}function Df(t,e){e=e.toLowerCase();const n=Object.keys(t);let i=n.length,r;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const jn=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,If=t=>!or(t)&&t!==jn;function zo(){const{caseless:t}=If(this)&&this||{},e={},n=(i,r)=>{const a=t&&Df(e,r)||r;aa(e[a])&&aa(i)?e[a]=zo(e[a],i):aa(i)?e[a]=zo({},i):Oi(i)?e[a]=i.slice():e[a]=i};for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&vr(arguments[i],n);return e}const Ty=(t,e,n,{allOwnKeys:i}={})=>(vr(e,(r,a)=>{n&&Rt(r)?t[a]=Cf(r,n):t[a]=r},{allOwnKeys:i}),t),Cy=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ry=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Fy=(t,e,n,i)=>{let r,a,o;const l={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),a=r.length;a-- >0;)o=r[a],(!i||i(o,t,e))&&!l[o]&&(e[o]=t[o],l[o]=!0);t=n!==!1&&yu(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Dy=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const i=t.indexOf(e,n);return i!==-1&&i===n},Iy=t=>{if(!t)return null;if(Oi(t))return t;let e=t.length;if(!Ff(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Py=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&yu(Uint8Array)),Ly=(t,e)=>{const i=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=i.next())&&!r.done;){const a=r.value;e.call(t,a[0],a[1])}},$y=(t,e)=>{let n;const i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},My=Gt("HTMLFormElement"),jy=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),Bl=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),By=Gt("RegExp"),Pf=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),i={};vr(n,(r,a)=>{let o;(o=e(r,a,t))!==!1&&(i[a]=o||r)}),Object.defineProperties(t,i)},Uy=t=>{Pf(t,(e,n)=>{if(Rt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=t[n];if(Rt(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Vy=(t,e)=>{const n={},i=r=>{r.forEach(a=>{n[a]=!0})};return Oi(t)?i(t):i(String(t).split(e)),n},qy=()=>{},Hy=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,co="abcdefghijklmnopqrstuvwxyz",Ul="0123456789",Lf={DIGIT:Ul,ALPHA:co,ALPHA_DIGIT:co+co.toUpperCase()+Ul},Ky=(t=16,e=Lf.ALPHA_DIGIT)=>{let n="";const{length:i}=e;for(;t--;)n+=e[Math.random()*i|0];return n};function zy(t){return!!(t&&Rt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Gy=t=>{const e=new Array(10),n=(i,r)=>{if(Qa(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[r]=i;const a=Oi(i)?[]:{};return vr(i,(o,l)=>{const d=n(o,r+1);!or(d)&&(a[l]=d)}),e[r]=void 0,a}}return i};return n(t,0)},Wy=Gt("AsyncFunction"),Jy=t=>t&&(Qa(t)||Rt(t))&&Rt(t.then)&&Rt(t.catch),$f=((t,e)=>t?setImmediate:e?((n,i)=>(jn.addEventListener("message",({source:r,data:a})=>{r===jn&&a===n&&i.length&&i.shift()()},!1),r=>{i.push(r),jn.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Rt(jn.postMessage)),Yy=typeof queueMicrotask!="undefined"?queueMicrotask.bind(jn):typeof process!="undefined"&&process.nextTick||$f,H={isArray:Oi,isArrayBuffer:Rf,isBuffer:hy,isFormData:Sy,isArrayBufferView:py,isString:my,isNumber:Ff,isBoolean:gy,isObject:Qa,isPlainObject:aa,isReadableStream:Ey,isRequest:wy,isResponse:Ay,isHeaders:Oy,isUndefined:or,isDate:vy,isFile:yy,isBlob:by,isRegExp:By,isFunction:Rt,isStream:_y,isURLSearchParams:Ny,isTypedArray:Py,isFileList:ky,forEach:vr,merge:zo,extend:Ty,trim:xy,stripBOM:Cy,inherits:Ry,toFlatObject:Fy,kindOf:Ya,kindOfTest:Gt,endsWith:Dy,toArray:Iy,forEachEntry:Ly,matchAll:$y,isHTMLForm:My,hasOwnProperty:Bl,hasOwnProp:Bl,reduceDescriptors:Pf,freezeMethods:Uy,toObjectSet:Vy,toCamelCase:jy,noop:qy,toFiniteNumber:Hy,findKey:Df,global:jn,isContextDefined:If,ALPHABET:Lf,generateString:Ky,isSpecCompliantForm:zy,toJSONObject:Gy,isAsyncFn:Wy,isThenable:Jy,setImmediate:$f,asap:Yy};function Ce(t,e,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}H.inherits(Ce,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}});const Mf=Ce.prototype,jf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{jf[t]={value:t}});Object.defineProperties(Ce,jf);Object.defineProperty(Mf,"isAxiosError",{value:!0});Ce.from=(t,e,n,i,r,a)=>{const o=Object.create(Mf);return H.toFlatObject(t,o,function(d){return d!==Error.prototype},l=>l!=="isAxiosError"),Ce.call(o,t.message,e,n,i,r),o.cause=t,o.name=t.name,a&&Object.assign(o,a),o};const Xy=null;function Go(t){return H.isPlainObject(t)||H.isArray(t)}function Bf(t){return H.endsWith(t,"[]")?t.slice(0,-2):t}function Vl(t,e,n){return t?t.concat(e).map(function(r,a){return r=Bf(r),!n&&a?"["+r+"]":r}).join(n?".":""):e}function Qy(t){return H.isArray(t)&&!t.some(Go)}const Zy=H.toFlatObject(H,{},null,function(e){return/^is[A-Z]/.test(e)});function Za(t,e,n){if(!H.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=H.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(N,E){return!H.isUndefined(E[N])});const i=n.metaTokens,r=n.visitor||m,a=n.dots,o=n.indexes,d=(n.Blob||typeof Blob!="undefined"&&Blob)&&H.isSpecCompliantForm(e);if(!H.isFunction(r))throw new TypeError("visitor must be a function");function h(_){if(_===null)return"";if(H.isDate(_))return _.toISOString();if(!d&&H.isBlob(_))throw new Ce("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(_)||H.isTypedArray(_)?d&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function m(_,N,E){let F=_;if(_&&!E&&typeof _=="object"){if(H.endsWith(N,"{}"))N=i?N:N.slice(0,-2),_=JSON.stringify(_);else if(H.isArray(_)&&Qy(_)||(H.isFileList(_)||H.endsWith(N,"[]"))&&(F=H.toArray(_)))return N=Bf(N),F.forEach(function(J,K){!(H.isUndefined(J)||J===null)&&e.append(o===!0?Vl([N],K,a):o===null?N:N+"[]",h(J))}),!1}return Go(_)?!0:(e.append(Vl(E,N,a),h(_)),!1)}const y=[],v=Object.assign(Zy,{defaultVisitor:m,convertValue:h,isVisitable:Go});function x(_,N){if(!H.isUndefined(_)){if(y.indexOf(_)!==-1)throw Error("Circular reference detected in "+N.join("."));y.push(_),H.forEach(_,function(F,V){(!(H.isUndefined(F)||F===null)&&r.call(e,F,H.isString(V)?V.trim():V,N,v))===!0&&x(F,N?N.concat(V):[V])}),y.pop()}}if(!H.isObject(t))throw new TypeError("data must be an object");return x(t),e}function ql(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function bu(t,e){this._pairs=[],t&&Za(t,this,e)}const Uf=bu.prototype;Uf.append=function(e,n){this._pairs.push([e,n])};Uf.toString=function(e){const n=e?function(i){return e.call(this,i,ql)}:ql;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function eb(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vf(t,e,n){if(!e)return t;const i=n&&n.encode||eb,r=n&&n.serialize;let a;if(r?a=r(e,n):a=H.isURLSearchParams(e)?e.toString():new bu(e,n).toString(i),a){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class Hl{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){H.forEach(this.handlers,function(i){i!==null&&e(i)})}}const qf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tb=typeof URLSearchParams!="undefined"?URLSearchParams:bu,nb=typeof FormData!="undefined"?FormData:null,ib=typeof Blob!="undefined"?Blob:null,rb={isBrowser:!0,classes:{URLSearchParams:tb,FormData:nb,Blob:ib},protocols:["http","https","file","blob","url","data"]},ku=typeof window!="undefined"&&typeof document!="undefined",Wo=typeof navigator=="object"&&navigator||void 0,ab=ku&&(!Wo||["ReactNative","NativeScript","NS"].indexOf(Wo.product)<0),sb=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ob=ku&&window.location.href||"http://localhost",ub=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ku,hasStandardBrowserEnv:ab,hasStandardBrowserWebWorkerEnv:sb,navigator:Wo,origin:ob},Symbol.toStringTag,{value:"Module"})),Et={...ub,...rb};function lb(t,e){return Za(t,new Et.classes.URLSearchParams,Object.assign({visitor:function(n,i,r,a){return Et.isNode&&H.isBuffer(n)?(this.append(i,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function cb(t){return H.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function db(t){const e={},n=Object.keys(t);let i;const r=n.length;let a;for(i=0;i<r;i++)a=n[i],e[a]=t[a];return e}function Hf(t){function e(n,i,r,a){let o=n[a++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),d=a>=n.length;return o=!o&&H.isArray(r)?r.length:o,d?(H.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!l):((!r[o]||!H.isObject(r[o]))&&(r[o]=[]),e(n,i,r[o],a)&&H.isArray(r[o])&&(r[o]=db(r[o])),!l)}if(H.isFormData(t)&&H.isFunction(t.entries)){const n={};return H.forEachEntry(t,(i,r)=>{e(cb(i),r,n,0)}),n}return null}function fb(t,e,n){if(H.isString(t))try{return(e||JSON.parse)(t),H.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}const yr={transitional:qf,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",r=i.indexOf("application/json")>-1,a=H.isObject(e);if(a&&H.isHTMLForm(e)&&(e=new FormData(e)),H.isFormData(e))return r?JSON.stringify(Hf(e)):e;if(H.isArrayBuffer(e)||H.isBuffer(e)||H.isStream(e)||H.isFile(e)||H.isBlob(e)||H.isReadableStream(e))return e;if(H.isArrayBufferView(e))return e.buffer;if(H.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return lb(e,this.formSerializer).toString();if((l=H.isFileList(e))||i.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Za(l?{"files[]":e}:e,d&&new d,this.formSerializer)}}return a||r?(n.setContentType("application/json",!1),fb(e)):e}],transformResponse:[function(e){const n=this.transitional||yr.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(H.isResponse(e)||H.isReadableStream(e))return e;if(e&&H.isString(e)&&(i&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(l){if(o)throw l.name==="SyntaxError"?Ce.from(l,Ce.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Et.classes.FormData,Blob:Et.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],t=>{yr.headers[t]={}});const hb=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pb=t=>{const e={};let n,i,r;return t&&t.split(`
32
+ `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||e[n]&&hb[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e},Kl=Symbol("internals");function qi(t){return t&&String(t).trim().toLowerCase()}function sa(t){return t===!1||t==null?t:H.isArray(t)?t.map(sa):String(t)}function mb(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}const gb=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function fo(t,e,n,i,r){if(H.isFunction(i))return i.call(this,e,n);if(r&&(e=n),!!H.isString(e)){if(H.isString(i))return e.indexOf(i)!==-1;if(H.isRegExp(i))return i.test(e)}}function vb(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function yb(t,e){const n=H.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(r,a,o){return this[i].call(this,e,r,a,o)},configurable:!0})})}let wt=class{constructor(e){e&&this.set(e)}set(e,n,i){const r=this;function a(l,d,h){const m=qi(d);if(!m)throw new Error("header name must be a non-empty string");const y=H.findKey(r,m);(!y||r[y]===void 0||h===!0||h===void 0&&r[y]!==!1)&&(r[y||d]=sa(l))}const o=(l,d)=>H.forEach(l,(h,m)=>a(h,m,d));if(H.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(H.isString(e)&&(e=e.trim())&&!gb(e))o(pb(e),n);else if(H.isHeaders(e))for(const[l,d]of e.entries())a(d,l,i);else e!=null&&a(n,e,i);return this}get(e,n){if(e=qi(e),e){const i=H.findKey(this,e);if(i){const r=this[i];if(!n)return r;if(n===!0)return mb(r);if(H.isFunction(n))return n.call(this,r,i);if(H.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=qi(e),e){const i=H.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||fo(this,this[i],i,n)))}return!1}delete(e,n){const i=this;let r=!1;function a(o){if(o=qi(o),o){const l=H.findKey(i,o);l&&(!n||fo(i,i[l],l,n))&&(delete i[l],r=!0)}}return H.isArray(e)?e.forEach(a):a(e),r}clear(e){const n=Object.keys(this);let i=n.length,r=!1;for(;i--;){const a=n[i];(!e||fo(this,this[a],a,e,!0))&&(delete this[a],r=!0)}return r}normalize(e){const n=this,i={};return H.forEach(this,(r,a)=>{const o=H.findKey(i,a);if(o){n[o]=sa(r),delete n[a];return}const l=e?vb(a):String(a).trim();l!==a&&delete n[a],n[l]=sa(r),i[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return H.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=e&&H.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
33
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){const i=(this[Kl]=this[Kl]={accessors:{}}).accessors,r=this.prototype;function a(o){const l=qi(o);i[l]||(yb(r,o),i[l]=!0)}return H.isArray(e)?e.forEach(a):a(e),this}};wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(wt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});H.freezeMethods(wt);function ho(t,e){const n=this||yr,i=e||n,r=wt.from(i.headers);let a=i.data;return H.forEach(t,function(l){a=l.call(n,a,r.normalize(),e?e.status:void 0)}),r.normalize(),a}function Kf(t){return!!(t&&t.__CANCEL__)}function xi(t,e,n){Ce.call(this,t==null?"canceled":t,Ce.ERR_CANCELED,e,n),this.name="CanceledError"}H.inherits(xi,Ce,{__CANCEL__:!0});function zf(t,e,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new Ce("Request failed with status code "+n.status,[Ce.ERR_BAD_REQUEST,Ce.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bb(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function kb(t,e){t=t||10;const n=new Array(t),i=new Array(t);let r=0,a=0,o;return e=e!==void 0?e:1e3,function(d){const h=Date.now(),m=i[a];o||(o=h),n[r]=d,i[r]=h;let y=a,v=0;for(;y!==r;)v+=n[y++],y=y%t;if(r=(r+1)%t,r===a&&(a=(a+1)%t),h-o<e)return;const x=m&&h-m;return x?Math.round(v*1e3/x):void 0}}function _b(t,e){let n=0,i=1e3/e,r,a;const o=(h,m=Date.now())=>{n=m,r=null,a&&(clearTimeout(a),a=null),t.apply(null,h)};return[(...h)=>{const m=Date.now(),y=m-n;y>=i?o(h,m):(r=h,a||(a=setTimeout(()=>{a=null,o(r)},i-y)))},()=>r&&o(r)]}const Na=(t,e,n=3)=>{let i=0;const r=kb(50,250);return _b(a=>{const o=a.loaded,l=a.lengthComputable?a.total:void 0,d=o-i,h=r(d),m=o<=l;i=o;const y={loaded:o,total:l,progress:l?o/l:void 0,bytes:d,rate:h||void 0,estimated:h&&l&&m?(l-o)/h:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(y)},n)},zl=(t,e)=>{const n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},Gl=t=>(...e)=>H.asap(()=>t(...e)),Sb=Et.hasStandardBrowserEnv?function(){const e=Et.navigator&&/(msie|trident)/i.test(Et.navigator.userAgent),n=document.createElement("a");let i;function r(a){let o=a;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=r(window.location.href),function(o){const l=H.isString(o)?r(o):o;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}(),Nb=Et.hasStandardBrowserEnv?{write(t,e,n,i,r,a){const o=[t+"="+encodeURIComponent(e)];H.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),H.isString(i)&&o.push("path="+i),H.isString(r)&&o.push("domain="+r),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Eb(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function wb(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Gf(t,e){return t&&!Eb(e)?wb(t,e):e}const Wl=t=>t instanceof wt?{...t}:t;function zn(t,e){e=e||{};const n={};function i(h,m,y){return H.isPlainObject(h)&&H.isPlainObject(m)?H.merge.call({caseless:y},h,m):H.isPlainObject(m)?H.merge({},m):H.isArray(m)?m.slice():m}function r(h,m,y){if(H.isUndefined(m)){if(!H.isUndefined(h))return i(void 0,h,y)}else return i(h,m,y)}function a(h,m){if(!H.isUndefined(m))return i(void 0,m)}function o(h,m){if(H.isUndefined(m)){if(!H.isUndefined(h))return i(void 0,h)}else return i(void 0,m)}function l(h,m,y){if(y in e)return i(h,m);if(y in t)return i(void 0,h)}const d={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(h,m)=>r(Wl(h),Wl(m),!0)};return H.forEach(Object.keys(Object.assign({},t,e)),function(m){const y=d[m]||r,v=y(t[m],e[m],m);H.isUndefined(v)&&y!==l||(n[m]=v)}),n}const Wf=t=>{const e=zn({},t);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:a,headers:o,auth:l}=e;e.headers=o=wt.from(o),e.url=Vf(Gf(e.baseURL,e.url),t.params,t.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let d;if(H.isFormData(n)){if(Et.hasStandardBrowserEnv||Et.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((d=o.getContentType())!==!1){const[h,...m]=d?d.split(";").map(y=>y.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...m].join("; "))}}if(Et.hasStandardBrowserEnv&&(i&&H.isFunction(i)&&(i=i(e)),i||i!==!1&&Sb(e.url))){const h=r&&a&&Nb.read(a);h&&o.set(r,h)}return e},Ab=typeof XMLHttpRequest!="undefined",Ob=Ab&&function(t){return new Promise(function(n,i){const r=Wf(t);let a=r.data;const o=wt.from(r.headers).normalize();let{responseType:l,onUploadProgress:d,onDownloadProgress:h}=r,m,y,v,x,_;function N(){x&&x(),_&&_(),r.cancelToken&&r.cancelToken.unsubscribe(m),r.signal&&r.signal.removeEventListener("abort",m)}let E=new XMLHttpRequest;E.open(r.method.toUpperCase(),r.url,!0),E.timeout=r.timeout;function F(){if(!E)return;const J=wt.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),Y={data:!l||l==="text"||l==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:J,config:t,request:E};zf(function(ne){n(ne),N()},function(ne){i(ne),N()},Y),E=null}"onloadend"in E?E.onloadend=F:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(F)},E.onabort=function(){E&&(i(new Ce("Request aborted",Ce.ECONNABORTED,t,E)),E=null)},E.onerror=function(){i(new Ce("Network Error",Ce.ERR_NETWORK,t,E)),E=null},E.ontimeout=function(){let K=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const Y=r.transitional||qf;r.timeoutErrorMessage&&(K=r.timeoutErrorMessage),i(new Ce(K,Y.clarifyTimeoutError?Ce.ETIMEDOUT:Ce.ECONNABORTED,t,E)),E=null},a===void 0&&o.setContentType(null),"setRequestHeader"in E&&H.forEach(o.toJSON(),function(K,Y){E.setRequestHeader(Y,K)}),H.isUndefined(r.withCredentials)||(E.withCredentials=!!r.withCredentials),l&&l!=="json"&&(E.responseType=r.responseType),h&&([v,_]=Na(h,!0),E.addEventListener("progress",v)),d&&E.upload&&([y,x]=Na(d),E.upload.addEventListener("progress",y),E.upload.addEventListener("loadend",x)),(r.cancelToken||r.signal)&&(m=J=>{E&&(i(!J||J.type?new xi(null,t,E):J),E.abort(),E=null)},r.cancelToken&&r.cancelToken.subscribe(m),r.signal&&(r.signal.aborted?m():r.signal.addEventListener("abort",m)));const V=bb(r.url);if(V&&Et.protocols.indexOf(V)===-1){i(new Ce("Unsupported protocol "+V+":",Ce.ERR_BAD_REQUEST,t));return}E.send(a||null)})},xb=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,r;const a=function(h){if(!r){r=!0,l();const m=h instanceof Error?h:this.reason;i.abort(m instanceof Ce?m:new xi(m instanceof Error?m.message:m))}};let o=e&&setTimeout(()=>{o=null,a(new Ce(`timeout ${e} of ms exceeded`,Ce.ETIMEDOUT))},e);const l=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(a):h.removeEventListener("abort",a)}),t=null)};t.forEach(h=>h.addEventListener("abort",a));const{signal:d}=i;return d.unsubscribe=()=>H.asap(l),d}},Tb=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let i=0,r;for(;i<n;)r=i+e,yield t.slice(i,r),i=r},Cb=async function*(t,e){for await(const n of Rb(t))yield*Tb(n,e)},Rb=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:i}=await e.read();if(n)break;yield i}}finally{await e.cancel()}},Jl=(t,e,n,i)=>{const r=Cb(t,e);let a=0,o,l=d=>{o||(o=!0,i&&i(d))};return new ReadableStream({async pull(d){try{const{done:h,value:m}=await r.next();if(h){l(),d.close();return}let y=m.byteLength;if(n){let v=a+=y;n(v)}d.enqueue(new Uint8Array(m))}catch(h){throw l(h),h}},cancel(d){return l(d),r.return()}},{highWaterMark:2})},es=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Jf=es&&typeof ReadableStream=="function",Fb=es&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Yf=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Db=Jf&&Yf(()=>{let t=!1;const e=new Request(Et.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Yl=64*1024,Jo=Jf&&Yf(()=>H.isReadableStream(new Response("").body)),Ea={stream:Jo&&(t=>t.body)};es&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Ea[e]&&(Ea[e]=H.isFunction(t[e])?n=>n[e]():(n,i)=>{throw new Ce(`Response type '${e}' is not supported`,Ce.ERR_NOT_SUPPORT,i)})})})(new Response);const Ib=async t=>{if(t==null)return 0;if(H.isBlob(t))return t.size;if(H.isSpecCompliantForm(t))return(await new Request(Et.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(H.isArrayBufferView(t)||H.isArrayBuffer(t))return t.byteLength;if(H.isURLSearchParams(t)&&(t=t+""),H.isString(t))return(await Fb(t)).byteLength},Pb=async(t,e)=>{const n=H.toFiniteNumber(t.getContentLength());return n==null?Ib(e):n},Lb=es&&(async t=>{let{url:e,method:n,data:i,signal:r,cancelToken:a,timeout:o,onDownloadProgress:l,onUploadProgress:d,responseType:h,headers:m,withCredentials:y="same-origin",fetchOptions:v}=Wf(t);h=h?(h+"").toLowerCase():"text";let x=xb([r,a&&a.toAbortSignal()],o),_;const N=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let E;try{if(d&&Db&&n!=="get"&&n!=="head"&&(E=await Pb(m,i))!==0){let Y=new Request(e,{method:"POST",body:i,duplex:"half"}),X;if(H.isFormData(i)&&(X=Y.headers.get("content-type"))&&m.setContentType(X),Y.body){const[ne,ye]=zl(E,Na(Gl(d)));i=Jl(Y.body,Yl,ne,ye)}}H.isString(y)||(y=y?"include":"omit");const F="credentials"in Request.prototype;_=new Request(e,{...v,signal:x,method:n.toUpperCase(),headers:m.normalize().toJSON(),body:i,duplex:"half",credentials:F?y:void 0});let V=await fetch(_);const J=Jo&&(h==="stream"||h==="response");if(Jo&&(l||J&&N)){const Y={};["status","statusText","headers"].forEach(de=>{Y[de]=V[de]});const X=H.toFiniteNumber(V.headers.get("content-length")),[ne,ye]=l&&zl(X,Na(Gl(l),!0))||[];V=new Response(Jl(V.body,Yl,ne,()=>{ye&&ye(),N&&N()}),Y)}h=h||"text";let K=await Ea[H.findKey(Ea,h)||"text"](V,t);return!J&&N&&N(),await new Promise((Y,X)=>{zf(Y,X,{data:K,headers:wt.from(V.headers),status:V.status,statusText:V.statusText,config:t,request:_})})}catch(F){throw N&&N(),F&&F.name==="TypeError"&&/fetch/i.test(F.message)?Object.assign(new Ce("Network Error",Ce.ERR_NETWORK,t,_),{cause:F.cause||F}):Ce.from(F,F&&F.code,t,_)}}),Yo={http:Xy,xhr:Ob,fetch:Lb};H.forEach(Yo,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Xl=t=>`- ${t}`,$b=t=>H.isFunction(t)||t===null||t===!1,Xf={getAdapter:t=>{t=H.isArray(t)?t:[t];const{length:e}=t;let n,i;const r={};for(let a=0;a<e;a++){n=t[a];let o;if(i=n,!$b(n)&&(i=Yo[(o=String(n)).toLowerCase()],i===void 0))throw new Ce(`Unknown adapter '${o}'`);if(i)break;r[o||"#"+a]=i}if(!i){const a=Object.entries(r).map(([l,d])=>`adapter ${l} `+(d===!1?"is not supported by the environment":"is not available in the build"));let o=e?a.length>1?`since :
34
+ `+a.map(Xl).join(`
35
+ `):" "+Xl(a[0]):"as no adapter specified";throw new Ce("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:Yo};function po(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new xi(null,t)}function Ql(t){return po(t),t.headers=wt.from(t.headers),t.data=ho.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Xf.getAdapter(t.adapter||yr.adapter)(t).then(function(i){return po(t),i.data=ho.call(t,t.transformResponse,i),i.headers=wt.from(i.headers),i},function(i){return Kf(i)||(po(t),i&&i.response&&(i.response.data=ho.call(t,t.transformResponse,i.response),i.response.headers=wt.from(i.response.headers))),Promise.reject(i)})}const Qf="1.7.7",_u={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{_u[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});const Zl={};_u.transitional=function(e,n,i){function r(a,o){return"[Axios v"+Qf+"] Transitional option '"+a+"'"+o+(i?". "+i:"")}return(a,o,l)=>{if(e===!1)throw new Ce(r(o," has been removed"+(n?" in "+n:"")),Ce.ERR_DEPRECATED);return n&&!Zl[o]&&(Zl[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(a,o,l):!0}};function Mb(t,e,n){if(typeof t!="object")throw new Ce("options must be an object",Ce.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let r=i.length;for(;r-- >0;){const a=i[r],o=e[a];if(o){const l=t[a],d=l===void 0||o(l,a,t);if(d!==!0)throw new Ce("option "+a+" must be "+d,Ce.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ce("Unknown option "+a,Ce.ERR_BAD_OPTION)}}const Xo={assertOptions:Mb,validators:_u},bn=Xo.validators;let Vn=class{constructor(e){this.defaults=e,this.interceptors={request:new Hl,response:new Hl}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let r;Error.captureStackTrace?Error.captureStackTrace(r={}):r=new Error;const a=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?a&&!String(i.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(i.stack+=`
36
+ `+a):i.stack=a}catch{}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=zn(this.defaults,n);const{transitional:i,paramsSerializer:r,headers:a}=n;i!==void 0&&Xo.assertOptions(i,{silentJSONParsing:bn.transitional(bn.boolean),forcedJSONParsing:bn.transitional(bn.boolean),clarifyTimeoutError:bn.transitional(bn.boolean)},!1),r!=null&&(H.isFunction(r)?n.paramsSerializer={serialize:r}:Xo.assertOptions(r,{encode:bn.function,serialize:bn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=a&&H.merge(a.common,a[n.method]);a&&H.forEach(["delete","get","head","post","put","patch","common"],_=>{delete a[_]}),n.headers=wt.concat(o,a);const l=[];let d=!0;this.interceptors.request.forEach(function(N){typeof N.runWhen=="function"&&N.runWhen(n)===!1||(d=d&&N.synchronous,l.unshift(N.fulfilled,N.rejected))});const h=[];this.interceptors.response.forEach(function(N){h.push(N.fulfilled,N.rejected)});let m,y=0,v;if(!d){const _=[Ql.bind(this),void 0];for(_.unshift.apply(_,l),_.push.apply(_,h),v=_.length,m=Promise.resolve(n);y<v;)m=m.then(_[y++],_[y++]);return m}v=l.length;let x=n;for(y=0;y<v;){const _=l[y++],N=l[y++];try{x=_(x)}catch(E){N.call(this,E);break}}try{m=Ql.call(this,x)}catch(_){return Promise.reject(_)}for(y=0,v=h.length;y<v;)m=m.then(h[y++],h[y++]);return m}getUri(e){e=zn(this.defaults,e);const n=Gf(e.baseURL,e.url);return Vf(n,e.params,e.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(e){Vn.prototype[e]=function(n,i){return this.request(zn(i||{},{method:e,url:n,data:(i||{}).data}))}});H.forEach(["post","put","patch"],function(e){function n(i){return function(a,o,l){return this.request(zn(l||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:a,data:o}))}}Vn.prototype[e]=n(),Vn.prototype[e+"Form"]=n(!0)});let jb=class Zf{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const i=this;this.promise.then(r=>{if(!i._listeners)return;let a=i._listeners.length;for(;a-- >0;)i._listeners[a](r);i._listeners=null}),this.promise.then=r=>{let a;const o=new Promise(l=>{i.subscribe(l),a=l}).then(r);return o.cancel=function(){i.unsubscribe(a)},o},e(function(a,o,l){i.reason||(i.reason=new xi(a,o,l),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Zf(function(r){e=r}),cancel:e}}};function Bb(t){return function(n){return t.apply(null,n)}}function Ub(t){return H.isObject(t)&&t.isAxiosError===!0}const Qo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Qo).forEach(([t,e])=>{Qo[e]=t});function eh(t){const e=new Vn(t),n=Cf(Vn.prototype.request,e);return H.extend(n,Vn.prototype,e,{allOwnKeys:!0}),H.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return eh(zn(t,r))},n}const Ze=eh(yr);Ze.Axios=Vn;Ze.CanceledError=xi;Ze.CancelToken=jb;Ze.isCancel=Kf;Ze.VERSION=Qf;Ze.toFormData=Za;Ze.AxiosError=Ce;Ze.Cancel=Ze.CanceledError;Ze.all=function(e){return Promise.all(e)};Ze.spread=Bb;Ze.isAxiosError=Ub;Ze.mergeConfig=zn;Ze.AxiosHeaders=wt;Ze.formToJSON=t=>Hf(H.isHTMLForm(t)?new FormData(t):t);Ze.getAdapter=Xf.getAdapter;Ze.HttpStatusCode=Qo;Ze.default=Ze;const{Axios:jS,AxiosError:BS,CanceledError:US,isCancel:VS,CancelToken:qS,VERSION:HS,all:KS,Cancel:zS,isAxiosError:GS,spread:WS,toFormData:JS,AxiosHeaders:YS,HttpStatusCode:XS,formToJSON:QS,getAdapter:ZS,mergeConfig:eN}=Ze,Vb={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class wa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||Vb,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}warn(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}error(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"error","")}deprecate(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,i,r){return r&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new wa(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new wa(this.logger,e)}}var Xt=new wa;class ts{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const r=this.observers[i].get(n)||0;this.observers[i].set(n,r+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[l,d]=o;for(let h=0;h<d;h++)l(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,d]=o;for(let h=0;h<d;h++)l.apply(l,[e,...i])})}}const Hi=()=>{let t,e;const n=new Promise((i,r)=>{t=i,e=r});return n.resolve=t,n.reject=e,n},ec=t=>t==null?"":""+t,qb=(t,e,n)=>{t.forEach(i=>{e[i]&&(n[i]=e[i])})},Hb=/###/g,tc=t=>t&&t.indexOf("###")>-1?t.replace(Hb,"."):t,nc=t=>!t||typeof t=="string",Qi=(t,e,n)=>{const i=typeof e!="string"?e:e.split(".");let r=0;for(;r<i.length-1;){if(nc(t))return{};const a=tc(i[r]);!t[a]&&n&&(t[a]=new n),Object.prototype.hasOwnProperty.call(t,a)?t=t[a]:t={},++r}return nc(t)?{}:{obj:t,k:tc(i[r])}},ic=(t,e,n)=>{const{obj:i,k:r}=Qi(t,e,Object);if(i!==void 0||e.length===1){i[r]=n;return}let a=e[e.length-1],o=e.slice(0,e.length-1),l=Qi(t,o,Object);for(;l.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),l=Qi(t,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${a}`]!="undefined"&&(l.obj=void 0);l.obj[`${l.k}.${a}`]=n},Kb=(t,e,n,i)=>{const{obj:r,k:a}=Qi(t,e,Object);r[a]=r[a]||[],r[a].push(n)},Aa=(t,e)=>{const{obj:n,k:i}=Qi(t,e);if(n)return n[i]},zb=(t,e,n)=>{const i=Aa(t,n);return i!==void 0?i:Aa(e,n)},th=(t,e,n)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?typeof t[i]=="string"||t[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?n&&(t[i]=e[i]):th(t[i],e[i],n):t[i]=e[i]);return t},li=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Gb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Wb=t=>typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>Gb[e]):t;class Jb{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const Yb=[" ",",","?","!",";"],Xb=new Jb(20),Qb=(t,e,n)=>{e=e||"",n=n||"";const i=Yb.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(i.length===0)return!0;const r=Xb.getRegExp(`(${i.map(o=>o==="?"?"\\?":o).join("|")})`);let a=!r.test(t);if(!a){const o=t.indexOf(n);o>0&&!r.test(t.substring(0,o))&&(a=!0)}return a},Zo=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const i=e.split(n);let r=t;for(let a=0;a<i.length;){if(!r||typeof r!="object")return;let o,l="";for(let d=a;d<i.length;++d)if(d!==a&&(l+=n),l+=i[d],o=r[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&d<i.length-1)continue;a+=d-a+1;break}r=o}return r},Oa=t=>t&&t.indexOf("_")>0?t.replace("_","-"):t;class rc extends ts{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,o=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,n],i&&(Array.isArray(i)?l.push(...i):typeof i=="string"&&a?l.push(...i.split(a)):l.push(i)));const d=Aa(this.data,l);return!d&&!n&&!i&&e.indexOf(".")>-1&&(e=l[0],n=l[1],i=l.slice(2).join(".")),d||!o||typeof i!="string"?d:Zo(this.data&&this.data[e]&&this.data[e][n],i,a)}addResource(e,n,i,r){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let l=[e,n];i&&(l=l.concat(o?i.split(o):i)),e.indexOf(".")>-1&&(l=e.split("."),r=n,n=l[1]),this.addNamespaces(n),ic(this.data,l,r),a.silent||this.emit("added",e,n,i,r)}addResources(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const a in i)(typeof i[a]=="string"||Array.isArray(i[a]))&&this.addResource(e,n,a,i[a],{silent:!0});r.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,r,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[e,n];e.indexOf(".")>-1&&(l=e.split("."),r=i,i=n,n=l[1]),this.addNamespaces(n);let d=Aa(this.data,l)||{};o.skipCopy||(i=JSON.parse(JSON.stringify(i))),r?th(d,i,a):d={...d,...i},ic(this.data,l,d),o.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var nh={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,r){return t.forEach(a=>{this.processors[a]&&(e=this.processors[a].process(e,n,i,r))}),e}};const ac={};class xa extends ts{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),qb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Xt.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const i=this.resolve(e,n);return i&&i.res!==void 0}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let a=n.ns||this.options.defaultNS||[];const o=i&&e.indexOf(i)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Qb(e,i,r);if(o&&!l){const d=e.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:e,namespaces:a};const h=e.split(i);(i!==r||i===r&&this.options.ns.indexOf(h[0])>-1)&&(a=h.shift()),e=h.join(r)}return typeof a=="string"&&(a=[a]),{key:e,namespaces:a}}translate(e,n,i){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),d=l[l.length-1],h=n.lng||this.language,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&h.toLowerCase()==="cimode"){if(m){const K=n.nsSeparator||this.options.nsSeparator;return r?{res:`${d}${K}${o}`,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:`${d}${K}${o}`}return r?{res:o,usedKey:o,exactUsedKey:o,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(n)}:o}const y=this.resolve(e,n);let v=y&&y.res;const x=y&&y.usedKey||o,_=y&&y.exactUsedKey||o,N=Object.prototype.toString.apply(v),E=["[object Number]","[object Function]","[object RegExp]"],F=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,V=!this.i18nFormat||this.i18nFormat.handleAsObject;if(V&&v&&(typeof v!="string"&&typeof v!="boolean"&&typeof v!="number")&&E.indexOf(N)<0&&!(typeof F=="string"&&Array.isArray(v))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,v,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(y.res=K,y.usedParams=this.getUsedParamsDetails(n),y):K}if(a){const K=Array.isArray(v),Y=K?[]:{},X=K?_:x;for(const ne in v)if(Object.prototype.hasOwnProperty.call(v,ne)){const ye=`${X}${a}${ne}`;Y[ne]=this.translate(ye,{...n,joinArrays:!1,ns:l}),Y[ne]===ye&&(Y[ne]=v[ne])}v=Y}}else if(V&&typeof F=="string"&&Array.isArray(v))v=v.join(F),v&&(v=this.extendTranslation(v,e,n,i));else{let K=!1,Y=!1;const X=n.count!==void 0&&typeof n.count!="string",ne=xa.hasDefaultValue(n),ye=X?this.pluralResolver.getSuffix(h,n.count,n):"",de=n.ordinal&&X?this.pluralResolver.getSuffix(h,n.count,{ordinal:!1}):"",je=X&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),ke=je&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${ye}`]||n[`defaultValue${de}`]||n.defaultValue;!this.isValidLookup(v)&&ne&&(K=!0,v=ke),this.isValidLookup(v)||(Y=!0,v=o);const Le=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:v,M=ne&&ke!==v&&this.options.updateMissing;if(Y||K||M){if(this.logger.log(M?"updateKey":"missingKey",h,d,o,M?ke:v),a){const ae=this.resolve(o,{...n,keySeparator:!1});ae&&ae.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.")}let w=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let ae=0;ae<z.length;ae++)w.push(z[ae]);else this.options.saveMissingTo==="all"?w=this.languageUtils.toResolveHierarchy(n.lng||this.language):w.push(n.lng||this.language);const Q=(ae,te,j)=>{const Oe=ne&&j!==v?j:Le;this.options.missingKeyHandler?this.options.missingKeyHandler(ae,d,te,Oe,M,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(ae,d,te,Oe,M,n),this.emit("missingKey",ae,d,te,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&X?w.forEach(ae=>{const te=this.pluralResolver.getSuffixes(ae,n);je&&n[`defaultValue${this.options.pluralSeparator}zero`]&&te.indexOf(`${this.options.pluralSeparator}zero`)<0&&te.push(`${this.options.pluralSeparator}zero`),te.forEach(j=>{Q([ae],o+j,n[`defaultValue${j}`]||ke)})}):Q(w,o,ke))}v=this.extendTranslation(v,e,n,y,i),Y&&v===o&&this.options.appendNamespaceToMissingKey&&(v=`${d}:${o}`),(Y||K)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?v=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}:${o}`:o,K?v:void 0):v=this.options.parseMissingKeyHandler(v))}return r?(y.res=v,y.usedParams=this.getUsedParamsDetails(n),y):v}extendTranslation(e,n,i,r,a){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const h=typeof e=="string"&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(h){const v=e.match(this.interpolator.nestingRegexp);m=v&&v.length}let y=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),e=this.interpolator.interpolate(e,y,i.lng||this.language||r.usedLng,i),h){const v=e.match(this.interpolator.nestingRegexp),x=v&&v.length;m<x&&(i.nest=!1)}!i.lng&&this.options.compatibilityAPI!=="v1"&&r&&r.res&&(i.lng=this.language||r.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var v=arguments.length,x=new Array(v),_=0;_<v;_++)x[_]=arguments[_];return a&&a[0]===x[0]&&!i.context?(o.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${n[0]}`),null):o.translate(...x,n)},i)),i.interpolation&&this.interpolator.reset()}const l=i.postProcess||this.options.postProcess,d=typeof l=="string"?[l]:l;return e!=null&&d&&d.length&&i.applyPostProcessor!==!1&&(e=nh.handle(d,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,r,a,o,l;return typeof e=="string"&&(e=[e]),e.forEach(d=>{if(this.isValidLookup(i))return;const h=this.extractFromKey(d,n),m=h.key;r=m;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const v=n.count!==void 0&&typeof n.count!="string",x=v&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),_=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",N=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);y.forEach(E=>{this.isValidLookup(i)||(l=E,!ac[`${N[0]}-${E}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(ac[`${N[0]}-${E}`]=!0,this.logger.warn(`key "${r}" for languages "${N.join(", ")}" won't get resolved as namespace "${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!!!")),N.forEach(F=>{if(this.isValidLookup(i))return;o=F;const V=[m];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(V,m,F,E,n);else{let K;v&&(K=this.pluralResolver.getSuffix(F,n.count,n));const Y=`${this.options.pluralSeparator}zero`,X=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(V.push(m+K),n.ordinal&&K.indexOf(X)===0&&V.push(m+K.replace(X,this.options.pluralSeparator)),x&&V.push(m+Y)),_){const ne=`${m}${this.options.contextSeparator}${n.context}`;V.push(ne),v&&(V.push(ne+K),n.ordinal&&K.indexOf(X)===0&&V.push(ne+K.replace(X,this.options.pluralSeparator)),x&&V.push(ne+Y))}}let J;for(;J=V.pop();)this.isValidLookup(i)||(a=J,i=this.getResource(F,E,J,n))}))})}),{res:i,usedKey:r,exactUsedKey:a,usedLng:o,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,i,r):this.resourceStore.getResource(e,n,i,r)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&typeof e.replace!="string";let r=i?e.replace:e;if(i&&typeof e.count!="undefined"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!i){r={...r};for(const a of n)delete r[a]}return r}static hasDefaultValue(e){const n="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}}const mo=t=>t.charAt(0).toUpperCase()+t.slice(1);class sc{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xt.create("languageUtils")}getScriptPartFromCode(e){if(e=Oa(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Oa(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map(r=>r.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=mo(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=mo(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=mo(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;const r=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(r))&&(n=r)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;const r=this.getLanguagePartFromCode(i);if(this.isSupportedCode(r))return n=r;n=this.options.supportedLngs.find(a=>{if(a===r)return a;if(!(a.indexOf("-")<0&&r.indexOf("-")<0)&&(a.indexOf("-")>0&&r.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===r||a.indexOf(r)===0&&r.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){const i=this.getFallbackCodes(n||this.options.fallbackLng||[],e),r=[],a=o=>{o&&(this.isSupportedCode(o)?r.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):typeof e=="string"&&a(this.formatLanguageCode(e)),i.forEach(o=>{r.indexOf(o)<0&&a(this.formatLanguageCode(o))}),r}}let Zb=[{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}],ek={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const tk=["v1","v2","v3"],nk=["v4"],oc={zero:0,one:1,two:2,few:3,many:4,other:5},ik=()=>{const t={};return Zb.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:ek[e.fc]}})}),t};class rk{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=Xt.create("pluralResolver"),(!this.options.compatibilityJSON||nk.includes(this.options.compatibilityJSON))&&(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=ik(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{const i=Oa(e==="dev"?"en":e),r=n.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:i,type:r});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];const o=new Intl.PluralRules(i,{type:r});return this.pluralRulesCache[a]=o,o}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(r=>`${n}${r}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((r,a)=>oc[r]-oc[a]).map(r=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r}`):i.numbers.map(r=>this.getSuffix(e,r,n)):[]}getSuffix(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=this.getRule(e,i);return r?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${r.select(n)}`:this.getSuffixRetroCompatible(r,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const i=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let r=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(r===2?r="plural":r===1&&(r=""));const a=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return this.options.compatibilityJSON==="v1"?r===1?"":typeof r=="number"?`_plural_${r.toString()}`:a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!tk.includes(this.options.compatibilityJSON)}}const uc=function(t,e,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=zb(t,e,n);return!a&&r&&typeof n=="string"&&(a=Zo(t,n,i),a===void 0&&(a=Zo(e,n,i))),a},go=t=>t.replace(/\$/g,"$$$$");class ak{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xt.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:r,prefix:a,prefixEscaped:o,suffix:l,suffixEscaped:d,formatSeparator:h,unescapeSuffix:m,unescapePrefix:y,nestingPrefix:v,nestingPrefixEscaped:x,nestingSuffix:_,nestingSuffixEscaped:N,nestingOptionsSeparator:E,maxReplaces:F,alwaysFormat:V}=e.interpolation;this.escape=n!==void 0?n:Wb,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=a?li(a):o||"{{",this.suffix=l?li(l):d||"}}",this.formatSeparator=h||",",this.unescapePrefix=m?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=v?li(v):x||li("$t("),this.nestingSuffix=_?li(_):N||li(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=F||1e3,this.alwaysFormat=V!==void 0?V:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,i)=>n&&n.source===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,i,r){let a,o,l;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=x=>{if(x.indexOf(this.formatSeparator)<0){const F=uc(n,d,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(F,void 0,i,{...r,...n,interpolationkey:x}):F}const _=x.split(this.formatSeparator),N=_.shift().trim(),E=_.join(this.formatSeparator).trim();return this.format(uc(n,d,N,this.options.keySeparator,this.options.ignoreJSONStructure),E,i,{...r,...n,interpolationkey:N})};this.resetRegExp();const m=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,y=r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>go(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?go(this.escape(x)):go(x)}].forEach(x=>{for(l=0;a=x.regex.exec(e);){const _=a[1].trim();if(o=h(_),o===void 0)if(typeof m=="function"){const E=m(e,a,r);o=typeof E=="string"?E:""}else if(r&&Object.prototype.hasOwnProperty.call(r,_))o="";else if(y){o=a[0];continue}else this.logger.warn(`missed to pass in variable ${_} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=ec(o));const N=x.safeValue(o);if(e=e.replace(a[0],N),y?(x.regex.lastIndex+=o.length,x.regex.lastIndex-=a[0].length):x.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,a,o;const l=(d,h)=>{const m=this.nestingOptionsSeparator;if(d.indexOf(m)<0)return d;const y=d.split(new RegExp(`${m}[ ]*{`));let v=`{${y[1]}`;d=y[0],v=this.interpolate(v,o);const x=v.match(/'/g),_=v.match(/"/g);(x&&x.length%2===0&&!_||_.length%2!==0)&&(v=v.replace(/'/g,'"'));try{o=JSON.parse(v),h&&(o={...h,...o})}catch(N){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,N),`${d}${m}${v}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,d};for(;r=this.nestingRegexp.exec(e);){let d=[];o={...i},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let h=!1;if(r[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(r[1])){const m=r[1].split(this.formatSeparator).map(y=>y.trim());r[1]=m.shift(),d=m,h=!0}if(a=n(l.call(this,r[1].trim(),o),o),a&&r[0]===e&&typeof a!="string")return a;typeof a!="string"&&(a=ec(a)),a||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),a=""),h&&(a=d.reduce((m,y)=>this.format(m,y,i.lng,{...i,interpolationkey:r[1].trim()}),a.trim())),e=e.replace(r[0],a),this.regexp.lastIndex=0}return e}}const sk=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const i=t.split("(");e=i[0].toLowerCase().trim();const r=i[1].substring(0,i[1].length-1);e==="currency"&&r.indexOf(":")<0?n.currency||(n.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?n.range||(n.range=r.trim()):r.split(";").forEach(o=>{if(o){const[l,...d]=o.split(":"),h=d.join(":").trim().replace(/^'+|'+$/g,""),m=l.trim();n[m]||(n[m]=h),h==="false"&&(n[m]=!1),h==="true"&&(n[m]=!0),isNaN(h)||(n[m]=parseInt(h,10))}})}return{formatName:e,formatOptions:n}},ci=t=>{const e={};return(n,i,r)=>{let a=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(a={...a,[r.interpolationkey]:void 0});const o=i+JSON.stringify(a);let l=e[o];return l||(l=t(Oa(i),r),e[o]=l),l(n)}};class ok{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Xt.create("formatter"),this.options=e,this.formats={number:ci((n,i)=>{const r=new Intl.NumberFormat(n,{...i});return a=>r.format(a)}),currency:ci((n,i)=>{const r=new Intl.NumberFormat(n,{...i,style:"currency"});return a=>r.format(a)}),datetime:ci((n,i)=>{const r=new Intl.DateTimeFormat(n,{...i});return a=>r.format(a)}),relativetime:ci((n,i)=>{const r=new Intl.RelativeTimeFormat(n,{...i});return a=>r.format(a,i.range||"day")}),list:ci((n,i)=>{const r=new Intl.ListFormat(n,{...i});return a=>r.format(a)})},this.init(e)}init(e){const i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=ci(n)}format(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const a=n.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(l=>l.indexOf(")")>-1)){const l=a.findIndex(d=>d.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,l)].join(this.formatSeparator)}return a.reduce((l,d)=>{const{formatName:h,formatOptions:m}=sk(d);if(this.formats[h]){let y=l;try{const v=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},x=v.locale||v.lng||r.locale||r.lng||i;y=this.formats[h](l,x,{...m,...r,...v})}catch(v){this.logger.warn(v)}return y}else this.logger.warn(`there was no format function for ${h}`);return l},e)}}const uk=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class lk extends ts{constructor(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=r,this.logger=Xt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,r.backend,r)}queueLoad(e,n,i,r){const a={},o={},l={},d={};return e.forEach(h=>{let m=!0;n.forEach(y=>{const v=`${h}|${y}`;!i.reload&&this.store.hasResourceBundle(h,y)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?o[v]===void 0&&(o[v]=!0):(this.state[v]=1,m=!1,o[v]===void 0&&(o[v]=!0),a[v]===void 0&&(a[v]=!0),d[y]===void 0&&(d[y]=!0)))}),m||(l[h]=!0)}),(Object.keys(a).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(d)}}loaded(e,n,i){const r=e.split("|"),a=r[0],o=r[1];n&&this.emit("failedLoading",a,o,n),!n&&i&&this.store.addResourceBundle(a,o,i,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&i&&(this.state[e]=0);const l={};this.queue.forEach(d=>{Kb(d.loaded,[a],o),uk(d,e),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(h=>{l[h]||(l[h]={});const m=d.loaded[h];m.length&&m.forEach(y=>{l[h][y]===void 0&&(l[h][y]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(d=>!d.done)}read(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:r,wait:a,callback:o});return}this.readingCalls++;const l=(h,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.callback)}if(h&&m&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,i,r+1,a*2,o)},a);return}o(h,m)},d=this.backend[i].bind(this.backend);if(d.length===2){try{const h=d(e,n);h&&typeof h.then=="function"?h.then(m=>l(null,m)).catch(l):l(null,h)}catch(h){l(h)}return}return d(e,n,l)}prepareLoading(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=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."),r&&r();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const a=this.queueLoad(e,n,i,r);if(!a.toLoad.length)return a.pending.length||r(),null;a.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=e.split("|"),r=i[0],a=i[1];this.read(r,a,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${a} for language ${r} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${a} for language ${r}`,l),this.loaded(e,o,l)})}saveMissing(e,n,i,r,a){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" 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}if(!(i==null||i==="")){if(this.backend&&this.backend.create){const d={...o,isUpdate:a},h=this.backend.create.bind(this.backend);if(h.length<6)try{let m;h.length===5?m=h(e,n,i,r,d):m=h(e,n,i,r),m&&typeof m.then=="function"?m.then(y=>l(null,y)).catch(l):l(null,m)}catch(m){l(m)}else h(e,n,i,r,l,d)}!e||!e[0]||this.store.addResource(e[0],n,i,r)}}}const lc=()=>({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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{e[i]=n[i]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),cc=t=>(typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Xr=()=>{},ck=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class ur extends ts{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=cc(e),this.services={},this.logger=Xt,this.modules={external:[]},ck(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(i=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const r=lc();this.options={...r,...this.options,...cc(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const a=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?Xt.init(a(this.modules.logger),this.options):Xt.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:typeof Intl!="undefined"&&(m=ok);const y=new sc(this.options);this.store=new rc(this.options.resources,this.options);const v=this.services;v.logger=Xt,v.resourceStore=this.store,v.languageUtils=y,v.pluralResolver=new rk(y,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),m&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(v.formatter=a(m),v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new ak(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new lk(a(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",function(x){for(var _=arguments.length,N=new Array(_>1?_-1:0),E=1;E<_;E++)N[E-1]=arguments[E];e.emit(x,...N)}),this.modules.languageDetector&&(v.languageDetector=a(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=a(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new xa(this.services,this.options),this.translator.on("*",function(x){for(var _=arguments.length,N=new Array(_>1?_-1:0),E=1;E<_;E++)N[E-1]=arguments[E];e.emit(x,...N)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,i||(i=Xr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(m=>{this[m]=function(){return e.store[m](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=function(){return e.store[m](...arguments),e}});const d=Hi(),h=()=>{const m=(y,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),d.resolve(v),i(y,v)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xr;const r=typeof e=="string"?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&r.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const a=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(h=>{h!=="cimode"&&a.indexOf(h)<0&&a.push(h)})};r?o(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>o(d)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(a,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(l)})}else i(null)}reloadResources(e,n,i){const r=Hi();return typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),i||(i=Xr),this.services.backendConnector.reload(e,n,a=>{r.resolve(),i(a)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&nh.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n<this.languages.length;n++){const i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,n){var i=this;this.isLanguageChangingTo=e;const r=Hi();this.emit("languageChanging",e);const a=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,h)=>{h?(a(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,r.resolve(function(){return i.t(...arguments)}),n&&n(d,function(){return i.t(...arguments)})},l=d=>{!e&&!d&&this.services.languageDetector&&(d=[]);const h=typeof d=="string"?d:this.services.languageUtils.getBestMatchFromCodes(d);h&&(this.language||a(h),this.translator.language||this.translator.changeLanguage(h),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(h)),this.loadResources(h,m=>{o(m,h)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,i){var r=this;const a=function(o,l){let d;if(typeof l!="object"){for(var h=arguments.length,m=new Array(h>2?h-2:0),y=2;y<h;y++)m[y-2]=arguments[y];d=r.options.overloadTranslationOptionHandler([o,l].concat(m))}else d={...l};d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs,d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||i||a.keyPrefix);const v=r.options.keySeparator||".";let x;return d.keyPrefix&&Array.isArray(o)?x=o.map(_=>`${d.keyPrefix}${v}${_}`):x=d.keyPrefix?`${d.keyPrefix}${v}${o}`:o,r.t(x,d)};return typeof e=="string"?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=i,a}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=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;const i=n.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const o=(l,d)=>{const h=this.services.backendConnector.state[`${l}|${d}`];return h===-1||h===0||h===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(i,e)&&(!r||o(a,e)))}loadNamespaces(e,n){const i=Hi();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){const i=Hi();typeof e=="string"&&(e=[e]);const r=this.options.preload||[],a=e.filter(o=>r.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return a.length?(this.options.preload=r.concat(a),this.loadResources(o=>{i.resolve(),n&&n(o)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["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"],i=this.services&&this.services.languageUtils||new sc(lc());return n.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ur(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xr;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},a=new ur(r);return(e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(l=>{a[l]=this[l]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},i&&(a.store=new rc(this.store.data,r),a.services.resourceStore=a.store),a.translator=new xa(a.services,r),a.translator.on("*",function(l){for(var d=arguments.length,h=new Array(d>1?d-1:0),m=1;m<d;m++)h[m-1]=arguments[m];a.emit(l,...h)}),a.init(r,n),a.translator.options=r,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const gt=ur.createInstance();gt.createInstance=ur.createInstance;gt.createInstance;gt.dir;gt.init;gt.loadResources;gt.reloadResources;gt.use;gt.changeLanguage;gt.getFixedT;const dc=gt.t;gt.exists;gt.setDefaultNamespace;gt.hasLoadedNamespace;gt.loadNamespaces;gt.loadLanguages;const ih=t=>dc(t?`errorCodes.${t}`:"errorCodes.DEFAULT");class dk{constructor(e){fe(this,"logger");fe(this,"axiosInstance");this.logger=e.logger,this.axiosInstance=Ze.create({baseURL:e.baseUrl,headers:e.accessToken?{Authorization:`Bearer ${e.accessToken}`}:{}})}async get(e){try{return(await this.axiosInstance.get(e)).data}catch(n){throw this.handleError(n)}}async post(e,n){var a;const{data:i={},ignoreError:r=!1}=n;try{return(await this.axiosInstance.post(e,i)).data}catch(o){if(r&&Ze.isAxiosError(o))return(a=o.response)==null?void 0:a.data;throw this.handleError(o)}}async put(e,n){var a;const{data:i={},ignoreError:r=!1}=n;try{return(await this.axiosInstance.put(e,i)).data}catch(o){if(r&&Ze.isAxiosError(o))return(a=o.response)==null?void 0:a.data;throw this.handleError(o)}}async delete(e){try{return(await this.axiosInstance.delete(e)).data}catch(n){throw this.handleError(n)}}handleError(e){var r;let n=kt.GENERAL_ERROR;if(Ze.isAxiosError(e))if(e.response)switch(e.response.status){case 400:n=kt.BAD_REQUEST;break;case 401:n=kt.UNAUTHORIZED;break;case 403:n=kt.FORBIDDEN;break;case 404:n=kt.NOT_FOUND;break;case 409:n=kt.CONFLICT;break;case 410:n=kt.GONE;break;case 415:n=kt.UNSUPPORTED_MEDIA_TYPE;break;case 429:n=kt.TOO_MANY_REQUESTS;break;case 500:n=kt.INTERNAL_SERVER_ERROR;break;case 503:n=kt.SERVICE_UNAVAILABLE;break;default:n=kt.SERVER_ERROR}else e.request?n=kt.NETWORK_ERROR:n=kt.CONFIG_ERROR;const i=ih(n);return this.logger.error("Error Code:",n,"Message:",i),this.logger.error("Result Data:",(r=e.response)==null?void 0:r.data),new Error(i)}}function rh(t){const e=Object.values(t);return Object.assign({},...e)}function ah(t){return Object.entries(t).reduce((e,[n,i])=>{const r=rh(i);return{...e,[n]:r}},{})}function sh(t,e){const n=ah(e);Object.entries(n).forEach(([i,r])=>{t.addResourceBundle(i,"translation",r,!0)})}const{slice:fk,forEach:hk}=[];function pk(t){return hk.call(fk.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const fc=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,mk=(t,e,n)=>{const i=n||{};i.path=i.path||"/";const r=encodeURIComponent(e);let a=`${t}=${r}`;if(i.maxAge>0){const o=i.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");a+=`; Max-Age=${Math.floor(o)}`}if(i.domain){if(!fc.test(i.domain))throw new TypeError("option domain is invalid");a+=`; Domain=${i.domain}`}if(i.path){if(!fc.test(i.path))throw new TypeError("option path is invalid");a+=`; Path=${i.path}`}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(a+="; HttpOnly"),i.secure&&(a+="; Secure"),i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return a},hc={create(t,e,n,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+n*60*1e3)),i&&(r.domain=i),document.cookie=mk(t,encodeURIComponent(e),r)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let i=0;i<n.length;i++){let r=n[i];for(;r.charAt(0)===" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return r.substring(e.length,r.length)}return null},remove(t){this.create(t,"",-1)}};var gk={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document!="undefined")return hc.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:i,cookieDomain:r,cookieOptions:a}=e;n&&typeof document!="undefined"&&hc.create(n,t,i,r,a)}},vk={name:"querystring",lookup(t){var i;let{lookupQuerystring:e}=t,n;if(typeof window!="undefined"){let{search:r}=window.location;!window.location.search&&((i=window.location.hash)==null?void 0:i.indexOf("?"))>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let l=0;l<o.length;l++){const d=o[l].indexOf("=");d>0&&o[l].substring(0,d)===e&&(n=o[l].substring(d+1))}}return n}};let Ki=null;const pc=()=>{if(Ki!==null)return Ki;try{Ki=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ki=!1}return Ki};var yk={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&pc())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&pc()&&window.localStorage.setItem(n,t)}};let zi=null;const mc=()=>{if(zi!==null)return zi;try{zi=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{zi=!1}return zi};var bk={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&mc())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&mc()&&window.sessionStorage.setItem(n,t)}},kk={name:"navigator",lookup(t){const e=[];if(typeof navigator!="undefined"){const{languages:n,userLanguage:i,language:r}=navigator;if(n)for(let a=0;a<n.length;a++)e.push(n[a]);i&&e.push(i),r&&e.push(r)}return e.length>0?e:void 0}},_k={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const i=e||(typeof document!="undefined"?document.documentElement:null);return i&&typeof i.getAttribute=="function"&&(n=i.getAttribute("lang")),n}},Sk={name:"path",lookup(t){var r;let{lookupFromPathIndex:e}=t;if(typeof window=="undefined")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(r=n[typeof e=="number"?e:0])==null?void 0:r.replace("/",""):void 0}},Nk={name:"subdomain",lookup(t){var r,a;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,i=typeof window!="undefined"&&((a=(r=window.location)==null?void 0:r.hostname)==null?void 0:a.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(i)return i[n]}};function Ek(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class oh{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=pk(n,this.options||{},Ek()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=r=>r.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(gk),this.addDetector(vk),this.addDetector(yk),this.addDetector(bk),this.addDetector(kk),this.addDetector(_k),this.addDetector(Sk),this.addDetector(Nk)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(i=>{if(this.detectors[i]){let r=this.detectors[i].lookup(this.options);r&&typeof r=="string"&&(r=[r]),r&&(n=n.concat(r))}}),n=n.map(i=>this.options.convertDetectedLanguage(i)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(e,this.options)}))}}oh.type="languageDetector";function uh(t,e){t.use(e).use(oh).init({resources:{},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(n,i,r)=>{if(i){const[a,...o]=i.split(",").map(l=>l.trim());if(a==="number")return new Intl.NumberFormat(r).format(n);if(a==="date")return new Intl.DateTimeFormat(r).format(n);if(a==="currency")return new Intl.NumberFormat(r,{style:"currency",currency:o[0]||"USD",currencyDisplay:"narrowSymbol"}).format(n).replace("$","").trim()}return n}},detection:{order:["navigator","cookie","localStorage","sessionStorage","querystring","htmlTag","path","subdomain"]}})}const wk=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ak={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ok=t=>Ak[t],xk=t=>t.replace(wk,Ok);let gc={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:xk};function Tk(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gc={...gc,...t}}const Ck={type:"3rdParty",init(t){Tk(t.options.react)}};uh(gt,Ck);const Rk=t=>sh(gt,t),vc={startTime:"UNKNOWN",viewerCount:0,status:"UNKNOWN"},Fk=()=>{const[t,e]=Pe.useState([]),[n,i]=Pe.useState(vc);return{realTimeStreamInfo:n,productsInCart:t,onTextMetadataCue:o=>{const{action:l,data:d,startTime:h,viewerCount:m,status:y}=JSON.parse(o==null?void 0:o.text);switch(l){case"sendivsdatarealtime":{i({startTime:h,viewerCount:m,status:y});break}case"sendaddtocart":{const{id:v,sessionId:x,productId:_,productImageUrl:N,productName:E}=d;e(F=>[...F,{id:v,sessionId:x,productId:_,productImageUrl:N,productName:E}])}break}},resetRealTimeStreamInfo:()=>{i(vc)},setProductsInCart:e}},Su=JSON,Dk=t=>t.toUpperCase(),Ik=t=>{const e={};return t.forEach((n,i)=>{e[i]=n}),e},Pk=(t,e,n)=>t.document?t:{document:t,variables:e,requestHeaders:n,signal:void 0},Lk=(t,e,n)=>t.query?t:{query:t,variables:e,requestHeaders:n,signal:void 0},$k=(t,e)=>t.documents?t:{documents:t,requestHeaders:e,signal:void 0};function oa(t,e){if(!!!t)throw new Error(e)}function Mk(t){return typeof t=="object"&&t!==null}function jk(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const Bk=/\r\n|[\n\r]/g;function eu(t,e){let n=0,i=1;for(const r of t.body.matchAll(Bk)){if(typeof r.index=="number"||jk(!1),r.index>=e)break;n=r.index+r[0].length,i+=1}return{line:i,column:e+1-n}}function Uk(t){return lh(t.source,eu(t.source,t.start))}function lh(t,e){const n=t.locationOffset.column-1,i="".padStart(n)+t.body,r=e.line-1,a=t.locationOffset.line-1,o=e.line+a,l=e.line===1?n:0,d=e.column+l,h=`${t.name}:${o}:${d}
37
+ `,m=i.split(/\r\n|[\n\r]/g),y=m[r];if(y.length>120){const v=Math.floor(d/80),x=d%80,_=[];for(let N=0;N<y.length;N+=80)_.push(y.slice(N,N+80));return h+yc([[`${o} |`,_[0]],..._.slice(1,v+1).map(N=>["|",N]),["|","^".padStart(x)],["|",_[v+1]]])}return h+yc([[`${o-1} |`,m[r-1]],[`${o} |`,y],["|","^".padStart(d)],[`${o+1} |`,m[r+1]]])}function yc(t){const e=t.filter(([i,r])=>r!==void 0),n=Math.max(...e.map(([i])=>i.length));return e.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
38
+ `)}function Vk(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}class Nu extends Error{constructor(e,...n){var i,r,a;const{nodes:o,source:l,positions:d,path:h,originalError:m,extensions:y}=Vk(n);super(e),this.name="GraphQLError",this.path=h!=null?h:void 0,this.originalError=m!=null?m:void 0,this.nodes=bc(Array.isArray(o)?o:o?[o]:void 0);const v=bc((i=this.nodes)===null||i===void 0?void 0:i.map(_=>_.loc).filter(_=>_!=null));this.source=l!=null?l:v==null||(r=v[0])===null||r===void 0?void 0:r.source,this.positions=d!=null?d:v==null?void 0:v.map(_=>_.start),this.locations=d&&l?d.map(_=>eu(l,_)):v==null?void 0:v.map(_=>eu(_.source,_.start));const x=Mk(m==null?void 0:m.extensions)?m==null?void 0:m.extensions:void 0;this.extensions=(a=y!=null?y:x)!==null&&a!==void 0?a:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),m!=null&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,Nu):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+=`
64
39
 
65
- `+vA(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
40
+ `+Uk(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+=`
66
41
 
67
- `+um(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function ff(t){return t===void 0||t.length===0?void 0:t}function pt(t,e,n){return new El(`Syntax Error: ${n}`,{source:t,positions:[e]})}class kA{constructor(e,n,r){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class lm{constructor(e,n,r,i,a,o){this.kind=e,this.start=n,this.end=r,this.line=i,this.column=a,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const cm={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},_A=new Set(Object.keys(cm));function hf(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&_A.has(e)}var gr;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(gr||(gr={}));var Wu;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Wu||(Wu={}));var Fe;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Fe||(Fe={}));function Ju(t){return t===9||t===32}function li(t){return t>=48&&t<=57}function dm(t){return t>=97&&t<=122||t>=65&&t<=90}function fm(t){return dm(t)||t===95}function SA(t){return dm(t)||li(t)||t===95}function AA(t){var e;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<t.length;++o){var a;const l=t[o],c=EA(l);c!==l.length&&(r=(a=r)!==null&&a!==void 0?a:o,i=o,o!==0&&c<n&&(n=c))}return t.map((o,l)=>l===0?o:o.slice(n)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function EA(t){let e=0;for(;e<t.length&&Ju(t.charCodeAt(e));)++e;return e}function wA(t,e){const n=t.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,a=r.length>1&&r.slice(1).every(O=>O.length===0||Ju(O.charCodeAt(0))),o=n.endsWith('\\"""'),l=t.endsWith('"')&&!o,c=t.endsWith("\\"),f=l||c,h=!i||t.length>70||f||a||o;let y="";const m=i&&Ju(t.charCodeAt(0));return(h&&!m||a)&&(y+=`
68
- `),y+=n,(h||f)&&(y+=`
69
- `),'"""'+y+'"""'}var ue;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(ue||(ue={}));class NA{constructor(e){const n=new lm(ue.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==ue.EOF)do if(e.next)e=e.next;else{const n=RA(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===ue.COMMENT);return e}}function OA(t){return t===ue.BANG||t===ue.DOLLAR||t===ue.AMP||t===ue.PAREN_L||t===ue.PAREN_R||t===ue.SPREAD||t===ue.COLON||t===ue.EQUALS||t===ue.AT||t===ue.BRACKET_L||t===ue.BRACKET_R||t===ue.BRACE_L||t===ue.PIPE||t===ue.BRACE_R}function Tr(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function as(t,e){return hm(t.charCodeAt(e))&&pm(t.charCodeAt(e+1))}function hm(t){return t>=55296&&t<=56319}function pm(t){return t>=56320&&t<=57343}function Gn(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return ue.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function ut(t,e,n,r,i){const a=t.line,o=1+n-t.lineStart;return new lm(e,n,r,a,o,i)}function RA(t,e){const n=t.source.body,r=n.length;let i=e;for(;i<r;){const a=n.charCodeAt(i);switch(a){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return TA(t,i);case 33:return ut(t,ue.BANG,i,i+1);case 36:return ut(t,ue.DOLLAR,i,i+1);case 38:return ut(t,ue.AMP,i,i+1);case 40:return ut(t,ue.PAREN_L,i,i+1);case 41:return ut(t,ue.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return ut(t,ue.SPREAD,i,i+3);break;case 58:return ut(t,ue.COLON,i,i+1);case 61:return ut(t,ue.EQUALS,i,i+1);case 64:return ut(t,ue.AT,i,i+1);case 91:return ut(t,ue.BRACKET_L,i,i+1);case 93:return ut(t,ue.BRACKET_R,i,i+1);case 123:return ut(t,ue.BRACE_L,i,i+1);case 124:return ut(t,ue.PIPE,i,i+1);case 125:return ut(t,ue.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?DA(t,i):xA(t,i)}if(li(a)||a===45)return CA(t,i,a);if(fm(a))return LA(t,i);throw pt(t.source,i,a===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Tr(a)||as(n,i)?`Unexpected character: ${Gn(t,i)}.`:`Invalid character: ${Gn(t,i)}.`)}return ut(t,ue.EOF,r,r)}function TA(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const a=n.charCodeAt(i);if(a===10||a===13)break;if(Tr(a))++i;else if(as(n,i))i+=2;else break}return ut(t,ue.COMMENT,e,i,n.slice(e+1,i))}function CA(t,e,n){const r=t.source.body;let i=e,a=n,o=!1;if(a===45&&(a=r.charCodeAt(++i)),a===48){if(a=r.charCodeAt(++i),li(a))throw pt(t.source,i,`Invalid number, unexpected digit after 0: ${Gn(t,i)}.`)}else i=cu(t,i,a),a=r.charCodeAt(i);if(a===46&&(o=!0,a=r.charCodeAt(++i),i=cu(t,i,a),a=r.charCodeAt(i)),(a===69||a===101)&&(o=!0,a=r.charCodeAt(++i),(a===43||a===45)&&(a=r.charCodeAt(++i)),i=cu(t,i,a),a=r.charCodeAt(i)),a===46||fm(a))throw pt(t.source,i,`Invalid number, expected digit but got: ${Gn(t,i)}.`);return ut(t,o?ue.FLOAT:ue.INT,e,i,r.slice(e,i))}function cu(t,e,n){if(!li(n))throw pt(t.source,e,`Invalid number, expected digit but got: ${Gn(t,e)}.`);const r=t.source.body;let i=e+1;for(;li(r.charCodeAt(i));)++i;return i}function xA(t,e){const n=t.source.body,r=n.length;let i=e+1,a=i,o="";for(;i<r;){const l=n.charCodeAt(i);if(l===34)return o+=n.slice(a,i),ut(t,ue.STRING,e,i+1,o);if(l===92){o+=n.slice(a,i);const c=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?PA(t,i):FA(t,i):IA(t,i);o+=c.value,i+=c.size,a=i;continue}if(l===10||l===13)break;if(Tr(l))++i;else if(as(n,i))i+=2;else throw pt(t.source,i,`Invalid character within String: ${Gn(t,i)}.`)}throw pt(t.source,i,"Unterminated string.")}function PA(t,e){const n=t.source.body;let r=0,i=3;for(;i<12;){const a=n.charCodeAt(e+i++);if(a===125){if(i<5||!Tr(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Wr(a),r<0)break}throw pt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+i)}".`)}function FA(t,e){const n=t.source.body,r=pf(n,e+2);if(Tr(r))return{value:String.fromCodePoint(r),size:6};if(hm(r)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const i=pf(n,e+8);if(pm(i))return{value:String.fromCodePoint(r,i),size:12}}throw pt(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function pf(t,e){return Wr(t.charCodeAt(e))<<12|Wr(t.charCodeAt(e+1))<<8|Wr(t.charCodeAt(e+2))<<4|Wr(t.charCodeAt(e+3))}function Wr(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function IA(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
70
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw pt(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function DA(t,e){const n=t.source.body,r=n.length;let i=t.lineStart,a=e+3,o=a,l="";const c=[];for(;a<r;){const f=n.charCodeAt(a);if(f===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){l+=n.slice(o,a),c.push(l);const h=ut(t,ue.BLOCK_STRING,e,a+3,AA(c).join(`
71
- `));return t.line+=c.length-1,t.lineStart=i,h}if(f===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){l+=n.slice(o,a),o=a+1,a+=4;continue}if(f===10||f===13){l+=n.slice(o,a),c.push(l),f===13&&n.charCodeAt(a+1)===10?a+=2:++a,l="",o=a,i=a;continue}if(Tr(f))++a;else if(as(n,a))a+=2;else throw pt(t.source,a,`Invalid character within String: ${Gn(t,a)}.`)}throw pt(t.source,a,"Unterminated string.")}function LA(t,e){const n=t.source.body,r=n.length;let i=e+1;for(;i<r;){const a=n.charCodeAt(i);if(SA(a))++i;else break}return ut(t,ue.NAME,e,i,n.slice(e,i))}const $A=10,mm=2;function wl(t){return ss(t,[])}function ss(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return jA(t,e);default:return String(t)}}function jA(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(BA(t)){const r=t.toJSON();if(r!==t)return typeof r=="string"?r:ss(r,n)}else if(Array.isArray(t))return UA(t,n);return MA(t,n)}function BA(t){return typeof t.toJSON=="function"}function MA(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>mm?"["+VA(t)+"]":"{ "+n.map(([i,a])=>i+": "+ss(a,e)).join(", ")+" }"}function UA(t,e){if(t.length===0)return"[]";if(e.length>mm)return"[Array]";const n=Math.min($A,t.length),r=t.length-n,i=[];for(let a=0;a<n;++a)i.push(ss(t[a],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function VA(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const qA=globalThis.process&&!0,HA=qA?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var r;const i=n.prototype[Symbol.toStringTag],a=Symbol.toStringTag in e?e[Symbol.toStringTag]:(r=e.constructor)===null||r===void 0?void 0:r.name;if(i===a){const o=wl(e);throw new Error(`Cannot use ${i} "${o}" from another module or realm.
42
+ `+lh(this.source,n);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function bc(t){return t===void 0||t.length===0?void 0:t}function ht(t,e,n){return new Nu(`Syntax Error: ${n}`,{source:t,positions:[e]})}class qk{constructor(e,n,i){this.start=e.start,this.end=n.end,this.startToken=e,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class ch{constructor(e,n,i,r,a,o){this.kind=e,this.start=n,this.end=i,this.line=r,this.column=a,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const dh={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Hk=new Set(Object.keys(dh));function kc(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&Hk.has(e)}var gi;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(gi||(gi={}));var tu;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(tu||(tu={}));var Ne;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(Ne||(Ne={}));function nu(t){return t===9||t===32}function lr(t){return t>=48&&t<=57}function fh(t){return t>=97&&t<=122||t>=65&&t<=90}function hh(t){return fh(t)||t===95}function Kk(t){return fh(t)||lr(t)||t===95}function zk(t){var e;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let o=0;o<t.length;++o){var a;const l=t[o],d=Gk(l);d!==l.length&&(i=(a=i)!==null&&a!==void 0?a:o,r=o,o!==0&&d<n&&(n=d))}return t.map((o,l)=>l===0?o:o.slice(n)).slice((e=i)!==null&&e!==void 0?e:0,r+1)}function Gk(t){let e=0;for(;e<t.length&&nu(t.charCodeAt(e));)++e;return e}function Wk(t,e){const n=t.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,a=i.length>1&&i.slice(1).every(x=>x.length===0||nu(x.charCodeAt(0))),o=n.endsWith('\\"""'),l=t.endsWith('"')&&!o,d=t.endsWith("\\"),h=l||d,m=!r||t.length>70||h||a||o;let y="";const v=r&&nu(t.charCodeAt(0));return(m&&!v||a)&&(y+=`
43
+ `),y+=n,(m||h)&&(y+=`
44
+ `),'"""'+y+'"""'}var W;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(W||(W={}));class Jk{constructor(e){const n=new ch(W.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==W.EOF)do if(e.next)e=e.next;else{const n=Xk(this,e.end);e.next=n,n.prev=e,e=n}while(e.kind===W.COMMENT);return e}}function Yk(t){return t===W.BANG||t===W.DOLLAR||t===W.AMP||t===W.PAREN_L||t===W.PAREN_R||t===W.SPREAD||t===W.COLON||t===W.EQUALS||t===W.AT||t===W.BRACKET_L||t===W.BRACKET_R||t===W.BRACE_L||t===W.PIPE||t===W.BRACE_R}function Ti(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function ns(t,e){return ph(t.charCodeAt(e))&&mh(t.charCodeAt(e+1))}function ph(t){return t>=55296&&t<=56319}function mh(t){return t>=56320&&t<=57343}function Gn(t,e){const n=t.source.body.codePointAt(e);if(n===void 0)return W.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function lt(t,e,n,i,r){const a=t.line,o=1+n-t.lineStart;return new ch(e,n,i,a,o,r)}function Xk(t,e){const n=t.source.body,i=n.length;let r=e;for(;r<i;){const a=n.charCodeAt(r);switch(a){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++t.line,t.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++t.line,t.lineStart=r;continue;case 35:return Qk(t,r);case 33:return lt(t,W.BANG,r,r+1);case 36:return lt(t,W.DOLLAR,r,r+1);case 38:return lt(t,W.AMP,r,r+1);case 40:return lt(t,W.PAREN_L,r,r+1);case 41:return lt(t,W.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return lt(t,W.SPREAD,r,r+3);break;case 58:return lt(t,W.COLON,r,r+1);case 61:return lt(t,W.EQUALS,r,r+1);case 64:return lt(t,W.AT,r,r+1);case 91:return lt(t,W.BRACKET_L,r,r+1);case 93:return lt(t,W.BRACKET_R,r,r+1);case 123:return lt(t,W.BRACE_L,r,r+1);case 124:return lt(t,W.PIPE,r,r+1);case 125:return lt(t,W.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?r_(t,r):e_(t,r)}if(lr(a)||a===45)return Zk(t,r,a);if(hh(a))return a_(t,r);throw ht(t.source,r,a===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Ti(a)||ns(n,r)?`Unexpected character: ${Gn(t,r)}.`:`Invalid character: ${Gn(t,r)}.`)}return lt(t,W.EOF,i,i)}function Qk(t,e){const n=t.source.body,i=n.length;let r=e+1;for(;r<i;){const a=n.charCodeAt(r);if(a===10||a===13)break;if(Ti(a))++r;else if(ns(n,r))r+=2;else break}return lt(t,W.COMMENT,e,r,n.slice(e+1,r))}function Zk(t,e,n){const i=t.source.body;let r=e,a=n,o=!1;if(a===45&&(a=i.charCodeAt(++r)),a===48){if(a=i.charCodeAt(++r),lr(a))throw ht(t.source,r,`Invalid number, unexpected digit after 0: ${Gn(t,r)}.`)}else r=vo(t,r,a),a=i.charCodeAt(r);if(a===46&&(o=!0,a=i.charCodeAt(++r),r=vo(t,r,a),a=i.charCodeAt(r)),(a===69||a===101)&&(o=!0,a=i.charCodeAt(++r),(a===43||a===45)&&(a=i.charCodeAt(++r)),r=vo(t,r,a),a=i.charCodeAt(r)),a===46||hh(a))throw ht(t.source,r,`Invalid number, expected digit but got: ${Gn(t,r)}.`);return lt(t,o?W.FLOAT:W.INT,e,r,i.slice(e,r))}function vo(t,e,n){if(!lr(n))throw ht(t.source,e,`Invalid number, expected digit but got: ${Gn(t,e)}.`);const i=t.source.body;let r=e+1;for(;lr(i.charCodeAt(r));)++r;return r}function e_(t,e){const n=t.source.body,i=n.length;let r=e+1,a=r,o="";for(;r<i;){const l=n.charCodeAt(r);if(l===34)return o+=n.slice(a,r),lt(t,W.STRING,e,r+1,o);if(l===92){o+=n.slice(a,r);const d=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?t_(t,r):n_(t,r):i_(t,r);o+=d.value,r+=d.size,a=r;continue}if(l===10||l===13)break;if(Ti(l))++r;else if(ns(n,r))r+=2;else throw ht(t.source,r,`Invalid character within String: ${Gn(t,r)}.`)}throw ht(t.source,r,"Unterminated string.")}function t_(t,e){const n=t.source.body;let i=0,r=3;for(;r<12;){const a=n.charCodeAt(e+r++);if(a===125){if(r<5||!Ti(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Wi(a),i<0)break}throw ht(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+r)}".`)}function n_(t,e){const n=t.source.body,i=_c(n,e+2);if(Ti(i))return{value:String.fromCodePoint(i),size:6};if(ph(i)&&n.charCodeAt(e+6)===92&&n.charCodeAt(e+7)===117){const r=_c(n,e+8);if(mh(r))return{value:String.fromCodePoint(i,r),size:12}}throw ht(t.source,e,`Invalid Unicode escape sequence: "${n.slice(e,e+6)}".`)}function _c(t,e){return Wi(t.charCodeAt(e))<<12|Wi(t.charCodeAt(e+1))<<8|Wi(t.charCodeAt(e+2))<<4|Wi(t.charCodeAt(e+3))}function Wi(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function i_(t,e){const n=t.source.body;switch(n.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
45
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ht(t.source,e,`Invalid character escape sequence: "${n.slice(e,e+2)}".`)}function r_(t,e){const n=t.source.body,i=n.length;let r=t.lineStart,a=e+3,o=a,l="";const d=[];for(;a<i;){const h=n.charCodeAt(a);if(h===34&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34){l+=n.slice(o,a),d.push(l);const m=lt(t,W.BLOCK_STRING,e,a+3,zk(d).join(`
46
+ `));return t.line+=d.length-1,t.lineStart=r,m}if(h===92&&n.charCodeAt(a+1)===34&&n.charCodeAt(a+2)===34&&n.charCodeAt(a+3)===34){l+=n.slice(o,a),o=a+1,a+=4;continue}if(h===10||h===13){l+=n.slice(o,a),d.push(l),h===13&&n.charCodeAt(a+1)===10?a+=2:++a,l="",o=a,r=a;continue}if(Ti(h))++a;else if(ns(n,a))a+=2;else throw ht(t.source,a,`Invalid character within String: ${Gn(t,a)}.`)}throw ht(t.source,a,"Unterminated string.")}function a_(t,e){const n=t.source.body,i=n.length;let r=e+1;for(;r<i;){const a=n.charCodeAt(r);if(Kk(a))++r;else break}return lt(t,W.NAME,e,r,n.slice(e,r))}const s_=10,gh=2;function Eu(t){return is(t,[])}function is(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return o_(t,e);default:return String(t)}}function o_(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const n=[...e,t];if(u_(t)){const i=t.toJSON();if(i!==t)return typeof i=="string"?i:is(i,n)}else if(Array.isArray(t))return c_(t,n);return l_(t,n)}function u_(t){return typeof t.toJSON=="function"}function l_(t,e){const n=Object.entries(t);return n.length===0?"{}":e.length>gh?"["+d_(t)+"]":"{ "+n.map(([r,a])=>r+": "+is(a,e)).join(", ")+" }"}function c_(t,e){if(t.length===0)return"[]";if(e.length>gh)return"[Array]";const n=Math.min(s_,t.length),i=t.length-n,r=[];for(let a=0;a<n;++a)r.push(is(t[a],e));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function d_(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const n=t.constructor.name;if(typeof n=="string"&&n!=="")return n}return e}const f_=globalThis.process&&!0,h_=f_?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if(typeof e=="object"&&e!==null){var i;const r=n.prototype[Symbol.toStringTag],a=Symbol.toStringTag in e?e[Symbol.toStringTag]:(i=e.constructor)===null||i===void 0?void 0:i.name;if(r===a){const o=Eu(e);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
72
47
 
73
48
  Ensure that there is only one instance of "graphql" in the node_modules
74
49
  directory. If different versions of "graphql" are the dependencies of other
@@ -79,70 +54,70 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
79
54
  Duplicate "graphql" modules cannot be used at the same time since different
80
55
  versions may have different capabilities and behavior. The data from one
81
56
  version used in the function from another could produce confusing and
82
- spurious results.`)}}return!1};class gm{constructor(e,n="GraphQL request",r={line:1,column:1}){typeof e=="string"||la(!1,`Body must be a string. Received: ${wl(e)}.`),this.body=e,this.name=n,this.locationOffset=r,this.locationOffset.line>0||la(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||la(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function KA(t){return HA(t,gm)}function zA(t,e){return new GA(t,e).parseDocument()}class GA{constructor(e,n={}){const r=KA(e)?e:new gm(e);this._lexer=new NA(r),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(ue.NAME);return this.node(e,{kind:Fe.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Fe.DOCUMENT,definitions:this.many(ue.SOF,this.parseDefinition,ue.EOF)})}parseDefinition(){if(this.peek(ue.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===ue.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw pt(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(ue.BRACE_L))return this.node(e,{kind:Fe.OPERATION_DEFINITION,operation:gr.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(ue.NAME)&&(r=this.parseName()),this.node(e,{kind:Fe.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(ue.NAME);switch(e.value){case"query":return gr.QUERY;case"mutation":return gr.MUTATION;case"subscription":return gr.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(ue.PAREN_L,this.parseVariableDefinition,ue.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Fe.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(ue.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(ue.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(ue.DOLLAR),this.node(e,{kind:Fe.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Fe.SELECTION_SET,selections:this.many(ue.BRACE_L,this.parseSelection,ue.BRACE_R)})}parseSelection(){return this.peek(ue.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(ue.COLON)?(r=n,i=this.parseName()):i=n,this.node(e,{kind:Fe.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(ue.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(ue.PAREN_L,n,ue.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(ue.COLON),this.node(n,{kind:Fe.ARGUMENT,name:r,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(ue.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(ue.NAME)?this.node(e,{kind:Fe.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Fe.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:Fe.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:Fe.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case ue.BRACKET_L:return this.parseList(e);case ue.BRACE_L:return this.parseObject(e);case ue.INT:return this.advanceLexer(),this.node(n,{kind:Fe.INT,value:n.value});case ue.FLOAT:return this.advanceLexer(),this.node(n,{kind:Fe.FLOAT,value:n.value});case ue.STRING:case ue.BLOCK_STRING:return this.parseStringLiteral();case ue.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:Fe.BOOLEAN,value:!0});case"false":return this.node(n,{kind:Fe.BOOLEAN,value:!1});case"null":return this.node(n,{kind:Fe.NULL});default:return this.node(n,{kind:Fe.ENUM,value:n.value})}case ue.DOLLAR:if(e)if(this.expectToken(ue.DOLLAR),this._lexer.token.kind===ue.NAME){const r=this._lexer.token.value;throw pt(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Fe.STRING,value:e.value,block:e.kind===ue.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:Fe.LIST,values:this.any(ue.BRACKET_L,n,ue.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:Fe.OBJECT,fields:this.any(ue.BRACE_L,n,ue.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,r=this.parseName();return this.expectToken(ue.COLON),this.node(n,{kind:Fe.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(ue.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(ue.AT),this.node(n,{kind:Fe.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(ue.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(ue.BRACKET_R),n=this.node(e,{kind:Fe.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(ue.BANG)?this.node(e,{kind:Fe.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:Fe.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(ue.STRING)||this.peek(ue.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(ue.BRACE_L,this.parseOperationTypeDefinition,ue.BRACE_R);return this.node(e,{kind:Fe.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(ue.COLON);const r=this.parseNamedType();return this.node(e,{kind:Fe.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:Fe.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Fe.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(ue.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(ue.BRACE_L,this.parseFieldDefinition,ue.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(ue.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Fe.FIELD_DEFINITION,description:n,name:r,arguments:i,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(ue.PAREN_L,this.parseInputValueDef,ue.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(ue.COLON);const i=this.parseTypeReference();let a;this.expectOptionalToken(ue.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Fe.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Fe.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:a,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(e,{kind:Fe.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(ue.EQUALS)?this.delimitedMany(ue.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(e,{kind:Fe.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:a})}parseEnumValuesDefinition(){return this.optionalMany(ue.BRACE_L,this.parseEnumValueDefinition,ue.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:Fe.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw pt(this._lexer.source,this._lexer.token.start,`${ea(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(e,{kind:Fe.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(ue.BRACE_L,this.parseInputValueDef,ue.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===ue.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(ue.BRACE_L,this.parseOperationTypeDefinition,ue.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:Fe.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(e,{kind:Fe.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(e,{kind:Fe.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&a.length===0)throw this.unexpected();return this.node(e,{kind:Fe.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:a})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:Fe.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:Fe.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:Fe.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(ue.AT);const r=this.parseName(),i=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Fe.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(ue.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Wu,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new kA(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw pt(this._lexer.source,n.start,`Expected ${ym(e)}, found ${ea(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===ue.NAME&&n.value===e)this.advanceLexer();else throw pt(this._lexer.source,n.start,`Expected "${e}", found ${ea(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===ue.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e!=null?e:this._lexer.token;return pt(this._lexer.source,n.start,`Unexpected ${ea(n)}.`)}any(e,n,r){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(e,n,r){if(this.expectOptionalToken(e)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(e,n,r){this.expectToken(e);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(e,n){this.expectOptionalToken(e);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(e));return r}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==ue.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw pt(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function ea(t){const e=t.value;return ym(t.kind)+(e!=null?` "${e}"`:"")}function ym(t){return OA(t)?`"${t}"`:t}function WA(t){return`"${t.replace(JA,YA)}"`}const JA=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function YA(t){return QA[t.charCodeAt(0)]}const QA=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],XA=Object.freeze({});function ZA(t,e,n=cm){const r=new Map;for(const k of Object.values(Fe))r.set(k,eE(e,k));let i,a=Array.isArray(t),o=[t],l=-1,c=[],f=t,h,y;const m=[],O=[];do{l++;const k=l===o.length,C=k&&c.length!==0;if(k){if(h=O.length===0?void 0:m[m.length-1],f=y,y=O.pop(),C)if(a){f=f.slice();let R=0;for(const[x,z]of c){const I=x-R;z===null?(f.splice(I,1),R++):f[I]=z}}else{f=Object.defineProperties({},Object.getOwnPropertyDescriptors(f));for(const[R,x]of c)f[R]=x}l=i.index,o=i.keys,c=i.edits,a=i.inArray,i=i.prev}else if(y){if(h=a?l:o[l],f=y[h],f==null)continue;m.push(h)}let S;if(!Array.isArray(f)){var A,E;hf(f)||la(!1,`Invalid AST Node: ${wl(f)}.`);const R=k?(A=r.get(f.kind))===null||A===void 0?void 0:A.leave:(E=r.get(f.kind))===null||E===void 0?void 0:E.enter;if(S=R==null?void 0:R.call(e,f,h,y,m,O),S===XA)break;if(S===!1){if(!k){m.pop();continue}}else if(S!==void 0&&(c.push([h,S]),!k))if(hf(S))f=S;else{m.pop();continue}}if(S===void 0&&C&&c.push([h,f]),k)m.pop();else{var b;i={inArray:a,index:l,keys:o,edits:c,prev:i},a=Array.isArray(f),o=a?f:(b=n[f.kind])!==null&&b!==void 0?b:[],l=-1,c=[],y&&O.push(y),y=f}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function eE(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function tE(t){return ZA(t,rE)}const nE=80,rE={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>Re(t.definitions,`
57
+ spurious results.`)}}return!1};class vh{constructor(e,n="GraphQL request",i={line:1,column:1}){typeof e=="string"||oa(!1,`Body must be a string. Received: ${Eu(e)}.`),this.body=e,this.name=n,this.locationOffset=i,this.locationOffset.line>0||oa(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||oa(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function p_(t){return h_(t,vh)}function m_(t,e){return new g_(t,e).parseDocument()}class g_{constructor(e,n={}){const i=p_(e)?e:new vh(e);this._lexer=new Jk(i),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(W.NAME);return this.node(e,{kind:Ne.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:Ne.DOCUMENT,definitions:this.many(W.SOF,this.parseDefinition,W.EOF)})}parseDefinition(){if(this.peek(W.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===W.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw ht(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(W.BRACE_L))return this.node(e,{kind:Ne.OPERATION_DEFINITION,operation:gi.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(W.NAME)&&(i=this.parseName()),this.node(e,{kind:Ne.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(W.NAME);switch(e.value){case"query":return gi.QUERY;case"mutation":return gi.MUTATION;case"subscription":return gi.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(W.PAREN_L,this.parseVariableDefinition,W.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:Ne.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(W.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(W.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(W.DOLLAR),this.node(e,{kind:Ne.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:Ne.SELECTION_SET,selections:this.many(W.BRACE_L,this.parseSelection,W.BRACE_R)})}parseSelection(){return this.peek(W.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(W.COLON)?(i=n,r=this.parseName()):r=n,this.node(e,{kind:Ne.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(W.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(W.PAREN_L,n,W.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:Ne.ARGUMENT,name:i,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(W.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(W.NAME)?this.node(e,{kind:Ne.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:Ne.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:Ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:Ne.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case W.BRACKET_L:return this.parseList(e);case W.BRACE_L:return this.parseObject(e);case W.INT:return this.advanceLexer(),this.node(n,{kind:Ne.INT,value:n.value});case W.FLOAT:return this.advanceLexer(),this.node(n,{kind:Ne.FLOAT,value:n.value});case W.STRING:case W.BLOCK_STRING:return this.parseStringLiteral();case W.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:Ne.BOOLEAN,value:!0});case"false":return this.node(n,{kind:Ne.BOOLEAN,value:!1});case"null":return this.node(n,{kind:Ne.NULL});default:return this.node(n,{kind:Ne.ENUM,value:n.value})}case W.DOLLAR:if(e)if(this.expectToken(W.DOLLAR),this._lexer.token.kind===W.NAME){const i=this._lexer.token.value;throw ht(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:Ne.STRING,value:e.value,block:e.kind===W.BLOCK_STRING})}parseList(e){const n=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:Ne.LIST,values:this.any(W.BRACKET_L,n,W.BRACKET_R)})}parseObject(e){const n=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:Ne.OBJECT,fields:this.any(W.BRACE_L,n,W.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,i=this.parseName();return this.expectToken(W.COLON),this.node(n,{kind:Ne.OBJECT_FIELD,name:i,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(W.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(W.AT),this.node(n,{kind:Ne.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(W.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(W.BRACKET_R),n=this.node(e,{kind:Ne.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(W.BANG)?this.node(e,{kind:Ne.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:Ne.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(W.STRING)||this.peek(W.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);return this.node(e,{kind:Ne.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(W.COLON);const i=this.parseNamedType();return this.node(e,{kind:Ne.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:Ne.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Ne.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:a,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(W.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseFieldDefinition,W.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(W.COLON);const a=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:Ne.FIELD_DEFINITION,description:n,name:i,arguments:r,type:a,directives:o})}parseArgumentDefs(){return this.optionalMany(W.PAREN_L,this.parseInputValueDef,W.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(W.COLON);const r=this.parseTypeReference();let a;this.expectOptionalToken(W.EQUALS)&&(a=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:Ne.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:a,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),a=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:Ne.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:a,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),a=this.parseUnionMemberTypes();return this.node(e,{kind:Ne.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:a})}parseUnionMemberTypes(){return this.expectOptionalToken(W.EQUALS)?this.delimitedMany(W.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),a=this.parseEnumValuesDefinition();return this.node(e,{kind:Ne.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:a})}parseEnumValuesDefinition(){return this.optionalMany(W.BRACE_L,this.parseEnumValueDefinition,W.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:Ne.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ht(this._lexer.source,this._lexer.token.start,`${Qr(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),a=this.parseInputFieldsDefinition();return this.node(e,{kind:Ne.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:a})}parseInputFieldsDefinition(){return this.optionalMany(W.BRACE_L,this.parseInputValueDef,W.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===W.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(W.BRACE_L,this.parseOperationTypeDefinition,W.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:Ne.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(e,{kind:Ne.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&a.length===0)throw this.unexpected();return this.node(e,{kind:Ne.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:a})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),a=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&a.length===0)throw this.unexpected();return this.node(e,{kind:Ne.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:a})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:Ne.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:Ne.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(e,{kind:Ne.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(W.AT);const i=this.parseName(),r=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:Ne.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:a,locations:o})}parseDirectiveLocations(){return this.delimitedMany(W.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(tu,n.value))return n;throw this.unexpected(e)}node(e,n){return this._options.noLocation!==!0&&(n.loc=new qk(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw ht(this._lexer.source,n.start,`Expected ${yh(e)}, found ${Qr(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const n=this._lexer.token;if(n.kind===W.NAME&&n.value===e)this.advanceLexer();else throw ht(this._lexer.source,n.start,`Expected "${e}", found ${Qr(n)}.`)}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===W.NAME&&n.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const n=e!=null?e:this._lexer.token;return ht(this._lexer.source,n.start,`Unexpected ${Qr(n)}.`)}any(e,n,i){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(e,n,i){if(this.expectOptionalToken(e)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(e,n,i){this.expectToken(e);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(e,n){this.expectOptionalToken(e);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(e));return i}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(e!==void 0&&n.kind!==W.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw ht(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function Qr(t){const e=t.value;return yh(t.kind)+(e!=null?` "${e}"`:"")}function yh(t){return Yk(t)?`"${t}"`:t}function v_(t){return`"${t.replace(y_,b_)}"`}const y_=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function b_(t){return k_[t.charCodeAt(0)]}const k_=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],__=Object.freeze({});function S_(t,e,n=dh){const i=new Map;for(const F of Object.values(Ne))i.set(F,N_(e,F));let r,a=Array.isArray(t),o=[t],l=-1,d=[],h=t,m,y;const v=[],x=[];do{l++;const F=l===o.length,V=F&&d.length!==0;if(F){if(m=x.length===0?void 0:v[v.length-1],h=y,y=x.pop(),V)if(a){h=h.slice();let K=0;for(const[Y,X]of d){const ne=Y-K;X===null?(h.splice(ne,1),K++):h[ne]=X}}else{h=Object.defineProperties({},Object.getOwnPropertyDescriptors(h));for(const[K,Y]of d)h[K]=Y}l=r.index,o=r.keys,d=r.edits,a=r.inArray,r=r.prev}else if(y){if(m=a?l:o[l],h=y[m],h==null)continue;v.push(m)}let J;if(!Array.isArray(h)){var _,N;kc(h)||oa(!1,`Invalid AST Node: ${Eu(h)}.`);const K=F?(_=i.get(h.kind))===null||_===void 0?void 0:_.leave:(N=i.get(h.kind))===null||N===void 0?void 0:N.enter;if(J=K==null?void 0:K.call(e,h,m,y,v,x),J===__)break;if(J===!1){if(!F){v.pop();continue}}else if(J!==void 0&&(d.push([m,J]),!F))if(kc(J))h=J;else{v.pop();continue}}if(J===void 0&&V&&d.push([m,h]),F)v.pop();else{var E;r={inArray:a,index:l,keys:o,edits:d,prev:r},a=Array.isArray(h),o=a?h:(E=n[h.kind])!==null&&E!==void 0?E:[],l=-1,d=[],y&&x.push(y),y=h}}while(r!==void 0);return d.length!==0?d[d.length-1][1]:t}function N_(t,e){const n=t[e];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:t.enter,leave:t.leave}}function E_(t){return S_(t,A_)}const w_=80,A_={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>ve(t.definitions,`
83
58
 
84
- `)},OperationDefinition:{leave(t){const e=Ve("(",Re(t.variableDefinitions,", "),")"),n=Re([t.operation,Re([t.name,e]),Re(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:r})=>t+": "+e+Ve(" = ",n)+Ve(" ",Re(r," "))},SelectionSet:{leave:({selections:t})=>Vt(t)},Field:{leave({alias:t,name:e,arguments:n,directives:r,selectionSet:i}){const a=Ve("",t,": ")+e;let o=a+Ve("(",Re(n,", "),")");return o.length>nE&&(o=a+Ve(`(
85
- `,ca(Re(n,`
59
+ `)},OperationDefinition:{leave(t){const e=$e("(",ve(t.variableDefinitions,", "),")"),n=ve([t.operation,ve([t.name,e]),ve(t.directives," ")]," ");return(n==="query"?"":n+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:n,directives:i})=>t+": "+e+$e(" = ",n)+$e(" ",ve(i," "))},SelectionSet:{leave:({selections:t})=>Bt(t)},Field:{leave({alias:t,name:e,arguments:n,directives:i,selectionSet:r}){const a=$e("",t,": ")+e;let o=a+$e("(",ve(n,", "),")");return o.length>w_&&(o=a+$e(`(
60
+ `,ua(ve(n,`
86
61
  `)),`
87
- )`)),Re([o,Re(r," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+Ve(" ",Re(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>Re(["...",Ve("on ",t),Re(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${t}${Ve("(",Re(n,", "),")")} on ${e} ${Ve("",Re(r," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?wA(t):WA(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+Re(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+Re(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+Ve("(",Re(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>Ve("",t,`
88
- `)+Re(["schema",Re(e," "),Vt(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>Ve("",t,`
89
- `)+Re(["scalar",e,Re(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Ve("",t,`
90
- `)+Re(["type",e,Ve("implements ",Re(n," & ")),Re(r," "),Vt(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:r,directives:i})=>Ve("",t,`
91
- `)+e+(mf(n)?Ve(`(
92
- `,ca(Re(n,`
62
+ )`)),ve([o,ve(i," "),r]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+$e(" ",ve(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:n})=>ve(["...",$e("on ",t),ve(e," "),n]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${t}${$e("(",ve(n,", "),")")} on ${e} ${$e("",ve(i," ")," ")}`+r},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?Wk(t):v_(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+ve(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+ve(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+$e("(",ve(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:n})=>$e("",t,`
63
+ `)+ve(["schema",ve(e," "),Bt(n)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:n})=>$e("",t,`
64
+ `)+ve(["scalar",e,ve(n," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:i,fields:r})=>$e("",t,`
65
+ `)+ve(["type",e,$e("implements ",ve(n," & ")),ve(i," "),Bt(r)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:n,type:i,directives:r})=>$e("",t,`
66
+ `)+e+(Sc(n)?$e(`(
67
+ `,ua(ve(n,`
93
68
  `)),`
94
- )`):Ve("(",Re(n,", "),")"))+": "+r+Ve(" ",Re(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:r,directives:i})=>Ve("",t,`
95
- `)+Re([e+": "+n,Ve("= ",r),Re(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:r,fields:i})=>Ve("",t,`
96
- `)+Re(["interface",e,Ve("implements ",Re(n," & ")),Re(r," "),Vt(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:r})=>Ve("",t,`
97
- `)+Re(["union",e,Re(n," "),Ve("= ",Re(r," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:r})=>Ve("",t,`
98
- `)+Re(["enum",e,Re(n," "),Vt(r)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>Ve("",t,`
99
- `)+Re([e,Re(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:r})=>Ve("",t,`
100
- `)+Re(["input",e,Re(n," "),Vt(r)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:r,locations:i})=>Ve("",t,`
101
- `)+"directive @"+e+(mf(n)?Ve(`(
102
- `,ca(Re(n,`
69
+ )`):$e("(",ve(n,", "),")"))+": "+i+$e(" ",ve(r," "))},InputValueDefinition:{leave:({description:t,name:e,type:n,defaultValue:i,directives:r})=>$e("",t,`
70
+ `)+ve([e+": "+n,$e("= ",i),ve(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:n,directives:i,fields:r})=>$e("",t,`
71
+ `)+ve(["interface",e,$e("implements ",ve(n," & ")),ve(i," "),Bt(r)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:n,types:i})=>$e("",t,`
72
+ `)+ve(["union",e,ve(n," "),$e("= ",ve(i," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:n,values:i})=>$e("",t,`
73
+ `)+ve(["enum",e,ve(n," "),Bt(i)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:n})=>$e("",t,`
74
+ `)+ve([e,ve(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:n,fields:i})=>$e("",t,`
75
+ `)+ve(["input",e,ve(n," "),Bt(i)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:n,repeatable:i,locations:r})=>$e("",t,`
76
+ `)+"directive @"+e+(Sc(n)?$e(`(
77
+ `,ua(ve(n,`
103
78
  `)),`
104
- )`):Ve("(",Re(n,", "),")"))+(r?" repeatable":"")+" on "+Re(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>Re(["extend schema",Re(t," "),Vt(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>Re(["extend scalar",t,Re(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>Re(["extend type",t,Ve("implements ",Re(e," & ")),Re(n," "),Vt(r)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:r})=>Re(["extend interface",t,Ve("implements ",Re(e," & ")),Re(n," "),Vt(r)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>Re(["extend union",t,Re(e," "),Ve("= ",Re(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>Re(["extend enum",t,Re(e," "),Vt(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>Re(["extend input",t,Re(e," "),Vt(n)]," ")}};function Re(t,e=""){var n;return(n=t==null?void 0:t.filter(r=>r).join(e))!==null&&n!==void 0?n:""}function Vt(t){return Ve(`{
105
- `,ca(Re(t,`
79
+ )`):$e("(",ve(n,", "),")"))+(i?" repeatable":"")+" on "+ve(r," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>ve(["extend schema",ve(t," "),Bt(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>ve(["extend scalar",t,ve(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:i})=>ve(["extend type",t,$e("implements ",ve(e," & ")),ve(n," "),Bt(i)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:n,fields:i})=>ve(["extend interface",t,$e("implements ",ve(e," & ")),ve(n," "),Bt(i)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:n})=>ve(["extend union",t,ve(e," "),$e("= ",ve(n," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:n})=>ve(["extend enum",t,ve(e," "),Bt(n)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:n})=>ve(["extend input",t,ve(e," "),Bt(n)]," ")}};function ve(t,e=""){var n;return(n=t==null?void 0:t.filter(i=>i).join(e))!==null&&n!==void 0?n:""}function Bt(t){return $e(`{
80
+ `,ua(ve(t,`
106
81
  `)),`
107
- }`)}function Ve(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function ca(t){return Ve(" ",t.replace(/\n/g,`
108
- `))}function mf(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
109
- `)))!==null&&e!==void 0?e:!1}const gf=t=>{var r,i;let e;const n=t.definitions.filter(a=>a.kind==="OperationDefinition");return n.length===1&&(e=(i=(r=n[0])==null?void 0:r.name)==null?void 0:i.value),e},du=t=>{if(typeof t=="string"){let n;try{const r=zA(t);n=gf(r)}catch{}return{query:t,operationName:n}}const e=gf(t);return{query:tE(t),operationName:e}};class Zr extends Error{constructor(e,n){const r=`${Zr.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(r),Object.setPrototypeOf(this,Zr.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Zr)}static extractMessage(e){var n,r,i;return(i=(r=(n=e.errors)==null?void 0:n[0])==null?void 0:r.message)!=null?i:`GraphQL Error (Code: ${e.status})`}}var Jr={exports:{}},iE=Jr.exports,yf;function aE(){return yf||(yf=1,function(t,e){var n=typeof self!="undefined"?self:iE,r=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(o){var l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(j){return j&&DataView.prototype.isPrototypeOf(j)}if(l.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(j){return j&&f.indexOf(Object.prototype.toString.call(j))>-1};function y(j){if(typeof j!="string"&&(j=String(j)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(j))throw new TypeError("Invalid character in header field name");return j.toLowerCase()}function m(j){return typeof j!="string"&&(j=String(j)),j}function O(j){var w={next:function(){var J=j.shift();return{done:J===void 0,value:J}}};return l.iterable&&(w[Symbol.iterator]=function(){return w}),w}function A(j){this.map={},j instanceof A?j.forEach(function(w,J){this.append(J,w)},this):Array.isArray(j)?j.forEach(function(w){this.append(w[0],w[1])},this):j&&Object.getOwnPropertyNames(j).forEach(function(w){this.append(w,j[w])},this)}A.prototype.append=function(j,w){j=y(j),w=m(w);var J=this.map[j];this.map[j]=J?J+", "+w:w},A.prototype.delete=function(j){delete this.map[y(j)]},A.prototype.get=function(j){return j=y(j),this.has(j)?this.map[j]:null},A.prototype.has=function(j){return this.map.hasOwnProperty(y(j))},A.prototype.set=function(j,w){this.map[y(j)]=m(w)},A.prototype.forEach=function(j,w){for(var J in this.map)this.map.hasOwnProperty(J)&&j.call(w,this.map[J],J,this)},A.prototype.keys=function(){var j=[];return this.forEach(function(w,J){j.push(J)}),O(j)},A.prototype.values=function(){var j=[];return this.forEach(function(w){j.push(w)}),O(j)},A.prototype.entries=function(){var j=[];return this.forEach(function(w,J){j.push([J,w])}),O(j)},l.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function E(j){if(j.bodyUsed)return Promise.reject(new TypeError("Already read"));j.bodyUsed=!0}function b(j){return new Promise(function(w,J){j.onload=function(){w(j.result)},j.onerror=function(){J(j.error)}})}function k(j){var w=new FileReader,J=b(w);return w.readAsArrayBuffer(j),J}function C(j){var w=new FileReader,J=b(w);return w.readAsText(j),J}function S(j){for(var w=new Uint8Array(j),J=new Array(w.length),te=0;te<w.length;te++)J[te]=String.fromCharCode(w[te]);return J.join("")}function R(j){if(j.slice)return j.slice(0);var w=new Uint8Array(j.byteLength);return w.set(new Uint8Array(j)),w.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(j){this._bodyInit=j,j?typeof j=="string"?this._bodyText=j:l.blob&&Blob.prototype.isPrototypeOf(j)?this._bodyBlob=j:l.formData&&FormData.prototype.isPrototypeOf(j)?this._bodyFormData=j:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(j)?this._bodyText=j.toString():l.arrayBuffer&&l.blob&&c(j)?(this._bodyArrayBuffer=R(j.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(j)||h(j))?this._bodyArrayBuffer=R(j):this._bodyText=j=Object.prototype.toString.call(j):this._bodyText="",this.headers.get("content-type")||(typeof j=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(j)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var j=E(this);if(j)return j;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?E(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(k)}),this.text=function(){var j=E(this);if(j)return j;if(this._bodyBlob)return C(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(S(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(ie)}),this.json=function(){return this.text().then(JSON.parse)},this}var z=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function I(j){var w=j.toUpperCase();return z.indexOf(w)>-1?w:j}function re(j,w){w=w||{};var J=w.body;if(j instanceof re){if(j.bodyUsed)throw new TypeError("Already read");this.url=j.url,this.credentials=j.credentials,w.headers||(this.headers=new A(j.headers)),this.method=j.method,this.mode=j.mode,this.signal=j.signal,!J&&j._bodyInit!=null&&(J=j._bodyInit,j.bodyUsed=!0)}else this.url=String(j);if(this.credentials=w.credentials||this.credentials||"same-origin",(w.headers||!this.headers)&&(this.headers=new A(w.headers)),this.method=I(w.method||this.method||"GET"),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&J)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(J)}re.prototype.clone=function(){return new re(this,{body:this._bodyInit})};function ie(j){var w=new FormData;return j.trim().split("&").forEach(function(J){if(J){var te=J.split("="),ne=te.shift().replace(/\+/g," "),se=te.join("=").replace(/\+/g," ");w.append(decodeURIComponent(ne),decodeURIComponent(se))}}),w}function ke(j){var w=new A,J=j.replace(/\r?\n[\t ]+/g," ");return J.split(/\r?\n/).forEach(function(te){var ne=te.split(":"),se=ne.shift().trim();if(se){var me=ne.join(":").trim();w.append(se,me)}}),w}x.call(re.prototype);function he(j,w){w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in w?w.statusText:"OK",this.headers=new A(w.headers),this.url=w.url||"",this._initBody(j)}x.call(he.prototype),he.prototype.clone=function(){return new he(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},he.error=function(){var j=new he(null,{status:0,statusText:""});return j.type="error",j};var Ee=[301,302,303,307,308];he.redirect=function(j,w){if(Ee.indexOf(w)===-1)throw new RangeError("Invalid status code");return new he(null,{status:w,headers:{location:j}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(w,J){this.message=w,this.name=J;var te=Error(w);this.stack=te.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function le(j,w){return new Promise(function(J,te){var ne=new re(j,w);if(ne.signal&&ne.signal.aborted)return te(new o.DOMException("Aborted","AbortError"));var se=new XMLHttpRequest;function me(){se.abort()}se.onload=function(){var G={status:se.status,statusText:se.statusText,headers:ke(se.getAllResponseHeaders()||"")};G.url="responseURL"in se?se.responseURL:G.headers.get("X-Request-URL");var D="response"in se?se.response:se.responseText;J(new he(D,G))},se.onerror=function(){te(new TypeError("Network request failed"))},se.ontimeout=function(){te(new TypeError("Network request failed"))},se.onabort=function(){te(new o.DOMException("Aborted","AbortError"))},se.open(ne.method,ne.url,!0),ne.credentials==="include"?se.withCredentials=!0:ne.credentials==="omit"&&(se.withCredentials=!1),"responseType"in se&&l.blob&&(se.responseType="blob"),ne.headers.forEach(function(G,D){se.setRequestHeader(D,G)}),ne.signal&&(ne.signal.addEventListener("abort",me),se.onreadystatechange=function(){se.readyState===4&&ne.signal.removeEventListener("abort",me)}),se.send(typeof ne._bodyInit=="undefined"?null:ne._bodyInit)})}return le.polyfill=!0,a.fetch||(a.fetch=le,a.Headers=A,a.Request=re,a.Response=he),o.Headers=A,o.Request=re,o.Response=he,o.fetch=le,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(Jr,Jr.exports)),Jr.exports}var xa=aE();const da=Wa(xa),sE=fg({__proto__:null,default:da},[xa]),dr=t=>{let e={};return t&&(typeof Headers!="undefined"&&t instanceof Headers||sE&&xa.Headers&&t instanceof xa.Headers?e=dA(t):Array.isArray(t)?t.forEach(([n,r])=>{n&&r!==void 0&&(e[n]=r)}):e=t),e},vf=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),oE=t=>{if(!Array.isArray(t.query)){const r=t,i=[`query=${encodeURIComponent(vf(r.query))}`];return t.variables&&i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`),r.operationName&&i.push(`operationName=${encodeURIComponent(r.operationName)}`),i.join("&")}if(typeof t.variables!="undefined"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");const e=t,n=t.query.reduce((r,i,a)=>(r.push({query:vf(i),variables:e.variables?e.jsonSerializer.stringify(e.variables[a]):void 0}),r),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},uE=t=>async e=>{var E;const{url:n,query:r,variables:i,operationName:a,fetch:o,fetchOptions:l,middleware:c}=e,f={...e.headers};let h="",y;t==="POST"?(y=cE(r,i,a,l.jsonSerializer),typeof y=="string"&&(f["Content-Type"]="application/json")):h=oE({query:r,variables:i,operationName:a,jsonSerializer:(E=l.jsonSerializer)!=null?E:Al});const m={method:t,headers:f,body:y,...l};let O=n,A=m;if(c){const b=await Promise.resolve(c({...m,url:n,operationName:a,variables:i})),{url:k,...C}=b;O=k,A=C}return h&&(O=`${O}?${h}`),await o(O,A)};class lE{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...r)=>{const[i,a,o]=r,l=hA(i,a,o),{headers:c,fetch:f=da,method:h="POST",requestMiddleware:y,responseMiddleware:m,...O}=this.requestConfig,{url:A}=this;l.signal!==void 0&&(O.signal=l.signal);const{operationName:E}=du(l.query);return fu({url:A,query:l.query,variables:l.variables,headers:{...dr(hu(c)),...dr(l.requestHeaders)},operationName:E,fetch:f,method:h,fetchOptions:O,middleware:y}).then(b=>(m&&m(b),b)).catch(b=>{throw m&&m(b),b})}}async request(e,...n){const[r,i]=n,a=fA(e,r,i),{headers:o,fetch:l=da,method:c="POST",requestMiddleware:f,responseMiddleware:h,...y}=this.requestConfig,{url:m}=this;a.signal!==void 0&&(y.signal=a.signal);const{query:O,operationName:A}=du(a.document);return fu({url:m,query:O,variables:a.variables,headers:{...dr(hu(o)),...dr(a.requestHeaders)},operationName:A,fetch:l,method:c,fetchOptions:y,middleware:f}).then(E=>(h&&h(E),E.data)).catch(E=>{throw h&&h(E),E})}batchRequests(e,n){var c;const r=pA(e,n),{headers:i,...a}=this.requestConfig;r.signal!==void 0&&(a.signal=r.signal);const o=r.documents.map(({document:f})=>du(f).query),l=r.documents.map(({variables:f})=>f);return fu({url:this.url,query:o,variables:l,headers:{...dr(hu(i)),...dr(r.requestHeaders)},operationName:void 0,fetch:(c=this.requestConfig.fetch)!=null?c:da,method:this.requestConfig.method||"POST",fetchOptions:a,middleware:this.requestConfig.requestMiddleware}).then(f=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(f),f.data)).catch(f=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(f),f})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:r}=this.requestConfig;return r?r[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const fu=async t=>{var h,y;const{query:e,variables:n,fetchOptions:r}=t,i=uE(cA((h=t.method)!=null?h:"post")),a=Array.isArray(t.query),o=await i(t),l=await dE(o,(y=r.jsonSerializer)!=null?y:Al),c=Array.isArray(l)?!l.some(({data:m})=>!m):!!l.data,f=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||r.errorPolicy==="all"||r.errorPolicy==="ignore";if(o.ok&&f&&c){const{errors:m,...O}=(Array.isArray(l),l),A=r.errorPolicy==="ignore"?O:l;return{...a?{data:A}:A,headers:o.headers,status:o.status}}else{const m=typeof l=="string"?{error:l}:l;throw new Zr({...m,status:o.status,headers:o.headers},{query:e,variables:n})}},cE=(t,e,n,r)=>{const i=r!=null?r:Al;if(!Array.isArray(t))return i.stringify({query:t,variables:e,operationName:n});if(typeof e!="undefined"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");const a=t.reduce((o,l,c)=>(o.push({query:l,variables:e?e[c]:void 0}),o),[]);return i.stringify(a)},dE=async(t,e)=>{let n;return t.headers.forEach((r,i)=>{i.toLowerCase()==="content-type"&&(n=r)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},hu=t=>typeof t=="function"?t():t;class vm extends dn{constructor(){super("EVENT_CHAT_ROOM_TOKEN_ERROR","Error getting chat room connection token")}}class os{constructor(e){Ae(this,"root",Rp(this));Ae(this,"token");this.root.setProps(e)}static toDomain(e){const n={token:e.token};return new os(n)}toPrimitives(){const{root:e,...n}=this;return{...n}}}const fE=_r.apiUrls.graphql;class bm{constructor(){Ae(this,"client");this.client=new lE(fE)}async getChatRoom(e){var i;const{getChatRoomToken:n}=await this.client.request(wp,{data:{account:e.account,idEvent:e.eventId,userName:e.userName}});this.propagateGraphqlErrorIfExists(n);const r=(i=n.data)==null?void 0:i.token;if(!r)throw new vm;return os.toDomain({token:r})}propagateGraphqlErrorIfExists(e){if(e.__typename==="ErrorGeneral")throw new Error(e.message)}}class km{constructor(e){Ae(this,"account");this.eventChatRoomRepository=e}async get(e){this.validateAccount();try{return await this.eventChatRoomRepository.getChatRoom({...e,account:this.account})}catch(n){throw new Zu(n)}}setAccount(e){this.account=e}validateAccount(){if(!this.account)throw new Hf}}const hE=new bm,Yu=new km(hE),us=Ia(void 0);us.debugLabel="chatSocketAtom";const ls=Ia(!1);ls.debugLabel="chatIsConnectedAtom";const ki=Ia([]);ki.debugLabel="chatMessageListAtom";const _m=t=>{var n;t.data=t.data.replace("replace_gif",(n=t.urlGif)!=null?n:"");const e=t.data.indexOf("::question__")>-1;if(e){const[r,i]=t.data.split("::")||["none","none"],a=i.split("question__")[1],o={response:r.replace("response__",""),question:JSON.parse(a)};return{...t,data:o.response,isResponse:e,responseData:t.data,question:e?o.question:null}}return t},Sm=t=>{const{url:e,token:n,onOpen:r,onClose:i,onMessage:a,onError:o}=t,l=new WebSocket(e,n);return l.onopen=c=>r(c),l.onclose=c=>i(c),l.onerror=c=>o(c),l.onmessage=c=>a(c),l},Am=()=>{const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(Math.random()*16)];return e},Nl=(t,e)=>{var m,O;const{Content:n,Attributes:r,Sender:{Attributes:i}}=e,{username:a,type:o,email:l}=r,{isAdmin:c}=i,f=(m=r==null?void 0:r.id)!=null?m:Sa(8),h=((O=t.find(A=>A.username===a))==null?void 0:O.color)||Am(),y={id:f,type:o,color:h,username:a,email:l,data:n,sendDate:r.sendDate,isAdmin:c==="true",responseAdmin:!1,question:null,account:r.account,idEvent:r.idEvent,urlGif:r.urlGif,ip:r.ip};return _m(y)},Em=t=>{const{eventId:e,userName:n,enabled:r=!0}=t,{accountName:i}=kp(),[a,o]=Ue.useState(""),l=()=>{r&&i&&(Yu.setAccount(i),Yu.get({eventId:e,userName:n}).then(c=>{o(c.token)}))};return Ue.useEffect(()=>{l()},[i,r]),{getQuery:{refetch:l},token:a}},{coreLogger:pE}=Zn(),At=pE.child("useConnectChatSocket"),mE=_r.publicUrls.wssIVSChat,gE=10,yE=t=>Math.min(1e4,1e3*Math.pow(2,t)),vE=(t,e,n)=>{const r=JSON.parse(t.data);switch(r.Type){case"EVENT":e==null||e(r);break;case"MESSAGE":n==null||n(r);break;case"ERROR":At.error("Chat room error:",r);break;default:At.error("Unknown chat room event:",t)}},wm=t=>{const{onMessage:e,eventId:n,enabled:r=!0,userName:i,onEvent:a}=t,{token:o,getQuery:l}=Em({eventId:n,userName:i,enabled:r}),[c,f]=Zs(us),[h,y]=Zs(ls),[m,O]=Zs(ki),A=Ue.useRef(0),E=Ue.useCallback(R=>At.error("Chat room socket error:",R),[]),b=Ue.useCallback(()=>{y(!0),A.current=0,At.debug("Successfully connected to the chat room")},[y]),k=Ue.useCallback(()=>{if(A.current>=gE){At.error("Max reconnection attempts reached. No further attempts will be made.");return}y(!1),A.current+=1;const R=yE(A.current);At.debug(`Disconnected from chat room. Reconnecting in ${R/1e3} seconds... (Attempt ${A.current})`),setTimeout(()=>l.refetch(),R)},[l,y]),C=Ue.useCallback(()=>{if(!o){At.debug("No token available. Connection aborted.");return}if((c==null?void 0:c.readyState)===WebSocket.OPEN){At.debug("WebSocket is already open. No need to reconnect.");return}At.debug("Connecting to the chat room...");const R=Sm({token:o,url:mE,onOpen:b,onClose:k,onError:E,onMessage:x=>vE(x,a,e)});f(R)},[o,c,a,e,b,k,E,f]),S=Ue.useCallback(()=>{if(!c||c.readyState!==WebSocket.OPEN){At.debug("No open socket to close.");return}At.debug("Closing chat room socket..."),c.close()},[c]);return Ue.useEffect(()=>{if(!r){At.debug("Chat is disabled, skipping connection.");return}if(!o){At.debug("Token not available, skipping connection.");return}return At.debug("Initializing connection with token:",o),S(),C(),S},[o,r]),{socket:c,chatIsConnected:h,chatMessageList:m,setChatMessageList:O}},bE=()=>{const t=_u(us),e=_u(ls);return{sendMessage:Ue.useCallback((r,i)=>{if(!t||!e)return;const a={id:i.id,sendDate:new Date,content:r,action:"SEND_MESSAGE",attributes:i},o=JSON.stringify(a);t.send(o)},[e,t])}},Nm=()=>{const t=Xu(ki);return{handleEvent:r=>{var i;if(r.EventName==="senddeletemessage"){const a=JSON.parse((i=r.Attributes)==null?void 0:i.data);t(o=>o.filter(l=>l.id!==a.id))}},handleMessage:r=>{t(i=>[...i,Nl(i,r)])}}},kE=t=>{const{eventId:e,userName:n}=t,[r,i]=Ue.useState(!1),[a,o]=Ue.useState(),[l,c]=Ue.useState(),[f,h]=Ue.useState([]),{handleEvent:y}=Nm(),m=Xu(ki),O=C=>{m(S=>[Nl(S,C),...S]),i(!1)},A=C=>{var S,R,x;if(y(C),C.EventName==="sendpinmessage"){const z=JSON.parse((S=C.Attributes)==null?void 0:S.data);o({data:z.data,id:z.id,username:z.username})}if(C.EventName==="sendunpinmessage"&&o(void 0),C.EventName==="sendhighlightproduct"){const z=JSON.parse((R=C.Attributes)==null?void 0:R.data);c({products:z.productIds,collection:z.collection,livestreamingId:z.idEvent})}if(C.EventName==="sendaddtocart"){const z=JSON.parse((x=C.Attributes)==null?void 0:x.data);h(I=>[...I,{id:z.id,sessionId:z.sessionId,productId:z.productId,productImageUrl:z.productImageUrl,productName:z.productName}])}},{socket:E,chatMessageList:b,setChatMessageList:k}=wm({onMessage:O,onEvent:A,eventId:e,userName:n});return{socket:E,chat:b,showLoader:r,pinnedMessage:a,highlightProduct:l,productsInCart:f,setChat:k,setShowLoader:i,setPinnedMessage:o,setProductsInCart:h}};/**
82
+ }`)}function $e(t,e,n=""){return e!=null&&e!==""?t+e+n:""}function ua(t){return $e(" ",t.replace(/\n/g,`
83
+ `))}function Sc(t){var e;return(e=t==null?void 0:t.some(n=>n.includes(`
84
+ `)))!==null&&e!==void 0?e:!1}const Nc=t=>{var i,r;let e;const n=t.definitions.filter(a=>a.kind==="OperationDefinition");return n.length===1&&(e=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),e},yo=t=>{if(typeof t=="string"){let n;try{const i=m_(t);n=Nc(i)}catch{}return{query:t,operationName:n}}const e=Nc(t);return{query:E_(t),operationName:e}};class Zi extends Error{constructor(e,n){const i=`${Zi.extractMessage(e)}: ${JSON.stringify({response:e,request:n})}`;super(i),Object.setPrototypeOf(this,Zi.prototype),this.response=e,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Zi)}static extractMessage(e){var n,i,r;return(r=(i=(n=e.errors)==null?void 0:n[0])==null?void 0:i.message)!=null?r:`GraphQL Error (Code: ${e.status})`}}var Ji={exports:{}},O_=Ji.exports,Ec;function x_(){return Ec||(Ec=1,function(t,e){var n=typeof self!="undefined"?self:O_,i=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(o){var l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function d(M){return M&&DataView.prototype.isPrototypeOf(M)}if(l.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(M){return M&&h.indexOf(Object.prototype.toString.call(M))>-1};function y(M){if(typeof M!="string"&&(M=String(M)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(M))throw new TypeError("Invalid character in header field name");return M.toLowerCase()}function v(M){return typeof M!="string"&&(M=String(M)),M}function x(M){var w={next:function(){var z=M.shift();return{done:z===void 0,value:z}}};return l.iterable&&(w[Symbol.iterator]=function(){return w}),w}function _(M){this.map={},M instanceof _?M.forEach(function(w,z){this.append(z,w)},this):Array.isArray(M)?M.forEach(function(w){this.append(w[0],w[1])},this):M&&Object.getOwnPropertyNames(M).forEach(function(w){this.append(w,M[w])},this)}_.prototype.append=function(M,w){M=y(M),w=v(w);var z=this.map[M];this.map[M]=z?z+", "+w:w},_.prototype.delete=function(M){delete this.map[y(M)]},_.prototype.get=function(M){return M=y(M),this.has(M)?this.map[M]:null},_.prototype.has=function(M){return this.map.hasOwnProperty(y(M))},_.prototype.set=function(M,w){this.map[y(M)]=v(w)},_.prototype.forEach=function(M,w){for(var z in this.map)this.map.hasOwnProperty(z)&&M.call(w,this.map[z],z,this)},_.prototype.keys=function(){var M=[];return this.forEach(function(w,z){M.push(z)}),x(M)},_.prototype.values=function(){var M=[];return this.forEach(function(w){M.push(w)}),x(M)},_.prototype.entries=function(){var M=[];return this.forEach(function(w,z){M.push([z,w])}),x(M)},l.iterable&&(_.prototype[Symbol.iterator]=_.prototype.entries);function N(M){if(M.bodyUsed)return Promise.reject(new TypeError("Already read"));M.bodyUsed=!0}function E(M){return new Promise(function(w,z){M.onload=function(){w(M.result)},M.onerror=function(){z(M.error)}})}function F(M){var w=new FileReader,z=E(w);return w.readAsArrayBuffer(M),z}function V(M){var w=new FileReader,z=E(w);return w.readAsText(M),z}function J(M){for(var w=new Uint8Array(M),z=new Array(w.length),Q=0;Q<w.length;Q++)z[Q]=String.fromCharCode(w[Q]);return z.join("")}function K(M){if(M.slice)return M.slice(0);var w=new Uint8Array(M.byteLength);return w.set(new Uint8Array(M)),w.buffer}function Y(){return this.bodyUsed=!1,this._initBody=function(M){this._bodyInit=M,M?typeof M=="string"?this._bodyText=M:l.blob&&Blob.prototype.isPrototypeOf(M)?this._bodyBlob=M:l.formData&&FormData.prototype.isPrototypeOf(M)?this._bodyFormData=M:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(M)?this._bodyText=M.toString():l.arrayBuffer&&l.blob&&d(M)?(this._bodyArrayBuffer=K(M.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(M)||m(M))?this._bodyArrayBuffer=K(M):this._bodyText=M=Object.prototype.toString.call(M):this._bodyText="",this.headers.get("content-type")||(typeof M=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(M)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var M=N(this);if(M)return M;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?N(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(F)}),this.text=function(){var M=N(this);if(M)return M;if(this._bodyBlob)return V(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(J(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(de)}),this.json=function(){return this.text().then(JSON.parse)},this}var X=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ne(M){var w=M.toUpperCase();return X.indexOf(w)>-1?w:M}function ye(M,w){w=w||{};var z=w.body;if(M instanceof ye){if(M.bodyUsed)throw new TypeError("Already read");this.url=M.url,this.credentials=M.credentials,w.headers||(this.headers=new _(M.headers)),this.method=M.method,this.mode=M.mode,this.signal=M.signal,!z&&M._bodyInit!=null&&(z=M._bodyInit,M.bodyUsed=!0)}else this.url=String(M);if(this.credentials=w.credentials||this.credentials||"same-origin",(w.headers||!this.headers)&&(this.headers=new _(w.headers)),this.method=ne(w.method||this.method||"GET"),this.mode=w.mode||this.mode||null,this.signal=w.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&z)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(z)}ye.prototype.clone=function(){return new ye(this,{body:this._bodyInit})};function de(M){var w=new FormData;return M.trim().split("&").forEach(function(z){if(z){var Q=z.split("="),ae=Q.shift().replace(/\+/g," "),te=Q.join("=").replace(/\+/g," ");w.append(decodeURIComponent(ae),decodeURIComponent(te))}}),w}function je(M){var w=new _,z=M.replace(/\r?\n[\t ]+/g," ");return z.split(/\r?\n/).forEach(function(Q){var ae=Q.split(":"),te=ae.shift().trim();if(te){var j=ae.join(":").trim();w.append(te,j)}}),w}Y.call(ye.prototype);function ke(M,w){w||(w={}),this.type="default",this.status=w.status===void 0?200:w.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in w?w.statusText:"OK",this.headers=new _(w.headers),this.url=w.url||"",this._initBody(M)}Y.call(ke.prototype),ke.prototype.clone=function(){return new ke(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _(this.headers),url:this.url})},ke.error=function(){var M=new ke(null,{status:0,statusText:""});return M.type="error",M};var Ae=[301,302,303,307,308];ke.redirect=function(M,w){if(Ae.indexOf(w)===-1)throw new RangeError("Invalid status code");return new ke(null,{status:w,headers:{location:M}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(w,z){this.message=w,this.name=z;var Q=Error(w);this.stack=Q.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Le(M,w){return new Promise(function(z,Q){var ae=new ye(M,w);if(ae.signal&&ae.signal.aborted)return Q(new o.DOMException("Aborted","AbortError"));var te=new XMLHttpRequest;function j(){te.abort()}te.onload=function(){var Oe={status:te.status,statusText:te.statusText,headers:je(te.getAllResponseHeaders()||"")};Oe.url="responseURL"in te?te.responseURL:Oe.headers.get("X-Request-URL");var Re="response"in te?te.response:te.responseText;z(new ke(Re,Oe))},te.onerror=function(){Q(new TypeError("Network request failed"))},te.ontimeout=function(){Q(new TypeError("Network request failed"))},te.onabort=function(){Q(new o.DOMException("Aborted","AbortError"))},te.open(ae.method,ae.url,!0),ae.credentials==="include"?te.withCredentials=!0:ae.credentials==="omit"&&(te.withCredentials=!1),"responseType"in te&&l.blob&&(te.responseType="blob"),ae.headers.forEach(function(Oe,Re){te.setRequestHeader(Re,Oe)}),ae.signal&&(ae.signal.addEventListener("abort",j),te.onreadystatechange=function(){te.readyState===4&&ae.signal.removeEventListener("abort",j)}),te.send(typeof ae._bodyInit=="undefined"?null:ae._bodyInit)})}return Le.polyfill=!0,a.fetch||(a.fetch=Le,a.Headers=_,a.Request=ye,a.Response=ke),o.Headers=_,o.Request=ye,o.Response=ke,o.fetch=Le,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;e=r.fetch,e.default=r.fetch,e.fetch=r.fetch,e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response,t.exports=e}(Ji,Ji.exports)),Ji.exports}var Ta=x_();const la=za(Ta),T_=hp({__proto__:null,default:la},[Ta]),di=t=>{let e={};return t&&(typeof Headers!="undefined"&&t instanceof Headers||T_&&Ta.Headers&&t instanceof Ta.Headers?e=Ik(t):Array.isArray(t)?t.forEach(([n,i])=>{n&&i!==void 0&&(e[n]=i)}):e=t),e},wc=t=>t.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),C_=t=>{if(!Array.isArray(t.query)){const i=t,r=[`query=${encodeURIComponent(wc(i.query))}`];return t.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof t.variables!="undefined"&&!Array.isArray(t.variables))throw new Error("Cannot create query with given variable type, array expected");const e=t,n=t.query.reduce((i,r,a)=>(i.push({query:wc(r),variables:e.variables?e.jsonSerializer.stringify(e.variables[a]):void 0}),i),[]);return`query=${encodeURIComponent(e.jsonSerializer.stringify(n))}`},R_=t=>async e=>{var N;const{url:n,query:i,variables:r,operationName:a,fetch:o,fetchOptions:l,middleware:d}=e,h={...e.headers};let m="",y;t==="POST"?(y=D_(i,r,a,l.jsonSerializer),typeof y=="string"&&(h["Content-Type"]="application/json")):m=C_({query:i,variables:r,operationName:a,jsonSerializer:(N=l.jsonSerializer)!=null?N:Su});const v={method:t,headers:h,body:y,...l};let x=n,_=v;if(d){const E=await Promise.resolve(d({...v,url:n,operationName:a,variables:r})),{url:F,...V}=E;x=F,_=V}return m&&(x=`${x}?${m}`),await o(x,_)};class F_{constructor(e,n={}){this.url=e,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,a,o]=i,l=Lk(r,a,o),{headers:d,fetch:h=la,method:m="POST",requestMiddleware:y,responseMiddleware:v,...x}=this.requestConfig,{url:_}=this;l.signal!==void 0&&(x.signal=l.signal);const{operationName:N}=yo(l.query);return bo({url:_,query:l.query,variables:l.variables,headers:{...di(ko(d)),...di(l.requestHeaders)},operationName:N,fetch:h,method:m,fetchOptions:x,middleware:y}).then(E=>(v&&v(E),E)).catch(E=>{throw v&&v(E),E})}}async request(e,...n){const[i,r]=n,a=Pk(e,i,r),{headers:o,fetch:l=la,method:d="POST",requestMiddleware:h,responseMiddleware:m,...y}=this.requestConfig,{url:v}=this;a.signal!==void 0&&(y.signal=a.signal);const{query:x,operationName:_}=yo(a.document);return bo({url:v,query:x,variables:a.variables,headers:{...di(ko(o)),...di(a.requestHeaders)},operationName:_,fetch:l,method:d,fetchOptions:y,middleware:h}).then(N=>(m&&m(N),N.data)).catch(N=>{throw m&&m(N),N})}batchRequests(e,n){var d;const i=$k(e,n),{headers:r,...a}=this.requestConfig;i.signal!==void 0&&(a.signal=i.signal);const o=i.documents.map(({document:h})=>yo(h).query),l=i.documents.map(({variables:h})=>h);return bo({url:this.url,query:o,variables:l,headers:{...di(ko(r)),...di(i.requestHeaders)},operationName:void 0,fetch:(d=this.requestConfig.fetch)!=null?d:la,method:this.requestConfig.method||"POST",fetchOptions:a,middleware:this.requestConfig.requestMiddleware}).then(h=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h.data)).catch(h=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h})}setHeaders(e){return this.requestConfig.headers=e,this}setHeader(e,n){const{headers:i}=this.requestConfig;return i?i[e]=n:this.requestConfig.headers={[e]:n},this}setEndpoint(e){return this.url=e,this}}const bo=async t=>{var m,y;const{query:e,variables:n,fetchOptions:i}=t,r=R_(Dk((m=t.method)!=null?m:"post")),a=Array.isArray(t.query),o=await r(t),l=await I_(o,(y=i.jsonSerializer)!=null?y:Su),d=Array.isArray(l)?!l.some(({data:v})=>!v):!!l.data,h=Array.isArray(l)||!l.errors||Array.isArray(l.errors)&&!l.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&h&&d){const{errors:v,...x}=(Array.isArray(l),l),_=i.errorPolicy==="ignore"?x:l;return{...a?{data:_}:_,headers:o.headers,status:o.status}}else{const v=typeof l=="string"?{error:l}:l;throw new Zi({...v,status:o.status,headers:o.headers},{query:e,variables:n})}},D_=(t,e,n,i)=>{const r=i!=null?i:Su;if(!Array.isArray(t))return r.stringify({query:t,variables:e,operationName:n});if(typeof e!="undefined"&&!Array.isArray(e))throw new Error("Cannot create request body with given variable type, array expected");const a=t.reduce((o,l,d)=>(o.push({query:l,variables:e?e[d]:void 0}),o),[]);return r.stringify(a)},I_=async(t,e)=>{let n;return t.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?e.parse(await t.text()):t.text()},ko=t=>typeof t=="function"?t():t;class bh extends cn{constructor(){super("EVENT_CHAT_ROOM_TOKEN_ERROR","Error getting chat room connection token")}}class rs{constructor(e){fe(this,"root",Tf(this));fe(this,"token");this.root.setProps(e)}static toDomain(e){const n={token:e.token};return new rs(n)}toPrimitives(){const{root:e,...n}=this;return{...n}}}const P_=_i.apiUrls.graphql;class kh{constructor(){fe(this,"client");this.client=new F_(P_)}async getChatRoom(e){var r;const{getChatRoomToken:n}=await this.client.request(Af,{data:{account:e.account,idEvent:e.eventId,userName:e.userName}});this.propagateGraphqlErrorIfExists(n);const i=(r=n.data)==null?void 0:r.token;if(!i)throw new bh;return rs.toDomain({token:i})}propagateGraphqlErrorIfExists(e){if(e.__typename==="ErrorGeneral")throw new Error(e.message)}}class _h{constructor(e){fe(this,"account");this.eventChatRoomRepository=e}async get(e){this.validateAccount();try{return await this.eventChatRoomRepository.getChatRoom({...e,account:this.account})}catch(n){throw new su(n)}}setAccount(e){this.account=e}validateAccount(){if(!this.account)throw new Xc}}const L_=new kh,iu=new _h(L_),as=Fa(void 0);as.debugLabel="chatSocketAtom";const ss=Fa(!1);ss.debugLabel="chatIsConnectedAtom";const br=Fa([]);br.debugLabel="chatMessageListAtom";const Sh=t=>{var n;t.data=t.data.replace("replace_gif",(n=t.urlGif)!=null?n:"");const e=t.data.indexOf("::question__")>-1;if(e){const[i,r]=t.data.split("::")||["none","none"],a=r.split("question__")[1],o={response:i.replace("response__",""),question:JSON.parse(a)};return{...t,data:o.response,isResponse:e,responseData:t.data,question:e?o.question:null}}return t},Nh=t=>{const{url:e,token:n,onOpen:i,onClose:r,onMessage:a,onError:o}=t,l=new WebSocket(e,n);return l.onopen=d=>i(d),l.onclose=d=>r(d),l.onerror=d=>o(d),l.onmessage=d=>a(d),l},Eh=()=>{const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(Math.random()*16)];return e},wu=(t,e)=>{var v,x;const{Content:n,Attributes:i,Sender:{Attributes:r}}=e,{username:a,type:o,email:l}=i,{isAdmin:d}=r,h=(v=i==null?void 0:i.id)!=null?v:ka(8),m=((x=t.find(_=>_.username===a))==null?void 0:x.color)||Eh(),y={id:h,type:o,color:m,username:a,email:l,data:n,sendDate:i.sendDate,isAdmin:d==="true",responseAdmin:!1,question:null,account:i.account,idEvent:i.idEvent,urlGif:i.urlGif,ip:i.ip};return Sh(y)},wh=t=>{const{eventId:e,userName:n,enabled:i=!0}=t,{accountName:r}=_f(),[a,o]=Pe.useState(""),l=()=>{i&&r&&(iu.setAccount(r),iu.get({eventId:e,userName:n}).then(d=>{o(d.token)}))};return Pe.useEffect(()=>{l()},[r,i]),{getQuery:{refetch:l},token:a}},{coreLogger:$_}=Zn(),Nt=$_.child("useConnectChatSocket"),M_=_i.publicUrls.wssIVSChat,j_=10,B_=t=>Math.min(1e4,1e3*Math.pow(2,t)),U_=(t,e,n)=>{const i=JSON.parse(t.data);switch(i.Type){case"EVENT":e==null||e(i);break;case"MESSAGE":n==null||n(i);break;case"ERROR":Nt.error("Chat room error:",i);break;default:Nt.error("Unknown chat room event:",t)}},Ah=t=>{const{onMessage:e,eventId:n,enabled:i=!0,userName:r,onEvent:a}=t,{token:o,getQuery:l}=wh({eventId:n,userName:r,enabled:i}),[d,h]=Ys(as),[m,y]=Ys(ss),[v,x]=Ys(br),_=Pe.useRef(0),N=Pe.useCallback(K=>Nt.error("Chat room socket error:",K),[]),E=Pe.useCallback(()=>{y(!0),_.current=0,Nt.debug("Successfully connected to the chat room")},[y]),F=Pe.useCallback(()=>{if(_.current>=j_){Nt.error("Max reconnection attempts reached. No further attempts will be made.");return}y(!1),_.current+=1;const K=B_(_.current);Nt.debug(`Disconnected from chat room. Reconnecting in ${K/1e3} seconds... (Attempt ${_.current})`),setTimeout(()=>l.refetch(),K)},[l,y]),V=Pe.useCallback(()=>{if(!o){Nt.debug("No token available. Connection aborted.");return}if((d==null?void 0:d.readyState)===WebSocket.OPEN){Nt.debug("WebSocket is already open. No need to reconnect.");return}Nt.debug("Connecting to the chat room...");const K=Nh({token:o,url:M_,onOpen:E,onClose:F,onError:N,onMessage:Y=>U_(Y,a,e)});h(K)},[o,d,a,e,E,F,N,h]),J=Pe.useCallback(()=>{if(!d||d.readyState!==WebSocket.OPEN){Nt.debug("No open socket to close.");return}Nt.debug("Closing chat room socket..."),d.close()},[d]);return Pe.useEffect(()=>{if(!i){Nt.debug("Chat is disabled, skipping connection.");return}if(!o){Nt.debug("Token not available, skipping connection.");return}return Nt.debug("Initializing connection with token:",o),J(),V(),J},[o,i]),{socket:d,chatIsConnected:m,chatMessageList:v,setChatMessageList:x}},V_=()=>{const t=xo(as),e=xo(ss);return{sendMessage:Pe.useCallback((i,r)=>{if(!t||!e)return;const a={id:r.id,sendDate:new Date,content:i,action:"SEND_MESSAGE",attributes:r},o=JSON.stringify(a);t.send(o)},[e,t])}},Oh=()=>{const t=au(br);return{handleEvent:i=>{var r;if(i.EventName==="senddeletemessage"){const a=JSON.parse((r=i.Attributes)==null?void 0:r.data);t(o=>o.filter(l=>l.id!==a.id))}},handleMessage:i=>{t(r=>[...r,wu(r,i)])}}},q_=t=>{const{eventId:e,userName:n}=t,[i,r]=Pe.useState(!1),[a,o]=Pe.useState(),[l,d]=Pe.useState(),[h,m]=Pe.useState([]),{handleEvent:y}=Oh(),v=au(br),x=V=>{v(J=>[wu(J,V),...J]),r(!1)},_=V=>{var J,K,Y;if(y(V),V.EventName==="sendpinmessage"){const X=JSON.parse((J=V.Attributes)==null?void 0:J.data);o({data:X.data,id:X.id,username:X.username})}if(V.EventName==="sendunpinmessage"&&o(void 0),V.EventName==="sendhighlightproduct"){const X=JSON.parse((K=V.Attributes)==null?void 0:K.data);d({products:X.productIds,collection:X.collection,livestreamingId:X.idEvent})}if(V.EventName==="sendaddtocart"){const X=JSON.parse((Y=V.Attributes)==null?void 0:Y.data);m(ne=>[...ne,{id:X.id,sessionId:X.sessionId,productId:X.productId,productImageUrl:X.productImageUrl,productName:X.productName}])}},{socket:N,chatMessageList:E,setChatMessageList:F}=Ah({onMessage:x,onEvent:_,eventId:e,userName:n});return{socket:N,chat:E,showLoader:i,pinnedMessage:a,highlightProduct:l,productsInCart:h,setChat:F,setShowLoader:r,setPinnedMessage:o,setProductsInCart:m}};/**
110
85
  * @license
111
86
  * Copyright 2019 Google LLC
112
87
  * SPDX-License-Identifier: BSD-3-Clause
113
- */const fa=globalThis,Ol=fa.ShadowRoot&&(fa.ShadyCSS===void 0||fa.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rl=Symbol(),bf=new WeakMap;let Om=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==Rl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Ol&&e===void 0){const r=n!==void 0&&n.length===1;r&&(e=bf.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&bf.set(n,e))}return e}toString(){return this.cssText}};const _E=t=>new Om(typeof t=="string"?t:t+"",void 0,Rl),SE=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((r,i,a)=>r+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[a+1],t[0]);return new Om(n,t,Rl)},AE=(t,e)=>{if(Ol)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),i=fa.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)}},kf=Ol?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return _E(n)})(t):t;/**
88
+ */const ca=globalThis,Au=ca.ShadowRoot&&(ca.ShadyCSS===void 0||ca.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ou=Symbol(),Ac=new WeakMap;let xh=class{constructor(e,n,i){if(this._$cssResult$=!0,i!==Ou)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(Au&&e===void 0){const i=n!==void 0&&n.length===1;i&&(e=Ac.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Ac.set(n,e))}return e}toString(){return this.cssText}};const H_=t=>new xh(typeof t=="string"?t:t+"",void 0,Ou),K_=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((i,r,a)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[a+1],t[0]);return new xh(n,t,Ou)},z_=(t,e)=>{if(Au)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const i=document.createElement("style"),r=ca.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=n.cssText,t.appendChild(i)}},Oc=Au?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const i of e.cssRules)n+=i.cssText;return H_(n)})(t):t;/**
114
89
  * @license
115
90
  * Copyright 2017 Google LLC
116
91
  * SPDX-License-Identifier: BSD-3-Clause
117
- */const{is:EE,defineProperty:wE,getOwnPropertyDescriptor:NE,getOwnPropertyNames:OE,getOwnPropertySymbols:RE,getPrototypeOf:TE}=Object,En=globalThis,_f=En.trustedTypes,CE=_f?_f.emptyScript:"",pu=En.reactiveElementPolyfillSupport,ei=(t,e)=>t,Qu={toAttribute(t,e){switch(e){case Boolean:t=t?CE:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Rm=(t,e)=>!EE(t,e),Sf={attribute:!0,type:String,converter:Qu,reflect:!1,hasChanged:Rm};var xf,Pf;(xf=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(Pf=En.litPropertyMetadata)!=null||(En.litPropertyMetadata=new WeakMap);class hr extends HTMLElement{static addInitializer(e){var n;this._$Ei(),((n=this.l)!=null?n:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Sf){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,n);i!==void 0&&wE(this.prototype,e,i)}}static getPropertyDescriptor(e,n,r){var o;const{get:i,set:a}=(o=NE(this.prototype,e))!=null?o:{get(){return this[n]},set(l){this[n]=l}};return{get(){return i==null?void 0:i.call(this)},set(l){const c=i==null?void 0:i.call(this);a.call(this,l),this.requestUpdate(e,c,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var n;return(n=this.elementProperties.get(e))!=null?n:Sf}static _$Ei(){if(this.hasOwnProperty(ei("elementProperties")))return;const e=TE(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ei("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ei("properties"))){const n=this.properties,r=[...OE(n),...RE(n)];for(const i of r)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)n.unshift(kf(i))}else e!==void 0&&n.push(kf(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(n=>n(this))}addController(e){var n,r;((n=this._$EO)!=null?n:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var n;(n=this._$EO)==null||n.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var n;const e=(n=this.shadowRoot)!=null?n:this.attachShadow(this.constructor.shadowRootOptions);return AE(e,this.constructor.elementStyles),e}connectedCallback(){var e,n;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(n=this._$EO)==null||n.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(n=>{var r;return(r=n.hostDisconnected)==null?void 0:r.call(n)})}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$EC(e,n){var a;const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const o=(((a=r.converter)==null?void 0:a.toAttribute)!==void 0?r.converter:Qu).toAttribute(n,r.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,n){var a;const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=r.getPropertyOptions(i),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((a=o.converter)==null?void 0:a.fromAttribute)!==void 0?o.converter:Qu;this._$Em=i,this[i]=l.fromAttribute(n,o.type),this._$Em=null}}requestUpdate(e,n,r){var i;if(e!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(e)),!((i=r.hasChanged)!=null?i:Rm)(this[e],n))return;this.P(e,n,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,n,r){var i;this._$AL.has(e)||this._$AL.set(e,n),r.reflect===!0&&this._$Em!==e&&((i=this._$Ej)!=null?i:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,l]of this._$Ep)this[o]=l;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[o,l]of a)l.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],l)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),(i=this._$EO)==null||i.forEach(a=>{var o;return(o=a.hostUpdate)==null?void 0:o.call(a)}),this.update(n)):this._$EU()}catch(a){throw e=!1,this._$EU(),a}e&&this._$AE(n)}willUpdate(e){}_$AE(e){var n;(n=this._$EO)==null||n.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(e){}firstUpdated(e){}}var Ff;hr.elementStyles=[],hr.shadowRootOptions={mode:"open"},hr[ei("elementProperties")]=new Map,hr[ei("finalized")]=new Map,pu==null||pu({ReactiveElement:hr}),((Ff=En.reactiveElementVersions)!=null?Ff:En.reactiveElementVersions=[]).push("2.0.4");/**
92
+ */const{is:G_,defineProperty:W_,getOwnPropertyDescriptor:J_,getOwnPropertyNames:Y_,getOwnPropertySymbols:X_,getPrototypeOf:Q_}=Object,Nn=globalThis,xc=Nn.trustedTypes,Z_=xc?xc.emptyScript:"",_o=Nn.reactiveElementPolyfillSupport,er=(t,e)=>t,ru={toAttribute(t,e){switch(e){case Boolean:t=t?Z_:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},Th=(t,e)=>!G_(t,e),Tc={attribute:!0,type:String,converter:ru,reflect:!1,hasChanged:Th};var Mc,jc;(Mc=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(jc=Nn.litPropertyMetadata)!=null||(Nn.litPropertyMetadata=new WeakMap);class hi extends HTMLElement{static addInitializer(e){var n;this._$Ei(),((n=this.l)!=null?n:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=Tc){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(e,n),!n.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(e,i,n);r!==void 0&&W_(this.prototype,e,r)}}static getPropertyDescriptor(e,n,i){var o;const{get:r,set:a}=(o=J_(this.prototype,e))!=null?o:{get(){return this[n]},set(l){this[n]=l}};return{get(){return r==null?void 0:r.call(this)},set(l){const d=r==null?void 0:r.call(this);a.call(this,l),this.requestUpdate(e,d,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var n;return(n=this.elementProperties.get(e))!=null?n:Tc}static _$Ei(){if(this.hasOwnProperty(er("elementProperties")))return;const e=Q_(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(er("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(er("properties"))){const n=this.properties,i=[...Y_(n),...X_(n)];for(const r of i)this.createProperty(r,n[r])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[i,r]of n)this.elementProperties.set(i,r)}this._$Eh=new Map;for(const[n,i]of this.elementProperties){const r=this._$Eu(n,i);r!==void 0&&this._$Eh.set(r,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)n.unshift(Oc(r))}else e!==void 0&&n.push(Oc(e));return n}static _$Eu(e,n){const i=n.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(n=>n(this))}addController(e){var n,i;((n=this._$EO)!=null?n:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)==null||i.call(e))}removeController(e){var n;(n=this._$EO)==null||n.delete(e)}_$E_(){const e=new Map,n=this.constructor.elementProperties;for(const i of n.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var n;const e=(n=this.shadowRoot)!=null?n:this.attachShadow(this.constructor.shadowRootOptions);return z_(e,this.constructor.elementStyles),e}connectedCallback(){var e,n;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(n=this._$EO)==null||n.forEach(i=>{var r;return(r=i.hostConnected)==null?void 0:r.call(i)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(n=>{var i;return(i=n.hostDisconnected)==null?void 0:i.call(n)})}attributeChangedCallback(e,n,i){this._$AK(e,i)}_$EC(e,n){var a;const i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){const o=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:ru).toAttribute(n,i.type);this._$Em=e,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(e,n){var a;const i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){const o=i.getPropertyOptions(r),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((a=o.converter)==null?void 0:a.fromAttribute)!==void 0?o.converter:ru;this._$Em=r,this[r]=l.fromAttribute(n,o.type),this._$Em=null}}requestUpdate(e,n,i){var r;if(e!==void 0){if(i!=null||(i=this.constructor.getPropertyOptions(e)),!((r=i.hasChanged)!=null?r:Th)(this[e],n))return;this.P(e,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,n,i){var r;this._$AL.has(e)||this._$AL.set(e,n),i.reflect===!0&&this._$Em!==e&&((r=this._$Ej)!=null?r:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i,r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((i=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,l]of this._$Ep)this[o]=l;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[o,l]of a)l.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],l)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),(r=this._$EO)==null||r.forEach(a=>{var o;return(o=a.hostUpdate)==null?void 0:o.call(a)}),this.update(n)):this._$EU()}catch(a){throw e=!1,this._$EU(),a}e&&this._$AE(n)}willUpdate(e){}_$AE(e){var n;(n=this._$EO)==null||n.forEach(i=>{var r;return(r=i.hostUpdated)==null?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(e){}firstUpdated(e){}}var Bc;hi.elementStyles=[],hi.shadowRootOptions={mode:"open"},hi[er("elementProperties")]=new Map,hi[er("finalized")]=new Map,_o==null||_o({ReactiveElement:hi}),((Bc=Nn.reactiveElementVersions)!=null?Bc:Nn.reactiveElementVersions=[]).push("2.0.4");/**
118
93
  * @license
119
94
  * Copyright 2017 Google LLC
120
95
  * SPDX-License-Identifier: BSD-3-Clause
121
- */const ti=globalThis,Pa=ti.trustedTypes,Af=Pa?Pa.createPolicy("lit-html",{createHTML:t=>t}):void 0,Tm="$lit$",_n=`lit$${Math.random().toFixed(9).slice(2)}$`,Cm="?"+_n,xE=`<${Cm}>`,Wn=document,ci=()=>Wn.createComment(""),di=t=>t===null||typeof t!="object"&&typeof t!="function",Tl=Array.isArray,PE=t=>Tl(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",mu=`[
122
- \f\r]`,Gr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ef=/-->/g,wf=/>/g,jn=RegExp(`>|${mu}(?:([^\\s"'>=/]+)(${mu}*=${mu}*(?:[^
123
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Nf=/'/g,Of=/"/g,xm=/^(?:script|style|textarea|title)$/i,FE=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),IE=FE(1),br=Symbol.for("lit-noChange"),lt=Symbol.for("lit-nothing"),Rf=new WeakMap,Mn=Wn.createTreeWalker(Wn,129);function Pm(t,e){if(!Tl(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Af!==void 0?Af.createHTML(e):e}const DE=(t,e)=>{const n=t.length-1,r=[];let i,a=e===2?"<svg>":e===3?"<math>":"",o=Gr;for(let l=0;l<n;l++){const c=t[l];let f,h,y=-1,m=0;for(;m<c.length&&(o.lastIndex=m,h=o.exec(c),h!==null);)m=o.lastIndex,o===Gr?h[1]==="!--"?o=Ef:h[1]!==void 0?o=wf:h[2]!==void 0?(xm.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=jn):h[3]!==void 0&&(o=jn):o===jn?h[0]===">"?(o=i!=null?i:Gr,y=-1):h[1]===void 0?y=-2:(y=o.lastIndex-h[2].length,f=h[1],o=h[3]===void 0?jn:h[3]==='"'?Of:Nf):o===Of||o===Nf?o=jn:o===Ef||o===wf?o=Gr:(o=jn,i=void 0);const O=o===jn&&t[l+1].startsWith("/>")?" ":"";a+=o===Gr?c+xE:y>=0?(r.push(f),c.slice(0,y)+Tm+c.slice(y)+_n+O):c+_n+(y===-2?l:O)}return[Pm(t,a+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};class fi{constructor({strings:e,_$litType$:n},r){let i;this.parts=[];let a=0,o=0;const l=e.length-1,c=this.parts,[f,h]=DE(e,n);if(this.el=fi.createElement(f,r),Mn.currentNode=this.el.content,n===2||n===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=Mn.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const y of i.getAttributeNames())if(y.endsWith(Tm)){const m=h[o++],O=i.getAttribute(y).split(_n),A=/([.?@])?(.*)/.exec(m);c.push({type:1,index:a,name:A[2],strings:O,ctor:A[1]==="."?$E:A[1]==="?"?jE:A[1]==="@"?BE:cs}),i.removeAttribute(y)}else y.startsWith(_n)&&(c.push({type:6,index:a}),i.removeAttribute(y));if(xm.test(i.tagName)){const y=i.textContent.split(_n),m=y.length-1;if(m>0){i.textContent=Pa?Pa.emptyScript:"";for(let O=0;O<m;O++)i.append(y[O],ci()),Mn.nextNode(),c.push({type:2,index:++a});i.append(y[m],ci())}}}else if(i.nodeType===8)if(i.data===Cm)c.push({type:2,index:a});else{let y=-1;for(;(y=i.data.indexOf(_n,y+1))!==-1;)c.push({type:7,index:a}),y+=_n.length-1}a++}}static createElement(e,n){const r=Wn.createElement("template");return r.innerHTML=e,r}}function kr(t,e,n=t,r){var o,l,c;if(e===br)return e;let i=r!==void 0?(o=n.o)==null?void 0:o[r]:n.l;const a=di(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==a&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),a===void 0?i=void 0:(i=new a(t),i._$AT(t,n,r)),r!==void 0?((c=n.o)!=null?c:n.o=[])[r]=i:n.l=i),i!==void 0&&(e=kr(t,i._$AS(t,e.values),i,r)),e}class LE{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var f;const{el:{content:n},parts:r}=this._$AD,i=((f=e==null?void 0:e.creationScope)!=null?f:Wn).importNode(n,!0);Mn.currentNode=i;let a=Mn.nextNode(),o=0,l=0,c=r[0];for(;c!==void 0;){if(o===c.index){let h;c.type===2?h=new _i(a,a.nextSibling,this,e):c.type===1?h=new c.ctor(a,c.name,c.strings,this,e):c.type===6&&(h=new ME(a,this,e)),this._$AV.push(h),c=r[++l]}o!==(c==null?void 0:c.index)&&(a=Mn.nextNode(),o++)}return Mn.currentNode=Wn,i}p(e){let n=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,n),n+=r.strings.length-2):r._$AI(e[n])),n++}}class _i{get _$AU(){var e,n;return(n=(e=this._$AM)==null?void 0:e._$AU)!=null?n:this.v}constructor(e,n,r,i){var a;this.type=2,this._$AH=lt,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=r,this.options=i,this.v=(a=i==null?void 0:i.isConnected)!=null?a:!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=kr(this,e,n),di(e)?e===lt||e==null||e===""?(this._$AH!==lt&&this._$AR(),this._$AH=lt):e!==this._$AH&&e!==br&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):PE(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==lt&&di(this._$AH)?this._$AA.nextSibling.data=e:this.T(Wn.createTextNode(e)),this._$AH=e}$(e){var a;const{values:n,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=fi.createElement(Pm(r.h,r.h[0]),this.options)),r);if(((a=this._$AH)==null?void 0:a._$AD)===i)this._$AH.p(n);else{const o=new LE(i,this),l=o.u(this.options);o.p(n),this.T(l),this._$AH=o}}_$AC(e){let n=Rf.get(e.strings);return n===void 0&&Rf.set(e.strings,n=new fi(e)),n}k(e){Tl(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let r,i=0;for(const a of e)i===n.length?n.push(r=new _i(this.O(ci()),this.O(ci()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,n){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,n);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var n;this._$AM===void 0&&(this.v=e,(n=this._$AP)==null||n.call(this,e))}}class cs{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,r,i,a){this.type=1,this._$AH=lt,this._$AN=void 0,this.element=e,this.name=n,this._$AM=i,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=lt}_$AI(e,n=this,r,i){const a=this.strings;let o=!1;if(a===void 0)e=kr(this,e,n,0),o=!di(e)||e!==this._$AH&&e!==br,o&&(this._$AH=e);else{const l=e;let c,f;for(e=a[0],c=0;c<a.length-1;c++)f=kr(this,l[r+c],n,c),f===br&&(f=this._$AH[c]),o||(o=!di(f)||f!==this._$AH[c]),f===lt?e=lt:e!==lt&&(e+=(f!=null?f:"")+a[c+1]),this._$AH[c]=f}o&&!i&&this.j(e)}j(e){e===lt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}}class $E extends cs{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===lt?void 0:e}}class jE extends cs{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==lt)}}class BE extends cs{constructor(e,n,r,i,a){super(e,n,r,i,a),this.type=5}_$AI(e,n=this){var o;if((e=(o=kr(this,e,n,0))!=null?o:lt)===br)return;const r=this._$AH,i=e===lt&&r!==lt||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==lt&&(r===lt||i);i&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var n,r;typeof this._$AH=="function"?this._$AH.call((r=(n=this.options)==null?void 0:n.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}}class ME{constructor(e,n,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){kr(this,e)}}const gu=ti.litHtmlPolyfillSupport;var If;gu==null||gu(fi,_i),((If=ti.litHtmlVersions)!=null?If:ti.litHtmlVersions=[]).push("3.2.0");const UE=(t,e,n)=>{var a,o;const r=(a=n==null?void 0:n.renderBefore)!=null?a:e;let i=r._$litPart$;if(i===void 0){const l=(o=n==null?void 0:n.renderBefore)!=null?o:null;r._$litPart$=i=new _i(e.insertBefore(ci(),l),l,void 0,n!=null?n:{})}return i._$AI(t),i};/**
96
+ */const tr=globalThis,Ca=tr.trustedTypes,Cc=Ca?Ca.createPolicy("lit-html",{createHTML:t=>t}):void 0,Ch="$lit$",kn=`lit$${Math.random().toFixed(9).slice(2)}$`,Rh="?"+kn,eS=`<${Rh}>`,Wn=document,cr=()=>Wn.createComment(""),dr=t=>t===null||typeof t!="object"&&typeof t!="function",xu=Array.isArray,tS=t=>xu(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",So=`[
97
+ \f\r]`,Gi=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Rc=/-->/g,Fc=/>/g,Mn=RegExp(`>|${So}(?:([^\\s"'>=/]+)(${So}*=${So}*(?:[^
98
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Dc=/'/g,Ic=/"/g,Fh=/^(?:script|style|textarea|title)$/i,nS=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),iS=nS(1),bi=Symbol.for("lit-noChange"),ct=Symbol.for("lit-nothing"),Pc=new WeakMap,Bn=Wn.createTreeWalker(Wn,129);function Dh(t,e){if(!xu(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Cc!==void 0?Cc.createHTML(e):e}const rS=(t,e)=>{const n=t.length-1,i=[];let r,a=e===2?"<svg>":e===3?"<math>":"",o=Gi;for(let l=0;l<n;l++){const d=t[l];let h,m,y=-1,v=0;for(;v<d.length&&(o.lastIndex=v,m=o.exec(d),m!==null);)v=o.lastIndex,o===Gi?m[1]==="!--"?o=Rc:m[1]!==void 0?o=Fc:m[2]!==void 0?(Fh.test(m[2])&&(r=RegExp("</"+m[2],"g")),o=Mn):m[3]!==void 0&&(o=Mn):o===Mn?m[0]===">"?(o=r!=null?r:Gi,y=-1):m[1]===void 0?y=-2:(y=o.lastIndex-m[2].length,h=m[1],o=m[3]===void 0?Mn:m[3]==='"'?Ic:Dc):o===Ic||o===Dc?o=Mn:o===Rc||o===Fc?o=Gi:(o=Mn,r=void 0);const x=o===Mn&&t[l+1].startsWith("/>")?" ":"";a+=o===Gi?d+eS:y>=0?(i.push(h),d.slice(0,y)+Ch+d.slice(y)+kn+x):d+kn+(y===-2?l:x)}return[Dh(t,a+(t[n]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class fr{constructor({strings:e,_$litType$:n},i){let r;this.parts=[];let a=0,o=0;const l=e.length-1,d=this.parts,[h,m]=rS(e,n);if(this.el=fr.createElement(h,i),Bn.currentNode=this.el.content,n===2||n===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(r=Bn.nextNode())!==null&&d.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(const y of r.getAttributeNames())if(y.endsWith(Ch)){const v=m[o++],x=r.getAttribute(y).split(kn),_=/([.?@])?(.*)/.exec(v);d.push({type:1,index:a,name:_[2],strings:x,ctor:_[1]==="."?sS:_[1]==="?"?oS:_[1]==="@"?uS:os}),r.removeAttribute(y)}else y.startsWith(kn)&&(d.push({type:6,index:a}),r.removeAttribute(y));if(Fh.test(r.tagName)){const y=r.textContent.split(kn),v=y.length-1;if(v>0){r.textContent=Ca?Ca.emptyScript:"";for(let x=0;x<v;x++)r.append(y[x],cr()),Bn.nextNode(),d.push({type:2,index:++a});r.append(y[v],cr())}}}else if(r.nodeType===8)if(r.data===Rh)d.push({type:2,index:a});else{let y=-1;for(;(y=r.data.indexOf(kn,y+1))!==-1;)d.push({type:7,index:a}),y+=kn.length-1}a++}}static createElement(e,n){const i=Wn.createElement("template");return i.innerHTML=e,i}}function ki(t,e,n=t,i){var o,l,d;if(e===bi)return e;let r=i!==void 0?(o=n.o)==null?void 0:o[i]:n.l;const a=dr(e)?void 0:e._$litDirective$;return(r==null?void 0:r.constructor)!==a&&((l=r==null?void 0:r._$AO)==null||l.call(r,!1),a===void 0?r=void 0:(r=new a(t),r._$AT(t,n,i)),i!==void 0?((d=n.o)!=null?d:n.o=[])[i]=r:n.l=r),r!==void 0&&(e=ki(t,r._$AS(t,e.values),r,i)),e}class aS{constructor(e,n){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var h;const{el:{content:n},parts:i}=this._$AD,r=((h=e==null?void 0:e.creationScope)!=null?h:Wn).importNode(n,!0);Bn.currentNode=r;let a=Bn.nextNode(),o=0,l=0,d=i[0];for(;d!==void 0;){if(o===d.index){let m;d.type===2?m=new kr(a,a.nextSibling,this,e):d.type===1?m=new d.ctor(a,d.name,d.strings,this,e):d.type===6&&(m=new lS(a,this,e)),this._$AV.push(m),d=i[++l]}o!==(d==null?void 0:d.index)&&(a=Bn.nextNode(),o++)}return Bn.currentNode=Wn,r}p(e){let n=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,n),n+=i.strings.length-2):i._$AI(e[n])),n++}}class kr{get _$AU(){var e,n;return(n=(e=this._$AM)==null?void 0:e._$AU)!=null?n:this.v}constructor(e,n,i,r){var a;this.type=2,this._$AH=ct,this._$AN=void 0,this._$AA=e,this._$AB=n,this._$AM=i,this.options=r,this.v=(a=r==null?void 0:r.isConnected)!=null?a:!0}get parentNode(){let e=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=n.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,n=this){e=ki(this,e,n),dr(e)?e===ct||e==null||e===""?(this._$AH!==ct&&this._$AR(),this._$AH=ct):e!==this._$AH&&e!==bi&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):tS(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ct&&dr(this._$AH)?this._$AA.nextSibling.data=e:this.T(Wn.createTextNode(e)),this._$AH=e}$(e){var a;const{values:n,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=fr.createElement(Dh(i.h,i.h[0]),this.options)),i);if(((a=this._$AH)==null?void 0:a._$AD)===r)this._$AH.p(n);else{const o=new aS(r,this),l=o.u(this.options);o.p(n),this.T(l),this._$AH=o}}_$AC(e){let n=Pc.get(e.strings);return n===void 0&&Pc.set(e.strings,n=new fr(e)),n}k(e){xu(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let i,r=0;for(const a of e)r===n.length?n.push(i=new kr(this.O(cr()),this.O(cr()),this,this.options)):i=n[r],i._$AI(a),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(e=this._$AA.nextSibling,n){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,n);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var n;this._$AM===void 0&&(this.v=e,(n=this._$AP)==null||n.call(this,e))}}class os{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,n,i,r,a){this.type=1,this._$AH=ct,this._$AN=void 0,this.element=e,this.name=n,this._$AM=r,this.options=a,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ct}_$AI(e,n=this,i,r){const a=this.strings;let o=!1;if(a===void 0)e=ki(this,e,n,0),o=!dr(e)||e!==this._$AH&&e!==bi,o&&(this._$AH=e);else{const l=e;let d,h;for(e=a[0],d=0;d<a.length-1;d++)h=ki(this,l[i+d],n,d),h===bi&&(h=this._$AH[d]),o||(o=!dr(h)||h!==this._$AH[d]),h===ct?e=ct:e!==ct&&(e+=(h!=null?h:"")+a[d+1]),this._$AH[d]=h}o&&!r&&this.j(e)}j(e){e===ct?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}}class sS extends os{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ct?void 0:e}}class oS extends os{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ct)}}class uS extends os{constructor(e,n,i,r,a){super(e,n,i,r,a),this.type=5}_$AI(e,n=this){var o;if((e=(o=ki(this,e,n,0))!=null?o:ct)===bi)return;const i=this._$AH,r=e===ct&&i!==ct||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,a=e!==ct&&(i===ct||r);r&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var n,i;typeof this._$AH=="function"?this._$AH.call((i=(n=this.options)==null?void 0:n.host)!=null?i:this.element,e):this._$AH.handleEvent(e)}}class lS{constructor(e,n,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){ki(this,e)}}const No=tr.litHtmlPolyfillSupport;var Uc;No==null||No(fr,kr),((Uc=tr.litHtmlVersions)!=null?Uc:tr.litHtmlVersions=[]).push("3.2.0");const cS=(t,e,n)=>{var a,o;const i=(a=n==null?void 0:n.renderBefore)!=null?a:e;let r=i._$litPart$;if(r===void 0){const l=(o=n==null?void 0:n.renderBefore)!=null?o:null;i._$litPart$=r=new kr(e.insertBefore(cr(),l),l,void 0,n!=null?n:{})}return r._$AI(t),r};/**
124
99
  * @license
125
100
  * Copyright 2017 Google LLC
126
101
  * SPDX-License-Identifier: BSD-3-Clause
127
- */class ni extends hr{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var n,r;const e=super.createRenderRoot();return(r=(n=this.renderOptions).renderBefore)!=null||(n.renderBefore=e.firstChild),e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=UE(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return br}}var Df;ni._$litElement$=!0,ni.finalized=!0,(Df=globalThis.litElementHydrateSupport)==null||Df.call(globalThis,{LitElement:ni});const yu=globalThis.litElementPolyfillSupport;yu==null||yu({LitElement:ni});var Lf;((Lf=globalThis.litElementVersions)!=null?Lf:globalThis.litElementVersions=[]).push("4.1.0");/**
102
+ */class nr extends hi{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var n,i;const e=super.createRenderRoot();return(i=(n=this.renderOptions).renderBefore)!=null||(n.renderBefore=e.firstChild),e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=cS(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return bi}}var Vc;nr._$litElement$=!0,nr.finalized=!0,(Vc=globalThis.litElementHydrateSupport)==null||Vc.call(globalThis,{LitElement:nr});const Eo=globalThis.litElementPolyfillSupport;Eo==null||Eo({LitElement:nr});var qc;((qc=globalThis.litElementVersions)!=null?qc:globalThis.litElementVersions=[]).push("4.1.0");/**
128
103
  * @license
129
104
  * Copyright 2020 Google LLC
130
105
  * SPDX-License-Identifier: BSD-3-Clause
131
- */const VE=t=>t.strings===void 0;/**
106
+ */const dS=t=>t.strings===void 0;/**
132
107
  * @license
133
108
  * Copyright 2017 Google LLC
134
109
  * SPDX-License-Identifier: BSD-3-Clause
135
- */const qE={CHILD:2},HE=t=>(...e)=>({_$litDirective$:t,values:e});class KE{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,r){this.t=e,this._$AM=n,this.i=r}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}}/**
110
+ */const fS={CHILD:2},hS=t=>(...e)=>({_$litDirective$:t,values:e});class pS{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,i){this.t=e,this._$AM=n,this.i=i}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}}/**
136
111
  * @license
137
112
  * Copyright 2017 Google LLC
138
113
  * SPDX-License-Identifier: BSD-3-Clause
139
- */const ri=(t,e)=>{var r;const n=t._$AN;if(n===void 0)return!1;for(const i of n)(r=i._$AO)==null||r.call(i,e,!1),ri(i,e);return!0},Fa=t=>{let e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n==null?void 0:n.size)===0)},Fm=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),WE(e)}};function zE(t){this._$AN!==void 0?(Fa(this),this._$AM=t,Fm(this)):this._$AM=t}function GE(t,e=!1,n=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let a=n;a<r.length;a++)ri(r[a],!1),Fa(r[a]);else r!=null&&(ri(r,!1),Fa(r));else ri(this,t)}const WE=t=>{var e,n;t.type==qE.CHILD&&((e=t._$AP)!=null||(t._$AP=GE),(n=t._$AQ)!=null||(t._$AQ=zE))};class JE extends KE{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,n,r){super._$AT(e,n,r),Fm(this),this.isConnected=e._$AU}_$AO(e,n=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),n&&(ri(this,e),Fa(this))}setValue(e){if(VE(this.t))this.t._$AI(e,this);else{const n=[...this.t._$AH];n[this.i]=e,this.t._$AI(n,this,0)}}disconnected(){}reconnected(){}}/**
114
+ */const ir=(t,e)=>{var i;const n=t._$AN;if(n===void 0)return!1;for(const r of n)(i=r._$AO)==null||i.call(r,e,!1),ir(r,e);return!0},Ra=t=>{let e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n==null?void 0:n.size)===0)},Ih=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),vS(e)}};function mS(t){this._$AN!==void 0?(Ra(this),this._$AM=t,Ih(this)):this._$AM=t}function gS(t,e=!1,n=0){const i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(e)if(Array.isArray(i))for(let a=n;a<i.length;a++)ir(i[a],!1),Ra(i[a]);else i!=null&&(ir(i,!1),Ra(i));else ir(this,t)}const vS=t=>{var e,n;t.type==fS.CHILD&&((e=t._$AP)!=null||(t._$AP=gS),(n=t._$AQ)!=null||(t._$AQ=mS))};class yS extends pS{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,n,i){super._$AT(e,n,i),Ih(this),this.isConnected=e._$AU}_$AO(e,n=!0){var i,r;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(r=this.disconnected)==null||r.call(this)),n&&(ir(this,e),Ra(this))}setValue(e){if(dS(this.t))this.t._$AI(e,this);else{const n=[...this.t._$AH];n[this.i]=e,this.t._$AI(n,this,0)}}disconnected(){}reconnected(){}}/**
140
115
  * @license
141
116
  * Copyright 2020 Google LLC
142
117
  * SPDX-License-Identifier: BSD-3-Clause
143
- */const YE=()=>new QE;class QE{}const vu=new WeakMap,XE=HE(class extends JE{render(t){return lt}update(t,[e]){var r;const n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=(r=t.options)==null?void 0:r.host,this.rt(this.ct=t.element)),lt}rt(t){var e;if(this.isConnected||(t=void 0),typeof this.Y=="function"){const n=(e=this.ht)!=null?e:globalThis;let r=vu.get(n);r===void 0&&(r=new WeakMap,vu.set(n,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e,n;return typeof this.Y=="function"?(e=vu.get((t=this.ht)!=null?t:globalThis))==null?void 0:e.get(this.Y):(n=this.Y)==null?void 0:n.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var ta={},Tf;function ZE(){if(Tf)return ta;Tf=1;var t=dg;return ta.createRoot=t.createRoot,ta.hydrateRoot=t.hydrateRoot,ta}var ew=ZE();class Im extends ni{constructor(){super(...arguments);Ae(this,"rootRef",YE());Ae(this,"rootInstance")}render(){return IE`<div ${XE(this.rootRef)}></div>`}updated(){this.updateReactComponent()}updateReactComponent(){if(!this.rootRef.value)return;this.rootInstance||(this.rootInstance=ew.createRoot(this.rootRef.value));const n=Ue.createElement(this.getReactComponent(),this.getReactProps(),Ue.createElement("slot"));this.rootInstance.render(n)}handleHMR(n){}injectStyles(n){const r=i=>i.replace("./","");for(const[i,a]of Object.entries(n)){const o=r(i),l=document.createElement("style");l.setAttribute("type","text/css"),l.setAttribute("id",o),l.innerHTML=a,setTimeout(()=>{var c;return(c=this.shadowRoot)==null?void 0:c.appendChild(l)})}}setupHMRListener(){}}Ae(Im,"baseStyles",SE`
118
+ */const bS=()=>new kS;class kS{}const wo=new WeakMap,_S=hS(class extends yS{render(t){return ct}update(t,[e]){var i;const n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=t.options)==null?void 0:i.host,this.rt(this.ct=t.element)),ct}rt(t){var e;if(this.isConnected||(t=void 0),typeof this.Y=="function"){const n=(e=this.ht)!=null?e:globalThis;let i=wo.get(n);i===void 0&&(i=new WeakMap,wo.set(n,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,t),t!==void 0&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){var t,e,n;return typeof this.Y=="function"?(e=wo.get((t=this.ht)!=null?t:globalThis))==null?void 0:e.get(this.Y):(n=this.Y)==null?void 0:n.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var Zr={},Lc;function SS(){if(Lc)return Zr;Lc=1;var t=fp;return Zr.createRoot=t.createRoot,Zr.hydrateRoot=t.hydrateRoot,Zr}var NS=SS();class Ph extends nr{constructor(){super(...arguments);fe(this,"rootRef",bS());fe(this,"rootInstance")}render(){return iS`<div ${_S(this.rootRef)}></div>`}updated(){this.updateReactComponent()}updateReactComponent(){if(!this.rootRef.value)return;this.rootInstance||(this.rootInstance=NS.createRoot(this.rootRef.value));const n=Pe.createElement(this.getReactComponent(),this.getReactProps(),Pe.createElement("slot"));this.rootInstance.render(n)}handleHMR(n){}injectStyles(n){const i=r=>r.replace("./","");for(const[r,a]of Object.entries(n)){const o=i(r),l=document.createElement("style");l.setAttribute("type","text/css"),l.setAttribute("id",o),l.innerHTML=a,setTimeout(()=>{var d;return(d=this.shadowRoot)==null?void 0:d.appendChild(l)})}}setupHMRListener(){}}fe(Ph,"baseStyles",K_`
144
119
  :host {
145
120
  width: 100%;
146
121
  }
147
- `);class Dm{constructor(e,n,r){Ae(this,"renderFn");Ae(this,"logger");Ae(this,"rootId");Ae(this,"element",null);Ae(this,"unmount");Ae(this,"updateProps");this.rootId=e,this.renderFn=n,this.logger=r}async render(e={}){var n;if(this.element)this.updateProps(e);else{const r=await this.renderFn(this.rootId,e);this.element=(n=r==null?void 0:r.element)!=null?n:null,this.updateProps=i=>r==null?void 0:r.updateProps(i),this.unmount=()=>{r==null||r.unmount(),this.element=null}}}}class ds{constructor(e){this.config=e}static isApplicable(e){return vl.LOCAL===e.bundler.stage}async execute(){var n;const{runtime:e}=this.config;(n=e.env)!=null&&n.account?await e.configureStore(e.env):e.logger.warn("missing account in local environment")}}Ae(ds,"type",fn.Local);const tw=window==null?void 0:window.__NZ_APP__;class Cl{constructor(e){this.config=e}static isApplicable(){return tw==="platform"}async execute(){}}Ae(Cl,"type",fn.Platform);const na=window==null?void 0:window.faststore_sdk_stores;class xl{constructor(e){this.config=e;const n={vtexfaststore:na};this.config.runtime.updateMeta(n)}static isApplicable(){return!!na}async execute(){const{runtime:e}=this.config;if(!na.account){e.logger.error("missing the account in window.faststore_sdk_stores");return}await e.configureStore({account:na.account})}}Ae(xl,"type",fn.VtexFastStore);const ra=window==null?void 0:window.__RUNTIME__;class fs{constructor(e){this.config=e;const n={vtexio:ra};this.config.runtime.updateMeta(n)}static isApplicable(){return!!ra}async execute(){const{runtime:e}=this.config;if(!ra.account){e.logger.error("missing the account in window.__RUNTIME__");return}await e.configureStore({account:ra.account})}}Ae(fs,"type",fn.VtexIO);const Cf=window==null?void 0:window.vtexjs;class hs{constructor(e){this.config=e;const n={vtexjs:Cf};this.config.runtime.updateMeta(n)}static isApplicable(){return!!Cf}async execute(){const{runtime:e}=this.config;let n={};const r=`${e.componentId.value}-script`,i=rp(r);if(n=Object.fromEntries(i.entries()),!n.account){e.logger.error(`missing the account in the search params of the script #${r}`);return}await e.configureStore({account:n.account})}}Ae(hs,"type",fn.VtexLegacy);class Pl{constructor(e){this.config=e}static isApplicable(e){return!ds.isApplicable(e)&&!fs.isApplicable()&&!hs.isApplicable()&&!xl.isApplicable()&&!Cl.isApplicable()}async execute(){}}Ae(Pl,"type",fn.External);const Lm=[ds,fs,hs,Pl,xl,Cl];class nw{constructor(e){Ae(this,"globalId");Ae(this,"metadata");Ae(this,"customConfigList");Ae(this,"env");Ae(this,"bundler");Ae(this,"logger");Ae(this,"componentId");Ae(this,"renderHandler");Ae(this,"store");this.globalId=e.globalId,this.store=e.getStore(),this.logger=e.logger.child("Runtime"),this.env=e.env,this.bundler=e.bundler,this.customConfigList=new Map,this.metadata={type:fn.External},this.initializeGlobals()}config(e,n,r){typeof n=="function"&&(r=n,n={});const{skipBaseBehavior:i=!1}=n;return this.customConfigList.set(e,{callback:r,skipBaseBehavior:i}),this}registerComponent(e,n){const r=this.toCamel(e);if(window[this.globalId][r])return this.logger.debug(`Component "${r}" is already registered.`),this;this.componentId={value:e,formatted:r},this.renderHandler=n;const i={render:this.renderHandler};return window[this.globalId][this.componentId.formatted]=i,this.logger.debug(`Component "${r}" registered.`),this}async execute(e){for(const n of Lm)if(n.isApplicable(this)){const r=new n({runtime:this}),i=this.customConfigList.get(n.type);this.updateMeta({type:n.type}),i!=null&&i.skipBaseBehavior||await r.execute(),i&&await i.callback({runtime:this,component:new Dm(this.componentId.value,this.renderHandler,this.logger)});break}await(e==null?void 0:e())}updateMeta(e){this.metadata={...this.metadata,...e}}async configureStore(e){await this.store.configure(e)}get meta(){return this.metadata}initializeGlobals(){var r;if(window[this.globalId]||(window[this.globalId]={},this.logger.debug(`Initialized "${this.globalId}" window object`)),(r=window[this.globalId])!=null&&r.runtime){this.logger.debug(`Runtime for "${this.globalId}" are already initialized.`);return}const e=()=>Object.freeze({...this.metadata}),n=()=>Object.freeze({isProd:this.bundler.isProd,get meta(){return e()}});Object.defineProperty(window[this.globalId],"runtime",{get:()=>n()}),this.logger.debug(`Initialized runtime for "${this.globalId}".`)}toCamel(e){return e.replace(/^[a-z]{2}-/,"").replace(/-./g,n=>n[1].toUpperCase())}}exports.AccountContractStatusTypes=cp;exports.AccountContractTypes=lp;exports.AccountInvalidError=Hf;exports.AccountNotFoundError=yl;exports.AccountPlanDescriptionTypes=fp;exports.AccountService=vp;exports.AccountSubscriptionTypes=dp;exports.AccountTypes=up;exports.AddToCartActionTypes=Xa;exports.AggregateRoot=Op;exports.ApiGraphqlTypes=Dk;exports.BaseDB=$h;exports.BroadcastChannelEventBus=Bh;exports.ComponentManager=Dm;exports.CreatePlanError=mp;exports.DomainError=dn;exports.ErrorCodes=kt;exports.EventBusWildcards=Qv;exports.EventChatRoom=os;exports.EventChatRoomService=km;exports.EventChatRoomTokenError=vm;exports.EventNames=Uh;exports.ExternalRuntime=Pl;exports.GlobalPageSectionTypes=hp;exports.GraphqlEventChatRoomRepository=bm;exports.HttpAxiosClient=VS;exports.InvalidNizzaGlobalObjectError=Kf;exports.LanguageTypes=Vh;exports.LocalRuntime=ds;exports.LogLevel=it;exports.LogLevelPriority=Qe;exports.Logger=ep;exports.MAX_PRODUCTS_IN_CART=Yv;exports.NizzaEventStatus=Mh;exports.NizzaProductRequestOriginTypes=Kh;exports.NizzaStore=Aa;exports.NizzaVariationTypes=Hh;exports.PlanNotFoundError=pp;exports.PriorityToLogLevelMap=qh;exports.ReactHostElement=Im;exports.ResourceNotFoundError=Bg;exports.RestAccountPlanRepository=gp;exports.RestPublicAccountRepository=yp;exports.Runtime=nw;exports.RuntimeStage=vl;exports.RuntimeType=fn;exports.StoreProvider=Fv;exports.UnexpectedError=Zu;exports.ValueObject=Vk;exports.VtexIORuntime=fs;exports.VtexLegacyRuntime=hs;exports.accountAtom=Vf;exports.accountService=bp;exports.addQuestionData=_m;exports.addToCartMessages=ju;exports.apiCall=Cg;exports.buildLanguageTranslations=rm;exports.buildTranslations=im;exports.chatIsConnectedAtom=ls;exports.chatMessageListAtom=ki;exports.chatSocketAtom=us;exports.connectToSocket=Sm;exports.createActionFactory=Np;exports.createAggregateRoot=Rp;exports.createNizzaLogger=Mb;exports.createPinoLogger=tp;exports.createStore=Lk;exports.customFetch=qn;exports.downloadFile=xg;exports.eventChatRoomService=Yu;exports.fileOrigin=qb;exports.getAccount=_p;exports.getClientMetadata=op;exports.getClientTimeZone=sp;exports.getNizza=Zn;exports.getRandomColor=Am;exports.getScriptParams=rp;exports.getStore=Dv;exports.getUserFriendlyMessage=nm;exports.i18Init=om;exports.jsDownload=qf;exports.nizzaDB=jh;exports.normalizeChatMessage=Nl;exports.registerTranslations=uA;exports.registerTranslationsOf=am;exports.runAddToCartHooks=jk;exports.runtimeList=Lm;exports.searchParams=np;exports.shortId=Sa;exports.sleep=Hb;exports.useAccount=kp;exports.useAutorun=xv;exports.useChatSocketActions=bE;exports.useChatSocketClient=kE;exports.useChatSocketHandlers=Nm;exports.useConnectChatSocket=wm;exports.useEventChatRoom=Em;exports.useMetaDataClient=lA;exports.useNZ=ip;exports.useNizza=ap;exports.useReaction=Pv;exports.useSelect=Lh;exports.useStore=Iv;exports.validateRequiredProps=Mg;
122
+ `);class Lh{constructor(e,n,i){fe(this,"renderFn");fe(this,"logger");fe(this,"rootId");fe(this,"element",null);fe(this,"unmount");fe(this,"updateProps");this.rootId=e,this.renderFn=n,this.logger=i}async render(e={}){var n;if(this.element)this.updateProps(e);else{const i=await this.renderFn(this.rootId,e);this.element=(n=i==null?void 0:i.element)!=null?n:null,this.updateProps=r=>i==null?void 0:i.updateProps(r),this.unmount=()=>{i==null||i.unmount(),this.element=null}}}}class us{constructor(e){this.config=e}static isApplicable(e){return vu.LOCAL===e.bundler.stage}async execute(){var n;const{runtime:e}=this.config;(n=e.env)!=null&&n.account?await e.configureStore(e.env):e.logger.warn("missing account in local environment")}}fe(us,"type",dn.Local);const ES=window==null?void 0:window.__NZ_APP__;class Tu{constructor(e){this.config=e}static isApplicable(){return ES==="platform"}async execute(){}}fe(Tu,"type",dn.Platform);const ea=window==null?void 0:window.faststore_sdk_stores;class Cu{constructor(e){this.config=e;const n={vtexfaststore:ea};this.config.runtime.updateMeta(n)}static isApplicable(){return!!ea}async execute(){const{runtime:e}=this.config;if(!ea.account){e.logger.error("missing the account in window.faststore_sdk_stores");return}await e.configureStore({account:ea.account})}}fe(Cu,"type",dn.VtexFastStore);const ta=window==null?void 0:window.__RUNTIME__;class ls{constructor(e){this.config=e;const n={vtexio:ta};this.config.runtime.updateMeta(n)}static isApplicable(){return!!ta}async execute(){const{runtime:e}=this.config;if(!ta.account){e.logger.error("missing the account in window.__RUNTIME__");return}await e.configureStore({account:ta.account})}}fe(ls,"type",dn.VtexIO);const $c=window==null?void 0:window.vtexjs;class cs{constructor(e){this.config=e;const n={vtexjs:$c};this.config.runtime.updateMeta(n)}static isApplicable(){return!!$c}async execute(){const{runtime:e}=this.config;let n={};const i=`${e.componentId.value}-script`,r=rf(i);if(n=Object.fromEntries(r.entries()),!n.account){e.logger.error(`missing the account in the search params of the script #${i}`);return}await e.configureStore({account:n.account})}}fe(cs,"type",dn.VtexLegacy);class Ru{constructor(e){this.config=e}static isApplicable(e){return!us.isApplicable(e)&&!ls.isApplicable()&&!cs.isApplicable()&&!Cu.isApplicable()&&!Tu.isApplicable()}async execute(){}}fe(Ru,"type",dn.External);const $h=[us,ls,cs,Ru,Cu,Tu];class wS{constructor(e){fe(this,"globalId");fe(this,"metadata");fe(this,"customConfigList");fe(this,"env");fe(this,"bundler");fe(this,"logger");fe(this,"componentId");fe(this,"renderHandler");fe(this,"store");this.globalId=e.globalId,this.store=e.getStore(),this.logger=e.logger.child("Runtime"),this.env=e.env,this.bundler=e.bundler,this.customConfigList=new Map,this.metadata={type:dn.External},this.initializeGlobals()}config(e,n,i){typeof n=="function"&&(i=n,n={});const{skipBaseBehavior:r=!1}=n;return this.customConfigList.set(e,{callback:i,skipBaseBehavior:r}),this}registerComponent(e,n){const i=this.toCamel(e);if(window[this.globalId][i])return this.logger.debug(`Component "${i}" is already registered.`),this;this.componentId={value:e,formatted:i},this.renderHandler=n;const r={render:this.renderHandler};return window[this.globalId][this.componentId.formatted]=r,this.logger.debug(`Component "${i}" registered.`),this}async execute(e){for(const n of $h)if(n.isApplicable(this)){const i=new n({runtime:this}),r=this.customConfigList.get(n.type);this.updateMeta({type:n.type}),r!=null&&r.skipBaseBehavior||await i.execute(),r&&await r.callback({runtime:this,component:new Lh(this.componentId.value,this.renderHandler,this.logger)});break}await(e==null?void 0:e())}updateMeta(e){this.metadata={...this.metadata,...e}}async configureStore(e){await this.store.configure(e)}get meta(){return this.metadata}initializeGlobals(){var i;if(window[this.globalId]||(window[this.globalId]={},this.logger.debug(`Initialized "${this.globalId}" window object`)),(i=window[this.globalId])!=null&&i.runtime){this.logger.debug(`Runtime for "${this.globalId}" are already initialized.`);return}const e=()=>Object.freeze({...this.metadata}),n=()=>Object.freeze({isProd:this.bundler.isProd,get meta(){return e()}});Object.defineProperty(window[this.globalId],"runtime",{get:()=>n()}),this.logger.debug(`Initialized runtime for "${this.globalId}".`)}toCamel(e){return e.replace(/^[a-z]{2}-/,"").replace(/-./g,n=>n[1].toUpperCase())}}exports.AccountContractStatusTypes=df;exports.AccountContractTypes=cf;exports.AccountInvalidError=Xc;exports.AccountNotFoundError=gu;exports.AccountPlanDescriptionTypes=hf;exports.AccountService=bf;exports.AccountSubscriptionTypes=ff;exports.AccountTypes=lf;exports.AddToCartActionTypes=Ja;exports.AggregateRoot=xf;exports.ApiGraphqlTypes=ry;exports.BaseDB=Hd;exports.BroadcastChannelEventBus=zd;exports.ComponentManager=Lh;exports.CreatePlanError=gf;exports.DomainError=cn;exports.ErrorCodes=kt;exports.EventBusWildcards=Qg;exports.EventChatRoom=rs;exports.EventChatRoomService=_h;exports.EventChatRoomTokenError=bh;exports.EventNames=Wd;exports.ExternalRuntime=Ru;exports.GlobalPageSectionTypes=pf;exports.GraphqlEventChatRoomRepository=kh;exports.HttpAxiosClient=dk;exports.InvalidNizzaGlobalObjectError=Qc;exports.LanguageTypes=Jd;exports.LocalRuntime=us;exports.LogLevel=et;exports.LogLevelPriority=ze;exports.Logger=ef;exports.MAX_PRODUCTS_IN_CART=Xg;exports.NizzaEventStatus=Gd;exports.NizzaProductRequestOriginTypes=Qd;exports.NizzaStore=_a;exports.NizzaVariationTypes=Xd;exports.PlanNotFoundError=mf;exports.PriorityToLogLevelMap=Yd;exports.ReactHostElement=Ph;exports.ResourceNotFoundError=Bp;exports.RestAccountPlanRepository=vf;exports.RestPublicAccountRepository=yf;exports.Runtime=wS;exports.RuntimeStage=vu;exports.RuntimeType=dn;exports.StoreProvider=Ig;exports.UnexpectedError=su;exports.ValueObject=dy;exports.VtexIORuntime=ls;exports.VtexLegacyRuntime=cs;exports.accountAtom=Jc;exports.accountService=kf;exports.addQuestionData=Sh;exports.addToCartMessages=Ko;exports.apiCall=Rp;exports.buildLanguageTranslations=rh;exports.buildTranslations=ah;exports.chatIsConnectedAtom=ss;exports.chatMessageListAtom=br;exports.chatSocketAtom=as;exports.connectToSocket=Nh;exports.createActionFactory=Of;exports.createAggregateRoot=Tf;exports.createNizzaLogger=lv;exports.createPinoLogger=tf;exports.createStore=ay;exports.customFetch=qn;exports.downloadFile=Fp;exports.eventChatRoomService=iu;exports.fileOrigin=fv;exports.getAccount=Sf;exports.getClientMetadata=uf;exports.getClientTimeZone=of;exports.getNizza=Zn;exports.getRandomColor=Eh;exports.getScriptParams=rf;exports.getStore=Lg;exports.getUserFriendlyMessage=ih;exports.i18Init=uh;exports.jsDownload=Yc;exports.nizzaDB=Kd;exports.normalizeChatMessage=wu;exports.registerTranslations=Rk;exports.registerTranslationsOf=sh;exports.runAddToCartHooks=oy;exports.runtimeList=$h;exports.searchParams=nf;exports.shortId=ka;exports.sleep=hv;exports.useAccount=_f;exports.useAutorun=Fg;exports.useChatSocketActions=V_;exports.useChatSocketClient=q_;exports.useChatSocketHandlers=Oh;exports.useConnectChatSocket=Ah;exports.useEventChatRoom=wh;exports.useMetaDataClient=Fk;exports.useNZ=af;exports.useNizza=sf;exports.useReaction=Dg;exports.useSelect=qd;exports.useStore=Pg;exports.validateRequiredProps=Up;
148
123
  //# sourceMappingURL=index.cjs.map