@sesamy/sesamy-js 1.19.4 → 1.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +2797 -2307
- package/package.json +1 -1
package/dist/sesamy-js.iife.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var sesamyJs=function(Ee){"use strict";var $S=Object.defineProperty;var kS=(Ee,oe,G)=>oe in Ee?$S(Ee,oe,{enumerable:!0,configurable:!0,writable:!0,value:G}):Ee[oe]=G;var ve=(Ee,oe,G)=>kS(Ee,typeof oe!="symbol"?oe+"":oe,G);var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},G=function(e){try{return!!e()}catch{return!0}},_l=G,dn=!_l(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Li=dn,Ui=Function.prototype,hn=Ui.call,Rl=Li&&Ui.bind.bind(hn,hn),B=Li?Rl:function(e){return function(){return hn.apply(e,arguments)}},xi=B,Cl=xi({}.toString),jl=xi("".slice),vn=function(e){return jl(Cl(e),8,-1)},Al=B,Ll=G,Ul=vn,pn=Object,xl=Al("".split),Ni=Ll(function(){return!pn("z").propertyIsEnumerable(0)})?function(e){return Ul(e)==="String"?xl(e,""):pn(e)}:pn,mn=function(e){return e==null},Nl=mn,Dl=TypeError,dr=function(e){if(Nl(e))throw new Dl("Can't call method on "+e);return e},Ml=Ni,Fl=dr,xt=function(e){return Ml(Fl(e))},Nt=function(e){return e&&e.Math===Math&&e},q=Nt(typeof globalThis=="object"&&globalThis)||Nt(typeof window=="object"&&window)||Nt(typeof self=="object"&&self)||Nt(typeof oe=="object"&&oe)||Nt(typeof oe=="object"&&oe)||function(){return this}()||Function("return this")(),Di={exports:{}},zl=!1,Mi=q,Hl=Object.defineProperty,gn=function(e,t){try{Hl(Mi,e,{value:t,configurable:!0,writable:!0})}catch{Mi[e]=t}return t},Bl=q,Kl=gn,Fi="__core-js_shared__",zi=Di.exports=Bl[Fi]||Kl(Fi,{});(zi.versions||(zi.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var yn=Di.exports,Hi=yn,Bi=function(e,t){return Hi[e]||(Hi[e]=t||{})},Gl=dr,Wl=Object,hr=function(e){return Wl(Gl(e))},Vl=B,Zl=hr,Yl=Vl({}.hasOwnProperty),pe=Object.hasOwn||function(t,r){return Yl(Zl(t),r)},Jl=B,Xl=0,ql=Math.random(),Ql=Jl(1 .toString),Ki=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ql(++Xl+ql,36)},ef=typeof navigator<"u"&&String(navigator.userAgent)||"",Gi=q,wn=ef,Wi=Gi.process,Vi=Gi.Deno,Zi=Wi&&Wi.versions||Vi&&Vi.version,Yi=Zi&&Zi.v8,me,vr;Yi&&(me=Yi.split("."),vr=me[0]>0&&me[0]<4?1:+(me[0]+me[1])),!vr&&wn&&(me=wn.match(/Edge\/(\d+)/),(!me||me[1]>=74)&&(me=wn.match(/Chrome\/(\d+)/),me&&(vr=+me[1])));var tf=vr,Ji=tf,rf=G,nf=q,af=nf.String,Xi=!!Object.getOwnPropertySymbols&&!rf(function(){var e=Symbol("symbol detection");return!af(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ji&&Ji<41}),of=Xi,qi=of&&!Symbol.sham&&typeof Symbol.iterator=="symbol",sf=q,cf=Bi,Qi=pe,uf=Ki,lf=Xi,ff=qi,ct=sf.Symbol,bn=cf("wks"),df=ff?ct.for||ct:ct&&ct.withoutSetter||uf,se=function(e){return Qi(bn,e)||(bn[e]=lf&&Qi(ct,e)?ct[e]:df("Symbol."+e)),bn[e]},Sn=typeof document=="object"&&document.all,J=typeof Sn>"u"&&Sn!==void 0?function(e){return typeof e=="function"||e===Sn}:function(e){return typeof e=="function"},hf=J,Oe=function(e){return typeof e=="object"?e!==null:hf(e)},vf=Oe,pf=String,mf=TypeError,Ue=function(e){if(vf(e))return e;throw new mf(pf(e)+" is not an object")},eo={},gf=G,X=!gf(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),yf=X,wf=G,to=yf&&wf(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Se={},bf=q,ro=Oe,In=bf.document,Sf=ro(In)&&ro(In.createElement),$n=function(e){return Sf?In.createElement(e):{}},If=X,$f=G,kf=$n,no=!If&&!$f(function(){return Object.defineProperty(kf("div"),"a",{get:function(){return 7}}).a!==7}),Pf=dn,pr=Function.prototype.call,Ie=Pf?pr.bind(pr):function(){return pr.apply(pr,arguments)},kn=q,Tf=J,Ef=function(e){return Tf(e)?e:void 0},ut=function(e,t){return arguments.length<2?Ef(kn[e]):kn[e]&&kn[e][t]},Of=B,ao=Of({}.isPrototypeOf),_f=ut,Rf=J,Cf=ao,jf=qi,Af=Object,io=jf?function(e){return typeof e=="symbol"}:function(e){var t=_f("Symbol");return Rf(t)&&Cf(t.prototype,Af(e))},Lf=String,oo=function(e){try{return Lf(e)}catch{return"Object"}},Uf=J,xf=oo,Nf=TypeError,mr=function(e){if(Uf(e))return e;throw new Nf(xf(e)+" is not a function")},Df=mr,Mf=mn,Pn=function(e,t){var r=e[t];return Mf(r)?void 0:Df(r)},Tn=Ie,En=J,On=Oe,Ff=TypeError,zf=function(e,t){var r,n;if(t==="string"&&En(r=e.toString)&&!On(n=Tn(r,e))||En(r=e.valueOf)&&!On(n=Tn(r,e))||t!=="string"&&En(r=e.toString)&&!On(n=Tn(r,e)))return n;throw new Ff("Can't convert object to primitive value")},Hf=Ie,so=Oe,co=io,Bf=Pn,Kf=zf,Gf=se,Wf=TypeError,Vf=Gf("toPrimitive"),Zf=function(e,t){if(!so(e)||co(e))return e;var r=Bf(e,Vf),n;if(r){if(t===void 0&&(t="default"),n=Hf(r,e,t),!so(n)||co(n))return n;throw new Wf("Can't convert object to primitive value")}return t===void 0&&(t="number"),Kf(e,t)},Yf=Zf,Jf=io,uo=function(e){var t=Yf(e,"string");return Jf(t)?t:t+""},Xf=X,qf=no,Qf=to,gr=Ue,lo=uo,ed=TypeError,_n=Object.defineProperty,td=Object.getOwnPropertyDescriptor,Rn="enumerable",Cn="configurable",jn="writable";Se.f=Xf?Qf?function(t,r,n){if(gr(t),r=lo(r),gr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&jn in n&&!n[jn]){var a=td(t,r);a&&a[jn]&&(t[r]=n.value,n={configurable:Cn in n?n[Cn]:a[Cn],enumerable:Rn in n?n[Rn]:a[Rn],writable:!1})}return _n(t,r,n)}:_n:function(t,r,n){if(gr(t),r=lo(r),gr(n),qf)try{return _n(t,r,n)}catch{}if("get"in n||"set"in n)throw new ed("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var rd=Math.ceil,nd=Math.floor,ad=Math.trunc||function(t){var r=+t;return(r>0?nd:rd)(r)},id=ad,An=function(e){var t=+e;return t!==t||t===0?0:id(t)},od=An,sd=Math.max,cd=Math.min,ud=function(e,t){var r=od(e);return r<0?sd(r+t,0):cd(r,t)},ld=An,fd=Math.min,dd=function(e){var t=ld(e);return t>0?fd(t,9007199254740991):0},hd=dd,fo=function(e){return hd(e.length)},vd=xt,pd=ud,md=fo,ho=function(e){return function(t,r,n){var a=vd(t),i=md(a);if(i===0)return!e&&-1;var o=pd(n,i),c;if(e&&r!==r){for(;i>o;)if(c=a[o++],c!==c)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},gd={includes:ho(!0),indexOf:ho(!1)},Ln={},yd=B,Un=pe,wd=xt,bd=gd.indexOf,Sd=Ln,vo=yd([].push),po=function(e,t){var r=wd(e),n=0,a=[],i;for(i in r)!Un(Sd,i)&&Un(r,i)&&vo(a,i);for(;t.length>n;)Un(r,i=t[n++])&&(~bd(a,i)||vo(a,i));return a},xn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Id=po,$d=xn,mo=Object.keys||function(t){return Id(t,$d)},kd=X,Pd=to,Td=Se,Ed=Ue,Od=xt,_d=mo;eo.f=kd&&!Pd?Object.defineProperties:function(t,r){Ed(t);for(var n=Od(r),a=_d(r),i=a.length,o=0,c;i>o;)Td.f(t,c=a[o++],n[c]);return t};var Rd=ut,Cd=Rd("document","documentElement"),jd=Bi,Ad=Ki,go=jd("keys"),Nn=function(e){return go[e]||(go[e]=Ad(e))},Ld=Ue,Ud=eo,yo=xn,xd=Ln,Nd=Cd,Dd=$n,Md=Nn,wo=">",bo="<",Dn="prototype",Mn="script",So=Md("IE_PROTO"),Fn=function(){},Io=function(e){return bo+Mn+wo+e+bo+"/"+Mn+wo},$o=function(e){e.write(Io("")),e.close();var t=e.parentWindow.Object;return e=null,t},Fd=function(){var e=Dd("iframe"),t="java"+Mn+":",r;return e.style.display="none",Nd.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Io("document.F=Object")),r.close(),r.F},yr,wr=function(){try{yr=new ActiveXObject("htmlfile")}catch{}wr=typeof document<"u"?document.domain&&yr?$o(yr):Fd():$o(yr);for(var e=yo.length;e--;)delete wr[Dn][yo[e]];return wr()};xd[So]=!0;var zn=Object.create||function(t,r){var n;return t!==null?(Fn[Dn]=Ld(t),n=new Fn,Fn[Dn]=null,n[So]=t):n=wr(),r===void 0?n:Ud.f(n,r)},zd=se,Hd=zn,Bd=Se.f,Hn=zd("unscopables"),Bn=Array.prototype;Bn[Hn]===void 0&&Bd(Bn,Hn,{configurable:!0,value:Hd(null)});var Kd=function(e){Bn[Hn][e]=!0},Dt={},Gd=q,Wd=J,ko=Gd.WeakMap,Vd=Wd(ko)&&/native code/.test(String(ko)),Mt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Zd=X,Yd=Se,Jd=Mt,br=Zd?function(e,t,r){return Yd.f(e,t,Jd(1,r))}:function(e,t,r){return e[t]=r,e},Xd=Vd,Po=q,qd=Oe,Qd=br,Kn=pe,Gn=yn,eh=Nn,th=Ln,To="Object already initialized",Wn=Po.TypeError,rh=Po.WeakMap,Sr,Ft,Ir,nh=function(e){return Ir(e)?Ft(e):Sr(e,{})},ah=function(e){return function(t){var r;if(!qd(t)||(r=Ft(t)).type!==e)throw new Wn("Incompatible receiver, "+e+" required");return r}};if(Xd||Gn.state){var $e=Gn.state||(Gn.state=new rh);$e.get=$e.get,$e.has=$e.has,$e.set=$e.set,Sr=function(e,t){if($e.has(e))throw new Wn(To);return t.facade=e,$e.set(e,t),t},Ft=function(e){return $e.get(e)||{}},Ir=function(e){return $e.has(e)}}else{var lt=eh("state");th[lt]=!0,Sr=function(e,t){if(Kn(e,lt))throw new Wn(To);return t.facade=e,Qd(e,lt,t),t},Ft=function(e){return Kn(e,lt)?e[lt]:{}},Ir=function(e){return Kn(e,lt)}}var zt={set:Sr,get:Ft,has:Ir,enforce:nh,getterFor:ah},Vn={},Zn={},Eo={}.propertyIsEnumerable,Oo=Object.getOwnPropertyDescriptor,ih=Oo&&!Eo.call({1:2},1);Zn.f=ih?function(t){var r=Oo(this,t);return!!r&&r.enumerable}:Eo;var oh=X,sh=Ie,ch=Zn,uh=Mt,lh=xt,fh=uo,dh=pe,hh=no,_o=Object.getOwnPropertyDescriptor;Vn.f=oh?_o:function(t,r){if(t=lh(t),r=fh(r),hh)try{return _o(t,r)}catch{}if(dh(t,r))return uh(!sh(ch.f,t,r),t[r])};var Ro={exports:{}},Yn=X,vh=pe,Co=Function.prototype,ph=Yn&&Object.getOwnPropertyDescriptor,Jn=vh(Co,"name"),mh=Jn&&(function(){}).name==="something",gh=Jn&&(!Yn||Yn&&ph(Co,"name").configurable),jo={EXISTS:Jn,PROPER:mh,CONFIGURABLE:gh},yh=B,wh=J,Xn=yn,bh=yh(Function.toString);wh(Xn.inspectSource)||(Xn.inspectSource=function(e){return bh(e)});var Ao=Xn.inspectSource,qn=B,Sh=G,Ih=J,$r=pe,Qn=X,$h=jo.CONFIGURABLE,kh=Ao,Lo=zt,Ph=Lo.enforce,Th=Lo.get,Uo=String,kr=Object.defineProperty,Eh=qn("".slice),Oh=qn("".replace),_h=qn([].join),Rh=Qn&&!Sh(function(){return kr(function(){},"length",{value:8}).length!==8}),Ch=String(String).split("String"),jh=Ro.exports=function(e,t,r){Eh(Uo(t),0,7)==="Symbol("&&(t="["+Oh(Uo(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!$r(e,"name")||$h&&e.name!==t)&&(Qn?kr(e,"name",{value:t,configurable:!0}):e.name=t),Rh&&r&&$r(r,"arity")&&e.length!==r.arity&&kr(e,"length",{value:r.arity});try{r&&$r(r,"constructor")&&r.constructor?Qn&&kr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=Ph(e);return $r(n,"source")||(n.source=_h(Ch,typeof t=="string"?t:"")),e};Function.prototype.toString=jh(function(){return Ih(this)&&Th(this).source||kh(this)},"toString");var xo=Ro.exports,Ah=J,Lh=Se,Uh=xo,xh=gn,xe=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(Ah(r)&&Uh(r,i,n),n.global)a?e[t]=r:xh(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:Lh.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},No={},Nh=po,Dh=xn,Mh=Dh.concat("length","prototype");No.f=Object.getOwnPropertyNames||function(t){return Nh(t,Mh)};var ea={};ea.f=Object.getOwnPropertySymbols;var Fh=ut,zh=B,Hh=No,Bh=ea,Kh=Ue,Gh=zh([].concat),Wh=Fh("Reflect","ownKeys")||function(t){var r=Hh.f(Kh(t)),n=Bh.f;return n?Gh(r,n(t)):r},Do=pe,Vh=Wh,Zh=Vn,Yh=Se,Jh=function(e,t,r){for(var n=Vh(t),a=Yh.f,i=Zh.f,o=0;o<n.length;o++){var c=n[o];!Do(e,c)&&!(r&&Do(r,c))&&a(e,c,i(t,c))}},Xh=G,qh=J,Qh=/#|\.prototype\./,Ht=function(e,t){var r=tv[ev(e)];return r===nv?!0:r===rv?!1:qh(t)?Xh(t):!!t},ev=Ht.normalize=function(e){return String(e).replace(Qh,".").toLowerCase()},tv=Ht.data={},rv=Ht.NATIVE="N",nv=Ht.POLYFILL="P",av=Ht,Pr=q,iv=Vn.f,ov=br,sv=xe,cv=gn,uv=Jh,lv=av,ft=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,c,l,f,u;if(n?o=Pr:a?o=Pr[r]||cv(r,{}):o=Pr[r]&&Pr[r].prototype,o)for(c in t){if(f=t[c],e.dontCallGetSet?(u=iv(o,c),l=u&&u.value):l=o[c],i=lv(n?c:r+(a?".":"#")+c,e.forced),!i&&l!==void 0){if(typeof f==typeof l)continue;uv(f,l)}(e.sham||l&&l.sham)&&ov(f,"sham",!0),sv(o,c,f,e)}},fv=G,dv=!fv(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),hv=pe,vv=J,pv=hr,mv=Nn,gv=dv,Mo=mv("IE_PROTO"),ta=Object,yv=ta.prototype,Fo=gv?ta.getPrototypeOf:function(e){var t=pv(e);if(hv(t,Mo))return t[Mo];var r=t.constructor;return vv(r)&&t instanceof r?r.prototype:t instanceof ta?yv:null},wv=G,bv=J,Sv=Oe,zo=Fo,Iv=xe,$v=se,ra=$v("iterator"),Ho=!1,Ve,na,aa;[].keys&&(aa=[].keys(),"next"in aa?(na=zo(zo(aa)),na!==Object.prototype&&(Ve=na)):Ho=!0);var kv=!Sv(Ve)||wv(function(){var e={};return Ve[ra].call(e)!==e});kv&&(Ve={}),bv(Ve[ra])||Iv(Ve,ra,function(){return this});var Bo={IteratorPrototype:Ve,BUGGY_SAFARI_ITERATORS:Ho},Pv=Se.f,Tv=pe,Ev=se,Ko=Ev("toStringTag"),Bt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Tv(e,Ko)&&Pv(e,Ko,{configurable:!0,value:t})},Ov=Bo.IteratorPrototype,_v=zn,Rv=Mt,Cv=Bt,jv=Dt,Av=function(){return this},Go=function(e,t,r,n){var a=t+" Iterator";return e.prototype=_v(Ov,{next:Rv(+!n,r)}),Cv(e,a,!1),jv[a]=Av,e},Lv=B,Uv=mr,xv=function(e,t,r){try{return Lv(Uv(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},Nv=Oe,Dv=function(e){return Nv(e)||e===null},Mv=Dv,Fv=String,zv=TypeError,Hv=function(e){if(Mv(e))return e;throw new zv("Can't set "+Fv(e)+" as a prototype")},Bv=xv,Kv=Oe,Gv=dr,Wv=Hv,Vv=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Bv(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return Gv(a),Wv(i),Kv(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Zv=ft,Yv=Ie,Wo=jo,Jv=J,Xv=Go,Vo=Fo,Zo=Vv,qv=Bt,Qv=br,ia=xe,ep=se,tp=Dt,Yo=Bo,rp=Wo.PROPER,np=Wo.CONFIGURABLE,Jo=Yo.IteratorPrototype,Tr=Yo.BUGGY_SAFARI_ITERATORS,Kt=ep("iterator"),Xo="keys",Gt="values",qo="entries",ap=function(){return this},Qo=function(e,t,r,n,a,i,o){Xv(r,t,n);var c=function($){if($===a&&d)return d;if(!Tr&&$&&$ in u)return u[$];switch($){case Xo:return function(){return new r(this,$)};case Gt:return function(){return new r(this,$)};case qo:return function(){return new r(this,$)}}return function(){return new r(this)}},l=t+" Iterator",f=!1,u=e.prototype,s=u[Kt]||u["@@iterator"]||a&&u[a],d=!Tr&&s||c(a),h=t==="Array"&&u.entries||s,m,S,g;if(h&&(m=Vo(h.call(new e)),m!==Object.prototype&&m.next&&(Vo(m)!==Jo&&(Zo?Zo(m,Jo):Jv(m[Kt])||ia(m,Kt,ap)),qv(m,l,!0))),rp&&a===Gt&&s&&s.name!==Gt&&(np?Qv(u,"name",Gt):(f=!0,d=function(){return Yv(s,this)})),a)if(S={values:c(Gt),keys:i?d:c(Xo),entries:c(qo)},o)for(g in S)(Tr||f||!(g in u))&&ia(u,g,S[g]);else Zv({target:t,proto:!0,forced:Tr||f},S);return u[Kt]!==d&&ia(u,Kt,d,{name:a}),tp[t]=d,S},oa=function(e,t){return{value:e,done:t}},ip=xt,sa=Kd,es=Dt,ts=zt,op=Se.f,sp=Qo,Er=oa,cp=X,rs="Array Iterator",up=ts.set,lp=ts.getterFor(rs),fp=sp(Array,"Array",function(e,t){up(this,{type:rs,target:ip(e),index:0,kind:t})},function(){var e=lp(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,Er(void 0,!0);switch(e.kind){case"keys":return Er(r,!1);case"values":return Er(t[r],!1)}return Er([r,t[r]],!1)},"values"),ns=es.Arguments=es.Array;if(sa("keys"),sa("values"),sa("entries"),cp&&ns.name!=="values")try{op(ns,"name",{value:"values"})}catch{}var as=q,dp=X,hp=Object.getOwnPropertyDescriptor,vp=function(e){if(!dp)return as[e];var t=hp(as,e);return t&&t.value},pp=G,mp=se,gp=X,is=zl,yp=mp("iterator"),Or=!pp(function(){var e=new URL("b?a=1&b=2&c=3","http://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),is&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(is||!gp)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[yp]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("http://x",void 0).host!=="x"}),os=xo,wp=Se,ca=function(e,t,r){return r.get&&os(r.get,t,{getter:!0}),r.set&&os(r.set,t,{setter:!0}),wp.f(e,t,r)},bp=xe,Sp=function(e,t,r){for(var n in t)bp(e,n,t[n],r);return e},Ip=ao,$p=TypeError,ss=function(e,t){if(Ip(t,e))return e;throw new $p("Incorrect invocation")},kp=vn,Pp=B,Tp=function(e){if(kp(e)==="Function")return Pp(e)},cs=Tp,Ep=mr,Op=dn,_p=cs(cs.bind),ua=function(e,t){return Ep(e),t===void 0?e:Op?_p(e,t):function(){return e.apply(t,arguments)}},Rp=se,Cp=Rp("toStringTag"),us={};us[Cp]="z";var jp=String(us)==="[object z]",Ap=jp,Lp=J,_r=vn,Up=se,xp=Up("toStringTag"),Np=Object,Dp=_r(function(){return arguments}())==="Arguments",Mp=function(e,t){try{return e[t]}catch{}},Rr=Ap?_r:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=Mp(t=Np(e),xp))=="string"?r:Dp?_r(t):(n=_r(t))==="Object"&&Lp(t.callee)?"Arguments":n},Fp=Rr,zp=String,Ne=function(e){if(Fp(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return zp(e)},Hp=Rr,ls=Pn,Bp=mn,Kp=Dt,Gp=se,Wp=Gp("iterator"),la=function(e){if(!Bp(e))return ls(e,Wp)||ls(e,"@@iterator")||Kp[Hp(e)]},Vp=Ie,Zp=mr,Yp=Ue,Jp=oo,Xp=la,qp=TypeError,fs=function(e,t){var r=arguments.length<2?Xp(e):t;if(Zp(r))return Yp(Vp(r,e));throw new qp(Jp(e)+" is not iterable")},Qp=TypeError,dt=function(e,t){if(e<t)throw new Qp("Not enough arguments");return e},em=B,ds=em([].slice),hs=ds,tm=Math.floor,fa=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=tm(r/2),c=fa(hs(e,0,o),t),l=fa(hs(e,o),t),f=c.length,u=l.length,s=0,d=0;s<f||d<u;)e[s+d]=s<f&&d<u?t(c[s],l[d])<=0?c[s++]:l[d++]:s<f?c[s++]:l[d++];return e},rm=fa,da=ft,Cr=q,ha=vp,jr=Ie,ke=B,Wt=X,vs=Or,ps=xe,nm=ca,am=Sp,im=Bt,om=Go,va=zt,ms=ss,pa=J,sm=pe,cm=ua,um=Rr,lm=Ue,gs=Oe,Q=Ne,fm=zn,ys=Mt,ws=fs,dm=la,Ar=oa,ht=dt,hm=se,vm=rm,pm=hm("iterator"),vt="URLSearchParams",bs=vt+"Iterator",Ss=va.set,ce=va.getterFor(vt),mm=va.getterFor(bs),Is=ha("fetch"),Lr=ha("Request"),Vt=ha("Headers"),ma=Lr&&Lr.prototype,$s=Vt&&Vt.prototype,gm=Cr.RegExp,ym=Cr.TypeError,ks=Cr.decodeURIComponent,wm=Cr.encodeURIComponent,bm=ke("".charAt),Ps=ke([].join),Ze=ke([].push),ga=ke("".replace),Sm=ke([].shift),Ts=ke([].splice),Es=ke("".split),Im=ke("".slice),$m=/\+/g,Os=Array(4),km=function(e){return Os[e-1]||(Os[e-1]=gm("((?:%[\\da-f]{2}){"+e+"})","gi"))},Pm=function(e){try{return ks(e)}catch{return e}},_s=function(e){var t=ga(e,$m," "),r=4;try{return ks(t)}catch{for(;r;)t=ga(t,km(r--),Pm);return t}},Tm=/[!'()~]|%20/g,Em={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Om=function(e){return Em[e]},Rs=function(e){return ga(wm(e),Tm,Om)},ya=om(function(t,r){Ss(this,{type:bs,target:ce(t).entries,index:0,kind:r})},vt,function(){var t=mm(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Ar(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Ar(a.key,!1);case"values":return Ar(a.value,!1)}return Ar([a.key,a.value],!1)},!0),Cs=function(e){this.entries=[],this.url=null,e!==void 0&&(gs(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?bm(e,0)==="?"?Im(e,1):e:Q(e)))};Cs.prototype={type:vt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=dm(e),n,a,i,o,c,l,f;if(r)for(n=ws(e,r),a=n.next;!(i=jr(a,n)).done;){if(o=ws(lm(i.value)),c=o.next,(l=jr(c,o)).done||(f=jr(c,o)).done||!jr(c,o).done)throw new ym("Expected sequence with length 2");Ze(t,{key:Q(l.value),value:Q(f.value)})}else for(var u in e)sm(e,u)&&Ze(t,{key:u,value:Q(e[u])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Es(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=Es(a,"="),Ze(t,{key:_s(Sm(i)),value:_s(Ps(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],Ze(t,Rs(n.key)+"="+Rs(n.value));return Ps(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ur=function(){ms(this,pt);var t=arguments.length>0?arguments[0]:void 0,r=Ss(this,new Cs(t));Wt||(this.size=r.entries.length)},pt=Ur.prototype;if(am(pt,{append:function(t,r){var n=ce(this);ht(arguments.length,2),Ze(n.entries,{key:Q(t),value:Q(r)}),Wt||this.length++,n.updateURL()},delete:function(e){for(var t=ce(this),r=ht(arguments.length,1),n=t.entries,a=Q(e),i=r<2?void 0:arguments[1],o=i===void 0?i:Q(i),c=0;c<n.length;){var l=n[c];if(l.key===a&&(o===void 0||l.value===o)){if(Ts(n,c,1),o!==void 0)break}else c++}Wt||(this.size=n.length),t.updateURL()},get:function(t){var r=ce(this).entries;ht(arguments.length,1);for(var n=Q(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=ce(this).entries;ht(arguments.length,1);for(var n=Q(t),a=[],i=0;i<r.length;i++)r[i].key===n&&Ze(a,r[i].value);return a},has:function(t){for(var r=ce(this).entries,n=ht(arguments.length,1),a=Q(t),i=n<2?void 0:arguments[1],o=i===void 0?i:Q(i),c=0;c<r.length;){var l=r[c++];if(l.key===a&&(o===void 0||l.value===o))return!0}return!1},set:function(t,r){var n=ce(this);ht(arguments.length,1);for(var a=n.entries,i=!1,o=Q(t),c=Q(r),l=0,f;l<a.length;l++)f=a[l],f.key===o&&(i?Ts(a,l--,1):(i=!0,f.value=c));i||Ze(a,{key:o,value:c}),Wt||(this.size=a.length),n.updateURL()},sort:function(){var t=ce(this);vm(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=ce(this).entries,n=cm(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 ya(this,"keys")},values:function(){return new ya(this,"values")},entries:function(){return new ya(this,"entries")}},{enumerable:!0}),ps(pt,pm,pt.entries,{name:"entries"}),ps(pt,"toString",function(){return ce(this).serialize()},{enumerable:!0}),Wt&&nm(pt,"size",{get:function(){return ce(this).entries.length},configurable:!0,enumerable:!0}),im(Ur,vt),da({global:!0,constructor:!0,forced:!vs},{URLSearchParams:Ur}),!vs&&pa(Vt)){var _m=ke($s.has),Rm=ke($s.set),js=function(e){if(gs(e)){var t=e.body,r;if(um(t)===vt)return r=e.headers?new Vt(e.headers):new Vt,_m(r,"content-type")||Rm(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),fm(e,{body:ys(0,Q(t)),headers:ys(0,r)})}return e};if(pa(Is)&&da({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return Is(t,arguments.length>1?js(arguments[1]):{})}}),pa(Lr)){var wa=function(t){return ms(this,ma),new Lr(t,arguments.length>1?js(arguments[1]):{})};ma.constructor=wa,wa.prototype=ma,da({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:wa})}}var Cm={URLSearchParams:Ur,getState:ce},jm=xe,xr=B,As=Ne,Am=dt,Ls=URLSearchParams,Nr=Ls.prototype,Lm=xr(Nr.append),Us=xr(Nr.delete),Um=xr(Nr.forEach),xm=xr([].push),ba=new Ls("a=1&a=2&b=3");ba.delete("a",1),ba.delete("b",void 0),ba+""!="a=2"&&jm(Nr,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return Us(this,e);var n=[];Um(this,function(s,d){xm(n,{key:d,value:s})}),Am(t,1);for(var a=As(e),i=As(r),o=0,c=0,l=!1,f=n.length,u;o<f;)u=n[o++],l||u.key===a?(l=!0,Us(this,u.key)):c++;for(;c<f;)u=n[c++],u.key===a&&u.value===i||Lm(this,u.key,u.value)},{enumerable:!0,unsafe:!0});var Nm=xe,xs=B,Dm=Ne,Mm=dt,Ns=URLSearchParams,Sa=Ns.prototype,Fm=xs(Sa.getAll),zm=xs(Sa.has),Ds=new Ns("a=1");(Ds.has("a",2)||!Ds.has("a",void 0))&&Nm(Sa,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return zm(this,t);var a=Fm(this,t);Mm(r,1);for(var i=Dm(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var Hm=X,Bm=B,Km=ca,Ia=URLSearchParams.prototype,Gm=Bm(Ia.forEach);Hm&&!("size"in Ia)&&Km(Ia,"size",{get:function(){var t=0;return Gm(this,function(){t++}),t},configurable:!0,enumerable:!0});var Wm=q,Ms=Wm,Vm=Ms;Vm.URLSearchParams;var $a=B,Zm=An,Ym=Ne,Jm=dr,Xm=$a("".charAt),Fs=$a("".charCodeAt),qm=$a("".slice),zs=function(e){return function(t,r){var n=Ym(Jm(t)),a=Zm(r),i=n.length,o,c;return a<0||a>=i?e?"":void 0:(o=Fs(n,a),o<55296||o>56319||a+1===i||(c=Fs(n,a+1))<56320||c>57343?e?Xm(n,a):o:e?qm(n,a,a+2):(o-55296<<10)+(c-56320)+65536)}},Hs={codeAt:zs(!1),charAt:zs(!0)},Qm=Hs.charAt,eg=Ne,Bs=zt,tg=Qo,Ks=oa,Gs="String Iterator",rg=Bs.set,ng=Bs.getterFor(Gs);tg(String,"String",function(e){rg(this,{type:Gs,string:eg(e),index:0})},function(){var t=ng(this),r=t.string,n=t.index,a;return n>=r.length?Ks(void 0,!0):(a=Qm(r,n),t.index+=a.length,Ks(a,!1))});var Ws=X,ag=B,ig=Ie,og=G,ka=mo,sg=ea,cg=Zn,ug=hr,lg=Ni,mt=Object.assign,Vs=Object.defineProperty,fg=ag([].concat),dg=!mt||og(function(){if(Ws&&mt({b:1},mt(Vs({},"a",{enumerable:!0,get:function(){Vs(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}),mt({},e)[r]!==7||ka(mt({},t)).join("")!==n})?function(t,r){for(var n=ug(t),a=arguments.length,i=1,o=sg.f,c=cg.f;a>i;)for(var l=lg(arguments[i++]),f=o?fg(ka(l),o(l)):ka(l),u=f.length,s=0,d;u>s;)d=f[s++],(!Ws||ig(c,l,d))&&(n[d]=l[d]);return n}:mt,hg=Ie,Zs=Ue,vg=Pn,pg=function(e,t,r){var n,a;Zs(e);try{if(n=vg(e,"return"),!n){if(t==="throw")throw r;return r}n=hg(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return Zs(n),r},mg=Ue,gg=pg,yg=function(e,t,r,n){try{return n?t(mg(r)[0],r[1]):t(r)}catch(a){gg(e,"throw",a)}},wg=se,bg=Dt,Sg=wg("iterator"),Ig=Array.prototype,$g=function(e){return e!==void 0&&(bg.Array===e||Ig[Sg]===e)},kg=B,Pg=G,Ys=J,Tg=Rr,Eg=ut,Og=Ao,Js=function(){},Xs=Eg("Reflect","construct"),Pa=/^\s*(?:class|function)\b/,_g=kg(Pa.exec),Rg=!Pa.test(Js),Zt=function(t){if(!Ys(t))return!1;try{return Xs(Js,[],t),!0}catch{return!1}},qs=function(t){if(!Ys(t))return!1;switch(Tg(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Rg||!!_g(Pa,Og(t))}catch{return!0}};qs.sham=!0;var Cg=!Xs||Pg(function(){var e;return Zt(Zt.call)||!Zt(Object)||!Zt(function(){e=!0})||e})?qs:Zt,jg=X,Ag=Se,Lg=Mt,Ug=function(e,t,r){jg?Ag.f(e,t,Lg(0,r)):e[t]=r},xg=ua,Ng=Ie,Dg=hr,Mg=yg,Fg=$g,zg=Cg,Hg=fo,Qs=Ug,Bg=fs,Kg=la,ec=Array,Gg=function(t){var r=Dg(t),n=zg(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=xg(i,a>2?arguments[2]:void 0));var c=Kg(r),l=0,f,u,s,d,h,m;if(c&&!(this===ec&&Fg(c)))for(u=n?new this:[],d=Bg(r,c),h=d.next;!(s=Ng(h,d)).done;l++)m=o?Mg(d,i,[s.value,l],!0):s.value,Qs(u,l,m);else for(f=Hg(r),u=n?new this(f):ec(f);f>l;l++)m=o?i(r[l],l):r[l],Qs(u,l,m);return u.length=l,u},Ye=B,Ta=2147483647,Yt=36,tc=1,Ea=26,Wg=38,Vg=700,Zg=72,Yg=128,Jg="-",Xg=/[^\0-\u007E]/,rc=/[.\u3002\uFF0E\uFF61]/g,nc="Overflow: input needs wider integers to process",Oa=Yt-tc,ac=RangeError,qg=Ye(rc.exec),gt=Math.floor,_a=String.fromCharCode,ic=Ye("".charCodeAt),oc=Ye([].join),De=Ye([].push),Qg=Ye("".replace),ey=Ye("".split),ty=Ye("".toLowerCase),ry=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=ic(e,r++);if(a>=55296&&a<=56319&&r<n){var i=ic(e,r++);(i&64512)===56320?De(t,((a&1023)<<10)+(i&1023)+65536):(De(t,a),r--)}else De(t,a)}return t},sc=function(e){return e+22+75*(e<26)},ny=function(e,t,r){var n=0;for(e=r?gt(e/Vg):e>>1,e+=gt(e/t);e>Oa*Ea>>1;)e=gt(e/Oa),n+=Yt;return gt(n+(Oa+1)*e/(e+Wg))},ay=function(e){var t=[];e=ry(e);var r=e.length,n=Yg,a=0,i=Zg,o,c;for(o=0;o<e.length;o++)c=e[o],c<128&&De(t,_a(c));var l=t.length,f=l;for(l&&De(t,Jg);f<r;){var u=Ta;for(o=0;o<e.length;o++)c=e[o],c>=n&&c<u&&(u=c);var s=f+1;if(u-n>gt((Ta-a)/s))throw new ac(nc);for(a+=(u-n)*s,n=u,o=0;o<e.length;o++){if(c=e[o],c<n&&++a>Ta)throw new ac(nc);if(c===n){for(var d=a,h=Yt;;){var m=h<=i?tc:h>=i+Ea?Ea:h-i;if(d<m)break;var S=d-m,g=Yt-m;De(t,_a(sc(m+S%g))),d=gt(S/g),h+=Yt}De(t,_a(sc(d))),i=ny(a,s,f===l),a=0,f++}}a++,n++}return oc(t,"")},iy=function(e){var t=[],r=ey(Qg(ty(e),rc,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],De(t,qg(Xg,a)?"xn--"+ay(a):a);return oc(t,".")},oy=ft,Ra=X,sy=Or,Ca=q,cc=ua,ue=B,Dr=xe,le=ca,cy=ss,ja=pe,Aa=dg,yt=Gg,ge=ds,uy=Hs.codeAt,ly=iy,_e=Ne,fy=Bt,dy=dt,uc=Cm,lc=zt,hy=lc.set,Mr=lc.getterFor("URL"),vy=uc.URLSearchParams,py=uc.getState,Jt=Ca.URL,La=Ca.TypeError,Fr=Ca.parseInt,my=Math.floor,fc=Math.pow,fe=ue("".charAt),ye=ue(/./.exec),Xt=ue([].join),gy=ue(1 .toString),yy=ue([].pop),wt=ue([].push),Ua=ue("".replace),wy=ue([].shift),by=ue("".split),qt=ue("".slice),zr=ue("".toLowerCase),Sy=ue([].unshift),Iy="Invalid authority",xa="Invalid scheme",Je="Invalid host",dc="Invalid port",hc=/[a-z]/i,$y=/[\d+-.a-z]/i,Na=/\d/,ky=/^0x/i,Py=/^[0-7]+$/,Ty=/^\d+$/,vc=/^[\da-f]+$/i,Ey=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Oy=/[\0\t\n\r #/:<>?@[\\\]^|]/,_y=/^[\u0000-\u0020]+/,Ry=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Cy=/[\t\n\r]/g,de,jy=function(e){var t=by(e,"."),r,n,a,i,o,c,l;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&&fe(i,0)==="0"&&(o=ye(ky,i)?16:8,i=qt(i,o===8?1:2)),i==="")c=0;else{if(!ye(o===10?Ty:o===8?Py:vc,i))return e;c=Fr(i,o)}wt(n,c)}for(a=0;a<r;a++)if(c=n[a],a===r-1){if(c>=fc(256,5-r))return null}else if(c>255)return null;for(l=yy(n),a=0;a<n.length;a++)l+=n[a]*fc(256,3-a);return l},Ay=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,c,l,f,u,s,d=function(){return fe(e,a)};if(d()===":"){if(fe(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&&ye(vc,d());)i=i*16+Fr(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(c=0;d();){if(l=null,c>0)if(d()==="."&&c<4)a++;else return;if(!ye(Na,d()))return;for(;ye(Na,d());){if(f=Fr(d(),10),l===null)l=f;else{if(l===0)return;l=l*10+f}if(l>255)return;a++}t[r]=t[r]*256+l,c++,(c===2||c===4)&&r++}if(c!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(u=r-n,r=7;r!==0&&u>0;)s=t[r],t[r--]=t[n+u-1],t[n+--u]=s;else if(r!==8)return;return t},Ly=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&&(t=n,r=a),t},Qt=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)Sy(t,e%256),e=my(e/256);return Xt(t,".")}else if(typeof e=="object"){for(t="",n=Ly(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=gy(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},Hr={},pc=Aa({},Hr,{" ":1,'"':1,"<":1,">":1,"`":1}),mc=Aa({},pc,{"#":1,"?":1,"{":1,"}":1}),Da=Aa({},mc,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Me=function(e,t){var r=uy(e,0);return r>32&&r<127&&!ja(t,e)?e:encodeURIComponent(e)},Br={ftp:21,file:null,http:80,https:443,ws:80,wss:443},er=function(e,t){var r;return e.length===2&&ye(hc,fe(e,0))&&((r=fe(e,1))===":"||!t&&r==="|")},gc=function(e){var t;return e.length>1&&er(qt(e,0,2))&&(e.length===2||(t=fe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},Uy=function(e){return e==="."||zr(e)==="%2e"},xy=function(e){return e=zr(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Ma={},yc={},Fa={},wc={},bc={},za={},Sc={},Ic={},Kr={},Gr={},Ha={},Ba={},Ka={},Ga={},$c={},Wa={},bt={},Pe={},kc={},Xe={},Re={},Va=function(e,t,r){var n=_e(e),a,i,o;if(t){if(i=this.parse(n),i)throw new La(i);this.searchParams=null}else{if(r!==void 0&&(a=new Va(r,!0)),i=this.parse(n,null,a),i)throw new La(i);o=py(new vy),o.bindURL(this),this.searchParams=o}};Va.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Ma,i=0,o="",c=!1,l=!1,f=!1,u,s,d,h;for(e=_e(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=Ua(e,_y,""),e=Ua(e,Ry,"$1")),e=Ua(e,Cy,""),u=yt(e);i<=u.length;){switch(s=u[i],a){case Ma:if(s&&ye(hc,s))o+=zr(s),a=yc;else{if(t)return xa;a=Fa;continue}break;case yc:if(s&&(ye($y,s)||s==="+"||s==="-"||s==="."))o+=zr(s);else if(s===":"){if(t&&(n.isSpecial()!==ja(Br,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Br[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ga:n.isSpecial()&&r&&r.scheme===n.scheme?a=wc:n.isSpecial()?a=Ic:u[i+1]==="/"?(a=bc,i++):(n.cannotBeABaseURL=!0,wt(n.path,""),a=kc)}else{if(t)return xa;o="",a=Fa,i=0;continue}break;case Fa:if(!r||r.cannotBeABaseURL&&s!=="#")return xa;if(r.cannotBeABaseURL&&s==="#"){n.scheme=r.scheme,n.path=ge(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Re;break}a=r.scheme==="file"?Ga:za;continue;case wc:if(s==="/"&&u[i+1]==="/")a=Kr,i++;else{a=za;continue}break;case bc:if(s==="/"){a=Gr;break}else{a=Pe;continue}case za:if(n.scheme=r.scheme,s===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query=r.query;else if(s==="/"||s==="\\"&&n.isSpecial())a=Sc;else if(s==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query="",a=Xe;else if(s==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.query=r.query,n.fragment="",a=Re;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=ge(r.path),n.path.length--,a=Pe;continue}break;case Sc:if(n.isSpecial()&&(s==="/"||s==="\\"))a=Kr;else if(s==="/")a=Gr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Pe;continue}break;case Ic:if(a=Kr,s!=="/"||fe(o,i+1)!=="/")continue;i++;break;case Kr:if(s!=="/"&&s!=="\\"){a=Gr;continue}break;case Gr:if(s==="@"){c&&(o="%40"+o),c=!0,d=yt(o);for(var m=0;m<d.length;m++){var S=d[m];if(S===":"&&!f){f=!0;continue}var g=Me(S,Da);f?n.password+=g:n.username+=g}o=""}else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(c&&o==="")return Iy;i-=yt(o).length+1,o="",a=Ha}else o+=s;break;case Ha:case Ba:if(t&&n.scheme==="file"){a=Wa;continue}else if(s===":"&&!l){if(o==="")return Je;if(h=n.parseHost(o),h)return h;if(o="",a=Ka,t===Ba)return}else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Je;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(h=n.parseHost(o),h)return h;if(o="",a=bt,t)return;continue}else s==="["?l=!0:s==="]"&&(l=!1),o+=s;break;case Ka:if(ye(Na,s))o+=s;else if(s===de||s==="/"||s==="?"||s==="#"||s==="\\"&&n.isSpecial()||t){if(o!==""){var $=Fr(o,10);if($>65535)return dc;n.port=n.isSpecial()&&$===Br[n.scheme]?null:$,o=""}if(t)return;a=bt;continue}else return dc;break;case Ga:if(n.scheme="file",s==="/"||s==="\\")a=$c;else if(r&&r.scheme==="file")switch(s){case de:n.host=r.host,n.path=ge(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=ge(r.path),n.query="",a=Xe;break;case"#":n.host=r.host,n.path=ge(r.path),n.query=r.query,n.fragment="",a=Re;break;default:gc(Xt(ge(u,i),""))||(n.host=r.host,n.path=ge(r.path),n.shortenPath()),a=Pe;continue}else{a=Pe;continue}break;case $c:if(s==="/"||s==="\\"){a=Wa;break}r&&r.scheme==="file"&&!gc(Xt(ge(u,i),""))&&(er(r.path[0],!0)?wt(n.path,r.path[0]):n.host=r.host),a=Pe;continue;case Wa:if(s===de||s==="/"||s==="\\"||s==="?"||s==="#"){if(!t&&er(o))a=Pe;else if(o===""){if(n.host="",t)return;a=bt}else{if(h=n.parseHost(o),h)return h;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=bt}continue}else o+=s;break;case bt:if(n.isSpecial()){if(a=Pe,s!=="/"&&s!=="\\")continue}else if(!t&&s==="?")n.query="",a=Xe;else if(!t&&s==="#")n.fragment="",a=Re;else if(s!==de&&(a=Pe,s!=="/"))continue;break;case Pe:if(s===de||s==="/"||s==="\\"&&n.isSpecial()||!t&&(s==="?"||s==="#")){if(xy(o)?(n.shortenPath(),s!=="/"&&!(s==="\\"&&n.isSpecial())&&wt(n.path,"")):Uy(o)?s!=="/"&&!(s==="\\"&&n.isSpecial())&&wt(n.path,""):(n.scheme==="file"&&!n.path.length&&er(o)&&(n.host&&(n.host=""),o=fe(o,0)+":"),wt(n.path,o)),o="",n.scheme==="file"&&(s===de||s==="?"||s==="#"))for(;n.path.length>1&&n.path[0]==="";)wy(n.path);s==="?"?(n.query="",a=Xe):s==="#"&&(n.fragment="",a=Re)}else o+=Me(s,mc);break;case kc:s==="?"?(n.query="",a=Xe):s==="#"?(n.fragment="",a=Re):s!==de&&(n.path[0]+=Me(s,Hr));break;case Xe:!t&&s==="#"?(n.fragment="",a=Re):s!==de&&(s==="'"&&n.isSpecial()?n.query+="%27":s==="#"?n.query+="%23":n.query+=Me(s,Hr));break;case Re:s!==de&&(n.fragment+=Me(s,pc));break}i++}},parseHost:function(e){var t,r,n;if(fe(e,0)==="["){if(fe(e,e.length-1)!=="]"||(t=Ay(qt(e,1,-1)),!t))return Je;this.host=t}else if(this.isSpecial()){if(e=ly(e),ye(Ey,e)||(t=jy(e),t===null))return Je;this.host=t}else{if(ye(Oy,e))return Je;for(t="",r=yt(e),n=0;n<r.length;n++)t+=Me(r[n],Hr);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return ja(Br,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!er(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,c=e.query,l=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=Qt(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+Xt(o,"/"):"",c!==null&&(f+="?"+c),l!==null&&(f+="#"+l),f},setHref:function(e){var t=this.parse(e);if(t)throw new La(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new St(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+Qt(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(_e(e)+":",Ma)},getUsername:function(){return this.username},setUsername:function(e){var t=yt(_e(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Me(t[r],Da)}},getPassword:function(){return this.password},setPassword:function(e){var t=yt(_e(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Me(t[r],Da)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?Qt(e):Qt(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ha)},getHostname:function(){var e=this.host;return e===null?"":Qt(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ba)},getPort:function(){var e=this.port;return e===null?"":_e(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=_e(e),e===""?this.port=null:this.parse(e,Ka))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+Xt(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,bt))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=_e(e),e===""?this.query=null:(fe(e,0)==="?"&&(e=qt(e,1)),this.query="",this.parse(e,Xe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=_e(e),e===""){this.fragment=null;return}fe(e,0)==="#"&&(e=qt(e,1)),this.fragment="",this.parse(e,Re)},update:function(){this.query=this.searchParams.serialize()||null}};var St=function(t){var r=cy(this,ee),n=dy(arguments.length,1)>1?arguments[1]:void 0,a=hy(r,new Va(t,!1,n));Ra||(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())},ee=St.prototype,he=function(e,t){return{get:function(){return Mr(this)[e]()},set:t&&function(r){return Mr(this)[t](r)},configurable:!0,enumerable:!0}};if(Ra&&(le(ee,"href",he("serialize","setHref")),le(ee,"origin",he("getOrigin")),le(ee,"protocol",he("getProtocol","setProtocol")),le(ee,"username",he("getUsername","setUsername")),le(ee,"password",he("getPassword","setPassword")),le(ee,"host",he("getHost","setHost")),le(ee,"hostname",he("getHostname","setHostname")),le(ee,"port",he("getPort","setPort")),le(ee,"pathname",he("getPathname","setPathname")),le(ee,"search",he("getSearch","setSearch")),le(ee,"searchParams",he("getSearchParams")),le(ee,"hash",he("getHash","setHash"))),Dr(ee,"toJSON",function(){return Mr(this).serialize()},{enumerable:!0}),Dr(ee,"toString",function(){return Mr(this).serialize()},{enumerable:!0}),Jt){var Pc=Jt.createObjectURL,Tc=Jt.revokeObjectURL;Pc&&Dr(St,"createObjectURL",cc(Pc,Jt)),Tc&&Dr(St,"revokeObjectURL",cc(Tc,Jt))}fy(St,"URL"),oy({global:!0,constructor:!0,forced:!sy,sham:!Ra},{URL:St});var Ny=ft,Dy=ut,Ec=G,My=dt,Oc=Ne,Fy=Or,Za=Dy("URL"),zy=Fy&&Ec(function(){Za.canParse()}),Hy=Ec(function(){return Za.canParse.length!==1});Ny({target:"URL",stat:!0,forced:!zy||Hy},{canParse:function(t){var r=My(arguments.length,1),n=Oc(t),a=r<2||arguments[1]===void 0?void 0:Oc(arguments[1]);try{return!!new Za(n,a)}catch{return!1}}});var By=ft,Ky=ut,Gy=dt,_c=Ne,Wy=Or,Vy=Ky("URL");By({target:"URL",stat:!0,forced:!Wy},{parse:function(t){var r=Gy(arguments.length,1),n=_c(t),a=r<2||arguments[1]===void 0?void 0:_c(arguments[1]);try{return new Vy(n,a)}catch{return null}}});var Zy=ft,Yy=Ie;Zy({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return Yy(URL.prototype.toString,this)}});var Jy=Ms;Jy.URL;var Xy={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},qy=$n,Ya=qy("span").classList,Rc=Ya&&Ya.constructor&&Ya.constructor.prototype,Qy=Rc===Object.prototype?void 0:Rc,Cc=q,jc=Xy,ew=Qy,tr=fp,Ac=br,tw=Bt,rw=se,Ja=rw("iterator"),Xa=tr.values,Lc=function(e,t){if(e){if(e[Ja]!==Xa)try{Ac(e,Ja,Xa)}catch{e[Ja]=Xa}if(tw(e,t,!0),jc[t]){for(var r in tr)if(e[r]!==tr[r])try{Ac(e,r,tr[r])}catch{e[r]=tr[r]}}}};for(var qa in jc)Lc(Cc[qa]&&Cc[qa].prototype,qa);Lc(ew,"DOMTokenList");function Fe(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Te(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}typeof SuppressedError=="function"&&SuppressedError;var qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ei(e,t){return e(t={exports:{}},t.exports),t.exports}var Qe=ei(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 c=a.locked.get(i);c===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(c.unshift(o),a.locked.set(i,c))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,c){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 c=o.pop();a.locked.set(i,o),c!==void 0&&setTimeout(c,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()}});Qa(Qe);var nw=Qa(ei(function(e,t){var r=qe&&qe.__awaiter||function(u,s,d,h){return new(d||(d=Promise))(function(m,S){function g(b){try{P(h.next(b))}catch(v){S(v)}}function $(b){try{P(h.throw(b))}catch(v){S(v)}}function P(b){b.done?m(b.value):new d(function(v){v(b.value)}).then(g,$)}P((h=h.apply(u,s||[])).next())})},n=qe&&qe.__generator||function(u,s){var d,h,m,S,g={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return S={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function $(P){return function(b){return function(v){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,h&&(m=2&v[0]?h.return:v[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,v[1])).done)return m;switch(h=0,m&&(v=[2&v[0],m.value]),v[0]){case 0:case 1:m=v;break;case 4:return g.label++,{value:v[1],done:!1};case 5:g.label++,h=v[1],v=[0];continue;case 7:v=g.ops.pop(),g.trys.pop();continue;default:if(m=g.trys,!((m=m.length>0&&m[m.length-1])||v[0]!==6&&v[0]!==2)){g=0;continue}if(v[0]===3&&(!m||v[1]>m[0]&&v[1]<m[3])){g.label=v[1];break}if(v[0]===6&&g.label<m[1]){g.label=m[1],m=v;break}if(m&&g.label<m[2]){g.label=m[2],g.ops.push(v);break}m[2]&&g.ops.pop(),g.trys.pop();continue}v=s.call(u,g)}catch(I){v=[6,I],h=0}finally{d=m=0}if(5&v[0])throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}([P,b])}}},a=qe;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},getItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return r(a,void 0,void 0,function(){return n(this,function(s){throw new Error("Unsupported")})})},setItem:function(u,s){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,s){return window.localStorage.setItem(u,s)}};function c(u){return new Promise(function(s){return setTimeout(s,u)})}function l(u){for(var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",h=0;h<u;h++)d+=s[Math.floor(Math.random()*s.length)];return d}var f=function(){function u(s){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(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=s,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(s,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var h,m,S,g,$,P,b;return n(this,function(v){switch(v.label){case 0:h=Date.now()+l(4),m=Date.now()+d,S=i+"-"+s,g=this.storageHandler===void 0?o:this.storageHandler,v.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return v.sent(),g.getItemSync(S)!==null?[3,5]:($=this.id+"-"+s+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return v.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:h,timeoutKey:$,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return v.sent(),(P=g.getItemSync(S))!==null&&(b=JSON.parse(P)).id===this.id&&b.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(S,h),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:v.sent(),v.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},u.prototype.refreshLockWhileAcquired=function(s,d){return r(this,void 0,void 0,function(){var h=this;return n(this,function(m){return setTimeout(function(){return r(h,void 0,void 0,function(){var S,g,$;return n(this,function(P){switch(P.label){case 0:return[4,Qe.default().lock(d)];case 1:return P.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(s))===null?(Qe.default().unlock(d),[2]):(($=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(s,JSON.stringify($)),Qe.default().unlock(d),this.refreshLockWhileAcquired(s,d),[2])):(Qe.default().unlock(d),[2])}})})},1e3),[2]})})},u.prototype.waitForSomethingToChange=function(s){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 m=!1,S=Date.now(),g=!1;function $(){if(g||(window.removeEventListener("storage",$),u.removeFromWaiting($),clearTimeout(P),g=!0),!m){m=!0;var b=50-(Date.now()-S);b>0?setTimeout(h,b):h(null)}}window.addEventListener("storage",$),u.addToWaiting($);var P=setTimeout($,Math.max(0,s-Date.now()))})];case 1:return d.sent(),[2]}})})},u.addToWaiting=function(s){this.removeFromWaiting(s),u.waiters!==void 0&&u.waiters.push(s)},u.removeFromWaiting=function(s){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(d){return d!==s}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(s){return s()})},u.prototype.releaseLock=function(s){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(s)];case 1:return[2,d.sent()]}})})},u.prototype.releaseLock__private__=function(s){return r(this,void 0,void 0,function(){var d,h,m,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,h=i+"-"+s,(m=d.getItemSync(h))===null?[2]:(S=JSON.parse(m)).id!==this.id?[3,2]:[4,Qe.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(h),Qe.default().unlock(S.iat),u.notifyWaiters(),g.label=2;case 2:return[2]}})})},u.lockCorrector=function(s){for(var d=Date.now()-5e3,h=s,m=[],S=0;;){var g=h.keySync(S);if(g===null)break;m.push(g),S++}for(var $=!1,P=0;P<m.length;P++){var b=m[P];if(b.includes(i)){var v=h.getItemSync(b);if(v!==null){var I=JSON.parse(v);(I.timeRefreshed===void 0&&I.timeAcquired<d||I.timeRefreshed!==void 0&&I.timeRefreshed<d)&&(h.removeItemSync(b),$=!0)}}}$&&u.notifyWaiters()},u.waiters=void 0,u}();t.default=f}));const aw={timeoutInSeconds:60},Uc={name:"auth0-spa-js",version:"2.1.3"},xc=()=>Date.now();let ae=class ji extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ji.prototype)}static fromPayload({error:t,error_description:r}){return new ji(t,r)}},iw=class $l extends ae{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,$l.prototype)}},ti=class kl extends ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,kl.prototype)}},ow=class Pl extends ti{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Pl.prototype)}},sw=class Tl extends ae{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Tl.prototype)}},cw=class El extends ae{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,El.prototype)}},Nc=class Ol extends ae{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Dc(t,["default"])}', scope: '${Dc(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Ol.prototype)}};function Dc(e,t=[]){return e&&!t.includes(e)?e:""}const Wr=()=>window.crypto,ri=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Wr().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},Mc=e=>btoa(e),ni=e=>{var{clientId:t}=e,r=Te(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()},Fc=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),uw=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},lw=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([uw(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},fw=async(e,t,r,n,a,i,o)=>{return c={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},l=i,new Promise(function(f,u){const s=new MessageChannel;s.port1.onmessage=function(d){d.data.error?u(new Error(d.data.error)):f(d.data),s.port1.close()},l.postMessage(c,[s.port2])});var c,l},dw=async(e,t,r,n,a,i,o=1e4)=>a?fw(e,t,r,n,o,a,i):lw(e,n,o);async function hw(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:c}=e,l=Te(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=c?ni(l):JSON.stringify(l);return await async function(u,s,d,h,m,S,g){let $,P=null;for(let A=0;A<3;A++)try{$=await dw(u,d,h,m,S,g,s),P=null;break}catch(M){P=M}if(P)throw P;const b=$.json,{error:v,error_description:I}=b,O=Te(b,["error","error_description"]),{ok:_}=$;if(!_){const A=I||`HTTP error. Unable to fetch ${u}`;throw v==="mfa_required"?new cw(v,A,O.mfa_token):v==="missing_refresh_token"?new Nc(d,h):new ae(v||"request_error",A)}return O}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||Uc))}},t,c)}const Vr=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let et=class Ai{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 Ai({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Ai({scope:r,audience:n,clientId:a})}},vw=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@@"))}},zc=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)}}()}},pw=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||xc}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 c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(t,c);l&&(a=await this.cache.get(l))}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 et({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 et({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=et.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),c=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],l=i.scope&&c.reduce((f,u)=>f&&o.has(u),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&l})[0]}},mw=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 rr=e=>typeof e=="number",gw=["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"],yw=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[c,l,f]=o;if(o.length!==3||!c||!l||!f)throw new Error("ID token could not be decoded");const u=JSON.parse(Fc(l)),s={__raw:i},d={};return Object.keys(u).forEach(h=>{s[h]=u[h],gw.includes(h)||(d[h]=u[h])}),{encoded:{header:c,payload:l,signature:f},header:JSON.parse(Fc(c)),claims:s,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&&!rr(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||!rr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!rr(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&&rr(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&&rr(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 tt=ei(function(e,t){var r=qe&&qe.__assign||function(){return r=Object.assign||function(l){for(var f,u=1,s=arguments.length;u<s;u++)for(var d in f=arguments[u])Object.prototype.hasOwnProperty.call(f,d)&&(l[d]=f[d]);return l},r.apply(this,arguments)};function n(l,f){if(!f)return"";var u="; "+l;return f===!0?u:u+"="+f}function a(l,f,u){return encodeURIComponent(l).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(s){if(typeof s.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*s.expires),s.expires=d}return n("Expires",s.expires?s.expires.toUTCString():"")+n("Domain",s.domain)+n("Path",s.path)+n("Secure",s.secure)+n("SameSite",s.sameSite)}(u)}function i(l){for(var f={},u=l?l.split("; "):[],s=/(%[\dA-F]{2})+/gi,d=0;d<u.length;d++){var h=u[d].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{f[h[0].replace(s,decodeURIComponent)]=m.replace(s,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function c(l,f,u){document.cookie=a(l,f,r({path:"/"},u))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(l){return o()[l]},t.set=c,t.remove=function(l,f){c(l,"",r(r({},f),{expires:-1}))}});Qa(tt),tt.encode,tt.parse,tt.getAll;var ww=tt.get,Hc=tt.set,Bc=tt.remove;const It={get(e){const t=ww(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),Hc(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bc(e,r)}},bw={get(e){return It.get(e)||It.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),Hc(`_legacy_${e}`,JSON.stringify(t),n),It.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),Bc(e,r),It.remove(e,t),It.remove(`_legacy_${e}`,t)}},Sw={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 Iw(e,t,r){var n=t===void 0?null:t,a=function(l,f){var u=atob(l);if(f){for(var s=new Uint8Array(u.length),d=0,h=u.length;d<h;++d)s[d]=u.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(s.buffer))}return u}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
-
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),
|
|
1
|
+
var sesamyJs=function(Le){"use strict";var tP=Object.defineProperty;var rP=(Le,le,H)=>le in Le?tP(Le,le,{enumerable:!0,configurable:!0,writable:!0,value:H}):Le[le]=H;var be=(Le,le,H)=>rP(Le,typeof le!="symbol"?le+"":le,H);var le=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},H=function(e){try{return!!e()}catch{return!0}},ov=H,Ur=!ov(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ns=Ur,as=Function.prototype,ia=as.call,sv=ns&&as.bind.bind(ia,ia),K=ns?sv:function(e){return function(){return ia.apply(e,arguments)}},is=K,cv=is({}.toString),uv=is("".slice),xr=function(e){return uv(cv(e),8,-1)},lv=K,fv=H,dv=xr,oa=Object,vv=lv("".split),os=fv(function(){return!oa("z").propertyIsEnumerable(0)})?function(e){return dv(e)==="String"?vv(e,""):oa(e)}:oa,Dr=function(e){return e==null},hv=Dr,pv=TypeError,Mr=function(e){if(hv(e))throw new pv("Can't call method on "+e);return e},mv=os,gv=Mr,er=function(e){return mv(gv(e))},tr=function(e){return e&&e.Math===Math&&e},G=tr(typeof globalThis=="object"&&globalThis)||tr(typeof window=="object"&&window)||tr(typeof self=="object"&&self)||tr(typeof le=="object"&&le)||tr(typeof le=="object"&&le)||function(){return this}()||Function("return this")(),ss={exports:{}},yv=!1,cs=G,wv=Object.defineProperty,sa=function(e,t){try{wv(cs,e,{value:t,configurable:!0,writable:!0})}catch{cs[e]=t}return t},bv=G,Sv=sa,us="__core-js_shared__",ls=ss.exports=bv[us]||Sv(us,{});(ls.versions||(ls.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ca=ss.exports,fs=ca,ds=function(e,t){return fs[e]||(fs[e]=t||{})},$v=Mr,Iv=Object,Fr=function(e){return Iv($v(e))},Ev=K,Tv=Fr,Pv=Ev({}.hasOwnProperty),fe=Object.hasOwn||function(t,r){return Pv(Tv(t),r)},Ov=K,kv=0,_v=Math.random(),Rv=Ov(1 .toString),vs=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Rv(++kv+_v,36)},zr=typeof navigator<"u"&&String(navigator.userAgent)||"",hs=G,ua=zr,ps=hs.process,ms=hs.Deno,gs=ps&&ps.versions||ms&&ms.version,ys=gs&&gs.v8,Se,Br;ys&&(Se=ys.split("."),Br=Se[0]>0&&Se[0]<4?1:+(Se[0]+Se[1])),!Br&&ua&&(Se=ua.match(/Edge\/(\d+)/),(!Se||Se[1]>=74)&&(Se=ua.match(/Chrome\/(\d+)/),Se&&(Br=+Se[1])));var ws=Br,bs=ws,Cv=H,Av=G,jv=Av.String,Ss=!!Object.getOwnPropertySymbols&&!Cv(function(){var e=Symbol("symbol detection");return!jv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&bs&&bs<41}),Lv=Ss,$s=Lv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Nv=G,Uv=ds,Is=fe,xv=vs,Dv=Ss,Mv=$s,wt=Nv.Symbol,la=Uv("wks"),Fv=Mv?wt.for||wt:wt&&wt.withoutSetter||xv,X=function(e){return Is(la,e)||(la[e]=Dv&&Is(wt,e)?wt[e]:Fv("Symbol."+e)),la[e]},fa=typeof document=="object"&&document.all,W=typeof fa>"u"&&fa!==void 0?function(e){return typeof e=="function"||e===fa}:function(e){return typeof e=="function"},zv=W,de=function(e){return typeof e=="object"?e!==null:zv(e)},Bv=de,Hv=String,Kv=TypeError,$e=function(e){if(Bv(e))return e;throw new Kv(Hv(e)+" is not an object")},Es={},Gv=H,q=!Gv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Wv=q,Vv=H,Ts=Wv&&Vv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ke={},Zv=G,Ps=de,da=Zv.document,Jv=Ps(da)&&Ps(da.createElement),Hr=function(e){return Jv?da.createElement(e):{}},Yv=q,Xv=H,qv=Hr,Os=!Yv&&!Xv(function(){return Object.defineProperty(qv("div"),"a",{get:function(){return 7}}).a!==7}),Qv=Ur,Kr=Function.prototype.call,te=Qv?Kr.bind(Kr):function(){return Kr.apply(Kr,arguments)},va=G,eh=W,th=function(e){return eh(e)?e:void 0},Ie=function(e,t){return arguments.length<2?th(va[e]):va[e]&&va[e][t]},rh=K,Gr=rh({}.isPrototypeOf),nh=Ie,ah=W,ih=Gr,oh=$s,sh=Object,ks=oh?function(e){return typeof e=="symbol"}:function(e){var t=nh("Symbol");return ah(t)&&ih(t.prototype,sh(e))},ch=String,Wr=function(e){try{return ch(e)}catch{return"Object"}},uh=W,lh=Wr,fh=TypeError,_e=function(e){if(uh(e))return e;throw new fh(lh(e)+" is not a function")},dh=_e,vh=Dr,ha=function(e,t){var r=e[t];return vh(r)?void 0:dh(r)},pa=te,ma=W,ga=de,hh=TypeError,ph=function(e,t){var r,n;if(t==="string"&&ma(r=e.toString)&&!ga(n=pa(r,e))||ma(r=e.valueOf)&&!ga(n=pa(r,e))||t!=="string"&&ma(r=e.toString)&&!ga(n=pa(r,e)))return n;throw new hh("Can't convert object to primitive value")},mh=te,_s=de,Rs=ks,gh=ha,yh=ph,wh=X,bh=TypeError,Sh=wh("toPrimitive"),$h=function(e,t){if(!_s(e)||Rs(e))return e;var r=gh(e,Sh),n;if(r){if(t===void 0&&(t="default"),n=mh(r,e,t),!_s(n)||Rs(n))return n;throw new bh("Can't convert object to primitive value")}return t===void 0&&(t="number"),yh(e,t)},Ih=$h,Eh=ks,Cs=function(e){var t=Ih(e,"string");return Eh(t)?t:t+""},Th=q,Ph=Os,Oh=Ts,Vr=$e,As=Cs,kh=TypeError,ya=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,wa="enumerable",ba="configurable",Sa="writable";ke.f=Th?Oh?function(t,r,n){if(Vr(t),r=As(r),Vr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&Sa in n&&!n[Sa]){var a=_h(t,r);a&&a[Sa]&&(t[r]=n.value,n={configurable:ba in n?n[ba]:a[ba],enumerable:wa in n?n[wa]:a[wa],writable:!1})}return ya(t,r,n)}:ya:function(t,r,n){if(Vr(t),r=As(r),Vr(n),Ph)try{return ya(t,r,n)}catch{}if("get"in n||"set"in n)throw new kh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Rh=Math.ceil,Ch=Math.floor,Ah=Math.trunc||function(t){var r=+t;return(r>0?Ch:Rh)(r)},jh=Ah,$a=function(e){var t=+e;return t!==t||t===0?0:jh(t)},Lh=$a,Nh=Math.max,Uh=Math.min,xh=function(e,t){var r=Lh(e);return r<0?Nh(r+t,0):Uh(r,t)},Dh=$a,Mh=Math.min,Fh=function(e){var t=Dh(e);return t>0?Mh(t,9007199254740991):0},zh=Fh,Ia=function(e){return zh(e.length)},Bh=er,Hh=xh,Kh=Ia,js=function(e){return function(t,r,n){var a=Bh(t),i=Kh(a);if(i===0)return!e&&-1;var o=Hh(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}},Gh={includes:js(!0),indexOf:js(!1)},Ea={},Wh=K,Ta=fe,Vh=er,Zh=Gh.indexOf,Jh=Ea,Ls=Wh([].push),Ns=function(e,t){var r=Vh(e),n=0,a=[],i;for(i in r)!Ta(Jh,i)&&Ta(r,i)&&Ls(a,i);for(;t.length>n;)Ta(r,i=t[n++])&&(~Zh(a,i)||Ls(a,i));return a},Pa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yh=Ns,Xh=Pa,Us=Object.keys||function(t){return Yh(t,Xh)},qh=q,Qh=Ts,ep=ke,tp=$e,rp=er,np=Us;Es.f=qh&&!Qh?Object.defineProperties:function(t,r){tp(t);for(var n=rp(r),a=np(r),i=a.length,o=0,s;i>o;)ep.f(t,s=a[o++],n[s]);return t};var ap=Ie,xs=ap("document","documentElement"),ip=ds,op=vs,Ds=ip("keys"),Oa=function(e){return Ds[e]||(Ds[e]=op(e))},sp=$e,cp=Es,Ms=Pa,up=Ea,lp=xs,fp=Hr,dp=Oa,Fs=">",zs="<",ka="prototype",_a="script",Bs=dp("IE_PROTO"),Ra=function(){},Hs=function(e){return zs+_a+Fs+e+zs+"/"+_a+Fs},Ks=function(e){e.write(Hs("")),e.close();var t=e.parentWindow.Object;return e=null,t},vp=function(){var e=fp("iframe"),t="java"+_a+":",r;return e.style.display="none",lp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Hs("document.F=Object")),r.close(),r.F},Zr,Jr=function(){try{Zr=new ActiveXObject("htmlfile")}catch{}Jr=typeof document<"u"?document.domain&&Zr?Ks(Zr):vp():Ks(Zr);for(var e=Ms.length;e--;)delete Jr[ka][Ms[e]];return Jr()};up[Bs]=!0;var Yr=Object.create||function(t,r){var n;return t!==null?(Ra[ka]=sp(t),n=new Ra,Ra[ka]=null,n[Bs]=t):n=Jr(),r===void 0?n:cp.f(n,r)},hp=X,pp=Yr,mp=ke.f,Ca=hp("unscopables"),Aa=Array.prototype;Aa[Ca]===void 0&&mp(Aa,Ca,{configurable:!0,value:pp(null)});var gp=function(e){Aa[Ca][e]=!0},rr={},yp=G,wp=W,Gs=yp.WeakMap,bp=wp(Gs)&&/native code/.test(String(Gs)),Qe=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Sp=q,$p=ke,Ip=Qe,et=Sp?function(e,t,r){return $p.f(e,t,Ip(1,r))}:function(e,t,r){return e[t]=r,e},Ep=bp,Ws=G,Tp=de,Pp=et,ja=fe,La=ca,Op=Oa,kp=Ea,Vs="Object already initialized",Na=Ws.TypeError,_p=Ws.WeakMap,Xr,nr,qr,Rp=function(e){return qr(e)?nr(e):Xr(e,{})},Cp=function(e){return function(t){var r;if(!Tp(t)||(r=nr(t)).type!==e)throw new Na("Incompatible receiver, "+e+" required");return r}};if(Ep||La.state){var Re=La.state||(La.state=new _p);Re.get=Re.get,Re.has=Re.has,Re.set=Re.set,Xr=function(e,t){if(Re.has(e))throw new Na(Vs);return t.facade=e,Re.set(e,t),t},nr=function(e){return Re.get(e)||{}},qr=function(e){return Re.has(e)}}else{var bt=Op("state");kp[bt]=!0,Xr=function(e,t){if(ja(e,bt))throw new Na(Vs);return t.facade=e,Pp(e,bt,t),t},nr=function(e){return ja(e,bt)?e[bt]:{}},qr=function(e){return ja(e,bt)}}var St={set:Xr,get:nr,has:qr,enforce:Rp,getterFor:Cp},Ua={},xa={},Zs={}.propertyIsEnumerable,Js=Object.getOwnPropertyDescriptor,Ap=Js&&!Zs.call({1:2},1);xa.f=Ap?function(t){var r=Js(this,t);return!!r&&r.enumerable}:Zs;var jp=q,Lp=te,Np=xa,Up=Qe,xp=er,Dp=Cs,Mp=fe,Fp=Os,Ys=Object.getOwnPropertyDescriptor;Ua.f=jp?Ys:function(t,r){if(t=xp(t),r=Dp(r),Fp)try{return Ys(t,r)}catch{}if(Mp(t,r))return Up(!Lp(Np.f,t,r),t[r])};var Xs={exports:{}},Da=q,zp=fe,qs=Function.prototype,Bp=Da&&Object.getOwnPropertyDescriptor,Ma=zp(qs,"name"),Hp=Ma&&(function(){}).name==="something",Kp=Ma&&(!Da||Da&&Bp(qs,"name").configurable),Qs={EXISTS:Ma,PROPER:Hp,CONFIGURABLE:Kp},Gp=K,Wp=W,Fa=ca,Vp=Gp(Function.toString);Wp(Fa.inspectSource)||(Fa.inspectSource=function(e){return Vp(e)});var za=Fa.inspectSource,Ba=K,Zp=H,Jp=W,Qr=fe,Ha=q,Yp=Qs.CONFIGURABLE,Xp=za,ec=St,qp=ec.enforce,Qp=ec.get,tc=String,en=Object.defineProperty,em=Ba("".slice),tm=Ba("".replace),rm=Ba([].join),nm=Ha&&!Zp(function(){return en(function(){},"length",{value:8}).length!==8}),am=String(String).split("String"),im=Xs.exports=function(e,t,r){em(tc(t),0,7)==="Symbol("&&(t="["+tm(tc(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Qr(e,"name")||Yp&&e.name!==t)&&(Ha?en(e,"name",{value:t,configurable:!0}):e.name=t),nm&&r&&Qr(r,"arity")&&e.length!==r.arity&&en(e,"length",{value:r.arity});try{r&&Qr(r,"constructor")&&r.constructor?Ha&&en(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=qp(e);return Qr(n,"source")||(n.source=rm(am,typeof t=="string"?t:"")),e};Function.prototype.toString=im(function(){return Jp(this)&&Qp(this).source||Xp(this)},"toString");var rc=Xs.exports,om=W,sm=ke,cm=rc,um=sa,ve=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(om(r)&&cm(r,i,n),n.global)a?e[t]=r:um(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:sm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},nc={},lm=Ns,fm=Pa,dm=fm.concat("length","prototype");nc.f=Object.getOwnPropertyNames||function(t){return lm(t,dm)};var Ka={};Ka.f=Object.getOwnPropertySymbols;var vm=Ie,hm=K,pm=nc,mm=Ka,gm=$e,ym=hm([].concat),wm=vm("Reflect","ownKeys")||function(t){var r=pm.f(gm(t)),n=mm.f;return n?ym(r,n(t)):r},ac=fe,bm=wm,Sm=Ua,$m=ke,ic=function(e,t,r){for(var n=bm(t),a=$m.f,i=Sm.f,o=0;o<n.length;o++){var s=n[o];!ac(e,s)&&!(r&&ac(r,s))&&a(e,s,i(t,s))}},Im=H,Em=W,Tm=/#|\.prototype\./,ar=function(e,t){var r=Om[Pm(e)];return r===_m?!0:r===km?!1:Em(t)?Im(t):!!t},Pm=ar.normalize=function(e){return String(e).replace(Tm,".").toLowerCase()},Om=ar.data={},km=ar.NATIVE="N",_m=ar.POLYFILL="P",oc=ar,tn=G,Rm=Ua.f,Cm=et,Am=ve,jm=sa,Lm=ic,Nm=oc,Q=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=tn:a?o=tn[r]||jm(r,{}):o=tn[r]&&tn[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Rm(o,s),u=l&&l.value):u=o[s],i=Nm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Lm(f,u)}(e.sham||u&&u.sham)&&Cm(f,"sham",!0),Am(o,s,f,e)}},Um=H,xm=!Um(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Dm=fe,Mm=W,Fm=Fr,zm=Oa,Bm=xm,sc=zm("IE_PROTO"),Ga=Object,Hm=Ga.prototype,Wa=Bm?Ga.getPrototypeOf:function(e){var t=Fm(e);if(Dm(t,sc))return t[sc];var r=t.constructor;return Mm(r)&&t instanceof r?r.prototype:t instanceof Ga?Hm:null},Km=H,Gm=W,Wm=de,cc=Wa,Vm=ve,Zm=X,Va=Zm("iterator"),uc=!1,tt,Za,Ja;[].keys&&(Ja=[].keys(),"next"in Ja?(Za=cc(cc(Ja)),Za!==Object.prototype&&(tt=Za)):uc=!0);var Jm=!Wm(tt)||Km(function(){var e={};return tt[Va].call(e)!==e});Jm&&(tt={}),Gm(tt[Va])||Vm(tt,Va,function(){return this});var lc={IteratorPrototype:tt,BUGGY_SAFARI_ITERATORS:uc},Ym=ke.f,Xm=fe,qm=X,fc=qm("toStringTag"),$t=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Xm(e,fc)&&Ym(e,fc,{configurable:!0,value:t})},Qm=lc.IteratorPrototype,eg=Yr,tg=Qe,rg=$t,ng=rr,ag=function(){return this},dc=function(e,t,r,n){var a=t+" Iterator";return e.prototype=eg(Qm,{next:tg(+!n,r)}),rg(e,a,!1),ng[a]=ag,e},ig=K,og=_e,sg=function(e,t,r){try{return ig(og(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},cg=de,ug=function(e){return cg(e)||e===null},lg=ug,fg=String,dg=TypeError,vg=function(e){if(lg(e))return e;throw new dg("Can't set "+fg(e)+" as a prototype")},hg=sg,pg=de,mg=Mr,gg=vg,Ya=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=hg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return mg(a),gg(i),pg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),yg=Q,wg=te,vc=Qs,bg=W,Sg=dc,hc=Wa,pc=Ya,$g=$t,Ig=et,Xa=ve,Eg=X,Tg=rr,mc=lc,Pg=vc.PROPER,Og=vc.CONFIGURABLE,gc=mc.IteratorPrototype,rn=mc.BUGGY_SAFARI_ITERATORS,ir=Eg("iterator"),yc="keys",or="values",wc="entries",kg=function(){return this},bc=function(e,t,r,n,a,i,o){Sg(r,t,n);var s=function(E){if(E===a&&d)return d;if(!rn&&E&&E in l)return l[E];switch(E){case yc:return function(){return new r(this,E)};case or:return function(){return new r(this,E)};case wc:return function(){return new r(this,E)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[ir]||l["@@iterator"]||a&&l[a],d=!rn&&c||s(a),v=t==="Array"&&l.entries||c,p,S,g;if(v&&(p=hc(v.call(new e)),p!==Object.prototype&&p.next&&(hc(p)!==gc&&(pc?pc(p,gc):bg(p[ir])||Xa(p,ir,kg)),$g(p,u,!0))),Pg&&a===or&&c&&c.name!==or&&(Og?Ig(l,"name",or):(f=!0,d=function(){return wg(c,this)})),a)if(S={values:s(or),keys:i?d:s(yc),entries:s(wc)},o)for(g in S)(rn||f||!(g in l))&&Xa(l,g,S[g]);else yg({target:t,proto:!0,forced:rn||f},S);return l[ir]!==d&&Xa(l,ir,d,{name:a}),Tg[t]=d,S},qa=function(e,t){return{value:e,done:t}},_g=er,Qa=gp,Sc=rr,$c=St,Rg=ke.f,Cg=bc,nn=qa,Ag=q,Ic="Array Iterator",jg=$c.set,Lg=$c.getterFor(Ic),Ng=Cg(Array,"Array",function(e,t){jg(this,{type:Ic,target:_g(e),index:0,kind:t})},function(){var e=Lg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,nn(void 0,!0);switch(e.kind){case"keys":return nn(r,!1);case"values":return nn(t[r],!1)}return nn([r,t[r]],!1)},"values"),Ec=Sc.Arguments=Sc.Array;if(Qa("keys"),Qa("values"),Qa("entries"),Ag&&Ec.name!=="values")try{Rg(Ec,"name",{value:"values"})}catch{}var Tc=G,Ug=q,xg=Object.getOwnPropertyDescriptor,Pc=function(e){if(!Ug)return Tc[e];var t=xg(Tc,e);return t&&t.value},Dg=H,Mg=X,Fg=q,Oc=yv,zg=Mg("iterator"),an=!Dg(function(){var e=new URL("b?a=1&b=2&c=3","http://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),Oc&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Oc||!Fg)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[zg]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("http://x",void 0).host!=="x"}),kc=rc,Bg=ke,on=function(e,t,r){return r.get&&kc(r.get,t,{getter:!0}),r.set&&kc(r.set,t,{setter:!0}),Bg.f(e,t,r)},Hg=ve,Kg=function(e,t,r){for(var n in t)Hg(e,n,t[n],r);return e},Gg=Gr,Wg=TypeError,ei=function(e,t){if(Gg(t,e))return e;throw new Wg("Incorrect invocation")},Vg=xr,Zg=K,Jg=function(e){if(Vg(e)==="Function")return Zg(e)},_c=Jg,Yg=_e,Xg=Ur,qg=_c(_c.bind),It=function(e,t){return Yg(e),t===void 0?e:Xg?qg(e,t):function(){return e.apply(t,arguments)}},Qg=X,ey=Qg("toStringTag"),Rc={};Rc[ey]="z";var ti=String(Rc)==="[object z]",ty=ti,ry=W,sn=xr,ny=X,ay=ny("toStringTag"),iy=Object,oy=sn(function(){return arguments}())==="Arguments",sy=function(e,t){try{return e[t]}catch{}},sr=ty?sn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=sy(t=iy(e),ay))=="string"?r:oy?sn(t):(n=sn(t))==="Object"&&ry(t.callee)?"Arguments":n},cy=sr,uy=String,Ne=function(e){if(cy(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return uy(e)},ly=sr,Cc=ha,fy=Dr,dy=rr,vy=X,hy=vy("iterator"),cn=function(e){if(!fy(e))return Cc(e,hy)||Cc(e,"@@iterator")||dy[ly(e)]},py=te,my=_e,gy=$e,yy=Wr,wy=cn,by=TypeError,ri=function(e,t){var r=arguments.length<2?wy(e):t;if(my(r))return gy(py(r,e));throw new by(yy(e)+" is not iterable")},Sy=TypeError,rt=function(e,t){if(e<t)throw new Sy("Not enough arguments");return e},$y=K,ni=$y([].slice),Ac=ni,Iy=Math.floor,ai=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=Iy(r/2),s=ai(Ac(e,0,o),t),u=ai(Ac(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},Ey=ai,ii=Q,un=G,oi=Pc,ln=te,Ce=K,cr=q,jc=an,Lc=ve,Ty=on,Py=Kg,Oy=$t,ky=dc,si=St,Nc=ei,ci=W,_y=fe,Ry=It,Cy=sr,Ay=$e,Uc=de,re=Ne,jy=Yr,xc=Qe,Dc=ri,Ly=cn,fn=qa,Et=rt,Ny=X,Uy=Ey,xy=Ny("iterator"),Tt="URLSearchParams",Mc=Tt+"Iterator",Fc=si.set,he=si.getterFor(Tt),Dy=si.getterFor(Mc),zc=oi("fetch"),dn=oi("Request"),ur=oi("Headers"),ui=dn&&dn.prototype,Bc=ur&&ur.prototype,My=un.RegExp,Fy=un.TypeError,Hc=un.decodeURIComponent,zy=un.encodeURIComponent,By=Ce("".charAt),Kc=Ce([].join),nt=Ce([].push),li=Ce("".replace),Hy=Ce([].shift),Gc=Ce([].splice),Wc=Ce("".split),Ky=Ce("".slice),Gy=/\+/g,Vc=Array(4),Wy=function(e){return Vc[e-1]||(Vc[e-1]=My("((?:%[\\da-f]{2}){"+e+"})","gi"))},Vy=function(e){try{return Hc(e)}catch{return e}},Zc=function(e){var t=li(e,Gy," "),r=4;try{return Hc(t)}catch{for(;r;)t=li(t,Wy(r--),Vy);return t}},Zy=/[!'()~]|%20/g,Jy={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Yy=function(e){return Jy[e]},Jc=function(e){return li(zy(e),Zy,Yy)},fi=ky(function(t,r){Fc(this,{type:Mc,target:he(t).entries,index:0,kind:r})},Tt,function(){var t=Dy(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,fn(void 0,!0);var a=r[n];switch(t.kind){case"keys":return fn(a.key,!1);case"values":return fn(a.value,!1)}return fn([a.key,a.value],!1)},!0),Yc=function(e){this.entries=[],this.url=null,e!==void 0&&(Uc(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?By(e,0)==="?"?Ky(e,1):e:re(e)))};Yc.prototype={type:Tt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Ly(e),n,a,i,o,s,u,f;if(r)for(n=Dc(e,r),a=n.next;!(i=ln(a,n)).done;){if(o=Dc(Ay(i.value)),s=o.next,(u=ln(s,o)).done||(f=ln(s,o)).done||!ln(s,o).done)throw new Fy("Expected sequence with length 2");nt(t,{key:re(u.value),value:re(f.value)})}else for(var l in e)_y(e,l)&&nt(t,{key:l,value:re(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Wc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=Wc(a,"="),nt(t,{key:Zc(Hy(i)),value:Zc(Kc(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],nt(t,Jc(n.key)+"="+Jc(n.value));return Kc(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var vn=function(){Nc(this,Pt);var t=arguments.length>0?arguments[0]:void 0,r=Fc(this,new Yc(t));cr||(this.size=r.entries.length)},Pt=vn.prototype;if(Py(Pt,{append:function(t,r){var n=he(this);Et(arguments.length,2),nt(n.entries,{key:re(t),value:re(r)}),cr||this.length++,n.updateURL()},delete:function(e){for(var t=he(this),r=Et(arguments.length,1),n=t.entries,a=re(e),i=r<2?void 0:arguments[1],o=i===void 0?i:re(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(Gc(n,s,1),o!==void 0)break}else s++}cr||(this.size=n.length),t.updateURL()},get:function(t){var r=he(this).entries;Et(arguments.length,1);for(var n=re(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=he(this).entries;Et(arguments.length,1);for(var n=re(t),a=[],i=0;i<r.length;i++)r[i].key===n&&nt(a,r[i].value);return a},has:function(t){for(var r=he(this).entries,n=Et(arguments.length,1),a=re(t),i=n<2?void 0:arguments[1],o=i===void 0?i:re(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=he(this);Et(arguments.length,1);for(var a=n.entries,i=!1,o=re(t),s=re(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?Gc(a,u--,1):(i=!0,f.value=s));i||nt(a,{key:o,value:s}),cr||(this.size=a.length),n.updateURL()},sort:function(){var t=he(this);Uy(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=he(this).entries,n=Ry(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 fi(this,"keys")},values:function(){return new fi(this,"values")},entries:function(){return new fi(this,"entries")}},{enumerable:!0}),Lc(Pt,xy,Pt.entries,{name:"entries"}),Lc(Pt,"toString",function(){return he(this).serialize()},{enumerable:!0}),cr&&Ty(Pt,"size",{get:function(){return he(this).entries.length},configurable:!0,enumerable:!0}),Oy(vn,Tt),ii({global:!0,constructor:!0,forced:!jc},{URLSearchParams:vn}),!jc&&ci(ur)){var Xy=Ce(Bc.has),qy=Ce(Bc.set),Xc=function(e){if(Uc(e)){var t=e.body,r;if(Cy(t)===Tt)return r=e.headers?new ur(e.headers):new ur,Xy(r,"content-type")||qy(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),jy(e,{body:xc(0,re(t)),headers:xc(0,r)})}return e};if(ci(zc)&&ii({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return zc(t,arguments.length>1?Xc(arguments[1]):{})}}),ci(dn)){var di=function(t){return Nc(this,ui),new dn(t,arguments.length>1?Xc(arguments[1]):{})};ui.constructor=di,di.prototype=ui,ii({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:di})}}var Qy={URLSearchParams:vn,getState:he},ew=ve,hn=K,qc=Ne,tw=rt,Qc=URLSearchParams,pn=Qc.prototype,rw=hn(pn.append),eu=hn(pn.delete),nw=hn(pn.forEach),aw=hn([].push),vi=new Qc("a=1&a=2&b=3");vi.delete("a",1),vi.delete("b",void 0),vi+""!="a=2"&&ew(pn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return eu(this,e);var n=[];nw(this,function(c,d){aw(n,{key:d,value:c})}),tw(t,1);for(var a=qc(e),i=qc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,eu(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||rw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var iw=ve,tu=K,ow=Ne,sw=rt,ru=URLSearchParams,hi=ru.prototype,cw=tu(hi.getAll),uw=tu(hi.has),nu=new ru("a=1");(nu.has("a",2)||!nu.has("a",void 0))&&iw(hi,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return uw(this,t);var a=cw(this,t);sw(r,1);for(var i=ow(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var lw=q,fw=K,dw=on,pi=URLSearchParams.prototype,vw=fw(pi.forEach);lw&&!("size"in pi)&&dw(pi,"size",{get:function(){var t=0;return vw(this,function(){t++}),t},configurable:!0,enumerable:!0});var hw=G,mi=hw,pw=mi;pw.URLSearchParams;var gi=K,mw=$a,gw=Ne,yw=Mr,ww=gi("".charAt),au=gi("".charCodeAt),bw=gi("".slice),iu=function(e){return function(t,r){var n=gw(yw(t)),a=mw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=au(n,a),o<55296||o>56319||a+1===i||(s=au(n,a+1))<56320||s>57343?e?ww(n,a):o:e?bw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},ou={codeAt:iu(!1),charAt:iu(!0)},Sw=ou.charAt,$w=Ne,su=St,Iw=bc,cu=qa,uu="String Iterator",Ew=su.set,Tw=su.getterFor(uu);Iw(String,"String",function(e){Ew(this,{type:uu,string:$w(e),index:0})},function(){var t=Tw(this),r=t.string,n=t.index,a;return n>=r.length?cu(void 0,!0):(a=Sw(r,n),t.index+=a.length,cu(a,!1))});var lu=q,Pw=K,Ow=te,kw=H,yi=Us,_w=Ka,Rw=xa,Cw=Fr,Aw=os,Ot=Object.assign,fu=Object.defineProperty,jw=Pw([].concat),Lw=!Ot||kw(function(){if(lu&&Ot({b:1},Ot(fu({},"a",{enumerable:!0,get:function(){fu(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}),Ot({},e)[r]!==7||yi(Ot({},t)).join("")!==n})?function(t,r){for(var n=Cw(t),a=arguments.length,i=1,o=_w.f,s=Rw.f;a>i;)for(var u=Aw(arguments[i++]),f=o?jw(yi(u),o(u)):yi(u),l=f.length,c=0,d;l>c;)d=f[c++],(!lu||Ow(s,u,d))&&(n[d]=u[d]);return n}:Ot,Nw=te,du=$e,Uw=ha,vu=function(e,t,r){var n,a;du(e);try{if(n=Uw(e,"return"),!n){if(t==="throw")throw r;return r}n=Nw(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return du(n),r},xw=$e,Dw=vu,Mw=function(e,t,r,n){try{return n?t(xw(r)[0],r[1]):t(r)}catch(a){Dw(e,"throw",a)}},Fw=X,zw=rr,Bw=Fw("iterator"),Hw=Array.prototype,hu=function(e){return e!==void 0&&(zw.Array===e||Hw[Bw]===e)},Kw=K,Gw=H,pu=W,Ww=sr,Vw=Ie,Zw=za,mu=function(){},gu=Vw("Reflect","construct"),wi=/^\s*(?:class|function)\b/,Jw=Kw(wi.exec),Yw=!wi.test(mu),lr=function(t){if(!pu(t))return!1;try{return gu(mu,[],t),!0}catch{return!1}},yu=function(t){if(!pu(t))return!1;switch(Ww(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Yw||!!Jw(wi,Zw(t))}catch{return!0}};yu.sham=!0;var wu=!gu||Gw(function(){var e;return lr(lr.call)||!lr(Object)||!lr(function(){e=!0})||e})?yu:lr,Xw=q,qw=ke,Qw=Qe,eb=function(e,t,r){Xw?qw.f(e,t,Qw(0,r)):e[t]=r},tb=It,rb=te,nb=Fr,ab=Mw,ib=hu,ob=wu,sb=Ia,bu=eb,cb=ri,ub=cn,Su=Array,lb=function(t){var r=nb(t),n=ob(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=tb(i,a>2?arguments[2]:void 0));var s=ub(r),u=0,f,l,c,d,v,p;if(s&&!(this===Su&&ib(s)))for(l=n?new this:[],d=cb(r,s),v=d.next;!(c=rb(v,d)).done;u++)p=o?ab(d,i,[c.value,u],!0):c.value,bu(l,u,p);else for(f=sb(r),l=n?new this(f):Su(f);f>u;u++)p=o?i(r[u],u):r[u],bu(l,u,p);return l.length=u,l},at=K,bi=2147483647,fr=36,$u=1,Si=26,fb=38,db=700,vb=72,hb=128,pb="-",mb=/[^\0-\u007E]/,Iu=/[.\u3002\uFF0E\uFF61]/g,Eu="Overflow: input needs wider integers to process",$i=fr-$u,Tu=RangeError,gb=at(Iu.exec),kt=Math.floor,Ii=String.fromCharCode,Pu=at("".charCodeAt),Ou=at([].join),He=at([].push),yb=at("".replace),wb=at("".split),bb=at("".toLowerCase),Sb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=Pu(e,r++);if(a>=55296&&a<=56319&&r<n){var i=Pu(e,r++);(i&64512)===56320?He(t,((a&1023)<<10)+(i&1023)+65536):(He(t,a),r--)}else He(t,a)}return t},ku=function(e){return e+22+75*(e<26)},$b=function(e,t,r){var n=0;for(e=r?kt(e/db):e>>1,e+=kt(e/t);e>$i*Si>>1;)e=kt(e/$i),n+=fr;return kt(n+($i+1)*e/(e+fb))},Ib=function(e){var t=[];e=Sb(e);var r=e.length,n=hb,a=0,i=vb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&He(t,Ii(s));var u=t.length,f=u;for(u&&He(t,pb);f<r;){var l=bi;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>kt((bi-a)/c))throw new Tu(Eu);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>bi)throw new Tu(Eu);if(s===n){for(var d=a,v=fr;;){var p=v<=i?$u:v>=i+Si?Si:v-i;if(d<p)break;var S=d-p,g=fr-p;He(t,Ii(ku(p+S%g))),d=kt(S/g),v+=fr}He(t,Ii(ku(d))),i=$b(a,c,f===u),a=0,f++}}a++,n++}return Ou(t,"")},Eb=function(e){var t=[],r=wb(yb(bb(e),Iu,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],He(t,gb(mb,a)?"xn--"+Ib(a):a);return Ou(t,".")},Tb=Q,Ei=q,Pb=an,Ti=G,_u=It,pe=K,mn=ve,me=on,Ob=ei,Pi=fe,Oi=Lw,_t=lb,Ee=ni,kb=ou.codeAt,_b=Eb,Ue=Ne,Rb=$t,Cb=rt,Ru=Qy,Cu=St,Ab=Cu.set,gn=Cu.getterFor("URL"),jb=Ru.URLSearchParams,Lb=Ru.getState,dr=Ti.URL,ki=Ti.TypeError,yn=Ti.parseInt,Nb=Math.floor,Au=Math.pow,ge=pe("".charAt),Te=pe(/./.exec),vr=pe([].join),Ub=pe(1 .toString),xb=pe([].pop),Rt=pe([].push),_i=pe("".replace),Db=pe([].shift),Mb=pe("".split),hr=pe("".slice),wn=pe("".toLowerCase),Fb=pe([].unshift),zb="Invalid authority",Ri="Invalid scheme",it="Invalid host",ju="Invalid port",Lu=/[a-z]/i,Bb=/[\d+-.a-z]/i,Ci=/\d/,Hb=/^0x/i,Kb=/^[0-7]+$/,Gb=/^\d+$/,Nu=/^[\da-f]+$/i,Wb=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Vb=/[\0\t\n\r #/:<>?@[\\\]^|]/,Zb=/^[\u0000-\u0020]+/,Jb=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Yb=/[\t\n\r]/g,ye,Xb=function(e){var t=Mb(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&&ge(i,0)==="0"&&(o=Te(Hb,i)?16:8,i=hr(i,o===8?1:2)),i==="")s=0;else{if(!Te(o===10?Gb:o===8?Kb:Nu,i))return e;s=yn(i,o)}Rt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Au(256,5-r))return null}else if(s>255)return null;for(u=xb(n),a=0;a<n.length;a++)u+=n[a]*Au(256,3-a);return u},qb=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 ge(e,a)};if(d()===":"){if(ge(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Te(Nu,d());)i=i*16+yn(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Te(Ci,d()))return;for(;Te(Ci,d());){if(f=yn(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},Qb=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&&(t=n,r=a),t},pr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)Fb(t,e%256),e=Nb(e/256);return vr(t,".")}else if(typeof e=="object"){for(t="",n=Qb(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=Ub(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},bn={},Uu=Oi({},bn,{" ":1,'"':1,"<":1,">":1,"`":1}),xu=Oi({},Uu,{"#":1,"?":1,"{":1,"}":1}),Ai=Oi({},xu,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Ke=function(e,t){var r=kb(e,0);return r>32&&r<127&&!Pi(t,e)?e:encodeURIComponent(e)},Sn={ftp:21,file:null,http:80,https:443,ws:80,wss:443},mr=function(e,t){var r;return e.length===2&&Te(Lu,ge(e,0))&&((r=ge(e,1))===":"||!t&&r==="|")},Du=function(e){var t;return e.length>1&&mr(hr(e,0,2))&&(e.length===2||(t=ge(e,2))==="/"||t==="\\"||t==="?"||t==="#")},eS=function(e){return e==="."||wn(e)==="%2e"},tS=function(e){return e=wn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},ji={},Mu={},Li={},Fu={},zu={},Ni={},Bu={},Hu={},$n={},In={},Ui={},xi={},Di={},Mi={},Ku={},Fi={},Ct={},Ae={},Gu={},ot={},xe={},zi=function(e,t,r){var n=Ue(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 zi(r,!0)),i=this.parse(n,null,a),i)throw new ki(i);o=Lb(new jb),o.bindURL(this),this.searchParams=o}};zi.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||ji,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ue(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=_i(e,Zb,""),e=_i(e,Jb,"$1")),e=_i(e,Yb,""),l=_t(e);i<=l.length;){switch(c=l[i],a){case ji:if(c&&Te(Lu,c))o+=wn(c),a=Mu;else{if(t)return Ri;a=Li;continue}break;case Mu:if(c&&(Te(Bb,c)||c==="+"||c==="-"||c==="."))o+=wn(c);else if(c===":"){if(t&&(n.isSpecial()!==Pi(Sn,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Sn[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Mi:n.isSpecial()&&r&&r.scheme===n.scheme?a=Fu:n.isSpecial()?a=Hu:l[i+1]==="/"?(a=zu,i++):(n.cannotBeABaseURL=!0,Rt(n.path,""),a=Gu)}else{if(t)return Ri;o="",a=Li,i=0;continue}break;case Li:if(!r||r.cannotBeABaseURL&&c!=="#")return Ri;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=Ee(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=xe;break}a=r.scheme==="file"?Mi:Ni;continue;case Fu:if(c==="/"&&l[i+1]==="/")a=$n,i++;else{a=Ni;continue}break;case zu:if(c==="/"){a=In;break}else{a=Ae;continue}case Ni: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=Ee(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Bu;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=ot;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=xe;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=Ae;continue}break;case Bu:if(n.isSpecial()&&(c==="/"||c==="\\"))a=$n;else if(c==="/")a=In;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=Ae;continue}break;case Hu:if(a=$n,c!=="/"||ge(o,i+1)!=="/")continue;i++;break;case $n:if(c!=="/"&&c!=="\\"){a=In;continue}break;case In:if(c==="@"){s&&(o="%40"+o),s=!0,d=_t(o);for(var p=0;p<d.length;p++){var S=d[p];if(S===":"&&!f){f=!0;continue}var g=Ke(S,Ai);f?n.password+=g:n.username+=g}o=""}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return zb;i-=_t(o).length+1,o="",a=Ui}else o+=c;break;case Ui:case xi:if(t&&n.scheme==="file"){a=Fi;continue}else if(c===":"&&!u){if(o==="")return it;if(v=n.parseHost(o),v)return v;if(o="",a=Di,t===xi)return}else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return it;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=Ct,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Di:if(Te(Ci,c))o+=c;else if(c===ye||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var E=yn(o,10);if(E>65535)return ju;n.port=n.isSpecial()&&E===Sn[n.scheme]?null:E,o=""}if(t)return;a=Ct;continue}else return ju;break;case Mi:if(n.scheme="file",c==="/"||c==="\\")a=Ku;else if(r&&r.scheme==="file")switch(c){case ye: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=ot;break;case"#":n.host=r.host,n.path=Ee(r.path),n.query=r.query,n.fragment="",a=xe;break;default:Du(vr(Ee(l,i),""))||(n.host=r.host,n.path=Ee(r.path),n.shortenPath()),a=Ae;continue}else{a=Ae;continue}break;case Ku:if(c==="/"||c==="\\"){a=Fi;break}r&&r.scheme==="file"&&!Du(vr(Ee(l,i),""))&&(mr(r.path[0],!0)?Rt(n.path,r.path[0]):n.host=r.host),a=Ae;continue;case Fi:if(c===ye||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&mr(o))a=Ae;else if(o===""){if(n.host="",t)return;a=Ct}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=Ct}continue}else o+=c;break;case Ct:if(n.isSpecial()){if(a=Ae,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=ot;else if(!t&&c==="#")n.fragment="",a=xe;else if(c!==ye&&(a=Ae,c!=="/"))continue;break;case Ae:if(c===ye||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(tS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Rt(n.path,"")):eS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Rt(n.path,""):(n.scheme==="file"&&!n.path.length&&mr(o)&&(n.host&&(n.host=""),o=ge(o,0)+":"),Rt(n.path,o)),o="",n.scheme==="file"&&(c===ye||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)Db(n.path);c==="?"?(n.query="",a=ot):c==="#"&&(n.fragment="",a=xe)}else o+=Ke(c,xu);break;case Gu:c==="?"?(n.query="",a=ot):c==="#"?(n.fragment="",a=xe):c!==ye&&(n.path[0]+=Ke(c,bn));break;case ot:!t&&c==="#"?(n.fragment="",a=xe):c!==ye&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Ke(c,bn));break;case xe:c!==ye&&(n.fragment+=Ke(c,Uu));break}i++}},parseHost:function(e){var t,r,n;if(ge(e,0)==="["){if(ge(e,e.length-1)!=="]"||(t=qb(hr(e,1,-1)),!t))return it;this.host=t}else if(this.isSpecial()){if(e=_b(e),Te(Wb,e)||(t=Xb(e),t===null))return it;this.host=t}else{if(Te(Vb,e))return it;for(t="",r=_t(e),n=0;n<r.length;n++)t+=Ke(r[n],bn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Pi(Sn,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!mr(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+=pr(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 At(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+pr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ue(e)+":",ji)},getUsername:function(){return this.username},setUsername:function(e){var t=_t(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Ke(t[r],Ai)}},getPassword:function(){return this.password},setPassword:function(e){var t=_t(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Ke(t[r],Ai)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?pr(e):pr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Ui)},getHostname:function(){var e=this.host;return e===null?"":pr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,xi)},getPort:function(){var e=this.port;return e===null?"":Ue(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ue(e),e===""?this.port=null:this.parse(e,Di))},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,Ct))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ue(e),e===""?this.query=null:(ge(e,0)==="?"&&(e=hr(e,1)),this.query="",this.parse(e,ot)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ue(e),e===""){this.fragment=null;return}ge(e,0)==="#"&&(e=hr(e,1)),this.fragment="",this.parse(e,xe)},update:function(){this.query=this.searchParams.serialize()||null}};var At=function(t){var r=Ob(this,ne),n=Cb(arguments.length,1)>1?arguments[1]:void 0,a=Ab(r,new zi(t,!1,n));Ei||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},ne=At.prototype,we=function(e,t){return{get:function(){return gn(this)[e]()},set:t&&function(r){return gn(this)[t](r)},configurable:!0,enumerable:!0}};if(Ei&&(me(ne,"href",we("serialize","setHref")),me(ne,"origin",we("getOrigin")),me(ne,"protocol",we("getProtocol","setProtocol")),me(ne,"username",we("getUsername","setUsername")),me(ne,"password",we("getPassword","setPassword")),me(ne,"host",we("getHost","setHost")),me(ne,"hostname",we("getHostname","setHostname")),me(ne,"port",we("getPort","setPort")),me(ne,"pathname",we("getPathname","setPathname")),me(ne,"search",we("getSearch","setSearch")),me(ne,"searchParams",we("getSearchParams")),me(ne,"hash",we("getHash","setHash"))),mn(ne,"toJSON",function(){return gn(this).serialize()},{enumerable:!0}),mn(ne,"toString",function(){return gn(this).serialize()},{enumerable:!0}),dr){var Wu=dr.createObjectURL,Vu=dr.revokeObjectURL;Wu&&mn(At,"createObjectURL",_u(Wu,dr)),Vu&&mn(At,"revokeObjectURL",_u(Vu,dr))}Rb(At,"URL"),Tb({global:!0,constructor:!0,forced:!Pb,sham:!Ei},{URL:At});var rS=Q,nS=Ie,Zu=H,aS=rt,Ju=Ne,iS=an,Bi=nS("URL"),oS=iS&&Zu(function(){Bi.canParse()}),sS=Zu(function(){return Bi.canParse.length!==1});rS({target:"URL",stat:!0,forced:!oS||sS},{canParse:function(t){var r=aS(arguments.length,1),n=Ju(t),a=r<2||arguments[1]===void 0?void 0:Ju(arguments[1]);try{return!!new Bi(n,a)}catch{return!1}}});var cS=Q,uS=Ie,lS=rt,Yu=Ne,fS=an,dS=uS("URL");cS({target:"URL",stat:!0,forced:!fS},{parse:function(t){var r=lS(arguments.length,1),n=Yu(t),a=r<2||arguments[1]===void 0?void 0:Yu(arguments[1]);try{return new dS(n,a)}catch{return null}}});var vS=Q,hS=te;vS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return hS(URL.prototype.toString,this)}});var pS=mi;pS.URL;var mS={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},gS=Hr,Hi=gS("span").classList,Xu=Hi&&Hi.constructor&&Hi.constructor.prototype,yS=Xu===Object.prototype?void 0:Xu,qu=G,Qu=mS,wS=yS,gr=Ng,el=et,bS=$t,SS=X,Ki=SS("iterator"),Gi=gr.values,tl=function(e,t){if(e){if(e[Ki]!==Gi)try{el(e,Ki,Gi)}catch{e[Ki]=Gi}if(bS(e,t,!0),Qu[t]){for(var r in gr)if(e[r]!==gr[r])try{el(e,r,gr[r])}catch{e[r]=gr[r]}}}};for(var Wi in Qu)tl(qu[Wi]&&qu[Wi].prototype,Wi);tl(wS,"DOMTokenList");var $S=de,IS=et,ES=function(e,t){$S(t)&&"cause"in t&&IS(e,"cause",t.cause)},TS=K,rl=Error,PS=TS("".replace),OS=function(e){return String(new rl(e).stack)}("zxcasd"),nl=/\n\s*at [^:]*:[^\n]*/,kS=nl.test(OS),_S=function(e,t){if(kS&&typeof e=="string"&&!rl.prepareStackTrace)for(;t--;)e=PS(e,nl,"");return e},RS=H,CS=Qe,AS=!RS(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",CS(1,7)),e.stack!==7):!0}),jS=et,LS=_S,NS=AS,al=Error.captureStackTrace,US=function(e,t,r,n){NS&&(al?al(e,t):jS(e,"stack",LS(r,n)))},xS=It,DS=te,MS=$e,FS=Wr,zS=hu,BS=Ia,il=Gr,HS=ri,KS=cn,ol=vu,GS=TypeError,En=function(e,t){this.stopped=e,this.result=t},sl=En.prototype,yr=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=xS(t,n),f,l,c,d,v,p,S,g=function(I){return f&&ol(f,"normal",I),new En(!0,I)},E=function(I){return a?(MS(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=KS(e),!l)throw new GS(FS(e)+" is not iterable");if(zS(l)){for(c=0,d=BS(e);d>c;c++)if(v=E(e[c]),v&&il(sl,v))return v;return new En(!1)}f=HS(e,l)}for(p=i?e.next:f.next;!(S=DS(p,f)).done;){try{v=E(S.value)}catch(I){ol(f,"throw",I)}if(typeof v=="object"&&v&&il(sl,v))return v}return new En(!1)},WS=Ne,VS=function(e,t){return e===void 0?arguments.length<2?"":t:WS(e)},ZS=Q,JS=Gr,YS=Wa,Tn=Ya,XS=ic,cl=Yr,Vi=et,Zi=Qe,qS=ES,QS=US,e$=yr,t$=VS,r$=X,n$=r$("toStringTag"),Pn=Error,a$=[].push,jt=function(t,r){var n=JS(Ji,this),a;Tn?a=Tn(new Pn,n?YS(this):Ji):(a=n?this:cl(Ji),Vi(a,n$,"Error")),r!==void 0&&Vi(a,"message",t$(r)),QS(a,jt,a.stack,1),arguments.length>2&&qS(a,arguments[2]);var i=[];return e$(t,a$,{that:i}),Vi(a,"errors",i),a};Tn?Tn(jt,Pn):XS(jt,Pn,{name:!0});var Ji=jt.prototype=cl(Pn.prototype,{constructor:Zi(1,jt),message:Zi(1,""),name:Zi(1,"AggregateError")});ZS({global:!0,constructor:!0,arity:2},{AggregateError:jt});var i$=ti,o$=sr,s$=i$?{}.toString:function(){return"[object "+o$(this)+"]"},c$=ti,u$=ve,l$=s$;c$||u$(Object.prototype,"toString",l$,{unsafe:!0});var f$=G,d$=xr,On=d$(f$.process)==="process",v$=Ie,h$=on,p$=X,m$=q,ul=p$("species"),g$=function(e){var t=v$(e);m$&&t&&!t[ul]&&h$(t,ul,{configurable:!0,get:function(){return this}})},y$=wu,w$=Wr,b$=TypeError,S$=function(e){if(y$(e))return e;throw new b$(w$(e)+" is not a constructor")},ll=$e,$$=S$,I$=Dr,E$=X,T$=E$("species"),fl=function(e,t){var r=ll(e).constructor,n;return r===void 0||I$(n=ll(r)[T$])?t:$$(n)},P$=Ur,dl=Function.prototype,vl=dl.apply,hl=dl.call,O$=typeof Reflect=="object"&&Reflect.apply||(P$?hl.bind(vl):function(){return hl.apply(vl,arguments)}),k$=zr,pl=/(?:ipad|iphone|ipod).*applewebkit/i.test(k$),se=G,_$=O$,R$=It,ml=W,C$=fe,gl=H,yl=xs,A$=ni,wl=Hr,j$=rt,L$=pl,N$=On,Yi=se.setImmediate,Xi=se.clearImmediate,U$=se.process,qi=se.Dispatch,x$=se.Function,bl=se.MessageChannel,D$=se.String,Qi=0,wr={},Sl="onreadystatechange",br,st,eo,to;gl(function(){br=se.location});var ro=function(e){if(C$(wr,e)){var t=wr[e];delete wr[e],t()}},no=function(e){return function(){ro(e)}},$l=function(e){ro(e.data)},Il=function(e){se.postMessage(D$(e),br.protocol+"//"+br.host)};(!Yi||!Xi)&&(Yi=function(t){j$(arguments.length,1);var r=ml(t)?t:x$(t),n=A$(arguments,1);return wr[++Qi]=function(){_$(r,void 0,n)},st(Qi),Qi},Xi=function(t){delete wr[t]},N$?st=function(e){U$.nextTick(no(e))}:qi&&qi.now?st=function(e){qi.now(no(e))}:bl&&!L$?(eo=new bl,to=eo.port2,eo.port1.onmessage=$l,st=R$(to.postMessage,to)):se.addEventListener&&ml(se.postMessage)&&!se.importScripts&&br&&br.protocol!=="file:"&&!gl(Il)?(st=Il,se.addEventListener("message",$l,!1)):Sl in wl("script")?st=function(e){yl.appendChild(wl("script"))[Sl]=function(){yl.removeChild(this),ro(e)}}:st=function(e){setTimeout(no(e),0)});var El={set:Yi,clear:Xi},Tl=function(){this.head=null,this.tail=null};Tl.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 Pl=Tl,M$=zr,F$=/ipad|iphone|ipod/i.test(M$)&&typeof Pebble<"u",z$=zr,B$=/web0s(?!.*chrome)/i.test(z$),Lt=G,H$=Pc,Ol=It,ao=El.set,K$=Pl,G$=pl,W$=F$,V$=B$,io=On,kl=Lt.MutationObserver||Lt.WebKitMutationObserver,_l=Lt.document,Rl=Lt.process,kn=Lt.Promise,oo=H$("queueMicrotask"),Nt,so,co,_n,Cl;if(!oo){var Rn=new K$,Cn=function(){var e,t;for(io&&(e=Rl.domain)&&e.exit();t=Rn.get();)try{t()}catch(r){throw Rn.head&&Nt(),r}e&&e.enter()};!G$&&!io&&!V$&&kl&&_l?(so=!0,co=_l.createTextNode(""),new kl(Cn).observe(co,{characterData:!0}),Nt=function(){co.data=so=!so}):!W$&&kn&&kn.resolve?(_n=kn.resolve(void 0),_n.constructor=kn,Cl=Ol(_n.then,_n),Nt=function(){Cl(Cn)}):io?Nt=function(){Rl.nextTick(Cn)}:(ao=Ol(ao,Lt),Nt=function(){ao(Cn)}),oo=function(e){Rn.head||Nt(),Rn.add(e)}}var Z$=oo,J$=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Sr=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},Y$=G,$r=Y$.Promise,Al=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",X$=Al,q$=On,Q$=!X$&&!q$&&typeof window=="object"&&typeof document=="object",eI=G,Ir=$r,tI=W,rI=oc,nI=za,aI=X,iI=Q$,oI=Al,uo=ws;Ir&&Ir.prototype;var sI=aI("species"),lo=!1,jl=tI(eI.PromiseRejectionEvent),cI=rI("Promise",function(){var e=nI(Ir),t=e!==String(Ir);if(!t&&uo===66)return!0;if(!uo||uo<51||!/native code/.test(e)){var r=new Ir(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[sI]=n,lo=r.then(function(){})instanceof n,!lo)return!0}return!t&&(iI||oI)&&!jl}),Er={CONSTRUCTOR:cI,REJECTION_EVENT:jl,SUBCLASSING:lo},De={},Ll=_e,uI=TypeError,lI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new uI("Bad Promise constructor");t=n,r=a}),this.resolve=Ll(t),this.reject=Ll(r)};De.f=function(e){return new lI(e)};var fI=Q,An=On,Ge=G,Ut=te,Nl=ve,Ul=Ya,dI=$t,vI=g$,hI=_e,jn=W,pI=de,mI=ei,gI=fl,xl=El.set,fo=Z$,yI=J$,wI=Sr,bI=Pl,Dl=St,Ln=$r,vo=Er,Ml=De,Nn="Promise",Fl=vo.CONSTRUCTOR,SI=vo.REJECTION_EVENT,$I=vo.SUBCLASSING,ho=Dl.getterFor(Nn),II=Dl.set,xt=Ln&&Ln.prototype,ct=Ln,Un=xt,zl=Ge.TypeError,po=Ge.document,mo=Ge.process,go=Ml.f,EI=go,TI=!!(po&&po.createEvent&&Ge.dispatchEvent),Bl="unhandledrejection",PI="rejectionhandled",Hl=0,Kl=1,OI=2,yo=1,Gl=2,xn,Wl,kI,Vl,Zl=function(e){var t;return pI(e)&&jn(t=e.then)?t:!1},Jl=function(e,t){var r=t.value,n=t.state===Kl,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===Gl&&RI(t),t.rejection=yo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new zl("Promise-chain cycle")):(f=Zl(u))?Ut(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},Yl=function(e,t){e.notified||(e.notified=!0,fo(function(){for(var r=e.reactions,n;n=r.get();)Jl(n,e);e.notified=!1,t&&!e.rejection&&_I(e)}))},Xl=function(e,t,r){var n,a;TI?(n=po.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Ge.dispatchEvent(n)):n={promise:t,reason:r},!SI&&(a=Ge["on"+e])?a(n):e===Bl&&yI("Unhandled promise rejection",r)},_I=function(e){Ut(xl,Ge,function(){var t=e.facade,r=e.value,n=ql(e),a;if(n&&(a=wI(function(){An?mo.emit("unhandledRejection",r,t):Xl(Bl,t,r)}),e.rejection=An||ql(e)?Gl:yo,a.error))throw a.value})},ql=function(e){return e.rejection!==yo&&!e.parent},RI=function(e){Ut(xl,Ge,function(){var t=e.facade;An?mo.emit("rejectionHandled",t):Xl(PI,t,e.value)})},Dt=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=OI,Yl(e,!0))},wo=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new zl("Promise can't be resolved itself");var n=Zl(t);n?fo(function(){var a={done:!1};try{Ut(n,t,Dt(wo,a,e),Dt(Mt,a,e))}catch(i){Mt(a,i,e)}}):(e.value=t,e.state=Kl,Yl(e,!1))}catch(a){Mt({done:!1},a,e)}}};if(Fl&&(ct=function(t){mI(this,Un),hI(t),Ut(xn,this);var r=ho(this);try{t(Dt(wo,r),Dt(Mt,r))}catch(n){Mt(r,n)}},Un=ct.prototype,xn=function(t){II(this,{type:Nn,done:!1,notified:!1,parent:!1,reactions:new bI,rejection:!1,state:Hl,value:void 0})},xn.prototype=Nl(Un,"then",function(t,r){var n=ho(this),a=go(gI(this,ct));return n.parent=!0,a.ok=jn(t)?t:!0,a.fail=jn(r)&&r,a.domain=An?mo.domain:void 0,n.state===Hl?n.reactions.add(a):fo(function(){Jl(a,n)}),a.promise}),Wl=function(){var e=new xn,t=ho(e);this.promise=e,this.resolve=Dt(wo,t),this.reject=Dt(Mt,t)},Ml.f=go=function(e){return e===ct||e===kI?new Wl(e):EI(e)},jn(Ln)&&xt!==Object.prototype)){Vl=xt.then,$I||Nl(xt,"then",function(t,r){var n=this;return new ct(function(a,i){Ut(Vl,n,a,i)}).then(t,r)},{unsafe:!0});try{delete xt.constructor}catch{}Ul&&Ul(xt,Un)}fI({global:!0,constructor:!0,wrap:!0,forced:Fl},{Promise:ct}),dI(ct,Nn,!1),vI(Nn);var CI=X,Ql=CI("iterator"),ef=!1;try{var AI=0,tf={next:function(){return{done:!!AI++}},return:function(){ef=!0}};tf[Ql]=function(){return this},Array.from(tf,function(){throw 2})}catch{}var jI=function(e,t){try{if(!t&&!ef)return!1}catch{return!1}var r=!1;try{var n={};n[Ql]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},LI=$r,NI=jI,UI=Er.CONSTRUCTOR,Dn=UI||!NI(function(e){LI.all(e).then(void 0,function(){})}),xI=Q,DI=te,MI=_e,FI=De,zI=Sr,BI=yr,HI=Dn;xI({target:"Promise",stat:!0,forced:HI},{all:function(t){var r=this,n=FI.f(r),a=n.resolve,i=n.reject,o=zI(function(){var s=MI(r.resolve),u=[],f=0,l=1;BI(t,function(c){var d=f++,v=!1;l++,DI(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var KI=Q,GI=Er.CONSTRUCTOR,bo=$r,WI=Ie,VI=W,ZI=ve,rf=bo&&bo.prototype;if(KI({target:"Promise",proto:!0,forced:GI,real:!0},{catch:function(e){return this.then(void 0,e)}}),VI(bo)){var nf=WI("Promise").prototype.catch;rf.catch!==nf&&ZI(rf,"catch",nf,{unsafe:!0})}var JI=Q,YI=te,XI=_e,qI=De,QI=Sr,e0=yr,t0=Dn;JI({target:"Promise",stat:!0,forced:t0},{race:function(t){var r=this,n=qI.f(r),a=n.reject,i=QI(function(){var o=XI(r.resolve);e0(t,function(s){YI(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var r0=Q,n0=De,a0=Er.CONSTRUCTOR;r0({target:"Promise",stat:!0,forced:a0},{reject:function(t){var r=n0.f(this),n=r.reject;return n(t),r.promise}});var i0=$e,o0=de,s0=De,af=function(e,t){if(i0(e),o0(t)&&t.constructor===e)return t;var r=s0.f(e),n=r.resolve;return n(t),r.promise},c0=Q,u0=Ie,l0=Er.CONSTRUCTOR,f0=af;u0("Promise"),c0({target:"Promise",stat:!0,forced:l0},{resolve:function(t){return f0(this,t)}});var d0=Q,v0=te,h0=_e,p0=De,m0=Sr,g0=yr,y0=Dn;d0({target:"Promise",stat:!0,forced:y0},{allSettled:function(t){var r=this,n=p0.f(r),a=n.resolve,i=n.reject,o=m0(function(){var s=h0(r.resolve),u=[],f=0,l=1;g0(t,function(c){var d=f++,v=!1;l++,v0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var w0=Q,b0=te,S0=_e,$0=Ie,I0=De,E0=Sr,T0=yr,P0=Dn,of="No one promise resolved";w0({target:"Promise",stat:!0,forced:P0},{any:function(t){var r=this,n=$0("AggregateError"),a=I0.f(r),i=a.resolve,o=a.reject,s=E0(function(){var u=S0(r.resolve),f=[],l=0,c=1,d=!1;T0(t,function(v){var p=l++,S=!1;c++,b0(u,r,v).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[p]=g,--c||o(new n(f,of)))})}),--c||o(new n(f,of))});return s.error&&o(s.value),a.promise}});var O0=Q,k0=De;O0({target:"Promise",stat:!0},{withResolvers:function(){var t=k0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var _0=Q,Mn=$r,R0=H,sf=Ie,cf=W,C0=fl,uf=af,A0=ve,So=Mn&&Mn.prototype,j0=!!Mn&&R0(function(){So.finally.call({then:function(){}},function(){})});if(_0({target:"Promise",proto:!0,real:!0,forced:j0},{finally:function(e){var t=C0(this,sf("Promise")),r=cf(e);return this.then(r?function(n){return uf(t,e()).then(function(){return n})}:e,r?function(n){return uf(t,e()).then(function(){throw n})}:e)}}),cf(Mn)){var lf=sf("Promise").prototype.finally;So.finally!==lf&&A0(So,"finally",lf,{unsafe:!0})}var L0=mi;L0.Promise;function We(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function je(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}typeof SuppressedError=="function"&&SuppressedError;var ut=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Io(e,t){return e(t={exports:{}},t.exports),t.exports}var lt=Io(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()}});$o(lt);var N0=$o(Io(function(e,t){var r=ut&&ut.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,S){function g(b){try{I(v.next(b))}catch(h){S(h)}}function E(b){try{I(v.throw(b))}catch(h){S(h)}}function I(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,E)}I((v=v.apply(l,c||[])).next())})},n=ut&&ut.__generator||function(l,c){var d,v,p,S,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return S={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function E(I){return function(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([I,b])}}},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="",v=0;v<l;v++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var v,p,S,g,E,I,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(S)!==null?[3,5]:(E=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:v,timeoutKey:E,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(I=g.getItemSync(S))!==null&&(b=JSON.parse(I)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(S,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var S,g,E;return n(this,function(I){switch(I.label){case 0:return[4,lt.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(c))===null?(lt.default().unlock(d),[2]):((E=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(E)),lt.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(lt.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(v){var p=!1,S=Date.now(),g=!1;function E(){if(g||(window.removeEventListener("storage",E),l.removeFromWaiting(E),clearTimeout(I),g=!0),!p){p=!0;var b=50-(Date.now()-S);b>0?setTimeout(v,b):v(null)}}window.addEventListener("storage",E),l.addToWaiting(E);var I=setTimeout(E,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,v,p,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(S=JSON.parse(p)).id!==this.id?[3,2]:[4,lt.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(v),lt.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],S=0;;){var g=v.keySync(S);if(g===null)break;p.push(g),S++}for(var E=!1,I=0;I<p.length;I++){var b=p[I];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),E=!0)}}}E&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const U0={timeoutInSeconds:60},ff={name:"auth0-spa-js",version:"2.1.3"},df=()=>Date.now();let ce=class ts extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,ts.prototype)}static fromPayload({error:t,error_description:r}){return new ts(t,r)}},x0=class ev extends ce{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,ev.prototype)}},Eo=class tv extends ce{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,tv.prototype)}},D0=class rv extends Eo{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,rv.prototype)}},M0=class nv extends ce{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,nv.prototype)}},F0=class av extends ce{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,av.prototype)}},vf=class iv extends ce{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${hf(t,["default"])}', scope: '${hf(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,iv.prototype)}};function hf(e,t=[]){return e&&!t.includes(e)?e:""}const Fn=()=>window.crypto,To=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Fn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},pf=e=>btoa(e),Po=e=>{var{clientId:t}=e,r=je(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()},mf=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),z0=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},B0=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([z0(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},H0=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},K0=async(e,t,r,n,a,i,o=1e4)=>a?H0(e,t,r,n,o,a,i):B0(e,n,o);async function G0(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=je(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?Po(u):JSON.stringify(u);return await async function(l,c,d,v,p,S,g){let E,I=null;for(let j=0;j<3;j++)try{E=await K0(l,d,v,p,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const b=E.json,{error:h,error_description:$}=b,k=je(b,["error","error_description"]),{ok:_}=E;if(!_){const j=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new F0(h,j,k.mfa_token):h==="missing_refresh_token"?new vf(d,v):new ce(h||"request_error",j)}return k}(`${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||ff))}},t,s)}const zn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let ft=class rs{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 rs({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new rs({scope:r,audience:n,clientId:a})}},W0=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@@"))}},gf=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)}}()}},V0=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||df}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]}},Z0=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 Tr=e=>typeof e=="number",J0=["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"],Y0=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(mf(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],J0.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(mf(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&&!Tr(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||!Tr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Tr(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&&Tr(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&&Tr(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=Io(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 v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});$o(dt),dt.encode,dt.parse,dt.getAll;var X0=dt.get,yf=dt.set,wf=dt.remove;const Ft={get(e){const t=X0(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),yf(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),wf(e,r)}},q0={get(e){return Ft.get(e)||Ft.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),yf(`_legacy_${e}`,JSON.stringify(t),n),Ft.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),wf(e,r),Ft.remove(e,t),Ft.remove(`_legacy_${e}`,t)}},Q0={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 eE(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,v=l.length;d<v;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
|
|
2
|
+
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var bf,Sf,$f,Oo,tE=(bf="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Sf=null,$f=!1,function(e){return Oo=Oo||eE(bf,Sf,$f),new Worker(Oo,e)});const ko={};let rE=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 nE={memory:()=>new gf().enclosedCache,localstorage:()=>new W0},If=e=>nE[e],Ef=e=>{const{openUrl:t,onRedirect:r}=e,n=je(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},_o=new N0;let aE=class{constructor(t){let r,n;if(this.userCache=new gf().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await _o.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(!Fn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Fn().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",!Vc(r))throw new Error(`Invalid cache location "${r}"`);n=Vc(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?It:bw,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:Sw;var i;this.scope=Vr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new mw(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||xc,this.cacheManager=new pw(n,n.allKeys?void 0:new kw(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,c)=>o?o.startsWith("https://")?o:`https://${o}/`:`${c}/`)(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 $w)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Uc)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${ni(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return yw({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=Mc(ri()),i=Mc(ri()),o=ri(),c=(u=>{const s=new Uint8Array(u);return(d=>{const h={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(s))))})(await(async u=>await Wr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(u)))(o)),l=((u,s,d,h,m,S,g,$)=>Object.assign(Object.assign(Object.assign({client_id:u.clientId},u.authorizationParams),d),{scope:Vr(s,d.scope),response_type:"code",response_mode:$||"query",state:h,nonce:m,redirect_uri:g||u.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,c,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(l);return{nonce:i,code_verifier:o,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},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(c=>new Promise((l,f)=>{let u;const s=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(s),clearTimeout(d),window.removeEventListener("message",u,!1),f(new sw(c.popup)))},1e3),d=setTimeout(()=>{clearInterval(s),f(new ow(c.popup)),window.removeEventListener("message",u,!1)},1e3*(c.timeoutInSeconds||60));u=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(s),window.removeEventListener("message",u,!1),c.popup.close(),h.data.response.error)return f(ae.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",u)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ae("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=Zc(t),{openUrl:a,fragment:i,appState:o}=n,c=Te(n,["openUrl","fragment","appState"]),l=((r=c.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:u}=f,s=Te(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},s),{appState:o}),l&&{organization:l}));const d=i?`${u}#${i}`:u;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}=(s=>{s.indexOf("#")>-1&&(s=s.substring(0,s.indexOf("#")));const d=new URLSearchParams(s);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("")),c=this.transactionManager.get();if(!c)throw new ae("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new iw(i,o||i,n,c.appState);if(!c.code_verifier||c.state&&c.state!==n)throw new ae("state_mismatch","Invalid state");const l=c.organization,f=c.nonce,u=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:a},u?{redirect_uri:u}:{}),{nonceIn:f,organization:l}),{appState:c.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:Vr(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let c=ii[o];return c||(c=i().finally(()=>{delete ii[o],c=null}),ii[o]=c),c})(()=>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=Te(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})(()=>oi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new ti;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:c,expires_in:l}=a;return Object.assign(Object.assign({id_token:i,access_token:o},c?{scope:c}:null),{expires_in:l})}finally{await oi.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:Vr(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},aw),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new et({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=Te(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ni(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Zc(t),{openUrl:n}=r,a=Te(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:c,redirect_uri:l,scope:f,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ae("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const s=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((m,S,g=60)=>new Promise(($,P)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const v=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",I,!1))};let I;const O=setTimeout(()=>{P(new ti),v()},1e3*g);I=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const A=_.source;A&&A.close(),_.data.response.error?P(ae.fromPayload(_.data.response)):$(_.data.response),clearTimeout(O),window.removeEventListener("message",I,!1),setTimeout(v,2e3)},window.addEventListener("message",I,!1),window.document.body.appendChild(b),b.setAttribute("src",m)}))(a,this.domainUrl,s);if(i!==d.state)throw new ae("state_mismatch","Invalid state");const h=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:c,code:d.code,grant_type:"authorization_code",redirect_uri:l,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},h),{scope:f,oauthTokenScope:h.scope,audience:u})}catch(s){throw s.error==="login_required"&&this.logout({openUrl:!1}),s}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new et({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 Nc(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=Te(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 et({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 et({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:c}=a,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},o?{scope:o}:null),{expires_in:c})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await hw(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 Ew(e){const t=new Tw(e);return await t.checkSession(),t}var we=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(we||{});const Ow="sesamy.com",_w="sesamy.dev",Rw="https://sesa.my",si="sesamyCacheTimestamp";function ze(e,t){return`https://${e}.${t==="dev"?_w:Ow}`}let ie,Yc;const $t="sesamyAccessToken",ci="sesamyRefreshToken";async function Cw(e){if(!e)return null;const t=localStorage.getItem(ci);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(ci),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(ci,i.refresh_token),localStorage.setItem($t,i.access_token),i.access_token}catch{Xc()}}async function ui(){const e=localStorage.getItem($t);if(!e)return null;const t=qc(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await Cw(t);if(r)return r;localStorage.removeItem($t)}return e}function Jc(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 jw(e){if(e.enabled===!1)return;Yc=e.organization;const t={domain:ze("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Jc(window.location.href)!==Jc(ze("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ie=await Ew(t),window.location.search.includes("code="))try{await ie.handleRedirectCallback();const r=await ie.getUser();Fe(we.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}}async function li(){return await ui()?!0:ie?ie.isAuthenticated():!1}async function Aw(){return await ui()?{sub:"local",name:"Local User"}:ie?ie.getUser():null}function fi(e){if(localStorage.removeItem($t),!ie)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ie.loginWithRedirect({...e,authorizationParams:{organization:Yc,redirect_uri:window.location.href,...t}})}async function nr(e=!0){const t=ui();if(t)return t;try{return ie?await ie.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Xc(e={}){if(localStorage.removeItem($t),Fe(we.LOGOUT,{}),!!ie)return ie.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function qc(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 Qc(e){const t=qc(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem($t,e),Fe(we.AUTHENTICATED,t)}const Lw=(e,t)=>t.skipDedupe||t.method!=="GET",Uw=(e,t)=>t.method+"@"+e,xw=e=>e.clone(),eu=({skip:e=Lw,key:t=Uw,resolver:r=xw}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const c=t(i,o);if(!n.has(c))n.set(c,[]);else return new Promise((l,f)=>{n.get(c).push([l,f])});try{return a(i,o).then(l=>(n.get(c).forEach(([f])=>f(r(l))),n.delete(c),l)).catch(l=>{throw n.get(c).forEach(([f,u])=>u(l)),n.delete(c),l})}catch(l){return n.delete(c),Promise.reject(l)}}},Nw=(e,t)=>e*t,Dw=e=>e&&e.ok,tu=({delayTimer:e=500,delayRamp:t=Nw,maxAttempts:r=10,until:n=Dw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:c}={})=>l=>(f,u)=>{let s=0;if(c&&c(f,u))return l(f,u);const d=(h,m)=>Promise.resolve(n(h,m)).then(S=>S?h&&o?h:m?Promise.reject(m):h:(s++,!r||s<=r?new Promise(g=>{const $=t(e,s);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:h,error:m,url:f,options:u})).then((P={})=>{var b,v;g(l((b=P&&P.url)!==null&&b!==void 0?b:f,(v=P&&P.options)!==null&&v!==void 0?v:u))}):g(l(f,u))},$)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):h&&o?h:Promise.reject(m||new Error("Number of attempts exceeded."))));return l(f,u).then(d).catch(h=>{if(!i)throw h;return d(null,h)})},Mw="application/json",ru="Content-Type",kt=Symbol(),nu=Symbol();function au(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===ru.toLowerCase()))===null||t===void 0?void 0:t[1]}function iu(e){return/^application\/.*json.*/.test(e)}const rt=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]=rt(o,i,r):n[a]=i,n},{...e})},Pt={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 Fw(e,t=!1){Pt.options=t?e:rt(Pt.options,e)}function zw(e,t=!1){Pt.polyfills=t?e:rt(Pt.polyfills,e)}function Hw(e){Pt.errorType=e}const Bw=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class ou extends Error{}const Kw=e=>{const t=Object.create(null);e=e._addons.reduce((b,v)=>v.beforeRequest&&v.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:c,_addons:l}=e,f=new Map(i),u=rt(a.options,n);let s=r;const d=Bw(c)((b,v)=>(s=b,a.polyfill("fetch")(b,v)))(r,u),h=new Error,m=d.catch(b=>{throw{[kt]:b}}).then(b=>{if(!b.ok){const v=new ou;if(v.cause=h,v.stack=v.stack+`
|
|
5
|
-
CAUSE: `+h.stack,v.response=b,v.url=s,b.type==="opaque")throw v;return b.text().then(I=>{var O;if(v.message=I,a.errorType==="json"||((O=b.headers.get("Content-Type"))===null||O===void 0?void 0:O.split(";")[0])==="application/json")try{v.json=JSON.parse(I)}catch{}throw v.text=I,v.status=b.status,v})}return b}),S=b=>b.catch(v=>{const I=v.hasOwnProperty(kt),O=I?v[kt]:v,_=(O==null?void 0:O.status)&&f.get(O.status)||f.get(O==null?void 0:O.name)||I&&f.has(kt)&&f.get(kt);if(_)return _(O,e);const A=f.get(nu);if(A)return A(O,e);throw O}),g=b=>v=>S(b?m.then(I=>I&&I[b]()).then(I=>v?v(I):I):m.then(I=>v?v(I):I)),$={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,v){return f.set(b,v),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(kt,b)}},P=l.reduce((b,v)=>({...b,...typeof v.resolver=="function"?v.resolver(b):v.resolver}),$);return o.reduce((b,v)=>v(b,e),P)},Gw={_url:"",_options:{},_config:Pt,_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:rt(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:rt(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:rt(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[ru]: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(nu,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=au(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||iu(a));return n=r?o?n.json(r,a):n.body(r):n,Kw(n._deferred.reduce((c,l)=>l(c,c._url,c._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=au(this._options.headers);return this.content(t||iu(r)&&r||Mw).body(JSON.stringify(e))}};function Ce(e="",t={}){return{...Gw,_url:e,_options:t}}Ce.default=Ce,Ce.options=Fw,Ce.errorType=Hw,Ce.polyfills=zw,Ce.WretchError=ou;function be(){sessionStorage.removeItem(si),Fe(we.CLEAR_CACHE,{})}function su(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function Ww(e){const t=ze("api2",e.environment),r=w=>async(k,T)=>{let H=sessionStorage.getItem(si);H||(H=Date.now().toString(),sessionStorage.setItem(si,H));const ne={...T,headers:{...T.headers,"Cache-Timestamp":H}};return w(k,ne)},n=(w=!0)=>k=>async(T,H)=>{let ne=null;if(ne=await nr(w),!ne){if(w)throw new Error("No access token available");return k(T,H)}const We={...H,headers:{...H.headers,...ne?{Authorization:`Bearer ${ne}`}:{}}};return k(T,We)},a=w=>(k,T)=>{if(T.headers.Authorization)return w(k,T);const H=localStorage.getItem("__anon_id"),ne=btoa(`${H}:`),We={...T,headers:{...T.headers,Authorization:`Basic ${ne}`}};return w(k,We)},i=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),eu(),tu({delayTimer:1e3,delayRamp:(w,k)=>w*k,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Ce(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,eu(),tu({delayTimer:1e3,delayRamp:(w,k)=>w*k,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function c(){return i.get("/entitlements").json()}async function l(w){const k=await i.get("/entitlements").json();return k==null?void 0:k.find(T=>T.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function u(){return i.get("/contracts").json()}async function s(w){const k=await i.get("/contracts").json();return k==null?void 0:k.find(T=>T.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function h(){return i.get("/bills").json()}async function m(w){const k=await i.get("/bills").json();return k==null?void 0:k.find(T=>T.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const k=await i.get("/transactions").json();return k==null?void 0:k.find(T=>T.id===w)}async function $(w,k){const T=await i.url(`/user-metadata/${w}`).put(k).json();return Fe(we.USER_ATTRIBUTE_CHANGED,{}),be(),T}async function P(w){const k=await i.url(`/user-metadata/${w}`).delete().res();return be(),k.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function v(){return await i.url("/user-metadata").get().json()}async function I(){return await i.url("/tags").get().json()}async function O(w){const k=await i.url(`/tags/${w}`).delete().res();return be(),k.ok}async function _(w){const k=await i.url("/tags").post(w).res();return Fe(we.USER_ATTRIBUTE_CHANGED,{}),be(),k.ok}async function A(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const k=await o.url(`/tallies/${w}`).delete().res();return be(),k.ok}async function W(w,k){return await o.url(`/tallies/${w}/push`).post(k).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function N(){return await nr(!1)?await i.url("/profile").get().json():null}async function z(w){const k=await i.url("/profile").patch(w).res();return be(),k.ok}async function R(){return await i.url("/payment-issues").get().json()}async function K(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function Z(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function Le(w){const k=await nr(!1);if(!k)throw new Error("No access token available");const T=new URL(`${ze("spotify-oas",e.environment)}/sesamy-callback`);T.searchParams.set("access_token",k),T.searchParams.set("state",w),window.location.href=T.toString()}async function p(w){const k=await i.url(`/products/${w}/auto-onboard`).post().json();return k.length&&be(),k}async function y(w,k=3600){const{shortlink:T}=await Ce(Rw).post({url:w,ttl:k}).json();return T}async function E(w){const k=await nr(!1);let T;const H=w.language||su();switch(w.target){case"account":T=new URL(`${ze("account",e.environment)}/${H}/subscriptions/${e.clientId}`);break;case"consume":T=new URL(`${ze("consume",e.environment)}/${H}/@${e.clientId}/${w.sku}`),w.episodeId?T.href+=`/${w.episodeId}`:T.href+="/listen";break;default:throw new Error("Invalid target")}return T.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),k&&(T.hash=`#access_token=${k}`),w.shorten?y(T.href,w.ttl):T.href}async function U(w){return(await o.url("/checkouts").post({language:su(),...w,vendorId:e.clientId})).json()}async function x(w,k){return(await o.url(`/checkouts/${w}`).patch(k)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function V(){const w=await nr(!1),k=new URL(`${ze("account",e.environment)}/subscriptions/${e.clientId}`);w&&(k.hash=`#access_token=${w}`),window.location.href=k.toString()}return{createCheckout:U,updateCheckout:x,getCheckout:D,getEntitlements:c,getEntitlement:l,getEntitlementAccess:f,getContracts:u,getContract:s,getProfile:N,updateProfile:z,getSubscriptions:d,getBills:h,getBill:m,setUserMetadata:$,deleteUserMetadata:P,getUserMetadata:b,listUserMetadata:v,getTags:I,deleteTag:O,setTag:_,getTally:A,getTallies:M,deleteTally:F,pushTally:W,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:p,isSpotifyLinked:K,unlinkSpotify:Z,linkSpotify:Le,generateLink:E,openHostedAccountPage:V}}const cu="@sesamy/sesamy-js",di="1.19.1";function uu(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var Zr="undefined",lu="object",hi=function(){},fu="any",du="*",nt="__",Yr=typeof process<"u"?process:{};Yr.env&&Yr.env.NODE_ENV;var Y=typeof document<"u";Yr.versions!=null&&Yr.versions.node!=null,typeof Deno<"u"&&Deno.core,Y&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function hu(e,t){return t.charAt(0)[e]()+t.slice(1)}var Vw=hu.bind(null,"toUpperCase"),Zw=hu.bind(null,"toLowerCase");function Yw(e){return vu(e)?Vw("null"):typeof e=="object"?Qw(e):Object.prototype.toString.call(e).slice(8,-1)}function Jr(e,t){t===void 0&&(t=!0);var r=Yw(e);return t?Zw(r):r}function ar(e,t){return typeof t===e}var te=ar.bind(null,"function"),He=ar.bind(null,"string"),Tt=ar.bind(null,"undefined"),Jw=ar.bind(null,"boolean");ar.bind(null,"symbol");function vu(e){return e===null}function Xw(e){return Jr(e)==="number"&&!isNaN(e)}function pu(e){return Jr(e)==="array"}function re(e){if(!qw(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function qw(e){return e&&(typeof e=="object"||e!==null)}function Qw(e){return te(e.constructor)?e.constructor.name:null}function eb(e){return e instanceof Error||He(e.message)&&e.constructor&&Xw(e.constructor.stackTraceLimit)}function mu(e,t){if(typeof t!="object"||vu(t))return!1;if(t instanceof e)return!0;var r=Jr(new e(""));if(eb(t))for(;t;){if(Jr(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}mu.bind(null,TypeError),mu.bind(null,SyntaxError);function Xr(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?tb(e,t):r}function tb(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function qr(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}qr(Xr,"form"),qr(Xr,"button"),qr(Xr,"input"),qr(Xr,"select");function rb(e){return e?pu(e)?e:[e]:[]}function gu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function nb(){if(Y){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function ab(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ib(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=gu(r[1]),o=gu(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 c in n){var l=c.split("[");l.length>1&&(ob(n,l.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[c]),delete n[c])}return n}(function(t){return Y&&window.location.search.substring(1)}())}function ob(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 Qr(){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 sb(e,t){var r,n,a,i=null,o=0,c=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var l=new Date;o||(o=l);var f=t-(l-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=l,a=e.apply(r,n)):i||(i=setTimeout(c,f)),a}}var ir="global",Et=nt+"global"+nt,Ot=typeof self===lu&&self.self===self&&self||typeof global===lu&&global.global===global&&global||void 0;function at(e){return Ot[Et][e]}function it(e,t){return Ot[Et][e]=t}function _t(e){delete Ot[Et][e]}function Rt(e,t,r){var n;try{if(vi(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Ot[Et]||(Ot[Et]={});var en={};function vi(e){if(typeof en[e]!==Zr)return en[e];try{var t=window[e];t.setItem(Zr,Zr),t.removeItem(Zr)}catch{return en[e]=!1}return en[e]=!0}function C(){return C=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},C.apply(this,arguments)}var Be="function",je="undefined",cb="@@redux/"+Math.random().toString(36),yu=function(){return typeof Symbol===Be&&Symbol.observable||"@@observable"}(),tn=" != "+Be;function wu(e,t,r){var n;if(typeof t===Be&&typeof r===je&&(r=t,t=void 0),typeof r!==je){if(typeof r!==Be)throw new Error("enhancer"+tn);return r(wu)(e,t)}if(typeof e!==Be)throw new Error("reducer"+tn);var a=e,i=t,o=[],c=o,l=!1;function f(){c===o&&(c=o.slice())}function u(){return i}function s(h){if(typeof h!==Be)throw new Error("Listener"+tn);var m=!0;return f(),c.push(h),function(){if(m){m=!1,f();var S=c.indexOf(h);c.splice(S,1)}}}function d(h){if(!re(h))throw new Error("Act != obj");if(typeof h.type===je)throw new Error("ActType "+je);if(l)throw new Error("Dispatch in reducer");try{l=!0,i=a(i,h)}finally{l=!1}for(var m=o=c,S=0;S<m.length;S++)(0,m[S])();return h}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:s,getState:u,replaceReducer:function(h){if(typeof h!==Be)throw new Error("next reducer"+tn);a=h,d({type:"@@redux/INIT"})}})[yu]=function(){var h,m=s;return(h={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(u())}return g(),{unsubscribe:m(g)}}})[yu]=function(){return this},h},n}function ub(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+je}function Ct(){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 lb(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),c=o.dispatch,l={getState:o.getState,dispatch:function(f){return c(f)}};return i=[].slice.call(e).map(function(f){return f(l)}),C({},o,{dispatch:c=Ct.apply(void 0,i)(o.dispatch)})}}}var Ke=nt+"anon_id",ot=nt+"user_id",jt=nt+"user_traits",Ge="userId",At="anonymousId",rn=["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"],pi=["name","EVENTS","config","loaded"],j=rn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),bu=/^utm_/,Su=/^an_prop_/,Iu=/^an_trait_/;function fb(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===j.bootstrap){var i=a.params,o=a.user,c=a.persistedUser,l=a.initialUser,f=c.userId===o.userId;c.anonymousId!==o.anonymousId&&t(Ke,o.anonymousId),f||t(ot,o.userId),l.traits&&t(jt,C({},f&&c.traits?c.traits:{},l.traits));var u=Object.keys(a.params);if(u.length){var s=i.an_uid,d=i.an_event,h=u.reduce(function(m,S){if(S.match(bu)||S.match(/^(d|g)clid/)){var g=S.replace(bu,"");m.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Su)&&(m.props[S.replace(Su,"")]=i[S]),S.match(Iu)&&(m.traits[S.replace(Iu,"")]=i[S]),m},{campaign:{},props:{},traits:{}});r.dispatch(C({type:j.params,raw:i},h,s?{userId:s}:{})),s&&setTimeout(function(){return e.identify(s,h.traits)},0),d&&setTimeout(function(){return e.track(d,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:j.campaign,campaign:h.campaign})}}return n(a)}}}}function db(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===j.setItemEnd){if(r.key===Ke)return C({},t,{anonymousId:r.value});if(r.key===ot)return C({},t,{userId:r.value})}switch(r.type){case j.identify:return Object.assign({},t,{userId:r.userId,traits:C({},t.traits,r.traits)});case j.reset:return[ot,Ke,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function $u(e){return{userId:e.getItem(ot),anonymousId:e.getItem(Ke),traits:e.getItem(jt)}}var mi=function(e){return nt+"TEMP"+nt+e};function hb(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(c){var l=c.userId,f=c.traits,u=c.options;if(c.type===j.reset&&([ot,jt,Ke].forEach(function(h){n(h)}),[Ge,At,"traits"].forEach(function(h){_t(mi(h))})),c.type===j.identify){a(Ke)||r(Ke,Qr());var s=a(ot),d=a(jt)||{};s&&s!==l&&i.dispatch({type:j.userIdChanged,old:{userId:s,traits:d},new:{userId:l,traits:f},options:u}),l&&r(ot,l),f&&r(jt,C({},d,f))}return o(c)}}}}var or={};function ku(e,t){or[e]&&te(or[e])&&(or[e](t),delete or[e])}function Pu(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(C({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Pu(e,t,r-10).then(n,a)})})}function vb(e){return{abort:e}}function Tu(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,c=i.queue,l=i.user;if(!i.context.offline&&c&&c.actions&&c.actions.length){var f=c.actions.reduce(function(s,d,h){return o[d.plugin].loaded?(s.process.push(d),s.processIndex.push(h)):(s.requeue.push(d),s.requeueIndex.push(h)),s},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(s){var d=c.actions[s],h=d.plugin,m=d.payload.type,S=a[h][m];if(S&&te(S)){var g,$=function(v,I){return v===void 0&&(v={}),I===void 0&&(I={}),[Ge,At].reduce(function(O,_){return v.hasOwnProperty(_)&&I[_]&&I[_]!==v[_]&&(O[_]=I[_]),O},v)}(d.payload,l),P=n[$.meta.rid];if(!P&&(g=S({payload:$,config:o[h].config,instance:r,abort:vb}))&&re(g)&&g.abort)return void(n[$.meta.rid]=!0);if(!P){var b=m+":"+h;e.dispatch(C({},$,{type:b,_:{called:b,from:"queueDrain"}}))}}});var u=c.actions.filter(function(s,d){return!~f.processIndex.indexOf(d)});c.actions=u}}}var gi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,c=e.store,l=e.EVENTS;try{var f=a.plugins,u=a.context,s=r.type,d=s.match(Lt),h=t.exact.map(function(g){return g.pluginName});d&&(h=o.during.map(function(g){return g.pluginName}));var m=function(g,$){return function(P,b,v){var I=b.config,O=b.name,_=O+"."+P.type;v&&(_=v.event);var A=P.type.match(Lt)?function(M,F,W,L,N){return function(z,R){var K=L?L.name:M,Z=R&&sr(R)?R:W;if(L&&(!(Z=R&&sr(R)?R:[M]).includes(M)||Z.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(Z)+" input valid");return C({},N,{abort:{reason:z,plugins:Z,caller:F,_:K}})}}(O,_,$,v,P):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(P,_);return{payload:pb(P),instance:g,config:I||{},abort:A}}}(n,h),S=t.exact.reduce(function(g,$){var P=$.pluginName,b=$.methodName,v=!1;return b.match(/^initialize/)||b.match(/^reset/)||(v=!f[P].loaded),u.offline&&b.match(/^(page|track|identify)/)&&(v=!0),g[""+P]=v,g},{});return Promise.resolve(t.exact.reduce(function(g,$,P){try{var b=$.pluginName;return Promise.resolve(g).then(function(v){function I(){return Promise.resolve(v)}var O=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,A,M){try{return Promise.resolve(_).then(function(F){return A.method&&te(A.method)?(function(z,R){var K=Lu(z);if(K&&K.name===R){var Z=Lu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(Z?"or "+Z.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
-
`))}}(A.methodName,A.pluginName),Promise.resolve(A.method({payload:F,instance:n,abort:(W=F,L=b,N=A.pluginName,function(z,R){return C({},W,{abort:{reason:z,plugins:R||[L],caller:s,from:N||L}})}),config:_u(A.pluginName,f,i),plugins:f})).then(function(z){var R=re(z)?z:{};return Promise.resolve(C({},F,R))})):F;var W,L,N})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){v[b]=_});v[b]=r}();return O&&O.then?O.then(I):I()})}catch(v){return Promise.reject(v)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function($,P,b){try{var v=t.exact.length===b+1,I=P.pluginName,O=i[I];return Promise.resolve($).then(function(_){var A=g[I]?g[I]:{};if(d&&(A=_),wi(A,I))return yi({data:A,method:s,instance:n,pluginName:I,store:c}),Promise.resolve(_);if(wi(_,I))return v&&yi({data:_,method:s,instance:n,store:c}),Promise.resolve(_);if(S.hasOwnProperty(I)&&S[I]===!0)return c.dispatch({type:"queue",plugin:I,payload:A,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=m(g[I],i[I]);return Promise.resolve(O[s]({abort:M.abort,payload:A,instance:n,config:_u(I,f,i),plugins:f})).then(function(F){var W=re(F)?F:{},L=C({},_,W),N=g[I];if(wi(N,I))yi({data:N,method:s,instance:n,pluginName:I,store:c});else{var z=s+":"+I;(z.match(/:/g)||[]).length<2&&!s.match(Eu)&&!s.match(Ou)&&n.dispatch(C({},d?L:A,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function($){if(!(s.match(Lt)||s.match(/^registerPlugin/)||s.match(Ou)||s.match(Eu)||s.match(/^params/)||s.match(/^userIdChanged/))){if(l.plugins.includes(s),$._&&$._.originalAction===s)return $;var P=C({},$,{_:{originalAction:$.type,called:$.type,from:"engineEnd"}});ju($,t.exact.length)&&!s.match(/End$/)&&(P=C({},P,{type:$.type+"Aborted"})),c.dispatch(P)}return $})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,Eu=/^bootstrap/,Ou=/^ready/;function yi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(C({},e.data,{type:r,_:{called:r,from:"abort"}}))}function _u(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Ru(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Cu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function wi(e,t){var r=e.abort;return!!r&&(r===!0||Au(r,t)||r&&Au(r.plugins,t))}function ju(e,t){var r=e.abort;if(!r)return!1;if(r===!0||He(r))return!0;var n=r.plugins;return sr(r)&&r.length===t||sr(n)&&n.length===t}function sr(e){return Array.isArray(e)}function Au(e,t){return!(!e||!sr(e))&&e.includes(t)}function Lu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function pb(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=re(e[r])?Object.assign({},e[r]):e[r]),t},{})}function mb(e,t,r){var n={};return function(a){return function(i){return function(o){try{var c,l=function(v){return c?v:i(s)},f=o.type,u=o.plugins,s=o;if(o.abort)return Promise.resolve(i(o));if(f===j.enablePlugin&&a.dispatch({type:j.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:o.meta}),f===j.disablePlugin&&setTimeout(function(){return ku(o.meta.rid,{payload:o})},0),f===j.initializeEnd){var d=t(),h=Object.keys(d),m=h.filter(function(v){return u.includes(v)}).map(function(v){return d[v]}),S=[],g=[],$=o.disabled,P=m.map(function(v){var I=v.loaded,O=v.name,_=v.config;return Pu(v,function(){return I({config:_})},1e4).then(function(A){return n[O]||(a.dispatch({type:j.pluginReadyType(O),name:O,events:Object.keys(v).filter(function(M){return!pi.includes(M)})}),n[O]=!0),S=S.concat(O),v}).catch(function(A){if(A instanceof Error)throw new Error(A);return g=g.concat(A.name),A})});Promise.all(P).then(function(v){var I={plugins:S,failed:g,disabled:$};setTimeout(function(){h.length===P.length+$.length&&a.dispatch(C({},{type:j.ready},I))},0)})}var b=function(){if(f!==j.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Tu(a,t,e)},0),Promise.resolve(function(v,I,O,_,A){try{var M=te(I)?I():I,F=v.type,W=F.replace(Lt,"");if(v._&&v._.called)return Promise.resolve(v);var L=O.getState(),N=(K=M,(Z=L.plugins)===void 0&&(Z={}),(Le=v.options)===void 0&&(Le={}),Object.keys(K).filter(function(p){var y=Le.plugins||{};return Jw(y[p])?y[p]:y.all!==!1&&(!Z[p]||Z[p].enabled!==!1)}).map(function(p){return K[p]}));F===j.initializeStart&&v.fromEnable&&(N=Object.keys(L.plugins).filter(function(p){var y=L.plugins[p];return v.plugins.includes(p)&&!y.initialized}).map(function(p){return M[p]}));var z=N.map(function(p){return p.name}),R=function(p,y,E){var U=Cu(p).map(function(x){return Ru(x,y)});return y.reduce(function(x,D){var V=D.name,w=Cu(p,V).map(function(ne){return Ru(ne,y)}),k=w[0],T=w[1],H=w[2];return k.length&&(x.beforeNS[V]=k),T.length&&(x.duringNS[V]=T),H.length&&(x.afterNS[V]=H),x},{before:U[0],beforeNS:{},during:U[1],duringNS:{},after:U[2],afterNS:{}})}(F,N);return Promise.resolve(gi({action:v,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(p){function y(){var x=function(){if(F.match(Lt))return Promise.resolve(gi({action:C({},E,{type:W+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(D){D.meta&&D.meta.hasCallback&&ku(D.meta.rid,{payload:D})})}();return x&&x.then?x.then(function(){return p}):p}if(ju(p,z.length))return p;var E,U=function(){if(F!==W)return Promise.resolve(gi({action:C({},p,{type:W}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:O,store:_,EVENTS:A})).then(function(x){E=x});E=p}();return U&&U.then?U.then(y):y()})}catch(p){return Promise.reject(p)}var K,Z,Le}(o,t,e,a,r)).then(function(v){return c=1,i(v)})}();return Promise.resolve(b&&b.then?b.then(l):l(b))}catch(v){return Promise.reject(v)}}}}}function gb(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,c=n.options;if(a===j.setItem||a===j.removeItem){if(n.abort)return r(n);a===j.setItem?e.setItem(i,o,c):e.removeItem(i,c)}return r(n)}}}}var yb=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(c){return r.dispatch(c)}},o=e[t].map(function(c){return c(i)});return Ct.apply(void 0,o)(n)(a)}}}}};function wb(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=Uu(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,c=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:c}),config:c},C({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var l=Uu(r.type,j.initialize),f=e()[l];return f&&l?(n[l]=C({},t[l],{initialized:!0,loaded:!!f.loaded({config:f.config})}),C({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=C({},t[r.name],{loaded:!0}),C({},t,n);switch(r.type){case j.disablePlugin:return C({},t,xu(r.plugins,!1,t));case j.enablePlugin:return C({},t,xu(r.plugins,!0,t));default:return t}}}function Uu(e,t){return e.substring(t.length+1,e.length)}function xu(e,t,r){return e.reduce(function(n,a){return n[a]=C({},r[a],{enabled:t}),n},r)}function Nu(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var bb={last:{},history:[]};function Sb(e,t){e===void 0&&(e=bb);var r=t.options,n=t.meta;if(t.type===j.track){var a=Nu(C({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return C({},e,{last:a,history:e.history.concat(a)})}return e}var Ib={actions:[]};function $b(e,t){e===void 0&&(e=Ib);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===j.identify?[t].concat(e.actions):e.actions.concat(t),C({},e,{actions:n});case"dequeue":return[];default:return e}}var Du=/#.*$/;function kb(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Du,""):"")}var Mu,Fu,zu,Hu,Pb=function(e){if(e===void 0&&(e={}),!Y)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,c=a.innerHeight,l=i.hash,f=i.search,u=function(d){var h=function(){if(Y){for(var m,S=document.getElementsByTagName("link"),g=0;m=S[g];g++)if(m.getAttribute("rel")==="canonical")return m.getAttribute("href")}}();return h?h.match(/\?/)?h:h+d:window.location.href.replace(Du,"")}(f),s={title:r,url:u,path:kb(u),hash:l,search:f,width:o,height:c};return n&&n!==""&&(s.referrer=n),C({},s,e)},Tb={last:{},history:[]};function Eb(e,t){e===void 0&&(e=Tb);var r=t.options;if(t.type===j.page){var n=Nu(C({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return C({},e,{last:n,history:e.history.concat(n)})}return e}Mu=function(){if(!Y)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"}(),Fu=Y?document.referrer:null,zu=nb(),Hu=ab();var Bu={initialized:!1,sessionId:Qr(),app:null,version:null,debug:!1,offline:!!Y&&!navigator.onLine,os:{name:Mu},userAgent:Y?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Hu,locale:zu,campaign:{},referrer:Fu};function Ob(e,t){e===void 0&&(e=Bu);var r=e.initialized,n=t.campaign;switch(t.type){case j.campaign:return C({},e,{campaign:n});case j.offline:return C({},e,{offline:!0});case j.online:return C({},e,{offline:!1});default:return r?e:C({},Bu,e,{initialized:!0})}}var _b=["plugins","reducers","storage"];function Rb(e,t,r){if(Y){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function Cb(e){var t=Rb.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Ku(){return it("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 Ot[Et].analytics.push(o.action||o),i(o)}})}}}function Gu(e){return function(){return Ct(Ct.apply(null,arguments),Ku())}}function bi(e){return e?pu(e)?e:[e]:[]}function Wu(e,t,r){e===void 0&&(e={});var n,a,i=Qr();return t&&(or[i]=(n=t,a=function(o){for(var c,l=o||Array.prototype.slice.call(arguments),f=0;f<l.length;f++)if(te(l[f])){c=l[f];break}return c}(r),function(o){a&&a(o),n(o)})),C({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function jb(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(p,y){if(te(y))return p.middlewares=p.middlewares.concat(y),p;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var E=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];p.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(p.methods[y.name]=Object.keys(y.methods).reduce(function(D,V){var w;return D[V]=(w=y.methods[V],function(){for(var k=Array.prototype.slice.call(arguments),T=new Array(w.length),H=0;H<k.length;H++)T[H]=k[H];return T[T.length]=I,w.apply({instance:I},T)}),D},{}),delete y.methods);var U=Object.keys(y).concat(E),x=new Set(p.events.concat(U));if(p.events=Array.from(x),p.pluginsArray=p.pluginsArray.concat(y),p.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return p.plugins[y.name]=y,p.plugins[y.name].loaded||(p.plugins[y.name].loaded=function(){return!0}),p},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:at,setItem:it,removeItem:_t},i=function(p){return function(y,E,U){return E.getState("user")[y]||(U&&re(U)&&U[y]?U[y]:$u(p)[y]||at(mi(y))||null)}}(a),o=n.plugins,c=n.events.filter(function(p){return!pi.includes(p)}).sort(),l=new Set(c.concat(rn).filter(function(p){return!pi.includes(p)})),f=Array.from(l).sort(),u=function(){return o},s=new yb,d=s.addMiddleware,h=s.removeMiddleware,m=s.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=ib(),$=$u(a),P=C({},$,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});P.anonymousId||(P.anonymousId=Qr());var b=C({enable:function(p,y){return new Promise(function(E){R.dispatch({type:j.enablePlugin,plugins:bi(p),_:{originalAction:j.enablePlugin}},E,[y])})},disable:function(p,y){return new Promise(function(E){R.dispatch({type:j.disablePlugin,plugins:bi(p),_:{originalAction:j.disablePlugin}},E,[y])})}},n.methods),v=!1,I={identify:function(p,y,E,U){try{var x=He(p)?p:null,D=re(p)?p:y,V=E||{},w=I.user();it(mi(Ge),x);var k=x||D.userId||i(Ge,I,D);return Promise.resolve(new Promise(function(T){R.dispatch(C({type:j.identifyStart,userId:k,traits:D||{},options:V,anonymousId:w.anonymousId},w.id&&w.id!==x&&{previousId:w.id}),T,[y,E,U])}))}catch(T){return Promise.reject(T)}},track:function(p,y,E,U){try{var x=re(p)?p.event:p;if(!x||!He(x))throw new Error("EventMissing");var D=re(p)?p:y||{},V=re(E)?E:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:j.trackStart,event:x,properties:D,options:V,userId:i(Ge,I,y),anonymousId:i(At,I,y)},w,[y,E,U])}))}catch(w){return Promise.reject(w)}},page:function(p,y,E){try{var U=re(p)?p:{},x=re(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:j.pageStart,properties:Pb(U),options:x,userId:i(Ge,I,U),anonymousId:i(At,I,U)},D,[p,y,E])}))}catch(D){return Promise.reject(D)}},user:function(p){if(p===Ge||p==="id")return i(Ge,I);if(p===At||p==="anonId")return i(At,I);var y=I.getState("user");return p?uu(y,p):y},reset:function(p){return new Promise(function(y){R.dispatch({type:j.resetStart},y,p)})},ready:function(p){return v&&p({plugins:b,instance:I}),I.on(j.ready,function(y){p(y),v=!0})},on:function(p,y){if(!p||!te(y))return!1;if(p===j.bootstrap)throw new Error(".on disabled for "+p);var E=/Start$|Start:/;if(p==="*"){var U=function(w){return function(k){return function(T){return T.type.match(E)&&y({payload:T,instance:I,plugins:o}),k(T)}}},x=function(w){return function(k){return function(T){return T.type.match(E)||y({payload:T,instance:I,plugins:o}),k(T)}}};return d(U,nn),d(x,an),function(){h(U,nn),h(x,an)}}var D=p.match(E)?nn:an,V=function(w){return function(k){return function(T){return T.type===p&&y({payload:T,instance:I,plugins:o,abort:S}),k(T)}}};return d(V,D),function(){return h(V,D)}},once:function(p,y){if(!p||!te(y))return!1;if(p===j.bootstrap)throw new Error(".once disabled for "+p);var E=I.on(p,function(U){y({payload:U.payload,instance:I,plugins:o,abort:S}),E()});return E},getState:function(p){var y=R.getState();return p?uu(y,p):Object.assign({},y)},dispatch:function(p){var y=He(p)?{type:p}:p;if(rn.includes(y.type))throw new Error("reserved action "+y.type);var E=C({},y,{_:C({originalAction:y.type},p._||{})});R.dispatch(E)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(p,y,E){R.dispatch({type:j.setItemStart,key:p,value:y,options:E})},removeItem:function(p,y){R.dispatch({type:j.removeItemStart,key:p,options:y})}},setAnonymousId:function(p,y){I.storage.setItem(Ke,p,y)},events:{core:rn,plugins:c}},O=n.middlewares.concat([function(p){return function(y){return function(E){return E.meta||(E.meta=Wu()),y(E)}}},m(nn),mb(I,u,{all:f,plugins:c}),gb(a),fb(I),hb(I),m(an)]),_={context:Ob,user:db(a),page:Eb,track:Sb,plugins:wb(u),queue:$b},A=Ct,M=Ct;if(Y&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(A=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Ku():re(typeof arguments[0])?Gu():Gu().apply(null,arguments)}}var W,L=function(p){return Object.keys(p).reduce(function(y,E){return _b.includes(E)||(y[E]=p[E]),y},{})}(e),N=n.pluginsArray.reduce(function(p,y){var E=y.name,U=y.config,x=y.loaded,D=n.pluginEnabled[E];return p[E]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!x({config:U}),config:U},p},{}),z={context:L,user:P,plugins:N},R=wu(function(p){for(var y=Object.keys(p),E={},U=0;U<y.length;U++){var x=y[U];typeof p[x]===Be&&(E[x]=p[x])}var D,V=Object.keys(E);try{(function(w){Object.keys(w).forEach(function(k){var T=w[k];if(typeof T(void 0,{type:"@@redux/INIT"})===je||typeof T(void 0,{type:cb})===je)throw new Error("reducer "+k+" "+je)})})(E)}catch(w){D=w}return function(w,k){if(w===void 0&&(w={}),D)throw D;for(var T=!1,H={},ne=0;ne<V.length;ne++){var We=V[ne],Il=w[We],Ci=(0,E[We])(Il,k);if(typeof Ci===je){var IS=ub(We,k);throw new Error(IS)}H[We]=Ci,T=T||Ci!==Il}return T?H:w}}(C({},_,t)),z,M(A(lb.apply(void 0,O))));R.dispatch=(W=R.dispatch,function(p,y,E){var U=C({},p,{meta:Wu(p.meta,y,bi(E))});return W.apply(null,[U])});var K=Object.keys(o);R.dispatch({type:j.bootstrap,plugins:K,config:L,params:g,user:P,initialUser:r,persistedUser:$});var Z=K.filter(function(p){return n.pluginEnabled[p]}),Le=K.filter(function(p){return!n.pluginEnabled[p]});return R.dispatch({type:j.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(p,y){var E=p.bootstrap,U=p.config,x=p.name;E&&te(E)&&E({instance:I,config:U,payload:p}),R.dispatch({type:j.registerPluginType(x),name:x,enabled:n.pluginEnabled[x],plugin:p}),n.pluginsArray.length===y+1&&R.dispatch({type:j.initializeStart,plugins:Z,disabled:Le})}),Cb(function(p){R.dispatch({type:p?j.offline:j.online})}),function(p,y,E){setInterval(function(){return Tu(p,y,E)},3e3)}(R,u,I),I}var nn="before",an="after",cr="cookie",st=Yu(),Vu=on,Ab=on;function Zu(e){return st?on(e,"",-1):_t(e)}function Yu(){if(st!==void 0)return st;var e="cookiecookie";try{on(e,e),st=document.cookie.indexOf(e)!==-1,Zu(e)}catch{st=!1}return st}function on(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return st===!1&&(o?it(e,t):at(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 ur="localStorage",Lb=vi.bind(null,"localStorage");Rt("localStorage","getItem",at),Rt("localStorage","setItem",it),Rt("localStorage","removeItem",_t);var lr="sessionStorage",Ub=vi.bind(null,"sessionStorage");Rt("sessionStorage","getItem",at),Rt("sessionStorage","setItem",it),Rt("sessionStorage","removeItem",_t);function Ut(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(re(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var xb=Lb(),Nb=Ub(),Db=Yu();function Ju(e,t){if(e){var r=Si(t),n=!Pi(r),a=Ii(r)?Ut(localStorage.getItem(e)):void 0;if(n&&!Tt(a))return a;var i=$i(r)?Ut(Vu(e)):void 0;if(n&&i)return i;var o=ki(r)?Ut(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var c=at(e);return n?c:{localStorage:a,sessionStorage:o,cookie:i,global:c}}}function Mb(e,t,r){if(e&&!Tt(t)){var n={},a=Si(r),i=JSON.stringify(t),o=!Pi(a);return Ii(a)&&(n[ur]=cn(ur,t,Ut(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[ur]:$i(a)&&(n[cr]=cn(cr,t,Ut(Vu(e))),Ab(e,i),o)?n[cr]:ki(a)&&(n[lr]=cn(lr,t,Ut(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[lr]:(n[ir]=cn(ir,t,at(e)),it(e,t),o?n[ir]:n)}}function Fb(e,t){if(e){var r=Si(t),n=Ju(e,du),a={};return!Tt(n.localStorage)&&Ii(r)&&(localStorage.removeItem(e),a[ur]=n.localStorage),!Tt(n.cookie)&&$i(r)&&(Zu(e),a[cr]=n.cookie),!Tt(n.sessionStorage)&&ki(r)&&(sessionStorage.removeItem(e),a[lr]=n.sessionStorage),!Tt(n.global)&&sn(r,ir)&&(_t(e),a[ir]=n.global),a}}function Si(e){return e?He(e)?e:e.storage:fu}function Ii(e){return xb&&sn(e,ur)}function $i(e){return Db&&sn(e,cr)}function ki(e){return Nb&&sn(e,lr)}function Pi(e){return e===du||e==="all"}function sn(e,t){return e===fu||e===t||Pi(e)}function cn(e,t,r){return{location:e,current:t,previous:r}}var zb={setItem:Mb,getItem:Ju,removeItem:Fb};function Hb(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xu(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 qu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xu(Object(r),!0).forEach(function(n){Hb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:zb};return jb(qu(qu({},t),e))}function Kb(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),c()}function c(){r=setInterval(o,t.interval||1e4)}return c(),{flush:o,push:function(l){return n=a.push(l),n>=i&&o(),n},size:function(){return a.length},end:function(l){l&&o(),clearInterval(r)}}}function Gb(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 c=r[o];r[o]=function(...l){var s;const f=((s=l[2])==null?void 0:s.toString())||"",u=Vb(f);return a!==u&&(a=u,setTimeout(()=>e(f),0)),c.apply(r,l)}})}function Wb(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function Vb(e){return["#","?"].forEach(t=>e=Wb(e,t)),e}function Zb(){Gb(()=>{Ae.page()})}function Yb(e){if(e===void 0&&(e={}),!Y)return hi;var t=el(),r=Ti(),n=Qu(),a=un(n,t),i=un(r,t),o=[],c=[],l=[],f=n,u=a,s=i,d=Object.keys(e);if(!d.length)return hi;var h=d.map(function(S){return Number(S)}),m=sb(function(){var S=el(),g=function(L,N){return N.map(function(z){return z===100?L-5:L*(z/100)})}(S,h),$=Ti(),P=Qu(),b=un(P,S),v=un($,S);if(u=b>u?b:u,s=v<s?v:s,!(o.length>=h.length)){var I=f===P,O="up";I?O="initial":f<=P&&(O="down");var _=g,A=h;(O==="up"||I)&&(_=g.slice().reverse(),A=h.slice().reverse());var M=A.reduce(function(L,N,z){var R=_[z];return l.includes(N)&&P<=R&&(l=l.filter(function(K){return K!==N}),L.singleFunction=N),O==="down"&&!o.includes(N)&&P>=R&&N>i?(c.push(N),L.callbacks=L.callbacks.concat(N),L):O==="up"&&!o.includes(N)&&P<=R&&N<=b?(L.foundFunc=[N],L):(I&&P>=R&&L.foundFunc.length===0&&(L.foundFunc=[N]),!c.includes(N)&&P>=R&&(c.push(N),L.singleFunction?l.push(N):L.singleFunction=N),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(f=P,O==="down"&&M.callbacks&&M.callbacks.forEach(function(L){te(e[L])&&(e[L]({trigger:L,direction:O,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,W=M.direction;te(e[F])&&e[F]({trigger:F,direction:W,scrollMin:s,scrollMax:u,range:[s,u]}),o.push(F)}}},500);return window.addEventListener("scroll",m),function(){return window.removeEventListener("scroll",m)}}function Ti(){return Y?document.body.scrollTop||document.documentElement.scrollTop:0}function Jb(){return Y?window.innerHeight||document.documentElement.clientHeight:0}function Qu(){return Math.round(Ti()+Jb())}function el(){if(!Y)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function un(e,t){return Math.round(e/t*100)}var tl="EventListener";function Xb(e){return function(t,r,n,a){var i=n||hi,o=a||!1;if(!Y)return i;var c=ln(r),l=ln(t,!0);if(!l.length)throw new Error("noElements");if(!c.length)throw new Error("noEvent");var f=[];return function u(s){s&&(f=[]);for(var d=s?"add"+tl:"remove"+tl,h=0;h<l.length;h++){var m=l[h];f[h]=s?o&&o.once?qb(i):i:f[h]||i;for(var S=0;S<c.length;S++)m[d]?m["on"+c[S]]=s?f[h]:null:m[d](c[S],f[h],o)}return u.bind(null,!s)}(e)}}function ln(e,t){if(He(e))return t?ln(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=rb(e);return t?i.map(function(o){return He(o)?ln(o,!0):o}).flat():i}function qb(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Ei=Xb("Event");function rl(e,t){return Y&&te(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),te(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}rl.bind(null,"onerror"),rl.bind(null,"onload");var nl=typeof window>"u",al="hidden";function Qb(e){if(nl)return!1;var t=eS(),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 eS(){var e=["webkit","moz","ms","o"];return nl||al in document?al:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var tS=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function rS(e,t){t===void 0&&(t={});var r=function(o,c){var l=this,f=!1;return function(u){f||(o.call(l,u),f=!0,setTimeout(function(){return f=!1},c))}}(e,t.throttle||1e4),n=[];function a(){var o=Qb(function(c){c||r({type:"tabVisible"})});return n=[o].concat(tS.map(function(c){return Ei(document,c,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 nS(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,c=o===void 0?1e4:o,l=e.throttle,f=l===void 0?2e3:l,u=!1,s=!1,d=new Date,h=function(){return clearTimeout(t)};function m(g){h(),i&&!u&&i(fr(d),g),a&&u&&(u=!1,a(fr(r),g),d=new Date),t=setTimeout(function(){u=!0,n&&(r=new Date,n(fr(d),g))},c)}var S=rS(m,{throttle:f});return{disable:function(){s=!0,u=!1,h();var g=S();return function(){return s=!1,d=new Date,m({type:"load"}),g()}},getStatus:function(){return{isIdle:u,isDisabled:s,active:u?0:fr(d,s),idle:u?fr(r,s):0}}}}function fr(e,t){return t?0:Math.round((new Date-e)/1e3)}const il=5e3;class aS{constructor(t){ve(this,"element");ve(this,"isInViewport",!1);ve(this,"isAwake",!1);ve(this,"isFlushing");ve(this,"observer");ve(this,"lastEventAt",Date.now());ve(this,"registeredView",!1);ve(this,"viewCallback");ve(this,"activeDurationCallback");ve(this,"idleDurationCallback");ve(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),nS({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:il}),Yb({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*il: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 ol="sesamy_session_id";function iS(){let e=sessionStorage.getItem(ol);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ol,e)),e}let sl=!1,Oi,cl,fn;const ul=new Map;function oS({clientId:e,enabled:t=!0,environment:r}){if(Oi=e,cl=t,fn=`${ze("logs",r)}/events`,!cl)return;window.addEventListener("beforeunload",()=>{fl.forEach((a,i)=>{a.bind(i)()}),cS()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&ul.forEach((a,i)=>{a.bind(i)()})}),Zb();const n=new aS({element:document.body,viewCallback:()=>{Ae.page()},activeDurationCallback:(a,i,o)=>{Ae.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Ae.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Ae.track("scroll",{scroll:a.scrollMax})}});uS(document.body,()=>{n.flush()}),lS(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(we.AUTHENTICATED,async a=>{const i=a;await Ae.identify(i.detail.sub)}),window.addEventListener(we.LOGOUT,async()=>{await Ae.track("logout",{}),_i.flush(),await Ae.reset()})}function ll(e){return JSON.stringify(e.map(t=>({...t,clientId:Oi,requestId:Math.random().toString(36).slice(2,9),sessionId:iS(),timestamp:new Date().toISOString(),version:di,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:cu,userAgent:navigator.userAgent,clientId:Oi}})))}const _i=Kb(async e=>{if(e.length>0){const t=ll(e);sl?navigator.sendBeacon(fn,t):(await fetch(fn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Ri(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(fn,ll([r]))}else _i.push(e)}const Ae=Bb({app:cu,version:di,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ri({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Ri({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Ri({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function sS(e,t){Ae.track(e,t)}function cS(){return sl=!0,_i.flush()}const fl=new Map;function uS(e,t){fl.set(e,t)}function lS(e,t){ul.set(e,t)}const dl="sesamySignedURLs";function hl(){const e=sessionStorage.getItem(dl);return e?JSON.parse(e):[]}function fS(e){const t=hl();t.push(e),sessionStorage.setItem(dl,JSON.stringify(t))}function dS(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:c,getContract:l,getContracts:f,getBill:u,getBills:s,getTransaction:d,getTransactions:h,getProfile:m,updateProfile:S,getTags:g,deleteTag:$,setTag:P,getUserMetadata:b,listUserMetadata:v,setUserMetadata:I,deleteUserMetadata:O,getTally:_,getTallies:A,pushTally:M,deleteTally:F,getProduct:W,getPaymentIssues:L,isSpotifyLinked:N,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:K,openHostedAccountPage:Z,generateLink:Le}=Ww(e),p={auth:{getUser:m,isAuthenticated:li,loginWithRedirect:fi,logout:Xc,setToken:Qc},checkouts:{get:r,create:t,update:n},profile:{get:m,update:S,openHostedAccountPage:Z,isSpotifyLinked:N,unlinkSpotify:z},analytics:{track:sS},tags:{list:g,set:P,delete:$},entitlements:{get:a,list:i,access:o,signedLinks:hl},contracts:{get:l,list:f},bills:{get:u,list:s},userMetadata:{get:b,list:v,set:I,delete:O},tallies:{get:_,list:A,push:M,delete:F},subscriptions:{list:c},transactions:{get:d,list:h},products:{get:W,autoOnboard:K,linkSpotify:R},getVersion:hS,getPaymentIssues:L,generateLink:Le,clearCache:be};return e.namespace&&(window[e.namespace]=p),p}function hS(){return di}async function vS({enabled:e=!1,rules:t}){if(!e)return;const r=await li(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const c=document.querySelector(a.content);c?o.innerHTML+=c.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const c=await vl(a.content);c?o.innerHTML+=c:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const c=document.querySelector(a.content);c?o.innerHTML=c.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const c=await vl(a.content);c?o.innerHTML=c:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function vl(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function pS(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Qc(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const pl="sesamy-refresh",ml="force-refetch-entitlements";function mS(){const e=new URLSearchParams(window.location.search),t=e.get(ml),r=e.get(pl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(ml),e.delete(pl),n.search=e.toString(),be(),window.history.replaceState(null,"",n)}}function gS(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;fS({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const gl="sesamy-user";async function yS(){const t=new URLSearchParams(window.location.search).get(gl);if(!t)return;const r=await Aw();(r==null?void 0:r.email)!==t&&(be(),fi({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(gl),window.history.replaceState(null,"",n)}const yl="sesamy-purchase";function wS(){const e=new URLSearchParams(window.location.search),t=e.get(yl);if(t!==null){const r=new URL(window.location.href);e.delete(yl),r.search=e.toString(),Fe(we.PURCHASE,{itemSrc:t}),be(),window.history.replaceState(null,"",r)}}const wl="sesamy-login";async function bS(){if(!new URLSearchParams(window.location.search).get(wl))return;await li()||fi();const n=new URL(window.location.href);n.searchParams.delete(wl),window.history.replaceState(null,"",n)}const SS=typeof window<"u";async function bl(e){oS({clientId:e.clientId,environment:e.environment,...e.analytics}),await jw({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await vS(e.transform),pS(),mS(),gS(),await bS(),await yS(),wS()}async function Sl(e){const t=dS({clientId:e.clientId,environment:e.environment,...e.api});return Fe(we.READY,{}),SS&&(e.awaitAllServices?await bl(e):bl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);Sl(t)}catch(t){console.error("Failed to parse config",t)}}return Ee.init=Sl,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"}),Ee}({});
|
|
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",!If(r))throw new Error(`Invalid cache location "${r}"`);n=If(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Ft:q0,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:Q0;var i;this.scope=zn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Z0(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||df,this.cacheManager=new V0(n,n.allKeys?void 0:new rE(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 tE)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||ff)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${Po(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return Y0({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=pf(To()),i=pf(To()),o=To(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await Fn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,S,g,E)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:zn(c,d.scope),response_type:"code",response_mode:E||"query",state:v,nonce:p,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,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 M0(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new D0(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(ce.fromPayload(v.data.response));u(v.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new ce("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Ef(t),{openUrl:a,fragment:i,appState:o}=n,s=je(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=je(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new ce("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new x0(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new ce("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:zn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=ko[o];return s||(s=i().finally(()=>{delete ko[o],s=null}),ko[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=je(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})(()=>_o.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Eo;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 _o.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:zn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},U0),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=je(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Po(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Ef(t),{openUrl:n}=r,a=je(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new ce("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((p,S,g=60)=>new Promise((E,I)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const k=setTimeout(()=>{I(new Eo),h()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const j=_.source;j&&j.close(),_.data.response.error?I(ce.fromPayload(_.data.response)):E(_.data.response),clearTimeout(k),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new ce("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:f,oauthTokenScope:v.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new 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 vf(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=je(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 G0(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 iE(e){const t=new aE(e);return await t.checkSession(),t}var Pe=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Pe||{});const oE="sesamy.com",sE="sesamy.dev",cE="https://sesa.my",Ro="sesamyCacheTimestamp";function Ve(e,t){return`https://${e}.${t==="dev"?sE:oE}`}let ue,Tf,Pf=!1;const zt="sesamyAccessToken",Co="sesamyRefreshToken";async function Pr(){return new Promise((r,n)=>{let a=0;const i=()=>{Pf?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function uE(e){if(!e)return null;const t=localStorage.getItem(Co);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(Co),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Co,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{kf()}}async function Ao(){const e=localStorage.getItem(zt);if(!e)return null;const t=_f(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await uE(t);if(r)return r;localStorage.removeItem(zt)}return e}function Of(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 lE(e){if(e.enabled===!1)return;Tf=e.organization;const t={domain:Ve("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(Of(window.location.href)!==Of(Ve("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ue=await iE(t),window.location.search.includes("code="))try{await ue.handleRedirectCallback();const r=await ue.getUser();We(Pe.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Pf=!0}async function jo(){return await Pr(),await Ao()?!0:ue?ue.isAuthenticated():!1}async function fE(){return await Pr(),await Ao()?{sub:"local",name:"Local User"}:ue?ue.getUser():null}async function Lo(e){if(await Pr(),localStorage.removeItem(zt),!ue)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ue.loginWithRedirect({...e,authorizationParams:{organization:Tf,redirect_uri:window.location.href,...t}})}async function Or(e=!0){await Pr();const t=await Ao();if(t)return t;try{return ue?await ue.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function kf(e={}){if(await Pr(),localStorage.removeItem(zt),We(Pe.LOGOUT,{}),!!ue)return ue.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function _f(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 Rf(e){const t=_f(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),We(Pe.AUTHENTICATED,t)}const dE=(e,t)=>t.skipDedupe||t.method!=="GET",vE=(e,t)=>t.method+"@"+e,hE=e=>e.clone(),Cf=({skip:e=dE,key:t=vE,resolver:r=hE}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([f,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},pE=(e,t)=>e*t,mE=e=>e&&e.ok,Af=({delayTimer:e=500,delayRamp:t=pE,maxAttempts:r=10,until:n=mE,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(v,p)=>Promise.resolve(n(v,p)).then(S=>S?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const E=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((I={})=>{var b,h;g(u((b=I&&I.url)!==null&&b!==void 0?b:f,(h=I&&I.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},E)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},gE="application/json",jf="Content-Type",Bt=Symbol(),Lf=Symbol();function Nf(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===jf.toLowerCase()))===null||t===void 0?void 0:t[1]}function Uf(e){return/^application\/.*json.*/.test(e)}const vt=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]=vt(o,i,r):n[a]=i,n},{...e})},Ht={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function yE(e,t=!1){Ht.options=t?e:vt(Ht.options,e)}function wE(e,t=!1){Ht.polyfills=t?e:vt(Ht.polyfills,e)}function bE(e){Ht.errorType=e}const SE=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class xf extends Error{}const $E=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=vt(a.options,n);let c=r;const d=SE(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[Bt]:b}}).then(b=>{if(!b.ok){const h=new xf;if(h.cause=v,h.stack=h.stack+`
|
|
5
|
+
CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var k;if(h.message=$,a.errorType==="json"||((k=b.headers.get("Content-Type"))===null||k===void 0?void 0:k.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),S=b=>b.catch(h=>{const $=h.hasOwnProperty(Bt),k=$?h[Bt]:h,_=(k==null?void 0:k.status)&&f.get(k.status)||f.get(k==null?void 0:k.name)||$&&f.has(Bt)&&f.get(Bt);if(_)return _(k,e);const j=f.get(Lf);if(j)return j(k,e);throw k}),g=b=>h=>S(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),E={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(Bt,b)}},I=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),E);return o.reduce((b,h)=>h(b,e),I)},IE={_url:"",_options:{},_config:Ht,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:vt(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:vt(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:vt(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[jf]: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(Lf,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=Nf(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Uf(a));return n=r?o?n.json(r,a):n.body(r):n,$E(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=Nf(this._options.headers);return this.content(t||Uf(r)&&r||gE).body(JSON.stringify(e))}};function Me(e="",t={}){return{...IE,_url:e,_options:t}}Me.default=Me,Me.options=yE,Me.errorType=bE,Me.polyfills=wE,Me.WretchError=xf;function Oe(){sessionStorage.removeItem(Ro),We(Pe.CLEAR_CACHE,{})}function Df(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function EE(e){const t=Ve("api2",e.environment),r=w=>async(T,P)=>{let B=sessionStorage.getItem(Ro);B||(B=Date.now().toString(),sessionStorage.setItem(Ro,B));const oe={...P,headers:{...P.headers,"Cache-Timestamp":B}};return w(T,oe)},n=(w=!0)=>T=>async(P,B)=>{let oe=null;if(oe=await Or(w),!oe){if(w)throw new Error("No access token available");return T(P,B)}const qe={...B,headers:{...B.headers,...oe?{Authorization:`Bearer ${oe}`}:{}}};return T(P,qe)},a=w=>(T,P)=>{if(P.headers.Authorization)return w(T,P);const B=localStorage.getItem("__anon_id"),oe=btoa(`${B}:`),qe={...P,headers:{...P.headers,Authorization:`Basic ${oe}`}};return w(T,qe)},i=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Cf(),Af({delayTimer:1e3,delayRamp:(w,T)=>w*T,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Cf(),Af({delayTimer:1e3,delayRamp:(w,T)=>w*T,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(w){const T=await i.get("/entitlements").json();return T==null?void 0:T.find(P=>P.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(w){const T=await i.get("/contracts").json();return T==null?void 0:T.find(P=>P.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function v(){return i.get("/bills").json()}async function p(w){const T=await i.get("/bills").json();return T==null?void 0:T.find(P=>P.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const T=await i.get("/transactions").json();return T==null?void 0:T.find(P=>P.id===w)}async function E(w,T){const P=await i.url(`/user-metadata/${w}`).put(T).json();return We(Pe.USER_ATTRIBUTE_CHANGED,{}),Oe(),P}async function I(w){const T=await i.url(`/user-metadata/${w}`).delete().res();return Oe(),T.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function h(){return await i.url("/user-metadata").get().json()}async function $(){return await i.url("/tags").get().json()}async function k(w){const T=await i.url(`/tags/${w}`).delete().res();return Oe(),T.ok}async function _(w){const T=await i.url("/tags").post(w).res();return We(Pe.USER_ATTRIBUTE_CHANGED,{}),Oe(),T.ok}async function j(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const T=await o.url(`/tallies/${w}`).delete().res();return Oe(),T.ok}async function Z(w,T){return await o.url(`/tallies/${w}/push`).post(T).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function x(){return await Or(!1)?await i.url("/profile").get().json():null}async function z(w){const T=await i.url("/profile").patch(w).res();return Oe(),T.ok}async function R(){return await i.url("/payment-issues").get().json()}async function V(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function Y(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function Be(w){const T=await Or(!1);if(!T)throw new Error("No access token available");const P=new URL(`${Ve("spotify-oas",e.environment)}/sesamy-callback`);P.searchParams.set("access_token",T),P.searchParams.set("state",w),window.location.href=P.toString()}async function m(w){const T=await i.url(`/products/${w}/auto-onboard`).post().json();return T.length&&Oe(),T}async function y(w,T=3600){const{shortlink:P}=await Me(cE).post({url:w,ttl:T}).json();return P}async function O(w){const T=await Or(!1);let P;const B=w.language||Df();switch(w.target){case"account":P=new URL(`${Ve("account",e.environment)}/${B}/subscriptions/${e.clientId}`);break;case"consume":P=new URL(`${Ve("consume",e.environment)}/${B}/@${e.clientId}/${w.sku}`),w.episodeId?P.href+=`/${w.episodeId}`:P.href+="/listen";break;default:throw new Error("Invalid target")}return P.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),T&&(P.hash=`#access_token=${T}`),w.shorten?y(P.href,w.ttl):P.href}async function N(w){return(await o.url("/checkouts").post({language:Df(),...w,vendorId:e.clientId})).json()}async function U(w,T){return(await o.url(`/checkouts/${w}`).patch(T)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function J(){const w=await Or(!1),T=new URL(`${Ve("account",e.environment)}/subscriptions/${e.clientId}`);w&&(T.hash=`#access_token=${w}`),window.location.href=T.toString()}return{createCheckout:N,updateCheckout:U,getCheckout:D,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,getProfile:x,updateProfile:z,getSubscriptions:d,getBills:v,getBill:p,setUserMetadata:E,deleteUserMetadata:I,getUserMetadata:b,listUserMetadata:h,getTags:$,deleteTag:k,setTag:_,getTally:j,getTallies:M,deleteTally:F,pushTally:Z,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:m,isSpotifyLinked:V,unlinkSpotify:Y,linkSpotify:Be,generateLink:O,openHostedAccountPage:J}}const Mf="@sesamy/sesamy-js",No="1.19.1";function Ff(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 Bn="undefined",zf="object",Uo=function(){},Bf="any",Hf="*",ht="__",Hn=typeof process<"u"?process:{};Hn.env&&Hn.env.NODE_ENV;var ee=typeof document<"u";Hn.versions!=null&&Hn.versions.node!=null,typeof Deno<"u"&&Deno.core,ee&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Kf(e,t){return t.charAt(0)[e]()+t.slice(1)}var TE=Kf.bind(null,"toUpperCase"),PE=Kf.bind(null,"toLowerCase");function OE(e){return Gf(e)?TE("null"):typeof e=="object"?CE(e):Object.prototype.toString.call(e).slice(8,-1)}function Kn(e,t){t===void 0&&(t=!0);var r=OE(e);return t?PE(r):r}function kr(e,t){return typeof t===e}var ae=kr.bind(null,"function"),Ze=kr.bind(null,"string"),Kt=kr.bind(null,"undefined"),kE=kr.bind(null,"boolean");kr.bind(null,"symbol");function Gf(e){return e===null}function _E(e){return Kn(e)==="number"&&!isNaN(e)}function Wf(e){return Kn(e)==="array"}function ie(e){if(!RE(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function RE(e){return e&&(typeof e=="object"||e!==null)}function CE(e){return ae(e.constructor)?e.constructor.name:null}function AE(e){return e instanceof Error||Ze(e.message)&&e.constructor&&_E(e.constructor.stackTraceLimit)}function Vf(e,t){if(typeof t!="object"||Gf(t))return!1;if(t instanceof e)return!0;var r=Kn(new e(""));if(AE(t))for(;t;){if(Kn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Vf.bind(null,TypeError),Vf.bind(null,SyntaxError);function Gn(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?jE(e,t):r}function jE(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function Wn(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}Wn(Gn,"form"),Wn(Gn,"button"),Wn(Gn,"input"),Wn(Gn,"select");function LE(e){return e?Wf(e)?e:[e]:[]}function Zf(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function NE(){if(ee){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function UE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function xE(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Zf(r[1]),o=Zf(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&&(DE(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return ee&&window.location.search.substring(1)}())}function DE(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 Vn(){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 ME(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 _r="global",Gt=ht+"global"+ht,Wt=typeof self===zf&&self.self===self&&self||typeof global===zf&&global.global===global&&global||void 0;function pt(e){return Wt[Gt][e]}function mt(e,t){return Wt[Gt][e]=t}function Vt(e){delete Wt[Gt][e]}function Zt(e,t,r){var n;try{if(xo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Wt[Gt]||(Wt[Gt]={});var Zn={};function xo(e){if(typeof Zn[e]!==Bn)return Zn[e];try{var t=window[e];t.setItem(Bn,Bn),t.removeItem(Bn)}catch{return Zn[e]=!1}return Zn[e]=!0}function C(){return C=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},C.apply(this,arguments)}var Je="function",Fe="undefined",FE="@@redux/"+Math.random().toString(36),Jf=function(){return typeof Symbol===Je&&Symbol.observable||"@@observable"}(),Jn=" != "+Je;function Yf(e,t,r){var n;if(typeof t===Je&&typeof r===Fe&&(r=t,t=void 0),typeof r!==Fe){if(typeof r!==Je)throw new Error("enhancer"+Jn);return r(Yf)(e,t)}if(typeof e!==Je)throw new Error("reducer"+Jn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Je)throw new Error("Listener"+Jn);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var S=s.indexOf(v);s.splice(S,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===Fe)throw new Error("ActType "+Fe);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,S=0;S<p.length;S++)(0,p[S])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Je)throw new Error("next reducer"+Jn);a=v,d({type:"@@redux/INIT"})}})[Jf]=function(){var v,p=c;return(v={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:p(g)}}})[Jf]=function(){return this},v},n}function zE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+Fe}function Jt(){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 BE(){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)}),C({},o,{dispatch:s=Jt.apply(void 0,i)(o.dispatch)})}}}var Ye=ht+"anon_id",gt=ht+"user_id",Yt=ht+"user_traits",Xe="userId",Xt="anonymousId",Yn=["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"],Do=["name","EVENTS","config","loaded"],A=Yn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Xf=/^utm_/,qf=/^an_prop_/,Qf=/^an_trait_/;function HE(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(Ye,o.anonymousId),f||t(gt,o.userId),u.traits&&t(Yt,C({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,v=l.reduce(function(p,S){if(S.match(Xf)||S.match(/^(d|g)clid/)){var g=S.replace(Xf,"");p.campaign[g==="campaign"?"name":g]=i[S]}return S.match(qf)&&(p.props[S.replace(qf,"")]=i[S]),S.match(Qf)&&(p.traits[S.replace(Qf,"")]=i[S]),p},{campaign:{},props:{},traits:{}});r.dispatch(C({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function KE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Ye)return C({},t,{anonymousId:r.value});if(r.key===gt)return C({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:C({},t.traits,r.traits)});case A.reset:return[gt,Ye,Yt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function ed(e){return{userId:e.getItem(gt),anonymousId:e.getItem(Ye),traits:e.getItem(Yt)}}var Mo=function(e){return ht+"TEMP"+ht+e};function GE(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&&([gt,Yt,Ye].forEach(function(v){n(v)}),[Xe,Xt,"traits"].forEach(function(v){Vt(Mo(v))})),s.type===A.identify){a(Ye)||r(Ye,Vn());var c=a(gt),d=a(Yt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(gt,u),f&&r(Yt,C({},d,f))}return o(s)}}}}var Rr={};function td(e,t){Rr[e]&&ae(Rr[e])&&(Rr[e](t),delete Rr[e])}function rd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(C({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return rd(e,t,r-10).then(n,a)})})}function WE(e){return{abort:e}}function nd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,S=a[v][p];if(S&&ae(S)){var g,E=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[Xe,Xt].reduce(function(k,_){return h.hasOwnProperty(_)&&$[_]&&$[_]!==h[_]&&(k[_]=$[_]),k},h)}(d.payload,u),I=n[E.meta.rid];if(!I&&(g=S({payload:E,config:o[v].config,instance:r,abort:WE}))&&ie(g)&&g.abort)return void(n[E.meta.rid]=!0);if(!I){var b=p+":"+v;e.dispatch(C({},E,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var Fo=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(qt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,E){return function(I,b,h){var $=b.config,k=b.name,_=k+"."+I.type;h&&(_=h.event);var j=I.type.match(qt)?function(M,F,Z,L,x){return function(z,R){var V=L?L.name:M,Y=R&&Cr(R)?R:Z;if(L&&(!(Y=R&&Cr(R)?R:[M]).includes(M)||Y.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(Y)+" input valid");return C({},x,{abort:{reason:z,plugins:Y,caller:F,_:V}})}}(k,_,E,h,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:VE(I),instance:g,config:$||{},abort:j}}}(n,v),S=t.exact.reduce(function(g,E){var I=E.pluginName,b=E.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[I].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+I]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,E,I){try{var b=E.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var k=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,j,M){try{return Promise.resolve(_).then(function(F){return j.method&&ae(j.method)?(function(z,R){var V=fd(z);if(V&&V.name===R){var Y=fd(V.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+V.method+" "+(Y?"or "+Y.method:"")+" in "+R+" plugin insteadof "+z].join(`
|
|
6
|
+
`))}}(j.methodName,j.pluginName),Promise.resolve(j.method({payload:F,instance:n,abort:(Z=F,L=b,x=j.pluginName,function(z,R){return C({},Z,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:od(j.pluginName,f,i),plugins:f})).then(function(z){var R=ie(z)?z:{};return Promise.resolve(C({},F,R))})):F;var Z,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){h[b]=_});h[b]=r}();return k&&k.then?k.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(E,I,b){try{var h=t.exact.length===b+1,$=I.pluginName,k=i[$];return Promise.resolve(E).then(function(_){var j=g[$]?g[$]:{};if(d&&(j=_),Bo(j,$))return zo({data:j,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(Bo(_,$))return h&&zo({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=p(g[$],i[$]);return Promise.resolve(k[c]({abort:M.abort,payload:j,instance:n,config:od($,f,i),plugins:f})).then(function(F){var Z=ie(F)?F:{},L=C({},_,Z),x=g[$];if(Bo(x,$))zo({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(ad)&&!c.match(id)&&n.dispatch(C({},d?L:j,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(E){if(!(c.match(qt)||c.match(/^registerPlugin/)||c.match(id)||c.match(ad)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),E._&&E._.originalAction===c)return E;var I=C({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});ud(E,t.exact.length)&&!c.match(/End$/)&&(I=C({},I,{type:E.type+"Aborted"})),s.dispatch(I)}return E})})}catch(g){return Promise.reject(g)}},qt=/Start$/,ad=/^bootstrap/,id=/^ready/;function zo(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(C({},e.data,{type:r,_:{called:r,from:"abort"}}))}function od(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function sd(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function cd(e,t){var r=e.replace(qt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function Bo(e,t){var r=e.abort;return!!r&&(r===!0||ld(r,t)||r&&ld(r.plugins,t))}function ud(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ze(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 ld(e,t){return!(!e||!Cr(e))&&e.includes(t)}function fd(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function VE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function ZE(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return td(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),S=[],g=[],E=o.disabled,I=p.map(function(h){var $=h.loaded,k=h.name,_=h.config;return rd(h,function(){return $({config:_})},1e4).then(function(j){return n[k]||(a.dispatch({type:A.pluginReadyType(k),name:k,events:Object.keys(h).filter(function(M){return!Do.includes(M)})}),n[k]=!0),S=S.concat(k),h}).catch(function(j){if(j instanceof Error)throw new Error(j);return g=g.concat(j.name),j})});Promise.all(I).then(function(h){var $={plugins:S,failed:g,disabled:E};setTimeout(function(){v.length===I.length+E.length&&a.dispatch(C({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return nd(a,t,e)},0),Promise.resolve(function(h,$,k,_,j){try{var M=ae($)?$():$,F=h.type,Z=F.replace(qt,"");if(h._&&h._.called)return Promise.resolve(h);var L=k.getState(),x=(V=M,(Y=L.plugins)===void 0&&(Y={}),(Be=h.options)===void 0&&(Be={}),Object.keys(V).filter(function(m){var y=Be.plugins||{};return kE(y[m])?y[m]:y.all!==!1&&(!Y[m]||Y[m].enabled!==!1)}).map(function(m){return V[m]}));F===A.initializeStart&&h.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,y,O){var N=cd(m).map(function(U){return sd(U,y)});return y.reduce(function(U,D){var J=D.name,w=cd(m,J).map(function(oe){return sd(oe,y)}),T=w[0],P=w[1],B=w[2];return T.length&&(U.beforeNS[J]=T),P.length&&(U.duringNS[J]=P),B.length&&(U.afterNS[J]=B),U},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,x);return Promise.resolve(Fo({action:h,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:j})).then(function(m){function y(){var U=function(){if(F.match(qt))return Promise.resolve(Fo({action:C({},O,{type:Z+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:j})).then(function(D){D.meta&&D.meta.hasCallback&&td(D.meta.rid,{payload:D})})}();return U&&U.then?U.then(function(){return m}):m}if(ud(m,z.length))return m;var O,N=function(){if(F!==Z)return Promise.resolve(Fo({action:C({},m,{type:Z}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:j})).then(function(U){O=U});O=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var V,Y,Be}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function JE(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 YE=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 Jt.apply(void 0,o)(n)(a)}}}}};function XE(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=dd(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},C({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=dd(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=C({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),C({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=C({},t[r.name],{loaded:!0}),C({},t,n);switch(r.type){case A.disablePlugin:return C({},t,vd(r.plugins,!1,t));case A.enablePlugin:return C({},t,vd(r.plugins,!0,t));default:return t}}}function dd(e,t){return e.substring(t.length+1,e.length)}function vd(e,t,r){return e.reduce(function(n,a){return n[a]=C({},r[a],{enabled:t}),n},r)}function hd(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var qE={last:{},history:[]};function QE(e,t){e===void 0&&(e=qE);var r=t.options,n=t.meta;if(t.type===A.track){var a=hd(C({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return C({},e,{last:a,history:e.history.concat(a)})}return e}var eT={actions:[]};function tT(e,t){e===void 0&&(e=eT);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),C({},e,{actions:n});case"dequeue":return[];default:return e}}var pd=/#.*$/;function rT(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(pd,""):"")}var md,gd,yd,wd,nT=function(e){if(e===void 0&&(e={}),!ee)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var v=function(){if(ee){for(var p,S=document.getElementsByTagName("link"),g=0;p=S[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(pd,"")}(f),c={title:r,url:l,path:rT(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),C({},c,e)},aT={last:{},history:[]};function iT(e,t){e===void 0&&(e=aT);var r=t.options;if(t.type===A.page){var n=hd(C({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return C({},e,{last:n,history:e.history.concat(n)})}return e}md=function(){if(!ee)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"}(),gd=ee?document.referrer:null,yd=NE(),wd=UE();var bd={initialized:!1,sessionId:Vn(),app:null,version:null,debug:!1,offline:!!ee&&!navigator.onLine,os:{name:md},userAgent:ee?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:wd,locale:yd,campaign:{},referrer:gd};function oT(e,t){e===void 0&&(e=bd);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return C({},e,{campaign:n});case A.offline:return C({},e,{offline:!0});case A.online:return C({},e,{offline:!1});default:return r?e:C({},bd,e,{initialized:!0})}}var sT=["plugins","reducers","storage"];function cT(e,t,r){if(ee){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function uT(e){var t=cT.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Sd(){return mt("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 Wt[Gt].analytics.push(o.action||o),i(o)}})}}}function $d(e){return function(){return Jt(Jt.apply(null,arguments),Sd())}}function Ho(e){return e?Wf(e)?e:[e]:[]}function Id(e,t,r){e===void 0&&(e={});var n,a,i=Vn();return t&&(Rr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(ae(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),C({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function lT(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(ae(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var O=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,J){var w;return D[J]=(w=y.methods[J],function(){for(var T=Array.prototype.slice.call(arguments),P=new Array(w.length),B=0;B<T.length;B++)P[B]=T[B];return P[P.length]=$,w.apply({instance:$},P)}),D},{}),delete y.methods);var N=Object.keys(y).concat(O),U=new Set(m.events.concat(N));if(m.events=Array.from(U),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:pt,setItem:mt,removeItem:Vt},i=function(m){return function(y,O,N){return O.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:ed(m)[y]||pt(Mo(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!Do.includes(m)}).sort(),u=new Set(s.concat(Yn).filter(function(m){return!Do.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new YE,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=xE(),E=ed(a),I=C({},E,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=Vn());var b=C({enable:function(m,y){return new Promise(function(O){R.dispatch({type:A.enablePlugin,plugins:Ho(m),_:{originalAction:A.enablePlugin}},O,[y])})},disable:function(m,y){return new Promise(function(O){R.dispatch({type:A.disablePlugin,plugins:Ho(m),_:{originalAction:A.disablePlugin}},O,[y])})}},n.methods),h=!1,$={identify:function(m,y,O,N){try{var U=Ze(m)?m:null,D=ie(m)?m:y,J=O||{},w=$.user();mt(Mo(Xe),U);var T=U||D.userId||i(Xe,$,D);return Promise.resolve(new Promise(function(P){R.dispatch(C({type:A.identifyStart,userId:T,traits:D||{},options:J,anonymousId:w.anonymousId},w.id&&w.id!==U&&{previousId:w.id}),P,[y,O,N])}))}catch(P){return Promise.reject(P)}},track:function(m,y,O,N){try{var U=ie(m)?m.event:m;if(!U||!Ze(U))throw new Error("EventMissing");var D=ie(m)?m:y||{},J=ie(O)?O:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:A.trackStart,event:U,properties:D,options:J,userId:i(Xe,$,y),anonymousId:i(Xt,$,y)},w,[y,O,N])}))}catch(w){return Promise.reject(w)}},page:function(m,y,O){try{var N=ie(m)?m:{},U=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:nT(N),options:U,userId:i(Xe,$,N),anonymousId:i(Xt,$,N)},D,[m,y,O])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===Xe||m==="id")return i(Xe,$);if(m===Xt||m==="anonId")return i(Xt,$);var y=$.getState("user");return m?Ff(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!ae(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var O=/Start$|Start:/;if(m==="*"){var N=function(w){return function(T){return function(P){return P.type.match(O)&&y({payload:P,instance:$,plugins:o}),T(P)}}},U=function(w){return function(T){return function(P){return P.type.match(O)||y({payload:P,instance:$,plugins:o}),T(P)}}};return d(N,Xn),d(U,qn),function(){v(N,Xn),v(U,qn)}}var D=m.match(O)?Xn:qn,J=function(w){return function(T){return function(P){return P.type===m&&y({payload:P,instance:$,plugins:o,abort:S}),T(P)}}};return d(J,D),function(){return v(J,D)}},once:function(m,y){if(!m||!ae(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var O=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:S}),O()});return O},getState:function(m){var y=R.getState();return m?Ff(y,m):Object.assign({},y)},dispatch:function(m){var y=Ze(m)?{type:m}:m;if(Yn.includes(y.type))throw new Error("reserved action "+y.type);var O=C({},y,{_:C({originalAction:y.type},m._||{})});R.dispatch(O)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,O){R.dispatch({type:A.setItemStart,key:m,value:y,options:O})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Ye,m,y)},events:{core:Yn,plugins:s}},k=n.middlewares.concat([function(m){return function(y){return function(O){return O.meta||(O.meta=Id()),y(O)}}},p(Xn),ZE($,l,{all:f,plugins:s}),JE(a),HE($),GE($),p(qn)]),_={context:oT,user:KE(a),page:iT,track:QE,plugins:XE(l),queue:tT},j=Jt,M=Jt;if(ee&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(j=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Sd():ie(typeof arguments[0])?$d():$d().apply(null,arguments)}}var Z,L=function(m){return Object.keys(m).reduce(function(y,O){return sT.includes(O)||(y[O]=m[O]),y},{})}(e),x=n.pluginsArray.reduce(function(m,y){var O=y.name,N=y.config,U=y.loaded,D=n.pluginEnabled[O];return m[O]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!U({config:N}),config:N},m},{}),z={context:L,user:I,plugins:x},R=Yf(function(m){for(var y=Object.keys(m),O={},N=0;N<y.length;N++){var U=y[N];typeof m[U]===Je&&(O[U]=m[U])}var D,J=Object.keys(O);try{(function(w){Object.keys(w).forEach(function(T){var P=w[T];if(typeof P(void 0,{type:"@@redux/INIT"})===Fe||typeof P(void 0,{type:FE})===Fe)throw new Error("reducer "+T+" "+Fe)})})(O)}catch(w){D=w}return function(w,T){if(w===void 0&&(w={}),D)throw D;for(var P=!1,B={},oe=0;oe<J.length;oe++){var qe=J[oe],Qd=w[qe],es=(0,O[qe])(Qd,T);if(typeof es===Fe){var eP=zE(qe,T);throw new Error(eP)}B[qe]=es,P=P||es!==Qd}return P?B:w}}(C({},_,t)),z,M(j(BE.apply(void 0,k))));R.dispatch=(Z=R.dispatch,function(m,y,O){var N=C({},m,{meta:Id(m.meta,y,Ho(O))});return Z.apply(null,[N])});var V=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:V,config:L,params:g,user:I,initialUser:r,persistedUser:E});var Y=V.filter(function(m){return n.pluginEnabled[m]}),Be=V.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:V,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var O=m.bootstrap,N=m.config,U=m.name;O&&ae(O)&&O({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(U),name:U,enabled:n.pluginEnabled[U],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:Y,disabled:Be})}),uT(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,O){setInterval(function(){return nd(m,y,O)},3e3)}(R,l,$),$}var Xn="before",qn="after",Ar="cookie",yt=Pd(),Ed=Qn,fT=Qn;function Td(e){return yt?Qn(e,"",-1):Vt(e)}function Pd(){if(yt!==void 0)return yt;var e="cookiecookie";try{Qn(e,e),yt=document.cookie.indexOf(e)!==-1,Td(e)}catch{yt=!1}return yt}function Qn(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return yt===!1&&(o?mt(e,t):pt(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 jr="localStorage",dT=xo.bind(null,"localStorage");Zt("localStorage","getItem",pt),Zt("localStorage","setItem",mt),Zt("localStorage","removeItem",Vt);var Lr="sessionStorage",vT=xo.bind(null,"sessionStorage");Zt("sessionStorage","getItem",pt),Zt("sessionStorage","setItem",mt),Zt("sessionStorage","removeItem",Vt);function Qt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var hT=dT(),pT=vT(),mT=Pd();function Od(e,t){if(e){var r=Ko(t),n=!Zo(r),a=Go(r)?Qt(localStorage.getItem(e)):void 0;if(n&&!Kt(a))return a;var i=Wo(r)?Qt(Ed(e)):void 0;if(n&&i)return i;var o=Vo(r)?Qt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=pt(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function gT(e,t,r){if(e&&!Kt(t)){var n={},a=Ko(r),i=JSON.stringify(t),o=!Zo(a);return Go(a)&&(n[jr]=ta(jr,t,Qt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[jr]:Wo(a)&&(n[Ar]=ta(Ar,t,Qt(Ed(e))),fT(e,i),o)?n[Ar]:Vo(a)&&(n[Lr]=ta(Lr,t,Qt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[Lr]:(n[_r]=ta(_r,t,pt(e)),mt(e,t),o?n[_r]:n)}}function yT(e,t){if(e){var r=Ko(t),n=Od(e,Hf),a={};return!Kt(n.localStorage)&&Go(r)&&(localStorage.removeItem(e),a[jr]=n.localStorage),!Kt(n.cookie)&&Wo(r)&&(Td(e),a[Ar]=n.cookie),!Kt(n.sessionStorage)&&Vo(r)&&(sessionStorage.removeItem(e),a[Lr]=n.sessionStorage),!Kt(n.global)&&ea(r,_r)&&(Vt(e),a[_r]=n.global),a}}function Ko(e){return e?Ze(e)?e:e.storage:Bf}function Go(e){return hT&&ea(e,jr)}function Wo(e){return mT&&ea(e,Ar)}function Vo(e){return pT&&ea(e,Lr)}function Zo(e){return e===Hf||e==="all"}function ea(e,t){return e===Bf||e===t||Zo(e)}function ta(e,t,r){return{location:e,current:t,previous:r}}var wT={setItem:gT,getItem:Od,removeItem:yT};function bT(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kd(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 _d(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kd(Object(r),!0).forEach(function(n){bT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ST(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:wT};return lT(_d(_d({},t),e))}function $T(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 IT(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=TT(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function ET(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function TT(e){return["#","?"].forEach(t=>e=ET(e,t)),e}function PT(){IT(()=>{ze.page()})}function OT(e){if(e===void 0&&(e={}),!ee)return Uo;var t=Cd(),r=Jo(),n=Rd(),a=ra(n,t),i=ra(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return Uo;var v=d.map(function(S){return Number(S)}),p=ME(function(){var S=Cd(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,v),E=Jo(),I=Rd(),b=ra(I,S),h=ra(E,S);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===I,k="up";$?k="initial":f<=I&&(k="down");var _=g,j=v;(k==="up"||$)&&(_=g.slice().reverse(),j=v.slice().reverse());var M=j.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(V){return V!==x}),L.singleFunction=x),k==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):k==="up"&&!o.includes(x)&&I<=R&&x<=b?(L.foundFunc=[x],L):($&&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:k});if(f=I,k==="down"&&M.callbacks&&M.callbacks.forEach(function(L){ae(e[L])&&(e[L]({trigger:L,direction:k,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,Z=M.direction;ae(e[F])&&e[F]({trigger:F,direction:Z,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function Jo(){return ee?document.body.scrollTop||document.documentElement.scrollTop:0}function kT(){return ee?window.innerHeight||document.documentElement.clientHeight:0}function Rd(){return Math.round(Jo()+kT())}function Cd(){if(!ee)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function ra(e,t){return Math.round(e/t*100)}var Ad="EventListener";function _T(e){return function(t,r,n,a){var i=n||Uo,o=a||!1;if(!ee)return i;var s=na(r),u=na(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"+Ad:"remove"+Ad,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?RT(i):i:f[v]||i;for(var S=0;S<s.length;S++)p[d]?p["on"+s[S]]=c?f[v]:null:p[d](s[S],f[v],o)}return l.bind(null,!c)}(e)}}function na(e,t){if(Ze(e))return t?na(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=LE(e);return t?i.map(function(o){return Ze(o)?na(o,!0):o}).flat():i}function RT(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var Yo=_T("Event");function jd(e,t){return ee&&ae(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),ae(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}jd.bind(null,"onerror"),jd.bind(null,"onload");var Ld=typeof window>"u",Nd="hidden";function CT(e){if(Ld)return!1;var t=AT(),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 AT(){var e=["webkit","moz","ms","o"];return Ld||Nd in document?Nd:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var jT=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function LT(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=CT(function(s){s||r({type:"tabVisible"})});return n=[o].concat(jT.map(function(s){return Yo(document,s,r)})).concat(Yo(window,"load",r)).concat(Yo(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function NT(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(Nr(d),g),a&&l&&(l=!1,a(Nr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(Nr(d),g))},s)}var S=LT(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=S();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:Nr(d,c),idle:l?Nr(r,c):0}}}}function Nr(e,t){return t?0:Math.round((new Date-e)/1e3)}const Ud=5e3;class UT{constructor(t){be(this,"element");be(this,"isInViewport",!1);be(this,"isAwake",!1);be(this,"isFlushing");be(this,"observer");be(this,"lastEventAt",Date.now());be(this,"registeredView",!1);be(this,"viewCallback");be(this,"activeDurationCallback");be(this,"idleDurationCallback");be(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),NT({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Ud}),OT({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*Ud: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 xd="sesamy_session_id";function xT(){let e=sessionStorage.getItem(xd);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(xd,e)),e}let Dd=!1,Xo,Md,aa;const Fd=new Map;function DT({clientId:e,enabled:t=!0,environment:r}){if(Xo=e,Md=t,aa=`${Ve("logs",r)}/events`,!Md)return;window.addEventListener("beforeunload",()=>{Bd.forEach((a,i)=>{a.bind(i)()}),FT()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Fd.forEach((a,i)=>{a.bind(i)()})}),PT();const n=new UT({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})}});zT(document.body,()=>{n.flush()}),BT(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Pe.AUTHENTICATED,async a=>{const i=a;await ze.identify(i.detail.sub)}),window.addEventListener(Pe.LOGOUT,async()=>{await ze.track("logout",{}),qo.flush(),await ze.reset()})}function zd(e){return JSON.stringify(e.map(t=>({...t,clientId:Xo,requestId:Math.random().toString(36).slice(2,9),sessionId:xT(),timestamp:new Date().toISOString(),version:No,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:Mf,userAgent:navigator.userAgent,clientId:Xo}})))}const qo=$T(async e=>{if(e.length>0){const t=zd(e);Dd?navigator.sendBeacon(aa,t):(await fetch(aa,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function Qo(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(aa,zd([r]))}else qo.push(e)}const ze=ST({app:Mf,version:No,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Qo({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;Qo({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;Qo({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function MT(e,t){ze.track(e,t)}function FT(){return Dd=!0,qo.flush()}const Bd=new Map;function zT(e,t){Bd.set(e,t)}function BT(e,t){Fd.set(e,t)}const Hd="sesamySignedURLs";function Kd(){const e=sessionStorage.getItem(Hd);return e?JSON.parse(e):[]}function HT(e){const t=Kd();t.push(e),sessionStorage.setItem(Hd,JSON.stringify(t))}function KT(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,getBill:l,getBills:c,getTransaction:d,getTransactions:v,getProfile:p,updateProfile:S,getTags:g,deleteTag:E,setTag:I,getUserMetadata:b,listUserMetadata:h,setUserMetadata:$,deleteUserMetadata:k,getTally:_,getTallies:j,pushTally:M,deleteTally:F,getProduct:Z,getPaymentIssues:L,isSpotifyLinked:x,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:V,openHostedAccountPage:Y,generateLink:Be}=EE(e),m={auth:{getUser:p,isAuthenticated:jo,loginWithRedirect:Lo,logout:kf,setToken:Rf},checkouts:{get:r,create:t,update:n},profile:{get:p,update:S,openHostedAccountPage:Y,isSpotifyLinked:x,unlinkSpotify:z},analytics:{track:MT},tags:{list:g,set:I,delete:E},entitlements:{get:a,list:i,access:o,signedLinks:Kd},contracts:{get:u,list:f},bills:{get:l,list:c},userMetadata:{get:b,list:h,set:$,delete:k},tallies:{get:_,list:j,push:M,delete:F},subscriptions:{list:s},transactions:{get:d,list:v},products:{get:Z,autoOnboard:V,linkSpotify:R},getVersion:GT,getPaymentIssues:L,generateLink:Be,clearCache:Oe};return e.namespace&&(window[e.namespace]=m),m}function GT(){return No}async function WT({enabled:e=!1,rules:t}){if(!e)return;const r=await jo(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await Gd(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await Gd(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function Gd(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function VT(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Rf(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const Wd="sesamy-refresh",Vd="force-refetch-entitlements";function ZT(){const e=new URLSearchParams(window.location.search),t=e.get(Vd),r=e.get(Wd);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(Vd),e.delete(Wd),n.search=e.toString(),Oe(),window.history.replaceState(null,"",n)}}function JT(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;HT({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const Zd="sesamy-user";async function YT(){const t=new URLSearchParams(window.location.search).get(Zd);if(!t)return;const r=await fE();(r==null?void 0:r.email)!==t&&(Oe(),Lo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(Zd),window.history.replaceState(null,"",n)}const Jd="sesamy-purchase";function XT(){const e=new URLSearchParams(window.location.search),t=e.get(Jd);if(t!==null){const r=new URL(window.location.href);e.delete(Jd),r.search=e.toString(),We(Pe.PURCHASE,{itemSrc:t}),Oe(),window.history.replaceState(null,"",r)}}const Yd="sesamy-login";async function qT(){if(!new URLSearchParams(window.location.search).get(Yd))return;await jo()||Lo();const n=new URL(window.location.href);n.searchParams.delete(Yd),window.history.replaceState(null,"",n)}const QT=typeof window<"u";async function Xd(e){DT({clientId:e.clientId,environment:e.environment,...e.analytics}),await lE({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await WT(e.transform),VT(),ZT(),JT(),await qT(),await YT(),XT(),We(Pe.READY,{})}async function qd(e){const t=KT({clientId:e.clientId,environment:e.environment,...e.api});return QT&&(e.awaitAllServices?await Xd(e):Xd(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);qd(t)}catch(t){console.error("Failed to parse config",t)}}return Le.init=qd,Object.defineProperty(Le,Symbol.toStringTag,{value:"Module"}),Le}({});
|