@sesamy/sesamy-js 1.92.0 → 1.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sesamy-js.cjs +6 -6
- package/dist/sesamy-js.iife.js +6 -6
- package/dist/sesamy-js.mjs +536 -524
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Gs={},Nn,Ws;function Ae(){return Ws||(Ws=1,Nn=function(e){try{return!!e()}catch{return!0}}),Nn}var jn,Vs;function dn(){if(Vs)return jn;Vs=1;var e=Ae();return jn=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),jn}var Dn,zs;function pe(){if(zs)return Dn;zs=1;var e=dn(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Dn=e?n:function(a){return function(){return t.apply(a,arguments)}},Dn}var Mn,Ks;function vn(){if(Ks)return Mn;Ks=1;var e=pe(),r=e({}.toString),t=e("".slice);return Mn=function(n){return t(r(n),8,-1)},Mn}var Fn,Js;function Bd(){if(Js)return Fn;Js=1;var e=pe(),r=Ae(),t=vn(),n=Object,a=e("".split);return Fn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,Fn}var Bn,Ys;function hn(){return Ys||(Ys=1,Bn=function(e){return e==null}),Bn}var Hn,Qs;function pn(){if(Qs)return Hn;Qs=1;var e=hn(),r=TypeError;return Hn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Hn}var Gn,Xs;function Ut(){if(Xs)return Gn;Xs=1;var e=Bd(),r=pn();return Gn=function(t){return e(r(t))},Gn}var wt,Zs;function me(){if(Zs)return wt;Zs=1;var e=function(r){return r&&r.Math===Math&&r};return wt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof Hs=="object"&&Hs)||e(typeof wt=="object"&&wt)||(function(){return this})()||Function("return this")(),wt}var Wn={exports:{}},Vn,eu;function sr(){return eu||(eu=1,Vn=!1),Vn}var zn,ru;function is(){if(ru)return zn;ru=1;var e=me(),r=Object.defineProperty;return zn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},zn}var tu;function os(){if(tu)return Wn.exports;tu=1;var e=sr(),r=me(),t=is(),n="__core-js_shared__",a=Wn.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Wn.exports}var Kn,nu;function Hd(){if(nu)return Kn;nu=1;var e=os();return Kn=function(r,t){return e[r]||(e[r]=t||{})},Kn}var Jn,au;function mn(){if(au)return Jn;au=1;var e=pn(),r=Object;return Jn=function(t){return r(e(t))},Jn}var Yn,iu;function ze(){if(iu)return Yn;iu=1;var e=pe(),r=mn(),t=e({}.hasOwnProperty);return Yn=Object.hasOwn||function(a,i){return t(r(a),i)},Yn}var Qn,ou;function Gd(){if(ou)return Qn;ou=1;var e=pe(),r=0,t=Math.random(),n=e(1.1.toString);return Qn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Qn}var Xn,su;function Lt(){if(su)return Xn;su=1;var e=me(),r=e.navigator,t=r&&r.userAgent;return Xn=t?String(t):"",Xn}var Zn,uu;function Wd(){if(uu)return Zn;uu=1;var e=me(),r=Lt(),t=e.process,n=e.Deno,a=t&&t.versions||n&&n.version,i=a&&a.v8,o,s;return i&&(o=i.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),Zn=s,Zn}var ea,cu;function Vd(){if(cu)return ea;cu=1;var e=Wd(),r=Ae(),t=me(),n=t.String;return ea=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),ea}var ra,lu;function zd(){if(lu)return ra;lu=1;var e=Vd();return ra=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ra}var ta,fu;function ke(){if(fu)return ta;fu=1;var e=me(),r=Hd(),t=ze(),n=Gd(),a=Vd(),i=zd(),o=e.Symbol,s=r("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return ta=function(c){return t(s,c)||(s[c]=a&&t(o,c)?o[c]:u("Symbol."+c)),s[c]},ta}var na,du;function we(){if(du)return na;du=1;var e=typeof document=="object"&&document.all;return na=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},na}var aa,vu;function Ke(){if(vu)return aa;vu=1;var e=we();return aa=function(r){return typeof r=="object"?r!==null:e(r)},aa}var ia,hu;function rr(){if(hu)return ia;hu=1;var e=Ke(),r=String,t=TypeError;return ia=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},ia}var oa={},sa,pu;function qe(){if(pu)return sa;pu=1;var e=Ae();return sa=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),sa}var ua,mu;function Kd(){if(mu)return ua;mu=1;var e=qe(),r=Ae();return ua=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ua}var ca={},la,gu;function gn(){if(gu)return la;gu=1;var e=me(),r=Ke(),t=e.document,n=r(t)&&r(t.createElement);return la=function(a){return n?t.createElement(a):{}},la}var fa,yu;function Jd(){if(yu)return fa;yu=1;var e=qe(),r=Ae(),t=gn();return fa=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),fa}var da,bu;function Le(){if(bu)return da;bu=1;var e=dn(),r=Function.prototype.call;return da=e?r.bind(r):function(){return r.apply(r,arguments)},da}var va,wu;function Je(){if(wu)return va;wu=1;var e=me(),r=we(),t=function(n){return r(n)?n:void 0};return va=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},va}var ha,Su;function yn(){if(Su)return ha;Su=1;var e=pe();return ha=e({}.isPrototypeOf),ha}var pa,Iu;function Yd(){if(Iu)return pa;Iu=1;var e=Je(),r=we(),t=yn(),n=zd(),a=Object;return pa=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},pa}var ma,Pu;function bn(){if(Pu)return ma;Pu=1;var e=String;return ma=function(r){try{return e(r)}catch{return"Object"}},ma}var ga,Eu;function tr(){if(Eu)return ga;Eu=1;var e=we(),r=bn(),t=TypeError;return ga=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},ga}var ya,Ru;function ss(){if(Ru)return ya;Ru=1;var e=tr(),r=hn();return ya=function(t,n){var a=t[n];return r(a)?void 0:e(a)},ya}var ba,Tu;function Bh(){if(Tu)return ba;Tu=1;var e=Le(),r=we(),t=Ke(),n=TypeError;return ba=function(a,i){var o,s;if(i==="string"&&r(o=a.toString)&&!t(s=e(o,a))||r(o=a.valueOf)&&!t(s=e(o,a))||i!=="string"&&r(o=a.toString)&&!t(s=e(o,a)))return s;throw new n("Can't convert object to primitive value")},ba}var wa,Ou;function Hh(){if(Ou)return wa;Ou=1;var e=Le(),r=Ke(),t=Yd(),n=ss(),a=Bh(),i=ke(),o=TypeError,s=i("toPrimitive");return wa=function(u,c){if(!r(u)||t(u))return u;var l=n(u,s),f;if(l){if(c===void 0&&(c="default"),f=e(l,u,c),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return c===void 0&&(c="number"),a(u,c)},wa}var Sa,Cu;function Qd(){if(Cu)return Sa;Cu=1;var e=Hh(),r=Yd();return Sa=function(t){var n=e(t,"string");return r(n)?n:n+""},Sa}var _u;function gr(){if(_u)return ca;_u=1;var e=qe(),r=Jd(),t=Kd(),n=rr(),a=Qd(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return ca.f=e?t?function(v,d,h){if(n(v),d=a(d),n(h),typeof v=="function"&&d==="prototype"&&"value"in h&&l in h&&!h[l]){var p=s(v,d);p&&p[l]&&(v[d]=h.value,h={configurable:c in h?h[c]:p[c],enumerable:u in h?h[u]:p[u],writable:!1})}return o(v,d,h)}:o:function(v,d,h){if(n(v),d=a(d),n(h),r)try{return o(v,d,h)}catch{}if("get"in h||"set"in h)throw new i("Accessors not supported");return"value"in h&&(v[d]=h.value),v},ca}var Ia,Au;function Gh(){if(Au)return Ia;Au=1;var e=Math.ceil,r=Math.floor;return Ia=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},Ia}var Pa,ku;function us(){if(ku)return Pa;ku=1;var e=Gh();return Pa=function(r){var t=+r;return t!==t||t===0?0:e(t)},Pa}var Ea,qu;function Xd(){if(qu)return Ea;qu=1;var e=us(),r=Math.max,t=Math.min;return Ea=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},Ea}var Ra,$u;function Wh(){if($u)return Ra;$u=1;var e=us(),r=Math.min;return Ra=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},Ra}var Ta,Uu;function cs(){if(Uu)return Ta;Uu=1;var e=Wh();return Ta=function(r){return e(r.length)},Ta}var Oa,Lu;function Vh(){if(Lu)return Oa;Lu=1;var e=Ut(),r=Xd(),t=cs(),n=function(a){return function(i,o,s){var u=e(i),c=t(u);if(c===0)return!a&&-1;var l=r(s,c),f;if(a&&o!==o){for(;c>l;)if(f=u[l++],f!==f)return!0}else for(;c>l;l++)if((a||l in u)&&u[l]===o)return a||l||0;return!a&&-1}};return Oa={includes:n(!0),indexOf:n(!1)},Oa}var Ca,xu;function ls(){return xu||(xu=1,Ca={}),Ca}var _a,Nu;function Zd(){if(Nu)return _a;Nu=1;var e=pe(),r=ze(),t=Ut(),n=Vh().indexOf,a=ls(),i=e([].push);return _a=function(o,s){var u=t(o),c=0,l=[],f;for(f in u)!r(a,f)&&r(u,f)&&i(l,f);for(;s.length>c;)r(u,f=s[c++])&&(~n(l,f)||i(l,f));return l},_a}var Aa,ju;function fs(){return ju||(ju=1,Aa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Aa}var ka,Du;function ev(){if(Du)return ka;Du=1;var e=Zd(),r=fs();return ka=Object.keys||function(n){return e(n,r)},ka}var Mu;function zh(){if(Mu)return oa;Mu=1;var e=qe(),r=Kd(),t=gr(),n=rr(),a=Ut(),i=ev();return oa.f=e&&!r?Object.defineProperties:function(s,u){n(s);for(var c=a(u),l=i(u),f=l.length,v=0,d;f>v;)t.f(s,d=l[v++],c[d]);return s},oa}var qa,Fu;function rv(){if(Fu)return qa;Fu=1;var e=Je();return qa=e("document","documentElement"),qa}var $a,Bu;function ds(){if(Bu)return $a;Bu=1;var e=Hd(),r=Gd(),t=e("keys");return $a=function(n){return t[n]||(t[n]=r(n))},$a}var Ua,Hu;function xt(){if(Hu)return Ua;Hu=1;var e=rr(),r=zh(),t=fs(),n=ls(),a=rv(),i=gn(),o=ds(),s=">",u="<",c="prototype",l="script",f=o("IE_PROTO"),v=function(){},d=function(I){return u+l+s+I+u+"/"+l+s},h=function(I){I.write(d("")),I.close();var g=I.parentWindow.Object;return I=null,g},p=function(){var I=i("iframe"),g="java"+l+":",b;return I.style.display="none",a.appendChild(I),I.src=String(g),b=I.contentWindow.document,b.open(),b.write(d("document.F=Object")),b.close(),b.F},S,R=function(){try{S=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&S?h(S):p():h(S);for(var I=t.length;I--;)delete R[c][t[I]];return R()};return n[f]=!0,Ua=Object.create||function(g,b){var y;return g!==null?(v[c]=e(g),y=new v,v[c]=null,y[f]=g):y=R(),b===void 0?y:r.f(y,b)},Ua}var La,Gu;function Kh(){if(Gu)return La;Gu=1;var e=ke(),r=xt(),t=gr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),La=function(i){a[n][i]=!0},La}var xa,Wu;function Nt(){return Wu||(Wu=1,xa={}),xa}var Na,Vu;function Jh(){if(Vu)return Na;Vu=1;var e=me(),r=we(),t=e.WeakMap;return Na=r(t)&&/native code/.test(String(t)),Na}var ja,zu;function Gr(){return zu||(zu=1,ja=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),ja}var Da,Ku;function Wr(){if(Ku)return Da;Ku=1;var e=qe(),r=gr(),t=Gr();return Da=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Da}var Ma,Ju;function ft(){if(Ju)return Ma;Ju=1;var e=Jh(),r=me(),t=Ke(),n=Wr(),a=ze(),i=os(),o=ds(),s=ls(),u="Object already initialized",c=r.TypeError,l=r.WeakMap,f,v,d,h=function(I){return d(I)?v(I):f(I,{})},p=function(I){return function(g){var b;if(!t(g)||(b=v(g)).type!==I)throw new c("Incompatible receiver, "+I+" required");return b}};if(e||i.state){var S=i.state||(i.state=new l);S.get=S.get,S.has=S.has,S.set=S.set,f=function(I,g){if(S.has(I))throw new c(u);return g.facade=I,S.set(I,g),g},v=function(I){return S.get(I)||{}},d=function(I){return S.has(I)}}else{var R=o("state");s[R]=!0,f=function(I,g){if(a(I,R))throw new c(u);return g.facade=I,n(I,R,g),g},v=function(I){return a(I,R)?I[R]:{}},d=function(I){return a(I,R)}}return Ma={set:f,get:v,has:d,enforce:h,getterFor:p},Ma}var Fa={},Ba={},Yu;function tv(){if(Yu)return Ba;Yu=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Ba.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,Ba}var Qu;function nv(){if(Qu)return Fa;Qu=1;var e=qe(),r=Le(),t=tv(),n=Gr(),a=Ut(),i=Qd(),o=ze(),s=Jd(),u=Object.getOwnPropertyDescriptor;return Fa.f=e?u:function(l,f){if(l=a(l),f=i(f),s)try{return u(l,f)}catch{}if(o(l,f))return n(!r(t.f,l,f),l[f])},Fa}var Ha={exports:{}},Ga,Xu;function av(){if(Xu)return Ga;Xu=1;var e=qe(),r=ze(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,a=r(t,"name"),i=a&&(function(){}).name==="something",o=a&&(!e||e&&n(t,"name").configurable);return Ga={EXISTS:a,PROPER:i,CONFIGURABLE:o},Ga}var Wa,Zu;function vs(){if(Zu)return Wa;Zu=1;var e=pe(),r=we(),t=os(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),Wa=t.inspectSource,Wa}var ec;function iv(){if(ec)return Ha.exports;ec=1;var e=pe(),r=Ae(),t=we(),n=ze(),a=qe(),i=av().CONFIGURABLE,o=vs(),s=ft(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,v=e("".slice),d=e("".replace),h=e([].join),p=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),R=Ha.exports=function(I,g,b){v(l(g),0,7)==="Symbol("&&(g="["+d(l(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),b&&b.getter&&(g="get "+g),b&&b.setter&&(g="set "+g),(!n(I,"name")||i&&I.name!==g)&&(a?f(I,"name",{value:g,configurable:!0}):I.name=g),p&&b&&n(b,"arity")&&I.length!==b.arity&&f(I,"length",{value:b.arity});try{b&&n(b,"constructor")&&b.constructor?a&&f(I,"prototype",{writable:!1}):I.prototype&&(I.prototype=void 0)}catch{}var y=u(I);return n(y,"source")||(y.source=h(S,typeof g=="string"?g:"")),I};return Function.prototype.toString=R(function(){return t(this)&&c(this).source||o(this)},"toString"),Ha.exports}var Va,rc;function Ye(){if(rc)return Va;rc=1;var e=we(),r=gr(),t=iv(),n=is();return Va=function(a,i,o,s){s||(s={});var u=s.enumerable,c=s.name!==void 0?s.name:i;if(e(o)&&t(o,c,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},Va}var za={},tc;function Yh(){if(tc)return za;tc=1;var e=Zd(),r=fs(),t=r.concat("length","prototype");return za.f=Object.getOwnPropertyNames||function(a){return e(a,t)},za}var Ka={},nc;function ov(){return nc||(nc=1,Ka.f=Object.getOwnPropertySymbols),Ka}var Ja,ac;function Qh(){if(ac)return Ja;ac=1;var e=Je(),r=pe(),t=Yh(),n=ov(),a=rr(),i=r([].concat);return Ja=e("Reflect","ownKeys")||function(s){var u=t.f(a(s)),c=n.f;return c?i(u,c(s)):u},Ja}var Ya,ic;function sv(){if(ic)return Ya;ic=1;var e=ze(),r=Qh(),t=nv(),n=gr();return Ya=function(a,i,o){for(var s=r(i),u=n.f,c=t.f,l=0;l<s.length;l++){var f=s[l];!e(a,f)&&!(o&&e(o,f))&&u(a,f,c(i,f))}},Ya}var Qa,oc;function uv(){if(oc)return Qa;oc=1;var e=Ae(),r=we(),t=/#|\.prototype\./,n=function(u,c){var l=i[a(u)];return l===s?!0:l===o?!1:r(c)?e(c):!!c},a=n.normalize=function(u){return String(u).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return Qa=n,Qa}var Xa,sc;function Pe(){if(sc)return Xa;sc=1;var e=me(),r=nv().f,t=Wr(),n=Ye(),a=is(),i=sv(),o=uv();return Xa=function(s,u){var c=s.target,l=s.global,f=s.stat,v,d,h,p,S,R;if(l?d=e:f?d=e[c]||a(c,{}):d=e[c]&&e[c].prototype,d)for(h in u){if(S=u[h],s.dontCallGetSet?(R=r(d,h),p=R&&R.value):p=d[h],v=o(l?h:c+(f?".":"#")+h,s.forced),!v&&p!==void 0){if(typeof S==typeof p)continue;i(S,p)}(s.sham||p&&p.sham)&&t(S,"sham",!0),n(d,h,S,s)}},Xa}var Za,uc;function Xh(){if(uc)return Za;uc=1;var e=Ae();return Za=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Za}var ei,cc;function hs(){if(cc)return ei;cc=1;var e=ze(),r=we(),t=mn(),n=ds(),a=Xh(),i=n("IE_PROTO"),o=Object,s=o.prototype;return ei=a?o.getPrototypeOf:function(u){var c=t(u);if(e(c,i))return c[i];var l=c.constructor;return r(l)&&c instanceof l?l.prototype:c instanceof o?s:null},ei}var ri,lc;function cv(){if(lc)return ri;lc=1;var e=Ae(),r=we(),t=Ke(),n=xt(),a=hs(),i=Ye(),o=ke(),s=sr(),u=o("iterator"),c=!1,l,f,v;[].keys&&(v=[].keys(),"next"in v?(f=a(a(v)),f!==Object.prototype&&(l=f)):c=!0);var d=!t(l)||e(function(){var h={};return l[u].call(h)!==h});return d?l={}:s&&(l=n(l)),r(l[u])||i(l,u,function(){return this}),ri={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:c},ri}var ti,fc;function dt(){if(fc)return ti;fc=1;var e=gr().f,r=ze(),t=ke(),n=t("toStringTag");return ti=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},ti}var ni,dc;function lv(){if(dc)return ni;dc=1;var e=cv().IteratorPrototype,r=xt(),t=Gr(),n=dt(),a=Nt(),i=function(){return this};return ni=function(o,s,u,c){var l=s+" Iterator";return o.prototype=r(e,{next:t(+!c,u)}),n(o,l,!1,!0),a[l]=i,o},ni}var ai,vc;function Zh(){if(vc)return ai;vc=1;var e=pe(),r=tr();return ai=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},ai}var ii,hc;function ep(){if(hc)return ii;hc=1;var e=Ke();return ii=function(r){return e(r)||r===null},ii}var oi,pc;function rp(){if(pc)return oi;pc=1;var e=ep(),r=String,t=TypeError;return oi=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},oi}var si,mc;function ps(){if(mc)return si;mc=1;var e=Zh(),r=Ke(),t=pn(),n=rp();return si=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=e(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,c){return t(u),n(c),r(u)&&(a?o(u,c):u.__proto__=c),u}})():void 0),si}var ui,gc;function fv(){if(gc)return ui;gc=1;var e=Pe(),r=Le(),t=sr(),n=av(),a=we(),i=lv(),o=hs(),s=ps(),u=dt(),c=Wr(),l=Ye(),f=ke(),v=Nt(),d=cv(),h=n.PROPER,p=n.CONFIGURABLE,S=d.IteratorPrototype,R=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),g="keys",b="values",y="entries",A=function(){return this};return ui=function(q,j,G,K,re,L,M){i(G,j,K);var N=function(J){if(J===re&&w)return w;if(!R&&J&&J in U)return U[J];switch(J){case g:return function(){return new G(this,J)};case b:return function(){return new G(this,J)};case y:return function(){return new G(this,J)}}return function(){return new G(this)}},m=j+" Iterator",C=!1,U=q.prototype,F=U[I]||U["@@iterator"]||re&&U[re],w=!R&&F||N(re),T=j==="Array"&&U.entries||F,x,H,Q;if(T&&(x=o(T.call(new q)),x!==Object.prototype&&x.next&&(!t&&o(x)!==S&&(s?s(x,S):a(x[I])||l(x,I,A)),u(x,m,!0,!0),t&&(v[m]=A))),h&&re===b&&F&&F.name!==b&&(!t&&p?c(U,"name",b):(C=!0,w=function(){return r(F,this)})),re)if(H={values:N(b),keys:L?w:N(g),entries:N(y)},M)for(Q in H)(R||C||!(Q in U))&&l(U,Q,H[Q]);else e({target:j,proto:!0,forced:R||C},H);return(!t||M)&&U[I]!==w&&l(U,I,w,{name:re}),v[j]=w,H},ui}var ci,yc;function ms(){return yc||(yc=1,ci=function(e,r){return{value:e,done:r}}),ci}var li,bc;function gs(){if(bc)return li;bc=1;var e=Ut(),r=Kh(),t=Nt(),n=ft(),a=gr().f,i=fv(),o=ms(),s=sr(),u=qe(),c="Array Iterator",l=n.set,f=n.getterFor(c);li=i(Array,"Array",function(d,h){l(this,{type:c,target:e(d),index:0,kind:h})},function(){var d=f(this),h=d.target,p=d.index++;if(!h||p>=h.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(h[p],!1)}return o([p,h[p]],!1)},"values");var v=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&u&&v.name!=="values")try{a(v,"name",{value:"values"})}catch{}return li}var wc={},Sc;function tp(){if(Sc)return wc;Sc=1;var e=Pe(),r=pe(),t=Xd(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=r([].join),s=!!i&&i.length!==1;return e({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(c){for(var l=[],f=arguments.length,v=0,d;f>v;){if(d=+arguments[v++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");l[v]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(l,"")}}),wc}var fi,Ic;function dv(){if(Ic)return fi;Ic=1;var e=me(),r=qe(),t=Object.getOwnPropertyDescriptor;return fi=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},fi}var di,Pc;function wn(){if(Pc)return di;Pc=1;var e=Ae(),r=ke(),t=qe(),n=sr(),a=r("iterator");return di=!e(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(c,l){o.delete("b"),u+=l+c}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!t)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),di}var vi,Ec;function Sn(){if(Ec)return vi;Ec=1;var e=iv(),r=gr();return vi=function(t,n,a){return a.get&&e(a.get,n,{getter:!0}),a.set&&e(a.set,n,{setter:!0}),r.f(t,n,a)},vi}var hi,Rc;function np(){if(Rc)return hi;Rc=1;var e=Ye();return hi=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},hi}var pi,Tc;function ys(){if(Tc)return pi;Tc=1;var e=yn(),r=TypeError;return pi=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},pi}var mi,Oc;function ap(){if(Oc)return mi;Oc=1;var e=vn(),r=pe();return mi=function(t){if(e(t)==="Function")return r(t)},mi}var gi,Cc;function vt(){if(Cc)return gi;Cc=1;var e=ap(),r=tr(),t=dn(),n=e(e.bind);return gi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},gi}var yi,_c;function bs(){if(_c)return yi;_c=1;var e=ke(),r=e("toStringTag"),t={};return t[r]="z",yi=String(t)==="[object z]",yi}var bi,Ac;function jt(){if(Ac)return bi;Ac=1;var e=bs(),r=we(),t=vn(),n=ke(),a=n("toStringTag"),i=Object,o=t((function(){return arguments})())==="Arguments",s=function(u,c){try{return u[c]}catch{}};return bi=e?t:function(u){var c,l,f;return u===void 0?"Undefined":u===null?"Null":typeof(l=s(c=i(u),a))=="string"?l:o?t(c):(f=t(c))==="Object"&&r(c.callee)?"Arguments":f},bi}var wi,kc;function yr(){if(kc)return wi;kc=1;var e=jt(),r=String;return wi=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},wi}var Si,qc;function In(){if(qc)return Si;qc=1;var e=jt(),r=ss(),t=hn(),n=Nt(),a=ke(),i=a("iterator");return Si=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},Si}var Ii,$c;function ws(){if($c)return Ii;$c=1;var e=Le(),r=tr(),t=rr(),n=bn(),a=In(),i=TypeError;return Ii=function(o,s){var u=arguments.length<2?a(o):s;if(r(u))return t(e(u,o));throw new i(n(o)+" is not iterable")},Ii}var Pi,Uc;function Vr(){if(Uc)return Pi;Uc=1;var e=TypeError;return Pi=function(r,t){if(r<t)throw new e("Not enough arguments");return r},Pi}var Ei,Lc;function Pn(){if(Lc)return Ei;Lc=1;var e=pe();return Ei=e([].slice),Ei}var Ri,xc;function ip(){if(xc)return Ri;xc=1;var e=Pn(),r=Math.floor,t=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var c=r(i/2),l=t(e(n,0,c),a),f=t(e(n,c),a),v=l.length,d=f.length,h=0,p=0;h<v||p<d;)n[h+p]=h<v&&p<d?a(l[h],f[p])<=0?l[h++]:f[p++]:h<v?l[h++]:f[p++];return n};return Ri=t,Ri}var Ti,Nc;function vv(){if(Nc)return Ti;Nc=1,gs(),tp();var e=Pe(),r=me(),t=dv(),n=Je(),a=Le(),i=pe(),o=qe(),s=wn(),u=Ye(),c=Sn(),l=np(),f=dt(),v=lv(),d=ft(),h=ys(),p=we(),S=ze(),R=vt(),I=jt(),g=rr(),b=Ke(),y=yr(),A=xt(),q=Gr(),j=ws(),G=In(),K=ms(),re=Vr(),L=ke(),M=ip(),N=L("iterator"),m="URLSearchParams",C=m+"Iterator",U=d.set,F=d.getterFor(m),w=d.getterFor(C),T=t("fetch"),x=t("Request"),H=t("Headers"),Q=x&&x.prototype,J=H&&H.prototype,le=r.TypeError,ne=r.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),Re=parseInt,xe=i("".charAt),je=i([].join),$e=i([].push),Qe=i("".replace),wr=i([].shift),Sr=i([].splice),_r=i("".split),Ar=i("".slice),yt=i(/./.exec),zr=/\+/g,kr="�",ye=/^[0-9a-f]+$/i,Xe=function(D,V){var z=Ar(D,V,V+2);return yt(ye,z)?Re(z,16):NaN},qr=function(D){for(var V=0,z=128;z>0&&(D&z)!==0;z>>=1)V++;return V},B=function(D){var V=null;switch(D.length){case 1:V=D[0];break;case 2:V=(D[0]&31)<<6|D[1]&63;break;case 3:V=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:V=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return V>1114111?null:V},X=function(D){D=Qe(D,zr," ");for(var V=D.length,z="",Y=0;Y<V;){var ie=xe(D,Y);if(ie==="%"){if(xe(D,Y+1)==="%"||Y+3>V){z+="%",Y++;continue}var se=Xe(D,Y+1);if(se!==se){z+=ie,Y++;continue}Y+=2;var ve=qr(se);if(ve===0)ie=ue(se);else{if(ve===1||ve>4){z+=kr,Y++;continue}for(var he=[se],Se=1;Se<ve&&(Y++,!(Y+3>V||xe(D,Y)!=="%"));){var Ue=Xe(D,Y+1);if(Ue!==Ue){Y+=3;break}if(Ue>191||Ue<128)break;$e(he,Ue),Y+=2,Se++}if(he.length!==ve){z+=kr;continue}var nr=B(he);nr===null?z+=kr:ie=ae(nr)}}z+=ie,Y++}return z},oe=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(D){return ce[D]},He=function(D){return Qe(ne(D),oe,fe)},Te=v(function(V,z){U(this,{type:C,target:F(V).entries,index:0,kind:z})},m,function(){var V=w(this),z=V.target,Y=V.index++;if(!z||Y>=z.length)return V.target=null,K(void 0,!0);var ie=z[Y];switch(V.kind){case"keys":return K(ie.key,!1);case"values":return K(ie.value,!1)}return K([ie.key,ie.value],!1)},!0),De=function(D){this.entries=[],this.url=null,D!==void 0&&(b(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?xe(D,0)==="?"?Ar(D,1):D:y(D)))};De.prototype={type:m,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var V=this.entries,z=G(D),Y,ie,se,ve,he,Se,Ue;if(z)for(Y=j(D,z),ie=Y.next;!(se=a(ie,Y)).done;){if(ve=j(g(se.value)),he=ve.next,(Se=a(he,ve)).done||(Ue=a(he,ve)).done||!a(he,ve).done)throw new le("Expected sequence with length 2");$e(V,{key:y(Se.value),value:y(Ue.value)})}else for(var nr in D)S(D,nr)&&$e(V,{key:nr,value:y(D[nr])})},parseQuery:function(D){if(D)for(var V=this.entries,z=_r(D,"&"),Y=0,ie,se;Y<z.length;)ie=z[Y++],ie.length&&(se=_r(ie,"="),$e(V,{key:X(wr(se)),value:X(je(se,"="))}))},serialize:function(){for(var D=this.entries,V=[],z=0,Y;z<D.length;)Y=D[z++],$e(V,He(Y.key)+"="+He(Y.value));return je(V,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Oe=function(){h(this,Ge);var V=arguments.length>0?arguments[0]:void 0,z=U(this,new De(V));o||(this.size=z.entries.length)},Ge=Oe.prototype;if(l(Ge,{append:function(V,z){var Y=F(this);re(arguments.length,2),$e(Y.entries,{key:y(V),value:y(z)}),o||this.length++,Y.updateURL()},delete:function(D){for(var V=F(this),z=re(arguments.length,1),Y=V.entries,ie=y(D),se=z<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<Y.length;){var Se=Y[he];if(Se.key===ie&&(ve===void 0||Se.value===ve)){if(Sr(Y,he,1),ve!==void 0)break}else he++}o||(this.size=Y.length),V.updateURL()},get:function(V){var z=F(this).entries;re(arguments.length,1);for(var Y=y(V),ie=0;ie<z.length;ie++)if(z[ie].key===Y)return z[ie].value;return null},getAll:function(V){var z=F(this).entries;re(arguments.length,1);for(var Y=y(V),ie=[],se=0;se<z.length;se++)z[se].key===Y&&$e(ie,z[se].value);return ie},has:function(V){for(var z=F(this).entries,Y=re(arguments.length,1),ie=y(V),se=Y<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<z.length;){var Se=z[he++];if(Se.key===ie&&(ve===void 0||Se.value===ve))return!0}return!1},set:function(V,z){var Y=F(this);re(arguments.length,1);for(var ie=Y.entries,se=!1,ve=y(V),he=y(z),Se=0,Ue;Se<ie.length;Se++)Ue=ie[Se],Ue.key===ve&&(se?Sr(ie,Se--,1):(se=!0,Ue.value=he));se||$e(ie,{key:ve,value:he}),o||(this.size=ie.length),Y.updateURL()},sort:function(){var V=F(this);M(V.entries,function(z,Y){return z.key>Y.key?1:-1}),V.updateURL()},forEach:function(V){for(var z=F(this).entries,Y=R(V,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<z.length;)se=z[ie++],Y(se.value,se.key,this)},keys:function(){return new Te(this,"keys")},values:function(){return new Te(this,"values")},entries:function(){return new Te(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&c(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(Oe,m),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:Oe}),!s&&p(H)){var Kr=i(J.has),bt=i(J.set),Jr=function(D){if(b(D)){var V=D.body,z;if(I(V)===m)return z=D.headers?new H(D.headers):new H,Kr(z,"content-type")||bt(z,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(D,{body:q(0,y(V)),headers:q(0,z)})}return D};if(p(T)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(V){return T(V,arguments.length>1?Jr(arguments[1]):{})}}),p(x)){var Yr=function(V){return h(this,Q),new x(V,arguments.length>1?Jr(arguments[1]):{})};Q.constructor=Yr,Yr.prototype=Q,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Yr})}}return Ti={URLSearchParams:Oe,getState:F},Ti}var jc;function op(){return jc||(jc=1,vv()),Gs}var Dc={},Mc;function sp(){if(Mc)return Dc;Mc=1;var e=Ye(),r=pe(),t=yr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),u=r(i.forEach),c=r([].push),l=new a("a=1&a=2&b=3");return l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(i,"delete",function(f){var v=arguments.length,d=v<2?void 0:arguments[1];if(v&&d===void 0)return s(this,f);var h=[];u(this,function(A,q){c(h,{key:q,value:A})}),n(v,1);for(var p=t(f),S=t(d),R=0,I=0,g=!1,b=h.length,y;R<b;)y=h[R++],g||y.key===p?(g=!0,s(this,y.key)):I++;for(;I<b;)y=h[I++],y.key===p&&y.value===S||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),Dc}var Fc={},Bc;function up(){if(Bc)return Fc;Bc=1;var e=Ye(),r=pe(),t=yr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&e(i,"has",function(l){var f=arguments.length,v=f<2?void 0:arguments[1];if(f&&v===void 0)return s(this,l);var d=o(this,l);n(f,1);for(var h=t(v),p=0;p<d.length;)if(d[p++]===h)return!0;return!1},{enumerable:!0,unsafe:!0}),Fc}var Hc={},Gc;function cp(){if(Gc)return Hc;Gc=1;var e=qe(),r=pe(),t=Sn(),n=URLSearchParams.prototype,a=r(n.forEach);return e&&!("size"in n)&&t(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),Hc}var Oi,Wc;function En(){if(Wc)return Oi;Wc=1;var e=me();return Oi=e,Oi}var Ci,Vc;function hv(){if(Vc)return Ci;Vc=1,op(),sp(),up(),cp();var e=En();return Ci=e.URLSearchParams,Ci}var zc={},Kc={},Jc={},_i,Yc;function pv(){if(Yc)return _i;Yc=1;var e=pe(),r=us(),t=yr(),n=pn(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(u){return function(c,l){var f=t(n(c)),v=r(l),d=f.length,h,p;return v<0||v>=d?u?"":void 0:(h=i(f,v),h<55296||h>56319||v+1===d||(p=i(f,v+1))<56320||p>57343?u?a(f,v):h:u?o(f,v,v+2):(h-55296<<10)+(p-56320)+65536)}};return _i={codeAt:s(!1),charAt:s(!0)},_i}var Qc;function mv(){if(Qc)return Jc;Qc=1;var e=pv().charAt,r=yr(),t=ft(),n=fv(),a=ms(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:r(u),index:0})},function(){var c=s(this),l=c.string,f=c.index,v;return f>=l.length?a(void 0,!0):(v=e(l,f),c.index+=v.length,a(v,!1))}),Jc}var Ai,Xc;function lp(){if(Xc)return Ai;Xc=1;var e=qe(),r=pe(),t=Le(),n=Ae(),a=ev(),i=ov(),o=tv(),s=mn(),u=Bd(),c=Object.assign,l=Object.defineProperty,f=r([].concat);return Ai=!c||n(function(){if(e&&c({b:1},c(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},d={},h=Symbol("assign detection"),p="abcdefghijklmnopqrst";return v[h]=7,p.split("").forEach(function(S){d[S]=S}),c({},v)[h]!==7||a(c({},d)).join("")!==p})?function(d,h){for(var p=s(d),S=arguments.length,R=1,I=i.f,g=o.f;S>R;)for(var b=u(arguments[R++]),y=I?f(a(b),I(b)):a(b),A=y.length,q=0,j;A>q;)j=y[q++],(!e||t(g,b,j))&&(p[j]=b[j]);return p}:c,Ai}var ki,Zc;function gv(){if(Zc)return ki;Zc=1;var e=Le(),r=rr(),t=ss();return ki=function(n,a,i){var o,s;r(n);try{if(o=t(n,"return"),!o){if(a==="throw")throw i;return i}o=e(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return r(o),i},ki}var qi,el;function fp(){if(el)return qi;el=1;var e=rr(),r=gv();return qi=function(t,n,a,i){try{return i?n(e(a)[0],a[1]):n(a)}catch(o){r(t,"throw",o)}},qi}var $i,rl;function yv(){if(rl)return $i;rl=1;var e=ke(),r=Nt(),t=e("iterator"),n=Array.prototype;return $i=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},$i}var Ui,tl;function bv(){if(tl)return Ui;tl=1;var e=pe(),r=Ae(),t=we(),n=jt(),a=Je(),i=vs(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=e(u.exec),l=!u.test(o),f=function(h){if(!t(h))return!1;try{return s(o,[],h),!0}catch{return!1}},v=function(h){if(!t(h))return!1;switch(n(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,i(h))}catch{return!0}};return v.sham=!0,Ui=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?v:f,Ui}var Li,nl;function dp(){if(nl)return Li;nl=1;var e=qe(),r=gr(),t=Gr();return Li=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},Li}var xi,al;function vp(){if(al)return xi;al=1;var e=vt(),r=Le(),t=mn(),n=fp(),a=yv(),i=bv(),o=cs(),s=dp(),u=ws(),c=In(),l=Array;return xi=function(v){var d=t(v),h=i(this),p=arguments.length,S=p>1?arguments[1]:void 0,R=S!==void 0;R&&(S=e(S,p>2?arguments[2]:void 0));var I=c(d),g=0,b,y,A,q,j,G;if(I&&!(this===l&&a(I)))for(y=h?new this:[],q=u(d,I),j=q.next;!(A=r(j,q)).done;g++)G=R?n(q,S,[A.value,g],!0):A.value,s(y,g,G);else for(b=o(d),y=h?new this(b):l(b);b>g;g++)G=R?S(d[g],g):d[g],s(y,g,G);return y.length=g,y},xi}var Ni,il;function hp(){if(il)return Ni;il=1;var e=pe(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",d=t-n,h=RangeError,p=e(f.exec),S=Math.floor,R=String.fromCharCode,I=e("".charCodeAt),g=e([].join),b=e([].push),y=e("".replace),A=e("".split),q=e("".toLowerCase),j=function(L){for(var M=[],N=0,m=L.length;N<m;){var C=I(L,N++);if(C>=55296&&C<=56319&&N<m){var U=I(L,N++);(U&64512)===56320?b(M,((C&1023)<<10)+(U&1023)+65536):(b(M,C),N--)}else b(M,C)}return M},G=function(L){return L+22+75*(L<26)},K=function(L,M,N){var m=0;for(L=N?S(L/o):L>>1,L+=S(L/M);L>d*a>>1;)L=S(L/d),m+=t;return S(m+(d+1)*L/(L+i))},re=function(L){var M=[];L=j(L);var N=L.length,m=u,C=0,U=s,F,w;for(F=0;F<L.length;F++)w=L[F],w<128&&b(M,R(w));var T=M.length,x=T;for(T&&b(M,c);x<N;){var H=r;for(F=0;F<L.length;F++)w=L[F],w>=m&&w<H&&(H=w);var Q=x+1;if(H-m>S((r-C)/Q))throw new h(v);for(C+=(H-m)*Q,m=H,F=0;F<L.length;F++){if(w=L[F],w<m&&++C>r)throw new h(v);if(w===m){for(var J=C,le=t;;){var ne=le<=U?n:le>=U+a?a:le-U;if(J<ne)break;var ue=J-ne,ae=t-ne;b(M,R(G(ne+ue%ae))),J=S(ue/ae),le+=t}b(M,R(G(J))),U=K(C,Q,x===T),C=0,x++}}C++,m++}return g(M,"")};return Ni=function(L){var M=[],N=A(y(q(L),f,"."),"."),m,C;for(m=0;m<N.length;m++)C=N[m],b(M,p(l,C)?"xn--"+re(C):C);return g(M,".")},Ni}var ol;function pp(){if(ol)return Kc;ol=1,mv();var e=Pe(),r=qe(),t=wn(),n=me(),a=vt(),i=pe(),o=Ye(),s=Sn(),u=ys(),c=ze(),l=lp(),f=vp(),v=Pn(),d=pv().codeAt,h=hp(),p=yr(),S=dt(),R=Vr(),I=vv(),g=ft(),b=g.set,y=g.getterFor("URL"),A=I.URLSearchParams,q=I.getState,j=n.URL,G=n.TypeError,K=n.parseInt,re=Math.floor,L=Math.pow,M=i("".charAt),N=i(/./.exec),m=i([].join),C=i(1.1.toString),U=i([].pop),F=i([].push),w=i("".replace),T=i([].shift),x=i("".split),H=i("".slice),Q=i("".toLowerCase),J=i([].unshift),le="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",Re=/[a-z]/i,xe=/[\d+-.a-z]/i,je=/\d/,$e=/^0x/i,Qe=/^[0-7]+$/,wr=/^\d+$/,Sr=/^[\da-f]+$/i,_r=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ar=/[\0\t\n\r #/:<>?@[\\\]^|]/,yt=/^[\u0000-\u0020]+/,zr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,kr=/[\t\n\r]/g,ye,Xe=function(E){var $=x(E,"."),O,P,_,te,W,be,Ie;if($.length&&$[$.length-1]===""&&$.length--,O=$.length,O>4)return E;for(P=[],_=0;_<O;_++){if(te=$[_],te==="")return E;if(W=10,te.length>1&&M(te,0)==="0"&&(W=N($e,te)?16:8,te=H(te,W===8?1:2)),te==="")be=0;else{if(!N(W===10?wr:W===8?Qe:Sr,te))return E;be=K(te,W)}F(P,be)}for(_=0;_<O;_++)if(be=P[_],_===O-1){if(be>=L(256,5-O))return null}else if(be>255)return null;for(Ie=U(P),_=0;_<P.length;_++)Ie+=P[_]*L(256,3-_);return Ie},qr=function(E){var $=[0,0,0,0,0,0,0,0],O=0,P=null,_=0,te,W,be,Ie,Ce,Ve,k,Ee=function(){return M(E,_)};if(Ee()===":"){if(M(E,1)!==":")return;_+=2,O++,P=O}for(;Ee();){if(O===8)return;if(Ee()===":"){if(P!==null)return;_++,O++,P=O;continue}for(te=W=0;W<4&&N(Sr,Ee());)te=te*16+K(Ee(),16),_++,W++;if(Ee()==="."){if(W===0||(_-=W,O>6))return;for(be=0;Ee();){if(Ie=null,be>0)if(Ee()==="."&&be<4)_++;else return;if(!N(je,Ee()))return;for(;N(je,Ee());){if(Ce=K(Ee(),10),Ie===null)Ie=Ce;else{if(Ie===0)return;Ie=Ie*10+Ce}if(Ie>255)return;_++}$[O]=$[O]*256+Ie,be++,(be===2||be===4)&&O++}if(be!==4)return;break}else if(Ee()===":"){if(_++,!Ee())return}else if(Ee())return;$[O++]=te}if(P!==null)for(Ve=O-P,O=7;O!==0&&Ve>0;)k=$[O],$[O--]=$[P+Ve-1],$[P+--Ve]=k;else if(O!==8)return;return $},B=function(E){for(var $=null,O=1,P=null,_=0,te=0;te<8;te++)E[te]!==0?(_>O&&($=P,O=_),P=null,_=0):(P===null&&(P=te),++_);return _>O?P:$},X=function(E){var $,O,P,_;if(typeof E=="number"){for($=[],O=0;O<4;O++)J($,E%256),E=re(E/256);return m($,".")}if(typeof E=="object"){for($="",P=B(E),O=0;O<8;O++)_&&E[O]===0||(_&&(_=!1),P===O?($+=O?":":"::",_=!0):($+=C(E[O],16),O<7&&($+=":")));return"["+$+"]"}return E},oe={},ce=l({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=l({},ce,{"#":1,"?":1,"{":1,"}":1}),He=l({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(E,$){var O=d(E,0);return O>32&&O<127&&!c($,E)?E:encodeURIComponent(E)},De={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Oe=function(E,$){var O;return E.length===2&&N(Re,M(E,0))&&((O=M(E,1))===":"||!$&&O==="|")},Ge=function(E){var $;return E.length>1&&Oe(H(E,0,2))&&(E.length===2||($=M(E,2))==="/"||$==="\\"||$==="?"||$==="#")},Kr=function(E){return E==="."||Q(E)==="%2e"},bt=function(E){return E=Q(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},Jr={},Yr={},D={},V={},z={},Y={},ie={},se={},ve={},he={},Se={},Ue={},nr={},qn={},Ns={},$n={},Qr={},ar={},js={},$r={},ur={},Un=function(E,$,O){var P=p(E),_,te,W;if($){if(te=this.parse(P),te)throw new G(te);this.searchParams=null}else{if(O!==void 0&&(_=new Un(O,!0)),te=this.parse(P,null,_),te)throw new G(te);W=q(new A),W.bindURL(this),this.searchParams=W}};Un.prototype={type:"URL",parse:function(E,$,O){var P=this,_=$||Jr,te=0,W="",be=!1,Ie=!1,Ce=!1,Ve,k,Ee,cr;for(E=p(E),$||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=w(E,yt,""),E=w(E,zr,"$1")),E=w(E,kr,""),Ve=f(E);te<=Ve.length;){switch(k=Ve[te],_){case Jr:if(k&&N(Re,k))W+=Q(k),_=Yr;else{if($)return ne;_=D;continue}break;case Yr:if(k&&(N(xe,k)||k==="+"||k==="-"||k==="."))W+=Q(k);else if(k===":"){if($&&(P.isSpecial()!==c(De,W)||W==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=W,$){P.isSpecial()&&De[P.scheme]===P.port&&(P.port=null);return}W="",P.scheme==="file"?_=qn:P.isSpecial()&&O&&O.scheme===P.scheme?_=V:P.isSpecial()?_=se:Ve[te+1]==="/"?(_=z,te++):(P.cannotBeABaseURL=!0,F(P.path,""),_=js)}else{if($)return ne;W="",_=D,te=0;continue}break;case D:if(!O||O.cannotBeABaseURL&&k!=="#")return ne;if(O.cannotBeABaseURL&&k==="#"){P.scheme=O.scheme,P.path=v(O.path),P.query=O.query,P.fragment="",P.cannotBeABaseURL=!0,_=ur;break}_=O.scheme==="file"?qn:Y;continue;case V:if(k==="/"&&Ve[te+1]==="/")_=ve,te++;else{_=Y;continue}break;case z:if(k==="/"){_=he;break}else{_=ar;continue}case Y:if(P.scheme=O.scheme,k===ye)P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query;else if(k==="/"||k==="\\"&&P.isSpecial())_=ie;else if(k==="?")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query="",_=$r;else if(k==="#")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query,P.fragment="",_=ur;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.path.length--,_=ar;continue}break;case ie:if(P.isSpecial()&&(k==="/"||k==="\\"))_=ve;else if(k==="/")_=he;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,_=ar;continue}break;case se:if(_=ve,k!=="/"||M(W,te+1)!=="/")continue;te++;break;case ve:if(k!=="/"&&k!=="\\"){_=he;continue}break;case he:if(k==="@"){be&&(W="%40"+W),be=!0,Ee=f(W);for(var Ln=0;Ln<Ee.length;Ln++){var Fs=Ee[Ln];if(Fs===":"&&!Ce){Ce=!0;continue}var Bs=Te(Fs,He);Ce?P.password+=Bs:P.username+=Bs}W=""}else if(k===ye||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()){if(be&&W==="")return le;te-=f(W).length+1,W="",_=Se}else W+=k;break;case Se:case Ue:if($&&P.scheme==="file"){_=$n;continue}else if(k===":"&&!Ie){if(W==="")return ue;if(cr=P.parseHost(W),cr)return cr;if(W="",_=nr,$===Ue)return}else if(k===ye||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()){if(P.isSpecial()&&W==="")return ue;if($&&W===""&&(P.includesCredentials()||P.port!==null))return;if(cr=P.parseHost(W),cr)return cr;if(W="",_=Qr,$)return;continue}else k==="["?Ie=!0:k==="]"&&(Ie=!1),W+=k;break;case nr:if(N(je,k))W+=k;else if(k===ye||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()||$){if(W!==""){var xn=K(W,10);if(xn>65535)return ae;P.port=P.isSpecial()&&xn===De[P.scheme]?null:xn,W=""}if($)return;_=Qr;continue}else return ae;break;case qn:if(P.scheme="file",k==="/"||k==="\\")_=Ns;else if(O&&O.scheme==="file")switch(k){case ye:P.host=O.host,P.path=v(O.path),P.query=O.query;break;case"?":P.host=O.host,P.path=v(O.path),P.query="",_=$r;break;case"#":P.host=O.host,P.path=v(O.path),P.query=O.query,P.fragment="",_=ur;break;default:Ge(m(v(Ve,te),""))||(P.host=O.host,P.path=v(O.path),P.shortenPath()),_=ar;continue}else{_=ar;continue}break;case Ns:if(k==="/"||k==="\\"){_=$n;break}O&&O.scheme==="file"&&!Ge(m(v(Ve,te),""))&&(Oe(O.path[0],!0)?F(P.path,O.path[0]):P.host=O.host),_=ar;continue;case $n:if(k===ye||k==="/"||k==="\\"||k==="?"||k==="#"){if(!$&&Oe(W))_=ar;else if(W===""){if(P.host="",$)return;_=Qr}else{if(cr=P.parseHost(W),cr)return cr;if(P.host==="localhost"&&(P.host=""),$)return;W="",_=Qr}continue}else W+=k;break;case Qr:if(P.isSpecial()){if(_=ar,k!=="/"&&k!=="\\")continue}else if(!$&&k==="?")P.query="",_=$r;else if(!$&&k==="#")P.fragment="",_=ur;else if(k!==ye&&(_=ar,k!=="/"))continue;break;case ar:if(k===ye||k==="/"||k==="\\"&&P.isSpecial()||!$&&(k==="?"||k==="#")){if(bt(W)?(P.shortenPath(),k!=="/"&&!(k==="\\"&&P.isSpecial())&&F(P.path,"")):Kr(W)?k!=="/"&&!(k==="\\"&&P.isSpecial())&&F(P.path,""):(P.scheme==="file"&&!P.path.length&&Oe(W)&&(P.host&&(P.host=""),W=M(W,0)+":"),F(P.path,W)),W="",P.scheme==="file"&&(k===ye||k==="?"||k==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);k==="?"?(P.query="",_=$r):k==="#"&&(P.fragment="",_=ur)}else W+=Te(k,fe);break;case js:k==="?"?(P.query="",_=$r):k==="#"?(P.fragment="",_=ur):k!==ye&&(P.path[0]+=Te(k,oe));break;case $r:!$&&k==="#"?(P.fragment="",_=ur):k!==ye&&(k==="'"&&P.isSpecial()?P.query+="%27":k==="#"?P.query+="%23":P.query+=Te(k,oe));break;case ur:k!==ye&&(P.fragment+=Te(k,ce));break}te++}},parseHost:function(E){var $,O,P;if(M(E,0)==="["){if(M(E,E.length-1)!=="]"||($=qr(H(E,1,-1)),!$))return ue;this.host=$}else if(this.isSpecial()){if(E=h(E),N(_r,E)||($=Xe(E),$===null))return ue;this.host=$}else{if(N(Ar,E))return ue;for($="",O=f(E),P=0;P<O.length;P++)$+=Te(O[P],oe);this.host=$}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return c(De,this.scheme)},shortenPath:function(){var E=this.path,$=E.length;$&&(this.scheme!=="file"||$!==1||!Oe(E[0],!0))&&E.length--},serialize:function(){var E=this,$=E.scheme,O=E.username,P=E.password,_=E.host,te=E.port,W=E.path,be=E.query,Ie=E.fragment,Ce=$+":";return _!==null?(Ce+="//",E.includesCredentials()&&(Ce+=O+(P?":"+P:"")+"@"),Ce+=X(_),te!==null&&(Ce+=":"+te)):$==="file"&&(Ce+="//"),Ce+=E.cannotBeABaseURL?W[0]:W.length?"/"+m(W,"/"):"",be!==null&&(Ce+="?"+be),Ie!==null&&(Ce+="#"+Ie),Ce},setHref:function(E){var $=this.parse(E);if($)throw new G($);this.searchParams.update()},getOrigin:function(){var E=this.scheme,$=this.port;if(E==="blob")try{return new Xr(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+X(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",Jr)},getUsername:function(){return this.username},setUsername:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var O=0;O<$.length;O++)this.username+=Te($[O],He)}},getPassword:function(){return this.password},setPassword:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var O=0;O<$.length;O++)this.password+=Te($[O],He)}},getHost:function(){var E=this.host,$=this.port;return E===null?"":$===null?X(E):X(E)+":"+$},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Se)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Ue)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,nr))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+m(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,Qr))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(M(E,0)==="?"&&(E=H(E,1)),this.query="",this.parse(E,$r)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}M(E,0)==="#"&&(E=H(E,1)),this.fragment="",this.parse(E,ur)},update:function(){this.query=this.searchParams.serialize()||null}};var Xr=function($){var O=u(this,Ne),P=R(arguments.length,1)>1?arguments[1]:void 0,_=b(O,new Un($,!1,P));r||(O.href=_.serialize(),O.origin=_.getOrigin(),O.protocol=_.getProtocol(),O.username=_.getUsername(),O.password=_.getPassword(),O.host=_.getHost(),O.hostname=_.getHostname(),O.port=_.getPort(),O.pathname=_.getPathname(),O.search=_.getSearch(),O.searchParams=_.getSearchParams(),O.hash=_.getHash())},Ne=Xr.prototype,We=function(E,$){return{get:function(){return y(this)[E]()},set:$&&function(O){return y(this)[$](O)},configurable:!0,enumerable:!0}};if(r&&(s(Ne,"href",We("serialize","setHref")),s(Ne,"origin",We("getOrigin")),s(Ne,"protocol",We("getProtocol","setProtocol")),s(Ne,"username",We("getUsername","setUsername")),s(Ne,"password",We("getPassword","setPassword")),s(Ne,"host",We("getHost","setHost")),s(Ne,"hostname",We("getHostname","setHostname")),s(Ne,"port",We("getPort","setPort")),s(Ne,"pathname",We("getPathname","setPathname")),s(Ne,"search",We("getSearch","setSearch")),s(Ne,"searchParams",We("getSearchParams")),s(Ne,"hash",We("getHash","setHash"))),o(Ne,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(Ne,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var Ds=j.createObjectURL,Ms=j.revokeObjectURL;Ds&&o(Xr,"createObjectURL",a(Ds,j)),Ms&&o(Xr,"revokeObjectURL",a(Ms,j))}return S(Xr,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:Xr}),Kc}var sl;function mp(){return sl||(sl=1,pp()),zc}var ul={},cl;function gp(){if(cl)return ul;cl=1;var e=Pe(),r=Je(),t=Ae(),n=Vr(),a=yr(),i=wn(),o=r("URL"),s=i&&t(function(){o.canParse()}),u=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||u},{canParse:function(l){var f=n(arguments.length,1),v=a(l),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(v,d)}catch{return!1}}}),ul}var ll={},fl;function yp(){if(fl)return ll;fl=1;var e=Pe(),r=Je(),t=Vr(),n=yr(),a=wn(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=t(arguments.length,1),c=n(s),l=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(c,l)}catch{return null}}}),ll}var dl={},vl;function bp(){if(vl)return dl;vl=1;var e=Pe(),r=Le();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),dl}var ji,hl;function wp(){if(hl)return ji;hl=1,hv(),mp(),gp(),yp(),bp();var e=En();return ji=e.URL,ji}var Di,pl;function Sp(){if(pl)return Di;pl=1;var e=wp();return Di=e,Di}var Mi,ml;function Ip(){if(ml)return Mi;ml=1;var e=Sp();return Mi=e,Mi}Ip();var gl={},Fi,yl;function Pp(){return yl||(yl=1,Fi={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}),Fi}var Bi,bl;function Ep(){if(bl)return Bi;bl=1;var e=gn(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return Bi=t===Object.prototype?void 0:t,Bi}var wl;function wv(){if(wl)return gl;wl=1;var e=me(),r=Pp(),t=Ep(),n=gs(),a=Wr(),i=dt(),o=ke(),s=o("iterator"),u=n.values,c=function(f,v){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,v,!0),r[v]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var l in r)c(e[l]&&e[l].prototype,l);return c(t,"DOMTokenList"),gl}var Hi,Sl;function Rp(){if(Sl)return Hi;Sl=1;var e=hv();return wv(),Hi=e,Hi}var Gi,Il;function Tp(){if(Il)return Gi;Il=1;var e=Rp();return Gi=e,Gi}Tp();var Pl={},El={},Wi,Rl;function Op(){if(Rl)return Wi;Rl=1;var e=Ke(),r=Wr();return Wi=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},Wi}var Vi,Tl;function Cp(){if(Tl)return Vi;Tl=1;var e=pe(),r=Error,t=e("".replace),n=(function(o){return String(new r(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return Vi=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},Vi}var zi,Ol;function _p(){if(Ol)return zi;Ol=1;var e=Ae(),r=Gr();return zi=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),zi}var Ki,Cl;function Ap(){if(Cl)return Ki;Cl=1;var e=Wr(),r=Cp(),t=_p(),n=Error.captureStackTrace;return Ki=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},Ki}var Ji,_l;function Dt(){if(_l)return Ji;_l=1;var e=vt(),r=Le(),t=rr(),n=bn(),a=yv(),i=cs(),o=yn(),s=ws(),u=In(),c=gv(),l=TypeError,f=function(d,h){this.stopped=d,this.result=h},v=f.prototype;return Ji=function(d,h,p){var S=p&&p.that,R=!!(p&&p.AS_ENTRIES),I=!!(p&&p.IS_RECORD),g=!!(p&&p.IS_ITERATOR),b=!!(p&&p.INTERRUPTED),y=e(h,S),A,q,j,G,K,re,L,M=function(m){return A&&c(A,"normal"),new f(!0,m)},N=function(m){return R?(t(m),b?y(m[0],m[1],M):y(m[0],m[1])):b?y(m,M):y(m)};if(I)A=d.iterator;else if(g)A=d;else{if(q=u(d),!q)throw new l(n(d)+" is not iterable");if(a(q)){for(j=0,G=i(d);G>j;j++)if(K=N(d[j]),K&&o(v,K))return K;return new f(!1)}A=s(d,q)}for(re=I?d.next:A.next;!(L=r(re,A)).done;){try{K=N(L.value)}catch(m){c(A,"throw",m)}if(typeof K=="object"&&K&&o(v,K))return K}return new f(!1)},Ji}var Yi,Al;function kp(){if(Al)return Yi;Al=1;var e=yr();return Yi=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},Yi}var kl;function qp(){if(kl)return El;kl=1;var e=Pe(),r=yn(),t=hs(),n=ps(),a=sv(),i=xt(),o=Wr(),s=Gr(),u=Op(),c=Ap(),l=Dt(),f=kp(),v=ke(),d=v("toStringTag"),h=Error,p=[].push,S=function(g,b){var y=r(R,this),A;n?A=n(new h,y?t(this):R):(A=y?this:i(R),o(A,d,"Error")),b!==void 0&&o(A,"message",f(b)),c(A,S,A.stack,1),arguments.length>2&&u(A,arguments[2]);var q=[];return l(g,p,{that:q}),o(A,"errors",q),A};n?n(S,h):a(S,h,{name:!0});var R=S.prototype=i(h.prototype,{constructor:s(1,S),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:S}),El}var ql;function $p(){return ql||(ql=1,qp()),Pl}var $l={},Qi,Ul;function Up(){if(Ul)return Qi;Ul=1;var e=bs(),r=jt();return Qi=e?{}.toString:function(){return"[object "+r(this)+"]"},Qi}var Ll;function Lp(){if(Ll)return $l;Ll=1;var e=bs(),r=Ye(),t=Up();return e||r(Object.prototype,"toString",t,{unsafe:!0}),$l}var xl={},Nl={},Xi,jl;function Sv(){if(jl)return Xi;jl=1;var e=me(),r=Lt(),t=vn(),n=function(a){return r.slice(0,a.length)===a};return Xi=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),Xi}var Zi,Dl;function Ss(){if(Dl)return Zi;Dl=1;var e=Sv();return Zi=e==="NODE",Zi}var eo,Ml;function xp(){if(Ml)return eo;Ml=1;var e=Je(),r=Sn(),t=ke(),n=qe(),a=t("species");return eo=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},eo}var ro,Fl;function Np(){if(Fl)return ro;Fl=1;var e=bv(),r=bn(),t=TypeError;return ro=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},ro}var to,Bl;function Iv(){if(Bl)return to;Bl=1;var e=rr(),r=Np(),t=hn(),n=ke(),a=n("species");return to=function(i,o){var s=e(i).constructor,u;return s===void 0||t(u=e(s)[a])?o:r(u)},to}var no,Hl;function Pv(){if(Hl)return no;Hl=1;var e=dn(),r=Function.prototype,t=r.apply,n=r.call;return no=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),no}var ao,Gl;function Ev(){if(Gl)return ao;Gl=1;var e=Lt();return ao=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),ao}var io,Wl;function Rv(){if(Wl)return io;Wl=1;var e=me(),r=Pv(),t=vt(),n=we(),a=ze(),i=Ae(),o=rv(),s=Pn(),u=gn(),c=Vr(),l=Ev(),f=Ss(),v=e.setImmediate,d=e.clearImmediate,h=e.process,p=e.Dispatch,S=e.Function,R=e.MessageChannel,I=e.String,g=0,b={},y="onreadystatechange",A,q,j,G;i(function(){A=e.location});var K=function(N){if(a(b,N)){var m=b[N];delete b[N],m()}},re=function(N){return function(){K(N)}},L=function(N){K(N.data)},M=function(N){e.postMessage(I(N),A.protocol+"//"+A.host)};return(!v||!d)&&(v=function(m){c(arguments.length,1);var C=n(m)?m:S(m),U=s(arguments,1);return b[++g]=function(){r(C,void 0,U)},q(g),g},d=function(m){delete b[m]},f?q=function(N){h.nextTick(re(N))}:p&&p.now?q=function(N){p.now(re(N))}:R&&!l?(j=new R,G=j.port2,j.port1.onmessage=L,q=t(G.postMessage,G)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&A&&A.protocol!=="file:"&&!i(M)?(q=M,e.addEventListener("message",L,!1)):y in u("script")?q=function(N){o.appendChild(u("script"))[y]=function(){o.removeChild(this),K(N)}}:q=function(N){setTimeout(re(N),0)}),io={set:v,clear:d},io}var oo,Vl;function Tv(){if(Vl)return oo;Vl=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},oo=e,oo}var so,zl;function jp(){if(zl)return so;zl=1;var e=Lt();return so=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",so}var uo,Kl;function Dp(){if(Kl)return uo;Kl=1;var e=Lt();return uo=/web0s(?!.*chrome)/i.test(e),uo}var co,Jl;function Mp(){if(Jl)return co;Jl=1;var e=me(),r=dv(),t=vt(),n=Rv().set,a=Tv(),i=Ev(),o=jp(),s=Dp(),u=Ss(),c=e.MutationObserver||e.WebKitMutationObserver,l=e.document,f=e.process,v=e.Promise,d=r("queueMicrotask"),h,p,S,R,I;if(!d){var g=new a,b=function(){var y,A;for(u&&(y=f.domain)&&y.exit();A=g.get();)try{A()}catch(q){throw g.head&&h(),q}y&&y.enter()};!i&&!u&&!s&&c&&l?(p=!0,S=l.createTextNode(""),new c(b).observe(S,{characterData:!0}),h=function(){S.data=p=!p}):!o&&v&&v.resolve?(R=v.resolve(void 0),R.constructor=v,I=t(R.then,R),h=function(){I(b)}):u?h=function(){f.nextTick(b)}:(n=t(n,e),h=function(){n(b)}),d=function(y){g.head||h(),g.add(y)}}return co=d,co}var lo,Yl;function Fp(){return Yl||(Yl=1,lo=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),lo}var fo,Ql;function ht(){return Ql||(Ql=1,fo=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),fo}var vo,Xl;function pt(){if(Xl)return vo;Xl=1;var e=me();return vo=e.Promise,vo}var ho,Zl;function Mt(){if(Zl)return ho;Zl=1;var e=me(),r=pt(),t=we(),n=uv(),a=vs(),i=ke(),o=Sv(),s=sr(),u=Wd(),c=r&&r.prototype,l=i("species"),f=!1,v=t(e.PromiseRejectionEvent),d=n("Promise",function(){var h=a(r),p=h!==String(r);if(!p&&u===66||s&&!(c.catch&&c.finally))return!0;if(!u||u<51||!/native code/.test(h)){var S=new r(function(g){g(1)}),R=function(g){g(function(){},function(){})},I=S.constructor={};if(I[l]=R,f=S.then(function(){})instanceof R,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!v});return ho={CONSTRUCTOR:d,REJECTION_EVENT:v,SUBCLASSING:f},ho}var po={},ef;function br(){if(ef)return po;ef=1;var e=tr(),r=TypeError,t=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new r("Bad Promise constructor");a=o,i=s}),this.resolve=e(a),this.reject=e(i)};return po.f=function(n){return new t(n)},po}var rf;function Bp(){if(rf)return Nl;rf=1;var e=Pe(),r=sr(),t=Ss(),n=me(),a=En(),i=Le(),o=Ye(),s=ps(),u=dt(),c=xp(),l=tr(),f=we(),v=Ke(),d=ys(),h=Iv(),p=Rv().set,S=Mp(),R=Fp(),I=ht(),g=Tv(),b=ft(),y=pt(),A=Mt(),q=br(),j="Promise",G=A.CONSTRUCTOR,K=A.REJECTION_EVENT,re=A.SUBCLASSING,L=b.getterFor(j),M=b.set,N=y&&y.prototype,m=y,C=N,U=n.TypeError,F=n.document,w=n.process,T=q.f,x=T,H=!!(F&&F.createEvent&&n.dispatchEvent),Q="unhandledrejection",J="rejectionhandled",le=0,ne=1,ue=2,ae=1,Re=2,xe,je,$e,Qe,wr=function(B){var X;return v(B)&&f(X=B.then)?X:!1},Sr=function(B,X){var oe=X.value,ce=X.state===ne,fe=ce?B.ok:B.fail,He=B.resolve,Te=B.reject,De=B.domain,Oe,Ge,Kr;try{fe?(ce||(X.rejection===Re&&kr(X),X.rejection=ae),fe===!0?Oe=oe:(De&&De.enter(),Oe=fe(oe),De&&(De.exit(),Kr=!0)),Oe===B.promise?Te(new U("Promise-chain cycle")):(Ge=wr(Oe))?i(Ge,Oe,He,Te):He(Oe)):Te(oe)}catch(bt){De&&!Kr&&De.exit(),Te(bt)}},_r=function(B,X){B.notified||(B.notified=!0,S(function(){for(var oe=B.reactions,ce;ce=oe.get();)Sr(ce,B);B.notified=!1,X&&!B.rejection&&yt(B)}))},Ar=function(B,X,oe){var ce,fe;H?(ce=F.createEvent("Event"),ce.promise=X,ce.reason=oe,ce.initEvent(B,!1,!0),n.dispatchEvent(ce)):ce={promise:X,reason:oe},!K&&(fe=n["on"+B])?fe(ce):B===Q&&R("Unhandled promise rejection",oe)},yt=function(B){i(p,n,function(){var X=B.facade,oe=B.value,ce=zr(B),fe;if(ce&&(fe=I(function(){t?w.emit("unhandledRejection",oe,X):Ar(Q,X,oe)}),B.rejection=t||zr(B)?Re:ae,fe.error))throw fe.value})},zr=function(B){return B.rejection!==ae&&!B.parent},kr=function(B){i(p,n,function(){var X=B.facade;t?w.emit("rejectionHandled",X):Ar(J,X,B.value)})},ye=function(B,X,oe){return function(ce){B(X,ce,oe)}},Xe=function(B,X,oe){B.done||(B.done=!0,oe&&(B=oe),B.value=X,B.state=ue,_r(B,!0))},qr=function(B,X,oe){if(!B.done){B.done=!0,oe&&(B=oe);try{if(B.facade===X)throw new U("Promise can't be resolved itself");var ce=wr(X);ce?S(function(){var fe={done:!1};try{i(ce,X,ye(qr,fe,B),ye(Xe,fe,B))}catch(He){Xe(fe,He,B)}}):(B.value=X,B.state=ne,_r(B,!1))}catch(fe){Xe({done:!1},fe,B)}}};if(G&&(m=function(X){d(this,C),l(X),i(xe,this);var oe=L(this);try{X(ye(qr,oe),ye(Xe,oe))}catch(ce){Xe(oe,ce)}},C=m.prototype,xe=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new g,rejection:!1,state:le,value:null})},xe.prototype=o(C,"then",function(X,oe){var ce=L(this),fe=T(h(this,m));return ce.parent=!0,fe.ok=f(X)?X:!0,fe.fail=f(oe)&&oe,fe.domain=t?w.domain:void 0,ce.state===le?ce.reactions.add(fe):S(function(){Sr(fe,ce)}),fe.promise}),je=function(){var B=new xe,X=L(B);this.promise=B,this.resolve=ye(qr,X),this.reject=ye(Xe,X)},q.f=T=function(B){return B===m||B===$e?new je(B):x(B)},!r&&f(y)&&N!==Object.prototype)){Qe=N.then,re||o(N,"then",function(X,oe){var ce=this;return new m(function(fe,He){i(Qe,ce,fe,He)}).then(X,oe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,C)}return e({global:!0,constructor:!0,wrap:!0,forced:G},{Promise:m}),$e=a.Promise,u(m,j,!1,!0),c(j),Nl}var tf={},mo,nf;function Hp(){if(nf)return mo;nf=1;var e=ke(),r=e("iterator"),t=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){t=!0}};a[r]=function(){return this},Array.from(a,function(){throw 2})}catch{}return mo=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var u={};u[r]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},mo}var go,af;function Rn(){if(af)return go;af=1;var e=pt(),r=Hp(),t=Mt().CONSTRUCTOR;return go=t||!r(function(n){e.all(n).then(void 0,function(){})}),go}var of;function Gp(){if(of)return tf;of=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Dt(),o=Rn();return e({target:"Promise",stat:!0,forced:o},{all:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]=y,--R||f(p))},v)}),--R||f(p)});return d.error&&v(d.value),l.promise}}),tf}var sf={},uf;function Wp(){if(uf)return sf;uf=1;var e=Pe(),r=sr(),t=Mt().CONSTRUCTOR,n=pt(),a=Je(),i=we(),o=Ye(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(c){return this.then(void 0,c)}}),!r&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return sf}var cf={},lf;function Vp(){if(lf)return cf;lf=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Dt(),o=Rn();return e({target:"Promise",stat:!0,forced:o},{race:function(u){var c=this,l=n.f(c),f=l.reject,v=a(function(){var d=t(c.resolve);i(u,function(h){r(d,c,h).then(l.resolve,f)})});return v.error&&f(v.value),l.promise}}),cf}var ff={},df;function zp(){if(df)return ff;df=1;var e=Pe(),r=br(),t=Mt().CONSTRUCTOR;return e({target:"Promise",stat:!0,forced:t},{reject:function(a){var i=r.f(this),o=i.reject;return o(a),i.promise}}),ff}var vf={},yo,hf;function Ov(){if(hf)return yo;hf=1;var e=rr(),r=Ke(),t=br();return yo=function(n,a){if(e(n),r(a)&&a.constructor===n)return a;var i=t.f(n),o=i.resolve;return o(a),i.promise},yo}var pf;function Kp(){if(pf)return vf;pf=1;var e=Pe(),r=Je(),t=sr(),n=pt(),a=Mt().CONSTRUCTOR,i=Ov(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(c){return i(s&&this===o?n:this,c)}}),vf}var mf;function Jp(){return mf||(mf=1,Bp(),Gp(),Wp(),Vp(),zp(),Kp()),xl}var gf={},yf;function Yp(){if(yf)return gf;yf=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Dt(),o=Rn();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]={status:"fulfilled",value:y},--R||f(p))},function(y){b||(b=!0,p[g]={status:"rejected",reason:y},--R||f(p))})}),--R||f(p)});return d.error&&v(d.value),l.promise}}),gf}var bf={},wf;function Qp(){if(wf)return bf;wf=1;var e=Pe(),r=Le(),t=tr(),n=Je(),a=br(),i=ht(),o=Dt(),s=Rn(),u="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(l){var f=this,v=n("AggregateError"),d=a.f(f),h=d.resolve,p=d.reject,S=i(function(){var R=t(f.resolve),I=[],g=0,b=1,y=!1;o(l,function(A){var q=g++,j=!1;b++,r(R,f,A).then(function(G){j||y||(y=!0,h(G))},function(G){j||y||(j=!0,I[q]=G,--b||p(new v(I,u)))})}),--b||p(new v(I,u))});return S.error&&p(S.value),d.promise}}),bf}var Sf={},If;function Cv(){if(If)return Sf;If=1;var e=Pe(),r=me(),t=Pv(),n=Pn(),a=br(),i=tr(),o=ht(),s=r.Promise,u=!1,c=!s||!s.try||o(function(){s.try(function(l){u=l===8},8)}).error||!u;return e({target:"Promise",stat:!0,forced:c},{try:function(l){var f=arguments.length>1?n(arguments,1):[],v=a.f(this),d=o(function(){return t(i(l),void 0,f)});return(d.error?v.reject:v.resolve)(d.value),v.promise}}),Sf}var Pf={},Ef;function _v(){if(Ef)return Pf;Ef=1;var e=Pe(),r=br();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Pf}var Rf={},Tf;function Xp(){if(Tf)return Rf;Tf=1;var e=Pe(),r=sr(),t=pt(),n=Ae(),a=Je(),i=we(),o=Iv(),s=Ov(),u=Ye(),c=t&&t.prototype,l=!!t&&n(function(){c.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(v){var d=o(this,a("Promise")),h=i(v);return this.then(h?function(p){return s(d,v()).then(function(){return p})}:v,h?function(p){return s(d,v()).then(function(){throw p})}:v)}}),!r&&i(t)){var f=a("Promise").prototype.finally;c.finally!==f&&u(c,"finally",f,{unsafe:!0})}return Rf}var bo,Of;function Zp(){if(Of)return bo;Of=1,$p(),gs(),Lp(),Jp(),Yp(),Qp(),Cv(),_v(),Xp(),mv();var e=En();return bo=e.Promise,bo}var wo,Cf;function em(){if(Cf)return wo;Cf=1;var e=Zp();return wv(),wo=e,wo}var _f={},Af;function rm(){return Af||(Af=1,Cv()),_f}var kf={},qf;function tm(){return qf||(qf=1,_v()),kf}var So,$f;function nm(){if($f)return So;$f=1;var e=em();return rm(),tm(),So=e,So}nm();const Av="sesamy-debug";function am(e,r,t){const n=new Date;n.setTime(n.getTime()+t*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${r}; ${a}; path=/`}function im(e){if(typeof document>"u")return null;const r=e+"=",t=document.cookie.split(";");for(let n=0;n<t.length;n++){let a=t[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null}function om(e){am(Av,e.toString(),1)}function sm(){return im(Av)==="true"}function de(e){sm()&&console.log(e)}function Lr(e,r){if(typeof window>"u")return;const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});de(`Triggering event: ${e}`),dispatchEvent(t)}const um=Object.freeze(Object.defineProperty({__proto__:null,triggerEvent:Lr},Symbol.toStringTag,{value:"Module"}));let kv=null;function Do(e){kv=e}function qv(){return kv}var er=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(er||{});const cm=Object.freeze(Object.defineProperty({__proto__:null,Events:er},Symbol.toStringTag,{value:"Module"})),$v="sesamy_is_authenticated";function lm(){try{return document.cookie.split(";").some(e=>e.trim().startsWith(`${$v}=true`))}catch{return!1}}function Io(e){try{const r=e?2592e3:0,t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${$v}=${e}; path=/; max-age=${r}; SameSite=Lax${t}`}catch{}}function Uf(e={}){let r=e.baseUrl??"",t="",n=!1,a=null,i=null;async function o(){try{const u=await fetch(`${r}/auth/userinfo`,{credentials:"include",headers:{Accept:"application/json"}});return u.ok?await u.json():null}catch(u){return de(`[cookie-auth] Failed to fetch userinfo: ${u.message}`),null}}const s={async init(u){if(t=u.vendorId||u.clientId||"",de(`[cookie-auth] Initializing with baseUrl: ${r}`),lm()){const c=await o();c===null?de("[cookie-auth] userinfo fetch failed transiently; retaining session hint"):c.authenticated&&c.sub?(a=!0,i=c,Io(!0),Lr(er.AUTHENTICATED,{sub:c.sub,appState:void 0})):(a=!1,Io(!1))}else a=!1;n=!0,Lr(er.AUTH_INITIALIZED,{})},async isAuthenticated(){if(!n)return!1;if(a!==null)return a;const u=await o();return u===null?(de("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"),!1):(a=u.authenticated,a)},async getTokenSilently(u,c){return null},async getUser(){if(!n)return null;if(i)return i;const u=await o();return u?.authenticated&&u.sub?(i=u,i):null},async login(u){if(!t)throw new Error("[cookie-auth] vendorId is required to build a login URL");const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/${encodeURIComponent(t)}/login`,window.location.origin);l.searchParams.set("return_to",c),window.location.href=l.toString()},async loginWithRedirect(u){return s.login(u)},async loginWithPopup(u){return de("[cookie-auth] loginWithPopup called — falling back to redirect"),s.login(u)},async logout(u){a=!1,i=null,Io(!1),Lr(er.LOGOUT,{});const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/logout`,window.location.origin);l.searchParams.set("return_to",c),u?.localOnly&&l.searchParams.set("local_only","true"),window.location.href=l.toString()}};return s}const fm="sesamyAccessToken";let qt=!1;function Cr(){const e=qv();if(!e)throw new Error("[sesamy-js] No auth plugin registered. This should not happen.");return e}async function dm(e){if(e.enabled===!1){de("Auth disabled via config"),qt=!0;return}e.useHttpCookies?(de("useHttpCookies=true — using cookie-based BFF plugin"),Do(Uf())):qv()||(de("No auth plugin registered — defaulting to cookie-based BFF plugin"),Do(Uf())),await Cr().init(e),qt=!0}async function dr(){return qt?Cr().isAuthenticated():!1}async function fr(e=!0,r=!1){return qt?Cr().getTokenSilently(e,r):null}async function vm(){return qt?Cr().getUser():null}async function hm(e){return Cr().login(e)}async function Is(e){return Cr().loginWithRedirect(e)}async function pm(e){return Cr().loginWithPopup(e)}async function mm(e={}){return Cr().logout(e)}async function Mo(e){const r=e.split(".");if(r.length!==3)throw new Error("Invalid token");const t=decodeURIComponent(atob(r[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(o=>"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)).join("")),n=JSON.parse(t);if(!n?.exp||n.exp<Date.now()/1e3)throw new Error("Invalid token");de("Set token"),localStorage.setItem(fm,e);const{triggerEvent:a}=await Promise.resolve().then(()=>um),{Events:i}=await Promise.resolve().then(()=>cm);a(i.AUTHENTICATED,{...n,appState:void 0})}const gm=(e,r)=>r.skipDedupe||r.method!=="GET",ym=(e,r)=>r.method+"@"+e,bm=e=>e.clone(),wm=({skip:e=gm,key:r=ym,resolver:t=bm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Sm=(e,r)=>e*r,Im=e=>e&&e.ok,Pm=({delayTimer:e=500,delayRamp:r=Sm,maxAttempts:t=10,until:n=Im,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})};let Po=class Uv extends Error{status;statusText;url;body;constructor(r,t,n,a,i){super(a),this.name="APIError",this.status=r,this.statusText=t,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Uv)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var rn=(e=>(e.BROWSER="browser",e.NORMAL="normal",e))(rn||{});const Em="application/json",Lv="Content-Type",Zr=Symbol(),xv=Symbol();function Lf(e={}){var r;const t=e instanceof Array?Object.fromEntries(e):e;return(r=Object.entries(t).find(([n])=>n.toLowerCase()===Lv.toLowerCase()))===null||r===void 0?void 0:r[1]}function xf(e){return/^application\/.*json.*/.test(e)}const xr=function(e,r,t=!1){return Object.entries(r).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=t?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=xr(o,i,t):n[a]=i,n},{...e})},st={options:{},errorType:"text",polyfills:{},polyfill(e,r=!0,t=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(r&&!a)throw new Error(e+" is not defined");return t&&a?new a(...n):a}};function Rm(e,r=!1){st.options=r?e:xr(st.options,e)}function Tm(e,r=!1){st.polyfills=r?e:xr(st.polyfills,e)}function Om(e){st.errorType=e}const Cm=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;let Nv=class extends Error{};const _m=e=>{const r=Object.create(null);e=e._addons.reduce((g,b)=>b.beforeRequest&&b.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,c=new Map(i),l=xr(a.options,n);let f=t;const v=Cm(s)((g,b)=>(f=g,a.polyfill("fetch")(g,b)))(t,l),d=new Error,h=v.catch(g=>{throw{[Zr]:g}}).then(g=>{var b;if(!g.ok){const y=new Nv;if(y.cause=d,y.stack=y.stack+`
|
|
2
|
-
CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const A=a.errorType==="json"||((b=g.headers.get("Content-Type"))===null||b===void 0?void 0:b.split(";")[0])==="application/json";return(a.errorType?A?g.text():g[a.errorType]():Promise.resolve(g.body)).then(q=>{if(y.message=typeof q=="string"?q:g.statusText,q)if(A&&typeof q=="string"){y.text=q;try{y.json=JSON.parse(q)}catch{}}else y[a.errorType]=q;throw y})}return g}),p=g=>g.catch(b=>{const y=Object.prototype.hasOwnProperty.call(b,Zr),A=y?b[Zr]:b,q=A?.status&&c.get(A.status)||c.get(A?.name)||y&&c.has(Zr)&&c.get(Zr);if(q)return q(A,e);const j=c.get(xv);if(j)return j(A,e);throw A}),S=g=>b=>p(g?h.then(y=>y&&y[g]()).then(y=>b?b(y):y):h.then(y=>b?b(y):y)),R={_wretchReq:e,_fetchReq:v,_sharedState:r,res:S(null),json:S("json"),blob:S("blob"),formData:S("formData"),arrayBuffer:S("arrayBuffer"),text:S("text"),error(g,b){return c.set(g,b),this},badRequest(g){return this.error(400,g)},unauthorized(g){return this.error(401,g)},forbidden(g){return this.error(403,g)},notFound(g){return this.error(404,g)},timeout(g){return this.error(408,g)},internalError(g){return this.error(500,g)},fetchError(g){return this.error(Zr,g)}},I=u.reduce((g,b)=>({...g,...typeof b.resolver=="function"?b.resolver(g):b.resolver}),R);return o.reduce((g,b)=>b(g,e),I)},Am={_url:"",_options:{},_config:st,_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,r=!1){return{...this,_config:{...this._config,polyfills:r?e:xr(this._config.polyfills,e)}}},url(e,r=!1){if(r)return{...this,_url:e};const t=this._url.split("?");return{...this,_url:t.length>1?t[0]+e+"?"+t[1]:this._url+e}},options(e,r=!1){return{...this,_options:r?e:xr(this._options,e)}},headers(e){const r=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:xr(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Lv]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,r){const t=new Map(this._catchers);return t.set(e,r),{...this,_catchers:t}},catcherFallback(e){return this.catcher(xv,e)},resolve(e,r=!1){return{...this,_resolvers:r?[e]:[...this._resolvers,e]}},defer(e,r=!1){return{...this,_deferred:r?[e]:[...this._deferred,e]}},middlewares(e,r=!1){return{...this,_middlewares:r?e:[...this._middlewares,...e]}},fetch(e=this._options.method,r="",t=null){let n=this.url(r).options({method:e});const a=Lf(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||xf(a));return n=t?o?n.json(t,a):n.body(t):n,_m(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,r=""){return this.fetch("PUT",r,e)},post(e,r=""){return this.fetch("POST",r,e)},patch(e,r=""){return this.fetch("PATCH",r,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,r){const t=Lf(this._options.headers);return this.content(r||xf(t)&&t||Em).body(JSON.stringify(e))}};function or(e="",r={}){return{...Am,_url:e,_options:r}}or.default=or;or.options=Rm;or.errorType=Om;or.polyfills=Tm;or.WretchError=Nv;const km=(e,r)=>r.skipDedupe||r.method!=="GET",qm=(e,r)=>r.method+"@"+e,$m=e=>e.clone(),Um=({skip:e=km,key:r=qm,resolver:t=$m}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Lm=(e,r)=>r.skipCache||r.method!=="GET",xm=(e,r)=>r.method+"@"+e,Nm=()=>!1,jm=()=>null,Dm=e=>e.ok,Mm=({throttle:e=1e3,skip:r=Lm,key:t=xm,clear:n=Nm,invalidate:a=jm,condition:i=Dm,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,c=new Set,l=v=>{e&&!c.has(v)&&(c.add(v),setTimeout(()=>{c.delete(v)},e))},f=v=>(d,h)=>{const p=t(d,h);let S=a(d,h);if(S&&(S instanceof Array||(S=[S]),S.forEach(R=>{typeof R=="string"?s.delete(R):R instanceof RegExp&&s.forEach((I,g)=>{R.test(g)&&s.delete(g)})})),n(d,h)&&s.clear(),r(d,h))return v(d,h);if(c.has(p)){if(s.has(p)){const R=s.get(p).clone();return o&&Object.defineProperty(R,o,{value:p,enumerable:!1}),Promise.resolve(R)}else if(u.has(p))return new Promise((R,I)=>{u.get(p).push([R,I])})}return u.has(p)||u.set(p,[]),l(p),v(d,h).then(R=>(i(R.clone())&&s.set(p,R.clone()),u.get(p).forEach(([I])=>I(R.clone())),u.delete(p),R)).catch(R=>{throw u.get(p).forEach(([,I])=>I(R)),u.delete(p),R})};return f.cacheResponse=function(v,d){l(v),s.set(v,d)},f.cache=s,f.inflight=u,f.throttling=c,f},Fm=(e,r)=>e*r,Bm=e=>e&&e.ok,Hm=({delayTimer:e=500,delayRamp:r=Fm,maxAttempts:t=10,until:n=Bm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})},Gm="@sesamy/sdk",Wm="1.23.0";let Vm=class{cache=new Map;get(r){return this.cache.get(r)||null}set(r,t){this.cache.set(r,t)}remove(r){this.cache.delete(r)}clear(){this.cache.clear()}};const Tt="sesamyCacheTimestamp",zm=e=>{const{libraryName:r=Gm,libraryVersion:t=Wm,cache:n}=e,a=n?.storage||new Vm,i=[s=>async(u,c)=>{if(n?.mode===rn.BROWSER){let l;typeof sessionStorage<"u"?(l=sessionStorage.getItem(Tt),l||(l=Date.now().toString(),sessionStorage.setItem(Tt,l))):(l=a.get(Tt),l||(l=Date.now().toString(),a.set(Tt,l)));const f={...c,headers:{...c.headers,"Cache-Timestamp":l}};return s(u,f)}return s(u,c)},s=>async(u,c)=>{const l=await e.tokenProvider();if(l===null)return s(u,c);const f={...c,headers:{...c.headers,Authorization:l}};return s(u,f)},Um()];n?.mode===rn.NORMAL&&i.push(Mm({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Hm({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=or(e.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${r}/${t}`,...e.headers}).middlewares(i);return{async request(s,u={}){try{const c=/^https?:\/\//.test(s);let l=o.url(s,c);u.headers&&(l=l.headers(u.headers));const f=(u.method||"GET").toLowerCase();let v;switch(f){case"get":v=l.get();break;case"post":v=l.post(u.body);break;case"put":v=l.put(u.body);break;case"patch":v=l.patch(u.body);break;case"delete":v=l.delete();break;default:v=l.get()}const d=await v.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&vr(),d.status===204)return null;if(!d.ok){const h=await d.text().catch(()=>"Unknown error");throw new Po(d.status,d.statusText,d.url,`API Error ${d.status}: ${h}`,h)}return await d.json()}catch(c){if(c instanceof Po)throw c;const l=c.status||500,f=c.message||"Unknown error",v=`${e.baseUrl}${s}`;throw new Po(l,f,v,`API Error ${l}: ${c.message||"Unknown error"}`,c.message||"Unknown error")}}}},vr=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Tt),"Cache cleared"),St={get:async(e,r)=>e.request(`/profile/${r}`),update:async(e,r,t)=>e.request(`/profile/${r}`,{method:"PATCH",body:JSON.stringify(t)}),checkSpotifyLink:async e=>e.request("/profile/spotify-link"),unlinkSpotify:async e=>e.request("/profile/unlink-spotify",{method:"POST"}),delete:async e=>{await e.request("/profile",{method:"DELETE"})}},Eo={list:async(e,r)=>{const t=new URLSearchParams;r?.type&&t.append("type",r.type),r?.sku&&t.append("sku",r.sku),r?.purchaseOptionId&&t.append("purchase-option-id",r.purchaseOptionId),r?.waitForEntitlementAfter&&t.append("wait-for-entitlement-after",r.waitForEntitlementAfter);const n=t.toString(),a=n?`/entitlements?${n}`:"/entitlements";return e.request(a)},get:async(e,r)=>e.request(`/entitlements/${r}`),getAccess:async(e,r)=>e.request(`/entitlements/${r}/access`)},Nf={list:async e=>e.request("/subscriptions"),get:async(e,r)=>e.request(`/subscriptions/${r}`)},jf={get:async(e,r)=>e.request(`/products/${r}`),autoOnboard:async(e,r)=>e.request(`/products/${r}/auto-onboard`,{method:"POST"})},Km=(e,r)=>{if(!e||!r)return e;const t=new URL(e);return t.hash=`access_token=${r}`,t.toString()},Df=(e,r)=>!e.manageUrl||!r?e:{...e,manageUrl:Km(e.manageUrl,r)},It={list:async e=>e.request("/contracts"),get:async(e,r)=>e.request(`/contracts/${r}`),cancel:async(e,r)=>e.request(`/contracts/${r}/cancel`,{method:"POST"}),createAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments`,{method:"POST",body:JSON.stringify(t)}),confirmAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments/${t}/confirm`,{method:"POST"})},Ro={get:async e=>e.request("/user-metadata"),set:async(e,r,t)=>{await e.request(`/user-metadata/${r}`,{method:"PUT",body:t})},delete:async(e,r)=>{await e.request(`/user-metadata/${r}`,{method:"DELETE"})}},et={list:async e=>e.request("/tallies"),get:async(e,r)=>e.request(`/tallies/${r}`),update:async(e,r,t)=>e.request(`/tallies/${r}`,{method:"PUT",body:JSON.stringify(t)}),create:async(e,r)=>e.request("/tallies",{method:"POST",body:JSON.stringify(r)}),delete:async(e,r)=>{try{return await e.request(`/tallies/${r}`,{method:"DELETE"}),!0}catch{return!1}},push:async(e,r,t)=>e.request(`/tallies/${r}/push`,{method:"POST",body:JSON.stringify(t)})},To={list:async e=>e.request("/tags"),add:async(e,r)=>{await e.request("/tags",{method:"POST",body:JSON.stringify({tag:r})})},remove:async(e,r)=>{await e.request(`/tags/${r}`,{method:"DELETE"})}},rt={generateCheckoutLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},generateAccountLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}${r.contractId?`/${encodeURIComponent(r.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePlanLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateConsumeLink:(e,r)=>{const t=r.language||"en";let n=new URL(`${e.baseUrl}/consume/${encodeURIComponent(t)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.sku)}`);return r.episodeId?n.href+=`/${encodeURIComponent(r.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()}},Oo={generateLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},create:async(e,r)=>e.request("/checkouts",{method:"POST",body:JSON.stringify(r)}),get:async(e,r)=>e.request(`/checkouts/${r}`),update:async(e,r,t)=>e.request(`/checkouts/${r}`,{method:"PATCH",body:JSON.stringify(t)})},Mf={list:async e=>e.request("/bills"),get:async(e,r)=>e.request(`/bills/${r}`)},Ff={list:async e=>e.request("/fulfillments"),create:async(e,r)=>e.request("/fulfillments",{method:"POST",body:JSON.stringify(r)})},Jm={get:async(e,r)=>{try{return new URL(r),e.request(r)}catch{return e.request(`/paywalls/${r}`)}}},Ym={list:async e=>e.request("/payment-issues")},Qm={content:async(e,r,t,n,a)=>{const i=new URLSearchParams({url:r});return t&&i.append("selector",t),n&&i.append("cache",n),e.request(`/proxy?${i.toString()}`,a)}},Xm={list:async(e,r)=>{const t=(r?new URLSearchParams({q:r}):new URLSearchParams).toString(),n=t?`/transactions?${t}`:"/transactions";return e.request(n)}},Bf={get:async e=>e.request("/vendor"),list:async e=>e.request("/vendors")},Zm=e=>{const r=zm(e);return{profile:{get:t=>St.get(r,t),update:(t,n)=>St.update(r,t,n),checkSpotifyLink:()=>St.checkSpotifyLink(r),unlinkSpotify:()=>St.unlinkSpotify(r),delete:()=>St.delete(r)},entitlements:{list:t=>Eo.list(r,t),get:t=>Eo.get(r,t),getAccess:t=>Eo.getAccess(r,t)},subscriptions:{list:()=>Nf.list(r),get:t=>Nf.get(r,t)},products:{get:t=>jf.get(r,t),autoOnboard:t=>jf.autoOnboard(r,t)},contracts:{list:async()=>{const t=await It.list(r),n=await e.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return t;const a=n.substring(7);return t.map(i=>Df(i,a))},get:async t=>{const n=await It.get(r,t),a=await e.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Df(n,i)},cancel:t=>It.cancel(r,t),createAmendment:(t,n)=>It.createAmendment(r,t,n),confirmAmendment:(t,n)=>It.confirmAmendment(r,t,n)},userMetadata:{get:()=>Ro.get(r),set:(t,n)=>Ro.set(r,t,n),delete:t=>Ro.delete(r,t)},tallies:{list:()=>et.list(r),get:t=>et.get(r,t),update:(t,n)=>et.update(r,t,n),create:t=>et.create(r,t),delete:t=>et.delete(r,t),push:(t,n)=>et.push(r,t,n)},tags:{list:()=>To.list(r),add:t=>To.add(r,t),remove:t=>To.remove(r,t)},checkouts:{generateLink:(t,n)=>rt.generateCheckoutLink(t,n),create:t=>Oo.create(r,t),get:t=>Oo.get(r,t),update:(t,n)=>Oo.update(r,t,n)},links:{generateCheckoutLink:(t,n)=>rt.generateCheckoutLink(t,n),generateAccountLink:(t,n)=>rt.generateAccountLink(t,n),generateChangePaymentLink:(t,n)=>rt.generateChangePaymentLink(t,n),generateChangePlanLink:(t,n)=>rt.generateChangePlanLink(t,n),generateConsumeLink:(t,n)=>rt.generateConsumeLink(t,n)},bills:{list:()=>Mf.list(r),get:t=>Mf.get(r,t)},fulfillments:{list:()=>Ff.list(r),create:t=>Ff.create(r,t)},paywalls:{get:t=>Jm.get(r,t)},paymentIssues:{list:()=>Ym.list(r)},proxy:{content:(t,n,a,i)=>Qm.content(r,t,n,a,i)},transactions:{list:t=>Xm.list(r,t)},vendor:{get:()=>Bf.get(r),list:()=>Bf.list(r)}}},eg="sesamy.com",rg="sesamy.dev",tg="https://sesa.my",Hf="sesamyCacheTimestamp",Gf="sesamyContentReloaded";class ng{get(r){return typeof sessionStorage>"u"?null:sessionStorage.getItem(r)}set(r,t){typeof sessionStorage<"u"&&sessionStorage.setItem(r,t)}remove(r){typeof sessionStorage<"u"&&sessionStorage.removeItem(r)}clear(){}}function ag(e,r){return`${e}.${r==="dev"?rg:eg}`}function ir(e,r){return`https://${ag(e,r)}`}function Qt(){let r=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en";return r==="nn"&&(r="nb"),r}function Fo(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function jv(e,r){if(Fo(e))return{itemSrc:e};const t=e.split(":");if(t.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${t.length}`);const[n,a,i]=t;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:r||i}}function Wf(e){return e.endsWith("/")?e.slice(0,-1):e}function Vf(e,r){if(!Fo(e)||!Fo(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&Wf(t.pathname)===Wf(n.pathname)}function ig(e,r,t){const n=new URL(`${ir("checkout3",e.environment)}`);r.language&&n.searchParams.set("lang",r.language);let a=r.sku,i=r.purchaseOptionId,o=r.itemSrc;if(r.itemSrc){const l=jv(r.itemSrc,r.purchaseOptionId);a=l.sku||a,i=l.purchaseOption||i,o=l.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),r.email&&n.searchParams.set("email",r.email),r.business&&n.searchParams.set("business","true"),r.currency&&n.searchParams.set("currency",r.currency),r.price&&n.searchParams.set("price",r.price.toString()),r.discountCode&&n.searchParams.set("discount-code",r.discountCode),r.attributionItemSrc?n.searchParams.set("itemSrc",r.attributionItemSrc):t.itemSrc&&n.searchParams.set("itemSrc",t.itemSrc),r.attributionPublisherContentId?n.searchParams.set("publisherContentId",r.attributionPublisherContentId):t.publisherContentId&&n.searchParams.set("publisherContentId",t.publisherContentId),r.utmSource?n.searchParams.set("utm_source",r.utmSource):t.utmSource&&n.searchParams.set("utm_source",t.utmSource),r.utmMedium?n.searchParams.set("utm_medium",r.utmMedium):t.utmMedium&&n.searchParams.set("utm_medium",t.utmMedium),r.utmCampaign?n.searchParams.set("utm_campaign",r.utmCampaign):t.utmCampaign&&n.searchParams.set("utm_campaign",t.utmCampaign),r.utmTerm?n.searchParams.set("utm_term",r.utmTerm):t.utmTerm&&n.searchParams.set("utm_term",t.utmTerm),r.utmContent?n.searchParams.set("utm_content",r.utmContent):t.utmContent&&n.searchParams.set("utm_content",t.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(l=>{const[f,v]=l.trim().split("=");return{key:f,value:v}}).filter(l=>s.some(f=>f===l.key)).forEach(l=>{n.searchParams.append(l.key,l.value)});let c=new URL(window.location.href);if(r.redirectUrl)try{c=new URL(r.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",r.redirectUrl)}return c.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&c.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",c.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:l,methods:f})=>f?f.map(v=>`${l}|${v}`):l).join(",")),r.requireAddress&&n.searchParams.set("require-address","true"),r.giftMode&&n.searchParams.set("gift-mode","true"),r.payerEmail&&n.searchParams.set("payer-email",r.payerEmail),r.metadata&&Object.entries(r.metadata).forEach(([l,f])=>{n.searchParams.set(`metadata.${l}`,String(f))}),n}const Dv="sesamySignedURLs";function Ps(){const e=sessionStorage.getItem(Dv);return e?JSON.parse(e):[]}function zf(e){const r=Ps();r.push(e),de(`Adding signed URL: ${e}`),sessionStorage.setItem(Dv,JSON.stringify(r))}function og(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Bo="sesamyAttribution";function sg(e){const r=localStorage.getItem(e);if(!r)return null;try{return JSON.parse(r).value}catch{return console.error(`Failed to parse ${e}`),null}}function ug(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function tn(){return sg(Bo)||{}}function Mv(e){if(e===null)localStorage.removeItem(Bo);else{de(`Setting attribution ${JSON.stringify(e)}`);const r=tn()??{},t=og({...r,...ug(e)});localStorage.setItem(Bo,JSON.stringify({value:t}))}}const Es="@sesamy/sesamy-js",Ft="1.92.0",Fv="sesamyFlags";async function Bv(e){try{localStorage.setItem(Fv,JSON.stringify(e))}catch{de("Failed to save flags to localStorage")}}async function Hv(e,r){const t=await Bt();t[e]=r,await Bv(t)}async function Gv(e){return(await Bt())[e]}async function Wv(e){const r=await Bt();e in r&&(delete r[e],await Bv(r))}async function Bt(){try{const e=localStorage.getItem(Fv);return e?JSON.parse(e):{}}catch{return{}}}function Vv(e){function r(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function t(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=r(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,c=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===c).length>1?a.unshift(`${c}:nth-child(${u})`):a.unshift(c)}i=i.parentElement}return a.join(" > ")}return t(e)}function zv(e){return e?Object.fromEntries(Object.entries(e).filter(([r,t])=>t!==void 0)):{}}function cg(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}let Me={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},Kv=[],Jv=!1,Rr;function Rs(){const e=window.location.pathname,r=new URLSearchParams(window.location.search),t=navigator.userAgent;return Kv.find(n=>{if(n.path&&!e.includes(n.path)||n.queryParam&&r.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!t.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!t.includes(n.userAgentContains))})}function lg(){return Rs()}function fg(e,r){Kv=e.content||[];const t=Rs();t&&t.type==="article"&&(Me={...Me,...zv(t.selectors)},Jv=t.enablePaywallSettingsUrlFallback||!1),Rr=r}function dg(e,r){const{selector:t,attribute:n}=r;return t===Me.article.selector||n&&e.hasAttribute(n)?e:e.querySelector(t)}function Yv(e,r,t=!1){if(e){if(r.attribute){if(r.attribute==="textContent")return e.textContent??void 0;const n=e.getAttribute(r.attribute),a=Yv(e.parentElement,r,t);if(t){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return e.textContent??void 0}}function ge(e){const r=document.head.querySelectorAll(`[property~='${e}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content;const t=document.head.querySelectorAll(`[name~='${e}'][content]`);for(let n=0;n<t.length;n+=1)if(t[n].content)return t[n].content}function Ot(e){const r=[];return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),document.head.querySelectorAll(`[name~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),r}let Ct=null;function Qv(){const e=[],r=document.querySelectorAll('script[type="application/ld+json"]');for(const t of r)try{const n=JSON.parse(t.textContent||"");Array.isArray(n)?e.push(...n):n["@graph"]&&Array.isArray(n["@graph"])?e.push(...n["@graph"]):e.push(n)}catch{}return e}function _t(e){const r=Qv(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.find(t)||null}function vg(e){const r=Qv(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.filter(t)}function Ho(e,r,t){if(!e||typeof e!="object")return typeof e=="string"?e:void 0;const a=e[r];if(typeof a=="string")return a;if(a&&typeof a=="object"&&t)return a[t]}function hg(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(n=>{if(typeof n=="string")return{name:n};if(typeof n=="object"&&n!==null){const a=n,i=a.name;return i?{name:i,url:a.url,image:Ho(a,"image","url"),jobTitle:a.jobTitle,sameAs:a.sameAs}:null}return null}).filter(n=>n!==null&&!!n.name);return t.length>0?t:void 0}function Co(e){if(Array.isArray(e))return e.filter(r=>typeof r=="string");if(typeof e=="string"){const r=e.split(",").map(t=>t.trim()).filter(Boolean);return r.length>0?r:void 0}}function Xv(){if(Ct)return Ct;const e=_t("NewsArticle")||_t("Article")||_t("BlogPosting")||_t("WebPage"),r=(...a)=>a.find(i=>i!=null&&i!=="")||void 0,t=(...a)=>a.find(i=>i&&i.length>0),n={contentType:e?Array.isArray(e["@type"])?e["@type"][0]:e["@type"]:void 0,authors:hg(e?.author)||(Ot("article:author").length>0?Ot("article:author").map(a=>({name:a})):void 0)||(ge("author")?[{name:ge("author")}]:void 0),keywords:t(Co(e?.keywords),Co(ge("keywords"))),tags:Ot("article:tag").length>0?Ot("article:tag"):void 0,categories:Co(ge("news_keywords")),section:r(e?.articleSection,ge("article:section")),publishedAt:r(e?.datePublished,ge("article:published_time")),modifiedAt:r(e?.dateModified,ge("article:modified_time")),ogType:ge("og:type"),ogSiteName:ge("og:site_name"),ogLocale:ge("og:locale"),twitterCard:ge("twitter:card"),twitterSite:ge("twitter:site"),twitterCreator:ge("twitter:creator"),creator:r(ge("creator"),ge("dc.creator")),mainEntityOfPage:e?Ho(e.mainEntityOfPage,"@id")||(typeof e.mainEntityOfPage=="string"?e.mainEntityOfPage:void 0):void 0,isAccessibleForFree:typeof e?.isAccessibleForFree=="boolean"?e.isAccessibleForFree:void 0,wordCount:typeof e?.wordCount=="number"?e.wordCount:void 0,publisher:e?.publisher&&typeof e.publisher=="object"?{name:e.publisher.name||"",url:e.publisher.url,logo:Ho(e.publisher,"logo","url")}:void 0};return Ct=zv(n),Ct}function pg(){Ct=null}function Ts({publisherContentId:e,key:r,defaultValue:t=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null,a=r.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(r)||ge(`sesamy:${r}`)||ge(`sesamy:${a}`)||ge(`og:${r}`)||ge(r)||t}function Zv(){const e=document.querySelectorAll(Me.article.selector);return Array.from(e).map(Ht).filter(r=>r!==null)}function Ht(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Vv(r)},n=(i,o,s,u)=>{const{transform:c,collect:l=!1}=u||{},f=dg(r,o),v=Yv(f,o,l),d=Ts({publisherContentId:s,key:cg(String(i))}),h=v||d||void 0;h&&(t[i]=c?c(h):h)};n("id",Me.id),n("title",Me.title,t.id),n("excerpt",Me.excerpt,t.id),n("image",Me.image,t.id),n("price",Me.price,t.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",Me.currency,t.id),n("url",Me.url,t.id),n("pass",Me.pass,t.id,{collect:!0}),n("paywallUrl",Me.paywallUrl,t.id),n("accessLevel",Me.accessLevel,t.id,{transform:i=>i||"entitlement"});const a=Rs();if(a&&a.type==="article"&&(a.pass&&(t.pass=t.pass?`${t.pass},${a.pass}`:a.pass),a.price&&!t.price&&(t.price=a.price.amount),a.price?.currency&&!t.currency&&(t.currency=a.price.currency),a.paywallUrl&&!t.paywallUrl&&(t.paywallUrl=a.paywallUrl)),Jv&&!t.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(t.paywallUrl=o)}}return t.url||(t.url=window.location.href),t.metadata=Xv(),t}async function mg(e){const r=Ht(e);if(!r)throw new Error("Could not find article element");if(r.accessLevel==="public")return!0;if(r.accessLevel==="logged-in"&&!r.paywallUrl)return await Rr.auth.isAuthenticated()?!0:null;if(r.paywallUrl&&((await Rr.paywalls.get(r.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await Rr.auth.isAuthenticated()?!0:null;if(!r.url)throw new Error("Article must have a URL");return await Rr.entitlements.hasAccess(r.url,r.pass?.split(",")||[])||null}async function eh(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=Ht(t);if(!n?.url)throw new Error("Could not find content for element");const a=await Rr.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await Rr.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=r||Vv(t.parentElement||t);return Rr.proxy.getContent(i.token,n.url,o)}function rh(e,r={}){const{closeOnBackdropClick:t=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=r,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof e=="string"?u.innerHTML=e:u.appendChild(e),s.appendChild(u);const c=()=>{s.remove(),n&&document.removeEventListener("keydown",l)},l=f=>{f.key==="Escape"&&c()};return t&&s.addEventListener("click",f=>{f.target===s&&c()}),n&&document.addEventListener("keydown",l),document.body.appendChild(s),{element:s,close:c}}function gg(e,r={}){const{position:t="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=r,c=document.createElement("div");c.setAttribute("data-sesamy-notification-bar","true"),c.setAttribute("data-sesamy-notification-position",t),Object.assign(c.style,{position:n?"fixed":"absolute",[t]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof e=="string"?c.innerHTML=e:c.appendChild(e);let l,f,v;const d=()=>{if(v&&clearTimeout(v),o&&s){const h=document.documentElement;h.style.transform=l||"",setTimeout(()=>{c.remove(),h.style.transition=f||""},parseFloat(u)*1e3)}else c.remove()};if(i&&(v=setTimeout(d,i)),o&&s){const h=document.documentElement;l=h.style.transform,f=h.style.transition,h.style.transition=`transform ${u} ease`,c.style.transition=`transform ${u} ease`,t==="top"?(h.style.transform=`translateY(${s})`,c.style.transform=`translateY(-${s})`):(h.style.transform=`translateY(-${s})`,c.style.transform=`translateY(${s})`),document.documentElement.prepend(c)}else document.body.appendChild(c);return{element:c,close:d}}function yg(e){const r=e.endpoint??ir("api2",e.environment),n=Zm({baseUrl:r,tokenProvider:async()=>{if(await dr())try{const U=await fr(!1);return U?`Bearer ${U}`:null}catch{}const m=localStorage.getItem("__anon_id");return`Basic ${btoa(`${e.vendorId||e.clientId}|${m}:`)}`},libraryName:Es,libraryVersion:Ft,vendorId:e.vendorId,cache:{mode:rn.BROWSER,storage:new ng}}),a=m=>async(C,U)=>{let F=sessionStorage.getItem(Hf);F||(F=Date.now().toString(),sessionStorage.setItem(Hf,F));const w={...U,headers:{...U.headers,"Cache-Timestamp":F}};return m(C,w)},i=(m=!0)=>C=>async(U,F)=>{const w=await fr(m);if(!w){if(await dr()){const x={...F,credentials:"include"};return C(U,x)}if(m)throw new Error("No access token available");return C(U,F)}const T={...F,headers:{...F.headers,Authorization:`Bearer ${w}`}};return C(U,T)},o=or(r).headers({"Content-Type":"application/json"}).middlewares([a,i(),wm(),Pm({delayTimer:1e3,delayRamp:(m,C)=>m*C,maxAttempts:3,until:m=>!!(m&&(m.ok||m.status>=400&&m.status<500)),retryOnNetworkError:!1})]);async function s(m={}){const{waitForEntitlementAfter:C,includeSignedLinks:U=!0}=m,F=await dr()?await n.entitlements.list({waitForEntitlementAfter:C?.toISOString()}):[];return U&&F.push(...Ps()),F}async function u(m,C=[]){return(await s())?.find(w=>{if(m){const{sku:T,purchaseOption:x}=jv(m);if("sku"in w&&T===w.sku||x&&"purchaseOptionsId"in w&&x===w.purchaseOptionsId||Vf(m,w.url))return!0}return!!C.some(T=>Vf(T,w.url))})}async function c(m,C,U){const F=new URL(r,window.location.origin);return F.pathname=F.pathname.replace(/\/$/,"")+"/proxy",F.searchParams.set("url",C),U&&F.searchParams.set("selector",U),or(F.toString()).headers({Authorization:`Bearer ${m}`}).get().text()}async function l(m){if(!m)throw new Error("SKU is required to get fulfillments");return await dr()?await o.get(`/fulfillments?sku=${encodeURIComponent(m)}`).json():[]}async function f(m,C){if(!m||!C)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:m},`/fulfillments/${encodeURIComponent(C)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(m){return(await n.transactions.list())?.find(U=>U.id===m)}async function h(){return await o.url("/tags").get().json()}async function p(m){const C=await o.url(`/tags/${encodeURIComponent(m)}`).delete().res();return vr(),C.ok}async function S(m){const C=await o.url("/tags").post(encodeURIComponent(m)).res();return Lr(er.USER_ATTRIBUTE_CHANGED,{}),vr(),C.ok}async function R(m){return(await n.tallies.get(m)).value}async function I(){const m=await n.tallies.list(),C={};for(const U of m)C[U.id]=U.value;return C}async function g(m){return await n.tallies.delete(m)}async function b(m,C){return await n.tallies.push(m,C)}async function y(){return await fr(!1)?await o.url("/profile").get().json():null}async function A(m){const C=await o.url("/profile").patch(m).res();return vr(),C.ok}async function q(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function G(m){const C=await fr(!1);if(!C)throw new Error("No access token available");const U=new URL(`${ir("access-sync",e.environment)}/spotify/sesamy-callback`);U.searchParams.set("access_token",C),U.searchParams.set("state",m),window.location.href=U.toString()}async function K(m){const C=await o.url(`/products/${encodeURIComponent(m)}/auto-onboard`).post().json();return C.length&&vr(),C}async function re(m,C=3600){const{shortlink:U}=await or(tg).post({url:m,ttl:C}).json();return U}async function L(m){const C=await fr(!1,!0);let U;const F=m.language||Qt(),w=tn();switch(m.target){case"account":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}${m.contractId?`/${encodeURIComponent(m.contractId)}`:""}`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-payment":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/change-payment-method`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-plan":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/edit-plan`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"consume":U=new URL(`${ir("consume",e.environment)}/${encodeURIComponent(m.language||F)}/@${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.sku)}`),m.episodeId?U.href+=`/${m.episodeId}`:U.href+="/listen",U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"checkout":U=ig(e,{language:F,...m},w);break;default:throw new Error("Invalid target")}return C&&(U.hash=`#access_token=${C}`),m.shorten?re(U.href,m.ttl):U.href}async function M(){const m=await fr(!1),C=new URL(`${ir("account",e.environment)}/subscriptions/${e.vendorId||e.clientId}`);m&&(C.hash=`#access_token=${m}`),window.location.href=C.toString()}async function N(m){const C=tn(),U=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[w,T]=F.trim().split("=");U.includes(w)&&!C[w]&&(C[w]=T)}),n.checkouts.create({language:Qt(),...m,attribution:{...C,...m.attribution}})}return{autoOnboardProduct:K,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Zv,get:Ht,getLanguage:Qt,unlock:eh,getPropertyFromHTML:Ts},contracts:n.contracts,deleteTag:p,deleteTally:g,entitlements:n.entitlements,flags:{get:Gv,set:Hv,list:Bt,delete:Wv},generateLink:L,getProxyContent:c,getEntitlements:s,getFulfillments:l,requestDelivery:f,hasAccess:u,isSpotifyLinked:q,linkSpotify:G,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:y,products:n.products,getSubscriptions:v,getTally:R,getTallies:I,getTags:h,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:b,setTag:S,unlinkSpotify:j,updateProfile:A,vendor:n.vendor}}function Kf(e,r,t,n,a){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)e=e?e[r[n]]:a;return e===a?t:e}var bg="function",wg="string",Ze="undefined",Sg="boolean",nn="object",Ig="array",Pg="number",Eg="symbol",Rg="null",Go=function(){},th="any",nh="*",Fr="__",Tg="form",Og="input",Cg="button",_g="select",an=typeof process!==Ze?process:{};an.env&&an.env.NODE_ENV;var _e=typeof document!==Ze;an.versions!=null&&an.versions.node!=null;typeof Deno!==Ze&&Deno.core;_e&&window.name==="nodejs"||typeof navigator!==Ze&&typeof navigator.userAgent!==Ze&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ah(e,r){return r.charAt(0)[e]()+r.slice(1)}var Ag=ah.bind(null,"toUpperCase"),kg=ah.bind(null,"toLowerCase");function qg(e){return ih(e)?Ag(Rg):typeof e===nn?xg(e):Object.prototype.toString.call(e).slice(8,-1)}function on(e,r){r===void 0&&(r=!0);var t=qg(e);return r?kg(t):t}function Gt(e,r){return typeof r===e}var Be=Gt.bind(null,bg),Tr=Gt.bind(null,wg),tt=Gt.bind(null,Ze),$g=Gt.bind(null,Sg);Gt.bind(null,Eg);function ih(e){return e===null}function Ug(e){return on(e)===Pg&&!isNaN(e)}function oh(e){return on(e)===Ig}function Fe(e){if(!Lg(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Lg(e){return e&&(typeof e===nn||e!==null)}function xg(e){return Be(e.constructor)?e.constructor.name:null}function Ng(e){return e instanceof Error||Tr(e.message)&&e.constructor&&Ug(e.constructor.stackTraceLimit)}function sh(e,r){if(typeof r!="object"||ih(r))return!1;if(r instanceof e)return!0;var t=on(new e(""));if(Ng(r))for(;r;){if(on(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}sh.bind(null,TypeError);sh.bind(null,SyntaxError);function Tn(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?jg(e,r):t}function jg(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function On(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}On(Tn,Tg);On(Tn,Cg);On(Tn,Og);On(Tn,_g);function Dg(e){return e?oh(e)?e:[e]:[]}function Jf(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Mg(){if(_e){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Fg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Bg(e){return(function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=Jf(t[1]),o=Jf(t[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var c=u.split("[");c.length>1&&(Hg(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(r){return _e&&window.location.search.substring(1)})())}function Hg(e,r,t){for(var n=r.length-1,a=0;a<n;++a){var i=r[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[r[n]]=t}function Cn(){for(var e="",r=0,t=4294967295*Math.random()|0;r++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[r-1],a=15&t;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),t=r%8==0?4294967295*Math.random()|0:t>>4}return e}function Gg(e,r){var t,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(t,n)};return function(){var u=new Date;o||(o=u);var c=r-(u-o);return t=this,n=arguments,c<=0?(clearTimeout(i),i=null,o=u,a=e.apply(t,n)):i||(i=setTimeout(s,c)),a}}var Nr="global",ut=Fr+Nr+Fr,ct=typeof self===nn&&self.self===self&&self||typeof global===nn&&global[Nr]===global&&global||void 0;function Br(e){return ct[ut][e]}function Hr(e,r){return ct[ut][e]=r}function mt(e){delete ct[ut][e]}function gt(e,r,t){var n;try{if(Os(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}ct[ut]||(ct[ut]={});var Wt={};function Os(e){if(typeof Wt[e]!==Ze)return Wt[e];try{var r=window[e];r.setItem(Ze,Ze),r.removeItem(Ze)}catch{return Wt[e]=!1}return Wt[e]=!0}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},ee.apply(null,arguments)}var Pr="function",hr="undefined",kt="reducer",uh="@@redux/",Wo=uh+"INIT",Wg=uh+Math.random().toString(36),Yf=(function(){return typeof Symbol===Pr&&Symbol.observable||"@@observable"})(),Vt=" != "+Pr;function ch(e,r,t){var n;if(typeof r===Pr&&typeof t===hr&&(t=r,r=void 0),typeof t!==hr){if(typeof t!==Pr)throw new Error("enhancer"+Vt);return t(ch)(e,r)}if(typeof e!==Pr)throw new Error(kt+Vt);var a=e,i=r,o=[],s=o,u=!1;function c(){s===o&&(s=o.slice())}function l(){return i}function f(d){if(typeof d!==Pr)throw new Error("Listener"+Vt);var h=!0;return c(),s.push(d),function(){if(h){h=!1,c();var p=s.indexOf(d);s.splice(p,1)}}}function v(d){if(!Fe(d))throw new Error("Act != obj");if(typeof d.type===hr)throw new Error("ActType "+hr);if(u)throw new Error("Dispatch in "+kt);try{u=!0,i=a(i,d)}finally{u=!1}for(var h=o=s,p=0;p<h.length;p++)(0,h[p])();return d}return v({type:Wo}),(n={dispatch:v,subscribe:f,getState:l,replaceReducer:function(d){if(typeof d!==Pr)throw new Error("next "+kt+Vt);a=d,v({type:Wo})}})[Yf]=function(){var d,h=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function S(){p.next&&p.next(l())}return S(),{unsubscribe:h(S)}}})[Yf]=function(){return this},d},n}function Vg(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+kt+" "+e+" returns "+hr}function lt(){var e=[].slice.call(arguments);return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,t){return function(){return r(t.apply(void 0,[].slice.call(arguments)))}})}function zg(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(c){return s(c)}};return i=[].slice.call(e).map(function(c){return c(u)}),ee({},o,{dispatch:s=lt.apply(void 0,i)(o.dispatch)})}}}var Or=Fr+"anon_id",jr=Fr+"user_id",at=Fr+"user_traits",Vo="analytics",Ir="userId",nt="anonymousId",Xt=["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"],zo=["name","EVENTS","config","loaded"],Z=Xt.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Qf=/^utm_/,Xf=/^an_prop_/,Zf=/^an_trait_/;function Kg(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===Z.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,c=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(Or,o.anonymousId),c||r(jr,o.userId),u.traits&&r(at,ee({},c&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var f=i.an_uid,v=i.an_event,d=l.reduce(function(h,p){if(p.match(Qf)||p.match(/^(d|g)clid/)){var S=p.replace(Qf,"");h.campaign[S==="campaign"?"name":S]=i[p]}return p.match(Xf)&&(h.props[p.replace(Xf,"")]=i[p]),p.match(Zf)&&(h.traits[p.replace(Zf,"")]=i[p]),h},{campaign:{},props:{},traits:{}});t.dispatch(ee({type:Z.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),v&&setTimeout(function(){return e.track(v,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:Z.campaign,campaign:d.campaign})}}return n(a)}}}}function Jg(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===Z.setItemEnd){if(t.key===Or)return ee({},r,{anonymousId:t.value});if(t.key===jr)return ee({},r,{userId:t.value})}switch(t.type){case Z.identify:return Object.assign({},r,{userId:t.userId,traits:ee({},r.traits,t.traits)});case Z.reset:return[jr,Or,at].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function ed(e){return{userId:e.getItem(jr),anonymousId:e.getItem(Or),traits:e.getItem(at)}}var Ko=function(e){return Fr+"TEMP"+Fr+e};function Yg(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var u=s.userId,c=s.traits,l=s.options;if(s.type===Z.reset&&([jr,at,Or].forEach(function(d){n(d)}),[Ir,nt,"traits"].forEach(function(d){mt(Ko(d))})),s.type===Z.identify){a(Or)||t(Or,Cn());var f=a(jr),v=a(at)||{};f&&f!==u&&i.dispatch({type:Z.userIdChanged,old:{userId:f,traits:v},new:{userId:u,traits:c},options:l}),u&&t(jr,u),c&&t(at,ee({},v,c))}return o(s)}}}}var At={};function rd(e,r){At[e]&&Be(At[e])&&(At[e](r),delete At[e])}function lh(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(ee({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return lh(e,r,t-10).then(n,a)})})}function Qg(e){return{abort:e}}function fh(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var c=s.actions.reduce(function(f,v,d){return o[v.plugin].loaded?(f.process.push(v),f.processIndex.push(d)):(f.requeue.push(v),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(f){var v=s.actions[f],d=v.plugin,h=v.payload.type,p=a[d][h];if(p&&Be(p)){var S,R=(function(b,y){return b===void 0&&(b={}),y===void 0&&(y={}),[Ir,nt].reduce(function(A,q){return b.hasOwnProperty(q)&&y[q]&&y[q]!==b[q]&&(A[q]=y[q]),A},b)})(v.payload,u),I=n[R.meta.rid];if(!I&&(S=p({payload:R,config:o[d].config,instance:t,abort:Qg}))&&Fe(S)&&S.abort)return void(n[R.meta.rid]=!0);if(!I){var g=h+":"+d;e.dispatch(ee({},R,{type:g,_:{called:g,from:"queueDrain"}}))}}});var l=s.actions.filter(function(f,v){return!~c.processIndex.indexOf(v)});s.actions=l}}}var _o=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var c=a.plugins,l=a.context,f=t.type,v=f.match(it),d=r.exact.map(function(S){return S.pluginName});v&&(d=o.during.map(function(S){return S.pluginName}));var h=(function(S,R){return function(I,g,b){var y=g.config,A=g.name,q=A+"."+I.type;b&&(q=b.event);var j=I.type.match(it)?(function(G,K,re,L,M){return function(N,m){var C=L?L.name:G,U=m&&$t(m)?m:re;if(L&&(!(U=m&&$t(m)?m:[G]).includes(G)||U.length!==1))throw new Error("Method "+K+" can only abort "+G+" plugin. "+JSON.stringify(U)+" input valid");return ee({},M,{abort:{reason:N,plugins:U,caller:K,_:C}})}})(A,q,R,b,I):(function(G,K){return function(){throw new Error(G.type+" action not cancellable. Remove abort in "+K)}})(I,q);return{payload:Xg(I),instance:S,config:y||{},abort:j}}})(n,d),p=r.exact.reduce(function(S,R){var I=R.pluginName,g=R.methodName,b=!1;return g.match(/^initialize/)||g.match(/^reset/)||(b=!c[I].loaded),l.offline&&g.match(/^(page|track|identify)/)&&(b=!0),S[""+I]=b,S},{});return Promise.resolve(r.exact.reduce(function(S,R,I){var g=R.pluginName;return Promise.resolve(S).then(function(b){function y(){return Promise.resolve(b)}var A=(function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function(q,j,G){return Promise.resolve(q).then(function(K){return j.method&&Be(j.method)?((function(N,m){var C=ud(N);if(C&&C.name===m){var U=ud(C.method);throw new Error([m+" plugin is calling method "+N,"Plugins cant call self","Use "+C.method+" "+(U?"or "+U.method:"")+" in "+m+" plugin insteadof "+N].join(`
|
|
3
|
-
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:K,instance:n,abort:(re=K,L=g,M=j.pluginName,function(N,m){return ee({},re,{abort:{reason:N,plugins:m||[L],caller:f,from:M||L}})}),config:ad(j.pluginName,c,i),plugins:c})).then(function(N){var m=Fe(N)?N:{};return Promise.resolve(ee({},K,m))})):K;var re,L,M})},Promise.resolve(t))).then(function(q){b[g]=q});b[g]=t})();return A&&A.then?A.then(y):y()})},Promise.resolve({}))).then(function(S){return Promise.resolve(r.exact.reduce(function(R,I,g){try{var b=r.exact.length===g+1,y=I.pluginName,A=i[y];return Promise.resolve(R).then(function(q){var j=S[y]?S[y]:{};if(v&&(j=q),ko(j,y))return Ao({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve(q);if(ko(q,y))return b&&Ao({data:q,method:f,instance:n,store:s}),Promise.resolve(q);if(p.hasOwnProperty(y)&&p[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(q);var G=h(S[y],i[y]);return Promise.resolve(A[f]({abort:G.abort,payload:j,instance:n,config:ad(y,c,i),plugins:c})).then(function(K){var re=Fe(K)?K:{},L=ee({},q,re),M=S[y];if(ko(M,y))Ao({data:M,method:f,instance:n,pluginName:y,store:s});else{var N=f+":"+y;(N.match(/:/g)||[]).length<2&&!f.match(td)&&!f.match(nd)&&n.dispatch(ee({},v?L:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(L)})})}catch(q){return Promise.reject(q)}},Promise.resolve(t))).then(function(R){if(!(f.match(it)||f.match(/^registerPlugin/)||f.match(nd)||f.match(td)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),R._&&R._.originalAction===f)return R;var I=ee({},R,{_:{originalAction:R.type,called:R.type,from:"engineEnd"}});dh(R,r.exact.length)&&!f.match(/End$/)&&(I=ee({},I,{type:R.type+"Aborted"})),s.dispatch(I)}return R})})}catch(S){return Promise.reject(S)}},it=/Start$/,td=/^bootstrap/,nd=/^ready/;function Ao(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(ee({},e.data,{type:t,_:{called:t,from:"abort"}}))}function ad(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function id(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function od(e,r){var t=e.replace(it,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function ko(e,r){var t=e.abort;return!!t&&(t===!0||sd(t,r)||t&&sd(t.plugins,r))}function dh(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Tr(t))return!0;var n=t.plugins;return $t(t)&&t.length===r||$t(n)&&n.length===r}function $t(e){return Array.isArray(e)}function sd(e,r){return!(!e||!$t(e))&&e.includes(r)}function ud(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function Xg(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Fe(e[t])?Object.assign({},e[t]):e[t]),r},{})}function Zg(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,u=function(b){return s?b:i(f)},c=o.type,l=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(c===Z.enablePlugin&&a.dispatch({type:Z.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),c===Z.disablePlugin&&setTimeout(function(){return rd(o.meta.rid,{payload:o})},0),c===Z.initializeEnd){var v=r(),d=Object.keys(v),h=d.filter(function(b){return l.includes(b)}).map(function(b){return v[b]}),p=[],S=[],R=o.disabled,I=h.map(function(b){var y=b.loaded,A=b.name,q=b.config;return lh(b,function(){return y({config:q})},1e4).then(function(j){return n[A]||(a.dispatch({type:Z.pluginReadyType(A),name:A,events:Object.keys(b).filter(function(G){return!zo.includes(G)})}),n[A]=!0),p=p.concat(A),b}).catch(function(j){if(j instanceof Error)throw new Error(j);return S=S.concat(j.name),j})});Promise.all(I).then(function(b){var y={plugins:p,failed:S,disabled:R};setTimeout(function(){d.length===I.length+R.length&&a.dispatch(ee({},{type:Z.ready},y))},0)})}var g=(function(){if(c!==Z.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return fh(a,r,e)},0),Promise.resolve((function(b,y,A,q,j){try{var G=Be(y)?y():y,K=b.type,re=K.replace(it,"");if(b._&&b._.called)return Promise.resolve(b);var L=A.getState(),M=(C=G,(U=L.plugins)===void 0&&(U={}),(F=b.options)===void 0&&(F={}),Object.keys(C).filter(function(w){var T=F.plugins||{};return $g(T[w])?T[w]:T.all!==!1&&(!U[w]||U[w].enabled!==!1)}).map(function(w){return C[w]}));K===Z.initializeStart&&b.fromEnable&&(M=Object.keys(L.plugins).filter(function(w){var T=L.plugins[w];return b.plugins.includes(w)&&!T.initialized}).map(function(w){return G[w]}));var N=M.map(function(w){return w.name}),m=(function(w,T){var x=od(w).map(function(H){return id(H,T)});return T.reduce(function(H,Q){var J=Q.name,le=od(w,J).map(function(Re){return id(Re,T)}),ne=le[0],ue=le[1],ae=le[2];return ne.length&&(H.beforeNS[J]=ne),ue.length&&(H.duringNS[J]=ue),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(K,M);return Promise.resolve(_o({action:b,data:{exact:m.before,namespaced:m.beforeNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(w){function T(){var Q=(function(){if(K.match(it))return Promise.resolve(_o({action:ee({},x,{type:re+"End"}),data:{exact:m.after,namespaced:m.afterNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&rd(J.meta.rid,{payload:J})})})();return Q&&Q.then?Q.then(function(){return w}):w}if(dh(w,N.length))return w;var x,H=(function(){if(K!==re)return Promise.resolve(_o({action:ee({},w,{type:re}),data:{exact:m.during,namespaced:m.duringNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(Q){x=Q});x=w})();return H&&H.then?H.then(T):T()})}catch(w){return Promise.reject(w)}var C,U,F})(o,r,e,a,t)).then(function(b){var y=i(b);return s=1,y})})();return Promise.resolve(g&&g.then?g.then(u):u(g))}catch(b){return Promise.reject(b)}}}}}function ey(e){return function(r){return function(t){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===Z.setItem||a===Z.removeItem){if(n.abort)return t(n);a===Z.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var ry=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(r,t){e[t]=e[t].concat(r)},this.removeMiddleware=function(r,t){var n=e[t].findIndex(function(a){return a===r});n!==-1&&(e[t]=[].concat(e[t].slice(0,n),e[t].slice(n+1)))},this.dynamicMiddlewares=function(r){return function(t){return function(n){return function(a){var i={getState:t.getState,dispatch:function(s){return t.dispatch(s)}},o=e[r].map(function(s){return s(i)});return lt.apply(void 0,o)(n)(a)}}}}};function ty(e){return function(r,t){r===void 0&&(r={});var n={};if(t.type==="initialize:aborted")return r;if(/^registerPlugin:([^:]*)$/.test(t.type)){var a=cd(t.type,"registerPlugin"),i=e()[a];if(!i||!a)return r;var o=t.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var u=cd(t.type,Z.initialize),c=e()[u];return c&&u?(n[u]=ee({},r[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),ee({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=ee({},r[t.name],{loaded:!0}),ee({},r,n);switch(t.type){case Z.disablePlugin:return ee({},r,ld(t.plugins,!1,r));case Z.enablePlugin:return ee({},r,ld(t.plugins,!0,r));default:return r}}}function cd(e,r){return e.substring(r.length+1,e.length)}function ld(e,r,t){return e.reduce(function(n,a){return n[a]=ee({},t[a],{enabled:r}),n},t)}function vh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var ny={last:{},history:[]};function ay(e,r){e===void 0&&(e=ny);var t=r.options,n=r.meta;if(r.type===Z.track){var a=vh(ee({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return ee({},e,{last:a,history:e.history.concat(a)})}return e}var iy={actions:[]};function oy(e,r){e===void 0&&(e=iy);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===Z.identify?[r].concat(e.actions):e.actions.concat(r),ee({},e,{actions:n});case"dequeue":return[];default:return e}}var hh=/#.*$/;function sy(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(hh,""):"")}var ph,mh,gh,yh,uy=function(e){if(e===void 0&&(e={}),!_e)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,c=i.search,l=(function(v){var d=(function(){if(_e){for(var h,p=document.getElementsByTagName("link"),S=0;h=p[S];S++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}})();return d?d.match(/\?/)?d:d+v:window.location.href.replace(hh,"")})(c),f={title:t,url:l,path:sy(l),hash:u,search:c,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,e)},cy={last:{},history:[]};function ly(e,r){e===void 0&&(e=cy);var t=r.options;if(r.type===Z.page){var n=vh(ee({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return ee({},e,{last:n,history:e.history.concat(n)})}return e}ph=(function(){if(!_e)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"})(),mh=_e?document.referrer:null,gh=Mg(),yh=Fg();var fd={initialized:!1,sessionId:Cn(),app:null,version:null,debug:!1,offline:!!_e&&!navigator.onLine,os:{name:ph},userAgent:_e?navigator.userAgent:"node",library:{name:Vo,version:"0.13.1"},timezone:yh,locale:gh,campaign:{},referrer:mh};function fy(e,r){e===void 0&&(e=fd);var t=e.initialized,n=r.campaign;switch(r.type){case Z.campaign:return ee({},e,{campaign:n});case Z.offline:return ee({},e,{offline:!0});case Z.online:return ee({},e,{offline:!1});default:return t?e:ee({},fd,e,{initialized:!0})}}var dy=["plugins","reducers","storage"];function vy(e,r,t){if(_e){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function hy(e){var r=vy.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function bh(){return Hr(Vo,[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return ct[ut][Vo].push(o.action||o),i(o)}})}}}function dd(e){return function(){return lt(lt.apply(null,arguments),bh())}}function qo(e){return e?oh(e)?e:[e]:[]}function vd(e,r,t){e===void 0&&(e={});var n,a,i=Cn();return r&&(At[i]=(n=r,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(Be(u[c])){s=u[c];break}return s})(t),function(o){a&&a(o),n(o)})),ee({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function py(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(w,T){if(Be(T))return w.middlewares=w.middlewares.concat(T),w;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var x=T.EVENTS?Object.keys(T.EVENTS).map(function(J){return T.EVENTS[J]}):[];w.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(w.methods[T.name]=Object.keys(T.methods).reduce(function(J,le){var ne;return J[le]=(ne=T.methods[le],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),Re=0;Re<ue.length;Re++)ae[Re]=ue[Re];return ae[ae.length]=y,ne.apply({instance:y},ae)}),J},{}),delete T.methods);var H=Object.keys(T).concat(x),Q=new Set(w.events.concat(H));if(w.events=Array.from(Q),w.pluginsArray=w.pluginsArray.concat(T),w.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return w.plugins[T.name]=T,w.plugins[T.name].loaded||(w.plugins[T.name].loaded=function(){return!0}),w},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:Br,setItem:Hr,removeItem:mt},i=(function(w){return function(T,x,H){return x.getState("user")[T]||(H&&Fe(H)&&H[T]?H[T]:ed(w)[T]||Br(Ko(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(w){return!zo.includes(w)}).sort(),u=new Set(s.concat(Xt).filter(function(w){return!zo.includes(w)})),c=Array.from(u).sort(),l=function(){return o},f=new ry,v=f.addMiddleware,d=f.removeMiddleware,h=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},S=Bg(),R=ed(a),I=ee({},R,t,S.an_uid?{userId:S.an_uid}:{},S.an_aid?{anonymousId:S.an_aid}:{});I.anonymousId||(I.anonymousId=Cn());var g=ee({enable:function(w,T){return new Promise(function(x){m.dispatch({type:Z.enablePlugin,plugins:qo(w),_:{originalAction:Z.enablePlugin}},x,[T])})},disable:function(w,T){return new Promise(function(x){m.dispatch({type:Z.disablePlugin,plugins:qo(w),_:{originalAction:Z.disablePlugin}},x,[T])})}},n.methods),b=!1,y={identify:function(w,T,x,H){try{var Q=Tr(w)?w:null,J=Fe(w)?w:T,le=x||{},ne=y.user();Hr(Ko(Ir),Q);var ue=Q||J.userId||i(Ir,y,J);return Promise.resolve(new Promise(function(ae){m.dispatch(ee({type:Z.identifyStart,userId:ue,traits:J||{},options:le,anonymousId:ne.anonymousId},ne.id&&ne.id!==Q&&{previousId:ne.id}),ae,[T,x,H])}))}catch(ae){return Promise.reject(ae)}},track:function(w,T,x,H){try{var Q=Fe(w)?w.event:w;if(!Q||!Tr(Q))throw new Error("EventMissing");var J=Fe(w)?w:T||{},le=Fe(x)?x:{};return Promise.resolve(new Promise(function(ne){m.dispatch({type:Z.trackStart,event:Q,properties:J,options:le,userId:i(Ir,y,T),anonymousId:i(nt,y,T)},ne,[T,x,H])}))}catch(ne){return Promise.reject(ne)}},page:function(w,T,x){try{var H=Fe(w)?w:{},Q=Fe(T)?T:{};return Promise.resolve(new Promise(function(J){m.dispatch({type:Z.pageStart,properties:uy(H),options:Q,userId:i(Ir,y,H),anonymousId:i(nt,y,H)},J,[w,T,x])}))}catch(J){return Promise.reject(J)}},user:function(w){if(w===Ir||w==="id")return i(Ir,y);if(w===nt||w==="anonId")return i(nt,y);var T=y.getState("user");return w?Kf(T,w):T},reset:function(w){return new Promise(function(T){m.dispatch({type:Z.resetStart},T,w)})},ready:function(w){return b&&w({plugins:g,instance:y}),y.on(Z.ready,function(T){w&&w(T),b=!0})},on:function(w,T){if(!w||!Be(T))return!1;if(w===Z.bootstrap)throw new Error(".on disabled for "+w);var x=/Start$|Start:/;if(w==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(x)&&T({payload:ae,instance:y,plugins:o}),ue(ae)}}},Q=function(ne){return function(ue){return function(ae){return ae.type.match(x)||T({payload:ae,instance:y,plugins:o}),ue(ae)}}};return v(H,zt),v(Q,Kt),function(){d(H,zt),d(Q,Kt)}}var J=w.match(x)?zt:Kt,le=function(ne){return function(ue){return function(ae){return ae.type===w&&T({payload:ae,instance:y,plugins:o,abort:p}),ue(ae)}}};return v(le,J),function(){return d(le,J)}},once:function(w,T){if(!w||!Be(T))return!1;if(w===Z.bootstrap)throw new Error(".once disabled for "+w);var x=y.on(w,function(H){T({payload:H.payload,instance:y,plugins:o,abort:p}),x()});return x},getState:function(w){var T=m.getState();return w?Kf(T,w):Object.assign({},T)},dispatch:function(w){var T=Tr(w)?{type:w}:w;if(Xt.includes(T.type))throw new Error("reserved action "+T.type);var x=ee({},T,{_:ee({originalAction:T.type},w._||{})});m.dispatch(x)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(w,T,x){m.dispatch({type:Z.setItemStart,key:w,value:T,options:x})},removeItem:function(w,T){m.dispatch({type:Z.removeItemStart,key:w,options:T})}},setAnonymousId:function(w,T){y.storage.setItem(Or,w,T)},events:{core:Xt,plugins:s}},A=n.middlewares.concat([function(w){return function(T){return function(x){return x.meta||(x.meta=vd()),T(x)}}},h(zt),Zg(y,l,{all:c,plugins:s}),ey(a),Kg(y),Yg(y),h(Kt)]),q={context:fy,user:Jg(a),page:ly,track:ay,plugins:ty(l),queue:oy},j=lt,G=lt;if(_e&&e.debug){var K=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;K&&(j=K({trace:!0,traceLimit:25})),G=function(){return arguments.length===0?bh():Fe(typeof arguments[0])?dd():dd().apply(null,arguments)}}var re,L=(function(w){return Object.keys(w).reduce(function(T,x){return dy.includes(x)||(T[x]=w[x]),T},{})})(e),M=n.pluginsArray.reduce(function(w,T){var x=T.name,H=T.config,Q=T.loaded,J=n.pluginEnabled[x];return w[x]={enabled:J,initialized:!!J&&!T.initialize,loaded:!!Q({config:H}),config:H},w},{}),N={context:L,user:I,plugins:M},m=ch((function(w){for(var T=Object.keys(w),x={},H=0;H<T.length;H++){var Q=T[H];typeof w[Q]===Pr&&(x[Q]=w[Q])}var J,le=Object.keys(x);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:Wo})===hr||typeof ae(void 0,{type:Wg})===hr)throw new Error(kt+" "+ue+" "+hr)})})(x)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,Re={},xe=0;xe<le.length;xe++){var je=le[xe],$e=ne[je],Qe=(0,x[je])($e,ue);if(typeof Qe===hr){var wr=Vg(je,ue);throw new Error(wr)}Re[je]=Qe,ae=ae||Qe!==$e}return ae?Re:ne}})(ee({},q,r)),N,G(j(zg.apply(void 0,A))));m.dispatch=(re=m.dispatch,function(w,T,x){var H=ee({},w,{meta:vd(w.meta,T,qo(x))});return re.apply(null,[H])});var C=Object.keys(o);m.dispatch({type:Z.bootstrap,plugins:C,config:L,params:S,user:I,initialUser:t,persistedUser:R});var U=C.filter(function(w){return n.pluginEnabled[w]}),F=C.filter(function(w){return!n.pluginEnabled[w]});return m.dispatch({type:Z.registerPlugins,plugins:C,enabled:n.pluginEnabled}),n.pluginsArray.map(function(w,T){var x=w.bootstrap,H=w.config,Q=w.name;x&&Be(x)&&x({instance:y,config:H,payload:w}),m.dispatch({type:Z.registerPluginType(Q),name:Q,enabled:n.pluginEnabled[Q],plugin:w}),n.pluginsArray.length===T+1&&m.dispatch({type:Z.initializeStart,plugins:U,disabled:F})}),hy(function(w){m.dispatch({type:w?Z.offline:Z.online})}),(function(w,T,x){setInterval(function(){return fh(w,T,x)},3e3)})(m,l,y),y}var zt="before",Kt="after",Dr="cookie",Ur=Ih(),wh=_n,my=_n;function Sh(e){return Ur?_n(e,"",-1):mt(e)}function Ih(){if(Ur!==void 0)return Ur;var e=Dr+Dr;try{_n(e,e),Ur=document.cookie.indexOf(e)!==-1,Sh(e)}catch{Ur=!1}return Ur}function _n(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ur===!1&&(o?Hr(e,r):Br(e)),o?document.cookie=e+"="+encodeURIComponent(r)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var pr="localStorage",gy=Os.bind(null,pr);gt(pr,"getItem",Br);gt(pr,"setItem",Hr);gt(pr,"removeItem",mt);var mr="sessionStorage",yy=Os.bind(null,mr);gt(mr,"getItem",Br);gt(mr,"setItem",Hr);gt(mr,"removeItem",mt);function ot(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Fe(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var by=gy(),wy=yy(),Sy=Ih();function Mr(e,r){if(e){var t=Cs(r),n=!qs(t),a=_s(t)?ot(localStorage.getItem(e)):void 0;if(n&&!tt(a))return a;var i=As(t)?ot(wh(e)):void 0;if(n&&i)return i;var o=ks(t)?ot(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=Br(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function sn(e,r,t){if(e&&!tt(r)){var n={},a=Cs(t),i=JSON.stringify(r),o=!qs(a);return _s(a)&&(n[pr]=Jt(pr,r,ot(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[pr]:As(a)&&(n[Dr]=Jt(Dr,r,ot(wh(e))),my(e,i),o)?n[Dr]:ks(a)&&(n[mr]=Jt(mr,r,ot(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[mr]:(n[Nr]=Jt(Nr,r,Br(e)),Hr(e,r),o?n[Nr]:n)}}function Iy(e,r){if(e){var t=Cs(r),n=Mr(e,nh),a={};return!tt(n.localStorage)&&_s(t)&&(localStorage.removeItem(e),a[pr]=n.localStorage),!tt(n.cookie)&&As(t)&&(Sh(e),a[Dr]=n.cookie),!tt(n.sessionStorage)&&ks(t)&&(sessionStorage.removeItem(e),a[mr]=n.sessionStorage),!tt(n.global)&&An(t,Nr)&&(mt(e),a[Nr]=n.global),a}}function Cs(e){return e?Tr(e)?e:e.storage:th}function _s(e){return by&&An(e,pr)}function As(e){return Sy&&An(e,Dr)}function ks(e){return wy&&An(e,mr)}function qs(e){return e===nh||e==="all"}function An(e,r){return e===th||e===r||qs(e)}function Jt(e,r,t){return{location:e,current:r,previous:t}}var Py={setItem:sn,getItem:Mr,removeItem:Iy};function Ey(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function hd(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function pd(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?hd(Object(t),!0).forEach(function(n){Ey(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):hd(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ry(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:Py};return py(pd(pd({},r),e))}function Ty(e){if(typeof window>"u")return;const{addEventListener:r,history:t,location:n}=window;let a=n.pathname;r("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=t[o];t[o]=function(...u){const c=u[2]?.toString()||"",l=Cy(c);return a!==l&&(a=l,setTimeout(()=>e(c),0)),s.apply(t,u)}})}function Oy(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function Cy(e){return["#","?"].forEach(r=>e=Oy(e,r)),e}function _y(){Ty(()=>{lr.page()})}var $o="up",Uo="down";function Ay(e){if(e===void 0&&(e={}),!_e)return Go;var r=gd(),t=Jo(),n=md(),a=Yt(n,r),i=Yt(t,r),o=[],s=[],u=[],c=n,l=a,f=i,v=Object.keys(e);if(!v.length)return Go;var d=v.map(function(p){return Number(p)}),h=Gg(function(){var p=gd(),S=(function(L,M){return M.map(function(N){return N===100?L-5:L*(N/100)})})(p,d),R=Jo(),I=md(),g=Yt(I,p),b=Yt(R,p);if(l=g>l?g:l,f=b<f?b:f,!(o.length>=d.length)){var y=c===I,A=$o;y?A="initial":c<=I&&(A=Uo);var q=S,j=d;(A===$o||y)&&(q=S.slice().reverse(),j=d.slice().reverse());var G=j.reduce(function(L,M,N){var m=q[N];return u.includes(M)&&I<=m&&(u=u.filter(function(C){return C!==M}),L.singleFunction=M),A===Uo&&!o.includes(M)&&I>=m&&M>i?(s.push(M),L.callbacks=L.callbacks.concat(M),L):A===$o&&!o.includes(M)&&I<=m&&M<=g?(L.foundFunc=[M],L):(y&&I>=m&&L.foundFunc.length===0&&(L.foundFunc=[M]),!s.includes(M)&&I>=m&&(s.push(M),L.singleFunction?u.push(M):L.singleFunction=M),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(c=I,A===Uo&&G.callbacks&&G.callbacks.forEach(function(L){Be(e[L])&&(e[L]({trigger:L,direction:A,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(L))}),G.singleFunction){var K=G.singleFunction,re=G.direction;Be(e[K])&&e[K]({trigger:K,direction:re,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(K)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function Jo(){return _e?document.body.scrollTop||document.documentElement.scrollTop:0}function ky(){return _e?window.innerHeight||document.documentElement.clientHeight:0}function md(){return Math.round(Jo()+ky())}function gd(){if(!_e)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Yt(e,r){return Math.round(e/r*100)}var $s="Event",yd=$s+"Listener";function qy(e){return function(r,t,n,a){var i=n||Go,o=a||!1;if(!_e)return i;var s=un(t),u=un(r,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+$s);var c=[];return(function l(f){f&&(c=[]);for(var v=f?"add"+yd:"remove"+yd,d=0;d<u.length;d++){var h=u[d];c[d]=f?o&&o.once?$y(i):i:c[d]||i;for(var p=0;p<s.length;p++)h[v]?h["on"+s[p]]=f?c[d]:null:h[v](s[p],c[d],o)}return l.bind(null,!f)})(e)}}function un(e,r){if(Tr(e))return r?un(document.querySelectorAll(e)):(t=e).split(t.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var t;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=Dg(e);return r?i.map(function(o){return Tr(o)?un(o,!0):o}).flat():i}function $y(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var Lo=qy($s);function Ph(e,r){return _e&&Be(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Be(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}Ph.bind(null,"onerror");Ph.bind(null,"onload");var Eh=typeof window>"u",bd="hidden";function Uy(e){if(Eh)return!1;var r=Ly(),t="".concat(r.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[r])},a=function(){return document.addEventListener(t,n)};return a(),function(){return document.removeEventListener(t,n),a}}function Ly(){var e=["webkit","moz","ms","o"];return Eh||bd in document?bd:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var xy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ny(e,r){r===void 0&&(r={});var t=(function(o,s){var u=this,c=!1;return function(l){c||(o.call(u,l),c=!0,setTimeout(function(){return c=!1},s))}})(e,r.throttle||1e4),n=[];function a(){var o=Uy(function(s){s||t({type:"tabVisible"})});return n=[o].concat(xy.map(function(s){return Lo(document,s,t)})).concat(Lo(window,"load",t)).concat(Lo(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function jy(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,u=e.throttle,c=u===void 0?2e3:u,l=!1,f=!1,v=new Date,d=function(){return clearTimeout(r)};function h(S){d(),i&&!l&&i(Pt(v),S),a&&l&&(l=!1,a(Pt(t),S),v=new Date),r=setTimeout(function(){l=!0,n&&(t=new Date,n(Pt(v),S))},s)}var p=Ny(h,{throttle:c});return{disable:function(){f=!0,l=!1,d();var S=p();return function(){return f=!1,v=new Date,h({type:"load"}),S()}},getStatus:function(){return{isIdle:l,isDisabled:f,active:l?0:Pt(v,f),idle:l?Pt(t,f):0}}}}function Pt(e,r){return r?0:Math.round((new Date-e)/1e3)}const wd=5e3;class Dy{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(r){this.element=r.element,this.viewCallback=r.viewCallback,this.activeDurationCallback=r.activeDurationCallback,this.idleDurationCallback=r.idleDurationCallback,this.scrollCallback=r.scrollCallback,this.observer=new IntersectionObserver(t=>{t.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),jy({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:wd}),Ay({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(r){r?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=r}handleAwake(r,t=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=r,this.lastEventAt=r?Date.now()-t*wd:Date.now(),this.isInViewport&&this.trackAwake(r,t)}handleScroll(r){this.scrollCallback&&this.scrollCallback(r)}handleVisibilityChange(){this.isAwake=!1;const r=Math.round((Date.now()-this.lastEventAt)/1e3);r>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,r))}trackAwake(r,t){!r&&this.activeDurationCallback&&this.activeDurationCallback(t,this.isFlushing,this.lastEventAt),r&&this.idleDurationCallback&&this.idleDurationCallback(t,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Rh(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function My(e,r){r=r||{};var t,n,a=[],i=r.max||1/0;function o(){clearInterval(t),e(a.splice(0,i)),s()}function s(){t=setInterval(o,r.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(t)}}}const Sd="sesamy_session_id";function Fy(){let e=sessionStorage.getItem(Sd);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Sd,e)),e}let Th=!1,Zt,cn,Yo;function Oh(e){return JSON.stringify(e.map(r=>{const{campaign:t,...n}=r.properties||{};return{anonymousId:r.anonymousId,userId:r.userId,type:r.type,properties:n,clientId:Yo,requestId:Math.random().toString(36).slice(2,9),sessionId:Fy(),timestamp:new Date().toISOString(),version:Ft,event:r.event,context:{...r.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:ge("sesamy:item-src"),publisherContentId:ge("sesamy:publisher-content-id")},campaign:t,locale:navigator.language,library:Es,userAgent:navigator.userAgent,clientId:Yo}}}))}const Ch=My(async e=>{if(e.length>0){const r=Oh(e);Th?navigator.sendBeacon(cn,r):(await fetch(cn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function xo(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(cn,Oh([r]))}else Ch.push(e)}function By(){return Th=!0,Ch.flush()}function Hy(e,r,t){Zt=r,cn=`${ir("logs",t)}/events`,Yo=e}const Gy={name:"custom-analytics-plugin",page:({payload:e})=>{if(!Zt)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;xo({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{if(!Zt)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;xo({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{if(!Zt)return;const{properties:r,anonymousId:t,userId:n}=e;xo({anonymousId:t,userId:n,properties:r,type:"identify"})}},Id=["source","medium","campaign","term","content"],Er="utm_",Wy=1800*1e3;function _h(e){return e?Date.now()-parseInt(e,10)>Wy:!0}function Pd(){const e=document.referrer||"";if(!e)return;const r=Mr(`${Er}set_at`);(_h(r)||!Mr(`${Er}referrer`))&&sn(`${Er}referrer`,e)}function Vy(){const e=()=>{const t={};for(const a of Id){const i=Mr(`${Er}${a}`);i&&(t[`utm_${a}`]=i)}const n=Mr(`${Er}referrer`);return n&&(t.utm_referrer=n),t};return{name:"attribution-tracking",initialize(){Pd()},campaign({payload:t}){const n=t?.campaign||{},a=Mr(`${Er}set_at`);if(Object.keys(n).length>0&&_h(a)){for(const o of Id){const s=n[o];s&&sn(`${Er}${o}`,s)}sn(`${Er}set_at`,String(Date.now()))}Pd()},page({payload:t}){return t.properties.campaign=e(),t},track({payload:t}){return t.properties.campaign=e(),t},getStoredCampaignData:e}}const zy=Vy(),Ed=new Map,Rd=new Map;function Ky({clientId:e,enabled:r=!0,environment:t}){Hy(e,r,t),r&&(window.addEventListener("beforeunload",()=>{Rd.forEach((n,a)=>{n.bind(a)()}),By()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Ed.forEach((n,a)=>{n.bind(a)()})}),_y(),Rh(()=>{const n=new Dy({element:document.body,viewCallback:()=>{lr.page()},activeDurationCallback:(a,i,o)=>{lr.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{lr.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{lr.track("scroll",{scroll:a.scrollMax})}});Rd.set(document.body,()=>{n.flush()}),Ed.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(er.AUTHENTICATED,async n=>{const a=n;await lr.identify(a.detail.sub)}),window.addEventListener(er.LOGOUT,async()=>{await lr.track("logout",{}),await lr.reset()}))}const lr=Ry({app:Es,version:Ft,plugins:[zy,Gy]});function Ah(e,r){lr.track(e,r)}const Jy=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function kh(){return new Promise(e=>{const r=Jy.map(t=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=t,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const t=!r.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);r.forEach(n=>n.remove()),e(t)},100)})}function qh(){const e=navigator.userAgent.toLowerCase(),r=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const t of r)if(t.regex.test(e))return{isInAppBrowser:!0,browserName:t.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Hs={},Nn,Gs;function Ae(){return Gs||(Gs=1,Nn=function(e){try{return!!e()}catch{return!0}}),Nn}var jn,Ws;function dn(){if(Ws)return jn;Ws=1;var e=Ae();return jn=!e(function(){var r=(function(){}).bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),jn}var Dn,Vs;function pe(){if(Vs)return Dn;Vs=1;var e=dn(),r=Function.prototype,t=r.call,n=e&&r.bind.bind(t,t);return Dn=e?n:function(a){return function(){return t.apply(a,arguments)}},Dn}var Mn,zs;function vn(){if(zs)return Mn;zs=1;var e=pe(),r=e({}.toString),t=e("".slice);return Mn=function(n){return t(r(n),8,-1)},Mn}var Fn,Ks;function Md(){if(Ks)return Fn;Ks=1;var e=pe(),r=Ae(),t=vn(),n=Object,a=e("".split);return Fn=r(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return t(i)==="String"?a(i,""):n(i)}:n,Fn}var Bn,Js;function hn(){return Js||(Js=1,Bn=function(e){return e==null}),Bn}var Hn,Ys;function pn(){if(Ys)return Hn;Ys=1;var e=hn(),r=TypeError;return Hn=function(t){if(e(t))throw new r("Can't call method on "+t);return t},Hn}var Gn,Qs;function Ut(){if(Qs)return Gn;Qs=1;var e=Md(),r=pn();return Gn=function(t){return e(r(t))},Gn}var wt,Xs;function me(){if(Xs)return wt;Xs=1;var e=function(r){return r&&r.Math===Math&&r};return wt=e(typeof globalThis=="object"&&globalThis)||e(typeof window=="object"&&window)||e(typeof self=="object"&&self)||e(typeof Bs=="object"&&Bs)||e(typeof wt=="object"&&wt)||(function(){return this})()||Function("return this")(),wt}var Wn={exports:{}},Vn,Zs;function sr(){return Zs||(Zs=1,Vn=!1),Vn}var zn,eu;function as(){if(eu)return zn;eu=1;var e=me(),r=Object.defineProperty;return zn=function(t,n){try{r(e,t,{value:n,configurable:!0,writable:!0})}catch{e[t]=n}return n},zn}var ru;function is(){if(ru)return Wn.exports;ru=1;var e=sr(),r=me(),t=as(),n="__core-js_shared__",a=Wn.exports=r[n]||t(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:e?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),Wn.exports}var Kn,tu;function Fd(){if(tu)return Kn;tu=1;var e=is();return Kn=function(r,t){return e[r]||(e[r]=t||{})},Kn}var Jn,nu;function mn(){if(nu)return Jn;nu=1;var e=pn(),r=Object;return Jn=function(t){return r(e(t))},Jn}var Yn,au;function ze(){if(au)return Yn;au=1;var e=pe(),r=mn(),t=e({}.hasOwnProperty);return Yn=Object.hasOwn||function(a,i){return t(r(a),i)},Yn}var Qn,iu;function Bd(){if(iu)return Qn;iu=1;var e=pe(),r=0,t=Math.random(),n=e(1.1.toString);return Qn=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++r+t,36)},Qn}var Xn,ou;function Lt(){if(ou)return Xn;ou=1;var e=me(),r=e.navigator,t=r&&r.userAgent;return Xn=t?String(t):"",Xn}var Zn,su;function Hd(){if(su)return Zn;su=1;var e=me(),r=Lt(),t=e.process,n=e.Deno,a=t&&t.versions||n&&n.version,i=a&&a.v8,o,s;return i&&(o=i.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&r&&(o=r.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=r.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),Zn=s,Zn}var ea,uu;function Gd(){if(uu)return ea;uu=1;var e=Hd(),r=Ae(),t=me(),n=t.String;return ea=!!Object.getOwnPropertySymbols&&!r(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&e&&e<41}),ea}var ra,cu;function Wd(){if(cu)return ra;cu=1;var e=Gd();return ra=e&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ra}var ta,lu;function ke(){if(lu)return ta;lu=1;var e=me(),r=Fd(),t=ze(),n=Bd(),a=Gd(),i=Wd(),o=e.Symbol,s=r("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return ta=function(c){return t(s,c)||(s[c]=a&&t(o,c)?o[c]:u("Symbol."+c)),s[c]},ta}var na,fu;function we(){if(fu)return na;fu=1;var e=typeof document=="object"&&document.all;return na=typeof e>"u"&&e!==void 0?function(r){return typeof r=="function"||r===e}:function(r){return typeof r=="function"},na}var aa,du;function Ke(){if(du)return aa;du=1;var e=we();return aa=function(r){return typeof r=="object"?r!==null:e(r)},aa}var ia,vu;function rr(){if(vu)return ia;vu=1;var e=Ke(),r=String,t=TypeError;return ia=function(n){if(e(n))return n;throw new t(r(n)+" is not an object")},ia}var oa={},sa,hu;function qe(){if(hu)return sa;hu=1;var e=Ae();return sa=!e(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),sa}var ua,pu;function Vd(){if(pu)return ua;pu=1;var e=qe(),r=Ae();return ua=e&&r(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ua}var ca={},la,mu;function gn(){if(mu)return la;mu=1;var e=me(),r=Ke(),t=e.document,n=r(t)&&r(t.createElement);return la=function(a){return n?t.createElement(a):{}},la}var fa,gu;function zd(){if(gu)return fa;gu=1;var e=qe(),r=Ae(),t=gn();return fa=!e&&!r(function(){return Object.defineProperty(t("div"),"a",{get:function(){return 7}}).a!==7}),fa}var da,yu;function Le(){if(yu)return da;yu=1;var e=dn(),r=Function.prototype.call;return da=e?r.bind(r):function(){return r.apply(r,arguments)},da}var va,bu;function Je(){if(bu)return va;bu=1;var e=me(),r=we(),t=function(n){return r(n)?n:void 0};return va=function(n,a){return arguments.length<2?t(e[n]):e[n]&&e[n][a]},va}var ha,wu;function yn(){if(wu)return ha;wu=1;var e=pe();return ha=e({}.isPrototypeOf),ha}var pa,Su;function Kd(){if(Su)return pa;Su=1;var e=Je(),r=we(),t=yn(),n=Wd(),a=Object;return pa=n?function(i){return typeof i=="symbol"}:function(i){var o=e("Symbol");return r(o)&&t(o.prototype,a(i))},pa}var ma,Iu;function bn(){if(Iu)return ma;Iu=1;var e=String;return ma=function(r){try{return e(r)}catch{return"Object"}},ma}var ga,Pu;function tr(){if(Pu)return ga;Pu=1;var e=we(),r=bn(),t=TypeError;return ga=function(n){if(e(n))return n;throw new t(r(n)+" is not a function")},ga}var ya,Eu;function os(){if(Eu)return ya;Eu=1;var e=tr(),r=hn();return ya=function(t,n){var a=t[n];return r(a)?void 0:e(a)},ya}var ba,Ru;function Fh(){if(Ru)return ba;Ru=1;var e=Le(),r=we(),t=Ke(),n=TypeError;return ba=function(a,i){var o,s;if(i==="string"&&r(o=a.toString)&&!t(s=e(o,a))||r(o=a.valueOf)&&!t(s=e(o,a))||i!=="string"&&r(o=a.toString)&&!t(s=e(o,a)))return s;throw new n("Can't convert object to primitive value")},ba}var wa,Tu;function Bh(){if(Tu)return wa;Tu=1;var e=Le(),r=Ke(),t=Kd(),n=os(),a=Fh(),i=ke(),o=TypeError,s=i("toPrimitive");return wa=function(u,c){if(!r(u)||t(u))return u;var l=n(u,s),f;if(l){if(c===void 0&&(c="default"),f=e(l,u,c),!r(f)||t(f))return f;throw new o("Can't convert object to primitive value")}return c===void 0&&(c="number"),a(u,c)},wa}var Sa,Ou;function Jd(){if(Ou)return Sa;Ou=1;var e=Bh(),r=Kd();return Sa=function(t){var n=e(t,"string");return r(n)?n:n+""},Sa}var Cu;function gr(){if(Cu)return ca;Cu=1;var e=qe(),r=zd(),t=Vd(),n=rr(),a=Jd(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",c="configurable",l="writable";return ca.f=e?t?function(v,d,h){if(n(v),d=a(d),n(h),typeof v=="function"&&d==="prototype"&&"value"in h&&l in h&&!h[l]){var p=s(v,d);p&&p[l]&&(v[d]=h.value,h={configurable:c in h?h[c]:p[c],enumerable:u in h?h[u]:p[u],writable:!1})}return o(v,d,h)}:o:function(v,d,h){if(n(v),d=a(d),n(h),r)try{return o(v,d,h)}catch{}if("get"in h||"set"in h)throw new i("Accessors not supported");return"value"in h&&(v[d]=h.value),v},ca}var Ia,_u;function Hh(){if(_u)return Ia;_u=1;var e=Math.ceil,r=Math.floor;return Ia=Math.trunc||function(n){var a=+n;return(a>0?r:e)(a)},Ia}var Pa,Au;function ss(){if(Au)return Pa;Au=1;var e=Hh();return Pa=function(r){var t=+r;return t!==t||t===0?0:e(t)},Pa}var Ea,ku;function Yd(){if(ku)return Ea;ku=1;var e=ss(),r=Math.max,t=Math.min;return Ea=function(n,a){var i=e(n);return i<0?r(i+a,0):t(i,a)},Ea}var Ra,qu;function Gh(){if(qu)return Ra;qu=1;var e=ss(),r=Math.min;return Ra=function(t){var n=e(t);return n>0?r(n,9007199254740991):0},Ra}var Ta,$u;function us(){if($u)return Ta;$u=1;var e=Gh();return Ta=function(r){return e(r.length)},Ta}var Oa,Uu;function Wh(){if(Uu)return Oa;Uu=1;var e=Ut(),r=Yd(),t=us(),n=function(a){return function(i,o,s){var u=e(i),c=t(u);if(c===0)return!a&&-1;var l=r(s,c),f;if(a&&o!==o){for(;c>l;)if(f=u[l++],f!==f)return!0}else for(;c>l;l++)if((a||l in u)&&u[l]===o)return a||l||0;return!a&&-1}};return Oa={includes:n(!0),indexOf:n(!1)},Oa}var Ca,Lu;function cs(){return Lu||(Lu=1,Ca={}),Ca}var _a,xu;function Qd(){if(xu)return _a;xu=1;var e=pe(),r=ze(),t=Ut(),n=Wh().indexOf,a=cs(),i=e([].push);return _a=function(o,s){var u=t(o),c=0,l=[],f;for(f in u)!r(a,f)&&r(u,f)&&i(l,f);for(;s.length>c;)r(u,f=s[c++])&&(~n(l,f)||i(l,f));return l},_a}var Aa,Nu;function ls(){return Nu||(Nu=1,Aa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Aa}var ka,ju;function Xd(){if(ju)return ka;ju=1;var e=Qd(),r=ls();return ka=Object.keys||function(n){return e(n,r)},ka}var Du;function Vh(){if(Du)return oa;Du=1;var e=qe(),r=Vd(),t=gr(),n=rr(),a=Ut(),i=Xd();return oa.f=e&&!r?Object.defineProperties:function(s,u){n(s);for(var c=a(u),l=i(u),f=l.length,v=0,d;f>v;)t.f(s,d=l[v++],c[d]);return s},oa}var qa,Mu;function Zd(){if(Mu)return qa;Mu=1;var e=Je();return qa=e("document","documentElement"),qa}var $a,Fu;function fs(){if(Fu)return $a;Fu=1;var e=Fd(),r=Bd(),t=e("keys");return $a=function(n){return t[n]||(t[n]=r(n))},$a}var Ua,Bu;function xt(){if(Bu)return Ua;Bu=1;var e=rr(),r=Vh(),t=ls(),n=cs(),a=Zd(),i=gn(),o=fs(),s=">",u="<",c="prototype",l="script",f=o("IE_PROTO"),v=function(){},d=function(I){return u+l+s+I+u+"/"+l+s},h=function(I){I.write(d("")),I.close();var g=I.parentWindow.Object;return I=null,g},p=function(){var I=i("iframe"),g="java"+l+":",b;return I.style.display="none",a.appendChild(I),I.src=String(g),b=I.contentWindow.document,b.open(),b.write(d("document.F=Object")),b.close(),b.F},S,R=function(){try{S=new ActiveXObject("htmlfile")}catch{}R=typeof document<"u"?document.domain&&S?h(S):p():h(S);for(var I=t.length;I--;)delete R[c][t[I]];return R()};return n[f]=!0,Ua=Object.create||function(g,b){var y;return g!==null?(v[c]=e(g),y=new v,v[c]=null,y[f]=g):y=R(),b===void 0?y:r.f(y,b)},Ua}var La,Hu;function zh(){if(Hu)return La;Hu=1;var e=ke(),r=xt(),t=gr().f,n=e("unscopables"),a=Array.prototype;return a[n]===void 0&&t(a,n,{configurable:!0,value:r(null)}),La=function(i){a[n][i]=!0},La}var xa,Gu;function Nt(){return Gu||(Gu=1,xa={}),xa}var Na,Wu;function Kh(){if(Wu)return Na;Wu=1;var e=me(),r=we(),t=e.WeakMap;return Na=r(t)&&/native code/.test(String(t)),Na}var ja,Vu;function Gr(){return Vu||(Vu=1,ja=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}}),ja}var Da,zu;function Wr(){if(zu)return Da;zu=1;var e=qe(),r=gr(),t=Gr();return Da=e?function(n,a,i){return r.f(n,a,t(1,i))}:function(n,a,i){return n[a]=i,n},Da}var Ma,Ku;function ft(){if(Ku)return Ma;Ku=1;var e=Kh(),r=me(),t=Ke(),n=Wr(),a=ze(),i=is(),o=fs(),s=cs(),u="Object already initialized",c=r.TypeError,l=r.WeakMap,f,v,d,h=function(I){return d(I)?v(I):f(I,{})},p=function(I){return function(g){var b;if(!t(g)||(b=v(g)).type!==I)throw new c("Incompatible receiver, "+I+" required");return b}};if(e||i.state){var S=i.state||(i.state=new l);S.get=S.get,S.has=S.has,S.set=S.set,f=function(I,g){if(S.has(I))throw new c(u);return g.facade=I,S.set(I,g),g},v=function(I){return S.get(I)||{}},d=function(I){return S.has(I)}}else{var R=o("state");s[R]=!0,f=function(I,g){if(a(I,R))throw new c(u);return g.facade=I,n(I,R,g),g},v=function(I){return a(I,R)?I[R]:{}},d=function(I){return a(I,R)}}return Ma={set:f,get:v,has:d,enforce:h,getterFor:p},Ma}var Fa={},Ba={},Ju;function ev(){if(Ju)return Ba;Ju=1;var e={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,t=r&&!e.call({1:2},1);return Ba.f=t?function(a){var i=r(this,a);return!!i&&i.enumerable}:e,Ba}var Yu;function rv(){if(Yu)return Fa;Yu=1;var e=qe(),r=Le(),t=ev(),n=Gr(),a=Ut(),i=Jd(),o=ze(),s=zd(),u=Object.getOwnPropertyDescriptor;return Fa.f=e?u:function(l,f){if(l=a(l),f=i(f),s)try{return u(l,f)}catch{}if(o(l,f))return n(!r(t.f,l,f),l[f])},Fa}var Ha={exports:{}},Ga,Qu;function tv(){if(Qu)return Ga;Qu=1;var e=qe(),r=ze(),t=Function.prototype,n=e&&Object.getOwnPropertyDescriptor,a=r(t,"name"),i=a&&(function(){}).name==="something",o=a&&(!e||e&&n(t,"name").configurable);return Ga={EXISTS:a,PROPER:i,CONFIGURABLE:o},Ga}var Wa,Xu;function ds(){if(Xu)return Wa;Xu=1;var e=pe(),r=we(),t=is(),n=e(Function.toString);return r(t.inspectSource)||(t.inspectSource=function(a){return n(a)}),Wa=t.inspectSource,Wa}var Zu;function nv(){if(Zu)return Ha.exports;Zu=1;var e=pe(),r=Ae(),t=we(),n=ze(),a=qe(),i=tv().CONFIGURABLE,o=ds(),s=ft(),u=s.enforce,c=s.get,l=String,f=Object.defineProperty,v=e("".slice),d=e("".replace),h=e([].join),p=a&&!r(function(){return f(function(){},"length",{value:8}).length!==8}),S=String(String).split("String"),R=Ha.exports=function(I,g,b){v(l(g),0,7)==="Symbol("&&(g="["+d(l(g),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),b&&b.getter&&(g="get "+g),b&&b.setter&&(g="set "+g),(!n(I,"name")||i&&I.name!==g)&&(a?f(I,"name",{value:g,configurable:!0}):I.name=g),p&&b&&n(b,"arity")&&I.length!==b.arity&&f(I,"length",{value:b.arity});try{b&&n(b,"constructor")&&b.constructor?a&&f(I,"prototype",{writable:!1}):I.prototype&&(I.prototype=void 0)}catch{}var y=u(I);return n(y,"source")||(y.source=h(S,typeof g=="string"?g:"")),I};return Function.prototype.toString=R(function(){return t(this)&&c(this).source||o(this)},"toString"),Ha.exports}var Va,ec;function Ye(){if(ec)return Va;ec=1;var e=we(),r=gr(),t=nv(),n=as();return Va=function(a,i,o,s){s||(s={});var u=s.enumerable,c=s.name!==void 0?s.name:i;if(e(o)&&t(o,c,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:r.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},Va}var za={},rc;function Jh(){if(rc)return za;rc=1;var e=Qd(),r=ls(),t=r.concat("length","prototype");return za.f=Object.getOwnPropertyNames||function(a){return e(a,t)},za}var Ka={},tc;function av(){return tc||(tc=1,Ka.f=Object.getOwnPropertySymbols),Ka}var Ja,nc;function Yh(){if(nc)return Ja;nc=1;var e=Je(),r=pe(),t=Jh(),n=av(),a=rr(),i=r([].concat);return Ja=e("Reflect","ownKeys")||function(s){var u=t.f(a(s)),c=n.f;return c?i(u,c(s)):u},Ja}var Ya,ac;function iv(){if(ac)return Ya;ac=1;var e=ze(),r=Yh(),t=rv(),n=gr();return Ya=function(a,i,o){for(var s=r(i),u=n.f,c=t.f,l=0;l<s.length;l++){var f=s[l];!e(a,f)&&!(o&&e(o,f))&&u(a,f,c(i,f))}},Ya}var Qa,ic;function ov(){if(ic)return Qa;ic=1;var e=Ae(),r=we(),t=/#|\.prototype\./,n=function(u,c){var l=i[a(u)];return l===s?!0:l===o?!1:r(c)?e(c):!!c},a=n.normalize=function(u){return String(u).replace(t,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return Qa=n,Qa}var Xa,oc;function Pe(){if(oc)return Xa;oc=1;var e=me(),r=rv().f,t=Wr(),n=Ye(),a=as(),i=iv(),o=ov();return Xa=function(s,u){var c=s.target,l=s.global,f=s.stat,v,d,h,p,S,R;if(l?d=e:f?d=e[c]||a(c,{}):d=e[c]&&e[c].prototype,d)for(h in u){if(S=u[h],s.dontCallGetSet?(R=r(d,h),p=R&&R.value):p=d[h],v=o(l?h:c+(f?".":"#")+h,s.forced),!v&&p!==void 0){if(typeof S==typeof p)continue;i(S,p)}(s.sham||p&&p.sham)&&t(S,"sham",!0),n(d,h,S,s)}},Xa}var Za,sc;function Qh(){if(sc)return Za;sc=1;var e=Ae();return Za=!e(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Za}var ei,uc;function vs(){if(uc)return ei;uc=1;var e=ze(),r=we(),t=mn(),n=fs(),a=Qh(),i=n("IE_PROTO"),o=Object,s=o.prototype;return ei=a?o.getPrototypeOf:function(u){var c=t(u);if(e(c,i))return c[i];var l=c.constructor;return r(l)&&c instanceof l?l.prototype:c instanceof o?s:null},ei}var ri,cc;function sv(){if(cc)return ri;cc=1;var e=Ae(),r=we(),t=Ke(),n=xt(),a=vs(),i=Ye(),o=ke(),s=sr(),u=o("iterator"),c=!1,l,f,v;[].keys&&(v=[].keys(),"next"in v?(f=a(a(v)),f!==Object.prototype&&(l=f)):c=!0);var d=!t(l)||e(function(){var h={};return l[u].call(h)!==h});return d?l={}:s&&(l=n(l)),r(l[u])||i(l,u,function(){return this}),ri={IteratorPrototype:l,BUGGY_SAFARI_ITERATORS:c},ri}var ti,lc;function dt(){if(lc)return ti;lc=1;var e=gr().f,r=ze(),t=ke(),n=t("toStringTag");return ti=function(a,i,o){a&&!o&&(a=a.prototype),a&&!r(a,n)&&e(a,n,{configurable:!0,value:i})},ti}var ni,fc;function uv(){if(fc)return ni;fc=1;var e=sv().IteratorPrototype,r=xt(),t=Gr(),n=dt(),a=Nt(),i=function(){return this};return ni=function(o,s,u,c){var l=s+" Iterator";return o.prototype=r(e,{next:t(+!c,u)}),n(o,l,!1,!0),a[l]=i,o},ni}var ai,dc;function Xh(){if(dc)return ai;dc=1;var e=pe(),r=tr();return ai=function(t,n,a){try{return e(r(Object.getOwnPropertyDescriptor(t,n)[a]))}catch{}},ai}var ii,vc;function Zh(){if(vc)return ii;vc=1;var e=Ke();return ii=function(r){return e(r)||r===null},ii}var oi,hc;function ep(){if(hc)return oi;hc=1;var e=Zh(),r=String,t=TypeError;return oi=function(n){if(e(n))return n;throw new t("Can't set "+r(n)+" as a prototype")},oi}var si,pc;function hs(){if(pc)return si;pc=1;var e=Xh(),r=Ke(),t=pn(),n=ep();return si=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=e(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,c){return t(u),n(c),r(u)&&(a?o(u,c):u.__proto__=c),u}})():void 0),si}var ui,mc;function cv(){if(mc)return ui;mc=1;var e=Pe(),r=Le(),t=sr(),n=tv(),a=we(),i=uv(),o=vs(),s=hs(),u=dt(),c=Wr(),l=Ye(),f=ke(),v=Nt(),d=sv(),h=n.PROPER,p=n.CONFIGURABLE,S=d.IteratorPrototype,R=d.BUGGY_SAFARI_ITERATORS,I=f("iterator"),g="keys",b="values",y="entries",A=function(){return this};return ui=function(q,j,G,K,re,L,M){i(G,j,K);var N=function(J){if(J===re&&w)return w;if(!R&&J&&J in U)return U[J];switch(J){case g:return function(){return new G(this,J)};case b:return function(){return new G(this,J)};case y:return function(){return new G(this,J)}}return function(){return new G(this)}},m=j+" Iterator",C=!1,U=q.prototype,F=U[I]||U["@@iterator"]||re&&U[re],w=!R&&F||N(re),T=j==="Array"&&U.entries||F,x,H,Q;if(T&&(x=o(T.call(new q)),x!==Object.prototype&&x.next&&(!t&&o(x)!==S&&(s?s(x,S):a(x[I])||l(x,I,A)),u(x,m,!0,!0),t&&(v[m]=A))),h&&re===b&&F&&F.name!==b&&(!t&&p?c(U,"name",b):(C=!0,w=function(){return r(F,this)})),re)if(H={values:N(b),keys:L?w:N(g),entries:N(y)},M)for(Q in H)(R||C||!(Q in U))&&l(U,Q,H[Q]);else e({target:j,proto:!0,forced:R||C},H);return(!t||M)&&U[I]!==w&&l(U,I,w,{name:re}),v[j]=w,H},ui}var ci,gc;function ps(){return gc||(gc=1,ci=function(e,r){return{value:e,done:r}}),ci}var li,yc;function ms(){if(yc)return li;yc=1;var e=Ut(),r=zh(),t=Nt(),n=ft(),a=gr().f,i=cv(),o=ps(),s=sr(),u=qe(),c="Array Iterator",l=n.set,f=n.getterFor(c);li=i(Array,"Array",function(d,h){l(this,{type:c,target:e(d),index:0,kind:h})},function(){var d=f(this),h=d.target,p=d.index++;if(!h||p>=h.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(h[p],!1)}return o([p,h[p]],!1)},"values");var v=t.Arguments=t.Array;if(r("keys"),r("values"),r("entries"),!s&&u&&v.name!=="values")try{a(v,"name",{value:"values"})}catch{}return li}var bc={},wc;function rp(){if(wc)return bc;wc=1;var e=Pe(),r=pe(),t=Yd(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=r([].join),s=!!i&&i.length!==1;return e({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(c){for(var l=[],f=arguments.length,v=0,d;f>v;){if(d=+arguments[v++],t(d,1114111)!==d)throw new n(d+" is not a valid code point");l[v]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(l,"")}}),bc}var fi,Sc;function lv(){if(Sc)return fi;Sc=1;var e=me(),r=qe(),t=Object.getOwnPropertyDescriptor;return fi=function(n){if(!r)return e[n];var a=t(e,n);return a&&a.value},fi}var di,Ic;function wn(){if(Ic)return di;Ic=1;var e=Ae(),r=ke(),t=qe(),n=sr(),a=r("iterator");return di=!e(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(c,l){o.delete("b"),u+=l+c}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!t)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),di}var vi,Pc;function Sn(){if(Pc)return vi;Pc=1;var e=nv(),r=gr();return vi=function(t,n,a){return a.get&&e(a.get,n,{getter:!0}),a.set&&e(a.set,n,{setter:!0}),r.f(t,n,a)},vi}var hi,Ec;function tp(){if(Ec)return hi;Ec=1;var e=Ye();return hi=function(r,t,n){for(var a in t)e(r,a,t[a],n);return r},hi}var pi,Rc;function gs(){if(Rc)return pi;Rc=1;var e=yn(),r=TypeError;return pi=function(t,n){if(e(n,t))return t;throw new r("Incorrect invocation")},pi}var mi,Tc;function np(){if(Tc)return mi;Tc=1;var e=vn(),r=pe();return mi=function(t){if(e(t)==="Function")return r(t)},mi}var gi,Oc;function vt(){if(Oc)return gi;Oc=1;var e=np(),r=tr(),t=dn(),n=e(e.bind);return gi=function(a,i){return r(a),i===void 0?a:t?n(a,i):function(){return a.apply(i,arguments)}},gi}var yi,Cc;function ys(){if(Cc)return yi;Cc=1;var e=ke(),r=e("toStringTag"),t={};return t[r]="z",yi=String(t)==="[object z]",yi}var bi,_c;function jt(){if(_c)return bi;_c=1;var e=ys(),r=we(),t=vn(),n=ke(),a=n("toStringTag"),i=Object,o=t((function(){return arguments})())==="Arguments",s=function(u,c){try{return u[c]}catch{}};return bi=e?t:function(u){var c,l,f;return u===void 0?"Undefined":u===null?"Null":typeof(l=s(c=i(u),a))=="string"?l:o?t(c):(f=t(c))==="Object"&&r(c.callee)?"Arguments":f},bi}var wi,Ac;function yr(){if(Ac)return wi;Ac=1;var e=jt(),r=String;return wi=function(t){if(e(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return r(t)},wi}var Si,kc;function In(){if(kc)return Si;kc=1;var e=jt(),r=os(),t=hn(),n=Nt(),a=ke(),i=a("iterator");return Si=function(o){if(!t(o))return r(o,i)||r(o,"@@iterator")||n[e(o)]},Si}var Ii,qc;function bs(){if(qc)return Ii;qc=1;var e=Le(),r=tr(),t=rr(),n=bn(),a=In(),i=TypeError;return Ii=function(o,s){var u=arguments.length<2?a(o):s;if(r(u))return t(e(u,o));throw new i(n(o)+" is not iterable")},Ii}var Pi,$c;function Vr(){if($c)return Pi;$c=1;var e=TypeError;return Pi=function(r,t){if(r<t)throw new e("Not enough arguments");return r},Pi}var Ei,Uc;function Pn(){if(Uc)return Ei;Uc=1;var e=pe();return Ei=e([].slice),Ei}var Ri,Lc;function ap(){if(Lc)return Ri;Lc=1;var e=Pn(),r=Math.floor,t=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var c=r(i/2),l=t(e(n,0,c),a),f=t(e(n,c),a),v=l.length,d=f.length,h=0,p=0;h<v||p<d;)n[h+p]=h<v&&p<d?a(l[h],f[p])<=0?l[h++]:f[p++]:h<v?l[h++]:f[p++];return n};return Ri=t,Ri}var Ti,xc;function fv(){if(xc)return Ti;xc=1,ms(),rp();var e=Pe(),r=me(),t=lv(),n=Je(),a=Le(),i=pe(),o=qe(),s=wn(),u=Ye(),c=Sn(),l=tp(),f=dt(),v=uv(),d=ft(),h=gs(),p=we(),S=ze(),R=vt(),I=jt(),g=rr(),b=Ke(),y=yr(),A=xt(),q=Gr(),j=bs(),G=In(),K=ps(),re=Vr(),L=ke(),M=ap(),N=L("iterator"),m="URLSearchParams",C=m+"Iterator",U=d.set,F=d.getterFor(m),w=d.getterFor(C),T=t("fetch"),x=t("Request"),H=t("Headers"),Q=x&&x.prototype,J=H&&H.prototype,le=r.TypeError,ne=r.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),Re=parseInt,xe=i("".charAt),je=i([].join),$e=i([].push),Qe=i("".replace),wr=i([].shift),Sr=i([].splice),_r=i("".split),Ar=i("".slice),yt=i(/./.exec),zr=/\+/g,kr="�",ye=/^[0-9a-f]+$/i,Xe=function(D,V){var z=Ar(D,V,V+2);return yt(ye,z)?Re(z,16):NaN},qr=function(D){for(var V=0,z=128;z>0&&(D&z)!==0;z>>=1)V++;return V},B=function(D){var V=null;switch(D.length){case 1:V=D[0];break;case 2:V=(D[0]&31)<<6|D[1]&63;break;case 3:V=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:V=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return V>1114111?null:V},X=function(D){D=Qe(D,zr," ");for(var V=D.length,z="",Y=0;Y<V;){var ie=xe(D,Y);if(ie==="%"){if(xe(D,Y+1)==="%"||Y+3>V){z+="%",Y++;continue}var se=Xe(D,Y+1);if(se!==se){z+=ie,Y++;continue}Y+=2;var ve=qr(se);if(ve===0)ie=ue(se);else{if(ve===1||ve>4){z+=kr,Y++;continue}for(var he=[se],Se=1;Se<ve&&(Y++,!(Y+3>V||xe(D,Y)!=="%"));){var Ue=Xe(D,Y+1);if(Ue!==Ue){Y+=3;break}if(Ue>191||Ue<128)break;$e(he,Ue),Y+=2,Se++}if(he.length!==ve){z+=kr;continue}var nr=B(he);nr===null?z+=kr:ie=ae(nr)}}z+=ie,Y++}return z},oe=/[!'()~]|%20/g,ce={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},fe=function(D){return ce[D]},He=function(D){return Qe(ne(D),oe,fe)},Te=v(function(V,z){U(this,{type:C,target:F(V).entries,index:0,kind:z})},m,function(){var V=w(this),z=V.target,Y=V.index++;if(!z||Y>=z.length)return V.target=null,K(void 0,!0);var ie=z[Y];switch(V.kind){case"keys":return K(ie.key,!1);case"values":return K(ie.value,!1)}return K([ie.key,ie.value],!1)},!0),De=function(D){this.entries=[],this.url=null,D!==void 0&&(b(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?xe(D,0)==="?"?Ar(D,1):D:y(D)))};De.prototype={type:m,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var V=this.entries,z=G(D),Y,ie,se,ve,he,Se,Ue;if(z)for(Y=j(D,z),ie=Y.next;!(se=a(ie,Y)).done;){if(ve=j(g(se.value)),he=ve.next,(Se=a(he,ve)).done||(Ue=a(he,ve)).done||!a(he,ve).done)throw new le("Expected sequence with length 2");$e(V,{key:y(Se.value),value:y(Ue.value)})}else for(var nr in D)S(D,nr)&&$e(V,{key:nr,value:y(D[nr])})},parseQuery:function(D){if(D)for(var V=this.entries,z=_r(D,"&"),Y=0,ie,se;Y<z.length;)ie=z[Y++],ie.length&&(se=_r(ie,"="),$e(V,{key:X(wr(se)),value:X(je(se,"="))}))},serialize:function(){for(var D=this.entries,V=[],z=0,Y;z<D.length;)Y=D[z++],$e(V,He(Y.key)+"="+He(Y.value));return je(V,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Oe=function(){h(this,Ge);var V=arguments.length>0?arguments[0]:void 0,z=U(this,new De(V));o||(this.size=z.entries.length)},Ge=Oe.prototype;if(l(Ge,{append:function(V,z){var Y=F(this);re(arguments.length,2),$e(Y.entries,{key:y(V),value:y(z)}),o||this.length++,Y.updateURL()},delete:function(D){for(var V=F(this),z=re(arguments.length,1),Y=V.entries,ie=y(D),se=z<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<Y.length;){var Se=Y[he];if(Se.key===ie&&(ve===void 0||Se.value===ve)){if(Sr(Y,he,1),ve!==void 0)break}else he++}o||(this.size=Y.length),V.updateURL()},get:function(V){var z=F(this).entries;re(arguments.length,1);for(var Y=y(V),ie=0;ie<z.length;ie++)if(z[ie].key===Y)return z[ie].value;return null},getAll:function(V){var z=F(this).entries;re(arguments.length,1);for(var Y=y(V),ie=[],se=0;se<z.length;se++)z[se].key===Y&&$e(ie,z[se].value);return ie},has:function(V){for(var z=F(this).entries,Y=re(arguments.length,1),ie=y(V),se=Y<2?void 0:arguments[1],ve=se===void 0?se:y(se),he=0;he<z.length;){var Se=z[he++];if(Se.key===ie&&(ve===void 0||Se.value===ve))return!0}return!1},set:function(V,z){var Y=F(this);re(arguments.length,1);for(var ie=Y.entries,se=!1,ve=y(V),he=y(z),Se=0,Ue;Se<ie.length;Se++)Ue=ie[Se],Ue.key===ve&&(se?Sr(ie,Se--,1):(se=!0,Ue.value=he));se||$e(ie,{key:ve,value:he}),o||(this.size=ie.length),Y.updateURL()},sort:function(){var V=F(this);M(V.entries,function(z,Y){return z.key>Y.key?1:-1}),V.updateURL()},forEach:function(V){for(var z=F(this).entries,Y=R(V,arguments.length>1?arguments[1]:void 0),ie=0,se;ie<z.length;)se=z[ie++],Y(se.value,se.key,this)},keys:function(){return new Te(this,"keys")},values:function(){return new Te(this,"values")},entries:function(){return new Te(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&c(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(Oe,m),e({global:!0,constructor:!0,forced:!s},{URLSearchParams:Oe}),!s&&p(H)){var Kr=i(J.has),bt=i(J.set),Jr=function(D){if(b(D)){var V=D.body,z;if(I(V)===m)return z=D.headers?new H(D.headers):new H,Kr(z,"content-type")||bt(z,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A(D,{body:q(0,y(V)),headers:q(0,z)})}return D};if(p(T)&&e({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(V){return T(V,arguments.length>1?Jr(arguments[1]):{})}}),p(x)){var Yr=function(V){return h(this,Q),new x(V,arguments.length>1?Jr(arguments[1]):{})};Q.constructor=Yr,Yr.prototype=Q,e({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Yr})}}return Ti={URLSearchParams:Oe,getState:F},Ti}var Nc;function ip(){return Nc||(Nc=1,fv()),Hs}var jc={},Dc;function op(){if(Dc)return jc;Dc=1;var e=Ye(),r=pe(),t=yr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.append),s=r(i.delete),u=r(i.forEach),c=r([].push),l=new a("a=1&a=2&b=3");return l.delete("a",1),l.delete("b",void 0),l+""!="a=2"&&e(i,"delete",function(f){var v=arguments.length,d=v<2?void 0:arguments[1];if(v&&d===void 0)return s(this,f);var h=[];u(this,function(A,q){c(h,{key:q,value:A})}),n(v,1);for(var p=t(f),S=t(d),R=0,I=0,g=!1,b=h.length,y;R<b;)y=h[R++],g||y.key===p?(g=!0,s(this,y.key)):I++;for(;I<b;)y=h[I++],y.key===p&&y.value===S||o(this,y.key,y.value)},{enumerable:!0,unsafe:!0}),jc}var Mc={},Fc;function sp(){if(Fc)return Mc;Fc=1;var e=Ye(),r=pe(),t=yr(),n=Vr(),a=URLSearchParams,i=a.prototype,o=r(i.getAll),s=r(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&e(i,"has",function(l){var f=arguments.length,v=f<2?void 0:arguments[1];if(f&&v===void 0)return s(this,l);var d=o(this,l);n(f,1);for(var h=t(v),p=0;p<d.length;)if(d[p++]===h)return!0;return!1},{enumerable:!0,unsafe:!0}),Mc}var Bc={},Hc;function up(){if(Hc)return Bc;Hc=1;var e=qe(),r=pe(),t=Sn(),n=URLSearchParams.prototype,a=r(n.forEach);return e&&!("size"in n)&&t(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),Bc}var Oi,Gc;function En(){if(Gc)return Oi;Gc=1;var e=me();return Oi=e,Oi}var Ci,Wc;function dv(){if(Wc)return Ci;Wc=1,ip(),op(),sp(),up();var e=En();return Ci=e.URLSearchParams,Ci}var Vc={},zc={},Kc={},_i,Jc;function vv(){if(Jc)return _i;Jc=1;var e=pe(),r=ss(),t=yr(),n=pn(),a=e("".charAt),i=e("".charCodeAt),o=e("".slice),s=function(u){return function(c,l){var f=t(n(c)),v=r(l),d=f.length,h,p;return v<0||v>=d?u?"":void 0:(h=i(f,v),h<55296||h>56319||v+1===d||(p=i(f,v+1))<56320||p>57343?u?a(f,v):h:u?o(f,v,v+2):(h-55296<<10)+(p-56320)+65536)}};return _i={codeAt:s(!1),charAt:s(!0)},_i}var Yc;function hv(){if(Yc)return Kc;Yc=1;var e=vv().charAt,r=yr(),t=ft(),n=cv(),a=ps(),i="String Iterator",o=t.set,s=t.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:r(u),index:0})},function(){var c=s(this),l=c.string,f=c.index,v;return f>=l.length?a(void 0,!0):(v=e(l,f),c.index+=v.length,a(v,!1))}),Kc}var Ai,Qc;function cp(){if(Qc)return Ai;Qc=1;var e=qe(),r=pe(),t=Le(),n=Ae(),a=Xd(),i=av(),o=ev(),s=mn(),u=Md(),c=Object.assign,l=Object.defineProperty,f=r([].concat);return Ai=!c||n(function(){if(e&&c({b:1},c(l({},"a",{enumerable:!0,get:function(){l(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var v={},d={},h=Symbol("assign detection"),p="abcdefghijklmnopqrst";return v[h]=7,p.split("").forEach(function(S){d[S]=S}),c({},v)[h]!==7||a(c({},d)).join("")!==p})?function(d,h){for(var p=s(d),S=arguments.length,R=1,I=i.f,g=o.f;S>R;)for(var b=u(arguments[R++]),y=I?f(a(b),I(b)):a(b),A=y.length,q=0,j;A>q;)j=y[q++],(!e||t(g,b,j))&&(p[j]=b[j]);return p}:c,Ai}var ki,Xc;function pv(){if(Xc)return ki;Xc=1;var e=Le(),r=rr(),t=os();return ki=function(n,a,i){var o,s;r(n);try{if(o=t(n,"return"),!o){if(a==="throw")throw i;return i}o=e(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return r(o),i},ki}var qi,Zc;function lp(){if(Zc)return qi;Zc=1;var e=rr(),r=pv();return qi=function(t,n,a,i){try{return i?n(e(a)[0],a[1]):n(a)}catch(o){r(t,"throw",o)}},qi}var $i,el;function mv(){if(el)return $i;el=1;var e=ke(),r=Nt(),t=e("iterator"),n=Array.prototype;return $i=function(a){return a!==void 0&&(r.Array===a||n[t]===a)},$i}var Ui,rl;function gv(){if(rl)return Ui;rl=1;var e=pe(),r=Ae(),t=we(),n=jt(),a=Je(),i=ds(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,c=e(u.exec),l=!u.test(o),f=function(h){if(!t(h))return!1;try{return s(o,[],h),!0}catch{return!1}},v=function(h){if(!t(h))return!1;switch(n(h)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!c(u,i(h))}catch{return!0}};return v.sham=!0,Ui=!s||r(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?v:f,Ui}var Li,tl;function fp(){if(tl)return Li;tl=1;var e=qe(),r=gr(),t=Gr();return Li=function(n,a,i){e?r.f(n,a,t(0,i)):n[a]=i},Li}var xi,nl;function dp(){if(nl)return xi;nl=1;var e=vt(),r=Le(),t=mn(),n=lp(),a=mv(),i=gv(),o=us(),s=fp(),u=bs(),c=In(),l=Array;return xi=function(v){var d=t(v),h=i(this),p=arguments.length,S=p>1?arguments[1]:void 0,R=S!==void 0;R&&(S=e(S,p>2?arguments[2]:void 0));var I=c(d),g=0,b,y,A,q,j,G;if(I&&!(this===l&&a(I)))for(y=h?new this:[],q=u(d,I),j=q.next;!(A=r(j,q)).done;g++)G=R?n(q,S,[A.value,g],!0):A.value,s(y,g,G);else for(b=o(d),y=h?new this(b):l(b);b>g;g++)G=R?S(d[g],g):d[g],s(y,g,G);return y.length=g,y},xi}var Ni,al;function vp(){if(al)return Ni;al=1;var e=pe(),r=2147483647,t=36,n=1,a=26,i=38,o=700,s=72,u=128,c="-",l=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,v="Overflow: input needs wider integers to process",d=t-n,h=RangeError,p=e(f.exec),S=Math.floor,R=String.fromCharCode,I=e("".charCodeAt),g=e([].join),b=e([].push),y=e("".replace),A=e("".split),q=e("".toLowerCase),j=function(L){for(var M=[],N=0,m=L.length;N<m;){var C=I(L,N++);if(C>=55296&&C<=56319&&N<m){var U=I(L,N++);(U&64512)===56320?b(M,((C&1023)<<10)+(U&1023)+65536):(b(M,C),N--)}else b(M,C)}return M},G=function(L){return L+22+75*(L<26)},K=function(L,M,N){var m=0;for(L=N?S(L/o):L>>1,L+=S(L/M);L>d*a>>1;)L=S(L/d),m+=t;return S(m+(d+1)*L/(L+i))},re=function(L){var M=[];L=j(L);var N=L.length,m=u,C=0,U=s,F,w;for(F=0;F<L.length;F++)w=L[F],w<128&&b(M,R(w));var T=M.length,x=T;for(T&&b(M,c);x<N;){var H=r;for(F=0;F<L.length;F++)w=L[F],w>=m&&w<H&&(H=w);var Q=x+1;if(H-m>S((r-C)/Q))throw new h(v);for(C+=(H-m)*Q,m=H,F=0;F<L.length;F++){if(w=L[F],w<m&&++C>r)throw new h(v);if(w===m){for(var J=C,le=t;;){var ne=le<=U?n:le>=U+a?a:le-U;if(J<ne)break;var ue=J-ne,ae=t-ne;b(M,R(G(ne+ue%ae))),J=S(ue/ae),le+=t}b(M,R(G(J))),U=K(C,Q,x===T),C=0,x++}}C++,m++}return g(M,"")};return Ni=function(L){var M=[],N=A(y(q(L),f,"."),"."),m,C;for(m=0;m<N.length;m++)C=N[m],b(M,p(l,C)?"xn--"+re(C):C);return g(M,".")},Ni}var il;function hp(){if(il)return zc;il=1,hv();var e=Pe(),r=qe(),t=wn(),n=me(),a=vt(),i=pe(),o=Ye(),s=Sn(),u=gs(),c=ze(),l=cp(),f=dp(),v=Pn(),d=vv().codeAt,h=vp(),p=yr(),S=dt(),R=Vr(),I=fv(),g=ft(),b=g.set,y=g.getterFor("URL"),A=I.URLSearchParams,q=I.getState,j=n.URL,G=n.TypeError,K=n.parseInt,re=Math.floor,L=Math.pow,M=i("".charAt),N=i(/./.exec),m=i([].join),C=i(1.1.toString),U=i([].pop),F=i([].push),w=i("".replace),T=i([].shift),x=i("".split),H=i("".slice),Q=i("".toLowerCase),J=i([].unshift),le="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",Re=/[a-z]/i,xe=/[\d+-.a-z]/i,je=/\d/,$e=/^0x/i,Qe=/^[0-7]+$/,wr=/^\d+$/,Sr=/^[\da-f]+$/i,_r=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ar=/[\0\t\n\r #/:<>?@[\\\]^|]/,yt=/^[\u0000-\u0020]+/,zr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,kr=/[\t\n\r]/g,ye,Xe=function(E){var $=x(E,"."),O,P,_,te,W,be,Ie;if($.length&&$[$.length-1]===""&&$.length--,O=$.length,O>4)return E;for(P=[],_=0;_<O;_++){if(te=$[_],te==="")return E;if(W=10,te.length>1&&M(te,0)==="0"&&(W=N($e,te)?16:8,te=H(te,W===8?1:2)),te==="")be=0;else{if(!N(W===10?wr:W===8?Qe:Sr,te))return E;be=K(te,W)}F(P,be)}for(_=0;_<O;_++)if(be=P[_],_===O-1){if(be>=L(256,5-O))return null}else if(be>255)return null;for(Ie=U(P),_=0;_<P.length;_++)Ie+=P[_]*L(256,3-_);return Ie},qr=function(E){var $=[0,0,0,0,0,0,0,0],O=0,P=null,_=0,te,W,be,Ie,Ce,Ve,k,Ee=function(){return M(E,_)};if(Ee()===":"){if(M(E,1)!==":")return;_+=2,O++,P=O}for(;Ee();){if(O===8)return;if(Ee()===":"){if(P!==null)return;_++,O++,P=O;continue}for(te=W=0;W<4&&N(Sr,Ee());)te=te*16+K(Ee(),16),_++,W++;if(Ee()==="."){if(W===0||(_-=W,O>6))return;for(be=0;Ee();){if(Ie=null,be>0)if(Ee()==="."&&be<4)_++;else return;if(!N(je,Ee()))return;for(;N(je,Ee());){if(Ce=K(Ee(),10),Ie===null)Ie=Ce;else{if(Ie===0)return;Ie=Ie*10+Ce}if(Ie>255)return;_++}$[O]=$[O]*256+Ie,be++,(be===2||be===4)&&O++}if(be!==4)return;break}else if(Ee()===":"){if(_++,!Ee())return}else if(Ee())return;$[O++]=te}if(P!==null)for(Ve=O-P,O=7;O!==0&&Ve>0;)k=$[O],$[O--]=$[P+Ve-1],$[P+--Ve]=k;else if(O!==8)return;return $},B=function(E){for(var $=null,O=1,P=null,_=0,te=0;te<8;te++)E[te]!==0?(_>O&&($=P,O=_),P=null,_=0):(P===null&&(P=te),++_);return _>O?P:$},X=function(E){var $,O,P,_;if(typeof E=="number"){for($=[],O=0;O<4;O++)J($,E%256),E=re(E/256);return m($,".")}if(typeof E=="object"){for($="",P=B(E),O=0;O<8;O++)_&&E[O]===0||(_&&(_=!1),P===O?($+=O?":":"::",_=!0):($+=C(E[O],16),O<7&&($+=":")));return"["+$+"]"}return E},oe={},ce=l({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),fe=l({},ce,{"#":1,"?":1,"{":1,"}":1}),He=l({},fe,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(E,$){var O=d(E,0);return O>32&&O<127&&!c($,E)?E:encodeURIComponent(E)},De={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Oe=function(E,$){var O;return E.length===2&&N(Re,M(E,0))&&((O=M(E,1))===":"||!$&&O==="|")},Ge=function(E){var $;return E.length>1&&Oe(H(E,0,2))&&(E.length===2||($=M(E,2))==="/"||$==="\\"||$==="?"||$==="#")},Kr=function(E){return E==="."||Q(E)==="%2e"},bt=function(E){return E=Q(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},Jr={},Yr={},D={},V={},z={},Y={},ie={},se={},ve={},he={},Se={},Ue={},nr={},qn={},xs={},$n={},Qr={},ar={},Ns={},$r={},ur={},Un=function(E,$,O){var P=p(E),_,te,W;if($){if(te=this.parse(P),te)throw new G(te);this.searchParams=null}else{if(O!==void 0&&(_=new Un(O,!0)),te=this.parse(P,null,_),te)throw new G(te);W=q(new A),W.bindURL(this),this.searchParams=W}};Un.prototype={type:"URL",parse:function(E,$,O){var P=this,_=$||Jr,te=0,W="",be=!1,Ie=!1,Ce=!1,Ve,k,Ee,cr;for(E=p(E),$||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=w(E,yt,""),E=w(E,zr,"$1")),E=w(E,kr,""),Ve=f(E);te<=Ve.length;){switch(k=Ve[te],_){case Jr:if(k&&N(Re,k))W+=Q(k),_=Yr;else{if($)return ne;_=D;continue}break;case Yr:if(k&&(N(xe,k)||k==="+"||k==="-"||k==="."))W+=Q(k);else if(k===":"){if($&&(P.isSpecial()!==c(De,W)||W==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=W,$){P.isSpecial()&&De[P.scheme]===P.port&&(P.port=null);return}W="",P.scheme==="file"?_=qn:P.isSpecial()&&O&&O.scheme===P.scheme?_=V:P.isSpecial()?_=se:Ve[te+1]==="/"?(_=z,te++):(P.cannotBeABaseURL=!0,F(P.path,""),_=Ns)}else{if($)return ne;W="",_=D,te=0;continue}break;case D:if(!O||O.cannotBeABaseURL&&k!=="#")return ne;if(O.cannotBeABaseURL&&k==="#"){P.scheme=O.scheme,P.path=v(O.path),P.query=O.query,P.fragment="",P.cannotBeABaseURL=!0,_=ur;break}_=O.scheme==="file"?qn:Y;continue;case V:if(k==="/"&&Ve[te+1]==="/")_=ve,te++;else{_=Y;continue}break;case z:if(k==="/"){_=he;break}else{_=ar;continue}case Y:if(P.scheme=O.scheme,k===ye)P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query;else if(k==="/"||k==="\\"&&P.isSpecial())_=ie;else if(k==="?")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query="",_=$r;else if(k==="#")P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.query=O.query,P.fragment="",_=ur;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,P.path=v(O.path),P.path.length--,_=ar;continue}break;case ie:if(P.isSpecial()&&(k==="/"||k==="\\"))_=ve;else if(k==="/")_=he;else{P.username=O.username,P.password=O.password,P.host=O.host,P.port=O.port,_=ar;continue}break;case se:if(_=ve,k!=="/"||M(W,te+1)!=="/")continue;te++;break;case ve:if(k!=="/"&&k!=="\\"){_=he;continue}break;case he:if(k==="@"){be&&(W="%40"+W),be=!0,Ee=f(W);for(var Ln=0;Ln<Ee.length;Ln++){var Ms=Ee[Ln];if(Ms===":"&&!Ce){Ce=!0;continue}var Fs=Te(Ms,He);Ce?P.password+=Fs:P.username+=Fs}W=""}else if(k===ye||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()){if(be&&W==="")return le;te-=f(W).length+1,W="",_=Se}else W+=k;break;case Se:case Ue:if($&&P.scheme==="file"){_=$n;continue}else if(k===":"&&!Ie){if(W==="")return ue;if(cr=P.parseHost(W),cr)return cr;if(W="",_=nr,$===Ue)return}else if(k===ye||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()){if(P.isSpecial()&&W==="")return ue;if($&&W===""&&(P.includesCredentials()||P.port!==null))return;if(cr=P.parseHost(W),cr)return cr;if(W="",_=Qr,$)return;continue}else k==="["?Ie=!0:k==="]"&&(Ie=!1),W+=k;break;case nr:if(N(je,k))W+=k;else if(k===ye||k==="/"||k==="?"||k==="#"||k==="\\"&&P.isSpecial()||$){if(W!==""){var xn=K(W,10);if(xn>65535)return ae;P.port=P.isSpecial()&&xn===De[P.scheme]?null:xn,W=""}if($)return;_=Qr;continue}else return ae;break;case qn:if(P.scheme="file",k==="/"||k==="\\")_=xs;else if(O&&O.scheme==="file")switch(k){case ye:P.host=O.host,P.path=v(O.path),P.query=O.query;break;case"?":P.host=O.host,P.path=v(O.path),P.query="",_=$r;break;case"#":P.host=O.host,P.path=v(O.path),P.query=O.query,P.fragment="",_=ur;break;default:Ge(m(v(Ve,te),""))||(P.host=O.host,P.path=v(O.path),P.shortenPath()),_=ar;continue}else{_=ar;continue}break;case xs:if(k==="/"||k==="\\"){_=$n;break}O&&O.scheme==="file"&&!Ge(m(v(Ve,te),""))&&(Oe(O.path[0],!0)?F(P.path,O.path[0]):P.host=O.host),_=ar;continue;case $n:if(k===ye||k==="/"||k==="\\"||k==="?"||k==="#"){if(!$&&Oe(W))_=ar;else if(W===""){if(P.host="",$)return;_=Qr}else{if(cr=P.parseHost(W),cr)return cr;if(P.host==="localhost"&&(P.host=""),$)return;W="",_=Qr}continue}else W+=k;break;case Qr:if(P.isSpecial()){if(_=ar,k!=="/"&&k!=="\\")continue}else if(!$&&k==="?")P.query="",_=$r;else if(!$&&k==="#")P.fragment="",_=ur;else if(k!==ye&&(_=ar,k!=="/"))continue;break;case ar:if(k===ye||k==="/"||k==="\\"&&P.isSpecial()||!$&&(k==="?"||k==="#")){if(bt(W)?(P.shortenPath(),k!=="/"&&!(k==="\\"&&P.isSpecial())&&F(P.path,"")):Kr(W)?k!=="/"&&!(k==="\\"&&P.isSpecial())&&F(P.path,""):(P.scheme==="file"&&!P.path.length&&Oe(W)&&(P.host&&(P.host=""),W=M(W,0)+":"),F(P.path,W)),W="",P.scheme==="file"&&(k===ye||k==="?"||k==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);k==="?"?(P.query="",_=$r):k==="#"&&(P.fragment="",_=ur)}else W+=Te(k,fe);break;case Ns:k==="?"?(P.query="",_=$r):k==="#"?(P.fragment="",_=ur):k!==ye&&(P.path[0]+=Te(k,oe));break;case $r:!$&&k==="#"?(P.fragment="",_=ur):k!==ye&&(k==="'"&&P.isSpecial()?P.query+="%27":k==="#"?P.query+="%23":P.query+=Te(k,oe));break;case ur:k!==ye&&(P.fragment+=Te(k,ce));break}te++}},parseHost:function(E){var $,O,P;if(M(E,0)==="["){if(M(E,E.length-1)!=="]"||($=qr(H(E,1,-1)),!$))return ue;this.host=$}else if(this.isSpecial()){if(E=h(E),N(_r,E)||($=Xe(E),$===null))return ue;this.host=$}else{if(N(Ar,E))return ue;for($="",O=f(E),P=0;P<O.length;P++)$+=Te(O[P],oe);this.host=$}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return c(De,this.scheme)},shortenPath:function(){var E=this.path,$=E.length;$&&(this.scheme!=="file"||$!==1||!Oe(E[0],!0))&&E.length--},serialize:function(){var E=this,$=E.scheme,O=E.username,P=E.password,_=E.host,te=E.port,W=E.path,be=E.query,Ie=E.fragment,Ce=$+":";return _!==null?(Ce+="//",E.includesCredentials()&&(Ce+=O+(P?":"+P:"")+"@"),Ce+=X(_),te!==null&&(Ce+=":"+te)):$==="file"&&(Ce+="//"),Ce+=E.cannotBeABaseURL?W[0]:W.length?"/"+m(W,"/"):"",be!==null&&(Ce+="?"+be),Ie!==null&&(Ce+="#"+Ie),Ce},setHref:function(E){var $=this.parse(E);if($)throw new G($);this.searchParams.update()},getOrigin:function(){var E=this.scheme,$=this.port;if(E==="blob")try{return new Xr(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+X(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",Jr)},getUsername:function(){return this.username},setUsername:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var O=0;O<$.length;O++)this.username+=Te($[O],He)}},getPassword:function(){return this.password},setPassword:function(E){var $=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var O=0;O<$.length;O++)this.password+=Te($[O],He)}},getHost:function(){var E=this.host,$=this.port;return E===null?"":$===null?X(E):X(E)+":"+$},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Se)},getHostname:function(){var E=this.host;return E===null?"":X(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,Ue)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,nr))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+m(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,Qr))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(M(E,0)==="?"&&(E=H(E,1)),this.query="",this.parse(E,$r)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}M(E,0)==="#"&&(E=H(E,1)),this.fragment="",this.parse(E,ur)},update:function(){this.query=this.searchParams.serialize()||null}};var Xr=function($){var O=u(this,Ne),P=R(arguments.length,1)>1?arguments[1]:void 0,_=b(O,new Un($,!1,P));r||(O.href=_.serialize(),O.origin=_.getOrigin(),O.protocol=_.getProtocol(),O.username=_.getUsername(),O.password=_.getPassword(),O.host=_.getHost(),O.hostname=_.getHostname(),O.port=_.getPort(),O.pathname=_.getPathname(),O.search=_.getSearch(),O.searchParams=_.getSearchParams(),O.hash=_.getHash())},Ne=Xr.prototype,We=function(E,$){return{get:function(){return y(this)[E]()},set:$&&function(O){return y(this)[$](O)},configurable:!0,enumerable:!0}};if(r&&(s(Ne,"href",We("serialize","setHref")),s(Ne,"origin",We("getOrigin")),s(Ne,"protocol",We("getProtocol","setProtocol")),s(Ne,"username",We("getUsername","setUsername")),s(Ne,"password",We("getPassword","setPassword")),s(Ne,"host",We("getHost","setHost")),s(Ne,"hostname",We("getHostname","setHostname")),s(Ne,"port",We("getPort","setPort")),s(Ne,"pathname",We("getPathname","setPathname")),s(Ne,"search",We("getSearch","setSearch")),s(Ne,"searchParams",We("getSearchParams")),s(Ne,"hash",We("getHash","setHash"))),o(Ne,"toJSON",function(){return y(this).serialize()},{enumerable:!0}),o(Ne,"toString",function(){return y(this).serialize()},{enumerable:!0}),j){var js=j.createObjectURL,Ds=j.revokeObjectURL;js&&o(Xr,"createObjectURL",a(js,j)),Ds&&o(Xr,"revokeObjectURL",a(Ds,j))}return S(Xr,"URL"),e({global:!0,constructor:!0,forced:!t,sham:!r},{URL:Xr}),zc}var ol;function pp(){return ol||(ol=1,hp()),Vc}var sl={},ul;function mp(){if(ul)return sl;ul=1;var e=Pe(),r=Je(),t=Ae(),n=Vr(),a=yr(),i=wn(),o=r("URL"),s=i&&t(function(){o.canParse()}),u=t(function(){return o.canParse.length!==1});return e({target:"URL",stat:!0,forced:!s||u},{canParse:function(l){var f=n(arguments.length,1),v=a(l),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(v,d)}catch{return!1}}}),sl}var cl={},ll;function gp(){if(ll)return cl;ll=1;var e=Pe(),r=Je(),t=Vr(),n=yr(),a=wn(),i=r("URL");return e({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=t(arguments.length,1),c=n(s),l=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(c,l)}catch{return null}}}),cl}var fl={},dl;function yp(){if(dl)return fl;dl=1;var e=Pe(),r=Le();return e({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}}),fl}var ji,vl;function bp(){if(vl)return ji;vl=1,dv(),pp(),mp(),gp(),yp();var e=En();return ji=e.URL,ji}var Di,hl;function wp(){if(hl)return Di;hl=1;var e=bp();return Di=e,Di}var Mi,pl;function Sp(){if(pl)return Mi;pl=1;var e=wp();return Mi=e,Mi}Sp();var ml={},Fi,gl;function Ip(){return gl||(gl=1,Fi={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}),Fi}var Bi,yl;function Pp(){if(yl)return Bi;yl=1;var e=gn(),r=e("span").classList,t=r&&r.constructor&&r.constructor.prototype;return Bi=t===Object.prototype?void 0:t,Bi}var bl;function yv(){if(bl)return ml;bl=1;var e=me(),r=Ip(),t=Pp(),n=ms(),a=Wr(),i=dt(),o=ke(),s=o("iterator"),u=n.values,c=function(f,v){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,v,!0),r[v]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var l in r)c(e[l]&&e[l].prototype,l);return c(t,"DOMTokenList"),ml}var Hi,wl;function Ep(){if(wl)return Hi;wl=1;var e=dv();return yv(),Hi=e,Hi}var Gi,Sl;function Rp(){if(Sl)return Gi;Sl=1;var e=Ep();return Gi=e,Gi}Rp();var Il={},Pl={},Wi,El;function Tp(){if(El)return Wi;El=1;var e=Ke(),r=Wr();return Wi=function(t,n){e(n)&&"cause"in n&&r(t,"cause",n.cause)},Wi}var Vi,Rl;function Op(){if(Rl)return Vi;Rl=1;var e=pe(),r=Error,t=e("".replace),n=(function(o){return String(new r(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return Vi=function(o,s){if(i&&typeof o=="string"&&!r.prepareStackTrace)for(;s--;)o=t(o,a,"");return o},Vi}var zi,Tl;function Cp(){if(Tl)return zi;Tl=1;var e=Ae(),r=Gr();return zi=!e(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",r(1,7)),t.stack!==7):!0}),zi}var Ki,Ol;function _p(){if(Ol)return Ki;Ol=1;var e=Wr(),r=Op(),t=Cp(),n=Error.captureStackTrace;return Ki=function(a,i,o,s){t&&(n?n(a,i):e(a,"stack",r(o,s)))},Ki}var Ji,Cl;function Dt(){if(Cl)return Ji;Cl=1;var e=vt(),r=Le(),t=rr(),n=bn(),a=mv(),i=us(),o=yn(),s=bs(),u=In(),c=pv(),l=TypeError,f=function(d,h){this.stopped=d,this.result=h},v=f.prototype;return Ji=function(d,h,p){var S=p&&p.that,R=!!(p&&p.AS_ENTRIES),I=!!(p&&p.IS_RECORD),g=!!(p&&p.IS_ITERATOR),b=!!(p&&p.INTERRUPTED),y=e(h,S),A,q,j,G,K,re,L,M=function(m){return A&&c(A,"normal"),new f(!0,m)},N=function(m){return R?(t(m),b?y(m[0],m[1],M):y(m[0],m[1])):b?y(m,M):y(m)};if(I)A=d.iterator;else if(g)A=d;else{if(q=u(d),!q)throw new l(n(d)+" is not iterable");if(a(q)){for(j=0,G=i(d);G>j;j++)if(K=N(d[j]),K&&o(v,K))return K;return new f(!1)}A=s(d,q)}for(re=I?d.next:A.next;!(L=r(re,A)).done;){try{K=N(L.value)}catch(m){c(A,"throw",m)}if(typeof K=="object"&&K&&o(v,K))return K}return new f(!1)},Ji}var Yi,_l;function Ap(){if(_l)return Yi;_l=1;var e=yr();return Yi=function(r,t){return r===void 0?arguments.length<2?"":t:e(r)},Yi}var Al;function kp(){if(Al)return Pl;Al=1;var e=Pe(),r=yn(),t=vs(),n=hs(),a=iv(),i=xt(),o=Wr(),s=Gr(),u=Tp(),c=_p(),l=Dt(),f=Ap(),v=ke(),d=v("toStringTag"),h=Error,p=[].push,S=function(g,b){var y=r(R,this),A;n?A=n(new h,y?t(this):R):(A=y?this:i(R),o(A,d,"Error")),b!==void 0&&o(A,"message",f(b)),c(A,S,A.stack,1),arguments.length>2&&u(A,arguments[2]);var q=[];return l(g,p,{that:q}),o(A,"errors",q),A};n?n(S,h):a(S,h,{name:!0});var R=S.prototype=i(h.prototype,{constructor:s(1,S),message:s(1,""),name:s(1,"AggregateError")});return e({global:!0,constructor:!0,arity:2},{AggregateError:S}),Pl}var kl;function qp(){return kl||(kl=1,kp()),Il}var ql={},Qi,$l;function $p(){if($l)return Qi;$l=1;var e=ys(),r=jt();return Qi=e?{}.toString:function(){return"[object "+r(this)+"]"},Qi}var Ul;function Up(){if(Ul)return ql;Ul=1;var e=ys(),r=Ye(),t=$p();return e||r(Object.prototype,"toString",t,{unsafe:!0}),ql}var Ll={},xl={},Xi,Nl;function bv(){if(Nl)return Xi;Nl=1;var e=me(),r=Lt(),t=vn(),n=function(a){return r.slice(0,a.length)===a};return Xi=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":e.Bun&&typeof Bun.version=="string"?"BUN":e.Deno&&typeof Deno.version=="object"?"DENO":t(e.process)==="process"?"NODE":e.window&&e.document?"BROWSER":"REST"})(),Xi}var Zi,jl;function ws(){if(jl)return Zi;jl=1;var e=bv();return Zi=e==="NODE",Zi}var eo,Dl;function Lp(){if(Dl)return eo;Dl=1;var e=Je(),r=Sn(),t=ke(),n=qe(),a=t("species");return eo=function(i){var o=e(i);n&&o&&!o[a]&&r(o,a,{configurable:!0,get:function(){return this}})},eo}var ro,Ml;function xp(){if(Ml)return ro;Ml=1;var e=gv(),r=bn(),t=TypeError;return ro=function(n){if(e(n))return n;throw new t(r(n)+" is not a constructor")},ro}var to,Fl;function wv(){if(Fl)return to;Fl=1;var e=rr(),r=xp(),t=hn(),n=ke(),a=n("species");return to=function(i,o){var s=e(i).constructor,u;return s===void 0||t(u=e(s)[a])?o:r(u)},to}var no,Bl;function Sv(){if(Bl)return no;Bl=1;var e=dn(),r=Function.prototype,t=r.apply,n=r.call;return no=typeof Reflect=="object"&&Reflect.apply||(e?n.bind(t):function(){return n.apply(t,arguments)}),no}var ao,Hl;function Iv(){if(Hl)return ao;Hl=1;var e=Lt();return ao=/(?:ipad|iphone|ipod).*applewebkit/i.test(e),ao}var io,Gl;function Pv(){if(Gl)return io;Gl=1;var e=me(),r=Sv(),t=vt(),n=we(),a=ze(),i=Ae(),o=Zd(),s=Pn(),u=gn(),c=Vr(),l=Iv(),f=ws(),v=e.setImmediate,d=e.clearImmediate,h=e.process,p=e.Dispatch,S=e.Function,R=e.MessageChannel,I=e.String,g=0,b={},y="onreadystatechange",A,q,j,G;i(function(){A=e.location});var K=function(N){if(a(b,N)){var m=b[N];delete b[N],m()}},re=function(N){return function(){K(N)}},L=function(N){K(N.data)},M=function(N){e.postMessage(I(N),A.protocol+"//"+A.host)};return(!v||!d)&&(v=function(m){c(arguments.length,1);var C=n(m)?m:S(m),U=s(arguments,1);return b[++g]=function(){r(C,void 0,U)},q(g),g},d=function(m){delete b[m]},f?q=function(N){h.nextTick(re(N))}:p&&p.now?q=function(N){p.now(re(N))}:R&&!l?(j=new R,G=j.port2,j.port1.onmessage=L,q=t(G.postMessage,G)):e.addEventListener&&n(e.postMessage)&&!e.importScripts&&A&&A.protocol!=="file:"&&!i(M)?(q=M,e.addEventListener("message",L,!1)):y in u("script")?q=function(N){o.appendChild(u("script"))[y]=function(){o.removeChild(this),K(N)}}:q=function(N){setTimeout(re(N),0)}),io={set:v,clear:d},io}var oo,Wl;function Ev(){if(Wl)return oo;Wl=1;var e=function(){this.head=null,this.tail=null};return e.prototype={add:function(r){var t={item:r,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var r=this.head;if(r){var t=this.head=r.next;return t===null&&(this.tail=null),r.item}}},oo=e,oo}var so,Vl;function Np(){if(Vl)return so;Vl=1;var e=Lt();return so=/ipad|iphone|ipod/i.test(e)&&typeof Pebble<"u",so}var uo,zl;function jp(){if(zl)return uo;zl=1;var e=Lt();return uo=/web0s(?!.*chrome)/i.test(e),uo}var co,Kl;function Dp(){if(Kl)return co;Kl=1;var e=me(),r=lv(),t=vt(),n=Pv().set,a=Ev(),i=Iv(),o=Np(),s=jp(),u=ws(),c=e.MutationObserver||e.WebKitMutationObserver,l=e.document,f=e.process,v=e.Promise,d=r("queueMicrotask"),h,p,S,R,I;if(!d){var g=new a,b=function(){var y,A;for(u&&(y=f.domain)&&y.exit();A=g.get();)try{A()}catch(q){throw g.head&&h(),q}y&&y.enter()};!i&&!u&&!s&&c&&l?(p=!0,S=l.createTextNode(""),new c(b).observe(S,{characterData:!0}),h=function(){S.data=p=!p}):!o&&v&&v.resolve?(R=v.resolve(void 0),R.constructor=v,I=t(R.then,R),h=function(){I(b)}):u?h=function(){f.nextTick(b)}:(n=t(n,e),h=function(){n(b)}),d=function(y){g.head||h(),g.add(y)}}return co=d,co}var lo,Jl;function Mp(){return Jl||(Jl=1,lo=function(e,r){try{arguments.length===1?console.error(e):console.error(e,r)}catch{}}),lo}var fo,Yl;function ht(){return Yl||(Yl=1,fo=function(e){try{return{error:!1,value:e()}}catch(r){return{error:!0,value:r}}}),fo}var vo,Ql;function pt(){if(Ql)return vo;Ql=1;var e=me();return vo=e.Promise,vo}var ho,Xl;function Mt(){if(Xl)return ho;Xl=1;var e=me(),r=pt(),t=we(),n=ov(),a=ds(),i=ke(),o=bv(),s=sr(),u=Hd(),c=r&&r.prototype,l=i("species"),f=!1,v=t(e.PromiseRejectionEvent),d=n("Promise",function(){var h=a(r),p=h!==String(r);if(!p&&u===66||s&&!(c.catch&&c.finally))return!0;if(!u||u<51||!/native code/.test(h)){var S=new r(function(g){g(1)}),R=function(g){g(function(){},function(){})},I=S.constructor={};if(I[l]=R,f=S.then(function(){})instanceof R,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!v});return ho={CONSTRUCTOR:d,REJECTION_EVENT:v,SUBCLASSING:f},ho}var po={},Zl;function br(){if(Zl)return po;Zl=1;var e=tr(),r=TypeError,t=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new r("Bad Promise constructor");a=o,i=s}),this.resolve=e(a),this.reject=e(i)};return po.f=function(n){return new t(n)},po}var ef;function Fp(){if(ef)return xl;ef=1;var e=Pe(),r=sr(),t=ws(),n=me(),a=En(),i=Le(),o=Ye(),s=hs(),u=dt(),c=Lp(),l=tr(),f=we(),v=Ke(),d=gs(),h=wv(),p=Pv().set,S=Dp(),R=Mp(),I=ht(),g=Ev(),b=ft(),y=pt(),A=Mt(),q=br(),j="Promise",G=A.CONSTRUCTOR,K=A.REJECTION_EVENT,re=A.SUBCLASSING,L=b.getterFor(j),M=b.set,N=y&&y.prototype,m=y,C=N,U=n.TypeError,F=n.document,w=n.process,T=q.f,x=T,H=!!(F&&F.createEvent&&n.dispatchEvent),Q="unhandledrejection",J="rejectionhandled",le=0,ne=1,ue=2,ae=1,Re=2,xe,je,$e,Qe,wr=function(B){var X;return v(B)&&f(X=B.then)?X:!1},Sr=function(B,X){var oe=X.value,ce=X.state===ne,fe=ce?B.ok:B.fail,He=B.resolve,Te=B.reject,De=B.domain,Oe,Ge,Kr;try{fe?(ce||(X.rejection===Re&&kr(X),X.rejection=ae),fe===!0?Oe=oe:(De&&De.enter(),Oe=fe(oe),De&&(De.exit(),Kr=!0)),Oe===B.promise?Te(new U("Promise-chain cycle")):(Ge=wr(Oe))?i(Ge,Oe,He,Te):He(Oe)):Te(oe)}catch(bt){De&&!Kr&&De.exit(),Te(bt)}},_r=function(B,X){B.notified||(B.notified=!0,S(function(){for(var oe=B.reactions,ce;ce=oe.get();)Sr(ce,B);B.notified=!1,X&&!B.rejection&&yt(B)}))},Ar=function(B,X,oe){var ce,fe;H?(ce=F.createEvent("Event"),ce.promise=X,ce.reason=oe,ce.initEvent(B,!1,!0),n.dispatchEvent(ce)):ce={promise:X,reason:oe},!K&&(fe=n["on"+B])?fe(ce):B===Q&&R("Unhandled promise rejection",oe)},yt=function(B){i(p,n,function(){var X=B.facade,oe=B.value,ce=zr(B),fe;if(ce&&(fe=I(function(){t?w.emit("unhandledRejection",oe,X):Ar(Q,X,oe)}),B.rejection=t||zr(B)?Re:ae,fe.error))throw fe.value})},zr=function(B){return B.rejection!==ae&&!B.parent},kr=function(B){i(p,n,function(){var X=B.facade;t?w.emit("rejectionHandled",X):Ar(J,X,B.value)})},ye=function(B,X,oe){return function(ce){B(X,ce,oe)}},Xe=function(B,X,oe){B.done||(B.done=!0,oe&&(B=oe),B.value=X,B.state=ue,_r(B,!0))},qr=function(B,X,oe){if(!B.done){B.done=!0,oe&&(B=oe);try{if(B.facade===X)throw new U("Promise can't be resolved itself");var ce=wr(X);ce?S(function(){var fe={done:!1};try{i(ce,X,ye(qr,fe,B),ye(Xe,fe,B))}catch(He){Xe(fe,He,B)}}):(B.value=X,B.state=ne,_r(B,!1))}catch(fe){Xe({done:!1},fe,B)}}};if(G&&(m=function(X){d(this,C),l(X),i(xe,this);var oe=L(this);try{X(ye(qr,oe),ye(Xe,oe))}catch(ce){Xe(oe,ce)}},C=m.prototype,xe=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new g,rejection:!1,state:le,value:null})},xe.prototype=o(C,"then",function(X,oe){var ce=L(this),fe=T(h(this,m));return ce.parent=!0,fe.ok=f(X)?X:!0,fe.fail=f(oe)&&oe,fe.domain=t?w.domain:void 0,ce.state===le?ce.reactions.add(fe):S(function(){Sr(fe,ce)}),fe.promise}),je=function(){var B=new xe,X=L(B);this.promise=B,this.resolve=ye(qr,X),this.reject=ye(Xe,X)},q.f=T=function(B){return B===m||B===$e?new je(B):x(B)},!r&&f(y)&&N!==Object.prototype)){Qe=N.then,re||o(N,"then",function(X,oe){var ce=this;return new m(function(fe,He){i(Qe,ce,fe,He)}).then(X,oe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,C)}return e({global:!0,constructor:!0,wrap:!0,forced:G},{Promise:m}),$e=a.Promise,u(m,j,!1,!0),c(j),xl}var rf={},mo,tf;function Bp(){if(tf)return mo;tf=1;var e=ke(),r=e("iterator"),t=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){t=!0}};a[r]=function(){return this},Array.from(a,function(){throw 2})}catch{}return mo=function(i,o){try{if(!o&&!t)return!1}catch{return!1}var s=!1;try{var u={};u[r]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},mo}var go,nf;function Rn(){if(nf)return go;nf=1;var e=pt(),r=Bp(),t=Mt().CONSTRUCTOR;return go=t||!r(function(n){e.all(n).then(void 0,function(){})}),go}var af;function Hp(){if(af)return rf;af=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Dt(),o=Rn();return e({target:"Promise",stat:!0,forced:o},{all:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]=y,--R||f(p))},v)}),--R||f(p)});return d.error&&v(d.value),l.promise}}),rf}var of={},sf;function Gp(){if(sf)return of;sf=1;var e=Pe(),r=sr(),t=Mt().CONSTRUCTOR,n=pt(),a=Je(),i=we(),o=Ye(),s=n&&n.prototype;if(e({target:"Promise",proto:!0,forced:t,real:!0},{catch:function(c){return this.then(void 0,c)}}),!r&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return of}var uf={},cf;function Wp(){if(cf)return uf;cf=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Dt(),o=Rn();return e({target:"Promise",stat:!0,forced:o},{race:function(u){var c=this,l=n.f(c),f=l.reject,v=a(function(){var d=t(c.resolve);i(u,function(h){r(d,c,h).then(l.resolve,f)})});return v.error&&f(v.value),l.promise}}),uf}var lf={},ff;function Vp(){if(ff)return lf;ff=1;var e=Pe(),r=br(),t=Mt().CONSTRUCTOR;return e({target:"Promise",stat:!0,forced:t},{reject:function(a){var i=r.f(this),o=i.reject;return o(a),i.promise}}),lf}var df={},yo,vf;function Rv(){if(vf)return yo;vf=1;var e=rr(),r=Ke(),t=br();return yo=function(n,a){if(e(n),r(a)&&a.constructor===n)return a;var i=t.f(n),o=i.resolve;return o(a),i.promise},yo}var hf;function zp(){if(hf)return df;hf=1;var e=Pe(),r=Je(),t=sr(),n=pt(),a=Mt().CONSTRUCTOR,i=Rv(),o=r("Promise"),s=t&&!a;return e({target:"Promise",stat:!0,forced:t||a},{resolve:function(c){return i(s&&this===o?n:this,c)}}),df}var pf;function Kp(){return pf||(pf=1,Fp(),Hp(),Gp(),Wp(),Vp(),zp()),Ll}var mf={},gf;function Jp(){if(gf)return mf;gf=1;var e=Pe(),r=Le(),t=tr(),n=br(),a=ht(),i=Dt(),o=Rn();return e({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var c=this,l=n.f(c),f=l.resolve,v=l.reject,d=a(function(){var h=t(c.resolve),p=[],S=0,R=1;i(u,function(I){var g=S++,b=!1;R++,r(h,c,I).then(function(y){b||(b=!0,p[g]={status:"fulfilled",value:y},--R||f(p))},function(y){b||(b=!0,p[g]={status:"rejected",reason:y},--R||f(p))})}),--R||f(p)});return d.error&&v(d.value),l.promise}}),mf}var yf={},bf;function Yp(){if(bf)return yf;bf=1;var e=Pe(),r=Le(),t=tr(),n=Je(),a=br(),i=ht(),o=Dt(),s=Rn(),u="No one promise resolved";return e({target:"Promise",stat:!0,forced:s},{any:function(l){var f=this,v=n("AggregateError"),d=a.f(f),h=d.resolve,p=d.reject,S=i(function(){var R=t(f.resolve),I=[],g=0,b=1,y=!1;o(l,function(A){var q=g++,j=!1;b++,r(R,f,A).then(function(G){j||y||(y=!0,h(G))},function(G){j||y||(j=!0,I[q]=G,--b||p(new v(I,u)))})}),--b||p(new v(I,u))});return S.error&&p(S.value),d.promise}}),yf}var wf={},Sf;function Tv(){if(Sf)return wf;Sf=1;var e=Pe(),r=me(),t=Sv(),n=Pn(),a=br(),i=tr(),o=ht(),s=r.Promise,u=!1,c=!s||!s.try||o(function(){s.try(function(l){u=l===8},8)}).error||!u;return e({target:"Promise",stat:!0,forced:c},{try:function(l){var f=arguments.length>1?n(arguments,1):[],v=a.f(this),d=o(function(){return t(i(l),void 0,f)});return(d.error?v.reject:v.resolve)(d.value),v.promise}}),wf}var If={},Pf;function Ov(){if(Pf)return If;Pf=1;var e=Pe(),r=br();return e({target:"Promise",stat:!0},{withResolvers:function(){var n=r.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),If}var Ef={},Rf;function Qp(){if(Rf)return Ef;Rf=1;var e=Pe(),r=sr(),t=pt(),n=Ae(),a=Je(),i=we(),o=wv(),s=Rv(),u=Ye(),c=t&&t.prototype,l=!!t&&n(function(){c.finally.call({then:function(){}},function(){})});if(e({target:"Promise",proto:!0,real:!0,forced:l},{finally:function(v){var d=o(this,a("Promise")),h=i(v);return this.then(h?function(p){return s(d,v()).then(function(){return p})}:v,h?function(p){return s(d,v()).then(function(){throw p})}:v)}}),!r&&i(t)){var f=a("Promise").prototype.finally;c.finally!==f&&u(c,"finally",f,{unsafe:!0})}return Ef}var bo,Tf;function Xp(){if(Tf)return bo;Tf=1,qp(),ms(),Up(),Kp(),Jp(),Yp(),Tv(),Ov(),Qp(),hv();var e=En();return bo=e.Promise,bo}var wo,Of;function Zp(){if(Of)return wo;Of=1;var e=Xp();return yv(),wo=e,wo}var Cf={},_f;function em(){return _f||(_f=1,Tv()),Cf}var Af={},kf;function rm(){return kf||(kf=1,Ov()),Af}var So,qf;function tm(){if(qf)return So;qf=1;var e=Zp();return em(),rm(),So=e,So}tm();const Cv="sesamy-debug";function nm(e,r,t){const n=new Date;n.setTime(n.getTime()+t*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${e}=${r}; ${a}; path=/`}function am(e){if(typeof document>"u")return null;const r=e+"=",t=document.cookie.split(";");for(let n=0;n<t.length;n++){let a=t[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null}function im(e){nm(Cv,e.toString(),1)}function om(){return am(Cv)==="true"}function de(e){om()&&console.log(e)}function Lr(e,r){if(typeof window>"u")return;const t=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0});de(`Triggering event: ${e}`),dispatchEvent(t)}const sm=Object.freeze(Object.defineProperty({__proto__:null,triggerEvent:Lr},Symbol.toStringTag,{value:"Module"}));let _v=null;function Av(e){_v=e}function kv(){return _v}var er=(e=>(e.AUTH_INITIALIZED="sesamyJsAuthInitialized",e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(er||{});const um=Object.freeze(Object.defineProperty({__proto__:null,Events:er},Symbol.toStringTag,{value:"Module"})),qv="sesamy_is_authenticated";function cm(){try{return document.cookie.split(";").some(e=>e.trim().startsWith(`${qv}=true`))}catch{return!1}}function Io(e){try{const r=e?2592e3:0,t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${qv}=${e}; path=/; max-age=${r}; SameSite=Lax${t}`}catch{}}function lm(e={}){let r=e.baseUrl??"",t="",n=!1,a=null,i=null;async function o(){try{const u=await fetch(`${r}/auth/userinfo`,{credentials:"include",headers:{Accept:"application/json"}});return u.ok?await u.json():null}catch(u){return de(`[cookie-auth] Failed to fetch userinfo: ${u.message}`),null}}const s={async init(u){if(t=u.vendorId||u.clientId||"",de(`[cookie-auth] Initializing with baseUrl: ${r}`),cm()){const c=await o();c===null?de("[cookie-auth] userinfo fetch failed transiently; retaining session hint"):c.authenticated&&c.sub?(a=!0,i=c,Io(!0),Lr(er.AUTHENTICATED,{sub:c.sub,appState:void 0})):(a=!1,Io(!1))}else a=!1;n=!0,Lr(er.AUTH_INITIALIZED,{})},async isAuthenticated(){if(!n)return!1;if(a!==null)return a;const u=await o();return u===null?(de("[cookie-auth] userinfo fetch failed transiently in isAuthenticated; will retry"),!1):(a=u.authenticated,a)},async getTokenSilently(u,c){return null},async getUser(){if(!n)return null;if(i)return i;const u=await o();return u?.authenticated&&u.sub?(i=u,i):null},async login(u){if(!t)throw new Error("[cookie-auth] vendorId is required to build a login URL");const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/${encodeURIComponent(t)}/login`,window.location.origin);l.searchParams.set("return_to",c),window.location.href=l.toString()},async loginWithRedirect(u){return s.login(u)},async loginWithPopup(u){return de("[cookie-auth] loginWithPopup called — falling back to redirect"),s.login(u)},async logout(u){a=!1,i=null,Io(!1),Lr(er.LOGOUT,{});const c=u?.returnTo??window.location.href,l=new URL(`${r}/auth/logout`,window.location.origin);l.searchParams.set("return_to",c),u?.localOnly&&l.searchParams.set("local_only","true"),window.location.href=l.toString()}};return s}const fm="sesamyAccessToken";let qt=!1;function Cr(){const e=kv();if(!e)throw new Error("[sesamy-js] No auth plugin registered. This should not happen.");return e}async function dm(e){if(e.enabled===!1){de("Auth disabled via config"),qt=!0;return}if(e.useHttpCookies)de("useHttpCookies=true — using cookie-based BFF plugin"),Av(lm());else if(!kv())throw new Error("[sesamy-js] No auth plugin registered. Load the auth0-plugin bundle before sesamy-js, or set useHttpCookies: true to use the cookie-based BFF plugin.");await Cr().init(e),qt=!0}async function dr(){return qt?Cr().isAuthenticated():!1}async function fr(e=!0,r=!1){return qt?Cr().getTokenSilently(e,r):null}async function vm(){return qt?Cr().getUser():null}async function hm(e){return Cr().login(e)}async function Ss(e){return Cr().loginWithRedirect(e)}async function pm(e){return Cr().loginWithPopup(e)}async function mm(e={}){return Cr().logout(e)}async function Do(e){const r=e.split(".");if(r.length!==3)throw new Error("Invalid token");const t=decodeURIComponent(atob(r[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(o=>"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)).join("")),n=JSON.parse(t);if(!n?.exp||n.exp<Date.now()/1e3)throw new Error("Invalid token");de("Set token"),localStorage.setItem(fm,e);const{triggerEvent:a}=await Promise.resolve().then(()=>sm),{Events:i}=await Promise.resolve().then(()=>um);a(i.AUTHENTICATED,{...n,appState:void 0})}const gm=(e,r)=>r.skipDedupe||r.method!=="GET",ym=(e,r)=>r.method+"@"+e,bm=e=>e.clone(),wm=({skip:e=gm,key:r=ym,resolver:t=bm}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Sm=(e,r)=>e*r,Im=e=>e&&e.ok,Pm=({delayTimer:e=500,delayRamp:r=Sm,maxAttempts:t=10,until:n=Im,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})};let Po=class $v extends Error{status;statusText;url;body;constructor(r,t,n,a,i){super(a),this.name="APIError",this.status=r,this.statusText=t,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,$v)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var rn=(e=>(e.BROWSER="browser",e.NORMAL="normal",e))(rn||{});const Em="application/json",Uv="Content-Type",Zr=Symbol(),Lv=Symbol();function $f(e={}){var r;const t=e instanceof Array?Object.fromEntries(e):e;return(r=Object.entries(t).find(([n])=>n.toLowerCase()===Uv.toLowerCase()))===null||r===void 0?void 0:r[1]}function Uf(e){return/^application\/.*json.*/.test(e)}const xr=function(e,r,t=!1){return Object.entries(r).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=t?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=xr(o,i,t):n[a]=i,n},{...e})},st={options:{},errorType:"text",polyfills:{},polyfill(e,r=!0,t=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(r&&!a)throw new Error(e+" is not defined");return t&&a?new a(...n):a}};function Rm(e,r=!1){st.options=r?e:xr(st.options,e)}function Tm(e,r=!1){st.polyfills=r?e:xr(st.polyfills,e)}function Om(e){st.errorType=e}const Cm=e=>r=>e.reduceRight((t,n)=>n(t),r)||r;let xv=class extends Error{};const _m=e=>{const r=Object.create(null);e=e._addons.reduce((g,b)=>b.beforeRequest&&b.beforeRequest(g,e._options,r)||g,e);const{_url:t,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,c=new Map(i),l=xr(a.options,n);let f=t;const v=Cm(s)((g,b)=>(f=g,a.polyfill("fetch")(g,b)))(t,l),d=new Error,h=v.catch(g=>{throw{[Zr]:g}}).then(g=>{var b;if(!g.ok){const y=new xv;if(y.cause=d,y.stack=y.stack+`
|
|
2
|
+
CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw y;const A=a.errorType==="json"||((b=g.headers.get("Content-Type"))===null||b===void 0?void 0:b.split(";")[0])==="application/json";return(a.errorType?A?g.text():g[a.errorType]():Promise.resolve(g.body)).then(q=>{if(y.message=typeof q=="string"?q:g.statusText,q)if(A&&typeof q=="string"){y.text=q;try{y.json=JSON.parse(q)}catch{}}else y[a.errorType]=q;throw y})}return g}),p=g=>g.catch(b=>{const y=Object.prototype.hasOwnProperty.call(b,Zr),A=y?b[Zr]:b,q=A?.status&&c.get(A.status)||c.get(A?.name)||y&&c.has(Zr)&&c.get(Zr);if(q)return q(A,e);const j=c.get(Lv);if(j)return j(A,e);throw A}),S=g=>b=>p(g?h.then(y=>y&&y[g]()).then(y=>b?b(y):y):h.then(y=>b?b(y):y)),R={_wretchReq:e,_fetchReq:v,_sharedState:r,res:S(null),json:S("json"),blob:S("blob"),formData:S("formData"),arrayBuffer:S("arrayBuffer"),text:S("text"),error(g,b){return c.set(g,b),this},badRequest(g){return this.error(400,g)},unauthorized(g){return this.error(401,g)},forbidden(g){return this.error(403,g)},notFound(g){return this.error(404,g)},timeout(g){return this.error(408,g)},internalError(g){return this.error(500,g)},fetchError(g){return this.error(Zr,g)}},I=u.reduce((g,b)=>({...g,...typeof b.resolver=="function"?b.resolver(g):b.resolver}),R);return o.reduce((g,b)=>b(g,e),I)},Am={_url:"",_options:{},_config:st,_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,r=!1){return{...this,_config:{...this._config,polyfills:r?e:xr(this._config.polyfills,e)}}},url(e,r=!1){if(r)return{...this,_url:e};const t=this._url.split("?");return{...this,_url:t.length>1?t[0]+e+"?"+t[1]:this._url+e}},options(e,r=!1){return{...this,_options:r?e:xr(this._options,e)}},headers(e){const r=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:xr(this._options,{headers:r})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Uv]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,r){const t=new Map(this._catchers);return t.set(e,r),{...this,_catchers:t}},catcherFallback(e){return this.catcher(Lv,e)},resolve(e,r=!1){return{...this,_resolvers:r?[e]:[...this._resolvers,e]}},defer(e,r=!1){return{...this,_deferred:r?[e]:[...this._deferred,e]}},middlewares(e,r=!1){return{...this,_middlewares:r?e:[...this._middlewares,...e]}},fetch(e=this._options.method,r="",t=null){let n=this.url(r).options({method:e});const a=$f(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof t=="object"&&!(i&&t instanceof i)&&(!n._options.headers||!a||Uf(a));return n=t?o?n.json(t,a):n.body(t):n,_m(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,r=""){return this.fetch("PUT",r,e)},post(e,r=""){return this.fetch("POST",r,e)},patch(e,r=""){return this.fetch("PATCH",r,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,r){const t=$f(this._options.headers);return this.content(r||Uf(t)&&t||Em).body(JSON.stringify(e))}};function or(e="",r={}){return{...Am,_url:e,_options:r}}or.default=or;or.options=Rm;or.errorType=Om;or.polyfills=Tm;or.WretchError=xv;const km=(e,r)=>r.skipDedupe||r.method!=="GET",qm=(e,r)=>r.method+"@"+e,$m=e=>e.clone(),Um=({skip:e=km,key:r=qm,resolver:t=$m}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=r(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,c)=>{n.get(s).push([u,c])});try{return a(i,o).then(u=>(n.get(s).forEach(([c])=>c(t(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,c])=>c(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Lm=(e,r)=>r.skipCache||r.method!=="GET",xm=(e,r)=>r.method+"@"+e,Nm=()=>!1,jm=()=>null,Dm=e=>e.ok,Mm=({throttle:e=1e3,skip:r=Lm,key:t=xm,clear:n=Nm,invalidate:a=jm,condition:i=Dm,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,c=new Set,l=v=>{e&&!c.has(v)&&(c.add(v),setTimeout(()=>{c.delete(v)},e))},f=v=>(d,h)=>{const p=t(d,h);let S=a(d,h);if(S&&(S instanceof Array||(S=[S]),S.forEach(R=>{typeof R=="string"?s.delete(R):R instanceof RegExp&&s.forEach((I,g)=>{R.test(g)&&s.delete(g)})})),n(d,h)&&s.clear(),r(d,h))return v(d,h);if(c.has(p)){if(s.has(p)){const R=s.get(p).clone();return o&&Object.defineProperty(R,o,{value:p,enumerable:!1}),Promise.resolve(R)}else if(u.has(p))return new Promise((R,I)=>{u.get(p).push([R,I])})}return u.has(p)||u.set(p,[]),l(p),v(d,h).then(R=>(i(R.clone())&&s.set(p,R.clone()),u.get(p).forEach(([I])=>I(R.clone())),u.delete(p),R)).catch(R=>{throw u.get(p).forEach(([,I])=>I(R)),u.delete(p),R})};return f.cacheResponse=function(v,d){l(v),s.set(v,d)},f.cache=s,f.inflight=u,f.throttling=c,f},Fm=(e,r)=>e*r,Bm=e=>e&&e.ok,Hm=({delayTimer:e=500,delayRamp:r=Fm,maxAttempts:t=10,until:n=Bm,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(c,l)=>{let f=0;if(s&&s(c,l))return u(c,l);const v=(d,h)=>Promise.resolve(n(d,h)).then(p=>p?d&&o?d:h?Promise.reject(h):d:(f++,!t||f<=t?new Promise(S=>{const R=r(e,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:h,url:c,options:l})).then((I={})=>{var g,b;S(u((g=I&&I.url)!==null&&g!==void 0?g:c,(b=I&&I.options)!==null&&b!==void 0?b:l))}):S(u(c,l))},R)}).then(v).catch(S=>{if(!i)throw S;return v(null,S)}):d&&o?d:Promise.reject(h||new Error("Number of attempts exceeded."))));return u(c,l).then(v).catch(d=>{if(!i)throw d;return v(null,d)})},Gm="@sesamy/sdk",Wm="1.23.0";let Vm=class{cache=new Map;get(r){return this.cache.get(r)||null}set(r,t){this.cache.set(r,t)}remove(r){this.cache.delete(r)}clear(){this.cache.clear()}};const Tt="sesamyCacheTimestamp",zm=e=>{const{libraryName:r=Gm,libraryVersion:t=Wm,cache:n}=e,a=n?.storage||new Vm,i=[s=>async(u,c)=>{if(n?.mode===rn.BROWSER){let l;typeof sessionStorage<"u"?(l=sessionStorage.getItem(Tt),l||(l=Date.now().toString(),sessionStorage.setItem(Tt,l))):(l=a.get(Tt),l||(l=Date.now().toString(),a.set(Tt,l)));const f={...c,headers:{...c.headers,"Cache-Timestamp":l}};return s(u,f)}return s(u,c)},s=>async(u,c)=>{const l=await e.tokenProvider();if(l===null)return s(u,c);const f={...c,headers:{...c.headers,Authorization:l}};return s(u,f)},Um()];n?.mode===rn.NORMAL&&i.push(Mm({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Hm({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=or(e.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${r}/${t}`,...e.headers}).middlewares(i);return{async request(s,u={}){try{const c=/^https?:\/\//.test(s);let l=o.url(s,c);u.headers&&(l=l.headers(u.headers));const f=(u.method||"GET").toLowerCase();let v;switch(f){case"get":v=l.get();break;case"post":v=l.post(u.body);break;case"put":v=l.put(u.body);break;case"patch":v=l.patch(u.body);break;case"delete":v=l.delete();break;default:v=l.get()}const d=await v.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&vr(),d.status===204)return null;if(!d.ok){const h=await d.text().catch(()=>"Unknown error");throw new Po(d.status,d.statusText,d.url,`API Error ${d.status}: ${h}`,h)}return await d.json()}catch(c){if(c instanceof Po)throw c;const l=c.status||500,f=c.message||"Unknown error",v=`${e.baseUrl}${s}`;throw new Po(l,f,v,`API Error ${l}: ${c.message||"Unknown error"}`,c.message||"Unknown error")}}}},vr=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Tt),"Cache cleared"),St={get:async(e,r)=>e.request(`/profile/${r}`),update:async(e,r,t)=>e.request(`/profile/${r}`,{method:"PATCH",body:JSON.stringify(t)}),checkSpotifyLink:async e=>e.request("/profile/spotify-link"),unlinkSpotify:async e=>e.request("/profile/unlink-spotify",{method:"POST"}),delete:async e=>{await e.request("/profile",{method:"DELETE"})}},Eo={list:async(e,r)=>{const t=new URLSearchParams;r?.type&&t.append("type",r.type),r?.sku&&t.append("sku",r.sku),r?.purchaseOptionId&&t.append("purchase-option-id",r.purchaseOptionId),r?.waitForEntitlementAfter&&t.append("wait-for-entitlement-after",r.waitForEntitlementAfter);const n=t.toString(),a=n?`/entitlements?${n}`:"/entitlements";return e.request(a)},get:async(e,r)=>e.request(`/entitlements/${r}`),getAccess:async(e,r)=>e.request(`/entitlements/${r}/access`)},Lf={list:async e=>e.request("/subscriptions"),get:async(e,r)=>e.request(`/subscriptions/${r}`)},xf={get:async(e,r)=>e.request(`/products/${r}`),autoOnboard:async(e,r)=>e.request(`/products/${r}/auto-onboard`,{method:"POST"})},Km=(e,r)=>{if(!e||!r)return e;const t=new URL(e);return t.hash=`access_token=${r}`,t.toString()},Nf=(e,r)=>!e.manageUrl||!r?e:{...e,manageUrl:Km(e.manageUrl,r)},It={list:async e=>e.request("/contracts"),get:async(e,r)=>e.request(`/contracts/${r}`),cancel:async(e,r)=>e.request(`/contracts/${r}/cancel`,{method:"POST"}),createAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments`,{method:"POST",body:JSON.stringify(t)}),confirmAmendment:async(e,r,t)=>e.request(`/contracts/${r}/amendments/${t}/confirm`,{method:"POST"})},Ro={get:async e=>e.request("/user-metadata"),set:async(e,r,t)=>{await e.request(`/user-metadata/${r}`,{method:"PUT",body:t})},delete:async(e,r)=>{await e.request(`/user-metadata/${r}`,{method:"DELETE"})}},et={list:async e=>e.request("/tallies"),get:async(e,r)=>e.request(`/tallies/${r}`),update:async(e,r,t)=>e.request(`/tallies/${r}`,{method:"PUT",body:JSON.stringify(t)}),create:async(e,r)=>e.request("/tallies",{method:"POST",body:JSON.stringify(r)}),delete:async(e,r)=>{try{return await e.request(`/tallies/${r}`,{method:"DELETE"}),!0}catch{return!1}},push:async(e,r,t)=>e.request(`/tallies/${r}/push`,{method:"POST",body:JSON.stringify(t)})},To={list:async e=>e.request("/tags"),add:async(e,r)=>{await e.request("/tags",{method:"POST",body:JSON.stringify({tag:r})})},remove:async(e,r)=>{await e.request(`/tags/${r}`,{method:"DELETE"})}},rt={generateCheckoutLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},generateAccountLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}${r.contractId?`/${encodeURIComponent(r.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateChangePlanLink:(e,r)=>{const t=r.language||"en",n=new URL(`${e.baseUrl}/account/${encodeURIComponent(t)}/subscriptions/${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()},generateConsumeLink:(e,r)=>{const t=r.language||"en";let n=new URL(`${e.baseUrl}/consume/${encodeURIComponent(t)}/@${encodeURIComponent(e.clientId)}/${encodeURIComponent(r.sku)}`);return r.episodeId?n.href+=`/${encodeURIComponent(r.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",r.redirectUrl||"/"),n.toString()}},Oo={generateLink:(e,r)=>{const t=new URL(`${e.apiUrl}/checkouts`);return r.items&&t.searchParams.set("items",JSON.stringify(r.items)),r.email&&t.searchParams.set("email",r.email),r.language&&t.searchParams.set("lang",r.language),r.redirectUrl&&t.searchParams.set("redirect-url",r.redirectUrl),r.giftMode&&t.searchParams.set("gift-mode","true"),r.payerEmail&&t.searchParams.set("payer-email",r.payerEmail),r.requireAddress&&t.searchParams.set("require-address","true"),r.metadata&&Object.entries(r.metadata).forEach(([n,a])=>{t.searchParams.set(`metadata.${n}`,a)}),t.toString()},create:async(e,r)=>e.request("/checkouts",{method:"POST",body:JSON.stringify(r)}),get:async(e,r)=>e.request(`/checkouts/${r}`),update:async(e,r,t)=>e.request(`/checkouts/${r}`,{method:"PATCH",body:JSON.stringify(t)})},jf={list:async e=>e.request("/bills"),get:async(e,r)=>e.request(`/bills/${r}`)},Df={list:async e=>e.request("/fulfillments"),create:async(e,r)=>e.request("/fulfillments",{method:"POST",body:JSON.stringify(r)})},Jm={get:async(e,r)=>{try{return new URL(r),e.request(r)}catch{return e.request(`/paywalls/${r}`)}}},Ym={list:async e=>e.request("/payment-issues")},Qm={content:async(e,r,t,n,a)=>{const i=new URLSearchParams({url:r});return t&&i.append("selector",t),n&&i.append("cache",n),e.request(`/proxy?${i.toString()}`,a)}},Xm={list:async(e,r)=>{const t=(r?new URLSearchParams({q:r}):new URLSearchParams).toString(),n=t?`/transactions?${t}`:"/transactions";return e.request(n)}},Mf={get:async e=>e.request("/vendor"),list:async e=>e.request("/vendors")},Zm=e=>{const r=zm(e);return{profile:{get:t=>St.get(r,t),update:(t,n)=>St.update(r,t,n),checkSpotifyLink:()=>St.checkSpotifyLink(r),unlinkSpotify:()=>St.unlinkSpotify(r),delete:()=>St.delete(r)},entitlements:{list:t=>Eo.list(r,t),get:t=>Eo.get(r,t),getAccess:t=>Eo.getAccess(r,t)},subscriptions:{list:()=>Lf.list(r),get:t=>Lf.get(r,t)},products:{get:t=>xf.get(r,t),autoOnboard:t=>xf.autoOnboard(r,t)},contracts:{list:async()=>{const t=await It.list(r),n=await e.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return t;const a=n.substring(7);return t.map(i=>Nf(i,a))},get:async t=>{const n=await It.get(r,t),a=await e.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return Nf(n,i)},cancel:t=>It.cancel(r,t),createAmendment:(t,n)=>It.createAmendment(r,t,n),confirmAmendment:(t,n)=>It.confirmAmendment(r,t,n)},userMetadata:{get:()=>Ro.get(r),set:(t,n)=>Ro.set(r,t,n),delete:t=>Ro.delete(r,t)},tallies:{list:()=>et.list(r),get:t=>et.get(r,t),update:(t,n)=>et.update(r,t,n),create:t=>et.create(r,t),delete:t=>et.delete(r,t),push:(t,n)=>et.push(r,t,n)},tags:{list:()=>To.list(r),add:t=>To.add(r,t),remove:t=>To.remove(r,t)},checkouts:{generateLink:(t,n)=>rt.generateCheckoutLink(t,n),create:t=>Oo.create(r,t),get:t=>Oo.get(r,t),update:(t,n)=>Oo.update(r,t,n)},links:{generateCheckoutLink:(t,n)=>rt.generateCheckoutLink(t,n),generateAccountLink:(t,n)=>rt.generateAccountLink(t,n),generateChangePaymentLink:(t,n)=>rt.generateChangePaymentLink(t,n),generateChangePlanLink:(t,n)=>rt.generateChangePlanLink(t,n),generateConsumeLink:(t,n)=>rt.generateConsumeLink(t,n)},bills:{list:()=>jf.list(r),get:t=>jf.get(r,t)},fulfillments:{list:()=>Df.list(r),create:t=>Df.create(r,t)},paywalls:{get:t=>Jm.get(r,t)},paymentIssues:{list:()=>Ym.list(r)},proxy:{content:(t,n,a,i)=>Qm.content(r,t,n,a,i)},transactions:{list:t=>Xm.list(r,t)},vendor:{get:()=>Mf.get(r),list:()=>Mf.list(r)}}},eg="sesamy.com",rg="sesamy.dev",tg="https://sesa.my",Ff="sesamyCacheTimestamp",Bf="sesamyContentReloaded";class ng{get(r){return typeof sessionStorage>"u"?null:sessionStorage.getItem(r)}set(r,t){typeof sessionStorage<"u"&&sessionStorage.setItem(r,t)}remove(r){typeof sessionStorage<"u"&&sessionStorage.removeItem(r)}clear(){}}function ag(e,r){return`${e}.${r==="dev"?rg:eg}`}function ir(e,r){return`https://${ag(e,r)}`}function Qt(){let r=(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en";return r==="nn"&&(r="nb"),r}function Mo(e){let r;try{r=new URL(e)}catch{return!1}return r.protocol==="http:"||r.protocol==="https:"}function Nv(e,r){if(Mo(e))return{itemSrc:e};const t=e.split(":");if(t.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${t.length}`);const[n,a,i]=t;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:r||i}}function Hf(e){return e.endsWith("/")?e.slice(0,-1):e}function Gf(e,r){if(!Mo(e)||!Mo(r))return!1;const t=new URL(e),n=new URL(r);return t.origin===n.origin&&Hf(t.pathname)===Hf(n.pathname)}function ig(e,r,t){const n=new URL(`${ir("checkout3",e.environment)}`);r.language&&n.searchParams.set("lang",r.language);let a=r.sku,i=r.purchaseOptionId,o=r.itemSrc;if(r.itemSrc){const l=Nv(r.itemSrc,r.purchaseOptionId);a=l.sku||a,i=l.purchaseOption||i,o=l.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),r.email&&n.searchParams.set("email",r.email),r.business&&n.searchParams.set("business","true"),r.currency&&n.searchParams.set("currency",r.currency),r.price&&n.searchParams.set("price",r.price.toString()),r.discountCode&&n.searchParams.set("discount-code",r.discountCode),r.attributionItemSrc?n.searchParams.set("itemSrc",r.attributionItemSrc):t.itemSrc&&n.searchParams.set("itemSrc",t.itemSrc),r.attributionPublisherContentId?n.searchParams.set("publisherContentId",r.attributionPublisherContentId):t.publisherContentId&&n.searchParams.set("publisherContentId",t.publisherContentId),r.utmSource?n.searchParams.set("utm_source",r.utmSource):t.utmSource&&n.searchParams.set("utm_source",t.utmSource),r.utmMedium?n.searchParams.set("utm_medium",r.utmMedium):t.utmMedium&&n.searchParams.set("utm_medium",t.utmMedium),r.utmCampaign?n.searchParams.set("utm_campaign",r.utmCampaign):t.utmCampaign&&n.searchParams.set("utm_campaign",t.utmCampaign),r.utmTerm?n.searchParams.set("utm_term",r.utmTerm):t.utmTerm&&n.searchParams.set("utm_term",t.utmTerm),r.utmContent?n.searchParams.set("utm_content",r.utmContent):t.utmContent&&n.searchParams.set("utm_content",t.utmContent);const s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(l=>{const[f,v]=l.trim().split("=");return{key:f,value:v}}).filter(l=>s.some(f=>f===l.key)).forEach(l=>{n.searchParams.append(l.key,l.value)});let c=new URL(window.location.href);if(r.redirectUrl)try{c=new URL(r.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",r.redirectUrl)}return c.searchParams.set("force-refetch-entitlements","true"),r.itemSrc&&c.searchParams.set("sesamy-purchase",r.itemSrc),n.searchParams.set("redirect-url",c.toString()),r.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",r.paymentMethodsFilter.flatMap(({provider:l,methods:f})=>f?f.map(v=>`${l}|${v}`):l).join(",")),r.requireAddress&&n.searchParams.set("require-address","true"),r.giftMode&&n.searchParams.set("gift-mode","true"),r.payerEmail&&n.searchParams.set("payer-email",r.payerEmail),r.metadata&&Object.entries(r.metadata).forEach(([l,f])=>{n.searchParams.set(`metadata.${l}`,String(f))}),n}const jv="sesamySignedURLs";function Is(){const e=sessionStorage.getItem(jv);return e?JSON.parse(e):[]}function Wf(e){const r=Is();r.push(e),de(`Adding signed URL: ${e}`),sessionStorage.setItem(jv,JSON.stringify(r))}function og(e){const r={};return Object.keys(e).forEach(t=>{const n=e[t];n!=null&&(r[t]=n.toString())}),r}const Fo="sesamyAttribution";function sg(e){const r=localStorage.getItem(e);if(!r)return null;try{return JSON.parse(r).value}catch{return console.error(`Failed to parse ${e}`),null}}function ug(e){return Object.keys(e).find(r=>r.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...e}:e}function tn(){return sg(Fo)||{}}function Dv(e){if(e===null)localStorage.removeItem(Fo);else{de(`Setting attribution ${JSON.stringify(e)}`);const r=tn()??{},t=og({...r,...ug(e)});localStorage.setItem(Fo,JSON.stringify({value:t}))}}const Ps="@sesamy/sesamy-js",Ft="1.94.0",Mv="sesamyFlags";async function Fv(e){try{localStorage.setItem(Mv,JSON.stringify(e))}catch{de("Failed to save flags to localStorage")}}async function Bv(e,r){const t=await Bt();t[e]=r,await Fv(t)}async function Hv(e){return(await Bt())[e]}async function Gv(e){const r=await Bt();e in r&&(delete r[e],await Fv(r))}async function Bt(){try{const e=localStorage.getItem(Mv);return e?JSON.parse(e):{}}catch{return{}}}function Wv(e){function r(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function t(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=r(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,c=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===c).length>1?a.unshift(`${c}:nth-child(${u})`):a.unshift(c)}i=i.parentElement}return a.join(" > ")}return t(e)}function Vv(e){return e?Object.fromEntries(Object.entries(e).filter(([r,t])=>t!==void 0)):{}}function cg(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}let Me={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},zv=[],Kv=!1,Rr;function Es(){const e=window.location.pathname,r=new URLSearchParams(window.location.search),t=navigator.userAgent;return zv.find(n=>{if(n.path&&!e.includes(n.path)||n.queryParam&&r.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!t.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!t.includes(n.userAgentContains))})}function lg(){return Es()}function fg(e,r){zv=e.content||[];const t=Es();t&&t.type==="article"&&(Me={...Me,...Vv(t.selectors)},Kv=t.enablePaywallSettingsUrlFallback||!1),Rr=r}function dg(e,r){const{selector:t,attribute:n}=r;return t===Me.article.selector||n&&e.hasAttribute(n)?e:e.querySelector(t)}function Jv(e,r,t=!1){if(e){if(r.attribute){if(r.attribute==="textContent")return e.textContent??void 0;const n=e.getAttribute(r.attribute),a=Jv(e.parentElement,r,t);if(t){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return e.textContent??void 0}}function ge(e){const r=document.head.querySelectorAll(`[property~='${e}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content;const t=document.head.querySelectorAll(`[name~='${e}'][content]`);for(let n=0;n<t.length;n+=1)if(t[n].content)return t[n].content}function Ot(e){const r=[];return document.head.querySelectorAll(`[property~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),document.head.querySelectorAll(`[name~='${e}'][content]`).forEach(a=>{a.content&&r.push(a.content)}),r}let Ct=null;function Yv(){const e=[],r=document.querySelectorAll('script[type="application/ld+json"]');for(const t of r)try{const n=JSON.parse(t.textContent||"");Array.isArray(n)?e.push(...n):n["@graph"]&&Array.isArray(n["@graph"])?e.push(...n["@graph"]):e.push(n)}catch{}return e}function _t(e){const r=Yv(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.find(t)||null}function vg(e){const r=Yv(),t=n=>!e||n["@type"]===e||Array.isArray(n["@type"])&&n["@type"].includes(e);return r.filter(t)}function Bo(e,r,t){if(!e||typeof e!="object")return typeof e=="string"?e:void 0;const a=e[r];if(typeof a=="string")return a;if(a&&typeof a=="object"&&t)return a[t]}function hg(e){if(!e)return;const t=(Array.isArray(e)?e:[e]).map(n=>{if(typeof n=="string")return{name:n};if(typeof n=="object"&&n!==null){const a=n,i=a.name;return i?{name:i,url:a.url,image:Bo(a,"image","url"),jobTitle:a.jobTitle,sameAs:a.sameAs}:null}return null}).filter(n=>n!==null&&!!n.name);return t.length>0?t:void 0}function Co(e){if(Array.isArray(e))return e.filter(r=>typeof r=="string");if(typeof e=="string"){const r=e.split(",").map(t=>t.trim()).filter(Boolean);return r.length>0?r:void 0}}function Qv(){if(Ct)return Ct;const e=_t("NewsArticle")||_t("Article")||_t("BlogPosting")||_t("WebPage"),r=(...a)=>a.find(i=>i!=null&&i!=="")||void 0,t=(...a)=>a.find(i=>i&&i.length>0),n={contentType:e?Array.isArray(e["@type"])?e["@type"][0]:e["@type"]:void 0,authors:hg(e?.author)||(Ot("article:author").length>0?Ot("article:author").map(a=>({name:a})):void 0)||(ge("author")?[{name:ge("author")}]:void 0),keywords:t(Co(e?.keywords),Co(ge("keywords"))),tags:Ot("article:tag").length>0?Ot("article:tag"):void 0,categories:Co(ge("news_keywords")),section:r(e?.articleSection,ge("article:section")),publishedAt:r(e?.datePublished,ge("article:published_time")),modifiedAt:r(e?.dateModified,ge("article:modified_time")),ogType:ge("og:type"),ogSiteName:ge("og:site_name"),ogLocale:ge("og:locale"),twitterCard:ge("twitter:card"),twitterSite:ge("twitter:site"),twitterCreator:ge("twitter:creator"),creator:r(ge("creator"),ge("dc.creator")),mainEntityOfPage:e?Bo(e.mainEntityOfPage,"@id")||(typeof e.mainEntityOfPage=="string"?e.mainEntityOfPage:void 0):void 0,isAccessibleForFree:typeof e?.isAccessibleForFree=="boolean"?e.isAccessibleForFree:void 0,wordCount:typeof e?.wordCount=="number"?e.wordCount:void 0,publisher:e?.publisher&&typeof e.publisher=="object"?{name:e.publisher.name||"",url:e.publisher.url,logo:Bo(e.publisher,"logo","url")}:void 0};return Ct=Vv(n),Ct}function pg(){Ct=null}function Rs({publisherContentId:e,key:r,defaultValue:t=""}){const n=e?document.body.querySelector(`sesamy-content-data[id='${e}']`):null,a=r.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(r)||ge(`sesamy:${r}`)||ge(`sesamy:${a}`)||ge(`og:${r}`)||ge(r)||t}function Xv(){const e=document.querySelectorAll(Me.article.selector);return Array.from(e).map(Ht).filter(r=>r!==null)}function Ht(e){const r=typeof e=="string"?document.querySelector(e):e;if(!r)return null;const t={element:r,selector:typeof e=="string"?e:Wv(r)},n=(i,o,s,u)=>{const{transform:c,collect:l=!1}=u||{},f=dg(r,o),v=Jv(f,o,l),d=Rs({publisherContentId:s,key:cg(String(i))}),h=v||d||void 0;h&&(t[i]=c?c(h):h)};n("id",Me.id),n("title",Me.title,t.id),n("excerpt",Me.excerpt,t.id),n("image",Me.image,t.id),n("price",Me.price,t.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",Me.currency,t.id),n("url",Me.url,t.id),n("pass",Me.pass,t.id,{collect:!0}),n("paywallUrl",Me.paywallUrl,t.id),n("accessLevel",Me.accessLevel,t.id,{transform:i=>i||"entitlement"});const a=Es();if(a&&a.type==="article"&&(a.pass&&(t.pass=t.pass?`${t.pass},${a.pass}`:a.pass),a.price&&!t.price&&(t.price=a.price.amount),a.price?.currency&&!t.currency&&(t.currency=a.price.currency),a.paywallUrl&&!t.paywallUrl&&(t.paywallUrl=a.paywallUrl)),Kv&&!t.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(t.paywallUrl=o)}}return t.url||(t.url=window.location.href),t.metadata=Qv(),t}async function mg(e){const r=Ht(e);if(!r)throw new Error("Could not find article element");if(r.accessLevel==="public")return!0;if(r.accessLevel==="logged-in"&&!r.paywallUrl)return await Rr.auth.isAuthenticated()?!0:null;if(r.paywallUrl&&((await Rr.paywalls.get(r.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await Rr.auth.isAuthenticated()?!0:null;if(!r.url)throw new Error("Article must have a URL");return await Rr.entitlements.hasAccess(r.url,r.pass?.split(",")||[])||null}async function Zv(e,r){const t=typeof e=="string"?document.querySelector(e):e;if(!t)throw new Error("Could not find element");const n=Ht(t);if(!n?.url)throw new Error("Could not find content for element");const a=await Rr.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");let i;if(!a.id&&a.token)i=a.token;else{const s=await Rr.entitlements.access(a.id);if(!s.token)throw new Error("Could not get access token");i=s.token}const o=r||Wv(t.parentElement||t);return Rr.proxy.getContent(i,n.url,o)}function eh(e,r={}){const{closeOnBackdropClick:t=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=r,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof e=="string"?u.innerHTML=e:u.appendChild(e),s.appendChild(u);const c=()=>{s.remove(),n&&document.removeEventListener("keydown",l)},l=f=>{f.key==="Escape"&&c()};return t&&s.addEventListener("click",f=>{f.target===s&&c()}),n&&document.addEventListener("keydown",l),document.body.appendChild(s),{element:s,close:c}}function gg(e,r={}){const{position:t="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=r,c=document.createElement("div");c.setAttribute("data-sesamy-notification-bar","true"),c.setAttribute("data-sesamy-notification-position",t),Object.assign(c.style,{position:n?"fixed":"absolute",[t]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof e=="string"?c.innerHTML=e:c.appendChild(e);let l,f,v;const d=()=>{if(v&&clearTimeout(v),o&&s){const h=document.documentElement;h.style.transform=l||"",setTimeout(()=>{c.remove(),h.style.transition=f||""},parseFloat(u)*1e3)}else c.remove()};if(i&&(v=setTimeout(d,i)),o&&s){const h=document.documentElement;l=h.style.transform,f=h.style.transition,h.style.transition=`transform ${u} ease`,c.style.transition=`transform ${u} ease`,t==="top"?(h.style.transform=`translateY(${s})`,c.style.transform=`translateY(-${s})`):(h.style.transform=`translateY(-${s})`,c.style.transform=`translateY(${s})`),document.documentElement.prepend(c)}else document.body.appendChild(c);return{element:c,close:d}}function yg(e){const r=e.endpoint??ir("api2",e.environment),n=Zm({baseUrl:r,tokenProvider:async()=>{if(await dr())try{const U=await fr(!1);return U?`Bearer ${U}`:null}catch{}const m=localStorage.getItem("__anon_id");return`Basic ${btoa(`${e.vendorId||e.clientId}|${m}:`)}`},libraryName:Ps,libraryVersion:Ft,vendorId:e.vendorId,cache:{mode:rn.BROWSER,storage:new ng}}),a=m=>async(C,U)=>{let F=sessionStorage.getItem(Ff);F||(F=Date.now().toString(),sessionStorage.setItem(Ff,F));const w={...U,headers:{...U.headers,"Cache-Timestamp":F}};return m(C,w)},i=(m=!0)=>C=>async(U,F)=>{const w=await fr(m);if(!w){if(await dr()){const x={...F,credentials:"include"};return C(U,x)}if(m)throw new Error("No access token available");return C(U,F)}const T={...F,headers:{...F.headers,Authorization:`Bearer ${w}`}};return C(U,T)},o=or(r).headers({"Content-Type":"application/json"}).middlewares([a,i(),wm(),Pm({delayTimer:1e3,delayRamp:(m,C)=>m*C,maxAttempts:3,until:m=>!!(m&&(m.ok||m.status>=400&&m.status<500)),retryOnNetworkError:!1})]);async function s(m={}){const{waitForEntitlementAfter:C,includeSignedLinks:U=!0}=m,F=await dr()?await n.entitlements.list({waitForEntitlementAfter:C?.toISOString()}):[];return U&&F.push(...Is()),F}async function u(m,C=[]){return(await s())?.find(w=>{if(m){const{sku:T,purchaseOption:x}=Nv(m);if("sku"in w&&T===w.sku||x&&"purchaseOptionsId"in w&&x===w.purchaseOptionsId||Gf(m,w.url))return!0}return!!C.some(T=>Gf(T,w.url))})}async function c(m,C,U){const F=new URL(r,window.location.origin);return F.pathname=F.pathname.replace(/\/$/,"")+"/proxy",F.searchParams.set("url",C),U&&F.searchParams.set("selector",U),or(F.toString()).headers({Authorization:`Bearer ${m}`}).get().text()}async function l(m){if(!m)throw new Error("SKU is required to get fulfillments");return await dr()?await o.get(`/fulfillments?sku=${encodeURIComponent(m)}`).json():[]}async function f(m,C){if(!m||!C)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:m},`/fulfillments/${encodeURIComponent(C)}/request-delivery?`).res()).ok}async function v(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(m){return(await n.transactions.list())?.find(U=>U.id===m)}async function h(){return await o.url("/tags").get().json()}async function p(m){const C=await o.url(`/tags/${encodeURIComponent(m)}`).delete().res();return vr(),C.ok}async function S(m){const C=await o.url("/tags").post(encodeURIComponent(m)).res();return Lr(er.USER_ATTRIBUTE_CHANGED,{}),vr(),C.ok}async function R(m){return(await n.tallies.get(m)).value}async function I(){const m=await n.tallies.list(),C={};for(const U of m)C[U.id]=U.value;return C}async function g(m){return await n.tallies.delete(m)}async function b(m,C){return await n.tallies.push(m,C)}async function y(){return await fr(!1)?await o.url("/profile").get().json():null}async function A(m){const C=await o.url("/profile").patch(m).res();return vr(),C.ok}async function q(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function G(m){const C=await fr(!1);if(!C)throw new Error("No access token available");const U=new URL(`${ir("access-sync",e.environment)}/spotify/sesamy-callback`);U.searchParams.set("access_token",C),U.searchParams.set("state",m),window.location.href=U.toString()}async function K(m){const C=await o.url(`/products/${encodeURIComponent(m)}/auto-onboard`).post().json();return C.length&&vr(),C}async function re(m,C=3600){const{shortlink:U}=await or(tg).post({url:m,ttl:C}).json();return U}async function L(m){const C=await fr(!1,!0);let U;const F=m.language||Qt(),w=tn();switch(m.target){case"account":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}${m.contractId?`/${encodeURIComponent(m.contractId)}`:""}`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-payment":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/change-payment-method`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"change-plan":U=new URL(`${ir("account",e.environment)}/${encodeURIComponent(m.language||F)}/subscriptions/${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.contractId)}/edit-plan`),U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"consume":U=new URL(`${ir("consume",e.environment)}/${encodeURIComponent(m.language||F)}/@${encodeURIComponent(e.vendorId||e.clientId)}/${encodeURIComponent(m.sku)}`),m.episodeId?U.href+=`/${m.episodeId}`:U.href+="/listen",U.searchParams.set("sesamy-redirect-url",m.redirectUrl||window.location.href);break;case"checkout":U=ig(e,{language:F,...m},w);break;default:throw new Error("Invalid target")}return C&&(U.hash=`#access_token=${C}`),m.shorten?re(U.href,m.ttl):U.href}async function M(){const m=await fr(!1),C=new URL(`${ir("account",e.environment)}/subscriptions/${e.vendorId||e.clientId}`);m&&(C.hash=`#access_token=${m}`),window.location.href=C.toString()}async function N(m){const C=tn(),U=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[w,T]=F.trim().split("=");U.includes(w)&&!C[w]&&(C[w]=T)}),n.checkouts.create({language:Qt(),...m,attribution:{...C,...m.attribution}})}return{autoOnboardProduct:K,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Xv,get:Ht,getLanguage:Qt,unlock:Zv,getPropertyFromHTML:Rs},contracts:n.contracts,deleteTag:p,deleteTally:g,entitlements:n.entitlements,flags:{get:Hv,set:Bv,list:Bt,delete:Gv},generateLink:L,getProxyContent:c,getEntitlements:s,getFulfillments:l,requestDelivery:f,hasAccess:u,isSpotifyLinked:q,linkSpotify:G,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:y,products:n.products,getSubscriptions:v,getTally:R,getTallies:I,getTags:h,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:b,setTag:S,unlinkSpotify:j,updateProfile:A,vendor:n.vendor}}function Vf(e,r,t,n,a){for(r=r.split?r.split("."):r,n=0;n<r.length;n++)e=e?e[r[n]]:a;return e===a?t:e}var bg="function",wg="string",Ze="undefined",Sg="boolean",nn="object",Ig="array",Pg="number",Eg="symbol",Rg="null",Ho=function(){},rh="any",th="*",Fr="__",Tg="form",Og="input",Cg="button",_g="select",an=typeof process!==Ze?process:{};an.env&&an.env.NODE_ENV;var _e=typeof document!==Ze;an.versions!=null&&an.versions.node!=null;typeof Deno!==Ze&&Deno.core;_e&&window.name==="nodejs"||typeof navigator!==Ze&&typeof navigator.userAgent!==Ze&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function nh(e,r){return r.charAt(0)[e]()+r.slice(1)}var Ag=nh.bind(null,"toUpperCase"),kg=nh.bind(null,"toLowerCase");function qg(e){return ah(e)?Ag(Rg):typeof e===nn?xg(e):Object.prototype.toString.call(e).slice(8,-1)}function on(e,r){r===void 0&&(r=!0);var t=qg(e);return r?kg(t):t}function Gt(e,r){return typeof r===e}var Be=Gt.bind(null,bg),Tr=Gt.bind(null,wg),tt=Gt.bind(null,Ze),$g=Gt.bind(null,Sg);Gt.bind(null,Eg);function ah(e){return e===null}function Ug(e){return on(e)===Pg&&!isNaN(e)}function ih(e){return on(e)===Ig}function Fe(e){if(!Lg(e))return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function Lg(e){return e&&(typeof e===nn||e!==null)}function xg(e){return Be(e.constructor)?e.constructor.name:null}function Ng(e){return e instanceof Error||Tr(e.message)&&e.constructor&&Ug(e.constructor.stackTraceLimit)}function oh(e,r){if(typeof r!="object"||ah(r))return!1;if(r instanceof e)return!0;var t=on(new e(""));if(Ng(r))for(;r;){if(on(r)===t)return!0;r=Object.getPrototypeOf(r)}return!1}oh.bind(null,TypeError);oh.bind(null,SyntaxError);function Tn(e,r){var t=e instanceof Element||e instanceof HTMLDocument;return t&&r?jg(e,r):t}function jg(e,r){return r===void 0&&(r=""),e&&e.nodeName===r.toUpperCase()}function On(e){var r=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(r))}}On(Tn,Tg);On(Tn,Cg);On(Tn,Og);On(Tn,_g);function Dg(e){return e?ih(e)?e:[e]:[]}function zf(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function Mg(){if(_e){var e=navigator,r=e.languages;return e.userLanguage||(r&&r.length?r[0]:e.language)}}function Fg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Bg(e){return(function(r){for(var t,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;t=a.exec(r);){var i=zf(t[1]),o=zf(t[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var c=u.split("[");c.length>1&&(Hg(n,c.map(function(l){return l.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(r){return _e&&window.location.search.substring(1)})())}function Hg(e,r,t){for(var n=r.length-1,a=0;a<n;++a){var i=r[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[r[n]]=t}function Cn(){for(var e="",r=0,t=4294967295*Math.random()|0;r++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[r-1],a=15&t;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),t=r%8==0?4294967295*Math.random()|0:t>>4}return e}function Gg(e,r){var t,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(t,n)};return function(){var u=new Date;o||(o=u);var c=r-(u-o);return t=this,n=arguments,c<=0?(clearTimeout(i),i=null,o=u,a=e.apply(t,n)):i||(i=setTimeout(s,c)),a}}var Nr="global",ut=Fr+Nr+Fr,ct=typeof self===nn&&self.self===self&&self||typeof global===nn&&global[Nr]===global&&global||void 0;function Br(e){return ct[ut][e]}function Hr(e,r){return ct[ut][e]=r}function mt(e){delete ct[ut][e]}function gt(e,r,t){var n;try{if(Ts(e)){var a=window[e];n=a[r].bind(a)}}catch{}return n||t}ct[ut]||(ct[ut]={});var Wt={};function Ts(e){if(typeof Wt[e]!==Ze)return Wt[e];try{var r=window[e];r.setItem(Ze,Ze),r.removeItem(Ze)}catch{return Wt[e]=!1}return Wt[e]=!0}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},ee.apply(null,arguments)}var Pr="function",hr="undefined",kt="reducer",sh="@@redux/",Go=sh+"INIT",Wg=sh+Math.random().toString(36),Kf=(function(){return typeof Symbol===Pr&&Symbol.observable||"@@observable"})(),Vt=" != "+Pr;function uh(e,r,t){var n;if(typeof r===Pr&&typeof t===hr&&(t=r,r=void 0),typeof t!==hr){if(typeof t!==Pr)throw new Error("enhancer"+Vt);return t(uh)(e,r)}if(typeof e!==Pr)throw new Error(kt+Vt);var a=e,i=r,o=[],s=o,u=!1;function c(){s===o&&(s=o.slice())}function l(){return i}function f(d){if(typeof d!==Pr)throw new Error("Listener"+Vt);var h=!0;return c(),s.push(d),function(){if(h){h=!1,c();var p=s.indexOf(d);s.splice(p,1)}}}function v(d){if(!Fe(d))throw new Error("Act != obj");if(typeof d.type===hr)throw new Error("ActType "+hr);if(u)throw new Error("Dispatch in "+kt);try{u=!0,i=a(i,d)}finally{u=!1}for(var h=o=s,p=0;p<h.length;p++)(0,h[p])();return d}return v({type:Go}),(n={dispatch:v,subscribe:f,getState:l,replaceReducer:function(d){if(typeof d!==Pr)throw new Error("next "+kt+Vt);a=d,v({type:Go})}})[Kf]=function(){var d,h=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function S(){p.next&&p.next(l())}return S(),{unsubscribe:h(S)}}})[Kf]=function(){return this},d},n}function Vg(e,r){var t=r&&r.type;return"action "+(t&&t.toString()||"?")+kt+" "+e+" returns "+hr}function lt(){var e=[].slice.call(arguments);return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,t){return function(){return r(t.apply(void 0,[].slice.call(arguments)))}})}function zg(){var e=arguments;return function(r){return function(t,n,a){var i,o=r(t,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(c){return s(c)}};return i=[].slice.call(e).map(function(c){return c(u)}),ee({},o,{dispatch:s=lt.apply(void 0,i)(o.dispatch)})}}}var Or=Fr+"anon_id",jr=Fr+"user_id",at=Fr+"user_traits",Wo="analytics",Ir="userId",nt="anonymousId",Xt=["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"],Vo=["name","EVENTS","config","loaded"],Z=Xt.reduce(function(e,r){return e[r]=r,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Jf=/^utm_/,Yf=/^an_prop_/,Qf=/^an_trait_/;function Kg(e){var r=e.storage.setItem;return function(t){return function(n){return function(a){if(a.type===Z.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,c=s.userId===o.userId;s.anonymousId!==o.anonymousId&&r(Or,o.anonymousId),c||r(jr,o.userId),u.traits&&r(at,ee({},c&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var f=i.an_uid,v=i.an_event,d=l.reduce(function(h,p){if(p.match(Jf)||p.match(/^(d|g)clid/)){var S=p.replace(Jf,"");h.campaign[S==="campaign"?"name":S]=i[p]}return p.match(Yf)&&(h.props[p.replace(Yf,"")]=i[p]),p.match(Qf)&&(h.traits[p.replace(Qf,"")]=i[p]),h},{campaign:{},props:{},traits:{}});t.dispatch(ee({type:Z.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return e.identify(f,d.traits)},0),v&&setTimeout(function(){return e.track(v,d.props)},0),Object.keys(d.campaign).length&&t.dispatch({type:Z.campaign,campaign:d.campaign})}}return n(a)}}}}function Jg(e){return function(r,t){if(r===void 0&&(r={}),t===void 0&&(t={}),t.type===Z.setItemEnd){if(t.key===Or)return ee({},r,{anonymousId:t.value});if(t.key===jr)return ee({},r,{userId:t.value})}switch(t.type){case Z.identify:return Object.assign({},r,{userId:t.userId,traits:ee({},r.traits,t.traits)});case Z.reset:return[jr,Or,at].forEach(function(n){e.removeItem(n)}),Object.assign({},r,{userId:null,anonymousId:null,traits:{}});default:return r}}}function Xf(e){return{userId:e.getItem(jr),anonymousId:e.getItem(Or),traits:e.getItem(at)}}var zo=function(e){return Fr+"TEMP"+Fr+e};function Yg(e){var r=e.storage,t=r.setItem,n=r.removeItem,a=r.getItem;return function(i){return function(o){return function(s){var u=s.userId,c=s.traits,l=s.options;if(s.type===Z.reset&&([jr,at,Or].forEach(function(d){n(d)}),[Ir,nt,"traits"].forEach(function(d){mt(zo(d))})),s.type===Z.identify){a(Or)||t(Or,Cn());var f=a(jr),v=a(at)||{};f&&f!==u&&i.dispatch({type:Z.userIdChanged,old:{userId:f,traits:v},new:{userId:u,traits:c},options:l}),u&&t(jr,u),c&&t(at,ee({},v,c))}return o(s)}}}}var At={};function Zf(e,r){At[e]&&Be(At[e])&&(At[e](r),delete At[e])}function ch(e,r,t){return new Promise(function(n,a){return r()?n(e):t<1?a(ee({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return ch(e,r,t-10).then(n,a)})})}function Qg(e){return{abort:e}}function lh(e,r,t){var n={},a=r(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var c=s.actions.reduce(function(f,v,d){return o[v.plugin].loaded?(f.process.push(v),f.processIndex.push(d)):(f.requeue.push(v),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(c.processIndex&&c.processIndex.length){c.processIndex.forEach(function(f){var v=s.actions[f],d=v.plugin,h=v.payload.type,p=a[d][h];if(p&&Be(p)){var S,R=(function(b,y){return b===void 0&&(b={}),y===void 0&&(y={}),[Ir,nt].reduce(function(A,q){return b.hasOwnProperty(q)&&y[q]&&y[q]!==b[q]&&(A[q]=y[q]),A},b)})(v.payload,u),I=n[R.meta.rid];if(!I&&(S=p({payload:R,config:o[d].config,instance:t,abort:Qg}))&&Fe(S)&&S.abort)return void(n[R.meta.rid]=!0);if(!I){var g=h+":"+d;e.dispatch(ee({},R,{type:g,_:{called:g,from:"queueDrain"}}))}}});var l=s.actions.filter(function(f,v){return!~c.processIndex.indexOf(v)});s.actions=l}}}var _o=function(e){var r=e.data,t=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var c=a.plugins,l=a.context,f=t.type,v=f.match(it),d=r.exact.map(function(S){return S.pluginName});v&&(d=o.during.map(function(S){return S.pluginName}));var h=(function(S,R){return function(I,g,b){var y=g.config,A=g.name,q=A+"."+I.type;b&&(q=b.event);var j=I.type.match(it)?(function(G,K,re,L,M){return function(N,m){var C=L?L.name:G,U=m&&$t(m)?m:re;if(L&&(!(U=m&&$t(m)?m:[G]).includes(G)||U.length!==1))throw new Error("Method "+K+" can only abort "+G+" plugin. "+JSON.stringify(U)+" input valid");return ee({},M,{abort:{reason:N,plugins:U,caller:K,_:C}})}})(A,q,R,b,I):(function(G,K){return function(){throw new Error(G.type+" action not cancellable. Remove abort in "+K)}})(I,q);return{payload:Xg(I),instance:S,config:y||{},abort:j}}})(n,d),p=r.exact.reduce(function(S,R){var I=R.pluginName,g=R.methodName,b=!1;return g.match(/^initialize/)||g.match(/^reset/)||(b=!c[I].loaded),l.offline&&g.match(/^(page|track|identify)/)&&(b=!0),S[""+I]=b,S},{});return Promise.resolve(r.exact.reduce(function(S,R,I){var g=R.pluginName;return Promise.resolve(S).then(function(b){function y(){return Promise.resolve(b)}var A=(function(){if(r.namespaced&&r.namespaced[g])return Promise.resolve(r.namespaced[g].reduce(function(q,j,G){return Promise.resolve(q).then(function(K){return j.method&&Be(j.method)?((function(N,m){var C=od(N);if(C&&C.name===m){var U=od(C.method);throw new Error([m+" plugin is calling method "+N,"Plugins cant call self","Use "+C.method+" "+(U?"or "+U.method:"")+" in "+m+" plugin insteadof "+N].join(`
|
|
3
|
+
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:K,instance:n,abort:(re=K,L=g,M=j.pluginName,function(N,m){return ee({},re,{abort:{reason:N,plugins:m||[L],caller:f,from:M||L}})}),config:td(j.pluginName,c,i),plugins:c})).then(function(N){var m=Fe(N)?N:{};return Promise.resolve(ee({},K,m))})):K;var re,L,M})},Promise.resolve(t))).then(function(q){b[g]=q});b[g]=t})();return A&&A.then?A.then(y):y()})},Promise.resolve({}))).then(function(S){return Promise.resolve(r.exact.reduce(function(R,I,g){try{var b=r.exact.length===g+1,y=I.pluginName,A=i[y];return Promise.resolve(R).then(function(q){var j=S[y]?S[y]:{};if(v&&(j=q),ko(j,y))return Ao({data:j,method:f,instance:n,pluginName:y,store:s}),Promise.resolve(q);if(ko(q,y))return b&&Ao({data:q,method:f,instance:n,store:s}),Promise.resolve(q);if(p.hasOwnProperty(y)&&p[y]===!0)return s.dispatch({type:"queue",plugin:y,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(q);var G=h(S[y],i[y]);return Promise.resolve(A[f]({abort:G.abort,payload:j,instance:n,config:td(y,c,i),plugins:c})).then(function(K){var re=Fe(K)?K:{},L=ee({},q,re),M=S[y];if(ko(M,y))Ao({data:M,method:f,instance:n,pluginName:y,store:s});else{var N=f+":"+y;(N.match(/:/g)||[]).length<2&&!f.match(ed)&&!f.match(rd)&&n.dispatch(ee({},v?L:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(L)})})}catch(q){return Promise.reject(q)}},Promise.resolve(t))).then(function(R){if(!(f.match(it)||f.match(/^registerPlugin/)||f.match(rd)||f.match(ed)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),R._&&R._.originalAction===f)return R;var I=ee({},R,{_:{originalAction:R.type,called:R.type,from:"engineEnd"}});fh(R,r.exact.length)&&!f.match(/End$/)&&(I=ee({},I,{type:R.type+"Aborted"})),s.dispatch(I)}return R})})}catch(S){return Promise.reject(S)}},it=/Start$/,ed=/^bootstrap/,rd=/^ready/;function Ao(e){var r=e.pluginName,t=e.method+"Aborted"+(r?":"+r:"");e.store.dispatch(ee({},e.data,{type:t,_:{called:t,from:"abort"}}))}function td(e,r,t){var n=r[e]||t[e];return n&&n.config?n.config:{}}function nd(e,r){return r.reduce(function(t,n){return n[e]?t.concat({methodName:e,pluginName:n.name,method:n[e]}):t},[])}function ad(e,r){var t=e.replace(it,""),n=r?":"+r:"";return[""+e+n,""+t+n,t+"End"+n]}function ko(e,r){var t=e.abort;return!!t&&(t===!0||id(t,r)||t&&id(t.plugins,r))}function fh(e,r){var t=e.abort;if(!t)return!1;if(t===!0||Tr(t))return!0;var n=t.plugins;return $t(t)&&t.length===r||$t(n)&&n.length===r}function $t(e){return Array.isArray(e)}function id(e,r){return!(!e||!$t(e))&&e.includes(r)}function od(e){var r=e.match(/(.*):(.*)/);return!!r&&{method:r[1],name:r[2]}}function Xg(e){return Object.keys(e).reduce(function(r,t){return t==="type"||(r[t]=Fe(e[t])?Object.assign({},e[t]):e[t]),r},{})}function Zg(e,r,t){var n={};return function(a){return function(i){return function(o){try{var s,u=function(b){return s?b:i(f)},c=o.type,l=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(c===Z.enablePlugin&&a.dispatch({type:Z.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),c===Z.disablePlugin&&setTimeout(function(){return Zf(o.meta.rid,{payload:o})},0),c===Z.initializeEnd){var v=r(),d=Object.keys(v),h=d.filter(function(b){return l.includes(b)}).map(function(b){return v[b]}),p=[],S=[],R=o.disabled,I=h.map(function(b){var y=b.loaded,A=b.name,q=b.config;return ch(b,function(){return y({config:q})},1e4).then(function(j){return n[A]||(a.dispatch({type:Z.pluginReadyType(A),name:A,events:Object.keys(b).filter(function(G){return!Vo.includes(G)})}),n[A]=!0),p=p.concat(A),b}).catch(function(j){if(j instanceof Error)throw new Error(j);return S=S.concat(j.name),j})});Promise.all(I).then(function(b){var y={plugins:p,failed:S,disabled:R};setTimeout(function(){d.length===I.length+R.length&&a.dispatch(ee({},{type:Z.ready},y))},0)})}var g=(function(){if(c!==Z.bootstrap)return/^ready:([^:]*)$/.test(c)&&setTimeout(function(){return lh(a,r,e)},0),Promise.resolve((function(b,y,A,q,j){try{var G=Be(y)?y():y,K=b.type,re=K.replace(it,"");if(b._&&b._.called)return Promise.resolve(b);var L=A.getState(),M=(C=G,(U=L.plugins)===void 0&&(U={}),(F=b.options)===void 0&&(F={}),Object.keys(C).filter(function(w){var T=F.plugins||{};return $g(T[w])?T[w]:T.all!==!1&&(!U[w]||U[w].enabled!==!1)}).map(function(w){return C[w]}));K===Z.initializeStart&&b.fromEnable&&(M=Object.keys(L.plugins).filter(function(w){var T=L.plugins[w];return b.plugins.includes(w)&&!T.initialized}).map(function(w){return G[w]}));var N=M.map(function(w){return w.name}),m=(function(w,T){var x=ad(w).map(function(H){return nd(H,T)});return T.reduce(function(H,Q){var J=Q.name,le=ad(w,J).map(function(Re){return nd(Re,T)}),ne=le[0],ue=le[1],ae=le[2];return ne.length&&(H.beforeNS[J]=ne),ue.length&&(H.duringNS[J]=ue),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(K,M);return Promise.resolve(_o({action:b,data:{exact:m.before,namespaced:m.beforeNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(w){function T(){var Q=(function(){if(K.match(it))return Promise.resolve(_o({action:ee({},x,{type:re+"End"}),data:{exact:m.after,namespaced:m.afterNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&Zf(J.meta.rid,{payload:J})})})();return Q&&Q.then?Q.then(function(){return w}):w}if(fh(w,N.length))return w;var x,H=(function(){if(K!==re)return Promise.resolve(_o({action:ee({},w,{type:re}),data:{exact:m.during,namespaced:m.duringNS},state:L,allPlugins:G,allMatches:m,instance:A,store:q,EVENTS:j})).then(function(Q){x=Q});x=w})();return H&&H.then?H.then(T):T()})}catch(w){return Promise.reject(w)}var C,U,F})(o,r,e,a,t)).then(function(b){var y=i(b);return s=1,y})})();return Promise.resolve(g&&g.then?g.then(u):u(g))}catch(b){return Promise.reject(b)}}}}}function ey(e){return function(r){return function(t){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===Z.setItem||a===Z.removeItem){if(n.abort)return t(n);a===Z.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return t(n)}}}}var ry=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(r,t){e[t]=e[t].concat(r)},this.removeMiddleware=function(r,t){var n=e[t].findIndex(function(a){return a===r});n!==-1&&(e[t]=[].concat(e[t].slice(0,n),e[t].slice(n+1)))},this.dynamicMiddlewares=function(r){return function(t){return function(n){return function(a){var i={getState:t.getState,dispatch:function(s){return t.dispatch(s)}},o=e[r].map(function(s){return s(i)});return lt.apply(void 0,o)(n)(a)}}}}};function ty(e){return function(r,t){r===void 0&&(r={});var n={};if(t.type==="initialize:aborted")return r;if(/^registerPlugin:([^:]*)$/.test(t.type)){var a=sd(t.type,"registerPlugin"),i=e()[a];if(!i||!a)return r;var o=t.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},r,n)}if(/^initialize:([^:]*)$/.test(t.type)){var u=sd(t.type,Z.initialize),c=e()[u];return c&&u?(n[u]=ee({},r[u],{initialized:!0,loaded:!!c.loaded({config:c.config})}),ee({},r,n)):r}if(/^ready:([^:]*)$/.test(t.type))return n[t.name]=ee({},r[t.name],{loaded:!0}),ee({},r,n);switch(t.type){case Z.disablePlugin:return ee({},r,ud(t.plugins,!1,r));case Z.enablePlugin:return ee({},r,ud(t.plugins,!0,r));default:return r}}}function sd(e,r){return e.substring(r.length+1,e.length)}function ud(e,r,t){return e.reduce(function(n,a){return n[a]=ee({},t[a],{enabled:r}),n},t)}function dh(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var ny={last:{},history:[]};function ay(e,r){e===void 0&&(e=ny);var t=r.options,n=r.meta;if(r.type===Z.track){var a=dh(ee({event:r.event,properties:r.properties},Object.keys(t).length&&{options:t},{meta:n}));return ee({},e,{last:a,history:e.history.concat(a)})}return e}var iy={actions:[]};function oy(e,r){e===void 0&&(e=iy);var t=r.payload;switch(r.type){case"queue":var n;return n=t&&t.type&&t.type===Z.identify?[r].concat(e.actions):e.actions.concat(r),ee({},e,{actions:n});case"dequeue":return[];default:return e}}var vh=/#.*$/;function sy(e){var r=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(r&&r[3]?r[3].split("?")[0].replace(vh,""):"")}var hh,ph,mh,gh,uy=function(e){if(e===void 0&&(e={}),!_e)return e;var r=document,t=r.title,n=r.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,c=i.search,l=(function(v){var d=(function(){if(_e){for(var h,p=document.getElementsByTagName("link"),S=0;h=p[S];S++)if(h.getAttribute("rel")==="canonical")return h.getAttribute("href")}})();return d?d.match(/\?/)?d:d+v:window.location.href.replace(vh,"")})(c),f={title:t,url:l,path:sy(l),hash:u,search:c,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,e)},cy={last:{},history:[]};function ly(e,r){e===void 0&&(e=cy);var t=r.options;if(r.type===Z.page){var n=dh(ee({properties:r.properties,meta:r.meta},Object.keys(t).length&&{options:t}));return ee({},e,{last:n,history:e.history.concat(n)})}return e}hh=(function(){if(!_e)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"})(),ph=_e?document.referrer:null,mh=Mg(),gh=Fg();var cd={initialized:!1,sessionId:Cn(),app:null,version:null,debug:!1,offline:!!_e&&!navigator.onLine,os:{name:hh},userAgent:_e?navigator.userAgent:"node",library:{name:Wo,version:"0.13.1"},timezone:gh,locale:mh,campaign:{},referrer:ph};function fy(e,r){e===void 0&&(e=cd);var t=e.initialized,n=r.campaign;switch(r.type){case Z.campaign:return ee({},e,{campaign:n});case Z.offline:return ee({},e,{offline:!0});case Z.online:return ee({},e,{offline:!1});default:return t?e:ee({},cd,e,{initialized:!0})}}var dy=["plugins","reducers","storage"];function vy(e,r,t){if(_e){var n=window[(t?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,r)})}}function hy(e){var r=vy.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return r(!0),function(t){return r(!1)}}function yh(){return Hr(Wo,[]),function(e){return function(r,t,n){var a=e(r,t,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return ct[ut][Wo].push(o.action||o),i(o)}})}}}function ld(e){return function(){return lt(lt.apply(null,arguments),yh())}}function qo(e){return e?ih(e)?e:[e]:[]}function fd(e,r,t){e===void 0&&(e={});var n,a,i=Cn();return r&&(At[i]=(n=r,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),c=0;c<u.length;c++)if(Be(u[c])){s=u[c];break}return s})(t),function(o){a&&a(o),n(o)})),ee({},e,{rid:i,ts:new Date().getTime()},r?{hasCallback:!0}:{})}function py(e){e===void 0&&(e={});var r=e.reducers||{},t=e.initialUser||{},n=(e.plugins||[]).reduce(function(w,T){if(Be(T))return w.middlewares=w.middlewares.concat(T),w;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var x=T.EVENTS?Object.keys(T.EVENTS).map(function(J){return T.EVENTS[J]}):[];w.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(w.methods[T.name]=Object.keys(T.methods).reduce(function(J,le){var ne;return J[le]=(ne=T.methods[le],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),Re=0;Re<ue.length;Re++)ae[Re]=ue[Re];return ae[ae.length]=y,ne.apply({instance:y},ae)}),J},{}),delete T.methods);var H=Object.keys(T).concat(x),Q=new Set(w.events.concat(H));if(w.events=Array.from(Q),w.pluginsArray=w.pluginsArray.concat(T),w.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return w.plugins[T.name]=T,w.plugins[T.name].loaded||(w.plugins[T.name].loaded=function(){return!0}),w},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:Br,setItem:Hr,removeItem:mt},i=(function(w){return function(T,x,H){return x.getState("user")[T]||(H&&Fe(H)&&H[T]?H[T]:Xf(w)[T]||Br(zo(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(w){return!Vo.includes(w)}).sort(),u=new Set(s.concat(Xt).filter(function(w){return!Vo.includes(w)})),c=Array.from(u).sort(),l=function(){return o},f=new ry,v=f.addMiddleware,d=f.removeMiddleware,h=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},S=Bg(),R=Xf(a),I=ee({},R,t,S.an_uid?{userId:S.an_uid}:{},S.an_aid?{anonymousId:S.an_aid}:{});I.anonymousId||(I.anonymousId=Cn());var g=ee({enable:function(w,T){return new Promise(function(x){m.dispatch({type:Z.enablePlugin,plugins:qo(w),_:{originalAction:Z.enablePlugin}},x,[T])})},disable:function(w,T){return new Promise(function(x){m.dispatch({type:Z.disablePlugin,plugins:qo(w),_:{originalAction:Z.disablePlugin}},x,[T])})}},n.methods),b=!1,y={identify:function(w,T,x,H){try{var Q=Tr(w)?w:null,J=Fe(w)?w:T,le=x||{},ne=y.user();Hr(zo(Ir),Q);var ue=Q||J.userId||i(Ir,y,J);return Promise.resolve(new Promise(function(ae){m.dispatch(ee({type:Z.identifyStart,userId:ue,traits:J||{},options:le,anonymousId:ne.anonymousId},ne.id&&ne.id!==Q&&{previousId:ne.id}),ae,[T,x,H])}))}catch(ae){return Promise.reject(ae)}},track:function(w,T,x,H){try{var Q=Fe(w)?w.event:w;if(!Q||!Tr(Q))throw new Error("EventMissing");var J=Fe(w)?w:T||{},le=Fe(x)?x:{};return Promise.resolve(new Promise(function(ne){m.dispatch({type:Z.trackStart,event:Q,properties:J,options:le,userId:i(Ir,y,T),anonymousId:i(nt,y,T)},ne,[T,x,H])}))}catch(ne){return Promise.reject(ne)}},page:function(w,T,x){try{var H=Fe(w)?w:{},Q=Fe(T)?T:{};return Promise.resolve(new Promise(function(J){m.dispatch({type:Z.pageStart,properties:uy(H),options:Q,userId:i(Ir,y,H),anonymousId:i(nt,y,H)},J,[w,T,x])}))}catch(J){return Promise.reject(J)}},user:function(w){if(w===Ir||w==="id")return i(Ir,y);if(w===nt||w==="anonId")return i(nt,y);var T=y.getState("user");return w?Vf(T,w):T},reset:function(w){return new Promise(function(T){m.dispatch({type:Z.resetStart},T,w)})},ready:function(w){return b&&w({plugins:g,instance:y}),y.on(Z.ready,function(T){w&&w(T),b=!0})},on:function(w,T){if(!w||!Be(T))return!1;if(w===Z.bootstrap)throw new Error(".on disabled for "+w);var x=/Start$|Start:/;if(w==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(x)&&T({payload:ae,instance:y,plugins:o}),ue(ae)}}},Q=function(ne){return function(ue){return function(ae){return ae.type.match(x)||T({payload:ae,instance:y,plugins:o}),ue(ae)}}};return v(H,zt),v(Q,Kt),function(){d(H,zt),d(Q,Kt)}}var J=w.match(x)?zt:Kt,le=function(ne){return function(ue){return function(ae){return ae.type===w&&T({payload:ae,instance:y,plugins:o,abort:p}),ue(ae)}}};return v(le,J),function(){return d(le,J)}},once:function(w,T){if(!w||!Be(T))return!1;if(w===Z.bootstrap)throw new Error(".once disabled for "+w);var x=y.on(w,function(H){T({payload:H.payload,instance:y,plugins:o,abort:p}),x()});return x},getState:function(w){var T=m.getState();return w?Vf(T,w):Object.assign({},T)},dispatch:function(w){var T=Tr(w)?{type:w}:w;if(Xt.includes(T.type))throw new Error("reserved action "+T.type);var x=ee({},T,{_:ee({originalAction:T.type},w._||{})});m.dispatch(x)},enablePlugin:g.enable,disablePlugin:g.disable,plugins:g,storage:{getItem:a.getItem,setItem:function(w,T,x){m.dispatch({type:Z.setItemStart,key:w,value:T,options:x})},removeItem:function(w,T){m.dispatch({type:Z.removeItemStart,key:w,options:T})}},setAnonymousId:function(w,T){y.storage.setItem(Or,w,T)},events:{core:Xt,plugins:s}},A=n.middlewares.concat([function(w){return function(T){return function(x){return x.meta||(x.meta=fd()),T(x)}}},h(zt),Zg(y,l,{all:c,plugins:s}),ey(a),Kg(y),Yg(y),h(Kt)]),q={context:fy,user:Jg(a),page:ly,track:ay,plugins:ty(l),queue:oy},j=lt,G=lt;if(_e&&e.debug){var K=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;K&&(j=K({trace:!0,traceLimit:25})),G=function(){return arguments.length===0?yh():Fe(typeof arguments[0])?ld():ld().apply(null,arguments)}}var re,L=(function(w){return Object.keys(w).reduce(function(T,x){return dy.includes(x)||(T[x]=w[x]),T},{})})(e),M=n.pluginsArray.reduce(function(w,T){var x=T.name,H=T.config,Q=T.loaded,J=n.pluginEnabled[x];return w[x]={enabled:J,initialized:!!J&&!T.initialize,loaded:!!Q({config:H}),config:H},w},{}),N={context:L,user:I,plugins:M},m=uh((function(w){for(var T=Object.keys(w),x={},H=0;H<T.length;H++){var Q=T[H];typeof w[Q]===Pr&&(x[Q]=w[Q])}var J,le=Object.keys(x);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:Go})===hr||typeof ae(void 0,{type:Wg})===hr)throw new Error(kt+" "+ue+" "+hr)})})(x)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,Re={},xe=0;xe<le.length;xe++){var je=le[xe],$e=ne[je],Qe=(0,x[je])($e,ue);if(typeof Qe===hr){var wr=Vg(je,ue);throw new Error(wr)}Re[je]=Qe,ae=ae||Qe!==$e}return ae?Re:ne}})(ee({},q,r)),N,G(j(zg.apply(void 0,A))));m.dispatch=(re=m.dispatch,function(w,T,x){var H=ee({},w,{meta:fd(w.meta,T,qo(x))});return re.apply(null,[H])});var C=Object.keys(o);m.dispatch({type:Z.bootstrap,plugins:C,config:L,params:S,user:I,initialUser:t,persistedUser:R});var U=C.filter(function(w){return n.pluginEnabled[w]}),F=C.filter(function(w){return!n.pluginEnabled[w]});return m.dispatch({type:Z.registerPlugins,plugins:C,enabled:n.pluginEnabled}),n.pluginsArray.map(function(w,T){var x=w.bootstrap,H=w.config,Q=w.name;x&&Be(x)&&x({instance:y,config:H,payload:w}),m.dispatch({type:Z.registerPluginType(Q),name:Q,enabled:n.pluginEnabled[Q],plugin:w}),n.pluginsArray.length===T+1&&m.dispatch({type:Z.initializeStart,plugins:U,disabled:F})}),hy(function(w){m.dispatch({type:w?Z.offline:Z.online})}),(function(w,T,x){setInterval(function(){return lh(w,T,x)},3e3)})(m,l,y),y}var zt="before",Kt="after",Dr="cookie",Ur=Sh(),bh=_n,my=_n;function wh(e){return Ur?_n(e,"",-1):mt(e)}function Sh(){if(Ur!==void 0)return Ur;var e=Dr+Dr;try{_n(e,e),Ur=document.cookie.indexOf(e)!==-1,wh(e)}catch{Ur=!1}return Ur}function _n(e,r,t,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ur===!1&&(o?Hr(e,r):Br(e)),o?document.cookie=e+"="+encodeURIComponent(r)+(t?"; expires="+new Date(+new Date+1e3*t).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var pr="localStorage",gy=Ts.bind(null,pr);gt(pr,"getItem",Br);gt(pr,"setItem",Hr);gt(pr,"removeItem",mt);var mr="sessionStorage",yy=Ts.bind(null,mr);gt(mr,"getItem",Br);gt(mr,"setItem",Hr);gt(mr,"removeItem",mt);function ot(e){var r=e;try{if((r=JSON.parse(e))==="true")return!0;if(r==="false")return!1;if(Fe(r))return r;parseFloat(r)===r&&(r=parseFloat(r))}catch{}if(r!==null&&r!=="")return r}var by=gy(),wy=yy(),Sy=Sh();function Mr(e,r){if(e){var t=Os(r),n=!ks(t),a=Cs(t)?ot(localStorage.getItem(e)):void 0;if(n&&!tt(a))return a;var i=_s(t)?ot(bh(e)):void 0;if(n&&i)return i;var o=As(t)?ot(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=Br(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function sn(e,r,t){if(e&&!tt(r)){var n={},a=Os(t),i=JSON.stringify(r),o=!ks(a);return Cs(a)&&(n[pr]=Jt(pr,r,ot(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[pr]:_s(a)&&(n[Dr]=Jt(Dr,r,ot(bh(e))),my(e,i),o)?n[Dr]:As(a)&&(n[mr]=Jt(mr,r,ot(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[mr]:(n[Nr]=Jt(Nr,r,Br(e)),Hr(e,r),o?n[Nr]:n)}}function Iy(e,r){if(e){var t=Os(r),n=Mr(e,th),a={};return!tt(n.localStorage)&&Cs(t)&&(localStorage.removeItem(e),a[pr]=n.localStorage),!tt(n.cookie)&&_s(t)&&(wh(e),a[Dr]=n.cookie),!tt(n.sessionStorage)&&As(t)&&(sessionStorage.removeItem(e),a[mr]=n.sessionStorage),!tt(n.global)&&An(t,Nr)&&(mt(e),a[Nr]=n.global),a}}function Os(e){return e?Tr(e)?e:e.storage:rh}function Cs(e){return by&&An(e,pr)}function _s(e){return Sy&&An(e,Dr)}function As(e){return wy&&An(e,mr)}function ks(e){return e===th||e==="all"}function An(e,r){return e===rh||e===r||ks(e)}function Jt(e,r,t){return{location:e,current:r,previous:t}}var Py={setItem:sn,getItem:Mr,removeItem:Iy};function Ey(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function dd(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function vd(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?dd(Object(t),!0).forEach(function(n){Ey(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):dd(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Ry(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r={storage:Py};return py(vd(vd({},r),e))}function Ty(e){if(typeof window>"u")return;const{addEventListener:r,history:t,location:n}=window;let a=n.pathname;r("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=t[o];t[o]=function(...u){const c=u[2]?.toString()||"",l=Cy(c);return a!==l&&(a=l,setTimeout(()=>e(c),0)),s.apply(t,u)}})}function Oy(e,r){const t=e.indexOf(r);return t>-1?e.slice(0,t):e}function Cy(e){return["#","?"].forEach(r=>e=Oy(e,r)),e}function _y(){Ty(()=>{lr.page()})}var $o="up",Uo="down";function Ay(e){if(e===void 0&&(e={}),!_e)return Ho;var r=pd(),t=Ko(),n=hd(),a=Yt(n,r),i=Yt(t,r),o=[],s=[],u=[],c=n,l=a,f=i,v=Object.keys(e);if(!v.length)return Ho;var d=v.map(function(p){return Number(p)}),h=Gg(function(){var p=pd(),S=(function(L,M){return M.map(function(N){return N===100?L-5:L*(N/100)})})(p,d),R=Ko(),I=hd(),g=Yt(I,p),b=Yt(R,p);if(l=g>l?g:l,f=b<f?b:f,!(o.length>=d.length)){var y=c===I,A=$o;y?A="initial":c<=I&&(A=Uo);var q=S,j=d;(A===$o||y)&&(q=S.slice().reverse(),j=d.slice().reverse());var G=j.reduce(function(L,M,N){var m=q[N];return u.includes(M)&&I<=m&&(u=u.filter(function(C){return C!==M}),L.singleFunction=M),A===Uo&&!o.includes(M)&&I>=m&&M>i?(s.push(M),L.callbacks=L.callbacks.concat(M),L):A===$o&&!o.includes(M)&&I<=m&&M<=g?(L.foundFunc=[M],L):(y&&I>=m&&L.foundFunc.length===0&&(L.foundFunc=[M]),!s.includes(M)&&I>=m&&(s.push(M),L.singleFunction?u.push(M):L.singleFunction=M),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(c=I,A===Uo&&G.callbacks&&G.callbacks.forEach(function(L){Be(e[L])&&(e[L]({trigger:L,direction:A,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(L))}),G.singleFunction){var K=G.singleFunction,re=G.direction;Be(e[K])&&e[K]({trigger:K,direction:re,scrollMin:f,scrollMax:l,range:[f,l]}),o.push(K)}}},500);return window.addEventListener("scroll",h),function(){return window.removeEventListener("scroll",h)}}function Ko(){return _e?document.body.scrollTop||document.documentElement.scrollTop:0}function ky(){return _e?window.innerHeight||document.documentElement.clientHeight:0}function hd(){return Math.round(Ko()+ky())}function pd(){if(!_e)return 0;var e=document.body,r=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight)}function Yt(e,r){return Math.round(e/r*100)}var qs="Event",md=qs+"Listener";function qy(e){return function(r,t,n,a){var i=n||Ho,o=a||!1;if(!_e)return i;var s=un(t),u=un(r,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+qs);var c=[];return(function l(f){f&&(c=[]);for(var v=f?"add"+md:"remove"+md,d=0;d<u.length;d++){var h=u[d];c[d]=f?o&&o.once?$y(i):i:c[d]||i;for(var p=0;p<s.length;p++)h[v]?h["on"+s[p]]=f?c[d]:null:h[v](s[p],c[d],o)}return l.bind(null,!f)})(e)}}function un(e,r){if(Tr(e))return r?un(document.querySelectorAll(e)):(t=e).split(t.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var t;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=Dg(e);return r?i.map(function(o){return Tr(o)?un(o,!0):o}).flat():i}function $y(e,r){var t;return function(){return e&&(t=e.apply(this,arguments),e=null),t}}var Lo=qy(qs);function Ih(e,r){return _e&&Be(window[e])?(t=window[e],n=r,(a=window)===void 0&&(a=null),Be(t)?function(){t.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=r;var t,n,a}Ih.bind(null,"onerror");Ih.bind(null,"onload");var Ph=typeof window>"u",gd="hidden";function Uy(e){if(Ph)return!1;var r=Ly(),t="".concat(r.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[r])},a=function(){return document.addEventListener(t,n)};return a(),function(){return document.removeEventListener(t,n),a}}function Ly(){var e=["webkit","moz","ms","o"];return Ph||gd in document?gd:e.reduce(function(r,t){var n=t+"Hidden";return!r&&n in document?n:r},null)}var xy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ny(e,r){r===void 0&&(r={});var t=(function(o,s){var u=this,c=!1;return function(l){c||(o.call(u,l),c=!0,setTimeout(function(){return c=!1},s))}})(e,r.throttle||1e4),n=[];function a(){var o=Uy(function(s){s||t({type:"tabVisible"})});return n=[o].concat(xy.map(function(s){return Lo(document,s,t)})).concat(Lo(window,"load",t)).concat(Lo(window,"scroll",t,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function jy(e){var r,t,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o,u=e.throttle,c=u===void 0?2e3:u,l=!1,f=!1,v=new Date,d=function(){return clearTimeout(r)};function h(S){d(),i&&!l&&i(Pt(v),S),a&&l&&(l=!1,a(Pt(t),S),v=new Date),r=setTimeout(function(){l=!0,n&&(t=new Date,n(Pt(v),S))},s)}var p=Ny(h,{throttle:c});return{disable:function(){f=!0,l=!1,d();var S=p();return function(){return f=!1,v=new Date,h({type:"load"}),S()}},getStatus:function(){return{isIdle:l,isDisabled:f,active:l?0:Pt(v,f),idle:l?Pt(t,f):0}}}}function Pt(e,r){return r?0:Math.round((new Date-e)/1e3)}const yd=5e3;class Dy{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(r){this.element=r.element,this.viewCallback=r.viewCallback,this.activeDurationCallback=r.activeDurationCallback,this.idleDurationCallback=r.idleDurationCallback,this.scrollCallback=r.scrollCallback,this.observer=new IntersectionObserver(t=>{t.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),jy({onIdle:t=>this.handleAwake(!1,t),onWakeUp:t=>this.handleAwake(!0,t),timeout:yd}),Ay({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(r){r?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=r}handleAwake(r,t=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=r,this.lastEventAt=r?Date.now()-t*yd:Date.now(),this.isInViewport&&this.trackAwake(r,t)}handleScroll(r){this.scrollCallback&&this.scrollCallback(r)}handleVisibilityChange(){this.isAwake=!1;const r=Math.round((Date.now()-this.lastEventAt)/1e3);r>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,r))}trackAwake(r,t){!r&&this.activeDurationCallback&&this.activeDurationCallback(t,this.isFlushing,this.lastEventAt),r&&this.idleDurationCallback&&this.idleDurationCallback(t,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Eh(e){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e):e()}function My(e,r){r=r||{};var t,n,a=[],i=r.max||1/0;function o(){clearInterval(t),e(a.splice(0,i)),s()}function s(){t=setInterval(o,r.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(t)}}}const bd="sesamy_session_id";function Fy(){let e=sessionStorage.getItem(bd);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(bd,e)),e}let Rh=!1,Zt,cn,Jo;function Th(e){return JSON.stringify(e.map(r=>{const{campaign:t,...n}=r.properties||{};return{anonymousId:r.anonymousId,userId:r.userId,type:r.type,properties:n,clientId:Jo,requestId:Math.random().toString(36).slice(2,9),sessionId:Fy(),timestamp:new Date().toISOString(),version:Ft,event:r.event,context:{...r.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:ge("sesamy:item-src"),publisherContentId:ge("sesamy:publisher-content-id")},campaign:t,locale:navigator.language,library:Ps,userAgent:navigator.userAgent,clientId:Jo}}}))}const Oh=My(async e=>{if(e.length>0){const r=Th(e);Rh?navigator.sendBeacon(cn,r):(await fetch(cn,{method:"POST",body:r,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function xo(e){if(e.anonymousId)if(e.properties?.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(cn,Th([r]))}else Oh.push(e)}function By(){return Rh=!0,Oh.flush()}function Hy(e,r,t){Zt=r,cn=`${ir("logs",t)}/events`,Jo=e}const Gy={name:"custom-analytics-plugin",page:({payload:e})=>{if(!Zt)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;xo({anonymousId:t,userId:n,properties:r,event:a,type:"page"})},track:({payload:e})=>{if(!Zt)return;const{properties:r,anonymousId:t,userId:n,event:a}=e;xo({anonymousId:t,userId:n,properties:r,event:a,type:"track"})},identify:({payload:e})=>{if(!Zt)return;const{properties:r,anonymousId:t,userId:n}=e;xo({anonymousId:t,userId:n,properties:r,type:"identify"})}},wd=["source","medium","campaign","term","content"],Er="utm_",Wy=1800*1e3;function Ch(e){return e?Date.now()-parseInt(e,10)>Wy:!0}function Sd(){const e=document.referrer||"";if(!e)return;const r=Mr(`${Er}set_at`);(Ch(r)||!Mr(`${Er}referrer`))&&sn(`${Er}referrer`,e)}function Vy(){const e=()=>{const t={};for(const a of wd){const i=Mr(`${Er}${a}`);i&&(t[`utm_${a}`]=i)}const n=Mr(`${Er}referrer`);return n&&(t.utm_referrer=n),t};return{name:"attribution-tracking",initialize(){Sd()},campaign({payload:t}){const n=t?.campaign||{},a=Mr(`${Er}set_at`);if(Object.keys(n).length>0&&Ch(a)){for(const o of wd){const s=n[o];s&&sn(`${Er}${o}`,s)}sn(`${Er}set_at`,String(Date.now()))}Sd()},page({payload:t}){return t.properties.campaign=e(),t},track({payload:t}){return t.properties.campaign=e(),t},getStoredCampaignData:e}}const zy=Vy(),Id=new Map,Pd=new Map;function Ky({clientId:e,enabled:r=!0,environment:t}){Hy(e,r,t),r&&(window.addEventListener("beforeunload",()=>{Pd.forEach((n,a)=>{n.bind(a)()}),By()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Id.forEach((n,a)=>{n.bind(a)()})}),_y(),Eh(()=>{const n=new Dy({element:document.body,viewCallback:()=>{lr.page()},activeDurationCallback:(a,i,o)=>{lr.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{lr.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{lr.track("scroll",{scroll:a.scrollMax})}});Pd.set(document.body,()=>{n.flush()}),Id.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(er.AUTHENTICATED,async n=>{const a=n;await lr.identify(a.detail.sub)}),window.addEventListener(er.LOGOUT,async()=>{await lr.track("logout",{}),await lr.reset()}))}const lr=Ry({app:Ps,version:Ft,plugins:[zy,Gy]});function _h(e,r){lr.track(e,r)}const Jy=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function Ah(){return new Promise(e=>{const r=Jy.map(t=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=t,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const t=!r.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);r.forEach(n=>n.remove()),e(t)},100)})}function kh(){const e=navigator.userAgent.toLowerCase(),r=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const t of r)if(t.regex.test(e))return{isInAppBrowser:!0,browserName:t.name};return/; wv\)/.test(e)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}/*!
|
|
4
4
|
*
|
|
5
5
|
* detectIncognito v1.6.2
|
|
6
6
|
*
|
|
@@ -30,7 +30,7 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
|
|
|
30
30
|
*
|
|
31
31
|
* Please keep this comment intact in order to properly abide by the MIT License.
|
|
32
32
|
*
|
|
33
|
-
**/var
|
|
33
|
+
**/var Yo={d:(e,r)=>{for(var t in r)Yo.o(r,t)&&!Yo.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)},$s={};Yo.d($s,{A:()=>Yy,k:()=>Us});var Et=function(e,r,t,n){return new(t||(t=Promise))(function(a,i){function o(c){try{u(n.next(c))}catch(l){i(l)}}function s(c){try{u(n.throw(c))}catch(l){i(l)}}function u(c){var l;c.done?a(c.value):(l=c.value,l instanceof t?l:new t(function(f){f(l)})).then(o,s)}u((n=n.apply(e,[])).next())})},Rt=function(e,r){var t,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(c){return(function(l){if(t)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(o=0)),o;)try{if(t=1,n&&(a=2&l[0]?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,n=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||l[0]!==6&&l[0]!==2)){o=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){o.label=l[1];break}if(l[0]===6&&o.label<a[1]){o.label=a[1],a=l;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(l);break}a[2]&&o.ops.pop(),o.trys.pop();continue}l=r.call(e,o)}catch(f){l=[6,f],n=0}finally{t=a=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}})([u,c])}}};function Us(){return Et(this,void 0,Promise,function(){return Rt(this,function(e){switch(e.label){case 0:return[4,new Promise(function(r,t){var n="Unknown",a=!1;function i(v){a||(a=!0,r({isPrivate:v,browserName:n}))}function o(){var v=0,d=parseInt("-1");try{d.toFixed(d)}catch(h){v=h.message.length}return v}function s(){return Et(this,void 0,void 0,function(){var v,d;return Rt(this,function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return h.sent(),i(!1),[3,3];case 2:return v=h.sent(),d=v instanceof Error&&typeof v.message=="string"?v.message:String(v),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var v;return Et(this,void 0,Promise,function(){return Rt(this,function(d){switch(d.label){case 0:return typeof((v=navigator.storage)===null||v===void 0?void 0:v.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var h=String(Math.random());try{var p=indexedDB.open(h,1);p.onupgradeneeded=function(S){var R=S.target.result,I=function(g){i(g)};try{R.createObjectStore("t",{autoIncrement:!0}).put(new Blob),I(!1)}catch(g){(g instanceof Error&&typeof g.message=="string"?g.message:String(g)).includes("are not yet supported")?I(!0):I(!1)}finally{R.close(),indexedDB.deleteDatabase(h)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var h=window.openDatabase,p=window.localStorage;try{h(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function c(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(v,d){var h=Math.round(d/1048576),p=2*Math.round((function(){var S,R,I,g=window;return(I=(R=(S=g?.performance)===null||S===void 0?void 0:S.memory)===null||R===void 0?void 0:R.jsHeapSizeLimit)!==null&&I!==void 0?I:1073741824})()/1048576);i(h<p)},function(v){t(new Error("detectIncognito somehow failed to query storage quota: "+v.message))})}function l(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?c():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var v;return Et(this,void 0,Promise,function(){var d,h,p;return Rt(this,function(S){switch(S.label){case 0:if(typeof((v=navigator.storage)===null||v===void 0?void 0:v.getDirectory)!="function")return[3,5];S.label=1;case 1:return S.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return S.sent(),i(!1),[3,4];case 3:return d=S.sent(),h=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(h.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(R){p.error&&p.error.name==="InvalidStateError"&&R.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},S.label=6;case 6:return[2]}})})}(function(){return Et(this,void 0,Promise,function(){return Rt(this,function(v){switch(v.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return v.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",l(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return v.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):t(new Error("detectIncognito cannot determine the browser")),v.label=6;case 6:return[2]}var d})})})().catch(t)})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Us);const Yy=Us;$s.A;const Qy=$s.k,en="sesamy_incognito_mode";function qh(){try{const e=sessionStorage.getItem(en);return e===null?void 0:e==="true"}catch{return}}async function $h(){try{const e=sessionStorage.getItem(en);if(e!==null)return e==="true";const{isPrivate:r}=await Qy();return sessionStorage.setItem(en,r.toString()),r}catch{try{sessionStorage.setItem(en,"false")}catch{}return!1}}function Xy(e,r,t=!1){const n={name:e,data:r},a=new CustomEvent(e,{detail:n,cancelable:t,bubbles:!0});_h(`event:${e}`,{...r,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return t&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function Zy(e,r){e.cancelable&&(e.detail.cancellationMessage=r,e.preventDefault())}const eb=["sesamy","__sesamy","__anon_id","auth0","a0","_legacy_auth0"],rb=["access_token","id_token","refresh_token","token"];function Qo(e){const r=e.split(".");return r.length===3?`${r[0]}.${r[1]}.[REDACTED]`:e}function Uh(e){const r=e.toLowerCase();return rb.some(t=>r.includes(t))}function Lh(e){const r=e.split(".");return r.length===3&&r.every(t=>t.length>0)}function Ed(e){const r=[];for(let t=0;t<e.length;t++){const n=e.key(t);if(!n)continue;if(eb.some(i=>n.toLowerCase().startsWith(i.toLowerCase()))){let i=e.getItem(n)||"",o=!1;(Uh(n)||Lh(i))&&(i=Qo(i),o=!0);try{const s=JSON.parse(i);if(typeof s=="object"&&s!==null){const u=Xo(s);u.wasRedacted&&(i=JSON.stringify(u.value),o=!0)}}catch{}r.push({key:n,value:i,redacted:o})}}return r}function Xo(e){if(e==null)return{value:e,wasRedacted:!1};if(typeof e=="string")return Lh(e)?{value:Qo(e),wasRedacted:!0}:{value:e,wasRedacted:!1};if(Array.isArray(e)){let r=!1;return{value:e.map(n=>{const a=Xo(n);return a.wasRedacted&&(r=!0),a.value}),wasRedacted:r}}if(typeof e=="object"){let r=!1;const t={};for(const[n,a]of Object.entries(e))if(Uh(n)&&typeof a=="string")t[n]=Qo(a),r=!0;else{const i=Xo(a);i.wasRedacted&&(r=!0),t[n]=i.value}return{value:t,wasRedacted:r}}return{value:e,wasRedacted:!1}}function tb(){const e=navigator;return{userAgent:e.userAgent,platform:e.platform,language:e.language,languages:[...e.languages||[]],cookiesEnabled:e.cookieEnabled,onLine:e.onLine,hardwareConcurrency:e.hardwareConcurrency,deviceMemory:e.deviceMemory,maxTouchPoints:e.maxTouchPoints,vendor:e.vendor,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,screenWidth:screen.width,screenHeight:screen.height,pixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}async function nb(){await $h();const[e]=await Promise.all([Ah()]),r=kh();return{adBlockEnabled:e,incognitoMode:qh()??!1,inAppBrowser:r.isInAppBrowser}}async function xh(e){const r=[],t={timestamp:new Date().toISOString(),sdkVersion:Ft,clientId:e.clientId,fallbackId:e.fallbackId};t.pageUrl=window.location.href,t.pageTitle=document.title;try{t.browser=tb()}catch(a){r.push(`Browser info collection failed: ${a.message}`)}try{t.detection=await nb()}catch(a){r.push(`Detection collection failed: ${a.message}`)}try{t.localStorage=Ed(localStorage)}catch(a){r.push(`LocalStorage collection failed: ${a.message}`)}try{t.sessionStorage=Ed(sessionStorage)}catch(a){r.push(`SessionStorage collection failed: ${a.message}`)}if(await dr()){try{const a=await fr(!1);if(a){const i=a.split(".");if(i.length>=2){const o=JSON.parse(atob(i[1]));t.userId=o.sub}}}catch(a){r.push(`User ID extraction failed: ${a.message}`)}if(e.getProfile)try{t.profile=await e.getProfile()||void 0}catch(a){r.push(`Profile collection failed: ${a.message}`)}if(e.getEntitlements)try{t.entitlements=await e.getEntitlements()}catch(a){r.push(`Entitlements collection failed: ${a.message}`)}if(e.getContracts)try{t.contracts=await e.getContracts()}catch(a){r.push(`Contracts collection failed: ${a.message}`)}if(e.getTags)try{t.tags=await e.getTags()}catch(a){r.push(`Tags collection failed: ${a.message}`)}if(e.getTallies)try{t.tallies=await e.getTallies()}catch(a){r.push(`Tallies collection failed: ${a.message}`)}}return r.length>0&&(t.errors=r),t}async function ab(e,r,t){const a=`${ir("api2",r)}/diagnostics`,i={"Content-Type":"application/json"};if(await dr())try{const s=await fr(!1);s&&(i.Authorization=`Bearer ${s}`)}catch{}if(!i.Authorization&&t){const s=localStorage.getItem("__anon_id")?.replace(/"/g,"")||"",u=btoa(`${t}|${s}:`);i.Authorization=`Basic ${u}`}const o=await fetch(a,{method:"POST",headers:i,body:JSON.stringify(e)});if(!o.ok){const s=await o.text();throw new Error(`Failed to submit diagnostics: ${s}`)}return o.json()}const Rd="user-diagnostics",Td="diagnostics-id",ib=`
|
|
34
34
|
.sesamy-diagnostics-modal {
|
|
35
35
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
36
36
|
background: white;
|
|
@@ -139,7 +139,7 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
|
|
|
139
139
|
<button class="btn-primary" data-action="send">Send Diagnostics</button>
|
|
140
140
|
</div>
|
|
141
141
|
<div class="status" style="display: none;"></div>
|
|
142
|
-
`,e}function
|
|
142
|
+
`,e}function Nh(e){return new Promise(r=>{const t=ob(),{close:n}=eh(t,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=t.querySelector('[data-action="cancel"]'),i=t.querySelector('[data-action="send"]'),o=t.querySelector(".status"),s=(u,c)=>{o.style.display="block",o.className=`status ${c}`,c==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),r({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await xh(e);s("Sending diagnostics...","loading");const c=await ab(u,e.environment,e.clientId);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),r({sent:!0,id:c.id})},1500)}catch(u){de(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function sb(e){const r=new URLSearchParams(window.location.search);if(r.get(Rd)?.toLowerCase()!=="true")return;const n=r.get(Td);n&&(e.fallbackId=n),de("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(Rd),a.searchParams.delete(Td),window.history.replaceState(null,"",a);const i=await Nh(e);i.sent?de(`Diagnostics sent with ID: ${i.id}`):de("User cancelled diagnostics")}async function ub(e){return Nh(e)}function cb(e){const{autoOnboardProduct:r,bills:t,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:c,getFulfillments:l,getProfile:f,getProxyContent:v,getSubscriptions:d,getTags:h,getTally:p,getTallies:S,getTransaction:R,hasAccess:I,isSpotifyLinked:g,linkSpotify:b,openHostedAccountPage:y,paywalls:A,paymentIssues:q,products:j,pushTally:G,requestDelivery:K,setTag:re,transactions:L,unlinkSpotify:M,updateProfile:N,userMetadata:m,vendor:C}=yg(e),U=()=>q.list(),T={analytics:{track:_h},attribution:{get:tn,set:Dv},auth:{getUser:f,getTokenSilently:fr,isAuthenticated:dr,loginWithRedirect:Ss,loginWithPopup:pm,login:hm,logout:mm,setToken:Do},bills:t,browser:{detectAdblock:Ah,isInAppBrowser:kh,isIncognito:qh},checkouts:n,clearCache:vr,content:{list:Xv,get:Ht,getLanguage:Qt,hasAccess:mg,unlock:Zv,getPropertyFromHTML:Rs,showModal:eh,showNotificationBar:gg},contracts:a,diagnostics:{send:x=>ub({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:x,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()}),collect:x=>xh({clientId:e.clientId||e.vendorId,environment:e.environment,fallbackId:x,getProfile:()=>f(),getEntitlements:()=>c(),getContracts:()=>a.list(),getTags:()=>h(),getTallies:()=>S()})},entitlements:{...s,access:s.getAccess,hasAccess:I,list:c,signedLinks:Is},events:{emit:Xy,cancel:Zy},flags:{get:Hv,set:Bv,list:Bt,delete:Gv},fulfillments:{list:l,requestDelivery:K},generateLink:u,getPaymentIssues:U,getVersion:lb,isReady:()=>exports.isInitialized,log:de,paywalls:A,paymentIssues:q,products:{...j,autoOnboard:r,linkSpotify:b},profile:{get:f,isSpotifyLinked:g,openHostedAccountPage:y,unlinkSpotify:M,update:N},proxy:{getContent:v},subscriptions:{list:d},tags:{delete:i,list:h,set:re},tallies:{delete:o,get:p,list:S,push:G},transactions:{...L,get:R},userMetadata:m,vendor:C,setToken:Do};return e.namespace&&(window[e.namespace]=T),T}function lb(){return Ft}function fb(e,r){e.style.position="relative",e.style.height="200px",e.style.overflow="hidden";let n=0;const a=Array.from(e.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
143
143
|
${r.selector}::before {
|
|
144
144
|
content: '';
|
|
145
145
|
position: absolute;
|
|
@@ -150,4 +150,4 @@ CAUSE: `+d.stack,y.response=g,y.status=g.status,y.url=f,g.type==="opaque")throw
|
|
|
150
150
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
151
151
|
pointer-events: none;
|
|
152
152
|
}
|
|
153
|
-
`,document.head.appendChild(i)}async function db(e){try{const r=await fetch(e);return r.ok?await r.text():(console.error(`Failed to fetch content from ${e}: ${r.statusText}`),null)}catch(r){return console.error(`Error fetching content from ${e}:`,r),null}}async function xs(e){if(e.contentType==="selector"&&e.content){const r=document.querySelector(e.content);if(r)return r.innerHTML;console.warn(`Source element for selector '${e.content}' not found`)}else if(e.contentType==="url"&&e.content){const r=await db(e.content);if(r)return r;console.warn(`Failed to fetch content from URL '${e.content}'`)}else if(e.content)return e.content;return""}async function vb(e,r){const t=r.insertionPoint||"inside",n=await xs(r);switch(t){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function hb(e,r){const t=await xs(r);e.innerHTML=t}async function pb(e,r){const t=await xs(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function mb({enabled:e=!1,rules:r}){e&&Rh(async()=>{const t=await dr(),n=window.location.href;for(const a of r){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==t))switch(a.transform){case"insert":await vb(s,a);break;case"replace":await hb(s,a);break;case"remove":o.remove();break;case"wrap":await pb(s,a);break;case"gradient":fb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const _d="access_token";function gb(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get(_d);if(r){Mo(r);const t=new URL(window.location.href);e.delete(_d),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const Ad="sesamy-refresh",kd="force-refetch-entitlements";function yb(){const e=new URLSearchParams(window.location.search),r=e.get(kd),t=e.get(Ad);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(kd),e.delete(Ad),n.search=e.toString(),vr(),window.history.replaceState(null,"",n)}}const es=(e,r)=>r.some(t=>e instanceof t);let qd,$d;function bb(){return qd||(qd=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function wb(){return $d||($d=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rs=new WeakMap,No=new WeakMap,kn=new WeakMap;function Sb(e){const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(ln(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return kn.set(r,e),r}function Ib(e){if(rs.has(e))return;const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});rs.set(e,r)}let ts={get(e,r,t){if(e instanceof IDBTransaction){if(r==="done")return rs.get(e);if(r==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return ln(e[r])},set(e,r,t){return e[r]=t,!0},has(e,r){return e instanceof IDBTransaction&&(r==="done"||r==="store")?!0:r in e}};function Dh(e){ts=e(ts)}function Pb(e){return wb().includes(e)?function(...r){return e.apply(ns(this),r),ln(this.request)}:function(...r){return ln(e.apply(ns(this),r))}}function Eb(e){return typeof e=="function"?Pb(e):(e instanceof IDBTransaction&&Ib(e),es(e,bb())?new Proxy(e,ts):e)}function ln(e){if(e instanceof IDBRequest)return Sb(e);if(No.has(e))return No.get(e);const r=Eb(e);return r!==e&&(No.set(e,r),kn.set(r,e)),r}const ns=e=>kn.get(e),Rb=["get","getKey","getAll","getAllKeys","count"],Tb=["put","add","delete","clear"],jo=new Map;function Ud(e,r){if(!(e instanceof IDBDatabase&&!(r in e)&&typeof r=="string"))return;if(jo.get(r))return jo.get(r);const t=r.replace(/FromIndex$/,""),n=r!==t,a=Tb.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Rb.includes(t)))return;const i=async function(o,...s){const u=this.transaction(o,a?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(s.shift())),(await Promise.all([c[t](...s),a&&u.done]))[0]};return jo.set(r,i),i}Dh(e=>({...e,get:(r,t,n)=>Ud(r,t)||e.get(r,t,n),has:(r,t)=>!!Ud(r,t)||e.has(r,t)}));const Ob=["continue","continuePrimaryKey","advance"],Ld={},as=new WeakMap,Mh=new WeakMap,Cb={get(e,r){if(!Ob.includes(r))return e[r];let t=Ld[r];return t||(t=Ld[r]=function(...n){as.set(this,Mh.get(this)[r](...n))}),t}};async function*_b(...e){let r=this;if(r instanceof IDBCursor||(r=await r.openCursor(...e)),!r)return;r=r;const t=new Proxy(r,Cb);for(Mh.set(t,r),kn.set(t,ns(r));r;)yield t,r=await(as.get(t)||r.continue()),as.delete(t)}function xd(e,r){return r===Symbol.asyncIterator&&es(e,[IDBIndex,IDBObjectStore,IDBCursor])||r==="iterate"&&es(e,[IDBIndex,IDBObjectStore])}Dh(e=>({...e,get(r,t,n){return xd(r,t)?_b:e.get(r,t,n)},has(r,t){return xd(r,t)||e.has(r,t)}}));function Ab(e){try{const r=e.lastIndexOf(".");if(r===-1)return{valid:!1,error:"invalid_format",message:"Token must contain payload and signature separated by '.'"};const t=e.substring(0,r),n=atob(kb(t)),a=JSON.parse(n);if(typeof a.v!="number"||typeof a.iss!="string"||typeof a.kid!="string"||typeof a.tier!="string"||typeof a.contentId!="string"||typeof a.exp!="number")return{valid:!1,error:"malformed",message:"Token missing required fields"};const i=Math.floor(Date.now()/1e3),o=a.exp-i;return{valid:!0,expired:o<0,expiresIn:o,payload:a}}catch{return{valid:!1,error:"malformed",message:"Failed to decode token"}}}function kb(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");const t=r.length%4;return t&&(r+="=".repeat(4-t)),r}function qb(e){if(!e||typeof e!="string")throw new Error("Invalid token: token must be a non-empty string");const r=e.split(".");if(r.length!==3&&r.length!==2)throw new Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");const t=r.length===3?r[1]:r[0];if(!t)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(t)}catch{throw new Error("Invalid JWT format: payload is not valid base64")}try{return JSON.parse(n)}catch{throw new Error("Invalid JWT format: payload is not valid JSON")}}function $b(e,r){const t=new Date(e.exp*1e3);return{id:"",title:e.p?.toString(),sku:e.s?.toString(),purchaseOption:e.p?.toString(),publisherContentId:e.pid?.toString(),url:e.url?.toString(),token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Ub(e,r){const t=new Date(e.exp*1e3),n=e.meta;return{id:e.tid,title:n?.purchaseOption?.toString()||e.tier,sku:e.tier,purchaseOption:n?.purchaseOption?.toString(),publisherContentId:e.contentId,url:e.url,token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Lb(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy_token")||e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=Ab(r);if(n.valid&&!n.expired){const a=Ub(n.payload,r);zf(a)}else if(n.valid)n.expired&&de("Share token has expired");else{const a=qb(r),i=$b(a,r);zf(i)}}catch(n){de(`Failed to extract signed link ${n}`)}const t=new URL(window.location.href);t.searchParams.delete("ss"),t.searchParams.delete("se"),t.searchParams.delete("sp"),t.searchParams.delete("so"),t.searchParams.delete("token"),t.searchParams.delete("sesamy-token"),t.searchParams.delete("sesamy_token"),window.history.replaceState(null,"",t)}const Nd="sesamy-user";async function xb(){const r=new URLSearchParams(window.location.search).get(Nd)?.toLowerCase();if(!r)return;const t=await vm();t?.email!==r?(de(`Current user does not match sesamy user: ${t?.email} !== ${r}`),vr(),Is({authorizationParams:{login_hint:r}})):de(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(Nd),window.history.replaceState(null,"",n)}const jd="sesamy-purchase";function Nb(){const e=new URLSearchParams(window.location.search),r=e.get(jd);if(r!==null){const t=new URL(window.location.href);e.delete(jd),t.search=e.toString(),de(`Purchase ${r}`),Lr(er.PURCHASE,{itemSrc:r}),vr(),window.history.replaceState(null,"",t)}}const Dd="sesamy-login",jb="sesamy_login";async function Db(){const e=new URLSearchParams(window.location.search);if(!(e.get(Dd)||e.get(jb)))return;await dr()||Is();const n=new URL(window.location.href);n.searchParams.delete(Dd),window.history.replaceState(null,"",n)}const Md="sesamy-debug";async function Mb(){const r=new URLSearchParams(window.location.search).get(Md)?.toLowerCase();if(!r)return;om(r==="true");const t=new URL(window.location.href);t.searchParams.delete(Md),window.history.replaceState(null,"",t)}function fn(){return typeof window<"u"}function Fb(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function Bb(e){if(!fn())return;const r=new URLSearchParams(window.location.search),t={utmSource:r.get("utm_source")??void 0,utmMedium:r.get("utm_medium")??void 0,utmCampaign:r.get("utm_campaign")??void 0,utmTerm:r.get("utm_term")??void 0,utmContent:r.get("utm_content")??void 0,ref:r.get("ref")??void 0,referrer:Fb()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),Mv(t)}function Hb(){const e=new URLSearchParams(window.location.search);let r=!1;try{r=!!window.opener&&window.opener.location.origin===window.location.origin}catch{r=!1}const t=sessionStorage.getItem(Gf)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem(Gf,"true"),n||(de("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Gb(e){const r=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},t=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",r(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};t('[sesamy-link="login"]',()=>e.auth.loginWithRedirect()),t('[sesamy-link="logout"]',()=>e.auth.logout());const n=await e.generateLink({target:"account"});n&&t('[sesamy-link="account"]',()=>{window.location.href=n})}async function Wb(e){const r=await e.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${r?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${r?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(t){console.error("Error handling visibility:",t)}}async function Vb(e){const r=ge("sesamy:locked-content-redirect-url");if(!r)return;const[t]=e.content.list();if(!t)return;await e.entitlements.hasAccess(t.url||"",t.pass?.split(",")||[])||(location.href=r)}exports.isInitialized=!1;async function Fd(e,r){de(`Init with config: ${JSON.stringify(e)}`);try{Hb(),Ky({clientId:e.clientId,environment:e.environment,...e.analytics}),await dm({clientId:e.clientId,vendorId:e.vendorId||e.clientId,organization:e.organization,environment:e.environment,...e.auth}),fg(e,r),e.transform&&await mb(e.transform),Uh(),Mb(),sb({clientId:e.clientId||e.vendorId,environment:e.environment,getProfile:()=>r.profile.get(),getEntitlements:()=>r.entitlements.list(),getContracts:()=>r.contracts.list(),getTags:()=>r.tags.list(),getTallies:()=>r.tallies.list()}),Bb(r),gb(),yb(),Lb(),await Db(),await xb(),Nb(),await Wb(r),await Gb(r),await Vb(r),exports.isInitialized=!0,Lr(er.READY,{})}catch(t){de(`Failed to init ${t.message}`)}}async function Fh(e){de("Initializing Sesamy");const r=e.api?.namespace||"sesamy";if(fn()&&r in window)return de("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[r];const t=cb({clientId:e.clientId,vendorId:e.vendorId,environment:e.environment,...e.api});return fn()?(e.awaitAllServices?await Fd(e,t):Fd(e,t),t):(exports.isInitialized=!0,t)}if(fn()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent);Fh(r)}catch(r){console.error("Failed to parse config",r)}}exports.Events=er;exports.clearMetadataCache=pg;exports.getAllLdJson=vg;exports.getAllMetaTags=Ot;exports.getContentConfig=lg;exports.getContentMetadata=Xv;exports.getLdJson=_t;exports.init=Fh;exports.registerAuthPlugin=Do;
|
|
153
|
+
`,document.head.appendChild(i)}async function db(e){try{const r=await fetch(e);return r.ok?await r.text():(console.error(`Failed to fetch content from ${e}: ${r.statusText}`),null)}catch(r){return console.error(`Error fetching content from ${e}:`,r),null}}async function Ls(e){if(e.contentType==="selector"&&e.content){const r=document.querySelector(e.content);if(r)return r.innerHTML;console.warn(`Source element for selector '${e.content}' not found`)}else if(e.contentType==="url"&&e.content){const r=await db(e.content);if(r)return r;console.warn(`Failed to fetch content from URL '${e.content}'`)}else if(e.content)return e.content;return""}async function vb(e,r){const t=r.insertionPoint||"inside",n=await Ls(r);switch(t){case"before":e.insertAdjacentHTML("beforebegin",n);break;case"after":e.insertAdjacentHTML("afterend",n);break;case"inside":default:e.innerHTML+=n;break}}async function hb(e,r){const t=await Ls(r);e.innerHTML=t}async function pb(e,r){const t=await Ls(r);e.innerHTML=t.replace("${content}",e.innerHTML)}async function mb({enabled:e=!1,rules:r}){e&&Eh(async()=>{const t=await dr(),n=window.location.href;for(const a of r){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==t))switch(a.transform){case"insert":await vb(s,a);break;case"replace":await hb(s,a);break;case"remove":o.remove();break;case"wrap":await pb(s,a);break;case"gradient":fb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const Od="access_token";function gb(){const e=new URLSearchParams(window.location.hash.substring(1)),r=e.get(Od);if(r){Do(r);const t=new URL(window.location.href);e.delete(Od),t.hash=e.toString(),window.history.replaceState(null,"",t)}}const Cd="sesamy-refresh",_d="force-refetch-entitlements";function yb(){const e=new URLSearchParams(window.location.search),r=e.get(_d),t=e.get(Cd);if(r!==null||t!==null){const n=new URL(window.location.href);e.delete(_d),e.delete(Cd),n.search=e.toString(),vr(),window.history.replaceState(null,"",n)}}const Zo=(e,r)=>r.some(t=>e instanceof t);let Ad,kd;function bb(){return Ad||(Ad=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function wb(){return kd||(kd=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const es=new WeakMap,No=new WeakMap,kn=new WeakMap;function Sb(e){const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("success",i),e.removeEventListener("error",o)},i=()=>{t(ln(e.result)),a()},o=()=>{n(e.error),a()};e.addEventListener("success",i),e.addEventListener("error",o)});return kn.set(r,e),r}function Ib(e){if(es.has(e))return;const r=new Promise((t,n)=>{const a=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",o),e.removeEventListener("abort",o)},i=()=>{t(),a()},o=()=>{n(e.error||new DOMException("AbortError","AbortError")),a()};e.addEventListener("complete",i),e.addEventListener("error",o),e.addEventListener("abort",o)});es.set(e,r)}let rs={get(e,r,t){if(e instanceof IDBTransaction){if(r==="done")return es.get(e);if(r==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return ln(e[r])},set(e,r,t){return e[r]=t,!0},has(e,r){return e instanceof IDBTransaction&&(r==="done"||r==="store")?!0:r in e}};function jh(e){rs=e(rs)}function Pb(e){return wb().includes(e)?function(...r){return e.apply(ts(this),r),ln(this.request)}:function(...r){return ln(e.apply(ts(this),r))}}function Eb(e){return typeof e=="function"?Pb(e):(e instanceof IDBTransaction&&Ib(e),Zo(e,bb())?new Proxy(e,rs):e)}function ln(e){if(e instanceof IDBRequest)return Sb(e);if(No.has(e))return No.get(e);const r=Eb(e);return r!==e&&(No.set(e,r),kn.set(r,e)),r}const ts=e=>kn.get(e),Rb=["get","getKey","getAll","getAllKeys","count"],Tb=["put","add","delete","clear"],jo=new Map;function qd(e,r){if(!(e instanceof IDBDatabase&&!(r in e)&&typeof r=="string"))return;if(jo.get(r))return jo.get(r);const t=r.replace(/FromIndex$/,""),n=r!==t,a=Tb.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Rb.includes(t)))return;const i=async function(o,...s){const u=this.transaction(o,a?"readwrite":"readonly");let c=u.store;return n&&(c=c.index(s.shift())),(await Promise.all([c[t](...s),a&&u.done]))[0]};return jo.set(r,i),i}jh(e=>({...e,get:(r,t,n)=>qd(r,t)||e.get(r,t,n),has:(r,t)=>!!qd(r,t)||e.has(r,t)}));const Ob=["continue","continuePrimaryKey","advance"],$d={},ns=new WeakMap,Dh=new WeakMap,Cb={get(e,r){if(!Ob.includes(r))return e[r];let t=$d[r];return t||(t=$d[r]=function(...n){ns.set(this,Dh.get(this)[r](...n))}),t}};async function*_b(...e){let r=this;if(r instanceof IDBCursor||(r=await r.openCursor(...e)),!r)return;r=r;const t=new Proxy(r,Cb);for(Dh.set(t,r),kn.set(t,ts(r));r;)yield t,r=await(ns.get(t)||r.continue()),ns.delete(t)}function Ud(e,r){return r===Symbol.asyncIterator&&Zo(e,[IDBIndex,IDBObjectStore,IDBCursor])||r==="iterate"&&Zo(e,[IDBIndex,IDBObjectStore])}jh(e=>({...e,get(r,t,n){return Ud(r,t)?_b:e.get(r,t,n)},has(r,t){return Ud(r,t)||e.has(r,t)}}));function Ab(e){try{const r=e.lastIndexOf(".");if(r===-1)return{valid:!1,error:"invalid_format",message:"Token must contain payload and signature separated by '.'"};const t=e.substring(0,r),n=atob(kb(t)),a=JSON.parse(n);if(typeof a.v!="number"||typeof a.iss!="string"||typeof a.kid!="string"||typeof a.tier!="string"||typeof a.contentId!="string"||typeof a.exp!="number")return{valid:!1,error:"malformed",message:"Token missing required fields"};const i=Math.floor(Date.now()/1e3),o=a.exp-i;return{valid:!0,expired:o<0,expiresIn:o,payload:a}}catch{return{valid:!1,error:"malformed",message:"Failed to decode token"}}}function kb(e){let r=e.replace(/-/g,"+").replace(/_/g,"/");const t=r.length%4;return t&&(r+="=".repeat(4-t)),r}function qb(e){if(!e||typeof e!="string")throw new Error("Invalid token: token must be a non-empty string");const r=e.split(".");if(r.length!==3&&r.length!==2)throw new Error("Invalid JWT format: token must have 2 or 3 parts separated by dots");const t=r.length===3?r[1]:r[0];if(!t)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(t)}catch{throw new Error("Invalid JWT format: payload is not valid base64")}try{return JSON.parse(n)}catch{throw new Error("Invalid JWT format: payload is not valid JSON")}}function $b(e,r){const t=new Date(e.exp*1e3);return{id:"",title:e.p?.toString(),sku:e.s?.toString(),purchaseOption:e.p?.toString(),publisherContentId:e.pid?.toString(),url:e.url?.toString(),token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Ub(e,r){const t=new Date(e.exp*1e3),n=e.meta;return{id:e.tid,title:n?.purchaseOption?.toString()||e.tier,sku:e.tier,purchaseOption:n?.purchaseOption?.toString(),publisherContentId:e.contentId,url:e.url,token:r,type:"article",hasAccess:!0,expiresAt:t.toISOString(),createdAt:new Date(e.iat*1e3).toISOString(),updatedAt:new Date(e.iat*1e3).toISOString()}}function Lb(){const e=new URLSearchParams(window.location.search),r=e.get("sesamy_token")||e.get("sesamy-token")||e.get("token");if(!r)return;try{const n=Ab(r);if(n.valid&&!n.expired){const a=Ub(n.payload,r);Wf(a)}else if(n.valid)n.expired&&de("Share token has expired");else{const a=qb(r),i=$b(a,r);Wf(i)}}catch(n){de(`Failed to extract signed link ${n}`)}const t=new URL(window.location.href);t.searchParams.delete("ss"),t.searchParams.delete("se"),t.searchParams.delete("sp"),t.searchParams.delete("so"),t.searchParams.delete("token"),t.searchParams.delete("sesamy-token"),t.searchParams.delete("sesamy_token"),window.history.replaceState(null,"",t)}const Ld="sesamy-user";async function xb(){const r=new URLSearchParams(window.location.search).get(Ld)?.toLowerCase();if(!r)return;const t=await vm();t?.email!==r?(de(`Current user does not match sesamy user: ${t?.email} !== ${r}`),vr(),Ss({authorizationParams:{login_hint:r}})):de(`Current user matches sesamy user: ${t?.email} === ${r}`);const n=new URL(window.location.href);n.searchParams.delete(Ld),window.history.replaceState(null,"",n)}const xd="sesamy-purchase";function Nb(){const e=new URLSearchParams(window.location.search),r=e.get(xd);if(r!==null){const t=new URL(window.location.href);e.delete(xd),t.search=e.toString(),de(`Purchase ${r}`),Lr(er.PURCHASE,{itemSrc:r}),vr(),window.history.replaceState(null,"",t)}}const Nd="sesamy-login",jb="sesamy_login";async function Db(){const e=new URLSearchParams(window.location.search);if(!(e.get(Nd)||e.get(jb)))return;await dr()||Ss();const n=new URL(window.location.href);n.searchParams.delete(Nd),window.history.replaceState(null,"",n)}const jd="sesamy-debug";async function Mb(){const r=new URLSearchParams(window.location.search).get(jd)?.toLowerCase();if(!r)return;im(r==="true");const t=new URL(window.location.href);t.searchParams.delete(jd),window.history.replaceState(null,"",t)}function fn(){return typeof window<"u"}function Fb(){if(!document.referrer.length)return;const e=new URL(document.referrer);if(!(e.hostname===window.location.hostname||e.hostname.includes("sesamy")))return document.referrer}async function Bb(e){if(!fn())return;const r=new URLSearchParams(window.location.search),t={utmSource:r.get("utm_source")??void 0,utmMedium:r.get("utm_medium")??void 0,utmCampaign:r.get("utm_campaign")??void 0,utmTerm:r.get("utm_term")??void 0,utmContent:r.get("utm_content")??void 0,ref:r.get("ref")??void 0,referrer:Fb()},[n]=e.content.list();n?.url&&(t.itemSrc=n.url,t.publisherContentId=n.id),Dv(t)}function Hb(){const e=new URLSearchParams(window.location.search);let r=!1;try{r=!!window.opener&&window.opener.location.origin===window.location.origin}catch{r=!1}const t=sessionStorage.getItem(Bf)==="true",n=e.has("code")||e.has("error")||e.has("state");!r||t||(sessionStorage.setItem(Bf,"true"),n||(de("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Gb(e){const r=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},t=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",r(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};t('[sesamy-link="login"]',()=>e.auth.loginWithRedirect()),t('[sesamy-link="logout"]',()=>e.auth.logout());const n=await e.generateLink({target:"account"});n&&t('[sesamy-link="account"]',()=>{window.location.href=n})}async function Wb(e){const r=await e.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${r?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${r?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(t){console.error("Error handling visibility:",t)}}async function Vb(e){const r=ge("sesamy:locked-content-redirect-url");if(!r)return;const[t]=e.content.list();if(!t)return;await e.entitlements.hasAccess(t.url||"",t.pass?.split(",")||[])||(location.href=r)}exports.isInitialized=!1;async function Dd(e,r){de(`Init with config: ${JSON.stringify(e)}`);try{Hb(),Ky({clientId:e.clientId,environment:e.environment,...e.analytics}),await dm({clientId:e.clientId,vendorId:e.vendorId||e.clientId,organization:e.organization,environment:e.environment,...e.auth}),fg(e,r),e.transform&&await mb(e.transform),$h(),Mb(),sb({clientId:e.clientId||e.vendorId,environment:e.environment,getProfile:()=>r.profile.get(),getEntitlements:()=>r.entitlements.list(),getContracts:()=>r.contracts.list(),getTags:()=>r.tags.list(),getTallies:()=>r.tallies.list()}),Bb(r),gb(),yb(),Lb(),await Db(),await xb(),Nb(),await Wb(r),await Gb(r),await Vb(r),exports.isInitialized=!0,Lr(er.READY,{})}catch(t){de(`Failed to init ${t.message}`)}}async function Mh(e){de("Initializing Sesamy");const r=e.api?.namespace||"sesamy";if(fn()&&r in window)return de("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[r];const t=cb({clientId:e.clientId,vendorId:e.vendorId,environment:e.environment,...e.api});return fn()?(e.awaitAllServices?await Dd(e,t):Dd(e,t),t):(exports.isInitialized=!0,t)}if(fn()){const e=document.getElementById("sesamy-js");if(e?.textContent)try{const r=JSON.parse(e.textContent);Mh(r)}catch(r){console.error("Failed to parse config",r)}}exports.Events=er;exports.clearMetadataCache=pg;exports.getAllLdJson=vg;exports.getAllMetaTags=Ot;exports.getContentConfig=lg;exports.getContentMetadata=Qv;exports.getLdJson=_t;exports.init=Mh;exports.registerAuthPlugin=Av;
|