@sesamy/sesamy-js 1.23.1 → 1.24.0
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 +6 -6
- package/dist/sesamy-js.d.ts +52 -34
- package/dist/sesamy-js.iife.js +6 -6
- package/dist/sesamy-js.mjs +1925 -1880
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";var Uh=Object.defineProperty;var xh=(e,t,r)=>t in e?Uh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var pe=(e,t,r)=>xh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},re=function(e){try{return!!e()}catch{return!0}},Nh=re,Hn=!Nh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Al=Hn,jl=Function.prototype,ki=jl.call,Dh=Al&&jl.bind.bind(ki,ki),G=Al?Dh:function(e){return function(){return ki.apply(e,arguments)}},Ll=G,Mh=Ll({}.toString),Fh=Ll("".slice),Gn=function(e){return Fh(Mh(e),8,-1)},Bh=G,zh=re,Hh=Gn,ha=Object,Gh=Bh("".split),Ul=zh(function(){return!ha("z").propertyIsEnumerable(0)})?function(e){return Hh(e)==="String"?Gh(e,""):ha(e)}:ha,Kn=function(e){return e==null},Kh=Kn,Wh=TypeError,Wn=function(e){if(Kh(e))throw new Wh("Can't call method on "+e);return e},Vh=Ul,Zh=Wn,Ar=function(e){return Vh(Zh(e))},ar=function(e){return e&&e.Math===Math&&e},K=ar(typeof globalThis=="object"&&globalThis)||ar(typeof window=="object"&&window)||ar(typeof self=="object"&&self)||ar(typeof zr=="object"&&zr)||ar(typeof zr=="object"&&zr)||function(){return this}()||Function("return this")(),xl={exports:{}},Jh=!1,ps=K,Yh=Object.defineProperty,mo=function(e,t){try{Yh(ps,e,{value:t,configurable:!0,writable:!0})}catch{ps[e]=t}return t},Xh=K,qh=mo,ms="__core-js_shared__",gs=xl.exports=Xh[ms]||qh(ms,{});(gs.versions||(gs.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 go=xl.exports,ys=go,Nl=function(e,t){return ys[e]||(ys[e]=t||{})},Qh=Wn,ev=Object,Vn=function(e){return ev(Qh(e))},tv=G,rv=Vn,nv=tv({}.hasOwnProperty),Se=Object.hasOwn||function(t,r){return nv(rv(t),r)},av=G,iv=0,ov=Math.random(),sv=av(1 .toString),Dl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+sv(++iv+ov,36)},cv=K,ws=cv.navigator,bs=ws&&ws.userAgent,jr=bs?String(bs):"",Ml=K,va=jr,Ss=Ml.process,$s=Ml.Deno,Is=Ss&&Ss.versions||$s&&$s.version,Ts=Is&&Is.v8,_e,En;Ts&&(_e=Ts.split("."),En=_e[0]>0&&_e[0]<4?1:+(_e[0]+_e[1]));!En&&va&&(_e=va.match(/Edge\/(\d+)/),(!_e||_e[1]>=74)&&(_e=va.match(/Chrome\/(\d+)/),_e&&(En=+_e[1])));var Fl=En,Ps=Fl,uv=re,lv=K,fv=lv.String,Bl=!!Object.getOwnPropertySymbols&&!uv(function(){var e=Symbol("symbol detection");return!fv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ps&&Ps<41}),dv=Bl,zl=dv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",hv=K,vv=Nl,Es=Se,pv=Dl,mv=Bl,gv=zl,At=hv.Symbol,pa=vv("wks"),yv=gv?At.for||At:At&&At.withoutSetter||pv,ne=function(e){return Es(pa,e)||(pa[e]=mv&&Es(At,e)?At[e]:yv("Symbol."+e)),pa[e]},ma=typeof document=="object"&&document.all,J=typeof ma>"u"&&ma!==void 0?function(e){return typeof e=="function"||e===ma}:function(e){return typeof e=="function"},wv=J,$e=function(e){return typeof e=="object"?e!==null:wv(e)},bv=$e,Sv=String,$v=TypeError,Ae=function(e){if(bv(e))return e;throw new $v(Sv(e)+" is not an object")},Hl={},Iv=re,ae=!Iv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Tv=ae,Pv=re,Gl=Tv&&Pv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ne={},Ev=K,Os=$e,_i=Ev.document,Ov=Os(_i)&&Os(_i.createElement),Zn=function(e){return Ov?_i.createElement(e):{}},kv=ae,_v=re,Rv=Zn,Kl=!kv&&!_v(function(){return Object.defineProperty(Rv("div"),"a",{get:function(){return 7}}).a!==7}),Cv=Hn,Hr=Function.prototype.call,ie=Cv?Hr.bind(Hr):function(){return Hr.apply(Hr,arguments)},ga=K,Av=J,jv=function(e){return Av(e)?e:void 0},Ie=function(e,t){return arguments.length<2?jv(ga[e]):ga[e]&&ga[e][t]},Lv=G,Jn=Lv({}.isPrototypeOf),Uv=Ie,xv=J,Nv=Jn,Dv=zl,Mv=Object,Wl=Dv?function(e){return typeof e=="symbol"}:function(e){var t=Uv("Symbol");return xv(t)&&Nv(t.prototype,Mv(e))},Fv=String,Yn=function(e){try{return Fv(e)}catch{return"Object"}},Bv=J,zv=Yn,Hv=TypeError,je=function(e){if(Bv(e))return e;throw new Hv(zv(e)+" is not a function")},Gv=je,Kv=Kn,yo=function(e,t){var r=e[t];return Kv(r)?void 0:Gv(r)},ya=ie,wa=J,ba=$e,Wv=TypeError,Vv=function(e,t){var r,n;if(t==="string"&&wa(r=e.toString)&&!ba(n=ya(r,e))||wa(r=e.valueOf)&&!ba(n=ya(r,e))||t!=="string"&&wa(r=e.toString)&&!ba(n=ya(r,e)))return n;throw new Wv("Can't convert object to primitive value")},Zv=ie,ks=$e,_s=Wl,Jv=yo,Yv=Vv,Xv=ne,qv=TypeError,Qv=Xv("toPrimitive"),ep=function(e,t){if(!ks(e)||_s(e))return e;var r=Jv(e,Qv),n;if(r){if(t===void 0&&(t="default"),n=Zv(r,e,t),!ks(n)||_s(n))return n;throw new qv("Can't convert object to primitive value")}return t===void 0&&(t="number"),Yv(e,t)},tp=ep,rp=Wl,Vl=function(e){var t=tp(e,"string");return rp(t)?t:t+""},np=ae,ap=Kl,ip=Gl,Gr=Ae,Rs=Vl,op=TypeError,Sa=Object.defineProperty,sp=Object.getOwnPropertyDescriptor,$a="enumerable",Ia="configurable",Ta="writable";Ne.f=np?ip?function(t,r,n){if(Gr(t),r=Rs(r),Gr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Ta in n&&!n[Ta]){var a=sp(t,r);a&&a[Ta]&&(t[r]=n.value,n={configurable:Ia in n?n[Ia]:a[Ia],enumerable:$a in n?n[$a]:a[$a],writable:!1})}return Sa(t,r,n)}:Sa:function(t,r,n){if(Gr(t),r=Rs(r),Gr(n),ap)try{return Sa(t,r,n)}catch{}if("get"in n||"set"in n)throw new op("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var cp=Math.ceil,up=Math.floor,lp=Math.trunc||function(t){var r=+t;return(r>0?up:cp)(r)},fp=lp,wo=function(e){var t=+e;return t!==t||t===0?0:fp(t)},dp=wo,hp=Math.max,vp=Math.min,Zl=function(e,t){var r=dp(e);return r<0?hp(r+t,0):vp(r,t)},pp=wo,mp=Math.min,gp=function(e){var t=pp(e);return t>0?mp(t,9007199254740991):0},yp=gp,bo=function(e){return yp(e.length)},wp=Ar,bp=Zl,Sp=bo,Cs=function(e){return function(t,r,n){var a=wp(t),i=Sp(a);if(i===0)return!e&&-1;var o=bp(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}},$p={includes:Cs(!0),indexOf:Cs(!1)},So={},Ip=G,Pa=Se,Tp=Ar,Pp=$p.indexOf,Ep=So,As=Ip([].push),Jl=function(e,t){var r=Tp(e),n=0,a=[],i;for(i in r)!Pa(Ep,i)&&Pa(r,i)&&As(a,i);for(;t.length>n;)Pa(r,i=t[n++])&&(~Pp(a,i)||As(a,i));return a},$o=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Op=Jl,kp=$o,Yl=Object.keys||function(t){return Op(t,kp)},_p=ae,Rp=Gl,Cp=Ne,Ap=Ae,jp=Ar,Lp=Yl;Hl.f=_p&&!Rp?Object.defineProperties:function(t,r){Ap(t);for(var n=jp(r),a=Lp(r),i=a.length,o=0,s;i>o;)Cp.f(t,s=a[o++],n[s]);return t};var Up=Ie,Xl=Up("document","documentElement"),xp=Nl,Np=Dl,js=xp("keys"),Io=function(e){return js[e]||(js[e]=Np(e))},Dp=Ae,Mp=Hl,Ls=$o,Fp=So,Bp=Xl,zp=Zn,Hp=Io,Us=">",xs="<",Ri="prototype",Ci="script",ql=Hp("IE_PROTO"),Ea=function(){},Ql=function(e){return xs+Ci+Us+e+xs+"/"+Ci+Us},Ns=function(e){e.write(Ql("")),e.close();var t=e.parentWindow.Object;return e=null,t},Gp=function(){var e=zp("iframe"),t="java"+Ci+":",r;return e.style.display="none",Bp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Ql("document.F=Object")),r.close(),r.F},Kr,gn=function(){try{Kr=new ActiveXObject("htmlfile")}catch{}gn=typeof document<"u"?document.domain&&Kr?Ns(Kr):Gp():Ns(Kr);for(var e=Ls.length;e--;)delete gn[Ri][Ls[e]];return gn()};Fp[ql]=!0;var Xn=Object.create||function(t,r){var n;return t!==null?(Ea[Ri]=Dp(t),n=new Ea,Ea[Ri]=null,n[ql]=t):n=gn(),r===void 0?n:Mp.f(n,r)},Kp=ne,Wp=Xn,Vp=Ne.f,Ai=Kp("unscopables"),ji=Array.prototype;ji[Ai]===void 0&&Vp(ji,Ai,{configurable:!0,value:Wp(null)});var Zp=function(e){ji[Ai][e]=!0},Lr={},Jp=K,Yp=J,Ds=Jp.WeakMap,Xp=Yp(Ds)&&/native code/.test(String(Ds)),yt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},qp=ae,Qp=Ne,em=yt,wt=qp?function(e,t,r){return Qp.f(e,t,em(1,r))}:function(e,t,r){return e[t]=r,e},tm=Xp,ef=K,rm=$e,nm=wt,Oa=Se,ka=go,am=Io,im=So,Ms="Object already initialized",Li=ef.TypeError,om=ef.WeakMap,On,kr,kn,sm=function(e){return kn(e)?kr(e):On(e,{})},cm=function(e){return function(t){var r;if(!rm(t)||(r=kr(t)).type!==e)throw new Li("Incompatible receiver, "+e+" required");return r}};if(tm||ka.state){var Le=ka.state||(ka.state=new om);Le.get=Le.get,Le.has=Le.has,Le.set=Le.set,On=function(e,t){if(Le.has(e))throw new Li(Ms);return t.facade=e,Le.set(e,t),t},kr=function(e){return Le.get(e)||{}},kn=function(e){return Le.has(e)}}else{var $t=am("state");im[$t]=!0,On=function(e,t){if(Oa(e,$t))throw new Li(Ms);return t.facade=e,nm(e,$t,t),t},kr=function(e){return Oa(e,$t)?e[$t]:{}},kn=function(e){return Oa(e,$t)}}var Xt={set:On,get:kr,has:kn,enforce:sm,getterFor:cm},To={},Po={},tf={}.propertyIsEnumerable,rf=Object.getOwnPropertyDescriptor,um=rf&&!tf.call({1:2},1);Po.f=um?function(t){var r=rf(this,t);return!!r&&r.enumerable}:tf;var lm=ae,fm=ie,dm=Po,hm=yt,vm=Ar,pm=Vl,mm=Se,gm=Kl,Fs=Object.getOwnPropertyDescriptor;To.f=lm?Fs:function(t,r){if(t=vm(t),r=pm(r),gm)try{return Fs(t,r)}catch{}if(mm(t,r))return hm(!fm(dm.f,t,r),t[r])};var nf={exports:{}},Ui=ae,ym=Se,af=Function.prototype,wm=Ui&&Object.getOwnPropertyDescriptor,Eo=ym(af,"name"),bm=Eo&&(function(){}).name==="something",Sm=Eo&&(!Ui||Ui&&wm(af,"name").configurable),of={EXISTS:Eo,PROPER:bm,CONFIGURABLE:Sm},$m=G,Im=J,xi=go,Tm=$m(Function.toString);Im(xi.inspectSource)||(xi.inspectSource=function(e){return Tm(e)});var Oo=xi.inspectSource,ko=G,Pm=re,Em=J,Wr=Se,Ni=ae,Om=of.CONFIGURABLE,km=Oo,sf=Xt,_m=sf.enforce,Rm=sf.get,Bs=String,yn=Object.defineProperty,Cm=ko("".slice),Am=ko("".replace),jm=ko([].join),Lm=Ni&&!Pm(function(){return yn(function(){},"length",{value:8}).length!==8}),Um=String(String).split("String"),xm=nf.exports=function(e,t,r){Cm(Bs(t),0,7)==="Symbol("&&(t="["+Am(Bs(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Wr(e,"name")||Om&&e.name!==t)&&(Ni?yn(e,"name",{value:t,configurable:!0}):e.name=t),Lm&&r&&Wr(r,"arity")&&e.length!==r.arity&&yn(e,"length",{value:r.arity});try{r&&Wr(r,"constructor")&&r.constructor?Ni&&yn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=_m(e);return Wr(n,"source")||(n.source=jm(Um,typeof t=="string"?t:"")),e};Function.prototype.toString=xm(function(){return Em(this)&&Rm(this).source||km(this)},"toString");var cf=nf.exports,Nm=J,Dm=Ne,Mm=cf,Fm=mo,Te=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(Nm(r)&&Mm(r,i,n),n.global)a?e[t]=r:Fm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Dm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},uf={},Bm=Jl,zm=$o,Hm=zm.concat("length","prototype");uf.f=Object.getOwnPropertyNames||function(t){return Bm(t,Hm)};var _o={};_o.f=Object.getOwnPropertySymbols;var Gm=Ie,Km=G,Wm=uf,Vm=_o,Zm=Ae,Jm=Km([].concat),Ym=Gm("Reflect","ownKeys")||function(t){var r=Wm.f(Zm(t)),n=Vm.f;return n?Jm(r,n(t)):r},zs=Se,Xm=Ym,qm=To,Qm=Ne,lf=function(e,t,r){for(var n=Xm(t),a=Qm.f,i=qm.f,o=0;o<n.length;o++){var s=n[o];!zs(e,s)&&!(r&&zs(r,s))&&a(e,s,i(t,s))}},eg=re,tg=J,rg=/#|\.prototype\./,Ur=function(e,t){var r=ag[ng(e)];return r===og?!0:r===ig?!1:tg(t)?eg(t):!!t},ng=Ur.normalize=function(e){return String(e).replace(rg,".").toLowerCase()},ag=Ur.data={},ig=Ur.NATIVE="N",og=Ur.POLYFILL="P",ff=Ur,Vr=K,sg=To.f,cg=wt,ug=Te,lg=mo,fg=lf,dg=ff,Q=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Vr:a?o=Vr[r]||lg(r,{}):o=Vr[r]&&Vr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=sg(o,s),u=l&&l.value):u=o[s],i=dg(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;fg(f,u)}(e.sham||u&&u.sham)&&cg(f,"sham",!0),ug(o,s,f,e)}},hg=re,vg=!hg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),pg=Se,mg=J,gg=Vn,yg=Io,wg=vg,Hs=yg("IE_PROTO"),Di=Object,bg=Di.prototype,Ro=wg?Di.getPrototypeOf:function(e){var t=gg(e);if(pg(t,Hs))return t[Hs];var r=t.constructor;return mg(r)&&t instanceof r?r.prototype:t instanceof Di?bg:null},Sg=re,$g=J,Ig=$e,Gs=Ro,Tg=Te,Pg=ne,Mi=Pg("iterator"),df=!1,vt,_a,Ra;[].keys&&(Ra=[].keys(),"next"in Ra?(_a=Gs(Gs(Ra)),_a!==Object.prototype&&(vt=_a)):df=!0);var Eg=!Ig(vt)||Sg(function(){var e={};return vt[Mi].call(e)!==e});Eg&&(vt={});$g(vt[Mi])||Tg(vt,Mi,function(){return this});var hf={IteratorPrototype:vt,BUGGY_SAFARI_ITERATORS:df},Og=Ne.f,kg=Se,_g=ne,Ks=_g("toStringTag"),qt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!kg(e,Ks)&&Og(e,Ks,{configurable:!0,value:t})},Rg=hf.IteratorPrototype,Cg=Xn,Ag=yt,jg=qt,Lg=Lr,Ug=function(){return this},vf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Cg(Rg,{next:Ag(+!n,r)}),jg(e,a,!1),Lg[a]=Ug,e},xg=G,Ng=je,Dg=function(e,t,r){try{return xg(Ng(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Mg=$e,Fg=function(e){return Mg(e)||e===null},Bg=Fg,zg=String,Hg=TypeError,Gg=function(e){if(Bg(e))return e;throw new Hg("Can't set "+zg(e)+" as a prototype")},Kg=Dg,Wg=$e,Vg=Wn,Zg=Gg,Co=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Kg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Vg(a),Zg(i),Wg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Jg=Q,Yg=ie,pf=of,Xg=J,qg=vf,Ws=Ro,Vs=Co,Qg=qt,ey=wt,Ca=Te,ty=ne,ry=Lr,mf=hf,ny=pf.PROPER,ay=pf.CONFIGURABLE,Zs=mf.IteratorPrototype,Zr=mf.BUGGY_SAFARI_ITERATORS,ir=ty("iterator"),Js="keys",or="values",Ys="entries",iy=function(){return this},gf=function(e,t,r,n,a,i,o){qg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Zr&&T&&T in l)return l[T];switch(T){case Js:return function(){return new r(this,T)};case or:return function(){return new r(this,T)};case Ys:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[ir]||l["@@iterator"]||a&&l[a],d=!Zr&&c||s(a),h=t==="Array"&&l.entries||c,v,b,g;if(h&&(v=Ws(h.call(new e)),v!==Object.prototype&&v.next&&(Ws(v)!==Zs&&(Vs?Vs(v,Zs):Xg(v[ir])||Ca(v,ir,iy)),Qg(v,u,!0))),ny&&a===or&&c&&c.name!==or&&(ay?ey(l,"name",or):(f=!0,d=function(){return Yg(c,this)})),a)if(b={values:s(or),keys:i?d:s(Js),entries:s(Ys)},o)for(g in b)(Zr||f||!(g in l))&&Ca(l,g,b[g]);else Jg({target:t,proto:!0,forced:Zr||f},b);return l[ir]!==d&&Ca(l,ir,d,{name:a}),ry[t]=d,b},Ao=function(e,t){return{value:e,done:t}},oy=Ar,jo=Zp,Xs=Lr,yf=Xt,sy=Ne.f,cy=gf,Jr=Ao,uy=ae,wf="Array Iterator",ly=yf.set,fy=yf.getterFor(wf),dy=cy(Array,"Array",function(e,t){ly(this,{type:wf,target:oy(e),index:0,kind:t})},function(){var e=fy(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,Jr(void 0,!0);switch(e.kind){case"keys":return Jr(r,!1);case"values":return Jr(t[r],!1)}return Jr([r,t[r]],!1)},"values"),qs=Xs.Arguments=Xs.Array;jo("keys");jo("values");jo("entries");if(uy&&qs.name!=="values")try{sy(qs,"name",{value:"values"})}catch{}var hy=Q,vy=G,py=Zl,my=RangeError,Qs=String.fromCharCode,ec=String.fromCodePoint,gy=vy([].join),yy=!!ec&&ec.length!==1;hy({target:"String",stat:!0,arity:1,forced:yy},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],py(i,1114111)!==i)throw new my(i+" is not a valid code point");r[a]=i<65536?Qs(i):Qs(((i-=65536)>>10)+55296,i%1024+56320)}return gy(r,"")}});var tc=K,wy=ae,by=Object.getOwnPropertyDescriptor,bf=function(e){if(!wy)return tc[e];var t=by(tc,e);return t&&t.value},Sy=re,$y=ne,Iy=ae,rc=Jh,Ty=$y("iterator"),qn=!Sy(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),rc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(rc||!Iy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Ty]||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"}),nc=cf,Py=Ne,Qn=function(e,t,r){return r.get&&nc(r.get,t,{getter:!0}),r.set&&nc(r.set,t,{setter:!0}),Py.f(e,t,r)},Ey=Te,Oy=function(e,t,r){for(var n in t)Ey(e,n,t[n],r);return e},ky=Jn,_y=TypeError,Lo=function(e,t){if(ky(t,e))return e;throw new _y("Incorrect invocation")},Ry=Gn,Cy=G,Ay=function(e){if(Ry(e)==="Function")return Cy(e)},ac=Ay,jy=je,Ly=Hn,Uy=ac(ac.bind),Qt=function(e,t){return jy(e),t===void 0?e:Ly?Uy(e,t):function(){return e.apply(t,arguments)}},xy=ne,Ny=xy("toStringTag"),Sf={};Sf[Ny]="z";var Uo=String(Sf)==="[object z]",Dy=Uo,My=J,wn=Gn,Fy=ne,By=Fy("toStringTag"),zy=Object,Hy=wn(function(){return arguments}())==="Arguments",Gy=function(e,t){try{return e[t]}catch{}},xr=Dy?wn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Gy(t=zy(e),By))=="string"?r:Hy?wn(t):(n=wn(t))==="Object"&&My(t.callee)?"Arguments":n},Ky=xr,Wy=String,Ve=function(e){if(Ky(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Wy(e)},Vy=xr,ic=yo,Zy=Kn,Jy=Lr,Yy=ne,Xy=Yy("iterator"),ea=function(e){if(!Zy(e))return ic(e,Xy)||ic(e,"@@iterator")||Jy[Vy(e)]},qy=ie,Qy=je,ew=Ae,tw=Yn,rw=ea,nw=TypeError,xo=function(e,t){var r=arguments.length<2?rw(e):t;if(Qy(r))return ew(qy(r,e));throw new nw(tw(e)+" is not iterable")},aw=TypeError,bt=function(e,t){if(e<t)throw new aw("Not enough arguments");return e},iw=G,ta=iw([].slice),oc=ta,ow=Math.floor,Fi=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=ow(r/2),s=Fi(oc(e,0,o),t),u=Fi(oc(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},sw=Fi,Bi=Q,$f=K,No=bf,cw=Ie,Yr=ie,Ce=G,yr=ae,If=qn,Tf=Te,uw=Qn,lw=Oy,fw=qt,dw=vf,Do=Xt,Pf=Lo,Aa=J,hw=Se,vw=Qt,pw=xr,mw=Ae,Ef=$e,se=Ve,gw=Xn,sc=yt,cc=xo,yw=ea,Xr=Ao,It=bt,ww=ne,bw=sw,Sw=ww("iterator"),er="URLSearchParams",Of=er+"Iterator",kf=Do.set,we=Do.getterFor(er),$w=Do.getterFor(Of),uc=No("fetch"),_n=No("Request"),wr=No("Headers"),ja=_n&&_n.prototype,lc=wr&&wr.prototype,Iw=$f.TypeError,Tw=$f.encodeURIComponent,Pw=String.fromCharCode,Ew=cw("String","fromCodePoint"),Ow=parseInt,bn=Ce("".charAt),fc=Ce([].join),Xe=Ce([].push),_f=Ce("".replace),kw=Ce([].shift),dc=Ce([].splice),hc=Ce("".split),Rf=Ce("".slice),_w=Ce(/./.exec),Rw=/\+/g,La="�",Cw=/^[0-9a-f]+$/i,vc=function(e,t){var r=Rf(e,t,t+2);return _w(Cw,r)?Ow(r,16):NaN},Aw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},jw=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},pc=function(e){e=_f(e,Rw," ");for(var t=e.length,r="",n=0;n<t;){var a=bn(e,n);if(a==="%"){if(bn(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=vc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=Aw(i);if(o===0)a=Pw(i);else{if(o===1||o>4){r+=La,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||bn(e,n)!=="%"));){var f=vc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Xe(s,f),n+=2,u++}if(s.length!==o){r+=La;continue}var l=jw(s);l===null?r+=La:a=Ew(l)}}r+=a,n++}return r},Lw=/[!'()~]|%20/g,Uw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},xw=function(e){return Uw[e]},mc=function(e){return _f(Tw(e),Lw,xw)},Ua=dw(function(t,r){kf(this,{type:Of,target:we(t).entries,index:0,kind:r})},er,function(){var t=$w(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,Xr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Xr(a.key,!1);case"values":return Xr(a.value,!1)}return Xr([a.key,a.value],!1)},!0),Cf=function(e){this.entries=[],this.url=null,e!==void 0&&(Ef(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?bn(e,0)==="?"?Rf(e,1):e:se(e)))};Cf.prototype={type:er,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=yw(e),n,a,i,o,s,u,f;if(r)for(n=cc(e,r),a=n.next;!(i=Yr(a,n)).done;){if(o=cc(mw(i.value)),s=o.next,(u=Yr(s,o)).done||(f=Yr(s,o)).done||!Yr(s,o).done)throw new Iw("Expected sequence with length 2");Xe(t,{key:se(u.value),value:se(f.value)})}else for(var l in e)hw(e,l)&&Xe(t,{key:l,value:se(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=hc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=hc(a,"="),Xe(t,{key:pc(kw(i)),value:pc(fc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Xe(t,mc(n.key)+"="+mc(n.value));return fc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ra=function(){Pf(this,Bt);var t=arguments.length>0?arguments[0]:void 0,r=kf(this,new Cf(t));yr||(this.size=r.entries.length)},Bt=ra.prototype;lw(Bt,{append:function(t,r){var n=we(this);It(arguments.length,2),Xe(n.entries,{key:se(t),value:se(r)}),yr||this.length++,n.updateURL()},delete:function(e){for(var t=we(this),r=It(arguments.length,1),n=t.entries,a=se(e),i=r<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(dc(n,s,1),o!==void 0)break}else s++}yr||(this.size=n.length),t.updateURL()},get:function(t){var r=we(this).entries;It(arguments.length,1);for(var n=se(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=we(this).entries;It(arguments.length,1);for(var n=se(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Xe(a,r[i].value);return a},has:function(t){for(var r=we(this).entries,n=It(arguments.length,1),a=se(t),i=n<2?void 0:arguments[1],o=i===void 0?i:se(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=we(this);It(arguments.length,1);for(var a=n.entries,i=!1,o=se(t),s=se(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?dc(a,u--,1):(i=!0,f.value=s));i||Xe(a,{key:o,value:s}),yr||(this.size=a.length),n.updateURL()},sort:function(){var t=we(this);bw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=we(this).entries,n=vw(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 Ua(this,"keys")},values:function(){return new Ua(this,"values")},entries:function(){return new Ua(this,"entries")}},{enumerable:!0});Tf(Bt,Sw,Bt.entries,{name:"entries"});Tf(Bt,"toString",function(){return we(this).serialize()},{enumerable:!0});yr&&uw(Bt,"size",{get:function(){return we(this).entries.length},configurable:!0,enumerable:!0});fw(ra,er);Bi({global:!0,constructor:!0,forced:!If},{URLSearchParams:ra});if(!If&&Aa(wr)){var Nw=Ce(lc.has),Dw=Ce(lc.set),gc=function(e){if(Ef(e)){var t=e.body,r;if(pw(t)===er)return r=e.headers?new wr(e.headers):new wr,Nw(r,"content-type")||Dw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),gw(e,{body:sc(0,se(t)),headers:sc(0,r)})}return e};if(Aa(uc)&&Bi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return uc(t,arguments.length>1?gc(arguments[1]):{})}}),Aa(_n)){var xa=function(t){return Pf(this,ja),new _n(t,arguments.length>1?gc(arguments[1]):{})};ja.constructor=xa,xa.prototype=ja,Bi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:xa})}}var Mw={URLSearchParams:ra,getState:we},Fw=Te,na=G,yc=Ve,Bw=bt,Af=URLSearchParams,aa=Af.prototype,zw=na(aa.append),wc=na(aa.delete),Hw=na(aa.forEach),Gw=na([].push),Mo=new Af("a=1&a=2&b=3");Mo.delete("a",1);Mo.delete("b",void 0);Mo+""!="a=2"&&Fw(aa,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return wc(this,e);var n=[];Hw(this,function(c,d){Gw(n,{key:d,value:c})}),Bw(t,1);for(var a=yc(e),i=yc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,wc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||zw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Kw=Te,jf=G,Ww=Ve,Vw=bt,Lf=URLSearchParams,Fo=Lf.prototype,Zw=jf(Fo.getAll),Jw=jf(Fo.has),bc=new Lf("a=1");(bc.has("a",2)||!bc.has("a",void 0))&&Kw(Fo,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Jw(this,t);var a=Zw(this,t);Vw(r,1);for(var i=Ww(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Yw=ae,Xw=G,qw=Qn,zi=URLSearchParams.prototype,Qw=Xw(zi.forEach);Yw&&!("size"in zi)&&qw(zi,"size",{get:function(){var t=0;return Qw(this,function(){t++}),t},configurable:!0,enumerable:!0});var eb=K,Bo=eb,tb=Bo;tb.URLSearchParams;var zo=G,rb=wo,nb=Ve,ab=Wn,ib=zo("".charAt),Sc=zo("".charCodeAt),ob=zo("".slice),$c=function(e){return function(t,r){var n=nb(ab(t)),a=rb(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=Sc(n,a),o<55296||o>56319||a+1===i||(s=Sc(n,a+1))<56320||s>57343?e?ib(n,a):o:e?ob(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},Uf={codeAt:$c(!1),charAt:$c(!0)},sb=Uf.charAt,cb=Ve,xf=Xt,ub=gf,Ic=Ao,Nf="String Iterator",lb=xf.set,fb=xf.getterFor(Nf);ub(String,"String",function(e){lb(this,{type:Nf,string:cb(e),index:0})},function(){var t=fb(this),r=t.string,n=t.index,a;return n>=r.length?Ic(void 0,!0):(a=sb(r,n),t.index+=a.length,Ic(a,!1))});var Tc=ae,db=G,hb=ie,vb=re,Na=Yl,pb=_o,mb=Po,gb=Vn,yb=Ul,Tt=Object.assign,Pc=Object.defineProperty,wb=db([].concat),bb=!Tt||vb(function(){if(Tc&&Tt({b:1},Tt(Pc({},"a",{enumerable:!0,get:function(){Pc(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}),Tt({},e)[r]!==7||Na(Tt({},t)).join("")!==n})?function(t,r){for(var n=gb(t),a=arguments.length,i=1,o=pb.f,s=mb.f;a>i;)for(var u=yb(arguments[i++]),f=o?wb(Na(u),o(u)):Na(u),l=f.length,c=0,d;l>c;)d=f[c++],(!Tc||hb(s,u,d))&&(n[d]=u[d]);return n}:Tt,Sb=ie,Ec=Ae,$b=yo,Df=function(e,t,r){var n,a;Ec(e);try{if(n=$b(e,"return"),!n){if(t==="throw")throw r;return r}n=Sb(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Ec(n),r},Ib=Ae,Tb=Df,Pb=function(e,t,r,n){try{return n?t(Ib(r)[0],r[1]):t(r)}catch(a){Tb(e,"throw",a)}},Eb=ne,Ob=Lr,kb=Eb("iterator"),_b=Array.prototype,Mf=function(e){return e!==void 0&&(Ob.Array===e||_b[kb]===e)},Rb=G,Cb=re,Ff=J,Ab=xr,jb=Ie,Lb=Oo,Bf=function(){},zf=jb("Reflect","construct"),Ho=/^\s*(?:class|function)\b/,Ub=Rb(Ho.exec),xb=!Ho.test(Bf),sr=function(t){if(!Ff(t))return!1;try{return zf(Bf,[],t),!0}catch{return!1}},Hf=function(t){if(!Ff(t))return!1;switch(Ab(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return xb||!!Ub(Ho,Lb(t))}catch{return!0}};Hf.sham=!0;var Gf=!zf||Cb(function(){var e;return sr(sr.call)||!sr(Object)||!sr(function(){e=!0})||e})?Hf:sr,Nb=ae,Db=Ne,Mb=yt,Fb=function(e,t,r){Nb?Db.f(e,t,Mb(0,r)):e[t]=r},Bb=Qt,zb=ie,Hb=Vn,Gb=Pb,Kb=Mf,Wb=Gf,Vb=bo,Oc=Fb,Zb=xo,Jb=ea,kc=Array,Yb=function(t){var r=Hb(t),n=Wb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Bb(i,a>2?arguments[2]:void 0));var s=Jb(r),u=0,f,l,c,d,h,v;if(s&&!(this===kc&&Kb(s)))for(l=n?new this:[],d=Zb(r,s),h=d.next;!(c=zb(h,d)).done;u++)v=o?Gb(d,i,[c.value,u],!0):c.value,Oc(l,u,v);else for(f=Vb(r),l=n?new this(f):kc(f);f>u;u++)v=o?i(r[u],u):r[u],Oc(l,u,v);return l.length=u,l},St=G,Da=2147483647,br=36,Kf=1,Hi=26,Xb=38,qb=700,Qb=72,eS=128,tS="-",rS=/[^\0-\u007E]/,Wf=/[.\u3002\uFF0E\uFF61]/g,_c="Overflow: input needs wider integers to process",Ma=br-Kf,Rc=RangeError,nS=St(Wf.exec),jt=Math.floor,Fa=String.fromCharCode,Cc=St("".charCodeAt),Vf=St([].join),qe=St([].push),aS=St("".replace),iS=St("".split),oS=St("".toLowerCase),sS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Cc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Cc(e,r++);(i&64512)===56320?qe(t,((a&1023)<<10)+(i&1023)+65536):(qe(t,a),r--)}else qe(t,a)}return t},Ac=function(e){return e+22+75*(e<26)},cS=function(e,t,r){var n=0;for(e=r?jt(e/qb):e>>1,e+=jt(e/t);e>Ma*Hi>>1;)e=jt(e/Ma),n+=br;return jt(n+(Ma+1)*e/(e+Xb))},uS=function(e){var t=[];e=sS(e);var r=e.length,n=eS,a=0,i=Qb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&qe(t,Fa(s));var u=t.length,f=u;for(u&&qe(t,tS);f<r;){var l=Da;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>jt((Da-a)/c))throw new Rc(_c);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Da)throw new Rc(_c);if(s===n){for(var d=a,h=br;;){var v=h<=i?Kf:h>=i+Hi?Hi:h-i;if(d<v)break;var b=d-v,g=br-v;qe(t,Fa(Ac(v+b%g))),d=jt(b/g),h+=br}qe(t,Fa(Ac(d))),i=cS(a,c,f===u),a=0,f++}}a++,n++}return Vf(t,"")},lS=function(e){var t=[],r=iS(aS(oS(e),Wf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],qe(t,nS(rS,a)?"xn--"+uS(a):a);return Vf(t,".")},fS=Q,Go=ae,dS=qn,Ko=K,jc=Qt,Pe=G,Rn=Te,me=Qn,hS=Lo,Gi=Se,Wo=bb,Pt=Yb,Ee=ta,vS=Uf.codeAt,pS=lS,Be=Ve,mS=qt,gS=bt,Zf=Mw,Jf=Xt,yS=Jf.set,Cn=Jf.getterFor("URL"),wS=Zf.URLSearchParams,bS=Zf.getState,cr=Ko.URL,Ki=Ko.TypeError,An=Ko.parseInt,SS=Math.floor,Lc=Math.pow,be=Pe("".charAt),Re=Pe(/./.exec),vr=Pe([].join),$S=Pe(1 .toString),IS=Pe([].pop),_t=Pe([].push),Ba=Pe("".replace),TS=Pe([].shift),PS=Pe("".split),Sr=Pe("".slice),jn=Pe("".toLowerCase),ES=Pe([].unshift),OS="Invalid authority",za="Invalid scheme",nt="Invalid host",Uc="Invalid port",Yf=/[a-z]/i,kS=/[\d+-.a-z]/i,Wi=/\d/,_S=/^0x/i,RS=/^[0-7]+$/,CS=/^\d+$/,Xf=/^[\da-f]+$/i,AS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,jS=/[\0\t\n\r #/:<>?@[\\\]^|]/,LS=/^[\u0000-\u0020]+/,US=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,xS=/[\t\n\r]/g,ge,NS=function(e){var t=PS(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&&be(i,0)==="0"&&(o=Re(_S,i)?16:8,i=Sr(i,o===8?1:2)),i==="")s=0;else{if(!Re(o===10?CS:o===8?RS:Xf,i))return e;s=An(i,o)}_t(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Lc(256,5-r))return null}else if(s>255)return null;for(u=IS(n),a=0;a<n.length;a++)u+=n[a]*Lc(256,3-a);return u},DS=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 be(e,a)};if(d()===":"){if(be(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&&Re(Xf,d());)i=i*16+An(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(!Re(Wi,d()))return;for(;Re(Wi,d());){if(f=An(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},MS=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},ur=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)ES(t,e%256),e=SS(e/256);return vr(t,".")}if(typeof e=="object"){for(t="",n=MS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=$S(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Sn={},qf=Wo({},Sn,{" ":1,'"':1,"<":1,">":1,"`":1}),Qf=Wo({},qf,{"#":1,"?":1,"{":1,"}":1}),Ha=Wo({},Qf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ze=function(e,t){var r=vS(e,0);return r>32&&r<127&&!Gi(t,e)?e:encodeURIComponent(e)},qr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pr=function(e,t){var r;return e.length===2&&Re(Yf,be(e,0))&&((r=be(e,1))===":"||!t&&r==="|")},xc=function(e){var t;return e.length>1&&pr(Sr(e,0,2))&&(e.length===2||(t=be(e,2))==="/"||t==="\\"||t==="?"||t==="#")},FS=function(e){return e==="."||jn(e)==="%2e"},BS=function(e){return e=jn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ga={},Nc={},Ka={},Dc={},Mc={},Wa={},Fc={},Bc={},Qr={},en={},Va={},Za={},Ja={},Ya={},zc={},Xa={},Et={},Ue={},Hc={},at={},Fe={},Vo=function(e,t,r){var n=Be(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Ki(i);this.searchParams=null}else{if(r!==void 0&&(a=new Vo(r,!0)),i=this.parse(n,null,a),i)throw new Ki(i);o=bS(new wS),o.bindURL(this),this.searchParams=o}};Vo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ga,i=0,o="",s=!1,u=!1,f=!1,l,c,d,h;for(e=Be(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=Ba(e,LS,""),e=Ba(e,US,"$1")),e=Ba(e,xS,""),l=Pt(e);i<=l.length;){switch(c=l[i],a){case Ga:if(c&&Re(Yf,c))o+=jn(c),a=Nc;else{if(t)return za;a=Ka;continue}break;case Nc:if(c&&(Re(kS,c)||c==="+"||c==="-"||c==="."))o+=jn(c);else if(c===":"){if(t&&(n.isSpecial()!==Gi(qr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&qr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ya:n.isSpecial()&&r&&r.scheme===n.scheme?a=Dc:n.isSpecial()?a=Bc:l[i+1]==="/"?(a=Mc,i++):(n.cannotBeABaseURL=!0,_t(n.path,""),a=Hc)}else{if(t)return za;o="",a=Ka,i=0;continue}break;case Ka:if(!r||r.cannotBeABaseURL&&c!=="#")return za;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Ee(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Fe;break}a=r.scheme==="file"?Ya:Wa;continue;case Dc:if(c==="/"&&l[i+1]==="/")a=Qr,i++;else{a=Wa;continue}break;case Mc:if(c==="/"){a=en;break}else{a=Ue;continue}case Wa:if(n.scheme=r.scheme,c===ge)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ee(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Fc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ee(r.path),n.query="",a=at;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ee(r.path),n.query=r.query,n.fragment="",a=Fe;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Ee(r.path),n.path.length--,a=Ue;continue}break;case Fc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Qr;else if(c==="/")a=en;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ue;continue}break;case Bc:if(a=Qr,c!=="/"||be(o,i+1)!=="/")continue;i++;break;case Qr:if(c!=="/"&&c!=="\\"){a=en;continue}break;case en:if(c==="@"){s&&(o="%40"+o),s=!0,d=Pt(o);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ze(b,Ha);f?n.password+=g:n.username+=g}o=""}else if(c===ge||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return OS;i-=Pt(o).length+1,o="",a=Va}else o+=c;break;case Va:case Za:if(t&&n.scheme==="file"){a=Xa;continue}else if(c===":"&&!u){if(o==="")return nt;if(h=n.parseHost(o),h)return h;if(o="",a=Ja,t===Za)return}else if(c===ge||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return nt;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=Et,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ja:if(Re(Wi,c))o+=c;else if(c===ge||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=An(o,10);if(T>65535)return Uc;n.port=n.isSpecial()&&T===qr[n.scheme]?null:T,o=""}if(t)return;a=Et;continue}else return Uc;break;case Ya:if(n.scheme="file",c==="/"||c==="\\")a=zc;else if(r&&r.scheme==="file")switch(c){case ge:n.host=r.host,n.path=Ee(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Ee(r.path),n.query="",a=at;break;case"#":n.host=r.host,n.path=Ee(r.path),n.query=r.query,n.fragment="",a=Fe;break;default:xc(vr(Ee(l,i),""))||(n.host=r.host,n.path=Ee(r.path),n.shortenPath()),a=Ue;continue}else{a=Ue;continue}break;case zc:if(c==="/"||c==="\\"){a=Xa;break}r&&r.scheme==="file"&&!xc(vr(Ee(l,i),""))&&(pr(r.path[0],!0)?_t(n.path,r.path[0]):n.host=r.host),a=Ue;continue;case Xa:if(c===ge||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&pr(o))a=Ue;else if(o===""){if(n.host="",t)return;a=Et}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=Et}continue}else o+=c;break;case Et:if(n.isSpecial()){if(a=Ue,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=at;else if(!t&&c==="#")n.fragment="",a=Fe;else if(c!==ge&&(a=Ue,c!=="/"))continue;break;case Ue:if(c===ge||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(BS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&_t(n.path,"")):FS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&_t(n.path,""):(n.scheme==="file"&&!n.path.length&&pr(o)&&(n.host&&(n.host=""),o=be(o,0)+":"),_t(n.path,o)),o="",n.scheme==="file"&&(c===ge||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)TS(n.path);c==="?"?(n.query="",a=at):c==="#"&&(n.fragment="",a=Fe)}else o+=Ze(c,Qf);break;case Hc:c==="?"?(n.query="",a=at):c==="#"?(n.fragment="",a=Fe):c!==ge&&(n.path[0]+=Ze(c,Sn));break;case at:!t&&c==="#"?(n.fragment="",a=Fe):c!==ge&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ze(c,Sn));break;case Fe:c!==ge&&(n.fragment+=Ze(c,qf));break}i++}},parseHost:function(e){var t,r,n;if(be(e,0)==="["){if(be(e,e.length-1)!=="]"||(t=DS(Sr(e,1,-1)),!t))return nt;this.host=t}else if(this.isSpecial()){if(e=pS(e),Re(AS,e)||(t=NS(e),t===null))return nt;this.host=t}else{if(Re(jS,e))return nt;for(t="",r=Pt(e),n=0;n<r.length;n++)t+=Ze(r[n],Sn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Gi(qr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!pr(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+=ur(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+vr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Ki(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new zt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+ur(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Be(e)+":",Ga)},getUsername:function(){return this.username},setUsername:function(e){var t=Pt(Be(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ze(t[r],Ha)}},getPassword:function(){return this.password},setPassword:function(e){var t=Pt(Be(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ze(t[r],Ha)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ur(e):ur(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Va)},getHostname:function(){var e=this.host;return e===null?"":ur(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Za)},getPort:function(){var e=this.port;return e===null?"":Be(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Be(e),e===""?this.port=null:this.parse(e,Ja))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+vr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Et))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Be(e),e===""?this.query=null:(be(e,0)==="?"&&(e=Sr(e,1)),this.query="",this.parse(e,at)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Be(e),e===""){this.fragment=null;return}be(e,0)==="#"&&(e=Sr(e,1)),this.fragment="",this.parse(e,Fe)},update:function(){this.query=this.searchParams.serialize()||null}};var zt=function(t){var r=hS(this,oe),n=gS(arguments.length,1)>1?arguments[1]:void 0,a=yS(r,new Vo(t,!1,n));Go||(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())},oe=zt.prototype,ye=function(e,t){return{get:function(){return Cn(this)[e]()},set:t&&function(r){return Cn(this)[t](r)},configurable:!0,enumerable:!0}};Go&&(me(oe,"href",ye("serialize","setHref")),me(oe,"origin",ye("getOrigin")),me(oe,"protocol",ye("getProtocol","setProtocol")),me(oe,"username",ye("getUsername","setUsername")),me(oe,"password",ye("getPassword","setPassword")),me(oe,"host",ye("getHost","setHost")),me(oe,"hostname",ye("getHostname","setHostname")),me(oe,"port",ye("getPort","setPort")),me(oe,"pathname",ye("getPathname","setPathname")),me(oe,"search",ye("getSearch","setSearch")),me(oe,"searchParams",ye("getSearchParams")),me(oe,"hash",ye("getHash","setHash")));Rn(oe,"toJSON",function(){return Cn(this).serialize()},{enumerable:!0});Rn(oe,"toString",function(){return Cn(this).serialize()},{enumerable:!0});if(cr){var Gc=cr.createObjectURL,Kc=cr.revokeObjectURL;Gc&&Rn(zt,"createObjectURL",jc(Gc,cr)),Kc&&Rn(zt,"revokeObjectURL",jc(Kc,cr))}mS(zt,"URL");fS({global:!0,constructor:!0,forced:!dS,sham:!Go},{URL:zt});var zS=Q,HS=Ie,ed=re,GS=bt,Wc=Ve,KS=qn,Zo=HS("URL"),WS=KS&&ed(function(){Zo.canParse()}),VS=ed(function(){return Zo.canParse.length!==1});zS({target:"URL",stat:!0,forced:!WS||VS},{canParse:function(t){var r=GS(arguments.length,1),n=Wc(t),a=r<2||arguments[1]===void 0?void 0:Wc(arguments[1]);try{return!!new Zo(n,a)}catch{return!1}}});var ZS=Q,JS=Ie,YS=bt,Vc=Ve,XS=qn,qS=JS("URL");ZS({target:"URL",stat:!0,forced:!XS},{parse:function(t){var r=YS(arguments.length,1),n=Vc(t),a=r<2||arguments[1]===void 0?void 0:Vc(arguments[1]);try{return new qS(n,a)}catch{return null}}});var QS=Q,e$=ie;QS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e$(URL.prototype.toString,this)}});var t$=Bo;t$.URL;var r$={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},n$=Zn,qa=n$("span").classList,Zc=qa&&qa.constructor&&qa.constructor.prototype,a$=Zc===Object.prototype?void 0:Zc,Jc=K,td=r$,i$=a$,mr=dy,Yc=wt,o$=qt,s$=ne,Qa=s$("iterator"),ei=mr.values,rd=function(e,t){if(e){if(e[Qa]!==ei)try{Yc(e,Qa,ei)}catch{e[Qa]=ei}if(o$(e,t,!0),td[t]){for(var r in mr)if(e[r]!==mr[r])try{Yc(e,r,mr[r])}catch{e[r]=mr[r]}}}};for(var ti in td)rd(Jc[ti]&&Jc[ti].prototype,ti);rd(i$,"DOMTokenList");var c$=$e,u$=wt,l$=function(e,t){c$(t)&&"cause"in t&&u$(e,"cause",t.cause)},f$=G,nd=Error,d$=f$("".replace),h$=function(e){return String(new nd(e).stack)}("zxcasd"),ad=/\n\s*at [^:]*:[^\n]*/,v$=ad.test(h$),p$=function(e,t){if(v$&&typeof e=="string"&&!nd.prepareStackTrace)for(;t--;)e=d$(e,ad,"");return e},m$=re,g$=yt,y$=!m$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",g$(1,7)),e.stack!==7):!0}),w$=wt,b$=p$,S$=y$,Xc=Error.captureStackTrace,$$=function(e,t,r,n){S$&&(Xc?Xc(e,t):w$(e,"stack",b$(r,n)))},I$=Qt,T$=ie,P$=Ae,E$=Yn,O$=Mf,k$=bo,qc=Jn,_$=xo,R$=ea,Qc=Df,C$=TypeError,$n=function(e,t){this.stopped=e,this.result=t},eu=$n.prototype,Nr=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=I$(t,n),f,l,c,d,h,v,b,g=function(I){return f&&Qc(f,"normal",I),new $n(!0,I)},T=function(I){return a?(P$(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=R$(e),!l)throw new C$(E$(e)+" is not iterable");if(O$(l)){for(c=0,d=k$(e);d>c;c++)if(h=T(e[c]),h&&qc(eu,h))return h;return new $n(!1)}f=_$(e,l)}for(v=i?e.next:f.next;!(b=T$(v,f)).done;){try{h=T(b.value)}catch(I){Qc(f,"throw",I)}if(typeof h=="object"&&h&&qc(eu,h))return h}return new $n(!1)},A$=Ve,j$=function(e,t){return e===void 0?arguments.length<2?"":t:A$(e)},L$=Q,U$=Jn,x$=Ro,Ln=Co,N$=lf,id=Xn,ri=wt,ni=yt,D$=l$,M$=$$,F$=Nr,B$=j$,z$=ne,H$=z$("toStringTag"),Un=Error,G$=[].push,Ht=function(t,r){var n=U$(ai,this),a;Ln?a=Ln(new Un,n?x$(this):ai):(a=n?this:id(ai),ri(a,H$,"Error")),r!==void 0&&ri(a,"message",B$(r)),M$(a,Ht,a.stack,1),arguments.length>2&&D$(a,arguments[2]);var i=[];return F$(t,G$,{that:i}),ri(a,"errors",i),a};Ln?Ln(Ht,Un):N$(Ht,Un,{name:!0});var ai=Ht.prototype=id(Un.prototype,{constructor:ni(1,Ht),message:ni(1,""),name:ni(1,"AggregateError")});L$({global:!0,constructor:!0,arity:2},{AggregateError:Ht});var K$=Uo,W$=xr,V$=K$?{}.toString:function(){return"[object "+W$(this)+"]"},Z$=Uo,J$=Te,Y$=V$;Z$||J$(Object.prototype,"toString",Y$,{unsafe:!0});var lr=K,X$=jr,q$=Gn,tn=function(e){return X$.slice(0,e.length)===e},od=function(){return tn("Bun/")?"BUN":tn("Cloudflare-Workers")?"CLOUDFLARE":tn("Deno/")?"DENO":tn("Node.js/")?"NODE":lr.Bun&&typeof Bun.version=="string"?"BUN":lr.Deno&&typeof Deno.version=="object"?"DENO":q$(lr.process)==="process"?"NODE":lr.window&&lr.document?"BROWSER":"REST"}(),Q$=od,Jo=Q$==="NODE",eI=Ie,tI=Qn,rI=ne,nI=ae,tu=rI("species"),aI=function(e){var t=eI(e);nI&&t&&!t[tu]&&tI(t,tu,{configurable:!0,get:function(){return this}})},iI=Gf,oI=Yn,sI=TypeError,cI=function(e){if(iI(e))return e;throw new sI(oI(e)+" is not a constructor")},ru=Ae,uI=cI,lI=Kn,fI=ne,dI=fI("species"),sd=function(e,t){var r=ru(e).constructor,n;return r===void 0||lI(n=ru(r)[dI])?t:uI(n)},hI=Hn,cd=Function.prototype,nu=cd.apply,au=cd.call,ud=typeof Reflect=="object"&&Reflect.apply||(hI?au.bind(nu):function(){return au.apply(nu,arguments)}),vI=jr,ld=/(?:ipad|iphone|ipod).*applewebkit/i.test(vI),fe=K,pI=ud,mI=Qt,iu=J,gI=Se,fd=re,ou=Xl,yI=ta,su=Zn,wI=bt,bI=ld,SI=Jo,Vi=fe.setImmediate,Zi=fe.clearImmediate,$I=fe.process,ii=fe.Dispatch,II=fe.Function,cu=fe.MessageChannel,TI=fe.String,oi=0,$r={},uu="onreadystatechange",_r,it,si,ci;fd(function(){_r=fe.location});var Yo=function(e){if(gI($r,e)){var t=$r[e];delete $r[e],t()}},ui=function(e){return function(){Yo(e)}},lu=function(e){Yo(e.data)},fu=function(e){fe.postMessage(TI(e),_r.protocol+"//"+_r.host)};(!Vi||!Zi)&&(Vi=function(t){wI(arguments.length,1);var r=iu(t)?t:II(t),n=yI(arguments,1);return $r[++oi]=function(){pI(r,void 0,n)},it(oi),oi},Zi=function(t){delete $r[t]},SI?it=function(e){$I.nextTick(ui(e))}:ii&&ii.now?it=function(e){ii.now(ui(e))}:cu&&!bI?(si=new cu,ci=si.port2,si.port1.onmessage=lu,it=mI(ci.postMessage,ci)):fe.addEventListener&&iu(fe.postMessage)&&!fe.importScripts&&_r&&_r.protocol!=="file:"&&!fd(fu)?(it=fu,fe.addEventListener("message",lu,!1)):uu in su("script")?it=function(e){ou.appendChild(su("script"))[uu]=function(){ou.removeChild(this),Yo(e)}}:it=function(e){setTimeout(ui(e),0)});var dd={set:Vi,clear:Zi},hd=function(){this.head=null,this.tail=null};hd.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 vd=hd,PI=jr,EI=/ipad|iphone|ipod/i.test(PI)&&typeof Pebble<"u",OI=jr,kI=/web0s(?!.*chrome)/i.test(OI),Gt=K,_I=bf,du=Qt,li=dd.set,RI=vd,CI=ld,AI=EI,jI=kI,fi=Jo,hu=Gt.MutationObserver||Gt.WebKitMutationObserver,vu=Gt.document,pu=Gt.process,rn=Gt.Promise,Ji=_I("queueMicrotask"),Ot,di,hi,nn,mu;if(!Ji){var an=new RI,on=function(){var e,t;for(fi&&(e=pu.domain)&&e.exit();t=an.get();)try{t()}catch(r){throw an.head&&Ot(),r}e&&e.enter()};!CI&&!fi&&!jI&&hu&&vu?(di=!0,hi=vu.createTextNode(""),new hu(on).observe(hi,{characterData:!0}),Ot=function(){hi.data=di=!di}):!AI&&rn&&rn.resolve?(nn=rn.resolve(void 0),nn.constructor=rn,mu=du(nn.then,nn),Ot=function(){mu(on)}):fi?Ot=function(){pu.nextTick(on)}:(li=du(li,Gt),Ot=function(){li(on)}),Ji=function(e){an.head||Ot(),an.add(e)}}var LI=Ji,UI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},tr=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},xI=K,Dr=xI.Promise,NI=K,Ir=Dr,DI=J,MI=ff,FI=Oo,BI=ne,gu=od,vi=Fl;Ir&&Ir.prototype;var zI=BI("species"),Yi=!1,pd=DI(NI.PromiseRejectionEvent),HI=MI("Promise",function(){var e=FI(Ir),t=e!==String(Ir);if(!t&&vi===66)return!0;if(!vi||vi<51||!/native code/.test(e)){var r=new Ir(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[zI]=n,Yi=r.then(function(){})instanceof n,!Yi)return!0}return!t&&(gu==="BROWSER"||gu==="DENO")&&!pd}),Mr={CONSTRUCTOR:HI,REJECTION_EVENT:pd,SUBCLASSING:Yi},De={},yu=je,GI=TypeError,KI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new GI("Bad Promise constructor");t=n,r=a}),this.resolve=yu(t),this.reject=yu(r)};De.f=function(e){return new KI(e)};var WI=Q,xn=Jo,tt=K,Kt=ie,wu=Te,bu=Co,VI=qt,ZI=aI,JI=je,In=J,YI=$e,XI=Lo,qI=sd,md=dd.set,Xo=LI,QI=UI,e0=tr,t0=vd,gd=Xt,Nn=Dr,qo=Mr,yd=De,ia="Promise",wd=qo.CONSTRUCTOR,r0=qo.REJECTION_EVENT,n0=qo.SUBCLASSING,pi=gd.getterFor(ia),a0=gd.set,Rt=Nn&&Nn.prototype,st=Nn,sn=Rt,bd=tt.TypeError,Xi=tt.document,Qo=tt.process,qi=yd.f,i0=qi,o0=!!(Xi&&Xi.createEvent&&tt.dispatchEvent),Sd="unhandledrejection",s0="rejectionhandled",Su=0,$d=1,c0=2,es=1,Id=2,cn,$u,u0,Iu,Td=function(e){var t;return YI(e)&&In(t=e.then)?t:!1},Pd=function(e,t){var r=t.value,n=t.state===$d,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===Id&&f0(t),t.rejection=es),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new bd("Promise-chain cycle")):(f=Td(u))?Kt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},Ed=function(e,t){e.notified||(e.notified=!0,Xo(function(){for(var r=e.reactions,n;n=r.get();)Pd(n,e);e.notified=!1,t&&!e.rejection&&l0(e)}))},Od=function(e,t,r){var n,a;o0?(n=Xi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),tt.dispatchEvent(n)):n={promise:t,reason:r},!r0&&(a=tt["on"+e])?a(n):e===Sd&&QI("Unhandled promise rejection",r)},l0=function(e){Kt(md,tt,function(){var t=e.facade,r=e.value,n=Tu(e),a;if(n&&(a=e0(function(){xn?Qo.emit("unhandledRejection",r,t):Od(Sd,t,r)}),e.rejection=xn||Tu(e)?Id:es,a.error))throw a.value})},Tu=function(e){return e.rejection!==es&&!e.parent},f0=function(e){Kt(md,tt,function(){var t=e.facade;xn?Qo.emit("rejectionHandled",t):Od(s0,t,e.value)})},Lt=function(e,t,r){return function(n){e(t,n,r)}},Nt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=c0,Ed(e,!0))},Qi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new bd("Promise can't be resolved itself");var n=Td(t);n?Xo(function(){var a={done:!1};try{Kt(n,t,Lt(Qi,a,e),Lt(Nt,a,e))}catch(i){Nt(a,i,e)}}):(e.value=t,e.state=$d,Ed(e,!1))}catch(a){Nt({done:!1},a,e)}}};if(wd&&(st=function(t){XI(this,sn),JI(t),Kt(cn,this);var r=pi(this);try{t(Lt(Qi,r),Lt(Nt,r))}catch(n){Nt(r,n)}},sn=st.prototype,cn=function(t){a0(this,{type:ia,done:!1,notified:!1,parent:!1,reactions:new t0,rejection:!1,state:Su,value:null})},cn.prototype=wu(sn,"then",function(t,r){var n=pi(this),a=qi(qI(this,st));return n.parent=!0,a.ok=In(t)?t:!0,a.fail=In(r)&&r,a.domain=xn?Qo.domain:void 0,n.state===Su?n.reactions.add(a):Xo(function(){Pd(a,n)}),a.promise}),$u=function(){var e=new cn,t=pi(e);this.promise=e,this.resolve=Lt(Qi,t),this.reject=Lt(Nt,t)},yd.f=qi=function(e){return e===st||e===u0?new $u(e):i0(e)},In(Nn)&&Rt!==Object.prototype)){Iu=Rt.then,n0||wu(Rt,"then",function(t,r){var n=this;return new st(function(a,i){Kt(Iu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Rt.constructor}catch{}bu&&bu(Rt,sn)}WI({global:!0,constructor:!0,wrap:!0,forced:wd},{Promise:st});VI(st,ia,!1);ZI(ia);var d0=ne,kd=d0("iterator"),_d=!1;try{var h0=0,Pu={next:function(){return{done:!!h0++}},return:function(){_d=!0}};Pu[kd]=function(){return this},Array.from(Pu,function(){throw 2})}catch{}var v0=function(e,t){try{if(!t&&!_d)return!1}catch{return!1}var r=!1;try{var n={};n[kd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},p0=Dr,m0=v0,g0=Mr.CONSTRUCTOR,oa=g0||!m0(function(e){p0.all(e).then(void 0,function(){})}),y0=Q,w0=ie,b0=je,S0=De,$0=tr,I0=Nr,T0=oa;y0({target:"Promise",stat:!0,forced:T0},{all:function(t){var r=this,n=S0.f(r),a=n.resolve,i=n.reject,o=$0(function(){var s=b0(r.resolve),u=[],f=0,l=1;I0(t,function(c){var d=f++,h=!1;l++,w0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var P0=Q,E0=Mr.CONSTRUCTOR,eo=Dr,O0=Ie,k0=J,_0=Te,Eu=eo&&eo.prototype;P0({target:"Promise",proto:!0,forced:E0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(k0(eo)){var Ou=O0("Promise").prototype.catch;Eu.catch!==Ou&&_0(Eu,"catch",Ou,{unsafe:!0})}var R0=Q,C0=ie,A0=je,j0=De,L0=tr,U0=Nr,x0=oa;R0({target:"Promise",stat:!0,forced:x0},{race:function(t){var r=this,n=j0.f(r),a=n.reject,i=L0(function(){var o=A0(r.resolve);U0(t,function(s){C0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var N0=Q,D0=De,M0=Mr.CONSTRUCTOR;N0({target:"Promise",stat:!0,forced:M0},{reject:function(t){var r=D0.f(this),n=r.reject;return n(t),r.promise}});var F0=Ae,B0=$e,z0=De,Rd=function(e,t){if(F0(e),B0(t)&&t.constructor===e)return t;var r=z0.f(e),n=r.resolve;return n(t),r.promise},H0=Q,G0=Ie,K0=Mr.CONSTRUCTOR,W0=Rd;G0("Promise");H0({target:"Promise",stat:!0,forced:K0},{resolve:function(t){return W0(this,t)}});var V0=Q,Z0=ie,J0=je,Y0=De,X0=tr,q0=Nr,Q0=oa;V0({target:"Promise",stat:!0,forced:Q0},{allSettled:function(t){var r=this,n=Y0.f(r),a=n.resolve,i=n.reject,o=X0(function(){var s=J0(r.resolve),u=[],f=0,l=1;q0(t,function(c){var d=f++,h=!1;l++,Z0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var eT=Q,tT=ie,rT=je,nT=Ie,aT=De,iT=tr,oT=Nr,sT=oa,ku="No one promise resolved";eT({target:"Promise",stat:!0,forced:sT},{any:function(t){var r=this,n=nT("AggregateError"),a=aT.f(r),i=a.resolve,o=a.reject,s=iT(function(){var u=rT(r.resolve),f=[],l=0,c=1,d=!1;oT(t,function(h){var v=l++,b=!1;c++,tT(u,r,h).then(function(g){b||d||(d=!0,i(g))},function(g){b||d||(b=!0,f[v]=g,--c||o(new n(f,ku)))})}),--c||o(new n(f,ku))});return s.error&&o(s.value),a.promise}});var cT=Q,uT=De;cT({target:"Promise",stat:!0},{withResolvers:function(){var t=uT.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var lT=Q,Dn=Dr,fT=re,Cd=Ie,Ad=J,dT=sd,_u=Rd,hT=Te,to=Dn&&Dn.prototype,vT=!!Dn&&fT(function(){to.finally.call({then:function(){}},function(){})});lT({target:"Promise",proto:!0,real:!0,forced:vT},{finally:function(e){var t=dT(this,Cd("Promise")),r=Ad(e);return this.then(r?function(n){return _u(t,e()).then(function(){return n})}:e,r?function(n){return _u(t,e()).then(function(){throw n})}:e)}});if(Ad(Dn)){var Ru=Cd("Promise").prototype.finally;to.finally!==Ru&&hT(to,"finally",Ru,{unsafe:!0})}var pT=Bo;pT.Promise;var mT=Q,gT=K,yT=ud,wT=ta,bT=De,ST=je,jd=tr,mi=gT.Promise,Cu=!1,$T=!mi||!mi.try||jd(function(){mi.try(function(e){Cu=e===8},8)}).error||!Cu;mT({target:"Promise",stat:!0,forced:$T},{try:function(e){var t=arguments.length>1?wT(arguments,1):[],r=bT.f(this),n=jd(function(){return yT(ST(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const Ld="sesamy-debug";function IT(e,t,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${t}; ${a}; path=/`}function TT(e){if(typeof document>"u")return null;const t=e+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null}function PT(e){IT(Ld,e.toString(),1)}function ET(){return TT(Ld)==="true"}function he(e){ET()&&console.log(e)}function We(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});he(`Triggering event: ${e}`),dispatchEvent(r)}function xe(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 ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ts(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function rs(e,t){return e(t={exports:{}},t.exports),t.exports}var ot=rs(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()}});ts(ot);var OT=ts(rs(function(e,t){var r=ct&&ct.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{I(h.next(y))}catch(p){b(p)}}function T(y){try{I(h.throw(y))}catch(p){b(p)}}function I(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=ct&&ct.__generator||function(l,c){var d,h,v,b,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return b={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function T(I){return function(y){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch(S){p=[6,S],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,y])}}},a=ct;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="",h=0;h<l;h++)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 h,v,b,g,T,I,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,b=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(b)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(b,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(b))!==null&&(y=JSON.parse(I)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=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 h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var b,g,T;return n(this,function(I){switch(I.label){case 0:return[4,ot.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?o:this.storageHandler,(g=b.getItemSync(c))===null?(ot.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(T)),ot.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(ot.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(h){var v=!1,b=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=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,h,v,b;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,ot.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),ot.default().unlock(b.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],b=0;;){var g=h.keySync(b);if(g===null)break;v.push(g),b++}for(var T=!1,I=0;I<v.length;I++){var y=v[I];if(y.includes(i)){var p=h.getItemSync(y);if(p!==null){var S=JSON.parse(p);(S.timeRefreshed===void 0&&S.timeAcquired<d||S.timeRefreshed!==void 0&&S.timeRefreshed<d)&&(h.removeItemSync(y),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const kT={timeoutInSeconds:60},Ud={name:"auth0-spa-js",version:"2.1.3"},xd=()=>Date.now();let le=class ro extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ro.prototype)}static fromPayload({error:t,error_description:r}){return new ro(t,r)}},_T=class Nd extends le{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Nd.prototype)}},no=class Dd extends le{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Dd.prototype)}},RT=class Md extends no{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Md.prototype)}},CT=class Fd extends le{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Fd.prototype)}},AT=class Bd extends le{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Bd.prototype)}},zd=class Hd extends le{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Au(t,["default"])}', scope: '${Au(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Hd.prototype)}};function Au(e,t=[]){return e&&!t.includes(e)?e:""}const Tn=()=>window.crypto,gi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Tn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},ju=e=>btoa(e),ao=e=>{var{clientId:t}=e,r=xe(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()},Lu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),jT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},LT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([jT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},UT=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},xT=async(e,t,r,n,a,i,o=1e4)=>a?UT(e,t,r,n,o,a,i):LT(e,n,o);async function NT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=xe(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?ao(u):JSON.stringify(u);return await async function(l,c,d,h,v,b,g){let T,I=null;for(let k=0;k<3;k++)try{T=await xT(l,d,h,v,b,g,c),I=null;break}catch(M){I=M}if(I)throw I;const y=T.json,{error:p,error_description:S}=y,O=xe(y,["error","error_description"]),{ok:_}=T;if(!_){const k=S||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new AT(p,k,O.mfa_token):p==="missing_refresh_token"?new zd(d,h):new le(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||Ud))}},t,s)}const un=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let lt=class io{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 io({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new io({scope:r,audience:n,clientId:a})}},DT=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@@"))}},Gd=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)}}()}},MT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||xd}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 lt({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 lt({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=lt.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]}},FT=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 fr=e=>typeof e=="number",BT=["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"],zT=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(Lu(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],BT.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Lu(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&&!fr(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||!fr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!fr(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&&fr(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&&fr(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 ft=rs(function(e,t){var r=ct&&ct.__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 h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.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}))}});ts(ft),ft.encode,ft.parse,ft.getAll;var HT=ft.get,Kd=ft.set,Wd=ft.remove;const Ct={get(e){const t=HT(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),Kd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Wd(e,r)}},GT={get(e){return Ct.get(e)||Ct.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),Kd(`_legacy_${e}`,JSON.stringify(t),n),Ct.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Wd(e,r),Ct.remove(e,t),Ct.remove(`_legacy_${e}`,t)}},KT={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 WT(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,h=l.length;d<h;++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
|
|
1
|
+
"use strict";var Mh=Object.defineProperty;var Fh=(e,t,r)=>t in e?Mh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var me=(e,t,r)=>Fh(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},re=function(e){try{return!!e()}catch{return!0}},Bh=re,Wn=!Bh(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Nl=Wn,xl=Function.prototype,Ri=xl.call,zh=Nl&&xl.bind.bind(Ri,Ri),K=Nl?zh:function(e){return function(){return Ri.apply(e,arguments)}},Dl=K,Hh=Dl({}.toString),Kh=Dl("".slice),Vn=function(e){return Kh(Hh(e),8,-1)},Gh=K,Wh=re,Vh=Vn,pa=Object,Zh=Gh("".split),Ml=Wh(function(){return!pa("z").propertyIsEnumerable(0)})?function(e){return Vh(e)==="String"?Zh(e,""):pa(e)}:pa,Zn=function(e){return e==null},Jh=Zn,Yh=TypeError,Jn=function(e){if(Jh(e))throw new Yh("Can't call method on "+e);return e},Xh=Ml,qh=Jn,Ur=function(e){return Xh(qh(e))},sr=function(e){return e&&e.Math===Math&&e},G=sr(typeof globalThis=="object"&&globalThis)||sr(typeof window=="object"&&window)||sr(typeof self=="object"&&self)||sr(typeof Gr=="object"&&Gr)||sr(typeof Gr=="object"&&Gr)||function(){return this}()||Function("return this")(),Fl={exports:{}},Qh=!1,ys=G,ev=Object.defineProperty,wo=function(e,t){try{ev(ys,e,{value:t,configurable:!0,writable:!0})}catch{ys[e]=t}return t},tv=G,rv=wo,ws="__core-js_shared__",bs=Fl.exports=tv[ws]||rv(ws,{});(bs.versions||(bs.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 bo=Fl.exports,Ss=bo,Bl=function(e,t){return Ss[e]||(Ss[e]=t||{})},nv=Jn,av=Object,Yn=function(e){return av(nv(e))},iv=K,ov=Yn,sv=iv({}.hasOwnProperty),$e=Object.hasOwn||function(t,r){return sv(ov(t),r)},cv=K,uv=0,lv=Math.random(),fv=cv(1 .toString),zl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+fv(++uv+lv,36)},dv=G,$s=dv.navigator,Is=$s&&$s.userAgent,Nr=Is?String(Is):"",Hl=G,ma=Nr,Ts=Hl.process,Ps=Hl.Deno,Es=Ts&&Ts.versions||Ps&&Ps.version,Os=Es&&Es.v8,Re,_n;Os&&(Re=Os.split("."),_n=Re[0]>0&&Re[0]<4?1:+(Re[0]+Re[1]));!_n&&ma&&(Re=ma.match(/Edge\/(\d+)/),(!Re||Re[1]>=74)&&(Re=ma.match(/Chrome\/(\d+)/),Re&&(_n=+Re[1])));var Kl=_n,ks=Kl,hv=re,vv=G,pv=vv.String,Gl=!!Object.getOwnPropertySymbols&&!hv(function(){var e=Symbol("symbol detection");return!pv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ks&&ks<41}),mv=Gl,Wl=mv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",gv=G,yv=Bl,_s=$e,wv=zl,bv=Gl,Sv=Wl,Lt=gv.Symbol,ga=yv("wks"),$v=Sv?Lt.for||Lt:Lt&&Lt.withoutSetter||wv,ne=function(e){return _s(ga,e)||(ga[e]=bv&&_s(Lt,e)?Lt[e]:$v("Symbol."+e)),ga[e]},ya=typeof document=="object"&&document.all,Y=typeof ya>"u"&&ya!==void 0?function(e){return typeof e=="function"||e===ya}:function(e){return typeof e=="function"},Iv=Y,Ie=function(e){return typeof e=="object"?e!==null:Iv(e)},Tv=Ie,Pv=String,Ev=TypeError,je=function(e){if(Tv(e))return e;throw new Ev(Pv(e)+" is not an object")},Vl={},Ov=re,ae=!Ov(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),kv=ae,_v=re,Zl=kv&&_v(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),De={},Rv=G,Rs=Ie,Ci=Rv.document,Cv=Rs(Ci)&&Rs(Ci.createElement),Xn=function(e){return Cv?Ci.createElement(e):{}},Av=ae,jv=re,Lv=Xn,Jl=!Av&&!jv(function(){return Object.defineProperty(Lv("div"),"a",{get:function(){return 7}}).a!==7}),Uv=Wn,Wr=Function.prototype.call,ie=Uv?Wr.bind(Wr):function(){return Wr.apply(Wr,arguments)},wa=G,Nv=Y,xv=function(e){return Nv(e)?e:void 0},Te=function(e,t){return arguments.length<2?xv(wa[e]):wa[e]&&wa[e][t]},Dv=K,qn=Dv({}.isPrototypeOf),Mv=Te,Fv=Y,Bv=qn,zv=Wl,Hv=Object,Yl=zv?function(e){return typeof e=="symbol"}:function(e){var t=Mv("Symbol");return Fv(t)&&Bv(t.prototype,Hv(e))},Kv=String,Qn=function(e){try{return Kv(e)}catch{return"Object"}},Gv=Y,Wv=Qn,Vv=TypeError,Le=function(e){if(Gv(e))return e;throw new Vv(Wv(e)+" is not a function")},Zv=Le,Jv=Zn,So=function(e,t){var r=e[t];return Jv(r)?void 0:Zv(r)},ba=ie,Sa=Y,$a=Ie,Yv=TypeError,Xv=function(e,t){var r,n;if(t==="string"&&Sa(r=e.toString)&&!$a(n=ba(r,e))||Sa(r=e.valueOf)&&!$a(n=ba(r,e))||t!=="string"&&Sa(r=e.toString)&&!$a(n=ba(r,e)))return n;throw new Yv("Can't convert object to primitive value")},qv=ie,Cs=Ie,As=Yl,Qv=So,ep=Xv,tp=ne,rp=TypeError,np=tp("toPrimitive"),ap=function(e,t){if(!Cs(e)||As(e))return e;var r=Qv(e,np),n;if(r){if(t===void 0&&(t="default"),n=qv(r,e,t),!Cs(n)||As(n))return n;throw new rp("Can't convert object to primitive value")}return t===void 0&&(t="number"),ep(e,t)},ip=ap,op=Yl,Xl=function(e){var t=ip(e,"string");return op(t)?t:t+""},sp=ae,cp=Jl,up=Zl,Vr=je,js=Xl,lp=TypeError,Ia=Object.defineProperty,fp=Object.getOwnPropertyDescriptor,Ta="enumerable",Pa="configurable",Ea="writable";De.f=sp?up?function(t,r,n){if(Vr(t),r=js(r),Vr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Ea in n&&!n[Ea]){var a=fp(t,r);a&&a[Ea]&&(t[r]=n.value,n={configurable:Pa in n?n[Pa]:a[Pa],enumerable:Ta in n?n[Ta]:a[Ta],writable:!1})}return Ia(t,r,n)}:Ia:function(t,r,n){if(Vr(t),r=js(r),Vr(n),cp)try{return Ia(t,r,n)}catch{}if("get"in n||"set"in n)throw new lp("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var dp=Math.ceil,hp=Math.floor,vp=Math.trunc||function(t){var r=+t;return(r>0?hp:dp)(r)},pp=vp,$o=function(e){var t=+e;return t!==t||t===0?0:pp(t)},mp=$o,gp=Math.max,yp=Math.min,ql=function(e,t){var r=mp(e);return r<0?gp(r+t,0):yp(r,t)},wp=$o,bp=Math.min,Sp=function(e){var t=wp(e);return t>0?bp(t,9007199254740991):0},$p=Sp,Io=function(e){return $p(e.length)},Ip=Ur,Tp=ql,Pp=Io,Ls=function(e){return function(t,r,n){var a=Ip(t),i=Pp(a);if(i===0)return!e&&-1;var o=Tp(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}},Ep={includes:Ls(!0),indexOf:Ls(!1)},To={},Op=K,Oa=$e,kp=Ur,_p=Ep.indexOf,Rp=To,Us=Op([].push),Ql=function(e,t){var r=kp(e),n=0,a=[],i;for(i in r)!Oa(Rp,i)&&Oa(r,i)&&Us(a,i);for(;t.length>n;)Oa(r,i=t[n++])&&(~_p(a,i)||Us(a,i));return a},Po=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Cp=Ql,Ap=Po,ef=Object.keys||function(t){return Cp(t,Ap)},jp=ae,Lp=Zl,Up=De,Np=je,xp=Ur,Dp=ef;Vl.f=jp&&!Lp?Object.defineProperties:function(t,r){Np(t);for(var n=xp(r),a=Dp(r),i=a.length,o=0,s;i>o;)Up.f(t,s=a[o++],n[s]);return t};var Mp=Te,tf=Mp("document","documentElement"),Fp=Bl,Bp=zl,Ns=Fp("keys"),Eo=function(e){return Ns[e]||(Ns[e]=Bp(e))},zp=je,Hp=Vl,xs=Po,Kp=To,Gp=tf,Wp=Xn,Vp=Eo,Ds=">",Ms="<",Ai="prototype",ji="script",rf=Vp("IE_PROTO"),ka=function(){},nf=function(e){return Ms+ji+Ds+e+Ms+"/"+ji+Ds},Fs=function(e){e.write(nf("")),e.close();var t=e.parentWindow.Object;return e=null,t},Zp=function(){var e=Wp("iframe"),t="java"+ji+":",r;return e.style.display="none",Gp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(nf("document.F=Object")),r.close(),r.F},Zr,bn=function(){try{Zr=new ActiveXObject("htmlfile")}catch{}bn=typeof document<"u"?document.domain&&Zr?Fs(Zr):Zp():Fs(Zr);for(var e=xs.length;e--;)delete bn[Ai][xs[e]];return bn()};Kp[rf]=!0;var ea=Object.create||function(t,r){var n;return t!==null?(ka[Ai]=zp(t),n=new ka,ka[Ai]=null,n[rf]=t):n=bn(),r===void 0?n:Hp.f(n,r)},Jp=ne,Yp=ea,Xp=De.f,Li=Jp("unscopables"),Ui=Array.prototype;Ui[Li]===void 0&&Xp(Ui,Li,{configurable:!0,value:Yp(null)});var qp=function(e){Ui[Li][e]=!0},xr={},Qp=G,em=Y,Bs=Qp.WeakMap,tm=em(Bs)&&/native code/.test(String(Bs)),wt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},rm=ae,nm=De,am=wt,bt=rm?function(e,t,r){return nm.f(e,t,am(1,r))}:function(e,t,r){return e[t]=r,e},im=tm,af=G,om=Ie,sm=bt,_a=$e,Ra=bo,cm=Eo,um=To,zs="Object already initialized",Ni=af.TypeError,lm=af.WeakMap,Rn,Cr,Cn,fm=function(e){return Cn(e)?Cr(e):Rn(e,{})},dm=function(e){return function(t){var r;if(!om(t)||(r=Cr(t)).type!==e)throw new Ni("Incompatible receiver, "+e+" required");return r}};if(im||Ra.state){var Ue=Ra.state||(Ra.state=new lm);Ue.get=Ue.get,Ue.has=Ue.has,Ue.set=Ue.set,Rn=function(e,t){if(Ue.has(e))throw new Ni(zs);return t.facade=e,Ue.set(e,t),t},Cr=function(e){return Ue.get(e)||{}},Cn=function(e){return Ue.has(e)}}else{var Tt=cm("state");um[Tt]=!0,Rn=function(e,t){if(_a(e,Tt))throw new Ni(zs);return t.facade=e,sm(e,Tt,t),t},Cr=function(e){return _a(e,Tt)?e[Tt]:{}},Cn=function(e){return _a(e,Tt)}}var Qt={set:Rn,get:Cr,has:Cn,enforce:fm,getterFor:dm},Oo={},ko={},of={}.propertyIsEnumerable,sf=Object.getOwnPropertyDescriptor,hm=sf&&!of.call({1:2},1);ko.f=hm?function(t){var r=sf(this,t);return!!r&&r.enumerable}:of;var vm=ae,pm=ie,mm=ko,gm=wt,ym=Ur,wm=Xl,bm=$e,Sm=Jl,Hs=Object.getOwnPropertyDescriptor;Oo.f=vm?Hs:function(t,r){if(t=ym(t),r=wm(r),Sm)try{return Hs(t,r)}catch{}if(bm(t,r))return gm(!pm(mm.f,t,r),t[r])};var cf={exports:{}},xi=ae,$m=$e,uf=Function.prototype,Im=xi&&Object.getOwnPropertyDescriptor,_o=$m(uf,"name"),Tm=_o&&(function(){}).name==="something",Pm=_o&&(!xi||xi&&Im(uf,"name").configurable),lf={EXISTS:_o,PROPER:Tm,CONFIGURABLE:Pm},Em=K,Om=Y,Di=bo,km=Em(Function.toString);Om(Di.inspectSource)||(Di.inspectSource=function(e){return km(e)});var Ro=Di.inspectSource,Co=K,_m=re,Rm=Y,Jr=$e,Mi=ae,Cm=lf.CONFIGURABLE,Am=Ro,ff=Qt,jm=ff.enforce,Lm=ff.get,Ks=String,Sn=Object.defineProperty,Um=Co("".slice),Nm=Co("".replace),xm=Co([].join),Dm=Mi&&!_m(function(){return Sn(function(){},"length",{value:8}).length!==8}),Mm=String(String).split("String"),Fm=cf.exports=function(e,t,r){Um(Ks(t),0,7)==="Symbol("&&(t="["+Nm(Ks(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Jr(e,"name")||Cm&&e.name!==t)&&(Mi?Sn(e,"name",{value:t,configurable:!0}):e.name=t),Dm&&r&&Jr(r,"arity")&&e.length!==r.arity&&Sn(e,"length",{value:r.arity});try{r&&Jr(r,"constructor")&&r.constructor?Mi&&Sn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=jm(e);return Jr(n,"source")||(n.source=xm(Mm,typeof t=="string"?t:"")),e};Function.prototype.toString=Fm(function(){return Rm(this)&&Lm(this).source||Am(this)},"toString");var df=cf.exports,Bm=Y,zm=De,Hm=df,Km=wo,Pe=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(Bm(r)&&Hm(r,i,n),n.global)a?e[t]=r:Km(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:zm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},hf={},Gm=Ql,Wm=Po,Vm=Wm.concat("length","prototype");hf.f=Object.getOwnPropertyNames||function(t){return Gm(t,Vm)};var Ao={};Ao.f=Object.getOwnPropertySymbols;var Zm=Te,Jm=K,Ym=hf,Xm=Ao,qm=je,Qm=Jm([].concat),eg=Zm("Reflect","ownKeys")||function(t){var r=Ym.f(qm(t)),n=Xm.f;return n?Qm(r,n(t)):r},Gs=$e,tg=eg,rg=Oo,ng=De,vf=function(e,t,r){for(var n=tg(t),a=ng.f,i=rg.f,o=0;o<n.length;o++){var s=n[o];!Gs(e,s)&&!(r&&Gs(r,s))&&a(e,s,i(t,s))}},ag=re,ig=Y,og=/#|\.prototype\./,Dr=function(e,t){var r=cg[sg(e)];return r===lg?!0:r===ug?!1:ig(t)?ag(t):!!t},sg=Dr.normalize=function(e){return String(e).replace(og,".").toLowerCase()},cg=Dr.data={},ug=Dr.NATIVE="N",lg=Dr.POLYFILL="P",pf=Dr,Yr=G,fg=Oo.f,dg=bt,hg=Pe,vg=wo,pg=vf,mg=pf,Q=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Yr:a?o=Yr[r]||vg(r,{}):o=Yr[r]&&Yr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=fg(o,s),u=l&&l.value):u=o[s],i=mg(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;pg(f,u)}(e.sham||u&&u.sham)&&dg(f,"sham",!0),hg(o,s,f,e)}},gg=re,yg=!gg(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),wg=$e,bg=Y,Sg=Yn,$g=Eo,Ig=yg,Ws=$g("IE_PROTO"),Fi=Object,Tg=Fi.prototype,jo=Ig?Fi.getPrototypeOf:function(e){var t=Sg(e);if(wg(t,Ws))return t[Ws];var r=t.constructor;return bg(r)&&t instanceof r?r.prototype:t instanceof Fi?Tg:null},Pg=re,Eg=Y,Og=Ie,Vs=jo,kg=Pe,_g=ne,Bi=_g("iterator"),mf=!1,pt,Ca,Aa;[].keys&&(Aa=[].keys(),"next"in Aa?(Ca=Vs(Vs(Aa)),Ca!==Object.prototype&&(pt=Ca)):mf=!0);var Rg=!Og(pt)||Pg(function(){var e={};return pt[Bi].call(e)!==e});Rg&&(pt={});Eg(pt[Bi])||kg(pt,Bi,function(){return this});var gf={IteratorPrototype:pt,BUGGY_SAFARI_ITERATORS:mf},Cg=De.f,Ag=$e,jg=ne,Zs=jg("toStringTag"),er=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Ag(e,Zs)&&Cg(e,Zs,{configurable:!0,value:t})},Lg=gf.IteratorPrototype,Ug=ea,Ng=wt,xg=er,Dg=xr,Mg=function(){return this},yf=function(e,t,r,n){var a=t+" Iterator";return e.prototype=Ug(Lg,{next:Ng(+!n,r)}),xg(e,a,!1),Dg[a]=Mg,e},Fg=K,Bg=Le,zg=function(e,t,r){try{return Fg(Bg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Hg=Ie,Kg=function(e){return Hg(e)||e===null},Gg=Kg,Wg=String,Vg=TypeError,Zg=function(e){if(Gg(e))return e;throw new Vg("Can't set "+Wg(e)+" as a prototype")},Jg=zg,Yg=Ie,Xg=Jn,qg=Zg,Lo=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Jg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Xg(a),qg(i),Yg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Qg=Q,ey=ie,wf=lf,ty=Y,ry=yf,Js=jo,Ys=Lo,ny=er,ay=bt,ja=Pe,iy=ne,oy=xr,bf=gf,sy=wf.PROPER,cy=wf.CONFIGURABLE,Xs=bf.IteratorPrototype,Xr=bf.BUGGY_SAFARI_ITERATORS,cr=iy("iterator"),qs="keys",ur="values",Qs="entries",uy=function(){return this},Sf=function(e,t,r,n,a,i,o){ry(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Xr&&T&&T in l)return l[T];switch(T){case qs:return function(){return new r(this,T)};case ur:return function(){return new r(this,T)};case Qs:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[cr]||l["@@iterator"]||a&&l[a],d=!Xr&&c||s(a),h=t==="Array"&&l.entries||c,v,b,g;if(h&&(v=Js(h.call(new e)),v!==Object.prototype&&v.next&&(Js(v)!==Xs&&(Ys?Ys(v,Xs):ty(v[cr])||ja(v,cr,uy)),ny(v,u,!0))),sy&&a===ur&&c&&c.name!==ur&&(cy?ay(l,"name",ur):(f=!0,d=function(){return ey(c,this)})),a)if(b={values:s(ur),keys:i?d:s(qs),entries:s(Qs)},o)for(g in b)(Xr||f||!(g in l))&&ja(l,g,b[g]);else Qg({target:t,proto:!0,forced:Xr||f},b);return l[cr]!==d&&ja(l,cr,d,{name:a}),oy[t]=d,b},Uo=function(e,t){return{value:e,done:t}},ly=Ur,No=qp,ec=xr,$f=Qt,fy=De.f,dy=Sf,qr=Uo,hy=ae,If="Array Iterator",vy=$f.set,py=$f.getterFor(If),my=dy(Array,"Array",function(e,t){vy(this,{type:If,target:ly(e),index:0,kind:t})},function(){var e=py(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,qr(void 0,!0);switch(e.kind){case"keys":return qr(r,!1);case"values":return qr(t[r],!1)}return qr([r,t[r]],!1)},"values"),tc=ec.Arguments=ec.Array;No("keys");No("values");No("entries");if(hy&&tc.name!=="values")try{fy(tc,"name",{value:"values"})}catch{}var gy=Q,yy=K,wy=ql,by=RangeError,rc=String.fromCharCode,nc=String.fromCodePoint,Sy=yy([].join),$y=!!nc&&nc.length!==1;gy({target:"String",stat:!0,arity:1,forced:$y},{fromCodePoint:function(t){for(var r=[],n=arguments.length,a=0,i;n>a;){if(i=+arguments[a++],wy(i,1114111)!==i)throw new by(i+" is not a valid code point");r[a]=i<65536?rc(i):rc(((i-=65536)>>10)+55296,i%1024+56320)}return Sy(r,"")}});var ac=G,Iy=ae,Ty=Object.getOwnPropertyDescriptor,Tf=function(e){if(!Iy)return ac[e];var t=Ty(ac,e);return t&&t.value},Py=re,Ey=ne,Oy=ae,ic=Qh,ky=Ey("iterator"),ta=!Py(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),ic&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(ic||!Oy)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[ky]||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"}),oc=df,_y=De,ra=function(e,t,r){return r.get&&oc(r.get,t,{getter:!0}),r.set&&oc(r.set,t,{setter:!0}),_y.f(e,t,r)},Ry=Pe,Cy=function(e,t,r){for(var n in t)Ry(e,n,t[n],r);return e},Ay=qn,jy=TypeError,xo=function(e,t){if(Ay(t,e))return e;throw new jy("Incorrect invocation")},Ly=Vn,Uy=K,Ny=function(e){if(Ly(e)==="Function")return Uy(e)},sc=Ny,xy=Le,Dy=Wn,My=sc(sc.bind),tr=function(e,t){return xy(e),t===void 0?e:Dy?My(e,t):function(){return e.apply(t,arguments)}},Fy=ne,By=Fy("toStringTag"),Pf={};Pf[By]="z";var Do=String(Pf)==="[object z]",zy=Do,Hy=Y,$n=Vn,Ky=ne,Gy=Ky("toStringTag"),Wy=Object,Vy=$n(function(){return arguments}())==="Arguments",Zy=function(e,t){try{return e[t]}catch{}},Mr=zy?$n:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Zy(t=Wy(e),Gy))=="string"?r:Vy?$n(t):(n=$n(t))==="Object"&&Hy(t.callee)?"Arguments":n},Jy=Mr,Yy=String,Ze=function(e){if(Jy(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Yy(e)},Xy=Mr,cc=So,qy=Zn,Qy=xr,ew=ne,tw=ew("iterator"),na=function(e){if(!qy(e))return cc(e,tw)||cc(e,"@@iterator")||Qy[Xy(e)]},rw=ie,nw=Le,aw=je,iw=Qn,ow=na,sw=TypeError,Mo=function(e,t){var r=arguments.length<2?ow(e):t;if(nw(r))return aw(rw(r,e));throw new sw(iw(e)+" is not iterable")},cw=TypeError,St=function(e,t){if(e<t)throw new cw("Not enough arguments");return e},uw=K,aa=uw([].slice),uc=aa,lw=Math.floor,zi=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=lw(r/2),s=zi(uc(e,0,o),t),u=zi(uc(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},fw=zi,Hi=Q,Ef=G,Fo=Tf,dw=Te,Qr=ie,Ae=K,Sr=ae,Of=ta,kf=Pe,hw=ra,vw=Cy,pw=er,mw=yf,Bo=Qt,_f=xo,La=Y,gw=$e,yw=tr,ww=Mr,bw=je,Rf=Ie,se=Ze,Sw=ea,lc=wt,fc=Mo,$w=na,en=Uo,Pt=St,Iw=ne,Tw=fw,Pw=Iw("iterator"),rr="URLSearchParams",Cf=rr+"Iterator",Af=Bo.set,be=Bo.getterFor(rr),Ew=Bo.getterFor(Cf),dc=Fo("fetch"),An=Fo("Request"),$r=Fo("Headers"),Ua=An&&An.prototype,hc=$r&&$r.prototype,Ow=Ef.TypeError,kw=Ef.encodeURIComponent,_w=String.fromCharCode,Rw=dw("String","fromCodePoint"),Cw=parseInt,In=Ae("".charAt),vc=Ae([].join),Qe=Ae([].push),jf=Ae("".replace),Aw=Ae([].shift),pc=Ae([].splice),mc=Ae("".split),Lf=Ae("".slice),jw=Ae(/./.exec),Lw=/\+/g,Na="�",Uw=/^[0-9a-f]+$/i,gc=function(e,t){var r=Lf(e,t,t+2);return jw(Uw,r)?Cw(r,16):NaN},Nw=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},xw=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},yc=function(e){e=jf(e,Lw," ");for(var t=e.length,r="",n=0;n<t;){var a=In(e,n);if(a==="%"){if(In(e,n+1)==="%"||n+3>t){r+="%",n++;continue}var i=gc(e,n+1);if(i!==i){r+=a,n++;continue}n+=2;var o=Nw(i);if(o===0)a=_w(i);else{if(o===1||o>4){r+=Na,n++;continue}for(var s=[i],u=1;u<o&&(n++,!(n+3>t||In(e,n)!=="%"));){var f=gc(e,n+1);if(f!==f){n+=3;break}if(f>191||f<128)break;Qe(s,f),n+=2,u++}if(s.length!==o){r+=Na;continue}var l=xw(s);l===null?r+=Na:a=Rw(l)}}r+=a,n++}return r},Dw=/[!'()~]|%20/g,Mw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Fw=function(e){return Mw[e]},wc=function(e){return jf(kw(e),Dw,Fw)},xa=mw(function(t,r){Af(this,{type:Cf,target:be(t).entries,index:0,kind:r})},rr,function(){var t=Ew(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=null,en(void 0,!0);var a=r[n];switch(t.kind){case"keys":return en(a.key,!1);case"values":return en(a.value,!1)}return en([a.key,a.value],!1)},!0),Uf=function(e){this.entries=[],this.url=null,e!==void 0&&(Rf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?In(e,0)==="?"?Lf(e,1):e:se(e)))};Uf.prototype={type:rr,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=$w(e),n,a,i,o,s,u,f;if(r)for(n=fc(e,r),a=n.next;!(i=Qr(a,n)).done;){if(o=fc(bw(i.value)),s=o.next,(u=Qr(s,o)).done||(f=Qr(s,o)).done||!Qr(s,o).done)throw new Ow("Expected sequence with length 2");Qe(t,{key:se(u.value),value:se(f.value)})}else for(var l in e)gw(e,l)&&Qe(t,{key:l,value:se(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=mc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=mc(a,"="),Qe(t,{key:yc(Aw(i)),value:yc(vc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Qe(t,wc(n.key)+"="+wc(n.value));return vc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ia=function(){_f(this,Ht);var t=arguments.length>0?arguments[0]:void 0,r=Af(this,new Uf(t));Sr||(this.size=r.entries.length)},Ht=ia.prototype;vw(Ht,{append:function(t,r){var n=be(this);Pt(arguments.length,2),Qe(n.entries,{key:se(t),value:se(r)}),Sr||this.length++,n.updateURL()},delete:function(e){for(var t=be(this),r=Pt(arguments.length,1),n=t.entries,a=se(e),i=r<2?void 0:arguments[1],o=i===void 0?i:se(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(pc(n,s,1),o!==void 0)break}else s++}Sr||(this.size=n.length),t.updateURL()},get:function(t){var r=be(this).entries;Pt(arguments.length,1);for(var n=se(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=be(this).entries;Pt(arguments.length,1);for(var n=se(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Qe(a,r[i].value);return a},has:function(t){for(var r=be(this).entries,n=Pt(arguments.length,1),a=se(t),i=n<2?void 0:arguments[1],o=i===void 0?i:se(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=be(this);Pt(arguments.length,1);for(var a=n.entries,i=!1,o=se(t),s=se(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?pc(a,u--,1):(i=!0,f.value=s));i||Qe(a,{key:o,value:s}),Sr||(this.size=a.length),n.updateURL()},sort:function(){var t=be(this);Tw(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=be(this).entries,n=yw(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 xa(this,"keys")},values:function(){return new xa(this,"values")},entries:function(){return new xa(this,"entries")}},{enumerable:!0});kf(Ht,Pw,Ht.entries,{name:"entries"});kf(Ht,"toString",function(){return be(this).serialize()},{enumerable:!0});Sr&&hw(Ht,"size",{get:function(){return be(this).entries.length},configurable:!0,enumerable:!0});pw(ia,rr);Hi({global:!0,constructor:!0,forced:!Of},{URLSearchParams:ia});if(!Of&&La($r)){var Bw=Ae(hc.has),zw=Ae(hc.set),bc=function(e){if(Rf(e)){var t=e.body,r;if(ww(t)===rr)return r=e.headers?new $r(e.headers):new $r,Bw(r,"content-type")||zw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Sw(e,{body:lc(0,se(t)),headers:lc(0,r)})}return e};if(La(dc)&&Hi({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return dc(t,arguments.length>1?bc(arguments[1]):{})}}),La(An)){var Da=function(t){return _f(this,Ua),new An(t,arguments.length>1?bc(arguments[1]):{})};Ua.constructor=Da,Da.prototype=Ua,Hi({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Da})}}var Hw={URLSearchParams:ia,getState:be},Kw=Pe,oa=K,Sc=Ze,Gw=St,Nf=URLSearchParams,sa=Nf.prototype,Ww=oa(sa.append),$c=oa(sa.delete),Vw=oa(sa.forEach),Zw=oa([].push),zo=new Nf("a=1&a=2&b=3");zo.delete("a",1);zo.delete("b",void 0);zo+""!="a=2"&&Kw(sa,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return $c(this,e);var n=[];Vw(this,function(c,d){Zw(n,{key:d,value:c})}),Gw(t,1);for(var a=Sc(e),i=Sc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,$c(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||Ww(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var Jw=Pe,xf=K,Yw=Ze,Xw=St,Df=URLSearchParams,Ho=Df.prototype,qw=xf(Ho.getAll),Qw=xf(Ho.has),Ic=new Df("a=1");(Ic.has("a",2)||!Ic.has("a",void 0))&&Jw(Ho,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Qw(this,t);var a=qw(this,t);Xw(r,1);for(var i=Yw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var eb=ae,tb=K,rb=ra,Ki=URLSearchParams.prototype,nb=tb(Ki.forEach);eb&&!("size"in Ki)&&rb(Ki,"size",{get:function(){var t=0;return nb(this,function(){t++}),t},configurable:!0,enumerable:!0});var ab=G,Ko=ab,ib=Ko;ib.URLSearchParams;var Go=K,ob=$o,sb=Ze,cb=Jn,ub=Go("".charAt),Tc=Go("".charCodeAt),lb=Go("".slice),Pc=function(e){return function(t,r){var n=sb(cb(t)),a=ob(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=Tc(n,a),o<55296||o>56319||a+1===i||(s=Tc(n,a+1))<56320||s>57343?e?ub(n,a):o:e?lb(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},Mf={codeAt:Pc(!1),charAt:Pc(!0)},fb=Mf.charAt,db=Ze,Ff=Qt,hb=Sf,Ec=Uo,Bf="String Iterator",vb=Ff.set,pb=Ff.getterFor(Bf);hb(String,"String",function(e){vb(this,{type:Bf,string:db(e),index:0})},function(){var t=pb(this),r=t.string,n=t.index,a;return n>=r.length?Ec(void 0,!0):(a=fb(r,n),t.index+=a.length,Ec(a,!1))});var Oc=ae,mb=K,gb=ie,yb=re,Ma=ef,wb=Ao,bb=ko,Sb=Yn,$b=Ml,Et=Object.assign,kc=Object.defineProperty,Ib=mb([].concat),Tb=!Et||yb(function(){if(Oc&&Et({b:1},Et(kc({},"a",{enumerable:!0,get:function(){kc(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}),Et({},e)[r]!==7||Ma(Et({},t)).join("")!==n})?function(t,r){for(var n=Sb(t),a=arguments.length,i=1,o=wb.f,s=bb.f;a>i;)for(var u=$b(arguments[i++]),f=o?Ib(Ma(u),o(u)):Ma(u),l=f.length,c=0,d;l>c;)d=f[c++],(!Oc||gb(s,u,d))&&(n[d]=u[d]);return n}:Et,Pb=ie,_c=je,Eb=So,zf=function(e,t,r){var n,a;_c(e);try{if(n=Eb(e,"return"),!n){if(t==="throw")throw r;return r}n=Pb(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return _c(n),r},Ob=je,kb=zf,_b=function(e,t,r,n){try{return n?t(Ob(r)[0],r[1]):t(r)}catch(a){kb(e,"throw",a)}},Rb=ne,Cb=xr,Ab=Rb("iterator"),jb=Array.prototype,Hf=function(e){return e!==void 0&&(Cb.Array===e||jb[Ab]===e)},Lb=K,Ub=re,Kf=Y,Nb=Mr,xb=Te,Db=Ro,Gf=function(){},Wf=xb("Reflect","construct"),Wo=/^\s*(?:class|function)\b/,Mb=Lb(Wo.exec),Fb=!Wo.test(Gf),lr=function(t){if(!Kf(t))return!1;try{return Wf(Gf,[],t),!0}catch{return!1}},Vf=function(t){if(!Kf(t))return!1;switch(Nb(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Fb||!!Mb(Wo,Db(t))}catch{return!0}};Vf.sham=!0;var Zf=!Wf||Ub(function(){var e;return lr(lr.call)||!lr(Object)||!lr(function(){e=!0})||e})?Vf:lr,Bb=ae,zb=De,Hb=wt,Kb=function(e,t,r){Bb?zb.f(e,t,Hb(0,r)):e[t]=r},Gb=tr,Wb=ie,Vb=Yn,Zb=_b,Jb=Hf,Yb=Zf,Xb=Io,Rc=Kb,qb=Mo,Qb=na,Cc=Array,eS=function(t){var r=Vb(t),n=Yb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=Gb(i,a>2?arguments[2]:void 0));var s=Qb(r),u=0,f,l,c,d,h,v;if(s&&!(this===Cc&&Jb(s)))for(l=n?new this:[],d=qb(r,s),h=d.next;!(c=Wb(h,d)).done;u++)v=o?Zb(d,i,[c.value,u],!0):c.value,Rc(l,u,v);else for(f=Xb(r),l=n?new this(f):Cc(f);f>u;u++)v=o?i(r[u],u):r[u],Rc(l,u,v);return l.length=u,l},$t=K,Fa=2147483647,Ir=36,Jf=1,Gi=26,tS=38,rS=700,nS=72,aS=128,iS="-",oS=/[^\0-\u007E]/,Yf=/[.\u3002\uFF0E\uFF61]/g,Ac="Overflow: input needs wider integers to process",Ba=Ir-Jf,jc=RangeError,sS=$t(Yf.exec),Ut=Math.floor,za=String.fromCharCode,Lc=$t("".charCodeAt),Xf=$t([].join),et=$t([].push),cS=$t("".replace),uS=$t("".split),lS=$t("".toLowerCase),fS=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Lc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Lc(e,r++);(i&64512)===56320?et(t,((a&1023)<<10)+(i&1023)+65536):(et(t,a),r--)}else et(t,a)}return t},Uc=function(e){return e+22+75*(e<26)},dS=function(e,t,r){var n=0;for(e=r?Ut(e/rS):e>>1,e+=Ut(e/t);e>Ba*Gi>>1;)e=Ut(e/Ba),n+=Ir;return Ut(n+(Ba+1)*e/(e+tS))},hS=function(e){var t=[];e=fS(e);var r=e.length,n=aS,a=0,i=nS,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&et(t,za(s));var u=t.length,f=u;for(u&&et(t,iS);f<r;){var l=Fa;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>Ut((Fa-a)/c))throw new jc(Ac);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Fa)throw new jc(Ac);if(s===n){for(var d=a,h=Ir;;){var v=h<=i?Jf:h>=i+Gi?Gi:h-i;if(d<v)break;var b=d-v,g=Ir-v;et(t,za(Uc(v+b%g))),d=Ut(b/g),h+=Ir}et(t,za(Uc(d))),i=dS(a,c,f===u),a=0,f++}}a++,n++}return Xf(t,"")},vS=function(e){var t=[],r=uS(cS(lS(e),Yf,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],et(t,sS(oS,a)?"xn--"+hS(a):a);return Xf(t,".")},pS=Q,Vo=ae,mS=ta,Zo=G,Nc=tr,Ee=K,jn=Pe,ge=ra,gS=xo,Wi=$e,Jo=Tb,Ot=eS,Oe=aa,yS=Mf.codeAt,wS=vS,ze=Ze,bS=er,SS=St,qf=Hw,Qf=Qt,$S=Qf.set,Ln=Qf.getterFor("URL"),IS=qf.URLSearchParams,TS=qf.getState,fr=Zo.URL,Vi=Zo.TypeError,Un=Zo.parseInt,PS=Math.floor,xc=Math.pow,Se=Ee("".charAt),Ce=Ee(/./.exec),gr=Ee([].join),ES=Ee(1 .toString),OS=Ee([].pop),Ct=Ee([].push),Ha=Ee("".replace),kS=Ee([].shift),_S=Ee("".split),Tr=Ee("".slice),Nn=Ee("".toLowerCase),RS=Ee([].unshift),CS="Invalid authority",Ka="Invalid scheme",at="Invalid host",Dc="Invalid port",ed=/[a-z]/i,AS=/[\d+-.a-z]/i,Zi=/\d/,jS=/^0x/i,LS=/^[0-7]+$/,US=/^\d+$/,td=/^[\da-f]+$/i,NS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,xS=/[\0\t\n\r #/:<>?@[\\\]^|]/,DS=/^[\u0000-\u0020]+/,MS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,FS=/[\t\n\r]/g,ye,BS=function(e){var t=_S(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&&Se(i,0)==="0"&&(o=Ce(jS,i)?16:8,i=Tr(i,o===8?1:2)),i==="")s=0;else{if(!Ce(o===10?US:o===8?LS:td,i))return e;s=Un(i,o)}Ct(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=xc(256,5-r))return null}else if(s>255)return null;for(u=OS(n),a=0;a<n.length;a++)u+=n[a]*xc(256,3-a);return u},zS=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 Se(e,a)};if(d()===":"){if(Se(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&&Ce(td,d());)i=i*16+Un(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(!Ce(Zi,d()))return;for(;Ce(Zi,d());){if(f=Un(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},HS=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},dr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)RS(t,e%256),e=PS(e/256);return gr(t,".")}if(typeof e=="object"){for(t="",n=HS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=ES(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Tn={},rd=Jo({},Tn,{" ":1,'"':1,"<":1,">":1,"`":1}),nd=Jo({},rd,{"#":1,"?":1,"{":1,"}":1}),Ga=Jo({},nd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ye=function(e,t){var r=yS(e,0);return r>32&&r<127&&!Wi(t,e)?e:encodeURIComponent(e)},tn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},yr=function(e,t){var r;return e.length===2&&Ce(ed,Se(e,0))&&((r=Se(e,1))===":"||!t&&r==="|")},Mc=function(e){var t;return e.length>1&&yr(Tr(e,0,2))&&(e.length===2||(t=Se(e,2))==="/"||t==="\\"||t==="?"||t==="#")},KS=function(e){return e==="."||Nn(e)==="%2e"},GS=function(e){return e=Nn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Wa={},Fc={},Va={},Bc={},zc={},Za={},Hc={},Kc={},rn={},nn={},Ja={},Ya={},Xa={},qa={},Gc={},Qa={},kt={},Ne={},Wc={},it={},Be={},Yo=function(e,t,r){var n=ze(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Vi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Yo(r,!0)),i=this.parse(n,null,a),i)throw new Vi(i);o=TS(new IS),o.bindURL(this),this.searchParams=o}};Yo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Wa,i=0,o="",s=!1,u=!1,f=!1,l,c,d,h;for(e=ze(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=Ha(e,DS,""),e=Ha(e,MS,"$1")),e=Ha(e,FS,""),l=Ot(e);i<=l.length;){switch(c=l[i],a){case Wa:if(c&&Ce(ed,c))o+=Nn(c),a=Fc;else{if(t)return Ka;a=Va;continue}break;case Fc:if(c&&(Ce(AS,c)||c==="+"||c==="-"||c==="."))o+=Nn(c);else if(c===":"){if(t&&(n.isSpecial()!==Wi(tn,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&tn[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=qa:n.isSpecial()&&r&&r.scheme===n.scheme?a=Bc:n.isSpecial()?a=Kc:l[i+1]==="/"?(a=zc,i++):(n.cannotBeABaseURL=!0,Ct(n.path,""),a=Wc)}else{if(t)return Ka;o="",a=Va,i=0;continue}break;case Va:if(!r||r.cannotBeABaseURL&&c!=="#")return Ka;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Oe(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Be;break}a=r.scheme==="file"?qa:Za;continue;case Bc:if(c==="/"&&l[i+1]==="/")a=rn,i++;else{a=Za;continue}break;case zc:if(c==="/"){a=nn;break}else{a=Ne;continue}case Za:if(n.scheme=r.scheme,c===ye)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Hc;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(r.path),n.query="",a=it;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(r.path),n.query=r.query,n.fragment="",a=Be;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=Oe(r.path),n.path.length--,a=Ne;continue}break;case Hc:if(n.isSpecial()&&(c==="/"||c==="\\"))a=rn;else if(c==="/")a=nn;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ne;continue}break;case Kc:if(a=rn,c!=="/"||Se(o,i+1)!=="/")continue;i++;break;case rn:if(c!=="/"&&c!=="\\"){a=nn;continue}break;case nn:if(c==="@"){s&&(o="%40"+o),s=!0,d=Ot(o);for(var v=0;v<d.length;v++){var b=d[v];if(b===":"&&!f){f=!0;continue}var g=Ye(b,Ga);f?n.password+=g:n.username+=g}o=""}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return CS;i-=Ot(o).length+1,o="",a=Ja}else o+=c;break;case Ja:case Ya:if(t&&n.scheme==="file"){a=Qa;continue}else if(c===":"&&!u){if(o==="")return at;if(h=n.parseHost(o),h)return h;if(o="",a=Xa,t===Ya)return}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return at;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=kt,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Xa:if(Ce(Zi,c))o+=c;else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=Un(o,10);if(T>65535)return Dc;n.port=n.isSpecial()&&T===tn[n.scheme]?null:T,o=""}if(t)return;a=kt;continue}else return Dc;break;case qa:if(n.scheme="file",c==="/"||c==="\\")a=Gc;else if(r&&r.scheme==="file")switch(c){case ye:n.host=r.host,n.path=Oe(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=Oe(r.path),n.query="",a=it;break;case"#":n.host=r.host,n.path=Oe(r.path),n.query=r.query,n.fragment="",a=Be;break;default:Mc(gr(Oe(l,i),""))||(n.host=r.host,n.path=Oe(r.path),n.shortenPath()),a=Ne;continue}else{a=Ne;continue}break;case Gc:if(c==="/"||c==="\\"){a=Qa;break}r&&r.scheme==="file"&&!Mc(gr(Oe(l,i),""))&&(yr(r.path[0],!0)?Ct(n.path,r.path[0]):n.host=r.host),a=Ne;continue;case Qa:if(c===ye||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&yr(o))a=Ne;else if(o===""){if(n.host="",t)return;a=kt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=kt}continue}else o+=c;break;case kt:if(n.isSpecial()){if(a=Ne,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=it;else if(!t&&c==="#")n.fragment="",a=Be;else if(c!==ye&&(a=Ne,c!=="/"))continue;break;case Ne:if(c===ye||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(GS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,"")):KS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Ct(n.path,""):(n.scheme==="file"&&!n.path.length&&yr(o)&&(n.host&&(n.host=""),o=Se(o,0)+":"),Ct(n.path,o)),o="",n.scheme==="file"&&(c===ye||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)kS(n.path);c==="?"?(n.query="",a=it):c==="#"&&(n.fragment="",a=Be)}else o+=Ye(c,nd);break;case Wc:c==="?"?(n.query="",a=it):c==="#"?(n.fragment="",a=Be):c!==ye&&(n.path[0]+=Ye(c,Tn));break;case it:!t&&c==="#"?(n.fragment="",a=Be):c!==ye&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ye(c,Tn));break;case Be:c!==ye&&(n.fragment+=Ye(c,rd));break}i++}},parseHost:function(e){var t,r,n;if(Se(e,0)==="["){if(Se(e,e.length-1)!=="]"||(t=zS(Tr(e,1,-1)),!t))return at;this.host=t}else if(this.isSpecial()){if(e=wS(e),Ce(NS,e)||(t=BS(e),t===null))return at;this.host=t}else{if(Ce(xS,e))return at;for(t="",r=Ot(e),n=0;n<r.length;n++)t+=Ye(r[n],Tn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Wi(tn,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!yr(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+=dr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+gr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Vi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new Kt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+dr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(ze(e)+":",Wa)},getUsername:function(){return this.username},setUsername:function(e){var t=Ot(ze(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ye(t[r],Ga)}},getPassword:function(){return this.password},setPassword:function(e){var t=Ot(ze(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ye(t[r],Ga)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?dr(e):dr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ja)},getHostname:function(){var e=this.host;return e===null?"":dr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ya)},getPort:function(){var e=this.port;return e===null?"":ze(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=ze(e),e===""?this.port=null:this.parse(e,Xa))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+gr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,kt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=ze(e),e===""?this.query=null:(Se(e,0)==="?"&&(e=Tr(e,1)),this.query="",this.parse(e,it)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=ze(e),e===""){this.fragment=null;return}Se(e,0)==="#"&&(e=Tr(e,1)),this.fragment="",this.parse(e,Be)},update:function(){this.query=this.searchParams.serialize()||null}};var Kt=function(t){var r=gS(this,oe),n=SS(arguments.length,1)>1?arguments[1]:void 0,a=$S(r,new Yo(t,!1,n));Vo||(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())},oe=Kt.prototype,we=function(e,t){return{get:function(){return Ln(this)[e]()},set:t&&function(r){return Ln(this)[t](r)},configurable:!0,enumerable:!0}};Vo&&(ge(oe,"href",we("serialize","setHref")),ge(oe,"origin",we("getOrigin")),ge(oe,"protocol",we("getProtocol","setProtocol")),ge(oe,"username",we("getUsername","setUsername")),ge(oe,"password",we("getPassword","setPassword")),ge(oe,"host",we("getHost","setHost")),ge(oe,"hostname",we("getHostname","setHostname")),ge(oe,"port",we("getPort","setPort")),ge(oe,"pathname",we("getPathname","setPathname")),ge(oe,"search",we("getSearch","setSearch")),ge(oe,"searchParams",we("getSearchParams")),ge(oe,"hash",we("getHash","setHash")));jn(oe,"toJSON",function(){return Ln(this).serialize()},{enumerable:!0});jn(oe,"toString",function(){return Ln(this).serialize()},{enumerable:!0});if(fr){var Vc=fr.createObjectURL,Zc=fr.revokeObjectURL;Vc&&jn(Kt,"createObjectURL",Nc(Vc,fr)),Zc&&jn(Kt,"revokeObjectURL",Nc(Zc,fr))}bS(Kt,"URL");pS({global:!0,constructor:!0,forced:!mS,sham:!Vo},{URL:Kt});var WS=Q,VS=Te,ad=re,ZS=St,Jc=Ze,JS=ta,Xo=VS("URL"),YS=JS&&ad(function(){Xo.canParse()}),XS=ad(function(){return Xo.canParse.length!==1});WS({target:"URL",stat:!0,forced:!YS||XS},{canParse:function(t){var r=ZS(arguments.length,1),n=Jc(t),a=r<2||arguments[1]===void 0?void 0:Jc(arguments[1]);try{return!!new Xo(n,a)}catch{return!1}}});var qS=Q,QS=Te,e$=St,Yc=Ze,t$=ta,r$=QS("URL");qS({target:"URL",stat:!0,forced:!t$},{parse:function(t){var r=e$(arguments.length,1),n=Yc(t),a=r<2||arguments[1]===void 0?void 0:Yc(arguments[1]);try{return new r$(n,a)}catch{return null}}});var n$=Q,a$=ie;n$({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return a$(URL.prototype.toString,this)}});var i$=Ko;i$.URL;var o$={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},s$=Xn,ei=s$("span").classList,Xc=ei&&ei.constructor&&ei.constructor.prototype,c$=Xc===Object.prototype?void 0:Xc,qc=G,id=o$,u$=c$,wr=my,Qc=bt,l$=er,f$=ne,ti=f$("iterator"),ri=wr.values,od=function(e,t){if(e){if(e[ti]!==ri)try{Qc(e,ti,ri)}catch{e[ti]=ri}if(l$(e,t,!0),id[t]){for(var r in wr)if(e[r]!==wr[r])try{Qc(e,r,wr[r])}catch{e[r]=wr[r]}}}};for(var ni in id)od(qc[ni]&&qc[ni].prototype,ni);od(u$,"DOMTokenList");var d$=Ie,h$=bt,v$=function(e,t){d$(t)&&"cause"in t&&h$(e,"cause",t.cause)},p$=K,sd=Error,m$=p$("".replace),g$=function(e){return String(new sd(e).stack)}("zxcasd"),cd=/\n\s*at [^:]*:[^\n]*/,y$=cd.test(g$),w$=function(e,t){if(y$&&typeof e=="string"&&!sd.prepareStackTrace)for(;t--;)e=m$(e,cd,"");return e},b$=re,S$=wt,$$=!b$(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",S$(1,7)),e.stack!==7):!0}),I$=bt,T$=w$,P$=$$,eu=Error.captureStackTrace,E$=function(e,t,r,n){P$&&(eu?eu(e,t):I$(e,"stack",T$(r,n)))},O$=tr,k$=ie,_$=je,R$=Qn,C$=Hf,A$=Io,tu=qn,j$=Mo,L$=na,ru=zf,U$=TypeError,Pn=function(e,t){this.stopped=e,this.result=t},nu=Pn.prototype,Fr=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=O$(t,n),f,l,c,d,h,v,b,g=function(I){return f&&ru(f,"normal",I),new Pn(!0,I)},T=function(I){return a?(_$(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=L$(e),!l)throw new U$(R$(e)+" is not iterable");if(C$(l)){for(c=0,d=A$(e);d>c;c++)if(h=T(e[c]),h&&tu(nu,h))return h;return new Pn(!1)}f=j$(e,l)}for(v=i?e.next:f.next;!(b=k$(v,f)).done;){try{h=T(b.value)}catch(I){ru(f,"throw",I)}if(typeof h=="object"&&h&&tu(nu,h))return h}return new Pn(!1)},N$=Ze,x$=function(e,t){return e===void 0?arguments.length<2?"":t:N$(e)},D$=Q,M$=qn,F$=jo,xn=Lo,B$=vf,ud=ea,ai=bt,ii=wt,z$=v$,H$=E$,K$=Fr,G$=x$,W$=ne,V$=W$("toStringTag"),Dn=Error,Z$=[].push,Gt=function(t,r){var n=M$(oi,this),a;xn?a=xn(new Dn,n?F$(this):oi):(a=n?this:ud(oi),ai(a,V$,"Error")),r!==void 0&&ai(a,"message",G$(r)),H$(a,Gt,a.stack,1),arguments.length>2&&z$(a,arguments[2]);var i=[];return K$(t,Z$,{that:i}),ai(a,"errors",i),a};xn?xn(Gt,Dn):B$(Gt,Dn,{name:!0});var oi=Gt.prototype=ud(Dn.prototype,{constructor:ii(1,Gt),message:ii(1,""),name:ii(1,"AggregateError")});D$({global:!0,constructor:!0,arity:2},{AggregateError:Gt});var J$=Do,Y$=Mr,X$=J$?{}.toString:function(){return"[object "+Y$(this)+"]"},q$=Do,Q$=Pe,eI=X$;q$||Q$(Object.prototype,"toString",eI,{unsafe:!0});var hr=G,tI=Nr,rI=Vn,an=function(e){return tI.slice(0,e.length)===e},ld=function(){return an("Bun/")?"BUN":an("Cloudflare-Workers")?"CLOUDFLARE":an("Deno/")?"DENO":an("Node.js/")?"NODE":hr.Bun&&typeof Bun.version=="string"?"BUN":hr.Deno&&typeof Deno.version=="object"?"DENO":rI(hr.process)==="process"?"NODE":hr.window&&hr.document?"BROWSER":"REST"}(),nI=ld,qo=nI==="NODE",aI=Te,iI=ra,oI=ne,sI=ae,au=oI("species"),cI=function(e){var t=aI(e);sI&&t&&!t[au]&&iI(t,au,{configurable:!0,get:function(){return this}})},uI=Zf,lI=Qn,fI=TypeError,dI=function(e){if(uI(e))return e;throw new fI(lI(e)+" is not a constructor")},iu=je,hI=dI,vI=Zn,pI=ne,mI=pI("species"),fd=function(e,t){var r=iu(e).constructor,n;return r===void 0||vI(n=iu(r)[mI])?t:hI(n)},gI=Wn,dd=Function.prototype,ou=dd.apply,su=dd.call,hd=typeof Reflect=="object"&&Reflect.apply||(gI?su.bind(ou):function(){return su.apply(ou,arguments)}),yI=Nr,vd=/(?:ipad|iphone|ipod).*applewebkit/i.test(yI),fe=G,wI=hd,bI=tr,cu=Y,SI=$e,pd=re,uu=tf,$I=aa,lu=Xn,II=St,TI=vd,PI=qo,Ji=fe.setImmediate,Yi=fe.clearImmediate,EI=fe.process,si=fe.Dispatch,OI=fe.Function,fu=fe.MessageChannel,kI=fe.String,ci=0,Pr={},du="onreadystatechange",Ar,ot,ui,li;pd(function(){Ar=fe.location});var Qo=function(e){if(SI(Pr,e)){var t=Pr[e];delete Pr[e],t()}},fi=function(e){return function(){Qo(e)}},hu=function(e){Qo(e.data)},vu=function(e){fe.postMessage(kI(e),Ar.protocol+"//"+Ar.host)};(!Ji||!Yi)&&(Ji=function(t){II(arguments.length,1);var r=cu(t)?t:OI(t),n=$I(arguments,1);return Pr[++ci]=function(){wI(r,void 0,n)},ot(ci),ci},Yi=function(t){delete Pr[t]},PI?ot=function(e){EI.nextTick(fi(e))}:si&&si.now?ot=function(e){si.now(fi(e))}:fu&&!TI?(ui=new fu,li=ui.port2,ui.port1.onmessage=hu,ot=bI(li.postMessage,li)):fe.addEventListener&&cu(fe.postMessage)&&!fe.importScripts&&Ar&&Ar.protocol!=="file:"&&!pd(vu)?(ot=vu,fe.addEventListener("message",hu,!1)):du in lu("script")?ot=function(e){uu.appendChild(lu("script"))[du]=function(){uu.removeChild(this),Qo(e)}}:ot=function(e){setTimeout(fi(e),0)});var md={set:Ji,clear:Yi},gd=function(){this.head=null,this.tail=null};gd.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 yd=gd,_I=Nr,RI=/ipad|iphone|ipod/i.test(_I)&&typeof Pebble<"u",CI=Nr,AI=/web0s(?!.*chrome)/i.test(CI),Wt=G,jI=Tf,pu=tr,di=md.set,LI=yd,UI=vd,NI=RI,xI=AI,hi=qo,mu=Wt.MutationObserver||Wt.WebKitMutationObserver,gu=Wt.document,yu=Wt.process,on=Wt.Promise,Xi=jI("queueMicrotask"),_t,vi,pi,sn,wu;if(!Xi){var cn=new LI,un=function(){var e,t;for(hi&&(e=yu.domain)&&e.exit();t=cn.get();)try{t()}catch(r){throw cn.head&&_t(),r}e&&e.enter()};!UI&&!hi&&!xI&&mu&&gu?(vi=!0,pi=gu.createTextNode(""),new mu(un).observe(pi,{characterData:!0}),_t=function(){pi.data=vi=!vi}):!NI&&on&&on.resolve?(sn=on.resolve(void 0),sn.constructor=on,wu=pu(sn.then,sn),_t=function(){wu(un)}):hi?_t=function(){yu.nextTick(un)}:(di=pu(di,Wt),_t=function(){di(un)}),Xi=function(e){cn.head||_t(),cn.add(e)}}var DI=Xi,MI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},nr=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},FI=G,Br=FI.Promise,BI=G,Er=Br,zI=Y,HI=pf,KI=Ro,GI=ne,bu=ld,mi=Kl;Er&&Er.prototype;var WI=GI("species"),qi=!1,wd=zI(BI.PromiseRejectionEvent),VI=HI("Promise",function(){var e=KI(Er),t=e!==String(Er);if(!t&&mi===66)return!0;if(!mi||mi<51||!/native code/.test(e)){var r=new Er(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[WI]=n,qi=r.then(function(){})instanceof n,!qi)return!0}return!t&&(bu==="BROWSER"||bu==="DENO")&&!wd}),zr={CONSTRUCTOR:VI,REJECTION_EVENT:wd,SUBCLASSING:qi},Me={},Su=Le,ZI=TypeError,JI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new ZI("Bad Promise constructor");t=n,r=a}),this.resolve=Su(t),this.reject=Su(r)};Me.f=function(e){return new JI(e)};var YI=Q,Mn=qo,nt=G,Vt=ie,$u=Pe,Iu=Lo,XI=er,qI=cI,QI=Le,En=Y,e0=Ie,t0=xo,r0=fd,bd=md.set,es=DI,n0=MI,a0=nr,i0=yd,Sd=Qt,Fn=Br,ts=zr,$d=Me,ca="Promise",Id=ts.CONSTRUCTOR,o0=ts.REJECTION_EVENT,s0=ts.SUBCLASSING,gi=Sd.getterFor(ca),c0=Sd.set,At=Fn&&Fn.prototype,ct=Fn,ln=At,Td=nt.TypeError,Qi=nt.document,rs=nt.process,eo=$d.f,u0=eo,l0=!!(Qi&&Qi.createEvent&&nt.dispatchEvent),Pd="unhandledrejection",f0="rejectionhandled",Tu=0,Ed=1,d0=2,ns=1,Od=2,fn,Pu,h0,Eu,kd=function(e){var t;return e0(e)&&En(t=e.then)?t:!1},_d=function(e,t){var r=t.value,n=t.state===Ed,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===Od&&p0(t),t.rejection=ns),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new Td("Promise-chain cycle")):(f=kd(u))?Vt(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},Rd=function(e,t){e.notified||(e.notified=!0,es(function(){for(var r=e.reactions,n;n=r.get();)_d(n,e);e.notified=!1,t&&!e.rejection&&v0(e)}))},Cd=function(e,t,r){var n,a;l0?(n=Qi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),nt.dispatchEvent(n)):n={promise:t,reason:r},!o0&&(a=nt["on"+e])?a(n):e===Pd&&n0("Unhandled promise rejection",r)},v0=function(e){Vt(bd,nt,function(){var t=e.facade,r=e.value,n=Ou(e),a;if(n&&(a=a0(function(){Mn?rs.emit("unhandledRejection",r,t):Cd(Pd,t,r)}),e.rejection=Mn||Ou(e)?Od:ns,a.error))throw a.value})},Ou=function(e){return e.rejection!==ns&&!e.parent},p0=function(e){Vt(bd,nt,function(){var t=e.facade;Mn?rs.emit("rejectionHandled",t):Cd(f0,t,e.value)})},Nt=function(e,t,r){return function(n){e(t,n,r)}},Mt=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=d0,Rd(e,!0))},to=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new Td("Promise can't be resolved itself");var n=kd(t);n?es(function(){var a={done:!1};try{Vt(n,t,Nt(to,a,e),Nt(Mt,a,e))}catch(i){Mt(a,i,e)}}):(e.value=t,e.state=Ed,Rd(e,!1))}catch(a){Mt({done:!1},a,e)}}};if(Id&&(ct=function(t){t0(this,ln),QI(t),Vt(fn,this);var r=gi(this);try{t(Nt(to,r),Nt(Mt,r))}catch(n){Mt(r,n)}},ln=ct.prototype,fn=function(t){c0(this,{type:ca,done:!1,notified:!1,parent:!1,reactions:new i0,rejection:!1,state:Tu,value:null})},fn.prototype=$u(ln,"then",function(t,r){var n=gi(this),a=eo(r0(this,ct));return n.parent=!0,a.ok=En(t)?t:!0,a.fail=En(r)&&r,a.domain=Mn?rs.domain:void 0,n.state===Tu?n.reactions.add(a):es(function(){_d(a,n)}),a.promise}),Pu=function(){var e=new fn,t=gi(e);this.promise=e,this.resolve=Nt(to,t),this.reject=Nt(Mt,t)},$d.f=eo=function(e){return e===ct||e===h0?new Pu(e):u0(e)},En(Fn)&&At!==Object.prototype)){Eu=At.then,s0||$u(At,"then",function(t,r){var n=this;return new ct(function(a,i){Vt(Eu,n,a,i)}).then(t,r)},{unsafe:!0});try{delete At.constructor}catch{}Iu&&Iu(At,ln)}YI({global:!0,constructor:!0,wrap:!0,forced:Id},{Promise:ct});XI(ct,ca,!1);qI(ca);var m0=ne,Ad=m0("iterator"),jd=!1;try{var g0=0,ku={next:function(){return{done:!!g0++}},return:function(){jd=!0}};ku[Ad]=function(){return this},Array.from(ku,function(){throw 2})}catch{}var y0=function(e,t){try{if(!t&&!jd)return!1}catch{return!1}var r=!1;try{var n={};n[Ad]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},w0=Br,b0=y0,S0=zr.CONSTRUCTOR,ua=S0||!b0(function(e){w0.all(e).then(void 0,function(){})}),$0=Q,I0=ie,T0=Le,P0=Me,E0=nr,O0=Fr,k0=ua;$0({target:"Promise",stat:!0,forced:k0},{all:function(t){var r=this,n=P0.f(r),a=n.resolve,i=n.reject,o=E0(function(){var s=T0(r.resolve),u=[],f=0,l=1;O0(t,function(c){var d=f++,h=!1;l++,I0(s,r,c).then(function(v){h||(h=!0,u[d]=v,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var _0=Q,R0=zr.CONSTRUCTOR,ro=Br,C0=Te,A0=Y,j0=Pe,_u=ro&&ro.prototype;_0({target:"Promise",proto:!0,forced:R0,real:!0},{catch:function(e){return this.then(void 0,e)}});if(A0(ro)){var Ru=C0("Promise").prototype.catch;_u.catch!==Ru&&j0(_u,"catch",Ru,{unsafe:!0})}var L0=Q,U0=ie,N0=Le,x0=Me,D0=nr,M0=Fr,F0=ua;L0({target:"Promise",stat:!0,forced:F0},{race:function(t){var r=this,n=x0.f(r),a=n.reject,i=D0(function(){var o=N0(r.resolve);M0(t,function(s){U0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var B0=Q,z0=Me,H0=zr.CONSTRUCTOR;B0({target:"Promise",stat:!0,forced:H0},{reject:function(t){var r=z0.f(this),n=r.reject;return n(t),r.promise}});var K0=je,G0=Ie,W0=Me,Ld=function(e,t){if(K0(e),G0(t)&&t.constructor===e)return t;var r=W0.f(e),n=r.resolve;return n(t),r.promise},V0=Q,Z0=Te,J0=zr.CONSTRUCTOR,Y0=Ld;Z0("Promise");V0({target:"Promise",stat:!0,forced:J0},{resolve:function(t){return Y0(this,t)}});var X0=Q,q0=ie,Q0=Le,eT=Me,tT=nr,rT=Fr,nT=ua;X0({target:"Promise",stat:!0,forced:nT},{allSettled:function(t){var r=this,n=eT.f(r),a=n.resolve,i=n.reject,o=tT(function(){var s=Q0(r.resolve),u=[],f=0,l=1;rT(t,function(c){var d=f++,h=!1;l++,q0(s,r,c).then(function(v){h||(h=!0,u[d]={status:"fulfilled",value:v},--l||a(u))},function(v){h||(h=!0,u[d]={status:"rejected",reason:v},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var aT=Q,iT=ie,oT=Le,sT=Te,cT=Me,uT=nr,lT=Fr,fT=ua,Cu="No one promise resolved";aT({target:"Promise",stat:!0,forced:fT},{any:function(t){var r=this,n=sT("AggregateError"),a=cT.f(r),i=a.resolve,o=a.reject,s=uT(function(){var u=oT(r.resolve),f=[],l=0,c=1,d=!1;lT(t,function(h){var v=l++,b=!1;c++,iT(u,r,h).then(function(g){b||d||(d=!0,i(g))},function(g){b||d||(b=!0,f[v]=g,--c||o(new n(f,Cu)))})}),--c||o(new n(f,Cu))});return s.error&&o(s.value),a.promise}});var dT=Q,hT=Me;dT({target:"Promise",stat:!0},{withResolvers:function(){var t=hT.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var vT=Q,Bn=Br,pT=re,Ud=Te,Nd=Y,mT=fd,Au=Ld,gT=Pe,no=Bn&&Bn.prototype,yT=!!Bn&&pT(function(){no.finally.call({then:function(){}},function(){})});vT({target:"Promise",proto:!0,real:!0,forced:yT},{finally:function(e){var t=mT(this,Ud("Promise")),r=Nd(e);return this.then(r?function(n){return Au(t,e()).then(function(){return n})}:e,r?function(n){return Au(t,e()).then(function(){throw n})}:e)}});if(Nd(Bn)){var ju=Ud("Promise").prototype.finally;no.finally!==ju&&gT(no,"finally",ju,{unsafe:!0})}var wT=Ko;wT.Promise;var bT=Q,ST=G,$T=hd,IT=aa,TT=Me,PT=Le,xd=nr,yi=ST.Promise,Lu=!1,ET=!yi||!yi.try||xd(function(){yi.try(function(e){Lu=e===8},8)}).error||!Lu;bT({target:"Promise",stat:!0,forced:ET},{try:function(e){var t=arguments.length>1?IT(arguments,1):[],r=TT.f(this),n=xd(function(){return $T(PT(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});const Dd="sesamy-debug";function OT(e,t,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${t}; ${a}; path=/`}function kT(e){if(typeof document>"u")return null;const t=e+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null}function _T(e){OT(Dd,e.toString(),1)}function RT(){return kT(Dd)==="true"}function he(e){RT()&&console.log(e)}function Ve(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});he(`Triggering event: ${e}`),dispatchEvent(r)}function xe(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 ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function as(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function is(e,t){return e(t={exports:{}},t.exports),t.exports}var st=is(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()}});as(st);var CT=as(is(function(e,t){var r=ut&&ut.__awaiter||function(l,c,d,h){return new(d||(d=Promise))(function(v,b){function g(y){try{I(h.next(y))}catch(p){b(p)}}function T(y){try{I(h.throw(y))}catch(p){b(p)}}function I(y){y.done?v(y.value):new d(function(p){p(y.value)}).then(g,T)}I((h=h.apply(l,c||[])).next())})},n=ut&&ut.__generator||function(l,c){var d,h,v,b,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return b={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function T(I){return function(y){return function(p){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(v=2&p[0]?h.return:p[0]?h.throw||((v=h.return)&&v.call(h),0):h.next)&&!(v=v.call(h,p[1])).done)return v;switch(h=0,v&&(p=[2&p[0],v.value]),p[0]){case 0:case 1:v=p;break;case 4:return g.label++,{value:p[1],done:!1};case 5:g.label++,h=p[1],p=[0];continue;case 7:p=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||p[0]!==6&&p[0]!==2)){g=0;continue}if(p[0]===3&&(!v||p[1]>v[0]&&p[1]<v[3])){g.label=p[1];break}if(p[0]===6&&g.label<v[1]){g.label=v[1],v=p;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(p);break}v[2]&&g.ops.pop(),g.trys.pop();continue}p=c.call(l,g)}catch(S){p=[6,S],h=0}finally{d=v=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([I,y])}}},a=ut;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="",h=0;h<l;h++)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 h,v,b,g,T,I,y;return n(this,function(p){switch(p.label){case 0:h=Date.now()+u(4),v=Date.now()+d,b=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,p.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return p.sent(),g.getItemSync(b)!==null?[3,5]:(T=this.id+"-"+c+"-"+h,[4,s(Math.floor(25*Math.random()))]);case 3:return p.sent(),g.setItemSync(b,JSON.stringify({id:this.id,iat:h,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return p.sent(),(I=g.getItemSync(b))!==null&&(y=JSON.parse(I)).id===this.id&&y.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(b,h),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:p.sent(),p.label=7;case 7:return h=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 h=this;return n(this,function(v){return setTimeout(function(){return r(h,void 0,void 0,function(){var b,g,T;return n(this,function(I){switch(I.label){case 0:return[4,st.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(b=this.storageHandler===void 0?o:this.storageHandler,(g=b.getItemSync(c))===null?(st.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),b.setItemSync(c,JSON.stringify(T)),st.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(st.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(h){var v=!1,b=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!v){v=!0;var y=50-(Date.now()-b);y>0?setTimeout(h,y):h(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=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,h,v,b;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+c,(v=d.getItemSync(h))===null?[2]:(b=JSON.parse(v)).id!==this.id?[3,2]:[4,st.default().lock(b.iat)];case 1:g.sent(),this.acquiredIatSet.delete(b.iat),d.removeItemSync(h),st.default().unlock(b.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,h=c,v=[],b=0;;){var g=h.keySync(b);if(g===null)break;v.push(g),b++}for(var T=!1,I=0;I<v.length;I++){var y=v[I];if(y.includes(i)){var p=h.getItemSync(y);if(p!==null){var S=JSON.parse(p);(S.timeRefreshed===void 0&&S.timeAcquired<d||S.timeRefreshed!==void 0&&S.timeRefreshed<d)&&(h.removeItemSync(y),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const AT={timeoutInSeconds:60},Md={name:"auth0-spa-js",version:"2.1.3"},Fd=()=>Date.now();let le=class ao extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ao.prototype)}static fromPayload({error:t,error_description:r}){return new ao(t,r)}},jT=class Bd extends le{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,Bd.prototype)}},io=class zd extends le{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,zd.prototype)}},LT=class Hd extends io{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Hd.prototype)}},UT=class Kd extends le{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Kd.prototype)}},NT=class Gd extends le{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Gd.prototype)}},Wd=class Vd extends le{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Uu(t,["default"])}', scope: '${Uu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Vd.prototype)}};function Uu(e,t=[]){return e&&!t.includes(e)?e:""}const On=()=>window.crypto,wi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(On().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Nu=e=>btoa(e),oo=e=>{var{clientId:t}=e,r=xe(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()},xu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),xT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},DT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([xT(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},FT=async(e,t,r,n,a,i,o=1e4)=>a?MT(e,t,r,n,o,a,i):DT(e,n,o);async function BT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=xe(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?oo(u):JSON.stringify(u);return await async function(l,c,d,h,v,b,g){let T,I=null;for(let k=0;k<3;k++)try{T=await FT(l,d,h,v,b,g,c),I=null;break}catch(M){I=M}if(I)throw I;const y=T.json,{error:p,error_description:S}=y,O=xe(y,["error","error_description"]),{ok:_}=T;if(!_){const k=S||`HTTP error. Unable to fetch ${l}`;throw p==="mfa_required"?new NT(p,k,O.mfa_token):p==="missing_refresh_token"?new Wd(d,h):new le(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||Md))}},t,s)}const dn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let ft=class so{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 so({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new so({scope:r,audience:n,clientId:a})}},zT=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@@"))}},Zd=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)}}()}},HT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||Fd}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 ft({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 ft({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=ft.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]}},KT=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 vr=e=>typeof e=="number",GT=["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"],WT=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(xu(u)),c={__raw:i},d={};return Object.keys(l).forEach(h=>{c[h]=l[h],GT.includes(h)||(d[h]=l[h])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(xu(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&&!vr(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||!vr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!vr(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&&vr(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&&vr(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 dt=is(function(e,t){var r=ut&&ut.__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 h=l[d].split("="),v=h.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{f[h[0].replace(c,decodeURIComponent)]=v.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}))}});as(dt),dt.encode,dt.parse,dt.getAll;var VT=dt.get,Jd=dt.set,Yd=dt.remove;const jt={get(e){const t=VT(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),Jd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Yd(e,r)}},ZT={get(e){return jt.get(e)||jt.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),Jd(`_legacy_${e}`,JSON.stringify(t),n),jt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Yd(e,r),jt.remove(e,t),jt.remove(`_legacy_${e}`,t)}},JT={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 YT(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,h=l.length;d<h;++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 Du,Mu,Fu,bi,XT=(Du="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Mu=null,Fu=!1,function(e){return bi=bi||YT(Du,Mu,Fu),new Worker(bi,e)});const Si={};let qT=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 QT={memory:()=>new Zd().enclosedCache,localstorage:()=>new zT},Bu=e=>QT[e],zu=e=>{const{openUrl:t,onRedirect:r}=e,n=xe(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},$i=new CT;let eP=class{constructor(t){let r,n;if(this.userCache=new Zd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await $i.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(!On())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(On().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",!Du(r))throw new Error(`Invalid cache location "${r}"`);n=Du(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Ct:GT,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:KT;var i;this.scope=un("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new FT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||xd,this.cacheManager=new MT(n,n.allKeys?void 0:new ZT(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 VT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Ud)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${ao(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return zT({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=ju(gi()),i=ju(gi()),o=gi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await Tn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,b,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:un(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,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 CT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new RT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(le.fromPayload(h.data.response));u(h.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 le("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=Mu(t),{openUrl:a,fragment:i,appState:o}=n,s=xe(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=xe(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 le("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new _T(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new le("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:un(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=wi[o];return s||(s=i().finally(()=>{delete wi[o],s=null}),wi[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=xe(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})(()=>bi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new no;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 bi.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:un(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},kT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new lt({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=xe(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ao(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Mu(t),{openUrl:n}=r,a=xe(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 le("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((v,b,g=60)=>new Promise((T,I)=>{const y=window.document.createElement("iframe");y.setAttribute("width","0"),y.setAttribute("height","0"),y.style.display="none";const p=()=>{window.document.body.contains(y)&&(window.document.body.removeChild(y),window.removeEventListener("message",S,!1))};let S;const O=setTimeout(()=>{I(new no),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(le.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",S,!1),setTimeout(p,2e3)},window.addEventListener("message",S,!1),window.document.body.appendChild(y),y.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new le("state_mismatch","Invalid state");const h=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({},h),{scope:f,oauthTokenScope:h.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 lt({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 zd(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=xe(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 lt({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 lt({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 NT(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 XT(e){const t=new YT(e);return await t.checkSession(),t}var ve=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ve||{});const qT="sesamy.com",QT="sesamy.dev",eP="https://sesa.my",oo="sesamyCacheTimestamp";function He(e,t){return`https://${e}.${t==="dev"?QT:qT}`}function so(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let de,Vd,co=!1,Fu=!1;const Wt="sesamyAccessToken",Si="sesamyRefreshToken";async function Fr(){return co?!0:new Promise((e,t)=>{const r=setTimeout(()=>{co?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(ve.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function tP(e){if(!e)return null;const t=localStorage.getItem(Si);if(!t)return he("No refresh token found in localstorage"),null;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(Si),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Si,i.refresh_token),localStorage.setItem(Wt,i.access_token),i.access_token}catch{Zd()}}async function ns(){const e=localStorage.getItem(Wt);if(!e)return null;const t=Jd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await tP(t);if(r)return r;localStorage.removeItem(Wt)}return e}function Bu(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 rP(e){if(e.enabled===!1)return;Vd=e.organization;const t={domain:He("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Bu(window.location.href)!==Bu(He("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),de=await XT(t),window.location.search.includes("code="))try{await de.handleRedirectCallback();const r=await de.getUser();if(!r)throw new Error("No user found");We(ve.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){alert("There was an error logging in"),console.error(r)}co=!0,We(ve.AUTH_INITIALIZED,{})}async function Rr(){return await Fr(),await ns()?!0:de?de.isAuthenticated():!1}async function nP(){return await Fr(),await ns()?(he("Using local user"),{sub:"local",name:"Local User"}):de?de.getUser():null}async function as(e){if(Fu){he("Login already in progress");return}if(Fu=!0,await Fr(),localStorage.removeItem(Wt),!de)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return de.loginWithRedirect({...e,authorizationParams:{organization:Vd,redirect_uri:window.location.href,ui_locales:so(),...t}})}async function dr(e=!0){await Fr();const t=await ns();if(t)return t;try{return de?await de.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Zd(e={}){if(await Fr(),localStorage.removeItem(Wt),We(ve.LOGOUT,{}),!!de)return de.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Jd(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 Yd(e){const t=Jd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Wt,e),We(ve.AUTHENTICATED,t)}const aP=(e,t)=>t.skipDedupe||t.method!=="GET",iP=(e,t)=>t.method+"@"+e,oP=e=>e.clone(),zu=({skip:e=aP,key:t=iP,resolver:r=oP}={})=>{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)}}},sP=(e,t)=>e*t,cP=e=>e&&e.ok,Hu=({delayTimer:e=500,delayRamp:t=sP,maxAttempts:r=10,until:n=cP,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=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var y,p;g(u((y=I&&I.url)!==null&&y!==void 0?y:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},uP="application/json",Xd="Content-Type",kt=Symbol(),qd=Symbol();function Gu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Xd.toLowerCase()))===null||t===void 0?void 0:t[1]}function Ku(e){return/^application\/.*json.*/.test(e)}const dt=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]=dt(o,i,r):n[a]=i,n},{...e})},Vt={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 lP(e,t=!1){Vt.options=t?e:dt(Vt.options,e)}function fP(e,t=!1){Vt.polyfills=t?e:dt(Vt.polyfills,e)}function dP(e){Vt.errorType=e}const hP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Qd extends Error{}const vP=e=>{const t=Object.create(null);e=e._addons.reduce((y,p)=>p.beforeRequest&&p.beforeRequest(y,e._options,t)||y,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=dt(a.options,n);let c=r;const d=hP(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,l),h=new Error,v=d.catch(y=>{throw{[kt]:y}}).then(y=>{var p;if(!y.ok){const S=new Qd;if(S.cause=h,S.stack=S.stack+`
|
|
5
|
-
CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw S;const O=a.errorType==="json"||((p=y.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(k=>{throw S.message=typeof k=="string"?k:y.statusText,k&&(O&&typeof k=="string"?(S.text=k,S.json=JSON.parse(k)):S[a.errorType]=k),S})}return y}),b=y=>y.catch(p=>{const S=Object.prototype.hasOwnProperty.call(p,kt),O=S?p[kt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||S&&f.has(kt)&&f.get(kt);if(_)return _(O,e);const k=f.get(qd);if(k)return k(O,e);throw O}),g=y=>p=>b(y?v.then(S=>S&&S[y]()).then(S=>p?p(S):S):v.then(S=>p?p(S):S)),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(y,p){return f.set(y,p),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(kt,y)}},I=u.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),T);return o.reduce((y,p)=>p(y,e),I)},pP={_url:"",_options:{},_config:Vt,_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:dt(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:dt(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:dt(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Xd]: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(qd,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=Gu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Ku(a));return n=r?o?n.json(r,a):n.body(r):n,vP(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=Gu(this._options.headers);return this.content(t||Ku(r)&&r||uP).body(JSON.stringify(e))}};function Ke(e="",t={}){return{...pP,_url:e,_options:t}}Ke.default=Ke;Ke.options=lP;Ke.errorType=dP;Ke.polyfills=fP;Ke.WretchError=Qd;function ke(){sessionStorage.removeItem(oo),console.log("Cache cleared"),We(ve.CLEAR_CACHE,{})}function uo(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function eh(e,t){if(uo(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function Wu(e){return e.endsWith("/")?e.slice(0,-1):e}function Vu(e,t){if(!uo(e)||!uo(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&Wu(r.pathname)===Wu(n.pathname)}function mP(e,t){const r=new URL(`${He("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}=eh(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("url",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}const th="sesamySignedURLs";function is(){const e=sessionStorage.getItem(th);return e?JSON.parse(e):[]}function gP(e){const t=is();t.push(e),he(`Adding signed URL: ${e}`),sessionStorage.setItem(th,JSON.stringify(t))}function yP(e){const t=He("api2",e.environment),r=$=>async(P,C)=>{let Y=sessionStorage.getItem(oo);Y||(Y=Date.now().toString(),sessionStorage.setItem(oo,Y));const W={...C,headers:{...C.headers,"Cache-Timestamp":Y}};return $(P,W)},n=($=!0)=>P=>async(C,Y)=>{let W=null;if(W=await dr($),!W){if($)throw new Error("No access token available");return P(C,Y)}const rt={...Y,headers:{...Y.headers,...W?{Authorization:`Bearer ${W}`}:{}}};return P(C,rt)},a=$=>(P,C)=>{if(C.headers.Authorization)return $(P,C);const Y=localStorage.getItem("__anon_id"),W=btoa(`${Y}:`),rt={...C,headers:{...C.headers,Authorization:`Basic ${W}`}};return $(P,rt)},i=Ke(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),zu(),Hu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),o=Ke(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,zu(),Hu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]);async function s($={}){const{waitForEntitlementAfter:P,includeSignedLinks:C=!0}=$,Y=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",W=await Rr()?await i.get(`/entitlements${Y}`).json():[];return C&&W.push(...is()),W}async function u($,P=[]){const C=await s();return C==null?void 0:C.find(W=>{const{sku:rt,purchaseOption:vs}=eh($);let da="sku"in W&&rt===W.sku;da&&vs&&"purchaseOptionId"in W&&(da=vs===W.purchaseOptionId);const Ah=Vu($,W.url),jh=P.some(Lh=>Vu(Lh,W.url));return da||Ah||jh})}async function f($){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function l($){return i.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await Rr()?await i.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return i.get("/contracts").json()}async function h($){const P=await i.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await i.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function g(){return i.get("/bills").json()}async function T($){const P=await i.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function I(){return i.get("/transactions").json()}async function y($){const P=await i.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await i.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return We(ve.USER_ATTRIBUTE_CHANGED,{}),ke(),C}async function S($){const P=await i.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return ke(),P.ok}async function O($){return(await i.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await i.url("/user-metadata").get().json()}async function k(){return await i.url("/tags").get().json()}async function M($){const P=await i.url(`/tags/${encodeURIComponent($)}`).delete().res();return ke(),P.ok}async function F($){const P=await i.url("/tags").post(encodeURIComponent($)).res();return We(ve.USER_ATTRIBUTE_CHANGED,{}),ke(),P.ok}async function X($){return(await o.url("/tallies").get().json())[$]}async function L(){return await o.url("/tallies").get().json()}async function N($){const P=await o.url(`/tallies/${$}`).delete().res();return ke(),P.ok}async function H($,P){return await o.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await i.url(`/products/${encodeURIComponent($)}`).get().json()}async function V(){return await dr(!1)?await i.url("/profile").get().json():null}async function ee($){const P=await i.url("/profile").patch($).res();return ke(),P.ok}async function Me(){return await i.url("/payment-issues").get().json()}async function m(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await dr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${He("spotify-oas",e.environment)}/sesamy-callback`);C.searchParams.set("access_token",P),C.searchParams.set("state",$),window.location.href=C.toString()}async function U($){const P=await i.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&ke(),P}async function x($,P=3600){const{shortlink:C}=await Ke(eP).post({url:$,ttl:P}).json();return C}async function D($){const P=await dr(!1);let C;const Y=$.language||so();switch($.target){case"account":C=new URL(`${He("account",e.environment)}/${encodeURIComponent($.language||Y)}/subscriptions/${encodeURIComponent(e.clientId)}`),C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"consume":C=new URL(`${He("consume",e.environment)}/${encodeURIComponent($.language||Y)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent($.sku)}`),$.episodeId?C.href+=`/${$.episodeId}`:C.href+="/listen",C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"checkout":C=mP(e,{language:Y,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?x(C.href,$.ttl):C.href}async function q($){return(await o.url("/checkouts").post({language:so(),...$,vendorId:e.clientId})).json()}async function z($,P){return(await o.url(`/checkouts/${$}`).patch(P)).json()}async function Z($){return(await o.url(`/checkouts/${$}`).get()).json()}async function B(){const $=await dr(!1),P=new URL(`${He("account",e.environment)}/subscriptions/${e.clientId}`);$&&(P.hash=`#access_token=${$}`),window.location.href=P.toString()}return{createCheckout:q,updateCheckout:z,getCheckout:Z,getEntitlements:s,getEntitlement:f,getEntitlementAccess:l,hasAccess:u,getFulfillments:c,getContracts:d,getContract:h,cancelContract:v,getProfile:V,updateProfile:ee,getSubscriptions:b,getBills:g,getBill:T,setUserMetadata:p,deleteUserMetadata:S,getUserMetadata:O,listUserMetadata:_,getTags:k,deleteTag:M,setTag:F,getTally:X,getTallies:L,deleteTally:N,pushTally:H,getTransactions:I,getTransaction:y,getProduct:R,getPaymentIssues:Me,autoOnboardProduct:U,isSpotifyLinked:m,unlinkSpotify:w,linkSpotify:E,generateLink:D,openHostedAccountPage:B}}const rh="@sesamy/sesamy-js",os="1.19.1";function Zu(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 ln="undefined",Ju="object",lo=function(){},nh="any",ah="*",pt="__",Mn=typeof process<"u"?process:{};Mn.env&&Mn.env.NODE_ENV;var te=typeof document<"u";Mn.versions!=null&&Mn.versions.node!=null;typeof Deno<"u"&&Deno.core;te&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ih(e,t){return t.charAt(0)[e]()+t.slice(1)}var wP=ih.bind(null,"toUpperCase"),bP=ih.bind(null,"toLowerCase");function SP(e){return oh(e)?wP("null"):typeof e=="object"?PP(e):Object.prototype.toString.call(e).slice(8,-1)}function Fn(e,t){t===void 0&&(t=!0);var r=SP(e);return t?bP(r):r}function Br(e,t){return typeof t===e}var ue=Br.bind(null,"function"),Qe=Br.bind(null,"string"),Ut=Br.bind(null,"undefined"),$P=Br.bind(null,"boolean");Br.bind(null,"symbol");function oh(e){return e===null}function IP(e){return Fn(e)==="number"&&!isNaN(e)}function sh(e){return Fn(e)==="array"}function ce(e){if(!TP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function TP(e){return e&&(typeof e=="object"||e!==null)}function PP(e){return ue(e.constructor)?e.constructor.name:null}function EP(e){return e instanceof Error||Qe(e.message)&&e.constructor&&IP(e.constructor.stackTraceLimit)}function ch(e,t){if(typeof t!="object"||oh(t))return!1;if(t instanceof e)return!0;var r=Fn(new e(""));if(EP(t))for(;t;){if(Fn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}ch.bind(null,TypeError);ch.bind(null,SyntaxError);function sa(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?OP(e,t):r}function OP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ca(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ca(sa,"form");ca(sa,"button");ca(sa,"input");ca(sa,"select");function kP(e){return e?sh(e)?e:[e]:[]}function Yu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function _P(){if(te){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function RP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function CP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Yu(r[1]),o=Yu(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&&(AP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return te&&window.location.search.substring(1)}())}function AP(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 ua(){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 jP(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 Tr="global",Zt=pt+"global"+pt,Jt=typeof self===Ju&&self.self===self&&self||typeof global===Ju&&global.global===global&&global||void 0;function mt(e){return Jt[Zt][e]}function gt(e,t){return Jt[Zt][e]=t}function rr(e){delete Jt[Zt][e]}function nr(e,t,r){var n;try{if(ss(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Jt[Zt]||(Jt[Zt]={});var fn={};function ss(e){if(typeof fn[e]!==ln)return fn[e];try{var t=window[e];t.setItem(ln,ln),t.removeItem(ln)}catch{return fn[e]=!1}return fn[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 Ye="function",Ge="undefined",LP="@@redux/"+Math.random().toString(36),Xu=function(){return typeof Symbol===Ye&&Symbol.observable||"@@observable"}(),dn=" != "+Ye;function uh(e,t,r){var n;if(typeof t===Ye&&typeof r===Ge&&(r=t,t=void 0),typeof r!==Ge){if(typeof r!==Ye)throw new Error("enhancer"+dn);return r(uh)(e,t)}if(typeof e!==Ye)throw new Error("reducer"+dn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==Ye)throw new Error("Listener"+dn);var v=!0;return f(),s.push(h),function(){if(v){v=!1,f();var b=s.indexOf(h);s.splice(b,1)}}}function d(h){if(!ce(h))throw new Error("Act != obj");if(typeof h.type===Ge)throw new Error("ActType "+Ge);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==Ye)throw new Error("next reducer"+dn);a=h,d({type:"@@redux/INIT"})}})[Xu]=function(){var h,v=c;return(h={subscribe:function(b){if(typeof b!="object")throw new TypeError("Observer != obj");function g(){b.next&&b.next(l())}return g(),{unsubscribe:v(g)}}})[Xu]=function(){return this},h},n}function UP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Ge}function Yt(){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 xP(){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=Yt.apply(void 0,i)(o.dispatch)})}}}var et=pt+"anon_id",ht=pt+"user_id",Dt=pt+"user_traits",Je="userId",xt="anonymousId",Pn=["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"],fo=["name","EVENTS","config","loaded"],A=Pn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),qu=/^utm_/,Qu=/^an_prop_/,el=/^an_trait_/;function NP(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(et,o.anonymousId),f||t(ht,o.userId),u.traits&&t(Dt,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,h=l.reduce(function(v,b){if(b.match(qu)||b.match(/^(d|g)clid/)){var g=b.replace(qu,"");v.campaign[g==="campaign"?"name":g]=i[b]}return b.match(Qu)&&(v.props[b.replace(Qu,"")]=i[b]),b.match(el)&&(v.traits[b.replace(el,"")]=i[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:A.campaign,campaign:h.campaign})}}return n(a)}}}}function DP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===et)return j({},t,{anonymousId:r.value});if(r.key===ht)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[ht,et,Dt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function tl(e){return{userId:e.getItem(ht),anonymousId:e.getItem(et),traits:e.getItem(Dt)}}var ho=function(e){return pt+"TEMP"+pt+e};function MP(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&&([ht,Dt,et].forEach(function(h){n(h)}),[Je,xt,"traits"].forEach(function(h){rr(ho(h))})),s.type===A.identify){a(et)||r(et,ua());var c=a(ht),d=a(Dt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ht,u),f&&r(Dt,j({},d,f))}return o(s)}}}}var gr={};function rl(e,t){gr[e]&&ue(gr[e])&&(gr[e](t),delete gr[e])}function lh(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 lh(e,t,r-10).then(n,a)})})}function FP(e){return{abort:e}}function fh(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,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,b=a[h][v];if(b&&ue(b)){var g,T=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[Je,xt].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=b({payload:T,config:o[h].config,instance:r,abort:FP}))&&ce(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var y=v+":"+h;e.dispatch(j({},T,{type:y,_:{called:y,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var $i=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(Mt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,y,p){var S=y.config,O=y.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Mt)?function(M,F,X,L,N){return function(H,R){var V=L?L.name:M,ee=R&&Cr(R)?R:X;if(L&&(!(ee=R&&Cr(R)?R:[M]).includes(M)||ee.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(ee)+" input valid");return j({},N,{abort:{reason:H,plugins:ee,caller:F,_:V}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:BP(I),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,T){var I=T.pluginName,y=T.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[I].loaded),l.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var y=T.pluginName;return Promise.resolve(g).then(function(p){function S(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[y])return Promise.resolve(t.namespaced[y].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ue(k.method)?(function(H,R){var V=ul(H);if(V&&V.name===R){var ee=ul(V.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+V.method+" "+(ee?"or "+ee.method:"")+" in "+R+" plugin insteadof "+H].join(`
|
|
6
|
-
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,N=k.pluginName,function(H,R){return j({},X,{abort:{reason:H,plugins:R||[L],caller:c,from:N||L}})}),config:il(k.pluginName,f,i),plugins:f})).then(function(H){var R=ce(H)?H:{};return Promise.resolve(j({},F,R))})):F;var X,L,N})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[y]=_});p[y]=r}();return O&&O.then?O.then(S):S()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,y){try{var p=t.exact.length===y+1,S=I.pluginName,O=i[S];return Promise.resolve(T).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),Ti(k,S))return Ii({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(Ti(_,S))return p&&Ii({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(b.hasOwnProperty(S)&&b[S]===!0)return s.dispatch({type:"queue",plugin:S,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[S],i[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:il(S,f,i),plugins:f})).then(function(F){var X=ce(F)?F:{},L=j({},_,X),N=g[S];if(Ti(N,S))Ii({data:N,method:c,instance:n,pluginName:S,store:s});else{var H=c+":"+S;(H.match(/:/g)||[]).length<2&&!c.match(nl)&&!c.match(al)&&n.dispatch(j({},d?L:k,{type:H,_:{called:H,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Mt)||c.match(/^registerPlugin/)||c.match(al)||c.match(nl)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});dh(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Mt=/Start$/,nl=/^bootstrap/,al=/^ready/;function Ii(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function il(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function ol(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function sl(e,t){var r=e.replace(Mt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Ti(e,t){var r=e.abort;return!!r&&(r===!0||cl(r,t)||r&&cl(r.plugins,t))}function dh(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Qe(r))return!0;var n=r.plugins;return Cr(r)&&r.length===t||Cr(n)&&n.length===t}function Cr(e){return Array.isArray(e)}function cl(e,t){return!(!e||!Cr(e))&&e.includes(t)}function ul(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function BP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ce(e[r])?Object.assign({},e[r]):e[r]),t},{})}function zP(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 rl(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),b=[],g=[],T=o.disabled,I=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return lh(p,function(){return S({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:A.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!fo.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(I).then(function(p){var S={plugins:b,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return fh(a,t,e)},0),Promise.resolve(function(p,S,O,_,k){try{var M=ue(S)?S():S,F=p.type,X=F.replace(Mt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),N=(V=M,(ee=L.plugins)===void 0&&(ee={}),(Me=p.options)===void 0&&(Me={}),Object.keys(V).filter(function(m){var w=Me.plugins||{};return $P(w[m])?w[m]:w.all!==!1&&(!ee[m]||ee[m].enabled!==!1)}).map(function(m){return V[m]}));F===A.initializeStart&&p.fromEnable&&(N=Object.keys(L.plugins).filter(function(m){var w=L.plugins[m];return p.plugins.includes(m)&&!w.initialized}).map(function(m){return M[m]}));var H=N.map(function(m){return m.name}),R=function(m,w,E){var U=sl(m).map(function(x){return ol(x,w)});return w.reduce(function(x,D){var q=D.name,z=sl(m,q).map(function(P){return ol(P,w)}),Z=z[0],B=z[1],$=z[2];return Z.length&&(x.beforeNS[q]=Z),B.length&&(x.duringNS[q]=B),$.length&&(x.afterNS[q]=$),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve($i({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function w(){var x=function(){if(F.match(Mt))return Promise.resolve($i({action:j({},E,{type:X+"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&&rl(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return m}):m}if(dh(m,H.length))return m;var E,U=function(){if(F!==X)return Promise.resolve($i({action:j({},m,{type:X}),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 U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var V,ee,Me}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(p){return Promise.reject(p)}}}}}function HP(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 GP=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 Yt.apply(void 0,o)(n)(a)}}}}};function KP(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=ll(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=ll(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,fl(r.plugins,!1,t));case A.enablePlugin:return j({},t,fl(r.plugins,!0,t));default:return t}}}function ll(e,t){return e.substring(t.length+1,e.length)}function fl(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function hh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var WP={last:{},history:[]};function VP(e,t){e===void 0&&(e=WP);var r=t.options,n=t.meta;if(t.type===A.track){var a=hh(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 ZP={actions:[]};function JP(e,t){e===void 0&&(e=ZP);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 vh=/#.*$/;function YP(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(vh,""):"")}var ph,mh,gh,yh,XP=function(e){if(e===void 0&&(e={}),!te)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 h=function(){if(te){for(var v,b=document.getElementsByTagName("link"),g=0;v=b[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(vh,"")}(f),c={title:r,url:l,path:YP(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},qP={last:{},history:[]};function QP(e,t){e===void 0&&(e=qP);var r=t.options;if(t.type===A.page){var n=hh(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}ph=function(){if(!te)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"}(),mh=te?document.referrer:null,gh=_P(),yh=RP();var dl={initialized:!1,sessionId:ua(),app:null,version:null,debug:!1,offline:!!te&&!navigator.onLine,os:{name:ph},userAgent:te?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:yh,locale:gh,campaign:{},referrer:mh};function eE(e,t){e===void 0&&(e=dl);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({},dl,e,{initialized:!0})}}var tE=["plugins","reducers","storage"];function rE(e,t,r){if(te){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function nE(e){var t=rE.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function wh(){return gt("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 Jt[Zt].analytics.push(o.action||o),i(o)}})}}}function hl(e){return function(){return Yt(Yt.apply(null,arguments),wh())}}function Pi(e){return e?sh(e)?e:[e]:[]}function vl(e,t,r){e===void 0&&(e={});var n,a,i=ua();return t&&(gr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ue(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 aE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,w){if(ue(w))return m.middlewares=m.middlewares.concat(w),m;if(w.NAMESPACE&&(w.name=w.NAMESPACE),!w.name)throw new Error("https://lytics.dev/errors/1");w.config||(w.config={});var E=w.EVENTS?Object.keys(w.EVENTS).map(function(D){return w.EVENTS[D]}):[];m.pluginEnabled[w.name]=!(w.enabled===!1||w.config.enabled===!1),delete w.enabled,w.methods&&(m.methods[w.name]=Object.keys(w.methods).reduce(function(D,q){var z;return D[q]=(z=w.methods[q],function(){for(var Z=Array.prototype.slice.call(arguments),B=new Array(z.length),$=0;$<Z.length;$++)B[$]=Z[$];return B[B.length]=S,z.apply({instance:S},B)}),D},{}),delete w.methods);var U=Object.keys(w).concat(E),x=new Set(m.events.concat(U));if(m.events=Array.from(x),m.pluginsArray=m.pluginsArray.concat(w),m.plugins[w.name])throw new Error(w.name+"AlreadyLoaded");return m.plugins[w.name]=w,m.plugins[w.name].loaded||(m.plugins[w.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:mt,setItem:gt,removeItem:rr},i=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ce(U)&&U[w]?U[w]:tl(m)[w]||mt(ho(w))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!fo.includes(m)}).sort(),u=new Set(s.concat(Pn).filter(function(m){return!fo.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new GP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=CP(),T=tl(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=ua());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:Pi(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:Pi(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var x=Qe(m)?m:null,D=ce(m)?m:w,q=E||{},z=S.user();gt(ho(Je),x);var Z=x||D.userId||i(Je,S,D);return Promise.resolve(new Promise(function(B){R.dispatch(j({type:A.identifyStart,userId:Z,traits:D||{},options:q,anonymousId:z.anonymousId},z.id&&z.id!==x&&{previousId:z.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var x=ce(m)?m.event:m;if(!x||!Qe(x))throw new Error("EventMissing");var D=ce(m)?m:w||{},q=ce(E)?E:{};return Promise.resolve(new Promise(function(z){R.dispatch({type:A.trackStart,event:x,properties:D,options:q,userId:i(Je,S,w),anonymousId:i(xt,S,w)},z,[w,E,U])}))}catch(z){return Promise.reject(z)}},page:function(m,w,E){try{var U=ce(m)?m:{},x=ce(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:XP(U),options:x,userId:i(Je,S,U),anonymousId:i(xt,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Je||m==="id")return i(Je,S);if(m===xt||m==="anonId")return i(xt,S);var w=S.getState("user");return m?Zu(w,m):w},reset:function(m){return new Promise(function(w){R.dispatch({type:A.resetStart},w,m)})},ready:function(m){return p&&m({plugins:y,instance:S}),S.on(A.ready,function(w){m(w),p=!0})},on:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(z){return function(Z){return function(B){return B.type.match(E)&&w({payload:B,instance:S,plugins:o}),Z(B)}}},x=function(z){return function(Z){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:o}),Z(B)}}};return d(U,hn),d(x,vn),function(){h(U,hn),h(x,vn)}}var D=m.match(E)?hn:vn,q=function(z){return function(Z){return function(B){return B.type===m&&w({payload:B,instance:S,plugins:o,abort:b}),Z(B)}}};return d(q,D),function(){return h(q,D)}},once:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var E=S.on(m,function(U){w({payload:U.payload,instance:S,plugins:o,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?Zu(w,m):Object.assign({},w)},dispatch:function(m){var w=Qe(m)?{type:m}:m;if(Pn.includes(w.type))throw new Error("reserved action "+w.type);var E=j({},w,{_:j({originalAction:w.type},m._||{})});R.dispatch(E)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(m,w,E){R.dispatch({type:A.setItemStart,key:m,value:w,options:E})},removeItem:function(m,w){R.dispatch({type:A.removeItemStart,key:m,options:w})}},setAnonymousId:function(m,w){S.storage.setItem(et,m,w)},events:{core:Pn,plugins:s}},O=n.middlewares.concat([function(m){return function(w){return function(E){return E.meta||(E.meta=vl()),w(E)}}},v(hn),zP(S,l,{all:f,plugins:s}),HP(a),NP(S),MP(S),v(vn)]),_={context:eE,user:DP(a),page:QP,track:VP,plugins:KP(l),queue:JP},k=Yt,M=Yt;if(te&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?wh():ce(typeof arguments[0])?hl():hl().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return tE.includes(E)||(w[E]=m[E]),w},{})}(e),N=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,x=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!x({config:U}),config:U},m},{}),H={context:L,user:I,plugins:N},R=uh(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var x=w[U];typeof m[x]===Ye&&(E[x]=m[x])}var D,q=Object.keys(E);try{(function(z){Object.keys(z).forEach(function(Z){var B=z[Z];if(typeof B(void 0,{type:"@@redux/INIT"})===Ge||typeof B(void 0,{type:LP})===Ge)throw new Error("reducer "+Z+" "+Ge)})})(E)}catch(z){D=z}return function(z,Z){if(z===void 0&&(z={}),D)throw D;for(var B=!1,$={},P=0;P<q.length;P++){var C=q[P],Y=z[C],W=(0,E[C])(Y,Z);if(typeof W===Ge){var rt=UP(C,Z);throw new Error(rt)}$[C]=W,B=B||W!==Y}return B?$:z}}(j({},_,t)),H,M(k(xP.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:vl(m.meta,w,Pi(E))});return X.apply(null,[U])});var V=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:V,config:L,params:g,user:I,initialUser:r,persistedUser:T});var ee=V.filter(function(m){return n.pluginEnabled[m]}),Me=V.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:V,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,w){var E=m.bootstrap,U=m.config,x=m.name;E&&ue(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:ee,disabled:Me})}),nE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return fh(m,w,E)},3e3)}(R,l,S),S}var hn="before",vn="after",Pr="cookie",ut=$h(),bh=la,iE=la;function Sh(e){return ut?la(e,"",-1):rr(e)}function $h(){if(ut!==void 0)return ut;var e="cookiecookie";try{la(e,e),ut=document.cookie.indexOf(e)!==-1,Sh(e)}catch{ut=!1}return ut}function la(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return ut===!1&&(o?gt(e,t):mt(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 Er="localStorage",oE=ss.bind(null,"localStorage");nr("localStorage","getItem",mt);nr("localStorage","setItem",gt);nr("localStorage","removeItem",rr);var Or="sessionStorage",sE=ss.bind(null,"sessionStorage");nr("sessionStorage","getItem",mt);nr("sessionStorage","setItem",gt);nr("sessionStorage","removeItem",rr);function Ft(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ce(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var cE=oE(),uE=sE(),lE=$h();function Ih(e,t){if(e){var r=cs(t),n=!ds(r),a=us(r)?Ft(localStorage.getItem(e)):void 0;if(n&&!Ut(a))return a;var i=ls(r)?Ft(bh(e)):void 0;if(n&&i)return i;var o=fs(r)?Ft(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=mt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function fE(e,t,r){if(e&&!Ut(t)){var n={},a=cs(r),i=JSON.stringify(t),o=!ds(a);return us(a)&&(n[Er]=pn(Er,t,Ft(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Er]:ls(a)&&(n[Pr]=pn(Pr,t,Ft(bh(e))),iE(e,i),o)?n[Pr]:fs(a)&&(n[Or]=pn(Or,t,Ft(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Or]:(n[Tr]=pn(Tr,t,mt(e)),gt(e,t),o?n[Tr]:n)}}function dE(e,t){if(e){var r=cs(t),n=Ih(e,ah),a={};return!Ut(n.localStorage)&&us(r)&&(localStorage.removeItem(e),a[Er]=n.localStorage),!Ut(n.cookie)&&ls(r)&&(Sh(e),a[Pr]=n.cookie),!Ut(n.sessionStorage)&&fs(r)&&(sessionStorage.removeItem(e),a[Or]=n.sessionStorage),!Ut(n.global)&&fa(r,Tr)&&(rr(e),a[Tr]=n.global),a}}function cs(e){return e?Qe(e)?e:e.storage:nh}function us(e){return cE&&fa(e,Er)}function ls(e){return lE&&fa(e,Pr)}function fs(e){return uE&&fa(e,Or)}function ds(e){return e===ah||e==="all"}function fa(e,t){return e===nh||e===t||ds(e)}function pn(e,t,r){return{location:e,current:t,previous:r}}var hE={setItem:fE,getItem:Ih,removeItem:dE};function vE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pl(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 ml(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pl(Object(r),!0).forEach(function(n){vE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:hE};return aE(ml(ml({},t),e))}function mE(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 gE(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=wE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function yE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function wE(e){return["#","?"].forEach(t=>e=yE(e,t)),e}function bE(){gE(()=>{ze.page()})}function SE(e){if(e===void 0&&(e={}),!te)return lo;var t=yl(),r=vo(),n=gl(),a=mn(n,t),i=mn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return lo;var h=d.map(function(b){return Number(b)}),v=jP(function(){var b=yl(),g=function(L,N){return N.map(function(H){return H===100?L-5:L*(H/100)})}(b,h),T=vo(),I=gl(),y=mn(I,b),p=mn(T,b);if(l=y>l?y:l,c=p<c?p:c,!(o.length>=h.length)){var S=f===I,O="up";S?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,N,H){var R=_[H];return u.includes(N)&&I<=R&&(u=u.filter(function(V){return V!==N}),L.singleFunction=N),O==="down"&&!o.includes(N)&&I>=R&&N>i?(s.push(N),L.callbacks=L.callbacks.concat(N),L):O==="up"&&!o.includes(N)&&I<=R&&N<=y?(L.foundFunc=[N],L):(S&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[N]),!s.includes(N)&&I>=R&&(s.push(N),L.singleFunction?u.push(N):L.singleFunction=N),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ue(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;ue(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function vo(){return te?document.body.scrollTop||document.documentElement.scrollTop:0}function $E(){return te?window.innerHeight||document.documentElement.clientHeight:0}function gl(){return Math.round(vo()+$E())}function yl(){if(!te)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function mn(e,t){return Math.round(e/t*100)}var wl="EventListener";function IE(e){return function(t,r,n,a){var i=n||lo,o=a||!1;if(!te)return i;var s=Bn(r),u=Bn(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"+wl:"remove"+wl,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?TE(i):i:f[h]||i;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],o)}return l.bind(null,!c)}(e)}}function Bn(e,t){if(Qe(e))return t?Bn(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=kP(e);return t?i.map(function(o){return Qe(o)?Bn(o,!0):o}).flat():i}function TE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ei=IE("Event");function Th(e,t){return te&&ue(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ue(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}Th.bind(null,"onerror");Th.bind(null,"onload");var Ph=typeof window>"u",bl="hidden";function PE(e){if(Ph)return!1;var t=EE(),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 EE(){var e=["webkit","moz","ms","o"];return Ph||bl in document?bl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var OE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function kE(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=PE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(OE.map(function(s){return Ei(document,s,r)})).concat(Ei(window,"load",r)).concat(Ei(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function _E(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,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(hr(d),g),a&&l&&(l=!1,a(hr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(hr(d),g))},s)}var b=kE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:hr(d,c),idle:l?hr(r,c):0}}}}function hr(e,t){return t?0:Math.round((new Date-e)/1e3)}const Sl=5e3;class RE{constructor(t){pe(this,"element");pe(this,"isInViewport",!1);pe(this,"isAwake",!1);pe(this,"isFlushing");pe(this,"observer");pe(this,"lastEventAt",Date.now());pe(this,"registeredView",!1);pe(this,"viewCallback");pe(this,"activeDurationCallback");pe(this,"idleDurationCallback");pe(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),_E({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Sl}),SE({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*Sl: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 $l="sesamy_session_id";function CE(){let e=sessionStorage.getItem($l);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem($l,e)),e}let Eh=!1,po,Il,zn;const Oh=new Map;function AE({clientId:e,enabled:t=!0,environment:r}){if(po=e,Il=t,zn=`${He("logs",r)}/events`,!Il)return;window.addEventListener("beforeunload",()=>{_h.forEach((a,i)=>{a.bind(i)()}),LE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Oh.forEach((a,i)=>{a.bind(i)()})}),bE();const n=new RE({element:document.body,viewCallback:()=>{ze.page()},activeDurationCallback:(a,i,o)=>{ze.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{ze.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{ze.track("scroll",{scroll:a.scrollMax})}});UE(document.body,()=>{n.flush()}),xE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ve.AUTHENTICATED,async a=>{const i=a;await ze.identify(i.detail.sub)}),window.addEventListener(ve.LOGOUT,async()=>{await ze.track("logout",{}),hs.flush(),await ze.reset()})}function kh(e){return JSON.stringify(e.map(t=>({...t,clientId:po,requestId:Math.random().toString(36).slice(2,9),sessionId:CE(),timestamp:new Date().toISOString(),version:os,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:rh,userAgent:navigator.userAgent,clientId:po}})))}const hs=mE(async e=>{if(e.length>0){const t=kh(e);Eh?navigator.sendBeacon(zn,t):(await fetch(zn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Oi(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(zn,kh([r]))}else hs.push(e)}const ze=pE({app:rh,version:os,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Oi({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Oi({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Oi({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function jE(e,t){ze.track(e,t)}function LE(){return Eh=!0,hs.flush()}const _h=new Map;function UE(e,t){_h.set(e,t)}function xE(e,t){Oh.set(e,t)}const NE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function DE(){return new Promise(e=>{const t=NE.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 ME(){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}}let Oe={article:{selector:"article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"article",attribute:"data-price"},currency:{selector:"article",attribute:"data-currency"},url:{selector:"link",attribute:"href"},id:{selector:"article",attribute:"data-id"}};function FE(e){var t;Oe={...Oe,...(t=e.content)==null?void 0:t.article}}function BE(e,t){const{selector:r}=t;return r===Oe.article.selector?e:e.querySelector(r)}function zE(e,t){if(e)return t.attribute?t.attribute==="textContent"?e.textContent??void 0:e.getAttribute(t.attribute)??void 0:e.textContent??void 0}function HE(){const e=document.querySelectorAll(Oe.article.selector);return Array.from(e).map(t=>{const r={element:t},n=(a,i,o)=>{const s=BE(t,i);if(s){const u=zE(s,i);u!==void 0&&(r[a]=o?o(u):u)}};return n("title",Oe.title),n("excerpt",Oe.excerpt),n("image",Oe.image),n("price",Oe.price,a=>parseFloat(a)),n("currency",Oe.currency),n("url",Oe.url),n("id",Oe.id),r})}function GE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getFulfillments:s,getSubscriptions:u,getContract:f,getContracts:l,cancelContract:c,getBill:d,getBills:h,getTransaction:v,getTransactions:b,getProfile:g,updateProfile:T,getTags:I,deleteTag:y,setTag:p,getUserMetadata:S,listUserMetadata:O,setUserMetadata:_,deleteUserMetadata:k,getTally:M,getTallies:F,pushTally:X,deleteTally:L,getProduct:N,getPaymentIssues:H,isSpotifyLinked:R,unlinkSpotify:V,linkSpotify:ee,autoOnboardProduct:Me,openHostedAccountPage:m,generateLink:w,hasAccess:E}=yP(e),U={auth:{getUser:g,isAuthenticated:Rr,loginWithRedirect:as,logout:Zd,setToken:Yd},checkouts:{get:r,create:t,update:n},profile:{get:g,update:T,openHostedAccountPage:m,isSpotifyLinked:R,unlinkSpotify:V},analytics:{track:jE},content:{list:HE},tags:{list:I,set:p,delete:y},entitlements:{get:a,list:i,hasAccess:E,access:o,signedLinks:is},fulfillments:{list:s},contracts:{get:f,list:l,cancel:c},bills:{get:d,list:h},userMetadata:{get:S,list:O,set:_,delete:k},tallies:{get:M,list:F,push:X,delete:L},subscriptions:{list:u},transactions:{get:v,list:b},products:{get:N,autoOnboard:Me,linkSpotify:ee},browser:{detectAdblock:DE,isInAppBrowser:ME},getVersion:KE,getPaymentIssues:H,generateLink:w,clearCache:ke,log:he};return e.namespace&&(window[e.namespace]=U),U}function KE(){return os}function WE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
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",!Bu(r))throw new Error(`Invalid cache location "${r}"`);n=Bu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?jt:ZT,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:JT;var i;this.scope=dn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new KT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Fd,this.cacheManager=new HT(n,n.allKeys?void 0:new qT(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 XT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Md)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${oo(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return WT({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=Nu(wi()),i=Nu(wi()),o=wi(),s=(l=>{const c=new Uint8Array(l);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,v=>h[v])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await On().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,h,v,b,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:dn(c,d.scope),response_type:"code",response_mode:T||"query",state:h,nonce:v,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 UT(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new LT(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),h.data.response.error)return f(le.fromPayload(h.data.response));u(h.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 le("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=zu(t),{openUrl:a,fragment:i,appState:o}=n,s=xe(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=xe(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 le("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new jT(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new le("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:dn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=Si[o];return s||(s=i().finally(()=>{delete Si[o],s=null}),Si[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=xe(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})(()=>$i.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new io;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 $i.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:dn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},AT),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new ft({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=xe(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${oo(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=zu(t),{openUrl:n}=r,a=xe(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 le("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((v,b,g=60)=>new Promise((T,I)=>{const y=window.document.createElement("iframe");y.setAttribute("width","0"),y.setAttribute("height","0"),y.style.display="none";const p=()=>{window.document.body.contains(y)&&(window.document.body.removeChild(y),window.removeEventListener("message",S,!1))};let S;const O=setTimeout(()=>{I(new io),p()},1e3*g);S=function(_){if(_.origin!=b||!_.data||_.data.type!=="authorization_response")return;const k=_.source;k&&k.close(),_.data.response.error?I(le.fromPayload(_.data.response)):T(_.data.response),clearTimeout(O),window.removeEventListener("message",S,!1),setTimeout(p,2e3)},window.addEventListener("message",S,!1),window.document.body.appendChild(y),y.setAttribute("src",v)}))(a,this.domainUrl,c);if(i!==d.state)throw new le("state_mismatch","Invalid state");const h=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({},h),{scope:f,oauthTokenScope:h.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 ft({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 Wd(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=xe(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 ft({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 ft({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 BT(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 tP(e){const t=new eP(e);return await t.checkSession(),t}var ve=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(ve||{});const rP="sesamy.com",nP="sesamy.dev",aP="https://sesa.my",co="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?nP:rP}`}function uo(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}let de,Xd,lo=!1,Hu=!1;const Zt="sesamyAccessToken",Ii="sesamyRefreshToken";async function Hr(){return lo?!0:new Promise((e,t)=>{const r=setTimeout(()=>{lo?e(!0):t(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(ve.AUTH_INITIALIZED,()=>{clearTimeout(r),e(!0)})})}async function iP(e){if(!e)return null;const t=localStorage.getItem(Ii);if(!t)return he("No refresh token found in localstorage"),null;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(Ii),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Ii,i.refresh_token),localStorage.setItem(Zt,i.access_token),i.access_token}catch{qd()}}async function os(){const e=localStorage.getItem(Zt);if(!e)return null;const t=Qd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await iP(t);if(r)return r;localStorage.removeItem(Zt)}return e}function Ku(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 oP(e){if(e.enabled===!1)return;Xd=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Ku(window.location.href)!==Ku(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),de=await tP(t),window.location.search.includes("code="))try{await de.handleRedirectCallback();const r=await de.getUser();if(!r)throw new Error("No user found");Ve(ve.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){alert("There was an error logging in"),console.error(r)}lo=!0,Ve(ve.AUTH_INITIALIZED,{})}async function jr(){return await Hr(),await os()?!0:de?de.isAuthenticated():!1}async function sP(){return await Hr(),await os()?(he("Using local user"),{sub:"local",name:"Local User"}):de?de.getUser():null}async function ss(e){if(Hu){he("Login already in progress");return}if(Hu=!0,await Hr(),localStorage.removeItem(Zt),!de)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return de.loginWithRedirect({...e,authorizationParams:{organization:Xd,redirect_uri:window.location.href,ui_locales:uo(),...t}})}async function pr(e=!0){await Hr();const t=await os();if(t)return t;try{return de?await de.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function qd(e={}){if(await Hr(),localStorage.removeItem(Zt),Ve(ve.LOGOUT,{}),!!de)return de.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Qd(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 eh(e){const t=Qd(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(Zt,e),Ve(ve.AUTHENTICATED,t)}const cP=(e,t)=>t.skipDedupe||t.method!=="GET",uP=(e,t)=>t.method+"@"+e,lP=e=>e.clone(),Gu=({skip:e=cP,key:t=uP,resolver:r=lP}={})=>{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)}}},fP=(e,t)=>e*t,dP=e=>e&&e.ok,Wu=({delayTimer:e=500,delayRamp:t=fP,maxAttempts:r=10,until:n=dP,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=(h,v)=>Promise.resolve(n(h,v)).then(b=>b?h&&o?h:v?Promise.reject(v):h:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:v,url:f,options:l})).then((I={})=>{var y,p;g(u((y=I&&I.url)!==null&&y!==void 0?y:f,(p=I&&I.options)!==null&&p!==void 0?p:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},hP="application/json",th="Content-Type",Rt=Symbol(),rh=Symbol();function Vu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===th.toLowerCase()))===null||t===void 0?void 0:t[1]}function Zu(e){return/^application\/.*json.*/.test(e)}const ht=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]=ht(o,i,r):n[a]=i,n},{...e})},Jt={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 vP(e,t=!1){Jt.options=t?e:ht(Jt.options,e)}function pP(e,t=!1){Jt.polyfills=t?e:ht(Jt.polyfills,e)}function mP(e){Jt.errorType=e}const gP=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class nh extends Error{}const yP=e=>{const t=Object.create(null);e=e._addons.reduce((y,p)=>p.beforeRequest&&p.beforeRequest(y,e._options,t)||y,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=ht(a.options,n);let c=r;const d=gP(s)((y,p)=>(c=y,a.polyfill("fetch")(y,p)))(r,l),h=new Error,v=d.catch(y=>{throw{[Rt]:y}}).then(y=>{var p;if(!y.ok){const S=new nh;if(S.cause=h,S.stack=S.stack+`
|
|
5
|
+
CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw S;const O=a.errorType==="json"||((p=y.headers.get("Content-Type"))===null||p===void 0?void 0:p.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(k=>{throw S.message=typeof k=="string"?k:y.statusText,k&&(O&&typeof k=="string"?(S.text=k,S.json=JSON.parse(k)):S[a.errorType]=k),S})}return y}),b=y=>y.catch(p=>{const S=Object.prototype.hasOwnProperty.call(p,Rt),O=S?p[Rt]:p,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||S&&f.has(Rt)&&f.get(Rt);if(_)return _(O,e);const k=f.get(rh);if(k)return k(O,e);throw O}),g=y=>p=>b(y?v.then(S=>S&&S[y]()).then(S=>p?p(S):S):v.then(S=>p?p(S):S)),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(y,p){return f.set(y,p),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(Rt,y)}},I=u.reduce((y,p)=>({...y,...typeof p.resolver=="function"?p.resolver(y):p.resolver}),T);return o.reduce((y,p)=>p(y,e),I)},wP={_url:"",_options:{},_config:Jt,_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:ht(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:ht(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:ht(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[th]: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(rh,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=Vu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Zu(a));return n=r?o?n.json(r,a):n.body(r):n,yP(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=Vu(this._options.headers);return this.content(t||Zu(r)&&r||hP).body(JSON.stringify(e))}};function We(e="",t={}){return{...wP,_url:e,_options:t}}We.default=We;We.options=vP;We.errorType=mP;We.polyfills=pP;We.WretchError=nh;function _e(){sessionStorage.removeItem(co),console.log("Cache cleared"),Ve(ve.CLEAR_CACHE,{})}function fo(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function ah(e,t){if(fo(e))return{itemSrc:e};const[r,n,a]=e.split(":");return{sku:`${r}:${n}`,purchaseOption:t||a}}function Ju(e){return e.endsWith("/")?e.slice(0,-1):e}function Yu(e,t){if(!fo(e)||!fo(t))return!1;const r=new URL(e),n=new URL(t);return r.origin===n.origin&&Ju(r.pathname)===Ju(n.pathname)}function bP(e,t){const r=new URL(`${Ke("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}=ah(t.itemSrc,t.purchaseOptionId);u&&r.searchParams.set("url",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}const ih="sesamySignedURLs";function cs(){const e=sessionStorage.getItem(ih);return e?JSON.parse(e):[]}function SP(e){const t=cs();t.push(e),he(`Adding signed URL: ${e}`),sessionStorage.setItem(ih,JSON.stringify(t))}const ho="sesamyAttribution";function $P(e){const t=sessionStorage.getItem(e);if(!t)return null;try{return JSON.parse(t).value}catch{return console.error(`Failed to parse ${e}`),null}}function us(){return $P(ho)||{}}function IP(e){if(e===null)sessionStorage.removeItem(ho);else{const t=us()??{};sessionStorage.setItem(ho,JSON.stringify({value:{...t,...e}}))}}function TP(e){const t=Ke("api2",e.environment),r=$=>async(P,C)=>{let W=sessionStorage.getItem(co);W||(W=Date.now().toString(),sessionStorage.setItem(co,W));const V={...C,headers:{...C.headers,"Cache-Timestamp":W}};return $(P,V)},n=($=!0)=>P=>async(C,W)=>{let V=null;if(V=await pr($),!V){if($)throw new Error("No access token available");return P(C,W)}const Je={...W,headers:{...W.headers,...V?{Authorization:`Bearer ${V}`}:{}}};return P(C,Je)},a=$=>(P,C)=>{if(C.headers.Authorization)return $(P,C);const W=localStorage.getItem("__anon_id"),V=btoa(`${e.clientId}|${W}:`),Je={...C,headers:{...C.headers,Authorization:`Basic ${V}`}};return $(P,Je)},i=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Gu(),Wu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]),o=We(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Gu(),Wu({delayTimer:1e3,delayRamp:($,P)=>$*P,maxAttempts:3,until:$=>!!($&&($.ok||$.status>=400&&$.status<500)),retryOnNetworkError:!1})]);async function s($={}){const{waitForEntitlementAfter:P,includeSignedLinks:C=!0}=$,W=P?`?wait-for-entitlement-after=${P.toISOString()}`:"",V=await jr()?await i.get(`/entitlements${W}`).json():[];return C&&V.push(...cs()),V}async function u($,P=[]){const C=await s();return C==null?void 0:C.find(V=>{const{sku:Je,purchaseOption:It}=ah($);let or="sku"in V&&Je===V.sku;or&&It&&"purchaseOptionId"in V&&(or=It===V.purchaseOptionId);const Nh=Yu($,V.url),xh=P.some(Dh=>Yu(Dh,V.url));return or||Nh||xh})}async function f($){const P=await i.get("/entitlements").json();return P==null?void 0:P.find(C=>C.id===$)}async function l($){return i.get(`/entitlements/${encodeURIComponent($)}/access`).json()}async function c($){return await jr()?await i.get(`/fulfillments?sku=${encodeURIComponent($)}`).json():[]}async function d(){return i.get("/contracts").json()}async function h($){const P=await i.get("/contracts").json();return P==null?void 0:P.find(C=>C.id===$)}async function v($){return(await i.post({},`/contracts/${encodeURIComponent($)}/cancel`).res()).ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function g(){return i.get("/bills").json()}async function T($){const P=await i.get("/bills").json();return P==null?void 0:P.find(C=>C.id===$)}async function I(){return i.get("/transactions").json()}async function y($){const P=await i.get("/transactions").json();return P==null?void 0:P.find(C=>C.id===$)}async function p($,P){const C=await i.url(`/user-metadata/${encodeURIComponent($)}`).put(P).json();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),C}async function S($){const P=await i.url(`/user-metadata/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function O($){return(await i.url(`/user-metadata/${encodeURIComponent($)}`).get().json())[$]}async function _(){return await i.url("/user-metadata").get().json()}async function k(){return await i.url("/tags").get().json()}async function M($){const P=await i.url(`/tags/${encodeURIComponent($)}`).delete().res();return _e(),P.ok}async function F($){const P=await i.url("/tags").post(encodeURIComponent($)).res();return Ve(ve.USER_ATTRIBUTE_CHANGED,{}),_e(),P.ok}async function X($){return(await o.url("/tallies").get().json())[$]}async function L(){return await o.url("/tallies").get().json()}async function x($){const P=await o.url(`/tallies/${$}`).delete().res();return _e(),P.ok}async function H($,P){return await o.url(`/tallies/${encodeURIComponent($)}/push`).post(P).json()}async function R($){return await i.url(`/products/${encodeURIComponent($)}`).get().json()}async function Z(){return await pr(!1)?await i.url("/profile").get().json():null}async function ee($){const P=await i.url("/profile").patch($).res();return _e(),P.ok}async function Fe(){return await i.url("/payment-issues").get().json()}async function m(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function w(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function E($){const P=await pr(!1);if(!P)throw new Error("No access token available");const C=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);C.searchParams.set("access_token",P),C.searchParams.set("state",$),window.location.href=C.toString()}async function U($){const P=await i.url(`/products/${encodeURIComponent($)}/auto-onboard`).post().json();return P.length&&_e(),P}async function N($,P=3600){const{shortlink:C}=await We(aP).post({url:$,ttl:P}).json();return C}async function D($){const P=await pr(!1);let C;const W=$.language||uo();switch($.target){case"account":C=new URL(`${Ke("account",e.environment)}/${encodeURIComponent($.language||W)}/subscriptions/${encodeURIComponent(e.clientId)}`),C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"consume":C=new URL(`${Ke("consume",e.environment)}/${encodeURIComponent($.language||W)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent($.sku)}`),$.episodeId?C.href+=`/${$.episodeId}`:C.href+="/listen",C.searchParams.set("sesamy-redirect-url",$.redirectUrl||window.location.href);break;case"checkout":C=bP(e,{language:W,...$});break;default:throw new Error("Invalid target")}return P&&(C.hash=`#access_token=${P}`),$.shorten?N(C.href,$.ttl):C.href}async function q($){const P=us(),C=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(V=>{const Je=P,[It,or]=V.trim().split("=");C.includes(It)&&!Je[It]&&(Je[It]=or)}),(await o.url("/checkouts").post({language:uo(),attribution:{...P,...$.attribution},...$,vendorId:e.clientId})).json()}async function z($,P){return(await o.url(`/checkouts/${$}`).patch(P)).json()}async function J($){return(await o.url(`/checkouts/${$}`).get()).json()}async function B($){return(await o.url(`/paywalls/${$}`).get()).json()}async function pe(){const $=await pr(!1),P=new URL(`${Ke("account",e.environment)}/subscriptions/${e.clientId}`);$&&(P.hash=`#access_token=${$}`),window.location.href=P.toString()}return{createCheckout:q,updateCheckout:z,getCheckout:J,getEntitlements:s,getEntitlement:f,getEntitlementAccess:l,hasAccess:u,getFulfillments:c,getContracts:d,getContract:h,cancelContract:v,getProfile:Z,updateProfile:ee,getSubscriptions:b,getBills:g,getBill:T,setUserMetadata:p,deleteUserMetadata:S,getUserMetadata:O,listUserMetadata:_,getTags:k,deleteTag:M,setTag:F,getTally:X,getTallies:L,deleteTally:x,pushTally:H,getTransactions:I,getTransaction:y,getProduct:R,getPaymentIssues:Fe,autoOnboardProduct:U,isSpotifyLinked:m,unlinkSpotify:w,linkSpotify:E,generateLink:D,getPaywall:B,openHostedAccountPage:pe}}const oh="@sesamy/sesamy-js",ls="1.19.1";function Xu(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 hn="undefined",qu="object",vo=function(){},sh="any",ch="*",mt="__",zn=typeof process<"u"?process:{};zn.env&&zn.env.NODE_ENV;var te=typeof document<"u";zn.versions!=null&&zn.versions.node!=null;typeof Deno<"u"&&Deno.core;te&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function uh(e,t){return t.charAt(0)[e]()+t.slice(1)}var PP=uh.bind(null,"toUpperCase"),EP=uh.bind(null,"toLowerCase");function OP(e){return lh(e)?PP("null"):typeof e=="object"?CP(e):Object.prototype.toString.call(e).slice(8,-1)}function Hn(e,t){t===void 0&&(t=!0);var r=OP(e);return t?EP(r):r}function Kr(e,t){return typeof t===e}var ue=Kr.bind(null,"function"),tt=Kr.bind(null,"string"),xt=Kr.bind(null,"undefined"),kP=Kr.bind(null,"boolean");Kr.bind(null,"symbol");function lh(e){return e===null}function _P(e){return Hn(e)==="number"&&!isNaN(e)}function fh(e){return Hn(e)==="array"}function ce(e){if(!RP(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function RP(e){return e&&(typeof e=="object"||e!==null)}function CP(e){return ue(e.constructor)?e.constructor.name:null}function AP(e){return e instanceof Error||tt(e.message)&&e.constructor&&_P(e.constructor.stackTraceLimit)}function dh(e,t){if(typeof t!="object"||lh(t))return!1;if(t instanceof e)return!0;var r=Hn(new e(""));if(AP(t))for(;t;){if(Hn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}dh.bind(null,TypeError);dh.bind(null,SyntaxError);function la(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?jP(e,t):r}function jP(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function fa(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}fa(la,"form");fa(la,"button");fa(la,"input");fa(la,"select");function LP(e){return e?fh(e)?e:[e]:[]}function Qu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function UP(){if(te){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function NP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function xP(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Qu(r[1]),o=Qu(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&&(DP(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return te&&window.location.search.substring(1)}())}function DP(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 da(){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 MP(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 Or="global",Yt=mt+"global"+mt,Xt=typeof self===qu&&self.self===self&&self||typeof global===qu&&global.global===global&&global||void 0;function gt(e){return Xt[Yt][e]}function yt(e,t){return Xt[Yt][e]=t}function ar(e){delete Xt[Yt][e]}function ir(e,t,r){var n;try{if(fs(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Xt[Yt]||(Xt[Yt]={});var vn={};function fs(e){if(typeof vn[e]!==hn)return vn[e];try{var t=window[e];t.setItem(hn,hn),t.removeItem(hn)}catch{return vn[e]=!1}return vn[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 qe="function",Ge="undefined",FP="@@redux/"+Math.random().toString(36),el=function(){return typeof Symbol===qe&&Symbol.observable||"@@observable"}(),pn=" != "+qe;function hh(e,t,r){var n;if(typeof t===qe&&typeof r===Ge&&(r=t,t=void 0),typeof r!==Ge){if(typeof r!==qe)throw new Error("enhancer"+pn);return r(hh)(e,t)}if(typeof e!==qe)throw new Error("reducer"+pn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(h){if(typeof h!==qe)throw new Error("Listener"+pn);var v=!0;return f(),s.push(h),function(){if(v){v=!1,f();var b=s.indexOf(h);s.splice(b,1)}}}function d(h){if(!ce(h))throw new Error("Act != obj");if(typeof h.type===Ge)throw new Error("ActType "+Ge);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,h)}finally{u=!1}for(var v=o=s,b=0;b<v.length;b++)(0,v[b])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(h){if(typeof h!==qe)throw new Error("next reducer"+pn);a=h,d({type:"@@redux/INIT"})}})[el]=function(){var h,v=c;return(h={subscribe:function(b){if(typeof b!="object")throw new TypeError("Observer != obj");function g(){b.next&&b.next(l())}return g(),{unsubscribe:v(g)}}})[el]=function(){return this},h},n}function BP(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Ge}function qt(){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 zP(){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=qt.apply(void 0,i)(o.dispatch)})}}}var rt=mt+"anon_id",vt=mt+"user_id",Ft=mt+"user_traits",Xe="userId",Dt="anonymousId",kn=["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"],po=["name","EVENTS","config","loaded"],A=kn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),tl=/^utm_/,rl=/^an_prop_/,nl=/^an_trait_/;function HP(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(rt,o.anonymousId),f||t(vt,o.userId),u.traits&&t(Ft,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,h=l.reduce(function(v,b){if(b.match(tl)||b.match(/^(d|g)clid/)){var g=b.replace(tl,"");v.campaign[g==="campaign"?"name":g]=i[b]}return b.match(rl)&&(v.props[b.replace(rl,"")]=i[b]),b.match(nl)&&(v.traits[b.replace(nl,"")]=i[b]),v},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},h,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:A.campaign,campaign:h.campaign})}}return n(a)}}}}function KP(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===rt)return j({},t,{anonymousId:r.value});if(r.key===vt)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[vt,rt,Ft].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function al(e){return{userId:e.getItem(vt),anonymousId:e.getItem(rt),traits:e.getItem(Ft)}}var mo=function(e){return mt+"TEMP"+mt+e};function GP(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&&([vt,Ft,rt].forEach(function(h){n(h)}),[Xe,Dt,"traits"].forEach(function(h){ar(mo(h))})),s.type===A.identify){a(rt)||r(rt,da());var c=a(vt),d=a(Ft)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(vt,u),f&&r(Ft,j({},d,f))}return o(s)}}}}var br={};function il(e,t){br[e]&&ue(br[e])&&(br[e](t),delete br[e])}function vh(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 vh(e,t,r-10).then(n,a)})})}function WP(e){return{abort:e}}function ph(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,h){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(h)):(c.requeue.push(d),c.requeueIndex.push(h)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],h=d.plugin,v=d.payload.type,b=a[h][v];if(b&&ue(b)){var g,T=function(p,S){return p===void 0&&(p={}),S===void 0&&(S={}),[Xe,Dt].reduce(function(O,_){return p.hasOwnProperty(_)&&S[_]&&S[_]!==p[_]&&(O[_]=S[_]),O},p)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=b({payload:T,config:o[h].config,instance:r,abort:WP}))&&ce(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var y=v+":"+h;e.dispatch(j({},T,{type:y,_:{called:y,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var Ti=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(Bt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var v=function(g,T){return function(I,y,p){var S=y.config,O=y.name,_=O+"."+I.type;p&&(_=p.event);var k=I.type.match(Bt)?function(M,F,X,L,x){return function(H,R){var Z=L?L.name:M,ee=R&&Lr(R)?R:X;if(L&&(!(ee=R&&Lr(R)?R:[M]).includes(M)||ee.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(ee)+" input valid");return j({},x,{abort:{reason:H,plugins:ee,caller:F,_:Z}})}}(O,_,T,p,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:VP(I),instance:g,config:S||{},abort:k}}}(n,h),b=t.exact.reduce(function(g,T){var I=T.pluginName,y=T.methodName,p=!1;return y.match(/^initialize/)||y.match(/^reset/)||(p=!f[I].loaded),l.offline&&y.match(/^(page|track|identify)/)&&(p=!0),g[""+I]=p,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var y=T.pluginName;return Promise.resolve(g).then(function(p){function S(){return Promise.resolve(p)}var O=function(){if(t.namespaced&&t.namespaced[y])return Promise.resolve(t.namespaced[y].reduce(function(_,k,M){try{return Promise.resolve(_).then(function(F){return k.method&&ue(k.method)?(function(H,R){var Z=dl(H);if(Z&&Z.name===R){var ee=dl(Z.method);throw new Error([R+" plugin is calling method "+H,"Plugins cant call self","Use "+Z.method+" "+(ee?"or "+ee.method:"")+" in "+R+" plugin insteadof "+H].join(`
|
|
6
|
+
`))}}(k.methodName,k.pluginName),Promise.resolve(k.method({payload:F,instance:n,abort:(X=F,L=y,x=k.pluginName,function(H,R){return j({},X,{abort:{reason:H,plugins:R||[L],caller:c,from:x||L}})}),config:cl(k.pluginName,f,i),plugins:f})).then(function(H){var R=ce(H)?H:{};return Promise.resolve(j({},F,R))})):F;var X,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){p[y]=_});p[y]=r}();return O&&O.then?O.then(S):S()})}catch(p){return Promise.reject(p)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,y){try{var p=t.exact.length===y+1,S=I.pluginName,O=i[S];return Promise.resolve(T).then(function(_){var k=g[S]?g[S]:{};if(d&&(k=_),Ei(k,S))return Pi({data:k,method:c,instance:n,pluginName:S,store:s}),Promise.resolve(_);if(Ei(_,S))return p&&Pi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(b.hasOwnProperty(S)&&b[S]===!0)return s.dispatch({type:"queue",plugin:S,payload:k,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=v(g[S],i[S]);return Promise.resolve(O[c]({abort:M.abort,payload:k,instance:n,config:cl(S,f,i),plugins:f})).then(function(F){var X=ce(F)?F:{},L=j({},_,X),x=g[S];if(Ei(x,S))Pi({data:x,method:c,instance:n,pluginName:S,store:s});else{var H=c+":"+S;(H.match(/:/g)||[]).length<2&&!c.match(ol)&&!c.match(sl)&&n.dispatch(j({},d?L:k,{type:H,_:{called:H,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Bt)||c.match(/^registerPlugin/)||c.match(sl)||c.match(ol)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});mh(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Bt=/Start$/,ol=/^bootstrap/,sl=/^ready/;function Pi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function cl(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function ul(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function ll(e,t){var r=e.replace(Bt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Ei(e,t){var r=e.abort;return!!r&&(r===!0||fl(r,t)||r&&fl(r.plugins,t))}function mh(e,t){var r=e.abort;if(!r)return!1;if(r===!0||tt(r))return!0;var n=r.plugins;return Lr(r)&&r.length===t||Lr(n)&&n.length===t}function Lr(e){return Array.isArray(e)}function fl(e,t){return!(!e||!Lr(e))&&e.includes(t)}function dl(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function VP(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ce(e[r])?Object.assign({},e[r]):e[r]),t},{})}function ZP(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 il(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),h=Object.keys(d),v=h.filter(function(p){return l.includes(p)}).map(function(p){return d[p]}),b=[],g=[],T=o.disabled,I=v.map(function(p){var S=p.loaded,O=p.name,_=p.config;return vh(p,function(){return S({config:_})},1e4).then(function(k){return n[O]||(a.dispatch({type:A.pluginReadyType(O),name:O,events:Object.keys(p).filter(function(M){return!po.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(I).then(function(p){var S={plugins:b,failed:g,disabled:T};setTimeout(function(){h.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},S))},0)})}var y=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return ph(a,t,e)},0),Promise.resolve(function(p,S,O,_,k){try{var M=ue(S)?S():S,F=p.type,X=F.replace(Bt,"");if(p._&&p._.called)return Promise.resolve(p);var L=O.getState(),x=(Z=M,(ee=L.plugins)===void 0&&(ee={}),(Fe=p.options)===void 0&&(Fe={}),Object.keys(Z).filter(function(m){var w=Fe.plugins||{};return kP(w[m])?w[m]:w.all!==!1&&(!ee[m]||ee[m].enabled!==!1)}).map(function(m){return Z[m]}));F===A.initializeStart&&p.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var w=L.plugins[m];return p.plugins.includes(m)&&!w.initialized}).map(function(m){return M[m]}));var H=x.map(function(m){return m.name}),R=function(m,w,E){var U=ll(m).map(function(N){return ul(N,w)});return w.reduce(function(N,D){var q=D.name,z=ll(m,q).map(function($){return ul($,w)}),J=z[0],B=z[1],pe=z[2];return J.length&&(N.beforeNS[q]=J),B.length&&(N.duringNS[q]=B),pe.length&&(N.afterNS[q]=pe),N},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,x);return Promise.resolve(Ti({action:p,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(m){function w(){var N=function(){if(F.match(Bt))return Promise.resolve(Ti({action:j({},E,{type:X+"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&&il(D.meta.rid,{payload:D})})}();return N&&N.then?N.then(function(){return m}):m}if(mh(m,H.length))return m;var E,U=function(){if(F!==X)return Promise.resolve(Ti({action:j({},m,{type:X}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:k})).then(function(N){E=N});E=m}();return U&&U.then?U.then(w):w()})}catch(m){return Promise.reject(m)}var Z,ee,Fe}(o,t,e,a,r)).then(function(p){return s=1,i(p)})}();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(p){return Promise.reject(p)}}}}}function JP(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 YP=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 qt.apply(void 0,o)(n)(a)}}}}};function XP(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=hl(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=hl(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,vl(r.plugins,!1,t));case A.enablePlugin:return j({},t,vl(r.plugins,!0,t));default:return t}}}function hl(e,t){return e.substring(t.length+1,e.length)}function vl(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function gh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var qP={last:{},history:[]};function QP(e,t){e===void 0&&(e=qP);var r=t.options,n=t.meta;if(t.type===A.track){var a=gh(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 eE={actions:[]};function tE(e,t){e===void 0&&(e=eE);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 yh=/#.*$/;function rE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(yh,""):"")}var wh,bh,Sh,$h,nE=function(e){if(e===void 0&&(e={}),!te)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 h=function(){if(te){for(var v,b=document.getElementsByTagName("link"),g=0;v=b[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(yh,"")}(f),c={title:r,url:l,path:rE(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},aE={last:{},history:[]};function iE(e,t){e===void 0&&(e=aE);var r=t.options;if(t.type===A.page){var n=gh(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}wh=function(){if(!te)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"}(),bh=te?document.referrer:null,Sh=UP(),$h=NP();var pl={initialized:!1,sessionId:da(),app:null,version:null,debug:!1,offline:!!te&&!navigator.onLine,os:{name:wh},userAgent:te?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:$h,locale:Sh,campaign:{},referrer:bh};function oE(e,t){e===void 0&&(e=pl);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({},pl,e,{initialized:!0})}}var sE=["plugins","reducers","storage"];function cE(e,t,r){if(te){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function uE(e){var t=cE.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Ih(){return yt("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 Xt[Yt].analytics.push(o.action||o),i(o)}})}}}function ml(e){return function(){return qt(qt.apply(null,arguments),Ih())}}function Oi(e){return e?fh(e)?e:[e]:[]}function gl(e,t,r){e===void 0&&(e={});var n,a,i=da();return t&&(br[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ue(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 lE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,w){if(ue(w))return m.middlewares=m.middlewares.concat(w),m;if(w.NAMESPACE&&(w.name=w.NAMESPACE),!w.name)throw new Error("https://lytics.dev/errors/1");w.config||(w.config={});var E=w.EVENTS?Object.keys(w.EVENTS).map(function(D){return w.EVENTS[D]}):[];m.pluginEnabled[w.name]=!(w.enabled===!1||w.config.enabled===!1),delete w.enabled,w.methods&&(m.methods[w.name]=Object.keys(w.methods).reduce(function(D,q){var z;return D[q]=(z=w.methods[q],function(){for(var J=Array.prototype.slice.call(arguments),B=new Array(z.length),pe=0;pe<J.length;pe++)B[pe]=J[pe];return B[B.length]=S,z.apply({instance:S},B)}),D},{}),delete w.methods);var U=Object.keys(w).concat(E),N=new Set(m.events.concat(U));if(m.events=Array.from(N),m.pluginsArray=m.pluginsArray.concat(w),m.plugins[w.name])throw new Error(w.name+"AlreadyLoaded");return m.plugins[w.name]=w,m.plugins[w.name].loaded||(m.plugins[w.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:gt,setItem:yt,removeItem:ar},i=function(m){return function(w,E,U){return E.getState("user")[w]||(U&&ce(U)&&U[w]?U[w]:al(m)[w]||gt(mo(w))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!po.includes(m)}).sort(),u=new Set(s.concat(kn).filter(function(m){return!po.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new YP,d=c.addMiddleware,h=c.removeMiddleware,v=c.dynamicMiddlewares,b=function(){throw new Error("Abort disabled inListener")},g=xP(),T=al(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=da());var y=j({enable:function(m,w){return new Promise(function(E){R.dispatch({type:A.enablePlugin,plugins:Oi(m),_:{originalAction:A.enablePlugin}},E,[w])})},disable:function(m,w){return new Promise(function(E){R.dispatch({type:A.disablePlugin,plugins:Oi(m),_:{originalAction:A.disablePlugin}},E,[w])})}},n.methods),p=!1,S={identify:function(m,w,E,U){try{var N=tt(m)?m:null,D=ce(m)?m:w,q=E||{},z=S.user();yt(mo(Xe),N);var J=N||D.userId||i(Xe,S,D);return Promise.resolve(new Promise(function(B){R.dispatch(j({type:A.identifyStart,userId:J,traits:D||{},options:q,anonymousId:z.anonymousId},z.id&&z.id!==N&&{previousId:z.id}),B,[w,E,U])}))}catch(B){return Promise.reject(B)}},track:function(m,w,E,U){try{var N=ce(m)?m.event:m;if(!N||!tt(N))throw new Error("EventMissing");var D=ce(m)?m:w||{},q=ce(E)?E:{};return Promise.resolve(new Promise(function(z){R.dispatch({type:A.trackStart,event:N,properties:D,options:q,userId:i(Xe,S,w),anonymousId:i(Dt,S,w)},z,[w,E,U])}))}catch(z){return Promise.reject(z)}},page:function(m,w,E){try{var U=ce(m)?m:{},N=ce(w)?w:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:nE(U),options:N,userId:i(Xe,S,U),anonymousId:i(Dt,S,U)},D,[m,w,E])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Xe||m==="id")return i(Xe,S);if(m===Dt||m==="anonId")return i(Dt,S);var w=S.getState("user");return m?Xu(w,m):w},reset:function(m){return new Promise(function(w){R.dispatch({type:A.resetStart},w,m)})},ready:function(m){return p&&m({plugins:y,instance:S}),S.on(A.ready,function(w){m(w),p=!0})},on:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var E=/Start$|Start:/;if(m==="*"){var U=function(z){return function(J){return function(B){return B.type.match(E)&&w({payload:B,instance:S,plugins:o}),J(B)}}},N=function(z){return function(J){return function(B){return B.type.match(E)||w({payload:B,instance:S,plugins:o}),J(B)}}};return d(U,mn),d(N,gn),function(){h(U,mn),h(N,gn)}}var D=m.match(E)?mn:gn,q=function(z){return function(J){return function(B){return B.type===m&&w({payload:B,instance:S,plugins:o,abort:b}),J(B)}}};return d(q,D),function(){return h(q,D)}},once:function(m,w){if(!m||!ue(w))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var E=S.on(m,function(U){w({payload:U.payload,instance:S,plugins:o,abort:b}),E()});return E},getState:function(m){var w=R.getState();return m?Xu(w,m):Object.assign({},w)},dispatch:function(m){var w=tt(m)?{type:m}:m;if(kn.includes(w.type))throw new Error("reserved action "+w.type);var E=j({},w,{_:j({originalAction:w.type},m._||{})});R.dispatch(E)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(m,w,E){R.dispatch({type:A.setItemStart,key:m,value:w,options:E})},removeItem:function(m,w){R.dispatch({type:A.removeItemStart,key:m,options:w})}},setAnonymousId:function(m,w){S.storage.setItem(rt,m,w)},events:{core:kn,plugins:s}},O=n.middlewares.concat([function(m){return function(w){return function(E){return E.meta||(E.meta=gl()),w(E)}}},v(mn),ZP(S,l,{all:f,plugins:s}),JP(a),HP(S),GP(S),v(gn)]),_={context:oE,user:KP(a),page:iE,track:QP,plugins:XP(l),queue:tE},k=qt,M=qt;if(te&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(k=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Ih():ce(typeof arguments[0])?ml():ml().apply(null,arguments)}}var X,L=function(m){return Object.keys(m).reduce(function(w,E){return sE.includes(E)||(w[E]=m[E]),w},{})}(e),x=n.pluginsArray.reduce(function(m,w){var E=w.name,U=w.config,N=w.loaded,D=n.pluginEnabled[E];return m[E]={enabled:D,initialized:!!D&&!w.initialize,loaded:!!N({config:U}),config:U},m},{}),H={context:L,user:I,plugins:x},R=hh(function(m){for(var w=Object.keys(m),E={},U=0;U<w.length;U++){var N=w[U];typeof m[N]===qe&&(E[N]=m[N])}var D,q=Object.keys(E);try{(function(z){Object.keys(z).forEach(function(J){var B=z[J];if(typeof B(void 0,{type:"@@redux/INIT"})===Ge||typeof B(void 0,{type:FP})===Ge)throw new Error("reducer "+J+" "+Ge)})})(E)}catch(z){D=z}return function(z,J){if(z===void 0&&(z={}),D)throw D;for(var B=!1,pe={},$=0;$<q.length;$++){var P=q[$],C=z[P],W=(0,E[P])(C,J);if(typeof W===Ge){var V=BP(P,J);throw new Error(V)}pe[P]=W,B=B||W!==C}return B?pe:z}}(j({},_,t)),H,M(k(zP.apply(void 0,O))));R.dispatch=(X=R.dispatch,function(m,w,E){var U=j({},m,{meta:gl(m.meta,w,Oi(E))});return X.apply(null,[U])});var Z=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:Z,config:L,params:g,user:I,initialUser:r,persistedUser:T});var ee=Z.filter(function(m){return n.pluginEnabled[m]}),Fe=Z.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:Z,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,w){var E=m.bootstrap,U=m.config,N=m.name;E&&ue(E)&&E({instance:S,config:U,payload:m}),R.dispatch({type:A.registerPluginType(N),name:N,enabled:n.pluginEnabled[N],plugin:m}),n.pluginsArray.length===w+1&&R.dispatch({type:A.initializeStart,plugins:ee,disabled:Fe})}),uE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,w,E){setInterval(function(){return ph(m,w,E)},3e3)}(R,l,S),S}var mn="before",gn="after",kr="cookie",lt=Eh(),Th=ha,fE=ha;function Ph(e){return lt?ha(e,"",-1):ar(e)}function Eh(){if(lt!==void 0)return lt;var e="cookiecookie";try{ha(e,e),lt=document.cookie.indexOf(e)!==-1,Ph(e)}catch{lt=!1}return lt}function ha(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return lt===!1&&(o?yt(e,t):gt(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",dE=fs.bind(null,"localStorage");ir("localStorage","getItem",gt);ir("localStorage","setItem",yt);ir("localStorage","removeItem",ar);var Rr="sessionStorage",hE=fs.bind(null,"sessionStorage");ir("sessionStorage","getItem",gt);ir("sessionStorage","setItem",yt);ir("sessionStorage","removeItem",ar);function zt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ce(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var vE=dE(),pE=hE(),mE=Eh();function Oh(e,t){if(e){var r=ds(t),n=!ms(r),a=hs(r)?zt(localStorage.getItem(e)):void 0;if(n&&!xt(a))return a;var i=vs(r)?zt(Th(e)):void 0;if(n&&i)return i;var o=ps(r)?zt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=gt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function gE(e,t,r){if(e&&!xt(t)){var n={},a=ds(r),i=JSON.stringify(t),o=!ms(a);return hs(a)&&(n[_r]=yn(_r,t,zt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[_r]:vs(a)&&(n[kr]=yn(kr,t,zt(Th(e))),fE(e,i),o)?n[kr]:ps(a)&&(n[Rr]=yn(Rr,t,zt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Rr]:(n[Or]=yn(Or,t,gt(e)),yt(e,t),o?n[Or]:n)}}function yE(e,t){if(e){var r=ds(t),n=Oh(e,ch),a={};return!xt(n.localStorage)&&hs(r)&&(localStorage.removeItem(e),a[_r]=n.localStorage),!xt(n.cookie)&&vs(r)&&(Ph(e),a[kr]=n.cookie),!xt(n.sessionStorage)&&ps(r)&&(sessionStorage.removeItem(e),a[Rr]=n.sessionStorage),!xt(n.global)&&va(r,Or)&&(ar(e),a[Or]=n.global),a}}function ds(e){return e?tt(e)?e:e.storage:sh}function hs(e){return vE&&va(e,_r)}function vs(e){return mE&&va(e,kr)}function ps(e){return pE&&va(e,Rr)}function ms(e){return e===ch||e==="all"}function va(e,t){return e===sh||e===t||ms(e)}function yn(e,t,r){return{location:e,current:t,previous:r}}var wE={setItem:gE,getItem:Oh,removeItem:yE};function bE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yl(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 wl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yl(Object(r),!0).forEach(function(n){bE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:wE};return lE(wl(wl({},t),e))}function $E(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 IE(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=PE(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function TE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function PE(e){return["#","?"].forEach(t=>e=TE(e,t)),e}function EE(){IE(()=>{He.page()})}function OE(e){if(e===void 0&&(e={}),!te)return vo;var t=Sl(),r=go(),n=bl(),a=wn(n,t),i=wn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return vo;var h=d.map(function(b){return Number(b)}),v=MP(function(){var b=Sl(),g=function(L,x){return x.map(function(H){return H===100?L-5:L*(H/100)})}(b,h),T=go(),I=bl(),y=wn(I,b),p=wn(T,b);if(l=y>l?y:l,c=p<c?p:c,!(o.length>=h.length)){var S=f===I,O="up";S?O="initial":f<=I&&(O="down");var _=g,k=h;(O==="up"||S)&&(_=g.slice().reverse(),k=h.slice().reverse());var M=k.reduce(function(L,x,H){var R=_[H];return u.includes(x)&&I<=R&&(u=u.filter(function(Z){return Z!==x}),L.singleFunction=x),O==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):O==="up"&&!o.includes(x)&&I<=R&&x<=y?(L.foundFunc=[x],L):(S&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=I,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ue(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,X=M.direction;ue(e[F])&&e[F]({trigger:F,direction:X,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function go(){return te?document.body.scrollTop||document.documentElement.scrollTop:0}function kE(){return te?window.innerHeight||document.documentElement.clientHeight:0}function bl(){return Math.round(go()+kE())}function Sl(){if(!te)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function wn(e,t){return Math.round(e/t*100)}var $l="EventListener";function _E(e){return function(t,r,n,a){var i=n||vo,o=a||!1;if(!te)return i;var s=Kn(r),u=Kn(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"+$l:"remove"+$l,h=0;h<u.length;h++){var v=u[h];f[h]=c?o&&o.once?RE(i):i:f[h]||i;for(var b=0;b<s.length;b++)v[d]?v["on"+s[b]]=c?f[h]:null:v[d](s[b],f[h],o)}return l.bind(null,!c)}(e)}}function Kn(e,t){if(tt(e))return t?Kn(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 tt(o)?Kn(o,!0):o}).flat():i}function RE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var ki=_E("Event");function kh(e,t){return te&&ue(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ue(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}kh.bind(null,"onerror");kh.bind(null,"onload");var _h=typeof window>"u",Il="hidden";function CE(e){if(_h)return!1;var t=AE(),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 AE(){var e=["webkit","moz","ms","o"];return _h||Il in document?Il:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var jE=["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=CE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(jE.map(function(s){return ki(document,s,r)})).concat(ki(window,"load",r)).concat(ki(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function UE(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,h=function(){return clearTimeout(t)};function v(g){h(),i&&!l&&i(mr(d),g),a&&l&&(l=!1,a(mr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(mr(d),g))},s)}var b=LE(v,{throttle:f});return{disable:function(){c=!0,l=!1,h();var g=b();return function(){return c=!1,d=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:mr(d,c),idle:l?mr(r,c):0}}}}function mr(e,t){return t?0:Math.round((new Date-e)/1e3)}const Tl=5e3;class NE{constructor(t){me(this,"element");me(this,"isInViewport",!1);me(this,"isAwake",!1);me(this,"isFlushing");me(this,"observer");me(this,"lastEventAt",Date.now());me(this,"registeredView",!1);me(this,"viewCallback");me(this,"activeDurationCallback");me(this,"idleDurationCallback");me(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),UE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Tl}),OE({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*Tl: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 Pl="sesamy_session_id";function xE(){let e=sessionStorage.getItem(Pl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Pl,e)),e}let Rh=!1,yo,El,Gn;const Ch=new Map;function DE({clientId:e,enabled:t=!0,environment:r}){if(yo=e,El=t,Gn=`${Ke("logs",r)}/events`,!El)return;window.addEventListener("beforeunload",()=>{jh.forEach((a,i)=>{a.bind(i)()}),FE()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Ch.forEach((a,i)=>{a.bind(i)()})}),EE();const n=new NE({element:document.body,viewCallback:()=>{He.page()},activeDurationCallback:(a,i,o)=>{He.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{He.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{He.track("scroll",{scroll:a.scrollMax})}});BE(document.body,()=>{n.flush()}),zE(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(ve.AUTHENTICATED,async a=>{const i=a;await He.identify(i.detail.sub)}),window.addEventListener(ve.LOGOUT,async()=>{await He.track("logout",{}),gs.flush(),await He.reset()})}function Ah(e){return JSON.stringify(e.map(t=>({...t,clientId:yo,requestId:Math.random().toString(36).slice(2,9),sessionId:xE(),timestamp:new Date().toISOString(),version:ls,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:oh,userAgent:navigator.userAgent,clientId:yo}})))}const gs=$E(async e=>{if(e.length>0){const t=Ah(e);Rh?navigator.sendBeacon(Gn,t):(await fetch(Gn,{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(Gn,Ah([r]))}else gs.push(e)}const He=SE({app:oh,version:ls,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 ME(e,t){He.track(e,t)}function FE(){return Rh=!0,gs.flush()}const jh=new Map;function BE(e,t){jh.set(e,t)}function zE(e,t){Ch.set(e,t)}const HE=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function KE(){return new Promise(e=>{const t=HE.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 GE(){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}}let ke={article:{selector:"article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"article",attribute:"data-price"},currency:{selector:"article",attribute:"data-currency"},url:{selector:"link",attribute:"href"},id:{selector:"article",attribute:"data-id"}};function WE(e){var t;ke={...ke,...(t=e.content)==null?void 0:t.article}}function VE(e,t){const{selector:r}=t;return r===ke.article.selector?e:e.querySelector(r)}function ZE(e,t){if(e)return t.attribute?t.attribute==="textContent"?e.textContent??void 0:e.getAttribute(t.attribute)??void 0:e.textContent??void 0}function JE(){const e=document.querySelectorAll(ke.article.selector);return Array.from(e).map(t=>{const r={element:t},n=(a,i,o)=>{const s=VE(t,i);if(s){const u=ZE(s,i);u!==void 0&&(r[a]=o?o(u):u)}};return n("title",ke.title),n("excerpt",ke.excerpt),n("image",ke.image),n("price",ke.price,a=>parseFloat(a)),n("currency",ke.currency),n("url",ke.url),n("id",ke.id),r})}function YE(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getFulfillments:s,getSubscriptions:u,getContract:f,getContracts:l,cancelContract:c,getBill:d,getBills:h,getTransaction:v,getTransactions:b,getProfile:g,updateProfile:T,getTags:I,deleteTag:y,setTag:p,getUserMetadata:S,listUserMetadata:O,setUserMetadata:_,deleteUserMetadata:k,getTally:M,getTallies:F,pushTally:X,deleteTally:L,getProduct:x,getPaymentIssues:H,isSpotifyLinked:R,unlinkSpotify:Z,linkSpotify:ee,autoOnboardProduct:Fe,openHostedAccountPage:m,generateLink:w,hasAccess:E,getPaywall:U}=TP(e),N={auth:{getUser:g,isAuthenticated:jr,loginWithRedirect:ss,logout:qd,setToken:eh},attribution:{get:us,set:IP},checkouts:{get:r,create:t,update:n},profile:{get:g,update:T,openHostedAccountPage:m,isSpotifyLinked:R,unlinkSpotify:Z},analytics:{track:ME},content:{list:JE},tags:{list:I,set:p,delete:y},entitlements:{get:a,list:i,hasAccess:E,access:o,signedLinks:cs},fulfillments:{list:s},contracts:{get:f,list:l,cancel:c},bills:{get:d,list:h},userMetadata:{get:S,list:O,set:_,delete:k},tallies:{get:M,list:F,push:X,delete:L},subscriptions:{list:u},transactions:{get:v,list:b},products:{get:x,autoOnboard:Fe,linkSpotify:ee},paywalls:{get:U},browser:{detectAdblock:KE,isInAppBrowser:GE},getVersion:XE,getPaymentIssues:H,generateLink:w,clearCache:_e,log:he};return e.namespace&&(window[e.namespace]=N),N}function XE(){return ls}function qE(e,t){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
7
7
|
${t.selector}::before {
|
|
8
8
|
content: '';
|
|
9
9
|
position: absolute;
|
|
@@ -14,4 +14,4 @@ CAUSE: `+h.stack,S.response=y,S.status=y.status,S.url=c,y.type==="opaque")throw
|
|
|
14
14
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
15
15
|
pointer-events: none;
|
|
16
16
|
}
|
|
17
|
-
`,document.head.appendChild(i)}async function
|
|
17
|
+
`,document.head.appendChild(i)}async function Lh(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}}async function QE(e,t){const r=t.insertionPoint||"inside";let n="";if(t.contentType==="selector"&&t.content){const a=document.querySelector(t.content);if(a)n=a.innerHTML;else{console.warn(`Source element for selector '${t.content}' not found`);return}}else if(t.contentType==="url"&&t.content){const a=await Lh(t.content);if(a)n=a;else{console.warn(`Failed to fetch content from URL '${t.content}'`);return}}else t.content&&(n=t.content);switch(r){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function eO(e,t){if(t.contentType==="selector"&&t.content){const r=document.querySelector(t.content);r?e.innerHTML=r.innerHTML:console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const r=await Lh(t.content);r?e.innerHTML=r:console.warn(`Failed to fetch content from URL '${t.content}'`)}else t.content&&(e.innerHTML=t.content)}async function tO({enabled:e=!1,rules:t}){if(!e)return;const r=await jr(),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){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await QE(s,a);break;case"replace":await eO(s,a);break;case"remove":o.remove();break;case"gradient":qE(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}const Ol="access_token";function rO(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get(Ol);if(t){eh(t);const r=new URL(window.location.href);e.delete(Ol),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const kl="sesamy-refresh",_l="force-refetch-entitlements";function nO(){const e=new URLSearchParams(window.location.search),t=e.get(_l),r=e.get(kl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(_l),e.delete(kl),n.search=e.toString(),_e(),window.history.replaceState(null,"",n)}}function aO(e){const t=e.split(".")[1],r=atob(t);return JSON.parse(r)}function iO(){var n,a,i,o;const e=new URLSearchParams(window.location.search),t=e.get("sesamy-token")||e.get("token");if(!t)return;try{const s=aO(t),u=new Date(s.exp*1e3),f={id:"",title:(n=s.p)==null?void 0:n.toString(),sku:(a=s.s)==null?void 0:a.toString(),purchaseOptionsId:(i=s.pid)==null?void 0:i.toString(),url:(o=s.url)==null?void 0:o.toString(),token:t,type:"article",expiresAt:u.toISOString(),createdAt:new Date(s.iat).toISOString(),updatedAt:new Date(s.iat).toISOString()};SP(f)}catch(s){he(`Failed to extract signed link ${s}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const Rl="sesamy-user";async function oO(){var a;const t=(a=new URLSearchParams(window.location.search).get(Rl))==null?void 0:a.toLowerCase();if(!t)return;const r=await sP();(r==null?void 0:r.email)!==t?(he(`Current user does not match sesamy user: ${r==null?void 0:r.email} !== ${t}`),_e(),ss({authorizationParams:{email_hint:t,login_hint:t}})):he(`Current user matches sesamy user: ${r==null?void 0:r.email} === ${t}`);const n=new URL(window.location.href);n.searchParams.delete(Rl),window.history.replaceState(null,"",n)}const Cl="sesamy-purchase";function sO(){const e=new URLSearchParams(window.location.search),t=e.get(Cl);if(t!==null){const r=new URL(window.location.href);e.delete(Cl),r.search=e.toString(),console.log("purchase",t),Ve(ve.PURCHASE,{itemSrc:t}),_e(),window.history.replaceState(null,"",r)}}const Al="sesamy-login",cO="sesamy_login";async function uO(){const e=new URLSearchParams(window.location.search);if(!(e.get(Al)||e.get(cO)))return;await jr()||ss();const n=new URL(window.location.href);n.searchParams.delete(Al),window.history.replaceState(null,"",n)}const jl="sesamy-debug";async function lO(){var n;const t=(n=new URLSearchParams(window.location.search).get(jl))==null?void 0:n.toLowerCase();if(!t)return;_T(t==="true");const r=new URL(window.location.href);r.searchParams.delete(jl),window.history.replaceState(null,"",r)}function Ll(){return typeof window<"u"}async function Ul(e){he(`Init with config: ${JSON.stringify(e)}`);try{DE({clientId:e.clientId,environment:e.environment,...e.analytics}),await oP({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),WE(e),e.transform&&await tO(e.transform),lO(),rO(),nO(),iO(),await uO(),await oO(),sO(),Ve(ve.READY,{})}catch(t){he(`Failed to init ${t.message}`)}}async function Uh(e){var n;he("Initializing Sesamy");const t=((n=e.api)==null?void 0:n.namespace)||"sesamy";if(Ll()&&t in window)return he("Sesamy already initialized. This is likely due to a duplicate import"),window[t];const r=YE({clientId:e.clientId,environment:e.environment,...e.api});return Ll()&&(e.awaitAllServices?await Ul(e):Ul(e)),r}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Uh(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=Uh;
|