@moonbase.sh/storefront 0.2.17 → 0.2.20
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 +5 -5
- package/dist/moonbase.umd.cjs +2 -2
- package/package.json +2 -2
package/dist/moonbase.js
CHANGED
|
@@ -8948,7 +8948,7 @@ function Xu(e) {
|
|
|
8948
8948
|
return;
|
|
8949
8949
|
}
|
|
8950
8950
|
const t = document.createElement("iframe");
|
|
8951
|
-
t.id = "moonbase-checkout", t.src = e, t.style.position = "fixed", t.style.top = "0px", t.style.left = "0px", t.style.right = "0px", t.style.border = "none", t.style.backgroundColor = "transparent", t.style.zIndex = Number.MAX_SAFE_INTEGER.toString(), t.setAttribute("background", "transparent"), t.setAttribute("frameborder", "0"), t.setAttribute("allowtransparency", "true"), t.height = "100%", t.width = "100%", document.body.append(t), window.onmessage = function(n) {
|
|
8951
|
+
t.id = "moonbase-checkout", t.src = e, t.style.position = "fixed", t.style.top = "0px", t.style.left = "0px", t.style.right = "0px", t.style.border = "none", t.style.colorScheme = "normal", t.style.backgroundColor = "transparent", t.style.zIndex = Number.MAX_SAFE_INTEGER.toString(), t.setAttribute("background", "transparent"), t.setAttribute("frameborder", "0"), t.setAttribute("allowtransparency", "true"), t.height = "100%", t.width = "100%", document.body.append(t), window.onmessage = function(n) {
|
|
8952
8952
|
var r;
|
|
8953
8953
|
try {
|
|
8954
8954
|
const o = lg.parse(n.data);
|
|
@@ -9276,10 +9276,11 @@ function Ji(e) {
|
|
|
9276
9276
|
i({ next: a.detail.next });
|
|
9277
9277
|
});
|
|
9278
9278
|
});
|
|
9279
|
-
} else
|
|
9280
|
-
|
|
9281
|
-
|
|
9279
|
+
} else {
|
|
9280
|
+
if (o.checkoutUrl && typeof window < "u")
|
|
9281
|
+
return window.location.href = o.checkoutUrl, { next: void 0 };
|
|
9282
9282
|
throw new Error("No checkout URL found");
|
|
9283
|
+
}
|
|
9283
9284
|
}
|
|
9284
9285
|
};
|
|
9285
9286
|
}
|
|
@@ -13850,7 +13851,6 @@ const P_ = { class: "moonbase:product-cart-item" }, $_ = ["src"], I_ = {
|
|
|
13850
13851
|
b(n).length > 0 ? (_(), xe(Zd, {
|
|
13851
13852
|
key: 3,
|
|
13852
13853
|
handler: i,
|
|
13853
|
-
"no-reset": !0,
|
|
13854
13854
|
label: "Checkout",
|
|
13855
13855
|
success: "Done",
|
|
13856
13856
|
error: "Cancelled"
|
package/dist/moonbase.umd.cjs
CHANGED
|
@@ -13,7 +13,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
13
13
|
|
|
14
14
|
For more details, see https://link.vuejs.org/feature-flags.`)}}const _t=Wm;function Im(e){return Dm(e)}function Dm(e,t){$m();const n=Ei();n.__VUE__=!0,g.NODE_ENV!=="production"&&pc(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:m=We,insertStaticContent:y}=e,E=(p,h,k,L=null,D=null,M=null,J=void 0,q=null,W=g.NODE_ENV!=="production"&&Dn?!1:!!h.dynamicChildren)=>{if(p===h)return;p&&!hr(p,h)&&(L=si(p),bt(p,D,M,!0),p=null),h.patchFlag===-2&&(W=!1,h.dynamicChildren=null);const{type:R,ref:Q,shapeFlag:le}=h;switch(R){case _o:S(p,h,k,L);break;case Ke:A(p,h,k,L);break;case bo:p==null?F(h,k,L,J):g.NODE_ENV!=="production"&&C(p,h,k,J);break;case Ce:oe(p,h,k,L,D,M,J,q,W);break;default:le&1?Z(p,h,k,L,D,M,J,q,W):le&6?w(p,h,k,L,D,M,J,q,W):le&64||le&128?R.process(p,h,k,L,D,M,J,q,W,jo):g.NODE_ENV!=="production"&&U("Invalid VNode type:",R,`(${typeof R})`)}Q!=null&&D&&na(Q,p&&p.ref,M,h||p,!h)},S=(p,h,k,L)=>{if(p==null)r(h.el=a(h.children),k,L);else{const D=h.el=p.el;h.children!==p.children&&l(D,h.children)}},A=(p,h,k,L)=>{p==null?r(h.el=c(h.children||""),k,L):h.el=p.el},F=(p,h,k,L)=>{[p.el,p.anchor]=y(p.children,h,k,L,p.el,p.anchor)},C=(p,h,k,L)=>{if(h.children!==p.children){const D=f(p.anchor);$(p),[h.el,h.anchor]=y(h.children,k,D,L)}else h.el=p.el,h.anchor=p.anchor},z=({el:p,anchor:h},k,L)=>{let D;for(;p&&p!==h;)D=f(p),r(p,k,L),p=D;r(h,k,L)},$=({el:p,anchor:h})=>{let k;for(;p&&p!==h;)k=f(p),o(p),p=k;o(h)},Z=(p,h,k,L,D,M,J,q,W)=>{h.type==="svg"?J="svg":h.type==="math"&&(J="mathml"),p==null?x(h,k,L,D,M,J,q,W):V(p,h,D,M,J,q,W)},x=(p,h,k,L,D,M,J,q)=>{let W,R;const{props:Q,shapeFlag:le,transition:se,dirs:we}=p;if(W=p.el=i(p.type,M,Q&&Q.is,Q),le&8?u(W,p.children):le&16&&Y(p.children,W,null,L,D,oa(p,M),J,q),we&&lr(p,null,L,"created"),de(W,p,p.scopeId,J,L),Q){for(const Fe in Q)Fe!=="value"&&!ro(Fe)&&s(W,Fe,null,Q[Fe],M,L);"value"in Q&&s(W,"value",null,Q.value,M),(R=Q.onVnodeBeforeMount)&&Jt(R,L,p)}g.NODE_ENV!=="production"&&(ns(W,"__vnode",p,!0),ns(W,"__vueParentComponent",L,!0)),we&&lr(p,null,L,"beforeMount");const Se=Am(D,se);Se&&se.beforeEnter(W),r(W,h,k),((R=Q&&Q.onVnodeMounted)||Se||we)&&_t(()=>{R&&Jt(R,L,p),Se&&se.enter(W),we&&lr(p,null,L,"mounted")},D)},de=(p,h,k,L,D)=>{if(k&&m(p,k),L)for(let M=0;M<L.length;M++)m(p,L[M]);if(D){let M=D.subTree;if(g.NODE_ENV!=="production"&&M.patchFlag>0&&M.patchFlag&2048&&(M=la(M.children)||M),h===M){const J=D.vnode;de(p,J,J.scopeId,J.slotScopeIds,D.parent)}}},Y=(p,h,k,L,D,M,J,q,W=0)=>{for(let R=W;R<p.length;R++){const Q=p[R]=q?Rn(p[R]):jt(p[R]);E(null,Q,h,k,L,D,M,J,q)}},V=(p,h,k,L,D,M,J)=>{const q=h.el=p.el;g.NODE_ENV!=="production"&&(q.__vnode=h);let{patchFlag:W,dynamicChildren:R,dirs:Q}=h;W|=p.patchFlag&16;const le=p.props||Me,se=h.props||Me;let we;if(k&&fr(k,!1),(we=se.onVnodeBeforeUpdate)&&Jt(we,k,h,p),Q&&lr(h,p,k,"beforeUpdate"),k&&fr(k,!0),g.NODE_ENV!=="production"&&Dn&&(W=0,J=!1,R=null),(le.innerHTML&&se.innerHTML==null||le.textContent&&se.textContent==null)&&u(q,""),R?(P(p.dynamicChildren,R,q,k,L,oa(h,D),M),g.NODE_ENV!=="production"&&yo(p,h)):J||ce(p,h,q,null,k,L,oa(h,D),M,!1),W>0){if(W&16)j(q,le,se,k,D);else if(W&2&&le.class!==se.class&&s(q,"class",null,se.class,D),W&4&&s(q,"style",le.style,se.style,D),W&8){const Se=h.dynamicProps;for(let Fe=0;Fe<Se.length;Fe++){const Ve=Se[Fe],rt=le[Ve],Mt=se[Ve];(Mt!==rt||Ve==="value")&&s(q,Ve,rt,Mt,D,k)}}W&1&&p.children!==h.children&&u(q,h.children)}else!J&&R==null&&j(q,le,se,k,D);((we=se.onVnodeUpdated)||Q)&&_t(()=>{we&&Jt(we,k,h,p),Q&&lr(h,p,k,"updated")},L)},P=(p,h,k,L,D,M,J)=>{for(let q=0;q<h.length;q++){const W=p[q],R=h[q],Q=W.el&&(W.type===Ce||!hr(W,R)||W.shapeFlag&70)?d(W.el):k;E(W,R,Q,null,L,D,M,J,!0)}},j=(p,h,k,L,D)=>{if(h!==k){if(h!==Me)for(const M in h)!ro(M)&&!(M in k)&&s(p,M,h[M],null,D,L);for(const M in k){if(ro(M))continue;const J=k[M],q=h[M];J!==q&&M!=="value"&&s(p,M,q,J,D,L)}"value"in k&&s(p,"value",h.value,k.value,D)}},oe=(p,h,k,L,D,M,J,q,W)=>{const R=h.el=p?p.el:a(""),Q=h.anchor=p?p.anchor:a("");let{patchFlag:le,dynamicChildren:se,slotScopeIds:we}=h;g.NODE_ENV!=="production"&&(Dn||le&2048)&&(le=0,W=!1,se=null),we&&(q=q?q.concat(we):we),p==null?(r(R,k,L),r(Q,k,L),Y(h.children||[],k,Q,D,M,J,q,W)):le>0&&le&64&&se&&p.dynamicChildren?(P(p.dynamicChildren,se,k,D,M,J,q),g.NODE_ENV!=="production"?yo(p,h):(h.key!=null||D&&h===D.subTree)&&yo(p,h,!0)):ce(p,h,k,Q,D,M,J,q,W)},w=(p,h,k,L,D,M,J,q,W)=>{h.slotScopeIds=q,p==null?h.shapeFlag&512?D.ctx.activate(h,k,L,J,W):I(h,k,L,D,M,J,W):ne(p,h,W)},I=(p,h,k,L,D,M,J)=>{const q=p.component=Qm(p,L,D);if(g.NODE_ENV!=="production"&&q.type.__hmrId&&Ch(q),g.NODE_ENV!=="production"&&(ms(p),pn(q,"mount")),mo(p)&&(q.ctx.renderer=jo),g.NODE_ENV!=="production"&&pn(q,"init"),tv(q,!1,J),g.NODE_ENV!=="production"&&hn(q,"init"),q.asyncDep){if(D&&D.registerDep(q,ae,J),!p.el){const W=q.subTree=B(Ke);A(null,W,h,k)}}else ae(q,p,h,k,D,M,J);g.NODE_ENV!=="production"&&(vs(),hn(q,"mount"))},ne=(p,h,k)=>{const L=h.component=p.component;if(Hm(p,h,k))if(L.asyncDep&&!L.asyncResolved){g.NODE_ENV!=="production"&&ms(h),re(L,h,k),g.NODE_ENV!=="production"&&vs();return}else L.next=h,xh(L.update),L.effect.dirty=!0,L.update();else h.el=p.el,L.vnode=h},ae=(p,h,k,L,D,M,J)=>{const q=()=>{if(p.isMounted){let{next:Q,bu:le,u:se,parent:we,vnode:Se}=p;{const Lr=Jc(p);if(Lr){Q&&(Q.el=Se.el,re(p,Q,J)),Lr.asyncDep.then(()=>{p.isUnmounted||q()});return}}let Fe=Q,Ve;g.NODE_ENV!=="production"&&ms(Q||p.vnode),fr(p,!1),Q?(Q.el=Se.el,re(p,Q,J)):Q=Se,le&&oo(le),(Ve=Q.props&&Q.props.onVnodeBeforeUpdate)&&Jt(Ve,we,Q,Se),fr(p,!0),g.NODE_ENV!=="production"&&pn(p,"render");const rt=aa(p);g.NODE_ENV!=="production"&&hn(p,"render");const Mt=p.subTree;p.subTree=rt,g.NODE_ENV!=="production"&&pn(p,"patch"),E(Mt,rt,d(Mt.el),si(Mt),p,D,M),g.NODE_ENV!=="production"&&hn(p,"patch"),Q.el=rt.el,Fe===null&&Zm(p,rt.el),se&&_t(se,D),(Ve=Q.props&&Q.props.onVnodeUpdated)&&_t(()=>Jt(Ve,we,Q,Se),D),g.NODE_ENV!=="production"&&hc(p),g.NODE_ENV!=="production"&&vs()}else{let Q;const{el:le,props:se}=h,{bm:we,m:Se,parent:Fe}=p,Ve=ho(h);if(fr(p,!1),we&&oo(we),!Ve&&(Q=se&&se.onVnodeBeforeMount)&&Jt(Q,Fe,h),fr(p,!0),le&&zd){const rt=()=>{g.NODE_ENV!=="production"&&pn(p,"render"),p.subTree=aa(p),g.NODE_ENV!=="production"&&hn(p,"render"),g.NODE_ENV!=="production"&&pn(p,"hydrate"),zd(le,p.subTree,p,D,null),g.NODE_ENV!=="production"&&hn(p,"hydrate")};Ve?h.type.__asyncLoader().then(()=>!p.isUnmounted&&rt()):rt()}else{g.NODE_ENV!=="production"&&pn(p,"render");const rt=p.subTree=aa(p);g.NODE_ENV!=="production"&&hn(p,"render"),g.NODE_ENV!=="production"&&pn(p,"patch"),E(null,rt,k,L,p,D,M),g.NODE_ENV!=="production"&&hn(p,"patch"),h.el=rt.el}if(Se&&_t(Se,D),!Ve&&(Q=se&&se.onVnodeMounted)){const rt=h;_t(()=>Jt(Q,Fe,rt),D)}(h.shapeFlag&256||Fe&&ho(Fe.vnode)&&Fe.vnode.shapeFlag&256)&&p.a&&_t(p.a,D),p.isMounted=!0,g.NODE_ENV!=="production"&&Ah(p),h=k=L=null}},W=p.effect=new Si(q,We,()=>gs(R),p.scope),R=p.update=()=>{W.dirty&&W.run()};R.i=p,R.id=p.uid,fr(p,!0),g.NODE_ENV!=="production"&&(W.onTrack=p.rtc?Q=>oo(p.rtc,Q):void 0,W.onTrigger=p.rtg?Q=>oo(p.rtg,Q):void 0),R()},re=(p,h,k)=>{h.component=p;const L=p.vnode.props;p.vnode=h,p.next=null,vm(p,h.props,L,k),xm(p,h.children,k),sn(),lc(p),an()},ce=(p,h,k,L,D,M,J,q,W=!1)=>{const R=p&&p.children,Q=p?p.shapeFlag:0,le=h.children,{patchFlag:se,shapeFlag:we}=h;if(se>0){if(se&128){je(R,le,k,L,D,M,J,q,W);return}else if(se&256){Ie(R,le,k,L,D,M,J,q,W);return}}we&8?(Q&16&&Ro(R,D,M),le!==R&&u(k,le)):Q&16?we&16?je(R,le,k,L,D,M,J,q,W):Ro(R,D,M,!0):(Q&8&&u(k,""),we&16&&Y(le,k,L,D,M,J,q,W))},Ie=(p,h,k,L,D,M,J,q,W)=>{p=p||$r,h=h||$r;const R=p.length,Q=h.length,le=Math.min(R,Q);let se;for(se=0;se<le;se++){const we=h[se]=W?Rn(h[se]):jt(h[se]);E(p[se],we,k,null,D,M,J,q,W)}R>Q?Ro(p,D,M,!0,!1,le):Y(h,k,L,D,M,J,q,W,le)},je=(p,h,k,L,D,M,J,q,W)=>{let R=0;const Q=h.length;let le=p.length-1,se=Q-1;for(;R<=le&&R<=se;){const we=p[R],Se=h[R]=W?Rn(h[R]):jt(h[R]);if(hr(we,Se))E(we,Se,k,null,D,M,J,q,W);else break;R++}for(;R<=le&&R<=se;){const we=p[le],Se=h[se]=W?Rn(h[se]):jt(h[se]);if(hr(we,Se))E(we,Se,k,null,D,M,J,q,W);else break;le--,se--}if(R>le){if(R<=se){const we=se+1,Se=we<Q?h[we].el:L;for(;R<=se;)E(null,h[R]=W?Rn(h[R]):jt(h[R]),k,Se,D,M,J,q,W),R++}}else if(R>se)for(;R<=le;)bt(p[R],D,M,!0),R++;else{const we=R,Se=R,Fe=new Map;for(R=Se;R<=se;R++){const yt=h[R]=W?Rn(h[R]):jt(h[R]);yt.key!=null&&(g.NODE_ENV!=="production"&&Fe.has(yt.key)&&U("Duplicate keys found during update:",JSON.stringify(yt.key),"Make sure keys are unique."),Fe.set(yt.key,R))}let Ve,rt=0;const Mt=se-Se+1;let Lr=!1,Kd=0;const Lo=new Array(Mt);for(R=0;R<Mt;R++)Lo[R]=0;for(R=we;R<=le;R++){const yt=p[R];if(rt>=Mt){bt(yt,D,M,!0);continue}let en;if(yt.key!=null)en=Fe.get(yt.key);else for(Ve=Se;Ve<=se;Ve++)if(Lo[Ve-Se]===0&&hr(yt,h[Ve])){en=Ve;break}en===void 0?bt(yt,D,M,!0):(Lo[en-Se]=R+1,en>=Kd?Kd=en:Lr=!0,E(yt,h[en],k,null,D,M,J,q,W),rt++)}const Gd=Lr?Vm(Lo):$r;for(Ve=Gd.length-1,R=Mt-1;R>=0;R--){const yt=Se+R,en=h[yt],Jd=yt+1<Q?h[yt+1].el:L;Lo[R]===0?E(null,en,k,Jd,D,M,J,q,W):Lr&&(Ve<0||R!==Gd[Ve]?nt(en,k,Jd,2):Ve--)}}},nt=(p,h,k,L,D=null)=>{const{el:M,type:J,transition:q,children:W,shapeFlag:R}=p;if(R&6){nt(p.component.subTree,h,k,L);return}if(R&128){p.suspense.move(h,k,L);return}if(R&64){J.move(p,h,k,jo);return}if(J===Ce){r(M,h,k);for(let le=0;le<W.length;le++)nt(W[le],h,k,L);r(p.anchor,h,k);return}if(J===bo){z(p,h,k);return}if(L!==2&&R&1&&q)if(L===0)q.beforeEnter(M),r(M,h,k),_t(()=>q.enter(M),D);else{const{leave:le,delayLeave:se,afterLeave:we}=q,Se=()=>r(M,h,k),Fe=()=>{le(M,()=>{Se(),we&&we()})};se?se(M,Se,Fe):Fe()}else r(M,h,k)},bt=(p,h,k,L=!1,D=!1)=>{const{type:M,props:J,ref:q,children:W,dynamicChildren:R,shapeFlag:Q,patchFlag:le,dirs:se,cacheIndex:we}=p;if(le===-2&&(D=!1),q!=null&&na(q,null,k,p,!0),we!=null&&(h.renderCache[we]=void 0),Q&256){h.ctx.deactivate(p);return}const Se=Q&1&&se,Fe=!ho(p);let Ve;if(Fe&&(Ve=J&&J.onVnodeBeforeUnmount)&&Jt(Ve,h,p),Q&6)Sw(p.component,k,L);else{if(Q&128){p.suspense.unmount(k,L);return}Se&&lr(p,null,h,"beforeUnmount"),Q&64?p.type.remove(p,h,k,jo,L):R&&!R.hasOnce&&(M!==Ce||le>0&&le&64)?Ro(R,h,k,!1,!0):(M===Ce&&le&384||!D&&Q&16)&&Ro(W,h,k),L&&bn(p)}(Fe&&(Ve=J&&J.onVnodeUnmounted)||Se)&&_t(()=>{Ve&&Jt(Ve,h,p),Se&&lr(p,null,h,"unmounted")},k)},bn=p=>{const{type:h,el:k,anchor:L,transition:D}=p;if(h===Ce){g.NODE_ENV!=="production"&&p.patchFlag>0&&p.patchFlag&2048&&D&&!D.persisted?p.children.forEach(J=>{J.type===Ke?o(J.el):bn(J)}):Gn(k,L);return}if(h===bo){$(p);return}const M=()=>{o(k),D&&!D.persisted&&D.afterLeave&&D.afterLeave()};if(p.shapeFlag&1&&D&&!D.persisted){const{leave:J,delayLeave:q}=D,W=()=>J(k,M);q?q(p.el,M,W):W()}else M()},Gn=(p,h)=>{let k;for(;p!==h;)k=f(p),o(p),p=k;o(h)},Sw=(p,h,k)=>{g.NODE_ENV!=="production"&&p.type.__hmrId&&Th(p);const{bum:L,scope:D,update:M,subTree:J,um:q,m:W,a:R}=p;Yc(W),Yc(R),L&&oo(L),D.stop(),M&&(M.active=!1,bt(J,p,h,k)),q&&_t(q,h),_t(()=>{p.isUnmounted=!0},h),h&&h.pendingBranch&&!h.isUnmounted&&p.asyncDep&&!p.asyncResolved&&p.suspenseId===h.pendingId&&(h.deps--,h.deps===0&&h.resolve()),g.NODE_ENV!=="production"&&Rh(p)},Ro=(p,h,k,L=!1,D=!1,M=0)=>{for(let J=M;J<p.length;J++)bt(p[J],h,k,L,D)},si=p=>{if(p.shapeFlag&6)return si(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const h=f(p.anchor||p.el),k=h&&h[qc];return k?f(k):h};let za=!1;const qd=(p,h,k)=>{p==null?h._vnode&&bt(h._vnode,null,null,!0):E(h._vnode||null,p,h,null,null,null,k),h._vnode=p,za||(za=!0,lc(),cc(),za=!1)},jo={p:E,um:bt,m:nt,r:bn,mt:I,mc:Y,pc:ce,pbc:P,n:si,o:e};let Wd,zd;return{render:qd,hydrate:Wd,createApp:fm(qd,Wd)}}function oa({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function fr({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Am(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function yo(e,t,n=!1){const r=e.children,o=t.children;if(ie(r)&&ie(o))for(let s=0;s<r.length;s++){const i=r[s];let a=o[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=o[s]=Rn(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&yo(i,a)),a.type===_o&&(a.el=i.el),g.NODE_ENV!=="production"&&a.type===Ke&&!a.el&&(a.el=i.el)}}function Vm(e){const t=e.slice(),n=[0];let r,o,s,i,a;const c=e.length;for(r=0;r<c;r++){const l=e[r];if(l!==0){if(o=n[n.length-1],e[o]<l){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<l?s=a+1:i=a;l<e[n[s]]&&(s>0&&(t[r]=n[s-1]),n[s]=r)}}for(s=n.length,i=n[s-1];s-- >0;)n[s]=i,i=t[i];return n}function Jc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Jc(t)}function Yc(e){if(e)for(let t=0;t<e.length;t++)e[t].active=!1}const Rm=Symbol.for("v-scx"),jm=()=>{{const e=$e(Rm);return e||g.NODE_ENV!=="production"&&U("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function ft(e,t){return sa(e,null,t)}const Cs={};function Xe(e,t,n){return g.NODE_ENV!=="production"&&!fe(t)&&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."),sa(e,t,n)}function sa(e,t,{immediate:n,deep:r,flush:o,once:s,onTrack:i,onTrigger:a}=Me){if(t&&s){const x=t;t=(...de)=>{x(...de),Z()}}g.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.'),g.NODE_ENV!=="production"&&!t&&(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.'),s!==void 0&&U('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=x=>{U("Invalid watch source: ",x,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=Ge,u=x=>r===!0?x:pr(x,r===!1?1:void 0);let d,f=!1,m=!1;if(He(e)?(d=()=>e.value,f=un(e)):ln(e)?(d=()=>u(e),f=!0):ie(e)?(m=!0,f=e.some(x=>ln(x)||un(x)),d=()=>e.map(x=>{if(He(x))return x.value;if(ln(x))return u(x);if(fe(x))return dn(x,l,2);g.NODE_ENV!=="production"&&c(x)})):fe(e)?t?d=()=>dn(e,l,2):d=()=>(y&&y(),kt(e,l,3,[E])):(d=We,g.NODE_ENV!=="production"&&c(e)),t&&r){const x=d;d=()=>pr(x())}let y,E=x=>{y=z.onStop=()=>{dn(x,l,4),y=z.onStop=void 0}},S;if(As)if(E=We,t?n&&kt(t,l,3,[d(),m?[]:void 0,E]):d(),o==="sync"){const x=jm();S=x.__watcherHandles||(x.__watcherHandles=[])}else return We;let A=m?new Array(e.length).fill(Cs):Cs;const F=()=>{if(!(!z.active||!z.dirty))if(t){const x=z.run();(r||f||(m?x.some((de,Y)=>Cn(de,A[Y])):Cn(x,A)))&&(y&&y(),kt(t,l,3,[x,A===Cs?void 0:m&&A[0]===Cs?[]:A,E]),A=x)}else z.run()};F.allowRecurse=!!t;let C;o==="sync"?C=F:o==="post"?C=()=>_t(F,l&&l.suspense):(F.pre=!0,l&&(F.id=l.uid),C=()=>gs(F));const z=new Si(d,We,C),$=Tl(),Z=()=>{z.stop(),$&&yi($.effects,z)};return g.NODE_ENV!=="production"&&(z.onTrack=i,z.onTrigger=a),t?n?F():A=z.run():o==="post"?_t(z.run.bind(z),l&&l.suspense):z.run(),S&&S.push(Z),Z}function Lm(e,t,n){const r=this.proxy,o=Be(e)?e.includes(".")?Xc(r,e):()=>r[e]:e.bind(r,r);let s;fe(t)?s=t:(s=t.handler,n=t);const i=Oo(this),a=sa(o,s.bind(r),n);return i(),a}function Xc(e,t){const n=t.split(".");return()=>{let r=e;for(let o=0;o<n.length&&r;o++)r=r[n[o]];return r}}function pr(e,t=1/0,n){if(t<=0||!De(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,He(e))pr(e.value,t,n);else if(ie(e))for(let r=0;r<e.length;r++)pr(e[r],t,n);else if(bl(e)||er(e))e.forEach(r=>{pr(r,t,n)});else if(El(e)){for(const r in e)pr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&pr(e[r],t,n)}return e}const Mm=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Et(t)}Modifiers`]||e[`${on(t)}Modifiers`];function Um(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Me;if(g.NODE_ENV!=="production"){const{emitsOptions:u,propsOptions:[d]}=e;if(u)if(!(t in u))(!d||!(nr(Et(t))in d))&&U(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${nr(Et(t))}" prop.`);else{const f=u[t];fe(f)&&(f(...n)||U(`Invalid event arguments: event validation failed for event "${t}".`))}}let o=n;const s=t.startsWith("update:"),i=s&&Mm(r,t.slice(7));if(i&&(i.trim&&(o=n.map(u=>Be(u)?u.trim():u)),i.number&&(o=n.map(Cp))),g.NODE_ENV!=="production"&&Mh(e,t,o),g.NODE_ENV!=="production"){const u=t.toLowerCase();u!==t&&r[nr(u)]&&U(`Event "${u}" is emitted in component ${Vs(e,e.type)} but the handler is registered for "${t}". 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 "${on(t)}" instead of "${t}".`)}let a,c=r[a=nr(t)]||r[a=nr(Et(t))];!c&&s&&(c=r[a=nr(on(t))]),c&&kt(c,e,6,o);const l=r[a+"Once"];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,kt(l,e,6,o)}}function Qc(e,t,n=!1){const r=t.emitsCache,o=r.get(e);if(o!==void 0)return o;const s=e.emits;let i={},a=!1;if(!fe(e)){const c=l=>{const u=Qc(l,t,!0);u&&(a=!0,qe(i,u))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!s&&!a?(De(e)&&r.set(e,null),null):(ie(s)?s.forEach(c=>i[c]=null):qe(i,s),De(e)&&r.set(e,i),i)}function Ts(e,t){return!e||!no(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ne(e,t[0].toLowerCase()+t.slice(1))||Ne(e,on(t))||Ne(e,t))}let ia=!1;function Ps(){ia=!0}function aa(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:c,render:l,renderCache:u,props:d,data:f,setupState:m,ctx:y,inheritAttrs:E}=e,S=ws(e);let A,F;g.NODE_ENV!=="production"&&(ia=!1);try{if(n.shapeFlag&4){const $=o||r,Z=g.NODE_ENV!=="production"&&m.__isScriptSetup?new Proxy($,{get(x,de,Y){return U(`Property '${String(de)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(x,de,Y)}}):$;A=jt(l.call(Z,$,u,g.NODE_ENV!=="production"?Wt(d):d,m,f,y)),F=a}else{const $=t;g.NODE_ENV!=="production"&&a===d&&Ps(),A=jt($.length>1?$(g.NODE_ENV!=="production"?Wt(d):d,g.NODE_ENV!=="production"?{get attrs(){return Ps(),Wt(a)},slots:i,emit:c}:{attrs:a,slots:i,emit:c}):$(g.NODE_ENV!=="production"?Wt(d):d,null)),F=t.props?a:Fm(a)}}catch($){wo.length=0,ao($,e,1),A=B(Ke)}let C=A,z;if(g.NODE_ENV!=="production"&&A.patchFlag>0&&A.patchFlag&2048&&([C,z]=eu(A)),F&&E!==!1){const $=Object.keys(F),{shapeFlag:Z}=C;if($.length){if(Z&7)s&&$.some(Qo)&&(F=Bm(F,s)),C=Rt(C,F,!1,!0);else if(g.NODE_ENV!=="production"&&!ia&&C.type!==Ke){const x=Object.keys(a),de=[],Y=[];for(let V=0,P=x.length;V<P;V++){const j=x[V];no(j)?Qo(j)||de.push(j[2].toLowerCase()+j.slice(3)):Y.push(j)}Y.length&&U(`Extraneous non-props attributes (${Y.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`),de.length&&U(`Extraneous non-emits event listeners (${de.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&&(g.NODE_ENV!=="production"&&!tu(C)&&U("Runtime directive used on component with non-element root node. The directives will not function as intended."),C=Rt(C,null,!1,!0),C.dirs=C.dirs?C.dirs.concat(n.dirs):n.dirs),n.transition&&(g.NODE_ENV!=="production"&&!tu(C)&&U("Component inside <Transition> renders non-element root node that cannot be animated."),C.transition=n.transition),g.NODE_ENV!=="production"&&z?z(C):A=C,ws(S),A}const eu=e=>{const t=e.children,n=e.dynamicChildren,r=la(t,!1);if(r){if(g.NODE_ENV!=="production"&&r.patchFlag>0&&r.patchFlag&2048)return eu(r)}else return[e,void 0];const o=t.indexOf(r),s=n?n.indexOf(r):-1,i=a=>{t[o]=a,n&&(s>-1?n[s]=a:a.patchFlag>0&&(e.dynamicChildren=[...n,a]))};return[jt(r),i]};function la(e,t=!0){let n;for(let r=0;r<e.length;r++){const o=e[r];if(Dr(o)){if(o.type!==Ke||o.children==="v-if"){if(n)return;if(n=o,g.NODE_ENV!=="production"&&t&&n.patchFlag>0&&n.patchFlag&2048)return la(n.children)}}else return}return n}const Fm=e=>{let t;for(const n in e)(n==="class"||n==="style"||no(n))&&((t||(t={}))[n]=e[n]);return t},Bm=(e,t)=>{const n={};for(const r in e)(!Qo(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},tu=e=>e.shapeFlag&7||e.type===Ke;function Hm(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:c}=t,l=s.emitsOptions;if(g.NODE_ENV!=="production"&&(o||a)&&Dn||t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?nu(r,i,l):!!i;if(c&8){const u=t.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(i[f]!==r[f]&&!Ts(l,f))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?nu(r,i,l):!0:!!i;return!1}function nu(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const s=r[o];if(t[s]!==e[s]&&!Ts(n,s))return!0}return!1}function Zm({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const qm=e=>e.__isSuspense;function Wm(e,t){t&&t.pendingBranch?ie(e)?t.effects.push(...e):t.effects.push(e):ac(e)}const Ce=Symbol.for("v-fgt"),_o=Symbol.for("v-txt"),Ke=Symbol.for("v-cmt"),bo=Symbol.for("v-stc"),wo=[];let Nt=null;function _(e=!1){wo.push(Nt=e?null:[])}function zm(){wo.pop(),Nt=wo[wo.length-1]||null}let Eo=1;function ru(e){Eo+=e,e<0&&Nt&&(Nt.hasOnce=!0)}function ou(e){return e.dynamicChildren=Eo>0?Nt||$r:null,zm(),Eo>0&&Nt&&Nt.push(e),e}function N(e,t,n,r,o,s){return ou(O(e,t,n,r,o,s,!0))}function xe(e,t,n,r,o){return ou(B(e,t,n,r,o,!0))}function Dr(e){return e?e.__v_isVNode===!0:!1}function hr(e,t){if(g.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const n=ys.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}const Km=(...e)=>iu(...e),su=({key:e})=>e??null,$s=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Be(e)||He(e)||fe(e)?{i:Ye,r:e,k:t,f:!!n}:e:null);function O(e,t=null,n=null,r=0,o=null,s=e===Ce?0:1,i=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&su(t),ref:t&&$s(t),scopeId:bs,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:s,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ye};return a?(ca(c,n),s&128&&e.normalize(c)):n&&(c.shapeFlag|=Be(n)?8:16),g.NODE_ENV!=="production"&&c.key!==c.key&&U("VNode created with invalid key (NaN). VNode type:",c.type),Eo>0&&!i&&Nt&&(c.patchFlag>0||s&6)&&c.patchFlag!==32&&Nt.push(c),c}const B=g.NODE_ENV!=="production"?Km:iu;function iu(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Oc)&&(g.NODE_ENV!=="production"&&!e&&U(`Invalid vnode type when creating vnode: ${e}.`),e=Ke),Dr(e)){const a=Rt(e,t,!0);return n&&ca(a,n),Eo>0&&!s&&Nt&&(a.shapeFlag&6?Nt[Nt.indexOf(e)]=a:Nt.push(a)),a.patchFlag=-2,a}if(pu(e)&&(e=e.__vccOpts),t){t=Gm(t);let{class:a,style:c}=t;a&&!Be(a)&&(t.class=rs(a)),De(c)&&(ps(c)&&!ie(c)&&(c=qe({},c)),t.style=Oi(c))}const i=Be(e)?1:qm(e)?128:km(e)?64:De(e)?4:fe(e)?2:0;return g.NODE_ENV!=="production"&&i&4&&ps(e)&&(e=ge(e),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`.",`
|
|
15
15
|
Component that was made reactive: `,e)),O(e,t,n,r,o,i,s,!0)}function Gm(e){return e?ps(e)||Vc(e)?qe({},e):e:null}function Rt(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:c}=e,l=t?ua(o||{},t):o,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&su(l),ref:t&&t.ref?n&&s?ie(s)?s.concat($s(t)):[s,$s(t)]:$s(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:g.NODE_ENV!=="production"&&i===-1&&ie(a)?a.map(au):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ce?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Rt(e.ssContent),ssFallback:e.ssFallback&&Rt(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Os(u,c.clone(u)),u}function au(e){const t=Rt(e);return ie(e.children)&&(t.children=e.children.map(au)),t}function Te(e=" ",t=0){return B(_o,null,e,t)}function Jm(e,t){const n=B(bo,null,e);return n.staticCount=t,n}function me(e="",t=!1){return t?(_(),xe(Ke,null,e)):B(Ke,null,e)}function jt(e){return e==null||typeof e=="boolean"?B(Ke):ie(e)?B(Ce,null,e.slice()):typeof e=="object"?Rn(e):B(_o,null,String(e))}function Rn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Rt(e)}function ca(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ie(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),ca(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Vc(t)?t._ctx=Ye:o===3&&Ye&&(Ye.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else fe(t)?(t={default:t,_ctx:Ye},n=32):(t=String(t),r&64?(n=16,t=[Te(t)]):n=8);e.children=t,e.shapeFlag|=n}function ua(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const o in r)if(o==="class")t.class!==r.class&&(t.class=rs([t.class,r.class]));else if(o==="style")t.style=Oi([t.style,r.style]);else if(no(o)){const s=t[o],i=r[o];i&&s!==i&&!(ie(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}function Jt(e,t,n,r=null){kt(e,t,7,[n,r])}const Ym=Ic();let Xm=0;function Qm(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||Ym,s={uid:Xm++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,scope:new kl(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:jc(r,o),emitsOptions:Qc(r,o),emit:null,emitted:null,propsDefaults:Me,inheritAttrs:r.inheritAttrs,ctx:Me,data:Me,props:Me,attrs:Me,slots:Me,refs:Me,setupState:Me,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 g.NODE_ENV!=="production"?s.ctx=nm(s):s.ctx={_:s},s.root=t?t.root:s,s.emit=Um.bind(null,s),e.ce&&e.ce(s),s}let Ge=null;const Is=()=>Ge||Ye;let Ds,da;{const e=Ei(),t=(n,r)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(r),s=>{o.length>1?o.forEach(i=>i(s)):o[0](s)}};Ds=t("__VUE_INSTANCE_SETTERS__",n=>Ge=n),da=t("__VUE_SSR_SETTERS__",n=>As=n)}const Oo=e=>{const t=Ge;return Ds(e),e.scope.on(),()=>{e.scope.off(),Ds(t)}},lu=()=>{Ge&&Ge.scope.off(),Ds(null)},ev=rn("slot,component");function fa(e,{isNativeTag:t}){(ev(e)||t(e))&&U("Do not use built-in or reserved HTML elements as component id: "+e)}function cu(e){return e.vnode.shapeFlag&4}let As=!1;function tv(e,t=!1,n=!1){t&&da(t);const{props:r,children:o}=e.vnode,s=cu(e);hm(e,r,s,t),Sm(e,o,n);const i=s?nv(e,t):void 0;return t&&da(!1),i}function nv(e,t){var n;const r=e.type;if(g.NODE_ENV!=="production"){if(r.name&&fa(r.name,e.appContext.config),r.components){const s=Object.keys(r.components);for(let i=0;i<s.length;i++)fa(s[i],e.appContext.config)}if(r.directives){const s=Object.keys(r.directives);for(let i=0;i<s.length;i++)vc(s[i])}r.compilerOptions&&rv()&&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.')}e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xc),g.NODE_ENV!=="production"&&rm(e);const{setup:o}=r;if(o){const s=e.setupContext=o.length>1?sv(e):null,i=Oo(e);sn();const a=dn(o,e,0,[g.NODE_ENV!=="production"?Wt(e.props):e.props,s]);if(an(),i(),_i(a)){if(a.then(lu,lu),t)return a.then(c=>{uu(e,c,t)}).catch(c=>{ao(c,e,0)});if(e.asyncDep=a,g.NODE_ENV!=="production"&&!e.suspense){const c=(n=r.name)!=null?n:"Anonymous";U(`Component <${c}>: 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 uu(e,a,t)}else du(e,t)}function uu(e,t,n){fe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:De(t)?(g.NODE_ENV!=="production"&&Dr(t)&&U("setup() should not return VNodes directly - return a render function instead."),g.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=tc(t),g.NODE_ENV!=="production"&&om(e)):g.NODE_ENV!=="production"&&t!==void 0&&U(`setup() should return an object. Received: ${t===null?"null":typeof t}`),du(e,n)}let pa;const rv=()=>!pa;function du(e,t,n){const r=e.type;if(!e.render){if(!t&&pa&&!r.render){const o=r.template||Yi(e).template;if(o){g.NODE_ENV!=="production"&&pn(e,"compile");const{isCustomElement:s,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:c}=r,l=qe(qe({isCustomElement:s,delimiters:a},i),c);r.render=pa(o,l),g.NODE_ENV!=="production"&&hn(e,"compile")}}e.render=r.render||We}{const o=Oo(e);sn();try{im(e)}finally{an(),o()}}g.NODE_ENV!=="production"&&!r.render&&e.render===We&&!t&&(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 fu=g.NODE_ENV!=="production"?{get(e,t){return Ps(),ot(e,"get",""),e[t]},set(){return U("setupContext.attrs is readonly."),!1},deleteProperty(){return U("setupContext.attrs is readonly."),!1}}:{get(e,t){return ot(e,"get",""),e[t]}};function ov(e){return new Proxy(e.slots,{get(t,n){return ot(e,"get","$slots"),t[n]}})}function sv(e){const t=n=>{if(g.NODE_ENV!=="production"&&(e.exposed&&U("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(ie(n)?r="array":He(n)&&(r="ref")),r!=="object"&&U(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(g.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,fu))},get slots(){return r||(r=ov(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,fu),slots:e.slots,emit:e.emit,expose:t}}function ha(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(tc($n(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in cr)return cr[n](e)},has(t,n){return n in t||n in cr}})):e.proxy}const iv=/(?:^|[-_])(\w)/g,av=e=>e.replace(iv,t=>t.toUpperCase()).replace(/[-_]/g,"");function ma(e,t=!0){return fe(e)?e.displayName||e.name:e.name||t&&e.__name}function Vs(e,t,n=!1){let r=ma(t);if(!r&&t.__file){const o=t.__file.match(/([^/\\]+)\.\w+$/);o&&(r=o[1])}if(!r&&e&&e.parent){const o=s=>{for(const i in s)if(s[i]===t)return i};r=o(e.components||e.parent.type.components)||o(e.appContext.components)}return r?av(r):n?"App":"Anonymous"}function pu(e){return fe(e)&&"__vccOpts"in e}const X=(e,t)=>{const n=dh(e,t,As);if(g.NODE_ENV!=="production"){const r=Is();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function Le(e,t,n){const r=arguments.length;return r===2?De(t)&&!ie(t)?Dr(t)?B(e,null,[t]):B(e,t):B(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Dr(n)&&(n=[n]),B(e,t,n))}function lv(){if(g.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},r={style:"color:#eb2f96"},o={__vue_custom_formatter:!0,header(d){return De(d)?d.__isVue?["div",e,"VueInstance"]:He(d)?["div",{},["span",e,u(d)],"<",a(d.value),">"]:ln(d)?["div",{},["span",e,un(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${cn(d)?" (readonly)":""}`]:cn(d)?["div",{},["span",e,un(d)?"ShallowReadonly":"Readonly"],"<",a(d),">"]:null:null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...s(d.$)]}};function s(d){const f=[];d.type.props&&d.props&&f.push(i("props",ge(d.props))),d.setupState!==Me&&f.push(i("setup",d.setupState)),d.data!==Me&&f.push(i("data",ge(d.data)));const m=c(d,"computed");m&&f.push(i("computed",m));const y=c(d,"inject");return y&&f.push(i("injected",y)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function i(d,f){return f=qe({},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",t,d]:typeof d=="string"?["span",n,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:De(d)?["object",{object:f?ge(d):d}]:["span",n,String(d)]}function c(d,f){const m=d.type;if(fe(m))return;const y={};for(const E in d.ctx)l(m,E,f)&&(y[E]=d.ctx[E]);return y}function l(d,f,m){const y=d[m];if(ie(y)&&y.includes(f)||De(y)&&f in y||d.extends&&l(d.extends,f,m)||d.mixins&&d.mixins.some(E=>l(E,f,m)))return!0}function u(d){return un(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const hu="3.4.38",jn=g.NODE_ENV!=="production"?U:We;var mn={};const cv="http://www.w3.org/2000/svg",uv="http://www.w3.org/1998/Math/MathML",vn=typeof document<"u"?document:null,mu=vn&&vn.createElement("template"),dv={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o=t==="svg"?vn.createElementNS(cv,e):t==="mathml"?vn.createElementNS(uv,e):n?vn.createElement(e,{is:n}):vn.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>vn.createTextNode(e),createComment:e=>vn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>vn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,s){const i=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{mu.innerHTML=r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e;const a=mu.content;if(r==="svg"||r==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ln="transition",No="animation",So=Symbol("_vtc"),xo=(e,{slots:t})=>Le(Hh,fv(e),t);xo.displayName="Transition";const vu={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};xo.props=qe({},gc,vu);const mr=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},gu=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function fv(e){const t={};for(const j in e)j in vu||(t[j]=e[j]);if(e.css===!1)return t;const{name:n="v",type:r,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=s,appearActiveClass:l=i,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,y=pv(o),E=y&&y[0],S=y&&y[1],{onBeforeEnter:A,onEnter:F,onEnterCancelled:C,onLeave:z,onLeaveCancelled:$,onBeforeAppear:Z=A,onAppear:x=F,onAppearCancelled:de=C}=t,Y=(j,oe,w)=>{vr(j,oe?u:a),vr(j,oe?l:i),w&&w()},V=(j,oe)=>{j._isLeaving=!1,vr(j,d),vr(j,m),vr(j,f),oe&&oe()},P=j=>(oe,w)=>{const I=j?x:F,ne=()=>Y(oe,j,w);mr(I,[oe,ne]),yu(()=>{vr(oe,j?c:s),Mn(oe,j?u:a),gu(I)||_u(oe,r,E,ne)})};return qe(t,{onBeforeEnter(j){mr(A,[j]),Mn(j,s),Mn(j,i)},onBeforeAppear(j){mr(Z,[j]),Mn(j,c),Mn(j,l)},onEnter:P(!1),onAppear:P(!0),onLeave(j,oe){j._isLeaving=!0;const w=()=>V(j,oe);Mn(j,d),Mn(j,f),vv(),yu(()=>{j._isLeaving&&(vr(j,d),Mn(j,m),gu(z)||_u(j,r,S,w))}),mr(z,[j,w])},onEnterCancelled(j){Y(j,!1),mr(C,[j])},onAppearCancelled(j){Y(j,!0),mr(de,[j])},onLeaveCancelled(j){V(j),mr($,[j])}})}function pv(e){if(e==null)return null;if(De(e))return[va(e.enter),va(e.leave)];{const t=va(e);return[t,t]}}function va(e){const t=Tp(e);return mn.NODE_ENV!=="production"&&Eh(t,"<transition> explicit duration"),t}function Mn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[So]||(e[So]=new Set)).add(t)}function vr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[So];n&&(n.delete(t),n.size||(e[So]=void 0))}function yu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let hv=0;function _u(e,t,n,r){const o=e._endId=++hv,s=()=>{o===e._endId&&r()};if(n)return setTimeout(s,n);const{type:i,timeout:a,propCount:c}=mv(e,t);if(!i)return r();const l=i+"end";let u=0;const d=()=>{e.removeEventListener(l,f),s()},f=m=>{m.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},a+1),e.addEventListener(l,f)}function mv(e,t){const n=window.getComputedStyle(e),r=y=>(n[y]||"").split(", "),o=r(`${Ln}Delay`),s=r(`${Ln}Duration`),i=bu(o,s),a=r(`${No}Delay`),c=r(`${No}Duration`),l=bu(a,c);let u=null,d=0,f=0;t===Ln?i>0&&(u=Ln,d=i,f=s.length):t===No?l>0&&(u=No,d=l,f=c.length):(d=Math.max(i,l),u=d>0?i>l?Ln:No:null,f=u?u===Ln?s.length:c.length:0);const m=u===Ln&&/\b(transform|all)(,|$)/.test(r(`${Ln}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:m}}function bu(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>wu(n)+wu(e[r])))}function wu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function vv(){return document.body.offsetHeight}function gv(e,t,n){const r=e[So];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Eu=Symbol("_vod"),yv=Symbol("_vsh"),_v=Symbol(mn.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),bv=/(^|;)\s*display\s*:/;function wv(e,t,n){const r=e.style,o=Be(n);let s=!1;if(n&&!o){if(t)if(Be(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Rs(r,a,"")}else for(const i in t)n[i]==null&&Rs(r,i,"");for(const i in n)i==="display"&&(s=!0),Rs(r,i,n[i])}else if(o){if(t!==n){const i=r[_v];i&&(n+=";"+i),r.cssText=n,s=bv.test(n)}}else t&&e.removeAttribute("style");Eu in e&&(e[Eu]=s?r.display:"",e[yv]&&(r.display="none"))}const Ev=/[^\\];\s*$/,Ou=/\s*!important$/;function Rs(e,t,n){if(ie(n))n.forEach(r=>Rs(e,t,r));else if(n==null&&(n=""),mn.NODE_ENV!=="production"&&Ev.test(n)&&jn(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith("--"))e.setProperty(t,n);else{const r=Ov(e,t);Ou.test(n)?e.setProperty(on(r),n.replace(Ou,""),"important"):e[r]=n}}const Nu=["Webkit","Moz","ms"],ga={};function Ov(e,t){const n=ga[t];if(n)return n;let r=Et(t);if(r!=="filter"&&r in e)return ga[t]=r;r=tr(r);for(let o=0;o<Nu.length;o++){const s=Nu[o]+r;if(s in e)return ga[t]=s}return t}const Su="http://www.w3.org/1999/xlink";function xu(e,t,n,r,o,s=Up(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Su,t.slice(6,t.length)):e.setAttributeNS(Su,t,n):n==null||s&&!Nl(n)?e.removeAttribute(t):e.setAttribute(t,s?"":kn(n)?String(n):n)}function Nv(e,t,n,r){if(t==="innerHTML"||t==="textContent"){if(n==null)return;e[t]=n;return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const i=o==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?"":String(n);(i!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const i=typeof e[t];i==="boolean"?n=Nl(n):n==null&&i==="string"?(n="",s=!0):i==="number"&&(n=0,s=!0)}try{e[t]=n}catch(i){mn.NODE_ENV!=="production"&&!s&&jn(`Failed setting prop "${t}" on <${o.toLowerCase()}>: value ${n} is invalid.`,i)}s&&e.removeAttribute(t)}function Sv(e,t,n,r){e.addEventListener(t,n,r)}function xv(e,t,n,r){e.removeEventListener(t,n,r)}const ku=Symbol("_vei");function kv(e,t,n,r,o=null){const s=e[ku]||(e[ku]={}),i=s[t];if(r&&i)i.value=mn.NODE_ENV!=="production"?Tu(r,t):r;else{const[a,c]=Cv(t);if(r){const l=s[t]=$v(mn.NODE_ENV!=="production"?Tu(r,t):r,o);Sv(e,a,l,c)}else i&&(xv(e,a,i,c),s[t]=void 0)}}const Cu=/(?:Once|Passive|Capture)$/;function Cv(e){let t;if(Cu.test(e)){t={};let r;for(;r=e.match(Cu);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):on(e.slice(2)),t]}let ya=0;const Tv=Promise.resolve(),Pv=()=>ya||(Tv.then(()=>ya=0),ya=Date.now());function $v(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;kt(Iv(r,n.value),t,5,[r])};return n.value=e,n.attached=Pv(),n}function Tu(e,t){return fe(e)||ie(e)?e:(jn(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
16
|
-
Expected function or array of functions, received type ${typeof e}.`),We)}function Iv(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const Pu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Dv=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?gv(e,r,i):t==="style"?wv(e,n,r):no(t)?Qo(t)||kv(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Av(e,t,r,i))?(Nv(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&xu(e,t,r,i,s,t!=="value")):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),xu(e,t,r,i))};function Av(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Pu(t)&&fe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Pu(t)&&Be(n)?!1:t in e}const Vv=["ctrl","shift","alt","meta"],Rv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Vv.some(n=>e[`${n}Key`]&&!t.includes(n))},jv=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...s)=>{for(let i=0;i<t.length;i++){const a=Rv[t[i]];if(a&&a(o,t))return}return e(o,...s)})},Lv=qe({patchProp:Dv},dv);let $u;function Mv(){return $u||($u=Im(Lv))}const Uv=(...e)=>{const t=Mv().createApp(...e);mn.NODE_ENV!=="production"&&(Bv(t),Hv(t));const{mount:n}=t;return t.mount=r=>{const o=Zv(r);if(!o)return;const s=t._component;!fe(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.innerHTML="";const i=n(o,!1,Fv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function Fv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bv(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>jp(t)||Lp(t)||Mp(t),writable:!1})}function Hv(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){jn("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=e.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(e.config,"compilerOptions",{get(){return jn(r),n},set(){jn(r)}})}}function Zv(e){if(Be(e)){const t=document.querySelector(e);return mn.NODE_ENV!=="production"&&!t&&jn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return mn.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&jn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var qv={};function Wv(){lv()}qv.NODE_ENV!=="production"&&Wv();let js;const zv=new Uint8Array(16);function Kv(){if(!js&&(js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return js(zv)}const st=[];for(let e=0;e<256;++e)st.push((e+256).toString(16).slice(1));function Gv(e,t=0){return st[e[t+0]]+st[e[t+1]]+st[e[t+2]]+st[e[t+3]]+"-"+st[e[t+4]]+st[e[t+5]]+"-"+st[e[t+6]]+st[e[t+7]]+"-"+st[e[t+8]]+st[e[t+9]]+"-"+st[e[t+10]]+st[e[t+11]]+st[e[t+12]]+st[e[t+13]]+st[e[t+14]]+st[e[t+15]]}const Iu={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _a(e,t,n){if(Iu.randomUUID&&!t&&!e)return Iu.randomUUID();e=e||{};const r=e.random||(e.rng||Kv)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Gv(r)}var Un=Symbol("storefront");function Jv(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var Yv=v.object({source:v.literal("moonbase-checkout"),event:v.literal("close"),next:v.string().optional()}),Xv=v.object({source:v.literal("moonbase-checkout"),event:v.literal("completed")}),Qv=v.discriminatedUnion("event",[Yv,Xv]);function Du(e){if(typeof window>"u"){console.warn("Can not mount checkout server side");return}const t=document.createElement("iframe");t.id="moonbase-checkout",t.src=e,t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.border="none",t.style.backgroundColor="transparent",t.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),t.setAttribute("background","transparent"),t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true"),t.height="100%",t.width="100%",document.body.append(t),window.onmessage=function(n){var r;try{const o=Qv.parse(n.data);o.event==="close"&&(document.body.contains(t)&&document.body.removeChild(t),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:o}))),o.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:o}))}catch(o){((r=n.data)==null?void 0:r.source)==="moonbase-checkout"&&console.error("Could not parse event:",n.data,o)}}}var Ls=class lt{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.hasUtm=X(()=>!!this.utm.value&&Object.values(this.utm.value).some(c=>!!c)),this.currentUser=T(null),this.loadedUser=T(!1),this.debouncedPushOrderContent=Jv(c=>this.client.orders.pushContent(c,void 0,this.hasUtm.value?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=T({id:_a(),status:eo.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1),this.utm=r(`${lt.storefrontKey}_utm`,void 0);return}const s=new URLSearchParams(window.location.search);this.utm=r(`${lt.storefrontKey}_utm`,{referrer:((o=window.document.referrer)==null?void 0:o.replace(/https?:\/\//g,"").split("/")[0])||void 0,source:s.get("utm_source")||void 0,medium:s.get("utm_medium")||void 0,campaign:s.get("utm_campaign")||void 0,term:s.get("utm_term")||void 0,content:s.get("utm_content")||void 0}),window.addEventListener("storage",c=>this.handleStorageUpdate(c));const i=localStorage.getItem(lt.sessionKey);i?(this.currentOrder=T(JSON.parse(i)),this.refreshOrder()):this.currentOrder=T({id:_a(),status:eo.Open,currency:"",items:[],couponsApplied:[]});const a=localStorage.getItem(lt.storefrontKey);if(a?(this.storefront=r(lt.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!0)):(this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1)),this.client.tokenStore.hasAccessToken&&(this.currentUser.value=this.client.tokenStore.user),this.updateStorefront(),this.updateUser(),window.location){const c=new URLSearchParams(window.location.search),l=c.get("mb_intent"),u=c.get("mb_endpoint");if(l==="checkout"&&c.get("mb_complete")&&u){const d=Object.fromEntries([...c.entries()].filter(([m])=>!m.startsWith("mb_"))),f=new URL(decodeURIComponent(u));for(const m of Object.keys(d))f.searchParams.append(m,d[m]);Du(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",()=>this.resetOrder())}get loadedStorefrontPromise(){return new Promise(t=>{Xe(this.loadedStorefront,n=>{n&&t()},{immediate:!0})})}get loadedUserPromise(){return new Promise(t=>{Xe(this.loadedUser,n=>{n&&t()},{immediate:!0})})}onCheckoutCompleted(t){window.addEventListener("moonbase-checkout-completed",()=>t())}onCheckoutClosed(t){window.addEventListener("moonbase-checkout-closed",n=>t(n.detail.next))}install(t){t.provide(Un,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(t){t instanceof pi||console.error("Could not load user",t)}finally{this.loadedUser.value=!0}}async updateStorefront(){const t=await this.client.storefront.get(this.hasUtm.value?this.utm.value:void 0);t&&(typeof window<"u"&&localStorage.setItem(lt.storefrontKey,JSON.stringify(t)),this.storefront.value=t,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=t.suggestedCurrency))}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(this.currentOrder.value)),this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(t){switch(t.key){case lt.sessionKey:this.currentOrder.value=JSON.parse(t.newValue);break;case lt.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break}}async refreshOrder(){try{const t=await this.client.orders.get(this.currentOrder.value.id);t&&(t.status!==eo.Open?this.resetOrder():(typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(t)),this.currentOrder.value=t))}catch(t){t!=null&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:_a(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:eo.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(lt.sessionKey)}};Ls.userKey="moonbase_user",Ls.sessionKey="moonbase_session",Ls.storefrontKey="moonbase_storefront";var eg=Ls;function Au(e,t){const n=t??$e(Un);if(!n)throw new Error("No storefront configured");return X(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function Vu(e,t){const n=t??$e(Un);if(!n)throw new Error("No storefront configured");return X(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function Ms(e){const t=$e(Un);if(!t)throw new Error("No storefront configured");return{getLicenses:async n=>t.client.inventory.licenses.get(n),getLicenseActivations:async(n,r)=>t.client.inventory.licenses.getActivations(n,r),getProduct:async(n,r)=>t.client.inventory.products.get(n,r),getProducts:async n=>t.client.inventory.products.getOwned(n),getProductLicenses:async(n,r)=>t.client.inventory.products.getLicenses(n,r),getProductActivations:async(n,r)=>t.client.inventory.products.getActivations(n,r),revokeActivation:async n=>t.client.inventory.licenses.revokeActivation(n.licenseId,n.id),activateProduct:async(n,r)=>t.client.inventory.activation.activate(n,r),downloadProduct:async n=>{if(!n.path)throw new Error("Product is not downloadable");window.location.href=await t.client.inventory.products.getDownloadUrl(n.path)}}}function tg(e,t){const n=$e(Un),r=hh(e);if(!r)throw new Error("No request ID was given when calling `useActivationRequest`");if(!n)throw new Error("No storefront configured");const o=n.stateFactory(`activation-request-${r}`,null),s=n.stateFactory(`activation-request-${r}-error`,null),i=n.stateFactory(`activation-request-${r}-loading`,!0),a=n.stateFactory(`activation-request-${r}-fulfilling`,!1),c=n.stateFactory(`activation-request-${r}-completing`,!1),l=n.stateFactory(`activation-request-${r}-completion-timeout`,null),u=async()=>{await n.client.activationRequests.isCompleted(r)&&o.value?(o.value.status=Ht.Completed,c.value=!1):l.value=setTimeout(u,1500)};return r&&r.length>0?n.client.activationRequests.get(r).then(d=>{o.value=d,o.value.status===Ht.Fulfilled&&(c.value=!0,u()),i.value=!1}).catch(d=>{s.value=d,i.value=!1}):(s.value=new Error("Missing request id"),i.value=!1),Zi(()=>{l.value&&clearTimeout(l.value)}),Xe(n.currentUser,async()=>{var d,f;if(!(!r||(f=(d=o.value)==null?void 0:d.licenseEligibility)!=null&&f.eligible)){i.value=!0;try{o.value=await n.client.activationRequests.get(r),o.value.status===Ht.Fulfilled&&(c.value=!0,u())}catch(m){s.value=m}i.value=!1}}),{activationRequest:o,loading:i,fulfilling:a,completing:c,error:s,isInstalled:X(()=>{var d;return o&&((d=o.value)==null?void 0:d.status)===Ht.Completed}),fulfillLicense:async()=>{a.value=!0,o.value=await n.client.activationRequests.fulfillLicense(r),a.value=!1,c.value=!0,u()},fulfillTrial:async()=>{a.value=!0,o.value=await n.client.activationRequests.fulfillTrial(r),a.value=!1,c.value=!0,u()},cancel:async()=>{var d;((d=o.value)==null?void 0:d.status)!==Ht.Cancelled&&(o.value=await n.client.activationRequests.cancel(r))}}}function ng(e){const t=$e(Un);if(!t)throw new Error("No storefront configured");return{peek:async n=>{try{return await t.client.vouchers.peek(n)}catch(r){throw r instanceof Pr?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await t.client.vouchers.redeem(n)}catch(r){throw r instanceof Pr?new Error("Voucher code invalid"):r}}}}function ba(e){const t=e??$e(Un);if(!t)throw new Error("No storefront configured");return{items:X(()=>t.currentOrder.value.items.map(n=>{if(n.type==="Product"){const r=t.storefront.value.products.find(i=>i.id===n.productId),s=((r==null?void 0:r.variations)||[]).find(i=>i.id===n.variationId);return{...n,product:r,variation:s,price:s==null?void 0:s.price}}else{const r=t.storefront.value.bundles.find(i=>i.id===n.bundleId),s=((r==null?void 0:r.variations)||[]).find(i=>i.id===n.variationId);return{...n,bundle:r,variation:s,price:s==null?void 0:s.price}}})),currency:X(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:X(()=>{const n=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((o,s)=>{var i,a,c,l,u,d;let f;if(s.type==="Product"){const m=t.storefront.value.products.find(S=>S.id===s.productId),E=((m==null?void 0:m.variations)||[]).find(S=>S.id===s.variationId);f=(c=(a=E==null?void 0:E.price[n])!=null?a:(i=m==null?void 0:m.defaultVariation)==null?void 0:i.price[n])!=null?c:0}else{const m=t.storefront.value.bundles.find(S=>S.id===s.bundleId),E=((m==null?void 0:m.variations)||[]).find(S=>S.id===s.variationId);f=(d=(u=E==null?void 0:E.price[n])!=null?u:(l=m==null?void 0:m.defaultVariation)==null?void 0:l.price[n])!=null?d:0}return o+f*s.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 o=`${n.type==="bundle"?"b":"p"}/${n.id}/${r.id}`;let s=t.currentOrder.value.items.find(i=>i.id===o);s?s.quantity+=1:n.type==="bundle"?(s={id:o,type:"Bundle",bundleId:n.id,bundle:n,quantity:1,variation:r,variationId:r.id,price:r.price},t.currentOrder.value.items.push(s)):n.type==="product"&&(s={id:o,type:"Product",productId:n.id,product:n,quantity:1,variation:r,variationId:r.id,price:r.price},t.currentOrder.value.items.push(s)),t.pushOrderContent()},setQuantity:(n,r)=>{const o=t.currentOrder.value.items.find(s=>s.id===n.id);if(!o)throw new Error("Cart item not found");if(o.quantity=r,o.quantity<=0){const s=t.currentOrder.value.items.findIndex(i=>i.id===o.id);t.currentOrder.value.items.splice(s,1)}t.pushOrderContent()},removeFromCart:n=>{const r=t.currentOrder.value.items.findIndex(o=>o.id===n.id);t.currentOrder.value.items.splice(r,1),t.pushOrderContent()},checkout:async n=>{const r=new URL(n,document.baseURI).href,o=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:r});if(o.embeddedCheckoutUrl&&typeof window<"u"){const s=o.embeddedCheckoutUrl;return new Promise(i=>{Du(s.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",a=>{i({next:a.detail.next})})})}else if(o.checkoutUrl&&typeof window<"u")window.location.href=o.checkoutUrl;else throw new Error("No checkout URL found")}}}function St(e){const t=e??$e(Un);if(!t)throw new Error("No storefront configured");return{user:t.currentUser,loaded:t.loadedUser,loadedPromise:t.loadedUserPromise,signIn:async(n,r)=>{const o=await t.client.identity.signIn(n,r);return t.currentUser.value=o,t.updateStorefront(),o},signUp:async(n,r,o,s,i,a,c)=>{const l=await t.client.identity.signUp(n,r,o,s,i,a,c);return t.currentUser.value=l,t.updateStorefront(),l},signOut:async()=>{t.client.tokenStore.setUser(null),await t.updateStorefront(),t.currentUser.value=null},update:async(n,r,o,s)=>{const i=await t.client.identity.update(n,r,o,s);return t.currentUser.value&&(t.currentUser.value.name=n,s&&(t.currentUser.value.communicationPreferences=s)),i},setPassword:async(n,r)=>{await t.client.identity.setPassword(n,r)},forgotPassword:async n=>{await t.client.identity.forgotPassword(n)},resetPassword:async(n,r,o)=>{await t.client.identity.resetPassword(n,r,o)},confirmAccount:async(n,r)=>await t.client.identity.confirmAccount(n,r),confirmEmail:async(n,r)=>await t.client.identity.confirmEmail(n,r),confirmEmailChange:async(n,r)=>{await t.client.identity.confirmEmailChange(n,r),t.updateUser()}}}function rg(e,t){const n={endpoint:e};return new eg(n,new Ep(n),(r,o)=>T(o))}var Ru=!1;function Us(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function wa(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function og(){return ju().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ju(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const sg=typeof Proxy=="function",ig="devtools-plugin:setup",ag="plugin:settings:set";let Ar,Ea;function lg(){var e;return Ar!==void 0||(typeof window<"u"&&window.performance?(Ar=!0,Ea=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Ar=!0,Ea=globalThis.perf_hooks.performance):Ar=!1),Ar}function cg(){return lg()?Ea.now():Date.now()}class ug{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const i in t.settings){const a=t.settings[i];r[i]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),a=JSON.parse(i);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return cg()}},n&&n.on(ag,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...c)=>{this.onQueue.push({method:a,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...c)=>(this.targetQueue.push({method:a,args:c,resolve:()=>{}}),this.fallbacks[a](...c)):(...c)=>new Promise(l=>{this.targetQueue.push({method:a,args:c,resolve:l})})})}async setRealTarget(t){this.target=t;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 Lu(e,t){const n=e,r=ju(),o=og(),s=sg&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(ig,e,t);else{const i=s?new ug(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var Pe={};let ko;const Co=e=>ko=e,Mu=Pe.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function gr(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Yt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Yt||(Yt={}));const yr=typeof window<"u",Uu=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 dg(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Oa(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){Hu(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function Fu(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Fs(e){try{e.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),e.dispatchEvent(n)}}const Bs=typeof navigator=="object"?navigator:{userAgent:""},Bu=/Macintosh/.test(Bs.userAgent)&&/AppleWebKit/.test(Bs.userAgent)&&!/Safari/.test(Bs.userAgent),Hu=yr?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Bu?fg:"msSaveOrOpenBlob"in Bs?pg:hg:()=>{};function fg(e,t="download",n){const r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,r.origin!==location.origin?Fu(r.href)?Oa(e,t,n):(r.target="_blank",Fs(r)):Fs(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Fs(r)},0))}function pg(e,t="download",n){if(typeof e=="string")if(Fu(e))Oa(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Fs(r)})}else navigator.msSaveOrOpenBlob(dg(e,n),t)}function hg(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return Oa(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Uu.HTMLElement))||"safari"in Uu,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||Bu)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let c=a.result;if(typeof c!="string")throw r=null,new Error("Wrong reader.result type");c=i?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=c:location.assign(c),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function tt(e,t){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function Na(e){return"_a"in e&&"install"in e}function Zu(){if(!("clipboard"in navigator))return tt("Your browser doesn't support the Clipboard API","error"),!0}function qu(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(tt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function mg(e){if(!Zu())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),tt("Global state copied to clipboard.")}catch(t){if(qu(t))return;tt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function vg(e){if(!Zu())try{Wu(e,JSON.parse(await navigator.clipboard.readText())),tt("Global state pasted from clipboard.")}catch(t){if(qu(t))return;tt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function gg(e){try{Hu(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){tt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let gn;function yg(){gn||(gn=document.createElement("input"),gn.type="file",gn.accept=".json");function e(){return new Promise((t,n)=>{gn.onchange=async()=>{const r=gn.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},gn.oncancel=()=>t(null),gn.onerror=n,gn.click()})}return e}async function _g(e){try{const n=await yg()();if(!n)return;const{text:r,file:o}=n;Wu(e,JSON.parse(r)),tt(`Global state imported from "${o.name}".`)}catch(t){tt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function Wu(e,t){for(const n in t){const r=e.state.value[n];r?Object.assign(r,t[n]):e.state.value[n]=t[n]}}function Lt(e){return{_custom:{display:e}}}const zu="🍍 Pinia (root)",Hs="_root";function bg(e){return Na(e)?{id:Hs,label:zu}:{id:e.$id,label:e.$id}}function wg(e){if(Na(e)){const n=Array.from(e._s.keys()),r=e._s;return{state:n.map(s=>({editable:!0,key:s,value:e.state.value[s]})),getters:n.filter(s=>r.get(s)._getters).map(s=>{const i=r.get(s);return{editable:!1,key:s,value:i._getters.reduce((a,c)=>(a[c]=i[c],a),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function Eg(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:Lt(e.type),key:Lt(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Og(e){switch(e){case Yt.direct:return"mutation";case Yt.patchFunction:return"$patch";case Yt.patchObject:return"$patch";default:return"unknown"}}let Vr=!0;const Zs=[],_r="pinia:mutations",pt="pinia",{assign:Ng}=Object,qs=e=>"🍍 "+e;function Sg(e,t){Lu({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Zs,app:e},n=>{typeof n.now!="function"&&tt("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:_r,label:"Pinia 🍍",color:15064968}),n.addInspector({id:pt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{mg(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await vg(t),n.sendInspectorTree(pt),n.sendInspectorState(pt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{gg(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await _g(t),n.sendInspectorTree(pt),n.sendInspectorState(pt)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const o=t._s.get(r);o?typeof o.$reset!="function"?tt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),tt(`Store "${r}" reset.`)):tt(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,o)=>{const s=r.componentInstance&&r.componentInstance.proxy;if(s&&s._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:qs(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:ge(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((c,l)=>(c[l]=a.$state[l],c),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:qs(a.$id),key:"getters",editable:!1,value:a._getters.reduce((c,l)=>{try{c[l]=a[l]}catch(u){c[l]=u}return c},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===pt){let o=[t];o=o.concat(Array.from(t._s.values())),r.rootNodes=(r.filter?o.filter(s=>"$id"in s?s.$id.toLowerCase().includes(r.filter.toLowerCase()):zu.toLowerCase().includes(r.filter.toLowerCase())):o).map(bg)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===pt){const o=r.nodeId===Hs?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==Hs&&(globalThis.$store=ge(o)),r.state=wg(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===pt){const s=r.nodeId===Hs?t:t._s.get(r.nodeId);if(!s)return tt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Na(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Vr=!1,r.set(s,i,r.state.value),Vr=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return tt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return tt(`Invalid path for store "${o}":
|
|
16
|
+
Expected function or array of functions, received type ${typeof e}.`),We)}function Iv(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>o=>!o._stopped&&r&&r(o))}else return t}const Pu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Dv=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?gv(e,r,i):t==="style"?wv(e,n,r):no(t)?Qo(t)||kv(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Av(e,t,r,i))?(Nv(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&xu(e,t,r,i,s,t!=="value")):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),xu(e,t,r,i))};function Av(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Pu(t)&&fe(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Pu(t)&&Be(n)?!1:t in e}const Vv=["ctrl","shift","alt","meta"],Rv={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Vv.some(n=>e[`${n}Key`]&&!t.includes(n))},jv=(e,t)=>{const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=(o,...s)=>{for(let i=0;i<t.length;i++){const a=Rv[t[i]];if(a&&a(o,t))return}return e(o,...s)})},Lv=qe({patchProp:Dv},dv);let $u;function Mv(){return $u||($u=Im(Lv))}const Uv=(...e)=>{const t=Mv().createApp(...e);mn.NODE_ENV!=="production"&&(Bv(t),Hv(t));const{mount:n}=t;return t.mount=r=>{const o=Zv(r);if(!o)return;const s=t._component;!fe(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.innerHTML="";const i=n(o,!1,Fv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function Fv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bv(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>jp(t)||Lp(t)||Mp(t),writable:!1})}function Hv(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){jn("The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead.")}});const n=e.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(e.config,"compilerOptions",{get(){return jn(r),n},set(){jn(r)}})}}function Zv(e){if(Be(e)){const t=document.querySelector(e);return mn.NODE_ENV!=="production"&&!t&&jn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return mn.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&jn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var qv={};function Wv(){lv()}qv.NODE_ENV!=="production"&&Wv();let js;const zv=new Uint8Array(16);function Kv(){if(!js&&(js=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!js))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return js(zv)}const st=[];for(let e=0;e<256;++e)st.push((e+256).toString(16).slice(1));function Gv(e,t=0){return st[e[t+0]]+st[e[t+1]]+st[e[t+2]]+st[e[t+3]]+"-"+st[e[t+4]]+st[e[t+5]]+"-"+st[e[t+6]]+st[e[t+7]]+"-"+st[e[t+8]]+st[e[t+9]]+"-"+st[e[t+10]]+st[e[t+11]]+st[e[t+12]]+st[e[t+13]]+st[e[t+14]]+st[e[t+15]]}const Iu={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _a(e,t,n){if(Iu.randomUUID&&!t&&!e)return Iu.randomUUID();e=e||{};const r=e.random||(e.rng||Kv)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Gv(r)}var Un=Symbol("storefront");function Jv(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var Yv=v.object({source:v.literal("moonbase-checkout"),event:v.literal("close"),next:v.string().optional()}),Xv=v.object({source:v.literal("moonbase-checkout"),event:v.literal("completed")}),Qv=v.discriminatedUnion("event",[Yv,Xv]);function Du(e){if(typeof window>"u"){console.warn("Can not mount checkout server side");return}const t=document.createElement("iframe");t.id="moonbase-checkout",t.src=e,t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.border="none",t.style.colorScheme="normal",t.style.backgroundColor="transparent",t.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),t.setAttribute("background","transparent"),t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true"),t.height="100%",t.width="100%",document.body.append(t),window.onmessage=function(n){var r;try{const o=Qv.parse(n.data);o.event==="close"&&(document.body.contains(t)&&document.body.removeChild(t),window.dispatchEvent(new CustomEvent("moonbase-checkout-closed",{detail:o}))),o.event==="completed"&&window.dispatchEvent(new CustomEvent("moonbase-checkout-completed",{detail:o}))}catch(o){((r=n.data)==null?void 0:r.source)==="moonbase-checkout"&&console.error("Could not parse event:",n.data,o)}}}var Ls=class lt{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.hasUtm=X(()=>!!this.utm.value&&Object.values(this.utm.value).some(c=>!!c)),this.currentUser=T(null),this.loadedUser=T(!1),this.debouncedPushOrderContent=Jv(c=>this.client.orders.pushContent(c,void 0,this.hasUtm.value?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=T({id:_a(),status:eo.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1),this.utm=r(`${lt.storefrontKey}_utm`,void 0);return}const s=new URLSearchParams(window.location.search);this.utm=r(`${lt.storefrontKey}_utm`,{referrer:((o=window.document.referrer)==null?void 0:o.replace(/https?:\/\//g,"").split("/")[0])||void 0,source:s.get("utm_source")||void 0,medium:s.get("utm_medium")||void 0,campaign:s.get("utm_campaign")||void 0,term:s.get("utm_term")||void 0,content:s.get("utm_content")||void 0}),window.addEventListener("storage",c=>this.handleStorageUpdate(c));const i=localStorage.getItem(lt.sessionKey);i?(this.currentOrder=T(JSON.parse(i)),this.refreshOrder()):this.currentOrder=T({id:_a(),status:eo.Open,currency:"",items:[],couponsApplied:[]});const a=localStorage.getItem(lt.storefrontKey);if(a?(this.storefront=r(lt.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!0)):(this.storefront=r(lt.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${lt.storefrontKey}_loaded`,!1)),this.client.tokenStore.hasAccessToken&&(this.currentUser.value=this.client.tokenStore.user),this.updateStorefront(),this.updateUser(),window.location){const c=new URLSearchParams(window.location.search),l=c.get("mb_intent"),u=c.get("mb_endpoint");if(l==="checkout"&&c.get("mb_complete")&&u){const d=Object.fromEntries([...c.entries()].filter(([m])=>!m.startsWith("mb_"))),f=new URL(decodeURIComponent(u));for(const m of Object.keys(d))f.searchParams.append(m,d[m]);Du(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",()=>this.resetOrder())}get loadedStorefrontPromise(){return new Promise(t=>{Xe(this.loadedStorefront,n=>{n&&t()},{immediate:!0})})}get loadedUserPromise(){return new Promise(t=>{Xe(this.loadedUser,n=>{n&&t()},{immediate:!0})})}onCheckoutCompleted(t){window.addEventListener("moonbase-checkout-completed",()=>t())}onCheckoutClosed(t){window.addEventListener("moonbase-checkout-closed",n=>t(n.detail.next))}install(t){t.provide(Un,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(t){t instanceof pi||console.error("Could not load user",t)}finally{this.loadedUser.value=!0}}async updateStorefront(){const t=await this.client.storefront.get(this.hasUtm.value?this.utm.value:void 0);t&&(typeof window<"u"&&localStorage.setItem(lt.storefrontKey,JSON.stringify(t)),this.storefront.value=t,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=t.suggestedCurrency))}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(this.currentOrder.value)),this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(t){switch(t.key){case lt.sessionKey:this.currentOrder.value=JSON.parse(t.newValue);break;case lt.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break}}async refreshOrder(){try{const t=await this.client.orders.get(this.currentOrder.value.id);t&&(t.status!==eo.Open?this.resetOrder():(typeof window<"u"&&localStorage.setItem(lt.sessionKey,JSON.stringify(t)),this.currentOrder.value=t))}catch(t){t!=null&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:_a(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:eo.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(lt.sessionKey)}};Ls.userKey="moonbase_user",Ls.sessionKey="moonbase_session",Ls.storefrontKey="moonbase_storefront";var eg=Ls;function Au(e,t){const n=t??$e(Un);if(!n)throw new Error("No storefront configured");return X(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function Vu(e,t){const n=t??$e(Un);if(!n)throw new Error("No storefront configured");return X(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function Ms(e){const t=$e(Un);if(!t)throw new Error("No storefront configured");return{getLicenses:async n=>t.client.inventory.licenses.get(n),getLicenseActivations:async(n,r)=>t.client.inventory.licenses.getActivations(n,r),getProduct:async(n,r)=>t.client.inventory.products.get(n,r),getProducts:async n=>t.client.inventory.products.getOwned(n),getProductLicenses:async(n,r)=>t.client.inventory.products.getLicenses(n,r),getProductActivations:async(n,r)=>t.client.inventory.products.getActivations(n,r),revokeActivation:async n=>t.client.inventory.licenses.revokeActivation(n.licenseId,n.id),activateProduct:async(n,r)=>t.client.inventory.activation.activate(n,r),downloadProduct:async n=>{if(!n.path)throw new Error("Product is not downloadable");window.location.href=await t.client.inventory.products.getDownloadUrl(n.path)}}}function tg(e,t){const n=$e(Un),r=hh(e);if(!r)throw new Error("No request ID was given when calling `useActivationRequest`");if(!n)throw new Error("No storefront configured");const o=n.stateFactory(`activation-request-${r}`,null),s=n.stateFactory(`activation-request-${r}-error`,null),i=n.stateFactory(`activation-request-${r}-loading`,!0),a=n.stateFactory(`activation-request-${r}-fulfilling`,!1),c=n.stateFactory(`activation-request-${r}-completing`,!1),l=n.stateFactory(`activation-request-${r}-completion-timeout`,null),u=async()=>{await n.client.activationRequests.isCompleted(r)&&o.value?(o.value.status=Ht.Completed,c.value=!1):l.value=setTimeout(u,1500)};return r&&r.length>0?n.client.activationRequests.get(r).then(d=>{o.value=d,o.value.status===Ht.Fulfilled&&(c.value=!0,u()),i.value=!1}).catch(d=>{s.value=d,i.value=!1}):(s.value=new Error("Missing request id"),i.value=!1),Zi(()=>{l.value&&clearTimeout(l.value)}),Xe(n.currentUser,async()=>{var d,f;if(!(!r||(f=(d=o.value)==null?void 0:d.licenseEligibility)!=null&&f.eligible)){i.value=!0;try{o.value=await n.client.activationRequests.get(r),o.value.status===Ht.Fulfilled&&(c.value=!0,u())}catch(m){s.value=m}i.value=!1}}),{activationRequest:o,loading:i,fulfilling:a,completing:c,error:s,isInstalled:X(()=>{var d;return o&&((d=o.value)==null?void 0:d.status)===Ht.Completed}),fulfillLicense:async()=>{a.value=!0,o.value=await n.client.activationRequests.fulfillLicense(r),a.value=!1,c.value=!0,u()},fulfillTrial:async()=>{a.value=!0,o.value=await n.client.activationRequests.fulfillTrial(r),a.value=!1,c.value=!0,u()},cancel:async()=>{var d;((d=o.value)==null?void 0:d.status)!==Ht.Cancelled&&(o.value=await n.client.activationRequests.cancel(r))}}}function ng(e){const t=$e(Un);if(!t)throw new Error("No storefront configured");return{peek:async n=>{try{return await t.client.vouchers.peek(n)}catch(r){throw r instanceof Pr?new Error("Voucher code invalid"):r}},redeem:async n=>{try{return await t.client.vouchers.redeem(n)}catch(r){throw r instanceof Pr?new Error("Voucher code invalid"):r}}}}function ba(e){const t=e??$e(Un);if(!t)throw new Error("No storefront configured");return{items:X(()=>t.currentOrder.value.items.map(n=>{if(n.type==="Product"){const r=t.storefront.value.products.find(i=>i.id===n.productId),s=((r==null?void 0:r.variations)||[]).find(i=>i.id===n.variationId);return{...n,product:r,variation:s,price:s==null?void 0:s.price}}else{const r=t.storefront.value.bundles.find(i=>i.id===n.bundleId),s=((r==null?void 0:r.variations)||[]).find(i=>i.id===n.variationId);return{...n,bundle:r,variation:s,price:s==null?void 0:s.price}}})),currency:X(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:X(()=>{const n=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((o,s)=>{var i,a,c,l,u,d;let f;if(s.type==="Product"){const m=t.storefront.value.products.find(S=>S.id===s.productId),E=((m==null?void 0:m.variations)||[]).find(S=>S.id===s.variationId);f=(c=(a=E==null?void 0:E.price[n])!=null?a:(i=m==null?void 0:m.defaultVariation)==null?void 0:i.price[n])!=null?c:0}else{const m=t.storefront.value.bundles.find(S=>S.id===s.bundleId),E=((m==null?void 0:m.variations)||[]).find(S=>S.id===s.variationId);f=(d=(u=E==null?void 0:E.price[n])!=null?u:(l=m==null?void 0:m.defaultVariation)==null?void 0:l.price[n])!=null?d:0}return o+f*s.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 o=`${n.type==="bundle"?"b":"p"}/${n.id}/${r.id}`;let s=t.currentOrder.value.items.find(i=>i.id===o);s?s.quantity+=1:n.type==="bundle"?(s={id:o,type:"Bundle",bundleId:n.id,bundle:n,quantity:1,variation:r,variationId:r.id,price:r.price},t.currentOrder.value.items.push(s)):n.type==="product"&&(s={id:o,type:"Product",productId:n.id,product:n,quantity:1,variation:r,variationId:r.id,price:r.price},t.currentOrder.value.items.push(s)),t.pushOrderContent()},setQuantity:(n,r)=>{const o=t.currentOrder.value.items.find(s=>s.id===n.id);if(!o)throw new Error("Cart item not found");if(o.quantity=r,o.quantity<=0){const s=t.currentOrder.value.items.findIndex(i=>i.id===o.id);t.currentOrder.value.items.splice(s,1)}t.pushOrderContent()},removeFromCart:n=>{const r=t.currentOrder.value.items.findIndex(o=>o.id===n.id);t.currentOrder.value.items.splice(r,1),t.pushOrderContent()},checkout:async n=>{const r=new URL(n,document.baseURI).href,o=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:r});if(o.embeddedCheckoutUrl&&typeof window<"u"){const s=o.embeddedCheckoutUrl;return new Promise(i=>{Du(s.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",a=>{i({next:a.detail.next})})})}else{if(o.checkoutUrl&&typeof window<"u")return window.location.href=o.checkoutUrl,{next:void 0};throw new Error("No checkout URL found")}}}}function St(e){const t=e??$e(Un);if(!t)throw new Error("No storefront configured");return{user:t.currentUser,loaded:t.loadedUser,loadedPromise:t.loadedUserPromise,signIn:async(n,r)=>{const o=await t.client.identity.signIn(n,r);return t.currentUser.value=o,t.updateStorefront(),o},signUp:async(n,r,o,s,i,a,c)=>{const l=await t.client.identity.signUp(n,r,o,s,i,a,c);return t.currentUser.value=l,t.updateStorefront(),l},signOut:async()=>{t.client.tokenStore.setUser(null),await t.updateStorefront(),t.currentUser.value=null},update:async(n,r,o,s)=>{const i=await t.client.identity.update(n,r,o,s);return t.currentUser.value&&(t.currentUser.value.name=n,s&&(t.currentUser.value.communicationPreferences=s)),i},setPassword:async(n,r)=>{await t.client.identity.setPassword(n,r)},forgotPassword:async n=>{await t.client.identity.forgotPassword(n)},resetPassword:async(n,r,o)=>{await t.client.identity.resetPassword(n,r,o)},confirmAccount:async(n,r)=>await t.client.identity.confirmAccount(n,r),confirmEmail:async(n,r)=>await t.client.identity.confirmEmail(n,r),confirmEmailChange:async(n,r)=>{await t.client.identity.confirmEmailChange(n,r),t.updateUser()}}}function rg(e,t){const n={endpoint:e};return new eg(n,new Ep(n),(r,o)=>T(o))}var Ru=!1;function Us(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)}function wa(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function og(){return ju().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ju(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const sg=typeof Proxy=="function",ig="devtools-plugin:setup",ag="plugin:settings:set";let Ar,Ea;function lg(){var e;return Ar!==void 0||(typeof window<"u"&&window.performance?(Ar=!0,Ea=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Ar=!0,Ea=globalThis.perf_hooks.performance):Ar=!1),Ar}function cg(){return lg()?Ea.now():Date.now()}class ug{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const i in t.settings){const a=t.settings[i];r[i]=a.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let s=Object.assign({},r);try{const i=localStorage.getItem(o),a=JSON.parse(i);Object.assign(s,a)}catch{}this.fallbacks={getSettings(){return s},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}s=i},now(){return cg()}},n&&n.on(ag,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...c)=>{this.onQueue.push({method:a,args:c})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...c)=>(this.targetQueue.push({method:a,args:c,resolve:()=>{}}),this.fallbacks[a](...c)):(...c)=>new Promise(l=>{this.targetQueue.push({method:a,args:c,resolve:l})})})}async setRealTarget(t){this.target=t;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 Lu(e,t){const n=e,r=ju(),o=og(),s=sg&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(ig,e,t);else{const i=s?new ug(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var Pe={};let ko;const Co=e=>ko=e,Mu=Pe.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function gr(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Yt;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Yt||(Yt={}));const yr=typeof window<"u",Uu=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 dg(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Oa(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){Hu(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function Fu(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Fs(e){try{e.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),e.dispatchEvent(n)}}const Bs=typeof navigator=="object"?navigator:{userAgent:""},Bu=/Macintosh/.test(Bs.userAgent)&&/AppleWebKit/.test(Bs.userAgent)&&!/Safari/.test(Bs.userAgent),Hu=yr?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!Bu?fg:"msSaveOrOpenBlob"in Bs?pg:hg:()=>{};function fg(e,t="download",n){const r=document.createElement("a");r.download=t,r.rel="noopener",typeof e=="string"?(r.href=e,r.origin!==location.origin?Fu(r.href)?Oa(e,t,n):(r.target="_blank",Fs(r)):Fs(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Fs(r)},0))}function pg(e,t="download",n){if(typeof e=="string")if(Fu(e))Oa(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){Fs(r)})}else navigator.msSaveOrOpenBlob(dg(e,n),t)}function hg(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return Oa(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(Uu.HTMLElement))||"safari"in Uu,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||Bu)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let c=a.result;if(typeof c!="string")throw r=null,new Error("Wrong reader.result type");c=i?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=c:location.assign(c),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function tt(e,t){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function Na(e){return"_a"in e&&"install"in e}function Zu(){if(!("clipboard"in navigator))return tt("Your browser doesn't support the Clipboard API","error"),!0}function qu(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(tt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function mg(e){if(!Zu())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),tt("Global state copied to clipboard.")}catch(t){if(qu(t))return;tt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function vg(e){if(!Zu())try{Wu(e,JSON.parse(await navigator.clipboard.readText())),tt("Global state pasted from clipboard.")}catch(t){if(qu(t))return;tt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function gg(e){try{Hu(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){tt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let gn;function yg(){gn||(gn=document.createElement("input"),gn.type="file",gn.accept=".json");function e(){return new Promise((t,n)=>{gn.onchange=async()=>{const r=gn.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},gn.oncancel=()=>t(null),gn.onerror=n,gn.click()})}return e}async function _g(e){try{const n=await yg()();if(!n)return;const{text:r,file:o}=n;Wu(e,JSON.parse(r)),tt(`Global state imported from "${o.name}".`)}catch(t){tt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function Wu(e,t){for(const n in t){const r=e.state.value[n];r?Object.assign(r,t[n]):e.state.value[n]=t[n]}}function Lt(e){return{_custom:{display:e}}}const zu="🍍 Pinia (root)",Hs="_root";function bg(e){return Na(e)?{id:Hs,label:zu}:{id:e.$id,label:e.$id}}function wg(e){if(Na(e)){const n=Array.from(e._s.keys()),r=e._s;return{state:n.map(s=>({editable:!0,key:s,value:e.state.value[s]})),getters:n.filter(s=>r.get(s)._getters).map(s=>{const i=r.get(s);return{editable:!1,key:s,value:i._getters.reduce((a,c)=>(a[c]=i[c],a),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function Eg(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:Lt(e.type),key:Lt(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Og(e){switch(e){case Yt.direct:return"mutation";case Yt.patchFunction:return"$patch";case Yt.patchObject:return"$patch";default:return"unknown"}}let Vr=!0;const Zs=[],_r="pinia:mutations",pt="pinia",{assign:Ng}=Object,qs=e=>"🍍 "+e;function Sg(e,t){Lu({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Zs,app:e},n=>{typeof n.now!="function"&&tt("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:_r,label:"Pinia 🍍",color:15064968}),n.addInspector({id:pt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{mg(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await vg(t),n.sendInspectorTree(pt),n.sendInspectorState(pt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{gg(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await _g(t),n.sendInspectorTree(pt),n.sendInspectorState(pt)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:r=>{const o=t._s.get(r);o?typeof o.$reset!="function"?tt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),tt(`Store "${r}" reset.`)):tt(`Cannot reset "${r}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent((r,o)=>{const s=r.componentInstance&&r.componentInstance.proxy;if(s&&s._pStores){const i=r.componentInstance.proxy._pStores;Object.values(i).forEach(a=>{r.instanceData.state.push({type:qs(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:ge(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((c,l)=>(c[l]=a.$state[l],c),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:qs(a.$id),key:"getters",editable:!1,value:a._getters.reduce((c,l)=>{try{c[l]=a[l]}catch(u){c[l]=u}return c},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===pt){let o=[t];o=o.concat(Array.from(t._s.values())),r.rootNodes=(r.filter?o.filter(s=>"$id"in s?s.$id.toLowerCase().includes(r.filter.toLowerCase()):zu.toLowerCase().includes(r.filter.toLowerCase())):o).map(bg)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===pt){const o=r.nodeId===Hs?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==Hs&&(globalThis.$store=ge(o)),r.state=wg(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===pt){const s=r.nodeId===Hs?t:t._s.get(r.nodeId);if(!s)return tt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;Na(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Vr=!1,r.set(s,i,r.state.value),Vr=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return tt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return tt(`Invalid path for store "${o}":
|
|
17
17
|
${i}
|
|
18
18
|
Only state can be modified.`);i[0]="$state",Vr=!1,r.set(s,i,r.state.value),Vr=!0}})})}function xg(e,t){Zs.includes(qs(t.$id))||Zs.push(qs(t.$id)),Lu({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Zs,app:e,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;t.$onAction(({after:i,onError:a,name:c,args:l})=>{const u=Ku++;n.addTimelineEvent({layerId:_r,event:{time:r(),title:"🛫 "+c,subtitle:"start",data:{store:Lt(t.$id),action:Lt(c),args:l},groupId:u}}),i(d=>{Fn=void 0,n.addTimelineEvent({layerId:_r,event:{time:r(),title:"🛬 "+c,subtitle:"end",data:{store:Lt(t.$id),action:Lt(c),args:l,result:d},groupId:u}})}),a(d=>{Fn=void 0,n.addTimelineEvent({layerId:_r,event:{time:r(),logType:"error",title:"💥 "+c,subtitle:"end",data:{store:Lt(t.$id),action:Lt(c),args:l,error:d},groupId:u}})})},!0),t._customProperties.forEach(i=>{Xe(()=>b(t[i]),(a,c)=>{n.notifyComponentUpdate(),n.sendInspectorState(pt),Vr&&n.addTimelineEvent({layerId:_r,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:c},groupId:Fn}})},{deep:!0})}),t.$subscribe(({events:i,type:a},c)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(pt),!Vr)return;const l={time:r(),title:Og(a),data:Ng({store:Lt(t.$id)},Eg(i)),groupId:Fn};a===Yt.patchFunction?l.subtitle="⤵️":a===Yt.patchObject?l.subtitle="🧩":i&&!Array.isArray(i)&&(l.subtitle=i.type),i&&(l.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:_r,event:l})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=$n(i=>{o(i),n.addTimelineEvent({layerId:_r,event:{time:r(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:Lt(t.$id),info:Lt("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(pt),n.sendInspectorState(pt)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(pt),n.sendInspectorState(pt),n.getSettings().logStoreChanges&&tt(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(pt),n.sendInspectorState(pt),n.getSettings().logStoreChanges&&tt(`"${t.$id}" store installed 🆕`)})}let Ku=0,Fn;function Gu(e,t,n){const r=t.reduce((o,s)=>(o[s]=ge(e)[s],o),{});for(const o in r)e[o]=function(){const s=Ku,i=n?new Proxy(e,{get(...c){return Fn=s,Reflect.get(...c)},set(...c){return Fn=s,Reflect.set(...c)}}):e;Fn=s;const a=r[o].apply(i,arguments);return Fn=void 0,a}}function kg({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){Gu(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;ge(t)._hotUpdate=function(o){r.apply(this,arguments),Gu(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)}}xg(e,t)}}function Cg(){const e=Cl(!0),t=e.run(()=>T({}));let n=[],r=[];const o=$n({install(s){Co(o),o._a=s,s.provide(Mu,o),s.config.globalProperties.$pinia=o,Pe.NODE_ENV!=="production"&&Pe.NODE_ENV!=="test"&&yr&&Sg(s,o),r.forEach(i=>n.push(i)),r=[]},use(s){return!this._a&&!Ru?r.push(s):n.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return Pe.NODE_ENV!=="production"&&Pe.NODE_ENV!=="test"&&typeof Proxy<"u"&&o.use(kg),o}function Ju(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];gr(o)&&gr(r)&&!He(r)&&!ln(r)?e[n]=Ju(o,r):e[n]=r}return e}const Yu=()=>{};function Xu(e,t,n,r=Yu){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&Tl()&&Bp(o),o}function Rr(e,...t){e.slice().forEach(n=>{n(...t)})}const Tg=e=>e(),Qu=Symbol(),Sa=Symbol();function xa(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,r)=>e.set(r,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];gr(o)&&gr(r)&&e.hasOwnProperty(n)&&!He(r)&&!ln(r)?e[n]=xa(o,r):e[n]=r}return e}const Pg=Pe.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function $g(e){return!gr(e)||!e.hasOwnProperty(Pg)}const{assign:Tt}=Object;function ed(e){return!!(He(e)&&e.effect)}function td(e,t,n,r){const{state:o,actions:s,getters:i}=t,a=n.state.value[e];let c;function l(){!a&&(Pe.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const u=Pe.NODE_ENV!=="production"&&r?nc(T(o?o():{}).value):nc(n.state.value[e]);return Tt(u,s,Object.keys(i||{}).reduce((d,f)=>(Pe.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 "${e}".`),d[f]=$n(X(()=>{Co(n);const m=n._s.get(e);return i[f].call(m,m)})),d),{}))}return c=ka(e,l,t,n,r,!0),c}function ka(e,t,n={},r,o,s){let i;const a=Tt({actions:{}},n);if(Pe.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const c={deep:!0};Pe.NODE_ENV!=="production"&&!Ru&&(c.onTrigger=V=>{l?m=V:l==!1&&!x._hotUpdating&&(Array.isArray(m)?m.push(V):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let l,u,d=[],f=[],m;const y=r.state.value[e];!s&&!y&&(Pe.NODE_ENV==="production"||!o)&&(r.state.value[e]={});const E=T({});let S;function A(V){let P;l=u=!1,Pe.NODE_ENV!=="production"&&(m=[]),typeof V=="function"?(V(r.state.value[e]),P={type:Yt.patchFunction,storeId:e,events:m}):(xa(r.state.value[e],V),P={type:Yt.patchObject,payload:V,storeId:e,events:m});const j=S=Symbol();co().then(()=>{S===j&&(l=!0)}),u=!0,Rr(d,P,r.state.value[e])}const F=s?function(){const{state:P}=n,j=P?P():{};this.$patch(oe=>{Tt(oe,j)})}:Pe.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:Yu;function C(){i.stop(),d=[],f=[],r._s.delete(e)}const z=(V,P="")=>{if(Qu in V)return V[Sa]=P,V;const j=function(){Co(r);const oe=Array.from(arguments),w=[],I=[];function ne(ce){w.push(ce)}function ae(ce){I.push(ce)}Rr(f,{args:oe,name:j[Sa],store:x,after:ne,onError:ae});let re;try{re=V.apply(this&&this.$id===e?this:x,oe)}catch(ce){throw Rr(I,ce),ce}return re instanceof Promise?re.then(ce=>(Rr(w,ce),ce)).catch(ce=>(Rr(I,ce),Promise.reject(ce))):(Rr(w,re),re)};return j[Qu]=!0,j[Sa]=P,j},$=$n({actions:{},getters:{},state:[],hotState:E}),Z={_p:r,$id:e,$onAction:Xu.bind(null,f),$patch:A,$reset:F,$subscribe(V,P={}){const j=Xu(d,V,P.detached,()=>oe()),oe=i.run(()=>Xe(()=>r.state.value[e],w=>{(P.flush==="sync"?u:l)&&V({storeId:e,type:Yt.direct,events:m},w)},Tt({},c,P)));return j},$dispose:C},x=so(Pe.NODE_ENV!=="production"||Pe.NODE_ENV!=="production"&&Pe.NODE_ENV!=="test"&&yr?Tt({_hmrPayload:$,_customProperties:$n(new Set)},Z):Z);r._s.set(e,x);const Y=(r._a&&r._a.runWithContext||Tg)(()=>r._e.run(()=>(i=Cl()).run(()=>t({action:z}))));for(const V in Y){const P=Y[V];if(He(P)&&!ed(P)||ln(P))Pe.NODE_ENV!=="production"&&o?Us(E.value,V,Di(Y,V)):s||(y&&$g(P)&&(He(P)?P.value=y[V]:xa(P,y[V])),r.state.value[e][V]=P),Pe.NODE_ENV!=="production"&&$.state.push(V);else if(typeof P=="function"){const j=Pe.NODE_ENV!=="production"&&o?P:z(P,V);Y[V]=j,Pe.NODE_ENV!=="production"&&($.actions[V]=P),a.actions[V]=P}else Pe.NODE_ENV!=="production"&&ed(P)&&($.getters[V]=s?n.getters[V]:P,yr&&(Y._getters||(Y._getters=$n([]))).push(V))}if(Tt(x,Y),Tt(ge(x),Y),Object.defineProperty(x,"$state",{get:()=>Pe.NODE_ENV!=="production"&&o?E.value:r.state.value[e],set:V=>{if(Pe.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");A(P=>{Tt(P,V)})}}),Pe.NODE_ENV!=="production"&&(x._hotUpdate=$n(V=>{x._hotUpdating=!0,V._hmrPayload.state.forEach(P=>{if(P in x.$state){const j=V.$state[P],oe=x.$state[P];typeof j=="object"&&gr(j)&&gr(oe)?Ju(j,oe):V.$state[P]=oe}Us(x,P,Di(V.$state,P))}),Object.keys(x.$state).forEach(P=>{P in V.$state||wa(x,P)}),l=!1,u=!1,r.state.value[e]=Di(V._hmrPayload,"hotState"),u=!0,co().then(()=>{l=!0});for(const P in V._hmrPayload.actions){const j=V[P];Us(x,P,z(j,P))}for(const P in V._hmrPayload.getters){const j=V._hmrPayload.getters[P],oe=s?X(()=>(Co(r),j.call(x,x))):j;Us(x,P,oe)}Object.keys(x._hmrPayload.getters).forEach(P=>{P in V._hmrPayload.getters||wa(x,P)}),Object.keys(x._hmrPayload.actions).forEach(P=>{P in V._hmrPayload.actions||wa(x,P)}),x._hmrPayload=V._hmrPayload,x._getters=V._getters,x._hotUpdating=!1})),Pe.NODE_ENV!=="production"&&Pe.NODE_ENV!=="test"&&yr){const V={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(P=>{Object.defineProperty(x,P,Tt({value:x[P]},V))})}return r._p.forEach(V=>{if(Pe.NODE_ENV!=="production"&&Pe.NODE_ENV!=="test"&&yr){const P=i.run(()=>V({store:x,app:r._a,pinia:r,options:a}));Object.keys(P||{}).forEach(j=>x._customProperties.add(j)),Tt(x,P)}else Tt(x,i.run(()=>V({store:x,app:r._a,pinia:r,options:a})))}),Pe.NODE_ENV!=="production"&&x.$state&&typeof x.$state=="object"&&typeof x.$state.constructor=="function"&&!x.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
19
19
|
state: () => new MyClass()
|
|
@@ -22,4 +22,4 @@ See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
|
22
22
|
This will fail in production.`);a=ko,a._s.has(r)||(s?ka(r,t,o,a):td(r,o,a),Pe.NODE_ENV!=="production"&&(i._pinia=a));const u=a._s.get(r);if(Pe.NODE_ENV!=="production"&&c){const d="__hot:"+r,f=s?ka(d,t,o,a,!0):td(d,Tt({},o),a,!0);c._hotUpdate(f),delete a.state.value[d],a._s.delete(d)}if(Pe.NODE_ENV!=="production"&&yr){const d=Is();if(d&&d.proxy&&!c){const f=d.proxy,m="_pStores"in f?f._pStores:f._pStores={};m[r]=u}}return u}return i.$id=r,i}var pe=(e=>(e.SignIn="sign_in",e.SignUp="sign_up",e.ForgotPassword="forgot_password",e.ResetPassword="reset_password",e.ConfirmAccount="confirm_account",e.ConfirmEmail="confirm_email",e.ConfirmEmailChange="confirm_email_change",e.ViewAccount="view_account",e.ViewProducts="view_products",e.RedeemVoucher="redeem_voucher",e.DownloadProduct="download_product",e.ActivateProduct="activate_product",e.ViewCart="view_cart",e.AddToCart="add_to_cart",e.Checkout="checkout",e))(pe||{});const Dg={toolbar:{enabled:!0,location:"bottom-right",show:{cart:!0,account:!0,moonbase:!0}},auth:{enable:{signUp:!0}}},Ws=Symbol("options");var ke=(e=>(e.None="None",e.Authentication="Authentication",e.Customer="Customer",e.Cart="Cart",e.Activation="Activation",e.Download="Download",e))(ke||{});const Ae=Ig("ui",()=>{const e=T("None"),t=T(null),n=T(null),r=T(null);function o(l,u,d){n.value=d??null,t.value=u,e.value=l}function s(l,u,d){r.value=[l,u,d]}function i(){e.value="None",n.value=null,r.value=null}function a(){const l=r.value;i(),co(()=>{if(l){const[u,d,f]=l;n.value=f??null,t.value=d,e.value=u}})}function c(l){return n.value===null||!n.value[l]?null:n.value[l]}return{active:e,intent:t,parameters:n,next:r,show:o,reset:i,enqueue:s,dequeue:a,getParameter:c}}),Xt=e=>new Promise(t=>setTimeout(t,e)),Ag=["data-visible","data-location"],Vg={key:0,href:"https://moonbase.sh",target:"_blank",class:"moonbase:toolbar-action","data-action-width":"narrow"},Rg=[Jm('<svg viewBox="0 0 512 512" height="18px" width="18px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>',1)],jg=["disabled"],Lg=he({__name:"Toolbar",setup(e){const t=T(!1),n=Ae(),r=St(),o=$e(Ws);return Re(()=>{Xt(100).then(()=>t.value=!0)}),(s,i)=>{var a,c,l,u,d;return _(),N("div",{class:"moonbase:toolbar","data-visible":t.value&&b(n).active===b(ke).None?"true":"false","data-location":b(o).toolbar.location},[(a=b(o))!=null&&a.toolbar.show.moonbase?(_(),N("a",Vg,Rg)):me("",!0),(c=b(o))!=null&&c.toolbar.show.cart?(_(),N("button",{key:1,class:"moonbase:toolbar-action",type:"button",onClick:i[0]||(i[0]=f=>b(n).show(b(ke).Cart,b(pe).AddToCart))}," Cart ")):me("",!0),(l=b(o))!=null&&l.toolbar.show.account&&!b(r).user.value?(_(),N("button",{key:2,class:"moonbase:toolbar-action",type:"button",disabled:!b(r).loaded,onClick:i[1]||(i[1]=f=>b(n).show(b(ke).Authentication,b(pe).SignIn))}," Log in ",8,jg)):(u=b(o))!=null&&u.toolbar.show.account?(_(),N("button",{key:3,class:"moonbase:toolbar-action",type:"button",onClick:i[2]||(i[2]=f=>b(n).show(b(ke).Customer,b(pe).ViewAccount))},K((d=b(r).user.value)==null?void 0:d.name),1)):me("",!0)],8,Ag)}}}),Mg=["hidden"],Ug=["for"],Fg=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby"],Bg=["id"],Hg=["id"],Zg=he({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(_(),N("div",{class:"moonbase:input",hidden:t.hidden||void 0},[O("label",{for:`mb-${t.name}`},K(t.label),9,Ug),O("input",ua({id:`mb-${t.name}`,type:t.type??"text",name:`mb-${t.name}`,placeholder:t.placeholder,value:t.modelValue,disabled:t.disabled,"aria-invalid":!!t.error,"aria-describedby":t.error?`mb-${t.name}-error`:t.hint?`mb-${t.name}-hint`:void 0},t.$attrs,{onInput:n[0]||(n[0]=r=>{var o;return t.$emit("update:modelValue",(o=r.target)==null?void 0:o.value)})}),null,16,Fg),t.error?(_(),N("p",{key:0,id:`mb-${t.name}-error`,class:"moonbase:input-hint","data-type":"error"},K(t.error),9,Bg)):t.hint?(_(),N("p",{key:1,id:`mb-${t.name}-hint`,class:"moonbase:input-hint"},K(t.hint),9,Hg)):me("",!0)],8,Mg))}}),Bn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},gt=Bn(Zg,[["__scopeId","data-v-65d18d50"]]),qg={},nd=e=>(Uh("data-v-f9a322c4"),e=e(),Fh(),e),Wg={fill:"none",viewBox:"0 0 24 24"},zg=[nd(()=>O("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1)),nd(()=>O("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1))];function Kg(e,t){return _(),N("svg",Wg,zg)}const Pt=Bn(qg,[["render",Kg],["__scopeId","data-v-f9a322c4"]]),Gg=["disabled"],rd=Symbol("form-state"),Hn=he({__name:"MoonForm",props:{handler:{type:Function},noReset:{type:Boolean}},setup(e){const t=e,n=T(!1),r=T(!1),o=T(!1);dt(rd,{working:n,isSuccess:r,isError:o});async function s(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Xt(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Xt(2500),o.value=!1}}return(i,a)=>(_(),N("form",{disabled:n.value||r.value,onSubmit:jv(s,["prevent"])},[Wi(i.$slots,"default")],40,Gg))}}),Jg=["disabled","data-success","data-error","data-working"],Yg=["data-visible"],Zn=Bn(he({__name:"MoonSubmitButton",props:{label:{},success:{},error:{}},setup(e){const t=e,{working:n,isSuccess:r,isError:o}=$e(rd),s=X(()=>r.value?t.success:o.value?t.error:t.label);return(i,a)=>(_(),N("button",{class:"moonbase:submit-button",type:"submit",disabled:b(r)||b(o)||b(n),"data-success":b(r)||void 0,"data-error":b(o)||void 0,"data-working":b(n)||void 0},[O("div",{"data-visible":b(n)||void 0,"aria-hidden":"true"},[b(n)?(_(),xe(Pt,{key:0})):me("",!0)],8,Yg),Te(" "+K(s.value),1)],8,Jg))}}),[["__scopeId","data-v-052f0f36"]]),Xg={class:"moonbase:checkbox"},Qg={class:"moonbase:checkbox-container"},ey=["id","name","value","disabled","aria-invalid","aria-describedby"],ty={class:"moonbase:checkbox-description"},ny=["for"],ry=["id"],oy=["id"],od=Bn(he({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(_(),N("div",Xg,[O("div",Qg,[O("input",ua({id:`mb-${t.name}`,type:"checkbox",name:`mb-${t.name}`,value:t.modelValue,disabled:t.disabled,"aria-invalid":!!t.error,"aria-describedby":t.error?`mb-${t.name}-error`:t.hint?`mb-${t.name}-hint`:void 0},t.$attrs,{onChecked:n[0]||(n[0]=r=>{var o;return t.$emit("update:modelValue",(o=r.target)==null?void 0:o.checked)})}),null,16,ey)]),O("div",ty,[O("label",{for:`mb-${t.name}`},K(t.label),9,ny),t.error?(_(),N("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},K(t.error),9,ry)):t.hint?(_(),N("p",{key:1,id:`mb-${t.name}-hint`},K(t.hint),9,oy)):me("",!0)])]))}}),[["__scopeId","data-v-20c4336e"]]),sy=["data-visible"],iy=he({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=Ae(),o=St(),s=T(""),i=T(r.getParameter("email")??""),a=T(""),c=T(!1),l=T(null);async function u(){l.value=null;try{const d=await o.signUp(s.value,i.value,a.value,null,!0,!0,c.value);Xt(1500).then(()=>n("signedUp",d))}catch(d){throw l.value=d.message,d}}return(d,f)=>(_(),xe(Hn,{handler:u,class:"moonbase:sign-up"},{default:ye(()=>[B(gt,{modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=m=>s.value=m),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),B(gt,{modelValue:i.value,"onUpdate:modelValue":f[1]||(f[1]=m=>i.value=m),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),B(gt,{modelValue:a.value,"onUpdate:modelValue":f[2]||(f[2]=m=>a.value=m),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),B(od,{modelValue:c.value,"onUpdate:modelValue":f[3]||(f[3]=m=>c.value=m),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),B(Zn,{success:"Signed up",label:"Sign up",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!l.value||void 0},K(l.value),9,sy),O("button",{type:"button",onClick:f[4]||(f[4]=m=>b(r).show(b(ke).Authentication,b(pe).SignIn,{email:i.value}))}," I already have an account ")]),_:1}))}}),ay={key:0,class:"moonbase:loader"},ly={key:1,class:"moonbase:error","data-visible":""},cy=O("p",null," Please create a new password for your account: ",-1),uy=["data-visible"],dy=he({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=Ae(),o=St(),s=T(!0),i=T(null),a=T(""),c=T(null);Re(async()=>{try{const u=r.getParameter("email"),d=r.getParameter("code");if(!u||!d)throw new Error("Link is broken");i.value=await o.confirmAccount(u,d)}catch(u){u instanceof Pr?c.value="Could not find a user to confirm":c.value=u.message}s.value=!1});async function l(){var u,d;if(c.value=null,!!((u=i.value)!=null&&u.resetPasswordToken))try{const f=r.getParameter("email");await o.resetPassword(f,a.value,(d=i.value)==null?void 0:d.resetPasswordToken);const m=await o.signIn(f,a.value);Xt(1500).then(()=>n("confirmedAccount",m))}catch(f){throw c.value=f.message,f}}return(u,d)=>(_(),xe(Hn,{handler:l,class:"moonbase:confirm-account"},{default:ye(()=>[s.value?(_(),N("div",ay,[B(Pt)])):i.value?(_(),N(Ce,{key:2},[O("h3",null," Hi "+K(i.value.name)+", ",1),cy,B(gt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),B(gt,{modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=f=>a.value=f),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:""},null,8,["modelValue"]),B(Zn,{success:"Password saved",label:"Save password",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!c.value||void 0},K(c.value),9,uy)],64)):(_(),N("div",ly,K(c.value),1))]),_:1}))}}),fy=O("h3",null," Forgot your password? ",-1),py=O("p",null," Please enter your email for a reset link: ",-1),hy=["data-visible"],my=he({__name:"ForgotPassword",setup(e){const t=Ae(),n=St(),r=T(t.getParameter("email")??""),o=T(null),s=T(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Xt(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof Pr?o.value="User not found":o.value=a.message,a}}return(a,c)=>(_(),xe(Hn,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:ye(()=>[fy,py,B(gt,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=l=>r.value=l),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),B(Zn,{success:"Email sent",label:"Reset password",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!o.value||void 0},K(o.value),9,hy)]),_:1}))}}),vy=O("p",null," Please create a new password for your account: ",-1),gy=["data-visible"],yy=he({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=Ae(),o=St(),s=X(()=>r.getParameter("email")),i=T(""),a=T(null);Re(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(a.value="Link broken, please try again")});async function c(){a.value=null;const l=r.getParameter("code");if(l)try{await o.resetPassword(s.value,i.value,l);const u=await o.signIn(s.value,i.value);Xt(1500).then(()=>n("passwordReset",u))}catch(u){throw a.value=u.message,u}}return(l,u)=>(_(),xe(Hn,{handler:c,class:"moonbase:reset-password"},{default:ye(()=>[O("h3",null," Hi "+K(s.value)+", ",1),vy,B(gt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),B(gt,{modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=d=>i.value=d),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:""},null,8,["modelValue"]),B(Zn,{success:"Password saved",label:"Save password",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!a.value||void 0},K(a.value),9,gy)]),_:1}))}}),_y={class:"moonbase:confirm-email-change"},by={key:0,class:"moonbase:loader"},wy={key:1,class:"moonbase:error","data-visible":""},Ey=O("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1),Oy=he({__name:"ConfirmEmailChange",setup(e){const t=Ae(),{user:n,confirmEmailChange:r}=St(),o=T(!0),s=T(null);return Re(async()=>{try{const i=t.getParameter("email"),a=t.getParameter("code");if(!i||!a)throw new Error("Link is broken");await r(i,a)}catch(i){s.value=i.message}o.value=!1}),(i,a)=>{var c;return _(),N("div",_y,[o.value?(_(),N("div",by,[B(Pt)])):s.value?(_(),N("div",wy,K(s.value),1)):(_(),N(Ce,{key:2},[O("h3",null," Hi "+K((c=b(n))==null?void 0:c.name)+", ",1),Ey],64))])}}});class Ny{constructor(){Nr(this,"current",this.detect());Nr(this,"currentId",0)}set(t){this.current!==t&&(this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}}let To=new Ny;function Ca(e,t,n,r){To.isServer||ft(o=>{e=e??window,e.addEventListener(t,n,r),o(()=>e.removeEventListener(t,n,r))})}function sd(e,t,n,r){To.isServer||ft(o=>{e.value&&(window.addEventListener(t,n,r),o(()=>window.removeEventListener(t,n,r)))})}var xt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(xt||{});function Ta(){let e=T(0),t=T(!0);return sd(t,"keydown",n=>{n.key==="Tab"&&(e.value=n.shiftKey?1:0)}),e}function Je(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Je),r}var qn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(qn||{}),Wn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Wn||{});function Qe({visible:e=!0,features:t=0,ourProps:n,theirProps:r,...o}){const s=ad(r,n),i=Object.assign(o,{props:s});if(e||t&2&&s.static)return zs(i);if(t&1){const a=s.unmount??!0?0:1;return Je(a,{0(){return null},1(){return zs({...o,props:{...s,hidden:!0,style:{display:"none"}}})}})}return zs(i)}function zs({props:e,attrs:t,slots:n,slot:r,name:o}){var l;const{as:s,...i}=Pa(e,["unmount","static"]);let a=(l=n.default)==null?void 0:l.call(n,r);const c={};if(r){let u=!1;const d=[];for(const[f,m]of Object.entries(r))typeof m=="boolean"&&(u=!0),m===!0&&d.push(f);u&&(c["data-moonbase-state"]=d.join(" "))}if(s==="template"){if(a=id(a??[]),Object.keys(i).length>0||Object.keys(t).length>0){const[u,...d]=a??[];if(!Sy(u)||d.length>0)throw new Error(['Passing props on "template"!',"",`The current component <${o} /> is rendering a "template".`,"However we need to passthrough the following props:",Object.keys(i).concat(Object.keys(t)).map(y=>y.trim()).filter((y,E,S)=>S.indexOf(y)===E).sort((y,E)=>y.localeCompare(E)).map(y=>` - ${y}`).join(`
|
|
23
23
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(y=>` - ${y}`).join(`
|
|
24
24
|
`)].join(`
|
|
25
|
-
`));const f=ad(u.props??{},i,c),m=Rt(u,f,!0);for(const y in f)y.startsWith("on")&&(m.props||(m.props={}),m.props[y]=f[y]);return m}return Array.isArray(a)&&a.length===1?a[0]:a}return Le(s,Object.assign({},i,c),{default:()=>a})}function id(e){return e.flatMap(t=>t.type===Ce?id(t.children):[t])}function ad(...e){if(e.length===0)return{};if(e.length===1)return e[0];const t={},n={};for(const r of e)for(const o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]??(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(const r in n)Object.assign(t,{[r](o,...s){const i=n[r];for(const a of i){if(o instanceof Event&&o.defaultPrevented)return;a(o,...s)}}});return t}function Pa(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Sy(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var zn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(zn||{});let Kn=he({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:t,attrs:n}){return()=>{let{features:r,...o}=e,s={"aria-hidden":(r&2)===2?!0:o["aria-hidden"]??void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Qe({ourProps:s,theirProps:o,slot:{},attrs:n,slots:t,name:"Hidden"})}}});function xy(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function G(e){if(e==null||e.value==null)return null;let t=e.value.$el??e.value;return t instanceof Node?t:null}function Qt(e){if(To.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let t=G(e);if(t)return t.ownerDocument}return document}const Ks=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ue=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ue||{}),yn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(yn||{});function Gs(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ks)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var $a=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))($a||{});function ld(e,t=0){var n;return e===((n=Qt(e))==null?void 0:n.body)?!1:Je(t,{0(){return e.matches(Ks)},1(){let r=e;for(;r!==null;){if(r.matches(Ks))return!0;r=r.parentElement}return!1}})}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.moonbaseFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.moonbaseFocusVisible:e.detail===0&&(document.documentElement.dataset.moonbaseFocusVisible="")},!0));function br(e){e==null||e.focus({preventScroll:!0})}const ky=["textarea","input"].join(",");function Cy(e){var t;return((t=e==null?void 0:e.matches)==null?void 0:t.call(e,ky))??!1}function jr(e,t=n=>n){return e.slice().sort((n,r)=>{const o=t(n),s=t(r);if(o===null||s===null)return 0;const i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function it(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){const s=(Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e==null?void 0:e.ownerDocument)??document;let i=Array.isArray(e)?n?jr(e):e:Gs(e);o.length>0&&i.length>1&&(i=i.filter(m=>!o.includes(m))),r=r??s.activeElement;const a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{};let u=0;const d=i.length;let f;do{if(u>=d||u+d<=0)return 0;let m=c+u;if(t&16)m=(m+d)%d;else{if(m<0)return 3;if(m>=d)return 1}f=i[m],f==null||f.focus(l),u+=a}while(f!==s.activeElement);return t&6&&Cy(f)&&f.select(),2}let wr=[];xy(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||wr[0]===t.target)return;let n=t.target;n=n.closest(Ks),wr.unshift(n??t.target),wr=wr.filter(r=>r!=null&&r.isConnected),wr.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Js(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function cd(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());const t=new Set;for(const n of e.value){const r=G(n);r instanceof HTMLElement&&t.add(r)}return t}var ud=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(ud||{});const Po=Object.assign(he({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null},features:{type:Number,default:30},containers:{type:[Object,Function],default:T(new Set)}},inheritAttrs:!1,setup(e,{attrs:t,slots:n,expose:r}){const o=T(null);r({el:o,$el:o});const s=X(()=>Qt(o)),i=T(!1);Re(()=>i.value=!0),mt(()=>i.value=!1),Py({ownerDocument:s},X(()=>i.value&&!!(e.features&16)));const a=$y({ownerDocument:s,container:o,initialFocus:X(()=>e.initialFocus)},X(()=>i.value&&!!(e.features&2)));Iy({ownerDocument:s,container:o,containers:e.containers,previousActiveElement:a},X(()=>i.value&&!!(e.features&8)));const c=Ta();function l(m){const y=G(o);if(!y)return;(S=>S())(()=>{Je(c.value,{[xt.Forwards]:()=>{it(y,Ue.First,{skipElements:[m.relatedTarget]})},[xt.Backwards]:()=>{it(y,Ue.Last,{skipElements:[m.relatedTarget]})}})})}const u=T(!1);function d(m){m.key==="Tab"&&(u.value=!0,requestAnimationFrame(()=>{u.value=!1}))}function f(m){if(!i.value)return;const y=cd(e.containers);G(o)instanceof HTMLElement&&y.add(G(o));const E=m.relatedTarget;E instanceof HTMLElement&&E.dataset.moonbaseFocusGuard!=="true"&&(dd(y,E)||(u.value?it(G(o),Je(c.value,{[xt.Forwards]:()=>Ue.Next,[xt.Backwards]:()=>Ue.Previous})|Ue.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&br(m.target)))}return()=>{const m={},y={ref:o,onKeydown:d,onFocusout:f},{features:E,initialFocus:S,containers:A,...F}=e;return Le(Ce,[!!(E&4)&&Le(Kn,{as:"button",type:"button","data-moonbase-focus-guard":!0,onFocus:l,features:zn.Focusable}),Qe({ourProps:y,theirProps:{...t,...F},slot:m,attrs:t,slots:n,name:"FocusTrap"}),!!(E&4)&&Le(Kn,{as:"button",type:"button","data-moonbase-focus-guard":!0,onFocus:l,features:zn.Focusable})])}}}),{features:ud});function Ty(e){const t=T(wr.slice());return Xe([e],([n],[r])=>{r===!0&&n===!1?Js(()=>{t.value.splice(0)}):r===!1&&n===!0&&(t.value=wr.slice())},{flush:"post"}),()=>t.value.find(n=>n!=null&&n.isConnected)??null}function Py({ownerDocument:e},t){const n=Ty(t);Re(()=>{ft(()=>{var r,o;t.value||((r=e.value)==null?void 0:r.activeElement)===((o=e.value)==null?void 0:o.body)&&br(n())},{flush:"post"})}),mt(()=>{t.value&&br(n())})}function $y({ownerDocument:e,container:t,initialFocus:n},r){const o=T(null),s=T(!1);return Re(()=>s.value=!0),mt(()=>s.value=!1),Re(()=>{Xe([t,n,r],(i,a)=>{if(i.every((l,u)=>(a==null?void 0:a[u])===l)||!r.value)return;const c=G(t);c&&Js(()=>{var d,f;if(!s.value)return;const l=G(n),u=(d=e.value)==null?void 0:d.activeElement;if(l){if(l===u){o.value=u;return}}else if(c.contains(u)){o.value=u;return}l?br(l):it(c,Ue.First|Ue.NoScroll)===yn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.value=(f=e.value)==null?void 0:f.activeElement})},{immediate:!0,flush:"post"})}),o}function Iy({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){var s;Ca((s=e.value)==null?void 0:s.defaultView,"focus",i=>{if(!o.value)return;const a=cd(n);G(t)instanceof HTMLElement&&a.add(G(t));const c=r.value;if(!c)return;const l=i.target;l&&l instanceof HTMLElement?dd(a,l)?(r.value=l,br(l)):(i.preventDefault(),i.stopPropagation(),br(c)):br(r.value)},!0)}function dd(e,t){for(const n of e)if(n.contains(t))return!0;return!1}function Dy(e){let t=fh(e.getSnapshot());return mt(e.subscribe(()=>{t.value=e.getSnapshot()})),t}function $o(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){t.requestAnimationFrame(()=>{t.requestAnimationFrame(...n)})},setTimeout(...n){let r=setTimeout(...n);t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Js(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=$o();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ay(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(a=>a()))}}}function Vy(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function fd(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ry(){return/Android/gi.test(window.navigator.userAgent)}function jy(){return fd()||Ry()}function Ly(){return fd()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){const i=$o();i.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>i.dispose()))}const o=window.scrollY??window.pageYOffset;let s=null;t.addEventListener(e,"click",i=>{if(i.target instanceof HTMLElement)try{const a=i.target.closest("a");if(!a)return;const{hash:c}=new URL(a.href),l=e.querySelector(c);l&&!r(l)&&(s=l)}catch{}},!0),t.addEventListener(e,"touchstart",i=>{if(i.target instanceof HTMLElement)if(r(i.target)){let a=i.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(i.target,"touchAction","none")}),t.addEventListener(e,"touchmove",i=>{if(i.target instanceof HTMLElement){if(i.target.tagName==="INPUT")return;if(r(i.target)){let a=i.target;for(;a.parentElement&&a.dataset.moonbasePortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.moonbasePortal===""&&i.preventDefault()}else i.preventDefault()}},{passive:!1}),t.add(()=>{const i=window.scrollY??window.pageYOffset;o!==i&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function My(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Uy(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Er=Ay(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:$o(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Uy(n)},o=[Ly(),Vy(),My()];o.forEach(({before:s})=>s==null?void 0:s(r)),o.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Er.subscribe(()=>{let e=Er.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Er.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Er.dispatch("TEARDOWN",n)}});function Fy(e,t,n){let r=Dy(Er),o=X(()=>{let s=e.value?r.value.get(e.value):void 0;return s?s.count>0:!1});return Xe([e,t],([s,i],[a],c)=>{if(!s||!i)return;Er.dispatch("PUSH",s,n);let l=!1;c(()=>{l||(Er.dispatch("POP",a??s,n),l=!0)})},{immediate:!0}),o}let By=0;function Hy(){return++By}function $t(){return Hy()}let Ia=new Map,Io=new Map;function pd(e,t=T(!0)){ft(n=>{if(!t.value)return;let r=G(e);if(!r)return;n(function(){if(!r)return;let i=Io.get(r)??1;if(i===1?Io.delete(r):Io.set(r,i-1),i!==1)return;let a=Ia.get(r);a&&(a["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",a["aria-hidden"]),r.inert=a.inert,Ia.delete(r))});let o=Io.get(r)??0;Io.set(r,o+1),o===0&&(Ia.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0)})}function Do(e,t,n,r){To.isServer||ft(o=>{e.value&&(document.addEventListener(t,n,r),o(()=>document.removeEventListener(t,n,r)))})}const hd=30;function md(e,t,n=X(()=>!0)){function r(i,a){if(i.defaultPrevented)return;const c=a(i);if(c===null||!c.getRootNode().contains(c))return;const l=function u(d){return typeof d=="function"?u(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(const u of l){if(u===null)continue;const d=u instanceof HTMLElement?u:G(u);if(d!=null&&d.contains(c)||i.composed&&i.composedPath().includes(d))return}return!ld(c,$a.Loose)&&c.tabIndex!==-1&&i.preventDefault(),t(i,c)}const o=T(null);Do(n,"pointerdown",i=>{var a,c;o.value=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target},!0),Do(n,"mousedown",i=>{var a,c;o.value=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target},!0),Do(n,"click",i=>{jy()||o.value&&(r(i,()=>o.value),o.value=null)},!0);const s={x:0,y:0};Do(n,"touchstart",i=>{s.x=i.touches[0].clientX,s.y=i.touches[0].clientY},!0),Do(n,"touchend",i=>{const a={x:i.changedTouches[0].clientX,y:i.changedTouches[0].clientY};if(!(Math.abs(a.x-s.x)>=hd||Math.abs(a.y-s.y)>=hd))return r(i,()=>i.target instanceof HTMLElement?i.target:null)},!0),sd(n,"blur",i=>r(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function vd({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){const r=T(null),o=Qt(r);function s(){var a,c;const i=[];for(const l of e)l!==null&&(l instanceof HTMLElement?i.push(l):"value"in l&&l.value instanceof HTMLElement&&i.push(l.value));if(t!=null&&t.value)for(const l of t.value)i.push(l);for(const l of(o==null?void 0:o.querySelectorAll("html > *, body > *"))??[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="moonbase"&&(l.contains(G(r))||l.contains((c=(a=G(r))==null?void 0:a.getRootNode())==null?void 0:c.host)||i.some(u=>l.contains(u))||i.push(l));return i}return{resolveContainers:s,contains(i){return s().some(a=>a.contains(i))},mainTreeNodeRef:r,MainTreeNode(){return n!=null?null:Le(Kn,{features:zn.Hidden,ref:r})}}}let gd=Symbol("Context");var at=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(at||{});function Zy(){return Ys()!==null}function Ys(){return $e(gd,null)}function yd(e){dt(gd,e)}const _d=Symbol("ForcePortalRootContext");function qy(){return $e(_d,!1)}const bd=he({name:"ForcePortalRoot",props:{as:{type:[Object,String],default:"template"},force:{type:Boolean,default:!1}},setup(e,{slots:t,attrs:n}){return dt(_d,e.force),()=>{const{force:r,...o}=e;return Qe({theirProps:o,ourProps:{},slot:{},slots:t,attrs:n,name:"ForcePortalRoot"})}}});let wd=Symbol("StackContext");var Da=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Da||{});function Wy(){return $e(wd,()=>{})}function zy({type:e,enabled:t,element:n,onUpdate:r}){let o=Wy();function s(...i){r==null||r(...i),o(...i)}Re(()=>{Xe(t,(i,a)=>{i?s(0,e,n):a===!0&&s(1,e,n)},{immediate:!0,flush:"sync"})}),mt(()=>{t.value&&s(1,e,n)}),dt(wd,s)}var et=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(et||{});let Ky=Symbol("DescriptionContext");function Gy({slot:e=T({}),name:t="Description",props:n={}}={}){let r=T([]);function o(s){return r.value.push(s),()=>{let i=r.value.indexOf(s);i!==-1&&r.value.splice(i,1)}}return dt(Ky,{register:o,slot:e,name:t,props:n}),X(()=>r.value.length>0?r.value.join(" "):void 0)}function Ed(e){const t=Qt(e);if(!t){if(e===null)return null;throw new Error(`[Moonbase]: Cannot find ownerDocument for contextElement: ${e}`)}const n=t.getElementById("moonbase");if(n)return n;throw new Error("[Moonbase]: Cannot find existing root element")}const Jy=he({name:"Portal",props:{as:{type:[Object,String],default:"div"}},setup(e,{slots:t,attrs:n}){const r=T(null);X(()=>Qt(r));const o=qy(),s=$e(Nd,null),i=T(o===!0||s==null?Ed(r.value):s.resolveTarget()),a=T(!1);Re(()=>{a.value=!0}),ft(()=>{o||s!=null&&(i.value=s.resolveTarget())});const c=$e(Aa,null);let l=!1;const u=Is();return Xe(r,()=>{if(l||!c)return;const d=G(r);d&&(mt(c.register(d),u),l=!0)}),()=>{if(!a.value||i.value===null)return null;const d={ref:r,"data-moonbase-portal":""};return Le(Pm,{to:i.value},Qe({ourProps:d,theirProps:e,slot:{},attrs:n,slots:t,name:"Portal"}))}}});let Aa=Symbol("PortalParentContext");function Od(){const e=$e(Aa,null),t=T([]);function n(s){return t.value.push(s),e&&e.register(s),()=>r(s)}function r(s){const i=t.value.indexOf(s);i!==-1&&t.value.splice(i,1),e&&e.unregister(s)}const o={register:n,unregister:r,portals:t};return[t,he({name:"PortalWrapper",setup(s,{slots:i}){return dt(Aa,o),()=>{var a;return(a=i.default)==null?void 0:a.call(i)}}})]}let Nd=Symbol("PortalGroupContext");const Yy=he({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup(e,{attrs:t,slots:n}){const r=so({resolveTarget(){return e.target}});return dt(Nd,r),()=>{const{target:o,...s}=e;return Qe({theirProps:s,ourProps:{},slot:{},attrs:t,slots:n,name:"PortalGroup"})}}}),Va=Symbol("DialogContext");function Xs(e){const t=$e(Va,null);if(t===null){const n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Xs),n}return t}const Qs="DC8F892D-2EBD-447C-A4C8-A03058436FF4",Sd=he({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:[Boolean,String],default:Qs},initialFocus:{type:Object,default:null},id:{type:String,default:()=>`moonbase-dialog-${$t()}`},role:{type:String,default:"dialog"}},emits:{close:e=>!0},setup(e,{emit:t,attrs:n,slots:r,expose:o}){var ce;const s=T(!1);Re(()=>{s.value=!0});let i=!1;const a=X(()=>e.role==="dialog"||e.role==="alertdialog"?e.role:(i||(i=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")),c=T(0),l=Ys(),u=X(()=>e.open===Qs&&l!==null?(l.value&at.Open)===at.Open:e.open),d=T(null),f=X(()=>Qt(d));if(o({el:d,$el:d}),!(e.open!==Qs||l!==null))throw new Error("You forgot to provide an `open` prop to the `Dialog`.");if(typeof u.value!="boolean")throw new TypeError(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${u.value===Qs?void 0:e.open}`);const y=X(()=>s.value&&u.value?0:1),E=X(()=>y.value===0),S=T(null),A={titleId:S,panelRef:T(null),dialogState:y,setTitleId(Ie){S.value!==Ie&&(S.value=Ie)},close(){t("close",!1)}},F=X(()=>c.value>1),C=$e(Va,null)!==null,[z,$]=Od(),{resolveContainers:Z,mainTreeNodeRef:x,MainTreeNode:de}=vd({portals:z,defaultContainers:[X(()=>A.panelRef.value??d.value)]}),Y=X(()=>F.value?"parent":"leaf"),V=X(()=>l!==null?(l.value&at.Closing)===at.Closing:!1),P=X(()=>C||V.value?!1:E.value),j=X(()=>{var Ie;return Array.from(((Ie=f.value)==null?void 0:Ie.querySelectorAll("body > *"))??[]).find(je=>je.id==="moonbase"?!1:je.contains(G(x))&&je instanceof HTMLElement)??null});pd(j,P);const oe=X(()=>F.value?!0:E.value),w=X(()=>{var Ie;return Array.from(((Ie=f.value)==null?void 0:Ie.querySelectorAll("[data-moonbase-portal]"))??[]).find(je=>je.contains(G(x))&&je instanceof HTMLElement)??null});pd(w,oe),zy({type:"Dialog",enabled:X(()=>y.value===0),element:d,onUpdate:(Ie,je)=>{if(je==="Dialog")return Je(Ie,{[Da.Add]:()=>c.value+=1,[Da.Remove]:()=>c.value-=1})}});const I=Gy({name:"DialogDescription",slot:X(()=>({open:u.value}))});dt(Va,A);const ne=X(()=>!(!E.value||F.value));md(Z,(Ie,je)=>{Ie.preventDefault(),A.close(),co(()=>je==null?void 0:je.focus())},ne);const ae=X(()=>!(F.value||y.value!==0));Ca((ce=f.value)==null?void 0:ce.defaultView,"keydown",Ie=>{ae.value&&(Ie.defaultPrevented||Ie.key===et.Escape&&(Ie.preventDefault(),Ie.stopPropagation(),A.close()))});const re=X(()=>!(V.value||y.value!==0||C));return Fy(f,re,Ie=>({containers:[...Ie.containers??[],Z]})),ft(Ie=>{if(y.value!==0)return;const je=G(d);if(!je)return;const nt=new ResizeObserver(bt=>{for(const bn of bt){const Gn=bn.target.getBoundingClientRect();Gn.x===0&&Gn.y===0&&Gn.width===0&&Gn.height===0&&A.close()}});nt.observe(je),Ie(()=>nt.disconnect())}),()=>{const{id:Ie,open:je,initialFocus:nt,...bt}=e,bn={...n,ref:d,id:Ie,role:a.value,"aria-modal":y.value===0?!0:void 0,"aria-labelledby":S.value,"aria-describedby":I.value},Gn={open:y.value===0};return Le(bd,{force:!0},()=>[Le(Jy,()=>Le(Yy,{target:d.value},()=>Le(bd,{force:!1},()=>Le(Po,{initialFocus:nt,containers:Z,features:E.value?Je(Y.value,{parent:Po.features.RestoreFocus,leaf:Po.features.All&~Po.features.FocusLock}):Po.features.None},()=>Le($,{},()=>Qe({ourProps:bn,theirProps:{...bt,...n},slot:Gn,attrs:n,slots:r,visible:y.value===0,features:qn.RenderStrategy|qn.Static,name:"Dialog"})))))),Le(de)])}}}),xd=he({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"},id:{type:String,default:()=>`moonbase-dialog-overlay-${$t()}`}},setup(e,{attrs:t,slots:n}){const r=Xs("DialogOverlay");function o(s){s.target===s.currentTarget&&(s.preventDefault(),s.stopPropagation(),r.close())}return()=>{const{id:s,...i}=e;return Qe({ourProps:{id:s,"aria-hidden":!0,onClick:o},theirProps:i,slot:{open:r.dialogState.value===0},attrs:t,slots:n,name:"DialogOverlay"})}}}),kd=he({name:"DialogPanel",props:{as:{type:[Object,String],default:"div"},id:{type:String,default:()=>`moonbase-dialog-panel-${$t()}`}},setup(e,{attrs:t,slots:n,expose:r}){const o=Xs("DialogPanel");r({el:o.panelRef,$el:o.panelRef});function s(i){i.stopPropagation()}return()=>{const{id:i,...a}=e,c={id:i,ref:o.panelRef,onClick:s};return Qe({ourProps:c,theirProps:a,slot:{open:o.dialogState.value===0},attrs:t,slots:n,name:"DialogPanel"})}}}),ei=he({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"},id:{type:String,default:()=>`moonbase-dialog-title-${$t()}`}},setup(e,{attrs:t,slots:n}){const r=Xs("DialogTitle");return Re(()=>{r.setTitleId(e.id),mt(()=>r.setTitleId(null))}),()=>{const{id:o,...s}=e;return Qe({ourProps:{id:o},theirProps:s,slot:{open:r.dialogState.value===0},attrs:t,slots:n,name:"DialogTitle"})}}});function Cd(e,t){if(e)return e;let n=t??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Td(e,t){let n=T(Cd(e.value.type,e.value.as));return Re(()=>{n.value=Cd(e.value.type,e.value.as)}),ft(()=>{var r;n.value||G(t)&&G(t)instanceof HTMLButtonElement&&!((r=G(t))!=null&&r.hasAttribute("type"))&&(n.value="button")}),n}const Pd=Symbol("PopoverContext");function Ra(e){const t=$e(Pd,null);if(t===null){const n=new Error(`<${e} /> is missing a parent <${ja.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ra),n}return t}const Xy=Symbol("PopoverGroupContext");function $d(){return $e(Xy,null)}const Id=Symbol("PopoverPanelContext");function Qy(){return $e(Id,null)}let ja=he({name:"Popover",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"}},setup(e,{slots:t,attrs:n,expose:r}){var z;const o=T(null);r({el:o,$el:o});const s=T(1),i=T(null),a=T(null),c=T(null),l=T(null),u=X(()=>Qt(o)),d=X(()=>{var P,j;if(!G(i)||!G(l))return!1;for(const oe of document.querySelectorAll("body > *"))if(Number(oe==null?void 0:oe.contains(G(i)))^Number(oe==null?void 0:oe.contains(G(l))))return!0;const $=Gs(),Z=$.indexOf(G(i)),x=(Z+$.length-1)%$.length,de=(Z+1)%$.length,Y=$[x],V=$[de];return!((P=G(l))!=null&&P.contains(Y))&&!((j=G(l))!=null&&j.contains(V))}),f={popoverState:s,buttonId:T(null),panelId:T(null),panel:l,button:i,isPortalled:d,beforePanelSentinel:a,afterPanelSentinel:c,togglePopover(){s.value=Je(s.value,{0:1,1:0})},closePopover(){s.value!==1&&(s.value=1)},close($){f.closePopover();const Z=$?$ instanceof HTMLElement?$:$.value instanceof HTMLElement?G($):G(f.button):G(f.button);Z==null||Z.focus()}};dt(Pd,f),yd(X(()=>Je(s.value,{0:at.Open,1:at.Closed})));const m={buttonId:f.buttonId,panelId:f.panelId,close(){f.closePopover()}},y=$d(),E=y==null?void 0:y.registerPopover,[S,A]=Od(),F=vd({mainTreeNodeRef:y==null?void 0:y.mainTreeNodeRef,portals:S,defaultContainers:[i,l]});function C(){var $,Z,x;return(y==null?void 0:y.isFocusWithinPopoverGroup())??((($=u.value)==null?void 0:$.activeElement)&&(((Z=G(i))==null?void 0:Z.contains(u.value.activeElement))||((x=G(l))==null?void 0:x.contains(u.value.activeElement))))}return ft(()=>E==null?void 0:E(m)),Ca((z=u.value)==null?void 0:z.defaultView,"focus",$=>{var Z,x;$.target!==window&&$.target instanceof HTMLElement&&s.value===0&&(C()||i&&l&&(F.contains($.target)||(Z=G(f.beforePanelSentinel))!=null&&Z.contains($.target)||(x=G(f.afterPanelSentinel))!=null&&x.contains($.target)||f.closePopover()))},!0),md(F.resolveContainers,($,Z)=>{var x;f.closePopover(),ld(Z,$a.Loose)||($.preventDefault(),(x=G(i))==null||x.focus())},X(()=>s.value===0)),()=>{const $={open:s.value===0,close:f.close};return Le(Ce,[Le(A,{},()=>Qe({theirProps:{...e,...n},ourProps:{ref:o},slot:$,slots:t,attrs:n,name:"Popover"})),Le(F.MainTreeNode)])}}});const Dd=he({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:()=>`moonbase-popover-button-${$t()}`}},inheritAttrs:!1,setup(e,{attrs:t,slots:n,expose:r}){const o=Ra("PopoverButton"),s=X(()=>Qt(o.button));r({el:o.button,$el:o.button}),Re(()=>{o.buttonId.value=e.id}),mt(()=>{o.buttonId.value=null});const i=$d(),a=i==null?void 0:i.closeOthers,c=Qy(),l=X(()=>c===null?!1:c.value===o.panelId.value),u=T(null),d=`moonbase-focus-sentinel-${$t()}`;l.value||ft(()=>{o.button.value=G(u)});const f=Td(X(()=>({as:e.as,type:t.type})),u);function m(C){var z,$,Z,x,de;if(l.value){if(o.popoverState.value===1)return;switch(C.key){case et.Space:case et.Enter:C.preventDefault(),($=(z=C.target).click)==null||$.call(z),o.closePopover(),(Z=G(o.button))==null||Z.focus();break}}else switch(C.key){case et.Space:case et.Enter:C.preventDefault(),C.stopPropagation(),o.popoverState.value===1&&(a==null||a(o.buttonId.value)),o.togglePopover();break;case et.Escape:if(o.popoverState.value!==0)return a==null?void 0:a(o.buttonId.value);if(!G(o.button)||(x=s.value)!=null&&x.activeElement&&!((de=G(o.button))!=null&&de.contains(s.value.activeElement)))return;C.preventDefault(),C.stopPropagation(),o.closePopover();break}}function y(C){l.value||C.key===et.Space&&C.preventDefault()}function E(C){var z,$;e.disabled||(l.value?(o.closePopover(),(z=G(o.button))==null||z.focus()):(C.preventDefault(),C.stopPropagation(),o.popoverState.value===1&&(a==null||a(o.buttonId.value)),o.togglePopover(),($=G(o.button))==null||$.focus()))}function S(C){C.preventDefault(),C.stopPropagation()}const A=Ta();function F(){const C=G(o.panel);if(!C)return;function z(){Je(A.value,{[xt.Forwards]:()=>it(C,Ue.First),[xt.Backwards]:()=>it(C,Ue.Last)})===yn.Error&&it(Gs().filter(Z=>Z.dataset.moonbaseFocusGuard!=="true"),Je(A.value,{[xt.Forwards]:Ue.Next,[xt.Backwards]:Ue.Previous}),{relativeTo:G(o.button)})}z()}return()=>{const C=o.popoverState.value===0,z={open:C},{id:$,...Z}=e,x=l.value?{ref:u,type:f.value,onKeydown:m,onClick:E}:{ref:u,id:$,type:f.value,"aria-expanded":o.popoverState.value===0,"aria-controls":G(o.panel)?o.panelId.value:void 0,disabled:e.disabled?!0:void 0,onKeydown:m,onKeyup:y,onClick:E,onMousedown:S};return Le(Ce,[Qe({ourProps:x,theirProps:{...t,...Z},slot:z,attrs:t,slots:n,name:"PopoverButton"}),C&&!l.value&&o.isPortalled.value&&Le(Kn,{id:d,features:zn.Focusable,"data-moonbase-focus-guard":!0,as:"button",type:"button",onFocus:F})])}}}),Ad=he({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1},id:{type:String,default:()=>`moonbase-popover-panel-${$t()}`}},inheritAttrs:!1,setup(e,{attrs:t,slots:n,expose:r}){const{focus:o}=e,s=Ra("PopoverPanel"),i=X(()=>Qt(s.panel)),a=`moonbase-focus-sentinel-before-${$t()}`,c=`moonbase-focus-sentinel-after-${$t()}`;r({el:s.panel,$el:s.panel}),Re(()=>{s.panelId.value=e.id}),mt(()=>{s.panelId.value=null}),dt(Id,s.panelId),ft(()=>{var A,F;if(!o||s.popoverState.value!==0||!s.panel)return;const S=(A=i.value)==null?void 0:A.activeElement;(F=G(s.panel))!=null&&F.contains(S)||it(G(s.panel),Ue.First)});const l=Ys(),u=X(()=>l!==null?(l.value&at.Open)===at.Open:s.popoverState.value===0);function d(S){var A,F;switch(S.key){case et.Escape:if(s.popoverState.value!==0||!G(s.panel)||i.value&&!((A=G(s.panel))!=null&&A.contains(i.value.activeElement)))return;S.preventDefault(),S.stopPropagation(),s.closePopover(),(F=G(s.button))==null||F.focus();break}}function f(S){var F,C,z,$,Z;const A=S.relatedTarget;A&&G(s.panel)&&((F=G(s.panel))!=null&&F.contains(A)||(s.closePopover(),((z=(C=G(s.beforePanelSentinel))==null?void 0:C.contains)!=null&&z.call(C,A)||(Z=($=G(s.afterPanelSentinel))==null?void 0:$.contains)!=null&&Z.call($,A))&&A.focus({preventScroll:!0})))}const m=Ta();function y(){const S=G(s.panel);if(!S)return;function A(){Je(m.value,{[xt.Forwards]:()=>{var C;it(S,Ue.First)===yn.Error&&((C=G(s.afterPanelSentinel))==null||C.focus())},[xt.Backwards]:()=>{var F;(F=G(s.button))==null||F.focus({preventScroll:!0})}})}A()}function E(){const S=G(s.panel);if(!S)return;function A(){Je(m.value,{[xt.Forwards]:()=>{const F=G(s.button),C=G(s.panel);if(!F)return;const z=Gs(),$=z.indexOf(F),Z=z.slice(0,$+1),de=[...z.slice($+1),...Z];for(const Y of de.slice())if(Y.dataset.moonbaseFocusGuard==="true"||C!=null&&C.contains(Y)){const V=de.indexOf(Y);V!==-1&&de.splice(V,1)}it(de,Ue.First,{sorted:!1})},[xt.Backwards]:()=>{var C;it(S,Ue.Previous)===yn.Error&&((C=G(s.button))==null||C.focus())}})}A()}return()=>{const S={open:s.popoverState.value===0,close:s.close},{id:A,focus:F,...C}=e,z={ref:s.panel,id:A,onKeydown:d,onFocusout:o&&s.popoverState.value===0?f:void 0,tabIndex:-1};return Qe({ourProps:z,theirProps:{...t,...C},attrs:t,slot:S,slots:{...n,default:(...$)=>{var Z;return[Le(Ce,[u.value&&s.isPortalled.value&&Le(Kn,{id:a,ref:s.beforePanelSentinel,features:zn.Focusable,"data-moonbase-focus-guard":!0,as:"button",type:"button",onFocus:y}),(Z=n.default)==null?void 0:Z.call(n,...$),u.value&&s.isPortalled.value&&Le(Kn,{id:c,ref:s.afterPanelSentinel,features:zn.Focusable,"data-moonbase-focus-guard":!0,as:"button",type:"button",onFocus:E})])]}},features:qn.RenderStrategy|qn.Static,visible:u.value,name:"PopoverPanel"})}}});let e_=he({props:{onFocus:{type:Function,required:!0}},setup(e){let t=T(!0);return()=>t.value?Le(Kn,{as:"button",type:"button",features:zn.Focusable,onFocus(n){n.preventDefault();let r,o=50;function s(){var i;if(o--<=0){r&&cancelAnimationFrame(r);return}if((i=e.onFocus)!=null&&i.call(e)){t.value=!1,cancelAnimationFrame(r);return}r=requestAnimationFrame(s)}r=requestAnimationFrame(s)}}):null}});const Vd=Symbol("TabsContext");function Ao(e){const t=$e(Vd,null);if(t===null){const n=new Error(`<${e} /> is missing a parent <TabGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ao),n}return t}const La=Symbol("TabsSSRContext"),t_=he({name:"TabGroup",emits:{change:e=>!0},props:{as:{type:[Object,String],default:"template"},selectedIndex:{type:[Number],default:null},defaultIndex:{type:[Number],default:0},vertical:{type:[Boolean],default:!1},manual:{type:[Boolean],default:!1}},inheritAttrs:!1,setup(e,{slots:t,attrs:n,emit:r}){const o=T(e.selectedIndex??e.defaultIndex),s=T([]),i=T([]),a=X(()=>e.selectedIndex!==null),c=X(()=>a.value?e.selectedIndex:o.value);function l(y){const E=jr(u.tabs.value,G),S=jr(u.panels.value,G),A=E.filter(F=>{var C;return!((C=G(F))!=null&&C.hasAttribute("disabled"))});if(y<0||y>E.length-1){const F=Je(o.value===null?0:Math.sign(y-o.value),{[-1]:()=>1,0:()=>Je(Math.sign(y),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0}),C=Je(F,{0:()=>E.indexOf(A[0]),1:()=>E.indexOf(A[A.length-1])});C!==-1&&(o.value=C),u.tabs.value=E,u.panels.value=S}else{const F=E.slice(0,y),z=[...E.slice(y),...F].find(Z=>A.includes(Z));if(!z)return;let $=E.indexOf(z)??u.selectedIndex.value;$===-1&&($=u.selectedIndex.value),o.value=$,u.tabs.value=E,u.panels.value=S}}let u={selectedIndex:X(()=>o.value??e.defaultIndex??null),orientation:X(()=>e.vertical?"vertical":"horizontal"),activation:X(()=>e.manual?"manual":"auto"),tabs:s,panels:i,setSelectedIndex(y){c.value!==y&&r("change",y),a.value||l(y)},registerTab(y){if(s.value.includes(y))return;const E=s.value[o.value];if(s.value.push(y),s.value=jr(s.value,G),!a.value){const S=s.value.indexOf(E)??o.value;S!==-1&&(o.value=S)}},unregisterTab(y){const E=s.value.indexOf(y);E!==-1&&s.value.splice(E,1)},registerPanel(y){i.value.includes(y)||(i.value.push(y),i.value=jr(i.value,G))},unregisterPanel(y){const E=i.value.indexOf(y);E!==-1&&i.value.splice(E,1)}};dt(Vd,u);const d=T({tabs:[],panels:[]}),f=T(!1);Re(()=>{f.value=!0}),dt(La,X(()=>f.value?null:d.value));const m=X(()=>e.selectedIndex);return Re(()=>{Xe([m],()=>l(e.selectedIndex??e.defaultIndex),{immediate:!0})}),ft(()=>{if(!a.value||c.value==null||u.tabs.value.length<=0)return;const y=jr(u.tabs.value,G);y.some((S,A)=>G(u.tabs.value[A])!==G(S))&&u.setSelectedIndex(y.findIndex(S=>G(S)===G(u.tabs.value[c.value])))}),()=>{const y={selectedIndex:o.value};return Le(Ce,[s.value.length<=0&&Le(e_,{onFocus:()=>{for(const E of s.value){const S=G(E);if((S==null?void 0:S.tabIndex)===0)return S.focus(),!0}return!1}}),Qe({theirProps:{...n,...Pa(e,["selectedIndex","defaultIndex","manual","vertical","onChange"])},ourProps:{},slot:y,slots:t,attrs:n,name:"TabGroup"})])}}}),n_=he({name:"TabList",props:{as:{type:[Object,String],default:"div"}},setup(e,{attrs:t,slots:n}){const r=Ao("TabList");return()=>{const o={selectedIndex:r.selectedIndex.value},s={role:"tablist","aria-orientation":r.orientation.value};return Qe({ourProps:s,theirProps:e,slot:o,attrs:t,slots:n,name:"TabList"})}}}),Ma=he({name:"Tab",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:()=>`moonbase-tabs-tab-${$t()}`}},setup(e,{attrs:t,slots:n,expose:r}){const o=Ao("Tab"),s=T(null);r({el:s,$el:s}),Re(()=>o.registerTab(s)),mt(()=>o.unregisterTab(s));const i=$e(La),a=X(()=>{if(i.value){const S=i.value.tabs.indexOf(e.id);return S===-1?i.value.tabs.push(e.id)-1:S}return-1}),c=X(()=>{const S=o.tabs.value.indexOf(s);return S===-1?a.value:S}),l=X(()=>c.value===o.selectedIndex.value);function u(S){var F;const A=S();if(A===yn.Success&&o.activation.value==="auto"){const C=(F=Qt(s))==null?void 0:F.activeElement,z=o.tabs.value.findIndex($=>G($)===C);z!==-1&&o.setSelectedIndex(z)}return A}function d(S){const A=o.tabs.value.map(C=>G(C)).filter(Boolean);if(S.key===et.Space||S.key===et.Enter){S.preventDefault(),S.stopPropagation(),o.setSelectedIndex(c.value);return}switch(S.key){case et.Home:case et.PageUp:return S.preventDefault(),S.stopPropagation(),u(()=>it(A,Ue.First));case et.End:case et.PageDown:return S.preventDefault(),S.stopPropagation(),u(()=>it(A,Ue.Last))}if(u(()=>Je(o.orientation.value,{vertical(){return S.key===et.ArrowUp?it(A,Ue.Previous|Ue.WrapAround):S.key===et.ArrowDown?it(A,Ue.Next|Ue.WrapAround):yn.Error},horizontal(){return S.key===et.ArrowLeft?it(A,Ue.Previous|Ue.WrapAround):S.key===et.ArrowRight?it(A,Ue.Next|Ue.WrapAround):yn.Error}}))===yn.Success)return S.preventDefault()}const f=T(!1);function m(){var S;f.value||(f.value=!0,!e.disabled&&((S=G(s))==null||S.focus({preventScroll:!0}),o.setSelectedIndex(c.value),Js(()=>{f.value=!1})))}function y(S){S.preventDefault()}const E=Td(X(()=>({as:e.as,type:t.type})),s);return()=>{var z;const S={selected:l.value,disabled:e.disabled??!1},{id:A,...F}=e,C={ref:s,onKeydown:d,onMousedown:y,onClick:m,id:A,role:"tab",type:E.value,"aria-controls":(z=G(o.panels.value[c.value]))==null?void 0:z.id,"aria-selected":l.value,tabIndex:l.value?0:-1,disabled:e.disabled?!0:void 0};return Qe({ourProps:C,theirProps:F,slot:S,attrs:t,slots:n,name:"Tab"})}}}),r_=he({name:"TabPanels",props:{as:{type:[Object,String],default:"div"}},setup(e,{slots:t,attrs:n}){const r=Ao("TabPanels");return()=>{const o={selectedIndex:r.selectedIndex.value};return Qe({theirProps:e,ourProps:{},slot:o,attrs:n,slots:t,name:"TabPanels"})}}}),Ua=he({name:"TabPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:()=>`moonbase-tabs-panel-${$t()}`},tabIndex:{type:Number,default:0}},setup(e,{attrs:t,slots:n,expose:r}){const o=Ao("TabPanel"),s=T(null);r({el:s,$el:s}),Re(()=>o.registerPanel(s)),mt(()=>o.unregisterPanel(s));const i=$e(La),a=X(()=>{if(i.value){const u=i.value.panels.indexOf(e.id);return u===-1?i.value.panels.push(e.id)-1:u}return-1}),c=X(()=>{const u=o.panels.value.indexOf(s);return u===-1?a.value:u}),l=X(()=>c.value===o.selectedIndex.value);return()=>{var E;const u={selected:l.value},{id:d,tabIndex:f,...m}=e,y={ref:s,id:d,role:"tabpanel","aria-labelledby":(E=G(o.tabs.value[c.value]))==null?void 0:E.id,tabIndex:l.value?f:-1};return!l.value&&e.unmount&&!e.static?Le(Kn,{as:"span","aria-hidden":!0,...y}):Qe({ourProps:y,theirProps:m,slot:u,attrs:t,slots:n,features:qn.Static|qn.RenderStrategy,visible:l.value,name:"TabPanel"})}}});function o_(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Fa(e,...t){e&&t.length>0&&!e.dataset.transition?e.dataset.transition=t.join(" "):e&&t.length>0&&(e.dataset.transition=[...e.dataset.transition.split(" "),...t].join(" "))}function ti(e,...t){e&&t.length>0&&e.dataset.transition&&(e.dataset.transition=e.dataset.transition.split(" ").filter(n=>!t.includes(n)).join(" "))}var Ba=(e=>(e.Finished="finished",e.Cancelled="cancelled",e))(Ba||{});function s_(e,t){const n=$o();if(!e)return n.dispose;const{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[s,i]=[r,o].map(a=>{const[c=0]=a.split(",").filter(Boolean).map(l=>l.includes("ms")?Number.parseFloat(l):Number.parseFloat(l)*1e3).sort((l,u)=>u-l);return c});return s!==0?n.setTimeout(()=>t("finished"),s+i):t("finished"),n.add(()=>t("cancelled")),n.dispose}function Rd(e,t,n,r,o,s){const i=$o(),a=s!==void 0?o_(s):()=>{};return ti(e,...o),Fa(e,...t,...n),i.nextFrame(()=>{ti(e,...n),Fa(e,...r),i.add(s_(e,c=>(ti(e,...r,...t),Fa(e,...o),a(c))))}),i.add(()=>ti(e,...t,...n,...r,...o)),i.add(()=>a("cancelled")),i.dispose}function Or(e=""){return e.split(/\s+/).filter(t=>t.length>1)}const Ha=Symbol("TransitionContext");function i_(){return $e(Ha,null)!==null}function a_(){const e=$e(Ha,null);if(e===null)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return e}const Za=Symbol("NestingContext");function l_(){const e=$e(Za,null);if(e===null)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return e}function ni(e){return"children"in e?ni(e.children):e.value.filter(({state:t})=>t==="visible").length>0}function jd(e){const t=T([]),n=T(!1);Re(()=>n.value=!0),mt(()=>n.value=!1);function r(s,i=Wn.Hidden){const a=t.value.findIndex(({id:c})=>c===s);a!==-1&&(Je(i,{[Wn.Unmount](){t.value.splice(a,1)},[Wn.Hidden](){t.value[a].state="hidden"}}),!ni(t)&&n.value&&(e==null||e()))}function o(s){const i=t.value.find(({id:a})=>a===s);return i?i.state!=="visible"&&(i.state="visible"):t.value.push({id:s,state:"visible"}),()=>r(s,Wn.Unmount)}return{children:t,register:o,unregister:r}}const Ld=qn.RenderStrategy,Vo=he({props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:"enter"},enterFrom:{type:[String],default:"enter-from"},enterTo:{type:[String],default:"enter-to"},entered:{type:[String],default:"entered"},leave:{type:[String],default:"leave"},leaveFrom:{type:[String],default:"leave-from"},leaveTo:{type:[String],default:"leave-to"}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(e,{emit:t,attrs:n,slots:r,expose:o}){const s=T(0);function i(){s.value|=at.Opening,t("beforeEnter")}function a(){s.value&=~at.Opening,t("afterEnter")}function c(){s.value|=at.Closing,t("beforeLeave")}function l(){s.value&=~at.Closing,t("afterLeave")}if(!i_()&&Zy())return()=>Le(qa,{...e,onBeforeEnter:i,onAfterEnter:a,onBeforeLeave:c,onAfterLeave:l},r);const u=T(null),d=X(()=>e.unmount?Wn.Unmount:Wn.Hidden);o({el:u,$el:u});const{show:f,appear:m}=a_(),{register:y,unregister:E}=l_(),S=T(f.value?"visible":"hidden"),A={value:!0},F=$t(),C={value:!1},z=jd(()=>{!C.value&&S.value!=="hidden"&&(S.value="hidden",E(F),l())});Re(()=>{const oe=y(F);mt(oe)}),ft(()=>{if(d.value===Wn.Hidden&&F){if(f.value&&S.value!=="visible"){S.value="visible";return}Je(S.value,{hidden:()=>E(F),visible:()=>y(F)})}});const $=Or(e.enter),Z=Or(e.enterFrom),x=Or(e.enterTo),de=Or(e.entered),Y=Or(e.leave),V=Or(e.leaveFrom),P=Or(e.leaveTo);Re(()=>{ft(()=>{if(S.value==="visible"){const oe=G(u);if(oe instanceof Comment&&oe.data==="")throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}})});function j(oe){const w=A.value&&!m.value,I=G(u);!I||!(I instanceof HTMLElement)||w||(C.value=!0,f.value&&i(),f.value||c(),oe(f.value?Rd(I,$,Z,x,de,ne=>{C.value=!1,ne===Ba.Finished&&a()}):Rd(I,Y,V,P,de,ne=>{C.value=!1,ne===Ba.Finished&&(ni(z)||(S.value="hidden",E(F),l()))})))}return Re(()=>{Xe([f],(oe,w,I)=>{j(I),A.value=!1},{immediate:!0})}),dt(Za,z),yd(X(()=>Je(S.value,{visible:at.Open,hidden:at.Closed})|s.value)),()=>{const{appear:oe,show:w,enter:I,enterFrom:ne,enterTo:ae,entered:re,leave:ce,leaveFrom:Ie,leaveTo:je,...nt}=e,bt={ref:u},bn={...nt,...m.value&&f.value&&To.isServer?{class:rs([n.class,nt.class,...$,...Z])}:{}};return Qe({theirProps:bn,ourProps:bt,slot:{},slots:r,attrs:n,features:Ld,visible:S.value==="visible",name:"TransitionChild"})}}}),c_=Vo,qa=he({inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(e,{emit:t,attrs:n,slots:r}){const o=Ys(),s=X(()=>e.show===null&&o!==null?(o.value&at.Open)===at.Open:e.show);ft(()=>{if(![!0,!1].includes(s.value))throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.')});const i=T(s.value?"visible":"hidden"),a=jd(()=>{i.value="hidden"}),c=T(!0),l={show:s,appear:X(()=>e.appear||!c.value)};return Re(()=>{ft(()=>{c.value=!1,s.value?i.value="visible":ni(a)||(i.value="hidden")})}),dt(Za,a),dt(Ha,l),()=>{const u=Pa(e,["show","appear","unmount","onBeforeEnter","onBeforeLeave","onAfterEnter","onAfterLeave"]),d={unmount:e.unmount};return Qe({ourProps:{...d,as:"template"},theirProps:{},slot:{},slots:{...r,default:()=>[Le(c_,{onBeforeEnter:()=>t("beforeEnter"),onAfterEnter:()=>t("afterEnter"),onBeforeLeave:()=>t("beforeLeave"),onAfterLeave:()=>t("afterLeave"),...n,...d,...u},r.default)]},attrs:{},features:Ld,visible:i.value==="visible",name:"Transition"})}}}),u_={class:"moonbase:modal-container"},ri=he({__name:"Modal",props:{open:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(_(),xe(b(qa),{as:"template",show:t.open},{default:ye(()=>[B(b(Sd),{as:"div",class:"moonbase:modal",onClose:n[0]||(n[0]=r=>t.$emit("close"))},{default:ye(()=>[O("div",u_,[B(b(Vo),{as:"template"},{default:ye(()=>[B(b(xd),{class:"moonbase:modal-overlay"})]),_:1}),B(b(Vo),{as:"template"},{default:ye(()=>[B(b(kd),{class:"moonbase:modal-content"},{default:ye(()=>[Wi(t.$slots,"default")]),_:3})]),_:3})])]),_:3})]),_:3},8,["show"]))}}),d_=["data-visible"],f_=he({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=Ae(),o=St(),s=$e(Ws),i=T(r.getParameter("email")??""),a=T(""),c=T(null);async function l(){c.value=null;try{const u=await o.signIn(i.value,a.value);Xt(1500).then(()=>n("signedIn",u))}catch(u){throw u instanceof Pr?c.value="User not found":c.value=u.message,u}}return(u,d)=>(_(),xe(Hn,{handler:l,class:"moonbase:sign-in"},{default:ye(()=>{var f;return[B(gt,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=m=>i.value=m),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),B(gt,{modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=m=>a.value=m),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),B(Zn,{success:"Signed in",label:"Sign in",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!c.value||void 0},K(c.value),9,d_),(f=b(s))!=null&&f.auth.enable.signUp?(_(),N("button",{key:0,type:"button",onClick:d[2]||(d[2]=m=>b(r).show(b(ke).Authentication,b(pe).SignUp,{email:i.value}))}," Create account ")):me("",!0),O("button",{type:"button",onClick:d[3]||(d[3]=m=>b(r).show(b(ke).Authentication,b(pe).ForgotPassword,{email:i.value}))}," Forgot password ")]}),_:1}))}}),p_={class:"moonbase:authentication"},h_={key:0,class:"moonbase:loader"},m_=he({__name:"Authentication",props:{open:{type:Boolean}},emits:["authenticated"],setup(e,{emit:t}){const n=t,r=Ae(),{loaded:o,user:s}=St();Xe(s,a=>{a&&r.intent===pe.SignIn&&(n("authenticated",a),r.dequeue())});const i=X(()=>{switch(r.intent){case pe.SignIn:return"Sign in";case pe.SignUp:return"Sign up";case pe.ConfirmAccount:return"Confirm account";case pe.ConfirmEmailChange:return"Confirm email change";case pe.ForgotPassword:return"Forgot password";case pe.ResetPassword:return"Reset password"}throw new Error("Moonbase: Unknown intent")});return(a,c)=>(_(),xe(ri,{open:a.open,onClose:c[3]||(c[3]=l=>b(r).reset())},{default:ye(()=>[O("div",p_,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(K(i.value),1)]),_:1}),b(o)?b(r).intent===b(pe).SignIn?(_(),xe(f_,{key:1})):b(r).intent===b(pe).SignUp?(_(),xe(iy,{key:2,onSignedUp:c[0]||(c[0]=l=>b(r).dequeue())})):b(r).intent===b(pe).ConfirmAccount?(_(),xe(dy,{key:3,onConfirmedAccount:c[1]||(c[1]=l=>b(r).dequeue())})):b(r).intent===b(pe).ConfirmEmailChange?(_(),xe(Oy,{key:4})):b(r).intent===b(pe).ForgotPassword?(_(),xe(my,{key:5})):b(r).intent===b(pe).ResetPassword?(_(),xe(yy,{key:6,onPasswordReset:c[2]||(c[2]=l=>b(r).dequeue())})):me("",!0):(_(),N("div",h_,[B(Pt)]))])]),_:1},8,["open"]))}});function _n(e,t){return new Intl.NumberFormat(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",maximumFractionDigits:2,minimumFractionDigits:2}).format(e)}const v_={class:"moonbase:product-cart-item"},g_=["src"],y_={key:1,class:"moonbase:image-placeholder"},__={class:"moonbase:product-cart-item-content"},b_={key:0,class:"moonbase:cart-item-discount"},w_={class:"font-semibold"},E_={key:0,class:"ml-0.5"},O_={key:2,class:"moonbase:product-cart-item-total"},N_={key:0,class:"moonbase:discount"},S_={key:1},x_=he({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){return(t,n)=>{var r,o,s;return _(),N("div",v_,[(r=t.lineItem.product)!=null&&r.iconUrl?(_(),N("img",{key:0,src:t.lineItem.product.iconUrl,alt:""},null,8,g_)):(_(),N("div",y_)),O("div",__,[O("h3",null,K((o=t.lineItem.product)==null?void 0:o.name),1),O("p",null,K((s=t.lineItem.product)==null?void 0:s.tagline),1),t.lineItem.appliedDiscount?(_(),N("p",b_,[Te(" Discount applied: "),O("span",w_,K(t.lineItem.appliedDiscount.name),1),t.lineItem.appliedDiscount.total?(_(),N("span",E_," (-"+K(b(_n)(t.lineItem.appliedDiscount.total[t.currency],t.currency))+") ",1)):me("",!0)])):me("",!0),O("p",null,K(t.lineItem.quantity)+" in cart",1)]),t.lineItem.variation?(_(),N("div",O_,[t.lineItem.variation.hasDiscount?(_(),N("span",N_,K(b(_n)(t.lineItem.variation.originalPrice[t.currency],t.currency)),1)):me("",!0),t.lineItem.quantity!==1?(_(),N("span",S_,K(t.lineItem.quantity)+" x "+K(b(_n)(t.lineItem.variation.price[t.currency],t.currency)),1)):me("",!0),Te(" "+K(b(_n)(t.lineItem.variation.price[t.currency]*t.lineItem.quantity,t.currency)),1)])):me("",!0)])}}}),k_={class:"moonbase:bundle-cart-item"},C_=["src"],T_={key:1,class:"moonbase:image-placeholder"},P_={class:"moonbase:bundle-cart-item-content"},$_={key:0,class:"moonbase:cart-item-discount"},I_={class:"font-semibold"},D_={key:0,class:"ml-0.5"},A_={class:"moonbase:bundle-cart-item-summary"},V_=["data-open"],R_=[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)],j_={key:2,class:"moonbase:product-cart-item-total"},L_={key:0,class:"moonbase:discount"},M_={key:1},U_=["src"],F_={key:1,class:"moonbase:image-placeholder"},B_=["data-included"],H_={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Z_=[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)],q_={key:0,class:"truncate italic"},W_={key:1,class:"truncate"},z_=he({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const t=T(!1),n=T(null);return Xe(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>{var s,i,a,c,l,u,d;return _(),N("div",null,[O("div",k_,[(s=r.lineItem.bundle)!=null&&s.iconUrl?(_(),N("img",{key:0,src:r.lineItem.bundle.iconUrl,alt:""},null,8,C_)):(_(),N("div",T_)),O("div",P_,[O("h3",null,K((i=r.lineItem.bundle)==null?void 0:i.name),1),O("p",null,K((a=r.lineItem.bundle)==null?void 0:a.tagline),1),r.lineItem.appliedDiscount?(_(),N("p",$_,[Te(" Discount applied: "),O("span",I_,K(r.lineItem.appliedDiscount.name),1),r.lineItem.appliedDiscount.total?(_(),N("span",D_," (-"+K(b(_n)(r.lineItem.appliedDiscount.total[r.currency],r.currency))+") ",1)):me("",!0)])):me("",!0),O("div",A_,[O("span",null,K(r.lineItem.quantity)+" in cart",1),r.lineItem.bundle?(_(),N("button",{key:0,onClick:o[0]||(o[0]=f=>t.value=!t.value)},[O("span",null,[Te(" Including "+K((c=r.lineItem.bundle)==null?void 0:c.products.filter(f=>f.included).length)+" ",1),(l=r.lineItem.bundle)!=null&&l.products.some(f=>!f.included)?(_(),N(Ce,{key:0},[Te("of "+K((u=r.lineItem.bundle)==null?void 0:u.products.length),1)],64)):me("",!0),Te(" products ")]),(_(),N("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},R_,8,V_))])):me("",!0)])]),r.lineItem.variation?(_(),N("div",j_,[r.lineItem.variation.hasDiscount?(_(),N("span",L_,K(b(_n)(r.lineItem.variation.originalPrice[r.currency],r.currency)),1)):me("",!0),r.lineItem.quantity!==1?(_(),N("span",M_,K(r.lineItem.quantity)+" x "+K(b(_n)(r.lineItem.variation.price[r.currency],r.currency)),1)):me("",!0),Te(" "+K(b(_n)(r.lineItem.variation.price[r.currency]*r.lineItem.quantity,r.currency)),1)])):me("",!0)]),O("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"}},[(_(!0),N(Ce,null,Gt(((d=r.lineItem.bundle)==null?void 0:d.products)||[],f=>(_(),N("div",{key:f.id},[f!=null&&f.iconUrl?(_(),N("img",{key:0,src:f.iconUrl,alt:""},null,8,U_)):(_(),N("div",F_)),O("div",null,[O("h3",{"data-included":f.included||void 0},[f.included?(_(),N("svg",H_,Z_)):me("",!0),Te(" "+K(f==null?void 0:f.name),1)],8,B_),f.included?f!=null&&f.tagline?(_(),N("p",W_,K(f.tagline),1)):me("",!0):(_(),N("p",q_," You already own this "))])]))),128))],512)])}}}),K_={class:"moonbase:cart-modal-container"},G_=he({__name:"CartModal",props:{open:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(_(),xe(b(qa),{as:"template",show:t.open},{default:ye(()=>[B(b(Sd),{as:"div",class:"moonbase:cart-modal",onClose:n[0]||(n[0]=r=>t.$emit("close"))},{default:ye(()=>[O("div",K_,[B(b(Vo),{as:"template"},{default:ye(()=>[B(b(xd),{class:"moonbase:cart-modal-overlay"})]),_:1}),B(b(Vo),{as:"template"},{default:ye(()=>[B(b(kd),{class:"moonbase:cart-modal-content"},{default:ye(()=>[Wi(t.$slots,"default")]),_:3})]),_:3})])]),_:3})]),_:3},8,["show"]))}}),J_=["disabled","data-success","data-error","data-working","data-variant"],Y_=["data-visible"],Md=he({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},variant:{},noReset:{type:Boolean}},setup(e){const t=e,n=T(!1),r=T(!1),o=T(!1),s=X(()=>r.value?t.success:o.value?t.error:t.label);async function i(){try{const a=t.handler();a instanceof Promise&&(n.value=!0,await a,n.value=!1,r.value=!0,await Xt(2500),t.noReset||(r.value=!1))}catch{n.value=!1,o.value=!0,await Xt(2500),o.value=!1}}return(a,c)=>(_(),N("button",{class:"moonbase:button",type:"button",disabled:r.value||o.value||n.value,"data-success":r.value||void 0,"data-error":o.value||void 0,"data-working":n.value||void 0,"data-variant":a.variant,onClick:i},[O("div",{"data-visible":n.value||void 0,"aria-hidden":"true"},[n.value?(_(),xe(Pt,{key:0})):me("",!0)],8,Y_),Te(" "+K(s.value),1)],8,J_))}}),X_={class:"moonbase:cart"},Q_={key:0,role:"list",class:"moonbase:cart-items"},eb={key:1,class:"moonbase:cart-empty"},tb={key:2,class:"moonbase:cart-total"},nb=O("label",null," Total ",-1),rb=O("p",null," Sales tax to be calculated at checkout ",-1),ob=he({__name:"Cart",props:{open:{type:Boolean}},setup(e){const t=Ae(),{items:n,total:r,currency:o,checkout:s}=ba();async function i(){if(!await s(`${window.location.pathname}?mb_intent=view_products`))throw new Error("Cancelled checkout")}return(a,c)=>(_(),xe(G_,{open:a.open,onClose:c[0]||(c[0]=l=>b(t).reset())},{default:ye(()=>[O("div",X_,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(" Cart ")]),_:1}),b(n).length>0?(_(),N("ul",Q_,[(_(!0),N(Ce,null,Gt(b(n),l=>(_(),N("li",{key:l.id},[l.type==="Product"?(_(),xe(x_,{key:0,"line-item":l,currency:b(o)},null,8,["line-item","currency"])):l.type==="Bundle"?(_(),xe(z_,{key:1,"line-item":l,currency:b(o)},null,8,["line-item","currency"])):me("",!0)]))),128))])):(_(),N("div",eb," Your cart is empty! ")),b(n).length>0?(_(),N("div",tb,[nb,O("span",null,K(b(_n)(b(r).amount,b(r).currency)),1),rb])):me("",!0),b(n).length>0?(_(),xe(Md,{key:3,handler:i,"no-reset":!0,label:"Checkout",success:"Done",error:"Cancelled"})):me("",!0)])]),_:1},8,["open"]))}}),sb={class:"moonbase:account"},ib={key:0,class:"moonbase:error"},ab={key:1,class:"moonbase:notification"},lb={key:0,class:"moonbase:error"},cb=he({__name:"Account",setup(e){var F,C,z;const t=Ae(),{user:n,update:r,setPassword:o,signOut:s}=St(),i=T(((F=n.value)==null?void 0:F.name)??""),a=T(((C=n.value)==null?void 0:C.email)??""),c=T(((z=n.value)==null?void 0:z.communicationPreferences)??{newsletterOptIn:!1}),l=T(null),u=T(!1),d=T(""),f=T(""),m=T(null),y=T(!1);async function E(){l.value=null,u.value=!1;try{(await r(i.value,a.value,void 0,c.value)).needsEmailConfirmationToken&&(u.value=!0)}catch($){throw l.value=$,$}}async function S(){m.value=null;try{await o(d.value,f.value),d.value="",f.value=""}catch($){throw m.value=$,$}}async function A(){y.value=!0,await s(),t.reset()}return($,Z)=>(_(),N("div",sb,[B(Hn,{handler:E},{default:ye(()=>[B(gt,{modelValue:i.value,"onUpdate:modelValue":Z[0]||(Z[0]=x=>i.value=x),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),B(gt,{modelValue:a.value,"onUpdate:modelValue":Z[1]||(Z[1]=x=>a.value=x),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),B(od,{modelValue:c.value.newsletterOptIn,"onUpdate:modelValue":Z[2]||(Z[2]=x=>c.value.newsletterOptIn=x),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),B(Zn,{label:"Save",error:"Error",success:"Saved"}),l.value?(_(),N("p",ib,K(l.value.message),1)):u.value?(_(),N("p",ab," You need to confirm your new email address, please check your inbox ")):me("",!0)]),_:1}),B(Hn,{handler:S},{default:ye(()=>[B(gt,{modelValue:d.value,"onUpdate:modelValue":Z[3]||(Z[3]=x=>d.value=x),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),B(gt,{modelValue:f.value,"onUpdate:modelValue":Z[4]||(Z[4]=x=>f.value=x),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),B(Zn,{label:"Save",error:"Error",success:"Saved"}),m.value?(_(),N("p",lb,K(m.value.message),1)):me("",!0)]),_:1}),B(Md,{label:"Log out",success:"Logged out",error:"Error",variant:"secondary",handler:A})]))}}),ub={},db={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},fb=[O("path",{d:"M320 336h76c55 0 100-21.21 100-75.6s-53-73.47-96-75.6C391.11 99.74 329 48 256 48c-69 0-113.44 45.79-128 91.2-60 5.7-112 35.88-112 98.4S70 336 136 336h56M192 400.1l64 63.9 64-63.9M256 224v224.03",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)];function pb(e,t){return _(),N("svg",db,fb)}const Ud=Bn(ub,[["render",pb]]),hb={},mb={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},vb=[O("path",{d:"M480 265H232v179l248 36V265zM216 265H32v150l184 26.7V265zM480 32L232 67.4V249h248V32zM216 69.7L32 96v153h184V69.7z",fill:"currentColor"},null,-1)];function gb(e,t){return _(),N("svg",mb,vb)}const Fd=Bn(hb,[["render",gb]]),yb={},_b={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},bb=[O("path",{d:"M443.66 405.05c-1.46-.79-2.85-1.54-4-2.2-6.47-3.83-13-10.52-11.85-17.83 2.42-15.94 2.89-23.47-.49-28.79a15.61 15.61 0 0 0-7.67-6.2v-.06c1.41-2.56 2.26-5.66 2.83-10.12 1.44-11-5-44-13.7-70.7-8.08-24.68-29.24-50-44.7-68.56l-3.61-4.34c-23.88-28.93-24.34-38.19-26.55-82.67-.32-6.47-.69-13.8-1.17-22C329.87 41.43 304 16 256 16c-25.2 0-44.62 7.15-57.72 21.26C187.79 48.55 182 64 182 80.78c0 29.52 2 53 2.15 54.29 1.4 35.7 1 41.22-8.31 57.55-2.23 3.93-8.38 10.87-14.89 18.21-8.48 9.57-18.09 20.41-23.36 29.22-3.77 6.31-5.88 12.63-8.11 19.33-3.4 10.21-7.26 21.78-18.15 36.57-12.57 17.07-15.52 29.61-11 47.45-4.94 6.45-4.83 14.37-4.75 20.23a25.84 25.84 0 0 1-.3 6.09c-2.29 7.59-12.42 9.4-22 10.18-1.58.12-3.1.21-4.55.29-7.26.39-13.53.74-17.13 6.3-3.47 5.36-1.12 13.8 2.14 25.48.72 2.58 1.46 5.25 2.19 8.06 1.83 7-.16 10.48-2.68 14.84-2.44 4.21-5.21 9-5.21 17.55 0 14.67 20 18 43.05 21.94 7.36 1.24 15 2.53 22.63 4.24a225.58 225.58 0 0 1 34.08 10.68c9.72 3.73 17.4 6.68 26.43 6.68 16.18 0 28.25-9.77 39.92-19.21l2.15-1.75c5.53-4.49 21.5-4 34.34-3.64 3.46.1 6.73.2 9.65.2h6.22c13.48-.08 31.94-.18 42.23 2.5 3.75 1 6.2 3.72 9.29 7.19 5.87 6.56 13.17 14.75 33.39 14.75 19.39 0 29.55-8.71 41.32-18.8 7.16-6.13 14.56-12.48 25.07-17.86 3.92-2 7.62-3.87 11.08-5.61 22.64-11.38 35.11-17.65 35.11-27.82 0-9.91-12.24-16.5-20.34-20.86zM211.11 88.38a13.91 13.91 0 0 1 12.47 9c1.95 5.55 1.81 10.42.21 12.94 0 0-.22-1-.36-1.44a14.85 14.85 0 0 0-6.44-8.59 11.35 11.35 0 0 0-8.94-1.47c-4.26 1.13-8.41 5-8.91 18.79-5.16-10.47-2.31-18 .92-23 2.31-3.73 7.47-6.33 11.05-6.23zm-17.5 375C192 479.24 175.2 479 170.09 478.59c-9.81-.82-21.66-4.69-33.13-8.43-4.52-1.47-9.19-3-13.73-4.34-13.2-3.89-30.12-6.74-43.72-9-3.22-.55-6.27-1.06-9.05-1.55s-4.61-1.27-5.2-2.3c-1-1.65.38-5.25 1.93-9.41C69.27 438 72.11 430.34 72 421c0-3.91-1.47-8.3-2.84-12.56-1.62-5-3.28-10.17-1.93-12.62 1.23-2.23 6.75-2.49 11.6-2.49h2.26c3.55 0 6.62.06 8.75-.53 6.51-1.81 14.86-6.92 17.81-13.88.9-2.17 1.37-6.94 2-14 .37-4.12.74-8.37 1.22-10.58a3.55 3.55 0 0 1 2.11-2.55c1.65-.77 6.78-1.91 18.63 4.08 11.18 5.65 22.88 25.84 34.2 45.37 3.56 6.14 6.92 11.94 10.3 17.36 14.04 22.54 18.83 31.6 17.5 44.8zm128.84-31.56a68.74 68.74 0 0 1-4.55 10.9.58.58 0 0 1-1.08-.42 56.61 56.61 0 0 0 2.11-18.43c-.25-4.73-.4-7.59-2.66-8.51s-4.26.83-9.45 5.54c-1.1 1-2.36 2.14-3.78 3.4-10.8 9.47-26.88 20.68-55.61 23.37-16.84 1.59-27.59-4.63-30.92-8.14a2.16 2.16 0 0 0-3.07-.08 2.23 2.23 0 0 0-.51 2.29c2.12 6.84 1.2 12.26-.49 16.19-.95 2.2-1.85 2.05-2-.34-.25-4.64-1-9.88-3-14.19-3.11-6.94-7-14.34-8.89-17.88v-.05c3.24-1.49 8.86-4.83 11.37-10.88s4.48-18-9.82-31.74c-6.28-6.05-22.1-17.16-36.06-27-10.9-7.65-22.17-15.56-23.65-17.51-4.49-5.89-6.37-9.3-6.94-19.65.07-2.3.13-4.59.19-6.89l.27-2.49a.58.58 0 0 1 1.15 0 63.07 63.07 0 0 0 2 9.72c1.08 3.73 2.4 7.58 3.62 9.18 3.19 4.22 7.56 7.39 11.67 8.49a5.48 5.48 0 0 0 5-.72c2.93-2.33 2.65-7.6 2.19-16.34-.47-9-1.11-21.34 1.85-34.55 5.62-25 10.91-32.51 17.61-42 .86-1.22 1.75-2.47 2.65-3.79 1.44-2.08 3-4.1 4.67-6.23 7.47-9.61 15.93-20.49 13.92-40.95-.51-5.19-.76-8.83-.86-11.39a1 1 0 0 1 1.88-.59l.49.77 1.21 2c4.86 8 13.64 22.57 25.1 22.57a13.62 13.62 0 0 0 2.36-.21c23.39-3.93 51.9-30.25 52.17-30.51 3.12-3 2.84-6.14 1.64-7.91a5.18 5.18 0 0 0-6.45-1.72c-3.29 1.4-7.14 3.15-11.22 5-13.82 6.27-37 16.75-42.25 14.34a23.11 23.11 0 0 1-6.32-5.13 1 1 0 0 1 1.14-1.65c5.59 2.29 9.55 1.45 14.2-.08l1-.34c9.37-3.09 14.2-4.77 30.76-12.08a97.55 97.55 0 0 1 16.26-5.93c4-1 6.42-1.63 7.71-4.34a6.65 6.65 0 0 0-.5-7.13c-1.53-1.87-4.07-2.57-7-1.9-3.22.75-4.7 3-6.41 4.49-2.4 2.05-5 4.16-17.19 8.65-27 10-34.58 10.61-45.21 3.43-9.84-6.69-15.15-13.23-15.15-16 0-2.13 5.45-5.7 8.71-7.84 1.33-.87 2.59-1.69 3.62-2.46 4.34-3.22 13-11.39 13.38-11.73 5.4-5.41 17.91-2.18 25 2.58a2.23 2.23 0 0 0 1.72.41 2.14 2.14 0 0 0 1.68-2.58c-4.2-17.46-.13-27.34 4-32.55a22.58 22.58 0 0 1 17.48-8.48c12.81 0 21.76 10 21.76 24.42 0 11-2.82 16.79-5.48 20.3a1.73 1.73 0 0 1-2.58.18 1.78 1.78 0 0 1-.24-2.2A24.61 24.61 0 0 0 290 114a16.58 16.58 0 0 0-16.84-16.67c-3.94 0-13.48 1.5-16.77 15.44a29.81 29.81 0 0 0-.34 11.07l.08.71c.9 7.38 15.3 12.51 27.23 15.51 11.36 2.85 13 6.22 8.84 19.63s3.11 26.23 5.7 29.57a78.3 78.3 0 0 1 8.31 12.47 93.8 93.8 0 0 1 6.62 16.48c2.17 6.79 4.05 12.65 10.63 21.22 11.07 14.4 17.66 48.64 15 78-.21 2.41-.53 4.29-.77 5.67-.43 2.53-.72 4.2.66 5.38s3.16.7 7.26-.63l3.43-1.09a109.33 109.33 0 0 1 12.58-2.8 2.15 2.15 0 0 0 1.59-1.16c3.43-6.91 3.85-15.22 4-22.47q0-1.31.06-2.79c.19-7.77.45-18.93-2.95-32a1 1 0 0 1 1.93-.64 93 93 0 0 1 6.66 25.55c2.55 22.58-1.9 32.09-1.94 32.17a1.61 1.61 0 0 0 .95 2.25 17.12 17.12 0 0 1 6.95 4.67c1.46 1.66.93 2.4-1.14 1.62a36.26 36.26 0 0 0-12.77-2.29c-10.4 0-18.09 4.95-21.51 9.19-3.19 3.94-3.7 7.67-3.83 11.27l-.06.05c-7.48-.75-12.94 1.21-17.47 6.21l-.08.09c-6.26 7.75-4 24.63-1.29 38.48 1.28 6.45 5.59 25.52 1.73 37.68zm96.1 10.07c-15.71 6.71-25.43 14.51-34 21.39-5.65 4.53-11 8.81-17.28 12.14-10.12 5.34-24.91 6.53-33.27-7.7-2.37-4-.71-9.86 1.58-17.95 3.05-10.75 7.23-25.46 3.71-44.65-.94-5.12-1.77-9.51-2.49-13.31C334 377 332.9 371.43 334 367c.63-2.45 3.43-3 5.87-3a20.83 20.83 0 0 1 2.63.19 29.51 29.51 0 0 0 7 12.1c5.7 5.86 13.63 8.83 23.56 8.85 2.1.17 25.94 1.55 36.54-22.4 1.46.18 3.65.7 4.3 2.3 1.28 3.19-.27 8.91-1.52 13.5-.9 3.31-1.68 6.16-1.63 8.37.31 16 11 22.78 25.83 32.16 1.79 1.13 3.66 2.31 5.55 3.54S445 425 445 426c-.52 4.79-20 13.16-26.45 15.91z",fill:"currentColor"},null,-1)];function wb(e,t){return _(),N("svg",_b,bb)}const Bd=Bn(yb,[["render",wb]]),Eb={},Ob={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Nb=[O("path",{d:"M349.13 136.86c-40.32 0-57.36 19.24-85.44 19.24-28.79 0-50.75-19.1-85.69-19.1-34.2 0-70.67 20.88-93.83 56.45-32.52 50.16-27 144.63 25.67 225.11 18.84 28.81 44 61.12 77 61.47h.6c28.68 0 37.2-18.78 76.67-19h.6c38.88 0 46.68 18.89 75.24 18.89h.6c33-.35 59.51-36.15 78.35-64.85 13.56-20.64 18.6-31 29-54.35-76.19-28.92-88.43-136.93-13.08-178.34-23-28.8-55.32-45.48-85.79-45.48z",fill:"currentColor"},null,-1),O("path",{d:"M340.25 32c-24 1.63-52 16.91-68.4 36.86-14.88 18.08-27.12 44.9-22.32 70.91h1.92c25.56 0 51.72-15.39 67-35.11 14.72-18.77 25.88-45.37 21.8-72.66z",fill:"currentColor"},null,-1)];function Sb(e,t){return _(),N("svg",Ob,Nb)}const Hd=Bn(Eb,[["render",Sb]]),xb={class:"moonbase:product-downloads"},kb=["data-last","onClick"],Cb={class:"moonbase:sr-only"},Tb={class:"moonbase:sr-only"},Pb=O("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})],-1),$b=["onClick"],Ib=he({__name:"ProductDownloads",props:{downloads:{}},setup(e){const t=e,n={[Bt.Universal]:()=>Ud,[Bt.Windows]:()=>Fd,[Bt.Linux]:()=>Bd,[Bt.Mac]:()=>Hd},{downloadProduct:r}=Ms(),o=X(()=>t.downloads.reduce((s,i)=>({...s,[i.platform]:(s[i.platform]||[]).concat({...i,icon:n[i.platform]})}),{}));return(s,i)=>(_(),N("span",xb,[(_(!0),N(Ce,null,Gt(o.value,(a,c,l)=>(_(),N(Ce,{key:c},[a.length===1?(_(),N("button",{key:0,type:"button",role:"button","data-last":l===Object.keys(o.value).length-1||void 0,onClick:u=>b(r)(a[0])},[O("span",Cb,K(c.toString()),1),(_(),xe(qi(a[0].icon()),{class:"h-5 w-5 text-white","aria-hidden":"true"}))],8,kb)):(_(),xe(b(ja),{key:1,as:"div","data-last":l===Object.keys(o.value).length-1||void 0,class:"moonbase:product-downloads-group"},{default:ye(()=>[B(b(Dd),null,{default:ye(()=>[O("span",Tb,K(c.toString()),1),(_(),xe(qi(a[0].icon()),{"aria-hidden":"true"})),Pb]),_:2},1024),B(xo,{name:"moonbase:scale"},{default:ye(()=>[B(b(Ad),{class:"moonbase:product-downloads-list"},{default:ye(()=>[(_(!0),N(Ce,null,Gt(a,u=>(_(),N("button",{key:u.key,type:"button",role:"button",onClick:d=>b(r)(u)},K(u.name),9,$b))),128))]),_:2},1024)]),_:2},1024)]),_:2},1032,["data-last"]))],64))),128))]))}}),Db={class:"moonbase:product-activations"},Ab=O("th",{scope:"col"}," Device ",-1),Vb=O("th",{scope:"col"}," Activation Method ",-1),Rb=O("th",{scope:"col"}," Last Online ",-1),jb={key:0,scope:"col"},Lb=[O("span",{class:"sr-only"},"Actions",-1)],Mb={key:0},Ub={colspan:"3"},Fb=O("td",null,null,-1),Bb={key:1},Hb=[O("td",{colspan:"3"}," No activations found ",-1)],Zb={key:0},qb=["onClick"],Wb=he({__name:"ProductActivations",props:{productId:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,revokeActivation:s}=Ms(),i=T(null);Re(async()=>{let l=await o(n.productId);for(i.value=l.items.map(u=>({...u,revoking:!1}));l.hasMore&&l.next;)l=await o(n.productId,l.next),i.value.push(...l.items.map(u=>({...u,revoking:!1})))});const a=X(()=>i.value&&i.value.some(l=>l.activationMethod===vi.Online));async function c(l){l.revoking=!0,await s(l),r("revoked",l),i.value&&i.value.splice(i.value.indexOf(l),1)}return(l,u)=>(_(),N("table",Db,[O("thead",null,[O("tr",null,[Ab,Vb,Rb,a.value?(_(),N("th",jb,Lb)):me("",!0)])]),O("tbody",null,[i.value?i.value.length===0?(_(),N("tr",Bb,Hb)):me("",!0):(_(),N("tr",Mb,[O("td",Ub,[B(Pt),Te(" Loading activations.. ")]),Fb])),(_(!0),N(Ce,null,Gt(i.value,d=>{var f;return _(),N("tr",{key:d.id},[O("td",null,K(d.name),1),O("td",null,K(d.activationMethod),1),O("td",null,K((f=d.lastValidatedAt)==null?void 0:f.toLocaleDateString()),1),a.value?(_(),N("td",Zb,[O("button",{class:"text-red-400 flex whitespace-nowrap items-center",onClick:m=>c(d)},[d.revoking?(_(),xe(Pt,{key:0})):me("",!0),Te(" Revoke ")],8,qb)])):me("",!0)])}),128))])]))}}),zb={class:"moonbase:products"},Kb=O("th",{scope:"col"}," Product ",-1),Gb=O("th",{scope:"col"}," Activations ",-1),Jb={key:0,scope:"col"},Yb={key:0},Xb=O("td",null,null,-1),Qb={key:1},e1=[O("td",{colspan:"3"}," No products found ",-1)],t1=["src"],n1={key:1,class:"moonbase:image-placeholder"},r1=O("span",{class:"moonbase:sr-only"},"View activations",-1),o1={key:0},s1={key:0},i1=he({__name:"Products",setup(e){const{getProducts:t}=Ms(),n=T(null);Re(async()=>{let o=await t();for(n.value=o.items;o.hasMore&&o.next;)o=await t(o.next),n.value.push(...o.items)});const r=X(()=>n.value&&n.value.some(o=>o.downloads));return(o,s)=>(_(),N("table",zb,[O("thead",null,[O("tr",null,[Kb,Gb,r.value?(_(),N("th",Jb," Downloads ")):me("",!0)])]),O("tbody",null,[n.value?n.value.length===0?(_(),N("tr",Qb,e1)):me("",!0):(_(),N("tr",Yb,[O("td",null,[B(Pt),Te(" Loading products.. ")]),Xb])),(_(!0),N(Ce,null,Gt(n.value||[],i=>(_(),N("tr",{key:i.id},[O("td",null,[O("div",null,[i.iconUrl?(_(),N("img",{key:0,src:i.iconUrl,alt:""},null,8,t1)):(_(),N("div",n1)),O("span",null,K(i.name),1)])]),B(b(ja),{as:"td"},{default:ye(()=>[B(b(Dd),{class:"moonbase:button","data-variant":"secondary"},{default:ye(()=>[r1,Te(" "+K(i.currentActivations)+" / "+K(i.maxActivations),1)]),_:2},1024),B(xo,{name:"moonbase:scale"},{default:ye(()=>[B(b(Ad),null,{default:ye(()=>[B(Wb,{"product-id":i.id},null,8,["product-id"])]),_:2},1024)]),_:2},1024)]),_:2},1024),r.value?(_(),N("td",o1,[i.currentVersion!=null?(_(),N("div",s1,[i.downloads?(_(),xe(Ib,{key:0,downloads:i.downloads},null,8,["downloads"])):me("",!0)])):me("",!0)])):me("",!0)]))),128))])]))}}),a1={class:"moonbase:redeem"},l1=["data-visible"],c1={key:1,class:"moonbase:redeem-voucher"},u1={key:0},d1={key:1},f1=O("span",null," Contains: ",-1),p1={class:"moonbase:redeem-voucher-products"},h1=["src"],m1={key:1,class:"moonbase:image-placeholder"},v1={key:0},g1={class:"moonbase:redeem-voucher-bundle"},y1=["src"],_1={key:1,class:"moonbase:image-placeholder"},b1={key:0},w1={class:"moonbase:redeem-voucher-bundle-products"},E1={class:"shrink-0"},O1=["src"],N1={key:1,class:"moonbase:image-placeholder"},S1=he({__name:"Redeem",setup(e){const{redeem:t}=ng(),n=T(!1),r=T(null),o=T(null),s=T("");async function i(){n.value=!0,o.value=null;try{r.value=await t(s.value)}catch(a){throw o.value=a,a}n.value=!1}return(a,c)=>(_(),N("div",a1,[B(xo,{mode:"out-in",name:"moonbase:slide-left"},{default:ye(()=>[r.value?(_(),N("div",c1,[O("h3",null,[Te(" You got: "),O("strong",null,K(r.value.name),1)]),r.value.description?(_(),N("h4",u1,K(r.value.description),1)):me("",!0),O("h4",null,[Te(" Code: "),O("strong",null,K(r.value.code),1)]),r.value.redeemsProducts.length>0?(_(),N("div",d1,[f1,O("div",p1,[(_(!0),N(Ce,null,Gt(r.value.redeemsProducts,({value:l,quantity:u})=>(_(),N("div",{key:l.id,class:"moonbase:redeem-voucher-product"},[O("div",null,[l.iconUrl?(_(),N("img",{key:0,src:l.iconUrl,alt:""},null,8,h1)):(_(),N("div",m1))]),O("div",null,[O("p",null,[Te(K(l.name)+" ",1),u!==1?(_(),N("span",v1,"x "+K(u),1)):me("",!0)]),O("p",null,K(l.tagline),1)])]))),128)),(_(!0),N(Ce,null,Gt(r.value.redeemsBundles,({value:l,quantity:u})=>(_(),N("div",{key:l.id},[O("div",g1,[O("div",null,[l.iconUrl?(_(),N("img",{key:0,src:l.iconUrl,alt:""},null,8,y1)):(_(),N("div",_1))]),O("div",null,[O("p",null,[Te(K(l.name)+" ",1),u!==1?(_(),N("span",b1,"x "+K(u),1)):me("",!0)]),O("p",null,K(l.tagline),1)])]),O("div",w1,[(_(!0),N(Ce,null,Gt(l.products,d=>(_(),N("div",{key:d.id,class:"moonbase:redeem-voucher-product"},[O("div",E1,[d.iconUrl?(_(),N("img",{key:0,src:d.iconUrl,alt:""},null,8,O1)):(_(),N("div",N1))]),O("div",null,[O("p",null,K(d.name),1),O("p",null,K(d.tagline),1)])]))),128))])]))),128))])])):me("",!0)])):(_(),xe(Hn,{key:0,handler:i},{default:ye(()=>{var l;return[B(gt,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),label:"Voucher code",name:"code",required:""},null,8,["modelValue"]),B(Zn,{label:"Redeem",success:"Redeem",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!o.value||void 0},K((l=o.value)==null?void 0:l.message),9,l1)]}),_:1}))]),_:1})]))}}),x1={class:"moonbase:customer"},k1=he({__name:"Customer",props:{open:{type:Boolean}},setup(e){const t=Ae();function n(s){switch(s){case pe.ViewAccount:return 0;case pe.ViewProducts:return 1;case pe.RedeemVoucher:return 2}return 0}const r=T(n(t.intent));Xe(()=>t.intent,s=>{r.value=n(s)});function o(s){r.value=s}return(s,i)=>(_(),xe(ri,{open:s.open,onClose:i[0]||(i[0]=a=>b(t).reset())},{default:ye(()=>[O("div",x1,[B(b(t_),{"selected-index":r.value,onChange:o},{default:ye(()=>[B(b(n_),null,{default:ye(()=>[B(b(Ma),null,{default:ye(()=>[Te("Account")]),_:1}),B(b(Ma),null,{default:ye(()=>[Te(" Products ")]),_:1}),B(b(Ma),null,{default:ye(()=>[Te("Redeem")]),_:1})]),_:1}),B(b(r_),null,{default:ye(()=>[B(b(Ua),null,{default:ye(()=>[B(cb)]),_:1}),B(b(Ua),null,{default:ye(()=>[B(i1)]),_:1}),B(b(Ua),null,{default:ye(()=>[B(S1)]),_:1})]),_:1})]),_:1},8,["selected-index"])])]),_:1},8,["open"]))}}),C1={class:"moonbase:auto-activate"},T1={key:0,class:"moonbase:loader"},P1={key:1,class:"moonbase:loader"},$1={key:2,class:"moonbase:loader"},I1={key:3},D1={key:0,class:"moonbase:auto-activate-product"},A1=["src"],V1={key:1,class:"moonbase:image-placeholder"},R1={key:1,class:"moonbase:loader"},j1=[O("h3",null," Uh oh ",-1),O("p",null," This activation request was cancelled, open your app to try again. ",-1)],L1={key:2,class:"moonbase:loader"},M1={key:3,class:"moonbase:loader"},U1=[O("h3",null," Done! ",-1),O("p",null," Your product is activated. ",-1)],F1={key:4,class:"moonbase:auto-activate-content"},B1={key:0},H1={key:1},Z1=O("p",null," You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ",-1),q1={class:"moonbase:auto-activate-cta"},W1=["href"],z1={key:2,class:"moonbase:auto-activate-trial"},K1={class:"moonbase:auto-activate-cta"},G1=he({__name:"AutoActivate",setup(e){const t=Ae(),{user:n,loaded:r}=St(),o=t.getParameter("token"),{activationRequest:s,loading:i,fulfilling:a,completing:c,error:l,fulfillLicense:u,fulfillTrial:d,cancel:f}=tg(o);Xe(s,E=>{var S;!a.value&&!c.value&&(E==null?void 0:E.status)===Ht.Requested&&((S=E==null?void 0:E.licenseEligibility)!=null&&S.eligible)&&u()});function m(){f(),t.show(ke.Customer,pe.ViewProducts)}function y(){t.enqueue(ke.Activation,pe.ActivateProduct,t.parameters??void 0),t.show(ke.Authentication,pe.SignIn)}return(E,S)=>{var A,F,C,z;return _(),N("div",C1,[b(i)||!b(r)?(_(),N("div",T1,[B(Pt)])):b(l)?(_(),N("div",P1,K(b(l)),1)):b(s)?(_(),N("div",I1,[b(s).product?(_(),N("div",D1,[b(s).product.iconUrl?(_(),N("img",{key:0,src:b(s).product.iconUrl,alt:""},null,8,A1)):(_(),N("div",V1)),O("div",null,[O("h2",null,K(b(s).product.name),1),O("h3",null,K(b(s).product.tagline),1)])])):me("",!0),((A=b(s))==null?void 0:A.status)===b(Ht).Cancelled?(_(),N("div",R1,j1)):b(a)||b(c)?(_(),N("div",L1,[B(Pt),O("p",null,"Activating "+K(b(s).product.name)+"...",1)])):((F=b(s))==null?void 0:F.status)===b(Ht).Completed?(_(),N("div",M1,U1)):(_(),N("div",F1,[b(n)?(C=b(n).ownedProducts)!=null&&C.includes(b(s).product.id)?(_(),N("div",H1,[Z1,O("span",q1,[O("button",{role:"button",class:"moonbase:button",onClick:S[0]||(S[0]=$=>m())}," Licenses "),b(s).product&&b(s).product.website?(_(),N("a",{key:0,href:b(s).product.website,class:"moonbase:button"}," Purchase ",8,W1)):me("",!0)])])):me("",!0):(_(),N("div",B1,[Te(" Please sign in to use a license "),O("span",{class:"moonbase:auto-activate-cta"},[O("button",{role:"button",class:"moonbase:button",onClick:y}," Sign in ")])])),(z=b(s).trialEligibility)!=null&&z.eligible?(_(),N("div",z1,[Te(" You are eligible for a "+K(b(s).trialEligibility.numberOfDaysPerProduct)+" day trial ",1),b(s).trialEligibility.existing?(_(),N(Ce,{key:0},[Te(" of which you have "+K(b(s).trialEligibility.numberOfDaysRemaining)+" days remaining ",1)],64)):me("",!0),Te(". "),O("span",K1,[O("button",{role:"button",class:"moonbase:button",onClick:S[1]||(S[1]=$=>b(d)())}," Start trial ")])])):me("",!0)]))])):(_(),N("div",$1," Could not find activation request "))])}}}),J1={class:"moonbase:activation"},Y1=he({__name:"Activation",props:{open:{type:Boolean}},setup(e){const t=Ae();return(n,r)=>(_(),xe(ri,{open:n.open,onClose:r[0]||(r[0]=o=>b(t).reset())},{default:ye(()=>[O("div",J1,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(" Activate product ")]),_:1}),n.open&&b(t).intent===b(pe).ActivateProduct?(_(),xe(G1,{key:0})):me("",!0)])]),_:1},8,["open"]))}});function X1(e){const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e<1)return`${e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);e=Number(e/1024**n);const r=t[n];return e>=10||e%1===0?`${e.toFixed(0)} ${r}`:`${e.toFixed(1)} ${r}`}const Q1={class:"moonbase:download-product"},ew={key:0,class:"moonbase:loader"},tw={key:1,class:"moonbase:loader"},nw={key:2,class:"moonbase:loader"},rw={key:3},ow={class:"moonbase:download-product-product"},sw=["src"],iw={key:1,class:"moonbase:image-placeholder"},aw={key:0},lw={key:0,class:"moonbase:download-product-content"},cw={key:1,class:"moonbase:download-product-content"},uw={key:2,class:"moonbase:download-product-content"},dw={key:0,role:"list"},fw={class:"moonbase:download-product-download-name"},pw=["onClick"],hw=O("span",{class:"moonbase:download-product-clicker"},null,-1),mw={class:"moonbase:download-product-download-description"},vw=O("span",null," |",-1),gw={key:1,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yw=[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"},null,-1)],_w={key:1,class:"moonbase:loader"},bw=he({__name:"DownloadProduct",setup(e){const t=Ae(),{user:n,loaded:r}=St(),{getProduct:o,downloadProduct:s}=Ms(),i={[Bt.Universal]:()=>Ud,[Bt.Windows]:()=>Fd,[Bt.Linux]:()=>Bd,[Bt.Mac]:()=>Hd},a=T(null),c=T([]),l=T(null),u=T(!0),d=X(()=>t.getParameter("key")),f=X(()=>{var E,S;return(S=(E=a.value)==null?void 0:E.downloads)==null?void 0:S.filter(A=>!d.value||A.key===d.value)});Re(async()=>{const E=t.getParameter("product_id"),S=t.getParameter("version");if(!E){l.value="Link is broken";return}try{a.value=await o(E,S||void 0)}catch(A){l.value=A.message}u.value=!1});function m(){t.enqueue(ke.Download,pe.DownloadProduct,t.parameters??void 0),t.show(ke.Authentication,pe.SignIn)}async function y(E){c.value.push(E.key),await s(E),c.value=c.value.filter(S=>S!==E.key)}return(E,S)=>{var A,F;return _(),N("div",Q1,[u.value||!b(r)?(_(),N("div",ew,[B(Pt)])):l.value?(_(),N("div",tw,K(l.value),1)):a.value?(_(),N("div",rw,[O("div",ow,[a.value.iconUrl?(_(),N("img",{key:0,src:a.value.iconUrl,alt:""},null,8,sw)):(_(),N("div",iw)),O("div",null,[O("h2",null,[Te(K(a.value.name)+" ",1),O("span",null,"v"+K(a.value.version||a.value.currentVersion),1),a.value.prerelease?(_(),N("span",aw," (pre-release)")):me("",!0)]),O("h3",null,K(a.value.tagline),1)])]),a.value.downloadsNeedsUser&&!b(n)?(_(),N("div",lw,[Te(" Please sign in to download product "),O("span",{class:"moonbase:download-product-cta"},[O("button",{role:"button",class:"moonbase:button",onClick:m}," Sign in ")])])):a.value.downloadsNeedsOwnership&&!((A=b(n).ownedProducts)!=null&&A.includes(a.value.id))?(_(),N("div",cw," This product requires ownership to download ")):(_(),N("div",uw,[(F=a.value)!=null&&F.downloads&&a.value.downloads.length>0?(_(),N("ul",dw,[(_(!0),N(Ce,null,Gt(f.value,C=>(_(),N("li",{key:C.key},[O("div",null,[O("p",fw,[O("button",{onClick:z=>y(C)},[hw,Te(" "+K(C.name),1)],8,pw)]),O("p",mw,[(_(),xe(qi(i[C.platform]()),{"aria-hidden":"true"})),Te(" "+K(C.platform)+" ",1),vw,Te(" "+K(b(X1)(C.size)),1)])]),O("div",null,[c.value.includes(C.key)?(_(),xe(Pt,{key:0})):(_(),N("svg",gw,yw))])]))),128))])):(_(),N("div",_w," No downloadable files found "))]))])):(_(),N("div",nw," Could not find product "))])}}}),ww={class:"moonbase:download"},Ew=he({__name:"Download",props:{open:{type:Boolean}},setup(e){const t=Ae();return(n,r)=>(_(),xe(ri,{open:n.open,onClose:r[0]||(r[0]=o=>b(t).reset())},{default:ye(()=>[O("div",ww,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(" Download product ")]),_:1}),n.open&&b(t).intent===b(pe).DownloadProduct?(_(),xe(bw,{key:0})):me("",!0)])]),_:1},8,["open"]))}}),Ow=he({__name:"App",setup(e){const t=$e(Ws),n=Ae();return(r,o)=>{var s;return _(),N(Ce,null,[(s=b(t))!=null&&s.toolbar.enabled?(_(),xe(Lg,{key:0})):me("",!0),B(ob,{open:b(n).active===b(ke).Cart},null,8,["open"]),B(m_,{open:b(n).active===b(ke).Authentication},null,8,["open"]),B(Y1,{open:b(n).active===b(ke).Activation},null,8,["open"]),B(Ew,{open:b(n).active===b(ke).Download},null,8,["open"]),B(k1,{open:b(n).active===b(ke).Customer},null,8,["open"])],64)}}});function oi(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Wa(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(oi(e)&&oi(n)){for(const r in e)if(n.hasOwnProperty(r)){const o=n[r];oi(o)&&oi(e[r])?e[r]=Wa(e[r],o):o!==void 0&&(e[r]=o)}}return Wa(e,...t)}class Nw{constructor(){Nr(this,"initialized",!1);Nr(this,"pinia");Nr(this,"storefront");Nr(this,"options")}async setup(t,n){if(document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}const r=document.createElement("div");if(r.id="moonbase",r.classList.add("moonbase"),document.body.append(r),this.options=Wa(Dg,n),this.storefront=rg(t),this.pinia=Cg(),Uv(Ow).use(this.storefront).use(this.pinia).provide(Ws,this.options).mount("#moonbase"),this.initialized=!0,window&&window.location){const s=new URLSearchParams(window.location.search),i=s.get("mb_intent");if(i&&Object.values(pe).includes(i)){const a=Object.fromEntries([...s.entries()].filter(([l])=>l.startsWith("mb_")).map(([l,u])=>[l.substring(3),u]));if(i===pe.Checkout&&a.complete)return;this[i](a);for(const l of Object.keys(a))s.delete(`mb_${l}`);const c=s.toString();window.history.replaceState(null,"",window.location.href.split("?")[0]+(c?`?${c}`:""))}}const o=Ae(this.pinia);this.storefront.onCheckoutClosed(s=>{s==="view_products"&&o.show(ke.Customer,pe.ViewProducts)})}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.SignIn,t)}sign_up(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!((r=this.options)!=null&&r.auth.enable.signUp))throw new Error("Sign ups are not enabled");Ae(this.pinia).show(ke.Authentication,pe.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.ConfirmAccount,t)}confirm_email(){}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);St(this.storefront).user.value?n.show(ke.Authentication,pe.ConfirmEmailChange,t):(n.show(ke.Authentication,pe.SignIn),n.enqueue(ke.Authentication,pe.ConfirmEmailChange,t))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=Ae(this.pinia);St(this.storefront).user.value?t.show(ke.Customer,pe.ViewAccount):(t.show(ke.Authentication,pe.SignIn),t.enqueue(ke.Customer,pe.ViewAccount))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Cart,pe.ViewCart)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Cart,pe.ViewCart,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Download,pe.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.token))throw new Error("You need to provide a token when activating a product");Ae(this.pinia).show(ke.Activation,pe.ActivateProduct,t)}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Cart,pe.ViewCart)}async add_to_cart(t){var o,s,i,a;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.product_id)&&!(t!=null&&t.bundle_id))throw new Error("You need to provide a product or bundle ID when adding to cart");const n=ba(this.storefront);if(t!=null&&t.product_id){const c=Vu(t.product_id,this.storefront);if(c.value)n.addToCart(c.value,(o=c.value.variations)==null?void 0:o.find(l=>l.id===t.variation_id));else{await this.storefront.loadedStorefrontPromise;const l=Vu(t.product_id,this.storefront);if(l.value)n.addToCart(l.value,(s=l.value.variations)==null?void 0:s.find(u=>u.id===t.variation_id));else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const c=Au(t.bundle_id,this.storefront);if(c.value)n.addToCart(c.value,(i=c.value.variations)==null?void 0:i.find(l=>l.id===t.variation_id));else{await this.storefront.loadedStorefrontPromise;const l=Au(t.bundle_id,this.storefront);if(l.value)n.addToCart(l.value,(a=l.value.variations)==null?void 0:a.find(u=>u.id===t.variation_id));else throw new Error(`Bundle '${t.bundle_id}' not found`)}}Ae(this.pinia).show(ke.Cart,pe.AddToCart)}checkout(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;ba(this.storefront).checkout(`${window.location.pathname}?mb_intent=view_products`)}}const Zd=new Nw;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=Zd),wt.MoonbaseIntent=pe,wt.default=Zd,Object.defineProperties(wt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
25
|
+
`));const f=ad(u.props??{},i,c),m=Rt(u,f,!0);for(const y in f)y.startsWith("on")&&(m.props||(m.props={}),m.props[y]=f[y]);return m}return Array.isArray(a)&&a.length===1?a[0]:a}return Le(s,Object.assign({},i,c),{default:()=>a})}function id(e){return e.flatMap(t=>t.type===Ce?id(t.children):[t])}function ad(...e){if(e.length===0)return{};if(e.length===1)return e[0];const t={},n={};for(const r of e)for(const o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]??(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(const r in n)Object.assign(t,{[r](o,...s){const i=n[r];for(const a of i){if(o instanceof Event&&o.defaultPrevented)return;a(o,...s)}}});return t}function Pa(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function Sy(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}var zn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(zn||{});let Kn=he({name:"Hidden",props:{as:{type:[Object,String],default:"div"},features:{type:Number,default:1}},setup(e,{slots:t,attrs:n}){return()=>{let{features:r,...o}=e,s={"aria-hidden":(r&2)===2?!0:o["aria-hidden"]??void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Qe({ourProps:s,theirProps:o,slot:{},attrs:n,slots:t,name:"Hidden"})}}});function xy(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function G(e){if(e==null||e.value==null)return null;let t=e.value.$el??e.value;return t instanceof Node?t:null}function Qt(e){if(To.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let t=G(e);if(t)return t.ownerDocument}return document}const Ks=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ue=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ue||{}),yn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(yn||{});function Gs(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ks)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var $a=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))($a||{});function ld(e,t=0){var n;return e===((n=Qt(e))==null?void 0:n.body)?!1:Je(t,{0(){return e.matches(Ks)},1(){let r=e;for(;r!==null;){if(r.matches(Ks))return!0;r=r.parentElement}return!1}})}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.moonbaseFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.moonbaseFocusVisible:e.detail===0&&(document.documentElement.dataset.moonbaseFocusVisible="")},!0));function br(e){e==null||e.focus({preventScroll:!0})}const ky=["textarea","input"].join(",");function Cy(e){var t;return((t=e==null?void 0:e.matches)==null?void 0:t.call(e,ky))??!1}function jr(e,t=n=>n){return e.slice().sort((n,r)=>{const o=t(n),s=t(r);if(o===null||s===null)return 0;const i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function it(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){const s=(Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e==null?void 0:e.ownerDocument)??document;let i=Array.isArray(e)?n?jr(e):e:Gs(e);o.length>0&&i.length>1&&(i=i.filter(m=>!o.includes(m))),r=r??s.activeElement;const a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{};let u=0;const d=i.length;let f;do{if(u>=d||u+d<=0)return 0;let m=c+u;if(t&16)m=(m+d)%d;else{if(m<0)return 3;if(m>=d)return 1}f=i[m],f==null||f.focus(l),u+=a}while(f!==s.activeElement);return t&6&&Cy(f)&&f.select(),2}let wr=[];xy(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||wr[0]===t.target)return;let n=t.target;n=n.closest(Ks),wr.unshift(n??t.target),wr=wr.filter(r=>r!=null&&r.isConnected),wr.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Js(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function cd(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());const t=new Set;for(const n of e.value){const r=G(n);r instanceof HTMLElement&&t.add(r)}return t}var ud=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(ud||{});const Po=Object.assign(he({name:"FocusTrap",props:{as:{type:[Object,String],default:"div"},initialFocus:{type:Object,default:null},features:{type:Number,default:30},containers:{type:[Object,Function],default:T(new Set)}},inheritAttrs:!1,setup(e,{attrs:t,slots:n,expose:r}){const o=T(null);r({el:o,$el:o});const s=X(()=>Qt(o)),i=T(!1);Re(()=>i.value=!0),mt(()=>i.value=!1),Py({ownerDocument:s},X(()=>i.value&&!!(e.features&16)));const a=$y({ownerDocument:s,container:o,initialFocus:X(()=>e.initialFocus)},X(()=>i.value&&!!(e.features&2)));Iy({ownerDocument:s,container:o,containers:e.containers,previousActiveElement:a},X(()=>i.value&&!!(e.features&8)));const c=Ta();function l(m){const y=G(o);if(!y)return;(S=>S())(()=>{Je(c.value,{[xt.Forwards]:()=>{it(y,Ue.First,{skipElements:[m.relatedTarget]})},[xt.Backwards]:()=>{it(y,Ue.Last,{skipElements:[m.relatedTarget]})}})})}const u=T(!1);function d(m){m.key==="Tab"&&(u.value=!0,requestAnimationFrame(()=>{u.value=!1}))}function f(m){if(!i.value)return;const y=cd(e.containers);G(o)instanceof HTMLElement&&y.add(G(o));const E=m.relatedTarget;E instanceof HTMLElement&&E.dataset.moonbaseFocusGuard!=="true"&&(dd(y,E)||(u.value?it(G(o),Je(c.value,{[xt.Forwards]:()=>Ue.Next,[xt.Backwards]:()=>Ue.Previous})|Ue.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&br(m.target)))}return()=>{const m={},y={ref:o,onKeydown:d,onFocusout:f},{features:E,initialFocus:S,containers:A,...F}=e;return Le(Ce,[!!(E&4)&&Le(Kn,{as:"button",type:"button","data-moonbase-focus-guard":!0,onFocus:l,features:zn.Focusable}),Qe({ourProps:y,theirProps:{...t,...F},slot:m,attrs:t,slots:n,name:"FocusTrap"}),!!(E&4)&&Le(Kn,{as:"button",type:"button","data-moonbase-focus-guard":!0,onFocus:l,features:zn.Focusable})])}}}),{features:ud});function Ty(e){const t=T(wr.slice());return Xe([e],([n],[r])=>{r===!0&&n===!1?Js(()=>{t.value.splice(0)}):r===!1&&n===!0&&(t.value=wr.slice())},{flush:"post"}),()=>t.value.find(n=>n!=null&&n.isConnected)??null}function Py({ownerDocument:e},t){const n=Ty(t);Re(()=>{ft(()=>{var r,o;t.value||((r=e.value)==null?void 0:r.activeElement)===((o=e.value)==null?void 0:o.body)&&br(n())},{flush:"post"})}),mt(()=>{t.value&&br(n())})}function $y({ownerDocument:e,container:t,initialFocus:n},r){const o=T(null),s=T(!1);return Re(()=>s.value=!0),mt(()=>s.value=!1),Re(()=>{Xe([t,n,r],(i,a)=>{if(i.every((l,u)=>(a==null?void 0:a[u])===l)||!r.value)return;const c=G(t);c&&Js(()=>{var d,f;if(!s.value)return;const l=G(n),u=(d=e.value)==null?void 0:d.activeElement;if(l){if(l===u){o.value=u;return}}else if(c.contains(u)){o.value=u;return}l?br(l):it(c,Ue.First|Ue.NoScroll)===yn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.value=(f=e.value)==null?void 0:f.activeElement})},{immediate:!0,flush:"post"})}),o}function Iy({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){var s;Ca((s=e.value)==null?void 0:s.defaultView,"focus",i=>{if(!o.value)return;const a=cd(n);G(t)instanceof HTMLElement&&a.add(G(t));const c=r.value;if(!c)return;const l=i.target;l&&l instanceof HTMLElement?dd(a,l)?(r.value=l,br(l)):(i.preventDefault(),i.stopPropagation(),br(c)):br(r.value)},!0)}function dd(e,t){for(const n of e)if(n.contains(t))return!0;return!1}function Dy(e){let t=fh(e.getSnapshot());return mt(e.subscribe(()=>{t.value=e.getSnapshot()})),t}function $o(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){t.requestAnimationFrame(()=>{t.requestAnimationFrame(...n)})},setTimeout(...n){let r=setTimeout(...n);t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Js(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=$o();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function Ay(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(a=>a()))}}}function Vy(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function fd(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ry(){return/Android/gi.test(window.navigator.userAgent)}function jy(){return fd()||Ry()}function Ly(){return fd()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){const i=$o();i.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>i.dispose()))}const o=window.scrollY??window.pageYOffset;let s=null;t.addEventListener(e,"click",i=>{if(i.target instanceof HTMLElement)try{const a=i.target.closest("a");if(!a)return;const{hash:c}=new URL(a.href),l=e.querySelector(c);l&&!r(l)&&(s=l)}catch{}},!0),t.addEventListener(e,"touchstart",i=>{if(i.target instanceof HTMLElement)if(r(i.target)){let a=i.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(i.target,"touchAction","none")}),t.addEventListener(e,"touchmove",i=>{if(i.target instanceof HTMLElement){if(i.target.tagName==="INPUT")return;if(r(i.target)){let a=i.target;for(;a.parentElement&&a.dataset.moonbasePortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.moonbasePortal===""&&i.preventDefault()}else i.preventDefault()}},{passive:!1}),t.add(()=>{const i=window.scrollY??window.pageYOffset;o!==i&&window.scrollTo(0,o),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function My(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Uy(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Er=Ay(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:$o(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Uy(n)},o=[Ly(),Vy(),My()];o.forEach(({before:s})=>s==null?void 0:s(r)),o.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Er.subscribe(()=>{let e=Er.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Er.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Er.dispatch("TEARDOWN",n)}});function Fy(e,t,n){let r=Dy(Er),o=X(()=>{let s=e.value?r.value.get(e.value):void 0;return s?s.count>0:!1});return Xe([e,t],([s,i],[a],c)=>{if(!s||!i)return;Er.dispatch("PUSH",s,n);let l=!1;c(()=>{l||(Er.dispatch("POP",a??s,n),l=!0)})},{immediate:!0}),o}let By=0;function Hy(){return++By}function $t(){return Hy()}let Ia=new Map,Io=new Map;function pd(e,t=T(!0)){ft(n=>{if(!t.value)return;let r=G(e);if(!r)return;n(function(){if(!r)return;let i=Io.get(r)??1;if(i===1?Io.delete(r):Io.set(r,i-1),i!==1)return;let a=Ia.get(r);a&&(a["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",a["aria-hidden"]),r.inert=a.inert,Ia.delete(r))});let o=Io.get(r)??0;Io.set(r,o+1),o===0&&(Ia.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0)})}function Do(e,t,n,r){To.isServer||ft(o=>{e.value&&(document.addEventListener(t,n,r),o(()=>document.removeEventListener(t,n,r)))})}const hd=30;function md(e,t,n=X(()=>!0)){function r(i,a){if(i.defaultPrevented)return;const c=a(i);if(c===null||!c.getRootNode().contains(c))return;const l=function u(d){return typeof d=="function"?u(d()):Array.isArray(d)||d instanceof Set?d:[d]}(e);for(const u of l){if(u===null)continue;const d=u instanceof HTMLElement?u:G(u);if(d!=null&&d.contains(c)||i.composed&&i.composedPath().includes(d))return}return!ld(c,$a.Loose)&&c.tabIndex!==-1&&i.preventDefault(),t(i,c)}const o=T(null);Do(n,"pointerdown",i=>{var a,c;o.value=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target},!0),Do(n,"mousedown",i=>{var a,c;o.value=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target},!0),Do(n,"click",i=>{jy()||o.value&&(r(i,()=>o.value),o.value=null)},!0);const s={x:0,y:0};Do(n,"touchstart",i=>{s.x=i.touches[0].clientX,s.y=i.touches[0].clientY},!0),Do(n,"touchend",i=>{const a={x:i.changedTouches[0].clientX,y:i.changedTouches[0].clientY};if(!(Math.abs(a.x-s.x)>=hd||Math.abs(a.y-s.y)>=hd))return r(i,()=>i.target instanceof HTMLElement?i.target:null)},!0),sd(n,"blur",i=>r(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function vd({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){const r=T(null),o=Qt(r);function s(){var a,c;const i=[];for(const l of e)l!==null&&(l instanceof HTMLElement?i.push(l):"value"in l&&l.value instanceof HTMLElement&&i.push(l.value));if(t!=null&&t.value)for(const l of t.value)i.push(l);for(const l of(o==null?void 0:o.querySelectorAll("html > *, body > *"))??[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="moonbase"&&(l.contains(G(r))||l.contains((c=(a=G(r))==null?void 0:a.getRootNode())==null?void 0:c.host)||i.some(u=>l.contains(u))||i.push(l));return i}return{resolveContainers:s,contains(i){return s().some(a=>a.contains(i))},mainTreeNodeRef:r,MainTreeNode(){return n!=null?null:Le(Kn,{features:zn.Hidden,ref:r})}}}let gd=Symbol("Context");var at=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(at||{});function Zy(){return Ys()!==null}function Ys(){return $e(gd,null)}function yd(e){dt(gd,e)}const _d=Symbol("ForcePortalRootContext");function qy(){return $e(_d,!1)}const bd=he({name:"ForcePortalRoot",props:{as:{type:[Object,String],default:"template"},force:{type:Boolean,default:!1}},setup(e,{slots:t,attrs:n}){return dt(_d,e.force),()=>{const{force:r,...o}=e;return Qe({theirProps:o,ourProps:{},slot:{},slots:t,attrs:n,name:"ForcePortalRoot"})}}});let wd=Symbol("StackContext");var Da=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Da||{});function Wy(){return $e(wd,()=>{})}function zy({type:e,enabled:t,element:n,onUpdate:r}){let o=Wy();function s(...i){r==null||r(...i),o(...i)}Re(()=>{Xe(t,(i,a)=>{i?s(0,e,n):a===!0&&s(1,e,n)},{immediate:!0,flush:"sync"})}),mt(()=>{t.value&&s(1,e,n)}),dt(wd,s)}var et=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(et||{});let Ky=Symbol("DescriptionContext");function Gy({slot:e=T({}),name:t="Description",props:n={}}={}){let r=T([]);function o(s){return r.value.push(s),()=>{let i=r.value.indexOf(s);i!==-1&&r.value.splice(i,1)}}return dt(Ky,{register:o,slot:e,name:t,props:n}),X(()=>r.value.length>0?r.value.join(" "):void 0)}function Ed(e){const t=Qt(e);if(!t){if(e===null)return null;throw new Error(`[Moonbase]: Cannot find ownerDocument for contextElement: ${e}`)}const n=t.getElementById("moonbase");if(n)return n;throw new Error("[Moonbase]: Cannot find existing root element")}const Jy=he({name:"Portal",props:{as:{type:[Object,String],default:"div"}},setup(e,{slots:t,attrs:n}){const r=T(null);X(()=>Qt(r));const o=qy(),s=$e(Nd,null),i=T(o===!0||s==null?Ed(r.value):s.resolveTarget()),a=T(!1);Re(()=>{a.value=!0}),ft(()=>{o||s!=null&&(i.value=s.resolveTarget())});const c=$e(Aa,null);let l=!1;const u=Is();return Xe(r,()=>{if(l||!c)return;const d=G(r);d&&(mt(c.register(d),u),l=!0)}),()=>{if(!a.value||i.value===null)return null;const d={ref:r,"data-moonbase-portal":""};return Le(Pm,{to:i.value},Qe({ourProps:d,theirProps:e,slot:{},attrs:n,slots:t,name:"Portal"}))}}});let Aa=Symbol("PortalParentContext");function Od(){const e=$e(Aa,null),t=T([]);function n(s){return t.value.push(s),e&&e.register(s),()=>r(s)}function r(s){const i=t.value.indexOf(s);i!==-1&&t.value.splice(i,1),e&&e.unregister(s)}const o={register:n,unregister:r,portals:t};return[t,he({name:"PortalWrapper",setup(s,{slots:i}){return dt(Aa,o),()=>{var a;return(a=i.default)==null?void 0:a.call(i)}}})]}let Nd=Symbol("PortalGroupContext");const Yy=he({name:"PortalGroup",props:{as:{type:[Object,String],default:"template"},target:{type:Object,default:null}},setup(e,{attrs:t,slots:n}){const r=so({resolveTarget(){return e.target}});return dt(Nd,r),()=>{const{target:o,...s}=e;return Qe({theirProps:s,ourProps:{},slot:{},attrs:t,slots:n,name:"PortalGroup"})}}}),Va=Symbol("DialogContext");function Xs(e){const t=$e(Va,null);if(t===null){const n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Xs),n}return t}const Qs="DC8F892D-2EBD-447C-A4C8-A03058436FF4",Sd=he({name:"Dialog",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},open:{type:[Boolean,String],default:Qs},initialFocus:{type:Object,default:null},id:{type:String,default:()=>`moonbase-dialog-${$t()}`},role:{type:String,default:"dialog"}},emits:{close:e=>!0},setup(e,{emit:t,attrs:n,slots:r,expose:o}){var ce;const s=T(!1);Re(()=>{s.value=!0});let i=!1;const a=X(()=>e.role==="dialog"||e.role==="alertdialog"?e.role:(i||(i=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")),c=T(0),l=Ys(),u=X(()=>e.open===Qs&&l!==null?(l.value&at.Open)===at.Open:e.open),d=T(null),f=X(()=>Qt(d));if(o({el:d,$el:d}),!(e.open!==Qs||l!==null))throw new Error("You forgot to provide an `open` prop to the `Dialog`.");if(typeof u.value!="boolean")throw new TypeError(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${u.value===Qs?void 0:e.open}`);const y=X(()=>s.value&&u.value?0:1),E=X(()=>y.value===0),S=T(null),A={titleId:S,panelRef:T(null),dialogState:y,setTitleId(Ie){S.value!==Ie&&(S.value=Ie)},close(){t("close",!1)}},F=X(()=>c.value>1),C=$e(Va,null)!==null,[z,$]=Od(),{resolveContainers:Z,mainTreeNodeRef:x,MainTreeNode:de}=vd({portals:z,defaultContainers:[X(()=>A.panelRef.value??d.value)]}),Y=X(()=>F.value?"parent":"leaf"),V=X(()=>l!==null?(l.value&at.Closing)===at.Closing:!1),P=X(()=>C||V.value?!1:E.value),j=X(()=>{var Ie;return Array.from(((Ie=f.value)==null?void 0:Ie.querySelectorAll("body > *"))??[]).find(je=>je.id==="moonbase"?!1:je.contains(G(x))&&je instanceof HTMLElement)??null});pd(j,P);const oe=X(()=>F.value?!0:E.value),w=X(()=>{var Ie;return Array.from(((Ie=f.value)==null?void 0:Ie.querySelectorAll("[data-moonbase-portal]"))??[]).find(je=>je.contains(G(x))&&je instanceof HTMLElement)??null});pd(w,oe),zy({type:"Dialog",enabled:X(()=>y.value===0),element:d,onUpdate:(Ie,je)=>{if(je==="Dialog")return Je(Ie,{[Da.Add]:()=>c.value+=1,[Da.Remove]:()=>c.value-=1})}});const I=Gy({name:"DialogDescription",slot:X(()=>({open:u.value}))});dt(Va,A);const ne=X(()=>!(!E.value||F.value));md(Z,(Ie,je)=>{Ie.preventDefault(),A.close(),co(()=>je==null?void 0:je.focus())},ne);const ae=X(()=>!(F.value||y.value!==0));Ca((ce=f.value)==null?void 0:ce.defaultView,"keydown",Ie=>{ae.value&&(Ie.defaultPrevented||Ie.key===et.Escape&&(Ie.preventDefault(),Ie.stopPropagation(),A.close()))});const re=X(()=>!(V.value||y.value!==0||C));return Fy(f,re,Ie=>({containers:[...Ie.containers??[],Z]})),ft(Ie=>{if(y.value!==0)return;const je=G(d);if(!je)return;const nt=new ResizeObserver(bt=>{for(const bn of bt){const Gn=bn.target.getBoundingClientRect();Gn.x===0&&Gn.y===0&&Gn.width===0&&Gn.height===0&&A.close()}});nt.observe(je),Ie(()=>nt.disconnect())}),()=>{const{id:Ie,open:je,initialFocus:nt,...bt}=e,bn={...n,ref:d,id:Ie,role:a.value,"aria-modal":y.value===0?!0:void 0,"aria-labelledby":S.value,"aria-describedby":I.value},Gn={open:y.value===0};return Le(bd,{force:!0},()=>[Le(Jy,()=>Le(Yy,{target:d.value},()=>Le(bd,{force:!1},()=>Le(Po,{initialFocus:nt,containers:Z,features:E.value?Je(Y.value,{parent:Po.features.RestoreFocus,leaf:Po.features.All&~Po.features.FocusLock}):Po.features.None},()=>Le($,{},()=>Qe({ourProps:bn,theirProps:{...bt,...n},slot:Gn,attrs:n,slots:r,visible:y.value===0,features:qn.RenderStrategy|qn.Static,name:"Dialog"})))))),Le(de)])}}}),xd=he({name:"DialogOverlay",props:{as:{type:[Object,String],default:"div"},id:{type:String,default:()=>`moonbase-dialog-overlay-${$t()}`}},setup(e,{attrs:t,slots:n}){const r=Xs("DialogOverlay");function o(s){s.target===s.currentTarget&&(s.preventDefault(),s.stopPropagation(),r.close())}return()=>{const{id:s,...i}=e;return Qe({ourProps:{id:s,"aria-hidden":!0,onClick:o},theirProps:i,slot:{open:r.dialogState.value===0},attrs:t,slots:n,name:"DialogOverlay"})}}}),kd=he({name:"DialogPanel",props:{as:{type:[Object,String],default:"div"},id:{type:String,default:()=>`moonbase-dialog-panel-${$t()}`}},setup(e,{attrs:t,slots:n,expose:r}){const o=Xs("DialogPanel");r({el:o.panelRef,$el:o.panelRef});function s(i){i.stopPropagation()}return()=>{const{id:i,...a}=e,c={id:i,ref:o.panelRef,onClick:s};return Qe({ourProps:c,theirProps:a,slot:{open:o.dialogState.value===0},attrs:t,slots:n,name:"DialogPanel"})}}}),ei=he({name:"DialogTitle",props:{as:{type:[Object,String],default:"h2"},id:{type:String,default:()=>`moonbase-dialog-title-${$t()}`}},setup(e,{attrs:t,slots:n}){const r=Xs("DialogTitle");return Re(()=>{r.setTitleId(e.id),mt(()=>r.setTitleId(null))}),()=>{const{id:o,...s}=e;return Qe({ourProps:{id:o},theirProps:s,slot:{open:r.dialogState.value===0},attrs:t,slots:n,name:"DialogTitle"})}}});function Cd(e,t){if(e)return e;let n=t??"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Td(e,t){let n=T(Cd(e.value.type,e.value.as));return Re(()=>{n.value=Cd(e.value.type,e.value.as)}),ft(()=>{var r;n.value||G(t)&&G(t)instanceof HTMLButtonElement&&!((r=G(t))!=null&&r.hasAttribute("type"))&&(n.value="button")}),n}const Pd=Symbol("PopoverContext");function Ra(e){const t=$e(Pd,null);if(t===null){const n=new Error(`<${e} /> is missing a parent <${ja.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ra),n}return t}const Xy=Symbol("PopoverGroupContext");function $d(){return $e(Xy,null)}const Id=Symbol("PopoverPanelContext");function Qy(){return $e(Id,null)}let ja=he({name:"Popover",inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"}},setup(e,{slots:t,attrs:n,expose:r}){var z;const o=T(null);r({el:o,$el:o});const s=T(1),i=T(null),a=T(null),c=T(null),l=T(null),u=X(()=>Qt(o)),d=X(()=>{var P,j;if(!G(i)||!G(l))return!1;for(const oe of document.querySelectorAll("body > *"))if(Number(oe==null?void 0:oe.contains(G(i)))^Number(oe==null?void 0:oe.contains(G(l))))return!0;const $=Gs(),Z=$.indexOf(G(i)),x=(Z+$.length-1)%$.length,de=(Z+1)%$.length,Y=$[x],V=$[de];return!((P=G(l))!=null&&P.contains(Y))&&!((j=G(l))!=null&&j.contains(V))}),f={popoverState:s,buttonId:T(null),panelId:T(null),panel:l,button:i,isPortalled:d,beforePanelSentinel:a,afterPanelSentinel:c,togglePopover(){s.value=Je(s.value,{0:1,1:0})},closePopover(){s.value!==1&&(s.value=1)},close($){f.closePopover();const Z=$?$ instanceof HTMLElement?$:$.value instanceof HTMLElement?G($):G(f.button):G(f.button);Z==null||Z.focus()}};dt(Pd,f),yd(X(()=>Je(s.value,{0:at.Open,1:at.Closed})));const m={buttonId:f.buttonId,panelId:f.panelId,close(){f.closePopover()}},y=$d(),E=y==null?void 0:y.registerPopover,[S,A]=Od(),F=vd({mainTreeNodeRef:y==null?void 0:y.mainTreeNodeRef,portals:S,defaultContainers:[i,l]});function C(){var $,Z,x;return(y==null?void 0:y.isFocusWithinPopoverGroup())??((($=u.value)==null?void 0:$.activeElement)&&(((Z=G(i))==null?void 0:Z.contains(u.value.activeElement))||((x=G(l))==null?void 0:x.contains(u.value.activeElement))))}return ft(()=>E==null?void 0:E(m)),Ca((z=u.value)==null?void 0:z.defaultView,"focus",$=>{var Z,x;$.target!==window&&$.target instanceof HTMLElement&&s.value===0&&(C()||i&&l&&(F.contains($.target)||(Z=G(f.beforePanelSentinel))!=null&&Z.contains($.target)||(x=G(f.afterPanelSentinel))!=null&&x.contains($.target)||f.closePopover()))},!0),md(F.resolveContainers,($,Z)=>{var x;f.closePopover(),ld(Z,$a.Loose)||($.preventDefault(),(x=G(i))==null||x.focus())},X(()=>s.value===0)),()=>{const $={open:s.value===0,close:f.close};return Le(Ce,[Le(A,{},()=>Qe({theirProps:{...e,...n},ourProps:{ref:o},slot:$,slots:t,attrs:n,name:"Popover"})),Le(F.MainTreeNode)])}}});const Dd=he({name:"PopoverButton",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:()=>`moonbase-popover-button-${$t()}`}},inheritAttrs:!1,setup(e,{attrs:t,slots:n,expose:r}){const o=Ra("PopoverButton"),s=X(()=>Qt(o.button));r({el:o.button,$el:o.button}),Re(()=>{o.buttonId.value=e.id}),mt(()=>{o.buttonId.value=null});const i=$d(),a=i==null?void 0:i.closeOthers,c=Qy(),l=X(()=>c===null?!1:c.value===o.panelId.value),u=T(null),d=`moonbase-focus-sentinel-${$t()}`;l.value||ft(()=>{o.button.value=G(u)});const f=Td(X(()=>({as:e.as,type:t.type})),u);function m(C){var z,$,Z,x,de;if(l.value){if(o.popoverState.value===1)return;switch(C.key){case et.Space:case et.Enter:C.preventDefault(),($=(z=C.target).click)==null||$.call(z),o.closePopover(),(Z=G(o.button))==null||Z.focus();break}}else switch(C.key){case et.Space:case et.Enter:C.preventDefault(),C.stopPropagation(),o.popoverState.value===1&&(a==null||a(o.buttonId.value)),o.togglePopover();break;case et.Escape:if(o.popoverState.value!==0)return a==null?void 0:a(o.buttonId.value);if(!G(o.button)||(x=s.value)!=null&&x.activeElement&&!((de=G(o.button))!=null&&de.contains(s.value.activeElement)))return;C.preventDefault(),C.stopPropagation(),o.closePopover();break}}function y(C){l.value||C.key===et.Space&&C.preventDefault()}function E(C){var z,$;e.disabled||(l.value?(o.closePopover(),(z=G(o.button))==null||z.focus()):(C.preventDefault(),C.stopPropagation(),o.popoverState.value===1&&(a==null||a(o.buttonId.value)),o.togglePopover(),($=G(o.button))==null||$.focus()))}function S(C){C.preventDefault(),C.stopPropagation()}const A=Ta();function F(){const C=G(o.panel);if(!C)return;function z(){Je(A.value,{[xt.Forwards]:()=>it(C,Ue.First),[xt.Backwards]:()=>it(C,Ue.Last)})===yn.Error&&it(Gs().filter(Z=>Z.dataset.moonbaseFocusGuard!=="true"),Je(A.value,{[xt.Forwards]:Ue.Next,[xt.Backwards]:Ue.Previous}),{relativeTo:G(o.button)})}z()}return()=>{const C=o.popoverState.value===0,z={open:C},{id:$,...Z}=e,x=l.value?{ref:u,type:f.value,onKeydown:m,onClick:E}:{ref:u,id:$,type:f.value,"aria-expanded":o.popoverState.value===0,"aria-controls":G(o.panel)?o.panelId.value:void 0,disabled:e.disabled?!0:void 0,onKeydown:m,onKeyup:y,onClick:E,onMousedown:S};return Le(Ce,[Qe({ourProps:x,theirProps:{...t,...Z},slot:z,attrs:t,slots:n,name:"PopoverButton"}),C&&!l.value&&o.isPortalled.value&&Le(Kn,{id:d,features:zn.Focusable,"data-moonbase-focus-guard":!0,as:"button",type:"button",onFocus:F})])}}}),Ad=he({name:"PopoverPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},focus:{type:Boolean,default:!1},id:{type:String,default:()=>`moonbase-popover-panel-${$t()}`}},inheritAttrs:!1,setup(e,{attrs:t,slots:n,expose:r}){const{focus:o}=e,s=Ra("PopoverPanel"),i=X(()=>Qt(s.panel)),a=`moonbase-focus-sentinel-before-${$t()}`,c=`moonbase-focus-sentinel-after-${$t()}`;r({el:s.panel,$el:s.panel}),Re(()=>{s.panelId.value=e.id}),mt(()=>{s.panelId.value=null}),dt(Id,s.panelId),ft(()=>{var A,F;if(!o||s.popoverState.value!==0||!s.panel)return;const S=(A=i.value)==null?void 0:A.activeElement;(F=G(s.panel))!=null&&F.contains(S)||it(G(s.panel),Ue.First)});const l=Ys(),u=X(()=>l!==null?(l.value&at.Open)===at.Open:s.popoverState.value===0);function d(S){var A,F;switch(S.key){case et.Escape:if(s.popoverState.value!==0||!G(s.panel)||i.value&&!((A=G(s.panel))!=null&&A.contains(i.value.activeElement)))return;S.preventDefault(),S.stopPropagation(),s.closePopover(),(F=G(s.button))==null||F.focus();break}}function f(S){var F,C,z,$,Z;const A=S.relatedTarget;A&&G(s.panel)&&((F=G(s.panel))!=null&&F.contains(A)||(s.closePopover(),((z=(C=G(s.beforePanelSentinel))==null?void 0:C.contains)!=null&&z.call(C,A)||(Z=($=G(s.afterPanelSentinel))==null?void 0:$.contains)!=null&&Z.call($,A))&&A.focus({preventScroll:!0})))}const m=Ta();function y(){const S=G(s.panel);if(!S)return;function A(){Je(m.value,{[xt.Forwards]:()=>{var C;it(S,Ue.First)===yn.Error&&((C=G(s.afterPanelSentinel))==null||C.focus())},[xt.Backwards]:()=>{var F;(F=G(s.button))==null||F.focus({preventScroll:!0})}})}A()}function E(){const S=G(s.panel);if(!S)return;function A(){Je(m.value,{[xt.Forwards]:()=>{const F=G(s.button),C=G(s.panel);if(!F)return;const z=Gs(),$=z.indexOf(F),Z=z.slice(0,$+1),de=[...z.slice($+1),...Z];for(const Y of de.slice())if(Y.dataset.moonbaseFocusGuard==="true"||C!=null&&C.contains(Y)){const V=de.indexOf(Y);V!==-1&&de.splice(V,1)}it(de,Ue.First,{sorted:!1})},[xt.Backwards]:()=>{var C;it(S,Ue.Previous)===yn.Error&&((C=G(s.button))==null||C.focus())}})}A()}return()=>{const S={open:s.popoverState.value===0,close:s.close},{id:A,focus:F,...C}=e,z={ref:s.panel,id:A,onKeydown:d,onFocusout:o&&s.popoverState.value===0?f:void 0,tabIndex:-1};return Qe({ourProps:z,theirProps:{...t,...C},attrs:t,slot:S,slots:{...n,default:(...$)=>{var Z;return[Le(Ce,[u.value&&s.isPortalled.value&&Le(Kn,{id:a,ref:s.beforePanelSentinel,features:zn.Focusable,"data-moonbase-focus-guard":!0,as:"button",type:"button",onFocus:y}),(Z=n.default)==null?void 0:Z.call(n,...$),u.value&&s.isPortalled.value&&Le(Kn,{id:c,ref:s.afterPanelSentinel,features:zn.Focusable,"data-moonbase-focus-guard":!0,as:"button",type:"button",onFocus:E})])]}},features:qn.RenderStrategy|qn.Static,visible:u.value,name:"PopoverPanel"})}}});let e_=he({props:{onFocus:{type:Function,required:!0}},setup(e){let t=T(!0);return()=>t.value?Le(Kn,{as:"button",type:"button",features:zn.Focusable,onFocus(n){n.preventDefault();let r,o=50;function s(){var i;if(o--<=0){r&&cancelAnimationFrame(r);return}if((i=e.onFocus)!=null&&i.call(e)){t.value=!1,cancelAnimationFrame(r);return}r=requestAnimationFrame(s)}r=requestAnimationFrame(s)}}):null}});const Vd=Symbol("TabsContext");function Ao(e){const t=$e(Vd,null);if(t===null){const n=new Error(`<${e} /> is missing a parent <TabGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ao),n}return t}const La=Symbol("TabsSSRContext"),t_=he({name:"TabGroup",emits:{change:e=>!0},props:{as:{type:[Object,String],default:"template"},selectedIndex:{type:[Number],default:null},defaultIndex:{type:[Number],default:0},vertical:{type:[Boolean],default:!1},manual:{type:[Boolean],default:!1}},inheritAttrs:!1,setup(e,{slots:t,attrs:n,emit:r}){const o=T(e.selectedIndex??e.defaultIndex),s=T([]),i=T([]),a=X(()=>e.selectedIndex!==null),c=X(()=>a.value?e.selectedIndex:o.value);function l(y){const E=jr(u.tabs.value,G),S=jr(u.panels.value,G),A=E.filter(F=>{var C;return!((C=G(F))!=null&&C.hasAttribute("disabled"))});if(y<0||y>E.length-1){const F=Je(o.value===null?0:Math.sign(y-o.value),{[-1]:()=>1,0:()=>Je(Math.sign(y),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0}),C=Je(F,{0:()=>E.indexOf(A[0]),1:()=>E.indexOf(A[A.length-1])});C!==-1&&(o.value=C),u.tabs.value=E,u.panels.value=S}else{const F=E.slice(0,y),z=[...E.slice(y),...F].find(Z=>A.includes(Z));if(!z)return;let $=E.indexOf(z)??u.selectedIndex.value;$===-1&&($=u.selectedIndex.value),o.value=$,u.tabs.value=E,u.panels.value=S}}let u={selectedIndex:X(()=>o.value??e.defaultIndex??null),orientation:X(()=>e.vertical?"vertical":"horizontal"),activation:X(()=>e.manual?"manual":"auto"),tabs:s,panels:i,setSelectedIndex(y){c.value!==y&&r("change",y),a.value||l(y)},registerTab(y){if(s.value.includes(y))return;const E=s.value[o.value];if(s.value.push(y),s.value=jr(s.value,G),!a.value){const S=s.value.indexOf(E)??o.value;S!==-1&&(o.value=S)}},unregisterTab(y){const E=s.value.indexOf(y);E!==-1&&s.value.splice(E,1)},registerPanel(y){i.value.includes(y)||(i.value.push(y),i.value=jr(i.value,G))},unregisterPanel(y){const E=i.value.indexOf(y);E!==-1&&i.value.splice(E,1)}};dt(Vd,u);const d=T({tabs:[],panels:[]}),f=T(!1);Re(()=>{f.value=!0}),dt(La,X(()=>f.value?null:d.value));const m=X(()=>e.selectedIndex);return Re(()=>{Xe([m],()=>l(e.selectedIndex??e.defaultIndex),{immediate:!0})}),ft(()=>{if(!a.value||c.value==null||u.tabs.value.length<=0)return;const y=jr(u.tabs.value,G);y.some((S,A)=>G(u.tabs.value[A])!==G(S))&&u.setSelectedIndex(y.findIndex(S=>G(S)===G(u.tabs.value[c.value])))}),()=>{const y={selectedIndex:o.value};return Le(Ce,[s.value.length<=0&&Le(e_,{onFocus:()=>{for(const E of s.value){const S=G(E);if((S==null?void 0:S.tabIndex)===0)return S.focus(),!0}return!1}}),Qe({theirProps:{...n,...Pa(e,["selectedIndex","defaultIndex","manual","vertical","onChange"])},ourProps:{},slot:y,slots:t,attrs:n,name:"TabGroup"})])}}}),n_=he({name:"TabList",props:{as:{type:[Object,String],default:"div"}},setup(e,{attrs:t,slots:n}){const r=Ao("TabList");return()=>{const o={selectedIndex:r.selectedIndex.value},s={role:"tablist","aria-orientation":r.orientation.value};return Qe({ourProps:s,theirProps:e,slot:o,attrs:t,slots:n,name:"TabList"})}}}),Ma=he({name:"Tab",props:{as:{type:[Object,String],default:"button"},disabled:{type:[Boolean],default:!1},id:{type:String,default:()=>`moonbase-tabs-tab-${$t()}`}},setup(e,{attrs:t,slots:n,expose:r}){const o=Ao("Tab"),s=T(null);r({el:s,$el:s}),Re(()=>o.registerTab(s)),mt(()=>o.unregisterTab(s));const i=$e(La),a=X(()=>{if(i.value){const S=i.value.tabs.indexOf(e.id);return S===-1?i.value.tabs.push(e.id)-1:S}return-1}),c=X(()=>{const S=o.tabs.value.indexOf(s);return S===-1?a.value:S}),l=X(()=>c.value===o.selectedIndex.value);function u(S){var F;const A=S();if(A===yn.Success&&o.activation.value==="auto"){const C=(F=Qt(s))==null?void 0:F.activeElement,z=o.tabs.value.findIndex($=>G($)===C);z!==-1&&o.setSelectedIndex(z)}return A}function d(S){const A=o.tabs.value.map(C=>G(C)).filter(Boolean);if(S.key===et.Space||S.key===et.Enter){S.preventDefault(),S.stopPropagation(),o.setSelectedIndex(c.value);return}switch(S.key){case et.Home:case et.PageUp:return S.preventDefault(),S.stopPropagation(),u(()=>it(A,Ue.First));case et.End:case et.PageDown:return S.preventDefault(),S.stopPropagation(),u(()=>it(A,Ue.Last))}if(u(()=>Je(o.orientation.value,{vertical(){return S.key===et.ArrowUp?it(A,Ue.Previous|Ue.WrapAround):S.key===et.ArrowDown?it(A,Ue.Next|Ue.WrapAround):yn.Error},horizontal(){return S.key===et.ArrowLeft?it(A,Ue.Previous|Ue.WrapAround):S.key===et.ArrowRight?it(A,Ue.Next|Ue.WrapAround):yn.Error}}))===yn.Success)return S.preventDefault()}const f=T(!1);function m(){var S;f.value||(f.value=!0,!e.disabled&&((S=G(s))==null||S.focus({preventScroll:!0}),o.setSelectedIndex(c.value),Js(()=>{f.value=!1})))}function y(S){S.preventDefault()}const E=Td(X(()=>({as:e.as,type:t.type})),s);return()=>{var z;const S={selected:l.value,disabled:e.disabled??!1},{id:A,...F}=e,C={ref:s,onKeydown:d,onMousedown:y,onClick:m,id:A,role:"tab",type:E.value,"aria-controls":(z=G(o.panels.value[c.value]))==null?void 0:z.id,"aria-selected":l.value,tabIndex:l.value?0:-1,disabled:e.disabled?!0:void 0};return Qe({ourProps:C,theirProps:F,slot:S,attrs:t,slots:n,name:"Tab"})}}}),r_=he({name:"TabPanels",props:{as:{type:[Object,String],default:"div"}},setup(e,{slots:t,attrs:n}){const r=Ao("TabPanels");return()=>{const o={selectedIndex:r.selectedIndex.value};return Qe({theirProps:e,ourProps:{},slot:o,attrs:n,slots:t,name:"TabPanels"})}}}),Ua=he({name:"TabPanel",props:{as:{type:[Object,String],default:"div"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:()=>`moonbase-tabs-panel-${$t()}`},tabIndex:{type:Number,default:0}},setup(e,{attrs:t,slots:n,expose:r}){const o=Ao("TabPanel"),s=T(null);r({el:s,$el:s}),Re(()=>o.registerPanel(s)),mt(()=>o.unregisterPanel(s));const i=$e(La),a=X(()=>{if(i.value){const u=i.value.panels.indexOf(e.id);return u===-1?i.value.panels.push(e.id)-1:u}return-1}),c=X(()=>{const u=o.panels.value.indexOf(s);return u===-1?a.value:u}),l=X(()=>c.value===o.selectedIndex.value);return()=>{var E;const u={selected:l.value},{id:d,tabIndex:f,...m}=e,y={ref:s,id:d,role:"tabpanel","aria-labelledby":(E=G(o.tabs.value[c.value]))==null?void 0:E.id,tabIndex:l.value?f:-1};return!l.value&&e.unmount&&!e.static?Le(Kn,{as:"span","aria-hidden":!0,...y}):Qe({ourProps:y,theirProps:m,slot:u,attrs:t,slots:n,features:qn.Static|qn.RenderStrategy,visible:l.value,name:"TabPanel"})}}});function o_(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Fa(e,...t){e&&t.length>0&&!e.dataset.transition?e.dataset.transition=t.join(" "):e&&t.length>0&&(e.dataset.transition=[...e.dataset.transition.split(" "),...t].join(" "))}function ti(e,...t){e&&t.length>0&&e.dataset.transition&&(e.dataset.transition=e.dataset.transition.split(" ").filter(n=>!t.includes(n)).join(" "))}var Ba=(e=>(e.Finished="finished",e.Cancelled="cancelled",e))(Ba||{});function s_(e,t){const n=$o();if(!e)return n.dispose;const{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[s,i]=[r,o].map(a=>{const[c=0]=a.split(",").filter(Boolean).map(l=>l.includes("ms")?Number.parseFloat(l):Number.parseFloat(l)*1e3).sort((l,u)=>u-l);return c});return s!==0?n.setTimeout(()=>t("finished"),s+i):t("finished"),n.add(()=>t("cancelled")),n.dispose}function Rd(e,t,n,r,o,s){const i=$o(),a=s!==void 0?o_(s):()=>{};return ti(e,...o),Fa(e,...t,...n),i.nextFrame(()=>{ti(e,...n),Fa(e,...r),i.add(s_(e,c=>(ti(e,...r,...t),Fa(e,...o),a(c))))}),i.add(()=>ti(e,...t,...n,...r,...o)),i.add(()=>a("cancelled")),i.dispose}function Or(e=""){return e.split(/\s+/).filter(t=>t.length>1)}const Ha=Symbol("TransitionContext");function i_(){return $e(Ha,null)!==null}function a_(){const e=$e(Ha,null);if(e===null)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return e}const Za=Symbol("NestingContext");function l_(){const e=$e(Za,null);if(e===null)throw new Error("A <TransitionChild /> is used but it is missing a parent <TransitionRoot />.");return e}function ni(e){return"children"in e?ni(e.children):e.value.filter(({state:t})=>t==="visible").length>0}function jd(e){const t=T([]),n=T(!1);Re(()=>n.value=!0),mt(()=>n.value=!1);function r(s,i=Wn.Hidden){const a=t.value.findIndex(({id:c})=>c===s);a!==-1&&(Je(i,{[Wn.Unmount](){t.value.splice(a,1)},[Wn.Hidden](){t.value[a].state="hidden"}}),!ni(t)&&n.value&&(e==null||e()))}function o(s){const i=t.value.find(({id:a})=>a===s);return i?i.state!=="visible"&&(i.state="visible"):t.value.push({id:s,state:"visible"}),()=>r(s,Wn.Unmount)}return{children:t,register:o,unregister:r}}const Ld=qn.RenderStrategy,Vo=he({props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:"enter"},enterFrom:{type:[String],default:"enter-from"},enterTo:{type:[String],default:"enter-to"},entered:{type:[String],default:"entered"},leave:{type:[String],default:"leave"},leaveFrom:{type:[String],default:"leave-from"},leaveTo:{type:[String],default:"leave-to"}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(e,{emit:t,attrs:n,slots:r,expose:o}){const s=T(0);function i(){s.value|=at.Opening,t("beforeEnter")}function a(){s.value&=~at.Opening,t("afterEnter")}function c(){s.value|=at.Closing,t("beforeLeave")}function l(){s.value&=~at.Closing,t("afterLeave")}if(!i_()&&Zy())return()=>Le(qa,{...e,onBeforeEnter:i,onAfterEnter:a,onBeforeLeave:c,onAfterLeave:l},r);const u=T(null),d=X(()=>e.unmount?Wn.Unmount:Wn.Hidden);o({el:u,$el:u});const{show:f,appear:m}=a_(),{register:y,unregister:E}=l_(),S=T(f.value?"visible":"hidden"),A={value:!0},F=$t(),C={value:!1},z=jd(()=>{!C.value&&S.value!=="hidden"&&(S.value="hidden",E(F),l())});Re(()=>{const oe=y(F);mt(oe)}),ft(()=>{if(d.value===Wn.Hidden&&F){if(f.value&&S.value!=="visible"){S.value="visible";return}Je(S.value,{hidden:()=>E(F),visible:()=>y(F)})}});const $=Or(e.enter),Z=Or(e.enterFrom),x=Or(e.enterTo),de=Or(e.entered),Y=Or(e.leave),V=Or(e.leaveFrom),P=Or(e.leaveTo);Re(()=>{ft(()=>{if(S.value==="visible"){const oe=G(u);if(oe instanceof Comment&&oe.data==="")throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}})});function j(oe){const w=A.value&&!m.value,I=G(u);!I||!(I instanceof HTMLElement)||w||(C.value=!0,f.value&&i(),f.value||c(),oe(f.value?Rd(I,$,Z,x,de,ne=>{C.value=!1,ne===Ba.Finished&&a()}):Rd(I,Y,V,P,de,ne=>{C.value=!1,ne===Ba.Finished&&(ni(z)||(S.value="hidden",E(F),l()))})))}return Re(()=>{Xe([f],(oe,w,I)=>{j(I),A.value=!1},{immediate:!0})}),dt(Za,z),yd(X(()=>Je(S.value,{visible:at.Open,hidden:at.Closed})|s.value)),()=>{const{appear:oe,show:w,enter:I,enterFrom:ne,enterTo:ae,entered:re,leave:ce,leaveFrom:Ie,leaveTo:je,...nt}=e,bt={ref:u},bn={...nt,...m.value&&f.value&&To.isServer?{class:rs([n.class,nt.class,...$,...Z])}:{}};return Qe({theirProps:bn,ourProps:bt,slot:{},slots:r,attrs:n,features:Ld,visible:S.value==="visible",name:"TransitionChild"})}}}),c_=Vo,qa=he({inheritAttrs:!1,props:{as:{type:[Object,String],default:"div"},show:{type:[Boolean],default:null},unmount:{type:[Boolean],default:!0},appear:{type:[Boolean],default:!1},enter:{type:[String],default:""},enterFrom:{type:[String],default:""},enterTo:{type:[String],default:""},entered:{type:[String],default:""},leave:{type:[String],default:""},leaveFrom:{type:[String],default:""},leaveTo:{type:[String],default:""}},emits:{beforeEnter:()=>!0,afterEnter:()=>!0,beforeLeave:()=>!0,afterLeave:()=>!0},setup(e,{emit:t,attrs:n,slots:r}){const o=Ys(),s=X(()=>e.show===null&&o!==null?(o.value&at.Open)===at.Open:e.show);ft(()=>{if(![!0,!1].includes(s.value))throw new Error('A <Transition /> is used but it is missing a `:show="true | false"` prop.')});const i=T(s.value?"visible":"hidden"),a=jd(()=>{i.value="hidden"}),c=T(!0),l={show:s,appear:X(()=>e.appear||!c.value)};return Re(()=>{ft(()=>{c.value=!1,s.value?i.value="visible":ni(a)||(i.value="hidden")})}),dt(Za,a),dt(Ha,l),()=>{const u=Pa(e,["show","appear","unmount","onBeforeEnter","onBeforeLeave","onAfterEnter","onAfterLeave"]),d={unmount:e.unmount};return Qe({ourProps:{...d,as:"template"},theirProps:{},slot:{},slots:{...r,default:()=>[Le(c_,{onBeforeEnter:()=>t("beforeEnter"),onAfterEnter:()=>t("afterEnter"),onBeforeLeave:()=>t("beforeLeave"),onAfterLeave:()=>t("afterLeave"),...n,...d,...u},r.default)]},attrs:{},features:Ld,visible:i.value==="visible",name:"Transition"})}}}),u_={class:"moonbase:modal-container"},ri=he({__name:"Modal",props:{open:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(_(),xe(b(qa),{as:"template",show:t.open},{default:ye(()=>[B(b(Sd),{as:"div",class:"moonbase:modal",onClose:n[0]||(n[0]=r=>t.$emit("close"))},{default:ye(()=>[O("div",u_,[B(b(Vo),{as:"template"},{default:ye(()=>[B(b(xd),{class:"moonbase:modal-overlay"})]),_:1}),B(b(Vo),{as:"template"},{default:ye(()=>[B(b(kd),{class:"moonbase:modal-content"},{default:ye(()=>[Wi(t.$slots,"default")]),_:3})]),_:3})])]),_:3})]),_:3},8,["show"]))}}),d_=["data-visible"],f_=he({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=Ae(),o=St(),s=$e(Ws),i=T(r.getParameter("email")??""),a=T(""),c=T(null);async function l(){c.value=null;try{const u=await o.signIn(i.value,a.value);Xt(1500).then(()=>n("signedIn",u))}catch(u){throw u instanceof Pr?c.value="User not found":c.value=u.message,u}}return(u,d)=>(_(),xe(Hn,{handler:l,class:"moonbase:sign-in"},{default:ye(()=>{var f;return[B(gt,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=m=>i.value=m),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),B(gt,{modelValue:a.value,"onUpdate:modelValue":d[1]||(d[1]=m=>a.value=m),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),B(Zn,{success:"Signed in",label:"Sign in",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!c.value||void 0},K(c.value),9,d_),(f=b(s))!=null&&f.auth.enable.signUp?(_(),N("button",{key:0,type:"button",onClick:d[2]||(d[2]=m=>b(r).show(b(ke).Authentication,b(pe).SignUp,{email:i.value}))}," Create account ")):me("",!0),O("button",{type:"button",onClick:d[3]||(d[3]=m=>b(r).show(b(ke).Authentication,b(pe).ForgotPassword,{email:i.value}))}," Forgot password ")]}),_:1}))}}),p_={class:"moonbase:authentication"},h_={key:0,class:"moonbase:loader"},m_=he({__name:"Authentication",props:{open:{type:Boolean}},emits:["authenticated"],setup(e,{emit:t}){const n=t,r=Ae(),{loaded:o,user:s}=St();Xe(s,a=>{a&&r.intent===pe.SignIn&&(n("authenticated",a),r.dequeue())});const i=X(()=>{switch(r.intent){case pe.SignIn:return"Sign in";case pe.SignUp:return"Sign up";case pe.ConfirmAccount:return"Confirm account";case pe.ConfirmEmailChange:return"Confirm email change";case pe.ForgotPassword:return"Forgot password";case pe.ResetPassword:return"Reset password"}throw new Error("Moonbase: Unknown intent")});return(a,c)=>(_(),xe(ri,{open:a.open,onClose:c[3]||(c[3]=l=>b(r).reset())},{default:ye(()=>[O("div",p_,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(K(i.value),1)]),_:1}),b(o)?b(r).intent===b(pe).SignIn?(_(),xe(f_,{key:1})):b(r).intent===b(pe).SignUp?(_(),xe(iy,{key:2,onSignedUp:c[0]||(c[0]=l=>b(r).dequeue())})):b(r).intent===b(pe).ConfirmAccount?(_(),xe(dy,{key:3,onConfirmedAccount:c[1]||(c[1]=l=>b(r).dequeue())})):b(r).intent===b(pe).ConfirmEmailChange?(_(),xe(Oy,{key:4})):b(r).intent===b(pe).ForgotPassword?(_(),xe(my,{key:5})):b(r).intent===b(pe).ResetPassword?(_(),xe(yy,{key:6,onPasswordReset:c[2]||(c[2]=l=>b(r).dequeue())})):me("",!0):(_(),N("div",h_,[B(Pt)]))])]),_:1},8,["open"]))}});function _n(e,t){return new Intl.NumberFormat(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",maximumFractionDigits:2,minimumFractionDigits:2}).format(e)}const v_={class:"moonbase:product-cart-item"},g_=["src"],y_={key:1,class:"moonbase:image-placeholder"},__={class:"moonbase:product-cart-item-content"},b_={key:0,class:"moonbase:cart-item-discount"},w_={class:"font-semibold"},E_={key:0,class:"ml-0.5"},O_={key:2,class:"moonbase:product-cart-item-total"},N_={key:0,class:"moonbase:discount"},S_={key:1},x_=he({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){return(t,n)=>{var r,o,s;return _(),N("div",v_,[(r=t.lineItem.product)!=null&&r.iconUrl?(_(),N("img",{key:0,src:t.lineItem.product.iconUrl,alt:""},null,8,g_)):(_(),N("div",y_)),O("div",__,[O("h3",null,K((o=t.lineItem.product)==null?void 0:o.name),1),O("p",null,K((s=t.lineItem.product)==null?void 0:s.tagline),1),t.lineItem.appliedDiscount?(_(),N("p",b_,[Te(" Discount applied: "),O("span",w_,K(t.lineItem.appliedDiscount.name),1),t.lineItem.appliedDiscount.total?(_(),N("span",E_," (-"+K(b(_n)(t.lineItem.appliedDiscount.total[t.currency],t.currency))+") ",1)):me("",!0)])):me("",!0),O("p",null,K(t.lineItem.quantity)+" in cart",1)]),t.lineItem.variation?(_(),N("div",O_,[t.lineItem.variation.hasDiscount?(_(),N("span",N_,K(b(_n)(t.lineItem.variation.originalPrice[t.currency],t.currency)),1)):me("",!0),t.lineItem.quantity!==1?(_(),N("span",S_,K(t.lineItem.quantity)+" x "+K(b(_n)(t.lineItem.variation.price[t.currency],t.currency)),1)):me("",!0),Te(" "+K(b(_n)(t.lineItem.variation.price[t.currency]*t.lineItem.quantity,t.currency)),1)])):me("",!0)])}}}),k_={class:"moonbase:bundle-cart-item"},C_=["src"],T_={key:1,class:"moonbase:image-placeholder"},P_={class:"moonbase:bundle-cart-item-content"},$_={key:0,class:"moonbase:cart-item-discount"},I_={class:"font-semibold"},D_={key:0,class:"ml-0.5"},A_={class:"moonbase:bundle-cart-item-summary"},V_=["data-open"],R_=[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)],j_={key:2,class:"moonbase:product-cart-item-total"},L_={key:0,class:"moonbase:discount"},M_={key:1},U_=["src"],F_={key:1,class:"moonbase:image-placeholder"},B_=["data-included"],H_={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Z_=[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)],q_={key:0,class:"truncate italic"},W_={key:1,class:"truncate"},z_=he({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const t=T(!1),n=T(null);return Xe(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>{var s,i,a,c,l,u,d;return _(),N("div",null,[O("div",k_,[(s=r.lineItem.bundle)!=null&&s.iconUrl?(_(),N("img",{key:0,src:r.lineItem.bundle.iconUrl,alt:""},null,8,C_)):(_(),N("div",T_)),O("div",P_,[O("h3",null,K((i=r.lineItem.bundle)==null?void 0:i.name),1),O("p",null,K((a=r.lineItem.bundle)==null?void 0:a.tagline),1),r.lineItem.appliedDiscount?(_(),N("p",$_,[Te(" Discount applied: "),O("span",I_,K(r.lineItem.appliedDiscount.name),1),r.lineItem.appliedDiscount.total?(_(),N("span",D_," (-"+K(b(_n)(r.lineItem.appliedDiscount.total[r.currency],r.currency))+") ",1)):me("",!0)])):me("",!0),O("div",A_,[O("span",null,K(r.lineItem.quantity)+" in cart",1),r.lineItem.bundle?(_(),N("button",{key:0,onClick:o[0]||(o[0]=f=>t.value=!t.value)},[O("span",null,[Te(" Including "+K((c=r.lineItem.bundle)==null?void 0:c.products.filter(f=>f.included).length)+" ",1),(l=r.lineItem.bundle)!=null&&l.products.some(f=>!f.included)?(_(),N(Ce,{key:0},[Te("of "+K((u=r.lineItem.bundle)==null?void 0:u.products.length),1)],64)):me("",!0),Te(" products ")]),(_(),N("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},R_,8,V_))])):me("",!0)])]),r.lineItem.variation?(_(),N("div",j_,[r.lineItem.variation.hasDiscount?(_(),N("span",L_,K(b(_n)(r.lineItem.variation.originalPrice[r.currency],r.currency)),1)):me("",!0),r.lineItem.quantity!==1?(_(),N("span",M_,K(r.lineItem.quantity)+" x "+K(b(_n)(r.lineItem.variation.price[r.currency],r.currency)),1)):me("",!0),Te(" "+K(b(_n)(r.lineItem.variation.price[r.currency]*r.lineItem.quantity,r.currency)),1)])):me("",!0)]),O("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"}},[(_(!0),N(Ce,null,Gt(((d=r.lineItem.bundle)==null?void 0:d.products)||[],f=>(_(),N("div",{key:f.id},[f!=null&&f.iconUrl?(_(),N("img",{key:0,src:f.iconUrl,alt:""},null,8,U_)):(_(),N("div",F_)),O("div",null,[O("h3",{"data-included":f.included||void 0},[f.included?(_(),N("svg",H_,Z_)):me("",!0),Te(" "+K(f==null?void 0:f.name),1)],8,B_),f.included?f!=null&&f.tagline?(_(),N("p",W_,K(f.tagline),1)):me("",!0):(_(),N("p",q_," You already own this "))])]))),128))],512)])}}}),K_={class:"moonbase:cart-modal-container"},G_=he({__name:"CartModal",props:{open:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>(_(),xe(b(qa),{as:"template",show:t.open},{default:ye(()=>[B(b(Sd),{as:"div",class:"moonbase:cart-modal",onClose:n[0]||(n[0]=r=>t.$emit("close"))},{default:ye(()=>[O("div",K_,[B(b(Vo),{as:"template"},{default:ye(()=>[B(b(xd),{class:"moonbase:cart-modal-overlay"})]),_:1}),B(b(Vo),{as:"template"},{default:ye(()=>[B(b(kd),{class:"moonbase:cart-modal-content"},{default:ye(()=>[Wi(t.$slots,"default")]),_:3})]),_:3})])]),_:3})]),_:3},8,["show"]))}}),J_=["disabled","data-success","data-error","data-working","data-variant"],Y_=["data-visible"],Md=he({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},variant:{},noReset:{type:Boolean}},setup(e){const t=e,n=T(!1),r=T(!1),o=T(!1),s=X(()=>r.value?t.success:o.value?t.error:t.label);async function i(){try{const a=t.handler();a instanceof Promise&&(n.value=!0,await a,n.value=!1,r.value=!0,await Xt(2500),t.noReset||(r.value=!1))}catch{n.value=!1,o.value=!0,await Xt(2500),o.value=!1}}return(a,c)=>(_(),N("button",{class:"moonbase:button",type:"button",disabled:r.value||o.value||n.value,"data-success":r.value||void 0,"data-error":o.value||void 0,"data-working":n.value||void 0,"data-variant":a.variant,onClick:i},[O("div",{"data-visible":n.value||void 0,"aria-hidden":"true"},[n.value?(_(),xe(Pt,{key:0})):me("",!0)],8,Y_),Te(" "+K(s.value),1)],8,J_))}}),X_={class:"moonbase:cart"},Q_={key:0,role:"list",class:"moonbase:cart-items"},eb={key:1,class:"moonbase:cart-empty"},tb={key:2,class:"moonbase:cart-total"},nb=O("label",null," Total ",-1),rb=O("p",null," Sales tax to be calculated at checkout ",-1),ob=he({__name:"Cart",props:{open:{type:Boolean}},setup(e){const t=Ae(),{items:n,total:r,currency:o,checkout:s}=ba();async function i(){if(!await s(`${window.location.pathname}?mb_intent=view_products`))throw new Error("Cancelled checkout")}return(a,c)=>(_(),xe(G_,{open:a.open,onClose:c[0]||(c[0]=l=>b(t).reset())},{default:ye(()=>[O("div",X_,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(" Cart ")]),_:1}),b(n).length>0?(_(),N("ul",Q_,[(_(!0),N(Ce,null,Gt(b(n),l=>(_(),N("li",{key:l.id},[l.type==="Product"?(_(),xe(x_,{key:0,"line-item":l,currency:b(o)},null,8,["line-item","currency"])):l.type==="Bundle"?(_(),xe(z_,{key:1,"line-item":l,currency:b(o)},null,8,["line-item","currency"])):me("",!0)]))),128))])):(_(),N("div",eb," Your cart is empty! ")),b(n).length>0?(_(),N("div",tb,[nb,O("span",null,K(b(_n)(b(r).amount,b(r).currency)),1),rb])):me("",!0),b(n).length>0?(_(),xe(Md,{key:3,handler:i,label:"Checkout",success:"Done",error:"Cancelled"})):me("",!0)])]),_:1},8,["open"]))}}),sb={class:"moonbase:account"},ib={key:0,class:"moonbase:error"},ab={key:1,class:"moonbase:notification"},lb={key:0,class:"moonbase:error"},cb=he({__name:"Account",setup(e){var F,C,z;const t=Ae(),{user:n,update:r,setPassword:o,signOut:s}=St(),i=T(((F=n.value)==null?void 0:F.name)??""),a=T(((C=n.value)==null?void 0:C.email)??""),c=T(((z=n.value)==null?void 0:z.communicationPreferences)??{newsletterOptIn:!1}),l=T(null),u=T(!1),d=T(""),f=T(""),m=T(null),y=T(!1);async function E(){l.value=null,u.value=!1;try{(await r(i.value,a.value,void 0,c.value)).needsEmailConfirmationToken&&(u.value=!0)}catch($){throw l.value=$,$}}async function S(){m.value=null;try{await o(d.value,f.value),d.value="",f.value=""}catch($){throw m.value=$,$}}async function A(){y.value=!0,await s(),t.reset()}return($,Z)=>(_(),N("div",sb,[B(Hn,{handler:E},{default:ye(()=>[B(gt,{modelValue:i.value,"onUpdate:modelValue":Z[0]||(Z[0]=x=>i.value=x),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),B(gt,{modelValue:a.value,"onUpdate:modelValue":Z[1]||(Z[1]=x=>a.value=x),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),B(od,{modelValue:c.value.newsletterOptIn,"onUpdate:modelValue":Z[2]||(Z[2]=x=>c.value.newsletterOptIn=x),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),B(Zn,{label:"Save",error:"Error",success:"Saved"}),l.value?(_(),N("p",ib,K(l.value.message),1)):u.value?(_(),N("p",ab," You need to confirm your new email address, please check your inbox ")):me("",!0)]),_:1}),B(Hn,{handler:S},{default:ye(()=>[B(gt,{modelValue:d.value,"onUpdate:modelValue":Z[3]||(Z[3]=x=>d.value=x),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),B(gt,{modelValue:f.value,"onUpdate:modelValue":Z[4]||(Z[4]=x=>f.value=x),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),B(Zn,{label:"Save",error:"Error",success:"Saved"}),m.value?(_(),N("p",lb,K(m.value.message),1)):me("",!0)]),_:1}),B(Md,{label:"Log out",success:"Logged out",error:"Error",variant:"secondary",handler:A})]))}}),ub={},db={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},fb=[O("path",{d:"M320 336h76c55 0 100-21.21 100-75.6s-53-73.47-96-75.6C391.11 99.74 329 48 256 48c-69 0-113.44 45.79-128 91.2-60 5.7-112 35.88-112 98.4S70 336 136 336h56M192 400.1l64 63.9 64-63.9M256 224v224.03",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)];function pb(e,t){return _(),N("svg",db,fb)}const Ud=Bn(ub,[["render",pb]]),hb={},mb={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},vb=[O("path",{d:"M480 265H232v179l248 36V265zM216 265H32v150l184 26.7V265zM480 32L232 67.4V249h248V32zM216 69.7L32 96v153h184V69.7z",fill:"currentColor"},null,-1)];function gb(e,t){return _(),N("svg",mb,vb)}const Fd=Bn(hb,[["render",gb]]),yb={},_b={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},bb=[O("path",{d:"M443.66 405.05c-1.46-.79-2.85-1.54-4-2.2-6.47-3.83-13-10.52-11.85-17.83 2.42-15.94 2.89-23.47-.49-28.79a15.61 15.61 0 0 0-7.67-6.2v-.06c1.41-2.56 2.26-5.66 2.83-10.12 1.44-11-5-44-13.7-70.7-8.08-24.68-29.24-50-44.7-68.56l-3.61-4.34c-23.88-28.93-24.34-38.19-26.55-82.67-.32-6.47-.69-13.8-1.17-22C329.87 41.43 304 16 256 16c-25.2 0-44.62 7.15-57.72 21.26C187.79 48.55 182 64 182 80.78c0 29.52 2 53 2.15 54.29 1.4 35.7 1 41.22-8.31 57.55-2.23 3.93-8.38 10.87-14.89 18.21-8.48 9.57-18.09 20.41-23.36 29.22-3.77 6.31-5.88 12.63-8.11 19.33-3.4 10.21-7.26 21.78-18.15 36.57-12.57 17.07-15.52 29.61-11 47.45-4.94 6.45-4.83 14.37-4.75 20.23a25.84 25.84 0 0 1-.3 6.09c-2.29 7.59-12.42 9.4-22 10.18-1.58.12-3.1.21-4.55.29-7.26.39-13.53.74-17.13 6.3-3.47 5.36-1.12 13.8 2.14 25.48.72 2.58 1.46 5.25 2.19 8.06 1.83 7-.16 10.48-2.68 14.84-2.44 4.21-5.21 9-5.21 17.55 0 14.67 20 18 43.05 21.94 7.36 1.24 15 2.53 22.63 4.24a225.58 225.58 0 0 1 34.08 10.68c9.72 3.73 17.4 6.68 26.43 6.68 16.18 0 28.25-9.77 39.92-19.21l2.15-1.75c5.53-4.49 21.5-4 34.34-3.64 3.46.1 6.73.2 9.65.2h6.22c13.48-.08 31.94-.18 42.23 2.5 3.75 1 6.2 3.72 9.29 7.19 5.87 6.56 13.17 14.75 33.39 14.75 19.39 0 29.55-8.71 41.32-18.8 7.16-6.13 14.56-12.48 25.07-17.86 3.92-2 7.62-3.87 11.08-5.61 22.64-11.38 35.11-17.65 35.11-27.82 0-9.91-12.24-16.5-20.34-20.86zM211.11 88.38a13.91 13.91 0 0 1 12.47 9c1.95 5.55 1.81 10.42.21 12.94 0 0-.22-1-.36-1.44a14.85 14.85 0 0 0-6.44-8.59 11.35 11.35 0 0 0-8.94-1.47c-4.26 1.13-8.41 5-8.91 18.79-5.16-10.47-2.31-18 .92-23 2.31-3.73 7.47-6.33 11.05-6.23zm-17.5 375C192 479.24 175.2 479 170.09 478.59c-9.81-.82-21.66-4.69-33.13-8.43-4.52-1.47-9.19-3-13.73-4.34-13.2-3.89-30.12-6.74-43.72-9-3.22-.55-6.27-1.06-9.05-1.55s-4.61-1.27-5.2-2.3c-1-1.65.38-5.25 1.93-9.41C69.27 438 72.11 430.34 72 421c0-3.91-1.47-8.3-2.84-12.56-1.62-5-3.28-10.17-1.93-12.62 1.23-2.23 6.75-2.49 11.6-2.49h2.26c3.55 0 6.62.06 8.75-.53 6.51-1.81 14.86-6.92 17.81-13.88.9-2.17 1.37-6.94 2-14 .37-4.12.74-8.37 1.22-10.58a3.55 3.55 0 0 1 2.11-2.55c1.65-.77 6.78-1.91 18.63 4.08 11.18 5.65 22.88 25.84 34.2 45.37 3.56 6.14 6.92 11.94 10.3 17.36 14.04 22.54 18.83 31.6 17.5 44.8zm128.84-31.56a68.74 68.74 0 0 1-4.55 10.9.58.58 0 0 1-1.08-.42 56.61 56.61 0 0 0 2.11-18.43c-.25-4.73-.4-7.59-2.66-8.51s-4.26.83-9.45 5.54c-1.1 1-2.36 2.14-3.78 3.4-10.8 9.47-26.88 20.68-55.61 23.37-16.84 1.59-27.59-4.63-30.92-8.14a2.16 2.16 0 0 0-3.07-.08 2.23 2.23 0 0 0-.51 2.29c2.12 6.84 1.2 12.26-.49 16.19-.95 2.2-1.85 2.05-2-.34-.25-4.64-1-9.88-3-14.19-3.11-6.94-7-14.34-8.89-17.88v-.05c3.24-1.49 8.86-4.83 11.37-10.88s4.48-18-9.82-31.74c-6.28-6.05-22.1-17.16-36.06-27-10.9-7.65-22.17-15.56-23.65-17.51-4.49-5.89-6.37-9.3-6.94-19.65.07-2.3.13-4.59.19-6.89l.27-2.49a.58.58 0 0 1 1.15 0 63.07 63.07 0 0 0 2 9.72c1.08 3.73 2.4 7.58 3.62 9.18 3.19 4.22 7.56 7.39 11.67 8.49a5.48 5.48 0 0 0 5-.72c2.93-2.33 2.65-7.6 2.19-16.34-.47-9-1.11-21.34 1.85-34.55 5.62-25 10.91-32.51 17.61-42 .86-1.22 1.75-2.47 2.65-3.79 1.44-2.08 3-4.1 4.67-6.23 7.47-9.61 15.93-20.49 13.92-40.95-.51-5.19-.76-8.83-.86-11.39a1 1 0 0 1 1.88-.59l.49.77 1.21 2c4.86 8 13.64 22.57 25.1 22.57a13.62 13.62 0 0 0 2.36-.21c23.39-3.93 51.9-30.25 52.17-30.51 3.12-3 2.84-6.14 1.64-7.91a5.18 5.18 0 0 0-6.45-1.72c-3.29 1.4-7.14 3.15-11.22 5-13.82 6.27-37 16.75-42.25 14.34a23.11 23.11 0 0 1-6.32-5.13 1 1 0 0 1 1.14-1.65c5.59 2.29 9.55 1.45 14.2-.08l1-.34c9.37-3.09 14.2-4.77 30.76-12.08a97.55 97.55 0 0 1 16.26-5.93c4-1 6.42-1.63 7.71-4.34a6.65 6.65 0 0 0-.5-7.13c-1.53-1.87-4.07-2.57-7-1.9-3.22.75-4.7 3-6.41 4.49-2.4 2.05-5 4.16-17.19 8.65-27 10-34.58 10.61-45.21 3.43-9.84-6.69-15.15-13.23-15.15-16 0-2.13 5.45-5.7 8.71-7.84 1.33-.87 2.59-1.69 3.62-2.46 4.34-3.22 13-11.39 13.38-11.73 5.4-5.41 17.91-2.18 25 2.58a2.23 2.23 0 0 0 1.72.41 2.14 2.14 0 0 0 1.68-2.58c-4.2-17.46-.13-27.34 4-32.55a22.58 22.58 0 0 1 17.48-8.48c12.81 0 21.76 10 21.76 24.42 0 11-2.82 16.79-5.48 20.3a1.73 1.73 0 0 1-2.58.18 1.78 1.78 0 0 1-.24-2.2A24.61 24.61 0 0 0 290 114a16.58 16.58 0 0 0-16.84-16.67c-3.94 0-13.48 1.5-16.77 15.44a29.81 29.81 0 0 0-.34 11.07l.08.71c.9 7.38 15.3 12.51 27.23 15.51 11.36 2.85 13 6.22 8.84 19.63s3.11 26.23 5.7 29.57a78.3 78.3 0 0 1 8.31 12.47 93.8 93.8 0 0 1 6.62 16.48c2.17 6.79 4.05 12.65 10.63 21.22 11.07 14.4 17.66 48.64 15 78-.21 2.41-.53 4.29-.77 5.67-.43 2.53-.72 4.2.66 5.38s3.16.7 7.26-.63l3.43-1.09a109.33 109.33 0 0 1 12.58-2.8 2.15 2.15 0 0 0 1.59-1.16c3.43-6.91 3.85-15.22 4-22.47q0-1.31.06-2.79c.19-7.77.45-18.93-2.95-32a1 1 0 0 1 1.93-.64 93 93 0 0 1 6.66 25.55c2.55 22.58-1.9 32.09-1.94 32.17a1.61 1.61 0 0 0 .95 2.25 17.12 17.12 0 0 1 6.95 4.67c1.46 1.66.93 2.4-1.14 1.62a36.26 36.26 0 0 0-12.77-2.29c-10.4 0-18.09 4.95-21.51 9.19-3.19 3.94-3.7 7.67-3.83 11.27l-.06.05c-7.48-.75-12.94 1.21-17.47 6.21l-.08.09c-6.26 7.75-4 24.63-1.29 38.48 1.28 6.45 5.59 25.52 1.73 37.68zm96.1 10.07c-15.71 6.71-25.43 14.51-34 21.39-5.65 4.53-11 8.81-17.28 12.14-10.12 5.34-24.91 6.53-33.27-7.7-2.37-4-.71-9.86 1.58-17.95 3.05-10.75 7.23-25.46 3.71-44.65-.94-5.12-1.77-9.51-2.49-13.31C334 377 332.9 371.43 334 367c.63-2.45 3.43-3 5.87-3a20.83 20.83 0 0 1 2.63.19 29.51 29.51 0 0 0 7 12.1c5.7 5.86 13.63 8.83 23.56 8.85 2.1.17 25.94 1.55 36.54-22.4 1.46.18 3.65.7 4.3 2.3 1.28 3.19-.27 8.91-1.52 13.5-.9 3.31-1.68 6.16-1.63 8.37.31 16 11 22.78 25.83 32.16 1.79 1.13 3.66 2.31 5.55 3.54S445 425 445 426c-.52 4.79-20 13.16-26.45 15.91z",fill:"currentColor"},null,-1)];function wb(e,t){return _(),N("svg",_b,bb)}const Bd=Bn(yb,[["render",wb]]),Eb={},Ob={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},Nb=[O("path",{d:"M349.13 136.86c-40.32 0-57.36 19.24-85.44 19.24-28.79 0-50.75-19.1-85.69-19.1-34.2 0-70.67 20.88-93.83 56.45-32.52 50.16-27 144.63 25.67 225.11 18.84 28.81 44 61.12 77 61.47h.6c28.68 0 37.2-18.78 76.67-19h.6c38.88 0 46.68 18.89 75.24 18.89h.6c33-.35 59.51-36.15 78.35-64.85 13.56-20.64 18.6-31 29-54.35-76.19-28.92-88.43-136.93-13.08-178.34-23-28.8-55.32-45.48-85.79-45.48z",fill:"currentColor"},null,-1),O("path",{d:"M340.25 32c-24 1.63-52 16.91-68.4 36.86-14.88 18.08-27.12 44.9-22.32 70.91h1.92c25.56 0 51.72-15.39 67-35.11 14.72-18.77 25.88-45.37 21.8-72.66z",fill:"currentColor"},null,-1)];function Sb(e,t){return _(),N("svg",Ob,Nb)}const Hd=Bn(Eb,[["render",Sb]]),xb={class:"moonbase:product-downloads"},kb=["data-last","onClick"],Cb={class:"moonbase:sr-only"},Tb={class:"moonbase:sr-only"},Pb=O("svg",{fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})],-1),$b=["onClick"],Ib=he({__name:"ProductDownloads",props:{downloads:{}},setup(e){const t=e,n={[Bt.Universal]:()=>Ud,[Bt.Windows]:()=>Fd,[Bt.Linux]:()=>Bd,[Bt.Mac]:()=>Hd},{downloadProduct:r}=Ms(),o=X(()=>t.downloads.reduce((s,i)=>({...s,[i.platform]:(s[i.platform]||[]).concat({...i,icon:n[i.platform]})}),{}));return(s,i)=>(_(),N("span",xb,[(_(!0),N(Ce,null,Gt(o.value,(a,c,l)=>(_(),N(Ce,{key:c},[a.length===1?(_(),N("button",{key:0,type:"button",role:"button","data-last":l===Object.keys(o.value).length-1||void 0,onClick:u=>b(r)(a[0])},[O("span",Cb,K(c.toString()),1),(_(),xe(qi(a[0].icon()),{class:"h-5 w-5 text-white","aria-hidden":"true"}))],8,kb)):(_(),xe(b(ja),{key:1,as:"div","data-last":l===Object.keys(o.value).length-1||void 0,class:"moonbase:product-downloads-group"},{default:ye(()=>[B(b(Dd),null,{default:ye(()=>[O("span",Tb,K(c.toString()),1),(_(),xe(qi(a[0].icon()),{"aria-hidden":"true"})),Pb]),_:2},1024),B(xo,{name:"moonbase:scale"},{default:ye(()=>[B(b(Ad),{class:"moonbase:product-downloads-list"},{default:ye(()=>[(_(!0),N(Ce,null,Gt(a,u=>(_(),N("button",{key:u.key,type:"button",role:"button",onClick:d=>b(r)(u)},K(u.name),9,$b))),128))]),_:2},1024)]),_:2},1024)]),_:2},1032,["data-last"]))],64))),128))]))}}),Db={class:"moonbase:product-activations"},Ab=O("th",{scope:"col"}," Device ",-1),Vb=O("th",{scope:"col"}," Activation Method ",-1),Rb=O("th",{scope:"col"}," Last Online ",-1),jb={key:0,scope:"col"},Lb=[O("span",{class:"sr-only"},"Actions",-1)],Mb={key:0},Ub={colspan:"3"},Fb=O("td",null,null,-1),Bb={key:1},Hb=[O("td",{colspan:"3"}," No activations found ",-1)],Zb={key:0},qb=["onClick"],Wb=he({__name:"ProductActivations",props:{productId:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,revokeActivation:s}=Ms(),i=T(null);Re(async()=>{let l=await o(n.productId);for(i.value=l.items.map(u=>({...u,revoking:!1}));l.hasMore&&l.next;)l=await o(n.productId,l.next),i.value.push(...l.items.map(u=>({...u,revoking:!1})))});const a=X(()=>i.value&&i.value.some(l=>l.activationMethod===vi.Online));async function c(l){l.revoking=!0,await s(l),r("revoked",l),i.value&&i.value.splice(i.value.indexOf(l),1)}return(l,u)=>(_(),N("table",Db,[O("thead",null,[O("tr",null,[Ab,Vb,Rb,a.value?(_(),N("th",jb,Lb)):me("",!0)])]),O("tbody",null,[i.value?i.value.length===0?(_(),N("tr",Bb,Hb)):me("",!0):(_(),N("tr",Mb,[O("td",Ub,[B(Pt),Te(" Loading activations.. ")]),Fb])),(_(!0),N(Ce,null,Gt(i.value,d=>{var f;return _(),N("tr",{key:d.id},[O("td",null,K(d.name),1),O("td",null,K(d.activationMethod),1),O("td",null,K((f=d.lastValidatedAt)==null?void 0:f.toLocaleDateString()),1),a.value?(_(),N("td",Zb,[O("button",{class:"text-red-400 flex whitespace-nowrap items-center",onClick:m=>c(d)},[d.revoking?(_(),xe(Pt,{key:0})):me("",!0),Te(" Revoke ")],8,qb)])):me("",!0)])}),128))])]))}}),zb={class:"moonbase:products"},Kb=O("th",{scope:"col"}," Product ",-1),Gb=O("th",{scope:"col"}," Activations ",-1),Jb={key:0,scope:"col"},Yb={key:0},Xb=O("td",null,null,-1),Qb={key:1},e1=[O("td",{colspan:"3"}," No products found ",-1)],t1=["src"],n1={key:1,class:"moonbase:image-placeholder"},r1=O("span",{class:"moonbase:sr-only"},"View activations",-1),o1={key:0},s1={key:0},i1=he({__name:"Products",setup(e){const{getProducts:t}=Ms(),n=T(null);Re(async()=>{let o=await t();for(n.value=o.items;o.hasMore&&o.next;)o=await t(o.next),n.value.push(...o.items)});const r=X(()=>n.value&&n.value.some(o=>o.downloads));return(o,s)=>(_(),N("table",zb,[O("thead",null,[O("tr",null,[Kb,Gb,r.value?(_(),N("th",Jb," Downloads ")):me("",!0)])]),O("tbody",null,[n.value?n.value.length===0?(_(),N("tr",Qb,e1)):me("",!0):(_(),N("tr",Yb,[O("td",null,[B(Pt),Te(" Loading products.. ")]),Xb])),(_(!0),N(Ce,null,Gt(n.value||[],i=>(_(),N("tr",{key:i.id},[O("td",null,[O("div",null,[i.iconUrl?(_(),N("img",{key:0,src:i.iconUrl,alt:""},null,8,t1)):(_(),N("div",n1)),O("span",null,K(i.name),1)])]),B(b(ja),{as:"td"},{default:ye(()=>[B(b(Dd),{class:"moonbase:button","data-variant":"secondary"},{default:ye(()=>[r1,Te(" "+K(i.currentActivations)+" / "+K(i.maxActivations),1)]),_:2},1024),B(xo,{name:"moonbase:scale"},{default:ye(()=>[B(b(Ad),null,{default:ye(()=>[B(Wb,{"product-id":i.id},null,8,["product-id"])]),_:2},1024)]),_:2},1024)]),_:2},1024),r.value?(_(),N("td",o1,[i.currentVersion!=null?(_(),N("div",s1,[i.downloads?(_(),xe(Ib,{key:0,downloads:i.downloads},null,8,["downloads"])):me("",!0)])):me("",!0)])):me("",!0)]))),128))])]))}}),a1={class:"moonbase:redeem"},l1=["data-visible"],c1={key:1,class:"moonbase:redeem-voucher"},u1={key:0},d1={key:1},f1=O("span",null," Contains: ",-1),p1={class:"moonbase:redeem-voucher-products"},h1=["src"],m1={key:1,class:"moonbase:image-placeholder"},v1={key:0},g1={class:"moonbase:redeem-voucher-bundle"},y1=["src"],_1={key:1,class:"moonbase:image-placeholder"},b1={key:0},w1={class:"moonbase:redeem-voucher-bundle-products"},E1={class:"shrink-0"},O1=["src"],N1={key:1,class:"moonbase:image-placeholder"},S1=he({__name:"Redeem",setup(e){const{redeem:t}=ng(),n=T(!1),r=T(null),o=T(null),s=T("");async function i(){n.value=!0,o.value=null;try{r.value=await t(s.value)}catch(a){throw o.value=a,a}n.value=!1}return(a,c)=>(_(),N("div",a1,[B(xo,{mode:"out-in",name:"moonbase:slide-left"},{default:ye(()=>[r.value?(_(),N("div",c1,[O("h3",null,[Te(" You got: "),O("strong",null,K(r.value.name),1)]),r.value.description?(_(),N("h4",u1,K(r.value.description),1)):me("",!0),O("h4",null,[Te(" Code: "),O("strong",null,K(r.value.code),1)]),r.value.redeemsProducts.length>0?(_(),N("div",d1,[f1,O("div",p1,[(_(!0),N(Ce,null,Gt(r.value.redeemsProducts,({value:l,quantity:u})=>(_(),N("div",{key:l.id,class:"moonbase:redeem-voucher-product"},[O("div",null,[l.iconUrl?(_(),N("img",{key:0,src:l.iconUrl,alt:""},null,8,h1)):(_(),N("div",m1))]),O("div",null,[O("p",null,[Te(K(l.name)+" ",1),u!==1?(_(),N("span",v1,"x "+K(u),1)):me("",!0)]),O("p",null,K(l.tagline),1)])]))),128)),(_(!0),N(Ce,null,Gt(r.value.redeemsBundles,({value:l,quantity:u})=>(_(),N("div",{key:l.id},[O("div",g1,[O("div",null,[l.iconUrl?(_(),N("img",{key:0,src:l.iconUrl,alt:""},null,8,y1)):(_(),N("div",_1))]),O("div",null,[O("p",null,[Te(K(l.name)+" ",1),u!==1?(_(),N("span",b1,"x "+K(u),1)):me("",!0)]),O("p",null,K(l.tagline),1)])]),O("div",w1,[(_(!0),N(Ce,null,Gt(l.products,d=>(_(),N("div",{key:d.id,class:"moonbase:redeem-voucher-product"},[O("div",E1,[d.iconUrl?(_(),N("img",{key:0,src:d.iconUrl,alt:""},null,8,O1)):(_(),N("div",N1))]),O("div",null,[O("p",null,K(d.name),1),O("p",null,K(d.tagline),1)])]))),128))])]))),128))])])):me("",!0)])):(_(),xe(Hn,{key:0,handler:i},{default:ye(()=>{var l;return[B(gt,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=u=>s.value=u),label:"Voucher code",name:"code",required:""},null,8,["modelValue"]),B(Zn,{label:"Redeem",success:"Redeem",error:"Error"}),O("span",{class:"moonbase:error","data-visible":!!o.value||void 0},K((l=o.value)==null?void 0:l.message),9,l1)]}),_:1}))]),_:1})]))}}),x1={class:"moonbase:customer"},k1=he({__name:"Customer",props:{open:{type:Boolean}},setup(e){const t=Ae();function n(s){switch(s){case pe.ViewAccount:return 0;case pe.ViewProducts:return 1;case pe.RedeemVoucher:return 2}return 0}const r=T(n(t.intent));Xe(()=>t.intent,s=>{r.value=n(s)});function o(s){r.value=s}return(s,i)=>(_(),xe(ri,{open:s.open,onClose:i[0]||(i[0]=a=>b(t).reset())},{default:ye(()=>[O("div",x1,[B(b(t_),{"selected-index":r.value,onChange:o},{default:ye(()=>[B(b(n_),null,{default:ye(()=>[B(b(Ma),null,{default:ye(()=>[Te("Account")]),_:1}),B(b(Ma),null,{default:ye(()=>[Te(" Products ")]),_:1}),B(b(Ma),null,{default:ye(()=>[Te("Redeem")]),_:1})]),_:1}),B(b(r_),null,{default:ye(()=>[B(b(Ua),null,{default:ye(()=>[B(cb)]),_:1}),B(b(Ua),null,{default:ye(()=>[B(i1)]),_:1}),B(b(Ua),null,{default:ye(()=>[B(S1)]),_:1})]),_:1})]),_:1},8,["selected-index"])])]),_:1},8,["open"]))}}),C1={class:"moonbase:auto-activate"},T1={key:0,class:"moonbase:loader"},P1={key:1,class:"moonbase:loader"},$1={key:2,class:"moonbase:loader"},I1={key:3},D1={key:0,class:"moonbase:auto-activate-product"},A1=["src"],V1={key:1,class:"moonbase:image-placeholder"},R1={key:1,class:"moonbase:loader"},j1=[O("h3",null," Uh oh ",-1),O("p",null," This activation request was cancelled, open your app to try again. ",-1)],L1={key:2,class:"moonbase:loader"},M1={key:3,class:"moonbase:loader"},U1=[O("h3",null," Done! ",-1),O("p",null," Your product is activated. ",-1)],F1={key:4,class:"moonbase:auto-activate-content"},B1={key:0},H1={key:1},Z1=O("p",null," You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ",-1),q1={class:"moonbase:auto-activate-cta"},W1=["href"],z1={key:2,class:"moonbase:auto-activate-trial"},K1={class:"moonbase:auto-activate-cta"},G1=he({__name:"AutoActivate",setup(e){const t=Ae(),{user:n,loaded:r}=St(),o=t.getParameter("token"),{activationRequest:s,loading:i,fulfilling:a,completing:c,error:l,fulfillLicense:u,fulfillTrial:d,cancel:f}=tg(o);Xe(s,E=>{var S;!a.value&&!c.value&&(E==null?void 0:E.status)===Ht.Requested&&((S=E==null?void 0:E.licenseEligibility)!=null&&S.eligible)&&u()});function m(){f(),t.show(ke.Customer,pe.ViewProducts)}function y(){t.enqueue(ke.Activation,pe.ActivateProduct,t.parameters??void 0),t.show(ke.Authentication,pe.SignIn)}return(E,S)=>{var A,F,C,z;return _(),N("div",C1,[b(i)||!b(r)?(_(),N("div",T1,[B(Pt)])):b(l)?(_(),N("div",P1,K(b(l)),1)):b(s)?(_(),N("div",I1,[b(s).product?(_(),N("div",D1,[b(s).product.iconUrl?(_(),N("img",{key:0,src:b(s).product.iconUrl,alt:""},null,8,A1)):(_(),N("div",V1)),O("div",null,[O("h2",null,K(b(s).product.name),1),O("h3",null,K(b(s).product.tagline),1)])])):me("",!0),((A=b(s))==null?void 0:A.status)===b(Ht).Cancelled?(_(),N("div",R1,j1)):b(a)||b(c)?(_(),N("div",L1,[B(Pt),O("p",null,"Activating "+K(b(s).product.name)+"...",1)])):((F=b(s))==null?void 0:F.status)===b(Ht).Completed?(_(),N("div",M1,U1)):(_(),N("div",F1,[b(n)?(C=b(n).ownedProducts)!=null&&C.includes(b(s).product.id)?(_(),N("div",H1,[Z1,O("span",q1,[O("button",{role:"button",class:"moonbase:button",onClick:S[0]||(S[0]=$=>m())}," Licenses "),b(s).product&&b(s).product.website?(_(),N("a",{key:0,href:b(s).product.website,class:"moonbase:button"}," Purchase ",8,W1)):me("",!0)])])):me("",!0):(_(),N("div",B1,[Te(" Please sign in to use a license "),O("span",{class:"moonbase:auto-activate-cta"},[O("button",{role:"button",class:"moonbase:button",onClick:y}," Sign in ")])])),(z=b(s).trialEligibility)!=null&&z.eligible?(_(),N("div",z1,[Te(" You are eligible for a "+K(b(s).trialEligibility.numberOfDaysPerProduct)+" day trial ",1),b(s).trialEligibility.existing?(_(),N(Ce,{key:0},[Te(" of which you have "+K(b(s).trialEligibility.numberOfDaysRemaining)+" days remaining ",1)],64)):me("",!0),Te(". "),O("span",K1,[O("button",{role:"button",class:"moonbase:button",onClick:S[1]||(S[1]=$=>b(d)())}," Start trial ")])])):me("",!0)]))])):(_(),N("div",$1," Could not find activation request "))])}}}),J1={class:"moonbase:activation"},Y1=he({__name:"Activation",props:{open:{type:Boolean}},setup(e){const t=Ae();return(n,r)=>(_(),xe(ri,{open:n.open,onClose:r[0]||(r[0]=o=>b(t).reset())},{default:ye(()=>[O("div",J1,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(" Activate product ")]),_:1}),n.open&&b(t).intent===b(pe).ActivateProduct?(_(),xe(G1,{key:0})):me("",!0)])]),_:1},8,["open"]))}});function X1(e){const t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(e<1)return`${e} B`;const n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1);e=Number(e/1024**n);const r=t[n];return e>=10||e%1===0?`${e.toFixed(0)} ${r}`:`${e.toFixed(1)} ${r}`}const Q1={class:"moonbase:download-product"},ew={key:0,class:"moonbase:loader"},tw={key:1,class:"moonbase:loader"},nw={key:2,class:"moonbase:loader"},rw={key:3},ow={class:"moonbase:download-product-product"},sw=["src"],iw={key:1,class:"moonbase:image-placeholder"},aw={key:0},lw={key:0,class:"moonbase:download-product-content"},cw={key:1,class:"moonbase:download-product-content"},uw={key:2,class:"moonbase:download-product-content"},dw={key:0,role:"list"},fw={class:"moonbase:download-product-download-name"},pw=["onClick"],hw=O("span",{class:"moonbase:download-product-clicker"},null,-1),mw={class:"moonbase:download-product-download-description"},vw=O("span",null," |",-1),gw={key:1,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},yw=[O("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"},null,-1)],_w={key:1,class:"moonbase:loader"},bw=he({__name:"DownloadProduct",setup(e){const t=Ae(),{user:n,loaded:r}=St(),{getProduct:o,downloadProduct:s}=Ms(),i={[Bt.Universal]:()=>Ud,[Bt.Windows]:()=>Fd,[Bt.Linux]:()=>Bd,[Bt.Mac]:()=>Hd},a=T(null),c=T([]),l=T(null),u=T(!0),d=X(()=>t.getParameter("key")),f=X(()=>{var E,S;return(S=(E=a.value)==null?void 0:E.downloads)==null?void 0:S.filter(A=>!d.value||A.key===d.value)});Re(async()=>{const E=t.getParameter("product_id"),S=t.getParameter("version");if(!E){l.value="Link is broken";return}try{a.value=await o(E,S||void 0)}catch(A){l.value=A.message}u.value=!1});function m(){t.enqueue(ke.Download,pe.DownloadProduct,t.parameters??void 0),t.show(ke.Authentication,pe.SignIn)}async function y(E){c.value.push(E.key),await s(E),c.value=c.value.filter(S=>S!==E.key)}return(E,S)=>{var A,F;return _(),N("div",Q1,[u.value||!b(r)?(_(),N("div",ew,[B(Pt)])):l.value?(_(),N("div",tw,K(l.value),1)):a.value?(_(),N("div",rw,[O("div",ow,[a.value.iconUrl?(_(),N("img",{key:0,src:a.value.iconUrl,alt:""},null,8,sw)):(_(),N("div",iw)),O("div",null,[O("h2",null,[Te(K(a.value.name)+" ",1),O("span",null,"v"+K(a.value.version||a.value.currentVersion),1),a.value.prerelease?(_(),N("span",aw," (pre-release)")):me("",!0)]),O("h3",null,K(a.value.tagline),1)])]),a.value.downloadsNeedsUser&&!b(n)?(_(),N("div",lw,[Te(" Please sign in to download product "),O("span",{class:"moonbase:download-product-cta"},[O("button",{role:"button",class:"moonbase:button",onClick:m}," Sign in ")])])):a.value.downloadsNeedsOwnership&&!((A=b(n).ownedProducts)!=null&&A.includes(a.value.id))?(_(),N("div",cw," This product requires ownership to download ")):(_(),N("div",uw,[(F=a.value)!=null&&F.downloads&&a.value.downloads.length>0?(_(),N("ul",dw,[(_(!0),N(Ce,null,Gt(f.value,C=>(_(),N("li",{key:C.key},[O("div",null,[O("p",fw,[O("button",{onClick:z=>y(C)},[hw,Te(" "+K(C.name),1)],8,pw)]),O("p",mw,[(_(),xe(qi(i[C.platform]()),{"aria-hidden":"true"})),Te(" "+K(C.platform)+" ",1),vw,Te(" "+K(b(X1)(C.size)),1)])]),O("div",null,[c.value.includes(C.key)?(_(),xe(Pt,{key:0})):(_(),N("svg",gw,yw))])]))),128))])):(_(),N("div",_w," No downloadable files found "))]))])):(_(),N("div",nw," Could not find product "))])}}}),ww={class:"moonbase:download"},Ew=he({__name:"Download",props:{open:{type:Boolean}},setup(e){const t=Ae();return(n,r)=>(_(),xe(ri,{open:n.open,onClose:r[0]||(r[0]=o=>b(t).reset())},{default:ye(()=>[O("div",ww,[B(b(ei),{as:"h3"},{default:ye(()=>[Te(" Download product ")]),_:1}),n.open&&b(t).intent===b(pe).DownloadProduct?(_(),xe(bw,{key:0})):me("",!0)])]),_:1},8,["open"]))}}),Ow=he({__name:"App",setup(e){const t=$e(Ws),n=Ae();return(r,o)=>{var s;return _(),N(Ce,null,[(s=b(t))!=null&&s.toolbar.enabled?(_(),xe(Lg,{key:0})):me("",!0),B(ob,{open:b(n).active===b(ke).Cart},null,8,["open"]),B(m_,{open:b(n).active===b(ke).Authentication},null,8,["open"]),B(Y1,{open:b(n).active===b(ke).Activation},null,8,["open"]),B(Ew,{open:b(n).active===b(ke).Download},null,8,["open"]),B(k1,{open:b(n).active===b(ke).Customer},null,8,["open"])],64)}}});function oi(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Wa(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(oi(e)&&oi(n)){for(const r in e)if(n.hasOwnProperty(r)){const o=n[r];oi(o)&&oi(e[r])?e[r]=Wa(e[r],o):o!==void 0&&(e[r]=o)}}return Wa(e,...t)}class Nw{constructor(){Nr(this,"initialized",!1);Nr(this,"pinia");Nr(this,"storefront");Nr(this,"options")}async setup(t,n){if(document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}const r=document.createElement("div");if(r.id="moonbase",r.classList.add("moonbase"),document.body.append(r),this.options=Wa(Dg,n),this.storefront=rg(t),this.pinia=Cg(),Uv(Ow).use(this.storefront).use(this.pinia).provide(Ws,this.options).mount("#moonbase"),this.initialized=!0,window&&window.location){const s=new URLSearchParams(window.location.search),i=s.get("mb_intent");if(i&&Object.values(pe).includes(i)){const a=Object.fromEntries([...s.entries()].filter(([l])=>l.startsWith("mb_")).map(([l,u])=>[l.substring(3),u]));if(i===pe.Checkout&&a.complete)return;this[i](a);for(const l of Object.keys(a))s.delete(`mb_${l}`);const c=s.toString();window.history.replaceState(null,"",window.location.href.split("?")[0]+(c?`?${c}`:""))}}const o=Ae(this.pinia);this.storefront.onCheckoutClosed(s=>{s==="view_products"&&o.show(ke.Customer,pe.ViewProducts)})}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.SignIn,t)}sign_up(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!((r=this.options)!=null&&r.auth.enable.signUp))throw new Error("Sign ups are not enabled");Ae(this.pinia).show(ke.Authentication,pe.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Authentication,pe.ConfirmAccount,t)}confirm_email(){}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Ae(this.pinia);St(this.storefront).user.value?n.show(ke.Authentication,pe.ConfirmEmailChange,t):(n.show(ke.Authentication,pe.SignIn),n.enqueue(ke.Authentication,pe.ConfirmEmailChange,t))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=Ae(this.pinia);St(this.storefront).user.value?t.show(ke.Customer,pe.ViewAccount):(t.show(ke.Authentication,pe.SignIn),t.enqueue(ke.Customer,pe.ViewAccount))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Cart,pe.ViewCart)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Cart,pe.ViewCart,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Download,pe.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.token))throw new Error("You need to provide a token when activating a product");Ae(this.pinia).show(ke.Activation,pe.ActivateProduct,t)}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Ae(this.pinia).show(ke.Cart,pe.ViewCart)}async add_to_cart(t){var o,s,i,a;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(!(t!=null&&t.product_id)&&!(t!=null&&t.bundle_id))throw new Error("You need to provide a product or bundle ID when adding to cart");const n=ba(this.storefront);if(t!=null&&t.product_id){const c=Vu(t.product_id,this.storefront);if(c.value)n.addToCart(c.value,(o=c.value.variations)==null?void 0:o.find(l=>l.id===t.variation_id));else{await this.storefront.loadedStorefrontPromise;const l=Vu(t.product_id,this.storefront);if(l.value)n.addToCart(l.value,(s=l.value.variations)==null?void 0:s.find(u=>u.id===t.variation_id));else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const c=Au(t.bundle_id,this.storefront);if(c.value)n.addToCart(c.value,(i=c.value.variations)==null?void 0:i.find(l=>l.id===t.variation_id));else{await this.storefront.loadedStorefrontPromise;const l=Au(t.bundle_id,this.storefront);if(l.value)n.addToCart(l.value,(a=l.value.variations)==null?void 0:a.find(u=>u.id===t.variation_id));else throw new Error(`Bundle '${t.bundle_id}' not found`)}}Ae(this.pinia).show(ke.Cart,pe.AddToCart)}checkout(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;ba(this.storefront).checkout(`${window.location.pathname}?mb_intent=view_products`)}}const Zd=new Nw;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=Zd),wt.MoonbaseIntent=pe,wt.default=Zd,Object.defineProperties(wt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.20",
|
|
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.
|
|
25
|
+
"@moonbase.sh/vue": "0.2.20"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^18.14.2",
|