@moonbase.sh/storefront 0.3.7 → 0.3.8
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 +2 -2
- package/dist/moonbase.umd.cjs +2 -2
- package/package.json +2 -2
package/dist/moonbase.js
CHANGED
|
@@ -10028,7 +10028,7 @@ function $r(e) {
|
|
|
10028
10028
|
const a = `${r.type === "bundle" ? "b" : "p"}/${r.id}/${o.id}`;
|
|
10029
10029
|
let l = t.currentOrder.value.items.find((u) => u.id === a);
|
|
10030
10030
|
if (l)
|
|
10031
|
-
l.quantity += 1, !l.variation && o && (l.variation = o), l.type === "Product" && r.type === "product" && !l.product && (l.product = r), l.type === "Bundle" && r.type === "bundle" && !l.bundle && (l.bundle = r);
|
|
10031
|
+
l.quantity += 1, !l.variation && o && (l.variation = o), !l.price && o && (l.price = o.price), !l.appliedDiscount && o.discount && (l.appliedDiscount = o.discount), l.type === "Product" && r.type === "product" && !l.product && (l.product = r), l.type === "Bundle" && r.type === "bundle" && !l.bundle && (l.bundle = r);
|
|
10032
10032
|
else if (r.type === "bundle")
|
|
10033
10033
|
l = {
|
|
10034
10034
|
id: a,
|
|
@@ -16949,7 +16949,7 @@ function G2(e, t) {
|
|
|
16949
16949
|
const Me = /* @__PURE__ */ sr(Z2, [["render", G2]]), K2 = { class: "moonbase:about" }, X2 = /* @__PURE__ */ he({
|
|
16950
16950
|
__name: "About",
|
|
16951
16951
|
setup(e) {
|
|
16952
|
-
const t = Ne(), n = "0.3.
|
|
16952
|
+
const t = Ne(), n = "0.3.8";
|
|
16953
16953
|
return (r, o) => (g(), T("div", K2, [
|
|
16954
16954
|
o[2] || (o[2] = Mh('<svg viewBox="0 0 512 512" height="56px" width="56px"><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)),
|
|
16955
16955
|
w(b(pp), { as: "h3" }, {
|
package/dist/moonbase.umd.cjs
CHANGED
|
@@ -12,7 +12,7 @@ If this is a native custom element, make sure to exclude it from component resol
|
|
|
12
12
|
|
|
13
13
|
For more details, see https://link.vuejs.org/feature-flags.`)}}const Rt=rv;function qg(e){return Wg(e)}function Wg(e,t){Hg();const n=xs();n.__VUE__=!0,S.NODE_ENV!=="production"&&Od(n.__VUE_DEVTOOLS_GLOBAL_HOOK__,n);const{insert:r,remove:o,patchProp:s,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:f,setScopeId:h=ht,insertStaticContent:p}=e,_=(y,x,U,K=null,q=null,W=null,ie=void 0,oe=null,re=S.NODE_ENV!=="production"&&mn?!1:!!x.dynamicChildren)=>{if(y===x)return;y&&!no(y,x)&&(K=za(y),it(y,q,W,!0),y=null),x.patchFlag===-2&&(re=!1,x.dynamicChildren=null);const{type:X,ref:Ee,shapeFlag:le}=x;switch(X){case Fs:E(y,x,U,K);break;case ot:C(y,x,U,K);break;case Us:y==null?z(x,U,K,ie):S.NODE_ENV!=="production"&&Z(y,x,U,ie);break;case De:G(y,x,U,K,q,W,ie,oe,re);break;default:le&1?D(y,x,U,K,q,W,ie,oe,re):le&6?_e(y,x,U,K,q,W,ie,oe,re):le&64||le&128?X.process(y,x,U,K,q,W,ie,oe,re,bi):S.NODE_ENV!=="production"&&J("Invalid VNode type:",X,`(${typeof X})`)}Ee!=null&&q&&ra(Ee,y&&y.ref,W,x||y,!x)},E=(y,x,U,K)=>{if(y==null)r(x.el=a(x.children),U,K);else{const q=x.el=y.el;x.children!==y.children&&u(q,x.children)}},C=(y,x,U,K)=>{y==null?r(x.el=l(x.children||""),U,K):x.el=y.el},z=(y,x,U,K)=>{[y.el,y.anchor]=p(y.children,x,U,K,y.el,y.anchor)},Z=(y,x,U,K)=>{if(x.children!==y.children){const q=f(y.anchor);L(y),[x.el,x.anchor]=p(x.children,U,q,K)}else x.el=y.el,x.anchor=y.anchor},B=({el:y,anchor:x},U,K)=>{let q;for(;y&&y!==x;)q=f(y),r(y,U,K),y=q;r(x,U,K)},L=({el:y,anchor:x})=>{let U;for(;y&&y!==x;)U=f(y),o(y),y=U;o(x)},D=(y,x,U,K,q,W,ie,oe,re)=>{x.type==="svg"?ie="svg":x.type==="math"&&(ie="mathml"),y==null?m(x,U,K,q,W,ie,oe,re):P(y,x,q,W,ie,oe,re)},m=(y,x,U,K,q,W,ie,oe)=>{let re,X;const{props:Ee,shapeFlag:le,transition:ge,dirs:Se}=y;if(re=y.el=i(y.type,W,Ee&&Ee.is,Ee),le&8?c(re,y.children):le&16&&I(y.children,re,null,K,q,Yl(y,W),ie,oe),Se&&Kr(y,null,K,"created"),$(re,y,y.scopeId,ie,K),Ee){for(const Ke in Ee)Ke!=="value"&&!ws(Ke)&&s(re,Ke,null,Ee[Ke],W,K);"value"in Ee&&s(re,"value",null,Ee.value,W),(X=Ee.onVnodeBeforeMount)&&$n(X,K,y)}S.NODE_ENV!=="production"&&(Vi(re,"__vnode",y,!0),Vi(re,"__vueParentComponent",K,!0)),Se&&Kr(y,null,K,"beforeMount");const Le=zg(q,ge);Le&&ge.beforeEnter(re),r(re,x,U),((X=Ee&&Ee.onVnodeMounted)||Le||Se)&&Rt(()=>{X&&$n(X,K,y),Le&&ge.enter(re),Se&&Kr(y,null,K,"mounted")},q)},$=(y,x,U,K,q)=>{if(U&&h(y,U),K)for(let W=0;W<K.length;W++)h(y,K[W]);if(q){let W=q.subTree;if(S.NODE_ENV!=="production"&&W.patchFlag>0&&W.patchFlag&2048&&(W=Xl(W.children)||W),x===W||kf(W.type)&&(W.ssContent===x||W.ssFallback===x)){const ie=q.vnode;$(y,ie,ie.scopeId,ie.slotScopeIds,q.parent)}}},I=(y,x,U,K,q,W,ie,oe,re=0)=>{for(let X=re;X<y.length;X++){const Ee=y[X]=oe?kr(y[X]):gn(y[X]);_(null,Ee,x,U,K,q,W,ie,oe)}},P=(y,x,U,K,q,W,ie)=>{const oe=x.el=y.el;S.NODE_ENV!=="production"&&(oe.__vnode=x);let{patchFlag:re,dynamicChildren:X,dirs:Ee}=x;re|=y.patchFlag&16;const le=y.props||qe,ge=x.props||qe;let Se;if(U&&eo(U,!1),(Se=ge.onVnodeBeforeUpdate)&&$n(Se,U,x,y),Ee&&Kr(x,y,U,"beforeUpdate"),U&&eo(U,!0),S.NODE_ENV!=="production"&&mn&&(re=0,ie=!1,X=null),(le.innerHTML&&ge.innerHTML==null||le.textContent&&ge.textContent==null)&&c(oe,""),X?(A(y.dynamicChildren,X,oe,U,K,Yl(x,q),W),S.NODE_ENV!=="production"&&js(y,x)):ie||me(y,x,oe,null,U,K,Yl(x,q),W,!1),re>0){if(re&16)k(oe,le,ge,U,q);else if(re&2&&le.class!==ge.class&&s(oe,"class",null,ge.class,q),re&4&&s(oe,"style",le.style,ge.style,q),re&8){const Le=x.dynamicProps;for(let Ke=0;Ke<Le.length;Ke++){const Ze=Le[Ke],Qt=le[Ze],Wt=ge[Ze];(Wt!==Qt||Ze==="value")&&s(oe,Ze,Qt,Wt,q,U)}}re&1&&y.children!==x.children&&c(oe,x.children)}else!ie&&X==null&&k(oe,le,ge,U,q);((Se=ge.onVnodeUpdated)||Ee)&&Rt(()=>{Se&&$n(Se,U,x,y),Ee&&Kr(x,y,U,"updated")},K)},A=(y,x,U,K,q,W,ie)=>{for(let oe=0;oe<x.length;oe++){const re=y[oe],X=x[oe],Ee=re.el&&(re.type===De||!no(re,X)||re.shapeFlag&70)?d(re.el):U;_(re,X,Ee,null,K,q,W,ie,!0)}},k=(y,x,U,K,q)=>{if(x!==U){if(x!==qe)for(const W in x)!ws(W)&&!(W in U)&&s(y,W,x[W],null,q,K);for(const W in U){if(ws(W))continue;const ie=U[W],oe=x[W];ie!==oe&&W!=="value"&&s(y,W,oe,ie,q,K)}"value"in U&&s(y,"value",x.value,U.value,q)}},G=(y,x,U,K,q,W,ie,oe,re)=>{const X=x.el=y?y.el:a(""),Ee=x.anchor=y?y.anchor:a("");let{patchFlag:le,dynamicChildren:ge,slotScopeIds:Se}=x;S.NODE_ENV!=="production"&&(mn||le&2048)&&(le=0,re=!1,ge=null),Se&&(oe=oe?oe.concat(Se):Se),y==null?(r(X,U,K),r(Ee,U,K),I(x.children||[],U,Ee,q,W,ie,oe,re)):le>0&&le&64&&ge&&y.dynamicChildren?(A(y.dynamicChildren,ge,U,q,W,ie,oe),S.NODE_ENV!=="production"?js(y,x):(x.key!=null||q&&x===q.subTree)&&js(y,x,!0)):me(y,x,U,Ee,q,W,ie,oe,re)},_e=(y,x,U,K,q,W,ie,oe,re)=>{x.slotScopeIds=oe,y==null?x.shapeFlag&512?q.ctx.activate(x,U,K,ie,re):O(x,U,K,q,W,ie,re):M(y,x,re)},O=(y,x,U,K,q,W,ie)=>{const oe=y.component=uv(y,K,q);if(S.NODE_ENV!=="production"&&oe.type.__hmrId&&Bb(oe),S.NODE_ENV!=="production"&&(zi(y),Do(oe,"mount")),Vs(y)&&(oe.ctx.renderer=bi),S.NODE_ENV!=="production"&&Do(oe,"init"),dv(oe,!1,ie),S.NODE_ENV!=="production"&&Io(oe,"init"),oe.asyncDep){if(S.NODE_ENV!=="production"&&mn&&(y.el=null),q&&q.registerDep(oe,H,ie),!y.el){const re=oe.subTree=w(ot);C(null,re,x,U)}}else H(oe,y,x,U,q,W,ie);S.NODE_ENV!=="production"&&(Zi(),Io(oe,"mount"))},M=(y,x,U)=>{const K=x.component=y.component;if(tv(y,x,U))if(K.asyncDep&&!K.asyncResolved){S.NODE_ENV!=="production"&&zi(x),ne(K,x,U),S.NODE_ENV!=="production"&&Zi();return}else K.next=x,K.update();else x.el=y.el,K.vnode=x},H=(y,x,U,K,q,W,ie)=>{const oe=()=>{if(y.isMounted){let{next:le,bu:ge,u:Se,parent:Le,vnode:Ke}=y;{const Rn=bf(y);if(Rn){le&&(le.el=Ke.el,ne(y,le,ie)),Rn.asyncDep.then(()=>{y.isUnmounted||oe()});return}}let Ze=le,Qt;S.NODE_ENV!=="production"&&zi(le||y.vnode),eo(y,!1),le?(le.el=Ke.el,ne(y,le,ie)):le=Ke,ge&&Es(ge),(Qt=le.props&&le.props.onVnodeBeforeUpdate)&&$n(Qt,Le,le,Ke),eo(y,!0),S.NODE_ENV!=="production"&&Do(y,"render");const Wt=_f(y);S.NODE_ENV!=="production"&&Io(y,"render");const Vn=y.subTree;y.subTree=Wt,S.NODE_ENV!=="production"&&Do(y,"patch"),_(Vn,Wt,d(Vn.el),za(Vn),y,q,W),S.NODE_ENV!=="production"&&Io(y,"patch"),le.el=Wt.el,Ze===null&&nv(y,Wt.el),Se&&Rt(Se,q),(Qt=le.props&&le.props.onVnodeUpdated)&&Rt(()=>$n(Qt,Le,le,Ke),q),S.NODE_ENV!=="production"&&Sd(y),S.NODE_ENV!=="production"&&Zi()}else{let le;const{el:ge,props:Se}=x,{bm:Le,m:Ke,parent:Ze,root:Qt,type:Wt}=y,Vn=Ao(x);eo(y,!1),Le&&Es(Le),!Vn&&(le=Se&&Se.onVnodeBeforeMount)&&$n(le,Ze,x),eo(y,!0);{Qt.ce&&Qt.ce._injectChildStyle(Wt),S.NODE_ENV!=="production"&&Do(y,"render");const Rn=y.subTree=_f(y);S.NODE_ENV!=="production"&&Io(y,"render"),S.NODE_ENV!=="production"&&Do(y,"patch"),_(null,Rn,U,K,y,q,W),S.NODE_ENV!=="production"&&Io(y,"patch"),x.el=Rn.el}if(Ke&&Rt(Ke,q),!Vn&&(le=Se&&Se.onVnodeMounted)){const Rn=x;Rt(()=>$n(le,Ze,Rn),q)}(x.shapeFlag&256||Ze&&Ao(Ze.vnode)&&Ze.vnode.shapeFlag&256)&&y.a&&Rt(y.a,q),y.isMounted=!0,S.NODE_ENV!=="production"&&Yb(y),x=U=K=null}};y.scope.on();const re=y.effect=new zc(oe);y.scope.off();const X=y.update=re.run.bind(re),Ee=y.job=re.runIfDirty.bind(re);Ee.i=y,Ee.id=y.uid,re.scheduler=()=>Ki(Ee),eo(y,!0),S.NODE_ENV!=="production"&&(re.onTrack=y.rtc?le=>Es(y.rtc,le):void 0,re.onTrigger=y.rtg?le=>Es(y.rtg,le):void 0),X()},ne=(y,x,U)=>{x.component=y;const K=y.vnode.props;y.vnode=x,y.next=null,Ag(y,x.props,K,U),Bg(y,x.children,U),qn(),_d(y),Wn()},me=(y,x,U,K,q,W,ie,oe,re=!1)=>{const X=y&&y.children,Ee=y?y.shapeFlag:0,le=x.children,{patchFlag:ge,shapeFlag:Se}=x;if(ge>0){if(ge&128){He(X,le,U,K,q,W,ie,oe,re);return}else if(ge&256){fe(X,le,U,K,q,W,ie,oe,re);return}}Se&8?(Ee&16&&mi(X,q,W),le!==X&&c(U,le)):Ee&16?Se&16?He(X,le,U,K,q,W,ie,oe,re):mi(X,q,W,!0):(Ee&8&&c(U,""),Se&16&&I(le,U,K,q,W,ie,oe,re))},fe=(y,x,U,K,q,W,ie,oe,re)=>{y=y||So,x=x||So;const X=y.length,Ee=x.length,le=Math.min(X,Ee);let ge;for(ge=0;ge<le;ge++){const Se=x[ge]=re?kr(x[ge]):gn(x[ge]);_(y[ge],Se,U,null,q,W,ie,oe,re)}X>Ee?mi(y,q,W,!0,!1,le):I(x,U,K,q,W,ie,oe,re,le)},He=(y,x,U,K,q,W,ie,oe,re)=>{let X=0;const Ee=x.length;let le=y.length-1,ge=Ee-1;for(;X<=le&&X<=ge;){const Se=y[X],Le=x[X]=re?kr(x[X]):gn(x[X]);if(no(Se,Le))_(Se,Le,U,null,q,W,ie,oe,re);else break;X++}for(;X<=le&&X<=ge;){const Se=y[le],Le=x[ge]=re?kr(x[ge]):gn(x[ge]);if(no(Se,Le))_(Se,Le,U,null,q,W,ie,oe,re);else break;le--,ge--}if(X>le){if(X<=ge){const Se=ge+1,Le=Se<Ee?x[Se].el:K;for(;X<=ge;)_(null,x[X]=re?kr(x[X]):gn(x[X]),U,Le,q,W,ie,oe,re),X++}}else if(X>ge)for(;X<=le;)it(y[X],q,W,!0),X++;else{const Se=X,Le=X,Ke=new Map;for(X=Le;X<=ge;X++){const Ft=x[X]=re?kr(x[X]):gn(x[X]);Ft.key!=null&&(S.NODE_ENV!=="production"&&Ke.has(Ft.key)&&J("Duplicate keys found during update:",JSON.stringify(Ft.key),"Make sure keys are unique."),Ke.set(Ft.key,X))}let Ze,Qt=0;const Wt=ge-Le+1;let Vn=!1,Rn=0;const gi=new Array(Wt);for(X=0;X<Wt;X++)gi[X]=0;for(X=Se;X<=le;X++){const Ft=y[X];if(Qt>=Wt){it(Ft,q,W,!0);continue}let Ln;if(Ft.key!=null)Ln=Ke.get(Ft.key);else for(Ze=Le;Ze<=ge;Ze++)if(gi[Ze-Le]===0&&no(Ft,x[Ze])){Ln=Ze;break}Ln===void 0?it(Ft,q,W,!0):(gi[Ln-Le]=X+1,Ln>=Rn?Rn=Ln:Vn=!0,_(Ft,x[Ln],U,null,q,W,ie,oe,re),Qt++)}const lm=Vn?Zg(gi):So;for(Ze=lm.length-1,X=Wt-1;X>=0;X--){const Ft=Le+X,Ln=x[Ft],um=Ft+1<Ee?x[Ft+1].el:K;gi[X]===0?_(null,Ln,U,um,q,W,ie,oe,re):Vn&&(Ze<0||X!==lm[Ze]?ft(Ln,U,um,2):Ze--)}}},ft=(y,x,U,K,q=null)=>{const{el:W,type:ie,transition:oe,children:re,shapeFlag:X}=y;if(X&6){ft(y.component.subTree,x,U,K);return}if(X&128){y.suspense.move(x,U,K);return}if(X&64){ie.move(y,x,U,bi);return}if(ie===De){r(W,x,U);for(let le=0;le<re.length;le++)ft(re[le],x,U,K);r(y.anchor,x,U);return}if(ie===Us){B(y,x,U);return}if(K!==2&&X&1&&oe)if(K===0)oe.beforeEnter(W),r(W,x,U),Rt(()=>oe.enter(W),q);else{const{leave:le,delayLeave:ge,afterLeave:Se}=oe,Le=()=>r(W,x,U),Ke=()=>{le(W,()=>{Le(),Se&&Se()})};ge?ge(W,Le,Ke):Ke()}else r(W,x,U)},it=(y,x,U,K=!1,q=!1)=>{const{type:W,props:ie,ref:oe,children:re,dynamicChildren:X,shapeFlag:Ee,patchFlag:le,dirs:ge,cacheIndex:Se}=y;if(le===-2&&(q=!1),oe!=null&&ra(oe,null,U,y,!0),Se!=null&&(x.renderCache[Se]=void 0),Ee&256){x.ctx.deactivate(y);return}const Le=Ee&1&&ge,Ke=!Ao(y);let Ze;if(Ke&&(Ze=ie&&ie.onVnodeBeforeUnmount)&&$n(Ze,x,y),Ee&6)E3(y.component,U,K);else{if(Ee&128){y.suspense.unmount(U,K);return}Le&&Kr(y,null,x,"beforeUnmount"),Ee&64?y.type.remove(y,x,U,bi,K):X&&!X.hasOnce&&(W!==De||le>0&&le&64)?mi(X,x,U,!1,!0):(W===De&&le&384||!q&&Ee&16)&&mi(re,x,U),K&&Ge(y)}(Ke&&(Ze=ie&&ie.onVnodeUnmounted)||Le)&&Rt(()=>{Ze&&$n(Ze,x,y),Le&&Kr(y,null,x,"unmounted")},U)},Ge=y=>{const{type:x,el:U,anchor:K,transition:q}=y;if(x===De){S.NODE_ENV!=="production"&&y.patchFlag>0&&y.patchFlag&2048&&q&&!q.persisted?y.children.forEach(ie=>{ie.type===ot?o(ie.el):Ge(ie)}):Tt(U,K);return}if(x===Us){L(y);return}const W=()=>{o(U),q&&!q.persisted&&q.afterLeave&&q.afterLeave()};if(y.shapeFlag&1&&q&&!q.persisted){const{leave:ie,delayLeave:oe}=q,re=()=>ie(U,W);oe?oe(y.el,W,re):re()}else W()},Tt=(y,x)=>{let U;for(;y!==x;)U=f(y),o(y),y=U;o(x)},E3=(y,x,U)=>{S.NODE_ENV!=="production"&&y.type.__hmrId&&Hb(y);const{bum:K,scope:q,job:W,subTree:ie,um:oe,m:re,a:X}=y;gf(re),gf(X),K&&Es(K),q.stop(),W&&(W.flags|=8,it(ie,y,x,U)),oe&&Rt(oe,x),Rt(()=>{y.isUnmounted=!0},x),x&&x.pendingBranch&&!x.isUnmounted&&y.asyncDep&&!y.asyncResolved&&y.suspenseId===x.pendingId&&(x.deps--,x.deps===0&&x.resolve()),S.NODE_ENV!=="production"&&Kb(y)},mi=(y,x,U,K=!1,q=!1,W=0)=>{for(let ie=W;ie<y.length;ie++)it(y[ie],x,U,K,q)},za=y=>{if(y.shapeFlag&6)return za(y.component.subTree);if(y.shapeFlag&128)return y.suspense.next();const x=f(y.anchor||y.el),U=x&&x[Pd];return U?f(U):x};let rc=!1;const am=(y,x,U)=>{y==null?x._vnode&&it(x._vnode,null,null,!0):_(x._vnode||null,y,x,null,null,null,U),x._vnode=y,rc||(rc=!0,_d(),wd(),rc=!1)},bi={p:_,um:it,m:ft,r:Ge,mt:O,mc:I,pc:me,pbc:A,n:za,o:e};return{render:am,hydrate:void 0,createApp:Cg(am)}}function Yl({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 eo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function zg(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function js(e,t,n=!1){const r=e.children,o=t.children;if(be(r)&&be(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]=kr(o[s]),a.el=i.el),!n&&a.patchFlag!==-2&&js(i,a)),a.type===Fs&&(a.el=i.el),S.NODE_ENV!=="production"&&a.type===ot&&!a.el&&(a.el=i.el)}}function Zg(e){const t=e.slice(),n=[0];let r,o,s,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(o=n[n.length-1],e[o]<u){t[r]=o,n.push(r);continue}for(s=0,i=n.length-1;s<i;)a=s+i>>1,e[n[a]]<u?s=a+1:i=a;u<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 bf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bf(t)}function gf(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const Yg=Symbol.for("v-scx"),Gg=()=>{{const e=ve(Yg);return e||S.NODE_ENV!=="production"&&J("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Zt(e,t){return Gl(e,null,t)}function Je(e,t,n){return S.NODE_ENV!=="production"&&!ye(t)&&J("`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."),Gl(e,t,n)}function Gl(e,t,n=qe){const{immediate:r,deep:o,flush:s,once:i}=n;S.NODE_ENV!=="production"&&!t&&(r!==void 0&&J('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&J('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&J('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const a=rt({},n);S.NODE_ENV!=="production"&&(a.onWarn=J);const l=t&&r||!t&&s!=="post";let u;if(Ws){if(s==="sync"){const h=Gg();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=ht,h.resume=ht,h.pause=ht,h}}const c=lt;a.call=(h,p,_)=>pn(h,c,p,_);let d=!1;s==="post"?a.scheduler=h=>{Rt(h,c&&c.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,p)=>{p?h():Ki(h)}),a.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=Db(e,t,a);return Ws&&(u?u.push(f):l&&f()),f}function Kg(e,t,n){const r=this.proxy,o=Xe(e)?e.includes(".")?vf(r,e):()=>r[e]:e.bind(r,r);let s;ye(t)?s=t:(s=t.handler,n=t);const i=qs(this),a=Gl(o,s.bind(r),n);return i(),a}function vf(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}}const Xg=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${At(t)}Modifiers`]||e[`${br(t)}Modifiers`];function Jg(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||qe;if(S.NODE_ENV!=="production"){const{emitsOptions:c,propsOptions:[d]}=e;if(c)if(!(t in c))(!d||!(Wr(At(t))in d))&&J(`Component emitted event "${t}" but it is neither declared in the emits option nor as an "${Wr(At(t))}" prop.`);else{const f=c[t];ye(f)&&(f(...n)||J(`Invalid event arguments: event validation failed for event "${t}".`))}}let o=n;const s=t.startsWith("update:"),i=s&&Xg(r,t.slice(7));if(i&&(i.trim&&(o=n.map(c=>Xe(c)?c.trim():c)),i.number&&(o=n.map(W0))),S.NODE_ENV!=="production"&&Qb(e,t,o),S.NODE_ENV!=="production"){const c=t.toLowerCase();c!==t&&r[Wr(c)]&&J(`Event "${c}" is emitted in component ${fa(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 "${br(t)}" instead of "${t}".`)}let a,l=r[a=Wr(t)]||r[a=Wr(At(t))];!l&&s&&(l=r[a=Wr(br(t))]),l&&pn(l,e,6,o);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,pn(u,e,6,o)}}function yf(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(!ye(e)){const l=u=>{const c=yf(u,t,!0);c&&(a=!0,rt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(Fe(e)&&r.set(e,null),null):(be(s)?s.forEach(l=>i[l]=null):rt(i,s),Fe(e)&&r.set(e,i),i)}function aa(e,t){return!e||!_s(t)?!1:(t=t.slice(2).replace(/Once$/,""),je(e,t[0].toLowerCase()+t.slice(1))||je(e,br(t))||je(e,t))}let Kl=!1;function la(){Kl=!0}function _f(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[s],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:d,data:f,setupState:h,ctx:p,inheritAttrs:_}=e,E=Qi(e);let C,z;S.NODE_ENV!=="production"&&(Kl=!1);try{if(n.shapeFlag&4){const L=o||r,D=S.NODE_ENV!=="production"&&h.__isScriptSetup?new Proxy(L,{get(m,$,I){return J(`Property '${String($)}' was accessed via 'this'. Avoid using 'this' in templates.`),Reflect.get(m,$,I)}}):L;C=gn(u.call(D,L,c,S.NODE_ENV!=="production"?Cn(d):d,h,f,p)),z=a}else{const L=t;S.NODE_ENV!=="production"&&a===d&&la(),C=gn(L.length>1?L(S.NODE_ENV!=="production"?Cn(d):d,S.NODE_ENV!=="production"?{get attrs(){return la(),Cn(a)},slots:i,emit:l}:{attrs:a,slots:i,emit:l}):L(S.NODE_ENV!=="production"?Cn(d):d,null)),z=t.props?a:Qg(a)}}catch(L){Bs.length=0,$s(L,e,1),C=w(ot)}let Z=C,B;if(S.NODE_ENV!=="production"&&C.patchFlag>0&&C.patchFlag&2048&&([Z,B]=wf(C)),z&&_!==!1){const L=Object.keys(z),{shapeFlag:D}=Z;if(L.length){if(D&7)s&&L.some(Di)&&(z=ev(z,s)),Z=bn(Z,z,!1,!0);else if(S.NODE_ENV!=="production"&&!Kl&&Z.type!==ot){const m=Object.keys(a),$=[],I=[];for(let P=0,A=m.length;P<A;P++){const k=m[P];_s(k)?Di(k)||$.push(k[2].toLowerCase()+k.slice(3)):I.push(k)}I.length&&J(`Extraneous non-props attributes (${I.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),$.length&&J(`Extraneous non-emits event listeners (${$.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&&(S.NODE_ENV!=="production"&&!Ef(Z)&&J("Runtime directive used on component with non-element root node. The directives will not function as intended."),Z=bn(Z,null,!1,!0),Z.dirs=Z.dirs?Z.dirs.concat(n.dirs):n.dirs),n.transition&&(S.NODE_ENV!=="production"&&!Ef(Z)&&J("Component inside <Transition> renders non-element root node that cannot be animated."),Ms(Z,n.transition)),S.NODE_ENV!=="production"&&B?B(Z):C=Z,Qi(E),C}const wf=e=>{const t=e.children,n=e.dynamicChildren,r=Xl(t,!1);if(r){if(S.NODE_ENV!=="production"&&r.patchFlag>0&&r.patchFlag&2048)return wf(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[gn(r),i]};function Xl(e,t=!0){let n;for(let r=0;r<e.length;r++){const o=e[r];if(to(o)){if(o.type!==ot||o.children==="v-if"){if(n)return;if(n=o,S.NODE_ENV!=="production"&&t&&n.patchFlag>0&&n.patchFlag&2048)return Xl(n.children)}}else return}return n}const Qg=e=>{let t;for(const n in e)(n==="class"||n==="style"||_s(n))&&((t||(t={}))[n]=e[n]);return t},ev=(e,t)=>{const n={};for(const r in e)(!Di(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n},Ef=e=>e.shapeFlag&7||e.type===ot;function tv(e,t,n){const{props:r,children:o,component:s}=e,{props:i,children:a,patchFlag:l}=t,u=s.emitsOptions;if(S.NODE_ENV!=="production"&&(o||a)&&mn||t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?xf(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let d=0;d<c.length;d++){const f=c[d];if(i[f]!==r[f]&&!aa(u,f))return!0}}}else return(o||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?xf(r,i,u):!0:!!i;return!1}function xf(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]&&!aa(n,s))return!0}return!1}function nv({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 kf=e=>e.__isSuspense;function rv(e,t){t&&t.pendingBranch?be(e)?t.effects.push(...e):t.effects.push(e):yd(e)}const De=Symbol.for("v-fgt"),Fs=Symbol.for("v-txt"),ot=Symbol.for("v-cmt"),Us=Symbol.for("v-stc"),Bs=[];let Yt=null;function g(e=!1){Bs.push(Yt=e?null:[])}function ov(){Bs.pop(),Yt=Bs[Bs.length-1]||null}let Hs=1;function Of(e,t=!1){Hs+=e,e<0&&Yt&&t&&(Yt.hasOnce=!0)}function Sf(e){return e.dynamicChildren=Hs>0?Yt||So:null,ov(),Hs>0&&Yt&&Yt.push(e),e}function T(e,t,n,r,o,s){return Sf(j(e,t,n,r,o,s,!0))}function Q(e,t,n,r,o){return Sf(w(e,t,n,r,o,!0))}function to(e){return e?e.__v_isVNode===!0:!1}function no(e,t){if(S.NODE_ENV!=="production"&&t.shapeFlag&6&&e.component){const n=Xi.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 sv=(...e)=>Cf(...e),Nf=({key:e})=>e??null,ua=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Xe(e)||Ye(e)||ye(e)?{i:mt,r:e,k:t,f:!!n}:e:null);function j(e,t=null,n=null,r=0,o=null,s=e===De?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Nf(t),ref:t&&ua(t),scopeId:Cd,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:mt};return a?(Jl(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Xe(n)?8:16),S.NODE_ENV!=="production"&&l.key!==l.key&&J("VNode created with invalid key (NaN). VNode type:",l.type),Hs>0&&!i&&Yt&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&Yt.push(l),l}const w=S.NODE_ENV!=="production"?sv:Cf;function Cf(e,t=null,n=null,r=0,o=null,s=!1){if((!e||e===Wd)&&(S.NODE_ENV!=="production"&&!e&&J(`Invalid vnode type when creating vnode: ${e}.`),e=ot),to(e)){const a=bn(e,t,!0);return n&&Jl(a,n),Hs>0&&!s&&Yt&&(a.shapeFlag&6?Yt[Yt.indexOf(e)]=a:Yt.push(a)),a.patchFlag=-2,a}if(Vf(e)&&(e=e.__vccOpts),t){t=iv(t);let{class:a,style:l}=t;a&&!Xe(a)&&(t.class=ks(a)),Fe(l)&&(Co(l)&&!be(l)&&(l=rt({},l)),t.style=Ri(l))}const i=Xe(e)?1:kf(e)?128:$d(e)?64:Fe(e)?4:ye(e)?2:0;return S.NODE_ENV!=="production"&&i&4&&Co(e)&&(e=ke(e),J("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`.",`
|
|
14
14
|
Component that was made reactive: `,e)),j(e,t,n,r,o,i,s,!0)}function iv(e){return e?Co(e)||sf(e)?rt({},e):e:null}function bn(e,t,n=!1,r=!1){const{props:o,ref:s,patchFlag:i,children:a,transition:l}=e,u=t?Ql(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Nf(u),ref:t&&t.ref?n&&s?be(s)?s.concat(ua(t)):[s,ua(t)]:ua(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:S.NODE_ENV!=="production"&&i===-1&&be(a)?a.map(Tf):a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==De?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bn(e.ssContent),ssFallback:e.ssFallback&&bn(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Ms(c,l.clone(c)),c}function Tf(e){const t=bn(e);return be(e.children)&&(t.children=e.children.map(Tf)),t}function V(e=" ",t=0){return w(Fs,null,e,t)}function Pf(e,t){const n=w(Us,null,e);return n.staticCount=t,n}function de(e="",t=!1){return t?(g(),Q(ot,null,e)):w(ot,null,e)}function gn(e){return e==null||typeof e=="boolean"?w(ot):be(e)?w(De,null,e.slice()):to(e)?kr(e):w(Fs,null,String(e))}function kr(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bn(e)}function Jl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(be(t))n=16;else if(typeof t=="object")if(r&65){const o=t.default;o&&(o._c&&(o._d=!1),Jl(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!sf(t)?t._ctx=mt:o===3&&mt&&(mt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ye(t)?(t={default:t,_ctx:mt},n=32):(t=String(t),r&64?(n=16,t=[V(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ql(...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=ks([t.class,r.class]));else if(o==="style")t.style=Ri([t.style,r.style]);else if(_s(o)){const s=t[o],i=r[o];i&&s!==i&&!(be(s)&&s.includes(i))&&(t[o]=s?[].concat(s,i):i)}else o!==""&&(t[o]=r[o])}return t}function $n(e,t,n,r=null){pn(e,t,7,[n,r])}const av=nf();let lv=0;function uv(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||av,s={uid:lv++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Hc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:lf(r,o),emitsOptions:yf(r,o),emit:null,emitted:null,propsDefaults:qe,inheritAttrs:r.inheritAttrs,ctx:qe,data:qe,props:qe,attrs:qe,slots:qe,refs:qe,setupState:qe,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 S.NODE_ENV!=="production"?s.ctx=vg(s):s.ctx={_:s},s.root=t?t.root:s,s.emit=Jg.bind(null,s),e.ce&&e.ce(s),s}let lt=null;const ca=()=>lt||mt;let da,eu;{const e=xs(),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)}};da=t("__VUE_INSTANCE_SETTERS__",n=>lt=n),eu=t("__VUE_SSR_SETTERS__",n=>Ws=n)}const qs=e=>{const t=lt;return da(e),e.scope.on(),()=>{e.scope.off(),da(t)}},$f=()=>{lt&<.scope.off(),da(null)},cv=Bn("slot,component");function tu(e,{isNativeTag:t}){(cv(e)||t(e))&&J("Do not use built-in or reserved HTML elements as component id: "+e)}function Af(e){return e.vnode.shapeFlag&4}let Ws=!1;function dv(e,t=!1,n=!1){t&&eu(t);const{props:r,children:o}=e.vnode,s=Af(e);Pg(e,r,s,t),Ug(e,o,n);const i=s?fv(e,t):void 0;return t&&eu(!1),i}function fv(e,t){var n;const r=e.type;if(S.NODE_ENV!=="production"){if(r.name&&tu(r.name,e.appContext.config),r.components){const s=Object.keys(r.components);for(let i=0;i<s.length;i++)tu(s[i],e.appContext.config)}if(r.directives){const s=Object.keys(r.directives);for(let i=0;i<s.length;i++)Td(s[i])}r.compilerOptions&&hv()&&J('"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,Gd),S.NODE_ENV!=="production"&&yg(e);const{setup:o}=r;if(o){qn();const s=e.setupContext=o.length>1?mv(e):null,i=qs(e),a=To(o,e,0,[S.NODE_ENV!=="production"?Cn(e.props):e.props,s]),l=hl(a);if(Wn(),i(),(l||e.sp)&&!Ao(e)&&Hd(e),l){if(a.then($f,$f),t)return a.then(u=>{Df(e,u,t)}).catch(u=>{$s(u,e,0)});if(e.asyncDep=a,S.NODE_ENV!=="production"&&!e.suspense){const u=(n=r.name)!=null?n:"Anonymous";J(`Component <${u}>: 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 Df(e,a,t)}else If(e,t)}function Df(e,t,n){ye(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Fe(t)?(S.NODE_ENV!=="production"&&to(t)&&J("setup() should not return VNodes directly - return a render function instead."),S.NODE_ENV!=="production"&&(e.devtoolsRawSetupState=t),e.setupState=hd(t),S.NODE_ENV!=="production"&&_g(e)):S.NODE_ENV!=="production"&&t!==void 0&&J(`setup() should return an object. Received: ${t===null?"null":typeof t}`),If(e,n)}const hv=()=>!0;function If(e,t,n){const r=e.type;e.render||(e.render=r.render||ht);{const o=qs(e);qn();try{Eg(e)}finally{Wn(),o()}}S.NODE_ENV!=="production"&&!r.render&&e.render===ht&&!t&&(r.template?J('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".'):J("Component is missing template or render function: ",r))}const Mf=S.NODE_ENV!=="production"?{get(e,t){return la(),pt(e,"get",""),e[t]},set(){return J("setupContext.attrs is readonly."),!1},deleteProperty(){return J("setupContext.attrs is readonly."),!1}}:{get(e,t){return pt(e,"get",""),e[t]}};function pv(e){return new Proxy(e.slots,{get(t,n){return pt(e,"get","$slots"),t[n]}})}function mv(e){const t=n=>{if(S.NODE_ENV!=="production"&&(e.exposed&&J("expose() should be called only once per setup()."),n!=null)){let r=typeof n;r==="object"&&(be(n)?r="array":Ye(n)&&(r="ref")),r!=="object"&&J(`expose() should be passed a plain object, received ${r}.`)}e.exposed=n||{}};if(S.NODE_ENV!=="production"){let n,r;return Object.freeze({get attrs(){return n||(n=new Proxy(e.attrs,Mf))},get slots(){return r||(r=pv(e))},get emit(){return(o,...s)=>e.emit(o,...s)},expose:t})}else return{attrs:new Proxy(e.attrs,Mf),slots:e.slots,emit:e.emit,expose:t}}function nu(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(hd(vr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Jr)return Jr[n](e)},has(t,n){return n in t||n in Jr}})):e.proxy}const bv=/(?:^|[-_])(\w)/g,gv=e=>e.replace(bv,t=>t.toUpperCase()).replace(/[-_]/g,"");function ru(e,t=!0){return ye(e)?e.displayName||e.name:e.name||t&&e.__name}function fa(e,t,n=!1){let r=ru(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?gv(r):n?"App":"Anonymous"}function Vf(e){return ye(e)&&"__vccOpts"in e}const se=(e,t)=>{const n=$b(e,t,Ws);if(S.NODE_ENV!=="production"){const r=ca();r&&r.appContext.config.warnRecursiveComputed&&(n._warnRecursive=!0)}return n};function ut(e,t,n){const r=arguments.length;return r===2?Fe(t)&&!be(t)?to(t)?w(e,null,[t]):w(e,t):w(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&to(n)&&(n=[n]),w(e,t,n))}function vv(){if(S.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 Fe(d)?d.__isVue?["div",e,"VueInstance"]:Ye(d)?["div",{},["span",e,c(d)],"<",a("_value"in d?d._value:d),">"]:hn(d)?["div",{},["span",e,It(d)?"ShallowReactive":"Reactive"],"<",a(d),`>${Zn(d)?" (readonly)":""}`]:Zn(d)?["div",{},["span",e,It(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",ke(d.props))),d.setupState!==qe&&f.push(i("setup",d.setupState)),d.data!==qe&&f.push(i("data",ke(d.data)));const h=l(d,"computed");h&&f.push(i("computed",h));const p=l(d,"inject");return p&&f.push(i("injected",p)),f.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),f}function i(d,f){return f=rt({},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(h=>["div",{},["span",r,h+": "],a(f[h],!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]:Fe(d)?["object",{object:f?ke(d):d}]:["span",n,String(d)]}function l(d,f){const h=d.type;if(ye(h))return;const p={};for(const _ in d.ctx)u(h,_,f)&&(p[_]=d.ctx[_]);return p}function u(d,f,h){const p=d[h];if(be(p)&&p.includes(f)||Fe(p)&&f in p||d.extends&&u(d.extends,f,h)||d.mixins&&d.mixins.some(_=>u(_,f,h)))return!0}function c(d){return It(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(o):window.devtoolsFormatters=[o]}const Rf="3.5.13",Gn=S.NODE_ENV!=="production"?J:ht;var An={};let ou;const Lf=typeof window<"u"&&window.trustedTypes;if(Lf)try{ou=Lf.createPolicy("vue",{createHTML:e=>e})}catch(e){An.NODE_ENV!=="production"&&Gn(`Error creating trusted types policy: ${e}`)}const jf=ou?e=>ou.createHTML(e):e=>e,yv="http://www.w3.org/2000/svg",_v="http://www.w3.org/1998/Math/MathML",Kn=typeof document<"u"?document:null,Ff=Kn&&Kn.createElement("template"),wv={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"?Kn.createElementNS(yv,e):t==="mathml"?Kn.createElementNS(_v,e):n?Kn.createElement(e,{is:n}):Kn.createElement(e);return e==="select"&&r&&r.multiple!=null&&o.setAttribute("multiple",r.multiple),o},createText:e=>Kn.createTextNode(e),createComment:e=>Kn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Kn.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{Ff.innerHTML=jf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Ff.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Or="transition",zs="animation",Zs=Symbol("_vtc"),Uf={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},Ev=rt({},Rd,Uf),Ys=(e=>(e.displayName="Transition",e.props=Ev,e))((e,{slots:t})=>ut(og,xv(e),t)),ro=(e,t=[])=>{be(e)?e.forEach(n=>n(...t)):e&&e(...t)},Bf=e=>e?be(e)?e.some(t=>t.length>1):e.length>1:!1;function xv(e){const t={};for(const k in e)k in Uf||(t[k]=e[k]);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:l=s,appearActiveClass:u=i,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,p=kv(o),_=p&&p[0],E=p&&p[1],{onBeforeEnter:C,onEnter:z,onEnterCancelled:Z,onLeave:B,onLeaveCancelled:L,onBeforeAppear:D=C,onAppear:m=z,onAppearCancelled:$=Z}=t,I=(k,G,_e,O)=>{k._enterCancelled=O,oo(k,G?c:a),oo(k,G?u:i),_e&&_e()},P=(k,G)=>{k._isLeaving=!1,oo(k,d),oo(k,h),oo(k,f),G&&G()},A=k=>(G,_e)=>{const O=k?m:z,M=()=>I(G,k,_e);ro(O,[G,M]),Hf(()=>{oo(G,k?l:s),Xn(G,k?c:a),Bf(O)||qf(G,r,_,M)})};return rt(t,{onBeforeEnter(k){ro(C,[k]),Xn(k,s),Xn(k,i)},onBeforeAppear(k){ro(D,[k]),Xn(k,l),Xn(k,u)},onEnter:A(!1),onAppear:A(!0),onLeave(k,G){k._isLeaving=!0;const _e=()=>P(k,G);Xn(k,d),k._enterCancelled?(Xn(k,f),Zf()):(Zf(),Xn(k,f)),Hf(()=>{k._isLeaving&&(oo(k,d),Xn(k,h),Bf(B)||qf(k,r,E,_e))}),ro(B,[k,_e])},onEnterCancelled(k){I(k,!1,void 0,!0),ro(Z,[k])},onAppearCancelled(k){I(k,!0,void 0,!0),ro($,[k])},onLeaveCancelled(k){P(k),ro(L,[k])}})}function kv(e){if(e==null)return null;if(Fe(e))return[su(e.enter),su(e.leave)];{const t=su(e);return[t,t]}}function su(e){const t=z0(e);return An.NODE_ENV!=="production"&&Lb(t,"<transition> explicit duration"),t}function Xn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Zs]||(e[Zs]=new Set)).add(t)}function oo(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Zs];n&&(n.delete(t),n.size||(e[Zs]=void 0))}function Hf(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Ov=0;function qf(e,t,n,r){const o=e._endId=++Ov,s=()=>{o===e._endId&&r()};if(n!=null)return setTimeout(s,n);const{type:i,timeout:a,propCount:l}=Sv(e,t);if(!i)return r();const u=i+"end";let c=0;const d=()=>{e.removeEventListener(u,f),s()},f=h=>{h.target===e&&++c>=l&&d()};setTimeout(()=>{c<l&&d()},a+1),e.addEventListener(u,f)}function Sv(e,t){const n=window.getComputedStyle(e),r=p=>(n[p]||"").split(", "),o=r(`${Or}Delay`),s=r(`${Or}Duration`),i=Wf(o,s),a=r(`${zs}Delay`),l=r(`${zs}Duration`),u=Wf(a,l);let c=null,d=0,f=0;t===Or?i>0&&(c=Or,d=i,f=s.length):t===zs?u>0&&(c=zs,d=u,f=l.length):(d=Math.max(i,u),c=d>0?i>u?Or:zs:null,f=c?c===Or?s.length:l.length:0);const h=c===Or&&/\b(transform|all)(,|$)/.test(r(`${Or}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:h}}function Wf(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>zf(n)+zf(e[r])))}function zf(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Zf(){return document.body.offsetHeight}function Nv(e,t,n){const r=e[Zs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Yf=Symbol("_vod"),Cv=Symbol("_vsh"),Tv=Symbol(An.NODE_ENV!=="production"?"CSS_VAR_TEXT":""),Pv=/(^|;)\s*display\s*:/;function $v(e,t,n){const r=e.style,o=Xe(n);let s=!1;if(n&&!o){if(t)if(Xe(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&ha(r,a,"")}else for(const i in t)n[i]==null&&ha(r,i,"");for(const i in n)i==="display"&&(s=!0),ha(r,i,n[i])}else if(o){if(t!==n){const i=r[Tv];i&&(n+=";"+i),r.cssText=n,s=Pv.test(n)}}else t&&e.removeAttribute("style");Yf in e&&(e[Yf]=s?r.display:"",e[Cv]&&(r.display="none"))}const Av=/[^\\];\s*$/,Gf=/\s*!important$/;function ha(e,t,n){if(be(n))n.forEach(r=>ha(e,t,r));else if(n==null&&(n=""),An.NODE_ENV!=="production"&&Av.test(n)&&Gn(`Unexpected semicolon at the end of '${t}' style value: '${n}'`),t.startsWith("--"))e.setProperty(t,n);else{const r=Dv(e,t);Gf.test(n)?e.setProperty(br(r),n.replace(Gf,""),"important"):e[r]=n}}const Kf=["Webkit","Moz","ms"],iu={};function Dv(e,t){const n=iu[t];if(n)return n;let r=At(t);if(r!=="filter"&&r in e)return iu[t]=r;r=qr(r);for(let o=0;o<Kf.length;o++){const s=Kf[o]+r;if(s in e)return iu[t]=s}return t}const Xf="http://www.w3.org/1999/xlink";function Jf(e,t,n,r,o,s=rb(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Xf,t.slice(6,t.length)):e.setAttributeNS(Xf,t,n):n==null||s&&!Fc(n)?e.removeAttribute(t):e.setAttribute(t,s?"":Hn(n)?String(n):n)}function Qf(e,t,n,r,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?jf(n):n);return}const s=e.tagName;if(t==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=Fc(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch(a){An.NODE_ENV!=="production"&&!i&&Gn(`Failed setting prop "${t}" on <${s.toLowerCase()}>: value ${n} is invalid.`,a)}i&&e.removeAttribute(o||t)}function Iv(e,t,n,r){e.addEventListener(t,n,r)}function Mv(e,t,n,r){e.removeEventListener(t,n,r)}const eh=Symbol("_vei");function Vv(e,t,n,r,o=null){const s=e[eh]||(e[eh]={}),i=s[t];if(r&&i)i.value=An.NODE_ENV!=="production"?nh(r,t):r;else{const[a,l]=Rv(t);if(r){const u=s[t]=Fv(An.NODE_ENV!=="production"?nh(r,t):r,o);Iv(e,a,u,l)}else i&&(Mv(e,a,i,l),s[t]=void 0)}}const th=/(?:Once|Passive|Capture)$/;function Rv(e){let t;if(th.test(e)){t={};let r;for(;r=e.match(th);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):br(e.slice(2)),t]}let au=0;const Lv=Promise.resolve(),jv=()=>au||(Lv.then(()=>au=0),au=Date.now());function Fv(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;pn(Uv(r,n.value),t,5,[r])};return n.value=e,n.attached=jv(),n}function nh(e,t){return ye(e)||be(e)?e:(Gn(`Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
|
|
15
|
-
Expected function or array of functions, received type ${typeof e}.`),ht)}function Uv(e,t){if(be(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 rh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Bv=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?Nv(e,r,i):t==="style"?$v(e,n,r):_s(t)?Di(t)||Vv(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hv(e,t,r,i))?(Qf(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Jf(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Xe(r))?Qf(e,At(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Jf(e,t,r,i))};function Hv(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&rh(t)&&ye(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 rh(t)&&Xe(n)?!1:t in e}const qv=["ctrl","shift","alt","meta"],Wv={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)=>qv.some(n=>e[`${n}Key`]&&!t.includes(n))},Sr=(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=Wv[t[i]];if(a&&a(o,t))return}return e(o,...s)})},zv=rt({patchProp:Bv},wv);let oh;function Zv(){return oh||(oh=qg(zv))}const Yv=(...e)=>{const t=Zv().createApp(...e);An.NODE_ENV!=="production"&&(Kv(t),Xv(t));const{mount:n}=t;return t.mount=r=>{const o=Jv(r);if(!o)return;const s=t._component;!ye(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,Gv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function Gv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Kv(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>eb(t)||tb(t)||nb(t),writable:!1})}function Xv(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Gn("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 Gn(r),n},set(){Gn(r)}})}}function Jv(e){if(Xe(e)){const t=document.querySelector(e);return An.NODE_ENV!=="production"&&!t&&Gn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return An.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&Gn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var Qv={};function ey(){vv()}Qv.NODE_ENV!=="production"&&ey();let pa;const ty=new Uint8Array(16);function ny(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(ty)}const _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function ry(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}const sh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gs(e,t,n){if(sh.randomUUID&&!e)return sh.randomUUID();e=e||{};const r=e.random||(e.rng||ny)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ry(r)}var nn=Symbol("storefront");function oy(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var sy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("close"),intent:v.string().optional(),completed:v.boolean()}),iy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("completed"),order:dl.orders.completedOrderSchema}),ay=v.discriminatedUnion("event",[sy,iy]);function ly(){var e;const t=document.getElementById("moonbase-checkout");!t||!(t instanceof HTMLIFrameElement)||(e=t.contentWindow)==null||e.postMessage("close","*")}function ma(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.setAttribute("allow","payment"),t.height="100%",t.width="100%",document.body.append(t),document.documentElement.style.overflow="hidden",window.onmessage=function(n){var r;try{const o=ay.parse(n.data);o.event==="close"&&(document.body.contains(t)&&(document.documentElement.style.removeProperty("overflow"),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 Ks=class at{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.currentUser=R(null),this.loadedUser=R(!1),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent=oy(l=>this.client.orders.pushContent(l,void 0,this.hasUtm?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=R({id:Gs(),status:Oo.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(at.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${at.storefrontKey}_loaded`,!1),this.utm=r(at.utmKey,void 0);return}window.addEventListener("storage",l=>this.handleStorageUpdate(l));const s=new URLSearchParams(window.location.search);if(this.utm=r(at.utmKey,{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}),this.hasUtm&&t.persistUtm)localStorage.setItem(at.utmKey,JSON.stringify(this.utm.value));else if(t.persistUtm){const l=localStorage.getItem(at.utmKey);if(l)try{this.utm=r(at.utmKey,JSON.parse(l))}catch{}}const i=localStorage.getItem(at.sessionKey);i?(this.currentOrder=R(JSON.parse(i)),this.refreshOrder()):(this.currentOrder=R({id:Gs(),status:Oo.Open,currency:"",items:[],couponsApplied:[]}),this.hasUtm&&this.pushOrderContent());const a=localStorage.getItem(at.storefrontKey);if(a?(this.storefront=r(at.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${at.storefrontKey}_loaded`,!0)):(this.storefront=r(at.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${at.storefrontKey}_loaded`,!1)),this.client.tokenStore.hasAccessToken&&(this.currentUser.value=dl.identity.userSchema.parse(this.client.tokenStore.user)),this.updateStorefront(),this.updateUser(),window.location){const l=new URLSearchParams(window.location.search),u=l.get("mb_intent"),c=l.get("mb_endpoint");if(u==="checkout"&&l.get("mb_complete")&&c){const d=Object.fromEntries([...l.entries()].filter(([h])=>!h.startsWith("mb_"))),f=new URL(decodeURIComponent(c));for(const h of Object.keys(d))f.searchParams.append(h,d[h]);ma(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",l=>{l.detail.order.id===this.currentOrder.value.id&&this.resetOrder()})}get loadedStorefrontPromise(){return new Promise(t=>{Je(this.loadedStorefront,n=>{n&&t()},{immediate:!0})})}get hasUtm(){return!!this.utm.value&&Object.values(this.utm.value).some(t=>!!t)}get loadedUserPromise(){return new Promise(t=>{Je(this.loadedUser,n=>{n&&t()},{immediate:!0})})}closeCheckout(){ly()}onCheckoutInitiated(t){window.addEventListener("moonbase-checkout-initiated",n=>t(n.detail.order,n.detail.total))}onCheckoutCompleted(t){window.addEventListener("moonbase-checkout-completed",n=>t(n.detail.order))}onCheckoutClosed(t){window.addEventListener("moonbase-checkout-closed",n=>t(n.detail.intent))}install(t){t.provide(nn,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),this.currentUser.value=null}finally{this.loadedUser.value=!0}return this.currentUser.value}async updateStorefront(){const t=await this.client.storefront.get(this.hasUtm?this.utm.value:void 0);return t&&(typeof window<"u"&&localStorage.setItem(at.storefrontKey,JSON.stringify(t)),this.storefront.value=t,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=t.suggestedCurrency)),t}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(at.sessionKey,JSON.stringify(this.currentOrder.value)),this.refreshOrderAbortController.abort(),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(t){var n;switch(t.key){case at.sessionKey:this.currentOrder.value=t.newValue?JSON.parse(t.newValue):{id:Gs(),currency:((n=this.storefront.value)==null?void 0:n.suggestedCurrency)||"",status:Oo.Open,items:[],couponsApplied:[]};break;case at.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break;case at.utmKey:this.utm.value=JSON.parse(t.newValue);break;case Dc.storageKey:t.newValue?console.warn("User was updated",t.newValue):(this.currentUser.value=null,console.warn("User was removed"))}}async refreshOrder(){try{const t=await this.client.orders.get(this.currentOrder.value.id,this.refreshOrderAbortController.signal);t&&(t.status!==Oo.Open?this.resetOrder():(typeof window<"u"&&localStorage.setItem(at.sessionKey,JSON.stringify(t)),this.currentOrder.value=t))}catch(t){t instanceof yc&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:Gs(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:Oo.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(at.sessionKey)}async surrenderOrder(){try{await this.client.orders.removeBillingDetails(this.currentOrder.value.id)}catch(t){if(t instanceof pr)return;console.warn("Could not surrender order:",t)}}};Ks.userKey="moonbase_user",Ks.sessionKey="moonbase_session",Ks.storefrontKey="moonbase_storefront",Ks.utmKey="moonbase_utm";var uy=Ks;function cy(e,t){const n=ve(nn);if(!n)throw new Error("No storefront configured");const r=n.stateFactory(`activation-request-${yr(e)}`,null),o=n.stateFactory(`activation-request-${yr(e)}-error`,null),s=n.stateFactory(`activation-request-${yr(e)}-loading`,!0),i=n.stateFactory(`activation-request-${yr(e)}-fulfilling`,!1),a=n.stateFactory(`activation-request-${yr(e)}-completing`,!1),l=n.stateFactory(`activation-request-${yr(e)}-completion-timeout`,null),u=async()=>{if(!r.value)return;await n.client.activationRequests.isCompleted(r.value.id)&&r.value?(r.value.status=dn.Completed,a.value=!1):l.value=setTimeout(u,1500)};return Je(()=>yr(e),async c=>{try{c&&c.length>0?(r.value=await n.client.activationRequests.get(c),r.value.status===dn.Fulfilled&&(a.value=!0,u()),s.value=!1):console.warn("No token given to `useActivationRequest`")}catch(d){o.value=d.message,s.value=!1}},{immediate:!0}),Ll(()=>{l.value&&clearTimeout(l.value)}),Je(n.currentUser,async()=>{var c,d;const f=yr(e);if(!(!f||(d=(c=r.value)==null?void 0:c.licenseEligibility)!=null&&d.eligible)){s.value=!0;try{r.value=await n.client.activationRequests.get(f),r.value.status===dn.Fulfilled&&(a.value=!0,u())}catch(h){o.value=h.message}s.value=!1}}),{activationRequest:r,loading:s,fulfilling:i,completing:a,error:o,isInstalled:se(()=>{var c;return r&&((c=r.value)==null?void 0:c.status)===dn.Completed}),fulfillLicense:async()=>{i.value=!0,r.value=await n.client.activationRequests.fulfillLicense(r.value.id),i.value=!1,a.value=!0,u()},fulfillTrial:async()=>{i.value=!0;try{r.value=await n.client.activationRequests.fulfillTrial(r.value.id),i.value=!1,a.value=!0;const c=u()}catch(c){console.warn("Could not fulfill trial: ",c),c instanceof Pi?o.value="You need to be signed in to do this":o.value=c.message,i.value=!1}},cancel:async()=>{!r.value||r.value.status===dn.Cancelled||(r.value=await n.client.activationRequests.cancel(r.value.id))}}}function Qe(e){const t=e??ve(nn);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,l)=>{const u=await t.client.identity.signUp(n,r,o,s,i,a,l);return t.currentUser.value=u,t.updateStorefront(),u},signOut:async()=>{t.client.tokenStore.setUser(null),await Promise.all([t.updateStorefront(),t.surrenderOrder()]),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),await t.updateUser())}}function ba(e,t){const n=t??ve(nn);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function dy(e){const t=ve(nn);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.bundles)}function Nr(e){const t=e??ve(nn);if(!t)throw new Error("No storefront configured");const n=se(()=>{const r=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((s,i)=>{var a,l,u,c,d,f,h,p,_;let E;if(i.type==="Product"){const C=t.storefront.value.products.find(D=>D.id===i.productId),Z=((C==null?void 0:C.variations)||[]).find(D=>D.id===i.variationId),B=(l=(a=Z==null?void 0:Z.pricingTiers)==null?void 0:a.filter(D=>i.quantity>=D.minQuantity))!=null?l:[],L=B.length>0?B[B.length-1]:null;E=(f=(d=(u=L==null?void 0:L.price[r])!=null?u:Z==null?void 0:Z.price[r])!=null?d:(c=C==null?void 0:C.defaultVariation)==null?void 0:c.price[r])!=null?f:0}else{const C=t.storefront.value.bundles.find(B=>B.id===i.bundleId),Z=((C==null?void 0:C.variations)||[]).find(B=>B.id===i.variationId);E=(_=(p=Z==null?void 0:Z.price[r])!=null?p:(h=C==null?void 0:C.defaultVariation)==null?void 0:h.price[r])!=null?_:0}return s+E*i.quantity},0),currency:r}});return{items:se(()=>t.currentOrder.value.items.map(r=>{var o,s;if(r.type==="Product"){const i=t.storefront.value.products.find(u=>u.id===r.productId),l=((i==null?void 0:i.variations)||[]).find(u=>u.id===r.variationId);return{...r,product:i,variation:l,price:l==null?void 0:l.price,appliedDiscount:(o=l==null?void 0:l.discount)!=null?o:r.appliedDiscount}}else{const i=t.storefront.value.bundles.find(u=>u.id===r.bundleId),l=((i==null?void 0:i.variations)||[]).find(u=>u.id===r.variationId);return{...r,bundle:i,variation:l,price:l==null?void 0:l.price,appliedDiscount:(s=l==null?void 0:l.discount)!=null?s:r.appliedDiscount}}})),currency:se(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:n,addToCart:(r,o)=>{var s,i;if(r=b(r),o??(o=r.defaultVariation),!o)throw new Error("Added item does not have a default variation, and none have been specified");const a=`${r.type==="bundle"?"b":"p"}/${r.id}/${o.id}`;let l=t.currentOrder.value.items.find(u=>u.id===a);if(l)l.quantity+=1,!l.variation&&o&&(l.variation=o),l.type==="Product"&&r.type==="product"&&!l.product&&(l.product=r),l.type==="Bundle"&&r.type==="bundle"&&!l.bundle&&(l.bundle=r);else if(r.type==="bundle")l={id:a,type:"Bundle",bundleId:r.id,bundle:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((s=r.defaultVariation)==null?void 0:s.id)},t.currentOrder.value.items.push(l);else if(r.type==="product")l={id:a,type:"Product",productId:r.id,product:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((i=r.defaultVariation)==null?void 0:i.id)},t.currentOrder.value.items.push(l);else throw new Ur("Invalid input",`Could not handle item of type '${r.type}'`);return t.pushOrderContent(),l},setQuantity:(r,o)=>{const s=t.currentOrder.value.items.find(i=>i.id===r.id);if(!s)throw new Error("Cart item not found");if(s.quantity=o,s.quantity<=0){const i=t.currentOrder.value.items.findIndex(a=>a.id===s.id);t.currentOrder.value.items.splice(i,1)}return t.pushOrderContent(),r},removeFromCart:r=>{const o=t.currentOrder.value.items.findIndex(s=>s.id===r.id);t.currentOrder.value.items.splice(o,1),t.pushOrderContent()},checkout:async r=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,a=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:i},t.hasUtm?t.utm.value:void 0);if(window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:a,total:n.value}})),!r.redirect&&a.embeddedCheckoutUrl&&typeof window<"u"){const l=a.embeddedCheckoutUrl;return new Promise(u=>{ma(l.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",c=>{const d=c;u({next:d.detail.intent,completed:d.detail.completed})},{once:!0})})}else{if(r.redirect&&a.checkoutUrl&&typeof window<"u")return window.location.href=a.checkoutUrl,{next:void 0,completed:!1};throw new Error("No checkout URL found")}}}}async function fy(e,t,n){var r,o;const s=n??ve(nn);if(!s)throw new Error("No storefront configured");const i=[];for(const c of e){const d=b(c.item),f=(r=c.variation)!=null?r:d.defaultVariation;if(!f)throw new Error("Added item does not have a default variation, and none have been specified");const h=`${d.type==="bundle"?"b":"p"}/${d.id}/${f.id}`;if(d.type==="bundle")i.push({id:h,type:"Bundle",bundleId:d.id,bundle:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else if(d.type==="product")i.push({id:h,type:"Product",productId:d.id,product:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else throw new Ur("Invalid input",`Could not handle item of type '${c.type}'`)}const a=typeof window<"u"?window.location.pathname:"",l=new URL((o=t.returnUrl)!=null?o:a,document.baseURI).href,u=await s.client.orders.pushContent({id:Gs(),currency:s.storefront.value.suggestedCurrency,items:i},{returnUrl:l},s.hasUtm?s.utm.value:void 0);if(window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:u,total:{amount:e.reduce((c,d)=>{var f,h;return c+((h=(f=d.variation)==null?void 0:f.price[u.currency])!=null?h:0)},0),currency:u.currency}}})),!t.redirect&&u.embeddedCheckoutUrl&&typeof window<"u"){const c=u.embeddedCheckoutUrl;return new Promise(d=>{ma(c.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",f=>{const h=f;d({next:h.detail.intent,completed:h.detail.completed})},{once:!0})})}else{if(t.redirect&&u.checkoutUrl&&typeof window<"u")return window.location.href=u.checkoutUrl,Promise.resolve({next:void 0,completed:!1});throw new Error("No checkout URL found")}}function so(e){const t=ve(nn);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)},getSubscriptions:async n=>t.client.inventory.subscriptions.get(n),getSubscription:async n=>t.client.inventory.subscriptions.getById(n),cancelSubscription:async n=>t.client.inventory.subscriptions.cancel(n),renewSubscription:async(n,r)=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,{location:a}=await t.client.inventory.subscriptions.renew(n,i,!r.redirect);return r.redirect?(window.location.href=a,Promise.resolve({next:void 0,completed:!1})):new Promise(l=>{ma(a.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",u=>{const c=u;l({next:c.detail.intent,completed:c.detail.completed})},{once:!0})})}}}function Xs(e,t){const n=t??ve(nn);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function hy(e){const t=ve(nn);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.products)}function ih(e){const t=ve(nn);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 py(e,t,n){const r={endpoint:e};return new uy(r,new j0(r),(o,s)=>R(s))}function ga(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 lu(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function my(){return ah().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ah(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const by=typeof Proxy=="function",gy="devtools-plugin:setup",vy="plugin:settings:set";let Mo,uu;function yy(){var e;return Mo!==void 0||(typeof window<"u"&&window.performance?(Mo=!0,uu=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Mo=!0,uu=globalThis.perf_hooks.performance):Mo=!1),Mo}function _y(){return yy()?uu.now():Date.now()}class wy{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 _y()}},n&&n.on(vy,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(u=>{this.targetQueue.push({method:a,args:l,resolve:u})})})}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 lh(e,t){const n=e,r=ah(),o=my(),s=by&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(gy,e,t);else{const i=s?new wy(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var Re={};let Js;const Qs=e=>Js=e,uh=Re.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function io(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Dn;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Dn||(Dn={}));const Cr=typeof window<"u",ch=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 Ey(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 cu(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){hh(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function dh(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function va(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 ya=typeof navigator=="object"?navigator:{userAgent:""},fh=/Macintosh/.test(ya.userAgent)&&/AppleWebKit/.test(ya.userAgent)&&!/Safari/.test(ya.userAgent),hh=Cr?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!fh?xy:"msSaveOrOpenBlob"in ya?ky:Oy:()=>{};function xy(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?dh(r.href)?cu(e,t,n):(r.target="_blank",va(r)):va(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){va(r)},0))}function ky(e,t="download",n){if(typeof e=="string")if(dh(e))cu(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){va(r)})}else navigator.msSaveOrOpenBlob(Ey(e,n),t)}function Oy(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return cu(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(ch.HTMLElement))||"safari"in ch,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||fh)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let l=a.result;if(typeof l!="string")throw r=null,new Error("Wrong reader.result type");l=i?l:l.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=l:location.assign(l),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function bt(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 du(e){return"_a"in e&&"install"in e}function ph(){if(!("clipboard"in navigator))return bt("Your browser doesn't support the Clipboard API","error"),!0}function mh(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(bt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Sy(e){if(!ph())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),bt("Global state copied to clipboard.")}catch(t){if(mh(t))return;bt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function Ny(e){if(!ph())try{bh(e,JSON.parse(await navigator.clipboard.readText())),bt("Global state pasted from clipboard.")}catch(t){if(mh(t))return;bt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function Cy(e){try{hh(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){bt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let Jn;function Ty(){Jn||(Jn=document.createElement("input"),Jn.type="file",Jn.accept=".json");function e(){return new Promise((t,n)=>{Jn.onchange=async()=>{const r=Jn.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},Jn.oncancel=()=>t(null),Jn.onerror=n,Jn.click()})}return e}async function Py(e){try{const n=await Ty()();if(!n)return;const{text:r,file:o}=n;bh(e,JSON.parse(r)),bt(`Global state imported from "${o.name}".`)}catch(t){bt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function bh(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 vn(e){return{_custom:{display:e}}}const gh="🍍 Pinia (root)",_a="_root";function $y(e){return du(e)?{id:_a,label:gh}:{id:e.$id,label:e.$id}}function Ay(e){if(du(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,l)=>(a[l]=i[l],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 Dy(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:vn(e.type),key:vn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Iy(e){switch(e){case Dn.direct:return"mutation";case Dn.patchFunction:return"$patch";case Dn.patchObject:return"$patch";default:return"unknown"}}let Vo=!0;const wa=[],ao="pinia:mutations",kt="pinia",{assign:My}=Object,Ea=e=>"🍍 "+e;function Vy(e,t){lh({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:wa,app:e},n=>{typeof n.now!="function"&&bt("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:ao,label:"Pinia 🍍",color:15064968}),n.addInspector({id:kt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Sy(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Ny(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Cy(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Py(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},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"?bt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),bt(`Store "${r}" reset.`)):bt(`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:Ea(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:ke(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((l,u)=>(l[u]=a.$state[u],l),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Ea(a.$id),key:"getters",editable:!1,value:a._getters.reduce((l,u)=>{try{l[u]=a[u]}catch(c){l[u]=c}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===kt){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()):gh.toLowerCase().includes(r.filter.toLowerCase())):o).map($y)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===kt){const o=r.nodeId===_a?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==_a&&(globalThis.$store=ke(o)),r.state=Ay(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===kt){const s=r.nodeId===_a?t:t._s.get(r.nodeId);if(!s)return bt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;du(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Vo=!1,r.set(s,i,r.state.value),Vo=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return bt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return bt(`Invalid path for store "${o}":
|
|
15
|
+
Expected function or array of functions, received type ${typeof e}.`),ht)}function Uv(e,t){if(be(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 rh=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Bv=(e,t,n,r,o,s)=>{const i=o==="svg";t==="class"?Nv(e,r,i):t==="style"?$v(e,n,r):_s(t)?Di(t)||Vv(e,t,n,r,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hv(e,t,r,i))?(Qf(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Jf(e,t,r,i,s,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Xe(r))?Qf(e,At(t),r,s,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Jf(e,t,r,i))};function Hv(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&rh(t)&&ye(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 rh(t)&&Xe(n)?!1:t in e}const qv=["ctrl","shift","alt","meta"],Wv={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)=>qv.some(n=>e[`${n}Key`]&&!t.includes(n))},Sr=(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=Wv[t[i]];if(a&&a(o,t))return}return e(o,...s)})},zv=rt({patchProp:Bv},wv);let oh;function Zv(){return oh||(oh=qg(zv))}const Yv=(...e)=>{const t=Zv().createApp(...e);An.NODE_ENV!=="production"&&(Kv(t),Xv(t));const{mount:n}=t;return t.mount=r=>{const o=Jv(r);if(!o)return;const s=t._component;!ye(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const i=n(o,!1,Gv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t};function Gv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Kv(e){Object.defineProperty(e.config,"isNativeTag",{value:t=>eb(t)||tb(t)||nb(t),writable:!1})}function Xv(e){{const t=e.config.isCustomElement;Object.defineProperty(e.config,"isCustomElement",{get(){return t},set(){Gn("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 Gn(r),n},set(){Gn(r)}})}}function Jv(e){if(Xe(e)){const t=document.querySelector(e);return An.NODE_ENV!=="production"&&!t&&Gn(`Failed to mount app: mount target selector "${e}" returned null.`),t}return An.NODE_ENV!=="production"&&window.ShadowRoot&&e instanceof window.ShadowRoot&&e.mode==="closed"&&Gn('mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'),e}var Qv={};function ey(){vv()}Qv.NODE_ENV!=="production"&&ey();let pa;const ty=new Uint8Array(16);function ny(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(ty)}const _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function ry(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}const sh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Gs(e,t,n){if(sh.randomUUID&&!e)return sh.randomUUID();e=e||{};const r=e.random||(e.rng||ny)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ry(r)}var nn=Symbol("storefront");function oy(e,t=100){let n=0;return async(...o)=>{clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var sy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("close"),intent:v.string().optional(),completed:v.boolean()}),iy=v.object({source:v.literal("moonbase-checkout"),event:v.literal("completed"),order:dl.orders.completedOrderSchema}),ay=v.discriminatedUnion("event",[sy,iy]);function ly(){var e;const t=document.getElementById("moonbase-checkout");!t||!(t instanceof HTMLIFrameElement)||(e=t.contentWindow)==null||e.postMessage("close","*")}function ma(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.setAttribute("allow","payment"),t.height="100%",t.width="100%",document.body.append(t),document.documentElement.style.overflow="hidden",window.onmessage=function(n){var r;try{const o=ay.parse(n.data);o.event==="close"&&(document.body.contains(t)&&(document.documentElement.style.removeProperty("overflow"),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 Ks=class at{constructor(t,n,r){this.configuration=t,this.client=n,this.stateFactory=r,this.currentUser=R(null),this.loadedUser=R(!1),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent=oy(l=>this.client.orders.pushContent(l,void 0,this.hasUtm?this.utm.value:void 0),500);var o;if(typeof window>"u"){this.currentOrder=R({id:Gs(),status:Oo.Open,currency:"",items:[],couponsApplied:[]}),this.storefront=r(at.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${at.storefrontKey}_loaded`,!1),this.utm=r(at.utmKey,void 0);return}window.addEventListener("storage",l=>this.handleStorageUpdate(l));const s=new URLSearchParams(window.location.search);if(this.utm=r(at.utmKey,{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}),this.hasUtm&&t.persistUtm)localStorage.setItem(at.utmKey,JSON.stringify(this.utm.value));else if(t.persistUtm){const l=localStorage.getItem(at.utmKey);if(l)try{this.utm=r(at.utmKey,JSON.parse(l))}catch{}}const i=localStorage.getItem(at.sessionKey);i?(this.currentOrder=R(JSON.parse(i)),this.refreshOrder()):(this.currentOrder=R({id:Gs(),status:Oo.Open,currency:"",items:[],couponsApplied:[]}),this.hasUtm&&this.pushOrderContent());const a=localStorage.getItem(at.storefrontKey);if(a?(this.storefront=r(at.storefrontKey,JSON.parse(a)),this.loadedStorefront=r(`${at.storefrontKey}_loaded`,!0)):(this.storefront=r(at.storefrontKey,{suggestedCurrency:"",bundles:[],products:[]}),this.loadedStorefront=r(`${at.storefrontKey}_loaded`,!1)),this.client.tokenStore.hasAccessToken&&(this.currentUser.value=dl.identity.userSchema.parse(this.client.tokenStore.user)),this.updateStorefront(),this.updateUser(),window.location){const l=new URLSearchParams(window.location.search),u=l.get("mb_intent"),c=l.get("mb_endpoint");if(u==="checkout"&&l.get("mb_complete")&&c){const d=Object.fromEntries([...l.entries()].filter(([h])=>!h.startsWith("mb_"))),f=new URL(decodeURIComponent(c));for(const h of Object.keys(d))f.searchParams.append(h,d[h]);ma(f.toString()),window.history.replaceState(null,"",window.location.href.split("?")[0])}}window.addEventListener("moonbase-checkout-completed",l=>{l.detail.order.id===this.currentOrder.value.id&&this.resetOrder()})}get loadedStorefrontPromise(){return new Promise(t=>{Je(this.loadedStorefront,n=>{n&&t()},{immediate:!0})})}get hasUtm(){return!!this.utm.value&&Object.values(this.utm.value).some(t=>!!t)}get loadedUserPromise(){return new Promise(t=>{Je(this.loadedUser,n=>{n&&t()},{immediate:!0})})}closeCheckout(){ly()}onCheckoutInitiated(t){window.addEventListener("moonbase-checkout-initiated",n=>t(n.detail.order,n.detail.total))}onCheckoutCompleted(t){window.addEventListener("moonbase-checkout-completed",n=>t(n.detail.order))}onCheckoutClosed(t){window.addEventListener("moonbase-checkout-closed",n=>t(n.detail.intent))}install(t){t.provide(nn,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),this.currentUser.value=null}finally{this.loadedUser.value=!0}return this.currentUser.value}async updateStorefront(){const t=await this.client.storefront.get(this.hasUtm?this.utm.value:void 0);return t&&(typeof window<"u"&&localStorage.setItem(at.storefrontKey,JSON.stringify(t)),this.storefront.value=t,this.loadedStorefront.value=!0,this.currentOrder.value.currency||(this.currentOrder.value.currency=t.suggestedCurrency)),t}async pushOrderContent(){typeof window<"u"&&localStorage.setItem(at.sessionKey,JSON.stringify(this.currentOrder.value)),this.refreshOrderAbortController.abort(),this.refreshOrderAbortController=new AbortController,this.debouncedPushOrderContent(this.currentOrder.value)}handleStorageUpdate(t){var n;switch(t.key){case at.sessionKey:this.currentOrder.value=t.newValue?JSON.parse(t.newValue):{id:Gs(),currency:((n=this.storefront.value)==null?void 0:n.suggestedCurrency)||"",status:Oo.Open,items:[],couponsApplied:[]};break;case at.storefrontKey:this.storefront.value=JSON.parse(t.newValue);break;case at.utmKey:this.utm.value=JSON.parse(t.newValue);break;case Dc.storageKey:t.newValue?console.warn("User was updated",t.newValue):(this.currentUser.value=null,console.warn("User was removed"))}}async refreshOrder(){try{const t=await this.client.orders.get(this.currentOrder.value.id,this.refreshOrderAbortController.signal);t&&(t.status!==Oo.Open?this.resetOrder():(typeof window<"u"&&localStorage.setItem(at.sessionKey,JSON.stringify(t)),this.currentOrder.value=t))}catch(t){t instanceof yc&&this.resetOrder()}}resetOrder(){var t;this.currentOrder.value={id:Gs(),currency:((t=this.storefront.value)==null?void 0:t.suggestedCurrency)||"",status:Oo.Open,items:[],couponsApplied:[]},typeof window<"u"&&localStorage.removeItem(at.sessionKey)}async surrenderOrder(){try{await this.client.orders.removeBillingDetails(this.currentOrder.value.id)}catch(t){if(t instanceof pr)return;console.warn("Could not surrender order:",t)}}};Ks.userKey="moonbase_user",Ks.sessionKey="moonbase_session",Ks.storefrontKey="moonbase_storefront",Ks.utmKey="moonbase_utm";var uy=Ks;function cy(e,t){const n=ve(nn);if(!n)throw new Error("No storefront configured");const r=n.stateFactory(`activation-request-${yr(e)}`,null),o=n.stateFactory(`activation-request-${yr(e)}-error`,null),s=n.stateFactory(`activation-request-${yr(e)}-loading`,!0),i=n.stateFactory(`activation-request-${yr(e)}-fulfilling`,!1),a=n.stateFactory(`activation-request-${yr(e)}-completing`,!1),l=n.stateFactory(`activation-request-${yr(e)}-completion-timeout`,null),u=async()=>{if(!r.value)return;await n.client.activationRequests.isCompleted(r.value.id)&&r.value?(r.value.status=dn.Completed,a.value=!1):l.value=setTimeout(u,1500)};return Je(()=>yr(e),async c=>{try{c&&c.length>0?(r.value=await n.client.activationRequests.get(c),r.value.status===dn.Fulfilled&&(a.value=!0,u()),s.value=!1):console.warn("No token given to `useActivationRequest`")}catch(d){o.value=d.message,s.value=!1}},{immediate:!0}),Ll(()=>{l.value&&clearTimeout(l.value)}),Je(n.currentUser,async()=>{var c,d;const f=yr(e);if(!(!f||(d=(c=r.value)==null?void 0:c.licenseEligibility)!=null&&d.eligible)){s.value=!0;try{r.value=await n.client.activationRequests.get(f),r.value.status===dn.Fulfilled&&(a.value=!0,u())}catch(h){o.value=h.message}s.value=!1}}),{activationRequest:r,loading:s,fulfilling:i,completing:a,error:o,isInstalled:se(()=>{var c;return r&&((c=r.value)==null?void 0:c.status)===dn.Completed}),fulfillLicense:async()=>{i.value=!0,r.value=await n.client.activationRequests.fulfillLicense(r.value.id),i.value=!1,a.value=!0,u()},fulfillTrial:async()=>{i.value=!0;try{r.value=await n.client.activationRequests.fulfillTrial(r.value.id),i.value=!1,a.value=!0;const c=u()}catch(c){console.warn("Could not fulfill trial: ",c),c instanceof Pi?o.value="You need to be signed in to do this":o.value=c.message,i.value=!1}},cancel:async()=>{!r.value||r.value.status===dn.Cancelled||(r.value=await n.client.activationRequests.cancel(r.value.id))}}}function Qe(e){const t=e??ve(nn);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,l)=>{const u=await t.client.identity.signUp(n,r,o,s,i,a,l);return t.currentUser.value=u,t.updateStorefront(),u},signOut:async()=>{t.client.tokenStore.setUser(null),await Promise.all([t.updateStorefront(),t.surrenderOrder()]),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),await t.updateUser())}}function ba(e,t){const n=t??ve(nn);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.bundles.find(r=>r.id===e)||null)}function dy(e){const t=ve(nn);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.bundles)}function Nr(e){const t=e??ve(nn);if(!t)throw new Error("No storefront configured");const n=se(()=>{const r=t.currentOrder.value.currency||t.storefront.value.suggestedCurrency;return{amount:t.currentOrder.value.items.reduce((s,i)=>{var a,l,u,c,d,f,h,p,_;let E;if(i.type==="Product"){const C=t.storefront.value.products.find(D=>D.id===i.productId),Z=((C==null?void 0:C.variations)||[]).find(D=>D.id===i.variationId),B=(l=(a=Z==null?void 0:Z.pricingTiers)==null?void 0:a.filter(D=>i.quantity>=D.minQuantity))!=null?l:[],L=B.length>0?B[B.length-1]:null;E=(f=(d=(u=L==null?void 0:L.price[r])!=null?u:Z==null?void 0:Z.price[r])!=null?d:(c=C==null?void 0:C.defaultVariation)==null?void 0:c.price[r])!=null?f:0}else{const C=t.storefront.value.bundles.find(B=>B.id===i.bundleId),Z=((C==null?void 0:C.variations)||[]).find(B=>B.id===i.variationId);E=(_=(p=Z==null?void 0:Z.price[r])!=null?p:(h=C==null?void 0:C.defaultVariation)==null?void 0:h.price[r])!=null?_:0}return s+E*i.quantity},0),currency:r}});return{items:se(()=>t.currentOrder.value.items.map(r=>{var o,s;if(r.type==="Product"){const i=t.storefront.value.products.find(u=>u.id===r.productId),l=((i==null?void 0:i.variations)||[]).find(u=>u.id===r.variationId);return{...r,product:i,variation:l,price:l==null?void 0:l.price,appliedDiscount:(o=l==null?void 0:l.discount)!=null?o:r.appliedDiscount}}else{const i=t.storefront.value.bundles.find(u=>u.id===r.bundleId),l=((i==null?void 0:i.variations)||[]).find(u=>u.id===r.variationId);return{...r,bundle:i,variation:l,price:l==null?void 0:l.price,appliedDiscount:(s=l==null?void 0:l.discount)!=null?s:r.appliedDiscount}}})),currency:se(()=>t.currentOrder.value.currency||t.storefront.value.suggestedCurrency),total:n,addToCart:(r,o)=>{var s,i;if(r=b(r),o??(o=r.defaultVariation),!o)throw new Error("Added item does not have a default variation, and none have been specified");const a=`${r.type==="bundle"?"b":"p"}/${r.id}/${o.id}`;let l=t.currentOrder.value.items.find(u=>u.id===a);if(l)l.quantity+=1,!l.variation&&o&&(l.variation=o),!l.price&&o&&(l.price=o.price),!l.appliedDiscount&&o.discount&&(l.appliedDiscount=o.discount),l.type==="Product"&&r.type==="product"&&!l.product&&(l.product=r),l.type==="Bundle"&&r.type==="bundle"&&!l.bundle&&(l.bundle=r);else if(r.type==="bundle")l={id:a,type:"Bundle",bundleId:r.id,bundle:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((s=r.defaultVariation)==null?void 0:s.id)},t.currentOrder.value.items.push(l);else if(r.type==="product")l={id:a,type:"Product",productId:r.id,product:r,quantity:1,variation:o,variationId:o.id,price:o.price,appliedDiscount:o.discount,isDefaultVariation:o.id===((i=r.defaultVariation)==null?void 0:i.id)},t.currentOrder.value.items.push(l);else throw new Ur("Invalid input",`Could not handle item of type '${r.type}'`);return t.pushOrderContent(),l},setQuantity:(r,o)=>{const s=t.currentOrder.value.items.find(i=>i.id===r.id);if(!s)throw new Error("Cart item not found");if(s.quantity=o,s.quantity<=0){const i=t.currentOrder.value.items.findIndex(a=>a.id===s.id);t.currentOrder.value.items.splice(i,1)}return t.pushOrderContent(),r},removeFromCart:r=>{const o=t.currentOrder.value.items.findIndex(s=>s.id===r.id);t.currentOrder.value.items.splice(o,1),t.pushOrderContent()},checkout:async r=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,a=await t.client.orders.pushContent(t.currentOrder.value,{returnUrl:i},t.hasUtm?t.utm.value:void 0);if(window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:a,total:n.value}})),!r.redirect&&a.embeddedCheckoutUrl&&typeof window<"u"){const l=a.embeddedCheckoutUrl;return new Promise(u=>{ma(l.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",c=>{const d=c;u({next:d.detail.intent,completed:d.detail.completed})},{once:!0})})}else{if(r.redirect&&a.checkoutUrl&&typeof window<"u")return window.location.href=a.checkoutUrl,{next:void 0,completed:!1};throw new Error("No checkout URL found")}}}}async function fy(e,t,n){var r,o;const s=n??ve(nn);if(!s)throw new Error("No storefront configured");const i=[];for(const c of e){const d=b(c.item),f=(r=c.variation)!=null?r:d.defaultVariation;if(!f)throw new Error("Added item does not have a default variation, and none have been specified");const h=`${d.type==="bundle"?"b":"p"}/${d.id}/${f.id}`;if(d.type==="bundle")i.push({id:h,type:"Bundle",bundleId:d.id,bundle:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else if(d.type==="product")i.push({id:h,type:"Product",productId:d.id,product:d,quantity:1,variation:f,variationId:f.id,price:f.price,appliedDiscount:f.discount});else throw new Ur("Invalid input",`Could not handle item of type '${c.type}'`)}const a=typeof window<"u"?window.location.pathname:"",l=new URL((o=t.returnUrl)!=null?o:a,document.baseURI).href,u=await s.client.orders.pushContent({id:Gs(),currency:s.storefront.value.suggestedCurrency,items:i},{returnUrl:l},s.hasUtm?s.utm.value:void 0);if(window.dispatchEvent(new CustomEvent("moonbase-checkout-initiated",{detail:{order:u,total:{amount:e.reduce((c,d)=>{var f,h;return c+((h=(f=d.variation)==null?void 0:f.price[u.currency])!=null?h:0)},0),currency:u.currency}}})),!t.redirect&&u.embeddedCheckoutUrl&&typeof window<"u"){const c=u.embeddedCheckoutUrl;return new Promise(d=>{ma(c.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",f=>{const h=f;d({next:h.detail.intent,completed:h.detail.completed})},{once:!0})})}else{if(t.redirect&&u.checkoutUrl&&typeof window<"u")return window.location.href=u.checkoutUrl,Promise.resolve({next:void 0,completed:!1});throw new Error("No checkout URL found")}}function so(e){const t=ve(nn);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)},getSubscriptions:async n=>t.client.inventory.subscriptions.get(n),getSubscription:async n=>t.client.inventory.subscriptions.getById(n),cancelSubscription:async n=>t.client.inventory.subscriptions.cancel(n),renewSubscription:async(n,r)=>{var o;const s=typeof window<"u"?window.location.pathname:"",i=new URL((o=r.returnUrl)!=null?o:s,document.baseURI).href,{location:a}=await t.client.inventory.subscriptions.renew(n,i,!r.redirect);return r.redirect?(window.location.href=a,Promise.resolve({next:void 0,completed:!1})):new Promise(l=>{ma(a.replace("acme-co.beta.moonbase.sh","localhost:3002")),window.addEventListener("moonbase-checkout-closed",u=>{const c=u;l({next:c.detail.intent,completed:c.detail.completed})},{once:!0})})}}}function Xs(e,t){const n=t??ve(nn);if(!n)throw new Error("No storefront configured");return se(()=>n.storefront.value.products.find(r=>r.id===e)||null)}function hy(e){const t=ve(nn);if(!t)throw new Error("No storefront configured");return se(()=>t.storefront.value.products)}function ih(e){const t=ve(nn);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 py(e,t,n){const r={endpoint:e};return new uy(r,new j0(r),(o,s)=>R(s))}function ga(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 lu(e,t){if(Array.isArray(e)){e.splice(t,1);return}delete e[t]}function my(){return ah().__VUE_DEVTOOLS_GLOBAL_HOOK__}function ah(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const by=typeof Proxy=="function",gy="devtools-plugin:setup",vy="plugin:settings:set";let Mo,uu;function yy(){var e;return Mo!==void 0||(typeof window<"u"&&window.performance?(Mo=!0,uu=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(Mo=!0,uu=globalThis.perf_hooks.performance):Mo=!1),Mo}function _y(){return yy()?uu.now():Date.now()}class wy{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 _y()}},n&&n.on(vy,(i,a)=>{i===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(i,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(i,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(u=>{this.targetQueue.push({method:a,args:l,resolve:u})})})}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 lh(e,t){const n=e,r=ah(),o=my(),s=by&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!s))o.emit(gy,e,t);else{const i=s?new wy(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}var Re={};let Js;const Qs=e=>Js=e,uh=Re.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function io(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Dn;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Dn||(Dn={}));const Cr=typeof window<"u",ch=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 Ey(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 cu(e,t,n){const r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){hh(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function dh(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function va(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 ya=typeof navigator=="object"?navigator:{userAgent:""},fh=/Macintosh/.test(ya.userAgent)&&/AppleWebKit/.test(ya.userAgent)&&!/Safari/.test(ya.userAgent),hh=Cr?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!fh?xy:"msSaveOrOpenBlob"in ya?ky:Oy:()=>{};function xy(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?dh(r.href)?cu(e,t,n):(r.target="_blank",va(r)):va(r)):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){va(r)},0))}function ky(e,t="download",n){if(typeof e=="string")if(dh(e))cu(e,t,n);else{const r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){va(r)})}else navigator.msSaveOrOpenBlob(Ey(e,n),t)}function Oy(e,t,n,r){if(r=r||open("","_blank"),r&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return cu(e,t,n);const o=e.type==="application/octet-stream",s=/constructor/i.test(String(ch.HTMLElement))||"safari"in ch,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||o&&s||fh)&&typeof FileReader<"u"){const a=new FileReader;a.onloadend=function(){let l=a.result;if(typeof l!="string")throw r=null,new Error("Wrong reader.result type");l=i?l:l.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=l:location.assign(l),r=null},a.readAsDataURL(e)}else{const a=URL.createObjectURL(e);r?r.location.assign(a):location.href=a,r=null,setTimeout(function(){URL.revokeObjectURL(a)},4e4)}}function bt(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 du(e){return"_a"in e&&"install"in e}function ph(){if(!("clipboard"in navigator))return bt("Your browser doesn't support the Clipboard API","error"),!0}function mh(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(bt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function Sy(e){if(!ph())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),bt("Global state copied to clipboard.")}catch(t){if(mh(t))return;bt("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function Ny(e){if(!ph())try{bh(e,JSON.parse(await navigator.clipboard.readText())),bt("Global state pasted from clipboard.")}catch(t){if(mh(t))return;bt("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function Cy(e){try{hh(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){bt("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let Jn;function Ty(){Jn||(Jn=document.createElement("input"),Jn.type="file",Jn.accept=".json");function e(){return new Promise((t,n)=>{Jn.onchange=async()=>{const r=Jn.files;if(!r)return t(null);const o=r.item(0);return t(o?{text:await o.text(),file:o}:null)},Jn.oncancel=()=>t(null),Jn.onerror=n,Jn.click()})}return e}async function Py(e){try{const n=await Ty()();if(!n)return;const{text:r,file:o}=n;bh(e,JSON.parse(r)),bt(`Global state imported from "${o.name}".`)}catch(t){bt("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function bh(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 vn(e){return{_custom:{display:e}}}const gh="🍍 Pinia (root)",_a="_root";function $y(e){return du(e)?{id:_a,label:gh}:{id:e.$id,label:e.$id}}function Ay(e){if(du(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,l)=>(a[l]=i[l],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 Dy(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:vn(e.type),key:vn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function Iy(e){switch(e){case Dn.direct:return"mutation";case Dn.patchFunction:return"$patch";case Dn.patchObject:return"$patch";default:return"unknown"}}let Vo=!0;const wa=[],ao="pinia:mutations",kt="pinia",{assign:My}=Object,Ea=e=>"🍍 "+e;function Vy(e,t){lh({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:wa,app:e},n=>{typeof n.now!="function"&&bt("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:ao,label:"Pinia 🍍",color:15064968}),n.addInspector({id:kt,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{Sy(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await Ny(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{Cy(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await Py(t),n.sendInspectorTree(kt),n.sendInspectorState(kt)},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"?bt(`Cannot reset "${r}" store because it doesn't have a "$reset" method implemented.`,"warn"):(o.$reset(),bt(`Store "${r}" reset.`)):bt(`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:Ea(a.$id),key:"state",editable:!0,value:a._isOptionsAPI?{_custom:{value:ke(a.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>a.$reset()}]}}:Object.keys(a.$state).reduce((l,u)=>(l[u]=a.$state[u],l),{})}),a._getters&&a._getters.length&&r.instanceData.state.push({type:Ea(a.$id),key:"getters",editable:!1,value:a._getters.reduce((l,u)=>{try{l[u]=a[u]}catch(c){l[u]=c}return l},{})})})}}),n.on.getInspectorTree(r=>{if(r.app===e&&r.inspectorId===kt){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()):gh.toLowerCase().includes(r.filter.toLowerCase())):o).map($y)}}),globalThis.$pinia=t,n.on.getInspectorState(r=>{if(r.app===e&&r.inspectorId===kt){const o=r.nodeId===_a?t:t._s.get(r.nodeId);if(!o)return;o&&(r.nodeId!==_a&&(globalThis.$store=ke(o)),r.state=Ay(o))}}),n.on.editInspectorState((r,o)=>{if(r.app===e&&r.inspectorId===kt){const s=r.nodeId===_a?t:t._s.get(r.nodeId);if(!s)return bt(`store "${r.nodeId}" not found`,"error");const{path:i}=r;du(s)?i.unshift("state"):(i.length!==1||!s._customProperties.has(i[0])||i[0]in s.$state)&&i.unshift("$state"),Vo=!1,r.set(s,i,r.state.value),Vo=!0}}),n.on.editComponentState(r=>{if(r.type.startsWith("🍍")){const o=r.type.replace(/^🍍\s*/,""),s=t._s.get(o);if(!s)return bt(`store "${o}" not found`,"error");const{path:i}=r;if(i[0]!=="state")return bt(`Invalid path for store "${o}":
|
|
16
16
|
${i}
|
|
17
17
|
Only state can be modified.`);i[0]="$state",Vo=!1,r.set(s,i,r.state.value),Vo=!0}})})}function Ry(e,t){wa.includes(Ea(t.$id))||wa.push(Ea(t.$id)),lh({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:wa,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:l,args:u})=>{const c=vh++;n.addTimelineEvent({layerId:ao,event:{time:r(),title:"🛫 "+l,subtitle:"start",data:{store:vn(t.$id),action:vn(l),args:u},groupId:c}}),i(d=>{Tr=void 0,n.addTimelineEvent({layerId:ao,event:{time:r(),title:"🛬 "+l,subtitle:"end",data:{store:vn(t.$id),action:vn(l),args:u,result:d},groupId:c}})}),a(d=>{Tr=void 0,n.addTimelineEvent({layerId:ao,event:{time:r(),logType:"error",title:"💥 "+l,subtitle:"end",data:{store:vn(t.$id),action:vn(l),args:u,error:d},groupId:c}})})},!0),t._customProperties.forEach(i=>{Je(()=>b(t[i]),(a,l)=>{n.notifyComponentUpdate(),n.sendInspectorState(kt),Vo&&n.addTimelineEvent({layerId:ao,event:{time:r(),title:"Change",subtitle:i,data:{newValue:a,oldValue:l},groupId:Tr}})},{deep:!0})}),t.$subscribe(({events:i,type:a},l)=>{if(n.notifyComponentUpdate(),n.sendInspectorState(kt),!Vo)return;const u={time:r(),title:Iy(a),data:My({store:vn(t.$id)},Dy(i)),groupId:Tr};a===Dn.patchFunction?u.subtitle="⤵️":a===Dn.patchObject?u.subtitle="🧩":i&&!Array.isArray(i)&&(u.subtitle=i.type),i&&(u.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:ao,event:u})},{detached:!0,flush:"sync"});const o=t._hotUpdate;t._hotUpdate=vr(i=>{o(i),n.addTimelineEvent({layerId:ao,event:{time:r(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:vn(t.$id),info:vn("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree(kt),n.sendInspectorState(kt)});const{$dispose:s}=t;t.$dispose=()=>{s(),n.notifyComponentUpdate(),n.sendInspectorTree(kt),n.sendInspectorState(kt),n.getSettings().logStoreChanges&&bt(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree(kt),n.sendInspectorState(kt),n.getSettings().logStoreChanges&&bt(`"${t.$id}" store installed 🆕`)})}let vh=0,Tr;function yh(e,t,n){const r=t.reduce((o,s)=>(o[s]=ke(e)[s],o),{});for(const o in r)e[o]=function(){const s=vh,i=n?new Proxy(e,{get(...l){return Tr=s,Reflect.get(...l)},set(...l){return Tr=s,Reflect.set(...l)}}):e;Tr=s;const a=r[o].apply(i,arguments);return Tr=void 0,a}}function Ly({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){yh(t,Object.keys(n.actions),t._isOptionsAPI);const r=t._hotUpdate;ke(t)._hotUpdate=function(o){r.apply(this,arguments),yh(t,Object.keys(o._hmrPayload.actions),!!t._isOptionsAPI)}}Ry(e,t)}}function jy(){const e=qc(!0),t=e.run(()=>R({}));let n=[],r=[];const o=vr({install(s){Qs(o),o._a=s,s.provide(uh,o),s.config.globalProperties.$pinia=o,Re.NODE_ENV!=="production"&&Re.NODE_ENV!=="test"&&Cr&&Vy(s,o),r.forEach(i=>n.push(i)),r=[]},use(s){return this._a?n.push(s):r.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return Re.NODE_ENV!=="production"&&Re.NODE_ENV!=="test"&&Cr&&typeof Proxy<"u"&&o.use(Ly),o}function _h(e,t){for(const n in t){const r=t[n];if(!(n in e))continue;const o=e[n];io(o)&&io(r)&&!Ye(r)&&!hn(r)?e[n]=_h(o,r):e[n]=r}return e}const wh=()=>{};function Eh(e,t,n,r=wh){e.push(t);const o=()=>{const s=e.indexOf(t);s>-1&&(e.splice(s,1),r())};return!n&&Wc()&&ob(o),o}function Ro(e,...t){e.slice().forEach(n=>{n(...t)})}const Fy=e=>e(),xh=Symbol(),fu=Symbol();function hu(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];io(o)&&io(r)&&e.hasOwnProperty(n)&&!Ye(r)&&!hn(r)?e[n]=hu(o,r):e[n]=r}return e}const Uy=Re.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function By(e){return!io(e)||!e.hasOwnProperty(Uy)}const{assign:rn}=Object;function kh(e){return!!(Ye(e)&&e.effect)}function Oh(e,t,n,r){const{state:o,actions:s,getters:i}=t,a=n.state.value[e];let l;function u(){!a&&(Re.NODE_ENV==="production"||!r)&&(n.state.value[e]=o?o():{});const c=Re.NODE_ENV!=="production"&&r?pd(R(o?o():{}).value):pd(n.state.value[e]);return rn(c,s,Object.keys(i||{}).reduce((d,f)=>(Re.NODE_ENV!=="production"&&f in c&&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]=vr(se(()=>{Qs(n);const h=n._s.get(e);return i[f].call(h,h)})),d),{}))}return l=pu(e,u,t,n,r,!0),l}function pu(e,t,n={},r,o,s){let i;const a=rn({actions:{}},n);if(Re.NODE_ENV!=="production"&&!r._e.active)throw new Error("Pinia destroyed");const l={deep:!0};Re.NODE_ENV!=="production"&&(l.onTrigger=P=>{u?h=P:u==!1&&!m._hotUpdating&&(Array.isArray(h)?h.push(P):console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let u,c,d=[],f=[],h;const p=r.state.value[e];!s&&!p&&(Re.NODE_ENV==="production"||!o)&&(r.state.value[e]={});const _=R({});let E;function C(P){let A;u=c=!1,Re.NODE_ENV!=="production"&&(h=[]),typeof P=="function"?(P(r.state.value[e]),A={type:Dn.patchFunction,storeId:e,events:h}):(hu(r.state.value[e],P),A={type:Dn.patchObject,payload:P,storeId:e,events:h});const k=E=Symbol();Gi().then(()=>{E===k&&(u=!0)}),c=!0,Ro(d,A,r.state.value[e])}const z=s?function(){const{state:A}=n,k=A?A():{};this.$patch(G=>{rn(G,k)})}:Re.NODE_ENV!=="production"?()=>{throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`)}:wh;function Z(){i.stop(),d=[],f=[],r._s.delete(e)}const B=(P,A="")=>{if(xh in P)return P[fu]=A,P;const k=function(){Qs(r);const G=Array.from(arguments),_e=[],O=[];function M(me){_e.push(me)}function H(me){O.push(me)}Ro(f,{args:G,name:k[fu],store:m,after:M,onError:H});let ne;try{ne=P.apply(this&&this.$id===e?this:m,G)}catch(me){throw Ro(O,me),me}return ne instanceof Promise?ne.then(me=>(Ro(_e,me),me)).catch(me=>(Ro(O,me),Promise.reject(me))):(Ro(_e,ne),ne)};return k[xh]=!0,k[fu]=A,k},L=vr({actions:{},getters:{},state:[],hotState:_}),D={_p:r,$id:e,$onAction:Eh.bind(null,f),$patch:C,$reset:z,$subscribe(P,A={}){const k=Eh(d,P,A.detached,()=>G()),G=i.run(()=>Je(()=>r.state.value[e],_e=>{(A.flush==="sync"?c:u)&&P({storeId:e,type:Dn.direct,events:h},_e)},rn({},l,A)));return k},$dispose:Z},m=Ps(Re.NODE_ENV!=="production"||Re.NODE_ENV!=="production"&&Re.NODE_ENV!=="test"&&Cr?rn({_hmrPayload:L,_customProperties:vr(new Set)},D):D);r._s.set(e,m);const I=(r._a&&r._a.runWithContext||Fy)(()=>r._e.run(()=>(i=qc()).run(()=>t({action:B}))));for(const P in I){const A=I[P];if(Ye(A)&&!kh(A)||hn(A))Re.NODE_ENV!=="production"&&o?ga(_.value,P,Cl(I,P)):s||(p&&By(A)&&(Ye(A)?A.value=p[P]:hu(A,p[P])),r.state.value[e][P]=A),Re.NODE_ENV!=="production"&&L.state.push(P);else if(typeof A=="function"){const k=Re.NODE_ENV!=="production"&&o?A:B(A,P);I[P]=k,Re.NODE_ENV!=="production"&&(L.actions[P]=A),a.actions[P]=A}else Re.NODE_ENV!=="production"&&kh(A)&&(L.getters[P]=s?n.getters[P]:A,Cr&&(I._getters||(I._getters=vr([]))).push(P))}if(rn(m,I),rn(ke(m),I),Object.defineProperty(m,"$state",{get:()=>Re.NODE_ENV!=="production"&&o?_.value:r.state.value[e],set:P=>{if(Re.NODE_ENV!=="production"&&o)throw new Error("cannot set hotState");C(A=>{rn(A,P)})}}),Re.NODE_ENV!=="production"&&(m._hotUpdate=vr(P=>{m._hotUpdating=!0,P._hmrPayload.state.forEach(A=>{if(A in m.$state){const k=P.$state[A],G=m.$state[A];typeof k=="object"&&io(k)&&io(G)?_h(k,G):P.$state[A]=G}ga(m,A,Cl(P.$state,A))}),Object.keys(m.$state).forEach(A=>{A in P.$state||lu(m,A)}),u=!1,c=!1,r.state.value[e]=Cl(P._hmrPayload,"hotState"),c=!0,Gi().then(()=>{u=!0});for(const A in P._hmrPayload.actions){const k=P[A];ga(m,A,B(k,A))}for(const A in P._hmrPayload.getters){const k=P._hmrPayload.getters[A],G=s?se(()=>(Qs(r),k.call(m,m))):k;ga(m,A,G)}Object.keys(m._hmrPayload.getters).forEach(A=>{A in P._hmrPayload.getters||lu(m,A)}),Object.keys(m._hmrPayload.actions).forEach(A=>{A in P._hmrPayload.actions||lu(m,A)}),m._hmrPayload=P._hmrPayload,m._getters=P._getters,m._hotUpdating=!1})),Re.NODE_ENV!=="production"&&Re.NODE_ENV!=="test"&&Cr){const P={writable:!0,configurable:!0,enumerable:!1};["_p","_hmrPayload","_getters","_customProperties"].forEach(A=>{Object.defineProperty(m,A,rn({value:m[A]},P))})}return r._p.forEach(P=>{if(Re.NODE_ENV!=="production"&&Re.NODE_ENV!=="test"&&Cr){const A=i.run(()=>P({store:m,app:r._a,pinia:r,options:a}));Object.keys(A||{}).forEach(k=>m._customProperties.add(k)),rn(m,A)}else rn(m,i.run(()=>P({store:m,app:r._a,pinia:r,options:a})))}),Re.NODE_ENV!=="production"&&m.$state&&typeof m.$state=="object"&&typeof m.$state.constructor=="function"&&!m.$state.constructor.toString().includes("[native code]")&&console.warn(`[🍍]: The "state" must be a plain object. It cannot be
|
|
18
18
|
state: () => new MyClass()
|
|
@@ -33,4 +33,4 @@ This will fail in production.`);a=Js,a._s.has(r)||(s?pu(r,t,o,a):Oh(r,o,a),Re.NO
|
|
|
33
33
|
*
|
|
34
34
|
* You can read more about the APCA Readability Criterion at
|
|
35
35
|
* https://readtech.org/ARC/
|
|
36
|
-
*/const gp=.027,Kw=5e-4,Xw=.1,vp=1.14,Ia=.022,yp=1.414,Jw=(e,t)=>{e=new ee(e),t=new ee(t),e.alpha()<1&&(e=Wo(t,e,e.alpha(),"rgb"));const n=_p(...e.rgb()),r=_p(...t.rgb()),o=n>=Ia?n:n+Math.pow(Ia-n,yp),s=r>=Ia?r:r+Math.pow(Ia-r,yp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<Kw?0:o<s?i*vp:a*vp;return(Math.abs(l)<Xw?0:l>0?l-gp:l+gp)*100};function _p(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:nr,pow:ct,min:Qw,max:e2,atan2:wp,abs:Ep,cos:Ma,sin:xp,exp:t2,PI:kp}=Math;function n2(e,t,n=1,r=1,o=1){var s=function(it){return 360*it/(2*kp)},i=function(it){return 2*kp*it/360};e=new ee(e),t=new ee(t);const[a,l,u]=Array.from(e.lab()),[c,d,f]=Array.from(t.lab()),h=(a+c)/2,p=nr(ct(l,2)+ct(u,2)),_=nr(ct(d,2)+ct(f,2)),E=(p+_)/2,C=.5*(1-nr(ct(E,7)/(ct(E,7)+ct(25,7)))),z=l*(1+C),Z=d*(1+C),B=nr(ct(z,2)+ct(u,2)),L=nr(ct(Z,2)+ct(f,2)),D=(B+L)/2,m=s(wp(u,z)),$=s(wp(f,Z)),I=m>=0?m:m+360,P=$>=0?$:$+360,A=Ep(I-P)>180?(I+P+360)/2:(I+P)/2,k=1-.17*Ma(i(A-30))+.24*Ma(i(2*A))+.32*Ma(i(3*A+6))-.2*Ma(i(4*A-63));let G=P-I;G=Ep(G)<=180?G:P<=I?G+360:G-360,G=2*nr(B*L)*xp(i(G)/2);const _e=c-a,O=L-B,M=1+.015*ct(h-50,2)/nr(20+ct(h-50,2)),H=1+.045*D,ne=1+.015*D*k,me=30*t2(-ct((A-275)/25,2)),He=-(2*nr(ct(D,7)/(ct(D,7)+ct(25,7))))*xp(2*i(me)),ft=nr(ct(_e/(n*M),2)+ct(O/(r*H),2)+ct(G/(o*ne),2)+He*(O/(r*H))*(G/(o*ne)));return e2(0,Qw(100,ft))}function r2(e,t,n="lab"){e=new ee(e),t=new ee(t);const r=e.get(n),o=t.get(n);let s=0;for(let i in r){const a=(r[i]||0)-(o[i]||0);s+=a*a}return Math.sqrt(s)}const o2=(...e)=>{try{return new ee(...e),!0}catch{return!1}},s2={cool(){return Da([$e.hsl(180,1,.9),$e.hsl(250,.7,.4)])},hot(){return Da(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Zu={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Op=Object.keys(Zu),Sp=new Map(Op.map(e=>[e.toLowerCase(),e])),i2=typeof Proxy=="function"?new Proxy(Zu,{get(e,t){const n=t.toLowerCase();if(Sp.has(n))return e[Sp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Op)}}):Zu,a2=(...e)=>{e=Pe(e,"cmyk");const[t,n,r,o]=e,s=e.length>4?e[4]:1;return o===1?[0,0,0,s]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s]},{max:Np}=Math,l2=(...e)=>{let[t,n,r]=Pe(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Np(t,Np(n,r)),s=o<1?1/(1-o):0,i=(1-t-o)*s,a=(1-n-o)*s,l=(1-r-o)*s;return[i,a,l,o]};ee.prototype.cmyk=function(){return l2(this._rgb)},Object.assign($e,{cmyk:(...e)=>new ee(...e,"cmyk")}),Ne.format.cmyk=a2,Ne.autodetect.push({p:2,test:(...e)=>{if(e=Pe(e,"cmyk"),Me(e)==="array"&&e.length===4)return"cmyk"}});const u2=(...e)=>{const t=Pe(e,"hsla");let n=Ho(e)||"lsa";return t[0]=sn(t[0]||0)+"deg",t[1]=sn(t[1]*100)+"%",t[2]=sn(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},c2=(...e)=>{const t=Pe(e,"lab");let n=Ho(e)||"lab";return t[0]=sn(t[0])+"%",t[1]=sn(t[1]),t[2]=sn(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},d2=(...e)=>{const t=Pe(e,"lch");let n=Ho(e)||"lab";return t[0]=sn(t[0])+"%",t[1]=sn(t[1]),t[2]=isNaN(t[2])?"none":sn(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},f2=(...e)=>{const t=Pe(e,"lab");return t[0]=sn(t[0]*100)+"%",t[1]=$u(t[1]),t[2]=$u(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Cp=(...e)=>{const[t,n,r,...o]=Pe(e,"rgb"),[s,i,a]=Hu(t,n,r),[l,u,c]=lp(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},h2=(...e)=>{const t=Pe(e,"lch");return t[0]=sn(t[0]*100)+"%",t[1]=$u(t[1]),t[2]=isNaN(t[2])?"none":sn(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:Yu}=Math,p2=(...e)=>{const t=Pe(e,"rgba");let n=Ho(e)||"rgb";if(n.substr(0,3)==="hsl")return u2(cp(t),n);if(n.substr(0,3)==="lab"){const r=ui();tr("d50");const o=c2(Mu(t),n);return tr(r),o}if(n.substr(0,3)==="lch"){const r=ui();tr("d50");const o=d2(ju(t),n);return tr(r),o}return n.substr(0,5)==="oklab"?f2(Hu(t)):n.substr(0,5)==="oklch"?h2(Cp(t)):(t[0]=Yu(t[0]),t[1]=Yu(t[1]),t[2]=Yu(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},Tp=(...e)=>{e=Pe(e,"lch");const[t,n,r,...o]=e,[s,i,a]=ap(t,n,r),[l,u,c]=Bu(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},rr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,wn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Va=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,an=/\s*/.source,Go=/\s+/.source,Gu=/\s*,\s*/.source,Ra=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Ko=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Pp=new RegExp("^rgba?\\("+an+[rr,rr,rr].join(Go)+Ko+"\\)$"),$p=new RegExp("^rgb\\("+an+[rr,rr,rr].join(Gu)+an+"\\)$"),Ap=new RegExp("^rgba\\("+an+[rr,rr,rr,wn].join(Gu)+an+"\\)$"),Dp=new RegExp("^hsla?\\("+an+[Ra,Va,Va].join(Go)+Ko+"\\)$"),Ip=new RegExp("^hsl?\\("+an+[Ra,Va,Va].join(Gu)+an+"\\)$"),Mp=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Vp=new RegExp("^lab\\("+an+[wn,wn,wn].join(Go)+Ko+"\\)$"),Rp=new RegExp("^lch\\("+an+[wn,wn,Ra].join(Go)+Ko+"\\)$"),Lp=new RegExp("^oklab\\("+an+[wn,wn,wn].join(Go)+Ko+"\\)$"),jp=new RegExp("^oklch\\("+an+[wn,wn,Ra].join(Go)+Ko+"\\)$"),{round:Fp}=Math,Xo=e=>e.map((t,n)=>n<=2?po(Fp(t),0,255):t),dt=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),jt=(e,t)=>e==="none"?t:e,Ku=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Ne.format.named)try{return Ne.format.named(e)}catch{}if((t=e.match(Pp))||(t=e.match($p))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+dt(jt(n[o],0),0,255);n=Xo(n);const r=t[4]!==void 0?+dt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(Ap)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+dt(n[r],0,255);return n}if((t=e.match(Dp))||(t=e.match(Ip))){const n=t.slice(1,4);n[0]=+jt(n[0].replace("deg",""),0),n[1]=+dt(jt(n[1],0),0,100)*.01,n[2]=+dt(jt(n[2],0),0,100)*.01;const r=Xo(Uu(n)),o=t[4]!==void 0?+dt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(Mp)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Uu(n);for(let o=0;o<3;o++)r[o]=Fp(r[o]);return r[3]=+t[4],r}if(t=e.match(Vp)){const n=t.slice(1,4);n[0]=dt(jt(n[0],0),0,100),n[1]=dt(jt(n[1],0),-125,125,!0),n[2]=dt(jt(n[2],0),-125,125,!0);const r=ui();tr("d50");const o=Xo(Du(n));tr(r);const s=t[4]!==void 0?+dt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(Rp)){const n=t.slice(1,4);n[0]=dt(n[0],0,100),n[1]=dt(jt(n[1],0),0,150,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=ui();tr("d50");const o=Xo(Lu(n));tr(r);const s=t[4]!==void 0?+dt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(Lp)){const n=t.slice(1,4);n[0]=dt(jt(n[0],0),0,1),n[1]=dt(jt(n[1],0),-.4,.4,!0),n[2]=dt(jt(n[2],0),-.4,.4,!0);const r=Xo(Bu(n)),o=t[4]!==void 0?+dt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(jp)){const n=t.slice(1,4);n[0]=dt(jt(n[0],0),0,1),n[1]=dt(jt(n[1],0),0,.4,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=Xo(Tp(n)),o=t[4]!==void 0?+dt(t[4],0,1):1;return r[3]=o,r}};Ku.test=e=>Pp.test(e)||Dp.test(e)||Vp.test(e)||Rp.test(e)||Lp.test(e)||jp.test(e)||$p.test(e)||Ap.test(e)||Ip.test(e)||Mp.test(e)||e==="transparent",ee.prototype.css=function(e){return p2(this._rgb,e)};const m2=(...e)=>new ee(...e,"css");$e.css=m2,Ne.format.css=Ku,Ne.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Me(e)==="string"&&Ku.test(e))return"css"}}),Ne.format.gl=(...e)=>{const t=Pe(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const b2=(...e)=>new ee(...e,"gl");$e.gl=b2,ee.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},ee.prototype.hex=function(e){return op(this._rgb,e)};const g2=(...e)=>new ee(...e,"hex");$e.hex=g2,Ne.format.hex=rp,Ne.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Me(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:La}=Math,Up=e=>{const t=e/100;let n,r,o;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*La(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*La(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*La(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*La(r),o=255),[n,r,o,1]},{round:v2}=Math,y2=(...e)=>{const t=Pe(e,"rgb"),n=t[0],r=t[2];let o=1e3,s=4e4;const i=.4;let a;for(;s-o>i;){a=(s+o)*.5;const l=Up(a);l[2]/l[0]>=r/n?s=a:o=a}return v2(a)};ee.prototype.temp=ee.prototype.kelvin=ee.prototype.temperature=function(){return y2(this._rgb)};const Xu=(...e)=>new ee(...e,"temp");Object.assign($e,{temp:Xu,kelvin:Xu,temperature:Xu}),Ne.format.temp=Ne.format.kelvin=Ne.format.temperature=Up,ee.prototype.oklch=function(){return Cp(this._rgb)},Object.assign($e,{oklch:(...e)=>new ee(...e,"oklch")}),Ne.format.oklch=Tp,Ne.autodetect.push({p:2,test:(...e)=>{if(e=Pe(e,"oklch"),Me(e)==="array"&&e.length===3)return"oklch"}}),Object.assign($e,{analyze:mp,average:xw,bezier:Tw,blend:_n,brewer:i2,Color:ee,colors:qo,contrast:Gw,contrastAPCA:Jw,cubehelix:Uw,deltaE:n2,distance:r2,input:Ne,interpolate:Wo,limits:bp,mix:Wo,random:Ww,scale:Da,scales:s2,valid:o2});const _2=[{name:"Slate",id:"slate",reference:!1,shades:[{number:50,hexcode:"#f8fafc"},{number:100,hexcode:"#f1f5f9"},{number:200,hexcode:"#e2e8f0"},{number:300,hexcode:"#cbd5e1"},{number:400,hexcode:"#94a3b8"},{number:500,hexcode:"#64748b"},{number:600,hexcode:"#475569"},{number:700,hexcode:"#334155"},{number:800,hexcode:"#1e293b"},{number:900,hexcode:"#0f172a"},{number:950,hexcode:"#020617"}]},{name:"Gray",id:"gray",reference:!1,shades:[{number:50,hexcode:"#f9fafb"},{number:100,hexcode:"#f3f4f6"},{number:200,hexcode:"#e5e7eb"},{number:300,hexcode:"#d1d5db"},{number:400,hexcode:"#9ca3af"},{number:500,hexcode:"#6b7280"},{number:600,hexcode:"#4b5563"},{number:700,hexcode:"#374151"},{number:800,hexcode:"#1f2937"},{number:900,hexcode:"#111827"},{number:950,hexcode:"#030712"}]},{name:"Zinc",id:"zinc",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f4f4f5"},{number:200,hexcode:"#e4e4e7"},{number:300,hexcode:"#d4d4d8"},{number:400,hexcode:"#a1a1aa"},{number:500,hexcode:"#71717a"},{number:600,hexcode:"#52525b"},{number:700,hexcode:"#3f3f46"},{number:800,hexcode:"#27272a"},{number:900,hexcode:"#18181b"},{number:950,hexcode:"#09090b"}]},{name:"Neutral",id:"neutral",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f5f5f5"},{number:200,hexcode:"#e5e5e5"},{number:300,hexcode:"#d4d4d4"},{number:400,hexcode:"#a3a3a3"},{number:500,hexcode:"#737373"},{number:600,hexcode:"#525252"},{number:700,hexcode:"#404040"},{number:800,hexcode:"#262626"},{number:900,hexcode:"#171717"},{number:950,hexcode:"#0a0a0a"}]},{name:"Stone",id:"stone",reference:!1,shades:[{number:50,hexcode:"#fafaf9"},{number:100,hexcode:"#f5f5f4"},{number:200,hexcode:"#e7e5e4"},{number:300,hexcode:"#d6d3d1"},{number:400,hexcode:"#a8a29e"},{number:500,hexcode:"#78716c"},{number:600,hexcode:"#57534e"},{number:700,hexcode:"#44403c"},{number:800,hexcode:"#292524"},{number:900,hexcode:"#1c1917"},{number:950,hexcode:"#0c0a09"}]},{name:"Red",id:"red",reference:!0,shades:[{number:50,hexcode:"#fef2f2"},{number:100,hexcode:"#fee2e2"},{number:200,hexcode:"#fecaca"},{number:300,hexcode:"#fca5a5"},{number:400,hexcode:"#f87171"},{number:500,hexcode:"#ef4444"},{number:600,hexcode:"#dc2626"},{number:700,hexcode:"#b91c1c"},{number:800,hexcode:"#991b1b"},{number:900,hexcode:"#7f1d1d"},{number:950,hexcode:"#450a0a"}]},{name:"Orange",id:"orange",reference:!0,shades:[{number:50,hexcode:"#fff7ed"},{number:100,hexcode:"#ffedd5"},{number:200,hexcode:"#fed7aa"},{number:300,hexcode:"#fdba74"},{number:400,hexcode:"#fb923c"},{number:500,hexcode:"#f97316"},{number:600,hexcode:"#ea580c"},{number:700,hexcode:"#c2410c"},{number:800,hexcode:"#9a3412"},{number:900,hexcode:"#7c2d12"},{number:950,hexcode:"#431407"}]},{name:"Amber",id:"amber",reference:!0,shades:[{number:50,hexcode:"#fffbeb"},{number:100,hexcode:"#fef3c7"},{number:200,hexcode:"#fde68a"},{number:300,hexcode:"#fcd34d"},{number:400,hexcode:"#fbbf24"},{number:500,hexcode:"#f59e0b"},{number:600,hexcode:"#d97706"},{number:700,hexcode:"#b45309"},{number:800,hexcode:"#92400e"},{number:900,hexcode:"#78350f"},{number:950,hexcode:"#451a03"}]},{name:"Yellow",id:"yellow",reference:!0,shades:[{number:50,hexcode:"#fefce8"},{number:100,hexcode:"#fef9c3"},{number:200,hexcode:"#fef08a"},{number:300,hexcode:"#fde047"},{number:400,hexcode:"#facc15"},{number:500,hexcode:"#eab308"},{number:600,hexcode:"#ca8a04"},{number:700,hexcode:"#a16207"},{number:800,hexcode:"#854d0e"},{number:900,hexcode:"#713f12"},{number:950,hexcode:"#422006"}]},{name:"Lime",id:"lime",reference:!0,shades:[{number:50,hexcode:"#f7fee7"},{number:100,hexcode:"#ecfccb"},{number:200,hexcode:"#d9f99d"},{number:300,hexcode:"#bef264"},{number:400,hexcode:"#a3e635"},{number:500,hexcode:"#84cc16"},{number:600,hexcode:"#65a30d"},{number:700,hexcode:"#4d7c0f"},{number:800,hexcode:"#3f6212"},{number:900,hexcode:"#365314"},{number:950,hexcode:"#1a2e05"}]},{name:"Green",id:"green",reference:!0,shades:[{number:50,hexcode:"#f0fdf4"},{number:100,hexcode:"#dcfce7"},{number:200,hexcode:"#bbf7d0"},{number:300,hexcode:"#86efac"},{number:400,hexcode:"#4ade80"},{number:500,hexcode:"#22c55e"},{number:600,hexcode:"#16a34a"},{number:700,hexcode:"#15803d"},{number:800,hexcode:"#166534"},{number:900,hexcode:"#14532d"},{number:950,hexcode:"#052e16"}]},{name:"Emerald",id:"emerald",reference:!0,shades:[{number:50,hexcode:"#ecfdf5"},{number:100,hexcode:"#d1fae5"},{number:200,hexcode:"#a7f3d0"},{number:300,hexcode:"#6ee7b7"},{number:400,hexcode:"#34d399"},{number:500,hexcode:"#10b981"},{number:600,hexcode:"#059669"},{number:700,hexcode:"#047857"},{number:800,hexcode:"#065f46"},{number:900,hexcode:"#064e3b"},{number:950,hexcode:"#022c22"}]},{name:"Teal",id:"teal",reference:!0,shades:[{number:50,hexcode:"#f0fdfa"},{number:100,hexcode:"#ccfbf1"},{number:200,hexcode:"#99f6e4"},{number:300,hexcode:"#5eead4"},{number:400,hexcode:"#2dd4bf"},{number:500,hexcode:"#14b8a6"},{number:600,hexcode:"#0d9488"},{number:700,hexcode:"#0f766e"},{number:800,hexcode:"#115e59"},{number:900,hexcode:"#134e4a"},{number:950,hexcode:"#042f2e"}]},{name:"Cyan",id:"cyan",reference:!0,shades:[{number:50,hexcode:"#ecfeff"},{number:100,hexcode:"#cffafe"},{number:200,hexcode:"#a5f3fc"},{number:300,hexcode:"#67e8f9"},{number:400,hexcode:"#22d3ee"},{number:500,hexcode:"#06b6d4"},{number:600,hexcode:"#0891b2"},{number:700,hexcode:"#0e7490"},{number:800,hexcode:"#155e75"},{number:900,hexcode:"#164e63"},{number:950,hexcode:"#083344"}]},{name:"Sky",id:"sky",reference:!0,shades:[{number:50,hexcode:"#f0f9ff"},{number:100,hexcode:"#e0f2fe"},{number:200,hexcode:"#bae6fd"},{number:300,hexcode:"#7dd3fc"},{number:400,hexcode:"#38bdf8"},{number:500,hexcode:"#0ea5e9"},{number:600,hexcode:"#0284c7"},{number:700,hexcode:"#0369a1"},{number:800,hexcode:"#075985"},{number:900,hexcode:"#0c4a6e"},{number:950,hexcode:"#082f49"}]},{name:"Blue",id:"blue",reference:!0,shades:[{number:50,hexcode:"#eff6ff"},{number:100,hexcode:"#dbeafe"},{number:200,hexcode:"#bfdbfe"},{number:300,hexcode:"#93c5fd"},{number:400,hexcode:"#60a5fa"},{number:500,hexcode:"#3b82f6"},{number:600,hexcode:"#2563eb"},{number:700,hexcode:"#1d4ed8"},{number:800,hexcode:"#1e40af"},{number:900,hexcode:"#1e3a8a"},{number:950,hexcode:"#172554"}]},{name:"Indigo",id:"indigo",reference:!0,shades:[{number:50,hexcode:"#eef2ff"},{number:100,hexcode:"#e0e7ff"},{number:200,hexcode:"#c7d2fe"},{number:300,hexcode:"#a5b4fc"},{number:400,hexcode:"#818cf8"},{number:500,hexcode:"#6366f1"},{number:600,hexcode:"#4f46e5"},{number:700,hexcode:"#4338ca"},{number:800,hexcode:"#3730a3"},{number:900,hexcode:"#312e81"},{number:950,hexcode:"#1e1b4b"}]},{name:"Violet",id:"violet",reference:!0,shades:[{number:50,hexcode:"#f5f3ff"},{number:100,hexcode:"#ede9fe"},{number:200,hexcode:"#ddd6fe"},{number:300,hexcode:"#c4b5fd"},{number:400,hexcode:"#a78bfa"},{number:500,hexcode:"#8b5cf6"},{number:600,hexcode:"#7c3aed"},{number:700,hexcode:"#6d28d9"},{number:800,hexcode:"#5b21b6"},{number:900,hexcode:"#4c1d95"},{number:950,hexcode:"#2e1065"}]},{name:"Purple",id:"purple",reference:!0,shades:[{number:50,hexcode:"#faf5ff"},{number:100,hexcode:"#f3e8ff"},{number:200,hexcode:"#e9d5ff"},{number:300,hexcode:"#d8b4fe"},{number:400,hexcode:"#c084fc"},{number:500,hexcode:"#a855f7"},{number:600,hexcode:"#9333ea"},{number:700,hexcode:"#7e22ce"},{number:800,hexcode:"#6b21a8"},{number:900,hexcode:"#581c87"},{number:950,hexcode:"#3b0764"}]},{name:"Fuchsia",id:"fuchsia",reference:!0,shades:[{number:50,hexcode:"#fdf4ff"},{number:100,hexcode:"#fae8ff"},{number:200,hexcode:"#f5d0fe"},{number:300,hexcode:"#f0abfc"},{number:400,hexcode:"#e879f9"},{number:500,hexcode:"#d946ef"},{number:600,hexcode:"#c026d3"},{number:700,hexcode:"#a21caf"},{number:800,hexcode:"#86198f"},{number:900,hexcode:"#701a75"},{number:950,hexcode:"#4a044e"}]},{name:"Pink",id:"pink",reference:!0,shades:[{number:50,hexcode:"#fdf2f8"},{number:100,hexcode:"#fce7f3"},{number:200,hexcode:"#fbcfe8"},{number:300,hexcode:"#f9a8d4"},{number:400,hexcode:"#f472b6"},{number:500,hexcode:"#ec4899"},{number:600,hexcode:"#db2777"},{number:700,hexcode:"#be185d"},{number:800,hexcode:"#9d174d"},{number:900,hexcode:"#831843"},{number:950,hexcode:"#500724"}]},{name:"Rose",id:"rose",reference:!0,shades:[{number:50,hexcode:"#fff1f2"},{number:100,hexcode:"#ffe4e6"},{number:200,hexcode:"#fecdd3"},{number:300,hexcode:"#fda4af"},{number:400,hexcode:"#fb7185"},{number:500,hexcode:"#f43f5e"},{number:600,hexcode:"#e11d48"},{number:700,hexcode:"#be123c"},{number:800,hexcode:"#9f1239"},{number:900,hexcode:"#881337"},{number:950,hexcode:"#4c0519"}]}];function w2(e){const r=_2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:$e.deltaE(e,a.hexcode)}))})).map(i=>({...i,closestShade:i.shades.reduce((a,l)=>a.delta<l.delta?a:l)})).reduce((i,a)=>i.closestShade.delta<a.closestShade.delta?i:a),o=r.shades.map(i=>({...i,lightnessDifference:Math.abs($e(i.hexcode).get("hsl.l")-e.get("hsl.l"))})),s=o.reduce((i,a)=>i.lightnessDifference<a.lightnessDifference?i:a);return{...r,shades:o,closestShade:s}}function E2(e){const t=$e(e),n=w2(t),r=t.get("hsl.h"),o=$e(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/$e(n.closestShade.hexcode).get("hsl.s");return n.shades.map(u=>{if(u.number===n.closestShade.number)return{number:u.number,hexcode:t.hex()};let c=$e(u.hexcode);const d=c.get("hsl.s")*a;return c=c.set("hsl.s",d),c=c.set("hsl.h",i),{number:u.number,hexcode:c.hex()}})}class Ju extends Error{constructor(){super(),this.name="IndiscriminateError"}}const x2={},k2={fill:"none",viewBox:"0 0 24 24"};function O2(e,t){return g(),T("svg",k2,t[0]||(t[0]=[j("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),j("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)]))}const Xt=Qn(x2,[["render",O2],["__scopeId","data-v-687bcaf0"]]),S2={"aria-hidden":"true"},Qu=he({__name:"MoonButtonBase",props:{label:{},successLabel:{},errorLabel:{},icon:{},variant:{},size:{},working:{type:Boolean},success:{type:Boolean},error:{type:Boolean},disabled:{type:Boolean},type:{}},emits:["click"],setup(e){const t=e,n=ve(Lt),r=se(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=se(()=>t.variant?t.variant==="secondary"?`secondary-${(n==null?void 0:n.value.theme.buttons)??"light"}`:t.variant:"primary");return(s,i)=>{var a,l;return g(),Q(jl(s.type==="anchor"?"a":"button"),{class:"moonbase:button",type:s.type||"button",disabled:s.success||s.error||s.working||s.disabled,"data-success":s.success||void 0,"data-error":s.error||void 0,"data-working":s.working||void 0,"data-variant":o.value,"data-size":s.size||"large","data-corners":(a=b(n))==null?void 0:a.theme.corners,"data-background":(l=b(n))==null?void 0:l.theme.colors.background,"data-icon-visible":s.working||s.success||s.error||!!s.icon||void 0,onClick:i[0]||(i[0]=u=>s.$emit("click",u))},{default:N(()=>[j("div",S2,[s.working?(g(),Q(Xt,{key:0})):s.success?(g(),Q(b(Z1),{key:1})):s.error?(g(),Q(b(X1),{key:2})):s.icon?(g(),Q(jl(s.icon),{key:3})):de("",!0)]),V(" "+F(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),st=he({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},icon:{},variant:{},size:{},noReset:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,n=R(!1),r=R(!1),o=R(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof Ju)return;o.value=!0,await Ht(2500),o.value=!1}}return(i,a)=>(g(),Q(Qu,{label:i.label,working:n.value,"success-label":i.success,success:r.value,"error-label":i.error,error:o.value,icon:i.icon,disabled:i.disabled,variant:i.variant,size:i.size,onClick:s},null,8,["label","working","success-label","success","error-label","error","icon","disabled","variant","size"]))}}),N2={},C2={class:"moonbase:text-body"};function T2(e,t){return g(),T("span",C2,[xt(e.$slots,"default")])}const tt=Qn(N2,[["render",T2]]),P2={},$2={class:"moonbase:text-subtext"};function A2(e,t){return g(),T("span",$2,[xt(e.$slots,"default")])}const Ve=Qn(P2,[["render",A2]]),D2={class:"moonbase:about"},I2=he({__name:"About",setup(e){const t=Te(),n="0.3.7";return(r,o)=>(g(),T("div",D2,[o[2]||(o[2]=Pf('<svg viewBox="0 0 512 512" height="56px" width="56px"><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)),w(b(qh),{as:"h3"},{default:N(()=>o[0]||(o[0]=[V(" Moonbase Embedded Storefront ")])),_:1}),w(Ve,null,{default:N(()=>[V(" Version "+F(b(n)),1)]),_:1}),w(tt,null,{default:N(()=>o[1]||(o[1]=[V(" This store is using the "),j("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),V(" module to accept payments, provide authentication and power software licensing. ")])),_:1}),w(st,{label:"Close",variant:"primary",handler:()=>b(t).reset()},null,8,["handler"])]))}});var qt=(e=>(e.SignedIn="signed-in",e.SignedUp="signed-up",e.SignedOut="signed-out",e.RedeemedVoucher="redeemed-voucher",e.DownloadedProduct="downloaded-product",e.ActivatedProduct="activated-product",e.AddedToCart="added-to-cart",e.CheckoutInitiated="checkout-initiated",e.CheckoutClosed="checkout-closed",e.CheckoutCompleted="checkout-completed",e))(qt||{});const M2=["data-corners","data-variant"],V2={class:"moonbase:card-content"},En=he({__name:"MoonCard",setup(e){const t=ve(Lt);return(n,r)=>{var o,s;return g(),T("div",{class:"moonbase:card","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-variant":(s=b(t))==null?void 0:s.theme.cards},[j("div",V2,[xt(n.$slots,"default")]),xt(n.$slots,"addon")],8,M2)}}}),R2=["data-corners"],L2=["src"],j2={key:1,class:"moonbase:image-placeholder"},Jt=he({__name:"ProductIcon",props:{url:{},size:{}},setup(e){const t=ve(Lt);return(n,r)=>{var o;return g(),T("div",{class:"moonbase:product-icon",style:Ri({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=b(t))==null?void 0:o.theme.corners},[n.url?(g(),T("img",{key:0,src:n.url,alt:""},null,8,L2)):(g(),T("div",j2,[w(b(Y1))]))],12,R2)}}}),F2={},U2={class:"moonbase:text-title"};function B2(e,t){return g(),T("h4",U2,[xt(e.$slots,"default")])}const Jo=Qn(F2,[["render",B2]]),H2={class:"moonbase:product-card-content"},Bp=he({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(g(),Q(En,{class:"moonbase:product-card"},{default:N(()=>[w(Jt,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",H2,[w(Jo,null,{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Ve,null,{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),xt(t.$slots,"description")]),xt(t.$slots,"default")]),_:3}))}}),q2={class:"moonbase:auto-activation"},W2={key:0,class:"moonbase:loader"},z2={key:1,class:"moonbase:loader"},Z2={key:2,class:"moonbase:loader"},Y2={key:3},G2={key:1,class:"moonbase:loader"},K2={key:2,class:"moonbase:loader"},X2={key:3,class:"moonbase:loader"},J2={key:4,class:"moonbase:auto-activation-content"},Q2={key:0,class:"moonbase:auto-activation-option"},eE={class:"moonbase:auto-activation-cta"},tE={key:1,class:"moonbase:auto-activation-option"},nE={class:"moonbase:auto-activation-cta"},rE={key:2,class:"moonbase:auto-activation-option"},oE={key:3,class:"moonbase:auto-activation-option"},sE={class:"moonbase:auto-activation-cta"},iE={key:4,class:"moonbase:auto-activation-option"},aE={key:4,class:"moonbase:auto-activation-cta"},lE={key:5,class:"moonbase:auto-activation-cta"},uE=he({__name:"AutoActivation",setup(e){const t=Te(),{user:n,loaded:r}=Qe(),o=ve(Vr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=cy(s),h=ve(nn);Je(i,m=>{var $;!l.value&&!u.value&&(m==null?void 0:m.status)===dn.Requested&&(($=m==null?void 0:m.licenseEligibility)!=null&&$.eligible)&&d(),(m==null?void 0:m.status)===dn.Completed&&(o==null||o(qt.ActivatedProduct,{product:m.product,fulfillmentType:m.fulfillmentType,user:n.value}))},{deep:!0});const p=se(()=>{if(i.value)return b(Xs(i.value.product.id))}),_=se(()=>p.value&&p.value.defaultVariation),{currency:E,addToCart:C,setQuantity:z}=Nr();function Z(){t.show(ae.Product,te.ViewProduct,{product_id:i.value.product.id})}function B(){t.enqueue(ae.Activation,te.ActivateProduct,t.parameters??void 0),t.show(ae.Authentication,te.SignIn)}function L(){if(!p.value)return;const m=C(p.value);z(m,1),t.enqueue(ae.Activation,te.ActivateProduct,t.parameters),t.show(ae.Cart,te.ViewCart)}function D(){var m;t.enqueue(ae.Activation,te.ActivateProduct,{...t.parameters,product_id:((m=i.value)==null?void 0:m.product.id)??""}),n.value?t.show(ae.Customer,te.RedeemVoucher):t.show(ae.Redeem,te.RedeemVoucher)}return(m,$)=>{var I,P,A,k,G,_e,O;return g(),T("div",q2,[b(a)||!b(r)||!((I=b(h))!=null&&I.loadedStorefront)?(g(),T("div",W2,[w(Xt)])):b(c)?(g(),T("div",z2,[w(et,null,{default:N(()=>$[0]||($[0]=[V(" Uh oh ")])),_:1}),w(tt,null,{default:N(()=>[V(F(b(c)),1)]),_:1})])):b(i)?(g(),T("div",Y2,[b(i).product?(g(),Q(Bp,{key:0,product:b(i).product},null,8,["product"])):de("",!0),((P=b(i))==null?void 0:P.status)===b(dn).Cancelled?(g(),T("div",G2,[w(et,null,{default:N(()=>$[3]||($[3]=[V(" Uh oh ")])),_:1}),w(tt,null,{default:N(()=>$[4]||($[4]=[V(" This activation request was cancelled, open your app to try again. ")])),_:1})])):b(l)||b(u)?(g(),T("div",K2,[w(Xt),w(tt,null,{default:N(()=>[V(" Activating "+F(b(i).product.name)+"... ",1)]),_:1})])):((A=b(i))==null?void 0:A.status)===b(dn).Completed?(g(),T("div",X2,[w(et,null,{default:N(()=>$[5]||($[5]=[V(" Done! ")])),_:1}),w(tt,null,{default:N(()=>$[6]||($[6]=[V(" Your product is activated. "),j("br",null,null,-1),V(" You may close this window and return to the app. ")])),_:1})])):(g(),T("div",J2,[_.value?(g(),T("div",Q2,[w(et,null,{default:N(()=>$[7]||($[7]=[V(" Option 1: Purchase product ")])),_:1}),w(tt,null,{default:N(()=>[V(" Buy a copy of "+F(p.value.name)+" for ",1),j("strong",null,F(b(yn)(p.value.defaultVariation.price[b(E)],b(E))),1),$[8]||($[8]=V(". "))]),_:1}),j("span",eE,[w(st,{label:"Purchase",variant:"primary",handler:()=>L()},null,8,["handler"])])])):de("",!0),b(n)?!b(n).ownedProducts||!((k=b(n).ownedProducts)!=null&&k.includes(b(i).product.id))&&!b(n).subscribedProducts||!((G=b(n).subscribedProducts)!=null&&G.includes(b(i).product.id))?(g(),T("div",rE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"2":"1")+": Use license ",1)]),_:1}),w(tt,null,{default:N(()=>$[10]||($[10]=[V(" You don't own any licenses for this product. ")])),_:1})])):(_e=b(n).ownedProducts)!=null&&_e.includes(b(i).product.id)||(O=b(n).subscribedProducts)!=null&&O.includes(b(i).product.id)?(g(),T("div",oE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"2":"1")+": Use license ",1)]),_:1}),w(tt,null,{default:N(()=>$[11]||($[11]=[V(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1}),j("span",sE,[w(st,{label:"Licenses",variant:"secondary",handler:()=>Z()},null,8,["handler"])])])):de("",!0):(g(),T("div",tE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"2":"1")+": Use license ",1)]),_:1}),w(tt,null,{default:N(()=>$[9]||($[9]=[V(" Please sign in to use a license for this product. ")])),_:1}),j("span",nE,[w(st,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])])),b(i).trialEligibility?(g(),T("div",iE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"3":"2")+": Start trial ",1)]),_:1}),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),Q(tt,{key:0},{default:N(()=>$[12]||($[12]=[V(" You need to be signed in to start a trial for this product. ")])),_:1})):b(i).trialEligibility.eligible&&b(i).trialEligibility.existing?(g(),Q(tt,{key:1},{default:N(()=>[V(" You are eligible for a "+F(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+F(b(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):b(i).trialEligibility.eligible?(g(),Q(tt,{key:2},{default:N(()=>[V(" You are eligible for a "+F(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(g(),Q(tt,{key:3},{default:N(()=>$[13]||($[13]=[V(" This device or product is not eligible for a trial. ")])),_:1})),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),T("span",aE,[w(st,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])):b(i).trialEligibility.eligible?(g(),T("span",lE,[w(st,{label:"Start trial",variant:"secondary",handler:b(f)},null,8,["handler"])])):de("",!0)])):de("",!0),$[15]||($[15]=j("div",{class:"moonbase:grow"},null,-1)),w(Ve,{class:"moonbase:auto-activation-redeem"},{default:N(()=>[$[14]||($[14]=V(" Have a voucher code? ")),j("button",{type:"button",onClick:D}," Redeem now ")]),_:1})]))])):(g(),T("div",Z2,[w(et,null,{default:N(()=>$[1]||($[1]=[V(" Uh oh ")])),_:1}),w(tt,null,{default:N(()=>$[2]||($[2]=[V(" Could not find activation request ")])),_:1})]))])}}}),cE={},dE={class:"moonbase:text-caption"};function fE(e,t){return g(),T("span",dE,[xt(e.$slots,"default")])}const Dr=Qn(cE,[["render",fE]]),hE=["data-corners"],pE=["accept"],mE={"data-error":""},bE=he({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=ve(Lt),o=R(!1),s=se(()=>{let u=".dt";return r!=null&&r.value&&(u=r.value.activation.deviceTokenFileExtension),u.startsWith(".")?u:`.${u}`});function i(u){const c=new FileReader;c.onload=d=>{var f;n("input",(f=d.target)==null?void 0:f.result)},c.readAsText(u)}function a(u){var d;o.value=!1;const c=(d=u.dataTransfer)==null?void 0:d.files;if(!c||c.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(c[0])}function l(u){const c=u.target,d=c==null?void 0:c.files;if(!d||d.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(d[0])}return(u,c)=>{var d,f;return g(),T("div",{class:ks(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=b(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=Sr(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=Sr(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=Sr(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=Sr(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=Sr(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=Sr(h=>o.value=!1,["prevent","stop"])),onDrop:Sr(a,["prevent","stop"])},[w(b(K1)),c[6]||(c[6]=j("label",{for:"fallback-input"},[j("span",{class:"moonbase:underline"},"Choose a machine file"),V(" or drag here to upload ")],-1)),j("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,pE),j("p",mE,F((f=u.error)==null?void 0:f.message),1)],42,hE)}}}),gE={class:"moonbase:manual-activation"},vE={key:1,class:"moonbase:loader"},yE={key:2,class:"moonbase:manual-activation-content"},_E=he({__name:"ManualActivation",setup(e){const t=ve(Lt),{activateProduct:n}=so(),r=Ai.Offline,o=R(0),s=R(null),i=R(null);async function a(l){o.value=1;try{i.value=await n(l,r),o.value=2}catch(u){s.value=u,o.value=0}}return(l,u)=>(g(),T("div",gE,[w(tt,null,{default:N(()=>u[2]||(u[2]=[V(" Upload your machine file here to get a license file for activating offline devices. The machine file can be generated in the installed app. ")])),_:1}),w(Ys,{mode:"out-in",name:"moonbase:slide-left"},{default:N(()=>[o.value===0?(g(),Q(bE,{key:0,error:s.value,onInput:u[0]||(u[0]=c=>a(c)),onError:u[1]||(u[1]=c=>s.value=c)},null,8,["error"])):o.value===1?(g(),T("div",vE,[w(Xt)])):o.value===2&&i.value?(g(),T("div",yE,[w(et,null,{default:N(()=>u[3]||(u[3]=[V(" Success! ")])),_:1}),w(tt,null,{default:N(()=>u[4]||(u[4]=[V(" Your license can be downloaded below: ")])),_:1}),i.value.license.product?(g(),Q(Bp,{key:0,product:i.value.license.product},{description:N(()=>[w(Dr,null,{default:N(()=>[V(F(i.value.license.activeNumberOfActivations)+" of "+F(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:N(()=>{var c;return[w(Bo,{href:i.value.url,target:"_blank",download:((c=b(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:N(()=>[w(b(G1))]),_:1},8,["href","download"])]}),_:1},8,["product"])):de("",!0),u[5]||(u[5]=j("div",null,null,-1)),u[6]||(u[6]=j("div",null,null,-1))])):de("",!0)]),_:1})]))}}),wE={class:"moonbase:activation"},EE=he({__name:"Activation",setup(e){const t=Te();return(n,r)=>(g(),T("div",wE,[b(t).getParameter("token")?(g(),Q(uE,{key:0})):(g(),Q(_E,{key:1}))]))}}),xE=["disabled"],Hp=Symbol("form-state"),or=he({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=R(!1),r=R(!1),o=R(!1),s=se(()=>t.disabled||n.value||r.value||!1);Bt(Hp,{working:n,isSuccess:r,isError:o,disabled:s});async function i(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Ht(2500),o.value=!1}}return(a,l)=>(g(),T("form",{disabled:s.value,onSubmit:Sr(i,["prevent"])},[xt(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,xE))}}),kE=["hidden"],OE=["for"],SE=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],NE=["id"],CE=["id"],Nt=he({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=ve(Lt);return(n,r)=>{var o;return g(),T("div",{class:"moonbase:input",hidden:n.hidden||void 0},[j("label",{for:`mb-${n.name}`},F(n.label),9,OE),j("input",Ql({id:`mb-${n.name}`,type:n.type??"text",name:`mb-${n.name}`,placeholder:n.placeholder,value:n.modelValue,disabled:n.disabled,"aria-invalid":!!n.error,"aria-describedby":n.error?`mb-${n.name}-error`:n.hint?`mb-${n.name}-hint`:void 0,"data-corners":(o=b(t))==null?void 0:o.theme.corners},n.$attrs,{onInput:r[0]||(r[0]=s=>{var i;return n.$emit("update:modelValue",(i=s.target)==null?void 0:i.value)})}),null,16,SE),n.error?(g(),T("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},F(n.error),9,NE)):n.hint?(g(),T("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},F(n.hint),9,CE)):de("",!0)],8,kE)}}}),sr=he({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=ve(Hp);return(s,i)=>(g(),Q(Qu,{label:s.label,working:b(t),"success-label":s.success,success:b(n),"error-label":s.error,error:b(r),type:"submit",disabled:b(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),TE=["data-visible"],PE={class:"moonbase:sign-in-actions"},$E=he({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=ve(Lt),i=ve(Vr),a=R(r.getParameter("email")??""),l=R(""),u=R(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(qt.SignedIn,{user:d}),Ht(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof pr?u.value="User not found":u.value=d.message,d}}return(d,f)=>(g(),Q(or,{handler:c,class:"moonbase:sign-in"},{default:N(()=>{var h;return[w(Nt,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=p=>a.value=p),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=p=>l.value=p),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},F(u.value),9,TE),w(sr,{success:"Signed in",label:"Sign in",error:"Error"}),j("div",PE,[(h=b(s))!=null&&h.auth.signUp.enabled?(g(),Q(st,{key:0,label:"Create account",variant:"subtle",handler:()=>b(r).show(b(ae).Authentication,b(te).SignUp,{email:a.value})},null,8,["handler"])):de("",!0),w(st,{label:"Forgot password",variant:"subtle",handler:()=>b(r).show(b(ae).Authentication,b(te).ForgotPassword,{email:a.value})},null,8,["handler"])])]}),_:1}))}}),Qo=[{title:"Password must be at least 6 characters long",test:e=>e.length>=6},{title:"Password must contain uppercase letters",test:e=>/[A-Z]/.test(e)},{title:"Password must contain lowercase letters",test:e=>/[a-z]/.test(e)},{title:"Password must contain at least one number",test:e=>/\d/.test(e)},{title:"Password must contain at least one special character",test:e=>/[=+\-^$*.[\\\]{}()?!@#%&/,><':;|_~`]/.test(e)}],AE={key:0,class:"moonbase:loader"},DE={key:1,class:"moonbase:error","data-visible":""},IE={key:0,class:"moonbase:password-validation"},ME=["data-visible"],VE=he({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=R(!0),i=R(null),a=R(""),l=R(!1),u=R(null),c=se(()=>Qo.some(f=>!f.test(a.value)));Ue(async()=>{try{const f=r.getParameter("email"),h=r.getParameter("code");if(!f||!h)throw new Error("Link is broken");i.value=await o.confirmAccount(f,h)}catch(f){f instanceof pr?u.value="Could not find a user to confirm":u.value=f.message}s.value=!1});async function d(){var f,h;if(u.value=null,!!((f=i.value)!=null&&f.resetPasswordToken))try{const p=r.getParameter("email");await o.resetPassword(p,a.value,(h=i.value)==null?void 0:h.resetPasswordToken);const _=await o.signIn(p,a.value);Ht(1500).then(()=>n("confirmedAccount",_))}catch(p){throw u.value=p.message,p}}return(f,h)=>(g(),Q(or,{handler:d,disabled:c.value,class:"moonbase:confirm-account"},{default:N(()=>[s.value?(g(),T("div",AE,[w(Xt)])):i.value?(g(),T(De,{key:2},[j("h3",null," Hi "+F(i.value.name)+", ",1),h[2]||(h[2]=j("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=p=>a.value=p),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:h[1]||(h[1]=p=>l.value=!0)},null,8,["modelValue"]),l.value&&c.value?(g(),T("div",IE,[(g(!0),T(De,null,yt(b(Qo).filter(p=>!p.test(a.value)),p=>(g(),Q(Ve,{key:p.title,"data-error":""},{default:N(()=>[V(F(p.title),1)]),_:2},1024))),128))])):de("",!0),w(sr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},F(u.value),9,ME)],64)):(g(),T("div",DE,F(u.value),1))]),_:1},8,["disabled"]))}}),RE={class:"moonbase:confirm-email-change"},LE={key:0,class:"moonbase:loader"},jE={key:1,class:"moonbase:error","data-visible":""},FE=he({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Te(),{user:o,confirmEmail:s}=Qe(),i=R(!0),a=R(null);return Ue(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(g(),T("div",RE,[i.value?(g(),T("div",LE,[w(Xt)])):a.value?(g(),T("div",jE,F(a.value),1)):(g(),T(De,{key:2},[w(et,null,{default:N(()=>u[0]||(u[0]=[V(" Success! ")])),_:1}),u[1]||(u[1]=j("p",null," Thanks for confirming your new email. ",-1)),b(o)?(g(),Q(st,{key:0,handler:()=>b(r).show(b(ae).Customer,b(te).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):de("",!0)],64))]))}}),UE={class:"moonbase:confirm-email-change"},BE={key:0,class:"moonbase:loader"},HE={key:1,class:"moonbase:error","data-visible":""},qE=he({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Te(),{user:o,confirmEmailChange:s}=Qe(),i=R(!0),a=R(null);return Ue(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return g(),T("div",UE,[i.value?(g(),T("div",BE,[w(Xt)])):a.value?(g(),T("div",HE,F(a.value),1)):(g(),T(De,{key:2},[j("h3",null," Hi "+F((c=b(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=j("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),WE=["data-visible"],zE=he({__name:"ForgotPassword",setup(e){const t=Te(),n=Qe(),r=R(t.getParameter("email")??""),o=R(null),s=R(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Ht(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof pr?o.value="User not found":o.value=a.message,a}}return(a,l)=>(g(),Q(or,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:N(({disabled:u})=>[l[1]||(l[1]=j("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),w(Nt,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:"",disabled:u},null,8,["modelValue","disabled"]),w(sr,{success:"Email sent",label:"Reset password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},F(o.value),9,WE)]),_:1}))}}),ZE={key:0,class:"moonbase:password-validation"},YE=["data-visible"],GE=he({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=se(()=>r.getParameter("email")),i=R(""),a=R(!1),l=R(null),u=se(()=>Qo.some(d=>!d.test(i.value)));Ue(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(l.value="Link broken, please try again")});async function c(){l.value=null;const d=r.getParameter("code");if(d)try{await o.resetPassword(s.value,i.value,d);const f=await o.signIn(s.value,i.value);Ht(1500).then(()=>n("passwordReset",f))}catch(f){throw l.value=f.message,f}}return(d,f)=>(g(),Q(or,{handler:c,disabled:u.value,class:"moonbase:reset-password"},{default:N(()=>[j("h3",null," Hi "+F(s.value)+", ",1),f[2]||(f[2]=j("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=h=>i.value=h),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:f[1]||(f[1]=h=>a.value=!0)},null,8,["modelValue"]),a.value&&u.value?(g(),T("div",ZE,[(g(!0),T(De,null,yt(b(Qo).filter(h=>!h.test(i.value)),h=>(g(),Q(Ve,{key:h.title,"data-error":""},{default:N(()=>[V(F(h.title),1)]),_:2},1024))),128))])):de("",!0),w(sr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!l.value||void 0},F(l.value),9,YE)]),_:1},8,["disabled"]))}}),KE={class:"moonbase:checkbox"},XE={class:"moonbase:checkbox-container"},JE=["id","name","value","disabled","aria-invalid","aria-describedby"],QE={class:"moonbase:checkbox-description"},e5=["for"],t5=["id"],n5=["id"],qp=he({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(g(),T("div",KE,[j("div",XE,[j("input",Ql({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,JE)]),j("div",QE,[j("label",{for:`mb-${t.name}`},F(t.label),9,e5),t.error?(g(),T("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},F(t.error),9,t5)):t.hint?(g(),T("p",{key:1,id:`mb-${t.name}-hint`},F(t.hint),9,n5)):de("",!0)])]))}}),r5={key:0,class:"moonbase:password-validation"},o5=["href"],s5=["href"],i5=["data-visible"],a5=he({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=ve(nc),i=ve(Vr),a=R(""),l=R(r.getParameter("email")??""),u=R(""),c=R(!1),d=R(!1),f=R(null),h=se(()=>Qo.some(_=>!_.test(u.value)));async function p(){f.value=null;try{const _=await o.signUp(a.value,l.value,u.value,null,!0,!0,d.value);i==null||i(qt.SignedUp,{user:_}),Ht(1500).then(()=>n("signedUp",_))}catch(_){throw f.value=_.message,_}}return(_,E)=>(g(),Q(or,{handler:p,disabled:h.value,class:"moonbase:sign-up"},{default:N(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=C=>a.value=C),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":E[1]||(E[1]=C=>l.value=C),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:u.value,"onUpdate:modelValue":E[2]||(E[2]=C=>u.value=C),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:E[3]||(E[3]=C=>c.value=!0)},null,8,["modelValue"]),c.value&&h.value?(g(),T("div",r5,[(g(!0),T(De,null,yt(b(Qo).filter(C=>!C.test(u.value)),C=>(g(),Q(Ve,{key:C.title,"data-error":""},{default:N(()=>[V(F(C.title),1)]),_:2},1024))),128))])):de("",!0),w(qp,{modelValue:d.value,"onUpdate:modelValue":E[4]||(E[4]=C=>d.value=C),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),w(Ve,null,{default:N(()=>[E[5]||(E[5]=V(" By signing up, you accept our ")),j("a",{href:`${b(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,o5),E[6]||(E[6]=V(" and ")),j("a",{href:`${b(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,s5),E[7]||(E[7]=V(". "))]),_:1}),w(sr,{success:"Signed up",label:"Sign up",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!f.value||void 0},F(f.value),9,i5),w(st,{label:"I already have an account",variant:"subtle",handler:()=>b(r).show(b(ae).Authentication,b(te).SignIn,{email:l.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),l5={class:"moonbase:authentication"},u5={key:0,class:"moonbase:loader"},c5=he({__name:"Authentication",setup(e){const t=Te(),{loaded:n}=Qe();return(r,o)=>(g(),T("div",l5,[w(Ys,{name:b(t).direction===b(bu).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:N(()=>[b(n)?b(t).intent===b(te).SignIn?(g(),Q($E,{key:1,onSignedIn:o[0]||(o[0]=s=>b(t).dequeue())})):b(t).intent===b(te).SignUp?(g(),Q(a5,{key:2,onSignedUp:o[1]||(o[1]=s=>b(t).next?b(t).dequeue():b(t).show(b(ae).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmAccount?(g(),Q(VE,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>b(t).show(b(ae).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmEmail?(g(),Q(FE,{key:4})):b(t).intent===b(te).ConfirmEmailChange?(g(),Q(qE,{key:5})):b(t).intent===b(te).ForgotPassword?(g(),Q(zE,{key:6})):b(t).intent===b(te).ResetPassword?(g(),Q(GE,{key:7,onPasswordReset:o[3]||(o[3]=s=>b(t).show(b(ae).Customer,b(te).ViewAccount,void 0))})):de("",!0):(g(),T("div",u5,[w(Xt)]))]),_:1},8,["name"])]))}}),d5={},f5={class:"moonbase:text-subtext-bold"};function h5(e,t){return g(),T("span",f5,[xt(e.$slots,"default")])}const Ct=Qn(d5,[["render",h5]]),p5=["data-corners","data-cards"],Wp=he({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=ve(Lt);return(n,r)=>{var o,s;return g(),T("div",{class:"moonbase:counter","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-cards":(s=b(t))==null?void 0:s.theme.cards},[j("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[w(b(J1))]),w(Ve,null,{default:N(()=>[V(F(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),j("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[w(b(Q1))])],8,p5)}}});function ec(e){switch(e){case fr.Daily:return"day";case fr.Weekly:return"week";case fr.Monthly:return"month";case fr.Quarterly:return"quarter";case fr.Yearly:return"year"}throw new Error("Unknown cycle length")}const m5={class:"moonbase:bundle-cart-item-content"},b5={key:0,class:"moonbase:bundle-cart-item-total"},g5={key:0,class:"moonbase:discount"},v5={class:"moonbase:bundle-cart-item-summary"},y5=["data-open"],_5=["data-open"],w5={class:"moonbase:bundle-cart-item-product-list-item-content"},E5={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},x5=he({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=ba(e.lineItem.bundleId),r=Nr(),o=R(!1),s=R(null);return Je(o,i=>{s.value&&(s.value.style.height=i?`${s.value.scrollHeight}px`:"0px")}),(i,a)=>(g(),Q(En,{class:"moonbase:bundle-cart-item"},{addon:N(()=>{var l;return[j("div",v5,[i.lineItem.bundle?(g(),T("button",{key:0,onClick:a[1]||(a[1]=u=>o.value=!o.value)},[w(Ct,null,{default:N(()=>{var u,c,d;return[V(F((u=i.lineItem.bundle)==null?void 0:u.products.filter(f=>f.included).length)+" ",1),(c=i.lineItem.bundle)!=null&&c.products.some(f=>!f.included)?(g(),T(De,{key:0},[V(" of "+F((d=i.lineItem.bundle)==null?void 0:d.products.length),1)],64)):de("",!0),a[2]||(a[2]=V(" products "))]}),_:1}),w(Ve,null,{default:N(()=>[V(F(o.value?"Hide":"Show")+" ",1),(g(),T("svg",{"data-open":o.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},a[3]||(a[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,y5))]),_:1})])):de("",!0)]),j("div",{ref_key:"productListRef",ref:s,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":o.value||void 0},[(g(!0),T(De,null,yt(((l=i.lineItem.bundle)==null?void 0:l.products)||[],u=>(g(),T("div",{key:u.id,class:"moonbase:bundle-cart-item-product-list-item"},[w(Jt,{url:u==null?void 0:u.iconUrl,size:48},null,8,["url"]),j("div",w5,[w(Ct,{"data-included":u.included||void 0},{default:N(()=>[u.included?(g(),T("svg",E5,a[4]||(a[4]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):de("",!0),V(" "+F(u==null?void 0:u.name),1)]),_:2},1032,["data-included"]),u.included?u!=null&&u.tagline?(g(),Q(Ve,{key:1},{default:N(()=>[V(F(u.tagline),1)]),_:2},1024)):de("",!0):(g(),Q(Ve,{key:0},{default:N(()=>a[5]||(a[5]=[V(" You already own this ")])),_:1}))])]))),128))],8,_5)]}),default:N(()=>{var l,u,c,d,f;return[w(Jt,{url:(l=i.lineItem.bundle)==null?void 0:l.iconUrl,size:72},null,8,["url"]),j("div",m5,[w(Ct,null,{default:N(()=>{var h;return[V(F((h=i.lineItem.bundle)==null?void 0:h.name),1)]}),_:1}),w(Ve,{class:"moonbase:bundle-cart-item-tagline","data-truncate":i.lineItem.variation&&i.lineItem.variation.id!==((c=(u=b(n))==null?void 0:u.defaultVariation)==null?void 0:c.id)||void 0},{default:N(()=>{var h;return[V(F((h=i.lineItem.bundle)==null?void 0:h.tagline),1)]}),_:1},8,["data-truncate"]),i.lineItem.variation&&i.lineItem.variation.id!==((f=(d=b(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)?(g(),Q(Ve,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:N(()=>[V(F(i.lineItem.variation.name),1)]),_:1})):de("",!0)]),i.lineItem.variation?(g(),T("div",b5,[w(li,null,{default:N(()=>{var h;return[i.lineItem.variation.hasDiscount?(g(),T("span",g5,F(b(yn)(i.lineItem.variation.originalPrice[i.currency]*i.lineItem.quantity,i.currency)),1)):de("",!0),V(" "+F(b(yn)(i.lineItem.variation.price[i.currency]*i.lineItem.quantity,i.currency))+" ",1),((h=i.lineItem.variation)==null?void 0:h.recurrence.type)==="Recurring"?(g(),Q(tt,{key:1},{default:N(()=>[V(" / "+F(b(ec)(i.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):de("",!0)]}),_:1}),w(Wp,{"model-value":i.lineItem.quantity,"onUpdate:modelValue":a[0]||(a[0]=h=>b(r).setQuantity(i.lineItem,h))},null,8,["model-value"])])):de("",!0)]}),_:1}))}}),k5={class:"moonbase:product-cart-item-content"},O5={class:"moonbase:product-cart-item-total"},S5={key:0,class:"moonbase:discount"},N5=he({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=Xs(t.lineItem.productId);function r(a){var u;if(!a.variation)throw new Error("No variation found");const l=s(a);return(l==null?void 0:l.price[t.currency])??((u=a.variation)==null?void 0:u.price[t.currency])}function o(a){return!!s(a)}function s(a){var u,c;const l=((c=(u=a.variation)==null?void 0:u.pricingTiers)==null?void 0:c.filter(d=>a.quantity>=d.minQuantity))??[];return l.length>0?l[l.length-1]:null}const i=Nr();return(a,l)=>(g(),Q(En,{class:"moonbase:product-cart-item"},{default:N(()=>{var u,c,d,f,h;return[w(Jt,{url:(u=a.lineItem.product)==null?void 0:u.iconUrl,size:72},null,8,["url"]),j("div",k5,[w(Ct,null,{default:N(()=>{var p;return[V(F((p=a.lineItem.product)==null?void 0:p.name),1)]}),_:1}),w(Ve,{class:"moonbase:product-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((d=(c=b(n))==null?void 0:c.defaultVariation)==null?void 0:d.id)||void 0},{default:N(()=>{var p;return[V(F((p=a.lineItem.product)==null?void 0:p.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((h=(f=b(n))==null?void 0:f.defaultVariation)==null?void 0:h.id)?(g(),Q(Ve,{key:0,class:"moonbase:product-cart-item-variation"},{default:N(()=>[V(F(a.lineItem.variation.name),1)]),_:1})):de("",!0)]),j("div",O5,[a.lineItem.variation?(g(),Q(li,{key:0},{default:N(()=>{var p;return[a.lineItem.variation.hasDiscount||o(a.lineItem)?(g(),T("span",S5,F(b(yn)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):de("",!0),V(" "+F(b(yn)(r(a.lineItem)*a.lineItem.quantity,a.currency))+" ",1),((p=a.lineItem.variation)==null?void 0:p.recurrence.type)==="Recurring"?(g(),Q(tt,{key:1},{default:N(()=>[V(" / "+F(b(ec)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):de("",!0)]}),_:1})):de("",!0),w(Wp,{"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=p=>b(i).setQuantity(a.lineItem,p))},null,8,["model-value"])])]}),_:1}))}}),C5={class:"moonbase:cart"},T5=["data-background"],P5=["data-corners"],$5={class:"moonbase:cart-total"},A5={"data-error":""},D5=he({__name:"Cart",setup(e){const{items:t,total:n,currency:r,checkout:o}=Nr(),s=ve(Lt),i=R(null);async function a(){i.value=null;try{const l=await o({redirect:(s==null?void 0:s.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(l!=null&&l.completed))throw new Ju}catch(l){throw i.value=l.message,l}}return(l,u)=>{var c,d;return g(),T("div",C5,[b(t).length>0?(g(),T("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(c=b(s))==null?void 0:c.theme.colors.background},[(g(!0),T(De,null,yt(b(t),f=>(g(),T("li",{key:f.id},[f.type==="Product"?(g(),Q(N5,{key:0,"line-item":f,currency:b(r)},null,8,["line-item","currency"])):f.type==="Bundle"?(g(),Q(x5,{key:1,"line-item":f,currency:b(r)},null,8,["line-item","currency"])):de("",!0)]))),128))],8,T5)):(g(),T("div",{key:1,class:"moonbase:cart-empty","data-corners":(d=b(s))==null?void 0:d.theme.corners},[w(b(e_)),w(Ct,null,{default:N(()=>u[0]||(u[0]=[V(" Your cart is empty ")])),_:1})],8,P5)),j("div",$5,[u[1]||(u[1]=j("label",null," Total ",-1)),j("span",null,F(b(yn)(b(n).amount,b(n).currency)),1),u[2]||(u[2]=j("p",null," Sales tax to be calculated at checkout ",-1)),j("p",A5,F(i.value),1)]),w(st,{handler:a,disabled:b(t).length===0,label:"Checkout",error:i.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),I5={class:"moonbase:account"},M5={key:0,class:"moonbase:error"},V5={key:1,class:"moonbase:notification"},R5={key:0,class:"moonbase:error"},L5=he({__name:"Account",setup(e){var z,Z,B;const t=Te(),{user:n,update:r,setPassword:o,signOut:s}=Qe(),i=ve(Vr),a=R(((z=n.value)==null?void 0:z.name)??""),l=R(((Z=n.value)==null?void 0:Z.email)??""),u=R(((B=n.value)==null?void 0:B.communicationPreferences)??{newsletterOptIn:!1}),c=R(null),d=R(!1),f=R(""),h=R(""),p=R(null);async function _(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(L){throw c.value=L,L}}async function E(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(L){throw p.value=L,L}}async function C(){const L={...n.value};await s(),i==null||i(qt.SignedOut,{user:L}),t.reset()}return(L,D)=>(g(),T("div",I5,[w(or,{handler:_},{default:N(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=m=>a.value=m),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":D[1]||(D[1]=m=>l.value=m),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),w(qp,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":D[2]||(D[2]=m=>u.value.newsletterOptIn=m),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),w(sr,{label:"Update",error:"Error",success:"Updated"}),c.value?(g(),T("p",M5,F(c.value.message),1)):d.value?(g(),T("p",V5," You need to confirm your new email address, please check your inbox ")):de("",!0)]),_:1}),w(or,{handler:E},{default:N(()=>[w(Nt,{modelValue:f.value,"onUpdate:modelValue":D[3]||(D[3]=m=>f.value=m),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),w(Nt,{modelValue:h.value,"onUpdate:modelValue":D[4]||(D[4]=m=>h.value=m),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),w(sr,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(g(),T("p",R5,F(p.value.message),1)):de("",!0)]),_:1}),w(st,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:C})]))}}),j5={class:"moonbase:products"},F5={key:0},U5={colspan:"2"},B5={key:1},H5=he({__name:"Products",setup(e){const t=Te(),{getProducts:n}=so(),r=R(null);return Ue(async()=>{let o=await n();for(r.value=o.items;o.hasMore&&o.next;)o=await n(o.next),r.value.push(...o.items)}),(o,s)=>(g(),T("table",j5,[j("tbody",null,[r.value?r.value.length===0?(g(),T("tr",B5,s[2]||(s[2]=[j("td",{colspan:"2"}," No products found ",-1)]))):de("",!0):(g(),T("tr",F5,[j("td",U5,[w(Xt),s[0]||(s[0]=V(" Loading products.. "))]),s[1]||(s[1]=j("td",null,null,-1))])),(g(!0),T(De,null,yt(r.value||[],i=>(g(),T("tr",{key:i.id},[j("td",null,[j("div",null,[w(Jt,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(g(),Q(Ve,{key:0},{default:N(()=>[V(F((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):de("",!0)])])]),j("td",null,[w(Bo,{variant:"subtle",ca:"",onClick:a=>b(t).show(b(ae).Product,b(te).ViewProduct,{product_id:i.id})},{default:N(()=>[w(b(Xh)),s[3]||(s[3]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])]))),128))])]))}}),q5={class:"moonbase:bundle-redemption-item-content"},W5={class:"moonbase:bundle-redemption-item-summary"},z5=["data-open"],Z5=["data-open"],zp=he({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=R(!1),n=R(null);return Je(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(g(),Q(En,{class:"moonbase:bundle-redemption-item"},{addon:N(()=>{var s;return[j("div",W5,[r.bundle?(g(),T("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[w(Ct,null,{default:N(()=>{var i;return[V(F((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),w(Ve,null,{default:N(()=>[V(F(t.value?"Hide":"Show")+" ",1),(g(),T("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,z5))]),_:1})])):de("",!0)]),j("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(g(!0),T(De,null,yt(((s=r.bundle)==null?void 0:s.products)||[],i=>(g(),T("div",{key:i.id},[w(Jt,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(i.name),1)]),_:2},1024),i.tagline?(g(),Q(Ve,{key:0},{default:N(()=>[V(F(i.tagline),1)]),_:2},1024)):de("",!0)])]))),128))],8,Z5)]}),default:N(()=>[w(Jt,{url:r.bundle.iconUrl,size:72},null,8,["url"]),j("div",q5,[w(Ct,null,{default:N(()=>{var s;return[V(F((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),w(Ve,{class:"moonbase:bundle-redemption-item-tagline"},{default:N(()=>{var s;return[V(F((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),Y5={class:"moonbase:product-redemption-item-content"},Zp=he({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(g(),Q(En,{class:"moonbase:product-redemption-item"},{default:N(()=>[w(Jt,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",Y5,[w(Ct,null,{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Ve,{class:"moonbase:product-redemption-item-tagline"},{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),G5={class:"moonbase:redeem"},K5=["data-visible"],X5={key:1,class:"moonbase:redeem-voucher"},J5={key:0,class:"moonbase:redeem-voucher-content"},Q5={key:1,class:"moonbase:redeem-voucher-return"},ex=he({__name:"Redeem",setup(e){const{redeem:t}=ih(),n=Te(),r=Qe(),o=ve(Vr),s=R(null),i=R(null),a=R(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(qt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(g(),T("div",G5,[w(Ys,{mode:"out-in",name:"moonbase:slide-left"},{default:N(()=>[s.value?(g(),T("div",X5,[j("div",null,[w(Jo,null,{default:N(()=>[V(F(s.value.name),1)]),_:1}),s.value.description?(g(),Q(et,{key:0},{default:N(()=>[V(' "'+F(s.value.description)+'" ',1)]),_:1})):de("",!0),w(Ve,null,{default:N(()=>[w(b(z1)),c[2]||(c[2]=V(" Licenses have been added to your account. "))]),_:1}),w(Ve,null,{default:N(()=>[c[3]||(c[3]=V(" Code: ")),j("strong",null,F(s.value.code),1)]),_:1})]),w(et,null,{default:N(()=>c[4]||(c[4]=[V(" Voucher summary ")])),_:1}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(g(),T("div",J5,[(g(!0),T(De,null,yt(s.value.redeemsProducts,({value:d,quantity:f})=>(g(),Q(Zp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),T(De,null,yt(s.value.redeemsBundles,({value:d,quantity:f})=>(g(),Q(zp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):de("",!0),b(n).next&&b(n).next[0]===b(ae).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=b(n).next)==null?void 0:f[2])==null?void 0:h.product_id)})||s.value.redeemsBundles.some(d=>d.value.products.some(f=>{var h,p;return f.id===((p=(h=b(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(g(),T("div",Q5,[w(st,{label:"Return to activation",variant:"primary",icon:b(W1),handler:()=>b(n).dequeue()},null,8,["icon","handler"])])):de("",!0)])):(g(),Q(or,{key:0,handler:l},{default:N(()=>{var d;return[w(tt,null,{default:N(()=>c[1]||(c[1]=[V(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),V(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(sr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!i.value||void 0},F((d=i.value)==null?void 0:d.message),9,K5)]}),_:1}))]),_:1})]))}}),Yp=6048e5,tx=864e5,ja=43200,Gp=1440,Kp=Symbol.for("constructDateFrom");function ir(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kp in e?e[Kp](t):e instanceof Date?new e.constructor(t):new Date(t)}function vt(e,t){return ir(t||e,e)}let nx={};function ci(){return nx}function di(e,t){var a,l,u,c;const n=ci(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=vt(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Fa(e,t){return di(e,{...t,weekStartsOn:1})}function Xp(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=ir(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Fa(o),i=ir(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Fa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Ua(e){const t=vt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ba(e,...t){const n=ir.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Jp(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function rx(e,t,n){const[r,o]=Ba(n==null?void 0:n.in,e,t),s=Jp(r),i=Jp(o),a=+s-Ua(s),l=+i-Ua(i);return Math.round((a-l)/tx)}function ox(e,t){const n=Xp(e,t),r=ir(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Fa(r)}function Ha(e,t){const n=+vt(e)-+vt(t);return n<0?-1:n>0?1:n}function sx(e){return ir(e,Date.now())}function ix(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ax(e){return!(!ix(e)&&typeof e!="number"||isNaN(+vt(e)))}function lx(e,t,n){const[r,o]=Ba(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function ux(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function cx(e,t){return+vt(e)-+vt(t)}function dx(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function fx(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function hx(e,t){const n=vt(e,t==null?void 0:t.in);return+dx(n,t)==+fx(n,t)}function px(e,t,n){const[r,o,s]=Ba(n==null?void 0:n.in,e,e,t),i=Ha(o,s),a=Math.abs(lx(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=Ha(o,s)===-i;hx(r)&&a===1&&Ha(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function mx(e,t,n){const r=cx(e,t)/1e3;return ux(n==null?void 0:n.roundingMethod)(r)}function bx(e,t){const n=vt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const gx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vx=(e,t,n)=>{let r;const o=gx[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function tc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const yx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_x={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ex={date:tc({formats:yx,defaultWidth:"full"}),time:tc({formats:_x,defaultWidth:"full"}),dateTime:tc({formats:wx,defaultWidth:"full"})},xx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kx=(e,t,n,r)=>xx[e];function fi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Ox={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Nx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Cx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Tx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Px={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},$x={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:fi({values:Ox,defaultWidth:"wide"}),quarter:fi({values:Sx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fi({values:Nx,defaultWidth:"wide"}),day:fi({values:Cx,defaultWidth:"wide"}),dayPeriod:fi({values:Tx,defaultWidth:"wide",formattingValues:Px,defaultFormattingWidth:"wide"})};function hi(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Dx(a,d=>d.test(i)):Ax(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function Ax(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Dx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ix(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const Mx=/^(\d+)(th|st|nd|rd)?/i,Vx=/\d+/i,Rx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lx={any:[/^b/i,/^(a|c)/i]},jx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fx={any:[/1/i,/2/i,/3/i,/4/i]},Ux={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Zx={ordinalNumber:Ix({matchPattern:Mx,parsePattern:Vx,valueCallback:e=>parseInt(e,10)}),era:hi({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),quarter:hi({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hi({matchPatterns:Ux,defaultMatchWidth:"wide",parsePatterns:Bx,defaultParseWidth:"any"}),day:hi({matchPatterns:Hx,defaultMatchWidth:"wide",parsePatterns:qx,defaultParseWidth:"any"}),dayPeriod:hi({matchPatterns:Wx,defaultMatchWidth:"any",parsePatterns:zx,defaultParseWidth:"any"})},Qp={code:"en-US",formatDistance:vx,formatLong:Ex,formatRelative:kx,localize:$x,match:Zx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yx(e,t){const n=vt(e,t==null?void 0:t.in);return rx(n,bx(n))+1}function Gx(e,t){const n=vt(e,t==null?void 0:t.in),r=+Fa(n)-+ox(n);return Math.round(r/Yp)+1}function em(e,t){var c,d,f,h;const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=ci(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=ir((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=di(i,t),l=ir((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=di(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function Kx(e,t){var a,l,u,c;const n=ci(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=em(e,t),s=ir((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),di(s,t)}function Xx(e,t){const n=vt(e,t==null?void 0:t.in),r=+di(n,t)-+Kx(n,t);return Math.round(r/Yp)+1}function ze(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ir={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ze(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ze(n+1,2)},d(e,t){return ze(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ze(e.getHours()%12||12,t.length)},H(e,t){return ze(e.getHours(),t.length)},m(e,t){return ze(e.getMinutes(),t.length)},s(e,t){return ze(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return ze(o,t.length)}},es={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Ir.y(e,t)},Y:function(e,t,n,r){const o=em(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return ze(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ze(s,t.length)},R:function(e,t){const n=Xp(e);return ze(n,t.length)},u:function(e,t){const n=e.getFullYear();return ze(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ze(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ze(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ir.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ze(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Xx(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):ze(o,t.length)},I:function(e,t,n){const r=Gx(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ze(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ir.d(e,t)},D:function(e,t,n){const r=Yx(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ze(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ze(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ze(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return ze(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=es.noon:r===0?o=es.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=es.evening:r>=12?o=es.afternoon:r>=4?o=es.morning:o=es.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ir.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ir.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ze(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ze(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ir.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ir.s(e,t)},S:function(e,t){return Ir.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rm(r);case"XXXX":case"XX":return mo(r);case"XXXXX":case"XXX":default:return mo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rm(r);case"xxxx":case"xx":return mo(r);case"xxxxx":case"xxx":default:return mo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nm(r,":");case"OOOO":default:return"GMT"+mo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nm(r,":");case"zzzz":default:return"GMT"+mo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ze(r,t.length)},T:function(e,t,n){return ze(+e,t.length)}};function nm(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+ze(s,2)}function rm(e,t){return e%60===0?(e>0?"-":"+")+ze(Math.abs(e)/60,2):mo(e,t)}function mo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=ze(Math.trunc(r/60),2),s=ze(r%60,2);return n+o+t+s}const om=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Jx={p:sm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return om(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",om(r,t)).replace("{{time}}",sm(o,t))}},Qx=/^D+$/,ek=/^Y+$/,tk=["D","DD","YY","YYYY"];function nk(e){return Qx.test(e)}function rk(e){return ek.test(e)}function ok(e,t,n){const r=sk(e,t,n);if(console.warn(r),tk.includes(e))throw new RangeError(r)}function sk(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ik=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ak=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lk=/^'([^]*?)'?$/,uk=/''/g,ck=/[a-zA-Z]/;function dk(e,t,n){var c,d,f,h;const r=ci(),o=r.locale??Qp,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=vt(e,n==null?void 0:n.in);if(!ax(a))throw new RangeError("Invalid time value");let l=t.match(ak).map(p=>{const _=p[0];if(_==="p"||_==="P"){const E=Jx[_];return E(p,o.formatLong)}return p}).join("").match(ik).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const _=p[0];if(_==="'")return{isToken:!1,value:fk(p)};if(tm[_])return{isToken:!0,value:p};if(_.match(ck))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(p=>{if(!p.isToken)return p.value;const _=p.value;(rk(_)||nk(_))&&ok(_,t,String(e));const E=tm[_[0]];return E(a,_,o.localize,u)}).join("")}function fk(e){const t=e.match(lk);return t?t[1].replace(uk,"'"):e}function hk(e,t,n){const r=ci(),o=(n==null?void 0:n.locale)??r.locale??Qp,s=2520,i=Ha(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[l,u]=Ba(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=mx(u,l),d=(Ua(u)-Ua(l))/1e3,f=Math.round((c-d)/60);let h;if(f<2)return n!=null&&n.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,a):c<10?o.formatDistance("lessThanXSeconds",10,a):c<20?o.formatDistance("lessThanXSeconds",20,a):c<40?o.formatDistance("halfAMinute",0,a):c<60?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",1,a):f===0?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",f,a);if(f<45)return o.formatDistance("xMinutes",f,a);if(f<90)return o.formatDistance("aboutXHours",1,a);if(f<Gp){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<ja){const p=Math.round(f/Gp);return o.formatDistance("xDays",p,a)}else if(f<ja*2)return h=Math.round(f/ja),o.formatDistance("aboutXMonths",h,a)}if(h=px(u,l),h<12){const p=Math.round(f/ja);return o.formatDistance("xMonths",p,a)}else{const p=h%12,_=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",_,a):p<9?o.formatDistance("overXYears",_,a):o.formatDistance("almostXYears",_+1,a)}}function pk(e,t){return hk(e,sx(e),t)}function mk(e){return pk(e,{addSuffix:!0})}function pi(e,t){return dk(e,t||"PPP")}const bk={class:"moonbase:subscriptions"},gk={key:0},vk={colspan:"2"},yk={key:1},_k=["data-subscription-status"],wk={key:0},Ek={key:1},xk=he({__name:"Subscriptions",setup(e){const t=Te(),{getSubscriptions:n}=so(),r=R(new Date),o=R(null);return Ue(async()=>{let s=await n();for(o.value=s.items;s.hasMore&&s.next;)s=await n(s.next),o.value.push(...s.items)}),(s,i)=>(g(),T("table",bk,[j("tbody",null,[o.value?o.value.length===0?(g(),T("tr",yk,i[2]||(i[2]=[j("td",{colspan:"2"}," No subscriptions found ",-1)]))):de("",!0):(g(),T("tr",gk,[j("td",vk,[w(Xt),i[0]||(i[0]=V(" Loading subscriptions.. "))]),i[1]||(i[1]=j("td",null,null,-1))])),(g(!0),T(De,null,yt(o.value||[],a=>(g(),T("tr",{key:a.id,"data-subscription-status":a.status},[j("td",null,[a.content.type==="Product"?(g(),T("div",wk,[w(Jt,{url:a.content.product.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(a.content.quantity)+" x "+F(a.content.product.name),1)]),_:2},1024),w(Ve,null,{default:N(()=>[V(F(a.status===b(mr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+F(b(pi)(a.expiresAt)),1)]),_:2},1024)])])):(g(),T("div",Ek,[w(Jt,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(a.content.quantity)+" x "+F(a.content.bundle.name),1)]),_:2},1024),w(Ve,null,{default:N(()=>[V(F(a.status===b(mr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+F(b(pi)(a.expiresAt)),1)]),_:2},1024)])]))]),j("td",null,[w(Bo,{variant:"subtle",ca:"",onClick:l=>b(t).show(b(ae).Subscription,b(te).ManageSubscription,{subscription_id:a.id})},{default:N(()=>[w(b(Xh)),i[3]||(i[3]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])],8,_k))),128))])]))}}),kk={class:"moonbase:customer"},Ok=he({__name:"Customer",setup(e){const t=Te(),{user:n}=Qe(),r=ve(Lt),o=se(()=>[{intent:te.ViewProducts,title:"Products",content:H5},{intent:te.ViewSubscriptions,title:"Subscriptions",content:xk,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:te.ViewAccount,title:"Account",content:L5},{intent:te.RedeemVoucher,title:"Redeem",content:ex}].filter(a=>a.predicate===void 0||a.predicate())),s=se(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(g(),T("div",kk,[w(b($1),{"selected-index":s.value,onChange:i},{default:N(()=>{var u,c;return[w(b(A1),{"data-corners":(u=b(r))==null?void 0:u.theme.corners,"data-background":(c=b(r))==null?void 0:c.theme.colors.background},{default:N(()=>[(g(!0),T(De,null,yt(o.value,d=>(g(),Q(b(D1),{key:d.intent},{default:N(()=>[V(F(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),w(b(I1),null,{default:N(()=>[(g(!0),T(De,null,yt(o.value,d=>(g(),Q(b(M1),{key:d.intent},{default:N(()=>[(g(),Q(jl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),Sk={class:"moonbase:product-card-content"},Nk=["data-open"],Ck=he({__name:"ProductCard",props:{product:{}},setup(e){const t=R(!1),n=R(null),r=se(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(g(),Q(En,{class:"moonbase:product-card"},{addon:N(()=>[j("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:n},{default:N(()=>[V(F(o.product.description),1)]),_:1},512),!t.value&&r.value?(g(),T("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[w(Ct,null,{default:N(()=>s[1]||(s[1]=[V(" read more ")])),_:1})])):de("",!0)],8,Nk)]),default:N(()=>[w(Jt,{url:o.product.iconUrl,size:72},null,8,["url"]),j("div",Sk,[w(Jo,null,{default:N(()=>{var i;return[V(F((i=o.product)==null?void 0:i.name),1)]}),_:1}),w(Ve,{class:"moonbase:product-card-tagline"},{default:N(()=>{var i;return[V(F((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function Tk(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 Pk={class:"moonbase:product-downloads"},$k=["data-open"],Ak={key:1,class:"moonbase:product-downloads-content"},Dk={key:2,class:"moonbase:product-downloads-content"},Ik={key:3,class:"moonbase:product-downloads-content"},Mk={key:4,class:"moonbase:product-downloads-content"},Vk={class:"moonbase:product-downloads-list"},Rk={class:"moonbase:product-downloads-download-actions"},Lk=he({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=Te(),r=Qe(),o=ve(Vr),{downloadProduct:s}=so(),i=R(!1),a=R(null),l=se(()=>a.value&&a.value.$el&&a.value.$el.scrollHeight>a.value.$el.clientHeight);function u(){n.enqueue(ae.Product,te.DownloadProduct,n.parameters??void 0),n.show(ae.Authentication,te.SignIn)}const c=[Sn.Windows,Sn.Mac,Sn.Linux,Sn.Universal];function d(){var C;const E=(((C=navigator.userAgentData)==null?void 0:C.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(E)?Sn.Mac:/win/.test(E)?Sn.Windows:/linux/.test(E)?Sn.Linux:Sn.Universal}const f=d(),h=[f,...c.filter(E=>E!==f)],p=se(()=>h.flatMap(E=>[...(t.product.downloads??[]).filter(C=>C.platform===E)]));async function _(E){await s(E),o==null||o(qt.DownloadedProduct,{product:t.product,download:E,user:r.user.value})}return(E,C)=>(g(),T("div",Pk,[w(et,null,{default:N(()=>[C[1]||(C[1]=V(" Downloads ")),w(Ve,null,{default:N(()=>[V(" Version "+F(E.product.version),1)]),_:1})]),_:1}),E.product.releaseDescription?(g(),T("div",{key:0,class:"moonbase:product-downloads-description","data-open":i.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:a},{default:N(()=>[V(F(E.product.releaseDescription),1)]),_:1},512),!i.value&&l.value?(g(),T("button",{key:0,onClick:C[0]||(C[0]=z=>i.value=!0)},[w(Ct,null,{default:N(()=>C[2]||(C[2]=[V(" read more ")])),_:1})])):de("",!0)],8,$k)):de("",!0),E.product.downloadsNeedsUser&&E.product.downloadsNeedsOwnership&&!E.product.numberOfLicenses&&!E.product.subscriptionLicenses?(g(),T("div",Ak,[w(tt,{"data-center":""},{default:N(()=>C[3]||(C[3]=[V(" This product requires ownership to download ")])),_:1}),w(st,{label:"Sign in",handler:()=>u},null,8,["handler"])])):E.product.downloadsNeedsUser&&!b(r).user?(g(),T("div",Dk,[w(tt,{"data-center":""},{default:N(()=>C[4]||(C[4]=[V(" This product requires an account to download ")])),_:1}),w(st,{label:"Sign in",handler:()=>u},null,8,["handler"])])):E.product.downloadsNeedsOwnership&&!E.product.numberOfLicenses&&!E.product.subscriptionLicenses?(g(),T("div",Ik,[w(tt,{"data-center":""},{default:N(()=>C[5]||(C[5]=[V(" This product requires ownership to download ")])),_:1})])):(g(),T("div",Mk,[j("div",Vk,[(g(!0),T(De,null,yt(p.value,z=>(g(),Q(En,{key:z.key,class:"moonbase:product-downloads-download"},{addon:N(()=>[j("div",Rk,[w(st,{label:`Download for ${z.platform}`,variant:z.platform===b(f)?"primary":"secondary","no-reset":!0,handler:()=>_(z),icon:b(B1)},null,8,["label","variant","handler","icon"])])]),default:N(()=>[j("div",null,[w(et,null,{default:N(()=>[V(F(z.platform),1)]),_:2},1024),w(Dr,null,{default:N(()=>[V(F(z.name)+" - "+F(b(Tk)(z.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),p.value.length===0?(g(),Q(tt,{key:0,"data-center":""},{default:N(()=>C[6]||(C[6]=[V(" No downloadable files found ")])),_:1})):de("",!0)]))]))}}),jk={class:"moonbase:product-licenses"},Fk={key:0,class:"moonbase:loader"},Uk={key:1,class:"moonbase:empty"},Bk={key:0,class:"moonbase:loader"},Hk={key:1,class:"moonbase:product-licenses-activations"},qk={key:0},Wk={class:"moonbase:product-licenses-activation-actions"},zk={key:2,class:"moonbase:loader"},Zk={key:3,class:"moonbase:product-licenses-licenses"},Yk=he({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=so(),a=R(null),l=R(null),u=R(!0);Ue(async()=>{if(n.product.maxActivations){let d=await o(n.product.id);for(a.value=d.items.map(f=>({...f,revoking:!1}));d.hasMore&&d.next;)d=await o(n.product.id,d.next),a.value.push(...d.items.map(f=>({...f,revoking:!1})))}if(n.product.externalLicenses){let d=await s(n.product.id);for(l.value=d.items;d.hasMore&&d.next;)d=await s(n.product.id,d.next),l.value.push(...d.items)}u.value=!1});async function c(d){await i(d),r("revoked",d),a.value&&Ht(1e3).then(()=>{var f,h;return(h=a.value)==null?void 0:h.splice((f=a.value)==null?void 0:f.indexOf(d),1)})}return(d,f)=>(g(),T("div",jk,[w(et,null,{default:N(()=>[f[0]||(f[0]=V(" Licenses ")),d.product.maxActivations&&d.product.maxActivations>0?(g(),Q(Ve,{key:0},{default:N(()=>[V(F(d.product.currentActivations??0)+" of "+F(d.product.maxActivations)+" seats used ",1)]),_:1})):de("",!0)]),_:1}),u.value?(g(),T("div",Fk,[w(Xt)])):!d.product.numberOfLicenses&&!d.product.subscriptionLicenses?(g(),T("div",Uk,[w(tt,null,{default:N(()=>f[1]||(f[1]=[V(" You don't own any licenses for this product yet ")])),_:1}),d.product&&d.product.website?(g(),Q(Qu,{key:0,type:"anchor",href:d.product.website,label:"Purchase",icon:b(q1)},null,8,["href","icon"])):de("",!0)])):de("",!0),u.value?de("",!0):(g(),T(De,{key:2},[d.product.maxActivations&&d.product.maxActivations>0&&!d.product.currentActivations?(g(),T("div",Bk,[w(b(Jh)),w(et,null,{default:N(()=>f[2]||(f[2]=[V(" No activations yet ")])),_:1})])):de("",!0),d.product.maxActivations&&a.value?(g(),T("div",Hk,[(g(!0),T(De,null,yt(a.value??[],h=>(g(),Q(En,{key:h.id,class:"moonbase:product-licenses-activation"},Zd({default:N(()=>[j("div",null,[w(Dr,null,{default:N(()=>f[3]||(f[3]=[V(" Device ")])),_:1}),w(et,null,{default:N(()=>[V(F(h.name),1)]),_:2},1024)]),j("div",null,[w(Dr,null,{default:N(()=>f[4]||(f[4]=[V(" Activation ")])),_:1}),w(et,null,{default:N(()=>[V(F(h.activationMethod),1)]),_:2},1024)]),h.lastValidatedAt?(g(),T("div",qk,[w(Dr,null,{default:N(()=>f[5]||(f[5]=[V(" First activated ")])),_:1}),w(et,null,{default:N(()=>[V(F(b(mk)(h.firstValidatedAt)),1)]),_:2},1024)])):de("",!0)]),_:2},[h.activationMethod===b(Ai).Online?{name:"addon",fn:N(()=>[j("div",Wk,[w(st,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>c(h)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):de("",!0),(!l.value||l.value.length===0)&&!d.product.maxActivations&&(d.product.numberOfLicenses||d.product.subscriptionLicenses)?(g(),T("div",zk,[w(b(Jh)),d.product.numberOfLicenses?(g(),Q(et,{key:0},{default:N(()=>[V(" You own "+F(d.product.numberOfLicenses)+" license"+F(d.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):de("",!0),d.product.subscriptionLicenses?(g(),Q(et,{key:1},{default:N(()=>[V(" You have "+F(d.product.subscriptionLicenses)+" subscription license"+F(d.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):de("",!0)])):d.product.externalLicenses&&l.value?(g(),T("div",Zk,[(g(!0),T(De,null,yt((l.value??[]).filter(h=>h.externalFulfillment),h=>(g(),Q(En,{key:h.id,class:"moonbase:product-licenses-license"},Zd({default:N(()=>[j("div",null,[w(Dr,null,{default:N(()=>[V(F(d.product.name)+" license ",1)]),_:1}),w(et,null,{default:N(()=>[V(F(h.id),1)]),_:2},1024)])]),_:2},[h.externalFulfillment?{name:"addon",fn:N(()=>[j("code",null,F(h.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):de("",!0)],64))]))}}),Gk={class:"moonbase:download-product"},Kk={key:0,class:"moonbase:loader"},Xk={key:1,class:"moonbase:loader"},Jk={key:2,class:"moonbase:loader"},Qk={key:3},e3=he({__name:"Product",setup(e){const t=Te(),n=Qe(),{loaded:r}=Qe(),{getProduct:o}=so(),s=R(null),i=R(null),a=R(!0);return Ue(async()=>{const l=t.getParameter("product_id"),u=t.getParameter("version");if(!l){i.value="Link is broken";return}try{s.value=await o(l,u||void 0)}catch(c){i.value=c.message}a.value=!1}),(l,u)=>(g(),T("div",Gk,[a.value||!b(r)?(g(),T("div",Kk,[w(Xt)])):i.value?(g(),T("div",Xk,F(i.value),1)):s.value?(g(),T("div",Qk,[w(Ck,{product:s.value},null,8,["product"]),s.value.downloads?(g(),Q(Lk,{key:0,product:s.value},null,8,["product"])):de("",!0),b(n).user.value?(g(),Q(Yk,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):de("",!0)])):(g(),T("div",Jk," Could not find product "))]))}}),t3={class:"moonbase:peek"},n3=["data-visible"],r3={key:1,class:"moonbase:peek-voucher"},o3={key:0,class:"moonbase:peek-voucher-content"},s3={class:"moonbase:peek-voucher-auth"},i3=he({__name:"Redeem",setup(e){const{peek:t}=ih(),n=Te(),r=R(null),o=R(null),s=R(n.getParameter("code")||"");async function i(){o.value=null;try{r.value=await t(s.value),n.parameters={code:r.value.code}}catch(u){throw o.value=u,u}}function a(){n.enqueue(ae.Customer,te.RedeemVoucher,{code:s.value}),n.show(ae.Authentication,te.SignIn)}function l(){n.enqueue(ae.Customer,te.RedeemVoucher,{code:s.value}),n.show(ae.Authentication,te.SignUp)}return(u,c)=>(g(),T("div",t3,[w(Ys,{mode:"out-in",name:"moonbase:slide-left"},{default:N(()=>[r.value?(g(),T("div",r3,[j("div",null,[w(Jo,null,{default:N(()=>[V(F(r.value.name),1)]),_:1}),r.value.description?(g(),Q(et,{key:0},{default:N(()=>[V(' "'+F(r.value.description)+'" ',1)]),_:1})):de("",!0),w(Ve,null,{default:N(()=>[c[2]||(c[2]=V(" Code: ")),j("strong",null,F(r.value.code),1)]),_:1})]),w(et,null,{default:N(()=>c[3]||(c[3]=[V(" Voucher summary ")])),_:1}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(g(),T("div",o3,[(g(!0),T(De,null,yt(r.value.redeemsProducts,({value:d,quantity:f})=>(g(),Q(Zp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),T(De,null,yt(r.value.redeemsBundles,({value:d,quantity:f})=>(g(),Q(zp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):de("",!0),j("div",s3,[w(tt,null,{default:N(()=>c[4]||(c[4]=[V(" Sign in or create an account to redeem products ")])),_:1}),w(st,{label:"Sign in",variant:"primary",handler:a}),w(st,{label:"Create account",variant:"subtle",handler:l})])])):(g(),Q(or,{key:0,handler:i},{default:N(()=>{var d;return[w(tt,null,{default:N(()=>c[1]||(c[1]=[V(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),V(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=f=>s.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(sr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},F((d=o.value)==null?void 0:d.message),9,n3)]}),_:1}))]),_:1})]))}}),a3={class:"moonbase:subscription-content-card-content"},l3=["data-open"],u3={class:"moonbase:subscription-content-card-content"},c3=["data-open"],d3=he({__name:"ContentCard",props:{subscription:{}},setup(e){const t=R(new Date),n=R(!1),r=R(null),o=se(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(g(),Q(En,{key:0,class:"moonbase:subscription-content-card"},{addon:N(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:r},{default:N(()=>[V(F(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(g(),T("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[w(Ct,null,{default:N(()=>i[2]||(i[2]=[V(" read more ")])),_:1})])):de("",!0)],8,l3)]),default:N(()=>[w(Jt,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),j("div",a3,[w(Jo,null,{default:N(()=>{var a;return[V(F((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-tagline"},{default:N(()=>{var a;return[V(F((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-expiry"},{default:N(()=>[V(F(s.subscription.status===b(mr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,F(b(pi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(g(),Q(En,{key:1,class:"moonbase:subscription-content-card"},{addon:N(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:r},{default:N(()=>[V(F(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(g(),T("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[w(Ct,null,{default:N(()=>i[3]||(i[3]=[V(" read more ")])),_:1})])):de("",!0)],8,c3)]),default:N(()=>[w(Jt,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),j("div",u3,[w(Jo,null,{default:N(()=>{var a;return[V(F((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-tagline"},{default:N(()=>{var a;return[V(F((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-expiry"},{default:N(()=>[V(F(s.subscription.status===b(mr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,F(b(pi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),f3={class:"moonbase:subscription"},h3={key:0,class:"moonbase:loader"},p3={key:1,class:"moonbase:loader"},m3={key:2,class:"moonbase:loader"},b3={key:3},g3={class:"moonbase:subscription-actions"},v3=he({__name:"Subscription",setup(e){const t=Te(),{loaded:n}=Qe(),{getSubscription:r,renewSubscription:o,cancelSubscription:s}=so(),i=R(null),a=R(new Date),l=R(null),u=R(!0);Ue(async()=>{const f=t.getParameter("subscription_id");if(!f){l.value="Link is broken";return}try{i.value=await r(f)}catch(h){l.value=h.message}u.value=!1});async function c(){if(!i.value)return;if((await o(i.value.id,{redirect:!1})).completed){const h=await r(i.value.id);Ht(1500).then(()=>i.value=h)}else throw new Ju}async function d(){i.value&&(i.value=await s(i.value.id))}return(f,h)=>(g(),T("div",f3,[u.value||!b(n)?(g(),T("div",h3,[w(Xt)])):l.value?(g(),T("div",p3,F(l.value),1)):i.value?(g(),T("div",b3,[w(d3,{subscription:i.value},null,8,["subscription"]),j("div",g3,[i.value.status===b(mr).Active?(g(),Q(st,{key:0,label:"Cancel subscription",variant:"danger",handler:d})):(g(),Q(st,{key:1,label:"Continue subscription",variant:"primary",handler:c})),i.value.status===b(mr).Active?(g(),Q(Dr,{key:2},{default:N(()=>[h[0]||(h[0]=V(" Cancelling a subscription will let you use the products to the end of the current period, after which you will lose access. If you want to continue using the products later, you may simply renew this subscription whenever you wish. You are currently paying ")),j("strong",null,F(b(yn)(i.value.total.due)),1),V(" per "+F(b(ec)(i.value.cycleLength))+" for this subscription. ",1)]),_:1})):(g(),Q(Dr,{key:3},{default:N(()=>[V(" This subscription has been stopped, and "+F(i.value.expiresAt>a.value?"expires":"expired")+" "+F(b(pi)(i.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1}))])])):(g(),T("div",m3," Could not find subscription "))]))}}),y3=he({__name:"App",setup(e){const t=ve(Lt),n=Te();Je(()=>[n.active,n.intent],([o,s])=>{});const r={Inter:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",Roboto:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap","EB Garamond":"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap",Merriweather:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",Poppins:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap","PT Serif":"https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap",Montserrat:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",Aleo:"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&display=swap"};if(t){const o=document.createElement("link");o.rel="stylesheet",o.href=r[t.value.theme.fonts.body],document.head.appendChild(o),document.documentElement.style.setProperty("--moonbase-font-body",t.value.theme.fonts.body??"");const s=document.createElement("link");s.rel="stylesheet",s.href=r[t.value.theme.fonts.heading],document.head.appendChild(s),document.documentElement.style.setProperty("--moonbase-font-heading",t.value.theme.fonts.heading??"");let i=t.value.theme.colors.primary;typeof i=="string"&&(i=Object.fromEntries(E2(i).map(a=>[a.number<=100||a.number===950?a.number-50:a.number-100,a.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",i[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",i[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",i[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",i[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",i[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",i[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",i[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",i[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",i[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",i[900]??"")}return Je(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),k_(),(o,s)=>{var i;return g(),T(De,null,[(i=b(t))!=null&&i.toolbar.enabled?(g(),Q(x_,{key:0})):de("",!0),w(m_,null,{default:N(()=>[b(n).active===b(ae).Cart?(g(),Q(D5,{key:0})):b(n).active===b(ae).Authentication?(g(),Q(c5,{key:1})):b(n).active===b(ae).Activation?(g(),Q(EE,{key:2})):b(n).active===b(ae).Product?(g(),Q(e3,{key:3})):b(n).active===b(ae).Subscription?(g(),Q(v3,{key:4})):b(n).active===b(ae).Customer?(g(),Q(Ok,{key:5})):b(n).active===b(ae).Redeem?(g(),Q(i3,{key:6})):b(n).active===b(ae).About?(g(),Q(I2,{key:7})):de("",!0)]),_:1})],64)}}});function qa(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function Wa(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(qa(e)&&qa(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];qa(o)&&qa(e[r])?e[r]=Wa(e[r],o):o!==void 0&&(e[r]=o)}}return Wa(e,...t)}function _3(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Ye(n)||hn(n)||Co(n)?t(ke(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const nc=Symbol("url"),Mr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:_3(t)})),Vr=Symbol("event-emitter");class w3{constructor(){bo(this,"initialized",!1);bo(this,"pinia");bo(this,"storefront");bo(this,"options")}async setup(t,n){var l,u;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}this.options=R(Wa(((l=this.options)==null?void 0:l.value)??Sh,n??{})),mu("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase"),(this.options.value.target??document.body).append(r),this.storefront=py(t),this.pinia=jy(),Yv(y3).use(this.storefront).use(this.pinia).provide(Lt,this.options).provide(nc,t.replace(/\/$/,"")).provide(Vr,Mr).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const i=Te(this.pinia),a=Qe(this.storefront);(u=this.storefront)==null||u.onCheckoutInitiated((c,d)=>{Mr(qt.CheckoutInitiated,{order:c,total:d,user:a.user.value})}),this.storefront.onCheckoutClosed(c=>{Mr(qt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:a.user.value}),c===te.ViewProducts&&(a.user?i.show(ae.Customer,te.ViewProducts):i.show(ae.Cart,te.ViewCart))}),this.storefront.onCheckoutCompleted(c=>{Mr(qt.CheckoutCompleted,{order:c,user:a.user.value})})}configure(t){var r;const n=Wa(((r=this.options)==null?void 0:r.value)??Sh,t??{});this.options?this.options.value=n:this.options=R(n)}on(t,n){window.addEventListener(`moonbase-storefront-${t}`,r=>n(r.detail))}handleLocationIntent(t){const n=new URLSearchParams(t.search),r=n.get("mb_intent");if(r&&Object.values(te).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===te.Checkout&&o.complete)return;this[r](o);for(const i of Object.keys(o))n.delete(`mb_${i}`);const s=n.toString();window.history.replaceState(null,"",t.href.split("?")[0]+(s?`?${s}`:""))}}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.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.value.auth.signUp.enabled))throw new Error("Sign ups are not enabled");Te(this.pinia).show(ae.Authentication,te.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia);Qe(this.storefront).user.value?n.show(ae.Authentication,te.ConfirmEmailChange,t):(n.enqueue(ae.Authentication,te.ConfirmEmailChange,t),n.show(ae.Authentication,te.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=Te(this.pinia);Qe(this.storefront).user.value?t.show(ae.Customer,te.ViewAccount):(t.enqueue(ae.Customer,te.ViewAccount),t.show(ae.Authentication,te.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Customer,te.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Customer,te.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia);Qe(this.storefront).user.value?n.show(ae.Customer,te.RedeemVoucher,t):n.show(ae.Redeem,te.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Product,te.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Product,te.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia),r=Qe(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(ae.Activation,te.ActivateProduct,t),n.show(ae.Authentication,te.SignIn)):n.show(ae.Activation,te.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia);Qe(this.storefront).user.value?n.show(ae.Subscription,te.ManageSubscription,t):(n.enqueue(ae.Subscription,te.ManageSubscription,t),n.show(ae.Authentication,te.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Cart,te.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=Nr(this.storefront),r=Qe(this.storefront);if(t!=null&&t.product_id){const l=Xs(t.product_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(o=l.value.variations)==null?void 0:o.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=Xs(t.product_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(s=u.value.variations)==null?void 0:s.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const l=ba(t.bundle_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(i=l.value.variations)==null?void 0:i.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=ba(t.bundle_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(a=u.value.variations)==null?void 0:a.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Bundle '${t.bundle_id}' not found`)}}(t==null?void 0:t.show_cart)!==!1&&Te(this.pinia).show(ae.Cart,te.AddToCart)}async purchase(t){var o,s,i,a,l;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(o=this.storefront)!=null&&o.loadedStorefront||await((s=this.storefront)==null?void 0:s.loadedStorefrontPromise);const n=t?Array.isArray(t)?t:[t]:[];if(n.length===0)throw new Error("No items given to purchase");const r=[];for(const u of n){if(!u.product_id&&!u.bundle_id)throw new Error("You need to provide a product or bundle ID when purchasing");if(u.product_id){const c=Xs(u.product_id,this.storefront);if(c.value)r.push({item:c.value,variation:(i=c.value.variations)==null?void 0:i.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Product '${u.product_id}' not found`)}if(u.bundle_id){const c=ba(u.bundle_id,this.storefront);if(c.value)r.push({item:c.value,variation:(a=c.value.variations)==null?void 0:a.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Bundle '${u.bundle_id}' not found`)}}await fy(r,{redirect:((l=this.options)==null?void 0:l.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`},this.storefront)}checkout(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;Nr(this.storefront).checkout({redirect:((r=this.options)==null?void 0:r.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`})}close_checkout(){var t;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(t=this.storefront)==null||t.closeCheckout()}view_about(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.About,te.ViewAbout)}}const im=new w3;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=im),Pt.MoonbaseIntent=te,Pt.default=im,Pt.eventEmitterKey=Vr,Pt.urlKey=nc,Object.defineProperties(Pt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
36
|
+
*/const gp=.027,Kw=5e-4,Xw=.1,vp=1.14,Ia=.022,yp=1.414,Jw=(e,t)=>{e=new ee(e),t=new ee(t),e.alpha()<1&&(e=Wo(t,e,e.alpha(),"rgb"));const n=_p(...e.rgb()),r=_p(...t.rgb()),o=n>=Ia?n:n+Math.pow(Ia-n,yp),s=r>=Ia?r:r+Math.pow(Ia-r,yp),i=Math.pow(s,.56)-Math.pow(o,.57),a=Math.pow(s,.65)-Math.pow(o,.62),l=Math.abs(s-o)<Kw?0:o<s?i*vp:a*vp;return(Math.abs(l)<Xw?0:l>0?l-gp:l+gp)*100};function _p(e,t,n){return .2126729*Math.pow(e/255,2.4)+.7151522*Math.pow(t/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:nr,pow:ct,min:Qw,max:e2,atan2:wp,abs:Ep,cos:Ma,sin:xp,exp:t2,PI:kp}=Math;function n2(e,t,n=1,r=1,o=1){var s=function(it){return 360*it/(2*kp)},i=function(it){return 2*kp*it/360};e=new ee(e),t=new ee(t);const[a,l,u]=Array.from(e.lab()),[c,d,f]=Array.from(t.lab()),h=(a+c)/2,p=nr(ct(l,2)+ct(u,2)),_=nr(ct(d,2)+ct(f,2)),E=(p+_)/2,C=.5*(1-nr(ct(E,7)/(ct(E,7)+ct(25,7)))),z=l*(1+C),Z=d*(1+C),B=nr(ct(z,2)+ct(u,2)),L=nr(ct(Z,2)+ct(f,2)),D=(B+L)/2,m=s(wp(u,z)),$=s(wp(f,Z)),I=m>=0?m:m+360,P=$>=0?$:$+360,A=Ep(I-P)>180?(I+P+360)/2:(I+P)/2,k=1-.17*Ma(i(A-30))+.24*Ma(i(2*A))+.32*Ma(i(3*A+6))-.2*Ma(i(4*A-63));let G=P-I;G=Ep(G)<=180?G:P<=I?G+360:G-360,G=2*nr(B*L)*xp(i(G)/2);const _e=c-a,O=L-B,M=1+.015*ct(h-50,2)/nr(20+ct(h-50,2)),H=1+.045*D,ne=1+.015*D*k,me=30*t2(-ct((A-275)/25,2)),He=-(2*nr(ct(D,7)/(ct(D,7)+ct(25,7))))*xp(2*i(me)),ft=nr(ct(_e/(n*M),2)+ct(O/(r*H),2)+ct(G/(o*ne),2)+He*(O/(r*H))*(G/(o*ne)));return e2(0,Qw(100,ft))}function r2(e,t,n="lab"){e=new ee(e),t=new ee(t);const r=e.get(n),o=t.get(n);let s=0;for(let i in r){const a=(r[i]||0)-(o[i]||0);s+=a*a}return Math.sqrt(s)}const o2=(...e)=>{try{return new ee(...e),!0}catch{return!1}},s2={cool(){return Da([$e.hsl(180,1,.9),$e.hsl(250,.7,.4)])},hot(){return Da(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Zu={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Op=Object.keys(Zu),Sp=new Map(Op.map(e=>[e.toLowerCase(),e])),i2=typeof Proxy=="function"?new Proxy(Zu,{get(e,t){const n=t.toLowerCase();if(Sp.has(n))return e[Sp.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(Op)}}):Zu,a2=(...e)=>{e=Pe(e,"cmyk");const[t,n,r,o]=e,s=e.length>4?e[4]:1;return o===1?[0,0,0,s]:[t>=1?0:255*(1-t)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),s]},{max:Np}=Math,l2=(...e)=>{let[t,n,r]=Pe(e,"rgb");t=t/255,n=n/255,r=r/255;const o=1-Np(t,Np(n,r)),s=o<1?1/(1-o):0,i=(1-t-o)*s,a=(1-n-o)*s,l=(1-r-o)*s;return[i,a,l,o]};ee.prototype.cmyk=function(){return l2(this._rgb)},Object.assign($e,{cmyk:(...e)=>new ee(...e,"cmyk")}),Ne.format.cmyk=a2,Ne.autodetect.push({p:2,test:(...e)=>{if(e=Pe(e,"cmyk"),Me(e)==="array"&&e.length===4)return"cmyk"}});const u2=(...e)=>{const t=Pe(e,"hsla");let n=Ho(e)||"lsa";return t[0]=sn(t[0]||0)+"deg",t[1]=sn(t[1]*100)+"%",t[2]=sn(t[2]*100)+"%",n==="hsla"||t.length>3&&t[3]<1?(t[3]="/ "+(t.length>3?t[3]:1),n="hsla"):t.length=3,`${n.substr(0,3)}(${t.join(" ")})`},c2=(...e)=>{const t=Pe(e,"lab");let n=Ho(e)||"lab";return t[0]=sn(t[0])+"%",t[1]=sn(t[1]),t[2]=sn(t[2]),n==="laba"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lab(${t.join(" ")})`},d2=(...e)=>{const t=Pe(e,"lch");let n=Ho(e)||"lab";return t[0]=sn(t[0])+"%",t[1]=sn(t[1]),t[2]=isNaN(t[2])?"none":sn(t[2])+"deg",n==="lcha"||t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`lch(${t.join(" ")})`},f2=(...e)=>{const t=Pe(e,"lab");return t[0]=sn(t[0]*100)+"%",t[1]=$u(t[1]),t[2]=$u(t[2]),t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklab(${t.join(" ")})`},Cp=(...e)=>{const[t,n,r,...o]=Pe(e,"rgb"),[s,i,a]=Hu(t,n,r),[l,u,c]=lp(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},h2=(...e)=>{const t=Pe(e,"lch");return t[0]=sn(t[0]*100)+"%",t[1]=$u(t[1]),t[2]=isNaN(t[2])?"none":sn(t[2])+"deg",t.length>3&&t[3]<1?t[3]="/ "+(t.length>3?t[3]:1):t.length=3,`oklch(${t.join(" ")})`},{round:Yu}=Math,p2=(...e)=>{const t=Pe(e,"rgba");let n=Ho(e)||"rgb";if(n.substr(0,3)==="hsl")return u2(cp(t),n);if(n.substr(0,3)==="lab"){const r=ui();tr("d50");const o=c2(Mu(t),n);return tr(r),o}if(n.substr(0,3)==="lch"){const r=ui();tr("d50");const o=d2(ju(t),n);return tr(r),o}return n.substr(0,5)==="oklab"?f2(Hu(t)):n.substr(0,5)==="oklch"?h2(Cp(t)):(t[0]=Yu(t[0]),t[1]=Yu(t[1]),t[2]=Yu(t[2]),(n==="rgba"||t.length>3&&t[3]<1)&&(t[3]="/ "+(t.length>3?t[3]:1),n="rgba"),`${n.substr(0,3)}(${t.slice(0,n==="rgb"?3:4).join(" ")})`)},Tp=(...e)=>{e=Pe(e,"lch");const[t,n,r,...o]=e,[s,i,a]=ap(t,n,r),[l,u,c]=Bu(s,i,a);return[l,u,c,...o.length>0&&o[0]<1?[o[0]]:[]]},rr=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,wn=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Va=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,an=/\s*/.source,Go=/\s+/.source,Gu=/\s*,\s*/.source,Ra=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Ko=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Pp=new RegExp("^rgba?\\("+an+[rr,rr,rr].join(Go)+Ko+"\\)$"),$p=new RegExp("^rgb\\("+an+[rr,rr,rr].join(Gu)+an+"\\)$"),Ap=new RegExp("^rgba\\("+an+[rr,rr,rr,wn].join(Gu)+an+"\\)$"),Dp=new RegExp("^hsla?\\("+an+[Ra,Va,Va].join(Go)+Ko+"\\)$"),Ip=new RegExp("^hsl?\\("+an+[Ra,Va,Va].join(Gu)+an+"\\)$"),Mp=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Vp=new RegExp("^lab\\("+an+[wn,wn,wn].join(Go)+Ko+"\\)$"),Rp=new RegExp("^lch\\("+an+[wn,wn,Ra].join(Go)+Ko+"\\)$"),Lp=new RegExp("^oklab\\("+an+[wn,wn,wn].join(Go)+Ko+"\\)$"),jp=new RegExp("^oklch\\("+an+[wn,wn,Ra].join(Go)+Ko+"\\)$"),{round:Fp}=Math,Xo=e=>e.map((t,n)=>n<=2?po(Fp(t),0,255):t),dt=(e,t=0,n=100,r=!1)=>(typeof e=="string"&&e.endsWith("%")&&(e=parseFloat(e.substring(0,e.length-1))/100,r?e=t+(e+1)*.5*(n-t):e=t+e*(n-t)),+e),jt=(e,t)=>e==="none"?t:e,Ku=e=>{if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t;if(Ne.format.named)try{return Ne.format.named(e)}catch{}if((t=e.match(Pp))||(t=e.match($p))){let n=t.slice(1,4);for(let o=0;o<3;o++)n[o]=+dt(jt(n[o],0),0,255);n=Xo(n);const r=t[4]!==void 0?+dt(t[4],0,1):1;return n[3]=r,n}if(t=e.match(Ap)){const n=t.slice(1,5);for(let r=0;r<4;r++)n[r]=+dt(n[r],0,255);return n}if((t=e.match(Dp))||(t=e.match(Ip))){const n=t.slice(1,4);n[0]=+jt(n[0].replace("deg",""),0),n[1]=+dt(jt(n[1],0),0,100)*.01,n[2]=+dt(jt(n[2],0),0,100)*.01;const r=Xo(Uu(n)),o=t[4]!==void 0?+dt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(Mp)){const n=t.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Uu(n);for(let o=0;o<3;o++)r[o]=Fp(r[o]);return r[3]=+t[4],r}if(t=e.match(Vp)){const n=t.slice(1,4);n[0]=dt(jt(n[0],0),0,100),n[1]=dt(jt(n[1],0),-125,125,!0),n[2]=dt(jt(n[2],0),-125,125,!0);const r=ui();tr("d50");const o=Xo(Du(n));tr(r);const s=t[4]!==void 0?+dt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(Rp)){const n=t.slice(1,4);n[0]=dt(n[0],0,100),n[1]=dt(jt(n[1],0),0,150,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=ui();tr("d50");const o=Xo(Lu(n));tr(r);const s=t[4]!==void 0?+dt(t[4],0,1):1;return o[3]=s,o}if(t=e.match(Lp)){const n=t.slice(1,4);n[0]=dt(jt(n[0],0),0,1),n[1]=dt(jt(n[1],0),-.4,.4,!0),n[2]=dt(jt(n[2],0),-.4,.4,!0);const r=Xo(Bu(n)),o=t[4]!==void 0?+dt(t[4],0,1):1;return r[3]=o,r}if(t=e.match(jp)){const n=t.slice(1,4);n[0]=dt(jt(n[0],0),0,1),n[1]=dt(jt(n[1],0),0,.4,!1),n[2]=+jt(n[2].replace("deg",""),0);const r=Xo(Tp(n)),o=t[4]!==void 0?+dt(t[4],0,1):1;return r[3]=o,r}};Ku.test=e=>Pp.test(e)||Dp.test(e)||Vp.test(e)||Rp.test(e)||Lp.test(e)||jp.test(e)||$p.test(e)||Ap.test(e)||Ip.test(e)||Mp.test(e)||e==="transparent",ee.prototype.css=function(e){return p2(this._rgb,e)};const m2=(...e)=>new ee(...e,"css");$e.css=m2,Ne.format.css=Ku,Ne.autodetect.push({p:5,test:(e,...t)=>{if(!t.length&&Me(e)==="string"&&Ku.test(e))return"css"}}),Ne.format.gl=(...e)=>{const t=Pe(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t};const b2=(...e)=>new ee(...e,"gl");$e.gl=b2,ee.prototype.gl=function(){const e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]},ee.prototype.hex=function(e){return op(this._rgb,e)};const g2=(...e)=>new ee(...e,"hex");$e.hex=g2,Ne.format.hex=rp,Ne.autodetect.push({p:4,test:(e,...t)=>{if(!t.length&&Me(e)==="string"&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});const{log:La}=Math,Up=e=>{const t=e/100;let n,r,o;return t<66?(n=255,r=t<6?0:-155.25485562709179-.44596950469579133*(r=t-2)+104.49216199393888*La(r),o=t<20?0:-254.76935184120902+.8274096064007395*(o=t-10)+115.67994401066147*La(o)):(n=351.97690566805693+.114206453784165*(n=t-55)-40.25366309332127*La(n),r=325.4494125711974+.07943456536662342*(r=t-50)-28.0852963507957*La(r),o=255),[n,r,o,1]},{round:v2}=Math,y2=(...e)=>{const t=Pe(e,"rgb"),n=t[0],r=t[2];let o=1e3,s=4e4;const i=.4;let a;for(;s-o>i;){a=(s+o)*.5;const l=Up(a);l[2]/l[0]>=r/n?s=a:o=a}return v2(a)};ee.prototype.temp=ee.prototype.kelvin=ee.prototype.temperature=function(){return y2(this._rgb)};const Xu=(...e)=>new ee(...e,"temp");Object.assign($e,{temp:Xu,kelvin:Xu,temperature:Xu}),Ne.format.temp=Ne.format.kelvin=Ne.format.temperature=Up,ee.prototype.oklch=function(){return Cp(this._rgb)},Object.assign($e,{oklch:(...e)=>new ee(...e,"oklch")}),Ne.format.oklch=Tp,Ne.autodetect.push({p:2,test:(...e)=>{if(e=Pe(e,"oklch"),Me(e)==="array"&&e.length===3)return"oklch"}}),Object.assign($e,{analyze:mp,average:xw,bezier:Tw,blend:_n,brewer:i2,Color:ee,colors:qo,contrast:Gw,contrastAPCA:Jw,cubehelix:Uw,deltaE:n2,distance:r2,input:Ne,interpolate:Wo,limits:bp,mix:Wo,random:Ww,scale:Da,scales:s2,valid:o2});const _2=[{name:"Slate",id:"slate",reference:!1,shades:[{number:50,hexcode:"#f8fafc"},{number:100,hexcode:"#f1f5f9"},{number:200,hexcode:"#e2e8f0"},{number:300,hexcode:"#cbd5e1"},{number:400,hexcode:"#94a3b8"},{number:500,hexcode:"#64748b"},{number:600,hexcode:"#475569"},{number:700,hexcode:"#334155"},{number:800,hexcode:"#1e293b"},{number:900,hexcode:"#0f172a"},{number:950,hexcode:"#020617"}]},{name:"Gray",id:"gray",reference:!1,shades:[{number:50,hexcode:"#f9fafb"},{number:100,hexcode:"#f3f4f6"},{number:200,hexcode:"#e5e7eb"},{number:300,hexcode:"#d1d5db"},{number:400,hexcode:"#9ca3af"},{number:500,hexcode:"#6b7280"},{number:600,hexcode:"#4b5563"},{number:700,hexcode:"#374151"},{number:800,hexcode:"#1f2937"},{number:900,hexcode:"#111827"},{number:950,hexcode:"#030712"}]},{name:"Zinc",id:"zinc",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f4f4f5"},{number:200,hexcode:"#e4e4e7"},{number:300,hexcode:"#d4d4d8"},{number:400,hexcode:"#a1a1aa"},{number:500,hexcode:"#71717a"},{number:600,hexcode:"#52525b"},{number:700,hexcode:"#3f3f46"},{number:800,hexcode:"#27272a"},{number:900,hexcode:"#18181b"},{number:950,hexcode:"#09090b"}]},{name:"Neutral",id:"neutral",reference:!1,shades:[{number:50,hexcode:"#fafafa"},{number:100,hexcode:"#f5f5f5"},{number:200,hexcode:"#e5e5e5"},{number:300,hexcode:"#d4d4d4"},{number:400,hexcode:"#a3a3a3"},{number:500,hexcode:"#737373"},{number:600,hexcode:"#525252"},{number:700,hexcode:"#404040"},{number:800,hexcode:"#262626"},{number:900,hexcode:"#171717"},{number:950,hexcode:"#0a0a0a"}]},{name:"Stone",id:"stone",reference:!1,shades:[{number:50,hexcode:"#fafaf9"},{number:100,hexcode:"#f5f5f4"},{number:200,hexcode:"#e7e5e4"},{number:300,hexcode:"#d6d3d1"},{number:400,hexcode:"#a8a29e"},{number:500,hexcode:"#78716c"},{number:600,hexcode:"#57534e"},{number:700,hexcode:"#44403c"},{number:800,hexcode:"#292524"},{number:900,hexcode:"#1c1917"},{number:950,hexcode:"#0c0a09"}]},{name:"Red",id:"red",reference:!0,shades:[{number:50,hexcode:"#fef2f2"},{number:100,hexcode:"#fee2e2"},{number:200,hexcode:"#fecaca"},{number:300,hexcode:"#fca5a5"},{number:400,hexcode:"#f87171"},{number:500,hexcode:"#ef4444"},{number:600,hexcode:"#dc2626"},{number:700,hexcode:"#b91c1c"},{number:800,hexcode:"#991b1b"},{number:900,hexcode:"#7f1d1d"},{number:950,hexcode:"#450a0a"}]},{name:"Orange",id:"orange",reference:!0,shades:[{number:50,hexcode:"#fff7ed"},{number:100,hexcode:"#ffedd5"},{number:200,hexcode:"#fed7aa"},{number:300,hexcode:"#fdba74"},{number:400,hexcode:"#fb923c"},{number:500,hexcode:"#f97316"},{number:600,hexcode:"#ea580c"},{number:700,hexcode:"#c2410c"},{number:800,hexcode:"#9a3412"},{number:900,hexcode:"#7c2d12"},{number:950,hexcode:"#431407"}]},{name:"Amber",id:"amber",reference:!0,shades:[{number:50,hexcode:"#fffbeb"},{number:100,hexcode:"#fef3c7"},{number:200,hexcode:"#fde68a"},{number:300,hexcode:"#fcd34d"},{number:400,hexcode:"#fbbf24"},{number:500,hexcode:"#f59e0b"},{number:600,hexcode:"#d97706"},{number:700,hexcode:"#b45309"},{number:800,hexcode:"#92400e"},{number:900,hexcode:"#78350f"},{number:950,hexcode:"#451a03"}]},{name:"Yellow",id:"yellow",reference:!0,shades:[{number:50,hexcode:"#fefce8"},{number:100,hexcode:"#fef9c3"},{number:200,hexcode:"#fef08a"},{number:300,hexcode:"#fde047"},{number:400,hexcode:"#facc15"},{number:500,hexcode:"#eab308"},{number:600,hexcode:"#ca8a04"},{number:700,hexcode:"#a16207"},{number:800,hexcode:"#854d0e"},{number:900,hexcode:"#713f12"},{number:950,hexcode:"#422006"}]},{name:"Lime",id:"lime",reference:!0,shades:[{number:50,hexcode:"#f7fee7"},{number:100,hexcode:"#ecfccb"},{number:200,hexcode:"#d9f99d"},{number:300,hexcode:"#bef264"},{number:400,hexcode:"#a3e635"},{number:500,hexcode:"#84cc16"},{number:600,hexcode:"#65a30d"},{number:700,hexcode:"#4d7c0f"},{number:800,hexcode:"#3f6212"},{number:900,hexcode:"#365314"},{number:950,hexcode:"#1a2e05"}]},{name:"Green",id:"green",reference:!0,shades:[{number:50,hexcode:"#f0fdf4"},{number:100,hexcode:"#dcfce7"},{number:200,hexcode:"#bbf7d0"},{number:300,hexcode:"#86efac"},{number:400,hexcode:"#4ade80"},{number:500,hexcode:"#22c55e"},{number:600,hexcode:"#16a34a"},{number:700,hexcode:"#15803d"},{number:800,hexcode:"#166534"},{number:900,hexcode:"#14532d"},{number:950,hexcode:"#052e16"}]},{name:"Emerald",id:"emerald",reference:!0,shades:[{number:50,hexcode:"#ecfdf5"},{number:100,hexcode:"#d1fae5"},{number:200,hexcode:"#a7f3d0"},{number:300,hexcode:"#6ee7b7"},{number:400,hexcode:"#34d399"},{number:500,hexcode:"#10b981"},{number:600,hexcode:"#059669"},{number:700,hexcode:"#047857"},{number:800,hexcode:"#065f46"},{number:900,hexcode:"#064e3b"},{number:950,hexcode:"#022c22"}]},{name:"Teal",id:"teal",reference:!0,shades:[{number:50,hexcode:"#f0fdfa"},{number:100,hexcode:"#ccfbf1"},{number:200,hexcode:"#99f6e4"},{number:300,hexcode:"#5eead4"},{number:400,hexcode:"#2dd4bf"},{number:500,hexcode:"#14b8a6"},{number:600,hexcode:"#0d9488"},{number:700,hexcode:"#0f766e"},{number:800,hexcode:"#115e59"},{number:900,hexcode:"#134e4a"},{number:950,hexcode:"#042f2e"}]},{name:"Cyan",id:"cyan",reference:!0,shades:[{number:50,hexcode:"#ecfeff"},{number:100,hexcode:"#cffafe"},{number:200,hexcode:"#a5f3fc"},{number:300,hexcode:"#67e8f9"},{number:400,hexcode:"#22d3ee"},{number:500,hexcode:"#06b6d4"},{number:600,hexcode:"#0891b2"},{number:700,hexcode:"#0e7490"},{number:800,hexcode:"#155e75"},{number:900,hexcode:"#164e63"},{number:950,hexcode:"#083344"}]},{name:"Sky",id:"sky",reference:!0,shades:[{number:50,hexcode:"#f0f9ff"},{number:100,hexcode:"#e0f2fe"},{number:200,hexcode:"#bae6fd"},{number:300,hexcode:"#7dd3fc"},{number:400,hexcode:"#38bdf8"},{number:500,hexcode:"#0ea5e9"},{number:600,hexcode:"#0284c7"},{number:700,hexcode:"#0369a1"},{number:800,hexcode:"#075985"},{number:900,hexcode:"#0c4a6e"},{number:950,hexcode:"#082f49"}]},{name:"Blue",id:"blue",reference:!0,shades:[{number:50,hexcode:"#eff6ff"},{number:100,hexcode:"#dbeafe"},{number:200,hexcode:"#bfdbfe"},{number:300,hexcode:"#93c5fd"},{number:400,hexcode:"#60a5fa"},{number:500,hexcode:"#3b82f6"},{number:600,hexcode:"#2563eb"},{number:700,hexcode:"#1d4ed8"},{number:800,hexcode:"#1e40af"},{number:900,hexcode:"#1e3a8a"},{number:950,hexcode:"#172554"}]},{name:"Indigo",id:"indigo",reference:!0,shades:[{number:50,hexcode:"#eef2ff"},{number:100,hexcode:"#e0e7ff"},{number:200,hexcode:"#c7d2fe"},{number:300,hexcode:"#a5b4fc"},{number:400,hexcode:"#818cf8"},{number:500,hexcode:"#6366f1"},{number:600,hexcode:"#4f46e5"},{number:700,hexcode:"#4338ca"},{number:800,hexcode:"#3730a3"},{number:900,hexcode:"#312e81"},{number:950,hexcode:"#1e1b4b"}]},{name:"Violet",id:"violet",reference:!0,shades:[{number:50,hexcode:"#f5f3ff"},{number:100,hexcode:"#ede9fe"},{number:200,hexcode:"#ddd6fe"},{number:300,hexcode:"#c4b5fd"},{number:400,hexcode:"#a78bfa"},{number:500,hexcode:"#8b5cf6"},{number:600,hexcode:"#7c3aed"},{number:700,hexcode:"#6d28d9"},{number:800,hexcode:"#5b21b6"},{number:900,hexcode:"#4c1d95"},{number:950,hexcode:"#2e1065"}]},{name:"Purple",id:"purple",reference:!0,shades:[{number:50,hexcode:"#faf5ff"},{number:100,hexcode:"#f3e8ff"},{number:200,hexcode:"#e9d5ff"},{number:300,hexcode:"#d8b4fe"},{number:400,hexcode:"#c084fc"},{number:500,hexcode:"#a855f7"},{number:600,hexcode:"#9333ea"},{number:700,hexcode:"#7e22ce"},{number:800,hexcode:"#6b21a8"},{number:900,hexcode:"#581c87"},{number:950,hexcode:"#3b0764"}]},{name:"Fuchsia",id:"fuchsia",reference:!0,shades:[{number:50,hexcode:"#fdf4ff"},{number:100,hexcode:"#fae8ff"},{number:200,hexcode:"#f5d0fe"},{number:300,hexcode:"#f0abfc"},{number:400,hexcode:"#e879f9"},{number:500,hexcode:"#d946ef"},{number:600,hexcode:"#c026d3"},{number:700,hexcode:"#a21caf"},{number:800,hexcode:"#86198f"},{number:900,hexcode:"#701a75"},{number:950,hexcode:"#4a044e"}]},{name:"Pink",id:"pink",reference:!0,shades:[{number:50,hexcode:"#fdf2f8"},{number:100,hexcode:"#fce7f3"},{number:200,hexcode:"#fbcfe8"},{number:300,hexcode:"#f9a8d4"},{number:400,hexcode:"#f472b6"},{number:500,hexcode:"#ec4899"},{number:600,hexcode:"#db2777"},{number:700,hexcode:"#be185d"},{number:800,hexcode:"#9d174d"},{number:900,hexcode:"#831843"},{number:950,hexcode:"#500724"}]},{name:"Rose",id:"rose",reference:!0,shades:[{number:50,hexcode:"#fff1f2"},{number:100,hexcode:"#ffe4e6"},{number:200,hexcode:"#fecdd3"},{number:300,hexcode:"#fda4af"},{number:400,hexcode:"#fb7185"},{number:500,hexcode:"#f43f5e"},{number:600,hexcode:"#e11d48"},{number:700,hexcode:"#be123c"},{number:800,hexcode:"#9f1239"},{number:900,hexcode:"#881337"},{number:950,hexcode:"#4c0519"}]}];function w2(e){const r=_2.filter(i=>i.reference).map(i=>({...i,shades:i.shades.map(a=>({...a,delta:$e.deltaE(e,a.hexcode)}))})).map(i=>({...i,closestShade:i.shades.reduce((a,l)=>a.delta<l.delta?a:l)})).reduce((i,a)=>i.closestShade.delta<a.closestShade.delta?i:a),o=r.shades.map(i=>({...i,lightnessDifference:Math.abs($e(i.hexcode).get("hsl.l")-e.get("hsl.l"))})),s=o.reduce((i,a)=>i.lightnessDifference<a.lightnessDifference?i:a);return{...r,shades:o,closestShade:s}}function E2(e){const t=$e(e),n=w2(t),r=t.get("hsl.h"),o=$e(n.closestShade.hexcode).get("hsl.h"),s=r-o,i=s===0?o.toString():s>0?`+${s}`:s.toString(),a=t.get("hsl.s")/$e(n.closestShade.hexcode).get("hsl.s");return n.shades.map(u=>{if(u.number===n.closestShade.number)return{number:u.number,hexcode:t.hex()};let c=$e(u.hexcode);const d=c.get("hsl.s")*a;return c=c.set("hsl.s",d),c=c.set("hsl.h",i),{number:u.number,hexcode:c.hex()}})}class Ju extends Error{constructor(){super(),this.name="IndiscriminateError"}}const x2={},k2={fill:"none",viewBox:"0 0 24 24"};function O2(e,t){return g(),T("svg",k2,t[0]||(t[0]=[j("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),j("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)]))}const Xt=Qn(x2,[["render",O2],["__scopeId","data-v-687bcaf0"]]),S2={"aria-hidden":"true"},Qu=he({__name:"MoonButtonBase",props:{label:{},successLabel:{},errorLabel:{},icon:{},variant:{},size:{},working:{type:Boolean},success:{type:Boolean},error:{type:Boolean},disabled:{type:Boolean},type:{}},emits:["click"],setup(e){const t=e,n=ve(Lt),r=se(()=>t.success?t.successLabel??t.label:t.error?t.errorLabel??t.label:t.label),o=se(()=>t.variant?t.variant==="secondary"?`secondary-${(n==null?void 0:n.value.theme.buttons)??"light"}`:t.variant:"primary");return(s,i)=>{var a,l;return g(),Q(jl(s.type==="anchor"?"a":"button"),{class:"moonbase:button",type:s.type||"button",disabled:s.success||s.error||s.working||s.disabled,"data-success":s.success||void 0,"data-error":s.error||void 0,"data-working":s.working||void 0,"data-variant":o.value,"data-size":s.size||"large","data-corners":(a=b(n))==null?void 0:a.theme.corners,"data-background":(l=b(n))==null?void 0:l.theme.colors.background,"data-icon-visible":s.working||s.success||s.error||!!s.icon||void 0,onClick:i[0]||(i[0]=u=>s.$emit("click",u))},{default:N(()=>[j("div",S2,[s.working?(g(),Q(Xt,{key:0})):s.success?(g(),Q(b(Z1),{key:1})):s.error?(g(),Q(b(X1),{key:2})):s.icon?(g(),Q(jl(s.icon),{key:3})):de("",!0)]),V(" "+F(r.value),1)]),_:1},8,["type","disabled","data-success","data-error","data-working","data-variant","data-size","data-corners","data-background","data-icon-visible"])}}}),st=he({__name:"MoonButton",props:{handler:{type:Function},label:{},success:{},error:{},icon:{},variant:{},size:{},noReset:{type:Boolean},disabled:{type:Boolean}},setup(e){const t=e,n=R(!1),r=R(!1),o=R(!1);async function s(){try{const i=t.handler();i instanceof Promise&&(n.value=!0,await i,n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1))}catch(i){if(n.value=!1,i instanceof Ju)return;o.value=!0,await Ht(2500),o.value=!1}}return(i,a)=>(g(),Q(Qu,{label:i.label,working:n.value,"success-label":i.success,success:r.value,"error-label":i.error,error:o.value,icon:i.icon,disabled:i.disabled,variant:i.variant,size:i.size,onClick:s},null,8,["label","working","success-label","success","error-label","error","icon","disabled","variant","size"]))}}),N2={},C2={class:"moonbase:text-body"};function T2(e,t){return g(),T("span",C2,[xt(e.$slots,"default")])}const tt=Qn(N2,[["render",T2]]),P2={},$2={class:"moonbase:text-subtext"};function A2(e,t){return g(),T("span",$2,[xt(e.$slots,"default")])}const Ve=Qn(P2,[["render",A2]]),D2={class:"moonbase:about"},I2=he({__name:"About",setup(e){const t=Te(),n="0.3.8";return(r,o)=>(g(),T("div",D2,[o[2]||(o[2]=Pf('<svg viewBox="0 0 512 512" height="56px" width="56px"><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)),w(b(qh),{as:"h3"},{default:N(()=>o[0]||(o[0]=[V(" Moonbase Embedded Storefront ")])),_:1}),w(Ve,null,{default:N(()=>[V(" Version "+F(b(n)),1)]),_:1}),w(tt,null,{default:N(()=>o[1]||(o[1]=[V(" This store is using the "),j("a",{href:"https://moonbase.sh/solutions/payments",target:"_blank"},"Moonbase Embedded Storefront",-1),V(" module to accept payments, provide authentication and power software licensing. ")])),_:1}),w(st,{label:"Close",variant:"primary",handler:()=>b(t).reset()},null,8,["handler"])]))}});var qt=(e=>(e.SignedIn="signed-in",e.SignedUp="signed-up",e.SignedOut="signed-out",e.RedeemedVoucher="redeemed-voucher",e.DownloadedProduct="downloaded-product",e.ActivatedProduct="activated-product",e.AddedToCart="added-to-cart",e.CheckoutInitiated="checkout-initiated",e.CheckoutClosed="checkout-closed",e.CheckoutCompleted="checkout-completed",e))(qt||{});const M2=["data-corners","data-variant"],V2={class:"moonbase:card-content"},En=he({__name:"MoonCard",setup(e){const t=ve(Lt);return(n,r)=>{var o,s;return g(),T("div",{class:"moonbase:card","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-variant":(s=b(t))==null?void 0:s.theme.cards},[j("div",V2,[xt(n.$slots,"default")]),xt(n.$slots,"addon")],8,M2)}}}),R2=["data-corners"],L2=["src"],j2={key:1,class:"moonbase:image-placeholder"},Jt=he({__name:"ProductIcon",props:{url:{},size:{}},setup(e){const t=ve(Lt);return(n,r)=>{var o;return g(),T("div",{class:"moonbase:product-icon",style:Ri({width:`${n.size}px`,height:`${n.size}px`}),"data-corners":(o=b(t))==null?void 0:o.theme.corners},[n.url?(g(),T("img",{key:0,src:n.url,alt:""},null,8,L2)):(g(),T("div",j2,[w(b(Y1))]))],12,R2)}}}),F2={},U2={class:"moonbase:text-title"};function B2(e,t){return g(),T("h4",U2,[xt(e.$slots,"default")])}const Jo=Qn(F2,[["render",B2]]),H2={class:"moonbase:product-card-content"},Bp=he({__name:"ProductCard",props:{product:{}},setup(e){return(t,n)=>(g(),Q(En,{class:"moonbase:product-card"},{default:N(()=>[w(Jt,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",H2,[w(Jo,null,{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Ve,null,{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.tagline),1)]}),_:1}),xt(t.$slots,"description")]),xt(t.$slots,"default")]),_:3}))}}),q2={class:"moonbase:auto-activation"},W2={key:0,class:"moonbase:loader"},z2={key:1,class:"moonbase:loader"},Z2={key:2,class:"moonbase:loader"},Y2={key:3},G2={key:1,class:"moonbase:loader"},K2={key:2,class:"moonbase:loader"},X2={key:3,class:"moonbase:loader"},J2={key:4,class:"moonbase:auto-activation-content"},Q2={key:0,class:"moonbase:auto-activation-option"},eE={class:"moonbase:auto-activation-cta"},tE={key:1,class:"moonbase:auto-activation-option"},nE={class:"moonbase:auto-activation-cta"},rE={key:2,class:"moonbase:auto-activation-option"},oE={key:3,class:"moonbase:auto-activation-option"},sE={class:"moonbase:auto-activation-cta"},iE={key:4,class:"moonbase:auto-activation-option"},aE={key:4,class:"moonbase:auto-activation-cta"},lE={key:5,class:"moonbase:auto-activation-cta"},uE=he({__name:"AutoActivation",setup(e){const t=Te(),{user:n,loaded:r}=Qe(),o=ve(Vr),s=t.getParameter("token"),{activationRequest:i,loading:a,fulfilling:l,completing:u,error:c,fulfillLicense:d,fulfillTrial:f}=cy(s),h=ve(nn);Je(i,m=>{var $;!l.value&&!u.value&&(m==null?void 0:m.status)===dn.Requested&&(($=m==null?void 0:m.licenseEligibility)!=null&&$.eligible)&&d(),(m==null?void 0:m.status)===dn.Completed&&(o==null||o(qt.ActivatedProduct,{product:m.product,fulfillmentType:m.fulfillmentType,user:n.value}))},{deep:!0});const p=se(()=>{if(i.value)return b(Xs(i.value.product.id))}),_=se(()=>p.value&&p.value.defaultVariation),{currency:E,addToCart:C,setQuantity:z}=Nr();function Z(){t.show(ae.Product,te.ViewProduct,{product_id:i.value.product.id})}function B(){t.enqueue(ae.Activation,te.ActivateProduct,t.parameters??void 0),t.show(ae.Authentication,te.SignIn)}function L(){if(!p.value)return;const m=C(p.value);z(m,1),t.enqueue(ae.Activation,te.ActivateProduct,t.parameters),t.show(ae.Cart,te.ViewCart)}function D(){var m;t.enqueue(ae.Activation,te.ActivateProduct,{...t.parameters,product_id:((m=i.value)==null?void 0:m.product.id)??""}),n.value?t.show(ae.Customer,te.RedeemVoucher):t.show(ae.Redeem,te.RedeemVoucher)}return(m,$)=>{var I,P,A,k,G,_e,O;return g(),T("div",q2,[b(a)||!b(r)||!((I=b(h))!=null&&I.loadedStorefront)?(g(),T("div",W2,[w(Xt)])):b(c)?(g(),T("div",z2,[w(et,null,{default:N(()=>$[0]||($[0]=[V(" Uh oh ")])),_:1}),w(tt,null,{default:N(()=>[V(F(b(c)),1)]),_:1})])):b(i)?(g(),T("div",Y2,[b(i).product?(g(),Q(Bp,{key:0,product:b(i).product},null,8,["product"])):de("",!0),((P=b(i))==null?void 0:P.status)===b(dn).Cancelled?(g(),T("div",G2,[w(et,null,{default:N(()=>$[3]||($[3]=[V(" Uh oh ")])),_:1}),w(tt,null,{default:N(()=>$[4]||($[4]=[V(" This activation request was cancelled, open your app to try again. ")])),_:1})])):b(l)||b(u)?(g(),T("div",K2,[w(Xt),w(tt,null,{default:N(()=>[V(" Activating "+F(b(i).product.name)+"... ",1)]),_:1})])):((A=b(i))==null?void 0:A.status)===b(dn).Completed?(g(),T("div",X2,[w(et,null,{default:N(()=>$[5]||($[5]=[V(" Done! ")])),_:1}),w(tt,null,{default:N(()=>$[6]||($[6]=[V(" Your product is activated. "),j("br",null,null,-1),V(" You may close this window and return to the app. ")])),_:1})])):(g(),T("div",J2,[_.value?(g(),T("div",Q2,[w(et,null,{default:N(()=>$[7]||($[7]=[V(" Option 1: Purchase product ")])),_:1}),w(tt,null,{default:N(()=>[V(" Buy a copy of "+F(p.value.name)+" for ",1),j("strong",null,F(b(yn)(p.value.defaultVariation.price[b(E)],b(E))),1),$[8]||($[8]=V(". "))]),_:1}),j("span",eE,[w(st,{label:"Purchase",variant:"primary",handler:()=>L()},null,8,["handler"])])])):de("",!0),b(n)?!b(n).ownedProducts||!((k=b(n).ownedProducts)!=null&&k.includes(b(i).product.id))&&!b(n).subscribedProducts||!((G=b(n).subscribedProducts)!=null&&G.includes(b(i).product.id))?(g(),T("div",rE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"2":"1")+": Use license ",1)]),_:1}),w(tt,null,{default:N(()=>$[10]||($[10]=[V(" You don't own any licenses for this product. ")])),_:1})])):(_e=b(n).ownedProducts)!=null&&_e.includes(b(i).product.id)||(O=b(n).subscribedProducts)!=null&&O.includes(b(i).product.id)?(g(),T("div",oE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"2":"1")+": Use license ",1)]),_:1}),w(tt,null,{default:N(()=>$[11]||($[11]=[V(" You don't have enough free seats on your licenses to activate this device. Either free up a seat or purchase additional licenses. ")])),_:1}),j("span",sE,[w(st,{label:"Licenses",variant:"secondary",handler:()=>Z()},null,8,["handler"])])])):de("",!0):(g(),T("div",tE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"2":"1")+": Use license ",1)]),_:1}),w(tt,null,{default:N(()=>$[9]||($[9]=[V(" Please sign in to use a license for this product. ")])),_:1}),j("span",nE,[w(st,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])])),b(i).trialEligibility?(g(),T("div",iE,[w(et,null,{default:N(()=>[V(" Option "+F(_.value?"3":"2")+": Start trial ",1)]),_:1}),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),Q(tt,{key:0},{default:N(()=>$[12]||($[12]=[V(" You need to be signed in to start a trial for this product. ")])),_:1})):b(i).trialEligibility.eligible&&b(i).trialEligibility.existing?(g(),Q(tt,{key:1},{default:N(()=>[V(" You are eligible for a "+F(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial of which you have "+F(b(i).trialEligibility.numberOfDaysRemaining)+" days remaining. ",1)]),_:1})):b(i).trialEligibility.eligible?(g(),Q(tt,{key:2},{default:N(()=>[V(" You are eligible for a "+F(b(i).trialEligibility.numberOfDaysPerProduct)+" day trial. ",1)]),_:1})):(g(),Q(tt,{key:3},{default:N(()=>$[13]||($[13]=[V(" This device or product is not eligible for a trial. ")])),_:1})),b(i).trialEligibility.eligible&&b(i).trialEligibility.requiresAccount&&!b(n)?(g(),T("span",aE,[w(st,{label:"Sign in",variant:"secondary",handler:()=>B()},null,8,["handler"])])):b(i).trialEligibility.eligible?(g(),T("span",lE,[w(st,{label:"Start trial",variant:"secondary",handler:b(f)},null,8,["handler"])])):de("",!0)])):de("",!0),$[15]||($[15]=j("div",{class:"moonbase:grow"},null,-1)),w(Ve,{class:"moonbase:auto-activation-redeem"},{default:N(()=>[$[14]||($[14]=V(" Have a voucher code? ")),j("button",{type:"button",onClick:D}," Redeem now ")]),_:1})]))])):(g(),T("div",Z2,[w(et,null,{default:N(()=>$[1]||($[1]=[V(" Uh oh ")])),_:1}),w(tt,null,{default:N(()=>$[2]||($[2]=[V(" Could not find activation request ")])),_:1})]))])}}}),cE={},dE={class:"moonbase:text-caption"};function fE(e,t){return g(),T("span",dE,[xt(e.$slots,"default")])}const Dr=Qn(cE,[["render",fE]]),hE=["data-corners"],pE=["accept"],mE={"data-error":""},bE=he({__name:"DeviceTokenInput",props:{error:{}},emits:["input","error"],setup(e,{emit:t}){const n=t,r=ve(Lt),o=R(!1),s=se(()=>{let u=".dt";return r!=null&&r.value&&(u=r.value.activation.deviceTokenFileExtension),u.startsWith(".")?u:`.${u}`});function i(u){const c=new FileReader;c.onload=d=>{var f;n("input",(f=d.target)==null?void 0:f.result)},c.readAsText(u)}function a(u){var d;o.value=!1;const c=(d=u.dataTransfer)==null?void 0:d.files;if(!c||c.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(c[0])}function l(u){const c=u.target,d=c==null?void 0:c.files;if(!d||d.length!==1){n("error",new Error("Only one file can be uploaded at a time!"));return}i(d[0])}return(u,c)=>{var d,f;return g(),T("div",{class:ks(["moonbase:device-token-input",{"moonbase:device-token-input--hovering":o.value}]),"data-corners":(d=b(r))==null?void 0:d.theme.corners,onDrag:c[0]||(c[0]=Sr(()=>{},["prevent","stop"])),onDragstart:c[1]||(c[1]=Sr(()=>{},["prevent","stop"])),onDragend:c[2]||(c[2]=Sr(h=>o.value=!1,["prevent","stop"])),onDragover:c[3]||(c[3]=Sr(h=>o.value=!0,["prevent","stop"])),onDragenter:c[4]||(c[4]=Sr(h=>o.value=!0,["prevent","stop"])),onDragleave:c[5]||(c[5]=Sr(h=>o.value=!1,["prevent","stop"])),onDrop:Sr(a,["prevent","stop"])},[w(b(K1)),c[6]||(c[6]=j("label",{for:"fallback-input"},[j("span",{class:"moonbase:underline"},"Choose a machine file"),V(" or drag here to upload ")],-1)),j("input",{id:"fallback-input",type:"file",accept:s.value,class:"moonbase:sr-only",onChange:l},null,40,pE),j("p",mE,F((f=u.error)==null?void 0:f.message),1)],42,hE)}}}),gE={class:"moonbase:manual-activation"},vE={key:1,class:"moonbase:loader"},yE={key:2,class:"moonbase:manual-activation-content"},_E=he({__name:"ManualActivation",setup(e){const t=ve(Lt),{activateProduct:n}=so(),r=Ai.Offline,o=R(0),s=R(null),i=R(null);async function a(l){o.value=1;try{i.value=await n(l,r),o.value=2}catch(u){s.value=u,o.value=0}}return(l,u)=>(g(),T("div",gE,[w(tt,null,{default:N(()=>u[2]||(u[2]=[V(" Upload your machine file here to get a license file for activating offline devices. The machine file can be generated in the installed app. ")])),_:1}),w(Ys,{mode:"out-in",name:"moonbase:slide-left"},{default:N(()=>[o.value===0?(g(),Q(bE,{key:0,error:s.value,onInput:u[0]||(u[0]=c=>a(c)),onError:u[1]||(u[1]=c=>s.value=c)},null,8,["error"])):o.value===1?(g(),T("div",vE,[w(Xt)])):o.value===2&&i.value?(g(),T("div",yE,[w(et,null,{default:N(()=>u[3]||(u[3]=[V(" Success! ")])),_:1}),w(tt,null,{default:N(()=>u[4]||(u[4]=[V(" Your license can be downloaded below: ")])),_:1}),i.value.license.product?(g(),Q(Bp,{key:0,product:i.value.license.product},{description:N(()=>[w(Dr,null,{default:N(()=>[V(F(i.value.license.activeNumberOfActivations)+" of "+F(i.value.license.maxNumberOfActivations)+" devices activated ",1)]),_:1})]),default:N(()=>{var c;return[w(Bo,{href:i.value.url,target:"_blank",download:((c=b(t))==null?void 0:c.activation.licenseTokenFileName)??"license-file.mb",class:"moonbase:manual-activation-download-button"},{default:N(()=>[w(b(G1))]),_:1},8,["href","download"])]}),_:1},8,["product"])):de("",!0),u[5]||(u[5]=j("div",null,null,-1)),u[6]||(u[6]=j("div",null,null,-1))])):de("",!0)]),_:1})]))}}),wE={class:"moonbase:activation"},EE=he({__name:"Activation",setup(e){const t=Te();return(n,r)=>(g(),T("div",wE,[b(t).getParameter("token")?(g(),Q(uE,{key:0})):(g(),Q(_E,{key:1}))]))}}),xE=["disabled"],Hp=Symbol("form-state"),or=he({__name:"MoonForm",props:{handler:{type:Function},disabled:{type:Boolean},noReset:{type:Boolean}},setup(e){const t=e,n=R(!1),r=R(!1),o=R(!1),s=se(()=>t.disabled||n.value||r.value||!1);Bt(Hp,{working:n,isSuccess:r,isError:o,disabled:s});async function i(){n.value=!0;try{await t.handler(),n.value=!1,r.value=!0,await Ht(2500),t.noReset||(r.value=!1)}catch{n.value=!1,o.value=!0,await Ht(2500),o.value=!1}}return(a,l)=>(g(),T("form",{disabled:s.value,onSubmit:Sr(i,["prevent"])},[xt(a.$slots,"default",{working:n.value,isSuccess:r.value,isError:o.value,disabled:n.value||r.value})],40,xE))}}),kE=["hidden"],OE=["for"],SE=["id","type","name","placeholder","value","disabled","aria-invalid","aria-describedby","data-corners"],NE=["id"],CE=["id"],Nt=he({inheritAttrs:!1,__name:"MoonInput",props:{name:{},label:{},placeholder:{},type:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{},hidden:{type:Boolean}},emits:["update:modelValue"],setup(e){const t=ve(Lt);return(n,r)=>{var o;return g(),T("div",{class:"moonbase:input",hidden:n.hidden||void 0},[j("label",{for:`mb-${n.name}`},F(n.label),9,OE),j("input",Ql({id:`mb-${n.name}`,type:n.type??"text",name:`mb-${n.name}`,placeholder:n.placeholder,value:n.modelValue,disabled:n.disabled,"aria-invalid":!!n.error,"aria-describedby":n.error?`mb-${n.name}-error`:n.hint?`mb-${n.name}-hint`:void 0,"data-corners":(o=b(t))==null?void 0:o.theme.corners},n.$attrs,{onInput:r[0]||(r[0]=s=>{var i;return n.$emit("update:modelValue",(i=s.target)==null?void 0:i.value)})}),null,16,SE),n.error?(g(),T("p",{key:0,id:`mb-${n.name}-error`,class:"moonbase:input-hint","data-type":"error"},F(n.error),9,NE)):n.hint?(g(),T("p",{key:1,id:`mb-${n.name}-hint`,class:"moonbase:input-hint"},F(n.hint),9,CE)):de("",!0)],8,kE)}}}),sr=he({__name:"MoonSubmitButton",props:{label:{},success:{},error:{},variant:{},size:{}},setup(e){const{working:t,isSuccess:n,isError:r,disabled:o}=ve(Hp);return(s,i)=>(g(),Q(Qu,{label:s.label,working:b(t),"success-label":s.success,success:b(n),"error-label":s.error,error:b(r),type:"submit",disabled:b(o),variant:s.variant,size:s.size},null,8,["label","working","success-label","success","error-label","error","disabled","variant","size"]))}}),TE=["data-visible"],PE={class:"moonbase:sign-in-actions"},$E=he({__name:"SignIn",emits:["signedIn"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=ve(Lt),i=ve(Vr),a=R(r.getParameter("email")??""),l=R(""),u=R(null);async function c(){u.value=null;try{const d=await o.signIn(a.value,l.value);i==null||i(qt.SignedIn,{user:d}),Ht(1500).then(()=>n("signedIn",d))}catch(d){throw d instanceof pr?u.value="User not found":u.value=d.message,d}}return(d,f)=>(g(),Q(or,{handler:c,class:"moonbase:sign-in"},{default:N(()=>{var h;return[w(Nt,{modelValue:a.value,"onUpdate:modelValue":f[0]||(f[0]=p=>a.value=p),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":f[1]||(f[1]=p=>l.value=p),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:""},null,8,["modelValue"]),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},F(u.value),9,TE),w(sr,{success:"Signed in",label:"Sign in",error:"Error"}),j("div",PE,[(h=b(s))!=null&&h.auth.signUp.enabled?(g(),Q(st,{key:0,label:"Create account",variant:"subtle",handler:()=>b(r).show(b(ae).Authentication,b(te).SignUp,{email:a.value})},null,8,["handler"])):de("",!0),w(st,{label:"Forgot password",variant:"subtle",handler:()=>b(r).show(b(ae).Authentication,b(te).ForgotPassword,{email:a.value})},null,8,["handler"])])]}),_:1}))}}),Qo=[{title:"Password must be at least 6 characters long",test:e=>e.length>=6},{title:"Password must contain uppercase letters",test:e=>/[A-Z]/.test(e)},{title:"Password must contain lowercase letters",test:e=>/[a-z]/.test(e)},{title:"Password must contain at least one number",test:e=>/\d/.test(e)},{title:"Password must contain at least one special character",test:e=>/[=+\-^$*.[\\\]{}()?!@#%&/,><':;|_~`]/.test(e)}],AE={key:0,class:"moonbase:loader"},DE={key:1,class:"moonbase:error","data-visible":""},IE={key:0,class:"moonbase:password-validation"},ME=["data-visible"],VE=he({__name:"ConfirmAccount",emits:["confirmedAccount"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=R(!0),i=R(null),a=R(""),l=R(!1),u=R(null),c=se(()=>Qo.some(f=>!f.test(a.value)));Ue(async()=>{try{const f=r.getParameter("email"),h=r.getParameter("code");if(!f||!h)throw new Error("Link is broken");i.value=await o.confirmAccount(f,h)}catch(f){f instanceof pr?u.value="Could not find a user to confirm":u.value=f.message}s.value=!1});async function d(){var f,h;if(u.value=null,!!((f=i.value)!=null&&f.resetPasswordToken))try{const p=r.getParameter("email");await o.resetPassword(p,a.value,(h=i.value)==null?void 0:h.resetPasswordToken);const _=await o.signIn(p,a.value);Ht(1500).then(()=>n("confirmedAccount",_))}catch(p){throw u.value=p.message,p}}return(f,h)=>(g(),Q(or,{handler:d,disabled:c.value,class:"moonbase:confirm-account"},{default:N(()=>[s.value?(g(),T("div",AE,[w(Xt)])):i.value?(g(),T(De,{key:2},[j("h3",null," Hi "+F(i.value.name)+", ",1),h[2]||(h[2]=j("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:a.value,"onUpdate:modelValue":h[0]||(h[0]=p=>a.value=p),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:h[1]||(h[1]=p=>l.value=!0)},null,8,["modelValue"]),l.value&&c.value?(g(),T("div",IE,[(g(!0),T(De,null,yt(b(Qo).filter(p=>!p.test(a.value)),p=>(g(),Q(Ve,{key:p.title,"data-error":""},{default:N(()=>[V(F(p.title),1)]),_:2},1024))),128))])):de("",!0),w(sr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!u.value||void 0},F(u.value),9,ME)],64)):(g(),T("div",DE,F(u.value),1))]),_:1},8,["disabled"]))}}),RE={class:"moonbase:confirm-email-change"},LE={key:0,class:"moonbase:loader"},jE={key:1,class:"moonbase:error","data-visible":""},FE=he({__name:"ConfirmEmail",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Te(),{user:o,confirmEmail:s}=Qe(),i=R(!0),a=R(null);return Ue(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>(g(),T("div",RE,[i.value?(g(),T("div",LE,[w(Xt)])):a.value?(g(),T("div",jE,F(a.value),1)):(g(),T(De,{key:2},[w(et,null,{default:N(()=>u[0]||(u[0]=[V(" Success! ")])),_:1}),u[1]||(u[1]=j("p",null," Thanks for confirming your new email. ",-1)),b(o)?(g(),Q(st,{key:0,handler:()=>b(r).show(b(ae).Customer,b(te).ViewAccount,void 0,!0),label:"Continue"},null,8,["handler"])):de("",!0)],64))]))}}),UE={class:"moonbase:confirm-email-change"},BE={key:0,class:"moonbase:loader"},HE={key:1,class:"moonbase:error","data-visible":""},qE=he({__name:"ConfirmEmailChange",emits:["confirmed"],setup(e,{emit:t}){const n=t,r=Te(),{user:o,confirmEmailChange:s}=Qe(),i=R(!0),a=R(null);return Ue(async()=>{try{const l=r.getParameter("email"),u=r.getParameter("code");if(!l||!u)throw new Error("Link is broken");await s(l,u),Ht(1500).then(()=>n("confirmed"))}catch(l){a.value=l.message}i.value=!1}),(l,u)=>{var c;return g(),T("div",UE,[i.value?(g(),T("div",BE,[w(Xt)])):a.value?(g(),T("div",HE,F(a.value),1)):(g(),T(De,{key:2},[j("h3",null," Hi "+F((c=b(o))==null?void 0:c.name)+", ",1),u[0]||(u[0]=j("p",null," Thanks for confirming your new email. You can now sign in using this new address. ",-1))],64))])}}}),WE=["data-visible"],zE=he({__name:"ForgotPassword",setup(e){const t=Te(),n=Qe(),r=R(t.getParameter("email")??""),o=R(null),s=R(!1);async function i(){o.value=null;try{await n.forgotPassword(r.value),Ht(1500).then(()=>{s.value=!0})}catch(a){throw a instanceof pr?o.value="User not found":o.value=a.message,a}}return(a,l)=>(g(),Q(or,{handler:i,class:"moonbase:sign-in","no-reset":""},{default:N(({disabled:u})=>[l[1]||(l[1]=j("p",null," Please enter your email address below. You will receive an email message with instructions on how to reset your password. ",-1)),w(Nt,{modelValue:r.value,"onUpdate:modelValue":l[0]||(l[0]=c=>r.value=c),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:"",disabled:u},null,8,["modelValue","disabled"]),w(sr,{success:"Email sent",label:"Reset password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},F(o.value),9,WE)]),_:1}))}}),ZE={key:0,class:"moonbase:password-validation"},YE=["data-visible"],GE=he({__name:"ResetPassword",emits:["passwordReset"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=se(()=>r.getParameter("email")),i=R(""),a=R(!1),l=R(null),u=se(()=>Qo.some(d=>!d.test(i.value)));Ue(()=>{(!r.getParameter("email")||!r.getParameter("code"))&&(l.value="Link broken, please try again")});async function c(){l.value=null;const d=r.getParameter("code");if(d)try{await o.resetPassword(s.value,i.value,d);const f=await o.signIn(s.value,i.value);Ht(1500).then(()=>n("passwordReset",f))}catch(f){throw l.value=f.message,f}}return(d,f)=>(g(),Q(or,{handler:c,disabled:u.value,class:"moonbase:reset-password"},{default:N(()=>[j("h3",null," Hi "+F(s.value)+", ",1),f[2]||(f[2]=j("p",null," Please create a new password for your account: ",-1)),w(Nt,{"model-value":b(r).getParameter("email"),hidden:"",label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["model-value"]),w(Nt,{modelValue:i.value,"onUpdate:modelValue":f[0]||(f[0]=h=>i.value=h),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"new-password",required:"",onBlur:f[1]||(f[1]=h=>a.value=!0)},null,8,["modelValue"]),a.value&&u.value?(g(),T("div",ZE,[(g(!0),T(De,null,yt(b(Qo).filter(h=>!h.test(i.value)),h=>(g(),Q(Ve,{key:h.title,"data-error":""},{default:N(()=>[V(F(h.title),1)]),_:2},1024))),128))])):de("",!0),w(sr,{success:"Password saved",label:"Save password",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!l.value||void 0},F(l.value),9,YE)]),_:1},8,["disabled"]))}}),KE={class:"moonbase:checkbox"},XE={class:"moonbase:checkbox-container"},JE=["id","name","value","disabled","aria-invalid","aria-describedby"],QE={class:"moonbase:checkbox-description"},e5=["for"],t5=["id"],n5=["id"],qp=he({inheritAttrs:!1,__name:"MoonCheckbox",props:{name:{},label:{},error:{},hint:{},disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(t,n)=>(g(),T("div",KE,[j("div",XE,[j("input",Ql({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,JE)]),j("div",QE,[j("label",{for:`mb-${t.name}`},F(t.label),9,e5),t.error?(g(),T("p",{key:0,id:`mb-${t.name}-error`,"data-type":"error"},F(t.error),9,t5)):t.hint?(g(),T("p",{key:1,id:`mb-${t.name}-hint`},F(t.hint),9,n5)):de("",!0)])]))}}),r5={key:0,class:"moonbase:password-validation"},o5=["href"],s5=["href"],i5=["data-visible"],a5=he({__name:"SignUp",emits:["signedUp"],setup(e,{emit:t}){const n=t,r=Te(),o=Qe(),s=ve(nc),i=ve(Vr),a=R(""),l=R(r.getParameter("email")??""),u=R(""),c=R(!1),d=R(!1),f=R(null),h=se(()=>Qo.some(_=>!_.test(u.value)));async function p(){f.value=null;try{const _=await o.signUp(a.value,l.value,u.value,null,!0,!0,d.value);i==null||i(qt.SignedUp,{user:_}),Ht(1500).then(()=>n("signedUp",_))}catch(_){throw f.value=_.message,_}}return(_,E)=>(g(),Q(or,{handler:p,disabled:h.value,class:"moonbase:sign-up"},{default:N(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":E[0]||(E[0]=C=>a.value=C),label:"Full name",name:"name",type:"text",placeholder:"Full name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":E[1]||(E[1]=C=>l.value=C),label:"Email address",name:"email",type:"email",placeholder:"Email address",autocomplete:"email",required:""},null,8,["modelValue"]),w(Nt,{modelValue:u.value,"onUpdate:modelValue":E[2]||(E[2]=C=>u.value=C),label:"Password",name:"password",type:"password",placeholder:"Password",autocomplete:"current-password",required:"",onBlur:E[3]||(E[3]=C=>c.value=!0)},null,8,["modelValue"]),c.value&&h.value?(g(),T("div",r5,[(g(!0),T(De,null,yt(b(Qo).filter(C=>!C.test(u.value)),C=>(g(),Q(Ve,{key:C.title,"data-error":""},{default:N(()=>[V(F(C.title),1)]),_:2},1024))),128))])):de("",!0),w(qp,{modelValue:d.value,"onUpdate:modelValue":E[4]||(E[4]=C=>d.value=C),label:"Receive updates and offers by email",name:"newsletter-opt-in"},null,8,["modelValue"]),w(Ve,null,{default:N(()=>[E[5]||(E[5]=V(" By signing up, you accept our ")),j("a",{href:`${b(s)}/terms-of-use`,target:"_blank",rel:"noopener"},"terms",8,o5),E[6]||(E[6]=V(" and ")),j("a",{href:`${b(s)}/privacy-policy`,target:"_blank",rel:"noopener"},"privacy policy",8,s5),E[7]||(E[7]=V(". "))]),_:1}),w(sr,{success:"Signed up",label:"Sign up",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!f.value||void 0},F(f.value),9,i5),w(st,{label:"I already have an account",variant:"subtle",handler:()=>b(r).show(b(ae).Authentication,b(te).SignIn,{email:l.value})},null,8,["handler"])]),_:1},8,["disabled"]))}}),l5={class:"moonbase:authentication"},u5={key:0,class:"moonbase:loader"},c5=he({__name:"Authentication",setup(e){const t=Te(),{loaded:n}=Qe();return(r,o)=>(g(),T("div",l5,[w(Ys,{name:b(t).direction===b(bu).Forward?"moonbase:slide-left":"moonbase:slide-right",mode:"out-in"},{default:N(()=>[b(n)?b(t).intent===b(te).SignIn?(g(),Q($E,{key:1,onSignedIn:o[0]||(o[0]=s=>b(t).dequeue())})):b(t).intent===b(te).SignUp?(g(),Q(a5,{key:2,onSignedUp:o[1]||(o[1]=s=>b(t).next?b(t).dequeue():b(t).show(b(ae).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmAccount?(g(),Q(VE,{key:3,onConfirmedAccount:o[2]||(o[2]=s=>b(t).show(b(ae).Customer,b(te).ViewAccount,void 0,!0))})):b(t).intent===b(te).ConfirmEmail?(g(),Q(FE,{key:4})):b(t).intent===b(te).ConfirmEmailChange?(g(),Q(qE,{key:5})):b(t).intent===b(te).ForgotPassword?(g(),Q(zE,{key:6})):b(t).intent===b(te).ResetPassword?(g(),Q(GE,{key:7,onPasswordReset:o[3]||(o[3]=s=>b(t).show(b(ae).Customer,b(te).ViewAccount,void 0))})):de("",!0):(g(),T("div",u5,[w(Xt)]))]),_:1},8,["name"])]))}}),d5={},f5={class:"moonbase:text-subtext-bold"};function h5(e,t){return g(),T("span",f5,[xt(e.$slots,"default")])}const Ct=Qn(d5,[["render",h5]]),p5=["data-corners","data-cards"],Wp=he({__name:"Counter",props:{modelValue:{}},emits:["update:modelValue"],setup(e){const t=ve(Lt);return(n,r)=>{var o,s;return g(),T("div",{class:"moonbase:counter","data-corners":(o=b(t))==null?void 0:o.theme.corners,"data-cards":(s=b(t))==null?void 0:s.theme.cards},[j("button",{onClick:r[0]||(r[0]=i=>n.$emit("update:modelValue",n.modelValue-1))},[w(b(J1))]),w(Ve,null,{default:N(()=>[V(F(n.modelValue.toString().padStart(2,"0")),1)]),_:1}),j("button",{onClick:r[1]||(r[1]=i=>n.$emit("update:modelValue",n.modelValue+1))},[w(b(Q1))])],8,p5)}}});function ec(e){switch(e){case fr.Daily:return"day";case fr.Weekly:return"week";case fr.Monthly:return"month";case fr.Quarterly:return"quarter";case fr.Yearly:return"year"}throw new Error("Unknown cycle length")}const m5={class:"moonbase:bundle-cart-item-content"},b5={key:0,class:"moonbase:bundle-cart-item-total"},g5={key:0,class:"moonbase:discount"},v5={class:"moonbase:bundle-cart-item-summary"},y5=["data-open"],_5=["data-open"],w5={class:"moonbase:bundle-cart-item-product-list-item-content"},E5={key:0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},x5=he({__name:"BundleCartItem",props:{lineItem:{},currency:{}},setup(e){const n=ba(e.lineItem.bundleId),r=Nr(),o=R(!1),s=R(null);return Je(o,i=>{s.value&&(s.value.style.height=i?`${s.value.scrollHeight}px`:"0px")}),(i,a)=>(g(),Q(En,{class:"moonbase:bundle-cart-item"},{addon:N(()=>{var l;return[j("div",v5,[i.lineItem.bundle?(g(),T("button",{key:0,onClick:a[1]||(a[1]=u=>o.value=!o.value)},[w(Ct,null,{default:N(()=>{var u,c,d;return[V(F((u=i.lineItem.bundle)==null?void 0:u.products.filter(f=>f.included).length)+" ",1),(c=i.lineItem.bundle)!=null&&c.products.some(f=>!f.included)?(g(),T(De,{key:0},[V(" of "+F((d=i.lineItem.bundle)==null?void 0:d.products.length),1)],64)):de("",!0),a[2]||(a[2]=V(" products "))]}),_:1}),w(Ve,null,{default:N(()=>[V(F(o.value?"Hide":"Show")+" ",1),(g(),T("svg",{"data-open":o.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},a[3]||(a[3]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,y5))]),_:1})])):de("",!0)]),j("div",{ref_key:"productListRef",ref:s,class:"moonbase:bundle-cart-item-product-list",style:{height:"0px"},"data-open":o.value||void 0},[(g(!0),T(De,null,yt(((l=i.lineItem.bundle)==null?void 0:l.products)||[],u=>(g(),T("div",{key:u.id,class:"moonbase:bundle-cart-item-product-list-item"},[w(Jt,{url:u==null?void 0:u.iconUrl,size:48},null,8,["url"]),j("div",w5,[w(Ct,{"data-included":u.included||void 0},{default:N(()=>[u.included?(g(),T("svg",E5,a[4]||(a[4]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)]))):de("",!0),V(" "+F(u==null?void 0:u.name),1)]),_:2},1032,["data-included"]),u.included?u!=null&&u.tagline?(g(),Q(Ve,{key:1},{default:N(()=>[V(F(u.tagline),1)]),_:2},1024)):de("",!0):(g(),Q(Ve,{key:0},{default:N(()=>a[5]||(a[5]=[V(" You already own this ")])),_:1}))])]))),128))],8,_5)]}),default:N(()=>{var l,u,c,d,f;return[w(Jt,{url:(l=i.lineItem.bundle)==null?void 0:l.iconUrl,size:72},null,8,["url"]),j("div",m5,[w(Ct,null,{default:N(()=>{var h;return[V(F((h=i.lineItem.bundle)==null?void 0:h.name),1)]}),_:1}),w(Ve,{class:"moonbase:bundle-cart-item-tagline","data-truncate":i.lineItem.variation&&i.lineItem.variation.id!==((c=(u=b(n))==null?void 0:u.defaultVariation)==null?void 0:c.id)||void 0},{default:N(()=>{var h;return[V(F((h=i.lineItem.bundle)==null?void 0:h.tagline),1)]}),_:1},8,["data-truncate"]),i.lineItem.variation&&i.lineItem.variation.id!==((f=(d=b(n))==null?void 0:d.defaultVariation)==null?void 0:f.id)?(g(),Q(Ve,{key:0,class:"moonbase:bundle-cart-item-variation"},{default:N(()=>[V(F(i.lineItem.variation.name),1)]),_:1})):de("",!0)]),i.lineItem.variation?(g(),T("div",b5,[w(li,null,{default:N(()=>{var h;return[i.lineItem.variation.hasDiscount?(g(),T("span",g5,F(b(yn)(i.lineItem.variation.originalPrice[i.currency]*i.lineItem.quantity,i.currency)),1)):de("",!0),V(" "+F(b(yn)(i.lineItem.variation.price[i.currency]*i.lineItem.quantity,i.currency))+" ",1),((h=i.lineItem.variation)==null?void 0:h.recurrence.type)==="Recurring"?(g(),Q(tt,{key:1},{default:N(()=>[V(" / "+F(b(ec)(i.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):de("",!0)]}),_:1}),w(Wp,{"model-value":i.lineItem.quantity,"onUpdate:modelValue":a[0]||(a[0]=h=>b(r).setQuantity(i.lineItem,h))},null,8,["model-value"])])):de("",!0)]}),_:1}))}}),k5={class:"moonbase:product-cart-item-content"},O5={class:"moonbase:product-cart-item-total"},S5={key:0,class:"moonbase:discount"},N5=he({__name:"ProductCartItem",props:{lineItem:{},currency:{}},setup(e){const t=e,n=Xs(t.lineItem.productId);function r(a){var u;if(!a.variation)throw new Error("No variation found");const l=s(a);return(l==null?void 0:l.price[t.currency])??((u=a.variation)==null?void 0:u.price[t.currency])}function o(a){return!!s(a)}function s(a){var u,c;const l=((c=(u=a.variation)==null?void 0:u.pricingTiers)==null?void 0:c.filter(d=>a.quantity>=d.minQuantity))??[];return l.length>0?l[l.length-1]:null}const i=Nr();return(a,l)=>(g(),Q(En,{class:"moonbase:product-cart-item"},{default:N(()=>{var u,c,d,f,h;return[w(Jt,{url:(u=a.lineItem.product)==null?void 0:u.iconUrl,size:72},null,8,["url"]),j("div",k5,[w(Ct,null,{default:N(()=>{var p;return[V(F((p=a.lineItem.product)==null?void 0:p.name),1)]}),_:1}),w(Ve,{class:"moonbase:product-cart-item-tagline","data-truncate":a.lineItem.variation&&a.lineItem.variation.id!==((d=(c=b(n))==null?void 0:c.defaultVariation)==null?void 0:d.id)||void 0},{default:N(()=>{var p;return[V(F((p=a.lineItem.product)==null?void 0:p.tagline),1)]}),_:1},8,["data-truncate"]),a.lineItem.variation&&a.lineItem.variation.id!==((h=(f=b(n))==null?void 0:f.defaultVariation)==null?void 0:h.id)?(g(),Q(Ve,{key:0,class:"moonbase:product-cart-item-variation"},{default:N(()=>[V(F(a.lineItem.variation.name),1)]),_:1})):de("",!0)]),j("div",O5,[a.lineItem.variation?(g(),Q(li,{key:0},{default:N(()=>{var p;return[a.lineItem.variation.hasDiscount||o(a.lineItem)?(g(),T("span",S5,F(b(yn)(a.lineItem.variation.originalPrice[a.currency]*a.lineItem.quantity,a.currency)),1)):de("",!0),V(" "+F(b(yn)(r(a.lineItem)*a.lineItem.quantity,a.currency))+" ",1),((p=a.lineItem.variation)==null?void 0:p.recurrence.type)==="Recurring"?(g(),Q(tt,{key:1},{default:N(()=>[V(" / "+F(b(ec)(a.lineItem.variation.recurrence.cycleLength)),1)]),_:1})):de("",!0)]}),_:1})):de("",!0),w(Wp,{"model-value":a.lineItem.quantity,"onUpdate:modelValue":l[0]||(l[0]=p=>b(i).setQuantity(a.lineItem,p))},null,8,["model-value"])])]}),_:1}))}}),C5={class:"moonbase:cart"},T5=["data-background"],P5=["data-corners"],$5={class:"moonbase:cart-total"},A5={"data-error":""},D5=he({__name:"Cart",setup(e){const{items:t,total:n,currency:r,checkout:o}=Nr(),s=ve(Lt),i=R(null);async function a(){i.value=null;try{const l=await o({redirect:(s==null?void 0:s.value.checkout.redirect)??!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`});if(!(l!=null&&l.completed))throw new Ju}catch(l){throw i.value=l.message,l}}return(l,u)=>{var c,d;return g(),T("div",C5,[b(t).length>0?(g(),T("ul",{key:0,role:"list",class:"moonbase:cart-items","data-background":(c=b(s))==null?void 0:c.theme.colors.background},[(g(!0),T(De,null,yt(b(t),f=>(g(),T("li",{key:f.id},[f.type==="Product"?(g(),Q(N5,{key:0,"line-item":f,currency:b(r)},null,8,["line-item","currency"])):f.type==="Bundle"?(g(),Q(x5,{key:1,"line-item":f,currency:b(r)},null,8,["line-item","currency"])):de("",!0)]))),128))],8,T5)):(g(),T("div",{key:1,class:"moonbase:cart-empty","data-corners":(d=b(s))==null?void 0:d.theme.corners},[w(b(e_)),w(Ct,null,{default:N(()=>u[0]||(u[0]=[V(" Your cart is empty ")])),_:1})],8,P5)),j("div",$5,[u[1]||(u[1]=j("label",null," Total ",-1)),j("span",null,F(b(yn)(b(n).amount,b(n).currency)),1),u[2]||(u[2]=j("p",null," Sales tax to be calculated at checkout ",-1)),j("p",A5,F(i.value),1)]),w(st,{handler:a,disabled:b(t).length===0,label:"Checkout",error:i.value?"Error":"Cancelled",variant:"primary"},null,8,["disabled","error"])])}}}),I5={class:"moonbase:account"},M5={key:0,class:"moonbase:error"},V5={key:1,class:"moonbase:notification"},R5={key:0,class:"moonbase:error"},L5=he({__name:"Account",setup(e){var z,Z,B;const t=Te(),{user:n,update:r,setPassword:o,signOut:s}=Qe(),i=ve(Vr),a=R(((z=n.value)==null?void 0:z.name)??""),l=R(((Z=n.value)==null?void 0:Z.email)??""),u=R(((B=n.value)==null?void 0:B.communicationPreferences)??{newsletterOptIn:!1}),c=R(null),d=R(!1),f=R(""),h=R(""),p=R(null);async function _(){c.value=null,d.value=!1;try{(await r(a.value,l.value,void 0,u.value)).needsEmailConfirmationToken&&(d.value=!0)}catch(L){throw c.value=L,L}}async function E(){p.value=null;try{await o(f.value,h.value),f.value="",h.value=""}catch(L){throw p.value=L,L}}async function C(){const L={...n.value};await s(),i==null||i(qt.SignedOut,{user:L}),t.reset()}return(L,D)=>(g(),T("div",I5,[w(or,{handler:_},{default:N(()=>[w(Nt,{modelValue:a.value,"onUpdate:modelValue":D[0]||(D[0]=m=>a.value=m),label:"Full name",name:"name",autocomplete:"name",required:""},null,8,["modelValue"]),w(Nt,{modelValue:l.value,"onUpdate:modelValue":D[1]||(D[1]=m=>l.value=m),label:"Email address",name:"email",type:"email",autocomplete:"email",required:""},null,8,["modelValue"]),w(qp,{modelValue:u.value.newsletterOptIn,"onUpdate:modelValue":D[2]||(D[2]=m=>u.value.newsletterOptIn=m),label:"Newsletter subscription",name:"newsletter-opt-in",hint:"Receive updates and offers by email"},null,8,["modelValue"]),w(sr,{label:"Update",error:"Error",success:"Updated"}),c.value?(g(),T("p",M5,F(c.value.message),1)):d.value?(g(),T("p",V5," You need to confirm your new email address, please check your inbox ")):de("",!0)]),_:1}),w(or,{handler:E},{default:N(()=>[w(Nt,{modelValue:f.value,"onUpdate:modelValue":D[3]||(D[3]=m=>f.value=m),label:"Current password",name:"old-password",type:"password",autocomplete:"current-password",required:""},null,8,["modelValue"]),w(Nt,{modelValue:h.value,"onUpdate:modelValue":D[4]||(D[4]=m=>h.value=m),label:"New password",name:"new-password",type:"password",autocomplete:"new-password",required:""},null,8,["modelValue"]),w(sr,{label:"Change password",error:"Error",success:"Password changed"}),p.value?(g(),T("p",R5,F(p.value.message),1)):de("",!0)]),_:1}),w(st,{label:"Log out",success:"Logged out",error:"Error",variant:"subtle",handler:C})]))}}),j5={class:"moonbase:products"},F5={key:0},U5={colspan:"2"},B5={key:1},H5=he({__name:"Products",setup(e){const t=Te(),{getProducts:n}=so(),r=R(null);return Ue(async()=>{let o=await n();for(r.value=o.items;o.hasMore&&o.next;)o=await n(o.next),r.value.push(...o.items)}),(o,s)=>(g(),T("table",j5,[j("tbody",null,[r.value?r.value.length===0?(g(),T("tr",B5,s[2]||(s[2]=[j("td",{colspan:"2"}," No products found ",-1)]))):de("",!0):(g(),T("tr",F5,[j("td",U5,[w(Xt),s[0]||(s[0]=V(" Loading products.. "))]),s[1]||(s[1]=j("td",null,null,-1))])),(g(!0),T(De,null,yt(r.value||[],i=>(g(),T("tr",{key:i.id},[j("td",null,[j("div",null,[w(Jt,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(i.name),1)]),_:2},1024),i.numberOfLicenses||i.subscriptionLicenses?(g(),Q(Ve,{key:0},{default:N(()=>[V(F((i.numberOfLicenses??0)+(i.subscriptionLicenses??0))+" licenses ",1)]),_:2},1024)):de("",!0)])])]),j("td",null,[w(Bo,{variant:"subtle",ca:"",onClick:a=>b(t).show(b(ae).Product,b(te).ViewProduct,{product_id:i.id})},{default:N(()=>[w(b(Xh)),s[3]||(s[3]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])]))),128))])]))}}),q5={class:"moonbase:bundle-redemption-item-content"},W5={class:"moonbase:bundle-redemption-item-summary"},z5=["data-open"],Z5=["data-open"],zp=he({__name:"BundleRedemptionItem",props:{bundle:{},quantity:{}},setup(e){const t=R(!1),n=R(null);return Je(t,r=>{n.value&&(n.value.style.height=r?`${n.value.scrollHeight}px`:"0px")}),(r,o)=>(g(),Q(En,{class:"moonbase:bundle-redemption-item"},{addon:N(()=>{var s;return[j("div",W5,[r.bundle?(g(),T("button",{key:0,onClick:o[0]||(o[0]=i=>t.value=!t.value)},[w(Ct,null,{default:N(()=>{var i;return[V(F((i=r.bundle)==null?void 0:i.products.length)+" products ",1)]}),_:1}),w(Ve,null,{default:N(()=>[V(F(t.value?"Hide":"Show")+" ",1),(g(),T("svg",{"data-open":t.value||void 0,fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},o[1]||(o[1]=[j("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)]),8,z5))]),_:1})])):de("",!0)]),j("div",{ref_key:"productListRef",ref:n,class:"moonbase:bundle-redemption-item-product-list",style:{height:"0px"},"data-open":t.value||void 0},[(g(!0),T(De,null,yt(((s=r.bundle)==null?void 0:s.products)||[],i=>(g(),T("div",{key:i.id},[w(Jt,{url:i.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(i.name),1)]),_:2},1024),i.tagline?(g(),Q(Ve,{key:0},{default:N(()=>[V(F(i.tagline),1)]),_:2},1024)):de("",!0)])]))),128))],8,Z5)]}),default:N(()=>[w(Jt,{url:r.bundle.iconUrl,size:72},null,8,["url"]),j("div",q5,[w(Ct,null,{default:N(()=>{var s;return[V(F((s=r.bundle)==null?void 0:s.name),1)]}),_:1}),w(Ve,{class:"moonbase:bundle-redemption-item-tagline"},{default:N(()=>{var s;return[V(F((s=r.bundle)==null?void 0:s.tagline),1)]}),_:1})])]),_:1}))}}),Y5={class:"moonbase:product-redemption-item-content"},Zp=he({__name:"ProductRedemptionItem",props:{product:{},quantity:{}},setup(e){return(t,n)=>(g(),Q(En,{class:"moonbase:product-redemption-item"},{default:N(()=>[w(Jt,{url:t.product.iconUrl,size:72},null,8,["url"]),j("div",Y5,[w(Ct,null,{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.name),1)]}),_:1}),w(Ve,{class:"moonbase:product-redemption-item-tagline"},{default:N(()=>{var r;return[V(F((r=t.product)==null?void 0:r.tagline),1)]}),_:1})])]),_:1}))}}),G5={class:"moonbase:redeem"},K5=["data-visible"],X5={key:1,class:"moonbase:redeem-voucher"},J5={key:0,class:"moonbase:redeem-voucher-content"},Q5={key:1,class:"moonbase:redeem-voucher-return"},ex=he({__name:"Redeem",setup(e){const{redeem:t}=ih(),n=Te(),r=Qe(),o=ve(Vr),s=R(null),i=R(null),a=R(n.getParameter("code")||"");async function l(){i.value=null;try{const u=await t(a.value);s.value=u,o==null||o(qt.RedeemedVoucher,{voucher:u,user:r.user.value})}catch(u){throw i.value=u,u}}return(u,c)=>(g(),T("div",G5,[w(Ys,{mode:"out-in",name:"moonbase:slide-left"},{default:N(()=>[s.value?(g(),T("div",X5,[j("div",null,[w(Jo,null,{default:N(()=>[V(F(s.value.name),1)]),_:1}),s.value.description?(g(),Q(et,{key:0},{default:N(()=>[V(' "'+F(s.value.description)+'" ',1)]),_:1})):de("",!0),w(Ve,null,{default:N(()=>[w(b(z1)),c[2]||(c[2]=V(" Licenses have been added to your account. "))]),_:1}),w(Ve,null,{default:N(()=>[c[3]||(c[3]=V(" Code: ")),j("strong",null,F(s.value.code),1)]),_:1})]),w(et,null,{default:N(()=>c[4]||(c[4]=[V(" Voucher summary ")])),_:1}),s.value.redeemsProducts.length>0||s.value.redeemsBundles.length>0?(g(),T("div",J5,[(g(!0),T(De,null,yt(s.value.redeemsProducts,({value:d,quantity:f})=>(g(),Q(Zp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),T(De,null,yt(s.value.redeemsBundles,({value:d,quantity:f})=>(g(),Q(zp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):de("",!0),b(n).next&&b(n).next[0]===b(ae).Activation&&(s.value.redeemsProducts.some(d=>{var f,h;return d.value.id===((h=(f=b(n).next)==null?void 0:f[2])==null?void 0:h.product_id)})||s.value.redeemsBundles.some(d=>d.value.products.some(f=>{var h,p;return f.id===((p=(h=b(n).next)==null?void 0:h[2])==null?void 0:p.product_id)})))?(g(),T("div",Q5,[w(st,{label:"Return to activation",variant:"primary",icon:b(W1),handler:()=>b(n).dequeue()},null,8,["icon","handler"])])):de("",!0)])):(g(),Q(or,{key:0,handler:l},{default:N(()=>{var d;return[w(tt,null,{default:N(()=>c[1]||(c[1]=[V(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),V(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=f=>a.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(sr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!i.value||void 0},F((d=i.value)==null?void 0:d.message),9,K5)]}),_:1}))]),_:1})]))}}),Yp=6048e5,tx=864e5,ja=43200,Gp=1440,Kp=Symbol.for("constructDateFrom");function ir(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kp in e?e[Kp](t):e instanceof Date?new e.constructor(t):new Date(t)}function vt(e,t){return ir(t||e,e)}let nx={};function ci(){return nx}function di(e,t){var a,l,u,c;const n=ci(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,o=vt(e,t==null?void 0:t.in),s=o.getDay(),i=(s<r?7:0)+s-r;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Fa(e,t){return di(e,{...t,weekStartsOn:1})}function Xp(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=ir(n,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const s=Fa(o),i=ir(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const a=Fa(i);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function Ua(e){const t=vt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ba(e,...t){const n=ir.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Jp(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function rx(e,t,n){const[r,o]=Ba(n==null?void 0:n.in,e,t),s=Jp(r),i=Jp(o),a=+s-Ua(s),l=+i-Ua(i);return Math.round((a-l)/tx)}function ox(e,t){const n=Xp(e,t),r=ir(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Fa(r)}function Ha(e,t){const n=+vt(e)-+vt(t);return n<0?-1:n>0?1:n}function sx(e){return ir(e,Date.now())}function ix(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ax(e){return!(!ix(e)&&typeof e!="number"||isNaN(+vt(e)))}function lx(e,t,n){const[r,o]=Ba(n==null?void 0:n.in,e,t),s=r.getFullYear()-o.getFullYear(),i=r.getMonth()-o.getMonth();return s*12+i}function ux(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function cx(e,t){return+vt(e)-+vt(t)}function dx(e,t){const n=vt(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function fx(e,t){const n=vt(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function hx(e,t){const n=vt(e,t==null?void 0:t.in);return+dx(n,t)==+fx(n,t)}function px(e,t,n){const[r,o,s]=Ba(n==null?void 0:n.in,e,e,t),i=Ha(o,s),a=Math.abs(lx(o,s));if(a<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-i*a);let l=Ha(o,s)===-i;hx(r)&&a===1&&Ha(r,s)===1&&(l=!1);const u=i*(a-+l);return u===0?0:u}function mx(e,t,n){const r=cx(e,t)/1e3;return ux(n==null?void 0:n.roundingMethod)(r)}function bx(e,t){const n=vt(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const gx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vx=(e,t,n)=>{let r;const o=gx[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function tc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const yx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_x={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},wx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ex={date:tc({formats:yx,defaultWidth:"full"}),time:tc({formats:_x,defaultWidth:"full"}),dateTime:tc({formats:wx,defaultWidth:"full"})},xx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kx=(e,t,n,r)=>xx[e];function fi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}const Ox={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Nx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Cx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Tx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Px={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},$x={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:fi({values:Ox,defaultWidth:"wide"}),quarter:fi({values:Sx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:fi({values:Nx,defaultWidth:"wide"}),day:fi({values:Cx,defaultWidth:"wide"}),dayPeriod:fi({values:Tx,defaultWidth:"wide",formattingValues:Px,defaultFormattingWidth:"wide"})};function hi(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;const i=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?Dx(a,d=>d.test(i)):Ax(a,d=>d.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(i.length);return{value:u,rest:c}}}function Ax(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Dx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ix(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(o.length);return{value:i,rest:a}}}const Mx=/^(\d+)(th|st|nd|rd)?/i,Vx=/\d+/i,Rx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lx={any:[/^b/i,/^(a|c)/i]},jx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Fx={any:[/1/i,/2/i,/3/i,/4/i]},Ux={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Bx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Zx={ordinalNumber:Ix({matchPattern:Mx,parsePattern:Vx,valueCallback:e=>parseInt(e,10)}),era:hi({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),quarter:hi({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hi({matchPatterns:Ux,defaultMatchWidth:"wide",parsePatterns:Bx,defaultParseWidth:"any"}),day:hi({matchPatterns:Hx,defaultMatchWidth:"wide",parsePatterns:qx,defaultParseWidth:"any"}),dayPeriod:hi({matchPatterns:Wx,defaultMatchWidth:"any",parsePatterns:zx,defaultParseWidth:"any"})},Qp={code:"en-US",formatDistance:vx,formatLong:Ex,formatRelative:kx,localize:$x,match:Zx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yx(e,t){const n=vt(e,t==null?void 0:t.in);return rx(n,bx(n))+1}function Gx(e,t){const n=vt(e,t==null?void 0:t.in),r=+Fa(n)-+ox(n);return Math.round(r/Yp)+1}function em(e,t){var c,d,f,h;const n=vt(e,t==null?void 0:t.in),r=n.getFullYear(),o=ci(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((h=(f=o.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=ir((t==null?void 0:t.in)||e,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const a=di(i,t),l=ir((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=di(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function Kx(e,t){var a,l,u,c;const n=ci(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,o=em(e,t),s=ir((t==null?void 0:t.in)||e,0);return s.setFullYear(o,0,r),s.setHours(0,0,0,0),di(s,t)}function Xx(e,t){const n=vt(e,t==null?void 0:t.in),r=+di(n,t)-+Kx(n,t);return Math.round(r/Yp)+1}function ze(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ir={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ze(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ze(n+1,2)},d(e,t){return ze(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ze(e.getHours()%12||12,t.length)},H(e,t){return ze(e.getHours(),t.length)},m(e,t){return ze(e.getMinutes(),t.length)},s(e,t){return ze(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return ze(o,t.length)}},es={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Ir.y(e,t)},Y:function(e,t,n,r){const o=em(e,r),s=o>0?o:1-o;if(t==="YY"){const i=s%100;return ze(i,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):ze(s,t.length)},R:function(e,t){const n=Xp(e);return ze(n,t.length)},u:function(e,t){const n=e.getFullYear();return ze(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ze(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ze(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ir.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ze(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=Xx(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):ze(o,t.length)},I:function(e,t,n){const r=Gx(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ze(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ir.d(e,t)},D:function(e,t,n){const r=Yx(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ze(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ze(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),s=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ze(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return ze(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=es.noon:r===0?o=es.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=es.evening:r>=12?o=es.afternoon:r>=4?o=es.morning:o=es.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ir.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ir.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ze(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ze(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ir.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ir.s(e,t)},S:function(e,t){return Ir.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return rm(r);case"XXXX":case"XX":return mo(r);case"XXXXX":case"XXX":default:return mo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rm(r);case"xxxx":case"xx":return mo(r);case"xxxxx":case"xxx":default:return mo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nm(r,":");case"OOOO":default:return"GMT"+mo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nm(r,":");case"zzzz":default:return"GMT"+mo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ze(r,t.length)},T:function(e,t,n){return ze(+e,t.length)}};function nm(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),s=r%60;return s===0?n+String(o):n+String(o)+t+ze(s,2)}function rm(e,t){return e%60===0?(e>0?"-":"+")+ze(Math.abs(e)/60,2):mo(e,t)}function mo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=ze(Math.trunc(r/60),2),s=ze(r%60,2);return n+o+t+s}const om=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sm=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Jx={p:sm,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return om(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",om(r,t)).replace("{{time}}",sm(o,t))}},Qx=/^D+$/,ek=/^Y+$/,tk=["D","DD","YY","YYYY"];function nk(e){return Qx.test(e)}function rk(e){return ek.test(e)}function ok(e,t,n){const r=sk(e,t,n);if(console.warn(r),tk.includes(e))throw new RangeError(r)}function sk(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ik=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ak=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lk=/^'([^]*?)'?$/,uk=/''/g,ck=/[a-zA-Z]/;function dk(e,t,n){var c,d,f,h;const r=ci(),o=r.locale??Qp,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,a=vt(e,n==null?void 0:n.in);if(!ax(a))throw new RangeError("Invalid time value");let l=t.match(ak).map(p=>{const _=p[0];if(_==="p"||_==="P"){const E=Jx[_];return E(p,o.formatLong)}return p}).join("").match(ik).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const _=p[0];if(_==="'")return{isToken:!1,value:fk(p)};if(tm[_])return{isToken:!0,value:p};if(_.match(ck))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:p}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:i,locale:o};return l.map(p=>{if(!p.isToken)return p.value;const _=p.value;(rk(_)||nk(_))&&ok(_,t,String(e));const E=tm[_[0]];return E(a,_,o.localize,u)}).join("")}function fk(e){const t=e.match(lk);return t?t[1].replace(uk,"'"):e}function hk(e,t,n){const r=ci(),o=(n==null?void 0:n.locale)??r.locale??Qp,s=2520,i=Ha(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:i}),[l,u]=Ba(n==null?void 0:n.in,...i>0?[t,e]:[e,t]),c=mx(u,l),d=(Ua(u)-Ua(l))/1e3,f=Math.round((c-d)/60);let h;if(f<2)return n!=null&&n.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,a):c<10?o.formatDistance("lessThanXSeconds",10,a):c<20?o.formatDistance("lessThanXSeconds",20,a):c<40?o.formatDistance("halfAMinute",0,a):c<60?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",1,a):f===0?o.formatDistance("lessThanXMinutes",1,a):o.formatDistance("xMinutes",f,a);if(f<45)return o.formatDistance("xMinutes",f,a);if(f<90)return o.formatDistance("aboutXHours",1,a);if(f<Gp){const p=Math.round(f/60);return o.formatDistance("aboutXHours",p,a)}else{if(f<s)return o.formatDistance("xDays",1,a);if(f<ja){const p=Math.round(f/Gp);return o.formatDistance("xDays",p,a)}else if(f<ja*2)return h=Math.round(f/ja),o.formatDistance("aboutXMonths",h,a)}if(h=px(u,l),h<12){const p=Math.round(f/ja);return o.formatDistance("xMonths",p,a)}else{const p=h%12,_=Math.trunc(h/12);return p<3?o.formatDistance("aboutXYears",_,a):p<9?o.formatDistance("overXYears",_,a):o.formatDistance("almostXYears",_+1,a)}}function pk(e,t){return hk(e,sx(e),t)}function mk(e){return pk(e,{addSuffix:!0})}function pi(e,t){return dk(e,t||"PPP")}const bk={class:"moonbase:subscriptions"},gk={key:0},vk={colspan:"2"},yk={key:1},_k=["data-subscription-status"],wk={key:0},Ek={key:1},xk=he({__name:"Subscriptions",setup(e){const t=Te(),{getSubscriptions:n}=so(),r=R(new Date),o=R(null);return Ue(async()=>{let s=await n();for(o.value=s.items;s.hasMore&&s.next;)s=await n(s.next),o.value.push(...s.items)}),(s,i)=>(g(),T("table",bk,[j("tbody",null,[o.value?o.value.length===0?(g(),T("tr",yk,i[2]||(i[2]=[j("td",{colspan:"2"}," No subscriptions found ",-1)]))):de("",!0):(g(),T("tr",gk,[j("td",vk,[w(Xt),i[0]||(i[0]=V(" Loading subscriptions.. "))]),i[1]||(i[1]=j("td",null,null,-1))])),(g(!0),T(De,null,yt(o.value||[],a=>(g(),T("tr",{key:a.id,"data-subscription-status":a.status},[j("td",null,[a.content.type==="Product"?(g(),T("div",wk,[w(Jt,{url:a.content.product.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(a.content.quantity)+" x "+F(a.content.product.name),1)]),_:2},1024),w(Ve,null,{default:N(()=>[V(F(a.status===b(mr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+F(b(pi)(a.expiresAt)),1)]),_:2},1024)])])):(g(),T("div",Ek,[w(Jt,{url:a.content.bundle.iconUrl,size:48},null,8,["url"]),j("div",null,[w(Ct,null,{default:N(()=>[V(F(a.content.quantity)+" x "+F(a.content.bundle.name),1)]),_:2},1024),w(Ve,null,{default:N(()=>[V(F(a.status===b(mr).Active?"Renews":a.expiresAt>r.value?"Expires":"Expired")+" "+F(b(pi)(a.expiresAt)),1)]),_:2},1024)])]))]),j("td",null,[w(Bo,{variant:"subtle",ca:"",onClick:l=>b(t).show(b(ae).Subscription,b(te).ManageSubscription,{subscription_id:a.id})},{default:N(()=>[w(b(Xh)),i[3]||(i[3]=j("span",{class:"moonbase:clickable"},null,-1))]),_:2},1032,["onClick"])])],8,_k))),128))])]))}}),kk={class:"moonbase:customer"},Ok=he({__name:"Customer",setup(e){const t=Te(),{user:n}=Qe(),r=ve(Lt),o=se(()=>[{intent:te.ViewProducts,title:"Products",content:H5},{intent:te.ViewSubscriptions,title:"Subscriptions",content:xk,predicate:()=>{var a;return((a=n.value)==null?void 0:a.hasSubscriptions)??!1}},{intent:te.ViewAccount,title:"Account",content:L5},{intent:te.RedeemVoucher,title:"Redeem",content:ex}].filter(a=>a.predicate===void 0||a.predicate())),s=se(()=>o.value.findIndex(a=>a.intent===t.intent));function i(a){t.intent=o.value[a].intent}return(a,l)=>(g(),T("div",kk,[w(b($1),{"selected-index":s.value,onChange:i},{default:N(()=>{var u,c;return[w(b(A1),{"data-corners":(u=b(r))==null?void 0:u.theme.corners,"data-background":(c=b(r))==null?void 0:c.theme.colors.background},{default:N(()=>[(g(!0),T(De,null,yt(o.value,d=>(g(),Q(b(D1),{key:d.intent},{default:N(()=>[V(F(d.title),1)]),_:2},1024))),128))]),_:1},8,["data-corners","data-background"]),w(b(I1),null,{default:N(()=>[(g(!0),T(De,null,yt(o.value,d=>(g(),Q(b(M1),{key:d.intent},{default:N(()=>[(g(),Q(jl(d.content)))]),_:2},1024))),128))]),_:1})]}),_:1},8,["selected-index"])]))}}),Sk={class:"moonbase:product-card-content"},Nk=["data-open"],Ck=he({__name:"ProductCard",props:{product:{}},setup(e){const t=R(!1),n=R(null),r=se(()=>n.value&&n.value.$el&&n.value.$el.scrollHeight>n.value.$el.clientHeight);return(o,s)=>(g(),Q(En,{class:"moonbase:product-card"},{addon:N(()=>[j("div",{class:"moonbase:product-card-description","data-open":t.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:n},{default:N(()=>[V(F(o.product.description),1)]),_:1},512),!t.value&&r.value?(g(),T("button",{key:0,onClick:s[0]||(s[0]=i=>t.value=!0)},[w(Ct,null,{default:N(()=>s[1]||(s[1]=[V(" read more ")])),_:1})])):de("",!0)],8,Nk)]),default:N(()=>[w(Jt,{url:o.product.iconUrl,size:72},null,8,["url"]),j("div",Sk,[w(Jo,null,{default:N(()=>{var i;return[V(F((i=o.product)==null?void 0:i.name),1)]}),_:1}),w(Ve,{class:"moonbase:product-card-tagline"},{default:N(()=>{var i;return[V(F((i=o.product)==null?void 0:i.tagline),1)]}),_:1})])]),_:1}))}});function Tk(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 Pk={class:"moonbase:product-downloads"},$k=["data-open"],Ak={key:1,class:"moonbase:product-downloads-content"},Dk={key:2,class:"moonbase:product-downloads-content"},Ik={key:3,class:"moonbase:product-downloads-content"},Mk={key:4,class:"moonbase:product-downloads-content"},Vk={class:"moonbase:product-downloads-list"},Rk={class:"moonbase:product-downloads-download-actions"},Lk=he({__name:"ProductDownloads",props:{product:{}},setup(e){const t=e,n=Te(),r=Qe(),o=ve(Vr),{downloadProduct:s}=so(),i=R(!1),a=R(null),l=se(()=>a.value&&a.value.$el&&a.value.$el.scrollHeight>a.value.$el.clientHeight);function u(){n.enqueue(ae.Product,te.DownloadProduct,n.parameters??void 0),n.show(ae.Authentication,te.SignIn)}const c=[Sn.Windows,Sn.Mac,Sn.Linux,Sn.Universal];function d(){var C;const E=(((C=navigator.userAgentData)==null?void 0:C.platform)??navigator.platform??"Unknown").toLowerCase();return/mac/.test(E)?Sn.Mac:/win/.test(E)?Sn.Windows:/linux/.test(E)?Sn.Linux:Sn.Universal}const f=d(),h=[f,...c.filter(E=>E!==f)],p=se(()=>h.flatMap(E=>[...(t.product.downloads??[]).filter(C=>C.platform===E)]));async function _(E){await s(E),o==null||o(qt.DownloadedProduct,{product:t.product,download:E,user:r.user.value})}return(E,C)=>(g(),T("div",Pk,[w(et,null,{default:N(()=>[C[1]||(C[1]=V(" Downloads ")),w(Ve,null,{default:N(()=>[V(" Version "+F(E.product.version),1)]),_:1})]),_:1}),E.product.releaseDescription?(g(),T("div",{key:0,class:"moonbase:product-downloads-description","data-open":i.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:a},{default:N(()=>[V(F(E.product.releaseDescription),1)]),_:1},512),!i.value&&l.value?(g(),T("button",{key:0,onClick:C[0]||(C[0]=z=>i.value=!0)},[w(Ct,null,{default:N(()=>C[2]||(C[2]=[V(" read more ")])),_:1})])):de("",!0)],8,$k)):de("",!0),E.product.downloadsNeedsUser&&E.product.downloadsNeedsOwnership&&!E.product.numberOfLicenses&&!E.product.subscriptionLicenses?(g(),T("div",Ak,[w(tt,{"data-center":""},{default:N(()=>C[3]||(C[3]=[V(" This product requires ownership to download ")])),_:1}),w(st,{label:"Sign in",handler:()=>u},null,8,["handler"])])):E.product.downloadsNeedsUser&&!b(r).user?(g(),T("div",Dk,[w(tt,{"data-center":""},{default:N(()=>C[4]||(C[4]=[V(" This product requires an account to download ")])),_:1}),w(st,{label:"Sign in",handler:()=>u},null,8,["handler"])])):E.product.downloadsNeedsOwnership&&!E.product.numberOfLicenses&&!E.product.subscriptionLicenses?(g(),T("div",Ik,[w(tt,{"data-center":""},{default:N(()=>C[5]||(C[5]=[V(" This product requires ownership to download ")])),_:1})])):(g(),T("div",Mk,[j("div",Vk,[(g(!0),T(De,null,yt(p.value,z=>(g(),Q(En,{key:z.key,class:"moonbase:product-downloads-download"},{addon:N(()=>[j("div",Rk,[w(st,{label:`Download for ${z.platform}`,variant:z.platform===b(f)?"primary":"secondary","no-reset":!0,handler:()=>_(z),icon:b(B1)},null,8,["label","variant","handler","icon"])])]),default:N(()=>[j("div",null,[w(et,null,{default:N(()=>[V(F(z.platform),1)]),_:2},1024),w(Dr,null,{default:N(()=>[V(F(z.name)+" - "+F(b(Tk)(z.size)),1)]),_:2},1024)])]),_:2},1024))),128))]),p.value.length===0?(g(),Q(tt,{key:0,"data-center":""},{default:N(()=>C[6]||(C[6]=[V(" No downloadable files found ")])),_:1})):de("",!0)]))]))}}),jk={class:"moonbase:product-licenses"},Fk={key:0,class:"moonbase:loader"},Uk={key:1,class:"moonbase:empty"},Bk={key:0,class:"moonbase:loader"},Hk={key:1,class:"moonbase:product-licenses-activations"},qk={key:0},Wk={class:"moonbase:product-licenses-activation-actions"},zk={key:2,class:"moonbase:loader"},Zk={key:3,class:"moonbase:product-licenses-licenses"},Yk=he({__name:"ProductLicenses",props:{product:{}},emits:["revoked"],setup(e,{emit:t}){const n=e,r=t,{getProductActivations:o,getProductLicenses:s,revokeActivation:i}=so(),a=R(null),l=R(null),u=R(!0);Ue(async()=>{if(n.product.maxActivations){let d=await o(n.product.id);for(a.value=d.items.map(f=>({...f,revoking:!1}));d.hasMore&&d.next;)d=await o(n.product.id,d.next),a.value.push(...d.items.map(f=>({...f,revoking:!1})))}if(n.product.externalLicenses){let d=await s(n.product.id);for(l.value=d.items;d.hasMore&&d.next;)d=await s(n.product.id,d.next),l.value.push(...d.items)}u.value=!1});async function c(d){await i(d),r("revoked",d),a.value&&Ht(1e3).then(()=>{var f,h;return(h=a.value)==null?void 0:h.splice((f=a.value)==null?void 0:f.indexOf(d),1)})}return(d,f)=>(g(),T("div",jk,[w(et,null,{default:N(()=>[f[0]||(f[0]=V(" Licenses ")),d.product.maxActivations&&d.product.maxActivations>0?(g(),Q(Ve,{key:0},{default:N(()=>[V(F(d.product.currentActivations??0)+" of "+F(d.product.maxActivations)+" seats used ",1)]),_:1})):de("",!0)]),_:1}),u.value?(g(),T("div",Fk,[w(Xt)])):!d.product.numberOfLicenses&&!d.product.subscriptionLicenses?(g(),T("div",Uk,[w(tt,null,{default:N(()=>f[1]||(f[1]=[V(" You don't own any licenses for this product yet ")])),_:1}),d.product&&d.product.website?(g(),Q(Qu,{key:0,type:"anchor",href:d.product.website,label:"Purchase",icon:b(q1)},null,8,["href","icon"])):de("",!0)])):de("",!0),u.value?de("",!0):(g(),T(De,{key:2},[d.product.maxActivations&&d.product.maxActivations>0&&!d.product.currentActivations?(g(),T("div",Bk,[w(b(Jh)),w(et,null,{default:N(()=>f[2]||(f[2]=[V(" No activations yet ")])),_:1})])):de("",!0),d.product.maxActivations&&a.value?(g(),T("div",Hk,[(g(!0),T(De,null,yt(a.value??[],h=>(g(),Q(En,{key:h.id,class:"moonbase:product-licenses-activation"},Zd({default:N(()=>[j("div",null,[w(Dr,null,{default:N(()=>f[3]||(f[3]=[V(" Device ")])),_:1}),w(et,null,{default:N(()=>[V(F(h.name),1)]),_:2},1024)]),j("div",null,[w(Dr,null,{default:N(()=>f[4]||(f[4]=[V(" Activation ")])),_:1}),w(et,null,{default:N(()=>[V(F(h.activationMethod),1)]),_:2},1024)]),h.lastValidatedAt?(g(),T("div",qk,[w(Dr,null,{default:N(()=>f[5]||(f[5]=[V(" First activated ")])),_:1}),w(et,null,{default:N(()=>[V(F(b(mk)(h.firstValidatedAt)),1)]),_:2},1024)])):de("",!0)]),_:2},[h.activationMethod===b(Ai).Online?{name:"addon",fn:N(()=>[j("div",Wk,[w(st,{label:"Revoke",variant:"secondary","no-reset":!0,handler:()=>c(h)},null,8,["handler"])])]),key:"0"}:void 0]),1024))),128))])):de("",!0),(!l.value||l.value.length===0)&&!d.product.maxActivations&&(d.product.numberOfLicenses||d.product.subscriptionLicenses)?(g(),T("div",zk,[w(b(Jh)),d.product.numberOfLicenses?(g(),Q(et,{key:0},{default:N(()=>[V(" You own "+F(d.product.numberOfLicenses)+" license"+F(d.product.numberOfLicenses!==1?"s":"")+" for this product ",1)]),_:1})):de("",!0),d.product.subscriptionLicenses?(g(),Q(et,{key:1},{default:N(()=>[V(" You have "+F(d.product.subscriptionLicenses)+" subscription license"+F(d.product.subscriptionLicenses!==1?"s":"")+" for this product ",1)]),_:1})):de("",!0)])):d.product.externalLicenses&&l.value?(g(),T("div",Zk,[(g(!0),T(De,null,yt((l.value??[]).filter(h=>h.externalFulfillment),h=>(g(),Q(En,{key:h.id,class:"moonbase:product-licenses-license"},Zd({default:N(()=>[j("div",null,[w(Dr,null,{default:N(()=>[V(F(d.product.name)+" license ",1)]),_:1}),w(et,null,{default:N(()=>[V(F(h.id),1)]),_:2},1024)])]),_:2},[h.externalFulfillment?{name:"addon",fn:N(()=>[j("code",null,F(h.externalFulfillment),1)]),key:"0"}:void 0]),1024))),128))])):de("",!0)],64))]))}}),Gk={class:"moonbase:download-product"},Kk={key:0,class:"moonbase:loader"},Xk={key:1,class:"moonbase:loader"},Jk={key:2,class:"moonbase:loader"},Qk={key:3},e3=he({__name:"Product",setup(e){const t=Te(),n=Qe(),{loaded:r}=Qe(),{getProduct:o}=so(),s=R(null),i=R(null),a=R(!0);return Ue(async()=>{const l=t.getParameter("product_id"),u=t.getParameter("version");if(!l){i.value="Link is broken";return}try{s.value=await o(l,u||void 0)}catch(c){i.value=c.message}a.value=!1}),(l,u)=>(g(),T("div",Gk,[a.value||!b(r)?(g(),T("div",Kk,[w(Xt)])):i.value?(g(),T("div",Xk,F(i.value),1)):s.value?(g(),T("div",Qk,[w(Ck,{product:s.value},null,8,["product"]),s.value.downloads?(g(),Q(Lk,{key:0,product:s.value},null,8,["product"])):de("",!0),b(n).user.value?(g(),Q(Yk,{key:1,product:s.value,onRevoked:u[0]||(u[0]=c=>s.value.currentActivations=(s.value.currentActivations??1)-1)},null,8,["product"])):de("",!0)])):(g(),T("div",Jk," Could not find product "))]))}}),t3={class:"moonbase:peek"},n3=["data-visible"],r3={key:1,class:"moonbase:peek-voucher"},o3={key:0,class:"moonbase:peek-voucher-content"},s3={class:"moonbase:peek-voucher-auth"},i3=he({__name:"Redeem",setup(e){const{peek:t}=ih(),n=Te(),r=R(null),o=R(null),s=R(n.getParameter("code")||"");async function i(){o.value=null;try{r.value=await t(s.value),n.parameters={code:r.value.code}}catch(u){throw o.value=u,u}}function a(){n.enqueue(ae.Customer,te.RedeemVoucher,{code:s.value}),n.show(ae.Authentication,te.SignIn)}function l(){n.enqueue(ae.Customer,te.RedeemVoucher,{code:s.value}),n.show(ae.Authentication,te.SignUp)}return(u,c)=>(g(),T("div",t3,[w(Ys,{mode:"out-in",name:"moonbase:slide-left"},{default:N(()=>[r.value?(g(),T("div",r3,[j("div",null,[w(Jo,null,{default:N(()=>[V(F(r.value.name),1)]),_:1}),r.value.description?(g(),Q(et,{key:0},{default:N(()=>[V(' "'+F(r.value.description)+'" ',1)]),_:1})):de("",!0),w(Ve,null,{default:N(()=>[c[2]||(c[2]=V(" Code: ")),j("strong",null,F(r.value.code),1)]),_:1})]),w(et,null,{default:N(()=>c[3]||(c[3]=[V(" Voucher summary ")])),_:1}),r.value.redeemsProducts.length>0||r.value.redeemsBundles.length>0?(g(),T("div",o3,[(g(!0),T(De,null,yt(r.value.redeemsProducts,({value:d,quantity:f})=>(g(),Q(Zp,{key:d.id,product:d,quantity:f},null,8,["product","quantity"]))),128)),(g(!0),T(De,null,yt(r.value.redeemsBundles,({value:d,quantity:f})=>(g(),Q(zp,{key:d.id,bundle:d,quantity:f},null,8,["bundle","quantity"]))),128))])):de("",!0),j("div",s3,[w(tt,null,{default:N(()=>c[4]||(c[4]=[V(" Sign in or create an account to redeem products ")])),_:1}),w(st,{label:"Sign in",variant:"primary",handler:a}),w(st,{label:"Create account",variant:"subtle",handler:l})])])):(g(),Q(or,{key:0,handler:i},{default:N(()=>{var d;return[w(tt,null,{default:N(()=>c[1]||(c[1]=[V(" Do you have a voucher you want to redeem? "),j("br",null,null,-1),V(" Please enter the code below: ")])),_:1}),w(Nt,{modelValue:s.value,"onUpdate:modelValue":c[0]||(c[0]=f=>s.value=f),label:"Voucher code",name:"code",required:"",placeholder:"0000-0000-0000-0000"},null,8,["modelValue"]),w(sr,{label:"Redeem voucher",error:"Error"}),j("span",{class:"moonbase:error","data-visible":!!o.value||void 0},F((d=o.value)==null?void 0:d.message),9,n3)]}),_:1}))]),_:1})]))}}),a3={class:"moonbase:subscription-content-card-content"},l3=["data-open"],u3={class:"moonbase:subscription-content-card-content"},c3=["data-open"],d3=he({__name:"ContentCard",props:{subscription:{}},setup(e){const t=R(new Date),n=R(!1),r=R(null),o=se(()=>r.value&&r.value.$el&&r.value.$el.scrollHeight>r.value.$el.clientHeight);return(s,i)=>s.subscription.content.type==="Product"?(g(),Q(En,{key:0,class:"moonbase:subscription-content-card"},{addon:N(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:r},{default:N(()=>[V(F(s.subscription.content.product.description),1)]),_:1},512),!n.value&&o.value?(g(),T("button",{key:0,onClick:i[0]||(i[0]=a=>n.value=!0)},[w(Ct,null,{default:N(()=>i[2]||(i[2]=[V(" read more ")])),_:1})])):de("",!0)],8,l3)]),default:N(()=>[w(Jt,{url:s.subscription.content.product.iconUrl,size:72},null,8,["url"]),j("div",a3,[w(Jo,null,{default:N(()=>{var a;return[V(F((a=s.subscription.content.product)==null?void 0:a.name),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-tagline"},{default:N(()=>{var a;return[V(F((a=s.subscription.content.product)==null?void 0:a.tagline),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-expiry"},{default:N(()=>[V(F(s.subscription.status===b(mr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,F(b(pi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1})):(g(),Q(En,{key:1,class:"moonbase:subscription-content-card"},{addon:N(()=>[j("div",{class:"moonbase:subscription-content-card-description","data-open":n.value||void 0},[w(Ve,{ref_key:"descriptionRef",ref:r},{default:N(()=>[V(F(s.subscription.content.bundle.description),1)]),_:1},512),!n.value&&o.value?(g(),T("button",{key:0,onClick:i[1]||(i[1]=a=>n.value=!0)},[w(Ct,null,{default:N(()=>i[3]||(i[3]=[V(" read more ")])),_:1})])):de("",!0)],8,c3)]),default:N(()=>[w(Jt,{url:s.subscription.content.bundle.iconUrl,size:72},null,8,["url"]),j("div",u3,[w(Jo,null,{default:N(()=>{var a;return[V(F((a=s.subscription.content.bundle)==null?void 0:a.name),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-tagline"},{default:N(()=>{var a;return[V(F((a=s.subscription.content.bundle)==null?void 0:a.tagline),1)]}),_:1}),w(Ve,{class:"moonbase:subscription-content-card-expiry"},{default:N(()=>[V(F(s.subscription.status===b(mr).Active?"Renews":s.subscription.expiresAt>t.value?"Expires":"Expired")+" ",1),j("strong",null,F(b(pi)(s.subscription.expiresAt)),1)]),_:1})])]),_:1}))}}),f3={class:"moonbase:subscription"},h3={key:0,class:"moonbase:loader"},p3={key:1,class:"moonbase:loader"},m3={key:2,class:"moonbase:loader"},b3={key:3},g3={class:"moonbase:subscription-actions"},v3=he({__name:"Subscription",setup(e){const t=Te(),{loaded:n}=Qe(),{getSubscription:r,renewSubscription:o,cancelSubscription:s}=so(),i=R(null),a=R(new Date),l=R(null),u=R(!0);Ue(async()=>{const f=t.getParameter("subscription_id");if(!f){l.value="Link is broken";return}try{i.value=await r(f)}catch(h){l.value=h.message}u.value=!1});async function c(){if(!i.value)return;if((await o(i.value.id,{redirect:!1})).completed){const h=await r(i.value.id);Ht(1500).then(()=>i.value=h)}else throw new Ju}async function d(){i.value&&(i.value=await s(i.value.id))}return(f,h)=>(g(),T("div",f3,[u.value||!b(n)?(g(),T("div",h3,[w(Xt)])):l.value?(g(),T("div",p3,F(l.value),1)):i.value?(g(),T("div",b3,[w(d3,{subscription:i.value},null,8,["subscription"]),j("div",g3,[i.value.status===b(mr).Active?(g(),Q(st,{key:0,label:"Cancel subscription",variant:"danger",handler:d})):(g(),Q(st,{key:1,label:"Continue subscription",variant:"primary",handler:c})),i.value.status===b(mr).Active?(g(),Q(Dr,{key:2},{default:N(()=>[h[0]||(h[0]=V(" Cancelling a subscription will let you use the products to the end of the current period, after which you will lose access. If you want to continue using the products later, you may simply renew this subscription whenever you wish. You are currently paying ")),j("strong",null,F(b(yn)(i.value.total.due)),1),V(" per "+F(b(ec)(i.value.cycleLength))+" for this subscription. ",1)]),_:1})):(g(),Q(Dr,{key:3},{default:N(()=>[V(" This subscription has been stopped, and "+F(i.value.expiresAt>a.value?"expires":"expired")+" "+F(b(pi)(i.value.expiresAt))+". If you want to continue using the products after this date, you may continue the subscription to regain access. ",1)]),_:1}))])])):(g(),T("div",m3," Could not find subscription "))]))}}),y3=he({__name:"App",setup(e){const t=ve(Lt),n=Te();Je(()=>[n.active,n.intent],([o,s])=>{});const r={Inter:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap",Roboto:"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap","EB Garamond":"https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400..800;1,400..800&display=swap",Merriweather:"https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap",Poppins:"https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap","PT Serif":"https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap",Montserrat:"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap",Aleo:"https://fonts.googleapis.com/css2?family=Aleo:ital,wght@0,100..900;1,100..900&display=swap"};if(t){const o=document.createElement("link");o.rel="stylesheet",o.href=r[t.value.theme.fonts.body],document.head.appendChild(o),document.documentElement.style.setProperty("--moonbase-font-body",t.value.theme.fonts.body??"");const s=document.createElement("link");s.rel="stylesheet",s.href=r[t.value.theme.fonts.heading],document.head.appendChild(s),document.documentElement.style.setProperty("--moonbase-font-heading",t.value.theme.fonts.heading??"");let i=t.value.theme.colors.primary;typeof i=="string"&&(i=Object.fromEntries(E2(i).map(a=>[a.number<=100||a.number===950?a.number-50:a.number-100,a.hexcode]))),document.documentElement.style.setProperty("--moonbase-brand-50",i[50]??""),document.documentElement.style.setProperty("--moonbase-brand-100",i[100]??""),document.documentElement.style.setProperty("--moonbase-brand-200",i[200]??""),document.documentElement.style.setProperty("--moonbase-brand-300",i[300]??""),document.documentElement.style.setProperty("--moonbase-brand-400",i[400]??""),document.documentElement.style.setProperty("--moonbase-brand-500",i[500]??""),document.documentElement.style.setProperty("--moonbase-brand-600",i[600]??""),document.documentElement.style.setProperty("--moonbase-brand-700",i[700]??""),document.documentElement.style.setProperty("--moonbase-brand-800",i[800]??""),document.documentElement.style.setProperty("--moonbase-brand-900",i[900]??"")}return Je(()=>t==null?void 0:t.value.theme.dark,o=>{o?document.documentElement.classList.add("moonbase:dark"):document.documentElement.classList.remove("moonbase:dark")},{immediate:!0}),k_(),(o,s)=>{var i;return g(),T(De,null,[(i=b(t))!=null&&i.toolbar.enabled?(g(),Q(x_,{key:0})):de("",!0),w(m_,null,{default:N(()=>[b(n).active===b(ae).Cart?(g(),Q(D5,{key:0})):b(n).active===b(ae).Authentication?(g(),Q(c5,{key:1})):b(n).active===b(ae).Activation?(g(),Q(EE,{key:2})):b(n).active===b(ae).Product?(g(),Q(e3,{key:3})):b(n).active===b(ae).Subscription?(g(),Q(v3,{key:4})):b(n).active===b(ae).Customer?(g(),Q(Ok,{key:5})):b(n).active===b(ae).Redeem?(g(),Q(i3,{key:6})):b(n).active===b(ae).About?(g(),Q(I2,{key:7})):de("",!0)]),_:1})],64)}}});function qa(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof HTMLElement)}function Wa(e,...t){if(t.length===0)return e;const n=t.shift();if(!n)return e;if(qa(e)&&qa(n)){for(const r in e)if(Object.prototype.hasOwnProperty.call(n,r)){const o=n[r];qa(o)&&qa(e[r])?e[r]=Wa(e[r],o):o!==void 0&&(e[r]=o)}}return Wa(e,...t)}function _3(e){const t=n=>Array.isArray(n)?n.map(r=>t(r)):Ye(n)||hn(n)||Co(n)?t(ke(n)):n&&typeof n=="object"?Object.keys(n).reduce((r,o)=>(r[o]=t(n[o]),r),{}):n;return t(e)}const nc=Symbol("url"),Mr=(e,t)=>window.dispatchEvent(new CustomEvent(`moonbase-storefront-${e}`,{detail:_3(t)})),Vr=Symbol("event-emitter");class w3{constructor(){bo(this,"initialized",!1);bo(this,"pinia");bo(this,"storefront");bo(this,"options")}async setup(t,n){var l,u;if(typeof window>"u")throw console.error("Moonbase setup must be done client-side"),new Error("Moonbase setup must be done client-side");if(document.getElementById("moonbase")){console.warn("Moonbase has already been initialized!");return}this.options=R(Wa(((l=this.options)==null?void 0:l.value)??Sh,n??{})),mu("Merged options:",this.options.value);const r=document.createElement("div");r.id="moonbase",r.classList.add("moonbase"),(this.options.value.target??document.body).append(r),this.storefront=py(t),this.pinia=jy(),Yv(y3).use(this.storefront).use(this.pinia).provide(Lt,this.options).provide(nc,t.replace(/\/$/,"")).provide(Vr,Mr).mount("#moonbase"),this.initialized=!0,window&&window.location&&this.handleLocationIntent(window.location);const i=Te(this.pinia),a=Qe(this.storefront);(u=this.storefront)==null||u.onCheckoutInitiated((c,d)=>{Mr(qt.CheckoutInitiated,{order:c,total:d,user:a.user.value})}),this.storefront.onCheckoutClosed(c=>{Mr(qt.CheckoutClosed,{order:this.storefront.currentOrder.value,user:a.user.value}),c===te.ViewProducts&&(a.user?i.show(ae.Customer,te.ViewProducts):i.show(ae.Cart,te.ViewCart))}),this.storefront.onCheckoutCompleted(c=>{Mr(qt.CheckoutCompleted,{order:c,user:a.user.value})})}configure(t){var r;const n=Wa(((r=this.options)==null?void 0:r.value)??Sh,t??{});this.options?this.options.value=n:this.options=R(n)}on(t,n){window.addEventListener(`moonbase-storefront-${t}`,r=>n(r.detail))}handleLocationIntent(t){const n=new URLSearchParams(t.search),r=n.get("mb_intent");if(r&&Object.values(te).includes(r)){const o=Object.fromEntries([...n.entries()].filter(([i])=>i.startsWith("mb_")).map(([i,a])=>[i.substring(3),a]));if(r===te.Checkout&&o.complete)return;this[r](o);for(const i of Object.keys(o))n.delete(`mb_${i}`);const s=n.toString();window.history.replaceState(null,"",t.href.split("?")[0]+(s?`?${s}`:""))}}sign_in(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.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.value.auth.signUp.enabled))throw new Error("Sign ups are not enabled");Te(this.pinia).show(ae.Authentication,te.SignUp,t)}forgot_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ForgotPassword,t)}reset_password(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ResetPassword,t)}confirm_account(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ConfirmAccount,t)}confirm_email(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Authentication,te.ConfirmEmail,t)}confirm_email_change(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia);Qe(this.storefront).user.value?n.show(ae.Authentication,te.ConfirmEmailChange,t):(n.enqueue(ae.Authentication,te.ConfirmEmailChange,t),n.show(ae.Authentication,te.SignIn))}view_account(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const t=Te(this.pinia);Qe(this.storefront).user.value?t.show(ae.Customer,te.ViewAccount):(t.enqueue(ae.Customer,te.ViewAccount),t.show(ae.Authentication,te.SignIn))}view_products(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Customer,te.ViewProducts)}view_subscriptions(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Customer,te.ViewSubscriptions)}redeem_voucher(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia);Qe(this.storefront).user.value?n.show(ae.Customer,te.RedeemVoucher,t):n.show(ae.Redeem,te.RedeemVoucher,t)}view_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Product,te.ViewProduct,t)}download_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Product,te.DownloadProduct,t)}activate_product(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia),r=Qe(this.storefront);!(t!=null&&t.token)&&!r.user.value?(n.enqueue(ae.Activation,te.ActivateProduct,t),n.show(ae.Authentication,te.SignIn)):n.show(ae.Activation,te.ActivateProduct,t)}manage_subscription(t){if(!this.initialized)throw new Error("Moonbase has not been set up yet");const n=Te(this.pinia);Qe(this.storefront).user.value?n.show(ae.Subscription,te.ManageSubscription,t):(n.enqueue(ae.Subscription,te.ManageSubscription,t),n.show(ae.Authentication,te.SignIn))}view_cart(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.Cart,te.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=Nr(this.storefront),r=Qe(this.storefront);if(t!=null&&t.product_id){const l=Xs(t.product_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(o=l.value.variations)==null?void 0:o.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=Xs(t.product_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(s=u.value.variations)==null?void 0:s.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Product '${t.product_id}' not found`)}}if(t!=null&&t.bundle_id){const l=ba(t.bundle_id,this.storefront);if(l.value){let u=n.addToCart(l.value,(i=l.value.variations)==null?void 0:i.find(c=>c.id===t.variation_id));t!=null&&t.quantity&&(u=n.setQuantity(u,u.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:u,currency:n.currency.value,user:r.user.value})}else{await this.storefront.loadedStorefrontPromise;const u=ba(t.bundle_id,this.storefront);if(u.value){let c=n.addToCart(u.value,(a=u.value.variations)==null?void 0:a.find(d=>d.id===t.variation_id));t!=null&&t.quantity&&(c=n.setQuantity(c,c.quantity+t.quantity-1)),Mr(qt.AddedToCart,{item:c,currency:n.currency.value,user:r.user.value})}else throw new Error(`Bundle '${t.bundle_id}' not found`)}}(t==null?void 0:t.show_cart)!==!1&&Te(this.pinia).show(ae.Cart,te.AddToCart)}async purchase(t){var o,s,i,a,l;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(o=this.storefront)!=null&&o.loadedStorefront||await((s=this.storefront)==null?void 0:s.loadedStorefrontPromise);const n=t?Array.isArray(t)?t:[t]:[];if(n.length===0)throw new Error("No items given to purchase");const r=[];for(const u of n){if(!u.product_id&&!u.bundle_id)throw new Error("You need to provide a product or bundle ID when purchasing");if(u.product_id){const c=Xs(u.product_id,this.storefront);if(c.value)r.push({item:c.value,variation:(i=c.value.variations)==null?void 0:i.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Product '${u.product_id}' not found`)}if(u.bundle_id){const c=ba(u.bundle_id,this.storefront);if(c.value)r.push({item:c.value,variation:(a=c.value.variations)==null?void 0:a.find(d=>d.id===u.variation_id),quantity:u.quantity});else throw new Error(`Bundle '${u.bundle_id}' not found`)}}await fy(r,{redirect:((l=this.options)==null?void 0:l.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`},this.storefront)}checkout(t){var r;if(!this.initialized)throw new Error("Moonbase has not been set up yet");if(t!=null&&t.complete)return;Nr(this.storefront).checkout({redirect:((r=this.options)==null?void 0:r.value.checkout.redirect)||!1,returnUrl:`${window.location.pathname}?mb_intent=view_products`})}close_checkout(){var t;if(!this.initialized)throw new Error("Moonbase has not been set up yet");(t=this.storefront)==null||t.closeCheckout()}view_about(){if(!this.initialized)throw new Error("Moonbase has not been set up yet");Te(this.pinia).show(ae.About,te.ViewAbout)}}const im=new w3;globalThis&&(globalThis.Moonbase?console.warn("Multiple instances of Moonbase detected, only one will be initialized"):globalThis.Moonbase=im),Pt.MoonbaseIntent=te,Pt.default=im,Pt.eventEmitterKey=Vr,Pt.urlKey=nc,Object.defineProperties(Pt,{__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.3.
|
|
4
|
+
"version": "0.3.8",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"date-fns": "^4.1.0",
|
|
25
25
|
"pinia": "^2.1.7",
|
|
26
26
|
"vue": "^3.5.3",
|
|
27
|
-
"@moonbase.sh/vue": "0.3.
|
|
27
|
+
"@moonbase.sh/vue": "0.3.8"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/chroma-js": "^2.4.4",
|