UNPKG

@revenuecat/purchases-js

Version:

Web subscriptions made easy. Powered by RevenueCat

1 lines 518 kB
(function(B,Q){typeof exports=="object"&&typeof module<"u"?Q(exports):typeof define=="function"&&define.amd?define(["exports"],Q):(B=typeof globalThis<"u"?globalThis:B||self,Q(B.Purchases={}))})(this,function(B){"use strict";var Jf=Object.create;var ni=Object.defineProperty;var Qf=Object.getOwnPropertyDescriptor;var Ns=(B,Q)=>(Q=Symbol[B])?Q:Symbol.for("Symbol."+B),la=B=>{throw TypeError(B)};var Cs=(B,Q,ie)=>Q in B?ni(B,Q,{enumerable:!0,configurable:!0,writable:!0,value:ie}):B[Q]=ie;var Fs=(B,Q)=>ni(B,"name",{value:Q,configurable:!0});var Os=B=>[,,,Jf((B==null?void 0:B[Ns("metadata")])??null)],Ls=["class","method","getter","setter","accessor","field","value","get","set"],sa=B=>B!==void 0&&typeof B!="function"?la("Function expected"):B,$f=(B,Q,ie,Me,he)=>({kind:Ls[B],name:Q,metadata:Me,addInitializer:De=>ie._?la("Already initialized"):he.push(sa(De||null))}),ii=(B,Q)=>Cs(Q,Ns("metadata"),B[3]),Bs=(B,Q,ie,Me)=>{for(var he=0,De=B[Q>>1],pr=De&&De.length;he<pr;he++)Q&1?De[he].call(ie):Me=De[he].call(ie,Me);return Me},Rs=(B,Q,ie,Me,he,De)=>{var pr,Ce,ca,Kr,Tt,ge=Q&7,It=!!(Q&8),Ke=!!(Q&16),Dt=ge>3?B.length+1:ge?It?1:2:0,da=Ls[ge+5],ua=ge>3&&(B[Dt-1]=[]),Ae=B[Dt]||(B[Dt]=[]),qe=ge&&(!Ke&&!It&&(he=he.prototype),ge<5&&(ge>3||!Ke)&&Qf(ge<4?he:{get[ie](){return js(this,De)},set[ie](Ne){return Ms(this,De,Ne)}},ie));ge?Ke&&ge<4&&Fs(De,(ge>2?"set ":ge>1?"get ":"")+ie):Fs(he,ie);for(var qt=Me.length-1;qt>=0;qt--)Kr=$f(ge,ie,ca={},B[3],Ae),ge&&(Kr.static=It,Kr.private=Ke,Tt=Kr.access={has:Ke?Ne=>eb(he,Ne):Ne=>ie in Ne},ge^3&&(Tt.get=Ke?Ne=>(ge^1?js:rb)(Ne,he,ge^4?De:qe.get):Ne=>Ne[ie]),ge>2&&(Tt.set=Ke?(Ne,zt)=>Ms(Ne,he,zt,ge^4?De:qe.set):(Ne,zt)=>Ne[ie]=zt)),Ce=(0,Me[qt])(ge?ge<4?Ke?De:qe[da]:ge>4?void 0:{get:qe.get,set:qe.set}:he,Kr),ca._=1,ge^4||Ce===void 0?sa(Ce)&&(ge>4?ua.unshift(Ce):ge?Ke?De=Ce:qe[da]=Ce:he=Ce):typeof Ce!="object"||Ce===null?la("Object expected"):(sa(pr=Ce.get)&&(qe.get=pr),sa(pr=Ce.set)&&(qe.set=pr),sa(pr=Ce.init)&&ua.unshift(pr));return ge||ii(B,he),qe&&ni(he,ie,qe),Ke?ge^4?De:qe:he},C=(B,Q,ie)=>Cs(B,typeof Q!="symbol"?Q+"":Q,ie),oi=(B,Q,ie)=>Q.has(B)||la("Cannot "+ie),eb=(B,Q)=>Object(Q)!==Q?la('Cannot use the "in" operator on this value'):B.has(Q),js=(B,Q,ie)=>(oi(B,Q,"read from private field"),ie?ie.call(B):Q.get(B));var Ms=(B,Q,ie,Me)=>(oi(B,Q,"write to private field"),Me?Me.call(B,ie):Q.set(B,ie),ie),rb=(B,Q,ie)=>(oi(B,Q,"access private method"),ie);var Ts,ei;const Q="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Q);const ie=1,Me=2,he=4,De=8,pr=16,Ce=1,ca=2,Kr=4,Tt=8,ge=16,It=1,Ke=2,Dt=4,da=1,ua=2,Ae=Symbol(),qe="http://www.w3.org/2000/svg";function qt(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Ne=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function zt(e){return Ne.includes(e)}const Us={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject"};function Vs(e){return e=e.toLowerCase(),Us[e]??e}const Hs=["touchstart","touchmove"];function Ws(e){return Hs.includes(e)}const si=!1;var pa=Array.isArray,Ys=Array.prototype.indexOf,Ja=Array.from,Gs=Object.defineProperty,Cr=Object.getOwnPropertyDescriptor,li=Object.getOwnPropertyDescriptors,Xs=Object.prototype,Zs=Array.prototype,Qa=Object.getPrototypeOf;function ct(e){return typeof e=="function"}const ce=()=>{};function Ks(e){return e()}function $a(e){for(var r=0;r<e.length;r++)e[r]()}const sr=2,ci=4,At=8,_a=16,lr=32,Ft=64,ga=128,Jr=256,ma=512,Oe=1024,Or=2048,jt=4096,_r=8192,dt=16384,di=32768,Lr=65536,Js=1<<17,Qs=1<<19,ui=1<<20,Br=Symbol("$state"),pi=Symbol("legacy props"),$s=Symbol("");function _i(e){return e===this.v}function gi(e,r){return e!=e?r==r:e!==r||e!==null&&typeof e=="object"||typeof e=="function"}function en(e){return!gi(e,this.v)}function el(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function rl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function tl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function al(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function nl(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function il(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ol(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function sl(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function ll(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let ut=!1,cl=!1;function dl(){ut=!0}function Ye(e,r){var t={f:0,v:e,reactions:null,equals:_i,rv:0,wv:0};return t}function $(e){return mi(Ye(e))}function fa(e,r=!1){var a;const t=Ye(e);return r||(t.equals=en),ut&&se!==null&&se.l!==null&&((a=se.l).s??(a.s=[])).push(t),t}function cr(e,r=!1){return mi(fa(e,r))}function mi(e){return ue!==null&&(ue.f&sr)!==0&&(mr===null?vl([e]):mr.push(e)),e}function z(e,r){return ue!==null&&pn()&&(ue.f&(sr|_a))!==0&&(mr===null||!mr.includes(e))&&ll(),rn(e,r)}function rn(e,r){return e.equals(r)||(e.v,e.v=r,e.wv=Ni(),fi(e,Or),pn()&&re!==null&&(re.f&Oe)!==0&&(re.f&lr)===0&&(Fe!==null&&Fe.includes(e)?(dr(re,Or),wa(re)):Ur===null?kl([e]):Ur.push(e))),r}function fi(e,r){var t=e.reactions;if(t!==null)for(var a=pn(),n=t.length,i=0;i<n;i++){var o=t[i],l=o.f;(l&Or)===0&&(!a&&o===re||(dr(o,r),(l&(Oe|Jr))!==0&&((l&sr)!==0?fi(o,jt):wa(o))))}}let tn=!1;function Y(e,r=null,t){if(typeof e!="object"||e===null||Br in e)return e;const a=Qa(e);if(a!==Xs&&a!==Zs)return e;var n=new Map,i=pa(e),o=Ye(0);i&&n.set("length",Ye(e.length));var l;return new Proxy(e,{defineProperty(s,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&il();var p=n.get(d);return p===void 0?(p=Ye(u.value),n.set(d,p)):z(p,Y(u.value,l)),!0},deleteProperty(s,d){var u=n.get(d);if(u===void 0)d in s&&n.set(d,Ye(Ae));else{if(i&&typeof d=="string"){var p=n.get("length"),_=Number(d);Number.isInteger(_)&&_<p.v&&z(p,_)}z(u,Ae),bi(o)}return!0},get(s,d,u){var f;if(d===Br)return e;var p=n.get(d),_=d in s;if(p===void 0&&(!_||(f=Cr(s,d))!=null&&f.writable)&&(p=Ye(Y(_?s[d]:Ae,l)),n.set(d,p)),p!==void 0){var g=c(p);return g===Ae?void 0:g}return Reflect.get(s,d,u)},getOwnPropertyDescriptor(s,d){var u=Reflect.getOwnPropertyDescriptor(s,d);if(u&&"value"in u){var p=n.get(d);p&&(u.value=c(p))}else if(u===void 0){var _=n.get(d),g=_==null?void 0:_.v;if(_!==void 0&&g!==Ae)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return u},has(s,d){var g;if(d===Br)return!0;var u=n.get(d),p=u!==void 0&&u.v!==Ae||Reflect.has(s,d);if(u!==void 0||re!==null&&(!p||(g=Cr(s,d))!=null&&g.writable)){u===void 0&&(u=Ye(p?Y(s[d],l):Ae),n.set(d,u));var _=c(u);if(_===Ae)return!1}return p},set(s,d,u,p){var k;var _=n.get(d),g=d in s;if(i&&d==="length")for(var f=u;f<_.v;f+=1){var m=n.get(f+"");m!==void 0?z(m,Ae):f in s&&(m=Ye(Ae),n.set(f+"",m))}_===void 0?(!g||(k=Cr(s,d))!=null&&k.writable)&&(_=Ye(void 0),z(_,Y(u,l)),n.set(d,_)):(g=_.v!==Ae,z(_,Y(u,l)));var x=Reflect.getOwnPropertyDescriptor(s,d);if(x!=null&&x.set&&x.set.call(p,u),!g){if(i&&typeof d=="string"){var y=n.get("length"),v=Number(d);Number.isInteger(v)&&v>=y.v&&z(y,v+1)}bi(o)}return!0},ownKeys(s){c(o);var d=Reflect.ownKeys(s).filter(_=>{var g=n.get(_);return g===void 0||g.v!==Ae});for(var[u,p]of n)p.v!==Ae&&!(u in s)&&d.push(u);return d},setPrototypeOf(){ol()}})}function bi(e,r=1){z(e,e.v+r)}var yi,hi,vi;function ul(){if(yi===void 0){yi=window;var e=Element.prototype,r=Node.prototype;hi=Cr(r,"firstChild").get,vi=Cr(r,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0}}function Mt(e=""){return document.createTextNode(e)}function Qr(e){return hi.call(e)}function ba(e){return vi.call(e)}function P(e,r){return Qr(e)}function J(e,r){{var t=Qr(e);return t instanceof Comment&&t.data===""?ba(t):t}}function N(e,r=1,t=!1){let a=e;for(;r--;)a=ba(a);return a}function pl(e){e.textContent=""}function T(e){var r=sr|Or;re===null?r|=Jr:re.f|=ui;var t=ue!==null&&(ue.f&sr)!==0?ue:null;const a={children:null,ctx:se,deps:null,equals:_i,f:r,fn:e,reactions:null,rv:0,v:null,wv:0,parent:t??re};return t!==null&&(t.children??(t.children=[])).push(a),a}function pt(e){const r=T(e);return r.equals=en,r}function ki(e){var r=e.children;if(r!==null){e.children=null;for(var t=0;t<r.length;t+=1){var a=r[t];(a.f&sr)!==0?an(a):Qe(a)}}}function _l(e){for(var r=e.parent;r!==null;){if((r.f&sr)===0)return r;r=r.parent}return null}function wi(e){var r,t=re;Le(_l(e));try{ki(e),r=Ci(e)}finally{Le(t)}return r}function Pi(e){var r=wi(e),t=(rt||(e.f&Jr)!==0)&&e.deps!==null?jt:Oe;dr(e,t),e.equals(r)||(e.v=r,e.wv=Ni())}function an(e){ki(e),Bt(e,0),dr(e,dt),e.v=e.children=e.deps=e.ctx=e.reactions=null}function xi(e){re===null&&ue===null&&tl(),ue!==null&&(ue.f&Jr)!==0&&rl(),cn&&el()}function gl(e,r){var t=r.last;t===null?r.last=r.first=e:(t.next=e,e.prev=t,r.last=e)}function _t(e,r,t,a=!0){var n=(e&Ft)!==0,i=re,o={ctx:se,deps:null,deriveds:null,nodes_start:null,nodes_end:null,f:e|Or,first:null,fn:r,last:null,next:null,parent:n?null:i,prev:null,teardown:null,transitions:null,wv:0};if(t){var l=mt;try{Ai(!0),Rt(o),o.f|=di}catch(u){throw Qe(o),u}finally{Ai(l)}}else r!==null&&wa(o);var s=t&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&ui)===0;if(!s&&!n&&a&&(i!==null&&gl(o,i),ue!==null&&(ue.f&sr)!==0)){var d=ue;(d.children??(d.children=[])).push(o)}return o}function Si(e){const r=_t(At,null,!1);return dr(r,Oe),r.teardown=e,r}function gt(e){xi();var r=re!==null&&(re.f&lr)!==0&&se!==null&&!se.m;if(r){var t=se;(t.e??(t.e=[])).push({fn:e,effect:re,reaction:ue})}else{var a=ya(e);return a}}function ml(e){return xi(),ha(e)}function fl(e){const r=_t(Ft,e,!0);return(t={})=>new Promise(a=>{t.outro?$r(r,()=>{Qe(r),a(void 0)}):(Qe(r),a(void 0))})}function ya(e){return _t(ci,e,!1)}function gr(e,r){var t=se,a={effect:null,ran:!1};t.l.r1.push(a),a.effect=ha(()=>{e(),!a.ran&&(a.ran=!0,z(t.l.r2,!0),Dr(r))})}function bl(){var e=se;ha(()=>{if(c(e.l.r2)){for(var r of e.l.r1){var t=r.effect;(t.f&Oe)!==0&&dr(t,jt),ft(t)&&Rt(t),r.ran=!1}e.l.r2.v=!1}})}function ha(e){return _t(At,e,!0)}function j(e){return Rr(e)}function Rr(e,r=0){return _t(At|_a|r,e,!0)}function Je(e,r=!0){return _t(At|lr,e,!0,r)}function Ei(e){var r=e.teardown;if(r!==null){const t=cn,a=ue;Fi(!0),$e(null);try{r.call(null)}finally{Fi(t),$e(a)}}}function Ti(e){var r=e.deriveds;if(r!==null){e.deriveds=null;for(var t=0;t<r.length;t+=1)an(r[t])}}function Ii(e,r=!1){var t=e.first;for(e.first=e.last=null;t!==null;){var a=t.next;Qe(t,r),t=a}}function yl(e){for(var r=e.first;r!==null;){var t=r.next;(r.f&lr)===0&&Qe(r),r=t}}function Qe(e,r=!0){var t=!1;if((r||(e.f&Qs)!==0)&&e.nodes_start!==null){for(var a=e.nodes_start,n=e.nodes_end;a!==null;){var i=a===n?null:ba(a);a.remove(),a=i}t=!0}Ii(e,r&&!t),Ti(e),Bt(e,0),dr(e,dt);var o=e.transitions;if(o!==null)for(const s of o)s.stop();Ei(e);var l=e.parent;l!==null&&l.first!==null&&Di(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=null}function Di(e){var r=e.parent,t=e.prev,a=e.next;t!==null&&(t.next=a),a!==null&&(a.prev=t),r!==null&&(r.first===e&&(r.first=a),r.last===e&&(r.last=t))}function $r(e,r){var t=[];nn(e,t,!0),qi(t,()=>{Qe(e),r&&r()})}function qi(e,r){var t=e.length;if(t>0){var a=()=>--t||r();for(var n of e)n.out(a)}else r()}function nn(e,r,t){if((e.f&_r)===0){if(e.f^=_r,e.transitions!==null)for(const o of e.transitions)(o.is_global||t)&&r.push(o);for(var a=e.first;a!==null;){var n=a.next,i=(a.f&Lr)!==0||(a.f&lr)!==0;nn(a,r,i?t:!1),a=n}}}function Nt(e){zi(e,!0)}function zi(e,r){if((e.f&_r)!==0){ft(e)&&Rt(e),e.f^=_r;for(var t=e.first;t!==null;){var a=t.next,n=(t.f&Lr)!==0||(t.f&lr)!==0;zi(t,n?r:!1),t=a}if(e.transitions!==null)for(const i of e.transitions)(i.is_global||r)&&i.in()}}let on=!1,sn=[];function hl(){on=!1;const e=sn.slice();sn=[],$a(e)}function et(e){on||(on=!0,queueMicrotask(hl)),sn.push(e)}function ln(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}let Ct=!1,va=!1,ka=null,mt=!1,cn=!1;function Ai(e){mt=e}function Fi(e){cn=e}let dn=[],Ot=0,tb=[],ue=null;function $e(e){ue=e}let re=null;function Le(e){re=e}let mr=null;function vl(e){mr=e}let Fe=null,Ge=0,Ur=null;function kl(e){Ur=e}let ji=1,un=0,rt=!1,se=null;function Mi(e){se=e}function Ni(){return++ji}function pn(){return!ut||se!==null&&se.l===null}function ft(e){var d;var r=e.f;if((r&Or)!==0)return!0;if((r&jt)!==0){var t=e.deps,a=(r&Jr)!==0;if(t!==null){var n,i,o=(r&ma)!==0,l=a&&re!==null&&!rt,s=t.length;if(o||l){for(n=0;n<s;n++)i=t[n],(o||!((d=i==null?void 0:i.reactions)!=null&&d.includes(e)))&&(i.reactions??(i.reactions=[])).push(e);o&&(e.f^=ma)}for(n=0;n<s;n++)if(i=t[n],ft(i)&&Pi(i),i.wv>e.wv)return!0}(!a||re!==null&&!rt)&&dr(e,Oe)}return!1}function wl(e,r){for(var t=r;t!==null;){if((t.f&ga)!==0)try{t.fn(e);return}catch{t.f^=ga}t=t.parent}throw Ct=!1,e}function Pl(e){return(e.f&dt)===0&&(e.parent===null||(e.parent.f&ga)===0)}function _n(){Ct=!1}function Lt(e,r,t,a){if(Ct){if(t===null&&(Ct=!1),Pl(r))throw e;return}t!==null&&(Ct=!0);{wl(e,r);return}}function Ci(e){var _;var r=Fe,t=Ge,a=Ur,n=ue,i=rt,o=mr,l=se,s=e.f;Fe=null,Ge=0,Ur=null,ue=(s&(lr|Ft))===0?e:null,rt=!mt&&(s&Jr)!==0,mr=null,se=e.ctx,un++;try{var d=(0,e.fn)(),u=e.deps;if(Fe!==null){var p;if(Bt(e,Ge),u!==null&&Ge>0)for(u.length=Ge+Fe.length,p=0;p<Fe.length;p++)u[Ge+p]=Fe[p];else e.deps=u=Fe;if(!rt)for(p=Ge;p<u.length;p++)((_=u[p]).reactions??(_.reactions=[])).push(e)}else u!==null&&Ge<u.length&&(Bt(e,Ge),u.length=Ge);return d}finally{Fe=r,Ge=t,Ur=a,ue=n,rt=i,mr=o,se=l}}function xl(e,r){let t=r.reactions;if(t!==null){var a=Ys.call(t,e);if(a!==-1){var n=t.length-1;n===0?t=r.reactions=null:(t[a]=t[n],t.pop())}}t===null&&(r.f&sr)!==0&&(Fe===null||!Fe.includes(r))&&(dr(r,jt),(r.f&(Jr|ma))===0&&(r.f^=ma),Bt(r,0))}function Bt(e,r){var t=e.deps;if(t!==null)for(var a=r;a<t.length;a++)xl(e,t[a])}function Rt(e){var r=e.f;if((r&dt)===0){dr(e,Oe);var t=re,a=se;re=e;try{(r&_a)!==0?yl(e):Ii(e),Ti(e),Ei(e);var n=Ci(e);e.teardown=typeof n=="function"?n:null,e.wv=ji;var i=e.deps,o;si&&cl&&e.f&Or}catch(l){Lt(l,e,t,a||e.ctx)}finally{re=t}}}function Sl(){if(Ot>1e3){Ot=0;try{al()}catch(e){if(ka!==null)Lt(e,ka,null);else throw e}}Ot++}function El(e){var r=e.length;if(r!==0){Sl();var t=mt;mt=!0;try{for(var a=0;a<r;a++){var n=e[a];(n.f&Oe)===0&&(n.f^=Oe);var i=[];Oi(n,i),Tl(i)}}finally{mt=t}}}function Tl(e){var r=e.length;if(r!==0)for(var t=0;t<r;t++){var a=e[t];if((a.f&(dt|_r))===0)try{ft(a)&&(Rt(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null?Di(a):a.fn=null))}catch(n){Lt(n,a,null,a.ctx)}}}function Il(){if(va=!1,Ot>1001)return;const e=dn;dn=[],El(e),va||(Ot=0,ka=null)}function wa(e){va||(va=!0,queueMicrotask(Il)),ka=e;for(var r=e;r.parent!==null;){r=r.parent;var t=r.f;if((t&(Ft|lr))!==0){if((t&Oe)===0)return;r.f^=Oe}}dn.push(r)}function Oi(e,r){var t=e.first,a=[];e:for(;t!==null;){var n=t.f,i=(n&lr)!==0,o=i&&(n&Oe)!==0,l=t.next;if(!o&&(n&_r)===0)if((n&At)!==0){if(i)t.f^=Oe;else try{ft(t)&&Rt(t)}catch(p){Lt(p,t,null,t.ctx)}var s=t.first;if(s!==null){t=s;continue}}else(n&ci)!==0&&a.push(t);if(l===null){let p=t.parent;for(;p!==null;){if(e===p)break e;var d=p.next;if(d!==null){t=d;continue e}p=p.parent}}t=l}for(var u=0;u<a.length;u++)s=a[u],r.push(s),Oi(s,r)}function c(e){var u;var r=e.f,t=(r&sr)!==0;if(t&&(r&dt)!==0){var a=wi(e);return an(e),a}if(ue!==null){mr!==null&&mr.includes(e)&&sl();var n=ue.deps;e.rv<un&&(e.rv=un,Fe===null&&n!==null&&n[Ge]===e?Ge++:Fe===null?Fe=[e]:Fe.push(e),Ur!==null&&re!==null&&(re.f&Oe)!==0&&(re.f&lr)===0&&Ur.includes(e)&&(dr(re,Or),wa(re)))}else if(t&&e.deps===null)for(var i=e,o=i.parent,l=i;o!==null;)if((o.f&sr)!==0){var s=o;l=s,o=s.parent}else{var d=o;(u=d.deriveds)!=null&&u.includes(l)||(d.deriveds??(d.deriveds=[])).push(l);break}return t&&(i=e,ft(i)&&Pi(i)),e.v}function Dr(e){const r=ue;try{return ue=null,e()}finally{ue=r}}const Dl=-7169;function dr(e,r){e.f=e.f&Dl|r}function je(e){return Li().get(e)}function gn(e,r){return Li().set(e,r),r}function Li(e){return se===null&&ln(),se.c??(se.c=new Map(ql(se)||void 0))}function ql(e){let r=e.p;for(;r!==null;){const t=r.c;if(t!==null)return t;r=r.p}return null}function X(e,r=!1,t){se={p:se,c:null,e:null,m:!1,s:e,x:null,l:null},ut&&!r&&(se.l={s:null,u:null,r1:[],r2:Ye(!1)})}function Z(e){const r=se;if(r!==null){e!==void 0&&(r.x=e);const o=r.e;if(o!==null){var t=re,a=ue;r.e=null;try{for(var n=0;n<o.length;n++){var i=o[n];Le(i.effect),$e(i.reaction),ya(i.fn)}}finally{Le(t),$e(a)}}se=r.p,r.m=!0}return e||{}}function Pa(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Br in e)mn(e);else if(!Array.isArray(e))for(let r in e){const t=e[r];typeof t=="object"&&t&&Br in t&&mn(t)}}}function mn(e,r=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!r.has(e)){r.add(e),e instanceof Date&&e.getTime();for(let a in e)try{mn(e[a],r)}catch{}const t=Qa(e);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const a=li(t);for(let n in a){const i=a[n].get;if(i)try{i.call(e)}catch{}}}}}function zl(e,r){if(r){const t=document.body;e.autofocus=!0,et(()=>{document.activeElement===t&&e.focus()})}}function Al(e){var r=ue,t=re;$e(null),Le(null);try{return e()}finally{$e(r),Le(t)}}const Bi=new Set,fn=new Set;function Ri(e,r,t,a){function n(i){if(a.capture||Ut.call(r,i),!i.cancelBubble)return Al(()=>t.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?et(()=>{r.addEventListener(e,n,a)}):r.addEventListener(e,n,a),n}function fr(e,r,t,a,n){var i={capture:a,passive:n},o=Ri(e,r,t,i);(r===document.body||r===window||r===document)&&Si(()=>{r.removeEventListener(e,o,i)})}function xa(e){for(var r=0;r<e.length;r++)Bi.add(e[r]);for(var t of fn)t(e)}function Ut(e){var v;var r=this,t=r.ownerDocument,a=e.type,n=((v=e.composedPath)==null?void 0:v.call(e))||[],i=n[0]||e.target,o=0,l=e.__root;if(l){var s=n.indexOf(l);if(s!==-1&&(r===document||r===window)){e.__root=r;return}var d=n.indexOf(r);if(d===-1)return;s<=d&&(o=s)}if(i=n[o]||e.target,i!==r){Gs(e,"currentTarget",{configurable:!0,get(){return i||t}});var u=ue,p=re;$e(null),Le(null);try{for(var _,g=[];i!==null;){var f=i.assignedSlot||i.parentNode||i.host||null;try{var m=i["__"+a];if(m!==void 0&&!i.disabled)if(pa(m)){var[x,...y]=m;x.apply(i,[e,...y])}else m.call(i,e)}catch(k){_?g.push(k):_=k}if(e.cancelBubble||f===r||f===null)break;i=f}if(_){for(let k of g)queueMicrotask(()=>{throw k});throw _}}finally{e.__root=r,delete e.currentTarget,$e(u),Le(p)}}}function bn(e){var r=document.createElement("template");return r.innerHTML=e,r.content}function tt(e,r){var t=re;t.nodes_start===null&&(t.nodes_start=e,t.nodes_end=r)}function D(e,r){var t=(r&da)!==0,a=(r&ua)!==0,n,i=!e.startsWith("<!>");return()=>{n===void 0&&(n=bn(i?e:"<!>"+e),t||(n=Qr(n)));var o=a?document.importNode(n,!0):n.cloneNode(!0);if(t){var l=Qr(o),s=o.lastChild;tt(l,s)}else tt(o,o);return o}}function br(e,r,t="svg"){var a=!e.startsWith("<!>"),n=`<${t}>${a?e:"<!>"+e}</${t}>`,i;return()=>{if(!i){var o=bn(n),l=Qr(o);i=Qr(l)}var s=i.cloneNode(!0);return tt(s,s),s}}function de(e=""){{var r=Mt(e+"");return tt(r,r),r}}function ne(){var e=document.createDocumentFragment(),r=document.createComment(""),t=Mt();return e.append(r,t),tt(r,t),e}function b(e,r){e!==null&&e.before(r)}let Sa=!0;function Ui(e){Sa=e}function ae(e,r){var t=r==null?"":typeof r=="object"?r+"":r;t!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=t,e.nodeValue=t==null?"":t+"")}function yn(e,r){return Fl(e,r)}const bt=new Map;function Fl(e,{target:r,anchor:t,props:a={},events:n,context:i,intro:o=!0}){ul();var l=new Set,s=p=>{for(var _=0;_<p.length;_++){var g=p[_];if(!l.has(g)){l.add(g);var f=Ws(g);r.addEventListener(g,Ut,{passive:f});var m=bt.get(g);m===void 0?(document.addEventListener(g,Ut,{passive:f}),bt.set(g,1)):bt.set(g,m+1)}}};s(Ja(Bi)),fn.add(s);var d=void 0,u=fl(()=>{var p=t??r.appendChild(Mt());return Je(()=>{if(i){X({});var _=se;_.c=i}n&&(a.$$events=n),Sa=o,d=e(p,a)||{},Sa=!0,i&&Z()}),()=>{var f;for(var _ of l){r.removeEventListener(_,Ut);var g=bt.get(_);--g===0?(document.removeEventListener(_,Ut),bt.delete(_)):bt.set(_,g)}fn.delete(s),p!==t&&((f=p.parentNode)==null||f.removeChild(p))}});return hn.set(d,u),d}let hn=new WeakMap;function Ea(e,r){const t=hn.get(e);return t?(hn.delete(e),t(r)):Promise.resolve()}function O(e,r,t=!1){var a=e,n=null,i=null,o=Ae,l=t?Lr:0,s=!1;const d=(p,_=!0)=>{s=!0,u(_,p)},u=(p,_)=>{o!==(o=p)&&(o?(n?Nt(n):_&&(n=Je(()=>_(a))),i&&$r(i,()=>{i=null})):(i?Nt(i):_&&(i=Je(()=>_(a))),n&&$r(n,()=>{n=null})))};Rr(()=>{s=!1,r(d),s||u(null,null)},l)}function yt(e,r){return r}function jl(e,r,t,a){for(var n=[],i=r.length,o=0;o<i;o++)nn(r[o].e,n,!0);var l=i>0&&n.length===0&&t!==null;if(l){var s=t.parentNode;pl(s),s.append(t),a.clear(),Vr(e,r[0].prev,r[i-1].next)}qi(n,()=>{for(var d=0;d<i;d++){var u=r[d];l||(a.delete(u.k),Vr(e,u.prev,u.next)),Qe(u.e,!l)}})}function ht(e,r,t,a,n,i=null){var o=e,l={flags:r,items:new Map,first:null},s=(r&he)!==0;if(s){var d=e;o=d.appendChild(Mt())}var u=null,p=!1;Rr(()=>{var _=t(),g=pa(_)?_:_==null?[]:Ja(_),f=g.length;if(!(p&&f===0)){p=f===0;{var m=ue;Ml(g,l,o,n,r,(m.f&_r)!==0,a)}i!==null&&(f===0?u?Nt(u):u=Je(()=>i(o)):u!==null&&$r(u,()=>{u=null})),t()}})}function Ml(e,r,t,a,n,i,o,l){var W,te,ye,_e;var s=(n&De)!==0,d=(n&(ie|Me))!==0,u=e.length,p=r.items,_=r.first,g=_,f,m=null,x,y=[],v=[],k,A,I,q;if(s)for(q=0;q<u;q+=1)k=e[q],A=o(k,q),I=p.get(A),I!==void 0&&((W=I.a)==null||W.measure(),(x??(x=new Set)).add(I));for(q=0;q<u;q+=1){if(k=e[q],A=o(k,q),I=p.get(A),I===void 0){var H=g?g.e.nodes_start:t;m=Cl(H,r,m,m===null?r.first:m.next,k,A,q,a,n),p.set(A,m),y=[],v=[],g=m.next;continue}if(d&&Nl(I,k,q,n),(I.e.f&_r)!==0&&(Nt(I.e),s&&((te=I.a)==null||te.unfix(),(x??(x=new Set)).delete(I))),I!==g){if(f!==void 0&&f.has(I)){if(y.length<v.length){var h=v[0],w;m=h.prev;var E=y[0],S=y[y.length-1];for(w=0;w<y.length;w+=1)Vi(y[w],h,t);for(w=0;w<v.length;w+=1)f.delete(v[w]);Vr(r,E.prev,S.next),Vr(r,m,E),Vr(r,S,h),g=h,m=S,q-=1,y=[],v=[]}else f.delete(I),Vi(I,g,t),Vr(r,I.prev,I.next),Vr(r,I,m===null?r.first:m.next),Vr(r,m,I),m=I;continue}for(y=[],v=[];g!==null&&g.k!==A;)(i||(g.e.f&_r)===0)&&(f??(f=new Set)).add(g),v.push(g),g=g.next;if(g===null)continue;I=g}y.push(I),m=I,g=I.next}if(g!==null||f!==void 0){for(var M=f===void 0?[]:Ja(f);g!==null;)(i||(g.e.f&_r)===0)&&M.push(g),g=g.next;var K=M.length;if(K>0){var L=(n&he)!==0&&u===0?t:null;if(s){for(q=0;q<K;q+=1)(ye=M[q].a)==null||ye.measure();for(q=0;q<K;q+=1)(_e=M[q].a)==null||_e.fix()}jl(r,M,L,p)}}s&&et(()=>{var ve;if(x!==void 0)for(I of x)(ve=I.a)==null||ve.apply()}),re.first=r.first&&r.first.e,re.last=m&&m.e}function Nl(e,r,t,a){(a&ie)!==0&&rn(e.v,r),(a&Me)!==0?rn(e.i,t):e.i=t}function Cl(e,r,t,a,n,i,o,l,s,d){var u=(s&ie)!==0,p=(s&pr)===0,_=u?p?fa(n):Ye(n):n,g=(s&Me)===0?o:Ye(o),f={i:g,v:_,k:i,a:null,e:null,prev:t,next:a};try{return f.e=Je(()=>l(e,_,g),tn),f.e.prev=t&&t.e,f.e.next=a&&a.e,t===null?r.first=f:(t.next=f,t.e.next=f.e),a!==null&&(a.prev=f,a.e.prev=f.e),f}finally{}}function Vi(e,r,t){for(var a=e.next?e.next.e.nodes_start:t,n=r?r.e.nodes_start:t,i=e.e.nodes_start;i!==a;){var o=ba(i);n.before(i),i=o}}function Vr(e,r,t){r===null?e.first=t:(r.next=t,r.e.next=t&&t.e),t!==null&&(t.prev=r,t.e.prev=r&&r.e)}function at(e,r,t,a,n){var i=e,o="",l;Rr(()=>{o!==(o=r()??"")&&(l!==void 0&&(Qe(l),l=void 0),o!==""&&(l=Je(()=>{var s=o+"",d=bn(s);tt(Qr(d),d.lastChild),i.before(d)})))})}function Ol(e,r,t,a,n){var l;var i=(l=r.$$slots)==null?void 0:l[t],o=!1;i===!0&&(i=r.children,o=!0),i===void 0||i(e,o?()=>a:a)}function ke(e,r,...t){var a=e,n=ce,i;Rr(()=>{n!==(n=r())&&(i&&(Qe(i),i=null),i=Je(()=>n(a,...t)))},Lr)}function Ll(e,r,t){var a=e,n,i;Rr(()=>{n!==(n=r())&&(i&&($r(i),i=null),n&&(i=Je(()=>t(a,n))))},Lr)}function Ta(e,r,t,a,n,i){var o,l,s=null,d=e,u;Rr(()=>{const p=r()||null;var _=p==="svg"?qe:null;p!==o&&(u&&(p===null?$r(u,()=>{u=null,l=null}):p===l?Nt(u):(Qe(u),Ui(!1))),p&&p!==l&&(u=Je(()=>{if(s=_?document.createElementNS(_,p):document.createElement(p),tt(s,s),a){var g=s.appendChild(Mt());a(s,g)}re.nodes_end=s,d.before(s)})),o=p,o&&(l=o),Ui(!0))},Lr)}function G(e,r){et(()=>{var t=e.getRootNode(),a=t.host?t:t.head??t.ownerDocument.head;if(!a.querySelector("#"+r.hash)){const n=document.createElement("style");n.id=r.hash,n.textContent=r.code,a.appendChild(n)}})}function Hi(e){var r,t,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(t=Hi(e[r]))&&(a&&(a+=" "),a+=t)}else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function Bl(){for(var e,r,t=0,a="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=Hi(e))&&(a&&(a+=" "),a+=r);return a}function Wi(e){return typeof e=="object"?Bl(e):e??""}function Rl(e,r){r?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function V(e,r,t,a){var n=e.__attributes??(e.__attributes={});n[r]!==(n[r]=t)&&(r==="style"&&"__styles"in e&&(e.__styles={}),r==="loading"&&(e[$s]=t),t==null?e.removeAttribute(r):typeof t!="string"&&Gi(e).includes(r)?e[r]=t:e.setAttribute(r,t))}function Ia(e,r,t,a,n=!1,i=!1,o=!1){var l=r||{},s=e.tagName==="OPTION";for(var d in r)d in t||(t[d]=null);t.class&&(t.class=Wi(t.class)),a!==void 0&&(t.class=t.class?t.class+" "+a:a);var u=Gi(e),p=e.__attributes??(e.__attributes={});for(const y in t){let v=t[y];if(s&&y==="value"&&v==null){e.value=e.__value="",l[y]=v;continue}var _=l[y];if(v!==_){l[y]=v;var g=y[0]+y[1];if(g!=="$$"){if(g==="on"){const k={},A="$$"+y;let I=y.slice(2);var f=zt(I);if(qt(I)&&(I=I.slice(0,-7),k.capture=!0),!f&&_){if(v!=null)continue;e.removeEventListener(I,l[A],k),l[A]=null}if(v!=null)if(f)e[`__${I}`]=v,xa([I]);else{let q=function(H){l[y].call(this,H)};l[A]=Ri(I,e,q,k)}else f&&(e[`__${I}`]=void 0)}else if(y==="style"&&v!=null)e.style.cssText=v+"";else if(y==="autofocus")zl(e,!!v);else if(y==="__value"||y==="value"&&v!=null)e.value=e[y]=e.__value=v;else if(y==="selected"&&s)Rl(e,v);else{var m=y;n||(m=Vs(m));var x=m==="defaultValue"||m==="defaultChecked";if(v==null&&!i&&!x)if(p[y]=null,m==="value"||m==="checked"){let k=e;if(m==="value"){let A=k.defaultValue;k.removeAttribute(m),k.defaultValue=A}else{let A=k.defaultChecked;k.removeAttribute(m),k.defaultChecked=A}}else e.removeAttribute(y);else x||u.includes(m)&&(i||typeof v!="string")?e[m]=v:typeof v!="function"&&V(e,m,v)}y==="style"&&"__styles"in e&&(e.__styles={})}}}return l}var Yi=new Map;function Gi(e){var r=Yi.get(e.nodeName);if(r)return r;Yi.set(e.nodeName,r=[]);for(var t,a=e,n=Element.prototype;n!==a;){t=li(a);for(var i in t)t[i].set&&r.push(i);a=Qa(a)}return r}function Ul(e,r,t){var a=e.__className,n=Xi(r,t);(a!==n||tn)&&(n===""?e.removeAttribute("class"):e.setAttribute("class",n),e.__className=n)}function Hr(e,r,t){var a=e.__className,n=Xi(r,t);(a!==n||tn)&&(r==null&&!t?e.removeAttribute("class"):e.className=n,e.__className=n)}function Xi(e,r){return(e??"")+(r?" "+r:"")}function qr(e,r,t){if(t){if(e.classList.contains(r))return;e.classList.add(r)}else{if(!e.classList.contains(r))return;e.classList.remove(r)}}const Vl=()=>performance.now(),zr={tick:e=>requestAnimationFrame(e),now:()=>Vl(),tasks:new Set};function Zi(){const e=zr.now();zr.tasks.forEach(r=>{r.c(e)||(zr.tasks.delete(r),r.f())}),zr.tasks.size!==0&&zr.tick(Zi)}function Hl(e){let r;return zr.tasks.size===0&&zr.tick(Zi),{promise:new Promise(t=>{zr.tasks.add(r={c:e,f:t})}),abort(){zr.tasks.delete(r)}}}function Da(e,r){e.dispatchEvent(new CustomEvent(r))}function Wl(e){if(e==="float")return"cssFloat";if(e==="offset")return"cssOffset";if(e.startsWith("--"))return e;const r=e.split("-");return r.length===1?r[0]:r[0]+r.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function Ki(e){const r={},t=e.split(";");for(const a of t){const[n,i]=a.split(":");if(!n||i===void 0)break;const o=Wl(n.trim());r[o]=i.trim()}return r}const Yl=e=>e;function Ji(e,r,t,a){var n=(e&It)!==0,i=(e&Ke)!==0,o=n&&i,l=(e&Dt)!==0,s=o?"both":n?"in":"out",d,u=r.inert,p,_;function g(){var v=ue,k=re;$e(null),Le(null);try{return d??(d=t()(r,(a==null?void 0:a())??{},{direction:s}))}finally{$e(v),Le(k)}}var f={is_global:l,in(){var v;if(r.inert=u,!n){_==null||_.abort(),(v=_==null?void 0:_.reset)==null||v.call(_);return}i||p==null||p.abort(),Da(r,"introstart"),p=vn(r,g(),_,1,()=>{Da(r,"introend"),p==null||p.abort(),p=d=void 0})},out(v){if(!i){v==null||v(),d=void 0;return}r.inert=!0,Da(r,"outrostart"),_=vn(r,g(),p,0,()=>{Da(r,"outroend"),v==null||v()})},stop:()=>{p==null||p.abort(),_==null||_.abort()}},m=re;if((m.transitions??(m.transitions=[])).push(f),n&&Sa){var x=l;if(!x){for(var y=m.parent;y&&(y.f&Lr)!==0;)for(;(y=y.parent)&&(y.f&_a)===0;);x=!y||(y.f&di)!==0}x&&ya(()=>{Dr(()=>f.in())})}}function vn(e,r,t,a,n){var i=a===1;if(ct(r)){var o,l=!1;return et(()=>{if(!l){var x=r({direction:i?"in":"out"});o=vn(e,x,t,a,n)}}),{abort:()=>{l=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(t==null||t.deactivate(),!(r!=null&&r.duration))return n(),{abort:ce,deactivate:ce,reset:ce,t:()=>a};const{delay:s=0,css:d,tick:u,easing:p=Yl}=r;var _=[];if(i&&t===void 0&&(u&&u(0,1),d)){var g=Ki(d(0,1));_.push(g,g)}var f=()=>1-a,m=e.animate(_,{duration:s});return m.onfinish=()=>{var x=(t==null?void 0:t.t())??1-a;t==null||t.abort();var y=a-x,v=r.duration*Math.abs(y),k=[];if(v>0){if(d)for(var A=Math.ceil(v/16.666666666666668),I=0;I<=A;I+=1){var q=x+y*p(I/A),H=d(q,1-q);k.push(Ki(H))}f=()=>{var h=m.currentTime;return x+y*p(h/v)},u&&Hl(()=>{if(m.playState!=="running")return!1;var h=f();return u(h,1-h),!0})}m=e.animate(k,{duration:v,fill:"forwards"}),m.onfinish=()=>{f=()=>a,u==null||u(a,1-a),n()}},{abort:()=>{m&&(m.cancel(),m.effect=null,m.onfinish=ce)},deactivate:()=>{n=ce},reset:()=>{a===0&&(u==null||u(1,0))},t:()=>f()}}function Qi(e,r){return e===r||(e==null?void 0:e[Br])===r}function $i(e={},r,t,a){return ya(()=>{var n,i;return ha(()=>{n=i,i=[],Dr(()=>{e!==t(...i)&&(r(e,...i),n&&Qi(t(...n),e)&&r(null,...n))})}),()=>{et(()=>{i&&Qi(t(...i),e)&&r(null,...i)})}}),e}function er(e=!1){const r=se,t=r.l.u;if(!t)return;let a=()=>Pa(r.s);if(e){let n=0,i={};const o=T(()=>{let l=!1;const s=r.s;for(const d in s)s[d]!==i[d]&&(i[d]=s[d],l=!0);return l&&n++,n});a=()=>c(o)}t.b.length&&ml(()=>{eo(r,a),$a(t.b)}),gt(()=>{const n=Dr(()=>t.m.map(Ks));return()=>{for(const i of n)typeof i=="function"&&i()}}),t.a.length&&gt(()=>{eo(r,a),$a(t.a)})}function eo(e,r){if(e.l.s)for(const t of e.l.s)c(t);r()}function ro(e,r){var i;var t=(i=e.$$events)==null?void 0:i[r.type],a=pa(t)?t.slice():t==null?[]:[t];for(var n of a)n.call(this,r)}function rr(e){se===null&&ln(),ut&&se.l!==null?Gl(se).m.push(e):gt(()=>{const r=Dr(e);if(typeof r=="function")return r})}function Vt(e){se===null&&ln(),rr(()=>()=>Dr(e))}function Gl(e){var r=e.l;return r.u??(r.u={a:[],b:[],m:[]})}function Xl(e,r,t){if(e==null)return r(void 0),ce;const a=Dr(()=>e.subscribe(r,t));return a.unsubscribe?()=>a.unsubscribe():a}let qa=!1;function Be(e,r,t){const a=t[r]??(t[r]={store:null,source:fa(void 0),unsubscribe:ce});if(a.store!==e)if(a.unsubscribe(),a.store=e??null,e==null)a.source.v=void 0,a.unsubscribe=ce;else{var n=!0;a.unsubscribe=Xl(e,i=>{n?a.source.v=i:z(a.source,i)}),n=!1}return c(a.source)}function Re(){const e={};return Si(()=>{for(var r in e)e[r].unsubscribe()}),e}function Zl(e){var r=qa;try{return qa=!1,[e(),qa]}finally{qa=r}}const Kl={get(e,r){if(!e.exclude.includes(r))return e.props[r]},set(e,r){return!1},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function Wr(e,r,t){return new Proxy({props:e,exclude:r},Kl)}const Jl={get(e,r){let t=e.props.length;for(;t--;){let a=e.props[t];if(ct(a)&&(a=a()),typeof a=="object"&&a!==null&&r in a)return a[r]}},set(e,r,t){let a=e.props.length;for(;a--;){let n=e.props[a];ct(n)&&(n=n());const i=Cr(n,r);if(i&&i.set)return i.set(t),!0}return!1},getOwnPropertyDescriptor(e,r){let t=e.props.length;for(;t--;){let a=e.props[t];if(ct(a)&&(a=a()),typeof a=="object"&&a!==null&&r in a){const n=Cr(a,r);return n&&!n.configurable&&(n.configurable=!0),n}}},has(e,r){if(r===Br||r===pi)return!1;for(let t of e.props)if(ct(t)&&(t=t()),t!=null&&r in t)return!0;return!1},ownKeys(e){const r=[];for(let t of e.props){ct(t)&&(t=t());for(const a in t)r.includes(a)||r.push(a)}return r}};function Ar(...e){return new Proxy({props:e},Jl)}function to(e){for(var r=re,t=re;r!==null&&(r.f&(lr|Ft))===0;)r=r.parent;try{return Le(r),e()}finally{Le(t)}}function U(e,r,t,a){var H;var n=(t&Ce)!==0,i=!ut||(t&ca)!==0,o=(t&Tt)!==0,l=(t&ge)!==0,s=!1,d;o?[d,s]=Zl(()=>e[r]):d=e[r];var u=Br in e||pi in e,p=((H=Cr(e,r))==null?void 0:H.set)??(u&&o&&r in e?h=>e[r]=h:void 0),_=a,g=!0,f=!1,m=()=>(f=!0,g&&(g=!1,l?_=Dr(a):_=a),_);d===void 0&&a!==void 0&&(p&&i&&nl(),d=m(),p&&p(d));var x;if(i)x=()=>{var h=e[r];return h===void 0?m():(g=!0,f=!1,h)};else{var y=to(()=>(n?T:pt)(()=>e[r]));y.f|=Js,x=()=>{var h=c(y);return h!==void 0&&(_=void 0),h===void 0?_:h}}if((t&Kr)===0)return x;if(p){var v=e.$$legacy;return function(h,w){return arguments.length>0?((!i||!w||v||s)&&p(w?x():h),h):x()}}var k=!1,A=!1,I=fa(d),q=to(()=>T(()=>{var h=x(),w=c(I);return k?(k=!1,A=!0,w):(A=!1,I.v=h)}));return n||(q.equals=en),function(h,w){if(arguments.length>0){const E=w?c(q):i&&o?Y(h):h;return q.equals(E)||(k=!0,z(I,E),f&&_!==void 0&&(_=E),Dr(()=>c(q))),h}return c(q)}}function ao(e,r){var t=re,a=ue,n=se;Le(e),$e(e),Mi(e.ctx);try{r()}finally{Le(t),$e(a),Mi(n)}}function Ql(e,r,t){var a=e,n;Rr(()=>{var i=re,o=!1;i.fn=l=>{var s=r.onerror;let d=r.failed;if(!s&&!d||o)throw l;var u=()=>{$r(n),ao(i,()=>{o=!1,n=Je(()=>t(a)),_n()})};s==null||s(l,u),n&&Qe(n),d&&et(()=>{ao(i,()=>{o=!0;try{n=Je(()=>{d(a,()=>l,()=>u)})}catch(p){Lt(p,i,null,i.ctx)}_n(),o=!1})})},n=Je(()=>t(a)),_n()},Lr|ga)}var we=(e=>(e[e.UnknownError=0]="UnknownError",e[e.UserCancelledError=1]="UserCancelledError",e[e.StoreProblemError=2]="StoreProblemError",e[e.PurchaseNotAllowedError=3]="PurchaseNotAllowedError",e[e.PurchaseInvalidError=4]="PurchaseInvalidError",e[e.ProductNotAvailableForPurchaseError=5]="ProductNotAvailableForPurchaseError",e[e.ProductAlreadyPurchasedError=6]="ProductAlreadyPurchasedError",e[e.ReceiptAlreadyInUseError=7]="ReceiptAlreadyInUseError",e[e.InvalidReceiptError=8]="InvalidReceiptError",e[e.MissingReceiptFileError=9]="MissingReceiptFileError",e[e.NetworkError=10]="NetworkError",e[e.InvalidCredentialsError=11]="InvalidCredentialsError",e[e.UnexpectedBackendResponseError=12]="UnexpectedBackendResponseError",e[e.InvalidAppUserIdError=14]="InvalidAppUserIdError",e[e.OperationAlreadyInProgressError=15]="OperationAlreadyInProgressError",e[e.UnknownBackendError=16]="UnknownBackendError",e[e.InvalidAppleSubscriptionKeyError=17]="InvalidAppleSubscriptionKeyError",e[e.IneligibleError=18]="IneligibleError",e[e.InsufficientPermissionsError=19]="InsufficientPermissionsError",e[e.PaymentPendingError=20]="PaymentPendingError",e[e.InvalidSubscriberAttributesError=21]="InvalidSubscriberAttributesError",e[e.LogOutWithAnonymousUserError=22]="LogOutWithAnonymousUserError",e[e.ConfigurationError=23]="ConfigurationError",e[e.UnsupportedError=24]="UnsupportedError",e[e.EmptySubscriberAttributesError=25]="EmptySubscriberAttributesError",e[e.CustomerInfoError=28]="CustomerInfoError",e[e.SignatureVerificationError=36]="SignatureVerificationError",e[e.InvalidEmailError=38]="InvalidEmailError",e))(we||{});class Ht{static getPublicMessage(r){switch(r){case 0:return"Unknown error.";case 1:return"Purchase was cancelled.";case 2:return"There was a problem with the store.";case 3:return"The device or user is not allowed to make the purchase.";case 4:return"One or more of the arguments provided are invalid.";case 5:return"The product is not available for purchase.";case 6:return"This product is already active for the user.";case 7:return"There is already another active subscriber using the same receipt.";case 8:return"The receipt is not valid.";case 9:return"The receipt is missing.";case 10:return"Error performing request. Please check your network connection and try again.";case 11:return"There was a credentials issue. Check the underlying error for more details.";case 12:return"Received unexpected response from the backend.";case 14:return"The app user id is not valid.";case 15:return"The operation is already in progress.";case 16:return"There was an unknown backend error.";case 17:return"Apple Subscription Key is invalid or not present. In order to provide subscription offers, you must first generate a subscription key. Please see https://docs.revenuecat.com/docs/ios-subscription-offers for more info.";case 18:return"The User is ineligible for that action.";case 19:return"App does not have sufficient permissions to make purchases.";case 20:return"The payment is pending.";case 21:return"One or more of the attributes sent could not be saved.";case 22:return"Called logOut but the current user is anonymous.";case 23:return"There is an issue with your configuration. Check the underlying error for more details.";case 24:return"There was a problem with the operation. Looks like we doesn't support that yet. Check the underlying error for more details.";case 25:return"A request for subscriber attributes returned none.";case 28:return"There was a problem related to the customer info.";case 36:return"Request failed signature verification. Please see https://rev.cat/trusted-entitlements for more info.";case 38:return"Email is not valid. Please provide a valid email address."}}static getErrorCodeForBackendErrorCode(r){switch(r){case 7101:case 7773:case 7898:case 7899:case 7900:case 7901:return 2;case 7102:return 7;case 7103:return 8;case 7107:case 7224:case 7225:return 11;case 7105:case 7106:case 7814:case 7877:case 7878:return 4;case 7772:return 6;case 7220:return 14;case 7259:return 28;case 7229:return 2;case 7230:case 7e3:return 23;case 7231:return 2;case 7232:return 18;case 7263:case 7264:return 21;case 7104:case 7234:case 7226:case 7110:return 12;case 7662:return 24;case 7012:case 7834:case 7879:return 38}}static convertCodeToBackendErrorCode(r){return r in Wt?r:null}static convertPurchaseFlowErrorCodeToErrorCode(r){switch(r){case pe.ErrorSettingUpPurchase:return 2;case pe.ErrorChargingPayment:return 20;case pe.NetworkError:return 10;case pe.MissingEmailError:return 4;case pe.AlreadyPurchasedError:return 6;default:return 0}}}var Wt=(e=>(e[e.BackendInvalidPlatform=7e3]="BackendInvalidPlatform",e[e.BackendInvalidEmail=7012]="BackendInvalidEmail",e[e.BackendStoreProblem=7101]="BackendStoreProblem",e[e.BackendCannotTransferPurchase=7102]="BackendCannotTransferPurchase",e[e.BackendInvalidReceiptToken=7103]="BackendInvalidReceiptToken",e[e.BackendInvalidAppStoreSharedSecret=7104]="BackendInvalidAppStoreSharedSecret",e[e.BackendInvalidPaymentModeOrIntroPriceNotProvided=7105]="BackendInvalidPaymentModeOrIntroPriceNotProvided",e[e.BackendProductIdForGoogleReceiptNotProvided=7106]="BackendProductIdForGoogleReceiptNotProvided",e[e.BackendInvalidPlayStoreCredentials=7107]="BackendInvalidPlayStoreCredentials",e[e.BackendInternalServerError=7110]="BackendInternalServerError",e[e.BackendEmptyAppUserId=7220]="BackendEmptyAppUserId",e[e.BackendInvalidAuthToken=7224]="BackendInvalidAuthToken",e[e.BackendInvalidAPIKey=7225]="BackendInvalidAPIKey",e[e.BackendBadRequest=7226]="BackendBadRequest",e[e.BackendPlayStoreQuotaExceeded=7229]="BackendPlayStoreQuotaExceeded",e[e.BackendPlayStoreInvalidPackageName=7230]="BackendPlayStoreInvalidPackageName",e[e.BackendPlayStoreGenericError=7231]="BackendPlayStoreGenericError",e[e.BackendUserIneligibleForPromoOffer=7232]="BackendUserIneligibleForPromoOffer",e[e.BackendInvalidAppleSubscriptionKey=7234]="BackendInvalidAppleSubscriptionKey",e[e.BackendSubscriberNotFound=7259]="BackendSubscriberNotFound",e[e.BackendInvalidSubscriberAttributes=7263]="BackendInvalidSubscriberAttributes",e[e.BackendInvalidSubscriberAttributesBody=7264]="BackendInvalidSubscriberAttributesBody",e[e.BackendProductIDsMalformed=7662]="BackendProductIDsMalformed",e[e.BackendAlreadySubscribedError=7772]="BackendAlreadySubscribedError",e[e.BackendPaymentGatewayGenericError=7773]="BackendPaymentGatewayGenericError",e[e.BackendOfferNotFound=7814]="BackendOfferNotFound",e[e.BackendNoMXRecordsFound=7834]="BackendNoMXRecordsFound",e[e.BackendInvalidOperationSession=7877]="BackendInvalidOperationSession",e[e.BackendPurchaseCannotBeCompleted=7878]="BackendPurchaseCannotBeCompleted",e[e.BackendEmailIsRequired=7879]="BackendEmailIsRequired",e[e.BackendGatewaySetupErrorStripeTaxNotActive=7898]="BackendGatewaySetupErrorStripeTaxNotActive",e[e.BackendGatewaySetupErrorInvalidTaxOriginAddress=7899]="BackendGatewaySetupErrorInvalidTaxOriginAddress",e[e.BackendGatewaySetupErrorMissingRequiredPermission=7900]="BackendGatewaySetupErrorMissingRequiredPermission",e[e.BackendGatewaySetupErrorSandboxModeOnly=7901]="BackendGatewaySetupErrorSandboxModeOnly",e))(Wt||{});class be extends Error{constructor(t,a,n,i){super(a);C(this,"toString",()=>`PurchasesError(code: ${we[this.errorCode]}, message: ${this.message})`);this.errorCode=t,this.underlyingErrorMessage=n,this.extra=i}static getForBackendError(t,a){const n=Ht.getErrorCodeForBackendErrorCode(t);return new be(n,Ht.getPublicMessage(n),a,{backendErrorCode:t})}static getForPurchasesFlowError(t){return new be(Ht.convertPurchaseFlowErrorCodeToErrorCode(t.errorCode),t.message,t.underlyingErrorMessage)}}class no extends Error{constructor(){super("Purchases must be configured before calling getInstance")}}var Yt=(e=>(e.Started="started",e.InProgress="in_progress",e.Succeeded="succeeded",e.Failed="failed",e))(Yt||{}),vt=(e=>(e[e.SetupIntentCreationFailed=1]="SetupIntentCreationFailed",e[e.PaymentMethodCreationFailed=2]="PaymentMethodCreationFailed",e[e.PaymentChargeFailed=3]="PaymentChargeFailed",e[e.SetupIntentCompletionFailed=4]="SetupIntentCompletionFailed",e[e.AlreadyPurchased=5]="AlreadyPurchased",e))(vt||{}),Ue=(e=>(e[e.Silent=0]="Silent",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Info=3]="Info",e[e.Debug=4]="Debug",e[e.Verbose=5]="Verbose",e))(Ue||{});class ee{static setLogLevel(r){this.logLevel=r}static log(r,t=this.logLevel){const a=`[Purchases] ${r}`;if(!(this.logLevel<t||t===Ue.Silent))switch(t){case Ue.Error:console.error(a);break;case Ue.Warn:console.warn(a);break;case Ue.Info:console.info(a);break;case Ue.Debug:console.debug(a);break;case Ue.Verbose:console.debug(a);break}}static errorLog(r){this.log(r,Ue.Error)}static warnLog(r){this.log(r,Ue.Warn)}static infoLog(r){this.log(r,Ue.Info)}static debugLog(r){this.log(r,Ue.Debug)}static verboseLog(r){this.log(r,Ue.Verbose)}}C(ee,"logLevel",Ue.Silent);function $l(e){var r;return e.operation.redemption_info?{redeemUrl:((r=e.operation.redemption_info)==null?void 0:r.redeem_url)??null}:null}var pe=(e=>(e[e.ErrorSettingUpPurchase=0]="ErrorSettingUpPurchase",e[e.ErrorChargingPayment=1]="ErrorChargingPayment",e[e.UnknownError=2]="UnknownError",e[e.NetworkError=3]="NetworkError",e[e.MissingEmailError=4]="MissingEmailError",e[e.AlreadyPurchasedError=5]="AlreadyPurchasedError",e[e.StripeTaxNotActive=6]="StripeTaxNotActive",e[e.StripeInvalidTaxOriginAddress=7]="StripeInvalidTaxOriginAddress",e[e.StripeMissingRequiredPermission=8]="StripeMissingRequiredPermission",e))(pe||{});class me extends Error{constructor(r,t,a,n,i){super(t),this.errorCode=r,this.underlyingErrorMessage=a,this.purchasesErrorCode=n,this.extra=i}getErrorCode(){var r;return((r=this.extra)==null?void 0:r.backendErrorCode)??this.purchasesErrorCode??this.errorCode}static fromPurchasesError(r,t){var n;let a;return r.errorCode===we.ProductAlreadyPurchasedError?a=5:r.errorCode===we.InvalidEmailError?a=4:r.errorCode===we.NetworkError?a=3:a=me.fromBackendErrorCode((n=r.extra)==null?void 0:n.backendErrorCode)??t,new me(a,r.message,r.underlyingErrorMessage,r.errorCode,r.extra)}static fromBackendErrorCode(r){switch(r){case Wt.BackendGatewaySetupErrorStripeTaxNotActive:return 6;case Wt.BackendGatewaySetupErrorInvalidTaxOriginAddress:return 7;case Wt.BackendGatewaySetupErrorMissingRequiredPermission:return 8;default:return null}}}class ec{constructor(r,t,a=10){C(this,"operationSessionId",null);C(this,"backend");C(this,"eventsTracker");C(this,"maxNumberAttempts");C(this,"waitMSBetweenAttempts",1e3);this.backend=r,this.eventsTracker=t,this.maxNumberAttempts=a}async checkoutStart(r,t,a,n,i,o){try{const l=this.eventsTracker.getTraceId(),s=await this.backend.postCheckoutStart(r,t,n,a,l,i,o);return this.operationSessionId=s.operation_session_id,s}catch(l){if(l instanceof be)throw me.fromPurchasesError(l,0);{const s="Unknown error starting purchase: "+String(l);throw ee.errorLog(s),new me(2,s)}}}async checkoutCalculateTax(r,t,a){const n=this.operationSessionId;if(!n)throw new me(0,"No purchase started");try{return await this.backend.postCheckoutCalculateTax(n,r,t,a)}catch(i){if(i instanceof be)throw me.fromPurchasesError(i,0);{const o="Unknown error calculating tax: "+String(i);throw ee.errorLog(o),new me(2,o)}}}async checkoutComplete(r){const t=this.operationSessionId;if(!t)throw new me(0,"No purchase started");try{return await this.backend.postCheckoutComplete(t,r)}catch(a){if(a instanceof be)throw me.fromPurchasesError(a,0);{const n="Unknown error starting purchase: "+String(a);throw ee.errorLog(n),new me(2,n)}}}async pollCurrentPurchaseForCompletion(){const r=this.operationSessionId;if(!r)throw new me(0,"No purchase in progress");return new Promise((t,a)=>{const n=(i=1)=>{if(i>this.maxNumberAttempts){this.clearPurchaseInProgress(),a(new me(2,"Max attempts reached trying to get successful purchase status"));return}this.backend.getCheckoutStatus(r).then(o=>{const l=o.operation.store_transaction_identifier,s=o.operation.product_identifier,d=o.operation.purchase_date?isNaN(Date.parse(o.operation.purchase_date))?null:new Date(o.operation.purchase_date):null;switch(o.operation.status){case Yt.Started:case Yt.InProgress:setTimeout(()=>n(i+1),this.waitMSBetweenAttempts);break;case Yt.Succeeded:if(this.clearPurchaseInProgress(),!l||!s||!d){a(new me(2,"Missing required fields in operation response."));return}t({redemptionInfo:$l(o),operationSessionId:r,storeTransactionIdentifier:l,productIdentifier:s,purchaseDate:d});return;case Yt.Failed:this.clearPurchaseInProgress(),this.handlePaymentError(o.operation.error,a)}}).catch(o=>{const l=me.fromPurchasesError(o,3);a(l)})};n()})}clearPurchaseInProgress(){this.operationSessionId=null}handlePaymentError(r,t){if(r==null){t(new me(2,"Got an error status but error field is empty."));return}switch(r.code){case vt.SetupIntentCreationFailed:t(new me(0,"Setup intent creation failed"));return;case vt.PaymentMethodCreationFailed:t(new me(0,"Payment method creation failed"));return;case vt.PaymentChargeFailed:t(new me(1,"Payment charge failed"));return;case vt.SetupIntentCompletionFailed:t(new me(0,"Setup intent completion failed"));return;case vt.AlreadyPurchased:t(new me(5,"Purchased was already completed"));return;default:t(new me(2,"Unknown error code received"));return}}}const Xe="rcb-ui-translator",kt="en",rc={"periods.week":"{{amount}} week","periods.month":"{{amount}} month","periods.year":"{{amount}} year","periods.day":"{{amount}} day","periods.weekShort":"{{amount}}wk","periods.monthShort":"{{amount}}mo","periods.yearShort":"{{amount}}yr","periods.dayShort":"{{amount}}d","periods.lifetime":"lifetime","periods.weekPlural":"{{amount}} weeks","periods.monthPlural":"{{amount}} months","periods.yearPlural":"{{amount}} years","periods.dayPlural":"{{amount}} days","periods.weekFrequency":"weekly","periods.monthFrequency":"monthly","periods.yearFrequency":"yearly","periods.dayFrequency":"daily","periods.perWeekFrequency":"per week","periods.perMonthFrequency":"per month","periods.perYearFrequency":"per year","periods.perDayFrequency":"per day","periods.unknownFrequency":"unknown","periods.weekFrequencyPlural":"every {{amount}} weeks","periods.monthFrequencyPlural":"every {{amount}} months","periods.yearFrequencyPlural":"every {{amount}} years","periods.dayFrequencyPlural":"every {{amount}} days","product_info.subscribe_to":"Subscribe to","product_info.product_title":"{{productTitle}}","product_info.product_description":"{{productDescription}}","product_info.product_price":"{{productPrice}}","product_info.free_trial_duration":"Try free for {{trialDuration}}","product_info.price_after_free_trial":"After trial ends, on {{renewalDate}}","product_info.intro_price_phase_after_trial":"Then {{introPriceDuration}} for {{introPrice}}","product_info.intro_price_phase":"First {{introPriceDuration}} for {{introPrice}}","product_info.intro_price_phase_paid_once":"paid once","product_info.price_after_intro_price":"After {{introPriceDuration}}, on {{renewalDate}}","product_info.after_trial":"after trial","product_info.after":"after","product_info.total_due_today":"Total due today","product_info.renewal_frequency":"Renews {{frequency}}","product_info.continues_until_cancelled":"Continues until cancelled","product_info.cancel_anytime":"Cancel anytime","payment_entry_page.payment_step_title":"Secure checkout by RevenueCat","payment_entry_page.trial_subscription_terms_info":"After your trial ends, you will be charged {{price}} {{perFrequency}} starting {{renewalDate}}. You can cancel any time before this date.","payment_entry_page.subscription_terms_info":"By subscribing, you agree to allow {{appName}} to charge you according to their terms until you cancel.","payment_entry_page.otp_terms_info":"By purchasing, you agree to allow {{appName}} to charge you according to their terms.","payment_entry_page.subs