@moonbase.sh/storefront 0.2.24 β†’ 0.2.26

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/moonbase.js CHANGED
@@ -11837,7 +11837,7 @@ function Uf(t) {
11837
11837
  return;
11838
11838
  }
11839
11839
  const e = document.createElement("iframe");
11840
- e.id = "moonbase-checkout", e.src = t, e.style.position = "fixed", e.style.top = "0px", e.style.left = "0px", e.style.right = "0px", e.style.border = "none", e.style.colorScheme = "normal", e.style.backgroundColor = "transparent", e.style.zIndex = Number.MAX_SAFE_INTEGER.toString(), e.setAttribute("background", "transparent"), e.setAttribute("frameborder", "0"), e.setAttribute("allowtransparency", "true"), e.height = "100%", e.width = "100%", document.body.append(e), document.documentElement.style.overflow = "hidden", window.onmessage = function(n) {
11840
+ e.id = "moonbase-checkout", e.src = t, e.style.position = "fixed", e.style.top = "0px", e.style.left = "0px", e.style.right = "0px", e.style.border = "none", e.style.colorScheme = "normal", e.style.backgroundColor = "transparent", e.style.zIndex = Number.MAX_SAFE_INTEGER.toString(), e.setAttribute("background", "transparent"), e.setAttribute("frameborder", "0"), e.setAttribute("allowtransparency", "true"), e.setAttribute("allow", "payment"), e.height = "100%", e.width = "100%", document.body.append(e), document.documentElement.style.overflow = "hidden", window.onmessage = function(n) {
11841
11841
  var r;
11842
11842
  try {
11843
11843
  const s = W_.parse(n.data);
@@ -14,7 +14,7 @@ If this is a native custom element, make sure to exclude it from component resol
14
14
 
15
15
  For more details, see https://link.vuejs.org/feature-flags.`)}}const Pt=Ag;function _g(t){return bg(t)}function bg(t,e){yg();const n=Ia();n.__VUE__=!0,v.NODE_ENV!=="production"&&Lu(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:m=nt,insertStaticContent:_}=t,E=(p,h,S,L=null,D=null,M=null,X=void 0,q=null,W=v.NODE_ENV!=="production"&&Jn?!1:!!h.dynamicChildren)=>{if(p===h)return;p&&!Dr(p,h)&&(L=ua(p),Ke(p,D,M,!0),p=null),h.patchFlag===-2&&(W=!1,h.dynamicChildren=null);const{type:j,ref:ne,shapeFlag:fe}=h;switch(j){case to:k(p,h,S,L);break;case st:A(p,h,S,L);break;case no:p==null?B(h,S,L,X):v.NODE_ENV!=="production"&&T(p,h,S,X);break;case Re:ce(p,h,S,L,D,M,X,q,W);break;default:fe&1?z(p,h,S,L,D,M,X,q,W):fe&6?Ze(p,h,S,L,D,M,X,q,W):fe&64||fe&128?j.process(p,h,S,L,D,M,X,q,W,Ao):v.NODE_ENV!=="production"&&U("Invalid VNode type:",j,`(${typeof j})`)}ne!=null&&D&&fl(ne,p&&p.ref,M,h||p,!h)},k=(p,h,S,L)=>{if(p==null)r(h.el=a(h.children),S,L);else{const D=h.el=p.el;h.children!==p.children&&c(D,h.children)}},A=(p,h,S,L)=>{p==null?r(h.el=l(h.children||""),S,L):h.el=p.el},B=(p,h,S,L)=>{[p.el,p.anchor]=_(p.children,h,S,L,p.el,p.anchor)},T=(p,h,S,L)=>{if(h.children!==p.children){const D=f(p.anchor);P(p),[h.el,h.anchor]=_(h.children,S,D,L)}else h.el=p.el,h.anchor=p.anchor},J=({el:p,anchor:h},S,L)=>{let D;for(;p&&p!==h;)D=f(p),r(p,S,L),p=D;r(h,S,L)},P=({el:p,anchor:h})=>{let S;for(;p&&p!==h;)S=f(p),s(p),p=S;s(h)},z=(p,h,S,L,D,M,X,q,W)=>{h.type==="svg"?X="svg":h.type==="math"&&(X="mathml"),p==null?N(h,S,L,D,M,X,q,W):R(p,h,D,M,X,q,W)},N=(p,h,S,L,D,M,X,q)=>{let W,j;const{props:ne,shapeFlag:fe,transition:ue,dirs:Se}=p;if(W=p.el=i(p.type,M,ne&&ne.is,ne),fe&8?u(W,p.children):fe&16&&K(p.children,W,null,L,D,hl(p,M),X,q),Se&&Tr(p,null,L,"created"),Oe(W,p,p.scopeId,X,L),ne){for(const Ye in ne)Ye!=="value"&&!Us(Ye)&&o(W,Ye,null,ne[Ye],M,L);"value"in ne&&o(W,"value",null,ne.value,M),(j=ne.onVnodeBeforeMount)&&pn(j,L,p)}v.NODE_ENV!=="production"&&(Jo(W,"__vnode",p,!0),Jo(W,"__vueParentComponent",L,!0)),Se&&Tr(p,null,L,"beforeMount");const De=wg(D,ue);De&&ue.beforeEnter(W),r(W,h,S),((j=ne&&ne.onVnodeMounted)||De||Se)&&Pt(()=>{j&&pn(j,L,p),De&&ue.enter(W),Se&&Tr(p,null,L,"mounted")},D)},Oe=(p,h,S,L,D)=>{if(S&&m(p,S),L)for(let M=0;M<L.length;M++)m(p,L[M]);if(D){let M=D.subTree;if(v.NODE_ENV!=="production"&&M.patchFlag>0&&M.patchFlag&2048&&(M=yl(M.children)||M),h===M){const X=D.vnode;Oe(p,X,X.scopeId,X.slotScopeIds,D.parent)}}},K=(p,h,S,L,D,M,X,q,W=0)=>{for(let j=W;j<p.length;j++){const ne=p[j]=q?Qn(p[j]):Kt(p[j]);E(null,ne,h,S,L,D,M,X,q)}},R=(p,h,S,L,D,M,X)=>{const q=h.el=p.el;v.NODE_ENV!=="production"&&(q.__vnode=h);let{patchFlag:W,dynamicChildren:j,dirs:ne}=h;W|=p.patchFlag&16;const fe=p.props||Ge,ue=h.props||Ge;let Se;if(S&&Ir(S,!1),(Se=ue.onVnodeBeforeUpdate)&&pn(Se,S,h,p),ne&&Tr(h,p,S,"beforeUpdate"),S&&Ir(S,!0),v.NODE_ENV!=="production"&&Jn&&(W=0,X=!1,j=null),(fe.innerHTML&&ue.innerHTML==null||fe.textContent&&ue.textContent==null)&&u(q,""),j?(V(p.dynamicChildren,j,q,S,L,hl(h,D),M),v.NODE_ENV!=="production"&&eo(p,h)):X||be(p,h,q,null,S,L,hl(h,D),M,!1),W>0){if(W&16)I(q,fe,ue,S,D);else if(W&2&&fe.class!==ue.class&&o(q,"class",null,ue.class,D),W&4&&o(q,"style",fe.style,ue.style,D),W&8){const De=h.dynamicProps;for(let Ye=0;Ye<De.length;Ye++){const He=De[Ye],ft=fe[He],en=ue[He];(en!==ft||He==="value")&&o(q,He,ft,en,D,S)}}W&1&&p.children!==h.children&&u(q,h.children)}else!X&&j==null&&I(q,fe,ue,S,D);((Se=ue.onVnodeUpdated)||ne)&&Pt(()=>{Se&&pn(Se,S,h,p),ne&&Tr(h,p,S,"updated")},L)},V=(p,h,S,L,D,M,X)=>{for(let q=0;q<h.length;q++){const W=p[q],j=h[q],ne=W.el&&(W.type===Re||!Dr(W,j)||W.shapeFlag&70)?d(W.el):S;E(W,j,ne,null,L,D,M,X,!0)}},I=(p,h,S,L,D)=>{if(h!==S){if(h!==Ge)for(const M in h)!Us(M)&&!(M in S)&&o(p,M,h[M],null,D,L);for(const M in S){if(Us(M))continue;const X=S[M],q=h[M];X!==q&&M!=="value"&&o(p,M,q,X,D,L)}"value"in S&&o(p,"value",h.value,S.value,D)}},ce=(p,h,S,L,D,M,X,q,W)=>{const j=h.el=p?p.el:a(""),ne=h.anchor=p?p.anchor:a("");let{patchFlag:fe,dynamicChildren:ue,slotScopeIds:Se}=h;v.NODE_ENV!=="production"&&(Jn||fe&2048)&&(fe=0,W=!1,ue=null),Se&&(q=q?q.concat(Se):Se),p==null?(r(j,S,L),r(ne,S,L),K(h.children||[],S,ne,D,M,X,q,W)):fe>0&&fe&64&&ue&&p.dynamicChildren?(V(p.dynamicChildren,ue,S,D,M,X,q),v.NODE_ENV!=="production"?eo(p,h):(h.key!=null||D&&h===D.subTree)&&eo(p,h,!0)):be(p,h,S,ne,D,M,X,q,W)},Ze=(p,h,S,L,D,M,X,q,W)=>{h.slotScopeIds=q,p==null?h.shapeFlag&512?D.ctx.activate(h,S,L,X,W):w(h,S,L,D,M,X,W):$(p,h,W)},w=(p,h,S,L,D,M,X)=>{const q=p.component=Ug(p,L,D);if(v.NODE_ENV!=="production"&&q.type.__hmrId&&mv(q),v.NODE_ENV!=="production"&&(ci(p),Pn(q,"mount")),Ys(p)&&(q.ctx.renderer=Ao),v.NODE_ENV!=="production"&&Pn(q,"init"),Bg(q,!1,X),v.NODE_ENV!=="production"&&In(q,"init"),q.asyncDep){if(D&&D.registerDep(q,Q,X),!p.el){const W=q.subTree=F(st);A(null,W,h,S)}}else Q(q,p,h,S,D,M,X);v.NODE_ENV!=="production"&&(ui(),In(q,"mount"))},$=(p,h,S)=>{const L=h.component=p.component;if($g(p,h,S))if(L.asyncDep&&!L.asyncResolved){v.NODE_ENV!=="production"&&ci(h),oe(L,h,S),v.NODE_ENV!=="production"&&ui();return}else L.next=h,pv(L.update),L.effect.dirty=!0,L.update();else h.el=p.el,L.vnode=h},Q=(p,h,S,L,D,M,X)=>{const q=()=>{if(p.isMounted){let{next:ne,bu:fe,u:ue,parent:Se,vnode:De}=p;{const ms=wd(p);if(ms){ne&&(ne.el=De.el,oe(p,ne,X)),ms.asyncDep.then(()=>{p.isUnmounted||q()});return}}let Ye=ne,He;v.NODE_ENV!=="production"&&ci(ne||p.vnode),Ir(p,!1),ne?(ne.el=De.el,oe(p,ne,X)):ne=De,fe&&Zs(fe),(He=ne.props&&ne.props.onVnodeBeforeUpdate)&&pn(He,Se,ne,De),Ir(p,!0),v.NODE_ENV!=="production"&&Pn(p,"render");const ft=gl(p);v.NODE_ENV!=="production"&&In(p,"render");const en=p.subTree;p.subTree=ft,v.NODE_ENV!=="production"&&Pn(p,"patch"),E(en,ft,d(en.el),ua(en),p,D,M),v.NODE_ENV!=="production"&&In(p,"patch"),ne.el=ft.el,Ye===null&&Pg(p,ft.el),ue&&Pt(ue,D),(He=ne.props&&ne.props.onVnodeUpdated)&&Pt(()=>pn(He,Se,ne,De),D),v.NODE_ENV!=="production"&&Mu(p),v.NODE_ENV!=="production"&&ui()}else{let ne;const{el:fe,props:ue}=h,{bm:Se,m:De,parent:Ye}=p,He=Js(h);if(Ir(p,!1),Se&&Zs(Se),!He&&(ne=ue&&ue.onVnodeBeforeMount)&&pn(ne,Ye,h),Ir(p,!0),fe&&Cp){const ft=()=>{v.NODE_ENV!=="production"&&Pn(p,"render"),p.subTree=gl(p),v.NODE_ENV!=="production"&&In(p,"render"),v.NODE_ENV!=="production"&&Pn(p,"hydrate"),Cp(fe,p.subTree,p,D,null),v.NODE_ENV!=="production"&&In(p,"hydrate")};He?h.type.__asyncLoader().then(()=>!p.isUnmounted&&ft()):ft()}else{v.NODE_ENV!=="production"&&Pn(p,"render");const ft=p.subTree=gl(p);v.NODE_ENV!=="production"&&In(p,"render"),v.NODE_ENV!=="production"&&Pn(p,"patch"),E(null,ft,S,L,p,D,M),v.NODE_ENV!=="production"&&In(p,"patch"),h.el=ft.el}if(De&&Pt(De,D),!He&&(ne=ue&&ue.onVnodeMounted)){const ft=h;Pt(()=>pn(ne,Ye,ft),D)}(h.shapeFlag&256||Ye&&Js(Ye.vnode)&&Ye.vnode.shapeFlag&256)&&p.a&&Pt(p.a,D),p.isMounted=!0,v.NODE_ENV!=="production"&&wv(p),h=S=L=null}},W=p.effect=new Va(q,nt,()=>di(j),p.scope),j=p.update=()=>{W.dirty&&W.run()};j.i=p,j.id=p.uid,Ir(p,!0),v.NODE_ENV!=="production"&&(W.onTrack=p.rtc?ne=>Zs(p.rtc,ne):void 0,W.onTrigger=p.rtg?ne=>Zs(p.rtg,ne):void 0),j()},oe=(p,h,S)=>{h.component=p;const L=p.vnode.props;p.vnode=h,p.next=null,rg(p,h.props,L,S),pg(p,h.children,S),kn(),Au(p),On()},be=(p,h,S,L,D,M,X,q,W=!1)=>{const j=p&&p.children,ne=p?p.shapeFlag:0,fe=h.children,{patchFlag:ue,shapeFlag:Se}=h;if(ue>0){if(ue&128){We(j,fe,S,L,D,M,X,q,W);return}else if(ue&256){ae(j,fe,S,L,D,M,X,q,W);return}}Se&8?(ne&16&&Io(j,D,M),fe!==j&&u(S,fe)):ne&16?Se&16?We(j,fe,S,L,D,M,X,q,W):Io(j,D,M,!0):(ne&8&&u(S,""),Se&16&&K(fe,S,L,D,M,X,q,W))},ae=(p,h,S,L,D,M,X,q,W)=>{p=p||ss,h=h||ss;const j=p.length,ne=h.length,fe=Math.min(j,ne);let ue;for(ue=0;ue<fe;ue++){const Se=h[ue]=W?Qn(h[ue]):Kt(h[ue]);E(p[ue],Se,S,null,D,M,X,q,W)}j>ne?Io(p,D,M,!0,!1,fe):K(h,S,L,D,M,X,q,W,fe)},We=(p,h,S,L,D,M,X,q,W)=>{let j=0;const ne=h.length;let fe=p.length-1,ue=ne-1;for(;j<=fe&&j<=ue;){const Se=p[j],De=h[j]=W?Qn(h[j]):Kt(h[j]);if(Dr(Se,De))E(Se,De,S,null,D,M,X,q,W);else break;j++}for(;j<=fe&&j<=ue;){const Se=p[fe],De=h[ue]=W?Qn(h[ue]):Kt(h[ue]);if(Dr(Se,De))E(Se,De,S,null,D,M,X,q,W);else break;fe--,ue--}if(j>fe){if(j<=ue){const Se=ue+1,De=Se<ne?h[Se].el:L;for(;j<=ue;)E(null,h[j]=W?Qn(h[j]):Kt(h[j]),S,De,D,M,X,q,W),j++}}else if(j>ue)for(;j<=fe;)Ke(p[j],D,M,!0),j++;else{const Se=j,De=j,Ye=new Map;for(j=De;j<=ue;j++){const Ct=h[j]=W?Qn(h[j]):Kt(h[j]);Ct.key!=null&&(v.NODE_ENV!=="production"&&Ye.has(Ct.key)&&U("Duplicate keys found during update:",JSON.stringify(Ct.key),"Make sure keys are unique."),Ye.set(Ct.key,j))}let He,ft=0;const en=ue-De+1;let ms=!1,$p=0;const Do=new Array(en);for(j=0;j<en;j++)Do[j]=0;for(j=Se;j<=fe;j++){const Ct=p[j];if(ft>=en){Ke(Ct,D,M,!0);continue}let _n;if(Ct.key!=null)_n=Ye.get(Ct.key);else for(He=De;He<=ue;He++)if(Do[He-De]===0&&Dr(Ct,h[He])){_n=He;break}_n===void 0?Ke(Ct,D,M,!0):(Do[_n-De]=j+1,_n>=$p?$p=_n:ms=!0,E(Ct,h[_n],S,null,D,M,X,q,W),ft++)}const Pp=ms?Eg(Do):ss;for(He=Pp.length-1,j=en-1;j>=0;j--){const Ct=De+j,_n=h[Ct],Ip=Ct+1<ne?h[Ct+1].el:L;Do[j]===0?E(null,_n,S,Ip,D,M,X,q,W):ms&&(He<0||j!==Pp[He]?xt(_n,S,Ip,2):He--)}}},xt=(p,h,S,L,D=null)=>{const{el:M,type:X,transition:q,children:W,shapeFlag:j}=p;if(j&6){xt(p.component.subTree,h,S,L);return}if(j&128){p.suspense.move(h,S,L);return}if(j&64){X.move(p,h,S,Ao);return}if(X===Re){r(M,h,S);for(let fe=0;fe<W.length;fe++)xt(W[fe],h,S,L);r(p.anchor,h,S);return}if(X===no){J(p,h,S);return}if(L!==2&&j&1&&q)if(L===0)q.beforeEnter(M),r(M,h,S),Pt(()=>q.enter(M),D);else{const{leave:fe,delayLeave:ue,afterLeave:Se}=q,De=()=>r(M,h,S),Ye=()=>{fe(M,()=>{De(),Se&&Se()})};ue?ue(M,De,Ye):Ye()}else r(M,h,S)},Ke=(p,h,S,L=!1,D=!1)=>{const{type:M,props:X,ref:q,children:W,dynamicChildren:j,shapeFlag:ne,patchFlag:fe,dirs:ue,cacheIndex:Se}=p;if(fe===-2&&(D=!1),q!=null&&fl(q,null,S,p,!0),Se!=null&&(h.renderCache[Se]=void 0),ne&256){h.ctx.deactivate(p);return}const De=ne&1&&ue,Ye=!Js(p);let He;if(Ye&&(He=X&&X.onVnodeBeforeUnmount)&&pn(He,h,p),ne&6)ox(p.component,S,L);else{if(ne&128){p.suspense.unmount(S,L);return}De&&Tr(p,null,h,"beforeUnmount"),ne&64?p.type.remove(p,h,S,Ao,L):j&&!j.hasOnce&&(M!==Re||fe>0&&fe&64)?Io(j,h,S,!1,!0):(M===Re&&fe&384||!D&&ne&16)&&Io(W,h,S),L&&At(p)}(Ye&&(He=X&&X.onVnodeUnmounted)||De)&&Pt(()=>{He&&pn(He,h,p),De&&Tr(p,null,h,"unmounted")},S)},At=p=>{const{type:h,el:S,anchor:L,transition:D}=p;if(h===Re){v.NODE_ENV!=="production"&&p.patchFlag>0&&p.patchFlag&2048&&D&&!D.persisted?p.children.forEach(X=>{X.type===st?s(X.el):At(X)}):gr(S,L);return}if(h===no){P(p);return}const M=()=>{s(S),D&&!D.persisted&&D.afterLeave&&D.afterLeave()};if(p.shapeFlag&1&&D&&!D.persisted){const{leave:X,delayLeave:q}=D,W=()=>X(S,M);q?q(p.el,M,W):W()}else M()},gr=(p,h)=>{let S;for(;p!==h;)S=f(p),s(p),p=S;s(h)},ox=(p,h,S)=>{v.NODE_ENV!=="production"&&p.type.__hmrId&&vv(p);const{bum:L,scope:D,update:M,subTree:X,um:q,m:W,a:j}=p;Ed(W),Ed(j),L&&Zs(L),D.stop(),M&&(M.active=!1,Ke(X,p,h,S)),q&&Pt(q,h),Pt(()=>{p.isUnmounted=!0},h),h&&h.pendingBranch&&!h.isUnmounted&&p.asyncDep&&!p.asyncResolved&&p.suspenseId===h.pendingId&&(h.deps--,h.deps===0&&h.resolve()),v.NODE_ENV!=="production"&&xv(p)},Io=(p,h,S,L=!1,D=!1,M=0)=>{for(let X=M;X<p.length;X++)Ke(p[X],h,S,L,D)},ua=p=>{if(p.shapeFlag&6)return ua(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const h=f(p.anchor||p.el),S=h&&h[vd];return S?f(S):h};let lc=!1;const Sp=(p,h,S)=>{p==null?h._vnode&&Ke(h._vnode,null,null,!0):E(h._vnode||null,p,h,null,null,null,S),h._vnode=p,lc||(lc=!0,Au(),Du(),lc=!1)},Ao={p:E,um:Ke,m:xt,r:At,mt:w,mc:K,pc:be,pbc:V,n:ua,o:t};let Tp,Cp;return{render:Sp,hydrate:Tp,createApp:Qv(Sp,Tp)}}function hl({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Ir({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function wg(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function eo(t,e,n=!1){const r=t.children,s=e.children;if(de(r)&&de(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=Qn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&eo(i,a)),a.type===to&&(a.el=i.el),v.NODE_ENV!=="production"&&a.type===st&&!a.el&&(a.el=i.el)}}function Eg(t){const e=t.slice(),n=[0];let r,s,o,i,a;const l=t.length;for(r=0;r<l;r++){const c=t[r];if(c!==0){if(s=n[n.length-1],t[s]<c){e[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,t[n[a]]<c?o=a+1:i=a;c<t[n[o]]&&(o>0&&(e[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=e[i];return n}function wd(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:wd(e)}function Ed(t){if(t)for(let e=0;e<t.length;e++)t[e].active=!1}const xg=Symbol.for("v-scx"),kg=()=>{{const t=Me(xg);return t||v.NODE_ENV!=="production"&&U("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),t}};function bt(t,e){return ml(t,null,e)}const Ei={};function lt(t,e,n){return v.NODE_ENV!=="production"&&!me(e)&&U("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),ml(t,e,n)}function ml(t,e,{immediate:n,deep:r,flush:s,once:o,onTrack:i,onTrigger:a}=Ge){if(e&&o){const N=e;e=(...Oe)=>{N(...Oe),z()}}v.NODE_ENV!=="production"&&r!==void 0&&typeof r=="number"&&U('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),v.NODE_ENV!=="production"&&!e&&(n!==void 0&&U('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),r!==void 0&&U('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&U('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const l=N=>{U("Invalid watch source: ",N,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},c=ot,u=N=>r===!0?N:Ar(N,r===!1?1:void 0);let d,f=!1,m=!1;if(Qe(t)?(d=()=>t.value,f=Tn(t)):Nn(t)?(d=()=>u(t),f=!0):de(t)?(m=!0,f=t.some(N=>Nn(N)||Tn(N)),d=()=>t.map(N=>{if(Qe(N))return N.value;if(Nn(N))return u(N);if(me(N))return Cn(N,c,2);v.NODE_ENV!=="production"&&l(N)})):me(t)?e?d=()=>Cn(t,c,2):d=()=>(_&&_(),Ut(t,c,3,[E])):(d=nt,v.NODE_ENV!=="production"&&l(t)),e&&r){const N=d;d=()=>Ar(N())}let _,E=N=>{_=J.onStop=()=>{Cn(N,c,4),_=J.onStop=void 0}},k;if(Ti)if(E=nt,e?n&&Ut(e,c,3,[d(),m?[]:void 0,E]):d(),s==="sync"){const N=kg();k=N.__watcherHandles||(N.__watcherHandles=[])}else return nt;let A=m?new Array(t.length).fill(Ei):Ei;const B=()=>{if(!(!J.active||!J.dirty))if(e){const N=J.run();(r||f||(m?N.some((Oe,K)=>zn(Oe,A[K])):zn(N,A)))&&(_&&_(),Ut(e,c,3,[N,A===Ei?void 0:m&&A[0]===Ei?[]:A,E]),A=N)}else J.run()};B.allowRecurse=!!e;let T;s==="sync"?T=B:s==="post"?T=()=>Pt(B,c&&c.suspense):(B.pre=!0,c&&(B.id=c.uid),T=()=>di(B));const J=new Va(d,nt,T),P=eu(),z=()=>{J.stop(),P&&Ta(P.effects,J)};return v.NODE_ENV!=="production"&&(J.onTrack=i,J.onTrigger=a),e?n?B():A=J.run():s==="post"?Pt(J.run.bind(J),c&&c.suspense):J.run(),k&&k.push(z),z}function Og(t,e,n){const r=this.proxy,s=Xe(t)?t.includes(".")?xd(r,t):()=>r[t]:t.bind(r,r);let o;me(e)?o=e:(o=e.handler,n=e);const i=oo(this),a=ml(s,o.bind(r),n);return i(),a}function xd(t,e){const n=e.split(".");return()=>{let r=t;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}function Ar(t,e=1/0,n){if(e<=0||!Be(t)||t.__v_skip||(n=n||new Set,n.has(t)))return t;if(n.add(t),e--,Qe(t))Ar(t.value,e,n);else if(de(t))for(let r=0;r<t.length;r++)Ar(t[r],e,n);else if(zc(t)||br(t))t.forEach(r=>{Ar(r,e,n)});else if(Wc(t)){for(const r in t)Ar(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&Ar(t[r],e,n)}return t}const Ng=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Vt(e)}Modifiers`]||t[`${xn(e)}Modifiers`];function Sg(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||Ge;if(v.NODE_ENV!=="production"){const{emitsOptions:u,propsOptions:[d]}=t;if(u)if(!(e in u))(!d||!(Er(Vt(e))in d))&&U(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${Er(Vt(e))}" prop.`);else{const f=u[e];me(f)&&(f(...n)||U(`Invalid event arguments: event validation failed for event "${e}".`))}}let s=n;const o=e.startsWith("update:"),i=o&&Ng(r,e.slice(7));if(i&&(i.trim&&(s=n.map(u=>Xe(u)?u.trim():u)),i.number&&(s=n.map(mm))),v.NODE_ENV!=="production"&&Nv(t,e,s),v.NODE_ENV!=="production"){const u=e.toLowerCase();u!==e&&r[Er(u)]&&U(`Event "${u}" is emitted in component ${Ci(t,t.type)} but the handler is registered for "${e}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${xn(e)}" instead of "${e}".`)}let a,l=r[a=Er(e)]||r[a=Er(Vt(e))];!l&&o&&(l=r[a=Er(xn(e))]),l&&Ut(l,t,6,s);const c=r[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,Ut(c,t,6,s)}}function kd(t,e,n=!1){const r=e.emitsCache,s=r.get(t);if(s!==void 0)return s;const o=t.emits;let i={},a=!1;if(!me(t)){const l=c=>{const u=kd(c,e,!0);u&&(a=!0,tt(i,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!o&&!a?(Be(t)&&r.set(t,null),null):(de(o)?o.forEach(l=>i[l]=null):tt(i,o),Be(t)&&r.set(t,i),i)}function xi(t,e){return!t||!Ms(e)?!1:(e=e.slice(2).replace(/Once$/,""),Ie(t,e[0].toLowerCase()+e.slice(1))||Ie(t,xn(e))||Ie(t,e))}let vl=!1;function ki(){vl=!0}function gl(t){const{type:e,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:m,ctx:_,inheritAttrs:E}=t,k=mi(t);let A,B;v.NODE_ENV!=="production"&&(vl=!1);try{if(n.shapeFlag&4){const P=s||r,z=v.NODE_ENV!=="production"&&m.__isScriptSetup?new Proxy(P,{get(N,Oe,K){return U(`Property '${String(Oe)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(N,Oe,K)}}):P;A=Kt(c.call(z,P,u,v.NODE_ENV!=="production"?cn(d):d,m,f,_)),B=a}else{const P=e;v.NODE_ENV!=="production"&&a===d&&ki(),A=Kt(P.length>1?P(v.NODE_ENV!=="production"?cn(d):d,v.NODE_ENV!=="production"?{get attrs(){return ki(),cn(a)},slots:i,emit:l}:{attrs:a,slots:i,emit:l}):P(v.NODE_ENV!=="production"?cn(d):d,null)),B=e.props?a:Tg(a)}}catch(P){ro.length=0,Hs(P,t,1),A=F(st)}let T=A,J;if(v.NODE_ENV!=="production"&&A.patchFlag>0&&A.patchFlag&2048&&([T,J]=Od(A)),B&&E!==!1){const P=Object.keys(B),{shapeFlag:z}=T;if(P.length){if(z&7)o&&P.some(Wo)&&(B=Cg(B,o)),T=Wt(T,B,!1,!0);else if(v.NODE_ENV!=="production"&&!vl&&T.type!==st){const N=Object.keys(a),Oe=[],K=[];for(let R=0,V=N.length;R<V;R++){const I=N[R];Ms(I)?Wo(I)||Oe.push(I[2].toLowerCase()+I.slice(3)):K.push(I)}K.length&&U(`Extraneous non-props attributes (${K.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),Oe.length&&U(`Extraneous non-emits event listeners (${Oe.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return n.dirs&&(v.NODE_ENV!=="production"&&!Nd(T)&&U("Runtime directive used on component with non-element root node. The directives will not function as intended."),T=Wt(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(n.dirs):n.dirs),n.transition&&(v.NODE_ENV!=="production"&&!Nd(T)&&U("Component inside <Transition> renders non-element root node that cannot be animated."),T.transition=n.transition),v.NODE_ENV!=="production"&&J?J(T):A=T,mi(k),A}const Od=t=>{const e=t.children,n=t.dynamicChildren,r=yl(e,!1);if(r){if(v.NODE_ENV!=="production"&&r.patchFlag>0&&r.patchFlag&2048)return Od(r)}else return[t,void 0];const s=e.indexOf(r),o=n?n.indexOf(r):-1,i=a=>{e[s]=a,n&&(o>-1?n[o]=a:a.patchFlag>0&&(t.dynamicChildren=[...n,a]))};return[Kt(r),i]};function yl(t,e=!0){let n;for(let r=0;r<t.length;r++){const s=t[r];if(is(s)){if(s.type!==st||s.children==="v-if"){if(n)return;if(n=s,v.NODE_ENV!=="production"&&e&&n.patchFlag>0&&n.patchFlag&2048)return yl(n.children)}}else return}return n}const Tg=t=>{let e;for(const n in t)(n==="class"||n==="style"||Ms(n))&&((e||(e={}))[n]=t[n]);return e},Cg=(t,e)=>{const n={};for(const r in t)(!Wo(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n},Nd=t=>t.shapeFlag&7||t.type===st;function $g(t,e,n){const{props:r,children:s,component:o}=t,{props:i,children:a,patchFlag:l}=e,c=o.emitsOptions;if(v.NODE_ENV!=="production"&&(s||a)&&Jn||e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Sd(r,i,c):!!i;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(i[f]!==r[f]&&!xi(c,f))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Sd(r,i,c):!0:!!i;return!1}function Sd(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(e[o]!==t[o]&&!xi(n,o))return!0}return!1}function Pg({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const Ig=t=>t.__isSuspense;function Ag(t,e){e&&e.pendingBranch?de(t)?e.effects.push(...t):e.effects.push(t):Iu(t)}const Re=Symbol.for("v-fgt"),to=Symbol.for("v-txt"),st=Symbol.for("v-cmt"),no=Symbol.for("v-stc"),ro=[];let jt=null;function g(t=!1){ro.push(jt=t?null:[])}function Dg(){ro.pop(),jt=ro[ro.length-1]||null}let so=1;function Td(t){so+=t,t<0&&jt&&(jt.hasOnce=!0)}function Cd(t){return t.dynamicChildren=so>0?jt||ss:null,Dg(),so>0&&jt&&jt.push(t),t}function O(t,e,n,r,s,o){return Cd(x(t,e,n,r,s,o,!0))}function Ve(t,e,n,r,s){return Cd(F(t,e,n,r,s,!0))}function is(t){return t?t.__v_isVNode===!0:!1}function Dr(t,e){if(v.NODE_ENV!=="production"&&e.shapeFlag&6&&t.component){const n=fi.get(e.type);if(n&&n.has(t.component))return t.shapeFlag&=-257,e.shapeFlag&=-513,!1}return t.type===e.type&&t.key===e.key}const Vg=(...t)=>Pd(...t),$d=({key:t})=>t??null,Oi=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Xe(t)||Qe(t)||me(t)?{i:at,r:t,k:e,f:!!n}:t:null);function x(t,e=null,n=null,r=0,s=null,o=t===Re?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&$d(e),ref:e&&Oi(e),scopeId:hi,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:at};return a?(_l(l,n),o&128&&t.normalize(l)):n&&(l.shapeFlag|=Xe(n)?8:16),v.NODE_ENV!=="production"&&l.key!==l.key&&U("VNode created with invalid key (NaN). VNode type:",l.type),so>0&&!i&&jt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&jt.push(l),l}const F=v.NODE_ENV!=="production"?Vg:Pd;function Pd(t,e=null,n=null,r=0,s=null,o=!1){if((!t||t===Ku)&&(v.NODE_ENV!=="production"&&!t&&U(`Invalid vnode type when creating vnode: ${t}.`),t=st),is(t)){const a=Wt(t,e,!0);return n&&_l(a,n),so>0&&!o&&jt&&(a.shapeFlag&6?jt[jt.indexOf(t)]=a:jt.push(a)),a.patchFlag=-2,a}if(Ld(t)&&(t=t.__vccOpts),e){e=Rg(e);let{class:a,style:l}=e;a&&!Xe(a)&&(e.class=Yo(a)),Be(l)&&(ai(l)&&!de(l)&&(l=tt({},l)),e.style=Aa(l))}const i=Xe(t)?1:Ig(t)?128:hg(t)?64:Be(t)?4:me(t)?2:0;return v.NODE_ENV!=="production"&&i&4&&ai(t)&&(t=Ee(t),U("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
16
16
  Component that was made reactive: `,t)),x(t,e,n,r,s,i,o,!0)}function Rg(t){return t?ai(t)||id(t)?tt({},t):t:null}function Wt(t,e,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=t,c=e?bl(s||{},e):s,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&$d(c),ref:e&&e.ref?n&&o?de(o)?o.concat(Oi(e)):[o,Oi(e)]:Oi(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:v.NODE_ENV!=="production"&&i===-1&&de(a)?a.map(Id):a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Re?i===-1?16:i|16:i,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Wt(t.ssContent),ssFallback:t.ssFallback&&Wt(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&gi(u,l.clone(u)),u}function Id(t){const e=Wt(t);return de(t.children)&&(e.children=t.children.map(Id)),e}function je(t=" ",e=0){return F(to,null,t,e)}function jg(t,e){const n=F(no,null,t);return n.staticCount=e,n}function ge(t="",e=!1){return e?(g(),Ve(st,null,t)):F(st,null,t)}function Kt(t){return t==null||typeof t=="boolean"?F(st):de(t)?F(Re,null,t.slice()):typeof t=="object"?Qn(t):F(to,null,String(t))}function Qn(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Wt(t)}function _l(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(de(e))n=16;else if(typeof e=="object")if(r&65){const s=e.default;s&&(s._c&&(s._d=!1),_l(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!id(e)?e._ctx=at:s===3&&at&&(at.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else me(e)?(e={default:e,_ctx:at},n=32):(e=String(e),r&64?(n=16,e=[je(e)]):n=8);t.children=e,t.shapeFlag|=n}function bl(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const s in r)if(s==="class")e.class!==r.class&&(e.class=Yo([e.class,r.class]));else if(s==="style")e.style=Aa([e.style,r.style]);else if(Ms(s)){const o=e[s],i=r[s];i&&o!==i&&!(de(o)&&o.includes(i))&&(e[s]=o?[].concat(o,i):i)}else s!==""&&(e[s]=r[s])}return e}function pn(t,e,n,r=null){Ut(t,e,7,[n,r])}const Lg=rd();let Mg=0;function Ug(t,e,n){const r=t.type,s=(e?e.appContext:t.appContext)||Lg,o={uid:Mg++,vnode:t,type:r,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new Xc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ld(r,s),emitsOptions:kd(r,s),emit:null,emitted:null,propsDefaults:Ge,inheritAttrs:r.inheritAttrs,ctx:Ge,data:Ge,props:Ge,attrs:Ge,slots:Ge,refs:Ge,setupState:Ge,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return v.NODE_ENV!=="production"?o.ctx=Fv(o):o.ctx={_:o},o.root=e?e.root:o,o.emit=Sg.bind(null,o),t.ce&&t.ce(o),o}let ot=null;const Ni=()=>ot||at;let Si,wl;{const t=Ia(),e=(n,r)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Si=e("__VUE_INSTANCE_SETTERS__",n=>ot=n),wl=e("__VUE_SSR_SETTERS__",n=>Ti=n)}const oo=t=>{const e=ot;return Si(t),t.scope.on(),()=>{t.scope.off(),Si(e)}},Ad=()=>{ot&&ot.scope.off(),Si(null)},Zg=En("slot,component");function El(t,{isNativeTag:e}){(Zg(t)||e(t))&&U("Do not use built-in or reserved HTML elements as component id: "+t)}function Dd(t){return t.vnode.shapeFlag&4}let Ti=!1;function Bg(t,e=!1,n=!1){e&&wl(e);const{props:r,children:s}=t.vnode,o=Dd(t);tg(t,r,o,e),fg(t,s,n);const i=o?Fg(t,e):void 0;return e&&wl(!1),i}function Fg(t,e){var n;const r=t.type;if(v.NODE_ENV!=="production"){if(r.name&&El(r.name,t.appContext.config),r.components){const o=Object.keys(r.components);for(let i=0;i<o.length;i++)El(o[i],t.appContext.config)}if(r.directives){const o=Object.keys(r.directives);for(let i=0;i<o.length;i++)Zu(o[i])}r.compilerOptions&&Hg()&&U('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Yu),v.NODE_ENV!=="production"&&Hv(t);const{setup:s}=r;if(s){const o=t.setupContext=s.length>1?qg(t):null,i=oo(t);kn();const a=Cn(s,t,0,[v.NODE_ENV!=="production"?cn(t.props):t.props,o]);if(On(),i(),Ca(a)){if(a.then(Ad,Ad),e)return a.then(l=>{Vd(t,l,e)}).catch(l=>{Hs(l,t,0)});if(t.asyncDep=a,v.NODE_ENV!=="production"&&!t.suspense){const l=(n=r.name)!=null?n:"Anonymous";U(`Component <${l}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`)}}else Vd(t,a,e)}else Rd(t,e)}function Vd(t,e,n){me(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Be(e)?(v.NODE_ENV!=="production"&&is(e)&&U("setup() should not return VNodes directly - return a render function instead."),v.NODE_ENV!=="production"&&(t.devtoolsRawSetupState=e),t.setupState=Nu(e),v.NODE_ENV!=="production"&&zv(t)):v.NODE_ENV!=="production"&&e!==void 0&&U(`setup() should return an object. Received: ${e===null?"null":typeof e}`),Rd(t,n)}let xl;const Hg=()=>!xl;function Rd(t,e,n){const r=t.type;if(!t.render){if(!e&&xl&&!r.render){const s=r.template||al(t).template;if(s){v.NODE_ENV!=="production"&&Pn(t,"compile");const{isCustomElement:o,compilerOptions:i}=t.appContext.config,{delimiters:a,compilerOptions:l}=r,c=tt(tt({isCustomElement:o,delimiters:a},i),l);r.render=xl(s,c),v.NODE_ENV!=="production"&&In(t,"compile")}}t.render=r.render||nt}{const s=oo(t);kn();try{Wv(t)}finally{On(),s()}}v.NODE_ENV!=="production"&&!r.render&&t.render===nt&&!e&&(r.template?U('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):U("Component is missing template or render function: ",r))}const jd=v.NODE_ENV!=="production"?{get(t,e){return ki(),pt(t,"get",""),t[e]},set(){return U("setupContext.attrs is readonly."),!1},deleteProperty(){return U("setupContext.attrs is readonly."),!1}}:{get(t,e){return pt(t,"get",""),t[e]}};function zg(t){return new Proxy(t.slots,{get(e,n){return pt(t,"get","$slots"),e[n]}})}function qg(t){const e=n=>{if(v.NODE_ENV!=="production"&&(t.exposed&&U("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(de(n)?r="array":Qe(n)&&(r="ref")),r!=="object"&&U(`expose() should be passed a plain object, received ${r}.`)}t.exposed=n||{}};if(v.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(t.attrs,jd))},get slots(){return r||(r=zg(t))},get emit(){return(s,...o)=>t.emit(s,...o)},expose:e})}else return{attrs:new Proxy(t.attrs,jd),slots:t.slots,emit:t.emit,expose:e}}function kl(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Nu(Kn(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Cr)return Cr[n](t)},has(e,n){return n in e||n in Cr}})):t.proxy}const Wg=/(?:^|[-_])(\w)/g,Kg=t=>t.replace(Wg,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ol(t,e=!0){return me(t)?t.displayName||t.name:t.name||e&&t.__name}function Ci(t,e,n=!1){let r=Ol(e);if(!r&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(r=s[1])}if(!r&&t&&t.parent){const s=o=>{for(const i in o)if(o[i]===e)return i};r=s(t.components||t.parent.type.components)||s(t.appContext.components)}return r?Kg(r):n?"App":"Anonymous"}function Ld(t){return me(t)&&"__vccOpts"in t}const ee=(t,e)=>{const n=Xm(t,e,Ti);if(v.NODE_ENV!=="production"){const r=Ni();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function qe(t,e,n){const r=arguments.length;return r===2?Be(e)&&!de(e)?is(e)?F(t,null,[e]):F(t,e):F(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&is(n)&&(n=[n]),F(t,e,n))}function Gg(){if(v.NODE_ENV==="production"||typeof window>"u")return;const t={style:"color:#3ba776"},e={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},s={__vue_custom_formatter:!0,header(d){return Be(d)?d.__isVue?["div",t,"VueInstance"]:Qe(d)?["div",{},["span",t,u(d)],"<",a(d.value),">"]:Nn(d)?["div",{},["span",t,Tn(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Sn(d)?" (readonly)":""}`]:Sn(d)?["div",{},["span",t,Tn(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]:null:null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...o(d.$)]}};function o(d){const f=[];d.type.props&&d.props&&f.push(i("props",Ee(d.props))),d.setupState!==Ge&&f.push(i("setup",d.setupState)),d.data!==Ge&&f.push(i("data",Ee(d.data)));const m=l(d,"computed");m&&f.push(i("computed",m));const _=l(d,"inject");return _&&f.push(i("injected",_)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function i(d,f){return f=tt({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(m=>["div",{},["span",r,m+": "],a(f[m],!1)])]]:["span",{}]}function a(d,f=!0){return typeof d=="number"?["span",e,d]:typeof d=="string"?["span",n,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:Be(d)?["object",{object:f?Ee(d):d}]:["span",n,String(d)]}function l(d,f){const m=d.type;if(me(m))return;const _={};for(const E in d.ctx)c(m,E,f)&&(_[E]=d.ctx[E]);return _}function c(d,f,m){const _=d[m];if(de(_)&&_.includes(f)||Be(_)&&f in _||d.extends&&c(d.extends,f,m)||d.mixins&&d.mixins.some(E=>c(E,f,m)))return!0}function u(d){return Tn(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}const Md="3.4.38",er=v.NODE_ENV!=="production"?U:nt;var An={};const Jg="http://www.w3.org/2000/svg",Yg="http://www.w3.org/1998/Math/MathML",Dn=typeof document<"u"?document:null,Ud=Dn&&Dn.createElement("template"),Xg={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const s=e==="svg"?Dn.createElementNS(Jg,t):e==="mathml"?Dn.createElementNS(Yg,t):n?Dn.createElement(t,{is:n}):Dn.createElement(t);return t==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:t=>Dn.createTextNode(t),createComment:t=>Dn.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Dn.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,s,o){const i=n?n.previousSibling:e.lastChild;if(s&&(s===o||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{Ud.innerHTML=r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t;const a=Ud.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[i?i.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},tr="transition",io="animation",ao=Symbol("_vtc"),lo=(t,{slots:e})=>qe($v,Qg(t),e);lo.displayName="Transition";const Zd={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};lo.props=tt({},Bu,Zd);const Vr=(t,e=[])=>{de(t)?t.forEach(n=>n(...e)):t&&t(...e)},Bd=t=>t?de(t)?t.some(e=>e.length>1):t.length>1:!1;function Qg(t){const e={};for(const I in t)I in Zd||(e[I]=t[I]);if(t.css===!1)return e;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:c=i,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=t,_=ey(s),E=_&&_[0],k=_&&_[1],{onBeforeEnter:A,onEnter:B,onEnterCancelled:T,onLeave:J,onLeaveCancelled:P,onBeforeAppear:z=A,onAppear:N=B,onAppearCancelled:Oe=T}=e,K=(I,ce,Ze)=>{Rr(I,ce?u:a),Rr(I,ce?c:i),Ze&&Ze()},R=(I,ce)=>{I._isLeaving=!1,Rr(I,d),Rr(I,m),Rr(I,f),ce&&ce()},V=I=>(ce,Ze)=>{const w=I?N:B,$=()=>K(ce,I,Ze);Vr(w,[ce,$]),Fd(()=>{Rr(ce,I?l:o),nr(ce,I?u:a),Bd(w)||Hd(ce,r,E,$)})};return tt(e,{onBeforeEnter(I){Vr(A,[I]),nr(I,o),nr(I,i)},onBeforeAppear(I){Vr(z,[I]),nr(I,l),nr(I,c)},onEnter:V(!1),onAppear:V(!0),onLeave(I,ce){I._isLeaving=!0;const Ze=()=>R(I,ce);nr(I,d),nr(I,f),ry(),Fd(()=>{I._isLeaving&&(Rr(I,d),nr(I,m),Bd(J)||Hd(I,r,k,Ze))}),Vr(J,[I,Ze])},onEnterCancelled(I){K(I,!1),Vr(T,[I])},onAppearCancelled(I){K(I,!0),Vr(Oe,[I])},onLeaveCancelled(I){R(I),Vr(P,[I])}})}function ey(t){if(t==null)return null;if(Be(t))return[Nl(t.enter),Nl(t.leave)];{const e=Nl(t);return[e,e]}}function Nl(t){const e=vm(t);return An.NODE_ENV!=="production"&&cv(e,"<transition> explicit duration"),e}function nr(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[ao]||(t[ao]=new Set)).add(e)}function Rr(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[ao];n&&(n.delete(e),n.size||(t[ao]=void 0))}function Fd(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let ty=0;function Hd(t,e,n,r){const s=t._endId=++ty,o=()=>{s===t._endId&&r()};if(n)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=ny(t,e);if(!i)return r();const c=i+"end";let u=0;const d=()=>{t.removeEventListener(c,f),o()},f=m=>{m.target===t&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),t.addEventListener(c,f)}function ny(t,e){const n=window.getComputedStyle(t),r=_=>(n[_]||"").split(", "),s=r(`${tr}Delay`),o=r(`${tr}Duration`),i=zd(s,o),a=r(`${io}Delay`),l=r(`${io}Duration`),c=zd(a,l);let u=null,d=0,f=0;e===tr?i>0&&(u=tr,d=i,f=o.length):e===io?c>0&&(u=io,d=c,f=l.length):(d=Math.max(i,c),u=d>0?i>c?tr:io:null,f=u?u===tr?o.length:l.length:0);const m=u===tr&&/\b(transform|all)(,|$)/.test(r(`${tr}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:m}}function zd(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>qd(n)+qd(t[r])))}function qd(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function ry(){return document.body.offsetHeight}function sy(t,e,n){const r=t[ao];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Wd=Symbol("_vod"),oy=Symbol("_vsh"),iy=Symbol(An.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),ay=/(^|;)\s*display\s*:/;function ly(t,e,n){const r=t.style,s=Xe(n);let o=!1;if(n&&!s){if(e)if(Xe(e))for(const i of e.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&$i(r,a,"")}else for(const i in e)n[i]==null&&$i(r,i,"");for(const i in n)i==="display"&&(o=!0),$i(r,i,n[i])}else if(s){if(e!==n){const i=r[iy];i&&(n+=";"+i),r.cssText=n,o=ay.test(n)}}else e&&t.removeAttribute("style");Wd in t&&(t[Wd]=o?r.display:"",t[oy]&&(r.display="none"))}const cy=/[^\\];\s*$/,Kd=/\s*!important$/;function $i(t,e,n){if(de(n))n.forEach(r=>$i(t,e,r));else if(n==null&&(n=""),An.NODE_ENV!=="production"&&cy.test(n)&&er(`Unexpected semicolon at the end of '${e}' style value: '${n}'`),e.startsWith("--"))t.setProperty(e,n);else{const r=uy(t,e);Kd.test(n)?t.setProperty(xn(r),n.replace(Kd,""),"important"):t[r]=n}}const Gd=["Webkit","Moz","ms"],Sl={};function uy(t,e){const n=Sl[e];if(n)return n;let r=Vt(e);if(r!=="filter"&&r in t)return Sl[e]=r;r=wr(r);for(let s=0;s<Gd.length;s++){const o=Gd[s]+r;if(o in t)return Sl[e]=o}return e}const Jd="http://www.w3.org/1999/xlink";function Yd(t,e,n,r,s,o=Sm(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Jd,e.slice(6,e.length)):t.setAttributeNS(Jd,e,n):n==null||o&&!Gc(n)?t.removeAttribute(e):t.setAttribute(e,o?"":Hn(n)?String(n):n)}function dy(t,e,n,r){if(e==="innerHTML"||e==="textContent"){if(n==null)return;t[e]=n;return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const i=s==="OPTION"?t.getAttribute("value")||"":t.value,a=n==null?"":String(n);(i!==a||!("_value"in t))&&(t.value=a),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const i=typeof t[e];i==="boolean"?n=Gc(n):n==null&&i==="string"?(n="",o=!0):i==="number"&&(n=0,o=!0)}try{t[e]=n}catch(i){An.NODE_ENV!=="production"&&!o&&er(`Failed setting prop "${e}" on <${s.toLowerCase()}>: value ${n} is invalid.`,i)}o&&t.removeAttribute(e)}function fy(t,e,n,r){t.addEventListener(e,n,r)}function py(t,e,n,r){t.removeEventListener(e,n,r)}const Xd=Symbol("_vei");function hy(t,e,n,r,s=null){const o=t[Xd]||(t[Xd]={}),i=o[e];if(r&&i)i.value=An.NODE_ENV!=="production"?ef(r,e):r;else{const[a,l]=my(e);if(r){const c=o[e]=yy(An.NODE_ENV!=="production"?ef(r,e):r,s);fy(t,a,c,l)}else i&&(py(t,a,i,l),o[e]=void 0)}}const Qd=/(?:Once|Passive|Capture)$/;function my(t){let e;if(Qd.test(t)){e={};let r;for(;r=t.match(Qd);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):xn(t.slice(2)),e]}let Tl=0;const vy=Promise.resolve(),gy=()=>Tl||(vy.then(()=>Tl=0),Tl=Date.now());function yy(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Ut(_y(r,n.value),e,5,[r])};return n.value=t,n.attached=gy(),n}function ef(t,e){return me(t)||de(t)?t:(er(`Wrong type passed as event handler to ${e} - did you forget @ or : in front of your prop?
17
- Expected function or array of functions, received type ${typeof t}.`),nt)}function _y(t,e){if(de(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>s=>!s._stopped&&r&&r(s))}else return e}const tf=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,by=(t,e,n,r,s,o)=>{const i=s==="svg";e==="class"?sy(t,r,i):e==="style"?ly(t,n,r):Ms(e)?Wo(e)||hy(t,e,n,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):wy(t,e,r,i))?(dy(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Yd(t,e,r,i,o,e!=="value")):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),Yd(t,e,r,i))};function wy(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&tf(e)&&me(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return tf(e)&&Xe(n)?!1:e in t}const Ey=["ctrl","shift","alt","meta"],xy={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Ey.some(n=>t[`${n}Key`]&&!e.includes(n))},ky=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=(s,...o)=>{for(let i=0;i<e.length;i++){const a=xy[e[i]];if(a&&a(s,e))return}return t(s,...o)})},Oy=tt({patchProp:by},Xg);let nf;function Ny(){return nf||(nf=_g(Oy))}const Sy=(...t)=>{const e=Ny().createApp(...t);An.NODE_ENV!=="production"&&(Cy(e),$y(e));const{mount:n}=e;return e.mount=r=>{const s=Py(r);if(!s)return;const o=e._component;!me(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.innerHTML="";const i=n(s,!1,Ty(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},e};function Ty(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Cy(t){Object.defineProperty(t.config,"isNativeTag",{value:e=>km(e)||Om(e)||Nm(e),writable:!1})}function $y(t){{const e=t.config.isCustomElement;Object.defineProperty(t.config,"isCustomElement",{get(){return e},set(){er("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=t.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(t.config,"compilerOptions",{get(){return er(r),n},set(){er(r)}})}}function Py(t){if(Xe(t)){const e=document.querySelector(t);return An.NODE_ENV!=="production"&&!e&&er(`Failed to mount app: mount target selector "${t}" returned null.`),e}return An.NODE_ENV!=="production"&&window.ShadowRoot&&t instanceof window.ShadowRoot&&t.mode==="closed"&&er('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),t}var Iy={};function Ay(){Gg()}Iy.NODE_ENV!=="production"&&Ay();let Pi;const Dy=new Uint8Array(16);function Vy(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(Dy)}const ht=[];for(let t=0;t<256;++t)ht.push((t+256).toString(16).slice(1));function Ry(t,e=0){return ht[t[e+0]]+ht[t[e+1]]+ht[t[e+2]]+ht[t[e+3]]+"-"+ht[t[e+4]]+ht[t[e+5]]+"-"+ht[t[e+6]]+ht[t[e+7]]+"-"+ht[t[e+8]]+ht[t[e+9]]+"-"+ht[t[e+10]]+ht[t[e+11]]+ht[t[e+12]]+ht[t[e+13]]+ht[t[e+14]]+ht[t[e+15]]}const rf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Cl(t,e,n){if(rf.randomUUID&&!e&&!t)return rf.randomUUID();t=t||{};const r=t.random||(t.rng||Vy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ry(r)}var Ue;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ue||(Ue={}));var $l;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($l||($l={}));const se=Ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rr=t=>{switch(typeof t){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(t)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(t)?se.array:t===null?se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?se.promise:typeof Map<"u"&&t instanceof Map?se.map:typeof Set<"u"&&t instanceof Set?se.set:typeof Date<"u"&&t instanceof Date?se.date:se.object;default:return se.unknown}},H=Ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),jy=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Gt extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return s(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Gt.create=t=>new Gt(t);const co=(t,e)=>{let n;switch(t.code){case H.invalid_type:t.received===se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ue.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ue.joinValues(t.keys,", ")}`;break;case H.invalid_union:n="Invalid input";break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ue.joinValues(t.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${Ue.joinValues(t.options)}, received '${t.received}'`;break;case H.invalid_arguments:n="Invalid function arguments";break;case H.invalid_return_type:n="Invalid function return type";break;case H.invalid_date:n="Invalid date";break;case H.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case H.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case H.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case H.custom:n="Invalid input";break;case H.invalid_intersection_types:n="Intersection results could not be merged";break;case H.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case H.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ue.assertNever(t)}return{message:n}};let sf=co;function Ly(t){sf=t}function Ii(){return sf}const Ai=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],i={...s,path:o};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:e,defaultError:a}).message;return{...s,path:o,message:s.message||a}},My=[];function ie(t,e){const n=Ai({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ii(),co].filter(r=>!!r)});t.common.issues.push(n)}class wt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ne;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n)r.push({key:await s.key,value:await s.value});return wt.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Ne;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}}const Ne=Object.freeze({status:"aborted"}),of=t=>({status:"dirty",value:t}),St=t=>({status:"valid",value:t}),Pl=t=>t.status==="aborted",Il=t=>t.status==="dirty",uo=t=>t.status==="valid",Di=t=>typeof Promise<"u"&&t instanceof Promise;var pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));class hn{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const af=(t,e)=>{if(uo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Gt(t.common.issues);return this._error=n,this._error}}};function Ce(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,a)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:s}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return rr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Di(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rr(e)},o=this._parseSync({data:e,path:s.path,parent:s});return af(s,o)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rr(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(Di(s)?s:Promise.resolve(s));return af(r,o)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const i=e(s),a=()=>o.addIssue({code:H.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Xt({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Rn.create(this,this._def)}nullable(){return Ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this,this._def)}promise(){return us.create(this,this._def)}or(e){return mo.create([this,e],this._def)}and(e){return vo.create(this,e,this._def)}transform(e){return new Xt({...Ce(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new wo({...Ce(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new cf({typeName:_e.ZodBranded,type:this,...Ce(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Ce(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Eo.create(this,e)}readonly(){return Bi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Uy=/^c[^\s-]{8,}$/i,Zy=/^[a-z][a-z0-9]*$/,By=/^[0-9A-HJKMNP-TV-Z]{26}$/,Fy=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hy=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Al;const qy=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Wy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ky=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Gy(t,e){return!!((e==="v4"||!e)&&qy.test(t)||(e==="v6"||!e)&&Wy.test(t))}class Jt extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.string,received:o.parsedType}),Ne}const r=new wt;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=e.data.length>o.value,a=e.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(e,s),i?ie(s,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&ie(s,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Hy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Al||(Al=new RegExp(zy,"u")),Al.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Fy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Uy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Zy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")By.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:H.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:H.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Ky(o).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Gy(e.data,o.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:H.invalid_string,message:o.message}),r.dirty()):Ue.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:H.invalid_string,...pe.errToObj(r)})}_addCheck(e){return new Jt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...pe.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Jt.create=t=>{var e;return new Jt({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ce(t)})};function Jy(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(t.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class sr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==se.number){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.number,received:o.parsedType}),Ne}let r;const s=new wt;for(const o of this._def.checks)o.kind==="int"?Ue.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:H.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Jy(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:H.not_finite,message:o.message}),s.dirty()):Ue.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,r,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:pe.toString(s)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}sr.create=t=>new sr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ce(t)});class or extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==se.bigint){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.bigint,received:o.parsedType}),Ne}let r;const s=new wt;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ue.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,r,s){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:pe.toString(s)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}or.create=t=>{var e;return new or({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ce(t)})};class fo extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.boolean,received:r.parsedType}),Ne}return St(e.data)}}fo.create=t=>new fo({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ce(t)});class jr extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.date,received:o.parsedType}),Ne}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_date}),Ne}const r=new wt;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ue.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new jr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}jr.create=t=>new jr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Ce(t)});class Vi extends Pe{_parse(e){if(this._getType(e)!==se.symbol){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.symbol,received:r.parsedType}),Ne}return St(e.data)}}Vi.create=t=>new Vi({typeName:_e.ZodSymbol,...Ce(t)});class po extends Pe{_parse(e){if(this._getType(e)!==se.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.undefined,received:r.parsedType}),Ne}return St(e.data)}}po.create=t=>new po({typeName:_e.ZodUndefined,...Ce(t)});class ho extends Pe{_parse(e){if(this._getType(e)!==se.null){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.null,received:r.parsedType}),Ne}return St(e.data)}}ho.create=t=>new ho({typeName:_e.ZodNull,...Ce(t)});class as extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return St(e.data)}}as.create=t=>new as({typeName:_e.ZodAny,...Ce(t)});class Lr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return St(e.data)}}Lr.create=t=>new Lr({typeName:_e.ZodUnknown,...Ce(t)});class Vn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:H.invalid_type,expected:se.never,received:n.parsedType}),Ne}}Vn.create=t=>new Vn({typeName:_e.ZodNever,...Ce(t)});class Ri extends Pe{_parse(e){if(this._getType(e)!==se.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.void,received:r.parsedType}),Ne}return St(e.data)}}Ri.create=t=>new Ri({typeName:_e.ZodVoid,...Ce(t)});class Yt extends Pe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==se.array)return ie(n,{code:H.invalid_type,expected:se.array,received:n.parsedType}),Ne;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(i||a)&&(ie(n,{code:i?H.too_big:H.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:H.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:H.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>s.type._parseAsync(new hn(n,i,n.path,a)))).then(i=>wt.mergeArray(r,i));const o=[...n.data].map((i,a)=>s.type._parseSync(new hn(n,i,n.path,a)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Yt({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new Yt({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new Yt({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}Yt.create=(t,e)=>new Yt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Ce(e)});function ls(t){if(t instanceof et){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Rn.create(ls(r))}return new et({...t._def,shape:()=>e})}else return t instanceof Yt?new Yt({...t._def,type:ls(t.element)}):t instanceof Rn?Rn.create(ls(t.unwrap())):t instanceof Ur?Ur.create(ls(t.unwrap())):t instanceof mn?mn.create(t.items.map(e=>ls(e))):t}class et extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ue.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==se.object){const c=this._getOrReturnCtx(e);return ie(c,{code:H.invalid_type,expected:se.object,received:c.parsedType}),Ne}const{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Vn&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=o[c],d=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new hn(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Vn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")a.length>0&&(ie(s,{code:H.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new hn(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(r,c)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new et({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=pe.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(e){return new et({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new et({...this._def,catchall:e})}pick(e){const n={};return Ue.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new et({...this._def,shape:()=>n})}omit(e){const n={};return Ue.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new et({...this._def,shape:()=>n})}deepPartial(){return ls(this)}partial(e){const n={};return Ue.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}),new et({...this._def,shape:()=>n})}required(e){const n={};return Ue.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Rn;)o=o._def.innerType;n[r]=o}}),new et({...this._def,shape:()=>n})}keyof(){return lf(Ue.objectKeys(this.shape))}}et.create=(t,e)=>new et({shape:()=>t,unknownKeys:"strip",catchall:Vn.create(),typeName:_e.ZodObject,...Ce(e)}),et.strictCreate=(t,e)=>new et({shape:()=>t,unknownKeys:"strict",catchall:Vn.create(),typeName:_e.ZodObject,...Ce(e)}),et.lazycreate=(t,e)=>new et({shape:t,unknownKeys:"strip",catchall:Vn.create(),typeName:_e.ZodObject,...Ce(e)});class mo extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Gt(a.ctx.common.issues));return ie(n,{code:H.invalid_union,unionErrors:i}),Ne}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Gt(l));return ie(n,{code:H.invalid_union,unionErrors:a}),Ne}}get options(){return this._def.options}}mo.create=(t,e)=>new mo({options:t,typeName:_e.ZodUnion,...Ce(e)});const ji=t=>t instanceof yo?ji(t.schema):t instanceof Xt?ji(t.innerType()):t instanceof _o?[t.value]:t instanceof ir?t.options:t instanceof bo?Object.keys(t.enum):t instanceof wo?ji(t._def.innerType):t instanceof po?[void 0]:t instanceof ho?[null]:null;class Li extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return ie(n,{code:H.invalid_type,expected:se.object,received:n.parsedType}),Ne;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ne)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const o of n){const i=ji(o.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Li({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ce(r)})}}function Dl(t,e){const n=rr(t),r=rr(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&r===se.object){const s=Ue.objectKeys(e),o=Ue.objectKeys(t).filter(a=>s.indexOf(a)!==-1),i={...t,...e};for(const a of o){const l=Dl(t[a],e[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===se.array&&r===se.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const i=t[o],a=e[o],l=Dl(i,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===se.date&&r===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class vo extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,i)=>{if(Pl(o)||Pl(i))return Ne;const a=Dl(o.value,i.value);return a.valid?((Il(o)||Il(i))&&n.dirty(),{status:n.value,value:a.data}):(ie(r,{code:H.invalid_intersection_types}),Ne)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vo.create=(t,e,n)=>new vo({left:t,right:e,typeName:_e.ZodIntersection,...Ce(n)});class mn extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.array)return ie(r,{code:H.invalid_type,expected:se.array,received:r.parsedType}),Ne;if(r.data.length<this._def.items.length)return ie(r,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ne;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new hn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(n,i)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new mn({...this._def,rest:e})}}mn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mn({items:t,typeName:_e.ZodTuple,rest:null,...Ce(e)})};class go extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.object)return ie(r,{code:H.invalid_type,expected:se.object,received:r.parsedType}),Ne;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in r.data)s.push({key:o._parse(new hn(r,a,r.path,a)),value:i._parse(new hn(r,r.data[a],r.path,a))});return r.common.async?wt.mergeObjectAsync(n,s):wt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Pe?new go({keyType:e,valueType:n,typeName:_e.ZodRecord,...Ce(r)}):new go({keyType:Jt.create(),valueType:e,typeName:_e.ZodRecord,...Ce(n)})}}class Mi extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.map)return ie(r,{code:H.invalid_type,expected:se.map,received:r.parsedType}),Ne;const s=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:s._parse(new hn(r,a,r.path,[c,"key"])),value:o._parse(new hn(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ne;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ne;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}Mi.create=(t,e,n)=>new Mi({valueType:e,keyType:t,typeName:_e.ZodMap,...Ce(n)});class Mr extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.set)return ie(r,{code:H.invalid_type,expected:se.set,received:r.parsedType}),Ne;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ie(r,{code:H.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ie(r,{code:H.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ne;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new hn(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(e,n){return new Mr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new Mr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Mr.create=(t,e)=>new Mr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Ce(e)});class cs extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.function)return ie(n,{code:H.invalid_type,expected:se.function,received:n.parsedType}),Ne;function r(a,l){return Ai({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ii(),co].filter(c=>!!c),issueData:{code:H.invalid_arguments,argumentsError:l}})}function s(a,l){return Ai({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ii(),co].filter(c=>!!c),issueData:{code:H.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof us){const a=this;return St(async function(...l){const c=new Gt([]),u=await a._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(r(l,m)),c}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(m=>{throw c.addIssue(s(d,m)),c})})}else{const a=this;return St(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Gt([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Gt([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new cs({...this._def,args:mn.create(e).rest(Lr.create())})}returns(e){return new cs({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new cs({args:e||mn.create([]).rest(Lr.create()),returns:n||Lr.create(),typeName:_e.ZodFunction,...Ce(r)})}}class yo extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}yo.create=(t,e)=>new yo({getter:t,typeName:_e.ZodLazy,...Ce(e)});class _o extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:H.invalid_literal,expected:this._def.value}),Ne}return{status:"valid",value:e.data}}get value(){return this._def.value}}_o.create=(t,e)=>new _o({value:t,typeName:_e.ZodLiteral,...Ce(e)});function lf(t,e){return new ir({values:t,typeName:_e.ZodEnum,...Ce(e)})}class ir extends Pe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{expected:Ue.joinValues(r),received:n.parsedType,code:H.invalid_type}),Ne}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{received:n.data,code:H.invalid_enum_value,options:r}),Ne}return St(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return ir.create(e)}exclude(e){return ir.create(this.options.filter(n=>!e.includes(n)))}}ir.create=lf;class bo extends Pe{_parse(e){const n=Ue.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==se.string&&r.parsedType!==se.number){const s=Ue.objectValues(n);return ie(r,{expected:Ue.joinValues(s),received:r.parsedType,code:H.invalid_type}),Ne}if(n.indexOf(e.data)===-1){const s=Ue.objectValues(n);return ie(r,{received:r.data,code:H.invalid_enum_value,options:s}),Ne}return St(e.data)}get enum(){return this._def.values}}bo.create=(t,e)=>new bo({values:t,typeName:_e.ZodNativeEnum,...Ce(e)});class us extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.promise&&n.common.async===!1)return ie(n,{code:H.invalid_type,expected:se.promise,received:n.parsedType}),Ne;const r=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return St(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}us.create=(t,e)=>new us({type:t,typeName:_e.ZodPromise,...Ce(e)});class Xt extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:i=>{ie(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(i).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:i,path:r.path,parent:r})}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ne:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ne:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!uo(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>uo(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:n.value,value:a})):i);Ue.assertNever(s)}}Xt.create=(t,e,n)=>new Xt({schema:t,typeName:_e.ZodEffects,effect:e,...Ce(n)}),Xt.createWithPreprocess=(t,e,n)=>new Xt({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Ce(n)});class Rn extends Pe{_parse(e){return this._getType(e)===se.undefined?St(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Rn.create=(t,e)=>new Rn({innerType:t,typeName:_e.ZodOptional,...Ce(e)});class Ur extends Pe{_parse(e){return this._getType(e)===se.null?St(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ur.create=(t,e)=>new Ur({innerType:t,typeName:_e.ZodNullable,...Ce(e)});class wo extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===se.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}wo.create=(t,e)=>new wo({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ce(e)});class Ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Di(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Gt(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ce(e)});class Zi extends Pe{_parse(e){if(this._getType(e)!==se.nan){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.nan,received:r.parsedType}),Ne}return{status:"valid",value:e.data}}}Zi.create=t=>new Zi({typeName:_e.ZodNaN,...Ce(t)});const Yy=Symbol("zod_brand");class cf extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Eo extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ne:o.status==="dirty"?(n.dirty(),of(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ne:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Eo({in:e,out:n,typeName:_e.ZodPipeline})}}class Bi extends Pe{_parse(e){const n=this._def.innerType._parse(e);return uo(n)&&(n.value=Object.freeze(n.value)),n}}Bi.create=(t,e)=>new Bi({innerType:t,typeName:_e.ZodReadonly,...Ce(e)});const uf=(t,e={},n)=>t?as.create().superRefine((r,s)=>{var o,i;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&i!==void 0?i:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):as.create(),Xy={object:et.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const Qy=(t,e={message:`Input not instance of ${t.name}`})=>uf(n=>n instanceof t,e),df=Jt.create,ff=sr.create,e_=Zi.create,t_=or.create,pf=fo.create,n_=jr.create,r_=Vi.create,s_=po.create,o_=ho.create,i_=as.create,a_=Lr.create,l_=Vn.create,c_=Ri.create,u_=Yt.create,d_=et.create,f_=et.strictCreate,p_=mo.create,h_=Li.create,m_=vo.create,v_=mn.create,g_=go.create,y_=Mi.create,__=Mr.create,b_=cs.create,w_=yo.create,E_=_o.create,x_=ir.create,k_=bo.create,O_=us.create,hf=Xt.create,N_=Rn.create,S_=Ur.create,T_=Xt.createWithPreprocess,C_=Eo.create;var ar=Object.freeze({__proto__:null,defaultErrorMap:co,setErrorMap:Ly,getErrorMap:Ii,makeIssue:Ai,EMPTY_PATH:My,addIssueToContext:ie,ParseStatus:wt,INVALID:Ne,DIRTY:of,OK:St,isAborted:Pl,isDirty:Il,isValid:uo,isAsync:Di,get util(){return Ue},get objectUtil(){return $l},ZodParsedType:se,getParsedType:rr,ZodType:Pe,ZodString:Jt,ZodNumber:sr,ZodBigInt:or,ZodBoolean:fo,ZodDate:jr,ZodSymbol:Vi,ZodUndefined:po,ZodNull:ho,ZodAny:as,ZodUnknown:Lr,ZodNever:Vn,ZodVoid:Ri,ZodArray:Yt,ZodObject:et,ZodUnion:mo,ZodDiscriminatedUnion:Li,ZodIntersection:vo,ZodTuple:mn,ZodRecord:go,ZodMap:Mi,ZodSet:Mr,ZodFunction:cs,ZodLazy:yo,ZodLiteral:_o,ZodEnum:ir,ZodNativeEnum:bo,ZodPromise:us,ZodEffects:Xt,ZodTransformer:Xt,ZodOptional:Rn,ZodNullable:Ur,ZodDefault:wo,ZodCatch:Ui,ZodNaN:Zi,BRAND:Yy,ZodBranded:cf,ZodPipeline:Eo,ZodReadonly:Bi,custom:uf,Schema:Pe,ZodSchema:Pe,late:Xy,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>Jt.create({...t,coerce:!0}),number:t=>sr.create({...t,coerce:!0}),boolean:t=>fo.create({...t,coerce:!0}),bigint:t=>or.create({...t,coerce:!0}),date:t=>jr.create({...t,coerce:!0})},any:i_,array:u_,bigint:t_,boolean:pf,date:n_,discriminatedUnion:h_,effect:hf,enum:x_,function:b_,instanceof:Qy,intersection:m_,lazy:w_,literal:E_,map:y_,nan:e_,nativeEnum:k_,never:l_,null:o_,nullable:S_,number:ff,object:d_,oboolean:()=>pf().optional(),onumber:()=>ff().optional(),optional:N_,ostring:()=>df().optional(),pipeline:C_,preprocess:T_,promise:O_,record:g_,set:__,strictObject:f_,string:df,symbol:r_,transformer:hf,tuple:v_,undefined:s_,union:p_,unknown:a_,void:c_,NEVER:Ne,ZodIssueCode:H,quotelessJson:jy,ZodError:Gt}),lr=Symbol("storefront");function $_(t,e=100){let n=0;return async(...s)=>{clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}var P_=ar.object({source:ar.literal("moonbase-checkout"),event:ar.literal("close"),intent:ar.string().optional()}),I_=ar.object({source:ar.literal("moonbase-checkout"),event:ar.literal("completed")}),A_=ar.discriminatedUnion("event",[P_,I_]);function mf(t){if(typeof window>"u"){console.warn("Can not mount checkout server side");return}const e=document.createElement("iframe");e.id="moonbase-checkout",e.src=t,e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.right="0px",e.style.border="none",e.style.colorScheme="normal",e.style.backgroundColor="transparent",e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.setAttribute("background","transparent"),e.setAttribute("frameborder","0"),e.setAttribute("allowtransparency","true"),e.height="100%",e.width="100%",document.body.append(e),document.documentElement.style.overflow="hidden",window.onmessage=function(n){var r;try{const s=A_.parse(n.data);s.event==="close"&&(document.body.contains(e)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(e)),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:s}))),s.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:s}))}catch(s){((r=n.data)==null?void 0:r.source)==="moonbase-checkout"&&console.error("Could not parse event:",n.data,s)}}}var Fi=class gt{constructor(e,n,r){this.configuration=e,this.client=n,this.stateFactory=r,this.hasUtm=ee(()=>!!this.utm.value&&Object.values(this.utm.value).some(l=>!!l)),this.currentUser=C(null),this.loadedUser=C(!1),this.debouncedPushOrderContent=$_(l=>this.client.orders.pushContent(l,void 0,this.hasUtm.value?this.utm.value:void 0),500);var s;if(typeof window>"u"){this.currentOrder=C({id:Cl(),status:js.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(gt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${gt.storefrontKey}_loaded`,!1),this.utm=r(`${gt.storefrontKey}_utm`,void 0);return}const o=new URLSearchParams(window.location.search);this.utm=r(`${gt.storefrontKey}_utm`,{referrer:((s=window.document.referrer)==null?void 0:s.replace(/https?:\/\//g,"").split("/")[0])||void 0,source:o.get("utm_source")||void 0,medium:o.get("utm_medium")||void 0,campaign:o.get("utm_campaign")||void 0,term:o.get("utm_term")||void 0,content:o.get("utm_content")||void 0}),window.addEventListener("storage",l=>this.handleStorageUpdate(l));const i=localStorage.getItem(gt.sessionKey);i?(this.currentOrder=C(JSON.parse(i)),this.refreshOrder()):this.currentOrder=C({id:Cl(),status:js.Open,currency:"",items:[],couponsApplied:[]});const a=localStorage.getItem(gt.storefrontKey);if(a?(this.storefront=r(gt.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${gt.storefrontKey}_loaded`,!0)):(this.storefront=r(gt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${gt.storefrontKey}_loaded`,!1)),this.client.tokenStore.hasAccessToken&&(this.currentUser.value=this.client.tokenStore.user),this.updateStorefront(),this.updateUser(),window.location){const l=new URLSearchParams(window.location.search),c=l.get("mb_intent"),u=l.get("mb_endpoint");if(c==="checkout"&&l.get("mb_complete")&&u){const d=Object.fromEntries([...l.entries()].filter(([m])=>!m.startsWith("mb_"))),f=new URL(decodeURIComponent(u));for(const m of Object.keys(d))f.searchParams.append(m,d[m]);mf(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",()=>this.resetOrder())}get loadedStorefrontPromise(){return new Promise(e=>{lt(this.loadedStorefront,n=>{n&&e()},{immediate:!0})})}get loadedUserPromise(){return new Promise(e=>{lt(this.loadedUser,n=>{n&&e()},{immediate:!0})})}onCheckoutCompleted(e){window.addEventListener("moonbase-checkout-completed",()=>e())}onCheckoutClosed(e){window.addEventListener("moonbase-checkout-closed",n=>e(n.detail.intent))}install(e){e.provide(lr,this),console.log("Moonbase.sh storefront installed, learn more at https://moonbase.sh/docs")}async updateUser(){try{this.currentUser.value=await this.client.identity.get()}catch(e){e instanceof xa||console.error("Could not load user",e)}finally{this.loadedUser.value=!0}}async updateStorefront(){const e=await this.client.storefront.get(this.hasUtm.value?this.utm.value:void 0);e&&(typeof window<"u"&&localStorage.setItem(gt.storefrontKey,JSON.stringify(e)),this.storefront.value=e,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=e.suggestedCurrency))}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(gt.sessionKey,JSON.stringify(this.currentOrder.value)),this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(e){switch(e.key){case gt.sessionKey:this.currentOrder.value=JSON.parse(e.newValue);break;case gt.storefrontKey:this.storefront.value=JSON.parse(e.newValue);break}}async refreshOrder(){try{const e=await this.client.orders.get(this.currentOrder.value.id);e&&(e.status!==js.Open?this.resetOrder():(typeof window<"u"&&localStorage.setItem(gt.sessionKey,JSON.stringify(e)),this.currentOrder.value=e))}catch(e){e!=null&&this.resetOrder()}}resetOrder(){var e;this.currentOrder.value={id:Cl(),currency:((e=this.storefront.value)==null?void 0:e.suggestedCurrency)||"",status:js.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(gt.sessionKey)}};Fi.userKey="moonbase_user",Fi.sessionKey="moonbase_session",Fi.storefrontKey="moonbase_storefront";var D_=Fi;function vf(t,e){const n=e??Me(lr);if(!n)throw new Error("No storefront configured");return ee(()=>n.storefront.value.bundles.find(r=>r.id===t)||null)}function gf(t,e){const n=e??Me(lr);if(!n)throw new Error("No storefront configured");return ee(()=>n.storefront.value.products.find(r=>r.id===t)||null)}function Hi(t){const e=Me(lr);if(!e)throw new Error("No storefront configured");return{getLicenses:async n=>e.client.inventory.licenses.get(n),getLicenseActivations:async(n,r)=>e.client.inventory.licenses.getActivations(n,r),getProduct:async(n,r)=>e.client.inventory.products.get(n,r),getProducts:async n=>e.client.inventory.products.getOwned(n),getProductLicenses:async(n,r)=>e.client.inventory.products.getLicenses(n,r),getProductActivations:async(n,r)=>e.client.inventory.products.getActivations(n,r),revokeActivation:async n=>e.client.inventory.licenses.revokeActivation(n.licenseId,n.id),activateProduct:async(n,r)=>e.client.inventory.activation.activate(n,r),downloadProduct:async n=>{if(!n.path)throw new Error("Product is not downloadable");window.location.href=await e.client.inventory.products.getDownloadUrl(n.path)}}}function V_(t,e){const n=Me(lr),r=tv(t);if(!r)throw new Error("No request ID was given when calling `useActivationRequest`");if(!n)throw new Error("No storefront configured");const s=n.stateFactory(`activation-request-${r}`,null),o=n.stateFactory(`activation-request-${r}-error`,null),i=n.stateFactory(`activation-request-${r}-loading`,!0),a=n.stateFactory(`activation-request-${r}-fulfilling`,!1),l=n.stateFactory(`activation-request-${r}-completing`,!1),c=n.stateFactory(`activation-request-${r}-completion-timeout`,null),u=async()=>{await n.client.activationRequests.isCompleted(r)&&s.value?(s.value.status=on.Completed,l.value=!1):c.value=setTimeout(u,1500)};return r&&r.length>0?n.client.activationRequests.get(r).then(d=>{s.value=d,s.value.status===on.Fulfilled&&(l.value=!0,u()),i.value=!1}).catch(d=>{o.value=d,i.value=!1}):(o.value=new Error("Missing request id"),i.value=!1),el(()=>{c.value&&clearTimeout(c.value)}),lt(n.currentUser,async()=>{var d,f;if(!(!r||(f=(d=s.value)==null?void 0:d.licenseEligibility)!=null&&f.eligible)){i.value=!0;try{s.value=await n.client.activationRequests.get(r),s.value.status===on.Fulfilled&&(l.value=!0,u())}catch(m){o.value=m}i.value=!1}}),{activationRequest:s,loading:i,fulfilling:a,completing:l,error:o,isInstalled:ee(()=>{var d;return s&&((d=s.value)==null?void 0:d.status)===on.Completed}),fulfillLicense:async()=>{a.value=!0,s.value=await n.client.activationRequests.fulfillLicense(r),a.value=!1,l.value=!0,u()},fulfillTrial:async()=>{a.value=!0,s.value=await n.client.activationRequests.fulfillTrial(r),a.value=!1,l.value=!0,u()},cancel:async()=>{var d;((d=s.value)==null?void 0:d.status)!==on.Cancelled&&(s.value=await n.client.activationRequests.cancel(r))}}}function R_(t){const e=Me(lr);if(!e)throw new Error("No storefront configured");return{peek:async n=>{try{return await e.client.vouchers.peek(n)}catch(r){throw r instanceof rs?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await e.client.vouchers.redeem(n)}catch(r){throw r instanceof rs?new Error("Voucher code invalid"):r}}}}function Vl(t){const e=t??Me(lr);if(!e)throw new Error("No storefront configured");return{items:ee(()=>e.currentOrder.value.items.map(n=>{var r,s;if(n.type==="Product"){const o=e.storefront.value.products.find(l=>l.id===n.productId),a=((o==null?void 0:o.variations)||[]).find(l=>l.id===n.variationId);return{...n,product:o,variation:a,price:a==null?void 0:a.price,appliedDiscount:(r=a==null?void 0:a.discount)!=null?r:n.appliedDiscount}}else{const o=e.storefront.value.bundles.find(l=>l.id===n.bundleId),a=((o==null?void 0:o.variations)||[]).find(l=>l.id===n.variationId);return{...n,bundle:o,variation:a,price:a==null?void 0:a.price,appliedDiscount:(s=a==null?void 0:a.discount)!=null?s:n.appliedDiscount}}})),currency:ee(()=>e.currentOrder.value.currency||e.storefront.value.suggestedCurrency),total:ee(()=>{const n=e.currentOrder.value.currency||e.storefront.value.suggestedCurrency;return{amount:e.currentOrder.value.items.reduce((s,o)=>{var i,a,l,c,u,d;let f;if(o.type==="Product"){const m=e.storefront.value.products.find(k=>k.id===o.productId),E=((m==null?void 0:m.variations)||[]).find(k=>k.id===o.variationId);f=(l=(a=E==null?void 0:E.price[n])!=null?a:(i=m==null?void 0:m.defaultVariation)==null?void 0:i.price[n])!=null?l:0}else{const m=e.storefront.value.bundles.find(k=>k.id===o.bundleId),E=((m==null?void 0:m.variations)||[]).find(k=>k.id===o.variationId);f=(d=(u=E==null?void 0:E.price[n])!=null?u:(c=m==null?void 0:m.defaultVariation)==null?void 0:c.price[n])!=null?d:0}return s+f*o.quantity},0),currency:n}}),addToCart:(n,r)=>{if(n=b(n),r??(r=n.defaultVariation),!r)throw new Error("Added item does not have a default variation, and none have been specified");const s=`${n.type==="bundle"?"b":"p"}/${n.id}/${r.id}`;let o=e.currentOrder.value.items.find(i=>i.id===s);o?o.quantity+=1:n.type==="bundle"?(o={id:s,type:"Bundle",bundleId:n.id,bundle:n,quantity:1,variation:r,variationId:r.id,price:r.price,appliedDiscount:r.discount},e.currentOrder.value.items.push(o)):n.type==="product"&&(o={id:s,type:"Product",productId:n.id,product:n,quantity:1,variation:r,variationId:r.id,price:r.price,appliedDiscount:r.discount},e.currentOrder.value.items.push(o)),e.pushOrderContent()},setQuantity:(n,r)=>{const s=e.currentOrder.value.items.find(o=>o.id===n.id);if(!s)throw new Error("Cart item not found");if(s.quantity=r,s.quantity<=0){const o=e.currentOrder.value.items.findIndex(i=>i.id===s.id);e.currentOrder.value.items.splice(o,1)}e.pushOrderContent()},removeFromCart:n=>{const r=e.currentOrder.value.items.findIndex(s=>s.id===n.id);e.currentOrder.value.items.splice(r,1),e.pushOrderContent()},checkout:async n=>{const r=new URL(n,document.baseURI).href,s=await e.client.orders.pushContent(e.currentOrder.value,{returnUrl:r});if(s.embeddedCheckoutUrl&&typeof window<"u"){const o=s.embeddedCheckoutUrl;return new Promise(i=>{mf(o.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",a=>{i({next:a.detail.next})})})}else{if(s.checkoutUrl&&typeof window<"u")return window.location.href=s.checkoutUrl,{next:void 0};throw new Error("No checkout URL found")}}}}function It(t){const e=t??Me(lr);if(!e)throw new Error("No storefront configured");return{user:e.currentUser,loaded:e.loadedUser,loadedPromise:e.loadedUserPromise,signIn:async(n,r)=>{const s=await e.client.identity.signIn(n,r);return e.currentUser.value=s,e.updateStorefront(),s},signUp:async(n,r,s,o,i,a,l)=>{const c=await e.client.identity.signUp(n,r,s,o,i,a,l);return e.currentUser.value=c,e.updateStorefront(),c},signOut:async()=>{e.client.tokenStore.setUser(null),await e.updateStorefront(),e.currentUser.value=null},update:async(n,r,s,o)=>{const i=await e.client.identity.update(n,r,s,o);return e.currentUser.value&&(e.currentUser.value.name=n,o&&(e.currentUser.value.communicationPreferences=o)),i},setPassword:async(n,r)=>{await e.client.identity.setPassword(n,r)},forgotPassword:async n=>{await e.client.identity.forgotPassword(n)},resetPassword:async(n,r,s)=>{await e.client.identity.resetPassword(n,r,s)},confirmAccount:async(n,r)=>await e.client.identity.confirmAccount(n,r),confirmEmail:async(n,r)=>await e.client.identity.confirmEmail(n,r),confirmEmailChange:async(n,r)=>{await e.client.identity.confirmEmailChange(n,r),e.updateUser()}}}function j_(t,e){const n={endpoint:t};return new D_(n,new cm(n),(r,s)=>C(s))}var yf=!1;function zi(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function Rl(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function L_(){return _f().__VUE_DEVTOOLS_GLOBAL_HOOK__}function _f(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const M_=typeof Proxy=="function",U_="devtools-plugin:setup",Z_="plugin:settings:set";let ds,jl;function B_(){var t;return ds!==void 0||(typeof window<"u"&&window.performance?(ds=!0,jl=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(ds=!0,jl=globalThis.perf_hooks.performance):ds=!1),ds}function F_(){return B_()?jl.now():Date.now()}class H_{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const i in e.settings){const a=e.settings[i];r[i]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const i=localStorage.getItem(s),a=JSON.parse(i);Object.assign(o,a)}catch{}this.fallbacks={getSettings(){return o},setSettings(i){try{localStorage.setItem(s,JSON.stringify(i))}catch{}o=i},now(){return F_()}},n&&n.on(Z_,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function bf(t,e){const n=t,r=_f(),s=L_(),o=M_&&n.enableEarlyProxy;if(s&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))s.emit(U_,t,e);else{const i=o?new H_(n,s):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:i}),i&&e(i.proxiedTarget)}}var Le={};let xo;const ko=t=>xo=t,wf=Le.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Zr(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var vn;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(vn||(vn={}));const Br=typeof window<"u",Ef=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function z_(t,{autoBom:e=!1}={}){return e&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function Ll(t,e,n){const r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){Of(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function xf(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function qi(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}const Wi=typeof navigator=="object"?navigator:{userAgent:""},kf=/Macintosh/.test(Wi.userAgent)&&/AppleWebKit/.test(Wi.userAgent)&&!/Safari/.test(Wi.userAgent),Of=Br?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!kf?q_:"msSaveOrOpenBlob"in Wi?W_:K_:()=>{};function q_(t,e="download",n){const r=document.createElement("a");r.download=e,r.rel="noopener",typeof t=="string"?(r.href=t,r.origin!==location.origin?xf(r.href)?Ll(t,e,n):(r.target="_blank",qi(r)):qi(r)):(r.href=URL.createObjectURL(t),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){qi(r)},0))}function W_(t,e="download",n){if(typeof t=="string")if(xf(t))Ll(t,e,n);else{const r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){qi(r)})}else navigator.msSaveOrOpenBlob(z_(t,n),e)}function K_(t,e,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return Ll(t,e,n);const s=t.type==="application/octet-stream",o=/constructor/i.test(String(Ef.HTMLElement))||"safari"in Ef,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||s&&o||kf)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let l=a.result;if(typeof l!="string")throw r=null,new Error("Wrong reader.result type");l=i?l:l.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=l:location.assign(l),r=null},a.readAsDataURL(t)}else{const a=URL.createObjectURL(t);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function dt(t,e){const n="🍍 "+t;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,e):e==="error"?console.error(n):e==="warn"?console.warn(n):console.log(n)}function Ml(t){return"_a"in t&&"install"in t}function Nf(){if(!("clipboard"in navigator))return dt("Your browser doesn't support the Clipboard API","error"),!0}function Sf(t){return t instanceof Error&&t.message.toLowerCase().includes("document is not focused")?(dt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function G_(t){if(!Nf())try{await navigator.clipboard.writeText(JSON.stringify(t.state.value)),dt("Global state copied to clipboard.")}catch(e){if(Sf(e))return;dt("Failed to serialize the state. Check the console for more details.","error"),console.error(e)}}async function J_(t){if(!Nf())try{Tf(t,JSON.parse(await navigator.clipboard.readText())),dt("Global state pasted from clipboard.")}catch(e){if(Sf(e))return;dt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(e)}}async function Y_(t){try{Of(new Blob([JSON.stringify(t.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(e){dt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(e)}}let jn;function X_(){jn||(jn=document.createElement("input"),jn.type="file",jn.accept=".json");function t(){return new Promise((e,n)=>{jn.onchange=async()=>{const r=jn.files;if(!r)return e(null);const s=r.item(0);return e(s?{text:await s.text(),file:s}:null)},jn.oncancel=()=>e(null),jn.onerror=n,jn.click()})}return t}async function Q_(t){try{const n=await X_()();if(!n)return;const{text:r,file:s}=n;Tf(t,JSON.parse(r)),dt(`Global state imported from "${s.name}".`)}catch(e){dt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(e)}}function Tf(t,e){for(const n in e){const r=t.state.value[n];r?Object.assign(r,e[n]):t.state.value[n]=e[n]}}function Qt(t){return{_custom:{display:t}}}const Cf="🍍 Pinia (root)",Ki="_root";function eb(t){return Ml(t)?{id:Ki,label:Cf}:{id:t.$id,label:t.$id}}function tb(t){if(Ml(t)){const n=Array.from(t._s.keys()),r=t._s;return{state:n.map(o=>({editable:!0,key:o,value:t.state.value[o]})),getters:n.filter(o=>r.get(o)._getters).map(o=>{const i=r.get(o);return{editable:!1,key:o,value:i._getters.reduce((a,l)=>(a[l]=i[l],a),{})}})}}const e={state:Object.keys(t.$state).map(n=>({editable:!0,key:n,value:t.$state[n]}))};return t._getters&&t._getters.length&&(e.getters=t._getters.map(n=>({editable:!1,key:n,value:t[n]}))),t._customProperties.size&&(e.customProperties=Array.from(t._customProperties).map(n=>({editable:!0,key:n,value:t[n]}))),e}function nb(t){return t?Array.isArray(t)?t.reduce((e,n)=>(e.keys.push(n.key),e.operations.push(n.type),e.oldValue[n.key]=n.oldValue,e.newValue[n.key]=n.newValue,e),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:Qt(t.type),key:Qt(t.key),oldValue:t.oldValue,newValue:t.newValue}:{}}function rb(t){switch(t){case vn.direct:return"mutation";case vn.patchFunction:return"$patch";case vn.patchObject:return"$patch";default:return"unknown"}}let fs=!0;const Gi=[],Fr="pinia:mutations",Et="pinia",{assign:sb}=Object,Ji=t=>"🍍 "+t;function ob(t,e){bf({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Gi,app:t},n=>{typeof n.now!="function"&&dt("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:Fr,label:"Pinia 🍍",color:15064968}),n.addInspector({id:Et,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{G_(e)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await J_(e),n.sendInspectorTree(Et),n.sendInspectorState(Et)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Y_(e)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Q_(e),n.sendInspectorTree(Et),n.sendInspectorState(Et)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const s=e._s.get(r);s?typeof s.$reset!="function"?dt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(s.$reset(),dt(`Store "${r}" reset.`)):dt(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,s)=>{const o=r.componentInstance&&r.componentInstance.proxy;if(o&&o._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:Ji(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:Ee(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((l,c)=>(l[c]=a.$state[c],l),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Ji(a.$id),key:"getters",editable:!1,value:a._getters.reduce((l,c)=>{try{l[c]=a[c]}catch(u){l[c]=u}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===t&&r.inspectorId===Et){let s=[e];s=s.concat(Array.from(e._s.values())),r.rootNodes=(r.filter?s.filter(o=>"$id"in o?o.$id.toLowerCase().includes(r.filter.toLowerCase()):Cf.toLowerCase().includes(r.filter.toLowerCase())):s).map(eb)}}),globalThis.$pinia=e,n.on.getInspectorState(r=>{if(r.app===t&&r.inspectorId===Et){const s=r.nodeId===Ki?e:e._s.get(r.nodeId);if(!s)return;s&&(r.nodeId!==Ki&&(globalThis.$store=Ee(s)),r.state=tb(s))}}),n.on.editInspectorState((r,s)=>{if(r.app===t&&r.inspectorId===Et){const o=r.nodeId===Ki?e:e._s.get(r.nodeId);if(!o)return dt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Ml(o)?i.unshift("state"):(i.length!==1||!o._customProperties.has(i[0])||i[0]in o.$state)&&i.unshift("$state"),fs=!1,r.set(o,i,r.state.value),fs=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const s=r.type.replace(/^🍍\s*/,""),o=e._s.get(s);if(!o)return dt(`store "${s}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return dt(`Invalid path for store "${s}":
17
+ Expected function or array of functions, received type ${typeof t}.`),nt)}function _y(t,e){if(de(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>s=>!s._stopped&&r&&r(s))}else return e}const tf=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,by=(t,e,n,r,s,o)=>{const i=s==="svg";e==="class"?sy(t,r,i):e==="style"?ly(t,n,r):Ms(e)?Wo(e)||hy(t,e,n,r,o):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):wy(t,e,r,i))?(dy(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Yd(t,e,r,i,o,e!=="value")):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),Yd(t,e,r,i))};function wy(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&tf(e)&&me(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return tf(e)&&Xe(n)?!1:e in t}const Ey=["ctrl","shift","alt","meta"],xy={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Ey.some(n=>t[`${n}Key`]&&!e.includes(n))},ky=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=(s,...o)=>{for(let i=0;i<e.length;i++){const a=xy[e[i]];if(a&&a(s,e))return}return t(s,...o)})},Oy=tt({patchProp:by},Xg);let nf;function Ny(){return nf||(nf=_g(Oy))}const Sy=(...t)=>{const e=Ny().createApp(...t);An.NODE_ENV!=="production"&&(Cy(e),$y(e));const{mount:n}=e;return e.mount=r=>{const s=Py(r);if(!s)return;const o=e._component;!me(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.innerHTML="";const i=n(s,!1,Ty(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},e};function Ty(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Cy(t){Object.defineProperty(t.config,"isNativeTag",{value:e=>km(e)||Om(e)||Nm(e),writable:!1})}function $y(t){{const e=t.config.isCustomElement;Object.defineProperty(t.config,"isCustomElement",{get(){return e},set(){er("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=t.config.compilerOptions,r='The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';Object.defineProperty(t.config,"compilerOptions",{get(){return er(r),n},set(){er(r)}})}}function Py(t){if(Xe(t)){const e=document.querySelector(t);return An.NODE_ENV!=="production"&&!e&&er(`Failed to mount app: mount target selector "${t}" returned null.`),e}return An.NODE_ENV!=="production"&&window.ShadowRoot&&t instanceof window.ShadowRoot&&t.mode==="closed"&&er('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),t}var Iy={};function Ay(){Gg()}Iy.NODE_ENV!=="production"&&Ay();let Pi;const Dy=new Uint8Array(16);function Vy(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(Dy)}const ht=[];for(let t=0;t<256;++t)ht.push((t+256).toString(16).slice(1));function Ry(t,e=0){return ht[t[e+0]]+ht[t[e+1]]+ht[t[e+2]]+ht[t[e+3]]+"-"+ht[t[e+4]]+ht[t[e+5]]+"-"+ht[t[e+6]]+ht[t[e+7]]+"-"+ht[t[e+8]]+ht[t[e+9]]+"-"+ht[t[e+10]]+ht[t[e+11]]+ht[t[e+12]]+ht[t[e+13]]+ht[t[e+14]]+ht[t[e+15]]}const rf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Cl(t,e,n){if(rf.randomUUID&&!e&&!t)return rf.randomUUID();t=t||{};const r=t.random||(t.rng||Vy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ry(r)}var Ue;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},t.getValidEnumValues=s=>{const o=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},t.find=(s,o)=>{for(const i of s)if(o(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(Ue||(Ue={}));var $l;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})($l||($l={}));const se=Ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rr=t=>{switch(typeof t){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(t)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(t)?se.array:t===null?se.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?se.promise:typeof Map<"u"&&t instanceof Map?se.map:typeof Set<"u"&&t instanceof Set?se.set:typeof Date<"u"&&t instanceof Date?se.date:se.object;default:return se.unknown}},H=Ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),jy=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Gt extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return s(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Gt.create=t=>new Gt(t);const co=(t,e)=>{let n;switch(t.code){case H.invalid_type:t.received===se.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case H.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ue.jsonStringifyReplacer)}`;break;case H.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ue.joinValues(t.keys,", ")}`;break;case H.invalid_union:n="Invalid input";break;case H.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ue.joinValues(t.options)}`;break;case H.invalid_enum_value:n=`Invalid enum value. Expected ${Ue.joinValues(t.options)}, received '${t.received}'`;break;case H.invalid_arguments:n="Invalid function arguments";break;case H.invalid_return_type:n="Invalid function return type";break;case H.invalid_date:n="Invalid date";break;case H.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case H.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case H.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case H.custom:n="Invalid input";break;case H.invalid_intersection_types:n="Intersection results could not be merged";break;case H.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case H.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ue.assertNever(t)}return{message:n}};let sf=co;function Ly(t){sf=t}function Ii(){return sf}const Ai=t=>{const{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],i={...s,path:o};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:e,defaultError:a}).message;return{...s,path:o,message:s.message||a}},My=[];function ie(t,e){const n=Ai({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ii(),co].filter(r=>!!r)});t.common.issues.push(n)}class wt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const s of n){if(s.status==="aborted")return Ne;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const s of n)r.push({key:await s.key,value:await s.value});return wt.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const s of n){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Ne;o.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[o.value]=i.value)}return{status:e.value,value:r}}}const Ne=Object.freeze({status:"aborted"}),of=t=>({status:"dirty",value:t}),St=t=>({status:"valid",value:t}),Pl=t=>t.status==="aborted",Il=t=>t.status==="dirty",uo=t=>t.status==="valid",Di=t=>typeof Promise<"u"&&t instanceof Promise;var pe;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(pe||(pe={}));class hn{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const af=(t,e)=>{if(uo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Gt(t.common.issues);return this._error=n,this._error}}};function Ce(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,a)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:s}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return rr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Di(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rr(e)},o=this._parseSync({data:e,path:s.path,parent:s});return af(s,o)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rr(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(Di(s)?s:Promise.resolve(s));return af(r,o)}refine(e,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const i=e(s),a=()=>o.addIssue({code:H.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(e){return new Xt({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Rn.create(this,this._def)}nullable(){return Ur.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yt.create(this,this._def)}promise(){return us.create(this,this._def)}or(e){return mo.create([this,e],this._def)}and(e){return vo.create(this,e,this._def)}transform(e){return new Xt({...Ce(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new wo({...Ce(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new cf({typeName:_e.ZodBranded,type:this,...Ce(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Ui({...Ce(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Eo.create(this,e)}readonly(){return Bi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Uy=/^c[^\s-]{8,}$/i,Zy=/^[a-z][a-z0-9]*$/,By=/^[0-9A-HJKMNP-TV-Z]{26}$/,Fy=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Hy=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,zy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Al;const qy=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Wy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ky=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Gy(t,e){return!!((e==="v4"||!e)&&qy.test(t)||(e==="v6"||!e)&&Wy.test(t))}class Jt extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==se.string){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.string,received:o.parsedType}),Ne}const r=new wt;let s;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=e.data.length>o.value,a=e.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(e,s),i?ie(s,{code:H.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&ie(s,{code:H.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Hy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"email",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Al||(Al=new RegExp(zy,"u")),Al.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"emoji",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Fy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"uuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Uy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Zy.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"cuid2",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")By.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ulid",code:H.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),ie(s,{validation:"url",code:H.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"regex",code:H.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Ky(o).test(e.data)||(s=this._getOrReturnCtx(e,s),ie(s,{code:H.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Gy(e.data,o.version)||(s=this._getOrReturnCtx(e,s),ie(s,{validation:"ip",code:H.invalid_string,message:o.message}),r.dirty()):Ue.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:H.invalid_string,...pe.errToObj(r)})}_addCheck(e){return new Jt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...pe.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...pe.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...pe.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...pe.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...pe.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...pe.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...pe.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...pe.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...pe.errToObj(n)})}nonempty(e){return this.min(1,pe.errToObj(e))}trim(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Jt.create=t=>{var e;return new Jt({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ce(t)})};function Jy(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(t.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class sr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==se.number){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.number,received:o.parsedType}),Ne}let r;const s=new wt;for(const o of this._def.checks)o.kind==="int"?Ue.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:H.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?Jy(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ie(r,{code:H.not_finite,message:o.message}),s.dirty()):Ue.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,r,s){return new sr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:pe.toString(s)}]})}_addCheck(e){return new sr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:pe.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}sr.create=t=>new sr({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ce(t)});class or extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==se.bigint){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.bigint,received:o.parsedType}),Ne}let r;const s=new wt;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ie(r,{code:H.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):Ue.assertNever(o);return{status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,pe.toString(n))}gt(e,n){return this.setLimit("min",e,!1,pe.toString(n))}lte(e,n){return this.setLimit("max",e,!0,pe.toString(n))}lt(e,n){return this.setLimit("max",e,!1,pe.toString(n))}setLimit(e,n,r,s){return new or({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:pe.toString(s)}]})}_addCheck(e){return new or({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:pe.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:pe.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}or.create=t=>{var e;return new or({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ce(t)})};class fo extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==se.boolean){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.boolean,received:r.parsedType}),Ne}return St(e.data)}}fo.create=t=>new fo({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ce(t)});class jr extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==se.date){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_type,expected:se.date,received:o.parsedType}),Ne}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return ie(o,{code:H.invalid_date}),Ne}const r=new wt;let s;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),ie(s,{code:H.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Ue.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new jr({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:pe.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:pe.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}jr.create=t=>new jr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Ce(t)});class Vi extends Pe{_parse(e){if(this._getType(e)!==se.symbol){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.symbol,received:r.parsedType}),Ne}return St(e.data)}}Vi.create=t=>new Vi({typeName:_e.ZodSymbol,...Ce(t)});class po extends Pe{_parse(e){if(this._getType(e)!==se.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.undefined,received:r.parsedType}),Ne}return St(e.data)}}po.create=t=>new po({typeName:_e.ZodUndefined,...Ce(t)});class ho extends Pe{_parse(e){if(this._getType(e)!==se.null){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.null,received:r.parsedType}),Ne}return St(e.data)}}ho.create=t=>new ho({typeName:_e.ZodNull,...Ce(t)});class as extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return St(e.data)}}as.create=t=>new as({typeName:_e.ZodAny,...Ce(t)});class Lr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return St(e.data)}}Lr.create=t=>new Lr({typeName:_e.ZodUnknown,...Ce(t)});class Vn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:H.invalid_type,expected:se.never,received:n.parsedType}),Ne}}Vn.create=t=>new Vn({typeName:_e.ZodNever,...Ce(t)});class Ri extends Pe{_parse(e){if(this._getType(e)!==se.undefined){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.void,received:r.parsedType}),Ne}return St(e.data)}}Ri.create=t=>new Ri({typeName:_e.ZodVoid,...Ce(t)});class Yt extends Pe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==se.array)return ie(n,{code:H.invalid_type,expected:se.array,received:n.parsedType}),Ne;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(i||a)&&(ie(n,{code:i?H.too_big:H.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(ie(n,{code:H.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(ie(n,{code:H.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>s.type._parseAsync(new hn(n,i,n.path,a)))).then(i=>wt.mergeArray(r,i));const o=[...n.data].map((i,a)=>s.type._parseSync(new hn(n,i,n.path,a)));return wt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Yt({...this._def,minLength:{value:e,message:pe.toString(n)}})}max(e,n){return new Yt({...this._def,maxLength:{value:e,message:pe.toString(n)}})}length(e,n){return new Yt({...this._def,exactLength:{value:e,message:pe.toString(n)}})}nonempty(e){return this.min(1,e)}}Yt.create=(t,e)=>new Yt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Ce(e)});function ls(t){if(t instanceof et){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Rn.create(ls(r))}return new et({...t._def,shape:()=>e})}else return t instanceof Yt?new Yt({...t._def,type:ls(t.element)}):t instanceof Rn?Rn.create(ls(t.unwrap())):t instanceof Ur?Ur.create(ls(t.unwrap())):t instanceof mn?mn.create(t.items.map(e=>ls(e))):t}class et extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ue.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==se.object){const c=this._getOrReturnCtx(e);return ie(c,{code:H.invalid_type,expected:se.object,received:c.parsedType}),Ne}const{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Vn&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=o[c],d=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new hn(s,d,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Vn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")a.length>0&&(ie(s,{code:H.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new hn(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>wt.mergeObjectSync(r,c)):wt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return pe.errToObj,new et({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=pe.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new et({...this._def,unknownKeys:"strip"})}passthrough(){return new et({...this._def,unknownKeys:"passthrough"})}extend(e){return new et({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new et({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new et({...this._def,catchall:e})}pick(e){const n={};return Ue.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new et({...this._def,shape:()=>n})}omit(e){const n={};return Ue.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new et({...this._def,shape:()=>n})}deepPartial(){return ls(this)}partial(e){const n={};return Ue.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional()}),new et({...this._def,shape:()=>n})}required(e){const n={};return Ue.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Rn;)o=o._def.innerType;n[r]=o}}),new et({...this._def,shape:()=>n})}keyof(){return lf(Ue.objectKeys(this.shape))}}et.create=(t,e)=>new et({shape:()=>t,unknownKeys:"strip",catchall:Vn.create(),typeName:_e.ZodObject,...Ce(e)}),et.strictCreate=(t,e)=>new et({shape:()=>t,unknownKeys:"strict",catchall:Vn.create(),typeName:_e.ZodObject,...Ce(e)}),et.lazycreate=(t,e)=>new et({shape:t,unknownKeys:"strip",catchall:Vn.create(),typeName:_e.ZodObject,...Ce(e)});class mo extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new Gt(a.ctx.common.issues));return ie(n,{code:H.invalid_union,unionErrors:i}),Ne}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new Gt(l));return ie(n,{code:H.invalid_union,unionErrors:a}),Ne}}get options(){return this._def.options}}mo.create=(t,e)=>new mo({options:t,typeName:_e.ZodUnion,...Ce(e)});const ji=t=>t instanceof yo?ji(t.schema):t instanceof Xt?ji(t.innerType()):t instanceof _o?[t.value]:t instanceof ir?t.options:t instanceof bo?Object.keys(t.enum):t instanceof wo?ji(t._def.innerType):t instanceof po?[void 0]:t instanceof ho?[null]:null;class Li extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.object)return ie(n,{code:H.invalid_type,expected:se.object,received:n.parsedType}),Ne;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:H.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ne)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const s=new Map;for(const o of n){const i=ji(o.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Li({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...Ce(r)})}}function Dl(t,e){const n=rr(t),r=rr(e);if(t===e)return{valid:!0,data:t};if(n===se.object&&r===se.object){const s=Ue.objectKeys(e),o=Ue.objectKeys(t).filter(a=>s.indexOf(a)!==-1),i={...t,...e};for(const a of o){const l=Dl(t[a],e[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===se.array&&r===se.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let o=0;o<t.length;o++){const i=t[o],a=e[o],l=Dl(i,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===se.date&&r===se.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class vo extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=(o,i)=>{if(Pl(o)||Pl(i))return Ne;const a=Dl(o.value,i.value);return a.valid?((Il(o)||Il(i))&&n.dirty(),{status:n.value,value:a.data}):(ie(r,{code:H.invalid_intersection_types}),Ne)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}vo.create=(t,e,n)=>new vo({left:t,right:e,typeName:_e.ZodIntersection,...Ce(n)});class mn extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.array)return ie(r,{code:H.invalid_type,expected:se.array,received:r.parsedType}),Ne;if(r.data.length<this._def.items.length)return ie(r,{code:H.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ne;!this._def.rest&&r.data.length>this._def.items.length&&(ie(r,{code:H.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new hn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>wt.mergeArray(n,i)):wt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new mn({...this._def,rest:e})}}mn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mn({items:t,typeName:_e.ZodTuple,rest:null,...Ce(e)})};class go extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.object)return ie(r,{code:H.invalid_type,expected:se.object,received:r.parsedType}),Ne;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in r.data)s.push({key:o._parse(new hn(r,a,r.path,a)),value:i._parse(new hn(r,r.data[a],r.path,a))});return r.common.async?wt.mergeObjectAsync(n,s):wt.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Pe?new go({keyType:e,valueType:n,typeName:_e.ZodRecord,...Ce(r)}):new go({keyType:Jt.create(),valueType:e,typeName:_e.ZodRecord,...Ce(n)})}}class Mi extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.map)return ie(r,{code:H.invalid_type,expected:se.map,received:r.parsedType}),Ne;const s=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:s._parse(new hn(r,a,r.path,[c,"key"])),value:o._parse(new hn(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ne;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ne;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}Mi.create=(t,e,n)=>new Mi({valueType:e,keyType:t,typeName:_e.ZodMap,...Ce(n)});class Mr extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==se.set)return ie(r,{code:H.invalid_type,expected:se.set,received:r.parsedType}),Ne;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(ie(r,{code:H.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(ie(r,{code:H.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ne;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new hn(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(e,n){return new Mr({...this._def,minSize:{value:e,message:pe.toString(n)}})}max(e,n){return new Mr({...this._def,maxSize:{value:e,message:pe.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Mr.create=(t,e)=>new Mr({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Ce(e)});class cs extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.function)return ie(n,{code:H.invalid_type,expected:se.function,received:n.parsedType}),Ne;function r(a,l){return Ai({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ii(),co].filter(c=>!!c),issueData:{code:H.invalid_arguments,argumentsError:l}})}function s(a,l){return Ai({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ii(),co].filter(c=>!!c),issueData:{code:H.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof us){const a=this;return St(async function(...l){const c=new Gt([]),u=await a._def.args.parseAsync(l,o).catch(m=>{throw c.addIssue(r(l,m)),c}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(m=>{throw c.addIssue(s(d,m)),c})})}else{const a=this;return St(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new Gt([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Gt([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new cs({...this._def,args:mn.create(e).rest(Lr.create())})}returns(e){return new cs({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new cs({args:e||mn.create([]).rest(Lr.create()),returns:n||Lr.create(),typeName:_e.ZodFunction,...Ce(r)})}}class yo extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}yo.create=(t,e)=>new yo({getter:t,typeName:_e.ZodLazy,...Ce(e)});class _o extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:H.invalid_literal,expected:this._def.value}),Ne}return{status:"valid",value:e.data}}get value(){return this._def.value}}_o.create=(t,e)=>new _o({value:t,typeName:_e.ZodLiteral,...Ce(e)});function lf(t,e){return new ir({values:t,typeName:_e.ZodEnum,...Ce(e)})}class ir extends Pe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{expected:Ue.joinValues(r),received:n.parsedType,code:H.invalid_type}),Ne}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return ie(n,{received:n.data,code:H.invalid_enum_value,options:r}),Ne}return St(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return ir.create(e)}exclude(e){return ir.create(this.options.filter(n=>!e.includes(n)))}}ir.create=lf;class bo extends Pe{_parse(e){const n=Ue.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==se.string&&r.parsedType!==se.number){const s=Ue.objectValues(n);return ie(r,{expected:Ue.joinValues(s),received:r.parsedType,code:H.invalid_type}),Ne}if(n.indexOf(e.data)===-1){const s=Ue.objectValues(n);return ie(r,{received:r.data,code:H.invalid_enum_value,options:s}),Ne}return St(e.data)}get enum(){return this._def.values}}bo.create=(t,e)=>new bo({values:t,typeName:_e.ZodNativeEnum,...Ce(e)});class us extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==se.promise&&n.common.async===!1)return ie(n,{code:H.invalid_type,expected:se.promise,received:n.parsedType}),Ne;const r=n.parsedType===se.promise?n.data:Promise.resolve(n.data);return St(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}us.create=(t,e)=>new us({type:t,typeName:_e.ZodPromise,...Ce(e)});class Xt extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:i=>{ie(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(i).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:i,path:r.path,parent:r})}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ne:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ne:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!uo(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>uo(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:n.value,value:a})):i);Ue.assertNever(s)}}Xt.create=(t,e,n)=>new Xt({schema:t,typeName:_e.ZodEffects,effect:e,...Ce(n)}),Xt.createWithPreprocess=(t,e,n)=>new Xt({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Ce(n)});class Rn extends Pe{_parse(e){return this._getType(e)===se.undefined?St(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Rn.create=(t,e)=>new Rn({innerType:t,typeName:_e.ZodOptional,...Ce(e)});class Ur extends Pe{_parse(e){return this._getType(e)===se.null?St(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ur.create=(t,e)=>new Ur({innerType:t,typeName:_e.ZodNullable,...Ce(e)});class wo extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===se.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}wo.create=(t,e)=>new wo({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ce(e)});class Ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Di(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Gt(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Gt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ui.create=(t,e)=>new Ui({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ce(e)});class Zi extends Pe{_parse(e){if(this._getType(e)!==se.nan){const r=this._getOrReturnCtx(e);return ie(r,{code:H.invalid_type,expected:se.nan,received:r.parsedType}),Ne}return{status:"valid",value:e.data}}}Zi.create=t=>new Zi({typeName:_e.ZodNaN,...Ce(t)});const Yy=Symbol("zod_brand");class cf extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Eo extends Pe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ne:o.status==="dirty"?(n.dirty(),of(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ne:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new Eo({in:e,out:n,typeName:_e.ZodPipeline})}}class Bi extends Pe{_parse(e){const n=this._def.innerType._parse(e);return uo(n)&&(n.value=Object.freeze(n.value)),n}}Bi.create=(t,e)=>new Bi({innerType:t,typeName:_e.ZodReadonly,...Ce(e)});const uf=(t,e={},n)=>t?as.create().superRefine((r,s)=>{var o,i;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&i!==void 0?i:!0,c=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...c,fatal:l})}}):as.create(),Xy={object:et.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const Qy=(t,e={message:`Input not instance of ${t.name}`})=>uf(n=>n instanceof t,e),df=Jt.create,ff=sr.create,e_=Zi.create,t_=or.create,pf=fo.create,n_=jr.create,r_=Vi.create,s_=po.create,o_=ho.create,i_=as.create,a_=Lr.create,l_=Vn.create,c_=Ri.create,u_=Yt.create,d_=et.create,f_=et.strictCreate,p_=mo.create,h_=Li.create,m_=vo.create,v_=mn.create,g_=go.create,y_=Mi.create,__=Mr.create,b_=cs.create,w_=yo.create,E_=_o.create,x_=ir.create,k_=bo.create,O_=us.create,hf=Xt.create,N_=Rn.create,S_=Ur.create,T_=Xt.createWithPreprocess,C_=Eo.create;var ar=Object.freeze({__proto__:null,defaultErrorMap:co,setErrorMap:Ly,getErrorMap:Ii,makeIssue:Ai,EMPTY_PATH:My,addIssueToContext:ie,ParseStatus:wt,INVALID:Ne,DIRTY:of,OK:St,isAborted:Pl,isDirty:Il,isValid:uo,isAsync:Di,get util(){return Ue},get objectUtil(){return $l},ZodParsedType:se,getParsedType:rr,ZodType:Pe,ZodString:Jt,ZodNumber:sr,ZodBigInt:or,ZodBoolean:fo,ZodDate:jr,ZodSymbol:Vi,ZodUndefined:po,ZodNull:ho,ZodAny:as,ZodUnknown:Lr,ZodNever:Vn,ZodVoid:Ri,ZodArray:Yt,ZodObject:et,ZodUnion:mo,ZodDiscriminatedUnion:Li,ZodIntersection:vo,ZodTuple:mn,ZodRecord:go,ZodMap:Mi,ZodSet:Mr,ZodFunction:cs,ZodLazy:yo,ZodLiteral:_o,ZodEnum:ir,ZodNativeEnum:bo,ZodPromise:us,ZodEffects:Xt,ZodTransformer:Xt,ZodOptional:Rn,ZodNullable:Ur,ZodDefault:wo,ZodCatch:Ui,ZodNaN:Zi,BRAND:Yy,ZodBranded:cf,ZodPipeline:Eo,ZodReadonly:Bi,custom:uf,Schema:Pe,ZodSchema:Pe,late:Xy,get ZodFirstPartyTypeKind(){return _e},coerce:{string:t=>Jt.create({...t,coerce:!0}),number:t=>sr.create({...t,coerce:!0}),boolean:t=>fo.create({...t,coerce:!0}),bigint:t=>or.create({...t,coerce:!0}),date:t=>jr.create({...t,coerce:!0})},any:i_,array:u_,bigint:t_,boolean:pf,date:n_,discriminatedUnion:h_,effect:hf,enum:x_,function:b_,instanceof:Qy,intersection:m_,lazy:w_,literal:E_,map:y_,nan:e_,nativeEnum:k_,never:l_,null:o_,nullable:S_,number:ff,object:d_,oboolean:()=>pf().optional(),onumber:()=>ff().optional(),optional:N_,ostring:()=>df().optional(),pipeline:C_,preprocess:T_,promise:O_,record:g_,set:__,strictObject:f_,string:df,symbol:r_,transformer:hf,tuple:v_,undefined:s_,union:p_,unknown:a_,void:c_,NEVER:Ne,ZodIssueCode:H,quotelessJson:jy,ZodError:Gt}),lr=Symbol("storefront");function $_(t,e=100){let n=0;return async(...s)=>{clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}var P_=ar.object({source:ar.literal("moonbase-checkout"),event:ar.literal("close"),intent:ar.string().optional()}),I_=ar.object({source:ar.literal("moonbase-checkout"),event:ar.literal("completed")}),A_=ar.discriminatedUnion("event",[P_,I_]);function mf(t){if(typeof window>"u"){console.warn("Can not mount checkout server side");return}const e=document.createElement("iframe");e.id="moonbase-checkout",e.src=t,e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.right="0px",e.style.border="none",e.style.colorScheme="normal",e.style.backgroundColor="transparent",e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.setAttribute("background","transparent"),e.setAttribute("frameborder","0"),e.setAttribute("allowtransparency","true"),e.setAttribute("allow","payment"),e.height="100%",e.width="100%",document.body.append(e),document.documentElement.style.overflow="hidden",window.onmessage=function(n){var r;try{const s=A_.parse(n.data);s.event==="close"&&(document.body.contains(e)&&(document.documentElement.style.removeProperty("overflow"),document.body.removeChild(e)),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:s}))),s.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:s}))}catch(s){((r=n.data)==null?void 0:r.source)==="moonbase-checkout"&&console.error("Could not parse event:",n.data,s)}}}var Fi=class gt{constructor(e,n,r){this.configuration=e,this.client=n,this.stateFactory=r,this.hasUtm=ee(()=>!!this.utm.value&&Object.values(this.utm.value).some(l=>!!l)),this.currentUser=C(null),this.loadedUser=C(!1),this.debouncedPushOrderContent=$_(l=>this.client.orders.pushContent(l,void 0,this.hasUtm.value?this.utm.value:void 0),500);var s;if(typeof window>"u"){this.currentOrder=C({id:Cl(),status:js.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(gt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${gt.storefrontKey}_loaded`,!1),this.utm=r(`${gt.storefrontKey}_utm`,void 0);return}const o=new URLSearchParams(window.location.search);this.utm=r(`${gt.storefrontKey}_utm`,{referrer:((s=window.document.referrer)==null?void 0:s.replace(/https?:\/\//g,"").split("/")[0])||void 0,source:o.get("utm_source")||void 0,medium:o.get("utm_medium")||void 0,campaign:o.get("utm_campaign")||void 0,term:o.get("utm_term")||void 0,content:o.get("utm_content")||void 0}),window.addEventListener("storage",l=>this.handleStorageUpdate(l));const i=localStorage.getItem(gt.sessionKey);i?(this.currentOrder=C(JSON.parse(i)),this.refreshOrder()):this.currentOrder=C({id:Cl(),status:js.Open,currency:"",items:[],couponsApplied:[]});const a=localStorage.getItem(gt.storefrontKey);if(a?(this.storefront=r(gt.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${gt.storefrontKey}_loaded`,!0)):(this.storefront=r(gt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${gt.storefrontKey}_loaded`,!1)),this.client.tokenStore.hasAccessToken&&(this.currentUser.value=this.client.tokenStore.user),this.updateStorefront(),this.updateUser(),window.location){const l=new URLSearchParams(window.location.search),c=l.get("mb_intent"),u=l.get("mb_endpoint");if(c==="checkout"&&l.get("mb_complete")&&u){const d=Object.fromEntries([...l.entries()].filter(([m])=>!m.startsWith("mb_"))),f=new URL(decodeURIComponent(u));for(const m of Object.keys(d))f.searchParams.append(m,d[m]);mf(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",()=>this.resetOrder())}get loadedStorefrontPromise(){return new Promise(e=>{lt(this.loadedStorefront,n=>{n&&e()},{immediate:!0})})}get loadedUserPromise(){return new Promise(e=>{lt(this.loadedUser,n=>{n&&e()},{immediate:!0})})}onCheckoutCompleted(e){window.addEventListener("moonbase-checkout-completed",()=>e())}onCheckoutClosed(e){window.addEventListener("moonbase-checkout-closed",n=>e(n.detail.intent))}install(e){e.provide(lr,this),console.log("Moonbase.sh storefront installed, learn more at https://moonbase.sh/docs")}async updateUser(){try{this.currentUser.value=await this.client.identity.get()}catch(e){e instanceof xa||console.error("Could not load user",e)}finally{this.loadedUser.value=!0}}async updateStorefront(){const e=await this.client.storefront.get(this.hasUtm.value?this.utm.value:void 0);e&&(typeof window<"u"&&localStorage.setItem(gt.storefrontKey,JSON.stringify(e)),this.storefront.value=e,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=e.suggestedCurrency))}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(gt.sessionKey,JSON.stringify(this.currentOrder.value)),this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(e){switch(e.key){case gt.sessionKey:this.currentOrder.value=JSON.parse(e.newValue);break;case gt.storefrontKey:this.storefront.value=JSON.parse(e.newValue);break}}async refreshOrder(){try{const e=await this.client.orders.get(this.currentOrder.value.id);e&&(e.status!==js.Open?this.resetOrder():(typeof window<"u"&&localStorage.setItem(gt.sessionKey,JSON.stringify(e)),this.currentOrder.value=e))}catch(e){e!=null&&this.resetOrder()}}resetOrder(){var e;this.currentOrder.value={id:Cl(),currency:((e=this.storefront.value)==null?void 0:e.suggestedCurrency)||"",status:js.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(gt.sessionKey)}};Fi.userKey="moonbase_user",Fi.sessionKey="moonbase_session",Fi.storefrontKey="moonbase_storefront";var D_=Fi;function vf(t,e){const n=e??Me(lr);if(!n)throw new Error("No storefront configured");return ee(()=>n.storefront.value.bundles.find(r=>r.id===t)||null)}function gf(t,e){const n=e??Me(lr);if(!n)throw new Error("No storefront configured");return ee(()=>n.storefront.value.products.find(r=>r.id===t)||null)}function Hi(t){const e=Me(lr);if(!e)throw new Error("No storefront configured");return{getLicenses:async n=>e.client.inventory.licenses.get(n),getLicenseActivations:async(n,r)=>e.client.inventory.licenses.getActivations(n,r),getProduct:async(n,r)=>e.client.inventory.products.get(n,r),getProducts:async n=>e.client.inventory.products.getOwned(n),getProductLicenses:async(n,r)=>e.client.inventory.products.getLicenses(n,r),getProductActivations:async(n,r)=>e.client.inventory.products.getActivations(n,r),revokeActivation:async n=>e.client.inventory.licenses.revokeActivation(n.licenseId,n.id),activateProduct:async(n,r)=>e.client.inventory.activation.activate(n,r),downloadProduct:async n=>{if(!n.path)throw new Error("Product is not downloadable");window.location.href=await e.client.inventory.products.getDownloadUrl(n.path)}}}function V_(t,e){const n=Me(lr),r=tv(t);if(!r)throw new Error("No request ID was given when calling `useActivationRequest`");if(!n)throw new Error("No storefront configured");const s=n.stateFactory(`activation-request-${r}`,null),o=n.stateFactory(`activation-request-${r}-error`,null),i=n.stateFactory(`activation-request-${r}-loading`,!0),a=n.stateFactory(`activation-request-${r}-fulfilling`,!1),l=n.stateFactory(`activation-request-${r}-completing`,!1),c=n.stateFactory(`activation-request-${r}-completion-timeout`,null),u=async()=>{await n.client.activationRequests.isCompleted(r)&&s.value?(s.value.status=on.Completed,l.value=!1):c.value=setTimeout(u,1500)};return r&&r.length>0?n.client.activationRequests.get(r).then(d=>{s.value=d,s.value.status===on.Fulfilled&&(l.value=!0,u()),i.value=!1}).catch(d=>{o.value=d,i.value=!1}):(o.value=new Error("Missing request id"),i.value=!1),el(()=>{c.value&&clearTimeout(c.value)}),lt(n.currentUser,async()=>{var d,f;if(!(!r||(f=(d=s.value)==null?void 0:d.licenseEligibility)!=null&&f.eligible)){i.value=!0;try{s.value=await n.client.activationRequests.get(r),s.value.status===on.Fulfilled&&(l.value=!0,u())}catch(m){o.value=m}i.value=!1}}),{activationRequest:s,loading:i,fulfilling:a,completing:l,error:o,isInstalled:ee(()=>{var d;return s&&((d=s.value)==null?void 0:d.status)===on.Completed}),fulfillLicense:async()=>{a.value=!0,s.value=await n.client.activationRequests.fulfillLicense(r),a.value=!1,l.value=!0,u()},fulfillTrial:async()=>{a.value=!0,s.value=await n.client.activationRequests.fulfillTrial(r),a.value=!1,l.value=!0,u()},cancel:async()=>{var d;((d=s.value)==null?void 0:d.status)!==on.Cancelled&&(s.value=await n.client.activationRequests.cancel(r))}}}function R_(t){const e=Me(lr);if(!e)throw new Error("No storefront configured");return{peek:async n=>{try{return await e.client.vouchers.peek(n)}catch(r){throw r instanceof rs?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await e.client.vouchers.redeem(n)}catch(r){throw r instanceof rs?new Error("Voucher code invalid"):r}}}}function Vl(t){const e=t??Me(lr);if(!e)throw new Error("No storefront configured");return{items:ee(()=>e.currentOrder.value.items.map(n=>{var r,s;if(n.type==="Product"){const o=e.storefront.value.products.find(l=>l.id===n.productId),a=((o==null?void 0:o.variations)||[]).find(l=>l.id===n.variationId);return{...n,product:o,variation:a,price:a==null?void 0:a.price,appliedDiscount:(r=a==null?void 0:a.discount)!=null?r:n.appliedDiscount}}else{const o=e.storefront.value.bundles.find(l=>l.id===n.bundleId),a=((o==null?void 0:o.variations)||[]).find(l=>l.id===n.variationId);return{...n,bundle:o,variation:a,price:a==null?void 0:a.price,appliedDiscount:(s=a==null?void 0:a.discount)!=null?s:n.appliedDiscount}}})),currency:ee(()=>e.currentOrder.value.currency||e.storefront.value.suggestedCurrency),total:ee(()=>{const n=e.currentOrder.value.currency||e.storefront.value.suggestedCurrency;return{amount:e.currentOrder.value.items.reduce((s,o)=>{var i,a,l,c,u,d;let f;if(o.type==="Product"){const m=e.storefront.value.products.find(k=>k.id===o.productId),E=((m==null?void 0:m.variations)||[]).find(k=>k.id===o.variationId);f=(l=(a=E==null?void 0:E.price[n])!=null?a:(i=m==null?void 0:m.defaultVariation)==null?void 0:i.price[n])!=null?l:0}else{const m=e.storefront.value.bundles.find(k=>k.id===o.bundleId),E=((m==null?void 0:m.variations)||[]).find(k=>k.id===o.variationId);f=(d=(u=E==null?void 0:E.price[n])!=null?u:(c=m==null?void 0:m.defaultVariation)==null?void 0:c.price[n])!=null?d:0}return s+f*o.quantity},0),currency:n}}),addToCart:(n,r)=>{if(n=b(n),r??(r=n.defaultVariation),!r)throw new Error("Added item does not have a default variation, and none have been specified");const s=`${n.type==="bundle"?"b":"p"}/${n.id}/${r.id}`;let o=e.currentOrder.value.items.find(i=>i.id===s);o?o.quantity+=1:n.type==="bundle"?(o={id:s,type:"Bundle",bundleId:n.id,bundle:n,quantity:1,variation:r,variationId:r.id,price:r.price,appliedDiscount:r.discount},e.currentOrder.value.items.push(o)):n.type==="product"&&(o={id:s,type:"Product",productId:n.id,product:n,quantity:1,variation:r,variationId:r.id,price:r.price,appliedDiscount:r.discount},e.currentOrder.value.items.push(o)),e.pushOrderContent()},setQuantity:(n,r)=>{const s=e.currentOrder.value.items.find(o=>o.id===n.id);if(!s)throw new Error("Cart item not found");if(s.quantity=r,s.quantity<=0){const o=e.currentOrder.value.items.findIndex(i=>i.id===s.id);e.currentOrder.value.items.splice(o,1)}e.pushOrderContent()},removeFromCart:n=>{const r=e.currentOrder.value.items.findIndex(s=>s.id===n.id);e.currentOrder.value.items.splice(r,1),e.pushOrderContent()},checkout:async n=>{const r=new URL(n,document.baseURI).href,s=await e.client.orders.pushContent(e.currentOrder.value,{returnUrl:r});if(s.embeddedCheckoutUrl&&typeof window<"u"){const o=s.embeddedCheckoutUrl;return new Promise(i=>{mf(o.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",a=>{i({next:a.detail.next})})})}else{if(s.checkoutUrl&&typeof window<"u")return window.location.href=s.checkoutUrl,{next:void 0};throw new Error("No checkout URL found")}}}}function It(t){const e=t??Me(lr);if(!e)throw new Error("No storefront configured");return{user:e.currentUser,loaded:e.loadedUser,loadedPromise:e.loadedUserPromise,signIn:async(n,r)=>{const s=await e.client.identity.signIn(n,r);return e.currentUser.value=s,e.updateStorefront(),s},signUp:async(n,r,s,o,i,a,l)=>{const c=await e.client.identity.signUp(n,r,s,o,i,a,l);return e.currentUser.value=c,e.updateStorefront(),c},signOut:async()=>{e.client.tokenStore.setUser(null),await e.updateStorefront(),e.currentUser.value=null},update:async(n,r,s,o)=>{const i=await e.client.identity.update(n,r,s,o);return e.currentUser.value&&(e.currentUser.value.name=n,o&&(e.currentUser.value.communicationPreferences=o)),i},setPassword:async(n,r)=>{await e.client.identity.setPassword(n,r)},forgotPassword:async n=>{await e.client.identity.forgotPassword(n)},resetPassword:async(n,r,s)=>{await e.client.identity.resetPassword(n,r,s)},confirmAccount:async(n,r)=>await e.client.identity.confirmAccount(n,r),confirmEmail:async(n,r)=>await e.client.identity.confirmEmail(n,r),confirmEmailChange:async(n,r)=>{await e.client.identity.confirmEmailChange(n,r),e.updateUser()}}}function j_(t,e){const n={endpoint:t};return new D_(n,new cm(n),(r,s)=>C(s))}var yf=!1;function zi(t,e,n){return Array.isArray(t)?(t.length=Math.max(t.length,e),t.splice(e,1,n),n):(t[e]=n,n)}function Rl(t,e){if(Array.isArray(t)){t.splice(e,1);return}delete t[e]}function L_(){return _f().__VUE_DEVTOOLS_GLOBAL_HOOK__}function _f(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const M_=typeof Proxy=="function",U_="devtools-plugin:setup",Z_="plugin:settings:set";let ds,jl;function B_(){var t;return ds!==void 0||(typeof window<"u"&&window.performance?(ds=!0,jl=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(ds=!0,jl=globalThis.perf_hooks.performance):ds=!1),ds}function F_(){return B_()?jl.now():Date.now()}class H_{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const i in e.settings){const a=e.settings[i];r[i]=a.defaultValue}const s=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const i=localStorage.getItem(s),a=JSON.parse(i);Object.assign(o,a)}catch{}this.fallbacks={getSettings(){return o},setSettings(i){try{localStorage.setItem(s,JSON.stringify(i))}catch{}o=i},now(){return F_()}},n&&n.on(Z_,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(c=>{this.targetQueue.push({method:a,args:l,resolve:c})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function bf(t,e){const n=t,r=_f(),s=L_(),o=M_&&n.enableEarlyProxy;if(s&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))s.emit(U_,t,e);else{const i=o?new H_(n,s):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:i}),i&&e(i.proxiedTarget)}}var Le={};let xo;const ko=t=>xo=t,wf=Le.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function Zr(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var vn;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(vn||(vn={}));const Br=typeof window<"u",Ef=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function z_(t,{autoBom:e=!1}={}){return e&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function Ll(t,e,n){const r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){Of(r.response,e,n)},r.onerror=function(){console.error("could not download file")},r.send()}function xf(t){const e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function qi(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(n)}}const Wi=typeof navigator=="object"?navigator:{userAgent:""},kf=/Macintosh/.test(Wi.userAgent)&&/AppleWebKit/.test(Wi.userAgent)&&!/Safari/.test(Wi.userAgent),Of=Br?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!kf?q_:"msSaveOrOpenBlob"in Wi?W_:K_:()=>{};function q_(t,e="download",n){const r=document.createElement("a");r.download=e,r.rel="noopener",typeof t=="string"?(r.href=t,r.origin!==location.origin?xf(r.href)?Ll(t,e,n):(r.target="_blank",qi(r)):qi(r)):(r.href=URL.createObjectURL(t),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){qi(r)},0))}function W_(t,e="download",n){if(typeof t=="string")if(xf(t))Ll(t,e,n);else{const r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){qi(r)})}else navigator.msSaveOrOpenBlob(z_(t,n),e)}function K_(t,e,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return Ll(t,e,n);const s=t.type==="application/octet-stream",o=/constructor/i.test(String(Ef.HTMLElement))||"safari"in Ef,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||s&&o||kf)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let l=a.result;if(typeof l!="string")throw r=null,new Error("Wrong reader.result type");l=i?l:l.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=l:location.assign(l),r=null},a.readAsDataURL(t)}else{const a=URL.createObjectURL(t);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function dt(t,e){const n="🍍 "+t;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,e):e==="error"?console.error(n):e==="warn"?console.warn(n):console.log(n)}function Ml(t){return"_a"in t&&"install"in t}function Nf(){if(!("clipboard"in navigator))return dt("Your browser doesn't support the Clipboard API","error"),!0}function Sf(t){return t instanceof Error&&t.message.toLowerCase().includes("document is not focused")?(dt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function G_(t){if(!Nf())try{await navigator.clipboard.writeText(JSON.stringify(t.state.value)),dt("Global state copied to clipboard.")}catch(e){if(Sf(e))return;dt("Failed to serialize the state. Check the console for more details.","error"),console.error(e)}}async function J_(t){if(!Nf())try{Tf(t,JSON.parse(await navigator.clipboard.readText())),dt("Global state pasted from clipboard.")}catch(e){if(Sf(e))return;dt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(e)}}async function Y_(t){try{Of(new Blob([JSON.stringify(t.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(e){dt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(e)}}let jn;function X_(){jn||(jn=document.createElement("input"),jn.type="file",jn.accept=".json");function t(){return new Promise((e,n)=>{jn.onchange=async()=>{const r=jn.files;if(!r)return e(null);const s=r.item(0);return e(s?{text:await s.text(),file:s}:null)},jn.oncancel=()=>e(null),jn.onerror=n,jn.click()})}return t}async function Q_(t){try{const n=await X_()();if(!n)return;const{text:r,file:s}=n;Tf(t,JSON.parse(r)),dt(`Global state imported from "${s.name}".`)}catch(e){dt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(e)}}function Tf(t,e){for(const n in e){const r=t.state.value[n];r?Object.assign(r,e[n]):t.state.value[n]=e[n]}}function Qt(t){return{_custom:{display:t}}}const Cf="🍍 Pinia (root)",Ki="_root";function eb(t){return Ml(t)?{id:Ki,label:Cf}:{id:t.$id,label:t.$id}}function tb(t){if(Ml(t)){const n=Array.from(t._s.keys()),r=t._s;return{state:n.map(o=>({editable:!0,key:o,value:t.state.value[o]})),getters:n.filter(o=>r.get(o)._getters).map(o=>{const i=r.get(o);return{editable:!1,key:o,value:i._getters.reduce((a,l)=>(a[l]=i[l],a),{})}})}}const e={state:Object.keys(t.$state).map(n=>({editable:!0,key:n,value:t.$state[n]}))};return t._getters&&t._getters.length&&(e.getters=t._getters.map(n=>({editable:!1,key:n,value:t[n]}))),t._customProperties.size&&(e.customProperties=Array.from(t._customProperties).map(n=>({editable:!0,key:n,value:t[n]}))),e}function nb(t){return t?Array.isArray(t)?t.reduce((e,n)=>(e.keys.push(n.key),e.operations.push(n.type),e.oldValue[n.key]=n.oldValue,e.newValue[n.key]=n.newValue,e),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:Qt(t.type),key:Qt(t.key),oldValue:t.oldValue,newValue:t.newValue}:{}}function rb(t){switch(t){case vn.direct:return"mutation";case vn.patchFunction:return"$patch";case vn.patchObject:return"$patch";default:return"unknown"}}let fs=!0;const Gi=[],Fr="pinia:mutations",Et="pinia",{assign:sb}=Object,Ji=t=>"🍍 "+t;function ob(t,e){bf({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Gi,app:t},n=>{typeof n.now!="function"&&dt("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:Fr,label:"Pinia 🍍",color:15064968}),n.addInspector({id:Et,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{G_(e)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await J_(e),n.sendInspectorTree(Et),n.sendInspectorState(Et)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Y_(e)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Q_(e),n.sendInspectorTree(Et),n.sendInspectorState(Et)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const s=e._s.get(r);s?typeof s.$reset!="function"?dt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(s.$reset(),dt(`Store "${r}" reset.`)):dt(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,s)=>{const o=r.componentInstance&&r.componentInstance.proxy;if(o&&o._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:Ji(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:Ee(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((l,c)=>(l[c]=a.$state[c],l),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Ji(a.$id),key:"getters",editable:!1,value:a._getters.reduce((l,c)=>{try{l[c]=a[c]}catch(u){l[c]=u}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===t&&r.inspectorId===Et){let s=[e];s=s.concat(Array.from(e._s.values())),r.rootNodes=(r.filter?s.filter(o=>"$id"in o?o.$id.toLowerCase().includes(r.filter.toLowerCase()):Cf.toLowerCase().includes(r.filter.toLowerCase())):s).map(eb)}}),globalThis.$pinia=e,n.on.getInspectorState(r=>{if(r.app===t&&r.inspectorId===Et){const s=r.nodeId===Ki?e:e._s.get(r.nodeId);if(!s)return;s&&(r.nodeId!==Ki&&(globalThis.$store=Ee(s)),r.state=tb(s))}}),n.on.editInspectorState((r,s)=>{if(r.app===t&&r.inspectorId===Et){const o=r.nodeId===Ki?e:e._s.get(r.nodeId);if(!o)return dt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Ml(o)?i.unshift("state"):(i.length!==1||!o._customProperties.has(i[0])||i[0]in o.$state)&&i.unshift("$state"),fs=!1,r.set(o,i,r.state.value),fs=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const s=r.type.replace(/^🍍\s*/,""),o=e._s.get(s);if(!o)return dt(`store "${s}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return dt(`Invalid path for store "${s}":
18
18
  ${i}
19
19
  Only state can be modified.`);i[0]="$state",fs=!1,r.set(o,i,r.state.value),fs=!0}})})}function ib(t,e){Gi.includes(Ji(e.$id))||Gi.push(Ji(e.$id)),bf({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Gi,app:t,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const r=typeof n.now=="function"?n.now.bind(n):Date.now;e.$onAction(({after:i,onError:a,name:l,args:c})=>{const u=$f++;n.addTimelineEvent({layerId:Fr,event:{time:r(),title:"πŸ›« "+l,subtitle:"start",data:{store:Qt(e.$id),action:Qt(l),args:c},groupId:u}}),i(d=>{cr=void 0,n.addTimelineEvent({layerId:Fr,event:{time:r(),title:"πŸ›¬ "+l,subtitle:"end",data:{store:Qt(e.$id),action:Qt(l),args:c,result:d},groupId:u}})}),a(d=>{cr=void 0,n.addTimelineEvent({layerId:Fr,event:{time:r(),logType:"error",title:"πŸ’₯ "+l,subtitle:"end",data:{store:Qt(e.$id),action:Qt(l),args:c,error:d},groupId:u}})})},!0),e._customProperties.forEach(i=>{lt(()=>b(e[i]),(a,l)=>{n.notifyComponentUpdate(),n.sendInspectorState(Et),fs&&n.addTimelineEvent({layerId:Fr,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:l},groupId:cr}})},{deep:!0})}),e.$subscribe(({events:i,type:a},l)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(Et),!fs)return;const c={time:r(),title:rb(a),data:sb({store:Qt(e.$id)},nb(i)),groupId:cr};a===vn.patchFunction?c.subtitle="‡️":a===vn.patchObject?c.subtitle="🧩":i&&!Array.isArray(i)&&(c.subtitle=i.type),i&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:Fr,event:c})},{detached:!0,flush:"sync"});const s=e._hotUpdate;e._hotUpdate=Kn(i=>{s(i),n.addTimelineEvent({layerId:Fr,event:{time:r(),title:"πŸ”₯ "+e.$id,subtitle:"HMR update",data:{store:Qt(e.$id),info:Qt("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(Et),n.sendInspectorState(Et)});const{$dispose:o}=e;e.$dispose=()=>{o(),n.notifyComponentUpdate(),n.sendInspectorTree(Et),n.sendInspectorState(Et),n.getSettings().logStoreChanges&&dt(`Disposed "${e.$id}" store πŸ—‘`)},n.notifyComponentUpdate(),n.sendInspectorTree(Et),n.sendInspectorState(Et),n.getSettings().logStoreChanges&&dt(`"${e.$id}" store installed πŸ†•`)})}let $f=0,cr;function Pf(t,e,n){const r=e.reduce((s,o)=>(s[o]=Ee(t)[o],s),{});for(const s in r)t[s]=function(){const o=$f,i=n?new Proxy(t,{get(...l){return cr=o,Reflect.get(...l)},set(...l){return cr=o,Reflect.set(...l)}}):t;cr=o;const a=r[s].apply(i,arguments);return cr=void 0,a}}function ab({app:t,store:e,options:n}){if(!e.$id.startsWith("__hot:")){if(e._isOptionsAPI=!!n.state,!e._p._testing){Pf(e,Object.keys(n.actions),e._isOptionsAPI);const r=e._hotUpdate;Ee(e)._hotUpdate=function(s){r.apply(this,arguments),Pf(e,Object.keys(s._hmrPayload.actions),!!e._isOptionsAPI)}}ib(t,e)}}function lb(){const t=Qc(!0),e=t.run(()=>C({}));let n=[],r=[];const s=Kn({install(o){ko(s),s._a=o,o.provide(wf,s),o.config.globalProperties.$pinia=s,Le.NODE_ENV!=="production"&&Le.NODE_ENV!=="test"&&Br&&ob(o,s),r.forEach(i=>n.push(i)),r=[]},use(o){return!this._a&&!yf?r.push(o):n.push(o),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return Le.NODE_ENV!=="production"&&Le.NODE_ENV!=="test"&&typeof Proxy<"u"&&s.use(ab),s}function If(t,e){for(const n in e){const r=e[n];if(!(n in t))continue;const s=t[n];Zr(s)&&Zr(r)&&!Qe(r)&&!Nn(r)?t[n]=If(s,r):t[n]=r}return t}const Af=()=>{};function Df(t,e,n,r=Af){t.push(e);const s=()=>{const o=t.indexOf(e);o>-1&&(t.splice(o,1),r())};return!n&&eu()&&Cm(s),s}function ps(t,...e){t.slice().forEach(n=>{n(...e)})}const cb=t=>t(),Vf=Symbol(),Ul=Symbol();function Zl(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,r)=>t.set(r,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],s=t[n];Zr(s)&&Zr(r)&&t.hasOwnProperty(n)&&!Qe(r)&&!Nn(r)?t[n]=Zl(s,r):t[n]=r}return t}const ub=Le.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function db(t){return!Zr(t)||!t.hasOwnProperty(ub)}const{assign:Bt}=Object;function Rf(t){return!!(Qe(t)&&t.effect)}function jf(t,e,n,r){const{state:s,actions:o,getters:i}=e,a=n.state.value[t];let l;function c(){!a&&(Le.NODE_ENV==="production"||!r)&&(n.state.value[t]=s?s():{});const u=Le.NODE_ENV!=="production"&&r?Su(C(s?s():{}).value):Su(n.state.value[t]);return Bt(u,o,Object.keys(i||{}).reduce((d,f)=>(Le.NODE_ENV!=="production"&&f in u&&console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${f}" in store "${t}".`),d[f]=Kn(ee(()=>{ko(n);const m=n._s.get(t);return i[f].call(m,m)})),d),{}))}return l=Bl(t,c,e,n,r,!0),l}function Bl(t,e,n={},r,s,o){let i;const a=Bt({actions:{}},n);if(Le.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const l={deep:!0};Le.NODE_ENV!=="production"&&!yf&&(l.onTrigger=R=>{c?m=R:c==!1&&!N._hotUpdating&&(Array.isArray(m)?m.push(R):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let c,u,d=[],f=[],m;const _=r.state.value[t];!o&&!_&&(Le.NODE_ENV==="production"||!s)&&(r.state.value[t]={});const E=C({});let k;function A(R){let V;c=u=!1,Le.NODE_ENV!=="production"&&(m=[]),typeof R=="function"?(R(r.state.value[t]),V={type:vn.patchFunction,storeId:t,events:m}):(Zl(r.state.value[t],R),V={type:vn.patchObject,payload:R,storeId:t,events:m});const I=k=Symbol();qs().then(()=>{k===I&&(c=!0)}),u=!0,ps(d,V,r.state.value[t])}const B=o?function(){const{state:V}=n,I=V?V():{};this.$patch(ce=>{Bt(ce,I)})}:Le.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`)}:Af;function T(){i.stop(),d=[],f=[],r._s.delete(t)}const J=(R,V="")=>{if(Vf in R)return R[Ul]=V,R;const I=function(){ko(r);const ce=Array.from(arguments),Ze=[],w=[];function $(be){Ze.push(be)}function Q(be){w.push(be)}ps(f,{args:ce,name:I[Ul],store:N,after:$,onError:Q});let oe;try{oe=R.apply(this&&this.$id===t?this:N,ce)}catch(be){throw ps(w,be),be}return oe instanceof Promise?oe.then(be=>(ps(Ze,be),be)).catch(be=>(ps(w,be),Promise.reject(be))):(ps(Ze,oe),oe)};return I[Vf]=!0,I[Ul]=V,I},P=Kn({actions:{},getters:{},state:[],hotState:E}),z={_p:r,$id:t,$onAction:Df.bind(null,f),$patch:A,$reset:B,$subscribe(R,V={}){const I=Df(d,R,V.detached,()=>ce()),ce=i.run(()=>lt(()=>r.state.value[t],Ze=>{(V.flush==="sync"?u:c)&&R({storeId:t,type:vn.direct,events:m},Ze)},Bt({},l,V)));return I},$dispose:T},N=Bs(Le.NODE_ENV!=="production"||Le.NODE_ENV!=="production"&&Le.NODE_ENV!=="test"&&Br?Bt({_hmrPayload:P,_customProperties:Kn(new Set)},z):z);r._s.set(t,N);const K=(r._a&&r._a.runWithContext||cb)(()=>r._e.run(()=>(i=Qc()).run(()=>e({action:J}))));for(const R in K){const V=K[R];if(Qe(V)&&!Rf(V)||Nn(V))Le.NODE_ENV!=="production"&&s?zi(E.value,R,Fa(K,R)):o||(_&&db(V)&&(Qe(V)?V.value=_[R]:Zl(V,_[R])),r.state.value[t][R]=V),Le.NODE_ENV!=="production"&&P.state.push(R);else if(typeof V=="function"){const I=Le.NODE_ENV!=="production"&&s?V:J(V,R);K[R]=I,Le.NODE_ENV!=="production"&&(P.actions[R]=V),a.actions[R]=V}else Le.NODE_ENV!=="production"&&Rf(V)&&(P.getters[R]=o?n.getters[R]:V,Br&&(K._getters||(K._getters=Kn([]))).push(R))}if(Bt(N,K),Bt(Ee(N),K),Object.defineProperty(N,"$state",{get:()=>Le.NODE_ENV!=="production"&&s?E.value:r.state.value[t],set:R=>{if(Le.NODE_ENV!=="production"&&s)throw new Error("cannot set hotState");A(V=>{Bt(V,R)})}}),Le.NODE_ENV!=="production"&&(N._hotUpdate=Kn(R=>{N._hotUpdating=!0,R._hmrPayload.state.forEach(V=>{if(V in N.$state){const I=R.$state[V],ce=N.$state[V];typeof I=="object"&&Zr(I)&&Zr(ce)?If(I,ce):R.$state[V]=ce}zi(N,V,Fa(R.$state,V))}),Object.keys(N.$state).forEach(V=>{V in R.$state||Rl(N,V)}),c=!1,u=!1,r.state.value[t]=Fa(R._hmrPayload,"hotState"),u=!0,qs().then(()=>{c=!0});for(const V in R._hmrPayload.actions){const I=R[V];zi(N,V,J(I,V))}for(const V in R._hmrPayload.getters){const I=R._hmrPayload.getters[V],ce=o?ee(()=>(ko(r),I.call(N,N))):I;zi(N,V,ce)}Object.keys(N._hmrPayload.getters).forEach(V=>{V in R._hmrPayload.getters||Rl(N,V)}),Object.keys(N._hmrPayload.actions).forEach(V=>{V in R._hmrPayload.actions||Rl(N,V)}),N._hmrPayload=R._hmrPayload,N._getters=R._getters,N._hotUpdating=!1})),Le.NODE_ENV!=="production"&&Le.NODE_ENV!=="test"&&Br){const R={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(V=>{Object.defineProperty(N,V,Bt({value:N[V]},R))})}return r._p.forEach(R=>{if(Le.NODE_ENV!=="production"&&Le.NODE_ENV!=="test"&&Br){const V=i.run(()=>R({store:N,app:r._a,pinia:r,options:a}));Object.keys(V||{}).forEach(I=>N._customProperties.add(I)),Bt(N,V)}else Bt(N,i.run(()=>R({store:N,app:r._a,pinia:r,options:a})))}),Le.NODE_ENV!=="production"&&N.$state&&typeof N.$state=="object"&&typeof N.$state.constructor=="function"&&!N.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
20
20
  state: () => new MyClass()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/storefront",
3
3
  "type": "module",
4
- "version": "0.2.24",
4
+ "version": "0.2.26",
5
5
  "description": "Package to let you embed Moonbase.sh into your storefront as a payment and delivery provider",
6
6
  "author": "Tobias LΓΈnnerΓΈd Madsen <m@dsen.tv>",
7
7
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  "pinia": "^2.1.7",
23
23
  "vite-plugin-css-injected-by-js": "^3.5.1",
24
24
  "vue": "^3.4.29",
25
- "@moonbase.sh/vue": "0.2.24"
25
+ "@moonbase.sh/vue": "0.2.26"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^18.14.2",