@playpilot/tpi 8.4.0 → 8.4.1

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.
@@ -2,7 +2,7 @@ var O1=Object.defineProperty;var Ls=qe=>{throw TypeError(qe)};var B1=(qe,De,He)=
2
2
  /*$vite$:1*/`,document.head.appendChild(qe);const De=!1;var He=Array.isArray,Ya=Array.prototype.indexOf,Hn=Array.from,Os=Object.defineProperty,vi=Object.getOwnPropertyDescriptor,vl=Object.getOwnPropertyDescriptors,Bs=Object.prototype,Fs=Array.prototype,Vn=Object.getPrototypeOf,pl=Object.isExtensible;function Zi(t){return typeof t=="function"}const bt=()=>{};function Hs(t){return typeof(t==null?void 0:t.then)=="function"}function Vs(t){return t()}function Un(t){for(var e=0;e<t.length;e++)t[e]()}function fl(){var t,e,i=new Promise((a,n)=>{t=a,e=n});return{promise:i,resolve:t,reject:e}}function Za(t,e,i=!1){return t===void 0?i?e():e:t}function Ja(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const i=[];for(const a of t)if(i.push(a),i.length===e)break;return i}const it=2,Wn=4,Xa=8,hl=1<<24,Nt=16,ei=32,Pi=64,Qa=128,Ct=512,rt=1024,dt=2048,ti=4096,ht=8192,ii=16384,$a=32768,Rt=65536,gl=1<<17,Gn=1<<18,Ji=1<<19,ml=1<<20,wa=32768,Kn=1<<21,Yn=1<<22,pi=1<<23,Ot=Symbol("$state"),yl=Symbol("legacy props"),Us=Symbol(""),Xi=new class extends Error{constructor(){super(...arguments);Dt(this,"name","StaleReactionError");Dt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Zn(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ws(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Gs(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Ks(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ys(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Zs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Js(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Xs(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Qs(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function $s(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ec(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const bl=1,_l=2,wl=4,tc=8,ic=16,ac=1,nc=2,rc=4,lc=8,oc=16,sc=1,cc=2,dc=4,uc=1,vc=2,Xe=Symbol(),pc="http://www.w3.org/1999/xhtml",fc="http://www.w3.org/2000/svg",hc="@attach";function gc(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function mc(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function xl(t){return t===this.v}function kl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Sl(t){return!kl(t,this.v)}let Qi=!1,yc=!1;function bc(){Qi=!0}let Me=null;function $i(t){Me=t}function Jn(t){return Tl().get(t)}function Xn(t,e){return Tl().set(t,e),e}function le(t,e=!1,i){Me={p:Me,i:!1,c:null,e:null,s:t,x:null,l:Qi&&!e?{s:null,u:null,$:[]}:null}}function oe(t){var e=Me,i=e.e;if(i!==null){e.e=null;for(var a of i)Jl(a)}return t!==void 0&&(e.x=t),e.i=!0,Me=e.p,t??{}}function Ei(){return!Qi||Me!==null&&Me.l===null}function Tl(t){return Me===null&&Zn(),Me.c??(Me.c=new Map(_c(Me)||void 0))}function _c(t){let e=t.p;for(;e!==null;){const i=e.c;if(i!==null)return i;e=e.p}return null}let Ci=[];function Pl(){var t=Ci;Ci=[],Un(t)}function ai(t){if(Ci.length===0&&!ta){var e=Ci;queueMicrotask(()=>{e===Ci&&Pl()})}Ci.push(t)}function wc(){for(;Ci.length>0;)Pl()}function El(t){var e=je;if(e===null)return Ce.f|=pi,t;if(e.f&$a)ea(t,e);else{if(!(e.f&Qa))throw t;e.b.error(t)}}function ea(t,e){for(;e!==null;){if(e.f&Qa)try{e.b.error(t);return}catch(i){t=i}e=e.parent}throw t}const en=new Set;let xe=null,xa=null,Ge=null,_t=[],tn=null,Qn=!1,ta=!1;const Ln=class Ln{constructor(){_e(this,Je);Dt(this,"committed",!1);Dt(this,"current",new Map);Dt(this,"previous",new Map);_e(this,fa,new Set);_e(this,ha,new Set);_e(this,Fi,0);_e(this,Hi,0);_e(this,Fa,null);_e(this,ga,[]);_e(this,ma,[]);Dt(this,"skipped_effects",new Set);Dt(this,"is_fork",!1)}is_deferred(){return this.is_fork||O(this,Hi)>0}process(e){var a;_t=[],xa=null,this.apply();var i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of e)Re(this,Je,sl).call(this,n,i);this.is_fork||Re(this,Je,Ms).call(this),this.is_deferred()?(Re(this,Je,Yi).call(this,i.effects),Re(this,Je,Yi).call(this,i.render_effects),Re(this,Je,Yi).call(this,i.block_effects)):(xa=this,xe=null,jl(i.render_effects),jl(i.effects),xa=null,(a=O(this,Fa))==null||a.resolve()),Ge=null}capture(e,i){this.previous.has(e)||this.previous.set(e,i),e.f&pi||(this.current.set(e,e.v),Ge==null||Ge.set(e,e.v))}activate(){xe=this,this.apply()}deactivate(){xe===this&&(xe=null,Ge=null)}flush(){if(this.activate(),_t.length>0){if(Il(),xe!==null&&xe!==this)return}else O(this,Fi)===0&&this.process([]);this.deactivate()}discard(){for(const e of O(this,ha))e(this);O(this,ha).clear()}increment(e){pe(this,Fi,O(this,Fi)+1),e&&pe(this,Hi,O(this,Hi)+1)}decrement(e){pe(this,Fi,O(this,Fi)-1),e&&pe(this,Hi,O(this,Hi)-1),this.revive()}revive(){for(const e of O(this,ga))lt(e,dt),Ii(e);for(const e of O(this,ma))lt(e,ti),Ii(e);pe(this,ga,[]),pe(this,ma,[]),this.flush()}oncommit(e){O(this,fa).add(e)}ondiscard(e){O(this,ha).add(e)}settled(){return(O(this,Fa)??pe(this,Fa,fl())).promise}static ensure(){if(xe===null){const e=xe=new Ln;en.add(xe),ta||Ln.enqueue(()=>{xe===e&&e.flush()})}return xe}static enqueue(e){ai(e)}apply(){}};fa=new WeakMap,ha=new WeakMap,Fi=new WeakMap,Hi=new WeakMap,Fa=new WeakMap,ga=new WeakMap,ma=new WeakMap,Je=new WeakSet,sl=function(e,i){var u;e.f^=rt;for(var a=e.first;a!==null;){var n=a.f,r=(n&(ei|Pi))!==0,o=r&&(n&rt)!==0,s=o||(n&ht)!==0||this.skipped_effects.has(a);if(a.f&Qa&&((u=a.b)!=null&&u.is_pending())&&(i={parent:i,effect:a,effects:[],render_effects:[],block_effects:[]}),!s&&a.fn!==null){r?a.f^=rt:n&Wn?i.effects.push(a):Ia(a)&&(a.f&Nt&&i.block_effects.push(a),ja(a));var c=a.first;if(c!==null){a=c;continue}}var d=a.parent;for(a=a.next;a===null&&d!==null;)d===i.effect&&(Re(this,Je,Yi).call(this,i.effects),Re(this,Je,Yi).call(this,i.render_effects),Re(this,Je,Yi).call(this,i.block_effects),i=i.parent),a=d.next,d=d.parent}},Yi=function(e){for(const i of e)(i.f&dt?O(this,ga):O(this,ma)).push(i),Re(this,Je,cl).call(this,i.deps),lt(i,rt)},cl=function(e){if(e!==null)for(const i of e)!(i.f&it)||!(i.f&wa)||(i.f^=wa,Re(this,Je,cl).call(this,i.deps))},Ms=function(){if(O(this,Hi)===0){for(const e of O(this,fa))e();O(this,fa).clear()}O(this,Fi)===0&&Re(this,Je,qs).call(this)},qs=function(){var r;if(en.size>1){this.previous.clear();var e=Ge,i=!0,a={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const o of en){if(o===this){i=!1;continue}const s=[];for(const[d,u]of this.current){if(o.current.has(d))if(i&&u!==o.current.get(d))o.current.set(d,u);else continue;s.push(d)}if(s.length===0)continue;const c=[...o.current.keys()].filter(d=>!this.current.has(d));if(c.length>0){var n=_t;_t=[];const d=new Set,u=new Map;for(const v of s)zl(v,c,d,u);if(_t.length>0){xe=o,o.apply();for(const v of _t)Re(r=o,Je,sl).call(r,v,a);o.deactivate()}_t=n}}xe=null,Ge=e}this.committed=!0,en.delete(this)};let Bt=Ln;function Cl(t){var e=ta;ta=!0;try{for(var i;;){if(wc(),_t.length===0&&(xe==null||xe.flush(),_t.length===0))return tn=null,i;Il()}}finally{ta=e}}function Il(){var t=mi;Qn=!0;var e=null;try{var i=0;for(nn(!0);_t.length>0;){var a=Bt.ensure();if(i++>1e3){var n,r;xc()}a.process(_t),fi.clear()}}finally{Qn=!1,nn(t),tn=null}}function xc(){try{Zs()}catch(t){ea(t,tn)}}let It=null;function jl(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var a=t[i++];if(!(a.f&(ii|ht))&&Ia(a)&&(It=new Set,ja(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?to(a):a.fn=null),(It==null?void 0:It.size)>0)){fi.clear();for(const n of It){if(n.f&(ii|ht))continue;const r=[n];let o=n.parent;for(;o!==null;)It.has(o)&&(It.delete(o),r.push(o)),o=o.parent;for(let s=r.length-1;s>=0;s--){const c=r[s];c.f&(ii|ht)||ja(c)}}It.clear()}}It=null}}function zl(t,e,i,a){if(!i.has(t)&&(i.add(t),t.reactions!==null))for(const n of t.reactions){const r=n.f;r&it?zl(n,e,i,a):r&(Yn|Nt)&&!(r&dt)&&Al(n,e,a)&&(lt(n,dt),Ii(n))}}function Al(t,e,i){const a=i.get(t);if(a!==void 0)return a;if(t.deps!==null)for(const n of t.deps){if(e.includes(n))return!0;if(n.f&it&&Al(n,e,i))return i.set(n,!0),!0}return i.set(t,!1),!1}function Ii(t){for(var e=tn=t;e.parent!==null;){e=e.parent;var i=e.f;if(Qn&&e===je&&i&Nt&&!(i&Gn))return;if(i&(Pi|ei)){if(!(i&rt))return;e.f^=rt}}_t.push(e)}function Ll(t){let e=0,i=Ht(0),a;return()=>{Pa()&&(l(i),an(()=>(e===0&&(a=xt(()=>t(()=>hi(i)))),e+=1,()=>{ai(()=>{e-=1,e===0&&(a==null||a(),a=void 0,hi(i))})})))}}var kc=Rt|Ji|Qa;function Ml(t,e,i){new Sc(t,e,i)}class Sc{constructor(e,i,a){_e(this,et);Dt(this,"parent");_e(this,Tt,!1);_e(this,Pt);_e(this,il,null);_e(this,Zt);_e(this,Vi);_e(this,Jt);_e(this,Et,null);_e(this,pt,null);_e(this,Xt,null);_e(this,di,null);_e(this,wi,null);_e(this,Ui,0);_e(this,xi,0);_e(this,Wi,!1);_e(this,ki,null);_e(this,Mn,Ll(()=>(pe(this,ki,Ht(O(this,Ui))),()=>{pe(this,ki,null)})));pe(this,Pt,e),pe(this,Zt,i),pe(this,Vi,a),this.parent=je.b,pe(this,Tt,!!O(this,Zt).pending),pe(this,Jt,ri(()=>{je.b=this;{var n=Re(this,et,dl).call(this);try{pe(this,Et,ut(()=>a(n)))}catch(r){this.error(r)}O(this,xi)>0?Re(this,et,Fn).call(this):pe(this,Tt,!1)}return()=>{var r;(r=O(this,wi))==null||r.remove()}},kc))}is_pending(){return O(this,Tt)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!O(this,Zt).pending}update_pending_count(e){Re(this,et,ul).call(this,e),pe(this,Ui,O(this,Ui)+e),O(this,ki)&&ni(O(this,ki),O(this,Ui))}get_effect_pending(){return O(this,Mn).call(this),l(O(this,ki))}error(e){var i=O(this,Zt).onerror;let a=O(this,Zt).failed;if(O(this,Wi)||!i&&!a)throw e;O(this,Et)&&(at(O(this,Et)),pe(this,Et,null)),O(this,pt)&&(at(O(this,pt)),pe(this,pt,null)),O(this,Xt)&&(at(O(this,Xt)),pe(this,Xt,null));var n=!1,r=!1;const o=()=>{if(n){mc();return}n=!0,r&&ec(),Bt.ensure(),pe(this,Ui,0),O(this,Xt)!==null&&ia(O(this,Xt),()=>{pe(this,Xt,null)}),pe(this,Tt,this.has_pending_snippet()),pe(this,Et,Re(this,et,Bn).call(this,()=>(pe(this,Wi,!1),ut(()=>O(this,Vi).call(this,O(this,Pt)))))),O(this,xi)>0?Re(this,et,Fn).call(this):pe(this,Tt,!1)};var s=Ce;try{vt(null),r=!0,i==null||i(e,o),r=!1}catch(c){ea(c,O(this,Jt)&&O(this,Jt).parent)}finally{vt(s)}a&&ai(()=>{pe(this,Xt,Re(this,et,Bn).call(this,()=>{Bt.ensure(),pe(this,Wi,!0);try{return ut(()=>{a(O(this,Pt),()=>e,()=>o)})}catch(c){return ea(c,O(this,Jt).parent),null}finally{pe(this,Wi,!1)}}))})}}Tt=new WeakMap,Pt=new WeakMap,il=new WeakMap,Zt=new WeakMap,Vi=new WeakMap,Jt=new WeakMap,Et=new WeakMap,pt=new WeakMap,Xt=new WeakMap,di=new WeakMap,wi=new WeakMap,Ui=new WeakMap,xi=new WeakMap,Wi=new WeakMap,ki=new WeakMap,Mn=new WeakMap,et=new WeakSet,F1=function(){try{pe(this,Et,ut(()=>O(this,Vi).call(this,O(this,Pt))))}catch(e){this.error(e)}pe(this,Tt,!1)},H1=function(){const e=O(this,Zt).pending;e&&(pe(this,pt,ut(()=>e(O(this,Pt)))),Bt.enqueue(()=>{var i=Re(this,et,dl).call(this);pe(this,Et,Re(this,et,Bn).call(this,()=>(Bt.ensure(),ut(()=>O(this,Vi).call(this,i))))),O(this,xi)>0?Re(this,et,Fn).call(this):(ia(O(this,pt),()=>{pe(this,pt,null)}),pe(this,Tt,!1))}))},dl=function(){var e=O(this,Pt);return O(this,Tt)&&(pe(this,wi,jt()),O(this,Pt).before(O(this,wi)),e=O(this,wi)),e},Bn=function(e){var i=je,a=Ce,n=Me;Wt(O(this,Jt)),vt(O(this,Jt)),$i(O(this,Jt).ctx);try{return e()}catch(r){return El(r),null}finally{Wt(i),vt(a),$i(n)}},Fn=function(){const e=O(this,Zt).pending;O(this,Et)!==null&&(pe(this,di,document.createDocumentFragment()),O(this,di).append(O(this,wi)),no(O(this,Et),O(this,di))),O(this,pt)===null&&pe(this,pt,ut(()=>e(O(this,Pt))))},ul=function(e){var i;if(!this.has_pending_snippet()){this.parent&&Re(i=this.parent,et,ul).call(i,e);return}pe(this,xi,O(this,xi)+e),O(this,xi)===0&&(pe(this,Tt,!1),O(this,pt)&&ia(O(this,pt),()=>{pe(this,pt,null)}),O(this,di)&&(O(this,Pt).before(O(this,di)),pe(this,di,null)))};let ji=null;function ql(t){ji=t}function Ne(t,e){return e}function Tc(t,e,i){for(var a=[],n=e.length,r=0;r<n;r++)nr(e[r].e,a,!0);io(a,()=>{var o=a.length===0&&i!==null;if(o){var s=i,c=s.parentNode;Mc(c),c.append(s),t.items.clear(),Ft(t,e[0].prev,e[n-1].next)}for(var d=0;d<n;d++){var u=e[d];o||(t.items.delete(u.k),Ft(t,u.prev,u.next)),at(u.e,!o)}t.first===e[0]&&(t.first=e[0].prev)})}function Le(t,e,i,a,n,r=null){var o=t,s=new Map,c=null,d=(e&wl)!==0,u=(e&bl)!==0,v=(e&_l)!==0;if(d){var p=t;o=p.appendChild(jt())}var f=null,_=er(()=>{var C=i();return He(C)?C:C==null?[]:Hn(C)}),h,b=!0;function g(){Pc(k,h,o,e,a),f!==null&&(h.length===0?(f.fragment?(o.before(f.fragment),f.fragment=null):rr(f.effect),x.first=f.effect):ia(f.effect,()=>{f=null}))}var x=ri(()=>{h=l(_);for(var C=h.length,D=new Set,P=xe,E=null,V=Gl(),L=0;L<C;L+=1){var z=h[L],j=a(z,L),I=b?null:s.get(j);I?(u&&ni(I.v,z),v?ni(I.i,L):I.i=L,V&&P.skipped_effects.delete(I.e)):(I=Ec(b?o:null,E,z,j,L,n,e,i),b&&(I.o=!0,E===null?c=I:E.next=I,E=I),s.set(j,I)),D.add(j)}if(C===0&&r&&!f)if(b)f={fragment:null,effect:ut(()=>r(o))};else{var R=document.createDocumentFragment(),U=jt();R.append(U),f={fragment:R,effect:ut(()=>r(U))}}if(!b)if(V){for(const[K,Y]of s)D.has(K)||P.skipped_effects.add(Y.e);P.oncommit(g),P.ondiscard(()=>{})}else g();l(_)}),k={effect:x,flags:e,items:s,first:c};b=!1}function Pc(t,e,i,a,n){var z,j,I,R;var r=(a&tc)!==0,o=e.length,s=t.items,c=t.first,d,u=null,v,p=[],f=[],_,h,b,g;if(r)for(g=0;g<o;g+=1)_=e[g],h=n(_,g),b=s.get(h),b.o&&((z=b.a)==null||z.measure(),(v??(v=new Set)).add(b));for(g=0;g<o;g+=1){if(_=e[g],h=n(_,g),b=s.get(h),t.first??(t.first=b),!b.o){b.o=!0;var x=u?u.next:c;Ft(t,u,b),Ft(t,b,x),$n(b,x,i),u=b,p=[],f=[],c=u.next;continue}if(b.e.f&ht&&(rr(b.e),r&&((j=b.a)==null||j.unfix(),(v??(v=new Set)).delete(b))),b!==c){if(d!==void 0&&d.has(b)){if(p.length<f.length){var k=f[0],C;u=k.prev;var D=p[0],P=p[p.length-1];for(C=0;C<p.length;C+=1)$n(p[C],k,i);for(C=0;C<f.length;C+=1)d.delete(f[C]);Ft(t,D.prev,P.next),Ft(t,u,D),Ft(t,P,k),c=k,u=P,g-=1,p=[],f=[]}else d.delete(b),$n(b,c,i),Ft(t,b.prev,b.next),Ft(t,b,u===null?t.first:u.next),Ft(t,u,b),u=b;continue}for(p=[],f=[];c!==null&&c.k!==h;)c.e.f&ht||(d??(d=new Set)).add(c),f.push(c),c=c.next;if(c===null)continue;b=c}p.push(b),u=b,c=b.next}if(c!==null||d!==void 0){for(var E=d===void 0?[]:Hn(d);c!==null;)c.e.f&ht||E.push(c),c=c.next;var V=E.length;if(V>0){var L=a&wl&&o===0?i:null;if(r){for(g=0;g<V;g+=1)(I=E[g].a)==null||I.measure();for(g=0;g<V;g+=1)(R=E[g].a)==null||R.fix()}Tc(t,E,L)}}r&&ai(()=>{var U;if(v!==void 0)for(b of v)(U=b.a)==null||U.apply()})}function Ec(t,e,i,a,n,r,o,s){var c=ji,d=(o&bl)!==0,u=(o&ic)===0,v=d?u?ar(i,!1,!1):Ht(i):i,p=o&_l?Ht(n):n,f={i:p,v,k:a,a:null,e:null,o:!1,prev:e,next:null};ji=f;try{if(t===null){var _=document.createDocumentFragment();_.append(t=jt())}return f.e=ut(()=>r(t,v,p,s)),e!==null&&(e.next=f),f}finally{ji=c}}function $n(t,e,i){for(var a=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,r=t.e.nodes_start;r!==null&&r!==a;){var o=Ta(r);n.before(r),r=o}}function Ft(t,e,i){e===null?(t.first=i,t.effect.first=i&&i.e):(e.e===t.effect.last&&i!==null&&(t.effect.last=i.e),e.e.next&&(e.e.next.prev=null),e.next=i,e.e.next=i&&i.e),i===null?t.effect.last=e&&e.e:(i.e===t.effect.last&&e===null&&(t.effect.last=i.e.prev),i.e.prev&&(i.e.prev.next=null),i.prev=e,i.e.prev=e&&e.e)}function Dl(t,e,i,a){const n=Ei()?Sa:er;if(i.length===0&&t.length===0){a(e.map(n));return}var r=xe,o=je,s=Nl();function c(){Promise.all(i.map(d=>Cc(d))).then(d=>{s();try{a([...e.map(n),...d])}catch(u){o.f&ii||ea(u,o)}r==null||r.deactivate(),ka()}).catch(d=>{ea(d,o)})}t.length>0?Promise.all(t).then(()=>{s();try{return c()}finally{r==null||r.deactivate(),ka()}}):c()}function Nl(){var t=je,e=Ce,i=Me,a=xe;return function(r=!0){Wt(t),vt(e),$i(i),r&&(a==null||a.activate())}}function ka(){Wt(null),vt(null),$i(null)}function Sa(t){var e=it|dt,i=Ce!==null&&Ce.f&it?Ce:null;return je!==null&&(je.f|=Ji),{ctx:Me,deps:null,effects:null,equals:xl,f:e,fn:t,reactions:null,rv:0,v:Xe,wv:0,parent:i??je,ac:null}}function Cc(t,e){let i=je;i===null&&Ws();var a=i.b,n=void 0,r=Ht(Xe),o=!Ce,s=new Map;return Fc(()=>{var p;var c=fl();n=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{d===xe&&d.committed&&d.deactivate(),ka()})}catch(f){c.reject(f),ka()}var d=xe;if(o){var u=!a.is_pending();a.update_pending_count(1),d.increment(u),(p=s.get(d))==null||p.reject(Xi),s.delete(d),s.set(d,c)}const v=(f,_=void 0)=>{if(d.activate(),_)_!==Xi&&(r.f|=pi,ni(r,_));else{r.f&pi&&(r.f^=pi),ni(r,f);for(const[h,b]of s){if(s.delete(h),h===d)break;b.reject(Xi)}}o&&(a.update_pending_count(-1),d.decrement(u))};c.promise.then(v,f=>v(null,f||"unknown"))}),Ea(()=>{for(const c of s.values())c.reject(Xi)}),new Promise(c=>{function d(u){function v(){u===n?c(r):d(n)}u.then(v,v)}d(n)})}function F(t){const e=Sa(t);return lo(e),e}function er(t){const e=Sa(t);return e.equals=Sl,e}function Rl(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)at(e[i])}}function Ic(t){for(var e=t.parent;e!==null;){if(!(e.f&it))return e.f&ii?null:e;e=e.parent}return null}function tr(t){var e,i=je;Wt(Ic(t));try{t.f&=~wa,Rl(t),e=vo(t)}finally{Wt(i)}return e}function Ol(t){var e=tr(t);if(t.equals(e)||(xe!=null&&xe.is_fork||(t.v=e),t.wv=co()),!Ai)if(Ge!==null)(Pa()||xe!=null&&xe.is_fork)&&Ge.set(t,e);else{var i=t.f&Ct?rt:ti;lt(t,i)}}let ir=new Set;const fi=new Map;let Bl=!1;function Ht(t,e){var i={f:0,v:t,reactions:null,equals:xl,rv:0,wv:0};return i}function W(t,e){const i=Ht(t);return lo(i),i}function ar(t,e=!1,i=!0){var n;const a=Ht(t);return e||(a.equals=Sl),Qi&&i&&Me!==null&&Me.l!==null&&((n=Me.l).s??(n.s=[])).push(a),a}function A(t,e,i=!1){Ce!==null&&(!Ut||Ce.f&gl)&&Ei()&&Ce.f&(it|Nt|Yn|gl)&&!(st!=null&&st.includes(t))&&$s();let a=i?Ve(e):e;return ni(t,a)}function ni(t,e){if(!t.equals(e)){var i=t.v;Ai?fi.set(t,e):fi.set(t,i),t.v=e;var a=Bt.ensure();a.capture(t,i),t.f&it&&(t.f&dt&&tr(t),lt(t,t.f&Ct?rt:ti)),t.wv=co(),Fl(t,dt),Ei()&&je!==null&&je.f&rt&&!(je.f&(ei|Pi))&&(wt===null?Vc([t]):wt.push(t)),!a.is_fork&&ir.size>0&&!Bl&&jc()}return e}function jc(){Bl=!1;var t=mi;nn(!0);const e=Array.from(ir);try{for(const i of e)i.f&rt&&lt(i,ti),Ia(i)&&ja(i)}finally{nn(t)}ir.clear()}function zc(t,e=1){var i=l(t),a=e===1?i++:i--;return A(t,i),a}function hi(t){A(t,t.v+1)}function Fl(t,e){var i=t.reactions;if(i!==null)for(var a=Ei(),n=i.length,r=0;r<n;r++){var o=i[r],s=o.f;if(!(!a&&o===je)){var c=(s&dt)===0;if(c&&lt(o,e),s&it){var d=o;Ge==null||Ge.delete(d),s&wa||(s&Ct&&(o.f|=wa),Fl(d,ti))}else c&&(s&Nt&&It!==null&&It.add(o),Ii(o))}}}function Ve(t){if(typeof t!="object"||t===null||Ot in t)return t;const e=Vn(t);if(e!==Bs&&e!==Fs)return t;var i=new Map,a=He(t),n=W(0),r=li,o=s=>{if(li===r)return s();var c=Ce,d=li;vt(null),so(r);var u=s();return vt(c),so(d),u};return a&&i.set("length",W(t.length)),new Proxy(t,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&Xs();var u=i.get(c);return u===void 0?u=o(()=>{var v=W(d.value);return i.set(c,v),v}):A(u,d.value,!0),!0},deleteProperty(s,c){var d=i.get(c);if(d===void 0){if(c in s){const u=o(()=>W(Xe));i.set(c,u),hi(n)}}else A(d,Xe),hi(n);return!0},get(s,c,d){var f;if(c===Ot)return t;var u=i.get(c),v=c in s;if(u===void 0&&(!v||(f=vi(s,c))!=null&&f.writable)&&(u=o(()=>{var _=Ve(v?s[c]:Xe),h=W(_);return h}),i.set(c,u)),u!==void 0){var p=l(u);return p===Xe?void 0:p}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var u=i.get(c);u&&(d.value=l(u))}else if(d===void 0){var v=i.get(c),p=v==null?void 0:v.v;if(v!==void 0&&p!==Xe)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return d},has(s,c){var p;if(c===Ot)return!0;var d=i.get(c),u=d!==void 0&&d.v!==Xe||Reflect.has(s,c);if(d!==void 0||je!==null&&(!u||(p=vi(s,c))!=null&&p.writable)){d===void 0&&(d=o(()=>{var f=u?Ve(s[c]):Xe,_=W(f);return _}),i.set(c,d));var v=l(d);if(v===Xe)return!1}return u},set(s,c,d,u){var k;var v=i.get(c),p=c in s;if(a&&c==="length")for(var f=d;f<v.v;f+=1){var _=i.get(f+"");_!==void 0?A(_,Xe):f in s&&(_=o(()=>W(Xe)),i.set(f+"",_))}if(v===void 0)(!p||(k=vi(s,c))!=null&&k.writable)&&(v=o(()=>W(void 0)),A(v,Ve(d)),i.set(c,v));else{p=v.v!==Xe;var h=o(()=>Ve(d));A(v,h)}var b=Reflect.getOwnPropertyDescriptor(s,c);if(b!=null&&b.set&&b.set.call(u,d),!p){if(a&&typeof c=="string"){var g=i.get("length"),x=Number(c);Number.isInteger(x)&&x>=g.v&&A(g,x+1)}hi(n)}return!0},ownKeys(s){l(n);var c=Reflect.ownKeys(s).filter(v=>{var p=i.get(v);return p===void 0||p.v!==Xe});for(var[d,u]of i)u.v!==Xe&&!(d in s)&&c.push(d);return c},setPrototypeOf(){Qs()}})}function Hl(t){try{if(t!==null&&typeof t=="object"&&Ot in t)return t[Ot]}catch{}return t}function Ac(t,e){return Object.is(Hl(t),Hl(e))}var Ie,Vl,Ul,Wl;function Lc(){if(Ie===void 0){Ie=window,Vl=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;Ul=vi(e,"firstChild").get,Wl=vi(e,"nextSibling").get,pl(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),pl(i)&&(i.__t=void 0)}}function jt(t=""){return document.createTextNode(t)}function Vt(t){return Ul.call(t)}function Ta(t){return Wl.call(t)}function w(t,e){return Vt(t)}function Q(t,e=!1){{var i=Vt(t);return i instanceof Comment&&i.data===""?Ta(i):i}}function S(t,e=1,i=!1){let a=t;for(;e--;)a=Ta(a);return a}function Mc(t){t.textContent=""}function Gl(){return!1}function qc(t,e){if(e){const i=document.body;t.autofocus=!0,ai(()=>{document.activeElement===i&&t.focus()})}}let Kl=!1;function Dc(){Kl||(Kl=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const i of t.target.elements)(e=i.__on_r)==null||e.call(i)})},{capture:!0}))}function Nc(t,e,i,a=!0){a&&i();for(var n of e)t.addEventListener(n,i);Ea(()=>{for(var r of e)t.removeEventListener(r,i)})}function zi(t){var e=Ce,i=je;vt(null),Wt(null);try{return t()}finally{vt(e),Wt(i)}}function Yl(t,e,i,a=i){t.addEventListener(e,()=>zi(i));const n=t.__on_r;n?t.__on_r=()=>{n(),a(!0)}:t.__on_r=()=>a(!0),Dc()}function Zl(t){je===null&&(Ce===null&&Ys(),Ks()),Ai&&Gs()}function Rc(t,e){var i=e.last;i===null?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}function zt(t,e,i){var a=je;a!==null&&a.f&ht&&(t|=ht);var n={ctx:Me,deps:null,nodes_start:null,nodes_end:null,f:t|dt|Ct,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(i)try{ja(n),n.f|=$a}catch(s){throw at(n),s}else e!==null&&Ii(n);var r=n;if(i&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&Ji)&&(r=r.first,t&Nt&&t&Rt&&r!==null&&(r.f|=Rt)),r!==null&&(r.parent=a,a!==null&&Rc(r,a),Ce!==null&&Ce.f&it&&!(t&Pi))){var o=Ce;(o.effects??(o.effects=[])).push(r)}return n}function Pa(){return Ce!==null&&!Ut}function Ea(t){const e=zt(Xa,null,!1);return lt(e,rt),e.teardown=t,e}function Ze(t){Zl();var e=je.f,i=!Ce&&(e&ei)!==0&&(e&$a)===0;if(i){var a=Me;(a.e??(a.e=[])).push(t)}else return Jl(t)}function Jl(t){return zt(Wn|ml,t,!1)}function Oc(t){return Zl(),zt(Xa|ml,t,!0)}function Bc(t){Bt.ensure();const e=zt(Pi|Ji,t,!0);return(i={})=>new Promise(a=>{i.outro?ia(e,()=>{at(e),a(void 0)}):(at(e),a(void 0))})}function gi(t){return zt(Wn,t,!1)}function Fc(t){return zt(Yn|Ji,t,!0)}function an(t,e=0){return zt(Xa|e,t,!0)}function H(t,e=[],i=[],a=[]){Dl(a,e,i,n=>{zt(Xa,()=>t(...n.map(l)),!0)})}function ri(t,e=0){var i=zt(Nt|e,t,!0);return i}function Xl(t,e=0){var i=zt(hl|e,t,!0);return i}function ut(t){return zt(ei|Ji,t,!0)}function Ql(t){var e=t.teardown;if(e!==null){const i=Ai,a=Ce;ro(!0),vt(null);try{e.call(null)}finally{ro(i),vt(a)}}}function $l(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const n=i.ac;n!==null&&zi(()=>{n.abort(Xi)});var a=i.next;i.f&Pi?i.parent=null:at(i,e),i=a}}function Hc(t){for(var e=t.first;e!==null;){var i=e.next;e.f&ei||at(e),e=i}}function at(t,e=!0){var i=!1;(e||t.f&Gn)&&t.nodes_start!==null&&t.nodes_end!==null&&(eo(t.nodes_start,t.nodes_end),i=!0),$l(t,e&&!i),rn(t,0),lt(t,ii);var a=t.transitions;if(a!==null)for(const r of a)r.stop();Ql(t);var n=t.parent;n!==null&&n.first!==null&&to(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function eo(t,e){for(;t!==null;){var i=t===e?null:Ta(t);t.remove(),t=i}}function to(t){var e=t.parent,i=t.prev,a=t.next;i!==null&&(i.next=a),a!==null&&(a.prev=i),e!==null&&(e.first===t&&(e.first=a),e.last===t&&(e.last=i))}function ia(t,e,i=!0){var a=[];nr(t,a,!0),io(a,()=>{i&&at(t),e&&e()})}function io(t,e){var i=t.length;if(i>0){var a=()=>--i||e();for(var n of t)n.out(a)}else e()}function nr(t,e,i){if(!(t.f&ht)){if(t.f^=ht,t.transitions!==null)for(const o of t.transitions)(o.is_global||i)&&e.push(o);for(var a=t.first;a!==null;){var n=a.next,r=(a.f&Rt)!==0||(a.f&ei)!==0&&(t.f&Nt)!==0;nr(a,e,r?i:!1),a=n}}}function rr(t){ao(t,!0)}function ao(t,e){if(t.f&ht){t.f^=ht,t.f&rt||(lt(t,dt),Ii(t));for(var i=t.first;i!==null;){var a=i.next,n=(i.f&Rt)!==0||(i.f&ei)!==0;ao(i,n?e:!1),i=a}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function no(t,e){for(var i=t.nodes_start,a=t.nodes_end;i!==null;){var n=i===a?null:Ta(i);e.append(i),i=n}}let mi=!1;function nn(t){mi=t}let Ai=!1;function ro(t){Ai=t}let Ce=null,Ut=!1;function vt(t){Ce=t}let je=null;function Wt(t){je=t}let st=null;function lo(t){Ce!==null&&(st===null?st=[t]:st.push(t))}let ct=null,gt=0,wt=null;function Vc(t){wt=t}let oo=1,Ca=0,li=Ca;function so(t){li=t}function co(){return++oo}function Ia(t){var e=t.f;if(e&dt)return!0;if(e&it&&(t.f&=-32769),e&ti){var i=t.deps;if(i!==null)for(var a=i.length,n=0;n<a;n++){var r=i[n];if(Ia(r)&&Ol(r),r.wv>t.wv)return!0}e&Ct&&Ge===null&&lt(t,rt)}return!1}function uo(t,e,i=!0){var a=t.reactions;if(a!==null&&!(st!=null&&st.includes(t)))for(var n=0;n<a.length;n++){var r=a[n];r.f&it?uo(r,e,!1):e===r&&(i?lt(r,dt):r.f&rt&&lt(r,ti),Ii(r))}}function vo(t){var _;var e=ct,i=gt,a=wt,n=Ce,r=st,o=Me,s=Ut,c=li,d=t.f;ct=null,gt=0,wt=null,Ce=d&(ei|Pi)?null:t,st=null,$i(t.ctx),Ut=!1,li=++Ca,t.ac!==null&&(zi(()=>{t.ac.abort(Xi)}),t.ac=null);try{t.f|=Kn;var u=t.fn,v=u(),p=t.deps;if(ct!==null){var f;if(rn(t,gt),p!==null&&gt>0)for(p.length=gt+ct.length,f=0;f<ct.length;f++)p[gt+f]=ct[f];else t.deps=p=ct;if(mi&&Pa()&&t.f&Ct)for(f=gt;f<p.length;f++)((_=p[f]).reactions??(_.reactions=[])).push(t)}else p!==null&&gt<p.length&&(rn(t,gt),p.length=gt);if(Ei()&&wt!==null&&!Ut&&p!==null&&!(t.f&(it|ti|dt)))for(f=0;f<wt.length;f++)uo(wt[f],t);return n!==null&&n!==t&&(Ca++,wt!==null&&(a===null?a=wt:a.push(...wt))),t.f&pi&&(t.f^=pi),v}catch(h){return El(h)}finally{t.f^=Kn,ct=e,gt=i,wt=a,Ce=n,st=r,$i(o),Ut=s,li=c}}function Uc(t,e){let i=e.reactions;if(i!==null){var a=Ya.call(i,t);if(a!==-1){var n=i.length-1;n===0?i=e.reactions=null:(i[a]=i[n],i.pop())}}i===null&&e.f&it&&(ct===null||!ct.includes(e))&&(lt(e,ti),e.f&Ct&&(e.f^=Ct,e.f&=-32769),Rl(e),rn(e,0))}function rn(t,e){var i=t.deps;if(i!==null)for(var a=e;a<i.length;a++)Uc(t,i[a])}function ja(t){var e=t.f;if(!(e&ii)){lt(t,rt);var i=je,a=mi;je=t,mi=!0;try{e&(Nt|hl)?Hc(t):$l(t),Ql(t);var n=vo(t);t.teardown=typeof n=="function"?n:null,t.wv=oo;var r;De&&yc&&t.f&dt&&t.deps}finally{mi=a,je=i}}}async function za(){await Promise.resolve(),Cl()}function l(t){var e=t.f,i=(e&it)!==0;if(Ce!==null&&!Ut){var a=je!==null&&(je.f&ii)!==0;if(!a&&!(st!=null&&st.includes(t))){var n=Ce.deps;if(Ce.f&Kn)t.rv<Ca&&(t.rv=Ca,ct===null&&n!==null&&n[gt]===t?gt++:ct===null?ct=[t]:ct.includes(t)||ct.push(t));else{(Ce.deps??(Ce.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[Ce]:r.includes(Ce)||r.push(Ce)}}}if(Ai){if(fi.has(t))return fi.get(t);if(i){var o=t,s=o.v;return(!(o.f&rt)&&o.reactions!==null||fo(o))&&(s=tr(o)),fi.set(o,s),s}}else i&&(!(Ge!=null&&Ge.has(t))||xe!=null&&xe.is_fork&&!Pa())&&(o=t,Ia(o)&&Ol(o),mi&&Pa()&&!(o.f&Ct)&&po(o));if(Ge!=null&&Ge.has(t))return Ge.get(t);if(t.f&pi)throw t.v;return t.v}function po(t){if(t.deps!==null){t.f^=Ct;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&it&&!(e.f&Ct)&&po(e)}}function fo(t){if(t.v===Xe)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(fi.has(e)||e.f&it&&fo(e))return!0;return!1}function xt(t){var e=Ut;try{return Ut=!0,t()}finally{Ut=e}}const Wc=-7169;function lt(t,e){t.f=t.f&Wc|e}function ho(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Ot in t)lr(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];typeof i=="object"&&i&&Ot in i&&lr(i)}}}function lr(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let a in t)try{lr(t[a],e)}catch{}const i=Vn(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const a=vl(i);for(let n in a){const r=a[n].get;if(r)try{r.call(t)}catch{}}}}}function Gc(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Kc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Yc(t){return Kc.includes(t)}const Zc={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Jc(t){return t=t.toLowerCase(),Zc[t]??t}const Xc=["touchstart","touchmove"];function Qc(t){return Xc.includes(t)}const go=new Set,or=new Set;function sr(t,e,i,a={}){function n(r){if(a.capture||Aa.call(e,r),!r.cancelBubble)return zi(()=>i==null?void 0:i.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?ai(()=>{e.addEventListener(t,n,a)}):e.addEventListener(t,n,a),n}function $c(t,e,i,a={}){var n=sr(e,t,i,a);return()=>{t.removeEventListener(e,n,a)}}function he(t,e,i,a,n){var r={capture:a,passive:n},o=sr(t,e,i,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ea(()=>{e.removeEventListener(t,o,r)})}function ke(t){for(var e=0;e<t.length;e++)go.add(t[e]);for(var i of or)i(t)}let mo=null;function Aa(t){var b;var e=this,i=e.ownerDocument,a=t.type,n=((b=t.composedPath)==null?void 0:b.call(t))||[],r=n[0]||t.target;mo=t;var o=0,s=mo===t&&t.__root;if(s){var c=n.indexOf(s);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var d=n.indexOf(e);if(d===-1)return;c<=d&&(o=c)}if(r=n[o]||t.target,r!==e){Os(t,"currentTarget",{configurable:!0,get(){return r||i}});var u=Ce,v=je;vt(null),Wt(null);try{for(var p,f=[];r!==null;){var _=r.assignedSlot||r.parentNode||r.host||null;try{var h=r["__"+a];h!=null&&(!r.disabled||t.target===r)&&h.call(r,t)}catch(g){p?f.push(g):p=g}if(t.cancelBubble||_===e||_===null)break;r=_}if(p){for(let g of f)queueMicrotask(()=>{throw g});throw p}}finally{t.__root=e,delete t.currentTarget,vt(u),Wt(v)}}}function cr(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Li(t,e){var i=je;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function T(t,e){var i=(e&uc)!==0,a=(e&vc)!==0,n,r=!t.startsWith("<!>");return()=>{n===void 0&&(n=cr(r?t:"<!>"+t),i||(n=Vt(n)));var o=a||Vl?document.importNode(n,!0):n.cloneNode(!0);if(i){var s=Vt(o),c=o.lastChild;Li(s,c)}else Li(o,o);return o}}function ed(t,e,i="svg"){var a=!t.startsWith("<!>"),n=`<${i}>${a?t:"<!>"+t}</${i}>`,r;return()=>{if(!r){var o=cr(n),s=Vt(o);r=Vt(s)}var c=r.cloneNode(!0);return Li(c,c),c}}function Ue(t,e){return ed(t,e,"svg")}function Qe(t=""){{var e=jt(t+"");return Li(e,e),e}}function ge(){var t=document.createDocumentFragment(),e=document.createComment(""),i=jt();return t.append(e,i),Li(e,i),t}function y(t,e){t!==null&&t.before(e)}let ln=!0;function on(t){ln=t}function Z(t,e){var i=e==null?"":typeof e=="object"?e+"":e;i!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=i,t.nodeValue=i+"")}function At(t,e){return td(t,e)}const aa=new Map;function td(t,{target:e,anchor:i,props:a={},events:n,context:r,intro:o=!0}){Lc();var s=new Set,c=v=>{for(var p=0;p<v.length;p++){var f=v[p];if(!s.has(f)){s.add(f);var _=Qc(f);e.addEventListener(f,Aa,{passive:_});var h=aa.get(f);h===void 0?(document.addEventListener(f,Aa,{passive:_}),aa.set(f,1)):aa.set(f,h+1)}}};c(Hn(go)),or.add(c);var d=void 0,u=Bc(()=>{var v=i??e.appendChild(jt());return Ml(v,{pending:()=>{}},p=>{if(r){le({});var f=Me;f.c=r}n&&(a.$$events=n),ln=o,d=t(p,a)||{},ln=!0,r&&oe()}),()=>{var _;for(var p of s){e.removeEventListener(p,Aa);var f=aa.get(p);--f===0?(document.removeEventListener(p,Aa),aa.delete(p)):aa.set(p,f)}or.delete(c),v!==i&&((_=v.parentNode)==null||_.removeChild(v))}});return dr.set(d,u),d}let dr=new WeakMap;function Mi(t,e){const i=dr.get(t);return i?(dr.delete(t),i(e)):Promise.resolve()}class na{constructor(e,i=!0){Dt(this,"anchor");_e(this,Mt,new Map);_e(this,Qt,new Map);_e(this,yt,new Map);_e(this,Gi,new Set);_e(this,Ha,!0);_e(this,Va,()=>{var e=xe;if(O(this,Mt).has(e)){var i=O(this,Mt).get(e),a=O(this,Qt).get(i);if(a)rr(a),O(this,Gi).delete(i);else{var n=O(this,yt).get(i);n&&(O(this,Qt).set(i,n.effect),O(this,yt).delete(i),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),a=n.effect)}for(const[r,o]of O(this,Mt)){if(O(this,Mt).delete(r),r===e)break;const s=O(this,yt).get(o);s&&(at(s.effect),O(this,yt).delete(o))}for(const[r,o]of O(this,Qt)){if(r===i||O(this,Gi).has(r))continue;const s=()=>{if(Array.from(O(this,Mt).values()).includes(r)){var d=document.createDocumentFragment();no(o,d),d.append(jt()),O(this,yt).set(r,{effect:o,fragment:d})}else at(o);O(this,Gi).delete(r),O(this,Qt).delete(r)};O(this,Ha)||!a?(O(this,Gi).add(r),ia(o,s,!1)):s()}}});_e(this,qn,e=>{O(this,Mt).delete(e);const i=Array.from(O(this,Mt).values());for(const[a,n]of O(this,yt))i.includes(a)||(at(n.effect),O(this,yt).delete(a))});this.anchor=e,pe(this,Ha,i)}ensure(e,i){var a=xe,n=Gl();if(i&&!O(this,Qt).has(e)&&!O(this,yt).has(e))if(n){var r=document.createDocumentFragment(),o=jt();r.append(o),O(this,yt).set(e,{effect:ut(()=>i(o)),fragment:r})}else O(this,Qt).set(e,ut(()=>i(this.anchor)));if(O(this,Mt).set(a,e),n){for(const[s,c]of O(this,Qt))s===e?a.skipped_effects.delete(c):a.skipped_effects.add(c);for(const[s,c]of O(this,yt))s===e?a.skipped_effects.delete(c.effect):a.skipped_effects.add(c.effect);a.oncommit(O(this,Va)),a.ondiscard(O(this,qn))}else O(this,Va).call(this)}}Mt=new WeakMap,Qt=new WeakMap,yt=new WeakMap,Gi=new WeakMap,Ha=new WeakMap,Va=new WeakMap,qn=new WeakMap;const id=0,ur=1;function sn(t,e,i,a,n){var r=Ei(),o=Xe,s=r?Ht(o):ar(o,!1,!1),c=r?Ht(o):ar(o,!1,!1),d=new na(t);ri(()=>{var u=e(),v=!1;if(Hs(u)){var p=Nl(),f=!1;const _=h=>{if(!v){f=!0,p(!1),Bt.ensure();try{h()}finally{ka(),ta||Cl()}}};u.then(h=>{_(()=>{ni(s,h),d.ensure(ur,a&&(b=>a(b,s)))})},h=>{_(()=>{if(ni(c,h),d.ensure(ur,n&&(b=>n(b,c))),!n)throw c.v})}),ai(()=>{f||_(()=>{d.ensure(id,i)})})}else ni(s,u),d.ensure(ur,a&&(_=>a(_,s)));return()=>{v=!0}})}function B(t,e,i=!1){var a=new na(t),n=i?Rt:0;function r(o,s){a.ensure(o,s)}ri(()=>{var o=!1;e((s,c=!0)=>{o=!0,r(c,s)}),o||r(!1,null)},n)}function qi(t,e,i){var a=new na(t),n=!Ei();ri(()=>{var r=e();n&&r!==null&&typeof r=="object"&&(r={}),a.ensure(r,i)})}function ad(t,e,i=!1,a=!1,n=!1){var r=t,o="";H(()=>{var s=je;if(o!==(o=e()??"")&&(s.nodes_start!==null&&(eo(s.nodes_start,s.nodes_end),s.nodes_start=s.nodes_end=null),o!=="")){var c=o+"";i?c=`<svg>${c}</svg>`:a&&(c=`<math>${c}</math>`);var d=cr(c);if((i||a)&&(d=Vt(d)),Li(Vt(d),d.lastChild),i||a)for(;Vt(d);)r.before(Vt(d));else r.before(d)}})}function Be(t,e,...i){var a=new na(t);ri(()=>{const n=e()??null;a.ensure(n,n&&(r=>n(r,...i)))},Rt)}function vr(t,e,i){var a=new na(t);ri(()=>{var n=e()??null;a.ensure(n,n&&(r=>i(r,n)))},Rt)}function yo(t,e,i,a,n,r){var o=null,s=t,c=ji,d=new na(s,!1);ri(()=>{const u=e()||null;var v=u==="svg"?fc:null;if(u===null){d.ensure(null,null),on(!0);return}return d.ensure(u,p=>{var f=ji;if(ql(c),u){if(o=v?document.createElementNS(v,u):document.createElement(u),Li(o,o),a){var _=o.appendChild(jt());a(o,_)}je.nodes_end=o,p.before(o)}ql(f)}),on(!0),()=>{u&&on(!1)}},Rt),Ea(()=>{on(!0)})}function nd(t,e){var i;i=document.head.appendChild(jt());try{ri(()=>e(i),Gn)}finally{}}function mt(t,e,i){gi(()=>{var a=xt(()=>e(t,i==null?void 0:i())||{});if(i&&(a!=null&&a.update)){var n=!1,r={};an(()=>{var o=i();ho(o),n&&kl(r,o)&&(r=o,a.update(o))}),n=!0}if(a!=null&&a.destroy)return()=>a.destroy()})}function cn(t,e){var i=void 0,a;Xl(()=>{i!==(i=e())&&(a&&(at(a),a=null),i&&(a=ut(()=>{gi(()=>i(t))})))})}function bo(t){var e,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(i=bo(t[e]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function rd(){for(var t,e,i=0,a="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=bo(t))&&(a&&(a+=" "),a+=e);return a}function ld(t){return typeof t=="object"?rd(t):t??""}const _o=[...`
3
3
  \r\f \v\uFEFF`];function od(t,e,i){var a=t==null?"":""+t;if(e&&(a=a?a+" "+e:e),i){for(var n in i)if(i[n])a=a?a+" "+n:n;else if(a.length)for(var r=n.length,o=0;(o=a.indexOf(n,o))>=0;){var s=o+r;(o===0||_o.includes(a[o-1]))&&(s===a.length||_o.includes(a[s]))?a=(o===0?"":a.substring(0,o))+a.substring(s+1):o=s}}return a===""?null:a}function wo(t,e=!1){var i=e?" !important;":";",a="";for(var n in t){var r=t[n];r!=null&&r!==""&&(a+=" "+n+": "+r+i)}return a}function pr(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function sd(t,e){if(e){var i="",a,n;if(Array.isArray(e)?(a=e[0],n=e[1]):a=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var r=!1,o=0,s=!1,c=[];a&&c.push(...Object.keys(a).map(pr)),n&&c.push(...Object.keys(n).map(pr));var d=0,u=-1;const h=t.length;for(var v=0;v<h;v++){var p=t[v];if(s?p==="/"&&t[v-1]==="*"&&(s=!1):r?r===p&&(r=!1):p==="/"&&t[v+1]==="*"?s=!0:p==='"'||p==="'"?r=p:p==="("?o++:p===")"&&o--,!s&&r===!1&&o===0){if(p===":"&&u===-1)u=v;else if(p===";"||v===h-1){if(u!==-1){var f=pr(t.substring(d,u).trim());if(!c.includes(f)){p!==";"&&v++;var _=t.substring(d,v).trim();i+=" "+_+";"}}d=v+1,u=-1}}}}return a&&(i+=wo(a)),n&&(i+=wo(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function we(t,e,i,a,n,r){var o=t.__className;if(o!==i||o===void 0){var s=od(i,a,r);s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s),t.__className=i}else if(r&&n!==r)for(var c in r){var d=!!r[c];(n==null||d!==!!n[c])&&t.classList.toggle(c,d)}return r}function fr(t,e={},i,a){for(var n in i){var r=i[n];e[n]!==r&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,r,a))}}function We(t,e,i,a){var n=t.__style;if(n!==e){var r=sd(e,a);r==null?t.removeAttribute("style"):t.style.cssText=r,t.__style=e}else a&&(Array.isArray(a)?(fr(t,i==null?void 0:i[0],a[0]),fr(t,i==null?void 0:i[1],a[1],"important")):fr(t,i,a));return a}function dn(t,e,i=!1){if(t.multiple){if(e==null)return;if(!He(e))return gc();for(var a of t.options)a.selected=e.includes(La(a));return}for(a of t.options){var n=La(a);if(Ac(n,e)){a.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function xo(t){var e=new MutationObserver(()=>{dn(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ea(()=>{e.disconnect()})}function cd(t,e,i=e){var a=new WeakSet,n=!0;Yl(t,"change",r=>{var o=r?"[selected]":":checked",s;if(t.multiple)s=[].map.call(t.querySelectorAll(o),La);else{var c=t.querySelector(o)??t.querySelector("option:not([disabled])");s=c&&La(c)}i(s),xe!==null&&a.add(xe)}),gi(()=>{var r=e();if(t===document.activeElement){var o=xa??xe;if(a.has(o))return}if(dn(t,r,n),n&&r===void 0){var s=t.querySelector(":checked");s!==null&&(r=La(s),i(r))}t.__value=r,n=!1}),xo(t)}function La(t){return"__value"in t?t.__value:t.value}const ra=Symbol("class"),la=Symbol("style"),ko=Symbol("is custom element"),So=Symbol("is html");function dd(t,e){var i=hr(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function ud(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function re(t,e,i,a){var n=hr(t);n[e]!==(n[e]=i)&&(e==="loading"&&(t[Us]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Eo(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function vd(t,e,i,a,n=!1,r=!1){var o=hr(t),s=o[ko],c=!o[So],d=e||{},u=t.tagName==="OPTION";for(var v in e)v in i||(i[v]=null);i.class?i.class=ld(i.class):(a||i[ra])&&(i.class=null),i[la]&&(i.style??(i.style=null));var p=Eo(t);for(const k in i){let C=i[k];if(u&&k==="value"&&C==null){t.value=t.__value="",d[k]=C;continue}if(k==="class"){var f=t.namespaceURI==="http://www.w3.org/1999/xhtml";we(t,f,C,a,e==null?void 0:e[ra],i[ra]),d[k]=C,d[ra]=i[ra];continue}if(k==="style"){We(t,C,e==null?void 0:e[la],i[la]),d[k]=C,d[la]=i[la];continue}var _=d[k];if(!(C===_&&!(C===void 0&&t.hasAttribute(k)))){d[k]=C;var h=k[0]+k[1];if(h!=="$$")if(h==="on"){const D={},P="$$"+k;let E=k.slice(2);var b=Yc(E);if(Gc(E)&&(E=E.slice(0,-7),D.capture=!0),!b&&_){if(C!=null)continue;t.removeEventListener(E,d[P],D),d[P]=null}if(C!=null)if(b)t[`__${E}`]=C,ke([E]);else{let V=function(L){d[k].call(this,L)};d[P]=sr(E,t,V,D)}else b&&(t[`__${E}`]=void 0)}else if(k==="style")re(t,k,C);else if(k==="autofocus")qc(t,!!C);else if(!s&&(k==="__value"||k==="value"&&C!=null))t.value=t.__value=C;else if(k==="selected"&&u)ud(t,C);else{var g=k;c||(g=Jc(g));var x=g==="defaultValue"||g==="defaultChecked";if(C==null&&!s&&!x)if(o[k]=null,g==="value"||g==="checked"){let D=t;const P=e===void 0;if(g==="value"){let E=D.defaultValue;D.removeAttribute(g),D.defaultValue=E,D.value=D.__value=P?E:null}else{let E=D.defaultChecked;D.removeAttribute(g),D.defaultChecked=E,D.checked=P?E:!1}}else t.removeAttribute(k);else x||p.includes(g)&&(s||typeof C!="string")?(t[g]=C,g in o&&(o[g]=Xe)):typeof C!="function"&&re(t,g,C)}}}return d}function To(t,e,i=[],a=[],n=[],r,o=!1,s=!1){Dl(n,i,a,c=>{var d=void 0,u={},v=t.nodeName==="SELECT",p=!1;if(Xl(()=>{var _=e(...c.map(l)),h=vd(t,d,_,r,o,s);p&&v&&"value"in _&&dn(t,_.value);for(let g of Object.getOwnPropertySymbols(u))_[g]||at(u[g]);for(let g of Object.getOwnPropertySymbols(_)){var b=_[g];g.description===hc&&(!d||b!==d[g])&&(u[g]&&at(u[g]),u[g]=ut(()=>cn(t,()=>b))),h[g]=b}d=h}),v){var f=t;gi(()=>{dn(f,d.value,!0),xo(f)})}p=!0})}function hr(t){return t.__attributes??(t.__attributes={[ko]:t.nodeName.includes("-"),[So]:t.namespaceURI===pc})}var Po=new Map;function Eo(t){var e=t.getAttribute("is")||t.nodeName,i=Po.get(e);if(i)return i;Po.set(e,i=[]);for(var a,n=t,r=Element.prototype;r!==n;){a=vl(n);for(var o in a)a[o].set&&i.push(o);n=Vn(n)}return i}const pd=()=>performance.now(),oi={tick:t=>requestAnimationFrame(t),now:()=>pd(),tasks:new Set};function Co(){const t=oi.now();oi.tasks.forEach(e=>{e.c(t)||(oi.tasks.delete(e),e.f())}),oi.tasks.size!==0&&oi.tick(Co)}function fd(t){let e;return oi.tasks.size===0&&oi.tick(Co),{promise:new Promise(i=>{oi.tasks.add(e={c:t,f:i})}),abort(){oi.tasks.delete(e)}}}function un(t,e){zi(()=>{t.dispatchEvent(new CustomEvent(e))})}function hd(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function Io(t){const e={},i=t.split(";");for(const a of i){const[n,r]=a.split(":");if(!n||r===void 0)break;const o=hd(n.trim());e[o]=r.trim()}return e}const gd=t=>t;function md(t,e,i){var a=ji,n,r,o,s=null;a.a??(a.a={element:t,measure(){n=this.element.getBoundingClientRect()},apply(){if(o==null||o.abort(),r=this.element.getBoundingClientRect(),n.left!==r.left||n.right!==r.right||n.top!==r.top||n.bottom!==r.bottom){const c=e()(this.element,{from:n,to:r},i==null?void 0:i());o=vn(this.element,c,void 0,1,()=>{o==null||o.abort(),o=void 0})}},fix(){if(!t.getAnimations().length){var{position:c,width:d,height:u}=getComputedStyle(t);if(c!=="absolute"&&c!=="fixed"){var v=t.style;s={position:v.position,width:v.width,height:v.height,transform:v.transform},v.position="absolute",v.width=d,v.height=u;var p=t.getBoundingClientRect();if(n.left!==p.left||n.top!==p.top){var f=`translate(${n.left-p.left}px, ${n.top-p.top}px)`;v.transform=v.transform?`${v.transform} ${f}`:f}}}},unfix(){if(s){var c=t.style;c.position=s.position,c.width=s.width,c.height=s.height,c.transform=s.transform}}}),a.a.element=t}function ze(t,e,i,a){var n=(t&sc)!==0,r=(t&cc)!==0,o=n&&r,s=(t&dc)!==0,c=o?"both":n?"in":"out",d,u=e.inert,v=e.style.overflow,p,f;function _(){return zi(()=>d??(d=i()(e,(a==null?void 0:a())??{},{direction:c})))}var h={is_global:s,in(){var k;if(e.inert=u,!n){f==null||f.abort(),(k=f==null?void 0:f.reset)==null||k.call(f);return}r||p==null||p.abort(),un(e,"introstart"),p=vn(e,_(),f,1,()=>{un(e,"introend"),p==null||p.abort(),p=d=void 0,e.style.overflow=v})},out(k){if(!r){k==null||k(),d=void 0;return}e.inert=!0,un(e,"outrostart"),f=vn(e,_(),p,0,()=>{un(e,"outroend"),k==null||k()})},stop:()=>{p==null||p.abort(),f==null||f.abort()}},b=je;if((b.transitions??(b.transitions=[])).push(h),n&&ln){var g=s;if(!g){for(var x=b.parent;x&&x.f&Rt;)for(;(x=x.parent)&&!(x.f&Nt););g=!x||(x.f&$a)!==0}g&&gi(()=>{xt(()=>h.in())})}}function vn(t,e,i,a,n){var r=a===1;if(Zi(e)){var o,s=!1;return ai(()=>{if(!s){var b=e({direction:r?"in":"out"});o=vn(t,b,i,a,n)}}),{abort:()=>{s=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return n(),{abort:bt,deactivate:bt,reset:bt,t:()=>a};const{delay:c=0,css:d,tick:u,easing:v=gd}=e;var p=[];if(r&&i===void 0&&(u&&u(0,1),d)){var f=Io(d(0,1));p.push(f,f)}var _=()=>1-a,h=t.animate(p,{duration:c,fill:"forwards"});return h.onfinish=()=>{h.cancel();var b=(i==null?void 0:i.t())??1-a;i==null||i.abort();var g=a-b,x=e.duration*Math.abs(g),k=[];if(x>0){var C=!1;if(d)for(var D=Math.ceil(x/16.666666666666668),P=0;P<=D;P+=1){var E=b+g*v(P/D),V=Io(d(E,1-E));k.push(V),C||(C=V.overflow==="hidden")}C&&(t.style.overflow="hidden"),_=()=>{var L=h.currentTime;return b+g*v(L/x)},u&&fd(()=>{if(h.playState!=="running")return!1;var L=_();return u(L,1-L),!0})}h=t.animate(k,{duration:x,fill:"forwards"}),h.onfinish=()=>{_=()=>a,u==null||u(a,1-a),n()}},{abort:()=>{h&&(h.cancel(),h.effect=null,h.onfinish=bt)},deactivate:()=>{n=bt},reset:()=>{a===0&&(u==null||u(1,0))},t:()=>_()}}function oa(t,e,i=e){var a=new WeakSet;Yl(t,"input",async n=>{var r=n?t.defaultValue:t.value;if(r=gr(t)?mr(r):r,i(r),xe!==null&&a.add(xe),await za(),r!==(r=e())){var o=t.selectionStart,s=t.selectionEnd,c=t.value.length;if(t.value=r??"",s!==null){var d=t.value.length;o===s&&s===c&&d>c?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=o,t.selectionEnd=Math.min(s,d))}}}),xt(e)==null&&t.value&&(i(gr(t)?mr(t.value):t.value),xe!==null&&a.add(xe)),an(()=>{var n=e();if(t===document.activeElement){var r=xa??xe;if(a.has(r))return}gr(t)&&n===mr(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n??"")})}function gr(t){var e=t.type;return e==="number"||e==="range"}function mr(t){return t===""?null:+t}const Nn=class Nn{constructor(e){_e(this,Dn);_e(this,Si,new WeakMap);_e(this,ya);_e(this,Ua);pe(this,Ua,e)}observe(e,i){var a=O(this,Si).get(e)||new Set;return a.add(i),O(this,Si).set(e,a),Re(this,Dn,Ds).call(this).observe(e,O(this,Ua)),()=>{var n=O(this,Si).get(e);n.delete(i),n.size===0&&(O(this,Si).delete(e),O(this,ya).unobserve(e))}}};Si=new WeakMap,ya=new WeakMap,Ua=new WeakMap,Dn=new WeakSet,Ds=function(){return O(this,ya)??pe(this,ya,new ResizeObserver(e=>{for(var i of e){Nn.entries.set(i.target,i);for(var a of O(this,Si).get(i.target)||[])a(i)}}))},Dt(Nn,"entries",new WeakMap);let yr=Nn;var yd=new yr({box:"border-box"});function Gt(t,e,i){var a=yd.observe(t,()=>i(t[e]));gi(()=>(xt(()=>i(t[e])),a))}function jo(t,e){return t===e||(t==null?void 0:t[Ot])===e}function nt(t={},e,i,a){return gi(()=>{var n,r;return an(()=>{n=r,r=[],xt(()=>{t!==i(...r)&&(e(t,...r),n&&jo(i(...n),t)&&e(null,...n))})}),()=>{ai(()=>{r&&jo(i(...r),t)&&e(null,...r)})}}),t}function pn(t,e){Nc(window,["resize"],()=>zi(()=>e(window[t])))}function zo(t=!1){const e=Me,i=e.l.u;if(!i)return;let a=()=>ho(e.s);if(t){let n=0,r={};const o=Sa(()=>{let s=!1;const c=e.s;for(const d in c)c[d]!==r[d]&&(r[d]=c[d],s=!0);return s&&n++,n});a=()=>l(o)}i.b.length&&Oc(()=>{Ao(e,a),Un(i.b)}),Ze(()=>{const n=xt(()=>i.m.map(Vs));return()=>{for(const r of n)typeof r=="function"&&r()}}),i.a.length&&Ze(()=>{Ao(e,a),Un(i.a)})}function Ao(t,e){if(t.l.s)for(const i of t.l.s)l(i);e()}let fn=!1;function bd(t){var e=fn;try{return fn=!1,[t(),fn]}finally{fn=e}}const _d={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Lo(t,e,i){return new Proxy({props:t,exclude:e},_d)}const wd={get(t,e){let i=t.props.length;for(;i--;){let a=t.props[i];if(Zi(a)&&(a=a()),typeof a=="object"&&a!==null&&e in a)return a[e]}},set(t,e,i){let a=t.props.length;for(;a--;){let n=t.props[a];Zi(n)&&(n=n());const r=vi(n,e);if(r&&r.set)return r.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let a=t.props[i];if(Zi(a)&&(a=a()),typeof a=="object"&&a!==null&&e in a){const n=vi(a,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Ot||e===yl)return!1;for(let i of t.props)if(Zi(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){const e=[];for(let i of t.props)if(Zi(i)&&(i=i()),!!i){for(const a in i)e.includes(a)||e.push(a);for(const a of Object.getOwnPropertySymbols(i))e.includes(a)||e.push(a)}return e}};function hn(...t){return new Proxy({props:t},wd)}function q(t,e,i,a){var k;var n=!Qi||(i&nc)!==0,r=(i&lc)!==0,o=(i&oc)!==0,s=a,c=!0,d=()=>(c&&(c=!1,s=o?xt(a):a),s),u;if(r){var v=Ot in t||yl in t;u=((k=vi(t,e))==null?void 0:k.set)??(v&&e in t?C=>t[e]=C:void 0)}var p,f=!1;r?[p,f]=bd(()=>t[e]):p=t[e],p===void 0&&a!==void 0&&(p=d(),u&&(n&&Js(),u(p)));var _;if(n?_=()=>{var C=t[e];return C===void 0?d():(c=!0,C)}:_=()=>{var C=t[e];return C!==void 0&&(s=void 0),C===void 0?s:C},n&&!(i&rc))return _;if(u){var h=t.$$legacy;return function(C,D){return arguments.length>0?((!n||!D||h||f)&&u(D?_():C),C):_()}}var b=!1,g=(i&ac?Sa:er)(()=>(b=!1,_()));r&&l(g);var x=je;return function(C,D){if(arguments.length>0){const P=D?l(g):n&&r?Ve(C):C;return A(g,P),b=!0,s!==void 0&&(s=P),C}return Ai&&b||x.f&ii?g.v:l(g)}}function $e(t){Me===null&&Zn(),Qi&&Me.l!==null?xd(Me).m.push(t):Ze(()=>{const e=xt(t);if(typeof e=="function")return e})}function br(t){Me===null&&Zn(),$e(()=>()=>xt(t))}function xd(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const kd="5";typeof window<"u"&&((zs=window.__svelte??(window.__svelte={})).v??(zs.v=new Set)).add(kd);function si(){var t;return(t=window.PlayPilotLinkInjections)==null?void 0:t.token}const Mo="https://www.playpilot.com",Sd="https://partner-api.playpilot.tech/1.0",Td="https://img-external.playpilot.tech",_r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",yi=600,wr={};async function Kt(t,{headers:e={},method:i="GET",body:a=null}={}){const n=!gn()&&i==="GET";if(n&&t in wr)return wr[t];const r=i==="GET"?{}:{"Content-Type":"application/json"},o=await fetch(Sd+t,{method:i,headers:new Headers({...r,...e}),body:a?JSON.stringify(a):null});if(!(o!=null&&o.ok))throw o;const s=await o.text();let c=s;try{s&&(c=JSON.parse(s))}catch{}return n&&(wr[t]=c),c}const xr="EncryptedToken",qo="articleReplacementEditToken",Do="playpilot-editorial-mode";async function No({href:t=window.location.href,throwError:e=!1}={}){try{const i=si();if(!i)throw new Error("No token was provided");const a=kr(t);if(!a)throw new Error("Could not be authenticated");return await Kt(`/external-pages/edit-authorization?api-token=${i}`,{method:"POST",body:{private_token:a}}),Pd(a),!0}catch(i){if(console.error(i),e)throw i}finally{Id()}return!1}function kr(t=""){var a,n;const e=(a=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:a.editorial_token;if(e)return e;if(t){const r=new URL(t).searchParams.get(qo);if(r)return decodeURI(r)}return((n=("; "+document.cookie).split(`; ${xr}=`).pop())==null?void 0:n.split(";")[0])||""}function Pd(t){const e=new Date;e.setTime(e.getTime()+30*24*60*60*1e3);const a="expires="+e.toUTCString();document.cookie=xr+"="+t+";"+a+";path=/"}function Ed(){document.cookie=xr+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function gn(){var e;const t=(e=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:e.editorial_token;return new URLSearchParams(window.location.search).get(Do)==="true"||!!t}function Cd(){const t=new URL(window.location.href);t.searchParams.set(Do,"true"),window.history.replaceState({},"",t)}function Id(){const t=new URL(window.location.href);t.searchParams.delete(qo),window.history.replaceState({},"",t)}function jd(t){let e=0;for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);e=e*31+a>>>0}return e.toString(16)}function mn(t=5){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(;i.length<t;)i+=e[Math.floor(Math.random()*e.length)];return i}const m=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"});function yn(){var a,n;const t=(a=window.PlayPilotLinkInjections)==null?void 0:a.language,e=Object.values(m);if(t){if(e.includes(t))return t;console.warn(`PlayPilot Link Injections: ${t} is not an accepted language`)}const i=(n=document.querySelector("html"))==null?void 0:n.getAttribute("lang");if(i){if(e.includes(i))return i;const r=e.find(o=>o.toLowerCase().startsWith(i+"-"));if(r)return r}return m.English}function Sr(t,e=""){const i=[],a=[t];for(;a.length>0;){const n=a.pop();if(i.includes(n)||e&&n.matches(e)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|LABEL|BLOCKQUOTE|H1)$/.test(n.tagName)||n.offsetWidth<=1)continue;const r=Array.from(n.childNodes).some(c=>{var d;return c.nodeType===Node.TEXT_NODE&&((d=c.nodeValue)==null?void 0:d.trim())!==""});if(r&&n.tagName==="LI"){const c=n.closest("ul, ol");c&&!i.includes(c)&&i.push(c);continue}const o=n.tagName==="P"&&!!n.textContent;if(r||o){i.push(n);continue}const s=Array.from(n.children);for(let c=s.length-1;c>=0;c--)a.push(s[c])}return i}function sa(){var e;const t=(e=window.PlayPilotLinkInjections)==null?void 0:e.selector;if(t){const i=t.replace(/(:)/g,"\\$1"),a=document.querySelector(i);if(a)return a}return document.querySelector("article")||document.querySelector("main")||document.body}function Tr(t){return t.map(e=>e.innerText).join(`
4
4
 
5
- `)}function Pr(t){const e=sa(),i=Sr(e,(t==null?void 0:t.exclude_elements_selector)||""),a=Tr(i);return{parentElement:e,elements:i,pageText:a}}function Ro(){const t=sa();return{content_heading:zd(t),content_modified_time:Ad(t),content_published_time:Ld(t)}}function zd(t){const e=t.querySelector("h1")||document.querySelector("h1");return(e==null?void 0:e.innerText.trim())||null}function Ad(t){const e=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||t.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,i=Oo().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Er(i):null}function Ld(t){const e=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||t.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||t.querySelector("time")||document.querySelector("time")||t.querySelector("[datetime]")||document.querySelector("[datetime]")||null,i=Oo().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Er(i):null}function Er(t){try{return new Date(t).toISOString()}catch{return null}}function Oo(){const t=document.querySelector('[type="application/ld+json"]');if(!t)return{};try{return JSON.parse(t.textContent||"")}catch{return{}}}function Di(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function Cr(t){return Object.entries(t).filter(([i,a])=>a!=null&&a!=="").map(([i,a])=>`${i}=${a}`).join("&")}function Md(t){return!!(t.exclude_urls_pattern&&Di().match(new RegExp(t.exclude_urls_pattern)))}let Ir=null;async function Ni(t,{url:e=Di(),hash:i=jd(t||""),params:a={},method:n="GET"}={}){const r=si(),o=gn()?await No():!1,s=yn();if(!r)throw new Error("No token was provided");const c=`/external-pages/?api-token=${r}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${s}`;let d;return n==="POST"?(a.run_ai&&(a.hash=i,a.page_text=t),a.url=e,a.metadata=Ro(),d=await Kt(c,{method:"POST",body:a})):d=await Kt(c+`&url=${e}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function Bo(t,{requireCompletedResult:e=!1,runAiWhenRelevant:i=!1,pollInterval:a=3e3,maxTries:n=600,onpoll:r=()=>null}={}){let o=0;Ir&&clearTimeout(Ir);const s=async(c,d)=>{let u;try{try{u=await Ni(t)}catch(v){throw(v==null?void 0:v.status)===404&&(u=await Ni(t,{method:"POST"}),u.ai_enabled&&(u=await Ni(t,{params:{run_ai:!0},method:"POST"}))),new Error}if(u&&i&&(u=await qd(t,u)),e&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=Fo(u.manual_injections||[]),u.ai_injections=Fo(u.ai_injections||[]),c(u);return}catch{if(o++,o>=n){n>1&&console.error("Max poll limit exceeded. Please return later."),c();return}u&&r(u),Ir=setTimeout(()=>s(c),a)}};return new Promise(s)}async function qd(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=Ro().content_modified_time,a=e.content_modified_time?Er(e.content_modified_time):null,n=i&&a===i;return e.ai_last_run&&n||new Date(i||0)<=new Date(a||0)?e:await Ni(t,{params:{run_ai:!0},method:"POST"})}async function Dd(t,e){var o;const i=(o=window.PlayPilotLinkInjections)==null?void 0:o.selector,n=t.filter(s=>s.manual).map(s=>({sid:s.sid,title:s.title,sentence:s.sentence,phrase_before:s.phrase_before,phrase_after:s.phrase_after,playpilot_url:s.playpilot_url,after_article:!!s.after_article,after_article_style:s.after_article_style||null,in_text:s.in_text??!0,inactive:!!s.inactive,removed:!!s.removed}));if(!await Ni(e,{method:"POST",params:{private_token:kr(),manual_injections:n,content_text_selector:i}}))throw new Error("saveLinkInjections response was faulty");return t}function Fo(t){return t.map(e=>({...e,key:Ho(e.sid)}))}function Ho(t){return t+"-"+mn()}function Nd(t,e,i){return t.filter(a=>i.every(n=>a[n]===e[n])).length}function Rd(t,e){return e.some(i=>t>=i.start&&t<i.end)}function Od(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function jr(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function Vo(t,e,i=[]){var r,o;const a=document.createTreeWalker(e);let n;for(;(n=a.nextNode())&&!((r=n.nodeValue)!=null&&r.includes(t)&&!i.includes(((o=n.parentNode)==null?void 0:o.nodeName)||"")););return n}function Uo(t){const e=t.parentNode;return e?e.nodeName==="A"||!!e.closest("a"):!1}function Bd(t,e,i,a){const n=Od(e),r=jr(e),o=t.slice(0,a),s=t.slice(a),c=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${r.replace(c,"\\$&")}|${n.replace(c,"\\$&")}`),u=s.replace(d,i);return o+u}function Fd(t,e,i,a){return t.substring(0,i)+e+t.substring(a)}function kt(t){return jr(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function Wo(t,e,i){const n=t.indexOf(e),r=Math.floor((i-e.length)/2);let o=Math.max(0,n-r),s=o+i;s>t.length&&(s=t.length,o=Math.max(0,s-i));let c=t.slice(o,s).trim();return o>0&&(c="…"+c),s<t.length&&(c+="…"),c}function Go(t,e,i){const a=t.nodeType===Node.TEXT_NODE&&t.parentNode?t.parentElement:t;if(!a||!t.textContent)return{before:"",after:""};const n=Math.max(a.innerText.indexOf(t.textContent),0),r=Ko(a.innerText.slice(0,e+n)),o=a.innerText.slice(i+n),s=Ko(Yo(r,2)),c=Yo(o,2);return{before:s,after:c}}function Ko(t){return t.split("").reverse().join("")}function Yo(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function bn(t,e){let i=0,a=0;for(;(a=t.indexOf(e,a))!==-1;)i++,a+=e.length;return i}function Hd(t,e,i){const a=[];let n=0;for(;n<=t.length;){const r=e?t.indexOf(e,n):n;if(r===-1&&e)break;const o=e?r+e.length:r,s=i?t.indexOf(i,o):t.length;if(i&&s===-1)break;const c=t.slice(o,s);a.push({match:c,index:o}),n=i?s+i.length:t.length+1}return a}function Vd(t,e,i,a){const r=Hd(t,i,a).filter(({match:s})=>jr(s).includes(e));return r.length?r.reduce((s,c)=>!s||c.match.length<s.match.length?c:s):null}function Ud(t){var e,i;return{leadingSpaces:((e=t.match(/^\s*/))==null?void 0:e[0].length)||0,trailingSpaces:((i=t.match(/\s*$/))==null?void 0:i[0].length)||0}}function Wd(t,e,i=0){const a=e.innerHTML,n=[],r=Gd(e);let o=a.indexOf(t);for(;o!==-1;)Rd(o,r)&&n.push(o),o=a.indexOf(t,o+t.length);return n[i]??-1}function Gd(t){const e=[],i=t.innerHTML;let a=!1,n=!1,r=!1,o=0;for(let s=0;s<i.length;s++){const c=i[s];if(!n&&!a&&c==="<"){a=!0,r&&(e.push({start:o,end:s}),r=!1);continue}if(a&&c==='"'&&(n=!n),a&&!n&&c===">"){a=!1;continue}!a&&!n&&!r&&(o=s,r=!0)}return!e.length&&t.textContent.length&&e.push({start:o,end:t.innerHTML.length}),e}function Kd(t,e){const i=[" ",".",",","<",">"];try{const a=i.map(s=>"\\"+s).join(""),n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`([${a}])${n}([${a}])`),o=e.match(r);return o!=null&&o.index?o.index+1:-1}catch{return-1}}function Zo(t){return t.ctrlKey||t.metaKey||t.button!==0}const ye={ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",InjectionVisible:"ali_injection_visible",UserLeft:"ali_user_left",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",ParticipantModalView:"ali_participant_modal_view",ParticipantModalClose:"ali_participant_modal_close",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",SimilarTitleClick:"ali_similar_title_click",ParticipantClick:"ali_title_participant_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FailedInjectionsCount:"ali_failed_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error",TopScrollView:"ali_top_scroll_view",TopScrollClick:"ali_top_scroll_click",DisplayAdView:"ali_display_ad_view",DisplayAdClick:"ali_display_ad_click",DisplayedAdPlaylickClick:"ali_display_ad_playlink_click",AdsFetchFailed:"ali_ads_fetch_failed",SplitTestView:"ali_split_test_view",SplitTestAction:"ali_split_test_action",ShareTitle:"ali_share_title",SaveTitle:"ali_save_title",NotifyTitle:"ali_notify_title",TrailerClick:"ali_trailer_button_click",ExpandTitleDescription:"ali_expand_title_description",RegionRequestFailed:"ali_region_request_failed",YouTubeAvailabilityRequestFailed:"ali_youtube_availability_request_failed",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed"},Ma={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest"};function Yd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function Lt(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function _n(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const zr=[{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];function Zd(t=[]){return t.map(e=>{var i;return((i=zr.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const Ar="playpilot_user_id";function Jd(){if(!Jo())return null;try{const t=localStorage.getItem(Ar);return t||(localStorage.setItem(Ar,mn(16)),localStorage.getItem(Ar))}catch{return null}}function Jo(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)}const Xd="https://insights.playpilot.net";async function be(t,e=null,i={}){var n,r,o,s,c;if(_n())return;if(!Lt("tracking")){$d(t,e,i);return}const a=new Headers({"Content-Type":"application/json"});e&&(i={original_title:e.original_title,title:e.title,title_sid:e.sid,title_type:e.type,genres:Zd(e.genres),providers:[...new Set(((n=e.providers)==null?void 0:n.map(d=>d.name))||[])],...i}),Jo()&&(i.user_id=Jd()),i.version="8.4.0",i.time_since_initialize=(r=window.PlayPilotLinkInjections)!=null&&r.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=Di(),i.organization_sid=((o=window.PlayPilotLinkInjections)==null?void 0:o.organization_sid)||"undefined",i.domain_sid=((s=window.PlayPilotLinkInjections)==null?void 0:s.domain_sid)||"undefined",i.device={type:window.innerWidth>yi?"desktop":"mobile",width:window.innerWidth,height:window.innerHeight,touch:window.matchMedia("(pointer: coarse)").matches,orientation:((c=screen.orientation)==null?void 0:c.type)||"undefined"},fetch(Xd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Qd({event:t,payload:i})}function Qd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function Xo({organizationSid:t=null,domainSid:e=null}){window.PlayPilotLinkInjections.organization_sid=t||null,window.PlayPilotLinkInjections.domain_sid=e||null}function $d(t,e=null,i={}){var a;(a=window.PlayPilotLinkInjections).queued_tracking_events||(a.queued_tracking_events=[]),window.PlayPilotLinkInjections.queued_tracking_events.push({event:t,title:e,payload:i})}function eu(){if(Lt("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])be(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}function Qo(){var t;return(t=window.PlayPilotLinkInjections.config)!=null&&t.allow_retargeting_pixels?Lt("pixels"):!1}async function $o(){if(!Lt("ads"))return[];const t=si();if(!t)throw new Error("No token was provided");try{return await Kt(`/ads/browse/?api-token=${t}`)}catch(e){throw be(ye.AdsFetchFailed,null,{status:e.status}),e}}function qa(t){var e;return!Lt("ads")||window.PlayPilotLinkInjections.no_affiliate?null:(((e=window.PlayPilotLinkInjections)==null?void 0:e.ads)||[]).find(i=>i.campaign_format===t)||null}function tu(t){return{sid:"",name:t.content.header||"",url:t.cta.url||"",logo_url:t.cta.image||"",highlighted:!0,cta_text:t.content.subheader,action_text:t.cta.header,slug:t.campaign_name,extra_info:{category:"SVOD"}}}async function Lr(t=5e3){var i,a,n,r;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.region;if(e)return e;try{const s=await(await fetch("https://api.country.is/",{signal:AbortSignal.timeout(t)})).json();let c=(a=s==null?void 0:s.country)==null?void 0:a.toLowerCase();if(!c)throw new Error("No country was returned by api.country.is");return c==="gb"&&(c="uk"),iu(c),c}catch(o){return be(ye.RegionRequestFailed,null,{message:o.message}),((r=(n=window.PlayPilotLinkInjections)==null?void 0:n.config)==null?void 0:r.fallback_region)||""}}function iu(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.region=t)}async function Mr(t={}){const e=si();if(!e)throw new Error("No token was provided");return t={...t,language:yn(),include_count:"false"},t.region!==null&&(t.region=t.region||await Lr()),await Kt(`/titles/browse?api-token=${e}&`+Cr(t))}async function au(t){return(await Mr({related_to_sid:t.sid})).results}const nu=t=>t;function qr(t){const e=t-1;return e*e*e+1}function es(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function St(t,{delay:e=0,duration:i=400,easing:a=nu}={}){const n=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:r=>`opacity: ${r*n}`}}function ca(t,{delay:e=0,duration:i=400,easing:a=qr,x:n=0,y:r=0,opacity:o=0}={}){const s=getComputedStyle(t),c=+s.opacity,d=s.transform==="none"?"":s.transform,u=c*(1-o),[v,p]=es(n),[f,_]=es(r);return{delay:e,duration:i,easing:a,css:(h,b)=>`
5
+ `)}function Pr(t){const e=sa(),i=Sr(e,(t==null?void 0:t.exclude_elements_selector)||""),a=Tr(i);return{parentElement:e,elements:i,pageText:a}}function Ro(){const t=sa();return{content_heading:zd(t),content_modified_time:Ad(t),content_published_time:Ld(t)}}function zd(t){const e=t.querySelector("h1")||document.querySelector("h1");return(e==null?void 0:e.innerText.trim())||null}function Ad(t){const e=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||t.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,i=Oo().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Er(i):null}function Ld(t){const e=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||t.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||t.querySelector("time")||document.querySelector("time")||t.querySelector("[datetime]")||document.querySelector("[datetime]")||null,i=Oo().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Er(i):null}function Er(t){try{return new Date(t).toISOString()}catch{return null}}function Oo(){const t=document.querySelector('[type="application/ld+json"]');if(!t)return{};try{return JSON.parse(t.textContent||"")}catch{return{}}}function Di(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function Cr(t){return Object.entries(t).filter(([i,a])=>a!=null&&a!=="").map(([i,a])=>`${i}=${a}`).join("&")}function Md(t){return!!(t.exclude_urls_pattern&&Di().match(new RegExp(t.exclude_urls_pattern)))}let Ir=null;async function Ni(t,{url:e=Di(),hash:i=jd(t||""),params:a={},method:n="GET"}={}){const r=si(),o=gn()?await No():!1,s=yn();if(!r)throw new Error("No token was provided");const c=`/external-pages/?api-token=${r}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${s}`;let d;return n==="POST"?(a.run_ai&&(a.hash=i,a.page_text=t),a.url=e,a.metadata=Ro(),d=await Kt(c,{method:"POST",body:a})):d=await Kt(c+`&url=${e}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function Bo(t,{requireCompletedResult:e=!1,runAiWhenRelevant:i=!1,pollInterval:a=3e3,maxTries:n=600,onpoll:r=()=>null}={}){let o=0;Ir&&clearTimeout(Ir);const s=async(c,d)=>{let u;try{try{u=await Ni(t)}catch(v){throw(v==null?void 0:v.status)===404&&(u=await Ni(t,{method:"POST"}),u.ai_enabled&&(u=await Ni(t,{params:{run_ai:!0},method:"POST"}))),new Error}if(u&&i&&(u=await qd(t,u)),e&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=Fo(u.manual_injections||[]),u.ai_injections=Fo(u.ai_injections||[]),c(u);return}catch{if(o++,o>=n){n>1&&console.error("Max poll limit exceeded. Please return later."),c();return}u&&r(u),Ir=setTimeout(()=>s(c),a)}};return new Promise(s)}async function qd(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=Ro().content_modified_time,a=e.content_modified_time?Er(e.content_modified_time):null,n=i&&a===i;return e.ai_last_run&&n||new Date(i||0)<=new Date(a||0)?e:await Ni(t,{params:{run_ai:!0},method:"POST"})}async function Dd(t,e){var o;const i=(o=window.PlayPilotLinkInjections)==null?void 0:o.selector,n=t.filter(s=>s.manual).map(s=>({sid:s.sid,title:s.title,sentence:s.sentence,phrase_before:s.phrase_before,phrase_after:s.phrase_after,playpilot_url:s.playpilot_url,after_article:!!s.after_article,after_article_style:s.after_article_style||null,in_text:s.in_text??!0,inactive:!!s.inactive,removed:!!s.removed}));if(!await Ni(e,{method:"POST",params:{private_token:kr(),manual_injections:n,content_text_selector:i}}))throw new Error("saveLinkInjections response was faulty");return t}function Fo(t){return t.map(e=>({...e,key:Ho(e.sid)}))}function Ho(t){return t+"-"+mn()}function Nd(t,e,i){return t.filter(a=>i.every(n=>a[n]===e[n])).length}function Rd(t,e){return e.some(i=>t>=i.start&&t<i.end)}function Od(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function jr(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function Vo(t,e,i=[]){var r,o;const a=document.createTreeWalker(e);let n;for(;(n=a.nextNode())&&!((r=n.nodeValue)!=null&&r.includes(t)&&!i.includes(((o=n.parentNode)==null?void 0:o.nodeName)||"")););return n}function Uo(t){const e=t.parentNode;return e?e.nodeName==="A"||!!e.closest("a"):!1}function Bd(t,e,i,a){const n=Od(e),r=jr(e),o=t.slice(0,a),s=t.slice(a),c=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${r.replace(c,"\\$&")}|${n.replace(c,"\\$&")}`),u=s.replace(d,i);return o+u}function Fd(t,e,i,a){return t.substring(0,i)+e+t.substring(a)}function kt(t){return jr(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function Wo(t,e,i){const n=t.indexOf(e),r=Math.floor((i-e.length)/2);let o=Math.max(0,n-r),s=o+i;s>t.length&&(s=t.length,o=Math.max(0,s-i));let c=t.slice(o,s).trim();return o>0&&(c="…"+c),s<t.length&&(c+="…"),c}function Go(t,e,i){const a=t.nodeType===Node.TEXT_NODE&&t.parentNode?t.parentElement:t;if(!a||!t.textContent)return{before:"",after:""};const n=Math.max(a.innerText.indexOf(t.textContent),0),r=Ko(a.innerText.slice(0,e+n)),o=a.innerText.slice(i+n),s=Ko(Yo(r,2)),c=Yo(o,2);return{before:s,after:c}}function Ko(t){return t.split("").reverse().join("")}function Yo(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function bn(t,e){let i=0,a=0;for(;(a=t.indexOf(e,a))!==-1;)i++,a+=e.length;return i}function Hd(t,e,i){const a=[];let n=0;for(;n<=t.length;){const r=e?t.indexOf(e,n):n;if(r===-1&&e)break;const o=e?r+e.length:r,s=i?t.indexOf(i,o):t.length;if(i&&s===-1)break;const c=t.slice(o,s);a.push({match:c,index:o}),n=i?s+i.length:t.length+1}return a}function Vd(t,e,i,a){const r=Hd(t,i,a).filter(({match:s})=>jr(s).includes(e));return r.length?r.reduce((s,c)=>!s||c.match.length<s.match.length?c:s):null}function Ud(t){var e,i;return{leadingSpaces:((e=t.match(/^\s*/))==null?void 0:e[0].length)||0,trailingSpaces:((i=t.match(/\s*$/))==null?void 0:i[0].length)||0}}function Wd(t,e,i=0){const a=e.innerHTML,n=[],r=Gd(e);let o=a.indexOf(t);for(;o!==-1;)Rd(o,r)&&n.push(o),o=a.indexOf(t,o+t.length);return n[i]??-1}function Gd(t){const e=[],i=t.innerHTML;let a=!1,n=!1,r=!1,o=0;for(let s=0;s<i.length;s++){const c=i[s];if(!n&&!a&&c==="<"){a=!0,r&&(e.push({start:o,end:s}),r=!1);continue}if(a&&c==='"'&&(n=!n),a&&!n&&c===">"){a=!1;continue}!a&&!n&&!r&&(o=s,r=!0)}return!e.length&&t.textContent.length&&e.push({start:o,end:t.innerHTML.length}),e}function Kd(t,e){const i=[" ",".",",","<",">"];try{const a=i.map(s=>"\\"+s).join(""),n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`([${a}])${n}([${a}])`),o=e.match(r);return o!=null&&o.index?o.index+1:-1}catch{return-1}}function Zo(t){return t.ctrlKey||t.metaKey||t.button!==0}const ye={ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",InjectionVisible:"ali_injection_visible",UserLeft:"ali_user_left",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",ParticipantModalView:"ali_participant_modal_view",ParticipantModalClose:"ali_participant_modal_close",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",SimilarTitleClick:"ali_similar_title_click",ParticipantClick:"ali_title_participant_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FailedInjectionsCount:"ali_failed_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error",TopScrollView:"ali_top_scroll_view",TopScrollClick:"ali_top_scroll_click",DisplayAdView:"ali_display_ad_view",DisplayAdClick:"ali_display_ad_click",DisplayedAdPlaylickClick:"ali_display_ad_playlink_click",AdsFetchFailed:"ali_ads_fetch_failed",SplitTestView:"ali_split_test_view",SplitTestAction:"ali_split_test_action",ShareTitle:"ali_share_title",SaveTitle:"ali_save_title",NotifyTitle:"ali_notify_title",TrailerClick:"ali_trailer_button_click",ExpandTitleDescription:"ali_expand_title_description",RegionRequestFailed:"ali_region_request_failed",YouTubeAvailabilityRequestFailed:"ali_youtube_availability_request_failed",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed"},Ma={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest"};function Yd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function Lt(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function _n(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const zr=[{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];function Zd(t=[]){return t.map(e=>{var i;return((i=zr.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const Ar="playpilot_user_id";function Jd(){if(!Jo())return null;try{const t=localStorage.getItem(Ar);return t||(localStorage.setItem(Ar,mn(16)),localStorage.getItem(Ar))}catch{return null}}function Jo(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)}const Xd="https://insights.playpilot.net";async function be(t,e=null,i={}){var n,r,o,s,c;if(_n())return;if(!Lt("tracking")){$d(t,e,i);return}const a=new Headers({"Content-Type":"application/json"});e&&(i={original_title:e.original_title,title:e.title,title_sid:e.sid,title_type:e.type,genres:Zd(e.genres),providers:[...new Set(((n=e.providers)==null?void 0:n.map(d=>d.name))||[])],...i}),Jo()&&(i.user_id=Jd()),i.version="8.4.1",i.time_since_initialize=(r=window.PlayPilotLinkInjections)!=null&&r.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=Di(),i.organization_sid=((o=window.PlayPilotLinkInjections)==null?void 0:o.organization_sid)||"undefined",i.domain_sid=((s=window.PlayPilotLinkInjections)==null?void 0:s.domain_sid)||"undefined",i.device={type:window.innerWidth>yi?"desktop":"mobile",width:window.innerWidth,height:window.innerHeight,touch:window.matchMedia("(pointer: coarse)").matches,orientation:((c=screen.orientation)==null?void 0:c.type)||"undefined"},fetch(Xd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Qd({event:t,payload:i})}function Qd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function Xo({organizationSid:t=null,domainSid:e=null}){window.PlayPilotLinkInjections.organization_sid=t||null,window.PlayPilotLinkInjections.domain_sid=e||null}function $d(t,e=null,i={}){var a;(a=window.PlayPilotLinkInjections).queued_tracking_events||(a.queued_tracking_events=[]),window.PlayPilotLinkInjections.queued_tracking_events.push({event:t,title:e,payload:i})}function eu(){if(Lt("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])be(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}function Qo(){var t;return(t=window.PlayPilotLinkInjections.config)!=null&&t.allow_retargeting_pixels?Lt("pixels"):!1}async function $o(){if(!Lt("ads"))return[];const t=si();if(!t)throw new Error("No token was provided");try{return await Kt(`/ads/browse/?api-token=${t}`)}catch(e){throw be(ye.AdsFetchFailed,null,{status:e.status}),e}}function qa(t){var e;return!Lt("ads")||window.PlayPilotLinkInjections.no_affiliate?null:(((e=window.PlayPilotLinkInjections)==null?void 0:e.ads)||[]).find(i=>i.campaign_format===t)||null}function tu(t){return{sid:"",name:t.content.header||"",url:t.cta.url||"",logo_url:t.cta.image||"",highlighted:!0,cta_text:t.content.subheader,action_text:t.cta.header,slug:t.campaign_name,extra_info:{category:"SVOD"}}}async function Lr(t=5e3){var i,a,n,r;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.region;if(e)return e;try{const s=await(await fetch("https://api.country.is/",{signal:AbortSignal.timeout(t)})).json();let c=(a=s==null?void 0:s.country)==null?void 0:a.toLowerCase();if(!c)throw new Error("No country was returned by api.country.is");return c==="gb"&&(c="uk"),iu(c),c}catch(o){return be(ye.RegionRequestFailed,null,{message:o.message}),((r=(n=window.PlayPilotLinkInjections)==null?void 0:n.config)==null?void 0:r.fallback_region)||""}}function iu(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.region=t)}async function Mr(t={}){const e=si();if(!e)throw new Error("No token was provided");return t={...t,language:yn(),include_count:"false"},t.region!==null&&(t.region=t.region||await Lr()),await Kt(`/titles/browse?api-token=${e}&`+Cr(t))}async function au(t){return(await Mr({related_to_sid:t.sid})).results}const nu=t=>t;function qr(t){const e=t-1;return e*e*e+1}function es(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function St(t,{delay:e=0,duration:i=400,easing:a=nu}={}){const n=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:r=>`opacity: ${r*n}`}}function ca(t,{delay:e=0,duration:i=400,easing:a=qr,x:n=0,y:r=0,opacity:o=0}={}){const s=getComputedStyle(t),c=+s.opacity,d=s.transform==="none"?"":s.transform,u=c*(1-o),[v,p]=es(n),[f,_]=es(r);return{delay:e,duration:i,easing:a,css:(h,b)=>`
6
6
  transform: ${d} translate(${(1-h)*v}${p}, ${(1-h)*f}${_});
7
7
  opacity: ${c-u*b}`}}function Da(t,{delay:e=0,duration:i=400,easing:a=qr,axis:n="y"}={}){const r=getComputedStyle(t),o=+r.opacity,s=n==="y"?"height":"width",c=parseFloat(r[s]),d=n==="y"?["top","bottom"]:["left","right"],u=d.map(g=>`${g[0].toUpperCase()}${g.slice(1)}`),v=parseFloat(r[`padding${u[0]}`]),p=parseFloat(r[`padding${u[1]}`]),f=parseFloat(r[`margin${u[0]}`]),_=parseFloat(r[`margin${u[1]}`]),h=parseFloat(r[`border${u[0]}Width`]),b=parseFloat(r[`border${u[1]}Width`]);return{delay:e,duration:i,easing:a,css:g=>`overflow: hidden;opacity: ${Math.min(g*20,1)*o};${s}: ${g*c}px;padding-${d[0]}: ${g*v}px;padding-${d[1]}: ${g*p}px;margin-${d[0]}: ${g*f}px;margin-${d[1]}: ${g*_}px;border-${d[0]}-width: ${g*h}px;border-${d[1]}-width: ${g*b}px;min-${s}: 0`}}function da(t,{delay:e=0,duration:i=400,easing:a=qr,start:n=0,opacity:r=0}={}){const o=getComputedStyle(t),s=+o.opacity,c=o.transform==="none"?"":o.transform,d=1-n,u=s*(1-r);return{delay:e,duration:i,easing:a,css:(v,p)=>`
8
8
  transform: ${c} scale(${1-d*p});
@@ -1,3 +1,3 @@
1
1
  (function(){"use strict";function m(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}const q="https://partner-api.playpilot.tech/1.0",h={};async function d(e,{headers:t={},method:n="GET",body:i=null}={}){const o=!_()&&n==="GET";if(o&&e in h)return h[e];const c=n==="GET"?{}:{"Content-Type":"application/json"},l=await fetch(q+e,{method:n,headers:new Headers({...c,...t}),body:i?JSON.stringify(i):null});if(!(l!=null&&l.ok))throw l;const s=await l.text();let r=s;try{s&&(r=JSON.parse(s))}catch{}return o&&(h[e]=r),r}const y="EncryptedToken",k="articleReplacementEditToken",x="playpilot-editorial-mode";async function I({href:e=window.location.href,throwError:t=!1}={}){try{const n=m();if(!n)throw new Error("No token was provided");const i=P(e);if(!i)throw new Error("Could not be authenticated");return await d(`/external-pages/edit-authorization?api-token=${n}`,{method:"POST",body:{private_token:i}}),A(i),!0}catch(n){if(console.error(n),t)throw n}finally{C()}return!1}function P(e=""){var i,o;const t=(i=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:i.editorial_token;if(t)return t;if(e){const c=new URL(e).searchParams.get(k);if(c)return decodeURI(c)}return((o=("; "+document.cookie).split(`; ${y}=`).pop())==null?void 0:o.split(";")[0])||""}function A(e){const t=new Date;t.setTime(t.getTime()+30*24*60*60*1e3);const i="expires="+t.toUTCString();document.cookie=y+"="+e+";"+i+";path=/"}function _(){var t;const e=(t=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:t.editorial_token;return new URLSearchParams(window.location.search).get(x)==="true"||!!e}function C(){const e=new URL(window.location.href);e.searchParams.delete(k),window.history.replaceState({},"",e)}async function O(){const e=m();if(!e)throw new Error("No token was provided");try{return await await d(`/domains/config?api-token=${e}`)||null}catch{return null}}function N(e){let t=0;for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);t=t*31+i>>>0}return t.toString(16)}function M(e=5){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(;n.length<e;)n+=t[Math.floor(Math.random()*t.length)];return n}const T=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"});function R(){var i,o;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.language,t=Object.values(T);if(e){if(t.includes(e))return e;console.warn(`PlayPilot Link Injections: ${e} is not an accepted language`)}const n=(o=document.querySelector("html"))==null?void 0:o.getAttribute("lang");if(n){if(t.includes(n))return n;const c=t.find(l=>l.toLowerCase().startsWith(n+"-"));if(c)return c}return T.English}function U(e,t=""){const n=[],i=[e];for(;i.length>0;){const o=i.pop();if(n.includes(o)||t&&o.matches(t)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|LABEL|BLOCKQUOTE|H1)$/.test(o.tagName)||o.offsetWidth<=1)continue;const c=Array.from(o.childNodes).some(r=>{var u;return r.nodeType===Node.TEXT_NODE&&((u=r.nodeValue)==null?void 0:u.trim())!==""});if(c&&o.tagName==="LI"){const r=o.closest("ul, ol");r&&!n.includes(r)&&n.push(r);continue}const l=o.tagName==="P"&&!!o.textContent;if(c||l){n.push(o);continue}const s=Array.from(o.children);for(let r=s.length-1;r>=0;r--)i.push(s[r])}return n}function S(){var t;const e=(t=window.PlayPilotLinkInjections)==null?void 0:t.selector;if(e){const n=e.replace(/(:)/g,"\\$1"),i=document.querySelector(n);if(i)return i}return document.querySelector("article")||document.querySelector("main")||document.body}function v(e){return e.map(t=>t.innerText).join(`
2
2
 
3
- `)}function $(e){const t=S(),n=U(t,(e==null?void 0:e.exclude_elements_selector)||""),i=v(n);return{parentElement:t,elements:n,pageText:i}}function E(){const e=S();return{content_heading:z(e),content_modified_time:D(e),content_published_time:G(e)}}function z(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function D(e){const t=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||e.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,n=b().dateModified||(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?g(n):null}function G(e){const t=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||e.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||e.querySelector("time")||document.querySelector("time")||e.querySelector("[datetime]")||document.querySelector("[datetime]")||null,n=b().datePublished||(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?g(n):null}function g(e){try{return new Date(e).toISOString()}catch{return null}}function b(){const e=document.querySelector('[type="application/ld+json"]');if(!e)return{};try{return JSON.parse(e.textContent||"")}catch{return{}}}function j(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}function H(e){return!!(e.exclude_urls_pattern&&j().match(new RegExp(e.exclude_urls_pattern)))}let p=null;async function f(e,{url:t=j(),hash:n=N(e||""),params:i={},method:o="GET"}={}){const c=m(),l=_()?await I():!1,s=R();if(!c)throw new Error("No token was provided");const r=`/external-pages/?api-token=${c}&include_title_details=true${l?"&editorial_mode_enabled=true":""}&language=${s}`;let u;return o==="POST"?(i.run_ai&&(i.hash=n,i.page_text=e),i.url=t,i.metadata=E(),u=await d(r,{method:"POST",body:i})):u=await d(r+`&url=${t}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=u,u}async function B(e,{requireCompletedResult:t=!1,runAiWhenRelevant:n=!1,pollInterval:i=3e3,maxTries:o=600,onpoll:c=()=>null}={}){let l=0;p&&clearTimeout(p);const s=async(r,u)=>{let a;try{try{a=await f(e)}catch(w){throw(w==null?void 0:w.status)===404&&(a=await f(e,{method:"POST"}),a.ai_enabled&&(a=await f(e,{params:{run_ai:!0},method:"POST"}))),new Error}if(a&&n&&(a=await F(e,a)),t&&a.ai_enabled&&a.ai_running)throw new Error;a.manual_injections=L(a.manual_injections||[]),a.ai_injections=L(a.ai_injections||[]),r(a);return}catch{if(l++,l>=o){o>1&&console.error("Max poll limit exceeded. Please return later."),r();return}a&&c(a),p=setTimeout(()=>s(r),i)}};return new Promise(s)}async function F(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=E().content_modified_time,i=t.content_modified_time?g(t.content_modified_time):null,o=n&&i===n;return t.ai_last_run&&o||new Date(n||0)<=new Date(i||0)?t:await f(e,{params:{run_ai:!0},method:"POST"})}function L(e){return e.map(t=>({...t,key:J(t.sid)}))}function J(e){return e+"-"+M()}function K(e){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=e)}function W(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}window.PlayPilotLinkInjections={token:"",editorial_token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,region:null,organization_sid:null,domain_sid:null,last_successful_fetch:null,tracked_events:[],queued_tracking_events:[],split_test_identifiers:{},evaluated_link_injections:[],initial_link_injections_promise:null,time_at_initialize:0,ads:[],require_consent:!0,no_affiliate:!1,consents:{ads:!1,pixels:!1,tracking:!1,split_tests:!1,affiliate:!1},config:{},app:null,async initialize(e={token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,region:null,organization_sid:null,domain_sid:null,editorial_token:"",require_consent:!0,no_affiliate:!1}){if(!e.token){console.error("An API token is required.");return}if(this.token=e.token,this.editorial_token=e.editorial_token,this.selector=e.selector,this.after_article_selector=e.after_article_selector,this.after_article_insert_position=e.after_article_insert_position,this.language=e.language,this.region=e.region,this.organization_sid=e.organization_sid,this.domain_sid=e.domain_sid,this.require_consent=e.require_consent,this.no_affiliate=e.no_affiliate,this.time_at_initialize=Date.now(),this.require_consent===!1&&K({ads:!0,pixels:!0,tracking:!0,split_tests:!0,affiliate:!0}),this.config=await O()||{},H(this.config))return;const{pageText:t}=$(this.config);this.initial_link_injections_promise=B(t,{maxTries:1,runAiWhenRelevant:!W()}),this.mount()},destroy(){var e;(e=window.PlayPilotMount)==null||e.destroy()},mount(){const e=_()||P(),t=document.createElement("script");t.id="playpilot-mount",t.src=`https://cdn.jsdelivr.net/npm/@playpilot/tpi@8.4.0/dist/${e?"editorial.":""}mount.js`,t.onload=()=>{var n;return(n=window.PlayPilotMount)==null?void 0:n.mount()},document.body.appendChild(t)}}})();
3
+ `)}function $(e){const t=S(),n=U(t,(e==null?void 0:e.exclude_elements_selector)||""),i=v(n);return{parentElement:t,elements:n,pageText:i}}function E(){const e=S();return{content_heading:z(e),content_modified_time:D(e),content_published_time:G(e)}}function z(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function D(e){const t=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||e.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,n=b().dateModified||(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?g(n):null}function G(e){const t=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||e.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||e.querySelector("time")||document.querySelector("time")||e.querySelector("[datetime]")||document.querySelector("[datetime]")||null,n=b().datePublished||(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?g(n):null}function g(e){try{return new Date(e).toISOString()}catch{return null}}function b(){const e=document.querySelector('[type="application/ld+json"]');if(!e)return{};try{return JSON.parse(e.textContent||"")}catch{return{}}}function j(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}function H(e){return!!(e.exclude_urls_pattern&&j().match(new RegExp(e.exclude_urls_pattern)))}let p=null;async function f(e,{url:t=j(),hash:n=N(e||""),params:i={},method:o="GET"}={}){const c=m(),l=_()?await I():!1,s=R();if(!c)throw new Error("No token was provided");const r=`/external-pages/?api-token=${c}&include_title_details=true${l?"&editorial_mode_enabled=true":""}&language=${s}`;let u;return o==="POST"?(i.run_ai&&(i.hash=n,i.page_text=e),i.url=t,i.metadata=E(),u=await d(r,{method:"POST",body:i})):u=await d(r+`&url=${t}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=u,u}async function B(e,{requireCompletedResult:t=!1,runAiWhenRelevant:n=!1,pollInterval:i=3e3,maxTries:o=600,onpoll:c=()=>null}={}){let l=0;p&&clearTimeout(p);const s=async(r,u)=>{let a;try{try{a=await f(e)}catch(w){throw(w==null?void 0:w.status)===404&&(a=await f(e,{method:"POST"}),a.ai_enabled&&(a=await f(e,{params:{run_ai:!0},method:"POST"}))),new Error}if(a&&n&&(a=await F(e,a)),t&&a.ai_enabled&&a.ai_running)throw new Error;a.manual_injections=L(a.manual_injections||[]),a.ai_injections=L(a.ai_injections||[]),r(a);return}catch{if(l++,l>=o){o>1&&console.error("Max poll limit exceeded. Please return later."),r();return}a&&c(a),p=setTimeout(()=>s(r),i)}};return new Promise(s)}async function F(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=E().content_modified_time,i=t.content_modified_time?g(t.content_modified_time):null,o=n&&i===n;return t.ai_last_run&&o||new Date(n||0)<=new Date(i||0)?t:await f(e,{params:{run_ai:!0},method:"POST"})}function L(e){return e.map(t=>({...t,key:J(t.sid)}))}function J(e){return e+"-"+M()}function K(e){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=e)}function W(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}window.PlayPilotLinkInjections={token:"",editorial_token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,region:null,organization_sid:null,domain_sid:null,last_successful_fetch:null,tracked_events:[],queued_tracking_events:[],split_test_identifiers:{},evaluated_link_injections:[],initial_link_injections_promise:null,time_at_initialize:0,ads:[],require_consent:!0,no_affiliate:!1,consents:{ads:!1,pixels:!1,tracking:!1,split_tests:!1,affiliate:!1},config:{},app:null,async initialize(e={token:"",selector:"",after_article_selector:"",after_article_insert_position:"",language:null,region:null,organization_sid:null,domain_sid:null,editorial_token:"",require_consent:!0,no_affiliate:!1}){if(!e.token){console.error("An API token is required.");return}if(this.token=e.token,this.editorial_token=e.editorial_token,this.selector=e.selector,this.after_article_selector=e.after_article_selector,this.after_article_insert_position=e.after_article_insert_position,this.language=e.language,this.region=e.region,this.organization_sid=e.organization_sid,this.domain_sid=e.domain_sid,this.require_consent=e.require_consent,this.no_affiliate=e.no_affiliate,this.time_at_initialize=Date.now(),this.require_consent===!1&&K({ads:!0,pixels:!0,tracking:!0,split_tests:!0,affiliate:!0}),this.config=await O()||{},H(this.config))return;const{pageText:t}=$(this.config);this.initial_link_injections_promise=B(t,{maxTries:1,runAiWhenRelevant:!W()}),this.mount()},destroy(){var e;(e=window.PlayPilotMount)==null||e.destroy()},mount(){const e=_()||P(),t=document.createElement("script");t.id="playpilot-mount",t.src=`https://cdn.jsdelivr.net/npm/@playpilot/tpi@8.4.1/dist/${e?"editorial.":""}mount.js`,t.onload=()=>{var n;return(n=window.PlayPilotMount)==null?void 0:n.mount()},document.body.appendChild(t)}}})();
package/dist/mount.js CHANGED
@@ -2,7 +2,7 @@ var Uh=Object.defineProperty;var is=Ee=>{throw TypeError(Ee)};var Wh=(Ee,Pe,Le)=
2
2
  /*$vite$:1*/`,document.head.appendChild(Ee);const Pe=!1;var Le=Array.isArray,La=Array.prototype.indexOf,kr=Array.from,ss=Object.defineProperty,ri=Object.getOwnPropertyDescriptor,Bn=Object.getOwnPropertyDescriptors,cs=Object.prototype,ds=Array.prototype,Sr=Object.getPrototypeOf,Fn=Object.isExtensible;function Ni(t){return typeof t=="function"}const pt=()=>{};function us(t){return typeof(t==null?void 0:t.then)=="function"}function ps(t){return t()}function Tr(t){for(var e=0;e<t.length;e++)t[e]()}function Vn(){var t,e,i=new Promise((a,r)=>{t=a,e=r});return{promise:i,resolve:t,reject:e}}function Hn(t,e,i=!1){return t===void 0?i?e():e:t}function Ma(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const i=[];for(const a of t)if(i.push(a),i.length===e)break;return i}const We=2,Er=4,Da=8,Un=1<<24,Pt=16,Gt=32,wi=64,qa=128,bt=512,Ze=1024,at=2048,Kt=4096,ot=8192,Yt=16384,Oa=32768,zt=65536,Wn=1<<17,Gn=1<<18,Ri=1<<19,Kn=1<<20,da=32768,Pr=1<<21,zr=1<<22,ni=1<<23,Ct=Symbol("$state"),Yn=Symbol("legacy props"),vs=Symbol(""),Bi=new class extends Error{constructor(){super(...arguments);Et(this,"name","StaleReactionError");Et(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Cr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function fs(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hs(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function gs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ms(t){throw new Error("https://svelte.dev/e/effect_orphan")}function ys(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function bs(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function ws(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function _s(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function xs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ks(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Zn=1,Jn=2,Qn=4,Ss=8,Ts=16,Es=1,Ps=2,zs=4,Cs=8,Is=16,js=1,As=2,Ls=4,Ms=1,Ds=2,Ve=Symbol(),qs="http://www.w3.org/1999/xhtml",Os="http://www.w3.org/2000/svg",Ns="@attach";function Rs(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Bs(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Xn(t){return t===this.v}function $n(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function el(t){return!$n(t,this.v)}let Fi=!1,Fs=!1;function Vs(){Fi=!0}let Se=null;function Vi(t){Se=t}function Ir(t){return tl().get(t)}function jr(t,e){return tl().set(t,e),e}function ae(t,e=!1,i){Se={p:Se,i:!1,c:null,e:null,s:t,x:null,l:Fi&&!e?{s:null,u:null,$:[]}:null}}function re(t){var e=Se,i=e.e;if(i!==null){e.e=null;for(var a of i)Sl(a)}return t!==void 0&&(e.x=t),e.i=!0,Se=e.p,t??{}}function _i(){return!Fi||Se!==null&&Se.l===null}function tl(t){return Se===null&&Cr(),Se.c??(Se.c=new Map(Hs(Se)||void 0))}function Hs(t){let e=t.p;for(;e!==null;){const i=e.c;if(i!==null)return i;e=e.p}return null}let xi=[];function il(){var t=xi;xi=[],Tr(t)}function Zt(t){if(xi.length===0&&!Ui){var e=xi;queueMicrotask(()=>{e===xi&&il()})}xi.push(t)}function Us(){for(;xi.length>0;)il()}function al(t){var e=ye;if(e===null)return he.f|=ni,t;if(e.f&Oa)Hi(t,e);else{if(!(e.f&qa))throw t;e.b.error(t)}}function Hi(t,e){for(;e!==null;){if(e.f&qa)try{e.b.error(t);return}catch(i){t=i}e=e.parent}throw t}const Na=new Set;let fe=null,Ra=null,Oe=null,vt=[],Ba=null,Ar=!1,Ui=!1;const fr=class fr{constructor(){oe(this,Fe);Et(this,"committed",!1);Et(this,"current",new Map);Et(this,"previous",new Map);oe(this,aa,new Set);oe(this,ra,new Set);oe(this,ji,0);oe(this,Ai,0);oe(this,Pa,null);oe(this,na,[]);oe(this,la,[]);Et(this,"skipped_effects",new Set);Et(this,"is_fork",!1)}is_deferred(){return this.is_fork||L(this,Ai)>0}process(e){var a;vt=[],Ra=null,this.apply();var i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const r of e)ze(this,Fe,qn).call(this,r,i);this.is_fork||ze(this,Fe,as).call(this),this.is_deferred()?(ze(this,Fe,Oi).call(this,i.effects),ze(this,Fe,Oi).call(this,i.render_effects),ze(this,Fe,Oi).call(this,i.block_effects)):(Ra=this,fe=null,ll(i.render_effects),ll(i.effects),Ra=null,(a=L(this,Pa))==null||a.resolve()),Oe=null}capture(e,i){this.previous.has(e)||this.previous.set(e,i),e.f&ni||(this.current.set(e,e.v),Oe==null||Oe.set(e,e.v))}activate(){fe=this,this.apply()}deactivate(){fe===this&&(fe=null,Oe=null)}flush(){if(this.activate(),vt.length>0){if(nl(),fe!==null&&fe!==this)return}else L(this,ji)===0&&this.process([]);this.deactivate()}discard(){for(const e of L(this,ra))e(this);L(this,ra).clear()}increment(e){ne(this,ji,L(this,ji)+1),e&&ne(this,Ai,L(this,Ai)+1)}decrement(e){ne(this,ji,L(this,ji)-1),e&&ne(this,Ai,L(this,Ai)-1),this.revive()}revive(){for(const e of L(this,na))Je(e,at),ki(e);for(const e of L(this,la))Je(e,Kt),ki(e);ne(this,na,[]),ne(this,la,[]),this.flush()}oncommit(e){L(this,aa).add(e)}ondiscard(e){L(this,ra).add(e)}settled(){return(L(this,Pa)??ne(this,Pa,Vn())).promise}static ensure(){if(fe===null){const e=fe=new fr;Na.add(fe),Ui||fr.enqueue(()=>{fe===e&&e.flush()})}return fe}static enqueue(e){Zt(e)}apply(){}};aa=new WeakMap,ra=new WeakMap,ji=new WeakMap,Ai=new WeakMap,Pa=new WeakMap,na=new WeakMap,la=new WeakMap,Fe=new WeakSet,qn=function(e,i){var u;e.f^=Ze;for(var a=e.first;a!==null;){var r=a.f,n=(r&(Gt|wi))!==0,l=n&&(r&Ze)!==0,s=l||(r&ot)!==0||this.skipped_effects.has(a);if(a.f&qa&&((u=a.b)!=null&&u.is_pending())&&(i={parent:i,effect:a,effects:[],render_effects:[],block_effects:[]}),!s&&a.fn!==null){n?a.f^=Ze:r&Er?i.effects.push(a):ma(a)&&(a.f&Pt&&i.block_effects.push(a),ya(a));var c=a.first;if(c!==null){a=c;continue}}var d=a.parent;for(a=a.next;a===null&&d!==null;)d===i.effect&&(ze(this,Fe,Oi).call(this,i.effects),ze(this,Fe,Oi).call(this,i.render_effects),ze(this,Fe,Oi).call(this,i.block_effects),i=i.parent),a=d.next,d=d.parent}},Oi=function(e){for(const i of e)(i.f&at?L(this,na):L(this,la)).push(i),ze(this,Fe,On).call(this,i.deps),Je(i,Ze)},On=function(e){if(e!==null)for(const i of e)!(i.f&We)||!(i.f&da)||(i.f^=da,ze(this,Fe,On).call(this,i.deps))},as=function(){if(L(this,Ai)===0){for(const e of L(this,aa))e();L(this,aa).clear()}L(this,ji)===0&&ze(this,Fe,rs).call(this)},rs=function(){var n;if(Na.size>1){this.previous.clear();var e=Oe,i=!0,a={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const l of Na){if(l===this){i=!1;continue}const s=[];for(const[d,u]of this.current){if(l.current.has(d))if(i&&u!==l.current.get(d))l.current.set(d,u);else continue;s.push(d)}if(s.length===0)continue;const c=[...l.current.keys()].filter(d=>!this.current.has(d));if(c.length>0){var r=vt;vt=[];const d=new Set,u=new Map;for(const p of s)ol(p,c,d,u);if(vt.length>0){fe=l,l.apply();for(const p of vt)ze(n=l,Fe,qn).call(n,p,a);l.deactivate()}vt=r}}fe=null,Oe=e}this.committed=!0,Na.delete(this)};let It=fr;function rl(t){var e=Ui;Ui=!0;try{for(var i;;){if(Us(),vt.length===0&&(fe==null||fe.flush(),vt.length===0))return Ba=null,i;nl()}}finally{Ui=e}}function nl(){var t=ci;Ar=!0;var e=null;try{var i=0;for(Va(!0);vt.length>0;){var a=It.ensure();if(i++>1e3){var r,n;Ws()}a.process(vt),li.clear()}}finally{Ar=!1,Va(t),Ba=null}}function Ws(){try{ys()}catch(t){Hi(t,Ba)}}let wt=null;function ll(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var a=t[i++];if(!(a.f&(Yt|ot))&&ma(a)&&(wt=new Set,ya(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?zl(a):a.fn=null),(wt==null?void 0:wt.size)>0)){li.clear();for(const r of wt){if(r.f&(Yt|ot))continue;const n=[r];let l=r.parent;for(;l!==null;)wt.has(l)&&(wt.delete(l),n.push(l)),l=l.parent;for(let s=n.length-1;s>=0;s--){const c=n[s];c.f&(Yt|ot)||ya(c)}}wt.clear()}}wt=null}}function ol(t,e,i,a){if(!i.has(t)&&(i.add(t),t.reactions!==null))for(const r of t.reactions){const n=r.f;n&We?ol(r,e,i,a):n&(zr|Pt)&&!(n&at)&&sl(r,e,a)&&(Je(r,at),ki(r))}}function sl(t,e,i){const a=i.get(t);if(a!==void 0)return a;if(t.deps!==null)for(const r of t.deps){if(e.includes(r))return!0;if(r.f&We&&sl(r,e,i))return i.set(r,!0),!0}return i.set(t,!1),!1}function ki(t){for(var e=Ba=t;e.parent!==null;){e=e.parent;var i=e.f;if(Ar&&e===ye&&i&Pt&&!(i&Gn))return;if(i&(wi|Gt)){if(!(i&Ze))return;e.f^=Ze}}vt.push(e)}function cl(t){let e=0,i=At(0),a;return()=>{fa()&&(o(i),Fa(()=>(e===0&&(a=qt(()=>t(()=>oi(i)))),e+=1,()=>{Zt(()=>{e-=1,e===0&&(a==null||a(),a=void 0,oi(i))})})))}}var Gs=zt|Ri|qa;function Ks(t,e,i){new Ys(t,e,i)}class Ys{constructor(e,i,a){oe(this,He);Et(this,"parent");oe(this,gt,!1);oe(this,mt);oe(this,Mn,null);oe(this,Ft);oe(this,Li);oe(this,Vt);oe(this,yt,null);oe(this,lt,null);oe(this,Ht,null);oe(this,ai,null);oe(this,hi,null);oe(this,Mi,0);oe(this,gi,0);oe(this,Di,!1);oe(this,mi,null);oe(this,hr,cl(()=>(ne(this,mi,At(L(this,Mi))),()=>{ne(this,mi,null)})));ne(this,mt,e),ne(this,Ft,i),ne(this,Li,a),this.parent=ye.b,ne(this,gt,!!L(this,Ft).pending),ne(this,Vt,si(()=>{ye.b=this;{var r=ze(this,He,Nn).call(this);try{ne(this,yt,rt(()=>a(r)))}catch(n){this.error(n)}L(this,gi)>0?ze(this,He,xr).call(this):ne(this,gt,!1)}return()=>{var n;(n=L(this,hi))==null||n.remove()}},Gs))}is_pending(){return L(this,gt)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!L(this,Ft).pending}update_pending_count(e){ze(this,He,Rn).call(this,e),ne(this,Mi,L(this,Mi)+e),L(this,mi)&&Jt(L(this,mi),L(this,Mi))}get_effect_pending(){return L(this,hr).call(this),o(L(this,mi))}error(e){var i=L(this,Ft).onerror;let a=L(this,Ft).failed;if(L(this,Di)||!i&&!a)throw e;L(this,yt)&&(Ke(L(this,yt)),ne(this,yt,null)),L(this,lt)&&(Ke(L(this,lt)),ne(this,lt,null)),L(this,Ht)&&(Ke(L(this,Ht)),ne(this,Ht,null));var r=!1,n=!1;const l=()=>{if(r){Bs();return}r=!0,n&&ks(),It.ensure(),ne(this,Mi,0),L(this,Ht)!==null&&Gi(L(this,Ht),()=>{ne(this,Ht,null)}),ne(this,gt,this.has_pending_snippet()),ne(this,yt,ze(this,He,_r).call(this,()=>(ne(this,Di,!1),rt(()=>L(this,Li).call(this,L(this,mt)))))),L(this,gi)>0?ze(this,He,xr).call(this):ne(this,gt,!1)};var s=he;try{nt(null),n=!0,i==null||i(e,l),n=!1}catch(c){Hi(c,L(this,Vt)&&L(this,Vt).parent)}finally{nt(s)}a&&Zt(()=>{ne(this,Ht,ze(this,He,_r).call(this,()=>{It.ensure(),ne(this,Di,!0);try{return rt(()=>{a(L(this,mt),()=>e,()=>l)})}catch(c){return Hi(c,L(this,Vt).parent),null}finally{ne(this,Di,!1)}}))})}}gt=new WeakMap,mt=new WeakMap,Mn=new WeakMap,Ft=new WeakMap,Li=new WeakMap,Vt=new WeakMap,yt=new WeakMap,lt=new WeakMap,Ht=new WeakMap,ai=new WeakMap,hi=new WeakMap,Mi=new WeakMap,gi=new WeakMap,Di=new WeakMap,mi=new WeakMap,hr=new WeakMap,He=new WeakSet,Gh=function(){try{ne(this,yt,rt(()=>L(this,Li).call(this,L(this,mt))))}catch(e){this.error(e)}ne(this,gt,!1)},Kh=function(){const e=L(this,Ft).pending;e&&(ne(this,lt,rt(()=>e(L(this,mt)))),It.enqueue(()=>{var i=ze(this,He,Nn).call(this);ne(this,yt,ze(this,He,_r).call(this,()=>(It.ensure(),rt(()=>L(this,Li).call(this,i))))),L(this,gi)>0?ze(this,He,xr).call(this):(Gi(L(this,lt),()=>{ne(this,lt,null)}),ne(this,gt,!1))}))},Nn=function(){var e=L(this,mt);return L(this,gt)&&(ne(this,hi,Lt()),L(this,mt).before(L(this,hi)),e=L(this,hi)),e},_r=function(e){var i=ye,a=he,r=Se;Dt(L(this,Vt)),nt(L(this,Vt)),Vi(L(this,Vt).ctx);try{return e()}catch(n){return al(n),null}finally{Dt(i),nt(a),Vi(r)}},xr=function(){const e=L(this,Ft).pending;L(this,yt)!==null&&(ne(this,ai,document.createDocumentFragment()),L(this,ai).append(L(this,hi)),jl(L(this,yt),L(this,ai))),L(this,lt)===null&&ne(this,lt,rt(()=>e(L(this,mt))))},Rn=function(e){var i;if(!this.has_pending_snippet()){this.parent&&ze(i=this.parent,He,Rn).call(i,e);return}ne(this,gi,L(this,gi)+e),L(this,gi)===0&&(ne(this,gt,!1),L(this,lt)&&Gi(L(this,lt),()=>{ne(this,lt,null)}),L(this,ai)&&(L(this,mt).before(L(this,ai)),ne(this,ai,null)))};let Si=null;function dl(t){Si=t}function Ie(t,e){return e}function Zs(t,e,i){for(var a=[],r=e.length,n=0;n<r;n++)Nr(e[n].e,a,!0);Cl(a,()=>{var l=a.length===0&&i!==null;if(l){var s=i,c=s.parentNode;rc(c),c.append(s),t.items.clear(),jt(t,e[0].prev,e[r-1].next)}for(var d=0;d<r;d++){var u=e[d];l||(t.items.delete(u.k),jt(t,u.prev,u.next)),Ke(u.e,!l)}t.first===e[0]&&(t.first=e[0].prev)})}function Ce(t,e,i,a,r,n=null){var l=t,s=new Map,c=null,d=(e&Qn)!==0,u=(e&Zn)!==0,p=(e&Jn)!==0;if(d){var f=t;l=f.appendChild(Lt())}var h=null,m=Mr(()=>{var P=i();return Le(P)?P:P==null?[]:kr(P)}),y,b=!0;function g(){Js(x,y,l,e,a),h!==null&&(y.length===0?(h.fragment?(l.before(h.fragment),h.fragment=null):Rr(h.effect),_.first=h.effect):Gi(h.effect,()=>{h=null}))}var _=si(()=>{y=o(m);for(var P=y.length,D=new Set,E=fe,z=null,N=_l(),A=0;A<P;A+=1){var M=y[A],I=a(M,A),k=b?null:s.get(I);k?(u&&Jt(k.v,M),p?Jt(k.i,A):k.i=A,N&&E.skipped_effects.delete(k.e)):(k=Qs(b?l:null,z,M,I,A,r,e,i),b&&(k.o=!0,z===null?c=k:z.next=k,z=k),s.set(I,k)),D.add(I)}if(P===0&&n&&!h)if(b)h={fragment:null,effect:rt(()=>n(l))};else{var T=document.createDocumentFragment(),H=Lt();T.append(H),h={fragment:T,effect:rt(()=>n(H))}}if(!b)if(N){for(const[W,X]of s)D.has(W)||E.skipped_effects.add(X.e);E.oncommit(g),E.ondiscard(()=>{})}else g();o(m)}),x={effect:_,flags:e,items:s,first:c};b=!1}function Js(t,e,i,a,r){var M,I,k,T;var n=(a&Ss)!==0,l=e.length,s=t.items,c=t.first,d,u=null,p,f=[],h=[],m,y,b,g;if(n)for(g=0;g<l;g+=1)m=e[g],y=r(m,g),b=s.get(y),b.o&&((M=b.a)==null||M.measure(),(p??(p=new Set)).add(b));for(g=0;g<l;g+=1){if(m=e[g],y=r(m,g),b=s.get(y),t.first??(t.first=b),!b.o){b.o=!0;var _=u?u.next:c;jt(t,u,b),jt(t,b,_),Lr(b,_,i),u=b,f=[],h=[],c=u.next;continue}if(b.e.f&ot&&(Rr(b.e),n&&((I=b.a)==null||I.unfix(),(p??(p=new Set)).delete(b))),b!==c){if(d!==void 0&&d.has(b)){if(f.length<h.length){var x=h[0],P;u=x.prev;var D=f[0],E=f[f.length-1];for(P=0;P<f.length;P+=1)Lr(f[P],x,i);for(P=0;P<h.length;P+=1)d.delete(h[P]);jt(t,D.prev,E.next),jt(t,u,D),jt(t,E,x),c=x,u=E,g-=1,f=[],h=[]}else d.delete(b),Lr(b,c,i),jt(t,b.prev,b.next),jt(t,b,u===null?t.first:u.next),jt(t,u,b),u=b;continue}for(f=[],h=[];c!==null&&c.k!==y;)c.e.f&ot||(d??(d=new Set)).add(c),h.push(c),c=c.next;if(c===null)continue;b=c}f.push(b),u=b,c=b.next}if(c!==null||d!==void 0){for(var z=d===void 0?[]:kr(d);c!==null;)c.e.f&ot||z.push(c),c=c.next;var N=z.length;if(N>0){var A=a&Qn&&l===0?i:null;if(n){for(g=0;g<N;g+=1)(k=z[g].a)==null||k.measure();for(g=0;g<N;g+=1)(T=z[g].a)==null||T.fix()}Zs(t,z,A)}}n&&Zt(()=>{var H;if(p!==void 0)for(b of p)(H=b.a)==null||H.apply()})}function Qs(t,e,i,a,r,n,l,s){var c=Si,d=(l&Zn)!==0,u=(l&Ts)===0,p=d?u?Or(i,!1,!1):At(i):i,f=l&Jn?At(r):r,h={i:f,v:p,k:a,a:null,e:null,o:!1,prev:e,next:null};Si=h;try{if(t===null){var m=document.createDocumentFragment();m.append(t=Lt())}return h.e=rt(()=>n(t,p,f,s)),e!==null&&(e.next=h),h}finally{Si=c}}function Lr(t,e,i){for(var a=t.next?t.next.e.nodes_start:i,r=e?e.e.nodes_start:i,n=t.e.nodes_start;n!==null&&n!==a;){var l=va(n);r.before(n),n=l}}function jt(t,e,i){e===null?(t.first=i,t.effect.first=i&&i.e):(e.e===t.effect.last&&i!==null&&(t.effect.last=i.e),e.e.next&&(e.e.next.prev=null),e.next=i,e.e.next=i&&i.e),i===null?t.effect.last=e&&e.e:(i.e===t.effect.last&&e===null&&(t.effect.last=i.e.prev),i.e.prev&&(i.e.prev.next=null),i.prev=e,i.e.prev=e&&e.e)}function ul(t,e,i,a){const r=_i()?pa:Mr;if(i.length===0&&t.length===0){a(e.map(r));return}var n=fe,l=ye,s=pl();function c(){Promise.all(i.map(d=>Xs(d))).then(d=>{s();try{a([...e.map(r),...d])}catch(u){l.f&Yt||Hi(u,l)}n==null||n.deactivate(),ua()}).catch(d=>{Hi(d,l)})}t.length>0?Promise.all(t).then(()=>{s();try{return c()}finally{n==null||n.deactivate(),ua()}}):c()}function pl(){var t=ye,e=he,i=Se,a=fe;return function(n=!0){Dt(t),nt(e),Vi(i),n&&(a==null||a.activate())}}function ua(){Dt(null),nt(null),Vi(null)}function pa(t){var e=We|at,i=he!==null&&he.f&We?he:null;return ye!==null&&(ye.f|=Ri),{ctx:Se,deps:null,effects:null,equals:Xn,f:e,fn:t,reactions:null,rv:0,v:Ve,wv:0,parent:i??ye,ac:null}}function Xs(t,e){let i=ye;i===null&&fs();var a=i.b,r=void 0,n=At(Ve),l=!he,s=new Map;return pc(()=>{var f;var c=Vn();r=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{d===fe&&d.committed&&d.deactivate(),ua()})}catch(h){c.reject(h),ua()}var d=fe;if(l){var u=!a.is_pending();a.update_pending_count(1),d.increment(u),(f=s.get(d))==null||f.reject(Bi),s.delete(d),s.set(d,c)}const p=(h,m=void 0)=>{if(d.activate(),m)m!==Bi&&(n.f|=ni,Jt(n,m));else{n.f&ni&&(n.f^=ni),Jt(n,h);for(const[y,b]of s){if(s.delete(y),y===d)break;b.reject(Bi)}}l&&(a.update_pending_count(-1),d.decrement(u))};c.promise.then(p,h=>p(null,h||"unknown"))}),ha(()=>{for(const c of s.values())c.reject(Bi)}),new Promise(c=>{function d(u){function p(){u===r?c(n):d(r)}u.then(p,p)}d(r)})}function F(t){const e=pa(t);return Ll(e),e}function Mr(t){const e=pa(t);return e.equals=el,e}function vl(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)Ke(e[i])}}function $s(t){for(var e=t.parent;e!==null;){if(!(e.f&We))return e.f&Yt?null:e;e=e.parent}return null}function Dr(t){var e,i=ye;Dt($s(t));try{t.f&=~da,vl(t),e=Nl(t)}finally{Dt(i)}return e}function fl(t){var e=Dr(t);if(t.equals(e)||(fe!=null&&fe.is_fork||(t.v=e),t.wv=ql()),!Pi)if(Oe!==null)(fa()||fe!=null&&fe.is_fork)&&Oe.set(t,e);else{var i=t.f&bt?Ze:Kt;Je(t,i)}}let qr=new Set;const li=new Map;let hl=!1;function At(t,e){var i={f:0,v:t,reactions:null,equals:Xn,rv:0,wv:0};return i}function G(t,e){const i=At(t);return Ll(i),i}function Or(t,e=!1,i=!0){var r;const a=At(t);return e||(a.equals=el),Fi&&i&&Se!==null&&Se.l!==null&&((r=Se.l).s??(r.s=[])).push(a),a}function q(t,e,i=!1){he!==null&&(!Mt||he.f&Wn)&&_i()&&he.f&(We|Pt|zr|Wn)&&!(Xe!=null&&Xe.includes(t))&&xs();let a=i?Ne(e):e;return Jt(t,a)}function Jt(t,e){if(!t.equals(e)){var i=t.v;Pi?li.set(t,e):li.set(t,i),t.v=e;var a=It.ensure();a.capture(t,i),t.f&We&&(t.f&at&&Dr(t),Je(t,t.f&bt?Ze:Kt)),t.wv=ql(),gl(t,at),_i()&&ye!==null&&ye.f&Ze&&!(ye.f&(Gt|wi))&&(ft===null?hc([t]):ft.push(t)),!a.is_fork&&qr.size>0&&!hl&&ec()}return e}function ec(){hl=!1;var t=ci;Va(!0);const e=Array.from(qr);try{for(const i of e)i.f&Ze&&Je(i,Kt),ma(i)&&ya(i)}finally{Va(t)}qr.clear()}function tc(t,e=1){var i=o(t),a=e===1?i++:i--;return q(t,i),a}function oi(t){q(t,t.v+1)}function gl(t,e){var i=t.reactions;if(i!==null)for(var a=_i(),r=i.length,n=0;n<r;n++){var l=i[n],s=l.f;if(!(!a&&l===ye)){var c=(s&at)===0;if(c&&Je(l,e),s&We){var d=l;Oe==null||Oe.delete(d),s&da||(s&bt&&(l.f|=da),gl(d,Kt))}else c&&(s&Pt&&wt!==null&&wt.add(l),ki(l))}}}function Ne(t){if(typeof t!="object"||t===null||Ct in t)return t;const e=Sr(t);if(e!==cs&&e!==ds)return t;var i=new Map,a=Le(t),r=G(0),n=Qt,l=s=>{if(Qt===n)return s();var c=he,d=Qt;nt(null),Dl(n);var u=s();return nt(c),Dl(d),u};return a&&i.set("length",G(t.length)),new Proxy(t,{defineProperty(s,c,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&ws();var u=i.get(c);return u===void 0?u=l(()=>{var p=G(d.value);return i.set(c,p),p}):q(u,d.value,!0),!0},deleteProperty(s,c){var d=i.get(c);if(d===void 0){if(c in s){const u=l(()=>G(Ve));i.set(c,u),oi(r)}}else q(d,Ve),oi(r);return!0},get(s,c,d){var h;if(c===Ct)return t;var u=i.get(c),p=c in s;if(u===void 0&&(!p||(h=ri(s,c))!=null&&h.writable)&&(u=l(()=>{var m=Ne(p?s[c]:Ve),y=G(m);return y}),i.set(c,u)),u!==void 0){var f=o(u);return f===Ve?void 0:f}return Reflect.get(s,c,d)},getOwnPropertyDescriptor(s,c){var d=Reflect.getOwnPropertyDescriptor(s,c);if(d&&"value"in d){var u=i.get(c);u&&(d.value=o(u))}else if(d===void 0){var p=i.get(c),f=p==null?void 0:p.v;if(p!==void 0&&f!==Ve)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(s,c){var f;if(c===Ct)return!0;var d=i.get(c),u=d!==void 0&&d.v!==Ve||Reflect.has(s,c);if(d!==void 0||ye!==null&&(!u||(f=ri(s,c))!=null&&f.writable)){d===void 0&&(d=l(()=>{var h=u?Ne(s[c]):Ve,m=G(h);return m}),i.set(c,d));var p=o(d);if(p===Ve)return!1}return u},set(s,c,d,u){var x;var p=i.get(c),f=c in s;if(a&&c==="length")for(var h=d;h<p.v;h+=1){var m=i.get(h+"");m!==void 0?q(m,Ve):h in s&&(m=l(()=>G(Ve)),i.set(h+"",m))}if(p===void 0)(!f||(x=ri(s,c))!=null&&x.writable)&&(p=l(()=>G(void 0)),q(p,Ne(d)),i.set(c,p));else{f=p.v!==Ve;var y=l(()=>Ne(d));q(p,y)}var b=Reflect.getOwnPropertyDescriptor(s,c);if(b!=null&&b.set&&b.set.call(u,d),!f){if(a&&typeof c=="string"){var g=i.get("length"),_=Number(c);Number.isInteger(_)&&_>=g.v&&q(g,_+1)}oi(r)}return!0},ownKeys(s){o(r);var c=Reflect.ownKeys(s).filter(p=>{var f=i.get(p);return f===void 0||f.v!==Ve});for(var[d,u]of i)u.v!==Ve&&!(d in s)&&c.push(d);return c},setPrototypeOf(){_s()}})}function ml(t){try{if(t!==null&&typeof t=="object"&&Ct in t)return t[Ct]}catch{}return t}function ic(t,e){return Object.is(ml(t),ml(e))}var je,yl,bl,wl;function ac(){if(je===void 0){je=window,yl=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;bl=ri(e,"firstChild").get,wl=ri(e,"nextSibling").get,Fn(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Fn(i)&&(i.__t=void 0)}}function Lt(t=""){return document.createTextNode(t)}function Wi(t){return bl.call(t)}function va(t){return wl.call(t)}function S(t,e){return Wi(t)}function Z(t,e=!1){{var i=Wi(t);return i instanceof Comment&&i.data===""?va(i):i}}function j(t,e=1,i=!1){let a=t;for(;e--;)a=va(a);return a}function rc(t){t.textContent=""}function _l(){return!1}function nc(t,e){if(e){const i=document.body;t.autofocus=!0,Zt(()=>{document.activeElement===i&&t.focus()})}}let xl=!1;function lc(){xl||(xl=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const i of t.target.elements)(e=i.__on_r)==null||e.call(i)})},{capture:!0}))}function oc(t,e,i,a=!0){a&&i();for(var r of e)t.addEventListener(r,i);ha(()=>{for(var n of e)t.removeEventListener(n,i)})}function Ti(t){var e=he,i=ye;nt(null),Dt(null);try{return t()}finally{nt(e),Dt(i)}}function sc(t,e,i,a=i){t.addEventListener(e,()=>Ti(i));const r=t.__on_r;r?t.__on_r=()=>{r(),a(!0)}:t.__on_r=()=>a(!0),lc()}function kl(t){ye===null&&(he===null&&ms(),gs()),Pi&&hs()}function cc(t,e){var i=e.last;i===null?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}function _t(t,e,i){var a=ye;a!==null&&a.f&ot&&(t|=ot);var r={ctx:Se,deps:null,nodes_start:null,nodes_end:null,f:t|at|bt,first:null,fn:e,last:null,next:null,parent:a,b:a&&a.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(i)try{ya(r),r.f|=Oa}catch(s){throw Ke(r),s}else e!==null&&ki(r);var n=r;if(i&&n.deps===null&&n.teardown===null&&n.nodes_start===null&&n.first===n.last&&!(n.f&Ri)&&(n=n.first,t&Pt&&t&zt&&n!==null&&(n.f|=zt)),n!==null&&(n.parent=a,a!==null&&cc(n,a),he!==null&&he.f&We&&!(t&wi))){var l=he;(l.effects??(l.effects=[])).push(n)}return r}function fa(){return he!==null&&!Mt}function ha(t){const e=_t(Da,null,!1);return Je(e,Ze),e.teardown=t,e}function Ge(t){kl();var e=ye.f,i=!he&&(e&Gt)!==0&&(e&Oa)===0;if(i){var a=Se;(a.e??(a.e=[])).push(t)}else return Sl(t)}function Sl(t){return _t(Er|Kn,t,!1)}function dc(t){return kl(),_t(Da|Kn,t,!0)}function uc(t){It.ensure();const e=_t(wi|Ri,t,!0);return(i={})=>new Promise(a=>{i.outro?Gi(e,()=>{Ke(e),a(void 0)}):(Ke(e),a(void 0))})}function Ei(t){return _t(Er,t,!1)}function pc(t){return _t(zr|Ri,t,!0)}function Fa(t,e=0){return _t(Da|e,t,!0)}function R(t,e=[],i=[],a=[]){ul(a,e,i,r=>{_t(Da,()=>t(...r.map(o)),!0)})}function si(t,e=0){var i=_t(Pt|e,t,!0);return i}function Tl(t,e=0){var i=_t(Un|e,t,!0);return i}function rt(t){return _t(Gt|Ri,t,!0)}function El(t){var e=t.teardown;if(e!==null){const i=Pi,a=he;Al(!0),nt(null);try{e.call(null)}finally{Al(i),nt(a)}}}function Pl(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const r=i.ac;r!==null&&Ti(()=>{r.abort(Bi)});var a=i.next;i.f&wi?i.parent=null:Ke(i,e),i=a}}function vc(t){for(var e=t.first;e!==null;){var i=e.next;e.f&Gt||Ke(e),e=i}}function Ke(t,e=!0){var i=!1;(e||t.f&Gn)&&t.nodes_start!==null&&t.nodes_end!==null&&(fc(t.nodes_start,t.nodes_end),i=!0),Pl(t,e&&!i),Ha(t,0),Je(t,Yt);var a=t.transitions;if(a!==null)for(const n of a)n.stop();El(t);var r=t.parent;r!==null&&r.first!==null&&zl(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function fc(t,e){for(;t!==null;){var i=t===e?null:va(t);t.remove(),t=i}}function zl(t){var e=t.parent,i=t.prev,a=t.next;i!==null&&(i.next=a),a!==null&&(a.prev=i),e!==null&&(e.first===t&&(e.first=a),e.last===t&&(e.last=i))}function Gi(t,e,i=!0){var a=[];Nr(t,a,!0),Cl(a,()=>{i&&Ke(t),e&&e()})}function Cl(t,e){var i=t.length;if(i>0){var a=()=>--i||e();for(var r of t)r.out(a)}else e()}function Nr(t,e,i){if(!(t.f&ot)){if(t.f^=ot,t.transitions!==null)for(const l of t.transitions)(l.is_global||i)&&e.push(l);for(var a=t.first;a!==null;){var r=a.next,n=(a.f&zt)!==0||(a.f&Gt)!==0&&(t.f&Pt)!==0;Nr(a,e,n?i:!1),a=r}}}function Rr(t){Il(t,!0)}function Il(t,e){if(t.f&ot){t.f^=ot,t.f&Ze||(Je(t,at),ki(t));for(var i=t.first;i!==null;){var a=i.next,r=(i.f&zt)!==0||(i.f&Gt)!==0;Il(i,r?e:!1),i=a}if(t.transitions!==null)for(const n of t.transitions)(n.is_global||e)&&n.in()}}function jl(t,e){for(var i=t.nodes_start,a=t.nodes_end;i!==null;){var r=i===a?null:va(i);e.append(i),i=r}}let ci=!1;function Va(t){ci=t}let Pi=!1;function Al(t){Pi=t}let he=null,Mt=!1;function nt(t){he=t}let ye=null;function Dt(t){ye=t}let Xe=null;function Ll(t){he!==null&&(Xe===null?Xe=[t]:Xe.push(t))}let $e=null,st=0,ft=null;function hc(t){ft=t}let Ml=1,ga=0,Qt=ga;function Dl(t){Qt=t}function ql(){return++Ml}function ma(t){var e=t.f;if(e&at)return!0;if(e&We&&(t.f&=-32769),e&Kt){var i=t.deps;if(i!==null)for(var a=i.length,r=0;r<a;r++){var n=i[r];if(ma(n)&&fl(n),n.wv>t.wv)return!0}e&bt&&Oe===null&&Je(t,Ze)}return!1}function Ol(t,e,i=!0){var a=t.reactions;if(a!==null&&!(Xe!=null&&Xe.includes(t)))for(var r=0;r<a.length;r++){var n=a[r];n.f&We?Ol(n,e,!1):e===n&&(i?Je(n,at):n.f&Ze&&Je(n,Kt),ki(n))}}function Nl(t){var m;var e=$e,i=st,a=ft,r=he,n=Xe,l=Se,s=Mt,c=Qt,d=t.f;$e=null,st=0,ft=null,he=d&(Gt|wi)?null:t,Xe=null,Vi(t.ctx),Mt=!1,Qt=++ga,t.ac!==null&&(Ti(()=>{t.ac.abort(Bi)}),t.ac=null);try{t.f|=Pr;var u=t.fn,p=u(),f=t.deps;if($e!==null){var h;if(Ha(t,st),f!==null&&st>0)for(f.length=st+$e.length,h=0;h<$e.length;h++)f[st+h]=$e[h];else t.deps=f=$e;if(ci&&fa()&&t.f&bt)for(h=st;h<f.length;h++)((m=f[h]).reactions??(m.reactions=[])).push(t)}else f!==null&&st<f.length&&(Ha(t,st),f.length=st);if(_i()&&ft!==null&&!Mt&&f!==null&&!(t.f&(We|Kt|at)))for(h=0;h<ft.length;h++)Ol(ft[h],t);return r!==null&&r!==t&&(ga++,ft!==null&&(a===null?a=ft:a.push(...ft))),t.f&ni&&(t.f^=ni),p}catch(y){return al(y)}finally{t.f^=Pr,$e=e,st=i,ft=a,he=r,Xe=n,Vi(l),Mt=s,Qt=c}}function gc(t,e){let i=e.reactions;if(i!==null){var a=La.call(i,t);if(a!==-1){var r=i.length-1;r===0?i=e.reactions=null:(i[a]=i[r],i.pop())}}i===null&&e.f&We&&($e===null||!$e.includes(e))&&(Je(e,Kt),e.f&bt&&(e.f^=bt,e.f&=-32769),vl(e),Ha(e,0))}function Ha(t,e){var i=t.deps;if(i!==null)for(var a=e;a<i.length;a++)gc(t,i[a])}function ya(t){var e=t.f;if(!(e&Yt)){Je(t,Ze);var i=ye,a=ci;ye=t,ci=!0;try{e&(Pt|Un)?vc(t):Pl(t),El(t);var r=Nl(t);t.teardown=typeof r=="function"?r:null,t.wv=Ml;var n;Pe&&Fs&&t.f&at&&t.deps}finally{ci=a,ye=i}}}async function ba(){await Promise.resolve(),rl()}function o(t){var e=t.f,i=(e&We)!==0;if(he!==null&&!Mt){var a=ye!==null&&(ye.f&Yt)!==0;if(!a&&!(Xe!=null&&Xe.includes(t))){var r=he.deps;if(he.f&Pr)t.rv<ga&&(t.rv=ga,$e===null&&r!==null&&r[st]===t?st++:$e===null?$e=[t]:$e.includes(t)||$e.push(t));else{(he.deps??(he.deps=[])).push(t);var n=t.reactions;n===null?t.reactions=[he]:n.includes(he)||n.push(he)}}}if(Pi){if(li.has(t))return li.get(t);if(i){var l=t,s=l.v;return(!(l.f&Ze)&&l.reactions!==null||Bl(l))&&(s=Dr(l)),li.set(l,s),s}}else i&&(!(Oe!=null&&Oe.has(t))||fe!=null&&fe.is_fork&&!fa())&&(l=t,ma(l)&&fl(l),ci&&fa()&&!(l.f&bt)&&Rl(l));if(Oe!=null&&Oe.has(t))return Oe.get(t);if(t.f&ni)throw t.v;return t.v}function Rl(t){if(t.deps!==null){t.f^=bt;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&We&&!(e.f&bt)&&Rl(e)}}function Bl(t){if(t.v===Ve)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(li.has(e)||e.f&We&&Bl(e))return!0;return!1}function qt(t){var e=Mt;try{return Mt=!0,t()}finally{Mt=e}}const mc=-7169;function Je(t,e){t.f=t.f&mc|e}function Fl(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Ct in t)Br(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];typeof i=="object"&&i&&Ct in i&&Br(i)}}}function Br(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let a in t)try{Br(t[a],e)}catch{}const i=Sr(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const a=Bn(i);for(let r in a){const n=a[r].get;if(n)try{n.call(t)}catch{}}}}}function yc(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const bc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function wc(t){return bc.includes(t)}const _c={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function xc(t){return t=t.toLowerCase(),_c[t]??t}const kc=["touchstart","touchmove"];function Sc(t){return kc.includes(t)}const Vl=new Set,Fr=new Set;function Vr(t,e,i,a={}){function r(n){if(a.capture||wa.call(e,n),!n.cancelBubble)return Ti(()=>i==null?void 0:i.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Zt(()=>{e.addEventListener(t,r,a)}):e.addEventListener(t,r,a),r}function Tc(t,e,i,a={}){var r=Vr(e,t,i,a);return()=>{t.removeEventListener(e,r,a)}}function _e(t,e,i,a,r){var n={capture:a,passive:r},l=Vr(t,e,i,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ha(()=>{e.removeEventListener(t,l,n)})}function ce(t){for(var e=0;e<t.length;e++)Vl.add(t[e]);for(var i of Fr)i(t)}let Hl=null;function wa(t){var b;var e=this,i=e.ownerDocument,a=t.type,r=((b=t.composedPath)==null?void 0:b.call(t))||[],n=r[0]||t.target;Hl=t;var l=0,s=Hl===t&&t.__root;if(s){var c=r.indexOf(s);if(c!==-1&&(e===document||e===window)){t.__root=e;return}var d=r.indexOf(e);if(d===-1)return;c<=d&&(l=c)}if(n=r[l]||t.target,n!==e){ss(t,"currentTarget",{configurable:!0,get(){return n||i}});var u=he,p=ye;nt(null),Dt(null);try{for(var f,h=[];n!==null;){var m=n.assignedSlot||n.parentNode||n.host||null;try{var y=n["__"+a];y!=null&&(!n.disabled||t.target===n)&&y.call(n,t)}catch(g){f?h.push(g):f=g}if(t.cancelBubble||m===e||m===null)break;n=m}if(f){for(let g of h)queueMicrotask(()=>{throw g});throw f}}finally{t.__root=e,delete t.currentTarget,nt(u),Dt(p)}}}function Ul(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Ki(t,e){var i=ye;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function C(t,e){var i=(e&Ms)!==0,a=(e&Ds)!==0,r,n=!t.startsWith("<!>");return()=>{r===void 0&&(r=Ul(n?t:"<!>"+t),i||(r=Wi(r)));var l=a||yl?document.importNode(r,!0):r.cloneNode(!0);if(i){var s=Wi(l),c=l.lastChild;Ki(s,c)}else Ki(l,l);return l}}function Ec(t,e,i="svg"){var a=!t.startsWith("<!>"),r=`<${i}>${a?t:"<!>"+t}</${i}>`,n;return()=>{if(!n){var l=Ul(r),s=Wi(l);n=Wi(s)}var c=n.cloneNode(!0);return Ki(c,c),c}}function ht(t,e){return Ec(t,e,"svg")}function Xt(t=""){{var e=Lt(t+"");return Ki(e,e),e}}function pe(){var t=document.createDocumentFragment(),e=document.createComment(""),i=Lt();return t.append(e,i),Ki(e,i),t}function w(t,e){t!==null&&t.before(e)}let Ua=!0;function Wa(t){Ua=t}function Y(t,e){var i=e==null?"":typeof e=="object"?e+"":e;i!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=i,t.nodeValue=i+"")}function Ot(t,e){return Pc(t,e)}const Yi=new Map;function Pc(t,{target:e,anchor:i,props:a={},events:r,context:n,intro:l=!0}){ac();var s=new Set,c=p=>{for(var f=0;f<p.length;f++){var h=p[f];if(!s.has(h)){s.add(h);var m=Sc(h);e.addEventListener(h,wa,{passive:m});var y=Yi.get(h);y===void 0?(document.addEventListener(h,wa,{passive:m}),Yi.set(h,1)):Yi.set(h,y+1)}}};c(kr(Vl)),Fr.add(c);var d=void 0,u=uc(()=>{var p=i??e.appendChild(Lt());return Ks(p,{pending:()=>{}},f=>{if(n){ae({});var h=Se;h.c=n}r&&(a.$$events=r),Ua=l,d=t(f,a)||{},Ua=!0,n&&re()}),()=>{var m;for(var f of s){e.removeEventListener(f,wa);var h=Yi.get(f);--h===0?(document.removeEventListener(f,wa),Yi.delete(f)):Yi.set(f,h)}Fr.delete(c),p!==i&&((m=p.parentNode)==null||m.removeChild(p))}});return Hr.set(d,u),d}let Hr=new WeakMap;function Zi(t,e){const i=Hr.get(t);return i?(Hr.delete(t),i(e)):Promise.resolve()}class Ji{constructor(e,i=!0){Et(this,"anchor");oe(this,kt,new Map);oe(this,Ut,new Map);oe(this,dt,new Map);oe(this,qi,new Set);oe(this,za,!0);oe(this,Ca,()=>{var e=fe;if(L(this,kt).has(e)){var i=L(this,kt).get(e),a=L(this,Ut).get(i);if(a)Rr(a),L(this,qi).delete(i);else{var r=L(this,dt).get(i);r&&(L(this,Ut).set(i,r.effect),L(this,dt).delete(i),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(const[n,l]of L(this,kt)){if(L(this,kt).delete(n),n===e)break;const s=L(this,dt).get(l);s&&(Ke(s.effect),L(this,dt).delete(l))}for(const[n,l]of L(this,Ut)){if(n===i||L(this,qi).has(n))continue;const s=()=>{if(Array.from(L(this,kt).values()).includes(n)){var d=document.createDocumentFragment();jl(l,d),d.append(Lt()),L(this,dt).set(n,{effect:l,fragment:d})}else Ke(l);L(this,qi).delete(n),L(this,Ut).delete(n)};L(this,za)||!a?(L(this,qi).add(n),Gi(l,s,!1)):s()}}});oe(this,gr,e=>{L(this,kt).delete(e);const i=Array.from(L(this,kt).values());for(const[a,r]of L(this,dt))i.includes(a)||(Ke(r.effect),L(this,dt).delete(a))});this.anchor=e,ne(this,za,i)}ensure(e,i){var a=fe,r=_l();if(i&&!L(this,Ut).has(e)&&!L(this,dt).has(e))if(r){var n=document.createDocumentFragment(),l=Lt();n.append(l),L(this,dt).set(e,{effect:rt(()=>i(l)),fragment:n})}else L(this,Ut).set(e,rt(()=>i(this.anchor)));if(L(this,kt).set(a,e),r){for(const[s,c]of L(this,Ut))s===e?a.skipped_effects.delete(c):a.skipped_effects.add(c);for(const[s,c]of L(this,dt))s===e?a.skipped_effects.delete(c.effect):a.skipped_effects.add(c.effect);a.oncommit(L(this,Ca)),a.ondiscard(L(this,gr))}else L(this,Ca).call(this)}}kt=new WeakMap,Ut=new WeakMap,dt=new WeakMap,qi=new WeakMap,za=new WeakMap,Ca=new WeakMap,gr=new WeakMap;const zc=0,Ur=1;function Ga(t,e,i,a,r){var n=_i(),l=Ve,s=n?At(l):Or(l,!1,!1),c=n?At(l):Or(l,!1,!1),d=new Ji(t);si(()=>{var u=e(),p=!1;if(us(u)){var f=pl(),h=!1;const m=y=>{if(!p){h=!0,f(!1),It.ensure();try{y()}finally{ua(),Ui||rl()}}};u.then(y=>{m(()=>{Jt(s,y),d.ensure(Ur,a&&(b=>a(b,s)))})},y=>{m(()=>{if(Jt(c,y),d.ensure(Ur,r&&(b=>r(b,c))),!r)throw c.v})}),Zt(()=>{h||m(()=>{d.ensure(zc,i)})})}else Jt(s,u),d.ensure(Ur,a&&(m=>a(m,s)));return()=>{p=!0}})}function V(t,e,i=!1){var a=new Ji(t),r=i?zt:0;function n(l,s){a.ensure(l,s)}si(()=>{var l=!1;e((s,c=!0)=>{l=!0,n(c,s)}),l||n(!1,null)},r)}function Qi(t,e,i){var a=new Ji(t),r=!_i();si(()=>{var n=e();r&&n!==null&&typeof n=="object"&&(n={}),a.ensure(n,i)})}function Re(t,e,...i){var a=new Ji(t);si(()=>{const r=e()??null;a.ensure(r,r&&(n=>r(n,...i)))},zt)}function Wr(t,e,i){var a=new Ji(t);si(()=>{var r=e()??null;a.ensure(r,r&&(n=>i(n,r)))},zt)}function Wl(t,e,i,a,r,n){var l=null,s=t,c=Si,d=new Ji(s,!1);si(()=>{const u=e()||null;var p=u==="svg"?Os:null;if(u===null){d.ensure(null,null),Wa(!0);return}return d.ensure(u,f=>{var h=Si;if(dl(c),u){if(l=p?document.createElementNS(p,u):document.createElement(u),Ki(l,l),a){var m=l.appendChild(Lt());a(l,m)}ye.nodes_end=l,f.before(l)}dl(h)}),Wa(!0),()=>{u&&Wa(!1)}},zt),ha(()=>{Wa(!0)})}function Nt(t,e,i){Ei(()=>{var a=qt(()=>e(t,i==null?void 0:i())||{});if(i&&(a!=null&&a.update)){var r=!1,n={};Fa(()=>{var l=i();Fl(l),r&&$n(n,l)&&(n=l,a.update(l))}),r=!0}if(a!=null&&a.destroy)return()=>a.destroy()})}function Ka(t,e){var i=void 0,a;Tl(()=>{i!==(i=e())&&(a&&(Ke(a),a=null),i&&(a=rt(()=>{Ei(()=>i(t))})))})}function Gl(t){var e,i,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(i=Gl(t[e]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Cc(){for(var t,e,i=0,a="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=Gl(t))&&(a&&(a+=" "),a+=e);return a}function Ic(t){return typeof t=="object"?Cc(t):t??""}const Kl=[...`
3
3
  \r\f \v\uFEFF`];function jc(t,e,i){var a=t==null?"":""+t;if(e&&(a=a?a+" "+e:e),i){for(var r in i)if(i[r])a=a?a+" "+r:r;else if(a.length)for(var n=r.length,l=0;(l=a.indexOf(r,l))>=0;){var s=l+n;(l===0||Kl.includes(a[l-1]))&&(s===a.length||Kl.includes(a[s]))?a=(l===0?"":a.substring(0,l))+a.substring(s+1):l=s}}return a===""?null:a}function Yl(t,e=!1){var i=e?" !important;":";",a="";for(var r in t){var n=t[r];n!=null&&n!==""&&(a+=" "+r+": "+n+i)}return a}function Gr(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Ac(t,e){if(e){var i="",a,r;if(Array.isArray(e)?(a=e[0],r=e[1]):a=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var n=!1,l=0,s=!1,c=[];a&&c.push(...Object.keys(a).map(Gr)),r&&c.push(...Object.keys(r).map(Gr));var d=0,u=-1;const y=t.length;for(var p=0;p<y;p++){var f=t[p];if(s?f==="/"&&t[p-1]==="*"&&(s=!1):n?n===f&&(n=!1):f==="/"&&t[p+1]==="*"?s=!0:f==='"'||f==="'"?n=f:f==="("?l++:f===")"&&l--,!s&&n===!1&&l===0){if(f===":"&&u===-1)u=p;else if(f===";"||p===y-1){if(u!==-1){var h=Gr(t.substring(d,u).trim());if(!c.includes(h)){f!==";"&&p++;var m=t.substring(d,p).trim();i+=" "+m+";"}}d=p+1,u=-1}}}}return a&&(i+=Yl(a)),r&&(i+=Yl(r,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function ge(t,e,i,a,r,n){var l=t.__className;if(l!==i||l===void 0){var s=jc(i,a,n);s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s),t.__className=i}else if(n&&r!==n)for(var c in n){var d=!!n[c];(r==null||d!==!!r[c])&&t.classList.toggle(c,d)}return n}function Kr(t,e={},i,a){for(var r in i){var n=i[r];e[r]!==n&&(i[r]==null?t.style.removeProperty(r):t.style.setProperty(r,n,a))}}function Be(t,e,i,a){var r=t.__style;if(r!==e){var n=Ac(e,a);n==null?t.removeAttribute("style"):t.style.cssText=n,t.__style=e}else a&&(Array.isArray(a)?(Kr(t,i==null?void 0:i[0],a[0]),Kr(t,i==null?void 0:i[1],a[1],"important")):Kr(t,i,a));return a}function Yr(t,e,i=!1){if(t.multiple){if(e==null)return;if(!Le(e))return Rs();for(var a of t.options)a.selected=e.includes(Zl(a));return}for(a of t.options){var r=Zl(a);if(ic(r,e)){a.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Lc(t){var e=new MutationObserver(()=>{Yr(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ha(()=>{e.disconnect()})}function Zl(t){return"__value"in t?t.__value:t.value}const Xi=Symbol("class"),$i=Symbol("style"),Jl=Symbol("is custom element"),Ql=Symbol("is html");function Mc(t,e){var i=Zr(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function Dc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ie(t,e,i,a){var r=Zr(t);r[e]!==(r[e]=i)&&(e==="loading"&&(t[vs]=i),i==null?t.removeAttribute(e):typeof i!="string"&&eo(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function qc(t,e,i,a,r=!1,n=!1){var l=Zr(t),s=l[Jl],c=!l[Ql],d=e||{},u=t.tagName==="OPTION";for(var p in e)p in i||(i[p]=null);i.class?i.class=Ic(i.class):(a||i[Xi])&&(i.class=null),i[$i]&&(i.style??(i.style=null));var f=eo(t);for(const x in i){let P=i[x];if(u&&x==="value"&&P==null){t.value=t.__value="",d[x]=P;continue}if(x==="class"){var h=t.namespaceURI==="http://www.w3.org/1999/xhtml";ge(t,h,P,a,e==null?void 0:e[Xi],i[Xi]),d[x]=P,d[Xi]=i[Xi];continue}if(x==="style"){Be(t,P,e==null?void 0:e[$i],i[$i]),d[x]=P,d[$i]=i[$i];continue}var m=d[x];if(!(P===m&&!(P===void 0&&t.hasAttribute(x)))){d[x]=P;var y=x[0]+x[1];if(y!=="$$")if(y==="on"){const D={},E="$$"+x;let z=x.slice(2);var b=wc(z);if(yc(z)&&(z=z.slice(0,-7),D.capture=!0),!b&&m){if(P!=null)continue;t.removeEventListener(z,d[E],D),d[E]=null}if(P!=null)if(b)t[`__${z}`]=P,ce([z]);else{let N=function(A){d[x].call(this,A)};d[E]=Vr(z,t,N,D)}else b&&(t[`__${z}`]=void 0)}else if(x==="style")ie(t,x,P);else if(x==="autofocus")nc(t,!!P);else if(!s&&(x==="__value"||x==="value"&&P!=null))t.value=t.__value=P;else if(x==="selected"&&u)Dc(t,P);else{var g=x;c||(g=xc(g));var _=g==="defaultValue"||g==="defaultChecked";if(P==null&&!s&&!_)if(l[x]=null,g==="value"||g==="checked"){let D=t;const E=e===void 0;if(g==="value"){let z=D.defaultValue;D.removeAttribute(g),D.defaultValue=z,D.value=D.__value=E?z:null}else{let z=D.defaultChecked;D.removeAttribute(g),D.defaultChecked=z,D.checked=E?z:!1}}else t.removeAttribute(x);else _||f.includes(g)&&(s||typeof P!="string")?(t[g]=P,g in l&&(l[g]=Ve)):typeof P!="function"&&ie(t,g,P)}}}return d}function Xl(t,e,i=[],a=[],r=[],n,l=!1,s=!1){ul(r,i,a,c=>{var d=void 0,u={},p=t.nodeName==="SELECT",f=!1;if(Tl(()=>{var m=e(...c.map(o)),y=qc(t,d,m,n,l,s);f&&p&&"value"in m&&Yr(t,m.value);for(let g of Object.getOwnPropertySymbols(u))m[g]||Ke(u[g]);for(let g of Object.getOwnPropertySymbols(m)){var b=m[g];g.description===Ns&&(!d||b!==d[g])&&(u[g]&&Ke(u[g]),u[g]=rt(()=>Ka(t,()=>b))),y[g]=b}d=y}),p){var h=t;Ei(()=>{Yr(h,d.value,!0),Lc(h)})}f=!0})}function Zr(t){return t.__attributes??(t.__attributes={[Jl]:t.nodeName.includes("-"),[Ql]:t.namespaceURI===qs})}var $l=new Map;function eo(t){var e=t.getAttribute("is")||t.nodeName,i=$l.get(e);if(i)return i;$l.set(e,i=[]);for(var a,r=t,n=Element.prototype;n!==r;){a=Bn(r);for(var l in a)a[l].set&&i.push(l);r=Sr(r)}return i}const Oc=()=>performance.now(),$t={tick:t=>requestAnimationFrame(t),now:()=>Oc(),tasks:new Set};function to(){const t=$t.now();$t.tasks.forEach(e=>{e.c(t)||($t.tasks.delete(e),e.f())}),$t.tasks.size!==0&&$t.tick(to)}function Nc(t){let e;return $t.tasks.size===0&&$t.tick(to),{promise:new Promise(i=>{$t.tasks.add(e={c:t,f:i})}),abort(){$t.tasks.delete(e)}}}function Ya(t,e){Ti(()=>{t.dispatchEvent(new CustomEvent(e))})}function Rc(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function io(t){const e={},i=t.split(";");for(const a of i){const[r,n]=a.split(":");if(!r||n===void 0)break;const l=Rc(r.trim());e[l]=n.trim()}return e}const Bc=t=>t;function Fc(t,e,i){var a=Si,r,n,l,s=null;a.a??(a.a={element:t,measure(){r=this.element.getBoundingClientRect()},apply(){if(l==null||l.abort(),n=this.element.getBoundingClientRect(),r.left!==n.left||r.right!==n.right||r.top!==n.top||r.bottom!==n.bottom){const c=e()(this.element,{from:r,to:n},i==null?void 0:i());l=Za(this.element,c,void 0,1,()=>{l==null||l.abort(),l=void 0})}},fix(){if(!t.getAnimations().length){var{position:c,width:d,height:u}=getComputedStyle(t);if(c!=="absolute"&&c!=="fixed"){var p=t.style;s={position:p.position,width:p.width,height:p.height,transform:p.transform},p.position="absolute",p.width=d,p.height=u;var f=t.getBoundingClientRect();if(r.left!==f.left||r.top!==f.top){var h=`translate(${r.left-f.left}px, ${r.top-f.top}px)`;p.transform=p.transform?`${p.transform} ${h}`:h}}}},unfix(){if(s){var c=t.style;c.position=s.position,c.width=s.width,c.height=s.height,c.transform=s.transform}}}),a.a.element=t}function Ae(t,e,i,a){var r=(t&js)!==0,n=(t&As)!==0,l=r&&n,s=(t&Ls)!==0,c=l?"both":r?"in":"out",d,u=e.inert,p=e.style.overflow,f,h;function m(){return Ti(()=>d??(d=i()(e,(a==null?void 0:a())??{},{direction:c})))}var y={is_global:s,in(){var x;if(e.inert=u,!r){h==null||h.abort(),(x=h==null?void 0:h.reset)==null||x.call(h);return}n||f==null||f.abort(),Ya(e,"introstart"),f=Za(e,m(),h,1,()=>{Ya(e,"introend"),f==null||f.abort(),f=d=void 0,e.style.overflow=p})},out(x){if(!n){x==null||x(),d=void 0;return}e.inert=!0,Ya(e,"outrostart"),h=Za(e,m(),f,0,()=>{Ya(e,"outroend"),x==null||x()})},stop:()=>{f==null||f.abort(),h==null||h.abort()}},b=ye;if((b.transitions??(b.transitions=[])).push(y),r&&Ua){var g=s;if(!g){for(var _=b.parent;_&&_.f&zt;)for(;(_=_.parent)&&!(_.f&Pt););g=!_||(_.f&Oa)!==0}g&&Ei(()=>{qt(()=>y.in())})}}function Za(t,e,i,a,r){var n=a===1;if(Ni(e)){var l,s=!1;return Zt(()=>{if(!s){var b=e({direction:n?"in":"out"});l=Za(t,b,i,a,r)}}),{abort:()=>{s=!0,l==null||l.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(i==null||i.deactivate(),!(e!=null&&e.duration))return r(),{abort:pt,deactivate:pt,reset:pt,t:()=>a};const{delay:c=0,css:d,tick:u,easing:p=Bc}=e;var f=[];if(n&&i===void 0&&(u&&u(0,1),d)){var h=io(d(0,1));f.push(h,h)}var m=()=>1-a,y=t.animate(f,{duration:c,fill:"forwards"});return y.onfinish=()=>{y.cancel();var b=(i==null?void 0:i.t())??1-a;i==null||i.abort();var g=a-b,_=e.duration*Math.abs(g),x=[];if(_>0){var P=!1;if(d)for(var D=Math.ceil(_/16.666666666666668),E=0;E<=D;E+=1){var z=b+g*p(E/D),N=io(d(z,1-z));x.push(N),P||(P=N.overflow==="hidden")}P&&(t.style.overflow="hidden"),m=()=>{var A=y.currentTime;return b+g*p(A/_)},u&&Nc(()=>{if(y.playState!=="running")return!1;var A=m();return u(A,1-A),!0})}y=t.animate(x,{duration:_,fill:"forwards"}),y.onfinish=()=>{m=()=>a,u==null||u(a,1-a),r()}},{abort:()=>{y&&(y.cancel(),y.effect=null,y.onfinish=pt)},deactivate:()=>{r=pt},reset:()=>{a===0&&(u==null||u(1,0))},t:()=>m()}}function _a(t,e,i=e){var a=new WeakSet;sc(t,"input",async r=>{var n=r?t.defaultValue:t.value;if(n=Jr(t)?Qr(n):n,i(n),fe!==null&&a.add(fe),await ba(),n!==(n=e())){var l=t.selectionStart,s=t.selectionEnd,c=t.value.length;if(t.value=n??"",s!==null){var d=t.value.length;l===s&&s===c&&d>c?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=l,t.selectionEnd=Math.min(s,d))}}}),qt(e)==null&&t.value&&(i(Jr(t)?Qr(t.value):t.value),fe!==null&&a.add(fe)),Fa(()=>{var r=e();if(t===document.activeElement){var n=Ra??fe;if(a.has(n))return}Jr(t)&&r===Qr(t.value)||t.type==="date"&&!r&&!t.value||r!==t.value&&(t.value=r??"")})}function Jr(t){var e=t.type;return e==="number"||e==="range"}function Qr(t){return t===""?null:+t}const yr=class yr{constructor(e){oe(this,mr);oe(this,yi,new WeakMap);oe(this,oa);oe(this,Ia);ne(this,Ia,e)}observe(e,i){var a=L(this,yi).get(e)||new Set;return a.add(i),L(this,yi).set(e,a),ze(this,mr,ns).call(this).observe(e,L(this,Ia)),()=>{var r=L(this,yi).get(e);r.delete(i),r.size===0&&(L(this,yi).delete(e),L(this,oa).unobserve(e))}}};yi=new WeakMap,oa=new WeakMap,Ia=new WeakMap,mr=new WeakSet,ns=function(){return L(this,oa)??ne(this,oa,new ResizeObserver(e=>{for(var i of e){yr.entries.set(i.target,i);for(var a of L(this,yi).get(i.target)||[])a(i)}}))},Et(yr,"entries",new WeakMap);let Xr=yr;var Vc=new Xr({box:"border-box"});function Rt(t,e,i){var a=Vc.observe(t,()=>i(t[e]));Ei(()=>(qt(()=>i(t[e])),a))}function ao(t,e){return t===e||(t==null?void 0:t[Ct])===e}function et(t={},e,i,a){return Ei(()=>{var r,n;return Fa(()=>{r=n,n=[],qt(()=>{t!==i(...n)&&(e(t,...n),r&&ao(i(...r),t)&&e(null,...r))})}),()=>{Zt(()=>{n&&ao(i(...n),t)&&e(null,...n)})}}),t}function Ja(t,e){oc(window,["resize"],()=>Ti(()=>e(window[t])))}function ro(t=!1){const e=Se,i=e.l.u;if(!i)return;let a=()=>Fl(e.s);if(t){let r=0,n={};const l=pa(()=>{let s=!1;const c=e.s;for(const d in c)c[d]!==n[d]&&(n[d]=c[d],s=!0);return s&&r++,r});a=()=>o(l)}i.b.length&&dc(()=>{no(e,a),Tr(i.b)}),Ge(()=>{const r=qt(()=>i.m.map(ps));return()=>{for(const n of r)typeof n=="function"&&n()}}),i.a.length&&Ge(()=>{no(e,a),Tr(i.a)})}function no(t,e){if(t.l.s)for(const i of t.l.s)o(i);e()}let Qa=!1;function Hc(t){var e=Qa;try{return Qa=!1,[t(),Qa]}finally{Qa=e}}const Uc={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function lo(t,e,i){return new Proxy({props:t,exclude:e},Uc)}const Wc={get(t,e){let i=t.props.length;for(;i--;){let a=t.props[i];if(Ni(a)&&(a=a()),typeof a=="object"&&a!==null&&e in a)return a[e]}},set(t,e,i){let a=t.props.length;for(;a--;){let r=t.props[a];Ni(r)&&(r=r());const n=ri(r,e);if(n&&n.set)return n.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let a=t.props[i];if(Ni(a)&&(a=a()),typeof a=="object"&&a!==null&&e in a){const r=ri(a,e);return r&&!r.configurable&&(r.configurable=!0),r}}},has(t,e){if(e===Ct||e===Yn)return!1;for(let i of t.props)if(Ni(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){const e=[];for(let i of t.props)if(Ni(i)&&(i=i()),!!i){for(const a in i)e.includes(a)||e.push(a);for(const a of Object.getOwnPropertySymbols(i))e.includes(a)||e.push(a)}return e}};function $r(...t){return new Proxy({props:t},Wc)}function O(t,e,i,a){var x;var r=!Fi||(i&Ps)!==0,n=(i&Cs)!==0,l=(i&Is)!==0,s=a,c=!0,d=()=>(c&&(c=!1,s=l?qt(a):a),s),u;if(n){var p=Ct in t||Yn in t;u=((x=ri(t,e))==null?void 0:x.set)??(p&&e in t?P=>t[e]=P:void 0)}var f,h=!1;n?[f,h]=Hc(()=>t[e]):f=t[e],f===void 0&&a!==void 0&&(f=d(),u&&(r&&bs(),u(f)));var m;if(r?m=()=>{var P=t[e];return P===void 0?d():(c=!0,P)}:m=()=>{var P=t[e];return P!==void 0&&(s=void 0),P===void 0?s:P},r&&!(i&zs))return m;if(u){var y=t.$$legacy;return function(P,D){return arguments.length>0?((!r||!D||y||h)&&u(D?m():P),P):m()}}var b=!1,g=(i&Es?pa:Mr)(()=>(b=!1,m()));n&&o(g);var _=ye;return function(P,D){if(arguments.length>0){const E=D?o(g):r&&n?Ne(P):P;return q(g,E),b=!0,s!==void 0&&(s=E),P}return Pi&&b||_.f&Yt?g.v:o(g)}}function ct(t){Se===null&&Cr(),Fi&&Se.l!==null?Gc(Se).m.push(t):Ge(()=>{const e=qt(t);if(typeof e=="function")return e})}function en(t){Se===null&&Cr(),ct(()=>()=>qt(t))}function Gc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const Kc="5";typeof window<"u"&&((Xo=window.__svelte??(window.__svelte={})).v??(Xo.v=new Set)).add(Kc);function di(){var t;return(t=window.PlayPilotLinkInjections)==null?void 0:t.token}const Yc="https://www.playpilot.com",Zc="https://partner-api.playpilot.tech/1.0",Jc="https://img-external.playpilot.tech",Qc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",ui=600,tn={};async function ei(t,{headers:e={},method:i="GET",body:a=null}={}){const r=!Xa()&&i==="GET";if(r&&t in tn)return tn[t];const n=i==="GET"?{}:{"Content-Type":"application/json"},l=await fetch(Zc+t,{method:i,headers:new Headers({...n,...e}),body:a?JSON.stringify(a):null});if(!(l!=null&&l.ok))throw l;const s=await l.text();let c=s;try{s&&(c=JSON.parse(s))}catch{}return r&&(tn[t]=c),c}const oo="EncryptedToken",so="articleReplacementEditToken",Xc="playpilot-editorial-mode";async function co({href:t=window.location.href,throwError:e=!1}={}){try{const i=di();if(!i)throw new Error("No token was provided");const a=uo(t);if(!a)throw new Error("Could not be authenticated");return await ei(`/external-pages/edit-authorization?api-token=${i}`,{method:"POST",body:{private_token:a}}),$c(a),!0}catch(i){if(console.error(i),e)throw i}finally{ed()}return!1}function uo(t=""){var a,r;const e=(a=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:a.editorial_token;if(e)return e;if(t){const n=new URL(t).searchParams.get(so);if(n)return decodeURI(n)}return((r=("; "+document.cookie).split(`; ${oo}=`).pop())==null?void 0:r.split(";")[0])||""}function $c(t){const e=new Date;e.setTime(e.getTime()+30*24*60*60*1e3);const a="expires="+e.toUTCString();document.cookie=oo+"="+t+";"+a+";path=/"}function Xa(){var e;const t=(e=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:e.editorial_token;return new URLSearchParams(window.location.search).get(Xc)==="true"||!!t}function ed(){const t=new URL(window.location.href);t.searchParams.delete(so),window.history.replaceState({},"",t)}function td(t){let e=0;for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);e=e*31+a>>>0}return e.toString(16)}function an(t=5){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(;i.length<t;)i+=e[Math.floor(Math.random()*e.length)];return i}const v=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"});function $a(){var a,r;const t=(a=window.PlayPilotLinkInjections)==null?void 0:a.language,e=Object.values(v);if(t){if(e.includes(t))return t;console.warn(`PlayPilot Link Injections: ${t} is not an accepted language`)}const i=(r=document.querySelector("html"))==null?void 0:r.getAttribute("lang");if(i){if(e.includes(i))return i;const n=e.find(l=>l.toLowerCase().startsWith(i+"-"));if(n)return n}return v.English}function po(t,e=""){const i=[],a=[t];for(;a.length>0;){const r=a.pop();if(i.includes(r)||e&&r.matches(e)||/^(A|BUTTON|SCRIPT|NOSCRIPT|STYLE|IFRAME|FIGCAPTION|TIME|LABEL|BLOCKQUOTE|H1)$/.test(r.tagName)||r.offsetWidth<=1)continue;const n=Array.from(r.childNodes).some(c=>{var d;return c.nodeType===Node.TEXT_NODE&&((d=c.nodeValue)==null?void 0:d.trim())!==""});if(n&&r.tagName==="LI"){const c=r.closest("ul, ol");c&&!i.includes(c)&&i.push(c);continue}const l=r.tagName==="P"&&!!r.textContent;if(n||l){i.push(r);continue}const s=Array.from(r.children);for(let c=s.length-1;c>=0;c--)a.push(s[c])}return i}function rn(){var e;const t=(e=window.PlayPilotLinkInjections)==null?void 0:e.selector;if(t){const i=t.replace(/(:)/g,"\\$1"),a=document.querySelector(i);if(a)return a}return document.querySelector("article")||document.querySelector("main")||document.body}function nn(t){return t.map(e=>e.innerText).join(`
4
4
 
5
- `)}function ln(t){const e=rn(),i=po(e,(t==null?void 0:t.exclude_elements_selector)||""),a=nn(i);return{parentElement:e,elements:i,pageText:a}}function vo(){const t=rn();return{content_heading:id(t),content_modified_time:ad(t),content_published_time:rd(t)}}function id(t){const e=t.querySelector("h1")||document.querySelector("h1");return(e==null?void 0:e.innerText.trim())||null}function ad(t){const e=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||t.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,i=fo().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?on(i):null}function rd(t){const e=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||t.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||t.querySelector("time")||document.querySelector("time")||t.querySelector("[datetime]")||document.querySelector("[datetime]")||null,i=fo().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?on(i):null}function on(t){try{return new Date(t).toISOString()}catch{return null}}function fo(){const t=document.querySelector('[type="application/ld+json"]');if(!t)return{};try{return JSON.parse(t.textContent||"")}catch{return{}}}function zi(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function sn(t){return Object.entries(t).filter(([i,a])=>a!=null&&a!=="").map(([i,a])=>`${i}=${a}`).join("&")}function nd(t){return!!(t.exclude_urls_pattern&&zi().match(new RegExp(t.exclude_urls_pattern)))}let cn=null;async function er(t,{url:e=zi(),hash:i=td(t||""),params:a={},method:r="GET"}={}){const n=di(),l=Xa()?await co():!1,s=$a();if(!n)throw new Error("No token was provided");const c=`/external-pages/?api-token=${n}&include_title_details=true${l?"&editorial_mode_enabled=true":""}&language=${s}`;let d;return r==="POST"?(a.run_ai&&(a.hash=i,a.page_text=t),a.url=e,a.metadata=vo(),d=await ei(c,{method:"POST",body:a})):d=await ei(c+`&url=${e}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function ho(t,{requireCompletedResult:e=!1,runAiWhenRelevant:i=!1,pollInterval:a=3e3,maxTries:r=600,onpoll:n=()=>null}={}){let l=0;cn&&clearTimeout(cn);const s=async(c,d)=>{let u;try{try{u=await er(t)}catch(p){throw(p==null?void 0:p.status)===404&&(u=await er(t,{method:"POST"}),u.ai_enabled&&(u=await er(t,{params:{run_ai:!0},method:"POST"}))),new Error}if(u&&i&&(u=await ld(t,u)),e&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=go(u.manual_injections||[]),u.ai_injections=go(u.ai_injections||[]),c(u);return}catch{if(l++,l>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),c();return}u&&n(u),cn=setTimeout(()=>s(c),a)}};return new Promise(s)}async function ld(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=vo().content_modified_time,a=e.content_modified_time?on(e.content_modified_time):null,r=i&&a===i;return e.ai_last_run&&r||new Date(i||0)<=new Date(a||0)?e:await er(t,{params:{run_ai:!0},method:"POST"})}function go(t){return t.map(e=>({...e,key:od(e.sid)}))}function od(t){return t+"-"+an()}function sd(t,e,i){return t.filter(a=>i.every(r=>a[r]===e[r])).length}function cd(t,e){return e.some(i=>t>=i.start&&t<i.end)}function dd(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function dn(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function mo(t,e,i=[]){var n,l;const a=document.createTreeWalker(e);let r;for(;(r=a.nextNode())&&!((n=r.nodeValue)!=null&&n.includes(t)&&!i.includes(((l=r.parentNode)==null?void 0:l.nodeName)||"")););return r}function yo(t){const e=t.parentNode;return e?e.nodeName==="A"||!!e.closest("a"):!1}function ud(t,e,i,a){const r=dd(e),n=dn(e),l=t.slice(0,a),s=t.slice(a),c=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${n.replace(c,"\\$&")}|${r.replace(c,"\\$&")}`),u=s.replace(d,i);return l+u}function pd(t,e,i,a){return t.substring(0,i)+e+t.substring(a)}function pi(t){return dn(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function vd(t,e,i){const a=t.nodeType===Node.TEXT_NODE&&t.parentNode?t.parentElement:t;if(!a||!t.textContent)return{before:"",after:""};const r=Math.max(a.innerText.indexOf(t.textContent),0),n=bo(a.innerText.slice(0,e+r)),l=a.innerText.slice(i+r),s=bo(wo(n,2)),c=wo(l,2);return{before:s,after:c}}function bo(t){return t.split("").reverse().join("")}function wo(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function tr(t,e){let i=0,a=0;for(;(a=t.indexOf(e,a))!==-1;)i++,a+=e.length;return i}function fd(t,e,i){const a=[];let r=0;for(;r<=t.length;){const n=e?t.indexOf(e,r):r;if(n===-1&&e)break;const l=e?n+e.length:n,s=i?t.indexOf(i,l):t.length;if(i&&s===-1)break;const c=t.slice(l,s);a.push({match:c,index:l}),r=i?s+i.length:t.length+1}return a}function hd(t,e,i,a){const n=fd(t,i,a).filter(({match:s})=>dn(s).includes(e));return n.length?n.reduce((s,c)=>!s||c.match.length<s.match.length?c:s):null}function gd(t){var e,i;return{leadingSpaces:((e=t.match(/^\s*/))==null?void 0:e[0].length)||0,trailingSpaces:((i=t.match(/\s*$/))==null?void 0:i[0].length)||0}}function md(t,e,i=0){const a=e.innerHTML,r=[],n=yd(e);let l=a.indexOf(t);for(;l!==-1;)cd(l,n)&&r.push(l),l=a.indexOf(t,l+t.length);return r[i]??-1}function yd(t){const e=[],i=t.innerHTML;let a=!1,r=!1,n=!1,l=0;for(let s=0;s<i.length;s++){const c=i[s];if(!r&&!a&&c==="<"){a=!0,n&&(e.push({start:l,end:s}),n=!1);continue}if(a&&c==='"'&&(r=!r),a&&!r&&c===">"){a=!1;continue}!a&&!r&&!n&&(l=s,n=!0)}return!e.length&&t.textContent.length&&e.push({start:l,end:t.innerHTML.length}),e}function bd(t,e){const i=[" ",".",",","<",">"];try{const a=i.map(s=>"\\"+s).join(""),r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`([${a}])${r}([${a}])`),l=e.match(n);return l!=null&&l.index?l.index+1:-1}catch{return-1}}function _o(t){return t.ctrlKey||t.metaKey||t.button!==0}const de={ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",InjectionVisible:"ali_injection_visible",UserLeft:"ali_user_left",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",ParticipantModalView:"ali_participant_modal_view",ParticipantModalClose:"ali_participant_modal_close",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",SimilarTitleClick:"ali_similar_title_click",ParticipantClick:"ali_title_participant_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FailedInjectionsCount:"ali_failed_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error",TopScrollView:"ali_top_scroll_view",TopScrollClick:"ali_top_scroll_click",DisplayAdView:"ali_display_ad_view",DisplayAdClick:"ali_display_ad_click",DisplayedAdPlaylickClick:"ali_display_ad_playlink_click",AdsFetchFailed:"ali_ads_fetch_failed",SplitTestView:"ali_split_test_view",SplitTestAction:"ali_split_test_action",ShareTitle:"ali_share_title",SaveTitle:"ali_save_title",NotifyTitle:"ali_notify_title",TrailerClick:"ali_trailer_button_click",ExpandTitleDescription:"ali_expand_title_description",RegionRequestFailed:"ali_region_request_failed",YouTubeAvailabilityRequestFailed:"ali_youtube_availability_request_failed",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed"},xa={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest"};function wd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function xt(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function ir(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const un=[{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];function _d(t=[]){return t.map(e=>{var i;return((i=un.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const pn="playpilot_user_id";function xd(){if(!xo())return null;try{const t=localStorage.getItem(pn);return t||(localStorage.setItem(pn,an(16)),localStorage.getItem(pn))}catch{return null}}function xo(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)}const kd="https://insights.playpilot.net";async function ue(t,e=null,i={}){var r,n,l,s,c;if(ir())return;if(!xt("tracking")){Td(t,e,i);return}const a=new Headers({"Content-Type":"application/json"});e&&(i={original_title:e.original_title,title:e.title,title_sid:e.sid,title_type:e.type,genres:_d(e.genres),providers:[...new Set(((r=e.providers)==null?void 0:r.map(d=>d.name))||[])],...i}),xo()&&(i.user_id=xd()),i.version="8.4.0",i.time_since_initialize=(n=window.PlayPilotLinkInjections)!=null&&n.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=zi(),i.organization_sid=((l=window.PlayPilotLinkInjections)==null?void 0:l.organization_sid)||"undefined",i.domain_sid=((s=window.PlayPilotLinkInjections)==null?void 0:s.domain_sid)||"undefined",i.device={type:window.innerWidth>ui?"desktop":"mobile",width:window.innerWidth,height:window.innerHeight,touch:window.matchMedia("(pointer: coarse)").matches,orientation:((c=screen.orientation)==null?void 0:c.type)||"undefined"},fetch(kd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Sd({event:t,payload:i})}function Sd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function ko({organizationSid:t=null,domainSid:e=null}){window.PlayPilotLinkInjections.organization_sid=t||null,window.PlayPilotLinkInjections.domain_sid=e||null}function Td(t,e=null,i={}){var a;(a=window.PlayPilotLinkInjections).queued_tracking_events||(a.queued_tracking_events=[]),window.PlayPilotLinkInjections.queued_tracking_events.push({event:t,title:e,payload:i})}function Ed(){if(xt("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])ue(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}function So(){var t;return(t=window.PlayPilotLinkInjections.config)!=null&&t.allow_retargeting_pixels?xt("pixels"):!1}async function To(){if(!xt("ads"))return[];const t=di();if(!t)throw new Error("No token was provided");try{return await ei(`/ads/browse/?api-token=${t}`)}catch(e){throw ue(de.AdsFetchFailed,null,{status:e.status}),e}}function ka(t){var e;return!xt("ads")||window.PlayPilotLinkInjections.no_affiliate?null:(((e=window.PlayPilotLinkInjections)==null?void 0:e.ads)||[]).find(i=>i.campaign_format===t)||null}function Pd(t){return{sid:"",name:t.content.header||"",url:t.cta.url||"",logo_url:t.cta.image||"",highlighted:!0,cta_text:t.content.subheader,action_text:t.cta.header,slug:t.campaign_name,extra_info:{category:"SVOD"}}}async function vn(t=5e3){var i,a,r,n;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.region;if(e)return e;try{const s=await(await fetch("https://api.country.is/",{signal:AbortSignal.timeout(t)})).json();let c=(a=s==null?void 0:s.country)==null?void 0:a.toLowerCase();if(!c)throw new Error("No country was returned by api.country.is");return c==="gb"&&(c="uk"),zd(c),c}catch(l){return ue(de.RegionRequestFailed,null,{message:l.message}),((n=(r=window.PlayPilotLinkInjections)==null?void 0:r.config)==null?void 0:n.fallback_region)||""}}function zd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.region=t)}async function fn(t={}){const e=di();if(!e)throw new Error("No token was provided");return t={...t,language:$a(),include_count:"false"},t.region!==null&&(t.region=t.region||await vn()),await ei(`/titles/browse?api-token=${e}&`+sn(t))}async function Cd(t){return(await fn({related_to_sid:t.sid})).results}const Id=t=>t;function Eo(t){const e=t-1;return e*e*e+1}function Po(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function ti(t,{delay:e=0,duration:i=400,easing:a=Id}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:n=>`opacity: ${n*r}`}}function Sa(t,{delay:e=0,duration:i=400,easing:a=Eo,x:r=0,y:n=0,opacity:l=0}={}){const s=getComputedStyle(t),c=+s.opacity,d=s.transform==="none"?"":s.transform,u=c*(1-l),[p,f]=Po(r),[h,m]=Po(n);return{delay:e,duration:i,easing:a,css:(y,b)=>`
5
+ `)}function ln(t){const e=rn(),i=po(e,(t==null?void 0:t.exclude_elements_selector)||""),a=nn(i);return{parentElement:e,elements:i,pageText:a}}function vo(){const t=rn();return{content_heading:id(t),content_modified_time:ad(t),content_published_time:rd(t)}}function id(t){const e=t.querySelector("h1")||document.querySelector("h1");return(e==null?void 0:e.innerText.trim())||null}function ad(t){const e=document.querySelector('meta[property*="modified_time"]')||document.querySelector('meta[name*="modified_time"]')||t.querySelector('[itemprop="dateModified"]')||document.querySelector('[itemprop="dateModified"]')||null,i=fo().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?on(i):null}function rd(t){const e=document.querySelector('meta[property*="published_time"]')||document.querySelector('meta[name*="published_time"]')||t.querySelector('[itemprop="datePublished"]')||document.querySelector('[itemprop="datePublished"]')||t.querySelector("time")||document.querySelector("time")||t.querySelector("[datetime]")||document.querySelector("[datetime]")||null,i=fo().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?on(i):null}function on(t){try{return new Date(t).toISOString()}catch{return null}}function fo(){const t=document.querySelector('[type="application/ld+json"]');if(!t)return{};try{return JSON.parse(t.textContent||"")}catch{return{}}}function zi(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function sn(t){return Object.entries(t).filter(([i,a])=>a!=null&&a!=="").map(([i,a])=>`${i}=${a}`).join("&")}function nd(t){return!!(t.exclude_urls_pattern&&zi().match(new RegExp(t.exclude_urls_pattern)))}let cn=null;async function er(t,{url:e=zi(),hash:i=td(t||""),params:a={},method:r="GET"}={}){const n=di(),l=Xa()?await co():!1,s=$a();if(!n)throw new Error("No token was provided");const c=`/external-pages/?api-token=${n}&include_title_details=true${l?"&editorial_mode_enabled=true":""}&language=${s}`;let d;return r==="POST"?(a.run_ai&&(a.hash=i,a.page_text=t),a.url=e,a.metadata=vo(),d=await ei(c,{method:"POST",body:a})):d=await ei(c+`&url=${e}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function ho(t,{requireCompletedResult:e=!1,runAiWhenRelevant:i=!1,pollInterval:a=3e3,maxTries:r=600,onpoll:n=()=>null}={}){let l=0;cn&&clearTimeout(cn);const s=async(c,d)=>{let u;try{try{u=await er(t)}catch(p){throw(p==null?void 0:p.status)===404&&(u=await er(t,{method:"POST"}),u.ai_enabled&&(u=await er(t,{params:{run_ai:!0},method:"POST"}))),new Error}if(u&&i&&(u=await ld(t,u)),e&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=go(u.manual_injections||[]),u.ai_injections=go(u.ai_injections||[]),c(u);return}catch{if(l++,l>=r){r>1&&console.error("Max poll limit exceeded. Please return later."),c();return}u&&n(u),cn=setTimeout(()=>s(c),a)}};return new Promise(s)}async function ld(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=vo().content_modified_time,a=e.content_modified_time?on(e.content_modified_time):null,r=i&&a===i;return e.ai_last_run&&r||new Date(i||0)<=new Date(a||0)?e:await er(t,{params:{run_ai:!0},method:"POST"})}function go(t){return t.map(e=>({...e,key:od(e.sid)}))}function od(t){return t+"-"+an()}function sd(t,e,i){return t.filter(a=>i.every(r=>a[r]===e[r])).length}function cd(t,e){return e.some(i=>t>=i.start&&t<i.end)}function dd(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function dn(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function mo(t,e,i=[]){var n,l;const a=document.createTreeWalker(e);let r;for(;(r=a.nextNode())&&!((n=r.nodeValue)!=null&&n.includes(t)&&!i.includes(((l=r.parentNode)==null?void 0:l.nodeName)||"")););return r}function yo(t){const e=t.parentNode;return e?e.nodeName==="A"||!!e.closest("a"):!1}function ud(t,e,i,a){const r=dd(e),n=dn(e),l=t.slice(0,a),s=t.slice(a),c=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${n.replace(c,"\\$&")}|${r.replace(c,"\\$&")}`),u=s.replace(d,i);return l+u}function pd(t,e,i,a){return t.substring(0,i)+e+t.substring(a)}function pi(t){return dn(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function vd(t,e,i){const a=t.nodeType===Node.TEXT_NODE&&t.parentNode?t.parentElement:t;if(!a||!t.textContent)return{before:"",after:""};const r=Math.max(a.innerText.indexOf(t.textContent),0),n=bo(a.innerText.slice(0,e+r)),l=a.innerText.slice(i+r),s=bo(wo(n,2)),c=wo(l,2);return{before:s,after:c}}function bo(t){return t.split("").reverse().join("")}function wo(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function tr(t,e){let i=0,a=0;for(;(a=t.indexOf(e,a))!==-1;)i++,a+=e.length;return i}function fd(t,e,i){const a=[];let r=0;for(;r<=t.length;){const n=e?t.indexOf(e,r):r;if(n===-1&&e)break;const l=e?n+e.length:n,s=i?t.indexOf(i,l):t.length;if(i&&s===-1)break;const c=t.slice(l,s);a.push({match:c,index:l}),r=i?s+i.length:t.length+1}return a}function hd(t,e,i,a){const n=fd(t,i,a).filter(({match:s})=>dn(s).includes(e));return n.length?n.reduce((s,c)=>!s||c.match.length<s.match.length?c:s):null}function gd(t){var e,i;return{leadingSpaces:((e=t.match(/^\s*/))==null?void 0:e[0].length)||0,trailingSpaces:((i=t.match(/\s*$/))==null?void 0:i[0].length)||0}}function md(t,e,i=0){const a=e.innerHTML,r=[],n=yd(e);let l=a.indexOf(t);for(;l!==-1;)cd(l,n)&&r.push(l),l=a.indexOf(t,l+t.length);return r[i]??-1}function yd(t){const e=[],i=t.innerHTML;let a=!1,r=!1,n=!1,l=0;for(let s=0;s<i.length;s++){const c=i[s];if(!r&&!a&&c==="<"){a=!0,n&&(e.push({start:l,end:s}),n=!1);continue}if(a&&c==='"'&&(r=!r),a&&!r&&c===">"){a=!1;continue}!a&&!r&&!n&&(l=s,n=!0)}return!e.length&&t.textContent.length&&e.push({start:l,end:t.innerHTML.length}),e}function bd(t,e){const i=[" ",".",",","<",">"];try{const a=i.map(s=>"\\"+s).join(""),r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`([${a}])${r}([${a}])`),l=e.match(n);return l!=null&&l.index?l.index+1:-1}catch{return-1}}function _o(t){return t.ctrlKey||t.metaKey||t.button!==0}const de={ArticlePageView:"ali_article_page_view",ArticleInjected:"ali_links_injected",InjectionVisible:"ali_injection_visible",UserLeft:"ali_user_left",TitleModalView:"ali_title_modal_view",TitleModalClose:"ali_title_modal_close",TitleModalScroll:"ali_title_modal_scroll",TitleModalPlaylinkClick:"ali_title_modal_playlink_click",TitleModalSaveClick:"ali_title_modal_save_click",ParticipantModalView:"ali_participant_modal_view",ParticipantModalClose:"ali_participant_modal_close",TitlePopoverView:"ali_title_popover_view",TitlePopoverClose:"ali_title_popover_close",TitlePopoverSaveClick:"ali_title_popover_save_click",TitlePopoverPlaylinkClick:"ali_title_popover_playlink_click",SimilarTitleClick:"ali_similar_title_click",ParticipantClick:"ali_title_participant_click",AfterArticlePlaylinkClick:"ali_after_article_playlink_click",AfterArticleModalButtonClick:"ali_after_article_modal_button_click",InjectionFailed:"ali_injection_failed",TotalInjectionsCount:"ali_injection_count",FailedInjectionsCount:"ali_failed_injection_count",FetchingConfigFailed:"ali_fetch_config_failed",AuthFailed:"ali_auth_failed",ManualReport:"ali_manual_report",EditorError:"ali_editor_error",InjectionError:"ali_injection_error",TopScrollView:"ali_top_scroll_view",TopScrollClick:"ali_top_scroll_click",DisplayAdView:"ali_display_ad_view",DisplayAdClick:"ali_display_ad_click",DisplayedAdPlaylickClick:"ali_display_ad_playlink_click",AdsFetchFailed:"ali_ads_fetch_failed",SplitTestView:"ali_split_test_view",SplitTestAction:"ali_split_test_action",ShareTitle:"ali_share_title",SaveTitle:"ali_save_title",NotifyTitle:"ali_notify_title",TrailerClick:"ali_trailer_button_click",ExpandTitleDescription:"ali_expand_title_description",RegionRequestFailed:"ali_region_request_failed",YouTubeAvailabilityRequestFailed:"ali_youtube_availability_request_failed",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed"},xa={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest"};function wd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function xt(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function ir(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const un=[{slug:"999",name:"Unscripted",categories:{},media_format:"video"},{slug:"900",name:"Independent",categories:{},media_format:"video"},{slug:"113",name:"Game Show",categories:{series:36,kids:28},media_format:"video"},{slug:"112",name:"Film Noir",categories:{movie:37},media_format:"video"},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42},media_format:"video"},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38},media_format:"video"},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36},media_format:"video"},{slug:"902",name:"Bollywood",categories:{},media_format:"video"},{slug:"240",name:"Concert",categories:{movie:45},media_format:"video"},{slug:"901",name:"Arthouse",categories:{},media_format:"video"},{slug:"903",name:"Alternate Version",categories:{},media_format:"video"},{slug:"121",name:"Reality TV",categories:{series:24},media_format:"video"},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44},media_format:"video"},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44},media_format:"video"},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84},media_format:"video"},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24},media_format:"video"},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70},media_format:"video"},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50},media_format:"video"},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76},media_format:"video"},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74},media_format:"video"},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28},media_format:"video"},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66},media_format:"video"},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32},media_format:"video"},{slug:"106",name:"Documentary",categories:{kids:50},media_format:"video"},{slug:"232",name:"Stand-up",categories:{movie:18,series:18},media_format:"video"},{slug:"126",name:"Talk Show",categories:{kids:34,series:16},media_format:"video"},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38},media_format:"video"},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90},media_format:"video"},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88},media_format:"video"},{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90},media_format:"video"},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80},media_format:"video"},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86},media_format:"video"},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46},media_format:"video"},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32},media_format:"video"},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20},media_format:"video"},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74},media_format:"video"},{slug:"103",name:"Kids",categories:{kids:76},media_format:"video"},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34},media_format:"video"},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30},media_format:"video"},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48},media_format:"video"},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40},media_format:"video"}];function _d(t=[]){return t.map(e=>{var i;return((i=un.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const pn="playpilot_user_id";function xd(){if(!xo())return null;try{const t=localStorage.getItem(pn);return t||(localStorage.setItem(pn,an(16)),localStorage.getItem(pn))}catch{return null}}function xo(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)}const kd="https://insights.playpilot.net";async function ue(t,e=null,i={}){var r,n,l,s,c;if(ir())return;if(!xt("tracking")){Td(t,e,i);return}const a=new Headers({"Content-Type":"application/json"});e&&(i={original_title:e.original_title,title:e.title,title_sid:e.sid,title_type:e.type,genres:_d(e.genres),providers:[...new Set(((r=e.providers)==null?void 0:r.map(d=>d.name))||[])],...i}),xo()&&(i.user_id=xd()),i.version="8.4.1",i.time_since_initialize=(n=window.PlayPilotLinkInjections)!=null&&n.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=zi(),i.organization_sid=((l=window.PlayPilotLinkInjections)==null?void 0:l.organization_sid)||"undefined",i.domain_sid=((s=window.PlayPilotLinkInjections)==null?void 0:s.domain_sid)||"undefined",i.device={type:window.innerWidth>ui?"desktop":"mobile",width:window.innerWidth,height:window.innerHeight,touch:window.matchMedia("(pointer: coarse)").matches,orientation:((c=screen.orientation)==null?void 0:c.type)||"undefined"},fetch(kd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Sd({event:t,payload:i})}function Sd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function ko({organizationSid:t=null,domainSid:e=null}){window.PlayPilotLinkInjections.organization_sid=t||null,window.PlayPilotLinkInjections.domain_sid=e||null}function Td(t,e=null,i={}){var a;(a=window.PlayPilotLinkInjections).queued_tracking_events||(a.queued_tracking_events=[]),window.PlayPilotLinkInjections.queued_tracking_events.push({event:t,title:e,payload:i})}function Ed(){if(xt("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])ue(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}function So(){var t;return(t=window.PlayPilotLinkInjections.config)!=null&&t.allow_retargeting_pixels?xt("pixels"):!1}async function To(){if(!xt("ads"))return[];const t=di();if(!t)throw new Error("No token was provided");try{return await ei(`/ads/browse/?api-token=${t}`)}catch(e){throw ue(de.AdsFetchFailed,null,{status:e.status}),e}}function ka(t){var e;return!xt("ads")||window.PlayPilotLinkInjections.no_affiliate?null:(((e=window.PlayPilotLinkInjections)==null?void 0:e.ads)||[]).find(i=>i.campaign_format===t)||null}function Pd(t){return{sid:"",name:t.content.header||"",url:t.cta.url||"",logo_url:t.cta.image||"",highlighted:!0,cta_text:t.content.subheader,action_text:t.cta.header,slug:t.campaign_name,extra_info:{category:"SVOD"}}}async function vn(t=5e3){var i,a,r,n;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.region;if(e)return e;try{const s=await(await fetch("https://api.country.is/",{signal:AbortSignal.timeout(t)})).json();let c=(a=s==null?void 0:s.country)==null?void 0:a.toLowerCase();if(!c)throw new Error("No country was returned by api.country.is");return c==="gb"&&(c="uk"),zd(c),c}catch(l){return ue(de.RegionRequestFailed,null,{message:l.message}),((n=(r=window.PlayPilotLinkInjections)==null?void 0:r.config)==null?void 0:n.fallback_region)||""}}function zd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.region=t)}async function fn(t={}){const e=di();if(!e)throw new Error("No token was provided");return t={...t,language:$a(),include_count:"false"},t.region!==null&&(t.region=t.region||await vn()),await ei(`/titles/browse?api-token=${e}&`+sn(t))}async function Cd(t){return(await fn({related_to_sid:t.sid})).results}const Id=t=>t;function Eo(t){const e=t-1;return e*e*e+1}function Po(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function ti(t,{delay:e=0,duration:i=400,easing:a=Id}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:n=>`opacity: ${n*r}`}}function Sa(t,{delay:e=0,duration:i=400,easing:a=Eo,x:r=0,y:n=0,opacity:l=0}={}){const s=getComputedStyle(t),c=+s.opacity,d=s.transform==="none"?"":s.transform,u=c*(1-l),[p,f]=Po(r),[h,m]=Po(n);return{delay:e,duration:i,easing:a,css:(y,b)=>`
6
6
  transform: ${d} translate(${(1-y)*p}${f}, ${(1-y)*h}${m});
7
7
  opacity: ${c-u*b}`}}function ea(t,{delay:e=0,duration:i=400,easing:a=Eo,start:r=0,opacity:n=0}={}){const l=getComputedStyle(t),s=+l.opacity,c=l.transform==="none"?"":l.transform,d=1-r,u=s*(1-n);return{delay:e,duration:i,easing:a,css:(p,f)=>`
8
8
  transform: ${c} scale(${1-d*f});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.4.0",
3
+ "version": "8.4.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
Binary file