@sesamy/sesamy-js 1.21.0 → 1.21.2
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/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +824 -825
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var bv=Object.defineProperty;var Sv=(e,t,r)=>t in e?bv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var fe=(e,t,r)=>Sv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Q=function(e){try{return!!e()}catch{return!0}},$v=Q,Dn=!$v(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),bl=Dn,Sl=Function.prototype,Ii=Sl.call,Iv=bl&&Sl.bind.bind(Ii,Ii),H=bl?Iv:function(e){return function(){return Ii.apply(e,arguments)}},$l=H,Pv=$l({}.toString),Tv=$l("".slice),Mn=function(e){return Tv(Pv(e),8,-1)},Ev=H,Ov=Q,kv=Mn,ca=Object,_v=Ev("".split),Il=Ov(function(){return!ca("z").propertyIsEnumerable(0)})?function(e){return kv(e)==="String"?_v(e,""):ca(e)}:ca,Fn=function(e){return e==null},Rv=Fn,Cv=TypeError,Bn=function(e){if(Rv(e))throw new Cv("Can't call method on "+e);return e},Av=Il,jv=Bn,Or=function(e){return Av(jv(e))},er=function(e){return e&&e.Math===Math&&e},K=er(typeof globalThis=="object"&&globalThis)||er(typeof window=="object"&&window)||er(typeof self=="object"&&self)||er(typeof Ur=="object"&&Ur)||er(typeof Ur=="object"&&Ur)||function(){return this}()||Function("return this")(),Pl={exports:{}},Lv=!1,os=K,Nv=Object.defineProperty,so=function(e,t){try{Nv(os,e,{value:t,configurable:!0,writable:!0})}catch{os[e]=t}return t},xv=K,Uv=so,ss="__core-js_shared__",cs=Pl.exports=xv[ss]||Uv(ss,{});(cs.versions||(cs.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var co=Pl.exports,us=co,Tl=function(e,t){return us[e]||(us[e]=t||{})},Dv=Bn,Mv=Object,zn=function(e){return Mv(Dv(e))},Fv=H,Bv=zn,zv=Fv({}.hasOwnProperty),ge=Object.hasOwn||function(t,r){return zv(Bv(t),r)},Hv=H,Kv=0,Gv=Math.random(),Wv=Hv(1 .toString),El=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Wv(++Kv+Gv,36)},Vv=K,ls=Vv.navigator,fs=ls&&ls.userAgent,kr=fs?String(fs):"",Ol=K,ua=kr,ds=Ol.process,vs=Ol.Deno,hs=ds&&ds.versions||vs&&vs.version,ps=hs&&hs.v8,Pe,Sn;ps&&(Pe=ps.split("."),Sn=Pe[0]>0&&Pe[0]<4?1:+(Pe[0]+Pe[1]));!Sn&&ua&&(Pe=ua.match(/Edge\/(\d+)/),(!Pe||Pe[1]>=74)&&(Pe=ua.match(/Chrome\/(\d+)/),Pe&&(Sn=+Pe[1])));var kl=Sn,ms=kl,Zv=Q,Jv=K,Yv=Jv.String,_l=!!Object.getOwnPropertySymbols&&!Zv(function(){var e=Symbol("symbol detection");return!Yv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ms&&ms<41}),Xv=_l,Rl=Xv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",qv=K,Qv=Tl,gs=ge,eh=El,th=_l,rh=Rl,kt=qv.Symbol,la=Qv("wks"),nh=rh?kt.for||kt:kt&&kt.withoutSetter||eh,ee=function(e){return gs(la,e)||(la[e]=th&&gs(kt,e)?kt[e]:nh("Symbol."+e)),la[e]},fa=typeof document=="object"&&document.all,W=typeof fa>"u"&&fa!==void 0?function(e){return typeof e=="function"||e===fa}:function(e){return typeof e=="function"},ah=W,ye=function(e){return typeof e=="object"?e!==null:ah(e)},ih=ye,oh=String,sh=TypeError,ke=function(e){if(ih(e))return e;throw new sh(oh(e)+" is not an object")},Cl={},ch=Q,te=!ch(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),uh=te,lh=Q,Al=uh&&lh(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),je={},fh=K,ys=ye,Pi=fh.document,dh=ys(Pi)&&ys(Pi.createElement),Hn=function(e){return dh?Pi.createElement(e):{}},vh=te,hh=Q,ph=Hn,jl=!vh&&!hh(function(){return Object.defineProperty(ph("div"),"a",{get:function(){return 7}}).a!==7}),mh=Dn,Dr=Function.prototype.call,re=mh?Dr.bind(Dr):function(){return Dr.apply(Dr,arguments)},da=K,gh=W,yh=function(e){return gh(e)?e:void 0},we=function(e,t){return arguments.length<2?yh(da[e]):da[e]&&da[e][t]},wh=H,Kn=wh({}.isPrototypeOf),bh=we,Sh=W,$h=Kn,Ih=Rl,Ph=Object,Ll=Ih?function(e){return typeof e=="symbol"}:function(e){var t=bh("Symbol");return Sh(t)&&$h(t.prototype,Ph(e))},Th=String,Gn=function(e){try{return Th(e)}catch{return"Object"}},Eh=W,Oh=Gn,kh=TypeError,_e=function(e){if(Eh(e))return e;throw new kh(Oh(e)+" is not a function")},_h=_e,Rh=Fn,uo=function(e,t){var r=e[t];return Rh(r)?void 0:_h(r)},va=re,ha=W,pa=ye,Ch=TypeError,Ah=function(e,t){var r,n;if(t==="string"&&ha(r=e.toString)&&!pa(n=va(r,e))||ha(r=e.valueOf)&&!pa(n=va(r,e))||t!=="string"&&ha(r=e.toString)&&!pa(n=va(r,e)))return n;throw new Ch("Can't convert object to primitive value")},jh=re,ws=ye,bs=Ll,Lh=uo,Nh=Ah,xh=ee,Uh=TypeError,Dh=xh("toPrimitive"),Mh=function(e,t){if(!ws(e)||bs(e))return e;var r=Lh(e,Dh),n;if(r){if(t===void 0&&(t="default"),n=jh(r,e,t),!ws(n)||bs(n))return n;throw new Uh("Can't convert object to primitive value")}return t===void 0&&(t="number"),Nh(e,t)},Fh=Mh,Bh=Ll,Nl=function(e){var t=Fh(e,"string");return Bh(t)?t:t+""},zh=te,Hh=jl,Kh=Al,Mr=ke,Ss=Nl,Gh=TypeError,ma=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,ga="enumerable",ya="configurable",wa="writable";je.f=zh?Kh?function(t,r,n){if(Mr(t),r=Ss(r),Mr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&wa in n&&!n[wa]){var a=Wh(t,r);a&&a[wa]&&(t[r]=n.value,n={configurable:ya in n?n[ya]:a[ya],enumerable:ga in n?n[ga]:a[ga],writable:!1})}return ma(t,r,n)}:ma:function(t,r,n){if(Mr(t),r=Ss(r),Mr(n),Hh)try{return ma(t,r,n)}catch{}if("get"in n||"set"in n)throw new Gh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Vh=Math.ceil,Zh=Math.floor,Jh=Math.trunc||function(t){var r=+t;return(r>0?Zh:Vh)(r)},Yh=Jh,lo=function(e){var t=+e;return t!==t||t===0?0:Yh(t)},Xh=lo,qh=Math.max,Qh=Math.min,xl=function(e,t){var r=Xh(e);return r<0?qh(r+t,0):Qh(r,t)},ep=lo,tp=Math.min,rp=function(e){var t=ep(e);return t>0?tp(t,9007199254740991):0},np=rp,fo=function(e){return np(e.length)},ap=Or,ip=xl,op=fo,$s=function(e){return function(t,r,n){var a=ap(t),i=op(a);if(i===0)return!e&&-1;var o=ip(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},sp={includes:$s(!0),indexOf:$s(!1)},vo={},cp=H,ba=ge,up=Or,lp=sp.indexOf,fp=vo,Is=cp([].push),Ul=function(e,t){var r=up(e),n=0,a=[],i;for(i in r)!ba(fp,i)&&ba(r,i)&&Is(a,i);for(;t.length>n;)ba(r,i=t[n++])&&(~lp(a,i)||Is(a,i));return a},ho=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dp=Ul,vp=ho,Dl=Object.keys||function(t){return dp(t,vp)},hp=te,pp=Al,mp=je,gp=ke,yp=Or,wp=Dl;Cl.f=hp&&!pp?Object.defineProperties:function(t,r){gp(t);for(var n=yp(r),a=wp(r),i=a.length,o=0,s;i>o;)mp.f(t,s=a[o++],n[s]);return t};var bp=we,Ml=bp("document","documentElement"),Sp=Tl,$p=El,Ps=Sp("keys"),po=function(e){return Ps[e]||(Ps[e]=$p(e))},Ip=ke,Pp=Cl,Ts=ho,Tp=vo,Ep=Ml,Op=Hn,kp=po,Es=">",Os="<",Ti="prototype",Ei="script",Fl=kp("IE_PROTO"),Sa=function(){},Bl=function(e){return Os+Ei+Es+e+Os+"/"+Ei+Es},ks=function(e){e.write(Bl("")),e.close();var t=e.parentWindow.Object;return e=null,t},_p=function(){var e=Op("iframe"),t="java"+Ei+":",r;return e.style.display="none",Ep.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Bl("document.F=Object")),r.close(),r.F},Fr,dn=function(){try{Fr=new ActiveXObject("htmlfile")}catch{}dn=typeof document<"u"?document.domain&&Fr?ks(Fr):_p():ks(Fr);for(var e=Ts.length;e--;)delete dn[Ti][Ts[e]];return dn()};Tp[Fl]=!0;var Wn=Object.create||function(t,r){var n;return t!==null?(Sa[Ti]=Ip(t),n=new Sa,Sa[Ti]=null,n[Fl]=t):n=dn(),r===void 0?n:Pp.f(n,r)},Rp=ee,Cp=Wn,Ap=je.f,Oi=Rp("unscopables"),ki=Array.prototype;ki[Oi]===void 0&&Ap(ki,Oi,{configurable:!0,value:Cp(null)});var jp=function(e){ki[Oi][e]=!0},_r={},Lp=K,Np=W,_s=Lp.WeakMap,xp=Np(_s)&&/native code/.test(String(_s)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Up=te,Dp=je,Mp=vt,ht=Up?function(e,t,r){return Dp.f(e,t,Mp(1,r))}:function(e,t,r){return e[t]=r,e},Fp=xp,zl=K,Bp=ye,zp=ht,$a=ge,Ia=co,Hp=po,Kp=vo,Rs="Object already initialized",_i=zl.TypeError,Gp=zl.WeakMap,$n,Pr,In,Wp=function(e){return In(e)?Pr(e):$n(e,{})},Vp=function(e){return function(t){var r;if(!Bp(t)||(r=Pr(t)).type!==e)throw new _i("Incompatible receiver, "+e+" required");return r}};if(Fp||Ia.state){var Re=Ia.state||(Ia.state=new Gp);Re.get=Re.get,Re.has=Re.has,Re.set=Re.set,$n=function(e,t){if(Re.has(e))throw new _i(Rs);return t.facade=e,Re.set(e,t),t},Pr=function(e){return Re.get(e)||{}},In=function(e){return Re.has(e)}}else{var yt=Hp("state");Kp[yt]=!0,$n=function(e,t){if($a(e,yt))throw new _i(Rs);return t.facade=e,zp(e,yt,t),t},Pr=function(e){return $a(e,yt)?e[yt]:{}},In=function(e){return $a(e,yt)}}var Vt={set:$n,get:Pr,has:In,enforce:Wp,getterFor:Vp},mo={},go={},Hl={}.propertyIsEnumerable,Kl=Object.getOwnPropertyDescriptor,Zp=Kl&&!Hl.call({1:2},1);go.f=Zp?function(t){var r=Kl(this,t);return!!r&&r.enumerable}:Hl;var Jp=te,Yp=re,Xp=go,qp=vt,Qp=Or,em=Nl,tm=ge,rm=jl,Cs=Object.getOwnPropertyDescriptor;mo.f=Jp?Cs:function(t,r){if(t=Qp(t),r=em(r),rm)try{return Cs(t,r)}catch{}if(tm(t,r))return qp(!Yp(Xp.f,t,r),t[r])};var Gl={exports:{}},Ri=te,nm=ge,Wl=Function.prototype,am=Ri&&Object.getOwnPropertyDescriptor,yo=nm(Wl,"name"),im=yo&&(function(){}).name==="something",om=yo&&(!Ri||Ri&&am(Wl,"name").configurable),Vl={EXISTS:yo,PROPER:im,CONFIGURABLE:om},sm=H,cm=W,Ci=co,um=sm(Function.toString);cm(Ci.inspectSource)||(Ci.inspectSource=function(e){return um(e)});var wo=Ci.inspectSource,bo=H,lm=Q,fm=W,Br=ge,Ai=te,dm=Vl.CONFIGURABLE,vm=wo,Zl=Vt,hm=Zl.enforce,pm=Zl.get,As=String,vn=Object.defineProperty,mm=bo("".slice),gm=bo("".replace),ym=bo([].join),wm=Ai&&!lm(function(){return vn(function(){},"length",{value:8}).length!==8}),bm=String(String).split("String"),Sm=Gl.exports=function(e,t,r){mm(As(t),0,7)==="Symbol("&&(t="["+gm(As(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Br(e,"name")||dm&&e.name!==t)&&(Ai?vn(e,"name",{value:t,configurable:!0}):e.name=t),wm&&r&&Br(r,"arity")&&e.length!==r.arity&&vn(e,"length",{value:r.arity});try{r&&Br(r,"constructor")&&r.constructor?Ai&&vn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=hm(e);return Br(n,"source")||(n.source=ym(bm,typeof t=="string"?t:"")),e};Function.prototype.toString=Sm(function(){return fm(this)&&pm(this).source||vm(this)},"toString");var Jl=Gl.exports,$m=W,Im=je,Pm=Jl,Tm=so,be=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if($m(r)&&Pm(r,i,n),n.global)a?e[t]=r:Tm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Im.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Yl={},Em=Ul,Om=ho,km=Om.concat("length","prototype");Yl.f=Object.getOwnPropertyNames||function(t){return Em(t,km)};var So={};So.f=Object.getOwnPropertySymbols;var _m=we,Rm=H,Cm=Yl,Am=So,jm=ke,Lm=Rm([].concat),Nm=_m("Reflect","ownKeys")||function(t){var r=Cm.f(jm(t)),n=Am.f;return n?Lm(r,n(t)):r},js=ge,xm=Nm,Um=mo,Dm=je,Xl=function(e,t,r){for(var n=xm(t),a=Dm.f,i=Um.f,o=0;o<n.length;o++){var s=n[o];!js(e,s)&&!(r&&js(r,s))&&a(e,s,i(t,s))}},Mm=Q,Fm=W,Bm=/#|\.prototype\./,Rr=function(e,t){var r=Hm[zm(e)];return r===Gm?!0:r===Km?!1:Fm(t)?Mm(t):!!t},zm=Rr.normalize=function(e){return String(e).replace(Bm,".").toLowerCase()},Hm=Rr.data={},Km=Rr.NATIVE="N",Gm=Rr.POLYFILL="P",ql=Rr,zr=K,Wm=mo.f,Vm=ht,Zm=be,Jm=so,Ym=Xl,Xm=ql,Y=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=zr:a?o=zr[r]||Jm(r,{}):o=zr[r]&&zr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Wm(o,s),u=l&&l.value):u=o[s],i=Xm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Ym(f,u)}(e.sham||u&&u.sham)&&Vm(f,"sham",!0),Zm(o,s,f,e)}},qm=Q,Qm=!qm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),eg=ge,tg=W,rg=zn,ng=po,ag=Qm,Ls=ng("IE_PROTO"),ji=Object,ig=ji.prototype,$o=ag?ji.getPrototypeOf:function(e){var t=rg(e);if(eg(t,Ls))return t[Ls];var r=t.constructor;return tg(r)&&t instanceof r?r.prototype:t instanceof ji?ig:null},og=Q,sg=W,cg=ye,Ns=$o,ug=be,lg=ee,Li=lg("iterator"),Ql=!1,ut,Pa,Ta;[].keys&&(Ta=[].keys(),"next"in Ta?(Pa=Ns(Ns(Ta)),Pa!==Object.prototype&&(ut=Pa)):Ql=!0);var fg=!cg(ut)||og(function(){var e={};return ut[Li].call(e)!==e});fg&&(ut={});sg(ut[Li])||ug(ut,Li,function(){return this});var ef={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Ql},dg=je.f,vg=ge,hg=ee,xs=hg("toStringTag"),Zt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!vg(e,xs)&&dg(e,xs,{configurable:!0,value:t})},pg=ef.IteratorPrototype,mg=Wn,gg=vt,yg=Zt,wg=_r,bg=function(){return this},tf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=mg(pg,{next:gg(+!n,r)}),yg(e,a,!1),wg[a]=bg,e},Sg=H,$g=_e,Ig=function(e,t,r){try{return Sg($g(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Pg=ye,Tg=function(e){return Pg(e)||e===null},Eg=Tg,Og=String,kg=TypeError,_g=function(e){if(Eg(e))return e;throw new kg("Can't set "+Og(e)+" as a prototype")},Rg=Ig,Cg=ye,Ag=Bn,jg=_g,Io=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Rg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Ag(a),jg(i),Cg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Lg=Y,Ng=re,rf=Vl,xg=W,Ug=tf,Us=$o,Ds=Io,Dg=Zt,Mg=ht,Ea=be,Fg=ee,Bg=_r,nf=ef,zg=rf.PROPER,Hg=rf.CONFIGURABLE,Ms=nf.IteratorPrototype,Hr=nf.BUGGY_SAFARI_ITERATORS,tr=Fg("iterator"),Fs="keys",rr="values",Bs="entries",Kg=function(){return this},af=function(e,t,r,n,a,i,o){Ug(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Hr&&T&&T in l)return l[T];switch(T){case Fs:return function(){return new r(this,T)};case rr:return function(){return new r(this,T)};case Bs:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[tr]||l["@@iterator"]||a&&l[a],d=!Hr&&c||s(a),v=t==="Array"&&l.entries||c,p,w,g;if(v&&(p=Us(v.call(new e)),p!==Object.prototype&&p.next&&(Us(p)!==Ms&&(Ds?Ds(p,Ms):xg(p[tr])||Ea(p,tr,Kg)),Dg(p,u,!0))),zg&&a===rr&&c&&c.name!==rr&&(Hg?Mg(l,"name",rr):(f=!0,d=function(){return Ng(c,this)})),a)if(w={values:s(rr),keys:i?d:s(Fs),entries:s(Bs)},o)for(g in w)(Hr||f||!(g in l))&&Ea(l,g,w[g]);else Lg({target:t,proto:!0,forced:Hr||f},w);return l[tr]!==d&&Ea(l,tr,d,{name:a}),Bg[t]=d,w},Po=function(e,t){return{value:e,done:t}},Gg=Or,To=jp,zs=_r,of=Vt,Wg=je.f,Vg=af,Kr=Po,Zg=te,sf="Array Iterator",Jg=of.set,Yg=of.getterFor(sf),Xg=Vg(Array,"Array",function(e,t){Jg(this,{type:sf,target:Gg(e),index:0,kind:t})},function(){var e=Yg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Kr(void 0,!0);switch(e.kind){case"keys":return Kr(r,!1);case"values":return Kr(t[r],!1)}return Kr([r,t[r]],!1)},"values"),Hs=zs.Arguments=zs.Array;To("keys");To("values");To("entries");if(Zg&&Hs.name!=="values")try{Wg(Hs,"name",{value:"values"})}catch{}var qg=Y,Qg=H,ey=xl,ty=RangeError,Ks=String.fromCharCode,Gs=String.fromCodePoint,ry=Qg([].join),ny=!!Gs&&Gs.length!==1;qg({target:"String",stat:!0,arity:1,forced:ny},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],ey(i,1114111)!==i)throw new ty(i+" is not a valid code point");r[a]=i<65536?Ks(i):Ks(((i-=65536)>>10)+55296,i%1024+56320)}return ry(r,"")}});var Ws=K,ay=te,iy=Object.getOwnPropertyDescriptor,cf=function(e){if(!ay)return Ws[e];var t=iy(Ws,e);return t&&t.value},oy=Q,sy=ee,cy=te,Vs=Lv,uy=sy("iterator"),Vn=!oy(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),Vs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Vs||!cy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[uy]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Zs=Jl,ly=je,Zn=function(e,t,r){return r.get&&Zs(r.get,t,{getter:!0}),r.set&&Zs(r.set,t,{setter:!0}),ly.f(e,t,r)},fy=be,dy=function(e,t,r){for(var n in t)fy(e,n,t[n],r);return e},vy=Kn,hy=TypeError,Eo=function(e,t){if(vy(t,e))return e;throw new hy("Incorrect invocation")},py=Mn,my=H,gy=function(e){if(py(e)==="Function")return my(e)},Js=gy,yy=_e,wy=Dn,by=Js(Js.bind),Jt=function(e,t){return yy(e),t===void 0?e:wy?by(e,t):function(){return e.apply(t,arguments)}},Sy=ee,$y=Sy("toStringTag"),uf={};uf[$y]="z";var Oo=String(uf)==="[object z]",Iy=Oo,Py=W,hn=Mn,Ty=ee,Ey=Ty("toStringTag"),Oy=Object,ky=hn(function(){return arguments}())==="Arguments",_y=function(e,t){try{return e[t]}catch{}},Cr=Iy?hn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=_y(t=Oy(e),Ey))=="string"?r:ky?hn(t):(n=hn(t))==="Object"&&Py(t.callee)?"Arguments":n},Ry=Cr,Cy=String,ze=function(e){if(Ry(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Cy(e)},Ay=Cr,Ys=uo,jy=Fn,Ly=_r,Ny=ee,xy=Ny("iterator"),Jn=function(e){if(!jy(e))return Ys(e,xy)||Ys(e,"@@iterator")||Ly[Ay(e)]},Uy=re,Dy=_e,My=ke,Fy=Gn,By=Jn,zy=TypeError,ko=function(e,t){var r=arguments.length<2?By(e):t;if(Dy(r))return My(Uy(r,e));throw new zy(Fy(e)+" is not iterable")},Hy=TypeError,pt=function(e,t){if(e<t)throw new Hy("Not enough arguments");return e},Ky=H,Yn=Ky([].slice),Xs=Yn,Gy=Math.floor,Ni=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=Gy(r/2),s=Ni(Xs(e,0,o),t),u=Ni(Xs(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Wy=Ni,xi=Y,lf=K,_o=cf,Vy=we,Gr=re,Ee=H,hr=te,ff=Vn,df=be,Zy=Zn,Jy=dy,Yy=Zt,Xy=tf,Ro=Vt,vf=Eo,Oa=W,qy=ge,Qy=Jt,ew=Cr,tw=ke,hf=ye,ae=ze,rw=Wn,qs=vt,Qs=ko,nw=Jn,Wr=Po,wt=pt,aw=ee,iw=Wy,ow=aw("iterator"),Yt="URLSearchParams",pf=Yt+"Iterator",mf=Ro.set,pe=Ro.getterFor(Yt),sw=Ro.getterFor(pf),ec=_o("fetch"),Pn=_o("Request"),pr=_o("Headers"),ka=Pn&&Pn.prototype,tc=pr&&pr.prototype,cw=lf.TypeError,uw=lf.encodeURIComponent,lw=String.fromCharCode,fw=Vy("String","fromCodePoint"),dw=parseInt,pn=Ee("".charAt),rc=Ee([].join),We=Ee([].push),gf=Ee("".replace),vw=Ee([].shift),nc=Ee([].splice),ac=Ee("".split),yf=Ee("".slice),hw=Ee(/./.exec),pw=/\+/g,_a="�",mw=/^[0-9a-f]+$/i,ic=function(e,t){var r=yf(e,t,t+2);return hw(mw,r)?dw(r,16):NaN},gw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},yw=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},oc=function(e){e=gf(e,pw," ");for(var t=e.length,r="",n=0;n<t;){var a=pn(e,n);if(a==="%"){if(pn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=ic(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=gw(i);if(o===0)a=lw(i);else{if(o===1||o>4){r+=_a,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||pn(e,n)!=="%"));){var f=ic(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;We(s,f),n+=2,u++}if(s.length!==o){r+=_a;continue}var l=yw(s);l===null?r+=_a:a=fw(l)}}r+=a,n++}return r},ww=/[!'()~]|%20/g,bw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Sw=function(e){return bw[e]},sc=function(e){return gf(uw(e),ww,Sw)},Ra=Xy(function(t,r){mf(this,{type:pf,target:pe(t).entries,index:0,kind:r})},Yt,function(){var t=sw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Wr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Wr(a.key,!1);case"values":return Wr(a.value,!1)}return Wr([a.key,a.value],!1)},!0),wf=function(e){this.entries=[],this.url=null,e!==void 0&&(hf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?pn(e,0)==="?"?yf(e,1):e:ae(e)))};wf.prototype={type:Yt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=nw(e),n,a,i,o,s,u,f;if(r)for(n=Qs(e,r),a=n.next;!(i=Gr(a,n)).done;){if(o=Qs(tw(i.value)),s=o.next,(u=Gr(s,o)).done||(f=Gr(s,o)).done||!Gr(s,o).done)throw new cw("Expected sequence with length 2");We(t,{key:ae(u.value),value:ae(f.value)})}else for(var l in e)qy(e,l)&&We(t,{key:l,value:ae(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=ac(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=ac(a,"="),We(t,{key:oc(vw(i)),value:oc(rc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],We(t,sc(n.key)+"="+sc(n.value));return rc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Xn=function(){vf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=mf(this,new wf(t));hr||(this.size=r.entries.length)},Ut=Xn.prototype;Jy(Ut,{append:function(t,r){var n=pe(this);wt(arguments.length,2),We(n.entries,{key:ae(t),value:ae(r)}),hr||this.length++,n.updateURL()},delete:function(e){for(var t=pe(this),r=wt(arguments.length,1),n=t.entries,a=ae(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ae(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(nc(n,s,1),o!==void 0)break}else s++}hr||(this.size=n.length),t.updateURL()},get:function(t){var r=pe(this).entries;wt(arguments.length,1);for(var n=ae(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=pe(this).entries;wt(arguments.length,1);for(var n=ae(t),a=[],i=0;i<r.length;i++)r[i].key===n&&We(a,r[i].value);return a},has:function(t){for(var r=pe(this).entries,n=wt(arguments.length,1),a=ae(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ae(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=pe(this);wt(arguments.length,1);for(var a=n.entries,i=!1,o=ae(t),s=ae(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?nc(a,u--,1):(i=!0,f.value=s));i||We(a,{key:o,value:s}),hr||(this.size=a.length),n.updateURL()},sort:function(){var t=pe(this);iw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=pe(this).entries,n=Qy(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new Ra(this,"keys")},values:function(){return new Ra(this,"values")},entries:function(){return new Ra(this,"entries")}},{enumerable:!0});df(Ut,ow,Ut.entries,{name:"entries"});df(Ut,"toString",function(){return pe(this).serialize()},{enumerable:!0});hr&&Zy(Ut,"size",{get:function(){return pe(this).entries.length},configurable:!0,enumerable:!0});Yy(Xn,Yt);xi({global:!0,constructor:!0,forced:!ff},{URLSearchParams:Xn});if(!ff&&Oa(pr)){var $w=Ee(tc.has),Iw=Ee(tc.set),cc=function(e){if(hf(e)){var t=e.body,r;if(ew(t)===Yt)return r=e.headers?new pr(e.headers):new pr,$w(r,"content-type")||Iw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),rw(e,{body:qs(0,ae(t)),headers:qs(0,r)})}return e};if(Oa(ec)&&xi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return ec(t,arguments.length>1?cc(arguments[1]):{})}}),Oa(Pn)){var Ca=function(t){return vf(this,ka),new Pn(t,arguments.length>1?cc(arguments[1]):{})};ka.constructor=Ca,Ca.prototype=ka,xi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ca})}}var Pw={URLSearchParams:Xn,getState:pe},Tw=be,qn=H,uc=ze,Ew=pt,bf=URLSearchParams,Qn=bf.prototype,Ow=qn(Qn.append),lc=qn(Qn.delete),kw=qn(Qn.forEach),_w=qn([].push),Co=new bf("a=1&a=2&b=3");Co.delete("a",1);Co.delete("b",void 0);Co+""!="a=2"&&Tw(Qn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return lc(this,e);var n=[];kw(this,function(c,d){_w(n,{key:d,value:c})}),Ew(t,1);for(var a=uc(e),i=uc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,lc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Ow(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Rw=be,Sf=H,Cw=ze,Aw=pt,$f=URLSearchParams,Ao=$f.prototype,jw=Sf(Ao.getAll),Lw=Sf(Ao.has),fc=new $f("a=1");(fc.has("a",2)||!fc.has("a",void 0))&&Rw(Ao,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Lw(this,t);var a=jw(this,t);Aw(r,1);for(var i=Cw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Nw=te,xw=H,Uw=Zn,Ui=URLSearchParams.prototype,Dw=xw(Ui.forEach);Nw&&!("size"in Ui)&&Uw(Ui,"size",{get:function(){var t=0;return Dw(this,function(){t++}),t},configurable:!0,enumerable:!0});var Mw=K,jo=Mw,Fw=jo;Fw.URLSearchParams;var Lo=H,Bw=lo,zw=ze,Hw=Bn,Kw=Lo("".charAt),dc=Lo("".charCodeAt),Gw=Lo("".slice),vc=function(e){return function(t,r){var n=zw(Hw(t)),a=Bw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=dc(n,a),o<55296||o>56319||a+1===i||(s=dc(n,a+1))<56320||s>57343?e?Kw(n,a):o:e?Gw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},If={codeAt:vc(!1),charAt:vc(!0)},Ww=If.charAt,Vw=ze,Pf=Vt,Zw=af,hc=Po,Tf="String Iterator",Jw=Pf.set,Yw=Pf.getterFor(Tf);Zw(String,"String",function(e){Jw(this,{type:Tf,string:Vw(e),index:0})},function(){var t=Yw(this),r=t.string,n=t.index,a;return n>=r.length?hc(void 0,!0):(a=Ww(r,n),t.index+=a.length,hc(a,!1))});var pc=te,Xw=H,qw=re,Qw=Q,Aa=Dl,eb=So,tb=go,rb=zn,nb=Il,bt=Object.assign,mc=Object.defineProperty,ab=Xw([].concat),ib=!bt||Qw(function(){if(pc&&bt({b:1},bt(mc({},"a",{enumerable:!0,get:function(){mc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),bt({},e)[r]!==7||Aa(bt({},t)).join("")!==n})?function(t,r){for(var n=rb(t),a=arguments.length,i=1,o=eb.f,s=tb.f;a>i;)for(var u=nb(arguments[i++]),f=o?ab(Aa(u),o(u)):Aa(u),l=f.length,c=0,d;l>c;)d=f[c++],(!pc||qw(s,u,d))&&(n[d]=u[d]);return n}:bt,ob=re,gc=ke,sb=uo,Ef=function(e,t,r){var n,a;gc(e);try{if(n=sb(e,"return"),!n){if(t==="throw")throw r;return r}n=ob(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return gc(n),r},cb=ke,ub=Ef,lb=function(e,t,r,n){try{return n?t(cb(r)[0],r[1]):t(r)}catch(a){ub(e,"throw",a)}},fb=ee,db=_r,vb=fb("iterator"),hb=Array.prototype,Of=function(e){return e!==void 0&&(db.Array===e||hb[vb]===e)},pb=H,mb=Q,kf=W,gb=Cr,yb=we,wb=wo,_f=function(){},Rf=yb("Reflect","construct"),No=/^\s*(?:class|function)\b/,bb=pb(No.exec),Sb=!No.test(_f),nr=function(t){if(!kf(t))return!1;try{return Rf(_f,[],t),!0}catch{return!1}},Cf=function(t){if(!kf(t))return!1;switch(gb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sb||!!bb(No,wb(t))}catch{return!0}};Cf.sham=!0;var Af=!Rf||mb(function(){var e;return nr(nr.call)||!nr(Object)||!nr(function(){e=!0})||e})?Cf:nr,$b=te,Ib=je,Pb=vt,Tb=function(e,t,r){$b?Ib.f(e,t,Pb(0,r)):e[t]=r},Eb=Jt,Ob=re,kb=zn,_b=lb,Rb=Of,Cb=Af,Ab=fo,yc=Tb,jb=ko,Lb=Jn,wc=Array,Nb=function(t){var r=kb(t),n=Cb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Eb(i,a>2?arguments[2]:void 0));var s=Lb(r),u=0,f,l,c,d,v,p;if(s&&!(this===wc&&Rb(s)))for(l=n?new this:[],d=jb(r,s),v=d.next;!(c=Ob(v,d)).done;u++)p=o?_b(d,i,[c.value,u],!0):c.value,yc(l,u,p);else for(f=Ab(r),l=n?new this(f):wc(f);f>u;u++)p=o?i(r[u],u):r[u],yc(l,u,p);return l.length=u,l},mt=H,ja=2147483647,mr=36,jf=1,Di=26,xb=38,Ub=700,Db=72,Mb=128,Fb="-",Bb=/[^\0-\u007E]/,Lf=/[.\u3002\uFF0E\uFF61]/g,bc="Overflow: input needs wider integers to process",La=mr-jf,Sc=RangeError,zb=mt(Lf.exec),_t=Math.floor,Na=String.fromCharCode,$c=mt("".charCodeAt),Nf=mt([].join),Ve=mt([].push),Hb=mt("".replace),Kb=mt("".split),Gb=mt("".toLowerCase),Wb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=$c(e,r++);if(a>=55296&&a<=56319&&r<n){var i=$c(e,r++);(i&64512)===56320?Ve(t,((a&1023)<<10)+(i&1023)+65536):(Ve(t,a),r--)}else Ve(t,a)}return t},Ic=function(e){return e+22+75*(e<26)},Vb=function(e,t,r){var n=0;for(e=r?_t(e/Ub):e>>1,e+=_t(e/t);e>La*Di>>1;)e=_t(e/La),n+=mr;return _t(n+(La+1)*e/(e+xb))},Zb=function(e){var t=[];e=Wb(e);var r=e.length,n=Mb,a=0,i=Db,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&Ve(t,Na(s));var u=t.length,f=u;for(u&&Ve(t,Fb);f<r;){var l=ja;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>_t((ja-a)/c))throw new Sc(bc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>ja)throw new Sc(bc);if(s===n){for(var d=a,v=mr;;){var p=v<=i?jf:v>=i+Di?Di:v-i;if(d<p)break;var w=d-p,g=mr-p;Ve(t,Na(Ic(p+w%g))),d=_t(w/g),v+=mr}Ve(t,Na(Ic(d))),i=Vb(a,c,f===u),a=0,f++}}a++,n++}return Nf(t,"")},Jb=function(e){var t=[],r=Kb(Hb(Gb(e),Lf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Ve(t,zb(Bb,a)?"xn--"+Zb(a):a);return Nf(t,".")},Yb=Y,xo=te,Xb=Vn,Uo=K,Pc=Jt,Se=H,Tn=be,de=Zn,qb=Eo,Mi=ge,Do=ib,St=Nb,$e=Yn,Qb=If.codeAt,eS=Jb,Ue=ze,tS=Zt,rS=pt,xf=Pw,Uf=Vt,nS=Uf.set,En=Uf.getterFor("URL"),aS=xf.URLSearchParams,iS=xf.getState,ar=Uo.URL,Fi=Uo.TypeError,On=Uo.parseInt,oS=Math.floor,Tc=Math.pow,me=Se("".charAt),Te=Se(/./.exec),lr=Se([].join),sS=Se(1 .toString),cS=Se([].pop),Tt=Se([].push),xa=Se("".replace),uS=Se([].shift),lS=Se("".split),gr=Se("".slice),kn=Se("".toLowerCase),fS=Se([].unshift),dS="Invalid authority",Ua="Invalid scheme",qe="Invalid host",Ec="Invalid port",Df=/[a-z]/i,vS=/[\d+-.a-z]/i,Bi=/\d/,hS=/^0x/i,pS=/^[0-7]+$/,mS=/^\d+$/,Mf=/^[\da-f]+$/i,gS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yS=/[\0\t\n\r #/:<>?@[\\\]^|]/,wS=/^[\u0000-\u0020]+/,bS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,SS=/[\t\n\r]/g,ve,$S=function(e){var t=lS(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&me(i,0)==="0"&&(o=Te(hS,i)?16:8,i=gr(i,o===8?1:2)),i==="")s=0;else{if(!Te(o===10?mS:o===8?pS:Mf,i))return e;s=On(i,o)}Tt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Tc(256,5-r))return null}else if(s>255)return null;for(u=cS(n),a=0;a<n.length;a++)u+=n[a]*Tc(256,3-a);return u},IS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return me(e,a)};if(d()===":"){if(me(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Te(Mf,d());)i=i*16+On(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Te(Bi,d()))return;for(;Te(Bi,d());){if(f=On(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},PS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},ir=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)fS(t,e%256),e=oS(e/256);return lr(t,".")}if(typeof e=="object"){for(t="",n=PS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=sS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},mn={},Ff=Do({},mn,{" ":1,'"':1,"<":1,">":1,"`":1}),Bf=Do({},Ff,{"#":1,"?":1,"{":1,"}":1}),Da=Do({},Bf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),He=function(e,t){var r=Qb(e,0);return r>32&&r<127&&!Mi(t,e)?e:encodeURIComponent(e)},Vr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},fr=function(e,t){var r;return e.length===2&&Te(Df,me(e,0))&&((r=me(e,1))===":"||!t&&r==="|")},Oc=function(e){var t;return e.length>1&&fr(gr(e,0,2))&&(e.length===2||(t=me(e,2))==="/"||t==="\\"||t==="?"||t==="#")},TS=function(e){return e==="."||kn(e)==="%2e"},ES=function(e){return e=kn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ma={},kc={},Fa={},_c={},Rc={},Ba={},Cc={},Ac={},Zr={},Jr={},za={},Ha={},Ka={},Ga={},jc={},Wa={},$t={},Ce={},Lc={},Qe={},xe={},Mo=function(e,t,r){var n=Ue(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Fi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Mo(r,!0)),i=this.parse(n,null,a),i)throw new Fi(i);o=iS(new aS),o.bindURL(this),this.searchParams=o}};Mo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ma,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ue(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=xa(e,wS,""),e=xa(e,bS,"$1")),e=xa(e,SS,""),l=St(e);i<=l.length;){switch(c=l[i],a){case Ma:if(c&&Te(Df,c))o+=kn(c),a=kc;else{if(t)return Ua;a=Fa;continue}break;case kc:if(c&&(Te(vS,c)||c==="+"||c==="-"||c==="."))o+=kn(c);else if(c===":"){if(t&&(n.isSpecial()!==Mi(Vr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Vr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ga:n.isSpecial()&&r&&r.scheme===n.scheme?a=_c:n.isSpecial()?a=Ac:l[i+1]==="/"?(a=Rc,i++):(n.cannotBeABaseURL=!0,Tt(n.path,""),a=Lc)}else{if(t)return Ua;o="",a=Fa,i=0;continue}break;case Fa:if(!r||r.cannotBeABaseURL&&c!=="#")return Ua;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=$e(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=xe;break}a=r.scheme==="file"?Ga:Ba;continue;case _c:if(c==="/"&&l[i+1]==="/")a=Zr,i++;else{a=Ba;continue}break;case Rc:if(c==="/"){a=Jr;break}else{a=Ce;continue}case Ba:if(n.scheme=r.scheme,c===ve)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Cc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.query="",a=Qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.query=r.query,n.fragment="",a=xe;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.path.length--,a=Ce;continue}break;case Cc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Zr;else if(c==="/")a=Jr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ce;continue}break;case Ac:if(a=Zr,c!=="/"||me(o,i+1)!=="/")continue;i++;break;case Zr:if(c!=="/"&&c!=="\\"){a=Jr;continue}break;case Jr:if(c==="@"){s&&(o="%40"+o),s=!0,d=St(o);for(var p=0;p<d.length;p++){var w=d[p];if(w===":"&&!f){f=!0;continue}var g=He(w,Da);f?n.password+=g:n.username+=g}o=""}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return dS;i-=St(o).length+1,o="",a=za}else o+=c;break;case za:case Ha:if(t&&n.scheme==="file"){a=Wa;continue}else if(c===":"&&!u){if(o==="")return qe;if(v=n.parseHost(o),v)return v;if(o="",a=Ka,t===Ha)return}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return qe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=$t,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ka:if(Te(Bi,c))o+=c;else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=On(o,10);if(T>65535)return Ec;n.port=n.isSpecial()&&T===Vr[n.scheme]?null:T,o=""}if(t)return;a=$t;continue}else return Ec;break;case Ga:if(n.scheme="file",c==="/"||c==="\\")a=jc;else if(r&&r.scheme==="file")switch(c){case ve:n.host=r.host,n.path=$e(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=$e(r.path),n.query="",a=Qe;break;case"#":n.host=r.host,n.path=$e(r.path),n.query=r.query,n.fragment="",a=xe;break;default:Oc(lr($e(l,i),""))||(n.host=r.host,n.path=$e(r.path),n.shortenPath()),a=Ce;continue}else{a=Ce;continue}break;case jc:if(c==="/"||c==="\\"){a=Wa;break}r&&r.scheme==="file"&&!Oc(lr($e(l,i),""))&&(fr(r.path[0],!0)?Tt(n.path,r.path[0]):n.host=r.host),a=Ce;continue;case Wa:if(c===ve||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&fr(o))a=Ce;else if(o===""){if(n.host="",t)return;a=$t}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=$t}continue}else o+=c;break;case $t:if(n.isSpecial()){if(a=Ce,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=Qe;else if(!t&&c==="#")n.fragment="",a=xe;else if(c!==ve&&(a=Ce,c!=="/"))continue;break;case Ce:if(c===ve||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(ES(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,"")):TS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,""):(n.scheme==="file"&&!n.path.length&&fr(o)&&(n.host&&(n.host=""),o=me(o,0)+":"),Tt(n.path,o)),o="",n.scheme==="file"&&(c===ve||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)uS(n.path);c==="?"?(n.query="",a=Qe):c==="#"&&(n.fragment="",a=xe)}else o+=He(c,Bf);break;case Lc:c==="?"?(n.query="",a=Qe):c==="#"?(n.fragment="",a=xe):c!==ve&&(n.path[0]+=He(c,mn));break;case Qe:!t&&c==="#"?(n.fragment="",a=xe):c!==ve&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=He(c,mn));break;case xe:c!==ve&&(n.fragment+=He(c,Ff));break}i++}},parseHost:function(e){var t,r,n;if(me(e,0)==="["){if(me(e,e.length-1)!=="]"||(t=IS(gr(e,1,-1)),!t))return qe;this.host=t}else if(this.isSpecial()){if(e=eS(e),Te(gS,e)||(t=$S(e),t===null))return qe;this.host=t}else{if(Te(yS,e))return qe;for(t="",r=St(e),n=0;n<r.length;n++)t+=He(r[n],mn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Mi(Vr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!fr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=ir(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+lr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Fi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Dt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+ir(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ue(e)+":",Ma)},getUsername:function(){return this.username},setUsername:function(e){var t=St(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=He(t[r],Da)}},getPassword:function(){return this.password},setPassword:function(e){var t=St(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=He(t[r],Da)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ir(e):ir(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,za)},getHostname:function(){var e=this.host;return e===null?"":ir(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getPort:function(){var e=this.port;return e===null?"":Ue(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ue(e),e===""?this.port=null:this.parse(e,Ka))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+lr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,$t))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ue(e),e===""?this.query=null:(me(e,0)==="?"&&(e=gr(e,1)),this.query="",this.parse(e,Qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ue(e),e===""){this.fragment=null;return}me(e,0)==="#"&&(e=gr(e,1)),this.fragment="",this.parse(e,xe)},update:function(){this.query=this.searchParams.serialize()||null}};var Dt=function(t){var r=qb(this,ne),n=rS(arguments.length,1)>1?arguments[1]:void 0,a=nS(r,new Mo(t,!1,n));xo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},ne=Dt.prototype,he=function(e,t){return{get:function(){return En(this)[e]()},set:t&&function(r){return En(this)[t](r)},configurable:!0,enumerable:!0}};xo&&(de(ne,"href",he("serialize","setHref")),de(ne,"origin",he("getOrigin")),de(ne,"protocol",he("getProtocol","setProtocol")),de(ne,"username",he("getUsername","setUsername")),de(ne,"password",he("getPassword","setPassword")),de(ne,"host",he("getHost","setHost")),de(ne,"hostname",he("getHostname","setHostname")),de(ne,"port",he("getPort","setPort")),de(ne,"pathname",he("getPathname","setPathname")),de(ne,"search",he("getSearch","setSearch")),de(ne,"searchParams",he("getSearchParams")),de(ne,"hash",he("getHash","setHash")));Tn(ne,"toJSON",function(){return En(this).serialize()},{enumerable:!0});Tn(ne,"toString",function(){return En(this).serialize()},{enumerable:!0});if(ar){var Nc=ar.createObjectURL,xc=ar.revokeObjectURL;Nc&&Tn(Dt,"createObjectURL",Pc(Nc,ar)),xc&&Tn(Dt,"revokeObjectURL",Pc(xc,ar))}tS(Dt,"URL");Yb({global:!0,constructor:!0,forced:!Xb,sham:!xo},{URL:Dt});var OS=Y,kS=we,zf=Q,_S=pt,Uc=ze,RS=Vn,Fo=kS("URL"),CS=RS&&zf(function(){Fo.canParse()}),AS=zf(function(){return Fo.canParse.length!==1});OS({target:"URL",stat:!0,forced:!CS||AS},{canParse:function(t){var r=_S(arguments.length,1),n=Uc(t),a=r<2||arguments[1]===void 0?void 0:Uc(arguments[1]);try{return!!new Fo(n,a)}catch{return!1}}});var jS=Y,LS=we,NS=pt,Dc=ze,xS=Vn,US=LS("URL");jS({target:"URL",stat:!0,forced:!xS},{parse:function(t){var r=NS(arguments.length,1),n=Dc(t),a=r<2||arguments[1]===void 0?void 0:Dc(arguments[1]);try{return new US(n,a)}catch{return null}}});var DS=Y,MS=re;DS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return MS(URL.prototype.toString,this)}});var FS=jo;FS.URL;var BS={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zS=Hn,Va=zS("span").classList,Mc=Va&&Va.constructor&&Va.constructor.prototype,HS=Mc===Object.prototype?void 0:Mc,Fc=K,Hf=BS,KS=HS,dr=Xg,Bc=ht,GS=Zt,WS=ee,Za=WS("iterator"),Ja=dr.values,Kf=function(e,t){if(e){if(e[Za]!==Ja)try{Bc(e,Za,Ja)}catch{e[Za]=Ja}if(GS(e,t,!0),Hf[t]){for(var r in dr)if(e[r]!==dr[r])try{Bc(e,r,dr[r])}catch{e[r]=dr[r]}}}};for(var Ya in Hf)Kf(Fc[Ya]&&Fc[Ya].prototype,Ya);Kf(KS,"DOMTokenList");var VS=ye,ZS=ht,JS=function(e,t){VS(t)&&"cause"in t&&ZS(e,"cause",t.cause)},YS=H,Gf=Error,XS=YS("".replace),qS=function(e){return String(new Gf(e).stack)}("zxcasd"),Wf=/\n\s*at [^:]*:[^\n]*/,QS=Wf.test(qS),e$=function(e,t){if(QS&&typeof e=="string"&&!Gf.prepareStackTrace)for(;t--;)e=XS(e,Wf,"");return e},t$=Q,r$=vt,n$=!t$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",r$(1,7)),e.stack!==7):!0}),a$=ht,i$=e$,o$=n$,zc=Error.captureStackTrace,s$=function(e,t,r,n){o$&&(zc?zc(e,t):a$(e,"stack",i$(r,n)))},c$=Jt,u$=re,l$=ke,f$=Gn,d$=Of,v$=fo,Hc=Kn,h$=ko,p$=Jn,Kc=Ef,m$=TypeError,gn=function(e,t){this.stopped=e,this.result=t},Gc=gn.prototype,Ar=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=c$(t,n),f,l,c,d,v,p,w,g=function(P){return f&&Kc(f,"normal",P),new gn(!0,P)},T=function(P){return a?(l$(P),s?u(P[0],P[1],g):u(P[0],P[1])):s?u(P,g):u(P)};if(i)f=e.iterator;else if(o)f=e;else{if(l=p$(e),!l)throw new m$(f$(e)+" is not iterable");if(d$(l)){for(c=0,d=v$(e);d>c;c++)if(v=T(e[c]),v&&Hc(Gc,v))return v;return new gn(!1)}f=h$(e,l)}for(p=i?e.next:f.next;!(w=u$(p,f)).done;){try{v=T(w.value)}catch(P){Kc(f,"throw",P)}if(typeof v=="object"&&v&&Hc(Gc,v))return v}return new gn(!1)},g$=ze,y$=function(e,t){return e===void 0?arguments.length<2?"":t:g$(e)},w$=Y,b$=Kn,S$=$o,_n=Io,$$=Xl,Vf=Wn,Xa=ht,qa=vt,I$=JS,P$=s$,T$=Ar,E$=y$,O$=ee,k$=O$("toStringTag"),Rn=Error,_$=[].push,Mt=function(t,r){var n=b$(Qa,this),a;_n?a=_n(new Rn,n?S$(this):Qa):(a=n?this:Vf(Qa),Xa(a,k$,"Error")),r!==void 0&&Xa(a,"message",E$(r)),P$(a,Mt,a.stack,1),arguments.length>2&&I$(a,arguments[2]);var i=[];return T$(t,_$,{that:i}),Xa(a,"errors",i),a};_n?_n(Mt,Rn):$$(Mt,Rn,{name:!0});var Qa=Mt.prototype=Vf(Rn.prototype,{constructor:qa(1,Mt),message:qa(1,""),name:qa(1,"AggregateError")});w$({global:!0,constructor:!0,arity:2},{AggregateError:Mt});var R$=Oo,C$=Cr,A$=R$?{}.toString:function(){return"[object "+C$(this)+"]"},j$=Oo,L$=be,N$=A$;j$||L$(Object.prototype,"toString",N$,{unsafe:!0});var or=K,x$=kr,U$=Mn,Yr=function(e){return x$.slice(0,e.length)===e},Zf=function(){return Yr("Bun/")?"BUN":Yr("Cloudflare-Workers")?"CLOUDFLARE":Yr("Deno/")?"DENO":Yr("Node.js/")?"NODE":or.Bun&&typeof Bun.version=="string"?"BUN":or.Deno&&typeof Deno.version=="object"?"DENO":U$(or.process)==="process"?"NODE":or.window&&or.document?"BROWSER":"REST"}(),D$=Zf,Bo=D$==="NODE",M$=we,F$=Zn,B$=ee,z$=te,Wc=B$("species"),H$=function(e){var t=M$(e);z$&&t&&!t[Wc]&&F$(t,Wc,{configurable:!0,get:function(){return this}})},K$=Af,G$=Gn,W$=TypeError,V$=function(e){if(K$(e))return e;throw new W$(G$(e)+" is not a constructor")},Vc=ke,Z$=V$,J$=Fn,Y$=ee,X$=Y$("species"),Jf=function(e,t){var r=Vc(e).constructor,n;return r===void 0||J$(n=Vc(r)[X$])?t:Z$(n)},q$=Dn,Yf=Function.prototype,Zc=Yf.apply,Jc=Yf.call,Xf=typeof Reflect=="object"&&Reflect.apply||(q$?Jc.bind(Zc):function(){return Jc.apply(Zc,arguments)}),Q$=kr,qf=/(?:ipad|iphone|ipod).*applewebkit/i.test(Q$),ue=K,eI=Xf,tI=Jt,Yc=W,rI=ge,Qf=Q,Xc=Ml,nI=Yn,qc=Hn,aI=pt,iI=qf,oI=Bo,zi=ue.setImmediate,Hi=ue.clearImmediate,sI=ue.process,ei=ue.Dispatch,cI=ue.Function,Qc=ue.MessageChannel,uI=ue.String,ti=0,yr={},eu="onreadystatechange",Tr,et,ri,ni;Qf(function(){Tr=ue.location});var zo=function(e){if(rI(yr,e)){var t=yr[e];delete yr[e],t()}},ai=function(e){return function(){zo(e)}},tu=function(e){zo(e.data)},ru=function(e){ue.postMessage(uI(e),Tr.protocol+"//"+Tr.host)};(!zi||!Hi)&&(zi=function(t){aI(arguments.length,1);var r=Yc(t)?t:cI(t),n=nI(arguments,1);return yr[++ti]=function(){eI(r,void 0,n)},et(ti),ti},Hi=function(t){delete yr[t]},oI?et=function(e){sI.nextTick(ai(e))}:ei&&ei.now?et=function(e){ei.now(ai(e))}:Qc&&!iI?(ri=new Qc,ni=ri.port2,ri.port1.onmessage=tu,et=tI(ni.postMessage,ni)):ue.addEventListener&&Yc(ue.postMessage)&&!ue.importScripts&&Tr&&Tr.protocol!=="file:"&&!Qf(ru)?(et=ru,ue.addEventListener("message",tu,!1)):eu in qc("script")?et=function(e){Xc.appendChild(qc("script"))[eu]=function(){Xc.removeChild(this),zo(e)}}:et=function(e){setTimeout(ai(e),0)});var ed={set:zi,clear:Hi},td=function(){this.head=null,this.tail=null};td.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var rd=td,lI=kr,fI=/ipad|iphone|ipod/i.test(lI)&&typeof Pebble<"u",dI=kr,vI=/web0s(?!.*chrome)/i.test(dI),Ft=K,hI=cf,nu=Jt,ii=ed.set,pI=rd,mI=qf,gI=fI,yI=vI,oi=Bo,au=Ft.MutationObserver||Ft.WebKitMutationObserver,iu=Ft.document,ou=Ft.process,Xr=Ft.Promise,Ki=hI("queueMicrotask"),It,si,ci,qr,su;if(!Ki){var Qr=new pI,en=function(){var e,t;for(oi&&(e=ou.domain)&&e.exit();t=Qr.get();)try{t()}catch(r){throw Qr.head&&It(),r}e&&e.enter()};!mI&&!oi&&!yI&&au&&iu?(si=!0,ci=iu.createTextNode(""),new au(en).observe(ci,{characterData:!0}),It=function(){ci.data=si=!si}):!gI&&Xr&&Xr.resolve?(qr=Xr.resolve(void 0),qr.constructor=Xr,su=nu(qr.then,qr),It=function(){su(en)}):oi?It=function(){ou.nextTick(en)}:(ii=nu(ii,Ft),It=function(){ii(en)}),Ki=function(e){Qr.head||It(),Qr.add(e)}}var wI=Ki,bI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Xt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},SI=K,jr=SI.Promise,$I=K,wr=jr,II=W,PI=ql,TI=wo,EI=ee,cu=Zf,ui=kl;wr&&wr.prototype;var OI=EI("species"),Gi=!1,nd=II($I.PromiseRejectionEvent),kI=PI("Promise",function(){var e=TI(wr),t=e!==String(wr);if(!t&&ui===66)return!0;if(!ui||ui<51||!/native code/.test(e)){var r=new wr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[OI]=n,Gi=r.then(function(){})instanceof n,!Gi)return!0}return!t&&(cu==="BROWSER"||cu==="DENO")&&!nd}),Lr={CONSTRUCTOR:kI,REJECTION_EVENT:nd,SUBCLASSING:Gi},Le={},uu=_e,_I=TypeError,RI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new _I("Bad Promise constructor");t=n,r=a}),this.resolve=uu(t),this.reject=uu(r)};Le.f=function(e){return new RI(e)};var CI=Y,Cn=Bo,Ye=K,Bt=re,lu=be,fu=Io,AI=Zt,jI=H$,LI=_e,yn=W,NI=ye,xI=Eo,UI=Jf,ad=ed.set,Ho=wI,DI=bI,MI=Xt,FI=rd,id=Vt,An=jr,Ko=Lr,od=Le,ea="Promise",sd=Ko.CONSTRUCTOR,BI=Ko.REJECTION_EVENT,zI=Ko.SUBCLASSING,li=id.getterFor(ea),HI=id.set,Et=An&&An.prototype,rt=An,tn=Et,cd=Ye.TypeError,Wi=Ye.document,Go=Ye.process,Vi=od.f,KI=Vi,GI=!!(Wi&&Wi.createEvent&&Ye.dispatchEvent),ud="unhandledrejection",WI="rejectionhandled",du=0,ld=1,VI=2,Wo=1,fd=2,rn,vu,ZI,hu,dd=function(e){var t;return NI(e)&&yn(t=e.then)?t:!1},vd=function(e,t){var r=t.value,n=t.state===ld,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===fd&&YI(t),t.rejection=Wo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new cd("Promise-chain cycle")):(f=dd(u))?Bt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},hd=function(e,t){e.notified||(e.notified=!0,Ho(function(){for(var r=e.reactions,n;n=r.get();)vd(n,e);e.notified=!1,t&&!e.rejection&&JI(e)}))},pd=function(e,t,r){var n,a;GI?(n=Wi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Ye.dispatchEvent(n)):n={promise:t,reason:r},!BI&&(a=Ye["on"+e])?a(n):e===ud&&DI("Unhandled promise rejection",r)},JI=function(e){Bt(ad,Ye,function(){var t=e.facade,r=e.value,n=pu(e),a;if(n&&(a=MI(function(){Cn?Go.emit("unhandledRejection",r,t):pd(ud,t,r)}),e.rejection=Cn||pu(e)?fd:Wo,a.error))throw a.value})},pu=function(e){return e.rejection!==Wo&&!e.parent},YI=function(e){Bt(ad,Ye,function(){var t=e.facade;Cn?Go.emit("rejectionHandled",t):pd(WI,t,e.value)})},Rt=function(e,t,r){return function(n){e(t,n,r)}},jt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=VI,hd(e,!0))},Zi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new cd("Promise can't be resolved itself");var n=dd(t);n?Ho(function(){var a={done:!1};try{Bt(n,t,Rt(Zi,a,e),Rt(jt,a,e))}catch(i){jt(a,i,e)}}):(e.value=t,e.state=ld,hd(e,!1))}catch(a){jt({done:!1},a,e)}}};if(sd&&(rt=function(t){xI(this,tn),LI(t),Bt(rn,this);var r=li(this);try{t(Rt(Zi,r),Rt(jt,r))}catch(n){jt(r,n)}},tn=rt.prototype,rn=function(t){HI(this,{type:ea,done:!1,notified:!1,parent:!1,reactions:new FI,rejection:!1,state:du,value:null})},rn.prototype=lu(tn,"then",function(t,r){var n=li(this),a=Vi(UI(this,rt));return n.parent=!0,a.ok=yn(t)?t:!0,a.fail=yn(r)&&r,a.domain=Cn?Go.domain:void 0,n.state===du?n.reactions.add(a):Ho(function(){vd(a,n)}),a.promise}),vu=function(){var e=new rn,t=li(e);this.promise=e,this.resolve=Rt(Zi,t),this.reject=Rt(jt,t)},od.f=Vi=function(e){return e===rt||e===ZI?new vu(e):KI(e)},yn(An)&&Et!==Object.prototype)){hu=Et.then,zI||lu(Et,"then",function(t,r){var n=this;return new rt(function(a,i){Bt(hu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Et.constructor}catch{}fu&&fu(Et,tn)}CI({global:!0,constructor:!0,wrap:!0,forced:sd},{Promise:rt});AI(rt,ea,!1);jI(ea);var XI=ee,md=XI("iterator"),gd=!1;try{var qI=0,mu={next:function(){return{done:!!qI++}},return:function(){gd=!0}};mu[md]=function(){return this},Array.from(mu,function(){throw 2})}catch{}var QI=function(e,t){try{if(!t&&!gd)return!1}catch{return!1}var r=!1;try{var n={};n[md]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},e0=jr,t0=QI,r0=Lr.CONSTRUCTOR,ta=r0||!t0(function(e){e0.all(e).then(void 0,function(){})}),n0=Y,a0=re,i0=_e,o0=Le,s0=Xt,c0=Ar,u0=ta;n0({target:"Promise",stat:!0,forced:u0},{all:function(t){var r=this,n=o0.f(r),a=n.resolve,i=n.reject,o=s0(function(){var s=i0(r.resolve),u=[],f=0,l=1;c0(t,function(c){var d=f++,v=!1;l++,a0(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var l0=Y,f0=Lr.CONSTRUCTOR,Ji=jr,d0=we,v0=W,h0=be,gu=Ji&&Ji.prototype;l0({target:"Promise",proto:!0,forced:f0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(v0(Ji)){var yu=d0("Promise").prototype.catch;gu.catch!==yu&&h0(gu,"catch",yu,{unsafe:!0})}var p0=Y,m0=re,g0=_e,y0=Le,w0=Xt,b0=Ar,S0=ta;p0({target:"Promise",stat:!0,forced:S0},{race:function(t){var r=this,n=y0.f(r),a=n.reject,i=w0(function(){var o=g0(r.resolve);b0(t,function(s){m0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var $0=Y,I0=Le,P0=Lr.CONSTRUCTOR;$0({target:"Promise",stat:!0,forced:P0},{reject:function(t){var r=I0.f(this),n=r.reject;return n(t),r.promise}});var T0=ke,E0=ye,O0=Le,yd=function(e,t){if(T0(e),E0(t)&&t.constructor===e)return t;var r=O0.f(e),n=r.resolve;return n(t),r.promise},k0=Y,_0=we,R0=Lr.CONSTRUCTOR,C0=yd;_0("Promise");k0({target:"Promise",stat:!0,forced:R0},{resolve:function(t){return C0(this,t)}});var A0=Y,j0=re,L0=_e,N0=Le,x0=Xt,U0=Ar,D0=ta;A0({target:"Promise",stat:!0,forced:D0},{allSettled:function(t){var r=this,n=N0.f(r),a=n.resolve,i=n.reject,o=x0(function(){var s=L0(r.resolve),u=[],f=0,l=1;U0(t,function(c){var d=f++,v=!1;l++,j0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var M0=Y,F0=re,B0=_e,z0=we,H0=Le,K0=Xt,G0=Ar,W0=ta,wu="No one promise resolved";M0({target:"Promise",stat:!0,forced:W0},{any:function(t){var r=this,n=z0("AggregateError"),a=H0.f(r),i=a.resolve,o=a.reject,s=K0(function(){var u=B0(r.resolve),f=[],l=0,c=1,d=!1;G0(t,function(v){var p=l++,w=!1;c++,F0(u,r,v).then(function(g){w||d||(d=!0,i(g))},function(g){w||d||(w=!0,f[p]=g,--c||o(new n(f,wu)))})}),--c||o(new n(f,wu))});return s.error&&o(s.value),a.promise}});var V0=Y,Z0=Le;V0({target:"Promise",stat:!0},{withResolvers:function(){var t=Z0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var J0=Y,jn=jr,Y0=Q,wd=we,bd=W,X0=Jf,bu=yd,q0=be,Yi=jn&&jn.prototype,Q0=!!jn&&Y0(function(){Yi.finally.call({then:function(){}},function(){})});J0({target:"Promise",proto:!0,real:!0,forced:Q0},{finally:function(e){var t=X0(this,wd("Promise")),r=bd(e);return this.then(r?function(n){return bu(t,e()).then(function(){return n})}:e,r?function(n){return bu(t,e()).then(function(){throw n})}:e)}});if(bd(jn)){var Su=wd("Promise").prototype.finally;Yi.finally!==Su&&q0(Yi,"finally",Su,{unsafe:!0})}var eP=jo;eP.Promise;var tP=Y,rP=K,nP=Xf,aP=Yn,iP=Le,oP=_e,Sd=Xt,fi=rP.Promise,$u=!1,sP=!fi||!fi.try||Sd(function(){fi.try(function(e){$u=e===8},8)}).error||!$u;tP({target:"Promise",stat:!0,forced:sP},{try:function(e){var t=arguments.length>1?aP(arguments,1):[],r=iP.f(this),n=Sd(function(){return nP(oP(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function Xe(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Ae(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zo(e,t){return e(t={exports:{}},t.exports),t.exports}var tt=Zo(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Vo(tt);var cP=Vo(Zo(function(e,t){var r=nt&&nt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,w){function g(b){try{P(v.next(b))}catch(h){w(h)}}function T(b){try{P(v.throw(b))}catch(h){w(h)}}function P(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,T)}P((v=v.apply(l,c||[])).next())})},n=nt&&nt.__generator||function(l,c){var d,v,p,w,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return w={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(w[Symbol.iterator]=function(){return this}),w;function T(P){return function(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([P,b])}}},a=nt;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",v=0;v<l;v++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var v,p,w,g,T,P,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,w=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(w)!==null?[3,5]:(T=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(w,JSON.stringify({id:this.id,iat:v,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(P=g.getItemSync(w))!==null&&(b=JSON.parse(P)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(w,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var w,g,T;return n(this,function(P){switch(P.label){case 0:return[4,tt.default().lock(d)];case 1:return P.sent(),this.acquiredIatSet.has(d)?(w=this.storageHandler===void 0?o:this.storageHandler,(g=w.getItemSync(c))===null?(tt.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),w.setItemSync(c,JSON.stringify(T)),tt.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(tt.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(v){var p=!1,w=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(P),g=!0),!p){p=!0;var b=50-(Date.now()-w);b>0?setTimeout(v,b):v(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var P=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,v,p,w;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(w=JSON.parse(p)).id!==this.id?[3,2]:[4,tt.default().lock(w.iat)];case 1:g.sent(),this.acquiredIatSet.delete(w.iat),d.removeItemSync(v),tt.default().unlock(w.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],w=0;;){var g=v.keySync(w);if(g===null)break;p.push(g),w++}for(var T=!1,P=0;P<p.length;P++){var b=p[P];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const uP={timeoutInSeconds:60},$d={name:"auth0-spa-js",version:"2.1.3"},Id=()=>Date.now();let ce=class Xi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Xi.prototype)}static fromPayload({error:t,error_description:r}){return new Xi(t,r)}},lP=class Pd extends ce{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Pd.prototype)}},qi=class Td extends ce{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Td.prototype)}},fP=class Ed extends qi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Ed.prototype)}},dP=class Od extends ce{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Od.prototype)}},vP=class kd extends ce{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,kd.prototype)}},_d=class Rd extends ce{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Iu(t,["default"])}', scope: '${Iu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Rd.prototype)}};function Iu(e,t=[]){return e&&!t.includes(e)?e:""}const wn=()=>window.crypto,di=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(wn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Pu=e=>btoa(e),Qi=e=>{var{clientId:t}=e,r=Ae(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Tu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),hP=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},pP=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([hP(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},mP=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},gP=async(e,t,r,n,a,i,o=1e4)=>a?mP(e,t,r,n,o,a,i):pP(e,n,o);async function yP(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=Ae(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?Qi(u):JSON.stringify(u);return await async function(l,c,d,v,p,w,g){let T,P=null;for(let C=0;C<3;C++)try{T=await gP(l,d,v,p,w,g,c),P=null;break}catch(M){P=M}if(P)throw P;const b=T.json,{error:h,error_description:$}=b,O=Ae(b,["error","error_description"]),{ok:k}=T;if(!k){const C=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new vP(h,C,O.mfa_token):h==="missing_refresh_token"?new _d(d,v):new ce(h||"request_error",C)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||$d))}},t,s)}const nn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class eo{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new eo({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new eo({scope:r,audience:n,clientId:a})}},wP=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Cd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},bP=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Id}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new it({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},SP=class{constructor(t,r,n){this.storage=t,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const sr=e=>typeof e=="number",$P=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],IP=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Tu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],$P.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Tu(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!sr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!sr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!sr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+r),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(t.claims.nbf!=null&&sr(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&sr(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ot=Zo(function(e,t){var r=nt&&nt.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Vo(ot),ot.encode,ot.parse,ot.getAll;var PP=ot.get,Ad=ot.set,jd=ot.remove;const Ot={get(e){const t=PP(e);if(t!==void 0)return JSON.parse(t)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r)}},TP={get(e){return Ot.get(e)||Ot.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(`_legacy_${e}`,JSON.stringify(t),n),Ot.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r),Ot.remove(e,t),Ot.remove(`_legacy_${e}`,t)}},EP={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function OP(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,v=l.length;d<v;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
-
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Eu,Ou,ku,vi,
|
|
1
|
+
"use strict";var bv=Object.defineProperty;var Sv=(e,t,r)=>t in e?bv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var fe=(e,t,r)=>Sv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Q=function(e){try{return!!e()}catch{return!0}},$v=Q,Dn=!$v(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),bl=Dn,Sl=Function.prototype,Ii=Sl.call,Iv=bl&&Sl.bind.bind(Ii,Ii),H=bl?Iv:function(e){return function(){return Ii.apply(e,arguments)}},$l=H,Tv=$l({}.toString),Pv=$l("".slice),Mn=function(e){return Pv(Tv(e),8,-1)},Ev=H,Ov=Q,kv=Mn,ca=Object,_v=Ev("".split),Il=Ov(function(){return!ca("z").propertyIsEnumerable(0)})?function(e){return kv(e)==="String"?_v(e,""):ca(e)}:ca,Fn=function(e){return e==null},Rv=Fn,Cv=TypeError,Bn=function(e){if(Rv(e))throw new Cv("Can't call method on "+e);return e},Av=Il,jv=Bn,Or=function(e){return Av(jv(e))},er=function(e){return e&&e.Math===Math&&e},G=er(typeof globalThis=="object"&&globalThis)||er(typeof window=="object"&&window)||er(typeof self=="object"&&self)||er(typeof Ur=="object"&&Ur)||er(typeof Ur=="object"&&Ur)||function(){return this}()||Function("return this")(),Tl={exports:{}},Lv=!1,os=G,Nv=Object.defineProperty,so=function(e,t){try{Nv(os,e,{value:t,configurable:!0,writable:!0})}catch{os[e]=t}return t},xv=G,Uv=so,ss="__core-js_shared__",cs=Tl.exports=xv[ss]||Uv(ss,{});(cs.versions||(cs.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"});var co=Tl.exports,us=co,Pl=function(e,t){return us[e]||(us[e]=t||{})},Dv=Bn,Mv=Object,zn=function(e){return Mv(Dv(e))},Fv=H,Bv=zn,zv=Fv({}.hasOwnProperty),ge=Object.hasOwn||function(t,r){return zv(Bv(t),r)},Hv=H,Gv=0,Kv=Math.random(),Wv=Hv(1 .toString),El=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Wv(++Gv+Kv,36)},Vv=G,ls=Vv.navigator,fs=ls&&ls.userAgent,kr=fs?String(fs):"",Ol=G,ua=kr,ds=Ol.process,vs=Ol.Deno,hs=ds&&ds.versions||vs&&vs.version,ps=hs&&hs.v8,Te,Sn;ps&&(Te=ps.split("."),Sn=Te[0]>0&&Te[0]<4?1:+(Te[0]+Te[1]));!Sn&&ua&&(Te=ua.match(/Edge\/(\d+)/),(!Te||Te[1]>=74)&&(Te=ua.match(/Chrome\/(\d+)/),Te&&(Sn=+Te[1])));var kl=Sn,ms=kl,Zv=Q,Jv=G,Yv=Jv.String,_l=!!Object.getOwnPropertySymbols&&!Zv(function(){var e=Symbol("symbol detection");return!Yv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ms&&ms<41}),Xv=_l,Rl=Xv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",qv=G,Qv=Pl,gs=ge,eh=El,th=_l,rh=Rl,kt=qv.Symbol,la=Qv("wks"),nh=rh?kt.for||kt:kt&&kt.withoutSetter||eh,ee=function(e){return gs(la,e)||(la[e]=th&&gs(kt,e)?kt[e]:nh("Symbol."+e)),la[e]},fa=typeof document=="object"&&document.all,W=typeof fa>"u"&&fa!==void 0?function(e){return typeof e=="function"||e===fa}:function(e){return typeof e=="function"},ah=W,ye=function(e){return typeof e=="object"?e!==null:ah(e)},ih=ye,oh=String,sh=TypeError,ke=function(e){if(ih(e))return e;throw new sh(oh(e)+" is not an object")},Cl={},ch=Q,te=!ch(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),uh=te,lh=Q,Al=uh&&lh(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),je={},fh=G,ys=ye,Ti=fh.document,dh=ys(Ti)&&ys(Ti.createElement),Hn=function(e){return dh?Ti.createElement(e):{}},vh=te,hh=Q,ph=Hn,jl=!vh&&!hh(function(){return Object.defineProperty(ph("div"),"a",{get:function(){return 7}}).a!==7}),mh=Dn,Dr=Function.prototype.call,re=mh?Dr.bind(Dr):function(){return Dr.apply(Dr,arguments)},da=G,gh=W,yh=function(e){return gh(e)?e:void 0},we=function(e,t){return arguments.length<2?yh(da[e]):da[e]&&da[e][t]},wh=H,Gn=wh({}.isPrototypeOf),bh=we,Sh=W,$h=Gn,Ih=Rl,Th=Object,Ll=Ih?function(e){return typeof e=="symbol"}:function(e){var t=bh("Symbol");return Sh(t)&&$h(t.prototype,Th(e))},Ph=String,Kn=function(e){try{return Ph(e)}catch{return"Object"}},Eh=W,Oh=Kn,kh=TypeError,_e=function(e){if(Eh(e))return e;throw new kh(Oh(e)+" is not a function")},_h=_e,Rh=Fn,uo=function(e,t){var r=e[t];return Rh(r)?void 0:_h(r)},va=re,ha=W,pa=ye,Ch=TypeError,Ah=function(e,t){var r,n;if(t==="string"&&ha(r=e.toString)&&!pa(n=va(r,e))||ha(r=e.valueOf)&&!pa(n=va(r,e))||t!=="string"&&ha(r=e.toString)&&!pa(n=va(r,e)))return n;throw new Ch("Can't convert object to primitive value")},jh=re,ws=ye,bs=Ll,Lh=uo,Nh=Ah,xh=ee,Uh=TypeError,Dh=xh("toPrimitive"),Mh=function(e,t){if(!ws(e)||bs(e))return e;var r=Lh(e,Dh),n;if(r){if(t===void 0&&(t="default"),n=jh(r,e,t),!ws(n)||bs(n))return n;throw new Uh("Can't convert object to primitive value")}return t===void 0&&(t="number"),Nh(e,t)},Fh=Mh,Bh=Ll,Nl=function(e){var t=Fh(e,"string");return Bh(t)?t:t+""},zh=te,Hh=jl,Gh=Al,Mr=ke,Ss=Nl,Kh=TypeError,ma=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,ga="enumerable",ya="configurable",wa="writable";je.f=zh?Gh?function(t,r,n){if(Mr(t),r=Ss(r),Mr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&wa in n&&!n[wa]){var a=Wh(t,r);a&&a[wa]&&(t[r]=n.value,n={configurable:ya in n?n[ya]:a[ya],enumerable:ga in n?n[ga]:a[ga],writable:!1})}return ma(t,r,n)}:ma:function(t,r,n){if(Mr(t),r=Ss(r),Mr(n),Hh)try{return ma(t,r,n)}catch{}if("get"in n||"set"in n)throw new Kh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Vh=Math.ceil,Zh=Math.floor,Jh=Math.trunc||function(t){var r=+t;return(r>0?Zh:Vh)(r)},Yh=Jh,lo=function(e){var t=+e;return t!==t||t===0?0:Yh(t)},Xh=lo,qh=Math.max,Qh=Math.min,xl=function(e,t){var r=Xh(e);return r<0?qh(r+t,0):Qh(r,t)},ep=lo,tp=Math.min,rp=function(e){var t=ep(e);return t>0?tp(t,9007199254740991):0},np=rp,fo=function(e){return np(e.length)},ap=Or,ip=xl,op=fo,$s=function(e){return function(t,r,n){var a=ap(t),i=op(a);if(i===0)return!e&&-1;var o=ip(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},sp={includes:$s(!0),indexOf:$s(!1)},vo={},cp=H,ba=ge,up=Or,lp=sp.indexOf,fp=vo,Is=cp([].push),Ul=function(e,t){var r=up(e),n=0,a=[],i;for(i in r)!ba(fp,i)&&ba(r,i)&&Is(a,i);for(;t.length>n;)ba(r,i=t[n++])&&(~lp(a,i)||Is(a,i));return a},ho=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],dp=Ul,vp=ho,Dl=Object.keys||function(t){return dp(t,vp)},hp=te,pp=Al,mp=je,gp=ke,yp=Or,wp=Dl;Cl.f=hp&&!pp?Object.defineProperties:function(t,r){gp(t);for(var n=yp(r),a=wp(r),i=a.length,o=0,s;i>o;)mp.f(t,s=a[o++],n[s]);return t};var bp=we,Ml=bp("document","documentElement"),Sp=Pl,$p=El,Ts=Sp("keys"),po=function(e){return Ts[e]||(Ts[e]=$p(e))},Ip=ke,Tp=Cl,Ps=ho,Pp=vo,Ep=Ml,Op=Hn,kp=po,Es=">",Os="<",Pi="prototype",Ei="script",Fl=kp("IE_PROTO"),Sa=function(){},Bl=function(e){return Os+Ei+Es+e+Os+"/"+Ei+Es},ks=function(e){e.write(Bl("")),e.close();var t=e.parentWindow.Object;return e=null,t},_p=function(){var e=Op("iframe"),t="java"+Ei+":",r;return e.style.display="none",Ep.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Bl("document.F=Object")),r.close(),r.F},Fr,dn=function(){try{Fr=new ActiveXObject("htmlfile")}catch{}dn=typeof document<"u"?document.domain&&Fr?ks(Fr):_p():ks(Fr);for(var e=Ps.length;e--;)delete dn[Pi][Ps[e]];return dn()};Pp[Fl]=!0;var Wn=Object.create||function(t,r){var n;return t!==null?(Sa[Pi]=Ip(t),n=new Sa,Sa[Pi]=null,n[Fl]=t):n=dn(),r===void 0?n:Tp.f(n,r)},Rp=ee,Cp=Wn,Ap=je.f,Oi=Rp("unscopables"),ki=Array.prototype;ki[Oi]===void 0&&Ap(ki,Oi,{configurable:!0,value:Cp(null)});var jp=function(e){ki[Oi][e]=!0},_r={},Lp=G,Np=W,_s=Lp.WeakMap,xp=Np(_s)&&/native code/.test(String(_s)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Up=te,Dp=je,Mp=vt,ht=Up?function(e,t,r){return Dp.f(e,t,Mp(1,r))}:function(e,t,r){return e[t]=r,e},Fp=xp,zl=G,Bp=ye,zp=ht,$a=ge,Ia=co,Hp=po,Gp=vo,Rs="Object already initialized",_i=zl.TypeError,Kp=zl.WeakMap,$n,Tr,In,Wp=function(e){return In(e)?Tr(e):$n(e,{})},Vp=function(e){return function(t){var r;if(!Bp(t)||(r=Tr(t)).type!==e)throw new _i("Incompatible receiver, "+e+" required");return r}};if(Fp||Ia.state){var Re=Ia.state||(Ia.state=new Kp);Re.get=Re.get,Re.has=Re.has,Re.set=Re.set,$n=function(e,t){if(Re.has(e))throw new _i(Rs);return t.facade=e,Re.set(e,t),t},Tr=function(e){return Re.get(e)||{}},In=function(e){return Re.has(e)}}else{var yt=Hp("state");Gp[yt]=!0,$n=function(e,t){if($a(e,yt))throw new _i(Rs);return t.facade=e,zp(e,yt,t),t},Tr=function(e){return $a(e,yt)?e[yt]:{}},In=function(e){return $a(e,yt)}}var Vt={set:$n,get:Tr,has:In,enforce:Wp,getterFor:Vp},mo={},go={},Hl={}.propertyIsEnumerable,Gl=Object.getOwnPropertyDescriptor,Zp=Gl&&!Hl.call({1:2},1);go.f=Zp?function(t){var r=Gl(this,t);return!!r&&r.enumerable}:Hl;var Jp=te,Yp=re,Xp=go,qp=vt,Qp=Or,em=Nl,tm=ge,rm=jl,Cs=Object.getOwnPropertyDescriptor;mo.f=Jp?Cs:function(t,r){if(t=Qp(t),r=em(r),rm)try{return Cs(t,r)}catch{}if(tm(t,r))return qp(!Yp(Xp.f,t,r),t[r])};var Kl={exports:{}},Ri=te,nm=ge,Wl=Function.prototype,am=Ri&&Object.getOwnPropertyDescriptor,yo=nm(Wl,"name"),im=yo&&(function(){}).name==="something",om=yo&&(!Ri||Ri&&am(Wl,"name").configurable),Vl={EXISTS:yo,PROPER:im,CONFIGURABLE:om},sm=H,cm=W,Ci=co,um=sm(Function.toString);cm(Ci.inspectSource)||(Ci.inspectSource=function(e){return um(e)});var wo=Ci.inspectSource,bo=H,lm=Q,fm=W,Br=ge,Ai=te,dm=Vl.CONFIGURABLE,vm=wo,Zl=Vt,hm=Zl.enforce,pm=Zl.get,As=String,vn=Object.defineProperty,mm=bo("".slice),gm=bo("".replace),ym=bo([].join),wm=Ai&&!lm(function(){return vn(function(){},"length",{value:8}).length!==8}),bm=String(String).split("String"),Sm=Kl.exports=function(e,t,r){mm(As(t),0,7)==="Symbol("&&(t="["+gm(As(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Br(e,"name")||dm&&e.name!==t)&&(Ai?vn(e,"name",{value:t,configurable:!0}):e.name=t),wm&&r&&Br(r,"arity")&&e.length!==r.arity&&vn(e,"length",{value:r.arity});try{r&&Br(r,"constructor")&&r.constructor?Ai&&vn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=hm(e);return Br(n,"source")||(n.source=ym(bm,typeof t=="string"?t:"")),e};Function.prototype.toString=Sm(function(){return fm(this)&&pm(this).source||vm(this)},"toString");var Jl=Kl.exports,$m=W,Im=je,Tm=Jl,Pm=so,be=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if($m(r)&&Tm(r,i,n),n.global)a?e[t]=r:Pm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Im.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Yl={},Em=Ul,Om=ho,km=Om.concat("length","prototype");Yl.f=Object.getOwnPropertyNames||function(t){return Em(t,km)};var So={};So.f=Object.getOwnPropertySymbols;var _m=we,Rm=H,Cm=Yl,Am=So,jm=ke,Lm=Rm([].concat),Nm=_m("Reflect","ownKeys")||function(t){var r=Cm.f(jm(t)),n=Am.f;return n?Lm(r,n(t)):r},js=ge,xm=Nm,Um=mo,Dm=je,Xl=function(e,t,r){for(var n=xm(t),a=Dm.f,i=Um.f,o=0;o<n.length;o++){var s=n[o];!js(e,s)&&!(r&&js(r,s))&&a(e,s,i(t,s))}},Mm=Q,Fm=W,Bm=/#|\.prototype\./,Rr=function(e,t){var r=Hm[zm(e)];return r===Km?!0:r===Gm?!1:Fm(t)?Mm(t):!!t},zm=Rr.normalize=function(e){return String(e).replace(Bm,".").toLowerCase()},Hm=Rr.data={},Gm=Rr.NATIVE="N",Km=Rr.POLYFILL="P",ql=Rr,zr=G,Wm=mo.f,Vm=ht,Zm=be,Jm=so,Ym=Xl,Xm=ql,Y=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=zr:a?o=zr[r]||Jm(r,{}):o=zr[r]&&zr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Wm(o,s),u=l&&l.value):u=o[s],i=Xm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Ym(f,u)}(e.sham||u&&u.sham)&&Vm(f,"sham",!0),Zm(o,s,f,e)}},qm=Q,Qm=!qm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),eg=ge,tg=W,rg=zn,ng=po,ag=Qm,Ls=ng("IE_PROTO"),ji=Object,ig=ji.prototype,$o=ag?ji.getPrototypeOf:function(e){var t=rg(e);if(eg(t,Ls))return t[Ls];var r=t.constructor;return tg(r)&&t instanceof r?r.prototype:t instanceof ji?ig:null},og=Q,sg=W,cg=ye,Ns=$o,ug=be,lg=ee,Li=lg("iterator"),Ql=!1,ut,Ta,Pa;[].keys&&(Pa=[].keys(),"next"in Pa?(Ta=Ns(Ns(Pa)),Ta!==Object.prototype&&(ut=Ta)):Ql=!0);var fg=!cg(ut)||og(function(){var e={};return ut[Li].call(e)!==e});fg&&(ut={});sg(ut[Li])||ug(ut,Li,function(){return this});var ef={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Ql},dg=je.f,vg=ge,hg=ee,xs=hg("toStringTag"),Zt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!vg(e,xs)&&dg(e,xs,{configurable:!0,value:t})},pg=ef.IteratorPrototype,mg=Wn,gg=vt,yg=Zt,wg=_r,bg=function(){return this},tf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=mg(pg,{next:gg(+!n,r)}),yg(e,a,!1),wg[a]=bg,e},Sg=H,$g=_e,Ig=function(e,t,r){try{return Sg($g(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Tg=ye,Pg=function(e){return Tg(e)||e===null},Eg=Pg,Og=String,kg=TypeError,_g=function(e){if(Eg(e))return e;throw new kg("Can't set "+Og(e)+" as a prototype")},Rg=Ig,Cg=ye,Ag=Bn,jg=_g,Io=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Rg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Ag(a),jg(i),Cg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Lg=Y,Ng=re,rf=Vl,xg=W,Ug=tf,Us=$o,Ds=Io,Dg=Zt,Mg=ht,Ea=be,Fg=ee,Bg=_r,nf=ef,zg=rf.PROPER,Hg=rf.CONFIGURABLE,Ms=nf.IteratorPrototype,Hr=nf.BUGGY_SAFARI_ITERATORS,tr=Fg("iterator"),Fs="keys",rr="values",Bs="entries",Gg=function(){return this},af=function(e,t,r,n,a,i,o){Ug(r,t,n);var s=function(P){if(P===a&&d)return d;if(!Hr&&P&&P in l)return l[P];switch(P){case Fs:return function(){return new r(this,P)};case rr:return function(){return new r(this,P)};case Bs:return function(){return new r(this,P)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[tr]||l["@@iterator"]||a&&l[a],d=!Hr&&c||s(a),v=t==="Array"&&l.entries||c,h,b,g;if(v&&(h=Us(v.call(new e)),h!==Object.prototype&&h.next&&(Us(h)!==Ms&&(Ds?Ds(h,Ms):xg(h[tr])||Ea(h,tr,Gg)),Dg(h,u,!0))),zg&&a===rr&&c&&c.name!==rr&&(Hg?Mg(l,"name",rr):(f=!0,d=function(){return Ng(c,this)})),a)if(b={values:s(rr),keys:i?d:s(Fs),entries:s(Bs)},o)for(g in b)(Hr||f||!(g in l))&&Ea(l,g,b[g]);else Lg({target:t,proto:!0,forced:Hr||f},b);return l[tr]!==d&&Ea(l,tr,d,{name:a}),Bg[t]=d,b},To=function(e,t){return{value:e,done:t}},Kg=Or,Po=jp,zs=_r,of=Vt,Wg=je.f,Vg=af,Gr=To,Zg=te,sf="Array Iterator",Jg=of.set,Yg=of.getterFor(sf),Xg=Vg(Array,"Array",function(e,t){Jg(this,{type:sf,target:Kg(e),index:0,kind:t})},function(){var e=Yg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Gr(void 0,!0);switch(e.kind){case"keys":return Gr(r,!1);case"values":return Gr(t[r],!1)}return Gr([r,t[r]],!1)},"values"),Hs=zs.Arguments=zs.Array;Po("keys");Po("values");Po("entries");if(Zg&&Hs.name!=="values")try{Wg(Hs,"name",{value:"values"})}catch{}var qg=Y,Qg=H,ey=xl,ty=RangeError,Gs=String.fromCharCode,Ks=String.fromCodePoint,ry=Qg([].join),ny=!!Ks&&Ks.length!==1;qg({target:"String",stat:!0,arity:1,forced:ny},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],ey(i,1114111)!==i)throw new ty(i+" is not a valid code point");r[a]=i<65536?Gs(i):Gs(((i-=65536)>>10)+55296,i%1024+56320)}return ry(r,"")}});var Ws=G,ay=te,iy=Object.getOwnPropertyDescriptor,cf=function(e){if(!ay)return Ws[e];var t=iy(Ws,e);return t&&t.value},oy=Q,sy=ee,cy=te,Vs=Lv,uy=sy("iterator"),Vn=!oy(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),Vs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Vs||!cy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[uy]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Zs=Jl,ly=je,Zn=function(e,t,r){return r.get&&Zs(r.get,t,{getter:!0}),r.set&&Zs(r.set,t,{setter:!0}),ly.f(e,t,r)},fy=be,dy=function(e,t,r){for(var n in t)fy(e,n,t[n],r);return e},vy=Gn,hy=TypeError,Eo=function(e,t){if(vy(t,e))return e;throw new hy("Incorrect invocation")},py=Mn,my=H,gy=function(e){if(py(e)==="Function")return my(e)},Js=gy,yy=_e,wy=Dn,by=Js(Js.bind),Jt=function(e,t){return yy(e),t===void 0?e:wy?by(e,t):function(){return e.apply(t,arguments)}},Sy=ee,$y=Sy("toStringTag"),uf={};uf[$y]="z";var Oo=String(uf)==="[object z]",Iy=Oo,Ty=W,hn=Mn,Py=ee,Ey=Py("toStringTag"),Oy=Object,ky=hn(function(){return arguments}())==="Arguments",_y=function(e,t){try{return e[t]}catch{}},Cr=Iy?hn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=_y(t=Oy(e),Ey))=="string"?r:ky?hn(t):(n=hn(t))==="Object"&&Ty(t.callee)?"Arguments":n},Ry=Cr,Cy=String,ze=function(e){if(Ry(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Cy(e)},Ay=Cr,Ys=uo,jy=Fn,Ly=_r,Ny=ee,xy=Ny("iterator"),Jn=function(e){if(!jy(e))return Ys(e,xy)||Ys(e,"@@iterator")||Ly[Ay(e)]},Uy=re,Dy=_e,My=ke,Fy=Kn,By=Jn,zy=TypeError,ko=function(e,t){var r=arguments.length<2?By(e):t;if(Dy(r))return My(Uy(r,e));throw new zy(Fy(e)+" is not iterable")},Hy=TypeError,pt=function(e,t){if(e<t)throw new Hy("Not enough arguments");return e},Gy=H,Yn=Gy([].slice),Xs=Yn,Ky=Math.floor,Ni=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=Ky(r/2),s=Ni(Xs(e,0,o),t),u=Ni(Xs(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Wy=Ni,xi=Y,lf=G,_o=cf,Vy=we,Kr=re,Ee=H,hr=te,ff=Vn,df=be,Zy=Zn,Jy=dy,Yy=Zt,Xy=tf,Ro=Vt,vf=Eo,Oa=W,qy=ge,Qy=Jt,ew=Cr,tw=ke,hf=ye,ae=ze,rw=Wn,qs=vt,Qs=ko,nw=Jn,Wr=To,wt=pt,aw=ee,iw=Wy,ow=aw("iterator"),Yt="URLSearchParams",pf=Yt+"Iterator",mf=Ro.set,pe=Ro.getterFor(Yt),sw=Ro.getterFor(pf),ec=_o("fetch"),Tn=_o("Request"),pr=_o("Headers"),ka=Tn&&Tn.prototype,tc=pr&&pr.prototype,cw=lf.TypeError,uw=lf.encodeURIComponent,lw=String.fromCharCode,fw=Vy("String","fromCodePoint"),dw=parseInt,pn=Ee("".charAt),rc=Ee([].join),We=Ee([].push),gf=Ee("".replace),vw=Ee([].shift),nc=Ee([].splice),ac=Ee("".split),yf=Ee("".slice),hw=Ee(/./.exec),pw=/\+/g,_a="�",mw=/^[0-9a-f]+$/i,ic=function(e,t){var r=yf(e,t,t+2);return hw(mw,r)?dw(r,16):NaN},gw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},yw=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(e[0]&31)<<6|e[1]&63;break;case 3:t=(e[0]&15)<<12|(e[1]&63)<<6|e[2]&63;break;case 4:t=(e[0]&7)<<18|(e[1]&63)<<12|(e[2]&63)<<6|e[3]&63;break}return t>1114111?null:t},oc=function(e){e=gf(e,pw," ");for(var t=e.length,r="",n=0;n<t;){var a=pn(e,n);if(a==="%"){if(pn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=ic(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=gw(i);if(o===0)a=lw(i);else{if(o===1||o>4){r+=_a,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||pn(e,n)!=="%"));){var f=ic(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;We(s,f),n+=2,u++}if(s.length!==o){r+=_a;continue}var l=yw(s);l===null?r+=_a:a=fw(l)}}r+=a,n++}return r},ww=/[!'()~]|%20/g,bw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Sw=function(e){return bw[e]},sc=function(e){return gf(uw(e),ww,Sw)},Ra=Xy(function(t,r){mf(this,{type:pf,target:pe(t).entries,index:0,kind:r})},Yt,function(){var t=sw(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Wr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Wr(a.key,!1);case"values":return Wr(a.value,!1)}return Wr([a.key,a.value],!1)},!0),wf=function(e){this.entries=[],this.url=null,e!==void 0&&(hf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?pn(e,0)==="?"?yf(e,1):e:ae(e)))};wf.prototype={type:Yt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=nw(e),n,a,i,o,s,u,f;if(r)for(n=Qs(e,r),a=n.next;!(i=Kr(a,n)).done;){if(o=Qs(tw(i.value)),s=o.next,(u=Kr(s,o)).done||(f=Kr(s,o)).done||!Kr(s,o).done)throw new cw("Expected sequence with length 2");We(t,{key:ae(u.value),value:ae(f.value)})}else for(var l in e)qy(e,l)&&We(t,{key:l,value:ae(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=ac(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=ac(a,"="),We(t,{key:oc(vw(i)),value:oc(rc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],We(t,sc(n.key)+"="+sc(n.value));return rc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Xn=function(){vf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=mf(this,new wf(t));hr||(this.size=r.entries.length)},Ut=Xn.prototype;Jy(Ut,{append:function(t,r){var n=pe(this);wt(arguments.length,2),We(n.entries,{key:ae(t),value:ae(r)}),hr||this.length++,n.updateURL()},delete:function(e){for(var t=pe(this),r=wt(arguments.length,1),n=t.entries,a=ae(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ae(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(nc(n,s,1),o!==void 0)break}else s++}hr||(this.size=n.length),t.updateURL()},get:function(t){var r=pe(this).entries;wt(arguments.length,1);for(var n=ae(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=pe(this).entries;wt(arguments.length,1);for(var n=ae(t),a=[],i=0;i<r.length;i++)r[i].key===n&&We(a,r[i].value);return a},has:function(t){for(var r=pe(this).entries,n=wt(arguments.length,1),a=ae(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ae(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=pe(this);wt(arguments.length,1);for(var a=n.entries,i=!1,o=ae(t),s=ae(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?nc(a,u--,1):(i=!0,f.value=s));i||We(a,{key:o,value:s}),hr||(this.size=a.length),n.updateURL()},sort:function(){var t=pe(this);iw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=pe(this).entries,n=Qy(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new Ra(this,"keys")},values:function(){return new Ra(this,"values")},entries:function(){return new Ra(this,"entries")}},{enumerable:!0});df(Ut,ow,Ut.entries,{name:"entries"});df(Ut,"toString",function(){return pe(this).serialize()},{enumerable:!0});hr&&Zy(Ut,"size",{get:function(){return pe(this).entries.length},configurable:!0,enumerable:!0});Yy(Xn,Yt);xi({global:!0,constructor:!0,forced:!ff},{URLSearchParams:Xn});if(!ff&&Oa(pr)){var $w=Ee(tc.has),Iw=Ee(tc.set),cc=function(e){if(hf(e)){var t=e.body,r;if(ew(t)===Yt)return r=e.headers?new pr(e.headers):new pr,$w(r,"content-type")||Iw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),rw(e,{body:qs(0,ae(t)),headers:qs(0,r)})}return e};if(Oa(ec)&&xi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return ec(t,arguments.length>1?cc(arguments[1]):{})}}),Oa(Tn)){var Ca=function(t){return vf(this,ka),new Tn(t,arguments.length>1?cc(arguments[1]):{})};ka.constructor=Ca,Ca.prototype=ka,xi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ca})}}var Tw={URLSearchParams:Xn,getState:pe},Pw=be,qn=H,uc=ze,Ew=pt,bf=URLSearchParams,Qn=bf.prototype,Ow=qn(Qn.append),lc=qn(Qn.delete),kw=qn(Qn.forEach),_w=qn([].push),Co=new bf("a=1&a=2&b=3");Co.delete("a",1);Co.delete("b",void 0);Co+""!="a=2"&&Pw(Qn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return lc(this,e);var n=[];kw(this,function(c,d){_w(n,{key:d,value:c})}),Ew(t,1);for(var a=uc(e),i=uc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,lc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Ow(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Rw=be,Sf=H,Cw=ze,Aw=pt,$f=URLSearchParams,Ao=$f.prototype,jw=Sf(Ao.getAll),Lw=Sf(Ao.has),fc=new $f("a=1");(fc.has("a",2)||!fc.has("a",void 0))&&Rw(Ao,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Lw(this,t);var a=jw(this,t);Aw(r,1);for(var i=Cw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Nw=te,xw=H,Uw=Zn,Ui=URLSearchParams.prototype,Dw=xw(Ui.forEach);Nw&&!("size"in Ui)&&Uw(Ui,"size",{get:function(){var t=0;return Dw(this,function(){t++}),t},configurable:!0,enumerable:!0});var Mw=G,jo=Mw,Fw=jo;Fw.URLSearchParams;var Lo=H,Bw=lo,zw=ze,Hw=Bn,Gw=Lo("".charAt),dc=Lo("".charCodeAt),Kw=Lo("".slice),vc=function(e){return function(t,r){var n=zw(Hw(t)),a=Bw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=dc(n,a),o<55296||o>56319||a+1===i||(s=dc(n,a+1))<56320||s>57343?e?Gw(n,a):o:e?Kw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},If={codeAt:vc(!1),charAt:vc(!0)},Ww=If.charAt,Vw=ze,Tf=Vt,Zw=af,hc=To,Pf="String Iterator",Jw=Tf.set,Yw=Tf.getterFor(Pf);Zw(String,"String",function(e){Jw(this,{type:Pf,string:Vw(e),index:0})},function(){var t=Yw(this),r=t.string,n=t.index,a;return n>=r.length?hc(void 0,!0):(a=Ww(r,n),t.index+=a.length,hc(a,!1))});var pc=te,Xw=H,qw=re,Qw=Q,Aa=Dl,eb=So,tb=go,rb=zn,nb=Il,bt=Object.assign,mc=Object.defineProperty,ab=Xw([].concat),ib=!bt||Qw(function(){if(pc&&bt({b:1},bt(mc({},"a",{enumerable:!0,get:function(){mc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),bt({},e)[r]!==7||Aa(bt({},t)).join("")!==n})?function(t,r){for(var n=rb(t),a=arguments.length,i=1,o=eb.f,s=tb.f;a>i;)for(var u=nb(arguments[i++]),f=o?ab(Aa(u),o(u)):Aa(u),l=f.length,c=0,d;l>c;)d=f[c++],(!pc||qw(s,u,d))&&(n[d]=u[d]);return n}:bt,ob=re,gc=ke,sb=uo,Ef=function(e,t,r){var n,a;gc(e);try{if(n=sb(e,"return"),!n){if(t==="throw")throw r;return r}n=ob(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return gc(n),r},cb=ke,ub=Ef,lb=function(e,t,r,n){try{return n?t(cb(r)[0],r[1]):t(r)}catch(a){ub(e,"throw",a)}},fb=ee,db=_r,vb=fb("iterator"),hb=Array.prototype,Of=function(e){return e!==void 0&&(db.Array===e||hb[vb]===e)},pb=H,mb=Q,kf=W,gb=Cr,yb=we,wb=wo,_f=function(){},Rf=yb("Reflect","construct"),No=/^\s*(?:class|function)\b/,bb=pb(No.exec),Sb=!No.test(_f),nr=function(t){if(!kf(t))return!1;try{return Rf(_f,[],t),!0}catch{return!1}},Cf=function(t){if(!kf(t))return!1;switch(gb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sb||!!bb(No,wb(t))}catch{return!0}};Cf.sham=!0;var Af=!Rf||mb(function(){var e;return nr(nr.call)||!nr(Object)||!nr(function(){e=!0})||e})?Cf:nr,$b=te,Ib=je,Tb=vt,Pb=function(e,t,r){$b?Ib.f(e,t,Tb(0,r)):e[t]=r},Eb=Jt,Ob=re,kb=zn,_b=lb,Rb=Of,Cb=Af,Ab=fo,yc=Pb,jb=ko,Lb=Jn,wc=Array,Nb=function(t){var r=kb(t),n=Cb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Eb(i,a>2?arguments[2]:void 0));var s=Lb(r),u=0,f,l,c,d,v,h;if(s&&!(this===wc&&Rb(s)))for(l=n?new this:[],d=jb(r,s),v=d.next;!(c=Ob(v,d)).done;u++)h=o?_b(d,i,[c.value,u],!0):c.value,yc(l,u,h);else for(f=Ab(r),l=n?new this(f):wc(f);f>u;u++)h=o?i(r[u],u):r[u],yc(l,u,h);return l.length=u,l},mt=H,ja=2147483647,mr=36,jf=1,Di=26,xb=38,Ub=700,Db=72,Mb=128,Fb="-",Bb=/[^\0-\u007E]/,Lf=/[.\u3002\uFF0E\uFF61]/g,bc="Overflow: input needs wider integers to process",La=mr-jf,Sc=RangeError,zb=mt(Lf.exec),_t=Math.floor,Na=String.fromCharCode,$c=mt("".charCodeAt),Nf=mt([].join),Ve=mt([].push),Hb=mt("".replace),Gb=mt("".split),Kb=mt("".toLowerCase),Wb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=$c(e,r++);if(a>=55296&&a<=56319&&r<n){var i=$c(e,r++);(i&64512)===56320?Ve(t,((a&1023)<<10)+(i&1023)+65536):(Ve(t,a),r--)}else Ve(t,a)}return t},Ic=function(e){return e+22+75*(e<26)},Vb=function(e,t,r){var n=0;for(e=r?_t(e/Ub):e>>1,e+=_t(e/t);e>La*Di>>1;)e=_t(e/La),n+=mr;return _t(n+(La+1)*e/(e+xb))},Zb=function(e){var t=[];e=Wb(e);var r=e.length,n=Mb,a=0,i=Db,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&Ve(t,Na(s));var u=t.length,f=u;for(u&&Ve(t,Fb);f<r;){var l=ja;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>_t((ja-a)/c))throw new Sc(bc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>ja)throw new Sc(bc);if(s===n){for(var d=a,v=mr;;){var h=v<=i?jf:v>=i+Di?Di:v-i;if(d<h)break;var b=d-h,g=mr-h;Ve(t,Na(Ic(h+b%g))),d=_t(b/g),v+=mr}Ve(t,Na(Ic(d))),i=Vb(a,c,f===u),a=0,f++}}a++,n++}return Nf(t,"")},Jb=function(e){var t=[],r=Gb(Hb(Kb(e),Lf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],Ve(t,zb(Bb,a)?"xn--"+Zb(a):a);return Nf(t,".")},Yb=Y,xo=te,Xb=Vn,Uo=G,Tc=Jt,Se=H,Pn=be,de=Zn,qb=Eo,Mi=ge,Do=ib,St=Nb,$e=Yn,Qb=If.codeAt,eS=Jb,Ue=ze,tS=Zt,rS=pt,xf=Tw,Uf=Vt,nS=Uf.set,En=Uf.getterFor("URL"),aS=xf.URLSearchParams,iS=xf.getState,ar=Uo.URL,Fi=Uo.TypeError,On=Uo.parseInt,oS=Math.floor,Pc=Math.pow,me=Se("".charAt),Pe=Se(/./.exec),lr=Se([].join),sS=Se(1 .toString),cS=Se([].pop),Pt=Se([].push),xa=Se("".replace),uS=Se([].shift),lS=Se("".split),gr=Se("".slice),kn=Se("".toLowerCase),fS=Se([].unshift),dS="Invalid authority",Ua="Invalid scheme",qe="Invalid host",Ec="Invalid port",Df=/[a-z]/i,vS=/[\d+-.a-z]/i,Bi=/\d/,hS=/^0x/i,pS=/^[0-7]+$/,mS=/^\d+$/,Mf=/^[\da-f]+$/i,gS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yS=/[\0\t\n\r #/:<>?@[\\\]^|]/,wS=/^[\u0000-\u0020]+/,bS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,SS=/[\t\n\r]/g,ve,$S=function(e){var t=lS(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&me(i,0)==="0"&&(o=Pe(hS,i)?16:8,i=gr(i,o===8?1:2)),i==="")s=0;else{if(!Pe(o===10?mS:o===8?pS:Mf,i))return e;s=On(i,o)}Pt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Pc(256,5-r))return null}else if(s>255)return null;for(u=cS(n),a=0;a<n.length;a++)u+=n[a]*Pc(256,3-a);return u},IS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return me(e,a)};if(d()===":"){if(me(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Pe(Mf,d());)i=i*16+On(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Pe(Bi,d()))return;for(;Pe(Bi,d());){if(f=On(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},TS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},ir=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)fS(t,e%256),e=oS(e/256);return lr(t,".")}if(typeof e=="object"){for(t="",n=TS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=sS(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},mn={},Ff=Do({},mn,{" ":1,'"':1,"<":1,">":1,"`":1}),Bf=Do({},Ff,{"#":1,"?":1,"{":1,"}":1}),Da=Do({},Bf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),He=function(e,t){var r=Qb(e,0);return r>32&&r<127&&!Mi(t,e)?e:encodeURIComponent(e)},Vr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},fr=function(e,t){var r;return e.length===2&&Pe(Df,me(e,0))&&((r=me(e,1))===":"||!t&&r==="|")},Oc=function(e){var t;return e.length>1&&fr(gr(e,0,2))&&(e.length===2||(t=me(e,2))==="/"||t==="\\"||t==="?"||t==="#")},PS=function(e){return e==="."||kn(e)==="%2e"},ES=function(e){return e=kn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ma={},kc={},Fa={},_c={},Rc={},Ba={},Cc={},Ac={},Zr={},Jr={},za={},Ha={},Ga={},Ka={},jc={},Wa={},$t={},Ce={},Lc={},Qe={},xe={},Mo=function(e,t,r){var n=Ue(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Fi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Mo(r,!0)),i=this.parse(n,null,a),i)throw new Fi(i);o=iS(new aS),o.bindURL(this),this.searchParams=o}};Mo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ma,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ue(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=xa(e,wS,""),e=xa(e,bS,"$1")),e=xa(e,SS,""),l=St(e);i<=l.length;){switch(c=l[i],a){case Ma:if(c&&Pe(Df,c))o+=kn(c),a=kc;else{if(t)return Ua;a=Fa;continue}break;case kc:if(c&&(Pe(vS,c)||c==="+"||c==="-"||c==="."))o+=kn(c);else if(c===":"){if(t&&(n.isSpecial()!==Mi(Vr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Vr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ka:n.isSpecial()&&r&&r.scheme===n.scheme?a=_c:n.isSpecial()?a=Ac:l[i+1]==="/"?(a=Rc,i++):(n.cannotBeABaseURL=!0,Pt(n.path,""),a=Lc)}else{if(t)return Ua;o="",a=Fa,i=0;continue}break;case Fa:if(!r||r.cannotBeABaseURL&&c!=="#")return Ua;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=$e(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=xe;break}a=r.scheme==="file"?Ka:Ba;continue;case _c:if(c==="/"&&l[i+1]==="/")a=Zr,i++;else{a=Ba;continue}break;case Rc:if(c==="/"){a=Jr;break}else{a=Ce;continue}case Ba:if(n.scheme=r.scheme,c===ve)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Cc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.query="",a=Qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.query=r.query,n.fragment="",a=xe;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=$e(r.path),n.path.length--,a=Ce;continue}break;case Cc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Zr;else if(c==="/")a=Jr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ce;continue}break;case Ac:if(a=Zr,c!=="/"||me(o,i+1)!=="/")continue;i++;break;case Zr:if(c!=="/"&&c!=="\\"){a=Jr;continue}break;case Jr:if(c==="@"){s&&(o="%40"+o),s=!0,d=St(o);for(var h=0;h<d.length;h++){var b=d[h];if(b===":"&&!f){f=!0;continue}var g=He(b,Da);f?n.password+=g:n.username+=g}o=""}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return dS;i-=St(o).length+1,o="",a=za}else o+=c;break;case za:case Ha:if(t&&n.scheme==="file"){a=Wa;continue}else if(c===":"&&!u){if(o==="")return qe;if(v=n.parseHost(o),v)return v;if(o="",a=Ga,t===Ha)return}else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return qe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=$t,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ga:if(Pe(Bi,c))o+=c;else if(c===ve||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var P=On(o,10);if(P>65535)return Ec;n.port=n.isSpecial()&&P===Vr[n.scheme]?null:P,o=""}if(t)return;a=$t;continue}else return Ec;break;case Ka:if(n.scheme="file",c==="/"||c==="\\")a=jc;else if(r&&r.scheme==="file")switch(c){case ve:n.host=r.host,n.path=$e(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=$e(r.path),n.query="",a=Qe;break;case"#":n.host=r.host,n.path=$e(r.path),n.query=r.query,n.fragment="",a=xe;break;default:Oc(lr($e(l,i),""))||(n.host=r.host,n.path=$e(r.path),n.shortenPath()),a=Ce;continue}else{a=Ce;continue}break;case jc:if(c==="/"||c==="\\"){a=Wa;break}r&&r.scheme==="file"&&!Oc(lr($e(l,i),""))&&(fr(r.path[0],!0)?Pt(n.path,r.path[0]):n.host=r.host),a=Ce;continue;case Wa:if(c===ve||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&fr(o))a=Ce;else if(o===""){if(n.host="",t)return;a=$t}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=$t}continue}else o+=c;break;case $t:if(n.isSpecial()){if(a=Ce,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=Qe;else if(!t&&c==="#")n.fragment="",a=xe;else if(c!==ve&&(a=Ce,c!=="/"))continue;break;case Ce:if(c===ve||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(ES(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Pt(n.path,"")):PS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Pt(n.path,""):(n.scheme==="file"&&!n.path.length&&fr(o)&&(n.host&&(n.host=""),o=me(o,0)+":"),Pt(n.path,o)),o="",n.scheme==="file"&&(c===ve||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)uS(n.path);c==="?"?(n.query="",a=Qe):c==="#"&&(n.fragment="",a=xe)}else o+=He(c,Bf);break;case Lc:c==="?"?(n.query="",a=Qe):c==="#"?(n.fragment="",a=xe):c!==ve&&(n.path[0]+=He(c,mn));break;case Qe:!t&&c==="#"?(n.fragment="",a=xe):c!==ve&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=He(c,mn));break;case xe:c!==ve&&(n.fragment+=He(c,Ff));break}i++}},parseHost:function(e){var t,r,n;if(me(e,0)==="["){if(me(e,e.length-1)!=="]"||(t=IS(gr(e,1,-1)),!t))return qe;this.host=t}else if(this.isSpecial()){if(e=eS(e),Pe(gS,e)||(t=$S(e),t===null))return qe;this.host=t}else{if(Pe(yS,e))return qe;for(t="",r=St(e),n=0;n<r.length;n++)t+=He(r[n],mn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Mi(Vr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!fr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=ir(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+lr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Fi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Dt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+ir(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ue(e)+":",Ma)},getUsername:function(){return this.username},setUsername:function(e){var t=St(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=He(t[r],Da)}},getPassword:function(){return this.password},setPassword:function(e){var t=St(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=He(t[r],Da)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ir(e):ir(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,za)},getHostname:function(){var e=this.host;return e===null?"":ir(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getPort:function(){var e=this.port;return e===null?"":Ue(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ue(e),e===""?this.port=null:this.parse(e,Ga))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+lr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,$t))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ue(e),e===""?this.query=null:(me(e,0)==="?"&&(e=gr(e,1)),this.query="",this.parse(e,Qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ue(e),e===""){this.fragment=null;return}me(e,0)==="#"&&(e=gr(e,1)),this.fragment="",this.parse(e,xe)},update:function(){this.query=this.searchParams.serialize()||null}};var Dt=function(t){var r=qb(this,ne),n=rS(arguments.length,1)>1?arguments[1]:void 0,a=nS(r,new Mo(t,!1,n));xo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},ne=Dt.prototype,he=function(e,t){return{get:function(){return En(this)[e]()},set:t&&function(r){return En(this)[t](r)},configurable:!0,enumerable:!0}};xo&&(de(ne,"href",he("serialize","setHref")),de(ne,"origin",he("getOrigin")),de(ne,"protocol",he("getProtocol","setProtocol")),de(ne,"username",he("getUsername","setUsername")),de(ne,"password",he("getPassword","setPassword")),de(ne,"host",he("getHost","setHost")),de(ne,"hostname",he("getHostname","setHostname")),de(ne,"port",he("getPort","setPort")),de(ne,"pathname",he("getPathname","setPathname")),de(ne,"search",he("getSearch","setSearch")),de(ne,"searchParams",he("getSearchParams")),de(ne,"hash",he("getHash","setHash")));Pn(ne,"toJSON",function(){return En(this).serialize()},{enumerable:!0});Pn(ne,"toString",function(){return En(this).serialize()},{enumerable:!0});if(ar){var Nc=ar.createObjectURL,xc=ar.revokeObjectURL;Nc&&Pn(Dt,"createObjectURL",Tc(Nc,ar)),xc&&Pn(Dt,"revokeObjectURL",Tc(xc,ar))}tS(Dt,"URL");Yb({global:!0,constructor:!0,forced:!Xb,sham:!xo},{URL:Dt});var OS=Y,kS=we,zf=Q,_S=pt,Uc=ze,RS=Vn,Fo=kS("URL"),CS=RS&&zf(function(){Fo.canParse()}),AS=zf(function(){return Fo.canParse.length!==1});OS({target:"URL",stat:!0,forced:!CS||AS},{canParse:function(t){var r=_S(arguments.length,1),n=Uc(t),a=r<2||arguments[1]===void 0?void 0:Uc(arguments[1]);try{return!!new Fo(n,a)}catch{return!1}}});var jS=Y,LS=we,NS=pt,Dc=ze,xS=Vn,US=LS("URL");jS({target:"URL",stat:!0,forced:!xS},{parse:function(t){var r=NS(arguments.length,1),n=Dc(t),a=r<2||arguments[1]===void 0?void 0:Dc(arguments[1]);try{return new US(n,a)}catch{return null}}});var DS=Y,MS=re;DS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return MS(URL.prototype.toString,this)}});var FS=jo;FS.URL;var BS={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zS=Hn,Va=zS("span").classList,Mc=Va&&Va.constructor&&Va.constructor.prototype,HS=Mc===Object.prototype?void 0:Mc,Fc=G,Hf=BS,GS=HS,dr=Xg,Bc=ht,KS=Zt,WS=ee,Za=WS("iterator"),Ja=dr.values,Gf=function(e,t){if(e){if(e[Za]!==Ja)try{Bc(e,Za,Ja)}catch{e[Za]=Ja}if(KS(e,t,!0),Hf[t]){for(var r in dr)if(e[r]!==dr[r])try{Bc(e,r,dr[r])}catch{e[r]=dr[r]}}}};for(var Ya in Hf)Gf(Fc[Ya]&&Fc[Ya].prototype,Ya);Gf(GS,"DOMTokenList");var VS=ye,ZS=ht,JS=function(e,t){VS(t)&&"cause"in t&&ZS(e,"cause",t.cause)},YS=H,Kf=Error,XS=YS("".replace),qS=function(e){return String(new Kf(e).stack)}("zxcasd"),Wf=/\n\s*at [^:]*:[^\n]*/,QS=Wf.test(qS),e$=function(e,t){if(QS&&typeof e=="string"&&!Kf.prepareStackTrace)for(;t--;)e=XS(e,Wf,"");return e},t$=Q,r$=vt,n$=!t$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",r$(1,7)),e.stack!==7):!0}),a$=ht,i$=e$,o$=n$,zc=Error.captureStackTrace,s$=function(e,t,r,n){o$&&(zc?zc(e,t):a$(e,"stack",i$(r,n)))},c$=Jt,u$=re,l$=ke,f$=Kn,d$=Of,v$=fo,Hc=Gn,h$=ko,p$=Jn,Gc=Ef,m$=TypeError,gn=function(e,t){this.stopped=e,this.result=t},Kc=gn.prototype,Ar=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=c$(t,n),f,l,c,d,v,h,b,g=function(T){return f&&Gc(f,"normal",T),new gn(!0,T)},P=function(T){return a?(l$(T),s?u(T[0],T[1],g):u(T[0],T[1])):s?u(T,g):u(T)};if(i)f=e.iterator;else if(o)f=e;else{if(l=p$(e),!l)throw new m$(f$(e)+" is not iterable");if(d$(l)){for(c=0,d=v$(e);d>c;c++)if(v=P(e[c]),v&&Hc(Kc,v))return v;return new gn(!1)}f=h$(e,l)}for(h=i?e.next:f.next;!(b=u$(h,f)).done;){try{v=P(b.value)}catch(T){Gc(f,"throw",T)}if(typeof v=="object"&&v&&Hc(Kc,v))return v}return new gn(!1)},g$=ze,y$=function(e,t){return e===void 0?arguments.length<2?"":t:g$(e)},w$=Y,b$=Gn,S$=$o,_n=Io,$$=Xl,Vf=Wn,Xa=ht,qa=vt,I$=JS,T$=s$,P$=Ar,E$=y$,O$=ee,k$=O$("toStringTag"),Rn=Error,_$=[].push,Mt=function(t,r){var n=b$(Qa,this),a;_n?a=_n(new Rn,n?S$(this):Qa):(a=n?this:Vf(Qa),Xa(a,k$,"Error")),r!==void 0&&Xa(a,"message",E$(r)),T$(a,Mt,a.stack,1),arguments.length>2&&I$(a,arguments[2]);var i=[];return P$(t,_$,{that:i}),Xa(a,"errors",i),a};_n?_n(Mt,Rn):$$(Mt,Rn,{name:!0});var Qa=Mt.prototype=Vf(Rn.prototype,{constructor:qa(1,Mt),message:qa(1,""),name:qa(1,"AggregateError")});w$({global:!0,constructor:!0,arity:2},{AggregateError:Mt});var R$=Oo,C$=Cr,A$=R$?{}.toString:function(){return"[object "+C$(this)+"]"},j$=Oo,L$=be,N$=A$;j$||L$(Object.prototype,"toString",N$,{unsafe:!0});var or=G,x$=kr,U$=Mn,Yr=function(e){return x$.slice(0,e.length)===e},Zf=function(){return Yr("Bun/")?"BUN":Yr("Cloudflare-Workers")?"CLOUDFLARE":Yr("Deno/")?"DENO":Yr("Node.js/")?"NODE":or.Bun&&typeof Bun.version=="string"?"BUN":or.Deno&&typeof Deno.version=="object"?"DENO":U$(or.process)==="process"?"NODE":or.window&&or.document?"BROWSER":"REST"}(),D$=Zf,Bo=D$==="NODE",M$=we,F$=Zn,B$=ee,z$=te,Wc=B$("species"),H$=function(e){var t=M$(e);z$&&t&&!t[Wc]&&F$(t,Wc,{configurable:!0,get:function(){return this}})},G$=Af,K$=Kn,W$=TypeError,V$=function(e){if(G$(e))return e;throw new W$(K$(e)+" is not a constructor")},Vc=ke,Z$=V$,J$=Fn,Y$=ee,X$=Y$("species"),Jf=function(e,t){var r=Vc(e).constructor,n;return r===void 0||J$(n=Vc(r)[X$])?t:Z$(n)},q$=Dn,Yf=Function.prototype,Zc=Yf.apply,Jc=Yf.call,Xf=typeof Reflect=="object"&&Reflect.apply||(q$?Jc.bind(Zc):function(){return Jc.apply(Zc,arguments)}),Q$=kr,qf=/(?:ipad|iphone|ipod).*applewebkit/i.test(Q$),ue=G,eI=Xf,tI=Jt,Yc=W,rI=ge,Qf=Q,Xc=Ml,nI=Yn,qc=Hn,aI=pt,iI=qf,oI=Bo,zi=ue.setImmediate,Hi=ue.clearImmediate,sI=ue.process,ei=ue.Dispatch,cI=ue.Function,Qc=ue.MessageChannel,uI=ue.String,ti=0,yr={},eu="onreadystatechange",Pr,et,ri,ni;Qf(function(){Pr=ue.location});var zo=function(e){if(rI(yr,e)){var t=yr[e];delete yr[e],t()}},ai=function(e){return function(){zo(e)}},tu=function(e){zo(e.data)},ru=function(e){ue.postMessage(uI(e),Pr.protocol+"//"+Pr.host)};(!zi||!Hi)&&(zi=function(t){aI(arguments.length,1);var r=Yc(t)?t:cI(t),n=nI(arguments,1);return yr[++ti]=function(){eI(r,void 0,n)},et(ti),ti},Hi=function(t){delete yr[t]},oI?et=function(e){sI.nextTick(ai(e))}:ei&&ei.now?et=function(e){ei.now(ai(e))}:Qc&&!iI?(ri=new Qc,ni=ri.port2,ri.port1.onmessage=tu,et=tI(ni.postMessage,ni)):ue.addEventListener&&Yc(ue.postMessage)&&!ue.importScripts&&Pr&&Pr.protocol!=="file:"&&!Qf(ru)?(et=ru,ue.addEventListener("message",tu,!1)):eu in qc("script")?et=function(e){Xc.appendChild(qc("script"))[eu]=function(){Xc.removeChild(this),zo(e)}}:et=function(e){setTimeout(ai(e),0)});var ed={set:zi,clear:Hi},td=function(){this.head=null,this.tail=null};td.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var rd=td,lI=kr,fI=/ipad|iphone|ipod/i.test(lI)&&typeof Pebble<"u",dI=kr,vI=/web0s(?!.*chrome)/i.test(dI),Ft=G,hI=cf,nu=Jt,ii=ed.set,pI=rd,mI=qf,gI=fI,yI=vI,oi=Bo,au=Ft.MutationObserver||Ft.WebKitMutationObserver,iu=Ft.document,ou=Ft.process,Xr=Ft.Promise,Gi=hI("queueMicrotask"),It,si,ci,qr,su;if(!Gi){var Qr=new pI,en=function(){var e,t;for(oi&&(e=ou.domain)&&e.exit();t=Qr.get();)try{t()}catch(r){throw Qr.head&&It(),r}e&&e.enter()};!mI&&!oi&&!yI&&au&&iu?(si=!0,ci=iu.createTextNode(""),new au(en).observe(ci,{characterData:!0}),It=function(){ci.data=si=!si}):!gI&&Xr&&Xr.resolve?(qr=Xr.resolve(void 0),qr.constructor=Xr,su=nu(qr.then,qr),It=function(){su(en)}):oi?It=function(){ou.nextTick(en)}:(ii=nu(ii,Ft),It=function(){ii(en)}),Gi=function(e){Qr.head||It(),Qr.add(e)}}var wI=Gi,bI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Xt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},SI=G,jr=SI.Promise,$I=G,wr=jr,II=W,TI=ql,PI=wo,EI=ee,cu=Zf,ui=kl;wr&&wr.prototype;var OI=EI("species"),Ki=!1,nd=II($I.PromiseRejectionEvent),kI=TI("Promise",function(){var e=PI(wr),t=e!==String(wr);if(!t&&ui===66)return!0;if(!ui||ui<51||!/native code/.test(e)){var r=new wr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[OI]=n,Ki=r.then(function(){})instanceof n,!Ki)return!0}return!t&&(cu==="BROWSER"||cu==="DENO")&&!nd}),Lr={CONSTRUCTOR:kI,REJECTION_EVENT:nd,SUBCLASSING:Ki},Le={},uu=_e,_I=TypeError,RI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new _I("Bad Promise constructor");t=n,r=a}),this.resolve=uu(t),this.reject=uu(r)};Le.f=function(e){return new RI(e)};var CI=Y,Cn=Bo,Ye=G,Bt=re,lu=be,fu=Io,AI=Zt,jI=H$,LI=_e,yn=W,NI=ye,xI=Eo,UI=Jf,ad=ed.set,Ho=wI,DI=bI,MI=Xt,FI=rd,id=Vt,An=jr,Go=Lr,od=Le,ea="Promise",sd=Go.CONSTRUCTOR,BI=Go.REJECTION_EVENT,zI=Go.SUBCLASSING,li=id.getterFor(ea),HI=id.set,Et=An&&An.prototype,rt=An,tn=Et,cd=Ye.TypeError,Wi=Ye.document,Ko=Ye.process,Vi=od.f,GI=Vi,KI=!!(Wi&&Wi.createEvent&&Ye.dispatchEvent),ud="unhandledrejection",WI="rejectionhandled",du=0,ld=1,VI=2,Wo=1,fd=2,rn,vu,ZI,hu,dd=function(e){var t;return NI(e)&&yn(t=e.then)?t:!1},vd=function(e,t){var r=t.value,n=t.state===ld,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===fd&&YI(t),t.rejection=Wo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new cd("Promise-chain cycle")):(f=dd(u))?Bt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},hd=function(e,t){e.notified||(e.notified=!0,Ho(function(){for(var r=e.reactions,n;n=r.get();)vd(n,e);e.notified=!1,t&&!e.rejection&&JI(e)}))},pd=function(e,t,r){var n,a;KI?(n=Wi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Ye.dispatchEvent(n)):n={promise:t,reason:r},!BI&&(a=Ye["on"+e])?a(n):e===ud&&DI("Unhandled promise rejection",r)},JI=function(e){Bt(ad,Ye,function(){var t=e.facade,r=e.value,n=pu(e),a;if(n&&(a=MI(function(){Cn?Ko.emit("unhandledRejection",r,t):pd(ud,t,r)}),e.rejection=Cn||pu(e)?fd:Wo,a.error))throw a.value})},pu=function(e){return e.rejection!==Wo&&!e.parent},YI=function(e){Bt(ad,Ye,function(){var t=e.facade;Cn?Ko.emit("rejectionHandled",t):pd(WI,t,e.value)})},Rt=function(e,t,r){return function(n){e(t,n,r)}},jt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=VI,hd(e,!0))},Zi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new cd("Promise can't be resolved itself");var n=dd(t);n?Ho(function(){var a={done:!1};try{Bt(n,t,Rt(Zi,a,e),Rt(jt,a,e))}catch(i){jt(a,i,e)}}):(e.value=t,e.state=ld,hd(e,!1))}catch(a){jt({done:!1},a,e)}}};if(sd&&(rt=function(t){xI(this,tn),LI(t),Bt(rn,this);var r=li(this);try{t(Rt(Zi,r),Rt(jt,r))}catch(n){jt(r,n)}},tn=rt.prototype,rn=function(t){HI(this,{type:ea,done:!1,notified:!1,parent:!1,reactions:new FI,rejection:!1,state:du,value:null})},rn.prototype=lu(tn,"then",function(t,r){var n=li(this),a=Vi(UI(this,rt));return n.parent=!0,a.ok=yn(t)?t:!0,a.fail=yn(r)&&r,a.domain=Cn?Ko.domain:void 0,n.state===du?n.reactions.add(a):Ho(function(){vd(a,n)}),a.promise}),vu=function(){var e=new rn,t=li(e);this.promise=e,this.resolve=Rt(Zi,t),this.reject=Rt(jt,t)},od.f=Vi=function(e){return e===rt||e===ZI?new vu(e):GI(e)},yn(An)&&Et!==Object.prototype)){hu=Et.then,zI||lu(Et,"then",function(t,r){var n=this;return new rt(function(a,i){Bt(hu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Et.constructor}catch{}fu&&fu(Et,tn)}CI({global:!0,constructor:!0,wrap:!0,forced:sd},{Promise:rt});AI(rt,ea,!1);jI(ea);var XI=ee,md=XI("iterator"),gd=!1;try{var qI=0,mu={next:function(){return{done:!!qI++}},return:function(){gd=!0}};mu[md]=function(){return this},Array.from(mu,function(){throw 2})}catch{}var QI=function(e,t){try{if(!t&&!gd)return!1}catch{return!1}var r=!1;try{var n={};n[md]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},e0=jr,t0=QI,r0=Lr.CONSTRUCTOR,ta=r0||!t0(function(e){e0.all(e).then(void 0,function(){})}),n0=Y,a0=re,i0=_e,o0=Le,s0=Xt,c0=Ar,u0=ta;n0({target:"Promise",stat:!0,forced:u0},{all:function(t){var r=this,n=o0.f(r),a=n.resolve,i=n.reject,o=s0(function(){var s=i0(r.resolve),u=[],f=0,l=1;c0(t,function(c){var d=f++,v=!1;l++,a0(s,r,c).then(function(h){v||(v=!0,u[d]=h,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var l0=Y,f0=Lr.CONSTRUCTOR,Ji=jr,d0=we,v0=W,h0=be,gu=Ji&&Ji.prototype;l0({target:"Promise",proto:!0,forced:f0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(v0(Ji)){var yu=d0("Promise").prototype.catch;gu.catch!==yu&&h0(gu,"catch",yu,{unsafe:!0})}var p0=Y,m0=re,g0=_e,y0=Le,w0=Xt,b0=Ar,S0=ta;p0({target:"Promise",stat:!0,forced:S0},{race:function(t){var r=this,n=y0.f(r),a=n.reject,i=w0(function(){var o=g0(r.resolve);b0(t,function(s){m0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var $0=Y,I0=Le,T0=Lr.CONSTRUCTOR;$0({target:"Promise",stat:!0,forced:T0},{reject:function(t){var r=I0.f(this),n=r.reject;return n(t),r.promise}});var P0=ke,E0=ye,O0=Le,yd=function(e,t){if(P0(e),E0(t)&&t.constructor===e)return t;var r=O0.f(e),n=r.resolve;return n(t),r.promise},k0=Y,_0=we,R0=Lr.CONSTRUCTOR,C0=yd;_0("Promise");k0({target:"Promise",stat:!0,forced:R0},{resolve:function(t){return C0(this,t)}});var A0=Y,j0=re,L0=_e,N0=Le,x0=Xt,U0=Ar,D0=ta;A0({target:"Promise",stat:!0,forced:D0},{allSettled:function(t){var r=this,n=N0.f(r),a=n.resolve,i=n.reject,o=x0(function(){var s=L0(r.resolve),u=[],f=0,l=1;U0(t,function(c){var d=f++,v=!1;l++,j0(s,r,c).then(function(h){v||(v=!0,u[d]={status:"fulfilled",value:h},--l||a(u))},function(h){v||(v=!0,u[d]={status:"rejected",reason:h},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var M0=Y,F0=re,B0=_e,z0=we,H0=Le,G0=Xt,K0=Ar,W0=ta,wu="No one promise resolved";M0({target:"Promise",stat:!0,forced:W0},{any:function(t){var r=this,n=z0("AggregateError"),a=H0.f(r),i=a.resolve,o=a.reject,s=G0(function(){var u=B0(r.resolve),f=[],l=0,c=1,d=!1;K0(t,function(v){var h=l++,b=!1;c++,F0(u,r,v).then(function(g){b||d||(d=!0,i(g))},function(g){b||d||(b=!0,f[h]=g,--c||o(new n(f,wu)))})}),--c||o(new n(f,wu))});return s.error&&o(s.value),a.promise}});var V0=Y,Z0=Le;V0({target:"Promise",stat:!0},{withResolvers:function(){var t=Z0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var J0=Y,jn=jr,Y0=Q,wd=we,bd=W,X0=Jf,bu=yd,q0=be,Yi=jn&&jn.prototype,Q0=!!jn&&Y0(function(){Yi.finally.call({then:function(){}},function(){})});J0({target:"Promise",proto:!0,real:!0,forced:Q0},{finally:function(e){var t=X0(this,wd("Promise")),r=bd(e);return this.then(r?function(n){return bu(t,e()).then(function(){return n})}:e,r?function(n){return bu(t,e()).then(function(){throw n})}:e)}});if(bd(jn)){var Su=wd("Promise").prototype.finally;Yi.finally!==Su&&q0(Yi,"finally",Su,{unsafe:!0})}var eT=jo;eT.Promise;var tT=Y,rT=G,nT=Xf,aT=Yn,iT=Le,oT=_e,Sd=Xt,fi=rT.Promise,$u=!1,sT=!fi||!fi.try||Sd(function(){fi.try(function(e){$u=e===8},8)}).error||!$u;tT({target:"Promise",stat:!0,forced:sT},{try:function(e){var t=arguments.length>1?aT(arguments,1):[],r=iT.f(this),n=Sd(function(){return nT(oT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function Xe(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Ae(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Zo(e,t){return e(t={exports:{}},t.exports),t.exports}var tt=Zo(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Vo(tt);var cT=Vo(Zo(function(e,t){var r=nt&&nt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(h,b){function g(w){try{T(v.next(w))}catch(p){b(p)}}function P(w){try{T(v.throw(w))}catch(p){b(p)}}function T(w){w.done?h(w.value):new d(function(p){p(w.value)}).then(g,P)}T((v=v.apply(l,c||[])).next())})},n=nt&&nt.__generator||function(l,c){var d,v,h,b,g={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]};return b={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function P(T){return function(w){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(h=2&p[0]?v.return:p[0]?v.throw||((h=v.return)&&h.call(v),0):v.next)&&!(h=h.call(v,p[1])).done)return h;switch(v=0,h&&(p=[2&p[0],h.value]),p[0]){case 0:case 1:h=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,v=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(h=g.trys,!((h=h.length>0&&h[h.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!h||p[1]>h[0]&&p[1]<h[3])){g.label=p[1];break}if(p[0]===6&&g.label<h[1]){g.label=h[1],h=p;break}if(h&&g.label<h[2]){g.label=h[2],g.ops.push(p);break}h[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch($){p=[6,$],v=0}finally{d=h=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([T,w])}}},a=nt;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",v=0;v<l;v++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var v,h,b,g,P,T,w;return n(this,function(p){switch(p.label){case 0:v=Date.now()+u(4),h=Date.now()+d,b=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<h?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(b)!==null?[3,5]:(P=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(b,JSON.stringify({id:this.id,iat:v,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(T=g.getItemSync(b))!==null&&(w=JSON.parse(T)).id===this.id&&w.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(b,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(h)];case 6:p.sent(),p.label=7;case 7:return v=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var v=this;return n(this,function(h){return setTimeout(function(){return r(v,void 0,void 0,function(){var b,g,P;return n(this,function(T){switch(T.label){case 0:return[4,tt.default().lock(d)];case 1:return T.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?o:this.storageHandler,(g=b.getItemSync(c))===null?(tt.default().unlock(d),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(P)),tt.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(tt.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(v){var h=!1,b=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),l.removeFromWaiting(P),clearTimeout(T),g=!0),!h){h=!0;var w=50-(Date.now()-b);w>0?setTimeout(v,w):v(null)}}window.addEventListener("storage",P),l.addToWaiting(P);var T=setTimeout(P,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,v,h,b;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(h=d.getItemSync(v))===null?[2]:(b=JSON.parse(h)).id!==this.id?[3,2]:[4,tt.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(v),tt.default().unlock(b.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,h=[],b=0;;){var g=v.keySync(b);if(g===null)break;h.push(g),b++}for(var P=!1,T=0;T<h.length;T++){var w=h[T];if(w.includes(i)){var p=v.getItemSync(w);if(p!==null){var $=JSON.parse(p);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(w),P=!0)}}}P&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const uT={timeoutInSeconds:60},$d={name:"auth0-spa-js",version:"2.1.3"},Id=()=>Date.now();let ce=class Xi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Xi.prototype)}static fromPayload({error:t,error_description:r}){return new Xi(t,r)}},lT=class Td extends ce{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Td.prototype)}},qi=class Pd extends ce{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Pd.prototype)}},fT=class Ed extends qi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Ed.prototype)}},dT=class Od extends ce{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Od.prototype)}},vT=class kd extends ce{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,kd.prototype)}},_d=class Rd extends ce{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Iu(t,["default"])}', scope: '${Iu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Rd.prototype)}};function Iu(e,t=[]){return e&&!t.includes(e)?e:""}const wn=()=>window.crypto,di=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(wn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Tu=e=>btoa(e),Qi=e=>{var{clientId:t}=e,r=Ae(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Pu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),hT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},pT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([hT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},mT=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},gT=async(e,t,r,n,a,i,o=1e4)=>a?mT(e,t,r,n,o,a,i):pT(e,n,o);async function yT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=Ae(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?Qi(u):JSON.stringify(u);return await async function(l,c,d,v,h,b,g){let P,T=null;for(let k=0;k<3;k++)try{P=await gT(l,d,v,h,b,g,c),T=null;break}catch(M){T=M}if(T)throw T;const w=P.json,{error:p,error_description:$}=w,O=Ae(w,["error","error_description"]),{ok:_}=P;if(!_){const k=$||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new vT(p,k,O.mfa_token):p==="missing_refresh_token"?new _d(d,v):new ce(p||"request_error",k)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||$d))}},t,s)}const nn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class eo{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new eo({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new eo({scope:r,audience:n,clientId:a})}},wT=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Cd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},bT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Id}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new it({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},ST=class{constructor(t,r,n){this.storage=t,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const sr=e=>typeof e=="number",$T=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],IT=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Pu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],$T.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Pu(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!sr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!sr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!sr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+r),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(t.claims.nbf!=null&&sr(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&sr(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ot=Zo(function(e,t){var r=nt&&nt.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var v=l[d].split("="),h=v.slice(1).join("=");h.charAt(0)==='"'&&(h=h.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=h.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Vo(ot),ot.encode,ot.parse,ot.getAll;var TT=ot.get,Ad=ot.set,jd=ot.remove;const Ot={get(e){const t=TT(e);if(t!==void 0)return JSON.parse(t)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r)}},PT={get(e){return Ot.get(e)||Ot.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Ad(`_legacy_${e}`,JSON.stringify(t),n),Ot.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),jd(e,r),Ot.remove(e,t),Ot.remove(`_legacy_${e}`,t)}},ET={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function OT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,v=l.length;d<v;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
+
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Eu,Ou,ku,vi,kT=(Eu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Ou=null,ku=!1,function(e){return vi=vi||OT(Eu,Ou,ku),new Worker(vi,e)});const hi={};let _T=class{constructor(t,r){this.cache=t,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(t),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(t){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(t),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}};const RT={memory:()=>new Cd().enclosedCache,localstorage:()=>new wT},_u=e=>RT[e],Ru=e=>{const{openUrl:t,onRedirect:r}=e,n=Ae(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},pi=new cT;let CT=class{constructor(t){let r,n;if(this.userCache=new Cd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await pi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!wn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(wn().subtle===void 0)throw new Error(`
|
|
3
3
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
4
|
-
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!_u(r))throw new Error(`Invalid cache location "${r}"`);n=_u(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Ot:TP,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:EP;var i;this.scope=nn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new SP(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Id,this.cacheManager=new bP(n,n.allKeys?void 0:new _P(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new kP)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||$d)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${Qi(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return IP({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=Pu(di()),i=Pu(di()),o=di(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await wn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,w,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:nn(c,d.scope),response_type:"code",response_mode:T||"query",state:v,nonce:p,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:w,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new dP(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new fP(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(ce.fromPayload(v.data.response));u(v.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ce("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Ru(t),{openUrl:a,fragment:i,appState:o}=n,s=Ae(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=Ae(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new ce("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new lP(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new ce("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:nn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=hi[o];return s||(s=i().finally(()=>{delete hi[o],s=null}),hi[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=Ae(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>pi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new qi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await pi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},r={}){var n;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:nn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},uP),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=Ae(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Qi(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Ru(t),{openUrl:n}=r,a=Ae(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ce("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((p,w,g=60)=>new Promise((T,P)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const O=setTimeout(()=>{P(new qi),h()},1e3*g);$=function(k){if(k.origin!=w||!k.data||k.data.type!=="authorization_response")return;const C=k.source;C&&C.close(),k.data.response.error?P(ce.fromPayload(k.data.response)):T(k.data.response),clearTimeout(O),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new ce("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:f,oauthTokenScope:v.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new it({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new _d(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=Ae(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new it({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new it({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await yP(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function AP(e){const t=new CP(e);return await t.checkSession(),t}var Oe=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Oe||{});const jP="sesamy.com",LP="sesamy.dev",NP="https://sesa.my",to="sesamyCacheTimestamp";function Me(e,t){return`https://${e}.${t==="dev"?LP:jP}`}let le,Ld,Nd=!1;const zt="sesamyAccessToken",mi="sesamyRefreshToken";async function Nr(){return new Promise((r,n)=>{let a=0;const i=()=>{Nd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function xP(e){if(!e)return null;const t=localStorage.getItem(mi);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(mi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(mi,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{xd()}}async function Jo(){const e=localStorage.getItem(zt);if(!e)return null;const t=Ud(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await xP(t);if(r)return r;localStorage.removeItem(zt)}return e}function Cu(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function UP(e){if(e.enabled===!1)return;Ld=e.organization;const t={domain:Me("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Cu(window.location.href)!==Cu(Me("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),le=await AP(t),window.location.search.includes("code="))try{await le.handleRedirectCallback();const r=await le.getUser();Xe(Oe.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Nd=!0}async function Yo(){return await Nr(),await Jo()?!0:le?le.isAuthenticated():!1}async function DP(){return await Nr(),await Jo()?{sub:"local",name:"Local User"}:le?le.getUser():null}async function Xo(e){if(await Nr(),localStorage.removeItem(zt),!le)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return le.loginWithRedirect({...e,authorizationParams:{organization:Ld,redirect_uri:window.location.href,...t}})}async function cr(e=!0){await Nr();const t=await Jo();if(t)return t;try{return le?await le.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function xd(e={}){if(await Nr(),localStorage.removeItem(zt),Xe(Oe.LOGOUT,{}),!!le)return le.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Ud(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function Dd(e){const t=Ud(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),Xe(Oe.AUTHENTICATED,t)}const MP=(e,t)=>t.skipDedupe||t.method!=="GET",FP=(e,t)=>t.method+"@"+e,BP=e=>e.clone(),Au=({skip:e=MP,key:t=FP,resolver:r=BP}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([f,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},zP=(e,t)=>e*t,HP=e=>e&&e.ok,ju=({delayTimer:e=500,delayRamp:t=zP,maxAttempts:r=10,until:n=HP,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(v,p)=>Promise.resolve(n(v,p)).then(w=>w?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((P={})=>{var b,h;g(u((b=P&&P.url)!==null&&b!==void 0?b:f,(h=P&&P.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},KP="application/json",Md="Content-Type",Pt=Symbol(),Fd=Symbol();function Lu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Md.toLowerCase()))===null||t===void 0?void 0:t[1]}function Nu(e){return/^application\/.*json.*/.test(e)}const st=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=st(o,i,r):n[a]=i,n},{...e})},Ht={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function GP(e,t=!1){Ht.options=t?e:st(Ht.options,e)}function WP(e,t=!1){Ht.polyfills=t?e:st(Ht.polyfills,e)}function VP(e){Ht.errorType=e}const ZP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Bd extends Error{}const JP=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=ZP(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[Pt]:b}}).then(b=>{if(!b.ok){const h=new Bd;if(h.cause=v,h.stack=h.stack+`
|
|
5
|
-
CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var O;if(h.message=$,a.errorType==="json"||((O=b.headers.get("Content-Type"))===null||O===void 0?void 0:O.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),w=b=>b.catch(h=>{const $=h.hasOwnProperty(Pt),O=$?h[Pt]:h,k=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||$&&f.has(Pt)&&f.get(Pt);if(k)return k(O,e);const C=f.get(Fd);if(C)return C(O,e);throw O}),g=b=>h=>w(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(Pt,b)}},P=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),T);return o.reduce((b,h)=>h(b,e),P)},YP={_url:"",_options:{},_config:Ht,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:st(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:st(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Md]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const r=new Map(this._catchers);return r.set(e,t),{...this,_catchers:r}},catcherFallback(e){return this.catcher(Fd,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Lu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Nu(a));return n=r?o?n.json(r,a):n.body(r):n,JP(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Lu(this._options.headers);return this.content(t||Nu(r)&&r||KP).body(JSON.stringify(e))}};function Be(e="",t={}){return{...YP,_url:e,_options:t}}Be.default=Be;Be.options=GP;Be.errorType=VP;Be.polyfills=WP;Be.WretchError=Bd;function Ie(){sessionStorage.removeItem(to),Xe(Oe.CLEAR_CACHE,{})}function xu(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function XP(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function qP(e,t){if(XP(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function QP(e,t){const r=new URL(`${Me("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=qP(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("itemSrc",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}function eT(e){const t=Me("api2",e.environment),r=S=>async(I,R)=>{let V=sessionStorage.getItem(to);V||(V=Date.now().toString(),sessionStorage.setItem(to,V));const se={...R,headers:{...R.headers,"Cache-Timestamp":V}};return S(I,se)},n=(S=!0)=>I=>async(R,V)=>{let se=null;if(se=await cr(S),!se){if(S)throw new Error("No access token available");return I(R,V)}const gt={...V,headers:{...V.headers,...se?{Authorization:`Bearer ${se}`}:{}}};return I(R,gt)},a=S=>(I,R)=>{if(R.headers.Authorization)return S(I,R);const V=localStorage.getItem("__anon_id"),se=btoa(`${V}:`),gt={...R,headers:{...R.headers,Authorization:`Basic ${se}`}};return S(I,gt)},i=Be(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Au(),ju({delayTimer:1e3,delayRamp:(S,I)=>S*I,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]),o=Be(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Au(),ju({delayTimer:1e3,delayRamp:(S,I)=>S*I,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(S){const I=await i.get("/entitlements").json();return I==null?void 0:I.find(R=>R.id===S)}async function f(S){return i.get(`/entitlements/${S}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(S){const I=await i.get("/contracts").json();return I==null?void 0:I.find(R=>R.id===S)}async function d(S){return(await i.post({},`/contracts/${S}/cancel`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function p(){return i.get("/bills").json()}async function w(S){const I=await i.get("/bills").json();return I==null?void 0:I.find(R=>R.id===S)}async function g(){return i.get("/transactions").json()}async function T(S){const I=await i.get("/transactions").json();return I==null?void 0:I.find(R=>R.id===S)}async function P(S,I){const R=await i.url(`/user-metadata/${S}`).put(I).json();return Xe(Oe.USER_ATTRIBUTE_CHANGED,{}),Ie(),R}async function b(S){const I=await i.url(`/user-metadata/${S}`).delete().res();return Ie(),I.ok}async function h(S){return(await i.url(`/user-metadata/${S}`).get().json())[S]}async function $(){return await i.url("/user-metadata").get().json()}async function O(){return await i.url("/tags").get().json()}async function k(S){const I=await i.url(`/tags/${S}`).delete().res();return Ie(),I.ok}async function C(S){const I=await i.url("/tags").post(S).res();return Xe(Oe.USER_ATTRIBUTE_CHANGED,{}),Ie(),I.ok}async function M(S){return(await o.url("/tallies").get().json())[S]}async function F(){return await o.url("/tallies").get().json()}async function Z(S){const I=await o.url(`/tallies/${S}`).delete().res();return Ie(),I.ok}async function L(S,I){return await o.url(`/tallies/${S}/push`).post(I).json()}async function U(S){return await i.url(`/products/${S}`).get().json()}async function z(){return await cr(!1)?await i.url("/profile").get().json():null}async function _(S){const I=await i.url("/profile").patch(S).res();return Ie(),I.ok}async function G(){return await i.url("/payment-issues").get().json()}async function X(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function Ne(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function m(S){const I=await cr(!1);if(!I)throw new Error("No access token available");const R=new URL(`${Me("spotify-oas",e.environment)}/sesamy-callback`);R.searchParams.set("access_token",I),R.searchParams.set("state",S),window.location.href=R.toString()}async function y(S){const I=await i.url(`/products/${S}/auto-onboard`).post().json();return I.length&&Ie(),I}async function E(S,I=3600){const{shortlink:R}=await Be(NP).post({url:S,ttl:I}).json();return R}async function N(S){const I=await cr(!1);let R;const V=S.language||xu();switch(S.target){case"account":R=new URL(`${Me("account",e.environment)}/${S.language||V}/subscriptions/${e.clientId}`),R.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":R=new URL(`${Me("consume",e.environment)}/${S.language||V}/@${e.clientId}/${S.sku}`),S.episodeId?R.href+=`/${S.episodeId}`:R.href+="/listen",R.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":R=QP(e,{language:V,...S});break;default:throw new Error("Invalid target")}return I&&(R.hash=`#access_token=${I}`),S.shorten?E(R.href,S.ttl):R.href}async function x(S){return(await o.url("/checkouts").post({language:xu(),...S,vendorId:e.clientId})).json()}async function D(S,I){return(await o.url(`/checkouts/${S}`).patch(I)).json()}async function J(S){return(await o.url(`/checkouts/${S}`).get()).json()}async function B(){const S=await cr(!1),I=new URL(`${Me("account",e.environment)}/subscriptions/${e.clientId}`);S&&(I.hash=`#access_token=${S}`),window.location.href=I.toString()}return{createCheckout:x,updateCheckout:D,getCheckout:J,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,cancelContract:d,getProfile:z,updateProfile:_,getSubscriptions:v,getBills:p,getBill:w,setUserMetadata:P,deleteUserMetadata:b,getUserMetadata:h,listUserMetadata:$,getTags:O,deleteTag:k,setTag:C,getTally:M,getTallies:F,deleteTally:Z,pushTally:L,getTransactions:g,getTransaction:T,getProduct:U,getPaymentIssues:G,autoOnboardProduct:y,isSpotifyLinked:X,unlinkSpotify:Ne,linkSpotify:m,generateLink:N,openHostedAccountPage:B}}const zd="@sesamy/sesamy-js",qo="1.19.1";function Uu(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var an="undefined",Du="object",ro=function(){},Hd="any",Kd="*",lt="__",Ln=typeof process<"u"?process:{};Ln.env&&Ln.env.NODE_ENV;var q=typeof document<"u";Ln.versions!=null&&Ln.versions.node!=null;typeof Deno<"u"&&Deno.core;q&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Gd(e,t){return t.charAt(0)[e]()+t.slice(1)}var tT=Gd.bind(null,"toUpperCase"),rT=Gd.bind(null,"toLowerCase");function nT(e){return Wd(e)?tT("null"):typeof e=="object"?sT(e):Object.prototype.toString.call(e).slice(8,-1)}function Nn(e,t){t===void 0&&(t=!0);var r=nT(e);return t?rT(r):r}function xr(e,t){return typeof t===e}var oe=xr.bind(null,"function"),Ze=xr.bind(null,"string"),Ct=xr.bind(null,"undefined"),aT=xr.bind(null,"boolean");xr.bind(null,"symbol");function Wd(e){return e===null}function iT(e){return Nn(e)==="number"&&!isNaN(e)}function Vd(e){return Nn(e)==="array"}function ie(e){if(!oT(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function oT(e){return e&&(typeof e=="object"||e!==null)}function sT(e){return oe(e.constructor)?e.constructor.name:null}function cT(e){return e instanceof Error||Ze(e.message)&&e.constructor&&iT(e.constructor.stackTraceLimit)}function Zd(e,t){if(typeof t!="object"||Wd(t))return!1;if(t instanceof e)return!0;var r=Nn(new e(""));if(cT(t))for(;t;){if(Nn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Zd.bind(null,TypeError);Zd.bind(null,SyntaxError);function ra(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?uT(e,t):r}function uT(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function na(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}na(ra,"form");na(ra,"button");na(ra,"input");na(ra,"select");function lT(e){return e?Vd(e)?e:[e]:[]}function Mu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function fT(){if(q){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function dT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vT(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Mu(r[1]),o=Mu(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(hT(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return q&&window.location.search.substring(1)}())}function hT(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function aa(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],a=15&r;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}function pT(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var br="global",Kt=lt+"global"+lt,Gt=typeof self===Du&&self.self===self&&self||typeof global===Du&&global.global===global&&global||void 0;function ft(e){return Gt[Kt][e]}function dt(e,t){return Gt[Kt][e]=t}function qt(e){delete Gt[Kt][e]}function Qt(e,t,r){var n;try{if(Qo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Gt[Kt]||(Gt[Kt]={});var on={};function Qo(e){if(typeof on[e]!==an)return on[e];try{var t=window[e];t.setItem(an,an),t.removeItem(an)}catch{return on[e]=!1}return on[e]=!0}function j(){return j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(this,arguments)}var Ge="function",Fe="undefined",mT="@@redux/"+Math.random().toString(36),Fu=function(){return typeof Symbol===Ge&&Symbol.observable||"@@observable"}(),sn=" != "+Ge;function Jd(e,t,r){var n;if(typeof t===Ge&&typeof r===Fe&&(r=t,t=void 0),typeof r!==Fe){if(typeof r!==Ge)throw new Error("enhancer"+sn);return r(Jd)(e,t)}if(typeof e!==Ge)throw new Error("reducer"+sn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ge)throw new Error("Listener"+sn);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var w=s.indexOf(v);s.splice(w,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===Fe)throw new Error("ActType "+Fe);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,w=0;w<p.length;w++)(0,p[w])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ge)throw new Error("next reducer"+sn);a=v,d({type:"@@redux/INIT"})}})[Fu]=function(){var v,p=c;return(v={subscribe:function(w){if(typeof w!="object")throw new TypeError("Observer != obj");function g(){w.next&&w.next(l())}return g(),{unsubscribe:p(g)}}})[Fu]=function(){return this},v},n}function gT(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Fe}function Wt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function yT(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=Wt.apply(void 0,i)(o.dispatch)})}}}var Je=lt+"anon_id",ct=lt+"user_id",Lt=lt+"user_traits",Ke="userId",At="anonymousId",bn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],no=["name","EVENTS","config","loaded"],A=bn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Bu=/^utm_/,zu=/^an_prop_/,Hu=/^an_trait_/;function wT(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Je,o.anonymousId),f||t(ct,o.userId),u.traits&&t(Lt,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,v=l.reduce(function(p,w){if(w.match(Bu)||w.match(/^(d|g)clid/)){var g=w.replace(Bu,"");p.campaign[g==="campaign"?"name":g]=i[w]}return w.match(zu)&&(p.props[w.replace(zu,"")]=i[w]),w.match(Hu)&&(p.traits[w.replace(Hu,"")]=i[w]),p},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function bT(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Je)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Je,Lt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Ku(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Je),traits:e.getItem(Lt)}}var ao=function(e){return lt+"TEMP"+lt+e};function ST(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([ct,Lt,Je].forEach(function(v){n(v)}),[Ke,At,"traits"].forEach(function(v){qt(ao(v))})),s.type===A.identify){a(Je)||r(Je,aa());var c=a(ct),d=a(Lt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(Lt,j({},d,f))}return o(s)}}}}var vr={};function Gu(e,t){vr[e]&&oe(vr[e])&&(vr[e](t),delete vr[e])}function Yd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Yd(e,t,r-10).then(n,a)})})}function $T(e){return{abort:e}}function Xd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,w=a[v][p];if(w&&oe(w)){var g,T=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[Ke,At].reduce(function(O,k){return h.hasOwnProperty(k)&&$[k]&&$[k]!==h[k]&&(O[k]=$[k]),O},h)}(d.payload,u),P=n[T.meta.rid];if(!P&&(g=w({payload:T,config:o[v].config,instance:r,abort:$T}))&&ie(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!P){var b=p+":"+v;e.dispatch(j({},T,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var gi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Nt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,T){return function(P,b,h){var $=b.config,O=b.name,k=O+"."+P.type;h&&(k=h.event);var C=P.type.match(Nt)?function(M,F,Z,L,U){return function(z,_){var G=L?L.name:M,X=_&&Er(_)?_:Z;if(L&&(!(X=_&&Er(_)?_:[M]).includes(M)||X.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(X)+" input valid");return j({},U,{abort:{reason:z,plugins:X,caller:F,_:G}})}}(O,k,T,h,P):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(P,k);return{payload:IT(P),instance:g,config:$||{},abort:C}}}(n,v),w=t.exact.reduce(function(g,T){var P=T.pluginName,b=T.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[P].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+P]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,T,P){try{var b=T.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var O=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(k,C,M){try{return Promise.resolve(k).then(function(F){return C.method&&oe(C.method)?(function(z,_){var G=qu(z);if(G&&G.name===_){var X=qu(G.method);throw new Error([_+" plugin is calling method "+z,"Plugins cant call self","Use "+G.method+" "+(X?"or "+X.method:"")+" in "+_+" plugin insteadof "+z].join(`
|
|
6
|
-
`))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(Z=F,L=b,U=C.pluginName,function(z,_){return j({},Z,{abort:{reason:z,plugins:_||[L],caller:c,from:U||L}})}),config:Zu(C.pluginName,f,i),plugins:f})).then(function(z){var _=ie(z)?z:{};return Promise.resolve(j({},F,_))})):F;var Z,L,U})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(k){h[b]=k});h[b]=r}();return O&&O.then?O.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,P,b){try{var h=t.exact.length===b+1,$=P.pluginName,O=i[$];return Promise.resolve(T).then(function(k){var C=g[$]?g[$]:{};if(d&&(C=k),wi(C,$))return yi({data:C,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(k);if(wi(k,$))return h&&yi({data:k,method:c,instance:n,store:s}),Promise.resolve(k);if(w.hasOwnProperty($)&&w[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(k);var M=p(g[$],i[$]);return Promise.resolve(O[c]({abort:M.abort,payload:C,instance:n,config:Zu($,f,i),plugins:f})).then(function(F){var Z=ie(F)?F:{},L=j({},k,Z),U=g[$];if(wi(U,$))yi({data:U,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(Wu)&&!c.match(Vu)&&n.dispatch(j({},d?L:C,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(k){return Promise.reject(k)}},Promise.resolve(r))).then(function(T){if(!(c.match(Nt)||c.match(/^registerPlugin/)||c.match(Vu)||c.match(Wu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var P=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});qd(T,t.exact.length)&&!c.match(/End$/)&&(P=j({},P,{type:T.type+"Aborted"})),s.dispatch(P)}return T})})}catch(g){return Promise.reject(g)}},Nt=/Start$/,Wu=/^bootstrap/,Vu=/^ready/;function yi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Zu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Ju(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Yu(e,t){var r=e.replace(Nt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function wi(e,t){var r=e.abort;return!!r&&(r===!0||Xu(r,t)||r&&Xu(r.plugins,t))}function qd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ze(r))return!0;var n=r.plugins;return Er(r)&&r.length===t||Er(n)&&n.length===t}function Er(e){return Array.isArray(e)}function Xu(e,t){return!(!e||!Er(e))&&e.includes(t)}function qu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function IT(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function PT(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Gu(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),w=[],g=[],T=o.disabled,P=p.map(function(h){var $=h.loaded,O=h.name,k=h.config;return Yd(h,function(){return $({config:k})},1e4).then(function(C){return n[O]||(a.dispatch({type:A.pluginReadyType(O),name:O,events:Object.keys(h).filter(function(M){return!no.includes(M)})}),n[O]=!0),w=w.concat(O),h}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(P).then(function(h){var $={plugins:w,failed:g,disabled:T};setTimeout(function(){v.length===P.length+T.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Xd(a,t,e)},0),Promise.resolve(function(h,$,O,k,C){try{var M=oe($)?$():$,F=h.type,Z=F.replace(Nt,"");if(h._&&h._.called)return Promise.resolve(h);var L=O.getState(),U=(G=M,(X=L.plugins)===void 0&&(X={}),(Ne=h.options)===void 0&&(Ne={}),Object.keys(G).filter(function(m){var y=Ne.plugins||{};return aT(y[m])?y[m]:y.all!==!1&&(!X[m]||X[m].enabled!==!1)}).map(function(m){return G[m]}));F===A.initializeStart&&h.fromEnable&&(U=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=U.map(function(m){return m.name}),_=function(m,y,E){var N=Yu(m).map(function(x){return Ju(x,y)});return y.reduce(function(x,D){var J=D.name,B=Yu(m,J).map(function(V){return Ju(V,y)}),S=B[0],I=B[1],R=B[2];return S.length&&(x.beforeNS[J]=S),I.length&&(x.duringNS[J]=I),R.length&&(x.afterNS[J]=R),x},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,U);return Promise.resolve(gi({action:h,data:{exact:_.before,namespaced:_.beforeNS},state:L,allPlugins:M,allMatches:_,instance:O,store:k,EVENTS:C})).then(function(m){function y(){var x=function(){if(F.match(Nt))return Promise.resolve(gi({action:j({},E,{type:Z+"End"}),data:{exact:_.after,namespaced:_.afterNS},state:L,allPlugins:M,allMatches:_,instance:O,store:k,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Gu(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return m}):m}if(qd(m,z.length))return m;var E,N=function(){if(F!==Z)return Promise.resolve(gi({action:j({},m,{type:Z}),data:{exact:_.during,namespaced:_.duringNS},state:L,allPlugins:M,allMatches:_,instance:O,store:k,EVENTS:C})).then(function(x){E=x});E=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var G,X,Ne}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function TT(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var ET=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Wt.apply(void 0,o)(n)(a)}}}}};function OT(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Qu(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Qu(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,el(r.plugins,!1,t));case A.enablePlugin:return j({},t,el(r.plugins,!0,t));default:return t}}}function Qu(e,t){return e.substring(t.length+1,e.length)}function el(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Qd(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var kT={last:{},history:[]};function _T(e,t){e===void 0&&(e=kT);var r=t.options,n=t.meta;if(t.type===A.track){var a=Qd(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var RT={actions:[]};function CT(e,t){e===void 0&&(e=RT);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var ev=/#.*$/;function AT(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(ev,""):"")}var tv,rv,nv,av,jT=function(e){if(e===void 0&&(e={}),!q)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var v=function(){if(q){for(var p,w=document.getElementsByTagName("link"),g=0;p=w[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(ev,"")}(f),c={title:r,url:l,path:AT(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},LT={last:{},history:[]};function NT(e,t){e===void 0&&(e=LT);var r=t.options;if(t.type===A.page){var n=Qd(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}tv=function(){if(!q)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),rv=q?document.referrer:null,nv=fT(),av=dT();var tl={initialized:!1,sessionId:aa(),app:null,version:null,debug:!1,offline:!!q&&!navigator.onLine,os:{name:tv},userAgent:q?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:av,locale:nv,campaign:{},referrer:rv};function xT(e,t){e===void 0&&(e=tl);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},tl,e,{initialized:!0})}}var UT=["plugins","reducers","storage"];function DT(e,t,r){if(q){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function MT(e){var t=DT.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function iv(){return dt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Gt[Kt].analytics.push(o.action||o),i(o)}})}}}function rl(e){return function(){return Wt(Wt.apply(null,arguments),iv())}}function bi(e){return e?Vd(e)?e:[e]:[]}function nl(e,t,r){e===void 0&&(e={});var n,a,i=aa();return t&&(vr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function FT(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var E=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,J){var B;return D[J]=(B=y.methods[J],function(){for(var S=Array.prototype.slice.call(arguments),I=new Array(B.length),R=0;R<S.length;R++)I[R]=S[R];return I[I.length]=$,B.apply({instance:$},I)}),D},{}),delete y.methods);var N=Object.keys(y).concat(E),x=new Set(m.events.concat(N));if(m.events=Array.from(x),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:qt},i=function(m){return function(y,E,N){return E.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:Ku(m)[y]||ft(ao(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!no.includes(m)}).sort(),u=new Set(s.concat(bn).filter(function(m){return!no.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new ET,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,w=function(){throw new Error("Abort disabled inListener")},g=vT(),T=Ku(a),P=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});P.anonymousId||(P.anonymousId=aa());var b=j({enable:function(m,y){return new Promise(function(E){_.dispatch({type:A.enablePlugin,plugins:bi(m),_:{originalAction:A.enablePlugin}},E,[y])})},disable:function(m,y){return new Promise(function(E){_.dispatch({type:A.disablePlugin,plugins:bi(m),_:{originalAction:A.disablePlugin}},E,[y])})}},n.methods),h=!1,$={identify:function(m,y,E,N){try{var x=Ze(m)?m:null,D=ie(m)?m:y,J=E||{},B=$.user();dt(ao(Ke),x);var S=x||D.userId||i(Ke,$,D);return Promise.resolve(new Promise(function(I){_.dispatch(j({type:A.identifyStart,userId:S,traits:D||{},options:J,anonymousId:B.anonymousId},B.id&&B.id!==x&&{previousId:B.id}),I,[y,E,N])}))}catch(I){return Promise.reject(I)}},track:function(m,y,E,N){try{var x=ie(m)?m.event:m;if(!x||!Ze(x))throw new Error("EventMissing");var D=ie(m)?m:y||{},J=ie(E)?E:{};return Promise.resolve(new Promise(function(B){_.dispatch({type:A.trackStart,event:x,properties:D,options:J,userId:i(Ke,$,y),anonymousId:i(At,$,y)},B,[y,E,N])}))}catch(B){return Promise.reject(B)}},page:function(m,y,E){try{var N=ie(m)?m:{},x=ie(y)?y:{};return Promise.resolve(new Promise(function(D){_.dispatch({type:A.pageStart,properties:jT(N),options:x,userId:i(Ke,$,N),anonymousId:i(At,$,N)},D,[m,y,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Ke||m==="id")return i(Ke,$);if(m===At||m==="anonId")return i(At,$);var y=$.getState("user");return m?Uu(y,m):y},reset:function(m){return new Promise(function(y){_.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var N=function(B){return function(S){return function(I){return I.type.match(E)&&y({payload:I,instance:$,plugins:o}),S(I)}}},x=function(B){return function(S){return function(I){return I.type.match(E)||y({payload:I,instance:$,plugins:o}),S(I)}}};return d(N,cn),d(x,un),function(){v(N,cn),v(x,un)}}var D=m.match(E)?cn:un,J=function(B){return function(S){return function(I){return I.type===m&&y({payload:I,instance:$,plugins:o,abort:w}),S(I)}}};return d(J,D),function(){return v(J,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var E=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:w}),E()});return E},getState:function(m){var y=_.getState();return m?Uu(y,m):Object.assign({},y)},dispatch:function(m){var y=Ze(m)?{type:m}:m;if(bn.includes(y.type))throw new Error("reserved action "+y.type);var E=j({},y,{_:j({originalAction:y.type},m._||{})});_.dispatch(E)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,E){_.dispatch({type:A.setItemStart,key:m,value:y,options:E})},removeItem:function(m,y){_.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Je,m,y)},events:{core:bn,plugins:s}},O=n.middlewares.concat([function(m){return function(y){return function(E){return E.meta||(E.meta=nl()),y(E)}}},p(cn),PT($,l,{all:f,plugins:s}),TT(a),wT($),ST($),p(un)]),k={context:xT,user:bT(a),page:NT,track:_T,plugins:OT(l),queue:CT},C=Wt,M=Wt;if(q&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?iv():ie(typeof arguments[0])?rl():rl().apply(null,arguments)}}var Z,L=function(m){return Object.keys(m).reduce(function(y,E){return UT.includes(E)||(y[E]=m[E]),y},{})}(e),U=n.pluginsArray.reduce(function(m,y){var E=y.name,N=y.config,x=y.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!x({config:N}),config:N},m},{}),z={context:L,user:P,plugins:U},_=Jd(function(m){for(var y=Object.keys(m),E={},N=0;N<y.length;N++){var x=y[N];typeof m[x]===Ge&&(E[x]=m[x])}var D,J=Object.keys(E);try{(function(B){Object.keys(B).forEach(function(S){var I=B[S];if(typeof I(void 0,{type:"@@redux/INIT"})===Fe||typeof I(void 0,{type:mT})===Fe)throw new Error("reducer "+S+" "+Fe)})})(E)}catch(B){D=B}return function(B,S){if(B===void 0&&(B={}),D)throw D;for(var I=!1,R={},V=0;V<J.length;V++){var se=J[V],gt=B[se],sa=(0,E[se])(gt,S);if(typeof sa===Fe){var wv=gT(se,S);throw new Error(wv)}R[se]=sa,I=I||sa!==gt}return I?R:B}}(j({},k,t)),z,M(C(yT.apply(void 0,O))));_.dispatch=(Z=_.dispatch,function(m,y,E){var N=j({},m,{meta:nl(m.meta,y,bi(E))});return Z.apply(null,[N])});var G=Object.keys(o);_.dispatch({type:A.bootstrap,plugins:G,config:L,params:g,user:P,initialUser:r,persistedUser:T});var X=G.filter(function(m){return n.pluginEnabled[m]}),Ne=G.filter(function(m){return!n.pluginEnabled[m]});return _.dispatch({type:A.registerPlugins,plugins:G,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var E=m.bootstrap,N=m.config,x=m.name;E&&oe(E)&&E({instance:$,config:N,payload:m}),_.dispatch({type:A.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:m}),n.pluginsArray.length===y+1&&_.dispatch({type:A.initializeStart,plugins:X,disabled:Ne})}),MT(function(m){_.dispatch({type:m?A.offline:A.online})}),function(m,y,E){setInterval(function(){return Xd(m,y,E)},3e3)}(_,l,$),$}var cn="before",un="after",Sr="cookie",at=cv(),ov=ia,BT=ia;function sv(e){return at?ia(e,"",-1):qt(e)}function cv(){if(at!==void 0)return at;var e="cookiecookie";try{ia(e,e),at=document.cookie.indexOf(e)!==-1,sv(e)}catch{at=!1}return at}function ia(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return at===!1&&(o?dt(e,t):ft(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var $r="localStorage",zT=Qo.bind(null,"localStorage");Qt("localStorage","getItem",ft);Qt("localStorage","setItem",dt);Qt("localStorage","removeItem",qt);var Ir="sessionStorage",HT=Qo.bind(null,"sessionStorage");Qt("sessionStorage","getItem",ft);Qt("sessionStorage","setItem",dt);Qt("sessionStorage","removeItem",qt);function xt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var KT=zT(),GT=HT(),WT=cv();function uv(e,t){if(e){var r=es(t),n=!as(r),a=ts(r)?xt(localStorage.getItem(e)):void 0;if(n&&!Ct(a))return a;var i=rs(r)?xt(ov(e)):void 0;if(n&&i)return i;var o=ns(r)?xt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function VT(e,t,r){if(e&&!Ct(t)){var n={},a=es(r),i=JSON.stringify(t),o=!as(a);return ts(a)&&(n[$r]=ln($r,t,xt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[$r]:rs(a)&&(n[Sr]=ln(Sr,t,xt(ov(e))),BT(e,i),o)?n[Sr]:ns(a)&&(n[Ir]=ln(Ir,t,xt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Ir]:(n[br]=ln(br,t,ft(e)),dt(e,t),o?n[br]:n)}}function ZT(e,t){if(e){var r=es(t),n=uv(e,Kd),a={};return!Ct(n.localStorage)&&ts(r)&&(localStorage.removeItem(e),a[$r]=n.localStorage),!Ct(n.cookie)&&rs(r)&&(sv(e),a[Sr]=n.cookie),!Ct(n.sessionStorage)&&ns(r)&&(sessionStorage.removeItem(e),a[Ir]=n.sessionStorage),!Ct(n.global)&&oa(r,br)&&(qt(e),a[br]=n.global),a}}function es(e){return e?Ze(e)?e:e.storage:Hd}function ts(e){return KT&&oa(e,$r)}function rs(e){return WT&&oa(e,Sr)}function ns(e){return GT&&oa(e,Ir)}function as(e){return e===Kd||e==="all"}function oa(e,t){return e===Hd||e===t||as(e)}function ln(e,t,r){return{location:e,current:t,previous:r}}var JT={setItem:VT,getItem:uv,removeItem:ZT};function YT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function il(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?al(Object(r),!0).forEach(function(n){YT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):al(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:JT};return FT(il(il({},t),e))}function qT(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function QT(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=tE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function eE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function tE(e){return["#","?"].forEach(t=>e=eE(e,t)),e}function rE(){QT(()=>{De.page()})}function nE(e){if(e===void 0&&(e={}),!q)return ro;var t=sl(),r=io(),n=ol(),a=fn(n,t),i=fn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return ro;var v=d.map(function(w){return Number(w)}),p=pT(function(){var w=sl(),g=function(L,U){return U.map(function(z){return z===100?L-5:L*(z/100)})}(w,v),T=io(),P=ol(),b=fn(P,w),h=fn(T,w);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===P,O="up";$?O="initial":f<=P&&(O="down");var k=g,C=v;(O==="up"||$)&&(k=g.slice().reverse(),C=v.slice().reverse());var M=C.reduce(function(L,U,z){var _=k[z];return u.includes(U)&&P<=_&&(u=u.filter(function(G){return G!==U}),L.singleFunction=U),O==="down"&&!o.includes(U)&&P>=_&&U>i?(s.push(U),L.callbacks=L.callbacks.concat(U),L):O==="up"&&!o.includes(U)&&P<=_&&U<=b?(L.foundFunc=[U],L):($&&P>=_&&L.foundFunc.length===0&&(L.foundFunc=[U]),!s.includes(U)&&P>=_&&(s.push(U),L.singleFunction?u.push(U):L.singleFunction=U),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=P,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,Z=M.direction;oe(e[F])&&e[F]({trigger:F,direction:Z,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function io(){return q?document.body.scrollTop||document.documentElement.scrollTop:0}function aE(){return q?window.innerHeight||document.documentElement.clientHeight:0}function ol(){return Math.round(io()+aE())}function sl(){if(!q)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function fn(e,t){return Math.round(e/t*100)}var cl="EventListener";function iE(e){return function(t,r,n,a){var i=n||ro,o=a||!1;if(!q)return i;var s=xn(r),u=xn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+cl:"remove"+cl,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?oE(i):i:f[v]||i;for(var w=0;w<s.length;w++)p[d]?p["on"+s[w]]=c?f[v]:null:p[d](s[w],f[v],o)}return l.bind(null,!c)}(e)}}function xn(e,t){if(Ze(e))return t?xn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=lT(e);return t?i.map(function(o){return Ze(o)?xn(o,!0):o}).flat():i}function oE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Si=iE("Event");function lv(e,t){return q&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}lv.bind(null,"onerror");lv.bind(null,"onload");var fv=typeof window>"u",ul="hidden";function sE(e){if(fv)return!1;var t=cE(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function cE(){var e=["webkit","moz","ms","o"];return fv||ul in document?ul:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var uE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function lE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=sE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(uE.map(function(s){return Si(document,s,r)})).concat(Si(window,"load",r)).concat(Si(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function fE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(ur(d),g),a&&l&&(l=!1,a(ur(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(ur(d),g))},s)}var w=lE(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=w();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:ur(d,c),idle:l?ur(r,c):0}}}}function ur(e,t){return t?0:Math.round((new Date-e)/1e3)}const ll=5e3;class dE{constructor(t){fe(this,"element");fe(this,"isInViewport",!1);fe(this,"isAwake",!1);fe(this,"isFlushing");fe(this,"observer");fe(this,"lastEventAt",Date.now());fe(this,"registeredView",!1);fe(this,"viewCallback");fe(this,"activeDurationCallback");fe(this,"idleDurationCallback");fe(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),fE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:ll}),nE({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(t){t?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=t}handleAwake(t,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=t,this.lastEventAt=t?Date.now()-r*ll:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const fl="sesamy_session_id";function vE(){let e=sessionStorage.getItem(fl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(fl,e)),e}let dv=!1,oo,dl,Un;const vv=new Map;function hE({clientId:e,enabled:t=!0,environment:r}){if(oo=e,dl=t,Un=`${Me("logs",r)}/events`,!dl)return;window.addEventListener("beforeunload",()=>{pv.forEach((a,i)=>{a.bind(i)()}),mE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&vv.forEach((a,i)=>{a.bind(i)()})}),rE();const n=new dE({element:document.body,viewCallback:()=>{De.page()},activeDurationCallback:(a,i,o)=>{De.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{De.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{De.track("scroll",{scroll:a.scrollMax})}});gE(document.body,()=>{n.flush()}),yE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Oe.AUTHENTICATED,async a=>{const i=a;await De.identify(i.detail.sub)}),window.addEventListener(Oe.LOGOUT,async()=>{await De.track("logout",{}),is.flush(),await De.reset()})}function hv(e){return JSON.stringify(e.map(t=>({...t,clientId:oo,requestId:Math.random().toString(36).slice(2,9),sessionId:vE(),timestamp:new Date().toISOString(),version:qo,event:t.event,context:{page:{url:window.location.hostname,path:window.location.pathname,title:document.title,search:window.location.search,referrer:document.referrer},locale:navigator.language,library:zd,userAgent:navigator.userAgent,clientId:oo}})))}const is=qT(async e=>{if(e.length>0){const t=hv(e);dv?navigator.sendBeacon(Un,t):(await fetch(Un,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function $i(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Un,hv([r]))}else is.push(e)}const De=XT({app:zd,version:qo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;$i({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;$i({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;$i({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function pE(e,t){De.track(e,t)}function mE(){return dv=!0,is.flush()}const pv=new Map;function gE(e,t){pv.set(e,t)}function yE(e,t){vv.set(e,t)}const mv="sesamySignedURLs";function gv(){const e=sessionStorage.getItem(mv);return e?JSON.parse(e):[]}function wE(e){const t=gv();t.push(e),sessionStorage.setItem(mv,JSON.stringify(t))}const bE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function SE(){return new Promise(e=>{const t=bE.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function $E(){const e=navigator.userAgent.toLowerCase(),t=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of t)if(r.regex.test(e))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function IE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,cancelContract:l,getBill:c,getBills:d,getTransaction:v,getTransactions:p,getProfile:w,updateProfile:g,getTags:T,deleteTag:P,setTag:b,getUserMetadata:h,listUserMetadata:$,setUserMetadata:O,deleteUserMetadata:k,getTally:C,getTallies:M,pushTally:F,deleteTally:Z,getProduct:L,getPaymentIssues:U,isSpotifyLinked:z,unlinkSpotify:_,linkSpotify:G,autoOnboardProduct:X,openHostedAccountPage:Ne,generateLink:m}=eT(e),y={auth:{getUser:w,isAuthenticated:Yo,loginWithRedirect:Xo,logout:xd,setToken:Dd},checkouts:{get:r,create:t,update:n},profile:{get:w,update:g,openHostedAccountPage:Ne,isSpotifyLinked:z,unlinkSpotify:_},analytics:{track:pE},tags:{list:T,set:b,delete:P},entitlements:{get:a,list:i,access:o,signedLinks:gv},contracts:{get:u,list:f,cancel:l},bills:{get:c,list:d},userMetadata:{get:h,list:$,set:O,delete:k},tallies:{get:C,list:M,push:F,delete:Z},subscriptions:{list:s},transactions:{get:v,list:p},products:{get:L,autoOnboard:X,linkSpotify:G},browser:{detectAdblock:SE,isInAppBrowser:$E},getVersion:PE,getPaymentIssues:U,generateLink:m,clearCache:Ie};return e.namespace&&(window[e.namespace]=y),y}function PE(){return qo}async function TE({enabled:e=!1,rules:t}){if(!e)return;const r=await Yo(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await vl(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await vl(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function vl(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function EE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Dd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const hl="sesamy-refresh",pl="force-refetch-entitlements";function OE(){const e=new URLSearchParams(window.location.search),t=e.get(pl),r=e.get(hl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(pl),e.delete(hl),n.search=e.toString(),Ie(),window.history.replaceState(null,"",n)}}function kE(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;wE({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const ml="sesamy-user";async function _E(){const t=new URLSearchParams(window.location.search).get(ml);if(!t)return;const r=await DP();(r==null?void 0:r.email)!==t&&(Ie(),Xo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const gl="sesamy-purchase";function RE(){const e=new URLSearchParams(window.location.search),t=e.get(gl);if(t!==null){const r=new URL(window.location.href);e.delete(gl),r.search=e.toString(),Xe(Oe.PURCHASE,{itemSrc:t}),Ie(),window.history.replaceState(null,"",r)}}const yl="sesamy-login";async function CE(){if(!new URLSearchParams(window.location.search).get(yl))return;await Yo()||Xo();const n=new URL(window.location.href);n.searchParams.delete(yl),window.history.replaceState(null,"",n)}const AE=typeof window<"u";async function wl(e){hE({clientId:e.clientId,environment:e.environment,...e.analytics}),await UP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await TE(e.transform),EE(),OE(),kE(),await CE(),await _E(),RE(),Xe(Oe.READY,{})}async function yv(e){const t=IE({clientId:e.clientId,environment:e.environment,...e.api});return AE&&(e.awaitAllServices?await wl(e):wl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);yv(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=yv;
|
|
4
|
+
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!_u(r))throw new Error(`Invalid cache location "${r}"`);n=_u(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Ot:PT,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:ET;var i;this.scope=nn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ST(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Id,this.cacheManager=new bT(n,n.allKeys?void 0:new _T(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new kT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||$d)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${Qi(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return IT({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=Tu(di()),i=Tu(di()),o=di(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,h=>v[h])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await wn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,h,b,g,P)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:nn(c,d.scope),response_type:"code",response_mode:P||"query",state:v,nonce:h,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:b,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new dT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new fT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(ce.fromPayload(v.data.response));u(v.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ce("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Ru(t),{openUrl:a,fragment:i,appState:o}=n,s=Ae(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=Ae(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new ce("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new lT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new ce("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:nn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=hi[o];return s||(s=i().finally(()=>{delete hi[o],s=null}),hi[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=Ae(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>pi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new qi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await pi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},r={}){var n;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:nn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},uT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=Ae(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Qi(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Ru(t),{openUrl:n}=r,a=Ae(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ce("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((h,b,g=60)=>new Promise((P,T)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const p=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",$,!1))};let $;const O=setTimeout(()=>{T(new qi),p()},1e3*g);$=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?T(ce.fromPayload(_.data.response)):P(_.data.response),clearTimeout(O),window.removeEventListener("message",$,!1),setTimeout(p,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(w),w.setAttribute("src",h)}))(a,this.domainUrl,c);if(i!==d.state)throw new ce("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:f,oauthTokenScope:v.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new it({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new _d(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=Ae(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new it({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new it({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await yT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function AT(e){const t=new CT(e);return await t.checkSession(),t}var Oe=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Oe||{});const jT="sesamy.com",LT="sesamy.dev",NT="https://sesa.my",to="sesamyCacheTimestamp";function Me(e,t){return`https://${e}.${t==="dev"?LT:jT}`}let le,Ld,Nd=!1;const zt="sesamyAccessToken",mi="sesamyRefreshToken";async function Nr(){return new Promise((r,n)=>{let a=0;const i=()=>{Nd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function xT(e){if(!e)return null;const t=localStorage.getItem(mi);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(mi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(mi,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{xd()}}async function Jo(){const e=localStorage.getItem(zt);if(!e)return null;const t=Ud(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await xT(t);if(r)return r;localStorage.removeItem(zt)}return e}function Cu(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function UT(e){if(e.enabled===!1)return;Ld=e.organization;const t={domain:Me("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Cu(window.location.href)!==Cu(Me("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),le=await AT(t),window.location.search.includes("code="))try{await le.handleRedirectCallback();const r=await le.getUser();Xe(Oe.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Nd=!0}async function Yo(){return await Nr(),await Jo()?!0:le?le.isAuthenticated():!1}async function DT(){return await Nr(),await Jo()?{sub:"local",name:"Local User"}:le?le.getUser():null}async function Xo(e){if(await Nr(),localStorage.removeItem(zt),!le)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return le.loginWithRedirect({...e,authorizationParams:{organization:Ld,redirect_uri:window.location.href,...t}})}async function cr(e=!0){await Nr();const t=await Jo();if(t)return t;try{return le?await le.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function xd(e={}){if(await Nr(),localStorage.removeItem(zt),Xe(Oe.LOGOUT,{}),!!le)return le.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Ud(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function Dd(e){const t=Ud(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),Xe(Oe.AUTHENTICATED,t)}const MT=(e,t)=>t.skipDedupe||t.method!=="GET",FT=(e,t)=>t.method+"@"+e,BT=e=>e.clone(),Au=({skip:e=MT,key:t=FT,resolver:r=BT}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,f])=>f(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},zT=(e,t)=>e*t,HT=e=>e&&e.ok,ju=({delayTimer:e=500,delayRamp:t=zT,maxAttempts:r=10,until:n=HT,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(v,h)=>Promise.resolve(n(v,h)).then(b=>b?v&&o?v:h?Promise.reject(h):v:(c++,!r||c<=r?new Promise(g=>{const P=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:h,url:f,options:l})).then((T={})=>{var w,p;g(u((w=T&&T.url)!==null&&w!==void 0?w:f,(p=T&&T.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},P)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},GT="application/json",Md="Content-Type",Tt=Symbol(),Fd=Symbol();function Lu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Md.toLowerCase()))===null||t===void 0?void 0:t[1]}function Nu(e){return/^application\/.*json.*/.test(e)}const st=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=st(o,i,r):n[a]=i,n},{...e})},Ht={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function KT(e,t=!1){Ht.options=t?e:st(Ht.options,e)}function WT(e,t=!1){Ht.polyfills=t?e:st(Ht.polyfills,e)}function VT(e){Ht.errorType=e}const ZT=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Bd extends Error{}const JT=e=>{const t=Object.create(null);e=e._addons.reduce((w,p)=>p.beforeRequest&&p.beforeRequest(w,e._options,t)||w,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=ZT(s)((w,p)=>(c=w,a.polyfill("fetch")(w,p)))(r,l),v=new Error,h=d.catch(w=>{throw{[Tt]:w}}).then(w=>{var p;if(!w.ok){const $=new Bd;if($.cause=v,$.stack=$.stack+`
|
|
5
|
+
CAUSE: `+v.stack,$.response=w,$.status=w.status,$.url=c,w.type==="opaque")throw $;const O=a.errorType==="json"||((p=w.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?w.text():w[a.errorType]():Promise.resolve(w.body)).then(k=>{throw $.message=typeof k=="string"?k:w.statusText,k&&(O&&typeof k=="string"?($.text=k,$.json=JSON.parse(k)):$[a.errorType]=k),$})}return w}),b=w=>w.catch(p=>{const $=Object.prototype.hasOwnProperty.call(p,Tt),O=$?p[Tt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||$&&f.has(Tt)&&f.get(Tt);if(_)return _(O,e);const k=f.get(Fd);if(k)return k(O,e);throw O}),g=w=>p=>b(w?h.then($=>$&&$[w]()).then($=>p?p($):$):h.then($=>p?p($):$)),P={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(w,p){return f.set(w,p),this},badRequest(w){return this.error(400,w)},unauthorized(w){return this.error(401,w)},forbidden(w){return this.error(403,w)},notFound(w){return this.error(404,w)},timeout(w){return this.error(408,w)},internalError(w){return this.error(500,w)},fetchError(w){return this.error(Tt,w)}},T=u.reduce((w,p)=>({...w,...typeof p.resolver=="function"?p.resolver(w):p.resolver}),P);return o.reduce((w,p)=>p(w,e),T)},YT={_url:"",_options:{},_config:Ht,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:st(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:st(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Md]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const r=new Map(this._catchers);return r.set(e,t),{...this,_catchers:r}},catcherFallback(e){return this.catcher(Fd,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Lu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Nu(a));return n=r?o?n.json(r,a):n.body(r):n,JT(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Lu(this._options.headers);return this.content(t||Nu(r)&&r||GT).body(JSON.stringify(e))}};function Be(e="",t={}){return{...YT,_url:e,_options:t}}Be.default=Be;Be.options=KT;Be.errorType=VT;Be.polyfills=WT;Be.WretchError=Bd;function Ie(){sessionStorage.removeItem(to),Xe(Oe.CLEAR_CACHE,{})}function xu(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function XT(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function qT(e,t){if(XT(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function QT(e,t){const r=new URL(`${Me("checkout3",e.environment)}`);if(r.searchParams.set("vendorId",e.clientId),t.language&&r.searchParams.set("lang",t.language),t.sku)r.searchParams.set("sku",t.sku),t.purchaseOptionId&&r.searchParams.set("poId",t.purchaseOptionId);else if(t.itemSrc){const{sku:o,purchaseOption:s,itemSrc:u}=qT(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("itemSrc",u),o&&r.searchParams.set("sku",o),s&&r.searchParams.set("poId",s)}t.email&&r.searchParams.set("email",t.email),t.business&&r.searchParams.set("business","true"),t.currency&&r.searchParams.set("currency",t.currency),t.price&&r.searchParams.set("price",t.price.toString()),t.discountCode&&r.searchParams.set("discountCode",t.discountCode),t.attributionItemSrc&&r.searchParams.set("attributionItemSrc",t.attributionItemSrc),t.attributionPublisherContentId&&r.searchParams.set("attributionPublisherContentId",t.attributionPublisherContentId),t.utmSource&&r.searchParams.set("utmSource",t.utmSource),t.utmMedium&&r.searchParams.set("utmMedium",t.utmMedium),t.utmCampaign&&r.searchParams.set("utmCampaign",t.utmCampaign),t.utmTerm&&r.searchParams.set("utmTerm",t.utmTerm),t.utmContent&&r.searchParams.set("utmContent",t.utmContent);const n=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(o=>{const[s,u]=o.trim().split("=");return{key:s,value:u}}).filter(o=>n.some(s=>s===o.key)).forEach(o=>{r.searchParams.append(o.key,o.value)});const i=new URL(t.redirectUrl||window.location.href);return i.searchParams.set("force-refetch-entitlements","true"),t.itemSrc&&i.searchParams.set("sesamy-purchase",t.itemSrc),r.searchParams.set("redirectUrl",i.toString()),t.paymemtMethodsFilter&&r.searchParams.set("paymentMethodsFilter",t.paymemtMethodsFilter.flatMap(({provider:o,methods:s})=>s?s.map(u=>`${o}|${u}`):o).join(",")),r}function eP(e){const t=Me("api2",e.environment),r=S=>async(I,C)=>{let V=sessionStorage.getItem(to);V||(V=Date.now().toString(),sessionStorage.setItem(to,V));const se={...C,headers:{...C.headers,"Cache-Timestamp":V}};return S(I,se)},n=(S=!0)=>I=>async(C,V)=>{let se=null;if(se=await cr(S),!se){if(S)throw new Error("No access token available");return I(C,V)}const gt={...V,headers:{...V.headers,...se?{Authorization:`Bearer ${se}`}:{}}};return I(C,gt)},a=S=>(I,C)=>{if(C.headers.Authorization)return S(I,C);const V=localStorage.getItem("__anon_id"),se=btoa(`${V}:`),gt={...C,headers:{...C.headers,Authorization:`Basic ${se}`}};return S(I,gt)},i=Be(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Au(),ju({delayTimer:1e3,delayRamp:(S,I)=>S*I,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]),o=Be(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Au(),ju({delayTimer:1e3,delayRamp:(S,I)=>S*I,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(S){const I=await i.get("/entitlements").json();return I==null?void 0:I.find(C=>C.id===S)}async function f(S){return i.get(`/entitlements/${S}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(S){const I=await i.get("/contracts").json();return I==null?void 0:I.find(C=>C.id===S)}async function d(S){return(await i.post({},`/contracts/${S}/cancel`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function h(){return i.get("/bills").json()}async function b(S){const I=await i.get("/bills").json();return I==null?void 0:I.find(C=>C.id===S)}async function g(){return i.get("/transactions").json()}async function P(S){const I=await i.get("/transactions").json();return I==null?void 0:I.find(C=>C.id===S)}async function T(S,I){const C=await i.url(`/user-metadata/${S}`).put(I).json();return Xe(Oe.USER_ATTRIBUTE_CHANGED,{}),Ie(),C}async function w(S){const I=await i.url(`/user-metadata/${S}`).delete().res();return Ie(),I.ok}async function p(S){return(await i.url(`/user-metadata/${S}`).get().json())[S]}async function $(){return await i.url("/user-metadata").get().json()}async function O(){return await i.url("/tags").get().json()}async function _(S){const I=await i.url(`/tags/${S}`).delete().res();return Ie(),I.ok}async function k(S){const I=await i.url("/tags").post(S).res();return Xe(Oe.USER_ATTRIBUTE_CHANGED,{}),Ie(),I.ok}async function M(S){return(await o.url("/tallies").get().json())[S]}async function F(){return await o.url("/tallies").get().json()}async function Z(S){const I=await o.url(`/tallies/${S}`).delete().res();return Ie(),I.ok}async function L(S,I){return await o.url(`/tallies/${S}/push`).post(I).json()}async function U(S){return await i.url(`/products/${S}`).get().json()}async function z(){return await cr(!1)?await i.url("/profile").get().json():null}async function R(S){const I=await i.url("/profile").patch(S).res();return Ie(),I.ok}async function K(){return await i.url("/payment-issues").get().json()}async function X(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function Ne(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function m(S){const I=await cr(!1);if(!I)throw new Error("No access token available");const C=new URL(`${Me("spotify-oas",e.environment)}/sesamy-callback`);C.searchParams.set("access_token",I),C.searchParams.set("state",S),window.location.href=C.toString()}async function y(S){const I=await i.url(`/products/${S}/auto-onboard`).post().json();return I.length&&Ie(),I}async function E(S,I=3600){const{shortlink:C}=await Be(NT).post({url:S,ttl:I}).json();return C}async function N(S){const I=await cr(!1);let C;const V=S.language||xu();switch(S.target){case"account":C=new URL(`${Me("account",e.environment)}/${S.language||V}/subscriptions/${e.clientId}`),C.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":C=new URL(`${Me("consume",e.environment)}/${S.language||V}/@${e.clientId}/${S.sku}`),S.episodeId?C.href+=`/${S.episodeId}`:C.href+="/listen",C.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":C=QT(e,{language:V,...S});break;default:throw new Error("Invalid target")}return I&&(C.hash=`#access_token=${I}`),S.shorten?E(C.href,S.ttl):C.href}async function x(S){return(await o.url("/checkouts").post({language:xu(),...S,vendorId:e.clientId})).json()}async function D(S,I){return(await o.url(`/checkouts/${S}`).patch(I)).json()}async function J(S){return(await o.url(`/checkouts/${S}`).get()).json()}async function B(){const S=await cr(!1),I=new URL(`${Me("account",e.environment)}/subscriptions/${e.clientId}`);S&&(I.hash=`#access_token=${S}`),window.location.href=I.toString()}return{createCheckout:x,updateCheckout:D,getCheckout:J,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,cancelContract:d,getProfile:z,updateProfile:R,getSubscriptions:v,getBills:h,getBill:b,setUserMetadata:T,deleteUserMetadata:w,getUserMetadata:p,listUserMetadata:$,getTags:O,deleteTag:_,setTag:k,getTally:M,getTallies:F,deleteTally:Z,pushTally:L,getTransactions:g,getTransaction:P,getProduct:U,getPaymentIssues:K,autoOnboardProduct:y,isSpotifyLinked:X,unlinkSpotify:Ne,linkSpotify:m,generateLink:N,openHostedAccountPage:B}}const zd="@sesamy/sesamy-js",qo="1.19.1";function Uu(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var an="undefined",Du="object",ro=function(){},Hd="any",Gd="*",lt="__",Ln=typeof process<"u"?process:{};Ln.env&&Ln.env.NODE_ENV;var q=typeof document<"u";Ln.versions!=null&&Ln.versions.node!=null;typeof Deno<"u"&&Deno.core;q&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Kd(e,t){return t.charAt(0)[e]()+t.slice(1)}var tP=Kd.bind(null,"toUpperCase"),rP=Kd.bind(null,"toLowerCase");function nP(e){return Wd(e)?tP("null"):typeof e=="object"?sP(e):Object.prototype.toString.call(e).slice(8,-1)}function Nn(e,t){t===void 0&&(t=!0);var r=nP(e);return t?rP(r):r}function xr(e,t){return typeof t===e}var oe=xr.bind(null,"function"),Ze=xr.bind(null,"string"),Ct=xr.bind(null,"undefined"),aP=xr.bind(null,"boolean");xr.bind(null,"symbol");function Wd(e){return e===null}function iP(e){return Nn(e)==="number"&&!isNaN(e)}function Vd(e){return Nn(e)==="array"}function ie(e){if(!oP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function oP(e){return e&&(typeof e=="object"||e!==null)}function sP(e){return oe(e.constructor)?e.constructor.name:null}function cP(e){return e instanceof Error||Ze(e.message)&&e.constructor&&iP(e.constructor.stackTraceLimit)}function Zd(e,t){if(typeof t!="object"||Wd(t))return!1;if(t instanceof e)return!0;var r=Nn(new e(""));if(cP(t))for(;t;){if(Nn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Zd.bind(null,TypeError);Zd.bind(null,SyntaxError);function ra(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?uP(e,t):r}function uP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function na(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}na(ra,"form");na(ra,"button");na(ra,"input");na(ra,"select");function lP(e){return e?Vd(e)?e:[e]:[]}function Mu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function fP(){if(q){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function dP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function vP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Mu(r[1]),o=Mu(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(hP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return q&&window.location.search.substring(1)}())}function hP(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function aa(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],a=15&r;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}function pP(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var br="global",Gt=lt+"global"+lt,Kt=typeof self===Du&&self.self===self&&self||typeof global===Du&&global.global===global&&global||void 0;function ft(e){return Kt[Gt][e]}function dt(e,t){return Kt[Gt][e]=t}function qt(e){delete Kt[Gt][e]}function Qt(e,t,r){var n;try{if(Qo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Kt[Gt]||(Kt[Gt]={});var on={};function Qo(e){if(typeof on[e]!==an)return on[e];try{var t=window[e];t.setItem(an,an),t.removeItem(an)}catch{return on[e]=!1}return on[e]=!0}function j(){return j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(this,arguments)}var Ke="function",Fe="undefined",mP="@@redux/"+Math.random().toString(36),Fu=function(){return typeof Symbol===Ke&&Symbol.observable||"@@observable"}(),sn=" != "+Ke;function Jd(e,t,r){var n;if(typeof t===Ke&&typeof r===Fe&&(r=t,t=void 0),typeof r!==Fe){if(typeof r!==Ke)throw new Error("enhancer"+sn);return r(Jd)(e,t)}if(typeof e!==Ke)throw new Error("reducer"+sn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ke)throw new Error("Listener"+sn);var h=!0;return f(),s.push(v),function(){if(h){h=!1,f();var b=s.indexOf(v);s.splice(b,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===Fe)throw new Error("ActType "+Fe);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var h=o=s,b=0;b<h.length;b++)(0,h[b])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ke)throw new Error("next reducer"+sn);a=v,d({type:"@@redux/INIT"})}})[Fu]=function(){var v,h=c;return(v={subscribe:function(b){if(typeof b!="object")throw new TypeError("Observer != obj");function g(){b.next&&b.next(l())}return g(),{unsubscribe:h(g)}}})[Fu]=function(){return this},v},n}function gP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Fe}function Wt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function yP(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=Wt.apply(void 0,i)(o.dispatch)})}}}var Je=lt+"anon_id",ct=lt+"user_id",Lt=lt+"user_traits",Ge="userId",At="anonymousId",bn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],no=["name","EVENTS","config","loaded"],A=bn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Bu=/^utm_/,zu=/^an_prop_/,Hu=/^an_trait_/;function wP(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Je,o.anonymousId),f||t(ct,o.userId),u.traits&&t(Lt,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,v=l.reduce(function(h,b){if(b.match(Bu)||b.match(/^(d|g)clid/)){var g=b.replace(Bu,"");h.campaign[g==="campaign"?"name":g]=i[b]}return b.match(zu)&&(h.props[b.replace(zu,"")]=i[b]),b.match(Hu)&&(h.traits[b.replace(Hu,"")]=i[b]),h},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function bP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Je)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Je,Lt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Gu(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Je),traits:e.getItem(Lt)}}var ao=function(e){return lt+"TEMP"+lt+e};function SP(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([ct,Lt,Je].forEach(function(v){n(v)}),[Ge,At,"traits"].forEach(function(v){qt(ao(v))})),s.type===A.identify){a(Je)||r(Je,aa());var c=a(ct),d=a(Lt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(Lt,j({},d,f))}return o(s)}}}}var vr={};function Ku(e,t){vr[e]&&oe(vr[e])&&(vr[e](t),delete vr[e])}function Yd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Yd(e,t,r-10).then(n,a)})})}function $P(e){return{abort:e}}function Xd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,h=d.payload.type,b=a[v][h];if(b&&oe(b)){var g,P=function(p,$){return p===void 0&&(p={}),$===void 0&&($={}),[Ge,At].reduce(function(O,_){return p.hasOwnProperty(_)&&$[_]&&$[_]!==p[_]&&(O[_]=$[_]),O},p)}(d.payload,u),T=n[P.meta.rid];if(!T&&(g=b({payload:P,config:o[v].config,instance:r,abort:$P}))&&ie(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!T){var w=h+":"+v;e.dispatch(j({},P,{type:w,_:{called:w,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var gi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Nt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var h=function(g,P){return function(T,w,p){var $=w.config,O=w.name,_=O+"."+T.type;p&&(_=p.event);var k=T.type.match(Nt)?function(M,F,Z,L,U){return function(z,R){var K=L?L.name:M,X=R&&Er(R)?R:Z;if(L&&(!(X=R&&Er(R)?R:[M]).includes(M)||X.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(X)+" input valid");return j({},U,{abort:{reason:z,plugins:X,caller:F,_:K}})}}(O,_,P,p,T):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(T,_);return{payload:IP(T),instance:g,config:$||{},abort:k}}}(n,v),b=t.exact.reduce(function(g,P){var T=P.pluginName,w=P.methodName,p=!1;return w.match(/^initialize/)||w.match(/^reset/)||(p=!f[T].loaded),l.offline&&w.match(/^(page|track|identify)/)&&(p=!0),g[""+T]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,P,T){try{var w=P.pluginName;return Promise.resolve(g).then(function(p){function $(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[w])return Promise.resolve(t.namespaced[w].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&oe(k.method)?(function(z,R){var K=qu(z);if(K&&K.name===R){var X=qu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(X?"or "+X.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
+
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(Z=F,L=w,U=k.pluginName,function(z,R){return j({},Z,{abort:{reason:z,plugins:R||[L],caller:c,from:U||L}})}),config:Zu(k.pluginName,f,i),plugins:f})).then(function(z){var R=ie(z)?z:{};return Promise.resolve(j({},F,R))})):F;var Z,L,U})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[w]=_});p[w]=r}();return O&&O.then?O.then($):$()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(P,T,w){try{var p=t.exact.length===w+1,$=T.pluginName,O=i[$];return Promise.resolve(P).then(function(_){var k=g[$]?g[$]:{};if(d&&(k=_),wi(k,$))return yi({data:k,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(wi(_,$))return p&&yi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(b.hasOwnProperty($)&&b[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=h(g[$],i[$]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:Zu($,f,i),plugins:f})).then(function(F){var Z=ie(F)?F:{},L=j({},_,Z),U=g[$];if(wi(U,$))yi({data:U,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(Wu)&&!c.match(Vu)&&n.dispatch(j({},d?L:k,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(P){if(!(c.match(Nt)||c.match(/^registerPlugin/)||c.match(Vu)||c.match(Wu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),P._&&P._.originalAction===c)return P;var T=j({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});qd(P,t.exact.length)&&!c.match(/End$/)&&(T=j({},T,{type:P.type+"Aborted"})),s.dispatch(T)}return P})})}catch(g){return Promise.reject(g)}},Nt=/Start$/,Wu=/^bootstrap/,Vu=/^ready/;function yi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Zu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Ju(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Yu(e,t){var r=e.replace(Nt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function wi(e,t){var r=e.abort;return!!r&&(r===!0||Xu(r,t)||r&&Xu(r.plugins,t))}function qd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ze(r))return!0;var n=r.plugins;return Er(r)&&r.length===t||Er(n)&&n.length===t}function Er(e){return Array.isArray(e)}function Xu(e,t){return!(!e||!Er(e))&&e.includes(t)}function qu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function IP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function TP(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(p){return s?p:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Ku(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),h=v.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),b=[],g=[],P=o.disabled,T=h.map(function(p){var $=p.loaded,O=p.name,_=p.config;return Yd(p,function(){return $({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:A.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!no.includes(M)})}),n[O]=!0),b=b.concat(O),p}).catch(function(k){if(k instanceof Error)throw new Error(k);return g=g.concat(k.name),k})});Promise.all(T).then(function(p){var $={plugins:b,failed:g,disabled:P};setTimeout(function(){v.length===T.length+P.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var w=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Xd(a,t,e)},0),Promise.resolve(function(p,$,O,_,k){try{var M=oe($)?$():$,F=p.type,Z=F.replace(Nt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),U=(K=M,(X=L.plugins)===void 0&&(X={}),(Ne=p.options)===void 0&&(Ne={}),Object.keys(K).filter(function(m){var y=Ne.plugins||{};return aP(y[m])?y[m]:y.all!==!1&&(!X[m]||X[m].enabled!==!1)}).map(function(m){return K[m]}));F===A.initializeStart&&p.fromEnable&&(U=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return p.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=U.map(function(m){return m.name}),R=function(m,y,E){var N=Yu(m).map(function(x){return Ju(x,y)});return y.reduce(function(x,D){var J=D.name,B=Yu(m,J).map(function(V){return Ju(V,y)}),S=B[0],I=B[1],C=B[2];return S.length&&(x.beforeNS[J]=S),I.length&&(x.duringNS[J]=I),C.length&&(x.afterNS[J]=C),x},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,U);return Promise.resolve(gi({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function y(){var x=function(){if(F.match(Nt))return Promise.resolve(gi({action:j({},E,{type:Z+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(D){D.meta&&D.meta.hasCallback&&Ku(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return m}):m}if(qd(m,z.length))return m;var E,N=function(){if(F!==Z)return Promise.resolve(gi({action:j({},m,{type:Z}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(x){E=x});E=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var K,X,Ne}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(w&&w.then?w.then(u):u(w))}catch(p){return Promise.reject(p)}}}}}function PP(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var EP=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Wt.apply(void 0,o)(n)(a)}}}}};function OP(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Qu(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Qu(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,el(r.plugins,!1,t));case A.enablePlugin:return j({},t,el(r.plugins,!0,t));default:return t}}}function Qu(e,t){return e.substring(t.length+1,e.length)}function el(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Qd(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var kP={last:{},history:[]};function _P(e,t){e===void 0&&(e=kP);var r=t.options,n=t.meta;if(t.type===A.track){var a=Qd(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var RP={actions:[]};function CP(e,t){e===void 0&&(e=RP);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var ev=/#.*$/;function AP(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(ev,""):"")}var tv,rv,nv,av,jP=function(e){if(e===void 0&&(e={}),!q)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var v=function(){if(q){for(var h,b=document.getElementsByTagName("link"),g=0;h=b[g];g++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(ev,"")}(f),c={title:r,url:l,path:AP(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},LP={last:{},history:[]};function NP(e,t){e===void 0&&(e=LP);var r=t.options;if(t.type===A.page){var n=Qd(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}tv=function(){if(!q)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),rv=q?document.referrer:null,nv=fP(),av=dP();var tl={initialized:!1,sessionId:aa(),app:null,version:null,debug:!1,offline:!!q&&!navigator.onLine,os:{name:tv},userAgent:q?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:av,locale:nv,campaign:{},referrer:rv};function xP(e,t){e===void 0&&(e=tl);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},tl,e,{initialized:!0})}}var UP=["plugins","reducers","storage"];function DP(e,t,r){if(q){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function MP(e){var t=DP.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function iv(){return dt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Kt[Gt].analytics.push(o.action||o),i(o)}})}}}function rl(e){return function(){return Wt(Wt.apply(null,arguments),iv())}}function bi(e){return e?Vd(e)?e:[e]:[]}function nl(e,t,r){e===void 0&&(e={});var n,a,i=aa();return t&&(vr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function FP(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var E=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,J){var B;return D[J]=(B=y.methods[J],function(){for(var S=Array.prototype.slice.call(arguments),I=new Array(B.length),C=0;C<S.length;C++)I[C]=S[C];return I[I.length]=$,B.apply({instance:$},I)}),D},{}),delete y.methods);var N=Object.keys(y).concat(E),x=new Set(m.events.concat(N));if(m.events=Array.from(x),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:qt},i=function(m){return function(y,E,N){return E.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:Gu(m)[y]||ft(ao(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!no.includes(m)}).sort(),u=new Set(s.concat(bn).filter(function(m){return!no.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new EP,d=c.addMiddleware,v=c.removeMiddleware,h=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=vP(),P=Gu(a),T=j({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});T.anonymousId||(T.anonymousId=aa());var w=j({enable:function(m,y){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:bi(m),_:{originalAction:A.enablePlugin}},E,[y])})},disable:function(m,y){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:bi(m),_:{originalAction:A.disablePlugin}},E,[y])})}},n.methods),p=!1,$={identify:function(m,y,E,N){try{var x=Ze(m)?m:null,D=ie(m)?m:y,J=E||{},B=$.user();dt(ao(Ge),x);var S=x||D.userId||i(Ge,$,D);return Promise.resolve(new Promise(function(I){R.dispatch(j({type:A.identifyStart,userId:S,traits:D||{},options:J,anonymousId:B.anonymousId},B.id&&B.id!==x&&{previousId:B.id}),I,[y,E,N])}))}catch(I){return Promise.reject(I)}},track:function(m,y,E,N){try{var x=ie(m)?m.event:m;if(!x||!Ze(x))throw new Error("EventMissing");var D=ie(m)?m:y||{},J=ie(E)?E:{};return Promise.resolve(new Promise(function(B){R.dispatch({type:A.trackStart,event:x,properties:D,options:J,userId:i(Ge,$,y),anonymousId:i(At,$,y)},B,[y,E,N])}))}catch(B){return Promise.reject(B)}},page:function(m,y,E){try{var N=ie(m)?m:{},x=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:jP(N),options:x,userId:i(Ge,$,N),anonymousId:i(At,$,N)},D,[m,y,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Ge||m==="id")return i(Ge,$);if(m===At||m==="anonId")return i(At,$);var y=$.getState("user");return m?Uu(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return p&&m({plugins:w,instance:$}),$.on(A.ready,function(y){m(y),p=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var N=function(B){return function(S){return function(I){return I.type.match(E)&&y({payload:I,instance:$,plugins:o}),S(I)}}},x=function(B){return function(S){return function(I){return I.type.match(E)||y({payload:I,instance:$,plugins:o}),S(I)}}};return d(N,cn),d(x,un),function(){v(N,cn),v(x,un)}}var D=m.match(E)?cn:un,J=function(B){return function(S){return function(I){return I.type===m&&y({payload:I,instance:$,plugins:o,abort:b}),S(I)}}};return d(J,D),function(){return v(J,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var E=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:b}),E()});return E},getState:function(m){var y=R.getState();return m?Uu(y,m):Object.assign({},y)},dispatch:function(m){var y=Ze(m)?{type:m}:m;if(bn.includes(y.type))throw new Error("reserved action "+y.type);var E=j({},y,{_:j({originalAction:y.type},m._||{})});R.dispatch(E)},enablePlugin:w.enable,disablePlugin:w.disable,plugins:w,storage:{getItem:a.getItem,setItem:function(m,y,E){R.dispatch({type:A.setItemStart,key:m,value:y,options:E})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Je,m,y)},events:{core:bn,plugins:s}},O=n.middlewares.concat([function(m){return function(y){return function(E){return E.meta||(E.meta=nl()),y(E)}}},h(cn),TP($,l,{all:f,plugins:s}),PP(a),wP($),SP($),h(un)]),_={context:xP,user:bP(a),page:NP,track:_P,plugins:OP(l),queue:CP},k=Wt,M=Wt;if(q&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?iv():ie(typeof arguments[0])?rl():rl().apply(null,arguments)}}var Z,L=function(m){return Object.keys(m).reduce(function(y,E){return UP.includes(E)||(y[E]=m[E]),y},{})}(e),U=n.pluginsArray.reduce(function(m,y){var E=y.name,N=y.config,x=y.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!x({config:N}),config:N},m},{}),z={context:L,user:T,plugins:U},R=Jd(function(m){for(var y=Object.keys(m),E={},N=0;N<y.length;N++){var x=y[N];typeof m[x]===Ke&&(E[x]=m[x])}var D,J=Object.keys(E);try{(function(B){Object.keys(B).forEach(function(S){var I=B[S];if(typeof I(void 0,{type:"@@redux/INIT"})===Fe||typeof I(void 0,{type:mP})===Fe)throw new Error("reducer "+S+" "+Fe)})})(E)}catch(B){D=B}return function(B,S){if(B===void 0&&(B={}),D)throw D;for(var I=!1,C={},V=0;V<J.length;V++){var se=J[V],gt=B[se],sa=(0,E[se])(gt,S);if(typeof sa===Fe){var wv=gP(se,S);throw new Error(wv)}C[se]=sa,I=I||sa!==gt}return I?C:B}}(j({},_,t)),z,M(k(yP.apply(void 0,O))));R.dispatch=(Z=R.dispatch,function(m,y,E){var N=j({},m,{meta:nl(m.meta,y,bi(E))});return Z.apply(null,[N])});var K=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:K,config:L,params:g,user:T,initialUser:r,persistedUser:P});var X=K.filter(function(m){return n.pluginEnabled[m]}),Ne=K.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var E=m.bootstrap,N=m.config,x=m.name;E&&oe(E)&&E({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:X,disabled:Ne})}),MP(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,E){setInterval(function(){return Xd(m,y,E)},3e3)}(R,l,$),$}var cn="before",un="after",Sr="cookie",at=cv(),ov=ia,BP=ia;function sv(e){return at?ia(e,"",-1):qt(e)}function cv(){if(at!==void 0)return at;var e="cookiecookie";try{ia(e,e),at=document.cookie.indexOf(e)!==-1,sv(e)}catch{at=!1}return at}function ia(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return at===!1&&(o?dt(e,t):ft(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var $r="localStorage",zP=Qo.bind(null,"localStorage");Qt("localStorage","getItem",ft);Qt("localStorage","setItem",dt);Qt("localStorage","removeItem",qt);var Ir="sessionStorage",HP=Qo.bind(null,"sessionStorage");Qt("sessionStorage","getItem",ft);Qt("sessionStorage","setItem",dt);Qt("sessionStorage","removeItem",qt);function xt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var GP=zP(),KP=HP(),WP=cv();function uv(e,t){if(e){var r=es(t),n=!as(r),a=ts(r)?xt(localStorage.getItem(e)):void 0;if(n&&!Ct(a))return a;var i=rs(r)?xt(ov(e)):void 0;if(n&&i)return i;var o=ns(r)?xt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function VP(e,t,r){if(e&&!Ct(t)){var n={},a=es(r),i=JSON.stringify(t),o=!as(a);return ts(a)&&(n[$r]=ln($r,t,xt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[$r]:rs(a)&&(n[Sr]=ln(Sr,t,xt(ov(e))),BP(e,i),o)?n[Sr]:ns(a)&&(n[Ir]=ln(Ir,t,xt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Ir]:(n[br]=ln(br,t,ft(e)),dt(e,t),o?n[br]:n)}}function ZP(e,t){if(e){var r=es(t),n=uv(e,Gd),a={};return!Ct(n.localStorage)&&ts(r)&&(localStorage.removeItem(e),a[$r]=n.localStorage),!Ct(n.cookie)&&rs(r)&&(sv(e),a[Sr]=n.cookie),!Ct(n.sessionStorage)&&ns(r)&&(sessionStorage.removeItem(e),a[Ir]=n.sessionStorage),!Ct(n.global)&&oa(r,br)&&(qt(e),a[br]=n.global),a}}function es(e){return e?Ze(e)?e:e.storage:Hd}function ts(e){return GP&&oa(e,$r)}function rs(e){return WP&&oa(e,Sr)}function ns(e){return KP&&oa(e,Ir)}function as(e){return e===Gd||e==="all"}function oa(e,t){return e===Hd||e===t||as(e)}function ln(e,t,r){return{location:e,current:t,previous:r}}var JP={setItem:VP,getItem:uv,removeItem:ZP};function YP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function al(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function il(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?al(Object(r),!0).forEach(function(n){YP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):al(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:JP};return FP(il(il({},t),e))}function qP(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function QP(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=tE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function eE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function tE(e){return["#","?"].forEach(t=>e=eE(e,t)),e}function rE(){QP(()=>{De.page()})}function nE(e){if(e===void 0&&(e={}),!q)return ro;var t=sl(),r=io(),n=ol(),a=fn(n,t),i=fn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return ro;var v=d.map(function(b){return Number(b)}),h=pP(function(){var b=sl(),g=function(L,U){return U.map(function(z){return z===100?L-5:L*(z/100)})}(b,v),P=io(),T=ol(),w=fn(T,b),p=fn(P,b);if(l=w>l?w:l,c=p<c?p:c,!(o.length>=v.length)){var $=f===T,O="up";$?O="initial":f<=T&&(O="down");var _=g,k=v;(O==="up"||$)&&(_=g.slice().reverse(),k=v.slice().reverse());var M=k.reduce(function(L,U,z){var R=_[z];return u.includes(U)&&T<=R&&(u=u.filter(function(K){return K!==U}),L.singleFunction=U),O==="down"&&!o.includes(U)&&T>=R&&U>i?(s.push(U),L.callbacks=L.callbacks.concat(U),L):O==="up"&&!o.includes(U)&&T<=R&&U<=w?(L.foundFunc=[U],L):($&&T>=R&&L.foundFunc.length===0&&(L.foundFunc=[U]),!s.includes(U)&&T>=R&&(s.push(U),L.singleFunction?u.push(U):L.singleFunction=U),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=T,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,Z=M.direction;oe(e[F])&&e[F]({trigger:F,direction:Z,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function io(){return q?document.body.scrollTop||document.documentElement.scrollTop:0}function aE(){return q?window.innerHeight||document.documentElement.clientHeight:0}function ol(){return Math.round(io()+aE())}function sl(){if(!q)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function fn(e,t){return Math.round(e/t*100)}var cl="EventListener";function iE(e){return function(t,r,n,a){var i=n||ro,o=a||!1;if(!q)return i;var s=xn(r),u=xn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+cl:"remove"+cl,v=0;v<u.length;v++){var h=u[v];f[v]=c?o&&o.once?oE(i):i:f[v]||i;for(var b=0;b<s.length;b++)h[d]?h["on"+s[b]]=c?f[v]:null:h[d](s[b],f[v],o)}return l.bind(null,!c)}(e)}}function xn(e,t){if(Ze(e))return t?xn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=lP(e);return t?i.map(function(o){return Ze(o)?xn(o,!0):o}).flat():i}function oE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Si=iE("Event");function lv(e,t){return q&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}lv.bind(null,"onerror");lv.bind(null,"onload");var fv=typeof window>"u",ul="hidden";function sE(e){if(fv)return!1;var t=cE(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function cE(){var e=["webkit","moz","ms","o"];return fv||ul in document?ul:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var uE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function lE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=sE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(uE.map(function(s){return Si(document,s,r)})).concat(Si(window,"load",r)).concat(Si(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function fE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,v=function(){return clearTimeout(t)};function h(g){v(),i&&!l&&i(ur(d),g),a&&l&&(l=!1,a(ur(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(ur(d),g))},s)}var b=lE(h,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=b();return function(){return c=!1,d=new Date,h({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:ur(d,c),idle:l?ur(r,c):0}}}}function ur(e,t){return t?0:Math.round((new Date-e)/1e3)}const ll=5e3;class dE{constructor(t){fe(this,"element");fe(this,"isInViewport",!1);fe(this,"isAwake",!1);fe(this,"isFlushing");fe(this,"observer");fe(this,"lastEventAt",Date.now());fe(this,"registeredView",!1);fe(this,"viewCallback");fe(this,"activeDurationCallback");fe(this,"idleDurationCallback");fe(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),fE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:ll}),nE({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(t){t?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=t}handleAwake(t,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=t,this.lastEventAt=t?Date.now()-r*ll:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const fl="sesamy_session_id";function vE(){let e=sessionStorage.getItem(fl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(fl,e)),e}let dv=!1,oo,dl,Un;const vv=new Map;function hE({clientId:e,enabled:t=!0,environment:r}){if(oo=e,dl=t,Un=`${Me("logs",r)}/events`,!dl)return;window.addEventListener("beforeunload",()=>{pv.forEach((a,i)=>{a.bind(i)()}),mE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&vv.forEach((a,i)=>{a.bind(i)()})}),rE();const n=new dE({element:document.body,viewCallback:()=>{De.page()},activeDurationCallback:(a,i,o)=>{De.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{De.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{De.track("scroll",{scroll:a.scrollMax})}});gE(document.body,()=>{n.flush()}),yE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Oe.AUTHENTICATED,async a=>{const i=a;await De.identify(i.detail.sub)}),window.addEventListener(Oe.LOGOUT,async()=>{await De.track("logout",{}),is.flush(),await De.reset()})}function hv(e){return JSON.stringify(e.map(t=>({...t,clientId:oo,requestId:Math.random().toString(36).slice(2,9),sessionId:vE(),timestamp:new Date().toISOString(),version:qo,event:t.event,context:{page:{url:window.location.hostname,path:window.location.pathname,title:document.title,search:window.location.search,referrer:document.referrer},locale:navigator.language,library:zd,userAgent:navigator.userAgent,clientId:oo}})))}const is=qP(async e=>{if(e.length>0){const t=hv(e);dv?navigator.sendBeacon(Un,t):(await fetch(Un,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function $i(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Un,hv([r]))}else is.push(e)}const De=XP({app:zd,version:qo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;$i({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;$i({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;$i({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function pE(e,t){De.track(e,t)}function mE(){return dv=!0,is.flush()}const pv=new Map;function gE(e,t){pv.set(e,t)}function yE(e,t){vv.set(e,t)}const mv="sesamySignedURLs";function gv(){const e=sessionStorage.getItem(mv);return e?JSON.parse(e):[]}function wE(e){const t=gv();t.push(e),sessionStorage.setItem(mv,JSON.stringify(t))}const bE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function SE(){return new Promise(e=>{const t=bE.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!t.every(n=>{const a=document.querySelector(`#${n.id}`);return a==null?void 0:a.offsetParent});t.forEach(n=>n.remove()),e(r)},100)})}function $E(){const e=navigator.userAgent.toLowerCase(),t=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of t)if(r.regex.test(e))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}function IE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,cancelContract:l,getBill:c,getBills:d,getTransaction:v,getTransactions:h,getProfile:b,updateProfile:g,getTags:P,deleteTag:T,setTag:w,getUserMetadata:p,listUserMetadata:$,setUserMetadata:O,deleteUserMetadata:_,getTally:k,getTallies:M,pushTally:F,deleteTally:Z,getProduct:L,getPaymentIssues:U,isSpotifyLinked:z,unlinkSpotify:R,linkSpotify:K,autoOnboardProduct:X,openHostedAccountPage:Ne,generateLink:m}=eP(e),y={auth:{getUser:b,isAuthenticated:Yo,loginWithRedirect:Xo,logout:xd,setToken:Dd},checkouts:{get:r,create:t,update:n},profile:{get:b,update:g,openHostedAccountPage:Ne,isSpotifyLinked:z,unlinkSpotify:R},analytics:{track:pE},tags:{list:P,set:w,delete:T},entitlements:{get:a,list:i,access:o,signedLinks:gv},contracts:{get:u,list:f,cancel:l},bills:{get:c,list:d},userMetadata:{get:p,list:$,set:O,delete:_},tallies:{get:k,list:M,push:F,delete:Z},subscriptions:{list:s},transactions:{get:v,list:h},products:{get:L,autoOnboard:X,linkSpotify:K},browser:{detectAdblock:SE,isInAppBrowser:$E},getVersion:TE,getPaymentIssues:U,generateLink:m,clearCache:Ie};return e.namespace&&(window[e.namespace]=y),y}function TE(){return qo}async function PE({enabled:e=!1,rules:t}){if(!e)return;const r=await Yo(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await vl(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await vl(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function vl(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function EE(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Dd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const hl="sesamy-refresh",pl="force-refetch-entitlements";function OE(){const e=new URLSearchParams(window.location.search),t=e.get(pl),r=e.get(hl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(pl),e.delete(hl),n.search=e.toString(),Ie(),window.history.replaceState(null,"",n)}}function kE(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;wE({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const ml="sesamy-user";async function _E(){var a;const t=(a=new URLSearchParams(window.location.search).get(ml))==null?void 0:a.toLowerCase();if(!t)return;const r=await DT();(r==null?void 0:r.email)!==t&&(Ie(),Xo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const gl="sesamy-purchase";function RE(){const e=new URLSearchParams(window.location.search),t=e.get(gl);if(t!==null){const r=new URL(window.location.href);e.delete(gl),r.search=e.toString(),Xe(Oe.PURCHASE,{itemSrc:t}),Ie(),window.history.replaceState(null,"",r)}}const yl="sesamy-login",CE="sesamy_login";async function AE(){const e=new URLSearchParams(window.location.search);if(!(e.get(yl)||e.get(CE)))return;await Yo()||Xo();const n=new URL(window.location.href);n.searchParams.delete(yl),window.history.replaceState(null,"",n)}const jE=typeof window<"u";async function wl(e){hE({clientId:e.clientId,environment:e.environment,...e.analytics}),await UT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await PE(e.transform),EE(),OE(),kE(),await AE(),await _E(),RE(),Xe(Oe.READY,{})}async function yv(e){const t=IE({clientId:e.clientId,environment:e.environment,...e.api});return jE&&(e.awaitAllServices?await wl(e):wl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);yv(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=yv;
|