@playpilot/tpi 8.10.4-beta.2 → 8.10.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorial.mount.js +1 -1
- package/dist/link-injections.js +2 -2
- package/dist/mount.js +1 -1
- package/package.json +1 -1
- package/src/lib/api/externalPages.ts +9 -9
- package/src/lib/injectionElements.ts +2 -2
- package/src/tests/lib/api/externalPages.test.js +44 -22
- package/src/tests/main.test.js +0 -1
- package/src/tests/routes/+page.test.js +4 -4
package/dist/editorial.mount.js
CHANGED
|
@@ -2,7 +2,7 @@ var nm=Object.defineProperty;var qs=De=>{throw TypeError(De)};var rm=(De,Ne,We)=
|
|
|
2
2
|
/*$vite$:1*/`,document.head.appendChild(De);const Ne=!1;var We=Array.isArray,ln=Array.prototype.indexOf,Qn=Array.from,Fs=Object.defineProperty,yi=Object.getOwnPropertyDescriptor,hl=Object.getOwnPropertyDescriptors,Hs=Object.prototype,Vs=Array.prototype,Xn=Object.getPrototypeOf,gl=Object.isExtensible;function Xi(t){return typeof t=="function"}const bt=()=>{};function Us(t){return typeof(t==null?void 0:t.then)=="function"}function Ws(t){return t()}function $n(t){for(var e=0;e<t.length;e++)t[e]()}function ml(){var t,e,i=new Promise((a,n)=>{t=a,e=n});return{promise:i,resolve:t,reject:e}}function on(t,e,i=!1){return t===void 0?i?e():e:t}function $i(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 nt=2,er=4,sn=8,yl=1<<24,Ht=16,ri=32,zi=64,cn=128,At=512,lt=1024,ut=2048,li=4096,ht=8192,oi=16384,dn=32768,Vt=65536,bl=1<<17,tr=1<<18,ea=1<<19,_l=1<<20,ja=32768,ir=1<<21,ar=1<<22,bi=1<<23,Ut=Symbol("$state"),xl=Symbol("legacy props"),Gs=Symbol(""),ta=new class extends Error{constructor(){super(...arguments);Ft(this,"name","StaleReactionError");Ft(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function nr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Ks(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Ys(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zs(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Js(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Qs(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Xs(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function $s(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ec(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function tc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ic(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const wl=1,kl=2,Sl=4,ac=8,nc=16,rc=1,lc=2,oc=4,sc=8,cc=16,dc=1,uc=2,vc=4,pc=1,fc=2,$e=Symbol(),hc="http://www.w3.org/1999/xhtml",gc="http://www.w3.org/2000/svg",mc="@attach";function yc(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function bc(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Tl(t){return t===this.v}function El(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Pl(t){return!El(t,this.v)}let ia=!1,_c=!1;function xc(){ia=!0}let Me=null;function aa(t){Me=t}function rr(t){return Cl().get(t)}function lr(t,e){return Cl().set(t,e),e}function re(t,e=!1,i){Me={p:Me,i:!1,c:null,e:null,s:t,x:null,l:ia&&!e?{s:null,u:null,$:[]}:null}}function le(t){var e=Me,i=e.e;if(i!==null){e.e=null;for(var a of i)$l(a)}return t!==void 0&&(e.x=t),e.i=!0,Me=e.p,t??{}}function Ai(){return!ia||Me!==null&&Me.l===null}function Cl(t){return Me===null&&nr(),Me.c??(Me.c=new Map(wc(Me)||void 0))}function wc(t){let e=t.p;for(;e!==null;){const i=e.c;if(i!==null)return i;e=e.p}return null}let Li=[];function Il(){var t=Li;Li=[],$n(t)}function si(t){if(Li.length===0&&!ra){var e=Li;queueMicrotask(()=>{e===Li&&Il()})}Li.push(t)}function kc(){for(;Li.length>0;)Il()}function jl(t){var e=Ce;if(e===null)return Pe.f|=bi,t;if(e.f&dn)na(t,e);else{if(!(e.f&cn))throw t;e.b.error(t)}}function na(t,e){for(;e!==null;){if(e.f&cn)try{e.b.error(t);return}catch(i){t=i}e=e.parent}throw t}const un=new Set;let ke=null,za=null,Ye=null,_t=[],vn=null,or=!1,ra=!1;const Fn=class Fn{constructor(){_e(this,Xe);Ft(this,"committed",!1);Ft(this,"current",new Map);Ft(this,"previous",new Map);_e(this,xa,new Set);_e(this,wa,new Set);_e(this,Wi,0);_e(this,Gi,0);_e(this,$a,null);_e(this,ka,[]);_e(this,Sa,[]);Ft(this,"skipped_effects",new Set);Ft(this,"is_fork",!1)}is_deferred(){return this.is_fork||H(this,Gi)>0}process(e){var a;_t=[],za=null,this.apply();var i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const n of e)Oe(this,Xe,ul).call(this,n,i);this.is_fork||Oe(this,Xe,Ds).call(this),this.is_deferred()?(Oe(this,Xe,Qi).call(this,i.effects),Oe(this,Xe,Qi).call(this,i.render_effects),Oe(this,Xe,Qi).call(this,i.block_effects)):(za=this,ke=null,Ll(i.render_effects),Ll(i.effects),za=null,(a=H(this,$a))==null||a.resolve()),Ye=null}capture(e,i){this.previous.has(e)||this.previous.set(e,i),e.f&bi||(this.current.set(e,e.v),Ye==null||Ye.set(e,e.v))}activate(){ke=this,this.apply()}deactivate(){ke===this&&(ke=null,Ye=null)}flush(){if(this.activate(),_t.length>0){if(Al(),ke!==null&&ke!==this)return}else H(this,Wi)===0&&this.process([]);this.deactivate()}discard(){for(const e of H(this,wa))e(this);H(this,wa).clear()}increment(e){ye(this,Wi,H(this,Wi)+1),e&&ye(this,Gi,H(this,Gi)+1)}decrement(e){ye(this,Wi,H(this,Wi)-1),e&&ye(this,Gi,H(this,Gi)-1),this.revive()}revive(){for(const e of H(this,ka))ot(e,ut),Mi(e);for(const e of H(this,Sa))ot(e,li),Mi(e);ye(this,ka,[]),ye(this,Sa,[]),this.flush()}oncommit(e){H(this,xa).add(e)}ondiscard(e){H(this,wa).add(e)}settled(){return(H(this,$a)??ye(this,$a,ml())).promise}static ensure(){if(ke===null){const e=ke=new Fn;un.add(ke),ra||Fn.enqueue(()=>{ke===e&&e.flush()})}return ke}static enqueue(e){si(e)}apply(){}};xa=new WeakMap,wa=new WeakMap,Wi=new WeakMap,Gi=new WeakMap,$a=new WeakMap,ka=new WeakMap,Sa=new WeakMap,Xe=new WeakSet,ul=function(e,i){var u;e.f^=lt;for(var a=e.first;a!==null;){var n=a.f,r=(n&(ri|zi))!==0,o=r&&(n<)!==0,s=o||(n&ht)!==0||this.skipped_effects.has(a);if(a.f&cn&&((u=a.b)!=null&&u.is_pending())&&(i={parent:i,effect:a,effects:[],render_effects:[],block_effects:[]}),!s&&a.fn!==null){r?a.f^=lt:n&er?i.effects.push(a):Ra(a)&&(a.f&Ht&&i.block_effects.push(a),Oa(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&&(Oe(this,Xe,Qi).call(this,i.effects),Oe(this,Xe,Qi).call(this,i.render_effects),Oe(this,Xe,Qi).call(this,i.block_effects),i=i.parent),a=d.next,d=d.parent}},Qi=function(e){for(const i of e)(i.f&ut?H(this,ka):H(this,Sa)).push(i),Oe(this,Xe,vl).call(this,i.deps),ot(i,lt)},vl=function(e){if(e!==null)for(const i of e)!(i.f&nt)||!(i.f&ja)||(i.f^=ja,Oe(this,Xe,vl).call(this,i.deps))},Ds=function(){if(H(this,Gi)===0){for(const e of H(this,xa))e();H(this,xa).clear()}H(this,Wi)===0&&Oe(this,Xe,Ns).call(this)},Ns=function(){var r;if(un.size>1){this.previous.clear();var e=Ye,i=!0,a={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const o of un){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)Ml(v,c,d,u);if(_t.length>0){ke=o,o.apply();for(const v of _t)Oe(r=o,Xe,ul).call(r,v,a);o.deactivate()}_t=n}}ke=null,Ye=e}this.committed=!0,un.delete(this)};let Wt=Fn;function zl(t){var e=ra;ra=!0;try{for(var i;;){if(kc(),_t.length===0&&(ke==null||ke.flush(),_t.length===0))return vn=null,i;Al()}}finally{ra=e}}function Al(){var t=ki;or=!0;var e=null;try{var i=0;for(fn(!0);_t.length>0;){var a=Wt.ensure();if(i++>1e3){var n,r;Sc()}a.process(_t),_i.clear()}}finally{or=!1,fn(t),vn=null}}function Sc(){try{Qs()}catch(t){na(t,vn)}}let Lt=null;function Ll(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var a=t[i++];if(!(a.f&(oi|ht))&&Ra(a)&&(Lt=new Set,Oa(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?no(a):a.fn=null),(Lt==null?void 0:Lt.size)>0)){_i.clear();for(const n of Lt){if(n.f&(oi|ht))continue;const r=[n];let o=n.parent;for(;o!==null;)Lt.has(o)&&(Lt.delete(o),r.push(o)),o=o.parent;for(let s=r.length-1;s>=0;s--){const c=r[s];c.f&(oi|ht)||Oa(c)}}Lt.clear()}}Lt=null}}function Ml(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&nt?Ml(n,e,i,a):r&(ar|Ht)&&!(r&ut)&&ql(n,e,a)&&(ot(n,ut),Mi(n))}}function ql(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&nt&&ql(n,e,i))return i.set(n,!0),!0}return i.set(t,!1),!1}function Mi(t){for(var e=vn=t;e.parent!==null;){e=e.parent;var i=e.f;if(or&&e===Ce&&i&Ht&&!(i&tr))return;if(i&(zi|ri)){if(!(i<))return;e.f^=lt}}_t.push(e)}function Dl(t){let e=0,i=Kt(0),a;return()=>{qa()&&(l(i),pn(()=>(e===0&&(a=wt(()=>t(()=>xi(i)))),e+=1,()=>{si(()=>{e-=1,e===0&&(a==null||a(),a=void 0,xi(i))})})))}}var Tc=Vt|ea|cn;function Nl(t,e,i){new Ec(t,e,i)}class Ec{constructor(e,i,a){_e(this,et);Ft(this,"parent");_e(this,Et,!1);_e(this,Pt);_e(this,cl,null);_e(this,ei);_e(this,Ki);_e(this,ti);_e(this,Ct,null);_e(this,ft,null);_e(this,ii,null);_e(this,gi,null);_e(this,Ei,null);_e(this,Yi,0);_e(this,Pi,0);_e(this,Zi,!1);_e(this,Ci,null);_e(this,Hn,Dl(()=>(ye(this,Ci,Kt(H(this,Yi))),()=>{ye(this,Ci,null)})));ye(this,Pt,e),ye(this,ei,i),ye(this,Ki,a),this.parent=Ce.b,ye(this,Et,!!H(this,ei).pending),ye(this,ti,di(()=>{Ce.b=this;{var n=Oe(this,et,pl).call(this);try{ye(this,Ct,vt(()=>a(n)))}catch(r){this.error(r)}H(this,Pi)>0?Oe(this,et,Jn).call(this):ye(this,Et,!1)}return()=>{var r;(r=H(this,Ei))==null||r.remove()}},Tc))}is_pending(){return H(this,Et)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!H(this,ei).pending}update_pending_count(e){Oe(this,et,fl).call(this,e),ye(this,Yi,H(this,Yi)+e),H(this,Ci)&&ci(H(this,Ci),H(this,Yi))}get_effect_pending(){return H(this,Hn).call(this),l(H(this,Ci))}error(e){var i=H(this,ei).onerror;let a=H(this,ei).failed;if(H(this,Zi)||!i&&!a)throw e;H(this,Ct)&&(rt(H(this,Ct)),ye(this,Ct,null)),H(this,ft)&&(rt(H(this,ft)),ye(this,ft,null)),H(this,ii)&&(rt(H(this,ii)),ye(this,ii,null));var n=!1,r=!1;const o=()=>{if(n){bc();return}n=!0,r&&ic(),Wt.ensure(),ye(this,Yi,0),H(this,ii)!==null&&la(H(this,ii),()=>{ye(this,ii,null)}),ye(this,Et,this.has_pending_snippet()),ye(this,Ct,Oe(this,et,Zn).call(this,()=>(ye(this,Zi,!1),vt(()=>H(this,Ki).call(this,H(this,Pt)))))),H(this,Pi)>0?Oe(this,et,Jn).call(this):ye(this,Et,!1)};var s=Pe;try{pt(null),r=!0,i==null||i(e,o),r=!1}catch(c){na(c,H(this,ti)&&H(this,ti).parent)}finally{pt(s)}a&&si(()=>{ye(this,ii,Oe(this,et,Zn).call(this,()=>{Wt.ensure(),ye(this,Zi,!0);try{return vt(()=>{a(H(this,Pt),()=>e,()=>o)})}catch(c){return na(c,H(this,ti).parent),null}finally{ye(this,Zi,!1)}}))})}}Et=new WeakMap,Pt=new WeakMap,cl=new WeakMap,ei=new WeakMap,Ki=new WeakMap,ti=new WeakMap,Ct=new WeakMap,ft=new WeakMap,ii=new WeakMap,gi=new WeakMap,Ei=new WeakMap,Yi=new WeakMap,Pi=new WeakMap,Zi=new WeakMap,Ci=new WeakMap,Hn=new WeakMap,et=new WeakSet,lm=function(){try{ye(this,Ct,vt(()=>H(this,Ki).call(this,H(this,Pt))))}catch(e){this.error(e)}ye(this,Et,!1)},om=function(){const e=H(this,ei).pending;e&&(ye(this,ft,vt(()=>e(H(this,Pt)))),Wt.enqueue(()=>{var i=Oe(this,et,pl).call(this);ye(this,Ct,Oe(this,et,Zn).call(this,()=>(Wt.ensure(),vt(()=>H(this,Ki).call(this,i))))),H(this,Pi)>0?Oe(this,et,Jn).call(this):(la(H(this,ft),()=>{ye(this,ft,null)}),ye(this,Et,!1))}))},pl=function(){var e=H(this,Pt);return H(this,Et)&&(ye(this,Ei,Mt()),H(this,Pt).before(H(this,Ei)),e=H(this,Ei)),e},Zn=function(e){var i=Ce,a=Pe,n=Me;Jt(H(this,ti)),pt(H(this,ti)),aa(H(this,ti).ctx);try{return e()}catch(r){return jl(r),null}finally{Jt(i),pt(a),aa(n)}},Jn=function(){const e=H(this,ei).pending;H(this,Ct)!==null&&(ye(this,gi,document.createDocumentFragment()),H(this,gi).append(H(this,Ei)),oo(H(this,Ct),H(this,gi))),H(this,ft)===null&&ye(this,ft,vt(()=>e(H(this,Pt))))},fl=function(e){var i;if(!this.has_pending_snippet()){this.parent&&Oe(i=this.parent,et,fl).call(i,e);return}ye(this,Pi,H(this,Pi)+e),H(this,Pi)===0&&(ye(this,Et,!1),H(this,ft)&&la(H(this,ft),()=>{ye(this,ft,null)}),H(this,gi)&&(H(this,Pt).before(H(this,gi)),ye(this,gi,null)))};let qi=null;function Rl(t){qi=t}function qe(t,e){return e}function Pc(t,e,i){for(var a=[],n=e.length,r=0;r<n;r++)pr(e[r].e,a,!0);ro(a,()=>{var o=a.length===0&&i!==null;if(o){var s=i,c=s.parentNode;qc(c),c.append(s),t.items.clear(),Gt(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),Gt(t,u.prev,u.next)),rt(u.e,!o)}t.first===e[0]&&(t.first=e[0].prev)})}function Ae(t,e,i,a,n,r=null){var o=t,s=new Map,c=null,d=(e&Sl)!==0,u=(e&wl)!==0,v=(e&kl)!==0;if(d){var p=t;o=p.appendChild(Mt())}var f=null,b=cr(()=>{var C=i();return We(C)?C:C==null?[]:Qn(C)}),h,_=!0;function m(){Cc(w,h,o,e,a),f!==null&&(h.length===0?(f.fragment?(o.before(f.fragment),f.fragment=null):fr(f.effect),E.first=f.effect):la(f.effect,()=>{f=null}))}var E=di(()=>{h=l(b);for(var C=h.length,A=new Set,I=ke,k=null,F=Zl(),L=0;L<C;L+=1){var j=h[L],T=a(j,L),z=_?null:s.get(T);z?(u&&ci(z.v,j),v?ci(z.i,L):z.i=L,F&&I.skipped_effects.delete(z.e)):(z=Ic(_?o:null,k,j,T,L,n,e,i),_&&(z.o=!0,k===null?c=z:k.next=z,k=z),s.set(T,z)),A.add(T)}if(C===0&&r&&!f)if(_)f={fragment:null,effect:vt(()=>r(o))};else{var O=document.createDocumentFragment(),N=Mt();O.append(N),f={fragment:O,effect:vt(()=>r(N))}}if(!_)if(F){for(const[W,Y]of s)A.has(W)||I.skipped_effects.add(Y.e);I.oncommit(m),I.ondiscard(()=>{})}else m();l(b)}),w={effect:E,flags:e,items:s,first:c};_=!1}function Cc(t,e,i,a,n){var j,T,z,O;var r=(a&ac)!==0,o=e.length,s=t.items,c=t.first,d,u=null,v,p=[],f=[],b,h,_,m;if(r)for(m=0;m<o;m+=1)b=e[m],h=n(b,m),_=s.get(h),_.o&&((j=_.a)==null||j.measure(),(v??(v=new Set)).add(_));for(m=0;m<o;m+=1){if(b=e[m],h=n(b,m),_=s.get(h),t.first??(t.first=_),!_.o){_.o=!0;var E=u?u.next:c;Gt(t,u,_),Gt(t,_,E),sr(_,E,i),u=_,p=[],f=[],c=u.next;continue}if(_.e.f&ht&&(fr(_.e),r&&((T=_.a)==null||T.unfix(),(v??(v=new Set)).delete(_))),_!==c){if(d!==void 0&&d.has(_)){if(p.length<f.length){var w=f[0],C;u=w.prev;var A=p[0],I=p[p.length-1];for(C=0;C<p.length;C+=1)sr(p[C],w,i);for(C=0;C<f.length;C+=1)d.delete(f[C]);Gt(t,A.prev,I.next),Gt(t,u,A),Gt(t,I,w),c=w,u=I,m-=1,p=[],f=[]}else d.delete(_),sr(_,c,i),Gt(t,_.prev,_.next),Gt(t,_,u===null?t.first:u.next),Gt(t,u,_),u=_;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;_=c}p.push(_),u=_,c=_.next}if(c!==null||d!==void 0){for(var k=d===void 0?[]:Qn(d);c!==null;)c.e.f&ht||k.push(c),c=c.next;var F=k.length;if(F>0){var L=a&Sl&&o===0?i:null;if(r){for(m=0;m<F;m+=1)(z=k[m].a)==null||z.measure();for(m=0;m<F;m+=1)(O=k[m].a)==null||O.fix()}Pc(t,k,L)}}r&&si(()=>{var N;if(v!==void 0)for(_ of v)(N=_.a)==null||N.apply()})}function Ic(t,e,i,a,n,r,o,s){var c=qi,d=(o&wl)!==0,u=(o&nc)===0,v=d?u?vr(i,!1,!1):Kt(i):i,p=o&kl?Kt(n):n,f={i:p,v,k:a,a:null,e:null,o:!1,prev:e,next:null};qi=f;try{if(t===null){var b=document.createDocumentFragment();b.append(t=Mt())}return f.e=vt(()=>r(t,v,p,s)),e!==null&&(e.next=f),f}finally{qi=c}}function sr(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=Ma(r);n.before(r),r=o}}function Gt(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 Ol(t,e,i,a){const n=Ai()?La:cr;if(i.length===0&&t.length===0){a(e.map(n));return}var r=ke,o=Ce,s=Bl();function c(){Promise.all(i.map(d=>jc(d))).then(d=>{s();try{a([...e.map(n),...d])}catch(u){o.f&oi||na(u,o)}r==null||r.deactivate(),Aa()}).catch(d=>{na(d,o)})}t.length>0?Promise.all(t).then(()=>{s();try{return c()}finally{r==null||r.deactivate(),Aa()}}):c()}function Bl(){var t=Ce,e=Pe,i=Me,a=ke;return function(r=!0){Jt(t),pt(e),aa(i),r&&(a==null||a.activate())}}function Aa(){Jt(null),pt(null),aa(null)}function La(t){var e=nt|ut,i=Pe!==null&&Pe.f&nt?Pe:null;return Ce!==null&&(Ce.f|=ea),{ctx:Me,deps:null,effects:null,equals:Tl,f:e,fn:t,reactions:null,rv:0,v:$e,wv:0,parent:i??Ce,ac:null}}function jc(t,e){let i=Ce;i===null&&Ks();var a=i.b,n=void 0,r=Kt($e),o=!Pe,s=new Map;return Hc(()=>{var p;var c=ml();n=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{d===ke&&d.committed&&d.deactivate(),Aa()})}catch(f){c.reject(f),Aa()}var d=ke;if(o){var u=!a.is_pending();a.update_pending_count(1),d.increment(u),(p=s.get(d))==null||p.reject(ta),s.delete(d),s.set(d,c)}const v=(f,b=void 0)=>{if(d.activate(),b)b!==ta&&(r.f|=bi,ci(r,b));else{r.f&bi&&(r.f^=bi),ci(r,f);for(const[h,_]of s){if(s.delete(h),h===d)break;_.reject(ta)}}o&&(a.update_pending_count(-1),d.decrement(u))};c.promise.then(v,f=>v(null,f||"unknown"))}),Da(()=>{for(const c of s.values())c.reject(ta)}),new Promise(c=>{function d(u){function v(){u===n?c(r):d(n)}u.then(v,v)}d(n)})}function U(t){const e=La(t);return co(e),e}function cr(t){const e=La(t);return e.equals=Pl,e}function Fl(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)rt(e[i])}}function zc(t){for(var e=t.parent;e!==null;){if(!(e.f&nt))return e.f&oi?null:e;e=e.parent}return null}function dr(t){var e,i=Ce;Jt(zc(t));try{t.f&=~ja,Fl(t),e=ho(t)}finally{Jt(i)}return e}function Hl(t){var e=dr(t);if(t.equals(e)||(ke!=null&&ke.is_fork||(t.v=e),t.wv=po()),!Ni)if(Ye!==null)(qa()||ke!=null&&ke.is_fork)&&Ye.set(t,e);else{var i=t.f&At?lt:li;ot(t,i)}}let ur=new Set;const _i=new Map;let Vl=!1;function Kt(t,e){var i={f:0,v:t,reactions:null,equals:Tl,rv:0,wv:0};return i}function G(t,e){const i=Kt(t);return co(i),i}function vr(t,e=!1,i=!0){var n;const a=Kt(t);return e||(a.equals=Pl),ia&&i&&Me!==null&&Me.l!==null&&((n=Me.l).s??(n.s=[])).push(a),a}function M(t,e,i=!1){Pe!==null&&(!Zt||Pe.f&bl)&&Ai()&&Pe.f&(nt|Ht|ar|bl)&&!(ct!=null&&ct.includes(t))&&tc();let a=i?Fe(e):e;return ci(t,a)}function ci(t,e){if(!t.equals(e)){var i=t.v;Ni?_i.set(t,e):_i.set(t,i),t.v=e;var a=Wt.ensure();a.capture(t,i),t.f&nt&&(t.f&ut&&dr(t),ot(t,t.f&At?lt:li)),t.wv=po(),Ul(t,ut),Ai()&&Ce!==null&&Ce.f<&&!(Ce.f&(ri|zi))&&(xt===null?Uc([t]):xt.push(t)),!a.is_fork&&ur.size>0&&!Vl&&Ac()}return e}function Ac(){Vl=!1;var t=ki;fn(!0);const e=Array.from(ur);try{for(const i of e)i.f<&&ot(i,li),Ra(i)&&Oa(i)}finally{fn(t)}ur.clear()}function xi(t){M(t,t.v+1)}function Ul(t,e){var i=t.reactions;if(i!==null)for(var a=Ai(),n=i.length,r=0;r<n;r++){var o=i[r],s=o.f;if(!(!a&&o===Ce)){var c=(s&ut)===0;if(c&&ot(o,e),s&nt){var d=o;Ye==null||Ye.delete(d),s&ja||(s&At&&(o.f|=ja),Ul(d,li))}else c&&(s&Ht&&Lt!==null&&Lt.add(o),Mi(o))}}}function Fe(t){if(typeof t!="object"||t===null||Ut in t)return t;const e=Xn(t);if(e!==Hs&&e!==Vs)return t;var i=new Map,a=We(t),n=G(0),r=ui,o=s=>{if(ui===r)return s();var c=Pe,d=ui;pt(null),vo(r);var u=s();return pt(c),vo(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)&&$s();var u=i.get(c);return u===void 0?u=o(()=>{var v=G(d.value);return i.set(c,v),v}):M(u,d.value,!0),!0},deleteProperty(s,c){var d=i.get(c);if(d===void 0){if(c in s){const u=o(()=>G($e));i.set(c,u),xi(n)}}else M(d,$e),xi(n);return!0},get(s,c,d){var f;if(c===Ut)return t;var u=i.get(c),v=c in s;if(u===void 0&&(!v||(f=yi(s,c))!=null&&f.writable)&&(u=o(()=>{var b=Fe(v?s[c]:$e),h=G(b);return h}),i.set(c,u)),u!==void 0){var p=l(u);return p===$e?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!==$e)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return d},has(s,c){var p;if(c===Ut)return!0;var d=i.get(c),u=d!==void 0&&d.v!==$e||Reflect.has(s,c);if(d!==void 0||Ce!==null&&(!u||(p=yi(s,c))!=null&&p.writable)){d===void 0&&(d=o(()=>{var f=u?Fe(s[c]):$e,b=G(f);return b}),i.set(c,d));var v=l(d);if(v===$e)return!1}return u},set(s,c,d,u){var w;var v=i.get(c),p=c in s;if(a&&c==="length")for(var f=d;f<v.v;f+=1){var b=i.get(f+"");b!==void 0?M(b,$e):f in s&&(b=o(()=>G($e)),i.set(f+"",b))}if(v===void 0)(!p||(w=yi(s,c))!=null&&w.writable)&&(v=o(()=>G(void 0)),M(v,Fe(d)),i.set(c,v));else{p=v.v!==$e;var h=o(()=>Fe(d));M(v,h)}var _=Reflect.getOwnPropertyDescriptor(s,c);if(_!=null&&_.set&&_.set.call(u,d),!p){if(a&&typeof c=="string"){var m=i.get("length"),E=Number(c);Number.isInteger(E)&&E>=m.v&&M(m,E+1)}xi(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!==$e});for(var[d,u]of i)u.v!==$e&&!(d in s)&&c.push(d);return c},setPrototypeOf(){ec()}})}function Wl(t){try{if(t!==null&&typeof t=="object"&&Ut in t)return t[Ut]}catch{}return t}function Lc(t,e){return Object.is(Wl(t),Wl(e))}var Ee,Gl,Kl,Yl;function Mc(){if(Ee===void 0){Ee=window,Gl=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;Kl=yi(e,"firstChild").get,Yl=yi(e,"nextSibling").get,gl(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),gl(i)&&(i.__t=void 0)}}function Mt(t=""){return document.createTextNode(t)}function Yt(t){return Kl.call(t)}function Ma(t){return Yl.call(t)}function x(t,e){return Yt(t)}function J(t,e=!1){{var i=Yt(t);return i instanceof Comment&&i.data===""?Ma(i):i}}function S(t,e=1,i=!1){let a=t;for(;e--;)a=Ma(a);return a}function qc(t){t.textContent=""}function Zl(){return!1}function Dc(t,e){if(e){const i=document.body;t.autofocus=!0,si(()=>{document.activeElement===i&&t.focus()})}}let Jl=!1;function Nc(){Jl||(Jl=!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 Rc(t,e,i,a=!0){a&&i();for(var n of e)t.addEventListener(n,i);Da(()=>{for(var r of e)t.removeEventListener(r,i)})}function Di(t){var e=Pe,i=Ce;pt(null),Jt(null);try{return t()}finally{pt(e),Jt(i)}}function Ql(t,e,i,a=i){t.addEventListener(e,()=>Di(i));const n=t.__on_r;n?t.__on_r=()=>{n(),a(!0)}:t.__on_r=()=>a(!0),Nc()}function Xl(t){Ce===null&&(Pe===null&&Js(),Zs()),Ni&&Ys()}function Oc(t,e){var i=e.last;i===null?e.last=e.first=t:(i.next=t,t.prev=i,e.last=t)}function qt(t,e,i){var a=Ce;a!==null&&a.f&ht&&(t|=ht);var n={ctx:Me,deps:null,nodes_start:null,nodes_end:null,f:t|ut|At,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{Oa(n),n.f|=dn}catch(s){throw rt(n),s}else e!==null&&Mi(n);var r=n;if(i&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&ea)&&(r=r.first,t&Ht&&t&Vt&&r!==null&&(r.f|=Vt)),r!==null&&(r.parent=a,a!==null&&Oc(r,a),Pe!==null&&Pe.f&nt&&!(t&zi))){var o=Pe;(o.effects??(o.effects=[])).push(r)}return n}function qa(){return Pe!==null&&!Zt}function Da(t){const e=qt(sn,null,!1);return ot(e,lt),e.teardown=t,e}function Ge(t){Xl();var e=Ce.f,i=!Pe&&(e&ri)!==0&&(e&dn)===0;if(i){var a=Me;(a.e??(a.e=[])).push(t)}else return $l(t)}function $l(t){return qt(er|_l,t,!1)}function Bc(t){return Xl(),qt(sn|_l,t,!0)}function Fc(t){Wt.ensure();const e=qt(zi|ea,t,!0);return(i={})=>new Promise(a=>{i.outro?la(e,()=>{rt(e),a(void 0)}):(rt(e),a(void 0))})}function wi(t){return qt(er,t,!1)}function Hc(t){return qt(ar|ea,t,!0)}function pn(t,e=0){return qt(sn|e,t,!0)}function V(t,e=[],i=[],a=[]){Ol(a,e,i,n=>{qt(sn,()=>t(...n.map(l)),!0)})}function di(t,e=0){var i=qt(Ht|e,t,!0);return i}function eo(t,e=0){var i=qt(yl|e,t,!0);return i}function vt(t){return qt(ri|ea,t,!0)}function to(t){var e=t.teardown;if(e!==null){const i=Ni,a=Pe;so(!0),pt(null);try{e.call(null)}finally{so(i),pt(a)}}}function io(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const n=i.ac;n!==null&&Di(()=>{n.abort(ta)});var a=i.next;i.f&zi?i.parent=null:rt(i,e),i=a}}function Vc(t){for(var e=t.first;e!==null;){var i=e.next;e.f&ri||rt(e),e=i}}function rt(t,e=!0){var i=!1;(e||t.f&tr)&&t.nodes_start!==null&&t.nodes_end!==null&&(ao(t.nodes_start,t.nodes_end),i=!0),io(t,e&&!i),hn(t,0),ot(t,oi);var a=t.transitions;if(a!==null)for(const r of a)r.stop();to(t);var n=t.parent;n!==null&&n.first!==null&&no(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function ao(t,e){for(;t!==null;){var i=t===e?null:Ma(t);t.remove(),t=i}}function no(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 la(t,e,i=!0){var a=[];pr(t,a,!0),ro(a,()=>{i&&rt(t),e&&e()})}function ro(t,e){var i=t.length;if(i>0){var a=()=>--i||e();for(var n of t)n.out(a)}else e()}function pr(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&Vt)!==0||(a.f&ri)!==0&&(t.f&Ht)!==0;pr(a,e,r?i:!1),a=n}}}function fr(t){lo(t,!0)}function lo(t,e){if(t.f&ht){t.f^=ht,t.f<||(ot(t,ut),Mi(t));for(var i=t.first;i!==null;){var a=i.next,n=(i.f&Vt)!==0||(i.f&ri)!==0;lo(i,n?e:!1),i=a}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function oo(t,e){for(var i=t.nodes_start,a=t.nodes_end;i!==null;){var n=i===a?null:Ma(i);e.append(i),i=n}}let ki=!1;function fn(t){ki=t}let Ni=!1;function so(t){Ni=t}let Pe=null,Zt=!1;function pt(t){Pe=t}let Ce=null;function Jt(t){Ce=t}let ct=null;function co(t){Pe!==null&&(ct===null?ct=[t]:ct.push(t))}let dt=null,gt=0,xt=null;function Uc(t){xt=t}let uo=1,Na=0,ui=Na;function vo(t){ui=t}function po(){return++uo}function Ra(t){var e=t.f;if(e&ut)return!0;if(e&nt&&(t.f&=-32769),e&li){var i=t.deps;if(i!==null)for(var a=i.length,n=0;n<a;n++){var r=i[n];if(Ra(r)&&Hl(r),r.wv>t.wv)return!0}e&At&&Ye===null&&ot(t,lt)}return!1}function fo(t,e,i=!0){var a=t.reactions;if(a!==null&&!(ct!=null&&ct.includes(t)))for(var n=0;n<a.length;n++){var r=a[n];r.f&nt?fo(r,e,!1):e===r&&(i?ot(r,ut):r.f<&&ot(r,li),Mi(r))}}function ho(t){var b;var e=dt,i=gt,a=xt,n=Pe,r=ct,o=Me,s=Zt,c=ui,d=t.f;dt=null,gt=0,xt=null,Pe=d&(ri|zi)?null:t,ct=null,aa(t.ctx),Zt=!1,ui=++Na,t.ac!==null&&(Di(()=>{t.ac.abort(ta)}),t.ac=null);try{t.f|=ir;var u=t.fn,v=u(),p=t.deps;if(dt!==null){var f;if(hn(t,gt),p!==null&>>0)for(p.length=gt+dt.length,f=0;f<dt.length;f++)p[gt+f]=dt[f];else t.deps=p=dt;if(ki&&qa()&&t.f&At)for(f=gt;f<p.length;f++)((b=p[f]).reactions??(b.reactions=[])).push(t)}else p!==null&><p.length&&(hn(t,gt),p.length=gt);if(Ai()&&xt!==null&&!Zt&&p!==null&&!(t.f&(nt|li|ut)))for(f=0;f<xt.length;f++)fo(xt[f],t);return n!==null&&n!==t&&(Na++,xt!==null&&(a===null?a=xt:a.push(...xt))),t.f&bi&&(t.f^=bi),v}catch(h){return jl(h)}finally{t.f^=ir,dt=e,gt=i,xt=a,Pe=n,ct=r,aa(o),Zt=s,ui=c}}function Wc(t,e){let i=e.reactions;if(i!==null){var a=ln.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&nt&&(dt===null||!dt.includes(e))&&(ot(e,li),e.f&At&&(e.f^=At,e.f&=-32769),Fl(e),hn(e,0))}function hn(t,e){var i=t.deps;if(i!==null)for(var a=e;a<i.length;a++)Wc(t,i[a])}function Oa(t){var e=t.f;if(!(e&oi)){ot(t,lt);var i=Ce,a=ki;Ce=t,ki=!0;try{e&(Ht|yl)?Vc(t):io(t),to(t);var n=ho(t);t.teardown=typeof n=="function"?n:null,t.wv=uo;var r;Ne&&_c&&t.f&ut&&t.deps}finally{ki=a,Ce=i}}}async function Ba(){await Promise.resolve(),zl()}function l(t){var e=t.f,i=(e&nt)!==0;if(Pe!==null&&!Zt){var a=Ce!==null&&(Ce.f&oi)!==0;if(!a&&!(ct!=null&&ct.includes(t))){var n=Pe.deps;if(Pe.f&ir)t.rv<Na&&(t.rv=Na,dt===null&&n!==null&&n[gt]===t?gt++:dt===null?dt=[t]:dt.includes(t)||dt.push(t));else{(Pe.deps??(Pe.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[Pe]:r.includes(Pe)||r.push(Pe)}}}if(Ni){if(_i.has(t))return _i.get(t);if(i){var o=t,s=o.v;return(!(o.f<)&&o.reactions!==null||mo(o))&&(s=dr(o)),_i.set(o,s),s}}else i&&(!(Ye!=null&&Ye.has(t))||ke!=null&&ke.is_fork&&!qa())&&(o=t,Ra(o)&&Hl(o),ki&&qa()&&!(o.f&At)&&go(o));if(Ye!=null&&Ye.has(t))return Ye.get(t);if(t.f&bi)throw t.v;return t.v}function go(t){if(t.deps!==null){t.f^=At;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&nt&&!(e.f&At)&&go(e)}}function mo(t){if(t.v===$e)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(_i.has(e)||e.f&nt&&mo(e))return!0;return!1}function wt(t){var e=Zt;try{return Zt=!0,t()}finally{Zt=e}}const Gc=-7169;function ot(t,e){t.f=t.f&Gc|e}function yo(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Ut in t)hr(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];typeof i=="object"&&i&&Ut in i&&hr(i)}}}function hr(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{hr(t[a],e)}catch{}const i=Xn(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const a=hl(i);for(let n in a){const r=a[n].get;if(r)try{r.call(t)}catch{}}}}}function Kc(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Yc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Zc(t){return Yc.includes(t)}const Jc={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 Qc(t){return t=t.toLowerCase(),Jc[t]??t}const Xc=["touchstart","touchmove"];function $c(t){return Xc.includes(t)}const bo=new Set,gr=new Set;function mr(t,e,i,a={}){function n(r){if(a.capture||Fa.call(e,r),!r.cancelBubble)return Di(()=>i==null?void 0:i.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?si(()=>{e.addEventListener(t,n,a)}):e.addEventListener(t,n,a),n}function ed(t,e,i,a={}){var n=mr(e,t,i,a);return()=>{t.removeEventListener(e,n,a)}}function he(t,e,i,a,n){var r={capture:a,passive:n},o=mr(t,e,i,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Da(()=>{e.removeEventListener(t,o,r)})}function xe(t){for(var e=0;e<t.length;e++)bo.add(t[e]);for(var i of gr)i(t)}let _o=null;function Fa(t){var _;var e=this,i=e.ownerDocument,a=t.type,n=((_=t.composedPath)==null?void 0:_.call(t))||[],r=n[0]||t.target;_o=t;var o=0,s=_o===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){Fs(t,"currentTarget",{configurable:!0,get(){return r||i}});var u=Pe,v=Ce;pt(null),Jt(null);try{for(var p,f=[];r!==null;){var b=r.assignedSlot||r.parentNode||r.host||null;try{var h=r["__"+a];h!=null&&(!r.disabled||t.target===r)&&h.call(r,t)}catch(m){p?f.push(m):p=m}if(t.cancelBubble||b===e||b===null)break;r=b}if(p){for(let m of f)queueMicrotask(()=>{throw m});throw p}}finally{t.__root=e,delete t.currentTarget,pt(u),Jt(v)}}}function yr(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Ri(t,e){var i=Ce;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function P(t,e){var i=(e&pc)!==0,a=(e&fc)!==0,n,r=!t.startsWith("<!>");return()=>{n===void 0&&(n=yr(r?t:"<!>"+t),i||(n=Yt(n)));var o=a||Gl?document.importNode(n,!0):n.cloneNode(!0);if(i){var s=Yt(o),c=o.lastChild;Ri(s,c)}else Ri(o,o);return o}}function td(t,e,i="svg"){var a=!t.startsWith("<!>"),n=`<${i}>${a?t:"<!>"+t}</${i}>`,r;return()=>{if(!r){var o=yr(n),s=Yt(o);r=Yt(s)}var c=r.cloneNode(!0);return Ri(c,c),c}}function Re(t,e){return td(t,e,"svg")}function Ze(t=""){{var e=Mt(t+"");return Ri(e,e),e}}function ge(){var t=document.createDocumentFragment(),e=document.createComment(""),i=Mt();return t.append(e,i),Ri(e,i),t}function y(t,e){t!==null&&t.before(e)}let gn=!0;function mn(t){gn=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 Dt(t,e){return id(t,e)}const oa=new Map;function id(t,{target:e,anchor:i,props:a={},events:n,context:r,intro:o=!0}){Mc();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 b=$c(f);e.addEventListener(f,Fa,{passive:b});var h=oa.get(f);h===void 0?(document.addEventListener(f,Fa,{passive:b}),oa.set(f,1)):oa.set(f,h+1)}}};c(Qn(bo)),gr.add(c);var d=void 0,u=Fc(()=>{var v=i??e.appendChild(Mt());return Nl(v,{pending:()=>{}},p=>{if(r){re({});var f=Me;f.c=r}n&&(a.$$events=n),gn=o,d=t(p,a)||{},gn=!0,r&&le()}),()=>{var b;for(var p of s){e.removeEventListener(p,Fa);var f=oa.get(p);--f===0?(document.removeEventListener(p,Fa),oa.delete(p)):oa.set(p,f)}gr.delete(c),v!==i&&((b=v.parentNode)==null||b.removeChild(v))}});return br.set(d,u),d}let br=new WeakMap;function Oi(t,e){const i=br.get(t);return i?(br.delete(t),i(e)):Promise.resolve()}class sa{constructor(e,i=!0){Ft(this,"anchor");_e(this,Ot,new Map);_e(this,ai,new Map);_e(this,yt,new Map);_e(this,Ji,new Set);_e(this,en,!0);_e(this,tn,()=>{var e=ke;if(H(this,Ot).has(e)){var i=H(this,Ot).get(e),a=H(this,ai).get(i);if(a)fr(a),H(this,Ji).delete(i);else{var n=H(this,yt).get(i);n&&(H(this,ai).set(i,n.effect),H(this,yt).delete(i),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),a=n.effect)}for(const[r,o]of H(this,Ot)){if(H(this,Ot).delete(r),r===e)break;const s=H(this,yt).get(o);s&&(rt(s.effect),H(this,yt).delete(o))}for(const[r,o]of H(this,ai)){if(r===i||H(this,Ji).has(r))continue;const s=()=>{if(Array.from(H(this,Ot).values()).includes(r)){var d=document.createDocumentFragment();oo(o,d),d.append(Mt()),H(this,yt).set(r,{effect:o,fragment:d})}else rt(o);H(this,Ji).delete(r),H(this,ai).delete(r)};H(this,en)||!a?(H(this,Ji).add(r),la(o,s,!1)):s()}}});_e(this,Vn,e=>{H(this,Ot).delete(e);const i=Array.from(H(this,Ot).values());for(const[a,n]of H(this,yt))i.includes(a)||(rt(n.effect),H(this,yt).delete(a))});this.anchor=e,ye(this,en,i)}ensure(e,i){var a=ke,n=Zl();if(i&&!H(this,ai).has(e)&&!H(this,yt).has(e))if(n){var r=document.createDocumentFragment(),o=Mt();r.append(o),H(this,yt).set(e,{effect:vt(()=>i(o)),fragment:r})}else H(this,ai).set(e,vt(()=>i(this.anchor)));if(H(this,Ot).set(a,e),n){for(const[s,c]of H(this,ai))s===e?a.skipped_effects.delete(c):a.skipped_effects.add(c);for(const[s,c]of H(this,yt))s===e?a.skipped_effects.delete(c.effect):a.skipped_effects.add(c.effect);a.oncommit(H(this,tn)),a.ondiscard(H(this,Vn))}else H(this,tn).call(this)}}Ot=new WeakMap,ai=new WeakMap,yt=new WeakMap,Ji=new WeakMap,en=new WeakMap,tn=new WeakMap,Vn=new WeakMap;const ad=0,_r=1;function Ha(t,e,i,a,n){var r=Ai(),o=$e,s=r?Kt(o):vr(o,!1,!1),c=r?Kt(o):vr(o,!1,!1),d=new sa(t);di(()=>{var u=e(),v=!1;if(Us(u)){var p=Bl(),f=!1;const b=h=>{if(!v){f=!0,p(!1),Wt.ensure();try{h()}finally{Aa(),ra||zl()}}};u.then(h=>{b(()=>{ci(s,h),d.ensure(_r,a&&(_=>a(_,s)))})},h=>{b(()=>{if(ci(c,h),d.ensure(_r,n&&(_=>n(_,c))),!n)throw c.v})}),si(()=>{f||b(()=>{d.ensure(ad,i)})})}else ci(s,u),d.ensure(_r,a&&(b=>a(b,s)));return()=>{v=!0}})}function B(t,e,i=!1){var a=new sa(t),n=i?Vt:0;function r(o,s){a.ensure(o,s)}di(()=>{var o=!1;e((s,c=!0)=>{o=!0,r(c,s)}),o||r(!1,null)},n)}function ca(t,e,i){var a=new sa(t),n=!Ai();di(()=>{var r=e();n&&r!==null&&typeof r=="object"&&(r={}),a.ensure(r,i)})}function nd(t,e,i=!1,a=!1,n=!1){var r=t,o="";V(()=>{var s=Ce;if(o!==(o=e()??"")&&(s.nodes_start!==null&&(ao(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=yr(c);if((i||a)&&(d=Yt(d)),Ri(Yt(d),d.lastChild),i||a)for(;Yt(d);)r.before(Yt(d));else r.before(d)}})}function Ve(t,e,...i){var a=new sa(t);di(()=>{const n=e()??null;a.ensure(n,n&&(r=>n(r,...i)))},Vt)}function xr(t,e,i){var a=new sa(t);di(()=>{var n=e()??null;a.ensure(n,n&&(r=>i(r,n)))},Vt)}function xo(t,e,i,a,n,r){var o=null,s=t,c=qi,d=new sa(s,!1);di(()=>{const u=e()||null;var v=u==="svg"?gc:null;if(u===null){d.ensure(null,null),mn(!0);return}return d.ensure(u,p=>{var f=qi;if(Rl(c),u){if(o=v?document.createElementNS(v,u):document.createElement(u),Ri(o,o),a){var b=o.appendChild(Mt());a(o,b)}Ce.nodes_end=o,p.before(o)}Rl(f)}),mn(!0),()=>{u&&mn(!1)}},Vt),Da(()=>{mn(!0)})}function rd(t,e){var i;i=document.head.appendChild(Mt());try{di(()=>e(i),tr)}finally{}}function mt(t,e,i){wi(()=>{var a=wt(()=>e(t,i==null?void 0:i())||{});if(i&&(a!=null&&a.update)){var n=!1,r={};pn(()=>{var o=i();yo(o),n&&El(r,o)&&(r=o,a.update(o))}),n=!0}if(a!=null&&a.destroy)return()=>a.destroy()})}function yn(t,e){var i=void 0,a;eo(()=>{i!==(i=e())&&(a&&(rt(a),a=null),i&&(a=vt(()=>{wi(()=>i(t))})))})}function wo(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=wo(t[e]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function ld(){for(var t,e,i=0,a="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=wo(t))&&(a&&(a+=" "),a+=e);return a}function od(t){return typeof t=="object"?ld(t):t??""}const ko=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function sd(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||ko.includes(a[o-1]))&&(s===a.length||ko.includes(a[s]))?a=(o===0?"":a.substring(0,o))+a.substring(s+1):o=s}}return a===""?null:a}function So(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 wr(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function cd(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(wr)),n&&c.push(...Object.keys(n).map(wr));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=wr(t.substring(d,u).trim());if(!c.includes(f)){p!==";"&&v++;var b=t.substring(d,v).trim();i+=" "+b+";"}}d=v+1,u=-1}}}}return a&&(i+=So(a)),n&&(i+=So(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=sd(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 kr(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 Ke(t,e,i,a){var n=t.__style;if(n!==e){var r=cd(e,a);r==null?t.removeAttribute("style"):t.style.cssText=r,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 bn(t,e,i=!1){if(t.multiple){if(e==null)return;if(!We(e))return yc();for(var a of t.options)a.selected=e.includes(Va(a));return}for(a of t.options){var n=Va(a);if(Lc(n,e)){a.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function To(t){var e=new MutationObserver(()=>{bn(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Da(()=>{e.disconnect()})}function dd(t,e,i=e){var a=new WeakSet,n=!0;Ql(t,"change",r=>{var o=r?"[selected]":":checked",s;if(t.multiple)s=[].map.call(t.querySelectorAll(o),Va);else{var c=t.querySelector(o)??t.querySelector("option:not([disabled])");s=c&&Va(c)}i(s),ke!==null&&a.add(ke)}),wi(()=>{var r=e();if(t===document.activeElement){var o=za??ke;if(a.has(o))return}if(bn(t,r,n),n&&r===void 0){var s=t.querySelector(":checked");s!==null&&(r=Va(s),i(r))}t.__value=r,n=!1}),To(t)}function Va(t){return"__value"in t?t.__value:t.value}const da=Symbol("class"),ua=Symbol("style"),Eo=Symbol("is custom element"),Po=Symbol("is html");function ud(t,e){var i=Sr(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function Co(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ce(t,e,i,a){var n=Sr(t);n[e]!==(n[e]=i)&&(e==="loading"&&(t[Gs]=i),i==null?t.removeAttribute(e):typeof i!="string"&&zo(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function vd(t,e,i,a,n=!1,r=!1){var o=Sr(t),s=o[Eo],c=!o[Po],d=e||{},u=t.tagName==="OPTION";for(var v in e)v in i||(i[v]=null);i.class?i.class=od(i.class):(a||i[da])&&(i.class=null),i[ua]&&(i.style??(i.style=null));var p=zo(t);for(const w in i){let C=i[w];if(u&&w==="value"&&C==null){t.value=t.__value="",d[w]=C;continue}if(w==="class"){var f=t.namespaceURI==="http://www.w3.org/1999/xhtml";we(t,f,C,a,e==null?void 0:e[da],i[da]),d[w]=C,d[da]=i[da];continue}if(w==="style"){Ke(t,C,e==null?void 0:e[ua],i[ua]),d[w]=C,d[ua]=i[ua];continue}var b=d[w];if(!(C===b&&!(C===void 0&&t.hasAttribute(w)))){d[w]=C;var h=w[0]+w[1];if(h!=="$$")if(h==="on"){const A={},I="$$"+w;let k=w.slice(2);var _=Zc(k);if(Kc(k)&&(k=k.slice(0,-7),A.capture=!0),!_&&b){if(C!=null)continue;t.removeEventListener(k,d[I],A),d[I]=null}if(C!=null)if(_)t[`__${k}`]=C,xe([k]);else{let F=function(L){d[w].call(this,L)};d[I]=mr(k,t,F,A)}else _&&(t[`__${k}`]=void 0)}else if(w==="style")ce(t,w,C);else if(w==="autofocus")Dc(t,!!C);else if(!s&&(w==="__value"||w==="value"&&C!=null))t.value=t.__value=C;else if(w==="selected"&&u)Co(t,C);else{var m=w;c||(m=Qc(m));var E=m==="defaultValue"||m==="defaultChecked";if(C==null&&!s&&!E)if(o[w]=null,m==="value"||m==="checked"){let A=t;const I=e===void 0;if(m==="value"){let k=A.defaultValue;A.removeAttribute(m),A.defaultValue=k,A.value=A.__value=I?k:null}else{let k=A.defaultChecked;A.removeAttribute(m),A.defaultChecked=k,A.checked=I?k:!1}}else t.removeAttribute(w);else E||p.includes(m)&&(s||typeof C!="string")?(t[m]=C,m in o&&(o[m]=$e)):typeof C!="function"&&ce(t,m,C)}}}return d}function Io(t,e,i=[],a=[],n=[],r,o=!1,s=!1){Ol(n,i,a,c=>{var d=void 0,u={},v=t.nodeName==="SELECT",p=!1;if(eo(()=>{var b=e(...c.map(l)),h=vd(t,d,b,r,o,s);p&&v&&"value"in b&&bn(t,b.value);for(let m of Object.getOwnPropertySymbols(u))b[m]||rt(u[m]);for(let m of Object.getOwnPropertySymbols(b)){var _=b[m];m.description===mc&&(!d||_!==d[m])&&(u[m]&&rt(u[m]),u[m]=vt(()=>yn(t,()=>_))),h[m]=_}d=h}),v){var f=t;wi(()=>{bn(f,d.value,!0),To(f)})}p=!0})}function Sr(t){return t.__attributes??(t.__attributes={[Eo]:t.nodeName.includes("-"),[Po]:t.namespaceURI===hc})}var jo=new Map;function zo(t){var e=t.getAttribute("is")||t.nodeName,i=jo.get(e);if(i)return i;jo.set(e,i=[]);for(var a,n=t,r=Element.prototype;r!==n;){a=hl(n);for(var o in a)a[o].set&&i.push(o);n=Xn(n)}return i}const pd=()=>performance.now(),vi={tick:t=>requestAnimationFrame(t),now:()=>pd(),tasks:new Set};function Ao(){const t=vi.now();vi.tasks.forEach(e=>{e.c(t)||(vi.tasks.delete(e),e.f())}),vi.tasks.size!==0&&vi.tick(Ao)}function fd(t){let e;return vi.tasks.size===0&&vi.tick(Ao),{promise:new Promise(i=>{vi.tasks.add(e={c:t,f:i})}),abort(){vi.tasks.delete(e)}}}function _n(t,e){Di(()=>{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 Lo(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=qi,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=xn(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&dc)!==0,r=(t&uc)!==0,o=n&&r,s=(t&vc)!==0,c=o?"both":n?"in":"out",d,u=e.inert,v=e.style.overflow,p,f;function b(){return Di(()=>d??(d=i()(e,(a==null?void 0:a())??{},{direction:c})))}var h={is_global:s,in(){var w;if(e.inert=u,!n){f==null||f.abort(),(w=f==null?void 0:f.reset)==null||w.call(f);return}r||p==null||p.abort(),_n(e,"introstart"),p=xn(e,b(),f,1,()=>{_n(e,"introend"),p==null||p.abort(),p=d=void 0,e.style.overflow=v})},out(w){if(!r){w==null||w(),d=void 0;return}e.inert=!0,_n(e,"outrostart"),f=xn(e,b(),p,0,()=>{_n(e,"outroend"),w==null||w()})},stop:()=>{p==null||p.abort(),f==null||f.abort()}},_=Ce;if((_.transitions??(_.transitions=[])).push(h),n&&gn){var m=s;if(!m){for(var E=_.parent;E&&E.f&Vt;)for(;(E=E.parent)&&!(E.f&Ht););m=!E||(E.f&dn)!==0}m&&wi(()=>{wt(()=>h.in())})}}function xn(t,e,i,a,n){var r=a===1;if(Xi(e)){var o,s=!1;return si(()=>{if(!s){var _=e({direction:r?"in":"out"});o=xn(t,_,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=Lo(d(0,1));p.push(f,f)}var b=()=>1-a,h=t.animate(p,{duration:c,fill:"forwards"});return h.onfinish=()=>{h.cancel();var _=(i==null?void 0:i.t())??1-a;i==null||i.abort();var m=a-_,E=e.duration*Math.abs(m),w=[];if(E>0){var C=!1;if(d)for(var A=Math.ceil(E/16.666666666666668),I=0;I<=A;I+=1){var k=_+m*v(I/A),F=Lo(d(k,1-k));w.push(F),C||(C=F.overflow==="hidden")}C&&(t.style.overflow="hidden"),b=()=>{var L=h.currentTime;return _+m*v(L/E)},u&&fd(()=>{if(h.playState!=="running")return!1;var L=b();return u(L,1-L),!0})}h=t.animate(w,{duration:E,fill:"forwards"}),h.onfinish=()=>{b=()=>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:()=>b()}}function va(t,e,i=e){var a=new WeakSet;Ql(t,"input",async n=>{var r=n?t.defaultValue:t.value;if(r=Tr(t)?Er(r):r,i(r),ke!==null&&a.add(ke),await Ba(),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))}}}),wt(e)==null&&t.value&&(i(Tr(t)?Er(t.value):t.value),ke!==null&&a.add(ke)),pn(()=>{var n=e();if(t===document.activeElement){var r=za??ke;if(a.has(r))return}Tr(t)&&n===Er(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n??"")})}function Tr(t){var e=t.type;return e==="number"||e==="range"}function Er(t){return t===""?null:+t}const Wn=class Wn{constructor(e){_e(this,Un);_e(this,Ii,new WeakMap);_e(this,Ta);_e(this,an);ye(this,an,e)}observe(e,i){var a=H(this,Ii).get(e)||new Set;return a.add(i),H(this,Ii).set(e,a),Oe(this,Un,Rs).call(this).observe(e,H(this,an)),()=>{var n=H(this,Ii).get(e);n.delete(i),n.size===0&&(H(this,Ii).delete(e),H(this,Ta).unobserve(e))}}};Ii=new WeakMap,Ta=new WeakMap,an=new WeakMap,Un=new WeakSet,Rs=function(){return H(this,Ta)??ye(this,Ta,new ResizeObserver(e=>{for(var i of e){Wn.entries.set(i.target,i);for(var a of H(this,Ii).get(i.target)||[])a(i)}}))},Ft(Wn,"entries",new WeakMap);let Pr=Wn;var yd=new Pr({box:"border-box"});function Nt(t,e,i){var a=yd.observe(t,()=>i(t[e]));wi(()=>(wt(()=>i(t[e])),a))}function Mo(t,e){return t===e||(t==null?void 0:t[Ut])===e}function Je(t={},e,i,a){return wi(()=>{var n,r;return pn(()=>{n=r,r=[],wt(()=>{t!==i(...r)&&(e(t,...r),n&&Mo(i(...n),t)&&e(null,...n))})}),()=>{si(()=>{r&&Mo(i(...r),t)&&e(null,...r)})}}),t}function Cr(t,e){Rc(window,["resize"],()=>Di(()=>e(window[t])))}function Ir(t=!1){const e=Me,i=e.l.u;if(!i)return;let a=()=>yo(e.s);if(t){let n=0,r={};const o=La(()=>{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&&Bc(()=>{qo(e,a),$n(i.b)}),Ge(()=>{const n=wt(()=>i.m.map(Ws));return()=>{for(const r of n)typeof r=="function"&&r()}}),i.a.length&&Ge(()=>{qo(e,a),$n(i.a)})}function qo(t,e){if(t.l.s)for(const i of t.l.s)l(i);e()}let wn=!1;function bd(t){var e=wn;try{return wn=!1,[t(),wn]}finally{wn=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 Do(t,e,i){return new Proxy({props:t,exclude:e},_d)}const xd={get(t,e){let i=t.props.length;for(;i--;){let a=t.props[i];if(Xi(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];Xi(n)&&(n=n());const r=yi(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(Xi(a)&&(a=a()),typeof a=="object"&&a!==null&&e in a){const n=yi(a,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===Ut||e===xl)return!1;for(let i of t.props)if(Xi(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){const e=[];for(let i of t.props)if(Xi(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 kn(...t){return new Proxy({props:t},xd)}function q(t,e,i,a){var w;var n=!ia||(i&lc)!==0,r=(i&sc)!==0,o=(i&cc)!==0,s=a,c=!0,d=()=>(c&&(c=!1,s=o?wt(a):a),s),u;if(r){var v=Ut in t||xl in t;u=((w=yi(t,e))==null?void 0:w.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&&Xs(),u(p)));var b;if(n?b=()=>{var C=t[e];return C===void 0?d():(c=!0,C)}:b=()=>{var C=t[e];return C!==void 0&&(s=void 0),C===void 0?s:C},n&&!(i&oc))return b;if(u){var h=t.$$legacy;return function(C,A){return arguments.length>0?((!n||!A||h||f)&&u(A?b():C),C):b()}}var _=!1,m=(i&rc?La:cr)(()=>(_=!1,b()));r&&l(m);var E=Ce;return function(C,A){if(arguments.length>0){const I=A?l(m):n&&r?Fe(C):C;return M(m,I),_=!0,s!==void 0&&(s=I),C}return Ni&&_||E.f&oi?m.v:l(m)}}function Qe(t){Me===null&&nr(),ia&&Me.l!==null?wd(Me).m.push(t):Ge(()=>{const e=wt(t);if(typeof e=="function")return e})}function jr(t){Me===null&&nr(),Qe(()=>()=>wt(t))}function wd(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const kd="5";typeof window<"u"&&((Ms=window.__svelte??(window.__svelte={})).v??(Ms.v=new Set)).add(kd);function pi(){var t;return(t=window.PlayPilotLinkInjections)==null?void 0:t.token}const No="https://www.playpilot.com",Sd="https://partner-api.playpilot.tech/1.0",Td="https://img-external.playpilot.tech",zr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",Bi=600,Ar={};async function Qt(t,{headers:e={},method:i="GET",body:a=null}={}){const n=!Sn()&&i==="GET";if(n&&t in Ar)return Ar[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&&(Ar[t]=c),c}const Lr="EncryptedToken",Ro="articleReplacementEditToken",Oo="playpilot-editorial-mode";async function Bo({href:t=window.location.href,throwError:e=!1}={}){try{const i=pi();if(!i)throw new Error("No token was provided");const a=Mr(t);if(!a)throw new Error("Could not be authenticated");return await Qt(`/external-pages/edit-authorization?api-token=${i}`,{method:"POST",body:{private_token:a}}),Ed(a),!0}catch(i){if(console.error(i),e)throw i}finally{Id()}return!1}function Mr(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(Ro);if(r)return decodeURI(r)}return((n=("; "+document.cookie).split(`; ${Lr}=`).pop())==null?void 0:n.split(";")[0])||""}function Ed(t){const e=new Date;e.setTime(e.getTime()+30*24*60*60*1e3);const a="expires="+e.toUTCString();document.cookie=Lr+"="+t+";"+a+";path=/"}function Pd(){document.cookie=Lr+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function Sn(){var e;const t=(e=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:e.editorial_token;return new URLSearchParams(window.location.search).get(Oo)==="true"||!!t}function Cd(){const t=new URL(window.location.href);t.searchParams.set(Oo,"true"),window.history.replaceState({},"",t)}function Id(){const t=new URL(window.location.href);t.searchParams.delete(Ro),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 Tn(t=5){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(;i.length<t;)i+=e[Math.floor(Math.random()*e.length)];return i}const g=Object.freeze({English:"en-US",Swedish:"sv-SE",Danish:"da-DK"});function Ua(){var a,n;const t=(a=window.PlayPilotLinkInjections)==null?void 0:a.language,e=Object.values(g);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 g.English}function qr(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 pa(){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 Fo(t){return t.map(e=>e.innerText).join(`
|
|
4
4
|
|
|
5
|
-
`)}function fa(t=(e=>(e=window.PlayPilotLinkInjections)==null?void 0:e.config)()){const i=pa(),a=qr(i,t.exclude_elements_selector||""),n=Fo(a);return{parentElement:i,elements:a,pageText:n}}function Ho(){const t=pa();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=Vo().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Dr(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=Vo().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Dr(i):null}function Dr(t){try{return new Date(t).toISOString()}catch{return null}}function Vo(){const e=Array.from(document.querySelectorAll('[type="application/ld+json"]')).find(i=>i.textContent.includes("dateModified")||i.textContent.includes("datePublished"));if(!e)return{};try{return JSON.parse(e.textContent||"")}catch{return{}}}function Fi(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function Nr(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&&Fi().match(new RegExp(t.exclude_urls_pattern)))}let Rr=null;async function Hi({url:t=Fi(),params:e={},method:i="GET"}={}){const a=pi(),n=Sn()?await Bo():!1,r=Ua(),{pageText:o}=fa(),s=jd(o||"");if(!a)throw new Error("No token was provided");const c=`/external-pages/?api-token=${a}&include_title_details=true${n?"&editorial_mode_enabled=true":""}&language=${r}`;let d;return console.log("page text in fetchLinkInjections",{pageText:o}),i==="POST"?(e.run_ai&&(e.hash=s,e.page_text=o),e.url=t,e.metadata=Ho(),d=await Qt(c,{method:"POST",body:e})):d=await Qt(c+`&url=${t}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function Uo({requireCompletedResult:t=!1,runAiWhenRelevant:e=!1,pollInterval:i=3e3,maxTries:a=600,onpoll:n=()=>null}={}){const{pageText:r}=fa();let o=0;Rr&&clearTimeout(Rr),console.log("page text in pollLinkInjections",{pageText:r});const s=async(c,d)=>{let u;try{try{u=await Hi()}catch(v){throw(v==null?void 0:v.status)===404&&(u=await Hi({method:"POST"}),u.ai_enabled&&(u=await Hi({params:{run_ai:!0},method:"POST"}))),new Error}if(u&&e&&(u=await qd(r,u)),t&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=Wo(u.manual_injections||[]),u.ai_injections=Wo(u.ai_injections||[]),c(u);return}catch{if(o++,o>=a){a>1&&console.error("Max poll limit exceeded. Please return later."),c();return}u&&n(u),Rr=setTimeout(()=>s(c),i)}};return new Promise(s)}async function qd(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=Ho().content_modified_time,a=e.content_modified_time?Dr(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 Hi({params:{run_ai:!0},method:"POST"})}async function Dd(t){var r;const e=(r=window.PlayPilotLinkInjections)==null?void 0:r.selector,a=t.filter(o=>o.manual).map(o=>({sid:o.sid,title:o.title,sentence:o.sentence,phrase_before:o.phrase_before,phrase_after:o.phrase_after,playpilot_url:o.playpilot_url,after_article:!!o.after_article,after_article_style:o.after_article_style||null,in_text:o.in_text??!0,inactive:!!o.inactive,removed:!!o.removed}));if(!await Hi({method:"POST",params:{private_token:Mr(),manual_injections:a,content_text_selector:e}}))throw new Error("saveLinkInjections response was faulty");return t}function Wo(t){return t.map(e=>({...e,key:Go(e.sid)}))}function Go(t){return t+"-"+Tn()}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 Or(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function Ko(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 Yo(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=Or(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 Or(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function Zo(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 Jo(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=Qo(a.innerText.slice(0,e+n)),o=a.innerText.slice(i+n),s=Qo(Xo(r,2)),c=Xo(o,2);return{before:s,after:c}}function Qo(t){return t.split("").reverse().join("")}function Xo(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function En(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})=>Or(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 $o(t){return t.ctrlKey||t.metaKey||t.button!==0}const ve={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",ExploreResultsError:"venus_explore_results_error",ExploreHomeRailError:"venus_explore_home_rail_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",CardToExploreCta:"ali_card_to_explore_cta",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed",ExploreTitleRailModalView:"venus_title_rail_modal_view",ExploreTitleRailExpandClick:"venus_title_rail_expand_click",ExploreTitleRailSetIndex:"venus_title_rail_set_index",ExploreNavigate:"venus_navigate",ExploreAnyClick:"venus_any_click",ExploreScrollDistance:"venus_scroll_distance"},Rt={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest",TitleInterest:"TitleInterest"},Si={Card:"tpi_card",Link:"tpi_link"};function Yd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function St(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function Pn(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const Cn=[{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90}},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50}},{slug:"103",name:"Kids",categories:{kids:76}},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46}},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84}},{slug:"106",name:"Documentary",categories:{kids:50}},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44}},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28}},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88}},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40}},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38}},{slug:"112",name:"Film Noir",categories:{movie:37}},{slug:"113",name:"Game Show",categories:{series:36,kids:28}},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90}},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86}},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66}},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30}},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32}},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76}},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38}},{slug:"121",name:"Reality TV",categories:{series:24}},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74}},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32}},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80}},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20}},{slug:"126",name:"Talk Show",categories:{kids:34,series:16}},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70}},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24}},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48}},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44}},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36}},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42}},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34}},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74}},{slug:"232",name:"Stand-up",categories:{movie:18,series:18}},{slug:"240",name:"Concert",categories:{movie:45}},{slug:"900",name:"Independent",categories:{}},{slug:"901",name:"Arthouse",categories:{}},{slug:"902",name:"Bollywood",categories:{}},{slug:"903",name:"Alternate Version",categories:{}},{slug:"999",name:"Unscripted",categories:{}}];function Zd(t=[]){return t.map(e=>{var i;return((i=Cn.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const Br="playpilot_user_id";function Jd(){if(!es())return null;try{const t=localStorage.getItem(Br);return t||(localStorage.setItem(Br,Tn(16)),localStorage.getItem(Br))}catch{return null}}function es(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)&&St("tracking")}const Qd="https://insights.playpilot.net";async function pe(t,e=null,i={}){var n,r,o,s,c;if(Pn())return;if(!St("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}),es()&&(i.user_id=Jd(),i.region=window.PlayPilotLinkInjections.region),i.version="8.10.4-beta.2",i.time_since_initialize=(r=window.PlayPilotLinkInjections)!=null&&r.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=Fi(),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>Bi?"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(Qd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Xd({event:t,payload:i})}function Xd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function ts({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(St("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])pe(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}async function is(){if(!St("ads"))return[];const t=pi();if(!t)throw new Error("No token was provided");try{return await Qt(`/ads/browse/?api-token=${t}`)}catch(e){throw pe(ve.AdsFetchFailed,null,{status:e.status}),e}}function Wa(t){var e;return!St("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 Fr(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 pe(ve.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 Hr(t={}){const e=pi();if(!e)throw new Error("No token was provided");return t={...t,language:Ua(),include_count:"false"},t.region!==null&&(t.region=t.region||await Fr()),await Qt(`/titles/browse?api-token=${e}&`+Nr(t))}async function au(t){return(await Hr({related_to_sid:t.sid})).results}const nu={"Where To Stream Online":{[g.English]:"Where to stream online",[g.Swedish]:"Var kan man streama online",[g.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[g.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[g.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[g.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"In-Text Disclaimer":{[g.English]:"We may earn a commission from purchases made through some of the links below.",[g.Swedish]:"Vi kan få en provision för köp som görs via några av länkarna nedan.",[g.Danish]:"Vi kan modtage en kommission for køb foretaget gennem nogle af nedenstående links."},"An Error Occurred":{[g.English]:"An error occurred",[g.Swedish]:"Ett fel inträffade",[g.Danish]:"Der opstod en fejl"},Loading:{[g.English]:"Loading",[g.Swedish]:"Laddar",[g.Danish]:"Indlæser"},"Title Unavailable":{[g.English]:"This title is not currently available to stream.",[g.Swedish]:"Den här titeln går inte att streama just nu.",[g.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[g.English]:"is not currently available to stream.",[g.Swedish]:"går inte att streama just nu.",[g.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[g.English]:"is available to stream on",[g.Swedish]:"finns att streama på",[g.Danish]:"kan streames på"},"Is Available To Stream":{[g.English]:"is available to stream.",[g.Swedish]:"finns att streama.",[g.Danish]:"kan streames."},"View Streaming Options":{[g.English]:"View streaming options",[g.Swedish]:"Se streamingalternativ",[g.Danish]:"Se streamingmuligheder"},"Commission Disclaimer":{[g.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[g.Swedish]:"Vi kan tjäna en provision om du gör ett köp via dessa länkar. I samarbete med",[g.Danish]:"Vi kan tjene en kommission, hvis du foretager et køb via disse links. I samarbejde med"},And:{[g.English]:"and",[g.Swedish]:"och",[g.Danish]:"og"},Minutes:{[g.English]:"minutes",[g.Swedish]:"minuter",[g.Danish]:"minutter"},"Type: movie":{[g.English]:"Movie",[g.Swedish]:"Film",[g.Danish]:"Film"},"Type: series":{[g.English]:"Series",[g.Swedish]:"Serie",[g.Danish]:"Serie"},Stream:{[g.English]:"Stream",[g.Swedish]:"Streama",[g.Danish]:"Stream"},Buy:{[g.English]:"Buy",[g.Swedish]:"Köp",[g.Danish]:"Køb"},Rent:{[g.English]:"Rent",[g.Swedish]:"Hyr",[g.Danish]:"Lej"},"Rent Or Buy":{[g.English]:"Rent or Buy",[g.Swedish]:"Hyr/köp",[g.Danish]:"Lej eller køb"},Watch:{[g.English]:"Watch",[g.Swedish]:"Titta nu",[g.Danish]:"Se nu"},"Category: AVOD":{[g.English]:"Stream for free",[g.Swedish]:"Streama gratis",[g.Danish]:"Stream gratis"},"Category: SVOD":{[g.English]:"Streaming services",[g.Swedish]:"Streamingtjänster",[g.Danish]:"Streamingtjenester"},"Category: RENT":{[g.English]:"Rent it",[g.Swedish]:"Hyr den",[g.Danish]:"Lej den"},"Category: BUY":{[g.English]:"Buy it",[g.Swedish]:"Köp den",[g.Danish]:"Køb den"},"Category: Other":{[g.English]:"Other",[g.Swedish]:"Annat",[g.Danish]:"Andet"},Share:{[g.English]:"Share",[g.Swedish]:"Dela",[g.Danish]:"Del"},"Copy URL":{[g.English]:"Copy URL",[g.Swedish]:"Kopiera URL",[g.Danish]:"Kopiér URL"},Email:{[g.English]:"Email",[g.Swedish]:"E-post",[g.Danish]:"E-mail"},"Show More":{[g.English]:"Show more",[g.Swedish]:"Visa mer",[g.Danish]:"Vis mere"},Cast:{[g.English]:"Cast",[g.Swedish]:"Rollista",[g.Danish]:"Skuespillere"},"Similar Titles":{[g.English]:"Similar movies & shows",[g.Swedish]:"Liknande filmer och serier",[g.Danish]:"Lignende film og serier"},"Watch Trailer":{[g.English]:"Watch trailer",[g.Swedish]:"Se trailer",[g.Danish]:"Se trailer"},"Streaming Guide":{[g.English]:"Streaming Guide",[g.Swedish]:"Streaming Guide",[g.Danish]:"Streaming Guide"},"Streaming Guide Description":{[g.English]:"Find where to watch movies online - the ultimate guide that helps you find the best movies and shows across streaming services.",[g.Swedish]:"Sök bland alla filmer och serier för att ta reda på var du kan streama dem",[g.Danish]:"Find ud af, hvor du kan se film online - den ultimative guide, der hjælper dig med at finde de bedste film og serier på streamingtjenester."},"Search Movies And Shows":{[g.English]:"Search movies and shows",[g.Swedish]:"Sök filmer och serier",[g.Danish]:"Søg film og serier"},Services:{[g.English]:"Services",[g.Swedish]:"Tjänster",[g.Danish]:"Tjenester"},Genres:{[g.English]:"Genres",[g.Swedish]:"Genrer",[g.Danish]:"Genrer"},IMDb:{[g.English]:"IMDb",[g.Swedish]:"IMDb",[g.Danish]:"IMDb"},Year:{[g.English]:"Year",[g.Swedish]:"År",[g.Danish]:"År"},Runtime:{[g.English]:"Runtime",[g.Swedish]:"Speltid",[g.Danish]:"Spilletid"},Countries:{[g.English]:"Countries",[g.Swedish]:"Länder",[g.Danish]:"Lande"},"All Filters":{[g.English]:"All filters",[g.Swedish]:"Alla filter",[g.Danish]:"Alle filtre"},"Sort By":{[g.English]:"Sort by",[g.Swedish]:"Sortera efter",[g.Danish]:"Sortér efter"},Popularity:{[g.English]:"Popularity",[g.Swedish]:"Popularitet",[g.Danish]:"Popularitet"},New:{[g.English]:"New",[g.Swedish]:"Nytt",[g.Danish]:"Nyt"},"Top Rated":{[g.English]:"Top Rated",[g.Swedish]:"Toppbetyg",[g.Danish]:"Højst vurderet"},"-popularity":{[g.English]:"Popularity",[g.Swedish]:"Popularitet",[g.Danish]:"Popularitet"},"-new":{[g.English]:"New",[g.Swedish]:"Nytt",[g.Danish]:"Nyt"},"-best":{[g.English]:"Top Rated",[g.Swedish]:"Toppbetyg",[g.Danish]:"Højst vurderet"},Search:{[g.English]:"Search",[g.Swedish]:"Sök",[g.Danish]:"Søg"},"Born On":{[g.English]:"Born on",[g.Swedish]:"Född den",[g.Danish]:"Født den"},"Died On":{[g.English]:"Died on",[g.Swedish]:"Död den",[g.Danish]:"Død den"},Credits:{[g.English]:"Credits",[g.Swedish]:"Medverkande",[g.Danish]:"Medvirkende"},Home:{[g.English]:"Home",[g.Swedish]:"Hem",[g.Danish]:"Hjem"},Explore:{[g.English]:"Explore",[g.Swedish]:"Utforska",[g.Danish]:"Udforsk"},"List: Trending":{[g.English]:"Trending Movies & Shows",[g.Swedish]:"Trendande Titlar",[g.Danish]:"Populære film og serier"},"List: Upcoming":{[g.English]:"Upcoming Releases",[g.Swedish]:"Kommande Premiärer",[g.Danish]:"Mest ventede film"},"List: New":{[g.English]:"New Releases",[g.Swedish]:"Nya Filmer & Serier",[g.Danish]:"Nye film og serier"},"List: Demand":{[g.English]:"Always in Demand",[g.Swedish]:"Tidlösa Favoriter",[g.Danish]:"Tidløse favoritter"},"List: Cinema":{[g.English]:"Coming to Cinemas",[g.Swedish]:"Snart på Bio",[g.Danish]:"Kommende film"},All:{[g.English]:"All",[g.Swedish]:"Alla",[g.Danish]:"Alle"},Unscripted:{[g.English]:"Unscripted",[g.Swedish]:"Oscripterat",[g.Danish]:"Umanuskriptet"},Independent:{[g.English]:"Independent",[g.Swedish]:"Indie",[g.Danish]:"Indie"},"Game Show":{[g.English]:"Game Show",[g.Swedish]:"Gameshow",[g.Danish]:"Quizshow"},"Film Noir":{[g.English]:"Film Noir",[g.Swedish]:"Film noir",[g.Danish]:"Film noir"},Entertainment:{[g.English]:"Entertainment",[g.Swedish]:"Underhållning",[g.Danish]:"Underholdning"},News:{[g.English]:"News",[g.Swedish]:"Nyheter",[g.Danish]:"Nyheder"},Short:{[g.English]:"Short",[g.Swedish]:"Kortfilm",[g.Danish]:"Kortfilm"},Bollywood:{[g.English]:"Bollywood",[g.Swedish]:"Bollywood",[g.Danish]:"Bollywood"},Concert:{[g.English]:"Concert",[g.Swedish]:"Konsert",[g.Danish]:"Koncert"},Arthouse:{[g.English]:"Arthouse",[g.Swedish]:"Arthouse",[g.Danish]:"Arthouse"},"Alternate Version":{[g.English]:"Alternate Version",[g.Swedish]:"Alternativ version",[g.Danish]:"Alternativ version"},"Reality TV":{[g.English]:"Reality TV",[g.Swedish]:"Reality-TV",[g.Danish]:"Reality-TV"},Culture:{[g.English]:"Culture",[g.Swedish]:"Kultur",[g.Danish]:"Kultur"},Drama:{[g.English]:"Drama",[g.Swedish]:"Drama",[g.Danish]:"Drama"},Crime:{[g.English]:"Crime",[g.Swedish]:"Kriminal",[g.Danish]:"Krimi"},Western:{[g.English]:"Western",[g.Swedish]:"Western",[g.Danish]:"Western"},Thriller:{[g.English]:"Thriller",[g.Swedish]:"Thriller",[g.Danish]:"Thriller"},Animation:{[g.English]:"Animation",[g.Swedish]:"Animerat",[g.Danish]:"Animation"},Mystery:{[g.English]:"Mystery",[g.Swedish]:"Mysterium",[g.Danish]:"Mysterium"},Science:{[g.English]:"Science",[g.Swedish]:"Vetenskap",[g.Danish]:"Videnskab"},Nature:{[g.English]:"Nature",[g.Swedish]:"Natur",[g.Danish]:"Natur"},War:{[g.English]:"War",[g.Swedish]:"Krig",[g.Danish]:"Krig"},"Sci-Fi":{[g.English]:"Sci-Fi",[g.Swedish]:"Sci-fi",[g.Danish]:"Sci-fi"},Documentary:{[g.English]:"Documentary",[g.Swedish]:"Dokumentär",[g.Danish]:"Dokumentar"},"Stand-up":{[g.English]:"Stand-up",[g.Swedish]:"Standup",[g.Danish]:"Stand-up"},"Talk Show":{[g.English]:"Talk Show",[g.Swedish]:"Talkshow",[g.Danish]:"Talkshow"},Fantasy:{[g.English]:"Fantasy",[g.Swedish]:"Fantasy",[g.Danish]:"Fantasy"},History:{[g.English]:"History",[g.Swedish]:"Historia",[g.Danish]:"Historie"},Adventure:{[g.English]:"Adventure",[g.Swedish]:"Äventyr",[g.Danish]:"Eventyr"},Action:{[g.English]:"Action",[g.Swedish]:"Action",[g.Danish]:"Action"},Horror:{[g.English]:"Horror",[g.Swedish]:"Skräck",[g.Danish]:"Gyser"},Comedy:{[g.English]:"Comedy",[g.Swedish]:"Komedi",[g.Danish]:"Komedie"},Biography:{[g.English]:"Biography",[g.Swedish]:"Biografi",[g.Danish]:"Biografi"},Music:{[g.English]:"Music",[g.Swedish]:"Musik",[g.Danish]:"Musik"},Sport:{[g.English]:"Sport",[g.Swedish]:"Sport",[g.Danish]:"Sport"},Romance:{[g.English]:"Romance",[g.Swedish]:"Romantik",[g.Danish]:"Romantik"},Kids:{[g.English]:"Kids",[g.Swedish]:"Barn",[g.Danish]:"Børn"},Lifestyle:{[g.English]:"Lifestyle",[g.Swedish]:"Livsstil",[g.Danish]:"Livsstil"},Musical:{[g.English]:"Musical",[g.Swedish]:"Musikal",[g.Danish]:"Musical"},Anime:{[g.English]:"Anime",[g.Swedish]:"Anime",[g.Danish]:"Anime"},Family:{[g.English]:"Family",[g.Swedish]:"Familj",[g.Danish]:"Familie"}};function fe(t,e=Ua()){var i;return((i=nu[t])==null?void 0:i[e])||t}const In=Object.freeze({Popular:"-popularity",New:"-new",Best:"-best"}),ru=t=>t;function Vr(t){const e=t-1;return e*e*e+1}function as(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Tt(t,{delay:e=0,duration:i=400,easing:a=ru}={}){const n=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:r=>`opacity: ${r*n}`}}function ha(t,{delay:e=0,duration:i=400,easing:a=Vr,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]=as(n),[f,b]=as(r);return{delay:e,duration:i,easing:a,css:(h,_)=>`
|
|
5
|
+
`)}function fa(t=(e=>(e=window.PlayPilotLinkInjections)==null?void 0:e.config)()||null){const i=pa(),a=qr(i,(t==null?void 0:t.exclude_elements_selector)||""),n=Fo(a);return{parentElement:i,elements:a,pageText:n}}function Ho(){const t=pa();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=Vo().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Dr(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=Vo().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?Dr(i):null}function Dr(t){try{return new Date(t).toISOString()}catch{return null}}function Vo(){const e=Array.from(document.querySelectorAll('[type="application/ld+json"]')).find(i=>i.textContent.includes("dateModified")||i.textContent.includes("datePublished"));if(!e)return{};try{return JSON.parse(e.textContent||"")}catch{return{}}}function Fi(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function Nr(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&&Fi().match(new RegExp(t.exclude_urls_pattern)))}let Rr=null;async function Hi({url:t=Fi(),params:e={},method:i="GET"}={}){const a=pi(),n=Sn()?await Bo():!1,r=Ua();if(!a)throw new Error("No token was provided");const o=`/external-pages/?api-token=${a}&include_title_details=true${n?"&editorial_mode_enabled=true":""}&language=${r}`;let s;if(i==="POST"){const{pageText:c}=fa();e.run_ai&&(e.hash=jd(c||""),e.page_text=c),e.url=t,e.metadata=Ho(),s=await Qt(o,{method:"POST",body:e})}else s=await Qt(o+`&url=${t}`,{method:"GET"});return window.PlayPilotLinkInjections.last_successful_fetch=s,s}async function Uo({requireCompletedResult:t=!1,runAiWhenRelevant:e=!1,pollInterval:i=3e3,maxTries:a=600,onpoll:n=()=>null}={}){let r=0;Rr&&clearTimeout(Rr);const o=async(s,c)=>{var u;let d;try{try{d=await Hi()}catch(p){throw console.error(p),(p==null?void 0:p.status)===404&&(d=await Hi({method:"POST"}),d.ai_enabled&&(d=await Hi({params:{run_ai:!0},method:"POST"}))),new Error}const{pageText:v}=fa();if(console.log(v),console.log((u=document.querySelector("#content"))==null?void 0:u.innerText),d&&e&&(d=await qd(v,d)),t&&d.ai_enabled&&d.ai_running)throw new Error;d.manual_injections=Wo(d.manual_injections||[]),d.ai_injections=Wo(d.ai_injections||[]),s(d);return}catch{if(r++,r>=a){a>1&&console.error("Max poll limit exceeded. Please return later."),s();return}d&&n(d),Rr=setTimeout(()=>o(s),i)}};return new Promise(o)}async function qd(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=Ho().content_modified_time,a=e.content_modified_time?Dr(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 Hi({params:{run_ai:!0},method:"POST"})}async function Dd(t){var r;const e=(r=window.PlayPilotLinkInjections)==null?void 0:r.selector,a=t.filter(o=>o.manual).map(o=>({sid:o.sid,title:o.title,sentence:o.sentence,phrase_before:o.phrase_before,phrase_after:o.phrase_after,playpilot_url:o.playpilot_url,after_article:!!o.after_article,after_article_style:o.after_article_style||null,in_text:o.in_text??!0,inactive:!!o.inactive,removed:!!o.removed}));if(!await Hi({method:"POST",params:{private_token:Mr(),manual_injections:a,content_text_selector:e}}))throw new Error("saveLinkInjections response was faulty");return t}function Wo(t){return t.map(e=>({...e,key:Go(e.sid)}))}function Go(t){return t+"-"+Tn()}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 Or(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function Ko(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 Yo(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=Or(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 Or(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function Zo(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 Jo(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=Qo(a.innerText.slice(0,e+n)),o=a.innerText.slice(i+n),s=Qo(Xo(r,2)),c=Xo(o,2);return{before:s,after:c}}function Qo(t){return t.split("").reverse().join("")}function Xo(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function En(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})=>Or(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 $o(t){return t.ctrlKey||t.metaKey||t.button!==0}const ve={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",ExploreResultsError:"venus_explore_results_error",ExploreHomeRailError:"venus_explore_home_rail_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",CardToExploreCta:"ali_card_to_explore_cta",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed",ExploreTitleRailModalView:"venus_title_rail_modal_view",ExploreTitleRailExpandClick:"venus_title_rail_expand_click",ExploreTitleRailSetIndex:"venus_title_rail_set_index",ExploreNavigate:"venus_navigate",ExploreAnyClick:"venus_any_click",ExploreScrollDistance:"venus_scroll_distance"},Rt={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest",TitleInterest:"TitleInterest"},Si={Card:"tpi_card",Link:"tpi_link"};function Yd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function St(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function Pn(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const Cn=[{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90}},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50}},{slug:"103",name:"Kids",categories:{kids:76}},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46}},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84}},{slug:"106",name:"Documentary",categories:{kids:50}},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44}},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28}},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88}},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40}},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38}},{slug:"112",name:"Film Noir",categories:{movie:37}},{slug:"113",name:"Game Show",categories:{series:36,kids:28}},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90}},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86}},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66}},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30}},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32}},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76}},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38}},{slug:"121",name:"Reality TV",categories:{series:24}},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74}},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32}},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80}},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20}},{slug:"126",name:"Talk Show",categories:{kids:34,series:16}},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70}},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24}},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48}},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44}},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36}},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42}},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34}},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74}},{slug:"232",name:"Stand-up",categories:{movie:18,series:18}},{slug:"240",name:"Concert",categories:{movie:45}},{slug:"900",name:"Independent",categories:{}},{slug:"901",name:"Arthouse",categories:{}},{slug:"902",name:"Bollywood",categories:{}},{slug:"903",name:"Alternate Version",categories:{}},{slug:"999",name:"Unscripted",categories:{}}];function Zd(t=[]){return t.map(e=>{var i;return((i=Cn.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const Br="playpilot_user_id";function Jd(){if(!es())return null;try{const t=localStorage.getItem(Br);return t||(localStorage.setItem(Br,Tn(16)),localStorage.getItem(Br))}catch{return null}}function es(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)&&St("tracking")}const Qd="https://insights.playpilot.net";async function pe(t,e=null,i={}){var n,r,o,s,c;if(Pn())return;if(!St("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}),es()&&(i.user_id=Jd(),i.region=window.PlayPilotLinkInjections.region),i.version="8.10.4-beta.3",i.time_since_initialize=(r=window.PlayPilotLinkInjections)!=null&&r.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=Fi(),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>Bi?"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(Qd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Xd({event:t,payload:i})}function Xd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function ts({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(St("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])pe(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}async function is(){if(!St("ads"))return[];const t=pi();if(!t)throw new Error("No token was provided");try{return await Qt(`/ads/browse/?api-token=${t}`)}catch(e){throw pe(ve.AdsFetchFailed,null,{status:e.status}),e}}function Wa(t){var e;return!St("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 Fr(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 pe(ve.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 Hr(t={}){const e=pi();if(!e)throw new Error("No token was provided");return t={...t,language:Ua(),include_count:"false"},t.region!==null&&(t.region=t.region||await Fr()),await Qt(`/titles/browse?api-token=${e}&`+Nr(t))}async function au(t){return(await Hr({related_to_sid:t.sid})).results}const nu={"Where To Stream Online":{[g.English]:"Where to stream online",[g.Swedish]:"Var kan man streama online",[g.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[g.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[g.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[g.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"In-Text Disclaimer":{[g.English]:"We may earn a commission from purchases made through some of the links below.",[g.Swedish]:"Vi kan få en provision för köp som görs via några av länkarna nedan.",[g.Danish]:"Vi kan modtage en kommission for køb foretaget gennem nogle af nedenstående links."},"An Error Occurred":{[g.English]:"An error occurred",[g.Swedish]:"Ett fel inträffade",[g.Danish]:"Der opstod en fejl"},Loading:{[g.English]:"Loading",[g.Swedish]:"Laddar",[g.Danish]:"Indlæser"},"Title Unavailable":{[g.English]:"This title is not currently available to stream.",[g.Swedish]:"Den här titeln går inte att streama just nu.",[g.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[g.English]:"is not currently available to stream.",[g.Swedish]:"går inte att streama just nu.",[g.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[g.English]:"is available to stream on",[g.Swedish]:"finns att streama på",[g.Danish]:"kan streames på"},"Is Available To Stream":{[g.English]:"is available to stream.",[g.Swedish]:"finns att streama.",[g.Danish]:"kan streames."},"View Streaming Options":{[g.English]:"View streaming options",[g.Swedish]:"Se streamingalternativ",[g.Danish]:"Se streamingmuligheder"},"Commission Disclaimer":{[g.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[g.Swedish]:"Vi kan tjäna en provision om du gör ett köp via dessa länkar. I samarbete med",[g.Danish]:"Vi kan tjene en kommission, hvis du foretager et køb via disse links. I samarbejde med"},And:{[g.English]:"and",[g.Swedish]:"och",[g.Danish]:"og"},Minutes:{[g.English]:"minutes",[g.Swedish]:"minuter",[g.Danish]:"minutter"},"Type: movie":{[g.English]:"Movie",[g.Swedish]:"Film",[g.Danish]:"Film"},"Type: series":{[g.English]:"Series",[g.Swedish]:"Serie",[g.Danish]:"Serie"},Stream:{[g.English]:"Stream",[g.Swedish]:"Streama",[g.Danish]:"Stream"},Buy:{[g.English]:"Buy",[g.Swedish]:"Köp",[g.Danish]:"Køb"},Rent:{[g.English]:"Rent",[g.Swedish]:"Hyr",[g.Danish]:"Lej"},"Rent Or Buy":{[g.English]:"Rent or Buy",[g.Swedish]:"Hyr/köp",[g.Danish]:"Lej eller køb"},Watch:{[g.English]:"Watch",[g.Swedish]:"Titta nu",[g.Danish]:"Se nu"},"Category: AVOD":{[g.English]:"Stream for free",[g.Swedish]:"Streama gratis",[g.Danish]:"Stream gratis"},"Category: SVOD":{[g.English]:"Streaming services",[g.Swedish]:"Streamingtjänster",[g.Danish]:"Streamingtjenester"},"Category: RENT":{[g.English]:"Rent it",[g.Swedish]:"Hyr den",[g.Danish]:"Lej den"},"Category: BUY":{[g.English]:"Buy it",[g.Swedish]:"Köp den",[g.Danish]:"Køb den"},"Category: Other":{[g.English]:"Other",[g.Swedish]:"Annat",[g.Danish]:"Andet"},Share:{[g.English]:"Share",[g.Swedish]:"Dela",[g.Danish]:"Del"},"Copy URL":{[g.English]:"Copy URL",[g.Swedish]:"Kopiera URL",[g.Danish]:"Kopiér URL"},Email:{[g.English]:"Email",[g.Swedish]:"E-post",[g.Danish]:"E-mail"},"Show More":{[g.English]:"Show more",[g.Swedish]:"Visa mer",[g.Danish]:"Vis mere"},Cast:{[g.English]:"Cast",[g.Swedish]:"Rollista",[g.Danish]:"Skuespillere"},"Similar Titles":{[g.English]:"Similar movies & shows",[g.Swedish]:"Liknande filmer och serier",[g.Danish]:"Lignende film og serier"},"Watch Trailer":{[g.English]:"Watch trailer",[g.Swedish]:"Se trailer",[g.Danish]:"Se trailer"},"Streaming Guide":{[g.English]:"Streaming Guide",[g.Swedish]:"Streaming Guide",[g.Danish]:"Streaming Guide"},"Streaming Guide Description":{[g.English]:"Find where to watch movies online - the ultimate guide that helps you find the best movies and shows across streaming services.",[g.Swedish]:"Sök bland alla filmer och serier för att ta reda på var du kan streama dem",[g.Danish]:"Find ud af, hvor du kan se film online - den ultimative guide, der hjælper dig med at finde de bedste film og serier på streamingtjenester."},"Search Movies And Shows":{[g.English]:"Search movies and shows",[g.Swedish]:"Sök filmer och serier",[g.Danish]:"Søg film og serier"},Services:{[g.English]:"Services",[g.Swedish]:"Tjänster",[g.Danish]:"Tjenester"},Genres:{[g.English]:"Genres",[g.Swedish]:"Genrer",[g.Danish]:"Genrer"},IMDb:{[g.English]:"IMDb",[g.Swedish]:"IMDb",[g.Danish]:"IMDb"},Year:{[g.English]:"Year",[g.Swedish]:"År",[g.Danish]:"År"},Runtime:{[g.English]:"Runtime",[g.Swedish]:"Speltid",[g.Danish]:"Spilletid"},Countries:{[g.English]:"Countries",[g.Swedish]:"Länder",[g.Danish]:"Lande"},"All Filters":{[g.English]:"All filters",[g.Swedish]:"Alla filter",[g.Danish]:"Alle filtre"},"Sort By":{[g.English]:"Sort by",[g.Swedish]:"Sortera efter",[g.Danish]:"Sortér efter"},Popularity:{[g.English]:"Popularity",[g.Swedish]:"Popularitet",[g.Danish]:"Popularitet"},New:{[g.English]:"New",[g.Swedish]:"Nytt",[g.Danish]:"Nyt"},"Top Rated":{[g.English]:"Top Rated",[g.Swedish]:"Toppbetyg",[g.Danish]:"Højst vurderet"},"-popularity":{[g.English]:"Popularity",[g.Swedish]:"Popularitet",[g.Danish]:"Popularitet"},"-new":{[g.English]:"New",[g.Swedish]:"Nytt",[g.Danish]:"Nyt"},"-best":{[g.English]:"Top Rated",[g.Swedish]:"Toppbetyg",[g.Danish]:"Højst vurderet"},Search:{[g.English]:"Search",[g.Swedish]:"Sök",[g.Danish]:"Søg"},"Born On":{[g.English]:"Born on",[g.Swedish]:"Född den",[g.Danish]:"Født den"},"Died On":{[g.English]:"Died on",[g.Swedish]:"Död den",[g.Danish]:"Død den"},Credits:{[g.English]:"Credits",[g.Swedish]:"Medverkande",[g.Danish]:"Medvirkende"},Home:{[g.English]:"Home",[g.Swedish]:"Hem",[g.Danish]:"Hjem"},Explore:{[g.English]:"Explore",[g.Swedish]:"Utforska",[g.Danish]:"Udforsk"},"List: Trending":{[g.English]:"Trending Movies & Shows",[g.Swedish]:"Trendande Titlar",[g.Danish]:"Populære film og serier"},"List: Upcoming":{[g.English]:"Upcoming Releases",[g.Swedish]:"Kommande Premiärer",[g.Danish]:"Mest ventede film"},"List: New":{[g.English]:"New Releases",[g.Swedish]:"Nya Filmer & Serier",[g.Danish]:"Nye film og serier"},"List: Demand":{[g.English]:"Always in Demand",[g.Swedish]:"Tidlösa Favoriter",[g.Danish]:"Tidløse favoritter"},"List: Cinema":{[g.English]:"Coming to Cinemas",[g.Swedish]:"Snart på Bio",[g.Danish]:"Kommende film"},All:{[g.English]:"All",[g.Swedish]:"Alla",[g.Danish]:"Alle"},Unscripted:{[g.English]:"Unscripted",[g.Swedish]:"Oscripterat",[g.Danish]:"Umanuskriptet"},Independent:{[g.English]:"Independent",[g.Swedish]:"Indie",[g.Danish]:"Indie"},"Game Show":{[g.English]:"Game Show",[g.Swedish]:"Gameshow",[g.Danish]:"Quizshow"},"Film Noir":{[g.English]:"Film Noir",[g.Swedish]:"Film noir",[g.Danish]:"Film noir"},Entertainment:{[g.English]:"Entertainment",[g.Swedish]:"Underhållning",[g.Danish]:"Underholdning"},News:{[g.English]:"News",[g.Swedish]:"Nyheter",[g.Danish]:"Nyheder"},Short:{[g.English]:"Short",[g.Swedish]:"Kortfilm",[g.Danish]:"Kortfilm"},Bollywood:{[g.English]:"Bollywood",[g.Swedish]:"Bollywood",[g.Danish]:"Bollywood"},Concert:{[g.English]:"Concert",[g.Swedish]:"Konsert",[g.Danish]:"Koncert"},Arthouse:{[g.English]:"Arthouse",[g.Swedish]:"Arthouse",[g.Danish]:"Arthouse"},"Alternate Version":{[g.English]:"Alternate Version",[g.Swedish]:"Alternativ version",[g.Danish]:"Alternativ version"},"Reality TV":{[g.English]:"Reality TV",[g.Swedish]:"Reality-TV",[g.Danish]:"Reality-TV"},Culture:{[g.English]:"Culture",[g.Swedish]:"Kultur",[g.Danish]:"Kultur"},Drama:{[g.English]:"Drama",[g.Swedish]:"Drama",[g.Danish]:"Drama"},Crime:{[g.English]:"Crime",[g.Swedish]:"Kriminal",[g.Danish]:"Krimi"},Western:{[g.English]:"Western",[g.Swedish]:"Western",[g.Danish]:"Western"},Thriller:{[g.English]:"Thriller",[g.Swedish]:"Thriller",[g.Danish]:"Thriller"},Animation:{[g.English]:"Animation",[g.Swedish]:"Animerat",[g.Danish]:"Animation"},Mystery:{[g.English]:"Mystery",[g.Swedish]:"Mysterium",[g.Danish]:"Mysterium"},Science:{[g.English]:"Science",[g.Swedish]:"Vetenskap",[g.Danish]:"Videnskab"},Nature:{[g.English]:"Nature",[g.Swedish]:"Natur",[g.Danish]:"Natur"},War:{[g.English]:"War",[g.Swedish]:"Krig",[g.Danish]:"Krig"},"Sci-Fi":{[g.English]:"Sci-Fi",[g.Swedish]:"Sci-fi",[g.Danish]:"Sci-fi"},Documentary:{[g.English]:"Documentary",[g.Swedish]:"Dokumentär",[g.Danish]:"Dokumentar"},"Stand-up":{[g.English]:"Stand-up",[g.Swedish]:"Standup",[g.Danish]:"Stand-up"},"Talk Show":{[g.English]:"Talk Show",[g.Swedish]:"Talkshow",[g.Danish]:"Talkshow"},Fantasy:{[g.English]:"Fantasy",[g.Swedish]:"Fantasy",[g.Danish]:"Fantasy"},History:{[g.English]:"History",[g.Swedish]:"Historia",[g.Danish]:"Historie"},Adventure:{[g.English]:"Adventure",[g.Swedish]:"Äventyr",[g.Danish]:"Eventyr"},Action:{[g.English]:"Action",[g.Swedish]:"Action",[g.Danish]:"Action"},Horror:{[g.English]:"Horror",[g.Swedish]:"Skräck",[g.Danish]:"Gyser"},Comedy:{[g.English]:"Comedy",[g.Swedish]:"Komedi",[g.Danish]:"Komedie"},Biography:{[g.English]:"Biography",[g.Swedish]:"Biografi",[g.Danish]:"Biografi"},Music:{[g.English]:"Music",[g.Swedish]:"Musik",[g.Danish]:"Musik"},Sport:{[g.English]:"Sport",[g.Swedish]:"Sport",[g.Danish]:"Sport"},Romance:{[g.English]:"Romance",[g.Swedish]:"Romantik",[g.Danish]:"Romantik"},Kids:{[g.English]:"Kids",[g.Swedish]:"Barn",[g.Danish]:"Børn"},Lifestyle:{[g.English]:"Lifestyle",[g.Swedish]:"Livsstil",[g.Danish]:"Livsstil"},Musical:{[g.English]:"Musical",[g.Swedish]:"Musikal",[g.Danish]:"Musical"},Anime:{[g.English]:"Anime",[g.Swedish]:"Anime",[g.Danish]:"Anime"},Family:{[g.English]:"Family",[g.Swedish]:"Familj",[g.Danish]:"Familie"}};function fe(t,e=Ua()){var i;return((i=nu[t])==null?void 0:i[e])||t}const In=Object.freeze({Popular:"-popularity",New:"-new",Best:"-best"}),ru=t=>t;function Vr(t){const e=t-1;return e*e*e+1}function as(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function Tt(t,{delay:e=0,duration:i=400,easing:a=ru}={}){const n=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:r=>`opacity: ${r*n}`}}function ha(t,{delay:e=0,duration:i=400,easing:a=Vr,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]=as(n),[f,b]=as(r);return{delay:e,duration:i,easing:a,css:(h,_)=>`
|
|
6
6
|
transform: ${d} translate(${(1-h)*v}${p}, ${(1-h)*f}${b});
|
|
7
7
|
opacity: ${c-u*_}`}}function Ga(t,{delay:e=0,duration:i=400,easing:a=Vr,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(m=>`${m[0].toUpperCase()}${m.slice(1)}`),v=parseFloat(r[`padding${u[0]}`]),p=parseFloat(r[`padding${u[1]}`]),f=parseFloat(r[`margin${u[0]}`]),b=parseFloat(r[`margin${u[1]}`]),h=parseFloat(r[`border${u[0]}Width`]),_=parseFloat(r[`border${u[1]}Width`]);return{delay:e,duration:i,easing:a,css:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*o};${s}: ${m*c}px;padding-${d[0]}: ${m*v}px;padding-${d[1]}: ${m*p}px;margin-${d[0]}: ${m*f}px;margin-${d[1]}: ${m*b}px;border-${d[0]}-width: ${m*h}px;border-${d[1]}-width: ${m*_}px;min-${s}: 0`}}function ga(t,{delay:e=0,duration:i=400,easing:a=Vr,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});
|
package/dist/link-injections.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(){"use strict";function m(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}const I="https://partner-api.playpilot.tech/1.0",h={};async function
|
|
1
|
+
(function(){"use strict";function m(){var e;return(e=window.PlayPilotLinkInjections)==null?void 0:e.token}const I="https://partner-api.playpilot.tech/1.0",h={};async function u(e,{headers:t={},method:n="GET",body:i=null}={}){const o=!g()&&n==="GET";if(o&&e in h)return h[e];const c=n==="GET"?{}:{"Content-Type":"application/json"},l=await fetch(I+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 a=s;try{s&&(a=JSON.parse(s))}catch{}return o&&(h[e]=a),a}const w="EncryptedToken",y="articleReplacementEditToken",A="playpilot-editorial-mode";async function C({href:e=window.location.href,throwError:t=!1}={}){try{const n=m();if(!n)throw new Error("No token was provided");const i=k(e);if(!i)throw new Error("Could not be authenticated");return await u(`/external-pages/edit-authorization?api-token=${n}`,{method:"POST",body:{private_token:i}}),O(i),!0}catch(n){if(console.error(n),t)throw n}finally{M()}return!1}function k(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(y);if(c)return decodeURI(c)}return((o=("; "+document.cookie).split(`; ${w}=`).pop())==null?void 0:o.split(";")[0])||""}function O(e){const t=new Date;t.setTime(t.getTime()+30*24*60*60*1e3);const i="expires="+t.toUTCString();document.cookie=w+"="+e+";"+i+";path=/"}function g(){var t;const e=(t=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:t.editorial_token;return new URLSearchParams(window.location.search).get(A)==="true"||!!e}function M(){const e=new URL(window.location.href);e.searchParams.delete(y),window.history.replaceState({},"",e)}async function N(){const e=m();if(!e)throw new Error("No token was provided");try{return await await u(`/domains/config?api-token=${e}`)||null}catch{return null}}function R(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 U(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 v(){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 $(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(a=>{var r;return a.nodeType===Node.TEXT_NODE&&((r=a.nodeValue)==null?void 0:r.trim())!==""});if(c&&o.tagName==="LI"){const a=o.closest("ul, ol");a&&!n.includes(a)&&n.push(a);continue}const l=o.tagName==="P"&&!!o.textContent;if(c||l){n.push(o);continue}const s=Array.from(o.children);for(let a=s.length-1;a>=0;a--)i.push(s[a])}return n}function P(){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 z(e){return e.map(t=>t.innerText).join(`
|
|
2
2
|
|
|
3
|
-
`)}function
|
|
3
|
+
`)}function S(e=(t=>(t=window.PlayPilotLinkInjections)==null?void 0:t.config)()||null){const n=P(),i=$(n,(e==null?void 0:e.exclude_elements_selector)||""),o=z(i);return{parentElement:n,elements:i,pageText:o}}function E(){const e=P();return{content_heading:D(e),content_modified_time:G(e),content_published_time:H(e)}}function D(e){const t=e.querySelector("h1")||document.querySelector("h1");return(t==null?void 0:t.innerText.trim())||null}function G(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=x().dateModified||(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?_(n):null}function H(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=x().datePublished||(t==null?void 0:t.getAttribute("content"))||(t==null?void 0:t.getAttribute("datetime"))||(t==null?void 0:t.innerText);return n?_(n):null}function _(e){try{return new Date(e).toISOString()}catch{return null}}function x(){const t=Array.from(document.querySelectorAll('[type="application/ld+json"]')).find(n=>n.textContent.includes("dateModified")||n.textContent.includes("datePublished"));if(!t)return{};try{return JSON.parse(t.textContent||"")}catch{return{}}}function b(){const e=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+e}function B(e){return!!(e.exclude_urls_pattern&&b().match(new RegExp(e.exclude_urls_pattern)))}let p=null;async function d({url:e=b(),params:t={},method:n="GET"}={}){const i=m(),o=g()?await C():!1,c=v();if(!i)throw new Error("No token was provided");const l=`/external-pages/?api-token=${i}&include_title_details=true${o?"&editorial_mode_enabled=true":""}&language=${c}`;let s;if(n==="POST"){const{pageText:a}=S();t.run_ai&&(t.hash=R(a||""),t.page_text=a),t.url=e,t.metadata=E(),s=await u(l,{method:"POST",body:t})}else s=await u(l+`&url=${e}`,{method:"GET"});return window.PlayPilotLinkInjections.last_successful_fetch=s,s}async function F({requireCompletedResult:e=!1,runAiWhenRelevant:t=!1,pollInterval:n=3e3,maxTries:i=600,onpoll:o=()=>null}={}){let c=0;p&&clearTimeout(p);const l=async(s,a)=>{var L;let r;try{try{r=await d()}catch(f){throw console.error(f),(f==null?void 0:f.status)===404&&(r=await d({method:"POST"}),r.ai_enabled&&(r=await d({params:{run_ai:!0},method:"POST"}))),new Error}const{pageText:q}=S();if(console.log(q),console.log((L=document.querySelector("#content"))==null?void 0:L.innerText),r&&t&&(r=await J(q,r)),e&&r.ai_enabled&&r.ai_running)throw new Error;r.manual_injections=j(r.manual_injections||[]),r.ai_injections=j(r.ai_injections||[]),s(r);return}catch{if(c++,c>=i){i>1&&console.error("Max poll limit exceeded. Please return later."),s();return}r&&o(r),p=setTimeout(()=>l(s),n)}};return new Promise(l)}async function J(e,t){if(!e||!t.ai_enabled||t.ai_running)return t;const n=E().content_modified_time,i=t.content_modified_time?_(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 d({params:{run_ai:!0},method:"POST"})}function j(e){return e.map(t=>({...t,key:K(t.sid)}))}function K(e){return e+"-"+U()}function W(e){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=e)}function V(){const e=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(e)}window.PlayPilotLinkInjections||(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}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&&W({ads:!0,pixels:!0,tracking:!0,split_tests:!0,affiliate:!0}),this.config=await N()||{},!B(this.config)&&(this.initial_link_injections_promise=F({maxTries:1,runAiWhenRelevant:!V()}),this.mount())},destroy(){var e;(e=window.PlayPilotMount)==null||e.destroy(),delete window.PlayPilotLinkInjections},mount(){const e=g()||k(),t=document.createElement("script");t.id="playpilot-mount",t.src=`https://cdn.jsdelivr.net/npm/@playpilot/tpi@8.10.4-beta.3/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 cg=Object.defineProperty;var ss=Te=>{throw TypeError(Te)};var dg=(Te,Ee,qe)=
|
|
|
2
2
|
/*$vite$:1*/`,document.head.appendChild(Te);const Ee=!1;var qe=Array.isArray,Va=Array.prototype.indexOf,Ar=Array.from,fs=Object.defineProperty,di=Object.getOwnPropertyDescriptor,Kn=Object.getOwnPropertyDescriptors,hs=Object.prototype,gs=Array.prototype,Lr=Object.getPrototypeOf,Zn=Object.isExtensible;function Vi(t){return typeof t=="function"}const vt=()=>{};function ms(t){return typeof(t==null?void 0:t.then)=="function"}function ys(t){return t()}function Mr(t){for(var e=0;e<t.length;e++)t[e]()}function Yn(){var t,e,i=new Promise((a,r)=>{t=a,e=r});return{promise:i,resolve:t,reject:e}}function Jn(t,e,i=!1){return t===void 0?i?e():e:t}function Ui(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 Ke=2,Dr=4,Ua=8,Qn=1<<24,It=16,Qt=32,Ti=64,Wa=128,wt=512,Xe=1024,nt=2048,Xt=4096,dt=8192,$t=16384,Ga=32768,jt=65536,Xn=1<<17,$n=1<<18,Wi=1<<19,el=1<<20,ga=32768,qr=1<<21,Nr=1<<22,ui=1<<23,At=Symbol("$state"),tl=Symbol("legacy props"),bs=Symbol(""),Gi=new class extends Error{constructor(){super(...arguments);zt(this,"name","StaleReactionError");zt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Rr(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ws(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function xs(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function _s(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ks(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Ss(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ts(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Es(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ps(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Cs(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zs(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const il=1,al=2,rl=4,Is=8,js=16,As=1,Ls=2,Ms=4,Ds=8,qs=16,Ns=1,Rs=2,Os=4,Bs=1,Fs=2,Ue=Symbol(),Hs="http://www.w3.org/1999/xhtml",Vs="http://www.w3.org/2000/svg",Us="@attach";function Ws(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Gs(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function nl(t){return t===this.v}function ll(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function ol(t){return!ll(t,this.v)}let Ki=!1,Ks=!1;function Zs(){Ki=!0}let Se=null;function Zi(t){Se=t}function Or(t){return sl().get(t)}function Br(t,e){return sl().set(t,e),e}function te(t,e=!1,i){Se={p:Se,i:!1,c:null,e:null,s:t,x:null,l:Ki&&!e?{s:null,u:null,$:[]}:null}}function ie(t){var e=Se,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,Se=e.p,t??{}}function Ei(){return!Ki||Se!==null&&Se.l===null}function sl(t){return Se===null&&Rr(),Se.c??(Se.c=new Map(Ys(Se)||void 0))}function Ys(t){let e=t.p;for(;e!==null;){const i=e.c;if(i!==null)return i;e=e.p}return null}let Pi=[];function cl(){var t=Pi;Pi=[],Mr(t)}function ei(t){if(Pi.length===0&&!Ji){var e=Pi;queueMicrotask(()=>{e===Pi&&cl()})}Pi.push(t)}function Js(){for(;Pi.length>0;)cl()}function dl(t){var e=xe;if(e===null)return ye.f|=ui,t;if(e.f&Ga)Yi(t,e);else{if(!(e.f&Wa))throw t;e.b.error(t)}}function Yi(t,e){for(;e!==null;){if(e.f&Wa)try{e.b.error(t);return}catch(i){t=i}e=e.parent}throw t}const Ka=new Set;let me=null,Za=null,Re=null,ft=[],Ya=null,Fr=!1,Ji=!1;const kr=class kr{constructor(){ue(this,He);zt(this,"committed",!1);zt(this,"current",new Map);zt(this,"previous",new Map);ue(this,ca,new Set);ue(this,da,new Set);ue(this,qi,0);ue(this,Ni,0);ue(this,Na,null);ue(this,ua,[]);ue(this,pa,[]);zt(this,"skipped_effects",new Set);zt(this,"is_fork",!1)}is_deferred(){return this.is_fork||D(this,Ni)>0}process(e){var a;ft=[],Za=null,this.apply();var i={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const r of e)ze(this,He,Vn).call(this,r,i);this.is_fork||ze(this,He,cs).call(this),this.is_deferred()?(ze(this,He,Hi).call(this,i.effects),ze(this,He,Hi).call(this,i.render_effects),ze(this,He,Hi).call(this,i.block_effects)):(Za=this,me=null,vl(i.render_effects),vl(i.effects),Za=null,(a=D(this,Na))==null||a.resolve()),Re=null}capture(e,i){this.previous.has(e)||this.previous.set(e,i),e.f&ui||(this.current.set(e,e.v),Re==null||Re.set(e,e.v))}activate(){me=this,this.apply()}deactivate(){me===this&&(me=null,Re=null)}flush(){if(this.activate(),ft.length>0){if(pl(),me!==null&&me!==this)return}else D(this,qi)===0&&this.process([]);this.deactivate()}discard(){for(const e of D(this,da))e(this);D(this,da).clear()}increment(e){ce(this,qi,D(this,qi)+1),e&&ce(this,Ni,D(this,Ni)+1)}decrement(e){ce(this,qi,D(this,qi)-1),e&&ce(this,Ni,D(this,Ni)-1),this.revive()}revive(){for(const e of D(this,ua))$e(e,nt),Ci(e);for(const e of D(this,pa))$e(e,Xt),Ci(e);ce(this,ua,[]),ce(this,pa,[]),this.flush()}oncommit(e){D(this,ca).add(e)}ondiscard(e){D(this,da).add(e)}settled(){return(D(this,Na)??ce(this,Na,Yn())).promise}static ensure(){if(me===null){const e=me=new kr;Ka.add(me),Ji||kr.enqueue(()=>{me===e&&e.flush()})}return me}static enqueue(e){ei(e)}apply(){}};ca=new WeakMap,da=new WeakMap,qi=new WeakMap,Ni=new WeakMap,Na=new WeakMap,ua=new WeakMap,pa=new WeakMap,He=new WeakSet,Vn=function(e,i){var u;e.f^=Xe;for(var a=e.first;a!==null;){var r=a.f,n=(r&(Qt|Ti))!==0,l=n&&(r&Xe)!==0,c=l||(r&dt)!==0||this.skipped_effects.has(a);if(a.f&Wa&&((u=a.b)!=null&&u.is_pending())&&(i={parent:i,effect:a,effects:[],render_effects:[],block_effects:[]}),!c&&a.fn!==null){n?a.f^=Xe:r&Dr?i.effects.push(a):ka(a)&&(a.f&It&&i.block_effects.push(a),Sa(a));var s=a.first;if(s!==null){a=s;continue}}var d=a.parent;for(a=a.next;a===null&&d!==null;)d===i.effect&&(ze(this,He,Hi).call(this,i.effects),ze(this,He,Hi).call(this,i.render_effects),ze(this,He,Hi).call(this,i.block_effects),i=i.parent),a=d.next,d=d.parent}},Hi=function(e){for(const i of e)(i.f&nt?D(this,ua):D(this,pa)).push(i),ze(this,He,Un).call(this,i.deps),$e(i,Xe)},Un=function(e){if(e!==null)for(const i of e)!(i.f&Ke)||!(i.f&ga)||(i.f^=ga,ze(this,He,Un).call(this,i.deps))},cs=function(){if(D(this,Ni)===0){for(const e of D(this,ca))e();D(this,ca).clear()}D(this,qi)===0&&ze(this,He,ds).call(this)},ds=function(){var n;if(Ka.size>1){this.previous.clear();var e=Re,i=!0,a={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const l of Ka){if(l===this){i=!1;continue}const c=[];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;c.push(d)}if(c.length===0)continue;const s=[...l.current.keys()].filter(d=>!this.current.has(d));if(s.length>0){var r=ft;ft=[];const d=new Set,u=new Map;for(const p of c)fl(p,s,d,u);if(ft.length>0){me=l,l.apply();for(const p of ft)ze(n=l,He,Vn).call(n,p,a);l.deactivate()}ft=r}}me=null,Re=e}this.committed=!0,Ka.delete(this)};let Lt=kr;function ul(t){var e=Ji;Ji=!0;try{for(var i;;){if(Js(),ft.length===0&&(me==null||me.flush(),ft.length===0))return Ya=null,i;pl()}}finally{Ji=e}}function pl(){var t=hi;Fr=!0;var e=null;try{var i=0;for(Qa(!0);ft.length>0;){var a=Lt.ensure();if(i++>1e3){var r,n;Qs()}a.process(ft),pi.clear()}}finally{Fr=!1,Qa(t),Ya=null}}function Qs(){try{Ss()}catch(t){Yi(t,Ya)}}let xt=null;function vl(t){var e=t.length;if(e!==0){for(var i=0;i<e;){var a=t[i++];if(!(a.f&($t|dt))&&ka(a)&&(xt=new Set,Sa(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?Dl(a):a.fn=null),(xt==null?void 0:xt.size)>0)){pi.clear();for(const r of xt){if(r.f&($t|dt))continue;const n=[r];let l=r.parent;for(;l!==null;)xt.has(l)&&(xt.delete(l),n.push(l)),l=l.parent;for(let c=n.length-1;c>=0;c--){const s=n[c];s.f&($t|dt)||Sa(s)}}xt.clear()}}xt=null}}function fl(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&Ke?fl(r,e,i,a):n&(Nr|It)&&!(n&nt)&&hl(r,e,a)&&($e(r,nt),Ci(r))}}function hl(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&Ke&&hl(r,e,i))return i.set(r,!0),!0}return i.set(t,!1),!1}function Ci(t){for(var e=Ya=t;e.parent!==null;){e=e.parent;var i=e.f;if(Fr&&e===xe&&i&It&&!(i&$n))return;if(i&(Ti|Qt)){if(!(i&Xe))return;e.f^=Xe}}ft.push(e)}function gl(t){let e=0,i=Dt(0),a;return()=>{wa()&&(o(i),Ja(()=>(e===0&&(a=Ot(()=>t(()=>vi(i)))),e+=1,()=>{ei(()=>{e-=1,e===0&&(a==null||a(),a=void 0,vi(i))})})))}}var Xs=jt|Wi|Wa;function $s(t,e,i){new ec(t,e,i)}class ec{constructor(e,i,a){ue(this,We);zt(this,"parent");ue(this,mt,!1);ue(this,yt);ue(this,Bn,null);ue(this,Ut);ue(this,Ri);ue(this,Wt);ue(this,bt,null);ue(this,ct,null);ue(this,Gt,null);ue(this,si,null);ue(this,wi,null);ue(this,Oi,0);ue(this,xi,0);ue(this,Bi,!1);ue(this,_i,null);ue(this,Sr,gl(()=>(ce(this,_i,Dt(D(this,Oi))),()=>{ce(this,_i,null)})));ce(this,yt,e),ce(this,Ut,i),ce(this,Ri,a),this.parent=xe.b,ce(this,mt,!!D(this,Ut).pending),ce(this,Wt,fi(()=>{xe.b=this;{var r=ze(this,We,Wn).call(this);try{ce(this,bt,lt(()=>a(r)))}catch(n){this.error(n)}D(this,xi)>0?ze(this,We,jr).call(this):ce(this,mt,!1)}return()=>{var n;(n=D(this,wi))==null||n.remove()}},Xs))}is_pending(){return D(this,mt)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!D(this,Ut).pending}update_pending_count(e){ze(this,We,Gn).call(this,e),ce(this,Oi,D(this,Oi)+e),D(this,_i)&&ti(D(this,_i),D(this,Oi))}get_effect_pending(){return D(this,Sr).call(this),o(D(this,_i))}error(e){var i=D(this,Ut).onerror;let a=D(this,Ut).failed;if(D(this,Bi)||!i&&!a)throw e;D(this,bt)&&(Ze(D(this,bt)),ce(this,bt,null)),D(this,ct)&&(Ze(D(this,ct)),ce(this,ct,null)),D(this,Gt)&&(Ze(D(this,Gt)),ce(this,Gt,null));var r=!1,n=!1;const l=()=>{if(r){Gs();return}r=!0,n&&zs(),Lt.ensure(),ce(this,Oi,0),D(this,Gt)!==null&&Xi(D(this,Gt),()=>{ce(this,Gt,null)}),ce(this,mt,this.has_pending_snippet()),ce(this,bt,ze(this,We,Ir).call(this,()=>(ce(this,Bi,!1),lt(()=>D(this,Ri).call(this,D(this,yt)))))),D(this,xi)>0?ze(this,We,jr).call(this):ce(this,mt,!1)};var c=ye;try{ot(null),n=!0,i==null||i(e,l),n=!1}catch(s){Yi(s,D(this,Wt)&&D(this,Wt).parent)}finally{ot(c)}a&&ei(()=>{ce(this,Gt,ze(this,We,Ir).call(this,()=>{Lt.ensure(),ce(this,Bi,!0);try{return lt(()=>{a(D(this,yt),()=>e,()=>l)})}catch(s){return Yi(s,D(this,Wt).parent),null}finally{ce(this,Bi,!1)}}))})}}mt=new WeakMap,yt=new WeakMap,Bn=new WeakMap,Ut=new WeakMap,Ri=new WeakMap,Wt=new WeakMap,bt=new WeakMap,ct=new WeakMap,Gt=new WeakMap,si=new WeakMap,wi=new WeakMap,Oi=new WeakMap,xi=new WeakMap,Bi=new WeakMap,_i=new WeakMap,Sr=new WeakMap,We=new WeakSet,ug=function(){try{ce(this,bt,lt(()=>D(this,Ri).call(this,D(this,yt))))}catch(e){this.error(e)}ce(this,mt,!1)},pg=function(){const e=D(this,Ut).pending;e&&(ce(this,ct,lt(()=>e(D(this,yt)))),Lt.enqueue(()=>{var i=ze(this,We,Wn).call(this);ce(this,bt,ze(this,We,Ir).call(this,()=>(Lt.ensure(),lt(()=>D(this,Ri).call(this,i))))),D(this,xi)>0?ze(this,We,jr).call(this):(Xi(D(this,ct),()=>{ce(this,ct,null)}),ce(this,mt,!1))}))},Wn=function(){var e=D(this,yt);return D(this,mt)&&(ce(this,wi,qt()),D(this,yt).before(D(this,wi)),e=D(this,wi)),e},Ir=function(e){var i=xe,a=ye,r=Se;Rt(D(this,Wt)),ot(D(this,Wt)),Zi(D(this,Wt).ctx);try{return e()}catch(n){return dl(n),null}finally{Rt(i),ot(a),Zi(r)}},jr=function(){const e=D(this,Ut).pending;D(this,bt)!==null&&(ce(this,si,document.createDocumentFragment()),D(this,si).append(D(this,wi)),Rl(D(this,bt),D(this,si))),D(this,ct)===null&&ce(this,ct,lt(()=>e(D(this,yt))))},Gn=function(e){var i;if(!this.has_pending_snippet()){this.parent&&ze(i=this.parent,We,Gn).call(i,e);return}ce(this,xi,D(this,xi)+e),D(this,xi)===0&&(ce(this,mt,!1),D(this,ct)&&Xi(D(this,ct),()=>{ce(this,ct,null)}),D(this,si)&&(D(this,yt).before(D(this,si)),ce(this,si,null)))};let zi=null;function ml(t){zi=t}function Ie(t,e){return e}function tc(t,e,i){for(var a=[],r=e.length,n=0;n<r;n++)Kr(e[n].e,a,!0);ql(a,()=>{var l=a.length===0&&i!==null;if(l){var c=i,s=c.parentNode;cc(s),s.append(c),t.items.clear(),Mt(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),Mt(t,u.prev,u.next)),Ze(u.e,!l)}t.first===e[0]&&(t.first=e[0].prev)})}function Pe(t,e,i,a,r,n=null){var l=t,c=new Map,s=null,d=(e&rl)!==0,u=(e&il)!==0,p=(e&al)!==0;if(d){var f=t;l=f.appendChild(qt())}var h=null,g=Vr(()=>{var T=i();return qe(T)?T:T==null?[]:Ar(T)}),m,w=!0;function y(){ic(x,m,l,e,a),h!==null&&(m.length===0?(h.fragment?(l.before(h.fragment),h.fragment=null):Zr(h.effect),_.first=h.effect):Xi(h.effect,()=>{h=null}))}var _=fi(()=>{m=o(g);for(var T=m.length,A=new Set,z=me,E=null,N=Cl(),L=0;L<T;L+=1){var M=m[L],k=a(M,L),C=w?null:c.get(k);C?(u&&ti(C.v,M),p?ti(C.i,L):C.i=L,N&&z.skipped_effects.delete(C.e)):(C=ac(w?l:null,E,M,k,L,r,e,i),w&&(C.o=!0,E===null?s=C:E.next=C,E=C),c.set(k,C)),A.add(k)}if(T===0&&n&&!h)if(w)h={fragment:null,effect:lt(()=>n(l))};else{var P=document.createDocumentFragment(),q=qt();P.append(q),h={fragment:P,effect:lt(()=>n(q))}}if(!w)if(N){for(const[B,J]of c)A.has(B)||z.skipped_effects.add(J.e);z.oncommit(y),z.ondiscard(()=>{})}else y();o(g)}),x={effect:_,flags:e,items:c,first:s};w=!1}function ic(t,e,i,a,r){var M,k,C,P;var n=(a&Is)!==0,l=e.length,c=t.items,s=t.first,d,u=null,p,f=[],h=[],g,m,w,y;if(n)for(y=0;y<l;y+=1)g=e[y],m=r(g,y),w=c.get(m),w.o&&((M=w.a)==null||M.measure(),(p??(p=new Set)).add(w));for(y=0;y<l;y+=1){if(g=e[y],m=r(g,y),w=c.get(m),t.first??(t.first=w),!w.o){w.o=!0;var _=u?u.next:s;Mt(t,u,w),Mt(t,w,_),Hr(w,_,i),u=w,f=[],h=[],s=u.next;continue}if(w.e.f&dt&&(Zr(w.e),n&&((k=w.a)==null||k.unfix(),(p??(p=new Set)).delete(w))),w!==s){if(d!==void 0&&d.has(w)){if(f.length<h.length){var x=h[0],T;u=x.prev;var A=f[0],z=f[f.length-1];for(T=0;T<f.length;T+=1)Hr(f[T],x,i);for(T=0;T<h.length;T+=1)d.delete(h[T]);Mt(t,A.prev,z.next),Mt(t,u,A),Mt(t,z,x),s=x,u=z,y-=1,f=[],h=[]}else d.delete(w),Hr(w,s,i),Mt(t,w.prev,w.next),Mt(t,w,u===null?t.first:u.next),Mt(t,u,w),u=w;continue}for(f=[],h=[];s!==null&&s.k!==m;)s.e.f&dt||(d??(d=new Set)).add(s),h.push(s),s=s.next;if(s===null)continue;w=s}f.push(w),u=w,s=w.next}if(s!==null||d!==void 0){for(var E=d===void 0?[]:Ar(d);s!==null;)s.e.f&dt||E.push(s),s=s.next;var N=E.length;if(N>0){var L=a&rl&&l===0?i:null;if(n){for(y=0;y<N;y+=1)(C=E[y].a)==null||C.measure();for(y=0;y<N;y+=1)(P=E[y].a)==null||P.fix()}tc(t,E,L)}}n&&ei(()=>{var q;if(p!==void 0)for(w of p)(q=w.a)==null||q.apply()})}function ac(t,e,i,a,r,n,l,c){var s=zi,d=(l&il)!==0,u=(l&js)===0,p=d?u?Gr(i,!1,!1):Dt(i):i,f=l&al?Dt(r):r,h={i:f,v:p,k:a,a:null,e:null,o:!1,prev:e,next:null};zi=h;try{if(t===null){var g=document.createDocumentFragment();g.append(t=qt())}return h.e=lt(()=>n(t,p,f,c)),e!==null&&(e.next=h),h}finally{zi=s}}function Hr(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=ba(n);r.before(n),n=l}}function Mt(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 yl(t,e,i,a){const r=Ei()?ya:Vr;if(i.length===0&&t.length===0){a(e.map(r));return}var n=me,l=xe,c=bl();function s(){Promise.all(i.map(d=>rc(d))).then(d=>{c();try{a([...e.map(r),...d])}catch(u){l.f&$t||Yi(u,l)}n==null||n.deactivate(),ma()}).catch(d=>{Yi(d,l)})}t.length>0?Promise.all(t).then(()=>{c();try{return s()}finally{n==null||n.deactivate(),ma()}}):s()}function bl(){var t=xe,e=ye,i=Se,a=me;return function(n=!0){Rt(t),ot(e),Zi(i),n&&(a==null||a.activate())}}function ma(){Rt(null),ot(null),Zi(null)}function ya(t){var e=Ke|nt,i=ye!==null&&ye.f&Ke?ye:null;return xe!==null&&(xe.f|=Wi),{ctx:Se,deps:null,effects:null,equals:nl,f:e,fn:t,reactions:null,rv:0,v:Ue,wv:0,parent:i??xe,ac:null}}function rc(t,e){let i=xe;i===null&&ws();var a=i.b,r=void 0,n=Dt(Ue),l=!ye,c=new Map;return mc(()=>{var f;var s=Yn();r=s.promise;try{Promise.resolve(t()).then(s.resolve,s.reject).then(()=>{d===me&&d.committed&&d.deactivate(),ma()})}catch(h){s.reject(h),ma()}var d=me;if(l){var u=!a.is_pending();a.update_pending_count(1),d.increment(u),(f=c.get(d))==null||f.reject(Gi),c.delete(d),c.set(d,s)}const p=(h,g=void 0)=>{if(d.activate(),g)g!==Gi&&(n.f|=ui,ti(n,g));else{n.f&ui&&(n.f^=ui),ti(n,h);for(const[m,w]of c){if(c.delete(m),m===d)break;w.reject(Gi)}}l&&(a.update_pending_count(-1),d.decrement(u))};s.promise.then(p,h=>p(null,h||"unknown"))}),xa(()=>{for(const s of c.values())s.reject(Gi)}),new Promise(s=>{function d(u){function p(){u===r?s(n):d(r)}u.then(p,p)}d(r)})}function U(t){const e=ya(t);return Bl(e),e}function Vr(t){const e=ya(t);return e.equals=ol,e}function wl(t){var e=t.effects;if(e!==null){t.effects=null;for(var i=0;i<e.length;i+=1)Ze(e[i])}}function nc(t){for(var e=t.parent;e!==null;){if(!(e.f&Ke))return e.f&$t?null:e;e=e.parent}return null}function Ur(t){var e,i=xe;Rt(nc(t));try{t.f&=~ga,wl(t),e=Wl(t)}finally{Rt(i)}return e}function xl(t){var e=Ur(t);if(t.equals(e)||(me!=null&&me.is_fork||(t.v=e),t.wv=Vl()),!Ai)if(Re!==null)(wa()||me!=null&&me.is_fork)&&Re.set(t,e);else{var i=t.f&wt?Xe:Xt;$e(t,i)}}let Wr=new Set;const pi=new Map;let _l=!1;function Dt(t,e){var i={f:0,v:t,reactions:null,equals:nl,rv:0,wv:0};return i}function G(t,e){const i=Dt(t);return Bl(i),i}function Gr(t,e=!1,i=!0){var r;const a=Dt(t);return e||(a.equals=ol),Ki&&i&&Se!==null&&Se.l!==null&&((r=Se.l).s??(r.s=[])).push(a),a}function R(t,e,i=!1){ye!==null&&(!Nt||ye.f&Xn)&&Ei()&&ye.f&(Ke|It|Nr|Xn)&&!(tt!=null&&tt.includes(t))&&Cs();let a=i?Le(e):e;return ti(t,a)}function ti(t,e){if(!t.equals(e)){var i=t.v;Ai?pi.set(t,e):pi.set(t,i),t.v=e;var a=Lt.ensure();a.capture(t,i),t.f&Ke&&(t.f&nt&&Ur(t),$e(t,t.f&wt?Xe:Xt)),t.wv=Vl(),kl(t,nt),Ei()&&xe!==null&&xe.f&Xe&&!(xe.f&(Qt|Ti))&&(ht===null?wc([t]):ht.push(t)),!a.is_fork&&Wr.size>0&&!_l&&lc()}return e}function lc(){_l=!1;var t=hi;Qa(!0);const e=Array.from(Wr);try{for(const i of e)i.f&Xe&&$e(i,Xt),ka(i)&&Sa(i)}finally{Qa(t)}Wr.clear()}function vi(t){R(t,t.v+1)}function kl(t,e){var i=t.reactions;if(i!==null)for(var a=Ei(),r=i.length,n=0;n<r;n++){var l=i[n],c=l.f;if(!(!a&&l===xe)){var s=(c&nt)===0;if(s&&$e(l,e),c&Ke){var d=l;Re==null||Re.delete(d),c&ga||(c&wt&&(l.f|=ga),kl(d,Xt))}else s&&(c&It&&xt!==null&&xt.add(l),Ci(l))}}}function Le(t){if(typeof t!="object"||t===null||At in t)return t;const e=Lr(t);if(e!==hs&&e!==gs)return t;var i=new Map,a=qe(t),r=G(0),n=ii,l=c=>{if(ii===n)return c();var s=ye,d=ii;ot(null),Hl(n);var u=c();return ot(s),Hl(d),u};return a&&i.set("length",G(t.length)),new Proxy(t,{defineProperty(c,s,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&Es();var u=i.get(s);return u===void 0?u=l(()=>{var p=G(d.value);return i.set(s,p),p}):R(u,d.value,!0),!0},deleteProperty(c,s){var d=i.get(s);if(d===void 0){if(s in c){const u=l(()=>G(Ue));i.set(s,u),vi(r)}}else R(d,Ue),vi(r);return!0},get(c,s,d){var h;if(s===At)return t;var u=i.get(s),p=s in c;if(u===void 0&&(!p||(h=di(c,s))!=null&&h.writable)&&(u=l(()=>{var g=Le(p?c[s]:Ue),m=G(g);return m}),i.set(s,u)),u!==void 0){var f=o(u);return f===Ue?void 0:f}return Reflect.get(c,s,d)},getOwnPropertyDescriptor(c,s){var d=Reflect.getOwnPropertyDescriptor(c,s);if(d&&"value"in d){var u=i.get(s);u&&(d.value=o(u))}else if(d===void 0){var p=i.get(s),f=p==null?void 0:p.v;if(p!==void 0&&f!==Ue)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(c,s){var f;if(s===At)return!0;var d=i.get(s),u=d!==void 0&&d.v!==Ue||Reflect.has(c,s);if(d!==void 0||xe!==null&&(!u||(f=di(c,s))!=null&&f.writable)){d===void 0&&(d=l(()=>{var h=u?Le(c[s]):Ue,g=G(h);return g}),i.set(s,d));var p=o(d);if(p===Ue)return!1}return u},set(c,s,d,u){var x;var p=i.get(s),f=s in c;if(a&&s==="length")for(var h=d;h<p.v;h+=1){var g=i.get(h+"");g!==void 0?R(g,Ue):h in c&&(g=l(()=>G(Ue)),i.set(h+"",g))}if(p===void 0)(!f||(x=di(c,s))!=null&&x.writable)&&(p=l(()=>G(void 0)),R(p,Le(d)),i.set(s,p));else{f=p.v!==Ue;var m=l(()=>Le(d));R(p,m)}var w=Reflect.getOwnPropertyDescriptor(c,s);if(w!=null&&w.set&&w.set.call(u,d),!f){if(a&&typeof s=="string"){var y=i.get("length"),_=Number(s);Number.isInteger(_)&&_>=y.v&&R(y,_+1)}vi(r)}return!0},ownKeys(c){o(r);var s=Reflect.ownKeys(c).filter(p=>{var f=i.get(p);return f===void 0||f.v!==Ue});for(var[d,u]of i)u.v!==Ue&&!(d in c)&&s.push(d);return s},setPrototypeOf(){Ps()}})}function Sl(t){try{if(t!==null&&typeof t=="object"&&At in t)return t[At]}catch{}return t}function oc(t,e){return Object.is(Sl(t),Sl(e))}var je,Tl,El,Pl;function sc(){if(je===void 0){je=window,Tl=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,i=Text.prototype;El=di(e,"firstChild").get,Pl=di(e,"nextSibling").get,Zn(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Zn(i)&&(i.__t=void 0)}}function qt(t=""){return document.createTextNode(t)}function Qi(t){return El.call(t)}function ba(t){return Pl.call(t)}function S(t,e){return Qi(t)}function Y(t,e=!1){{var i=Qi(t);return i instanceof Comment&&i.data===""?ba(i):i}}function j(t,e=1,i=!1){let a=t;for(;e--;)a=ba(a);return a}function cc(t){t.textContent=""}function Cl(){return!1}function dc(t,e){if(e){const i=document.body;t.autofocus=!0,ei(()=>{document.activeElement===i&&t.focus()})}}let zl=!1;function uc(){zl||(zl=!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 pc(t,e,i,a=!0){a&&i();for(var r of e)t.addEventListener(r,i);xa(()=>{for(var n of e)t.removeEventListener(n,i)})}function Ii(t){var e=ye,i=xe;ot(null),Rt(null);try{return t()}finally{ot(e),Rt(i)}}function vc(t,e,i,a=i){t.addEventListener(e,()=>Ii(i));const r=t.__on_r;r?t.__on_r=()=>{r(),a(!0)}:t.__on_r=()=>a(!0),uc()}function Il(t){xe===null&&(ye===null&&ks(),_s()),Ai&&xs()}function fc(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=xe;a!==null&&a.f&dt&&(t|=dt);var r={ctx:Se,deps:null,nodes_start:null,nodes_end:null,f:t|nt|wt,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{Sa(r),r.f|=Ga}catch(c){throw Ze(r),c}else e!==null&&Ci(r);var n=r;if(i&&n.deps===null&&n.teardown===null&&n.nodes_start===null&&n.first===n.last&&!(n.f&Wi)&&(n=n.first,t&It&&t&jt&&n!==null&&(n.f|=jt)),n!==null&&(n.parent=a,a!==null&&fc(n,a),ye!==null&&ye.f&Ke&&!(t&Ti))){var l=ye;(l.effects??(l.effects=[])).push(n)}return r}function wa(){return ye!==null&&!Nt}function xa(t){const e=_t(Ua,null,!1);return $e(e,Xe),e.teardown=t,e}function Be(t){Il();var e=xe.f,i=!ye&&(e&Qt)!==0&&(e&Ga)===0;if(i){var a=Se;(a.e??(a.e=[])).push(t)}else return jl(t)}function jl(t){return _t(Dr|el,t,!1)}function hc(t){return Il(),_t(Ua|el,t,!0)}function gc(t){Lt.ensure();const e=_t(Ti|Wi,t,!0);return(i={})=>new Promise(a=>{i.outro?Xi(e,()=>{Ze(e),a(void 0)}):(Ze(e),a(void 0))})}function ji(t){return _t(Dr,t,!1)}function mc(t){return _t(Nr|Wi,t,!0)}function Ja(t,e=0){return _t(Ua|e,t,!0)}function V(t,e=[],i=[],a=[]){yl(a,e,i,r=>{_t(Ua,()=>t(...r.map(o)),!0)})}function fi(t,e=0){var i=_t(It|e,t,!0);return i}function Al(t,e=0){var i=_t(Qn|e,t,!0);return i}function lt(t){return _t(Qt|Wi,t,!0)}function Ll(t){var e=t.teardown;if(e!==null){const i=Ai,a=ye;Ol(!0),ot(null);try{e.call(null)}finally{Ol(i),ot(a)}}}function Ml(t,e=!1){var i=t.first;for(t.first=t.last=null;i!==null;){const r=i.ac;r!==null&&Ii(()=>{r.abort(Gi)});var a=i.next;i.f&Ti?i.parent=null:Ze(i,e),i=a}}function yc(t){for(var e=t.first;e!==null;){var i=e.next;e.f&Qt||Ze(e),e=i}}function Ze(t,e=!0){var i=!1;(e||t.f&$n)&&t.nodes_start!==null&&t.nodes_end!==null&&(bc(t.nodes_start,t.nodes_end),i=!0),Ml(t,e&&!i),Xa(t,0),$e(t,$t);var a=t.transitions;if(a!==null)for(const n of a)n.stop();Ll(t);var r=t.parent;r!==null&&r.first!==null&&Dl(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function bc(t,e){for(;t!==null;){var i=t===e?null:ba(t);t.remove(),t=i}}function Dl(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 Xi(t,e,i=!0){var a=[];Kr(t,a,!0),ql(a,()=>{i&&Ze(t),e&&e()})}function ql(t,e){var i=t.length;if(i>0){var a=()=>--i||e();for(var r of t)r.out(a)}else e()}function Kr(t,e,i){if(!(t.f&dt)){if(t.f^=dt,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&jt)!==0||(a.f&Qt)!==0&&(t.f&It)!==0;Kr(a,e,n?i:!1),a=r}}}function Zr(t){Nl(t,!0)}function Nl(t,e){if(t.f&dt){t.f^=dt,t.f&Xe||($e(t,nt),Ci(t));for(var i=t.first;i!==null;){var a=i.next,r=(i.f&jt)!==0||(i.f&Qt)!==0;Nl(i,r?e:!1),i=a}if(t.transitions!==null)for(const n of t.transitions)(n.is_global||e)&&n.in()}}function Rl(t,e){for(var i=t.nodes_start,a=t.nodes_end;i!==null;){var r=i===a?null:ba(i);e.append(i),i=r}}let hi=!1;function Qa(t){hi=t}let Ai=!1;function Ol(t){Ai=t}let ye=null,Nt=!1;function ot(t){ye=t}let xe=null;function Rt(t){xe=t}let tt=null;function Bl(t){ye!==null&&(tt===null?tt=[t]:tt.push(t))}let it=null,ut=0,ht=null;function wc(t){ht=t}let Fl=1,_a=0,ii=_a;function Hl(t){ii=t}function Vl(){return++Fl}function ka(t){var e=t.f;if(e&nt)return!0;if(e&Ke&&(t.f&=-32769),e&Xt){var i=t.deps;if(i!==null)for(var a=i.length,r=0;r<a;r++){var n=i[r];if(ka(n)&&xl(n),n.wv>t.wv)return!0}e&wt&&Re===null&&$e(t,Xe)}return!1}function Ul(t,e,i=!0){var a=t.reactions;if(a!==null&&!(tt!=null&&tt.includes(t)))for(var r=0;r<a.length;r++){var n=a[r];n.f&Ke?Ul(n,e,!1):e===n&&(i?$e(n,nt):n.f&Xe&&$e(n,Xt),Ci(n))}}function Wl(t){var g;var e=it,i=ut,a=ht,r=ye,n=tt,l=Se,c=Nt,s=ii,d=t.f;it=null,ut=0,ht=null,ye=d&(Qt|Ti)?null:t,tt=null,Zi(t.ctx),Nt=!1,ii=++_a,t.ac!==null&&(Ii(()=>{t.ac.abort(Gi)}),t.ac=null);try{t.f|=qr;var u=t.fn,p=u(),f=t.deps;if(it!==null){var h;if(Xa(t,ut),f!==null&&ut>0)for(f.length=ut+it.length,h=0;h<it.length;h++)f[ut+h]=it[h];else t.deps=f=it;if(hi&&wa()&&t.f&wt)for(h=ut;h<f.length;h++)((g=f[h]).reactions??(g.reactions=[])).push(t)}else f!==null&&ut<f.length&&(Xa(t,ut),f.length=ut);if(Ei()&&ht!==null&&!Nt&&f!==null&&!(t.f&(Ke|Xt|nt)))for(h=0;h<ht.length;h++)Ul(ht[h],t);return r!==null&&r!==t&&(_a++,ht!==null&&(a===null?a=ht:a.push(...ht))),t.f&ui&&(t.f^=ui),p}catch(m){return dl(m)}finally{t.f^=qr,it=e,ut=i,ht=a,ye=r,tt=n,Zi(l),Nt=c,ii=s}}function xc(t,e){let i=e.reactions;if(i!==null){var a=Va.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&Ke&&(it===null||!it.includes(e))&&($e(e,Xt),e.f&wt&&(e.f^=wt,e.f&=-32769),wl(e),Xa(e,0))}function Xa(t,e){var i=t.deps;if(i!==null)for(var a=e;a<i.length;a++)xc(t,i[a])}function Sa(t){var e=t.f;if(!(e&$t)){$e(t,Xe);var i=xe,a=hi;xe=t,hi=!0;try{e&(It|Qn)?yc(t):Ml(t),Ll(t);var r=Wl(t);t.teardown=typeof r=="function"?r:null,t.wv=Fl;var n;Ee&&Ks&&t.f&nt&&t.deps}finally{hi=a,xe=i}}}async function Ta(){await Promise.resolve(),ul()}function o(t){var e=t.f,i=(e&Ke)!==0;if(ye!==null&&!Nt){var a=xe!==null&&(xe.f&$t)!==0;if(!a&&!(tt!=null&&tt.includes(t))){var r=ye.deps;if(ye.f&qr)t.rv<_a&&(t.rv=_a,it===null&&r!==null&&r[ut]===t?ut++:it===null?it=[t]:it.includes(t)||it.push(t));else{(ye.deps??(ye.deps=[])).push(t);var n=t.reactions;n===null?t.reactions=[ye]:n.includes(ye)||n.push(ye)}}}if(Ai){if(pi.has(t))return pi.get(t);if(i){var l=t,c=l.v;return(!(l.f&Xe)&&l.reactions!==null||Kl(l))&&(c=Ur(l)),pi.set(l,c),c}}else i&&(!(Re!=null&&Re.has(t))||me!=null&&me.is_fork&&!wa())&&(l=t,ka(l)&&xl(l),hi&&wa()&&!(l.f&wt)&&Gl(l));if(Re!=null&&Re.has(t))return Re.get(t);if(t.f&ui)throw t.v;return t.v}function Gl(t){if(t.deps!==null){t.f^=wt;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&Ke&&!(e.f&wt)&&Gl(e)}}function Kl(t){if(t.v===Ue)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(pi.has(e)||e.f&Ke&&Kl(e))return!0;return!1}function Ot(t){var e=Nt;try{return Nt=!0,t()}finally{Nt=e}}const _c=-7169;function $e(t,e){t.f=t.f&_c|e}function Zl(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(At in t)Yr(t);else if(!Array.isArray(t))for(let e in t){const i=t[e];typeof i=="object"&&i&&At in i&&Yr(i)}}}function Yr(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{Yr(t[a],e)}catch{}const i=Lr(t);if(i!==Object.prototype&&i!==Array.prototype&&i!==Map.prototype&&i!==Set.prototype&&i!==Date.prototype){const a=Kn(i);for(let r in a){const n=a[r].get;if(n)try{n.call(t)}catch{}}}}}function kc(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Sc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Tc(t){return Sc.includes(t)}const Ec={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 Pc(t){return t=t.toLowerCase(),Ec[t]??t}const Cc=["touchstart","touchmove"];function zc(t){return Cc.includes(t)}const Yl=new Set,Jr=new Set;function Qr(t,e,i,a={}){function r(n){if(a.capture||Ea.call(e,n),!n.cancelBubble)return Ii(()=>i==null?void 0:i.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?ei(()=>{e.addEventListener(t,r,a)}):e.addEventListener(t,r,a),r}function Ic(t,e,i,a={}){var r=Qr(e,t,i,a);return()=>{t.removeEventListener(e,r,a)}}function _e(t,e,i,a,r){var n={capture:a,passive:r},l=Qr(t,e,i,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&xa(()=>{e.removeEventListener(t,l,n)})}function pe(t){for(var e=0;e<t.length;e++)Yl.add(t[e]);for(var i of Jr)i(t)}let Jl=null;function Ea(t){var w;var e=this,i=e.ownerDocument,a=t.type,r=((w=t.composedPath)==null?void 0:w.call(t))||[],n=r[0]||t.target;Jl=t;var l=0,c=Jl===t&&t.__root;if(c){var s=r.indexOf(c);if(s!==-1&&(e===document||e===window)){t.__root=e;return}var d=r.indexOf(e);if(d===-1)return;s<=d&&(l=s)}if(n=r[l]||t.target,n!==e){fs(t,"currentTarget",{configurable:!0,get(){return n||i}});var u=ye,p=xe;ot(null),Rt(null);try{for(var f,h=[];n!==null;){var g=n.assignedSlot||n.parentNode||n.host||null;try{var m=n["__"+a];m!=null&&(!n.disabled||t.target===n)&&m.call(n,t)}catch(y){f?h.push(y):f=y}if(t.cancelBubble||g===e||g===null)break;n=g}if(f){for(let y of h)queueMicrotask(()=>{throw y});throw f}}finally{t.__root=e,delete t.currentTarget,ot(u),Rt(p)}}}function Ql(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function $i(t,e){var i=xe;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function I(t,e){var i=(e&Bs)!==0,a=(e&Fs)!==0,r,n=!t.startsWith("<!>");return()=>{r===void 0&&(r=Ql(n?t:"<!>"+t),i||(r=Qi(r)));var l=a||Tl?document.importNode(r,!0):r.cloneNode(!0);if(i){var c=Qi(l),s=l.lastChild;$i(c,s)}else $i(l,l);return l}}function jc(t,e,i="svg"){var a=!t.startsWith("<!>"),r=`<${i}>${a?t:"<!>"+t}</${i}>`,n;return()=>{if(!n){var l=Ql(r),c=Qi(l);n=Qi(c)}var s=n.cloneNode(!0);return $i(s,s),s}}function Ye(t,e){return jc(t,e,"svg")}function kt(t=""){{var e=qt(t+"");return $i(e,e),e}}function ve(){var t=document.createDocumentFragment(),e=document.createComment(""),i=qt();return t.append(e,i),$i(e,i),t}function b(t,e){t!==null&&t.before(e)}let $a=!0;function er(t){$a=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 Bt(t,e){return Ac(t,e)}const ea=new Map;function Ac(t,{target:e,anchor:i,props:a={},events:r,context:n,intro:l=!0}){sc();var c=new Set,s=p=>{for(var f=0;f<p.length;f++){var h=p[f];if(!c.has(h)){c.add(h);var g=zc(h);e.addEventListener(h,Ea,{passive:g});var m=ea.get(h);m===void 0?(document.addEventListener(h,Ea,{passive:g}),ea.set(h,1)):ea.set(h,m+1)}}};s(Ar(Yl)),Jr.add(s);var d=void 0,u=gc(()=>{var p=i??e.appendChild(qt());return $s(p,{pending:()=>{}},f=>{if(n){te({});var h=Se;h.c=n}r&&(a.$$events=r),$a=l,d=t(f,a)||{},$a=!0,n&&ie()}),()=>{var g;for(var f of c){e.removeEventListener(f,Ea);var h=ea.get(f);--h===0?(document.removeEventListener(f,Ea),ea.delete(f)):ea.set(f,h)}Jr.delete(s),p!==i&&((g=p.parentNode)==null||g.removeChild(p))}});return Xr.set(d,u),d}let Xr=new WeakMap;function ta(t,e){const i=Xr.get(t);return i?(Xr.delete(t),i(e)):Promise.resolve()}class ia{constructor(e,i=!0){zt(this,"anchor");ue(this,Et,new Map);ue(this,Kt,new Map);ue(this,pt,new Map);ue(this,Fi,new Set);ue(this,Ra,!0);ue(this,Oa,()=>{var e=me;if(D(this,Et).has(e)){var i=D(this,Et).get(e),a=D(this,Kt).get(i);if(a)Zr(a),D(this,Fi).delete(i);else{var r=D(this,pt).get(i);r&&(D(this,Kt).set(i,r.effect),D(this,pt).delete(i),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(const[n,l]of D(this,Et)){if(D(this,Et).delete(n),n===e)break;const c=D(this,pt).get(l);c&&(Ze(c.effect),D(this,pt).delete(l))}for(const[n,l]of D(this,Kt)){if(n===i||D(this,Fi).has(n))continue;const c=()=>{if(Array.from(D(this,Et).values()).includes(n)){var d=document.createDocumentFragment();Rl(l,d),d.append(qt()),D(this,pt).set(n,{effect:l,fragment:d})}else Ze(l);D(this,Fi).delete(n),D(this,Kt).delete(n)};D(this,Ra)||!a?(D(this,Fi).add(n),Xi(l,c,!1)):c()}}});ue(this,Tr,e=>{D(this,Et).delete(e);const i=Array.from(D(this,Et).values());for(const[a,r]of D(this,pt))i.includes(a)||(Ze(r.effect),D(this,pt).delete(a))});this.anchor=e,ce(this,Ra,i)}ensure(e,i){var a=me,r=Cl();if(i&&!D(this,Kt).has(e)&&!D(this,pt).has(e))if(r){var n=document.createDocumentFragment(),l=qt();n.append(l),D(this,pt).set(e,{effect:lt(()=>i(l)),fragment:n})}else D(this,Kt).set(e,lt(()=>i(this.anchor)));if(D(this,Et).set(a,e),r){for(const[c,s]of D(this,Kt))c===e?a.skipped_effects.delete(s):a.skipped_effects.add(s);for(const[c,s]of D(this,pt))c===e?a.skipped_effects.delete(s.effect):a.skipped_effects.add(s.effect);a.oncommit(D(this,Oa)),a.ondiscard(D(this,Tr))}else D(this,Oa).call(this)}}Et=new WeakMap,Kt=new WeakMap,pt=new WeakMap,Fi=new WeakMap,Ra=new WeakMap,Oa=new WeakMap,Tr=new WeakMap;const Lc=0,$r=1;function Pa(t,e,i,a,r){var n=Ei(),l=Ue,c=n?Dt(l):Gr(l,!1,!1),s=n?Dt(l):Gr(l,!1,!1),d=new ia(t);fi(()=>{var u=e(),p=!1;if(ms(u)){var f=bl(),h=!1;const g=m=>{if(!p){h=!0,f(!1),Lt.ensure();try{m()}finally{ma(),Ji||ul()}}};u.then(m=>{g(()=>{ti(c,m),d.ensure($r,a&&(w=>a(w,c)))})},m=>{g(()=>{if(ti(s,m),d.ensure($r,r&&(w=>r(w,s))),!r)throw s.v})}),ei(()=>{h||g(()=>{d.ensure(Lc,i)})})}else ti(c,u),d.ensure($r,a&&(g=>a(g,c)));return()=>{p=!0}})}function H(t,e,i=!1){var a=new ia(t),r=i?jt:0;function n(l,c){a.ensure(l,c)}fi(()=>{var l=!1;e((c,s=!0)=>{l=!0,n(s,c)}),l||n(!1,null)},r)}function Ca(t,e,i){var a=new ia(t),r=!Ei();fi(()=>{var n=e();r&&n!==null&&typeof n=="object"&&(n={}),a.ensure(n,i)})}function Oe(t,e,...i){var a=new ia(t);fi(()=>{const r=e()??null;a.ensure(r,r&&(n=>r(n,...i)))},jt)}function en(t,e,i){var a=new ia(t);fi(()=>{var r=e()??null;a.ensure(r,r&&(n=>i(n,r)))},jt)}function Xl(t,e,i,a,r,n){var l=null,c=t,s=zi,d=new ia(c,!1);fi(()=>{const u=e()||null;var p=u==="svg"?Vs:null;if(u===null){d.ensure(null,null),er(!0);return}return d.ensure(u,f=>{var h=zi;if(ml(s),u){if(l=p?document.createElementNS(p,u):document.createElement(u),$i(l,l),a){var g=l.appendChild(qt());a(l,g)}xe.nodes_end=l,f.before(l)}ml(h)}),er(!0),()=>{u&&er(!1)}},jt),xa(()=>{er(!0)})}function Ft(t,e,i){ji(()=>{var a=Ot(()=>e(t,i==null?void 0:i())||{});if(i&&(a!=null&&a.update)){var r=!1,n={};Ja(()=>{var l=i();Zl(l),r&&ll(n,l)&&(n=l,a.update(l))}),r=!0}if(a!=null&&a.destroy)return()=>a.destroy()})}function tr(t,e){var i=void 0,a;Al(()=>{i!==(i=e())&&(a&&(Ze(a),a=null),i&&(a=lt(()=>{ji(()=>i(t))})))})}function $l(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=$l(t[e]))&&(a&&(a+=" "),a+=i)}else for(i in t)t[i]&&(a&&(a+=" "),a+=i);return a}function Mc(){for(var t,e,i=0,a="",r=arguments.length;i<r;i++)(t=arguments[i])&&(e=$l(t))&&(a&&(a+=" "),a+=e);return a}function Dc(t){return typeof t=="object"?Mc(t):t??""}const eo=[...`
|
|
3
3
|
\r\f \v\uFEFF`];function qc(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 c=l+n;(l===0||eo.includes(a[l-1]))&&(c===a.length||eo.includes(a[c]))?a=(l===0?"":a.substring(0,l))+a.substring(c+1):l=c}}return a===""?null:a}function to(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 tn(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Nc(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,c=!1,s=[];a&&s.push(...Object.keys(a).map(tn)),r&&s.push(...Object.keys(r).map(tn));var d=0,u=-1;const m=t.length;for(var p=0;p<m;p++){var f=t[p];if(c?f==="/"&&t[p-1]==="*"&&(c=!1):n?n===f&&(n=!1):f==="/"&&t[p+1]==="*"?c=!0:f==='"'||f==="'"?n=f:f==="("?l++:f===")"&&l--,!c&&n===!1&&l===0){if(f===":"&&u===-1)u=p;else if(f===";"||p===m-1){if(u!==-1){var h=tn(t.substring(d,u).trim());if(!s.includes(h)){f!==";"&&p++;var g=t.substring(d,p).trim();i+=" "+g+";"}}d=p+1,u=-1}}}}return a&&(i+=to(a)),r&&(i+=to(r,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function we(t,e,i,a,r,n){var l=t.__className;if(l!==i||l===void 0){var c=qc(i,a,n);c==null?t.removeAttribute("class"):e?t.className=c:t.setAttribute("class",c),t.__className=i}else if(n&&r!==n)for(var s in n){var d=!!n[s];(r==null||d!==!!r[s])&&t.classList.toggle(s,d)}return n}function an(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 Fe(t,e,i,a){var r=t.__style;if(r!==e){var n=Nc(e,a);n==null?t.removeAttribute("style"):t.style.cssText=n,t.__style=e}else a&&(Array.isArray(a)?(an(t,i==null?void 0:i[0],a[0]),an(t,i==null?void 0:i[1],a[1],"important")):an(t,i,a));return a}function rn(t,e,i=!1){if(t.multiple){if(e==null)return;if(!qe(e))return Ws();for(var a of t.options)a.selected=e.includes(io(a));return}for(a of t.options){var r=io(a);if(oc(r,e)){a.selected=!0;return}}(!i||e!==void 0)&&(t.selectedIndex=-1)}function Rc(t){var e=new MutationObserver(()=>{rn(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),xa(()=>{e.disconnect()})}function io(t){return"__value"in t?t.__value:t.value}const aa=Symbol("class"),ra=Symbol("style"),ao=Symbol("is custom element"),ro=Symbol("is html");function Oc(t,e){var i=nn(t);i.value===(i.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function no(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ae(t,e,i,a){var r=nn(t);r[e]!==(r[e]=i)&&(e==="loading"&&(t[bs]=i),i==null?t.removeAttribute(e):typeof i!="string"&&so(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function Bc(t,e,i,a,r=!1,n=!1){var l=nn(t),c=l[ao],s=!l[ro],d=e||{},u=t.tagName==="OPTION";for(var p in e)p in i||(i[p]=null);i.class?i.class=Dc(i.class):(a||i[aa])&&(i.class=null),i[ra]&&(i.style??(i.style=null));var f=so(t);for(const x in i){let T=i[x];if(u&&x==="value"&&T==null){t.value=t.__value="",d[x]=T;continue}if(x==="class"){var h=t.namespaceURI==="http://www.w3.org/1999/xhtml";we(t,h,T,a,e==null?void 0:e[aa],i[aa]),d[x]=T,d[aa]=i[aa];continue}if(x==="style"){Fe(t,T,e==null?void 0:e[ra],i[ra]),d[x]=T,d[ra]=i[ra];continue}var g=d[x];if(!(T===g&&!(T===void 0&&t.hasAttribute(x)))){d[x]=T;var m=x[0]+x[1];if(m!=="$$")if(m==="on"){const A={},z="$$"+x;let E=x.slice(2);var w=Tc(E);if(kc(E)&&(E=E.slice(0,-7),A.capture=!0),!w&&g){if(T!=null)continue;t.removeEventListener(E,d[z],A),d[z]=null}if(T!=null)if(w)t[`__${E}`]=T,pe([E]);else{let N=function(L){d[x].call(this,L)};d[z]=Qr(E,t,N,A)}else w&&(t[`__${E}`]=void 0)}else if(x==="style")ae(t,x,T);else if(x==="autofocus")dc(t,!!T);else if(!c&&(x==="__value"||x==="value"&&T!=null))t.value=t.__value=T;else if(x==="selected"&&u)no(t,T);else{var y=x;s||(y=Pc(y));var _=y==="defaultValue"||y==="defaultChecked";if(T==null&&!c&&!_)if(l[x]=null,y==="value"||y==="checked"){let A=t;const z=e===void 0;if(y==="value"){let E=A.defaultValue;A.removeAttribute(y),A.defaultValue=E,A.value=A.__value=z?E:null}else{let E=A.defaultChecked;A.removeAttribute(y),A.defaultChecked=E,A.checked=z?E:!1}}else t.removeAttribute(x);else _||f.includes(y)&&(c||typeof T!="string")?(t[y]=T,y in l&&(l[y]=Ue)):typeof T!="function"&&ae(t,y,T)}}}return d}function lo(t,e,i=[],a=[],r=[],n,l=!1,c=!1){yl(r,i,a,s=>{var d=void 0,u={},p=t.nodeName==="SELECT",f=!1;if(Al(()=>{var g=e(...s.map(o)),m=Bc(t,d,g,n,l,c);f&&p&&"value"in g&&rn(t,g.value);for(let y of Object.getOwnPropertySymbols(u))g[y]||Ze(u[y]);for(let y of Object.getOwnPropertySymbols(g)){var w=g[y];y.description===Us&&(!d||w!==d[y])&&(u[y]&&Ze(u[y]),u[y]=lt(()=>tr(t,()=>w))),m[y]=w}d=m}),p){var h=t;ji(()=>{rn(h,d.value,!0),Rc(h)})}f=!0})}function nn(t){return t.__attributes??(t.__attributes={[ao]:t.nodeName.includes("-"),[ro]:t.namespaceURI===Hs})}var oo=new Map;function so(t){var e=t.getAttribute("is")||t.nodeName,i=oo.get(e);if(i)return i;oo.set(e,i=[]);for(var a,r=t,n=Element.prototype;n!==r;){a=Kn(r);for(var l in a)a[l].set&&i.push(l);r=Lr(r)}return i}const Fc=()=>performance.now(),ai={tick:t=>requestAnimationFrame(t),now:()=>Fc(),tasks:new Set};function co(){const t=ai.now();ai.tasks.forEach(e=>{e.c(t)||(ai.tasks.delete(e),e.f())}),ai.tasks.size!==0&&ai.tick(co)}function Hc(t){let e;return ai.tasks.size===0&&ai.tick(co),{promise:new Promise(i=>{ai.tasks.add(e={c:t,f:i})}),abort(){ai.tasks.delete(e)}}}function ir(t,e){Ii(()=>{t.dispatchEvent(new CustomEvent(e))})}function Vc(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 uo(t){const e={},i=t.split(";");for(const a of i){const[r,n]=a.split(":");if(!r||n===void 0)break;const l=Vc(r.trim());e[l]=n.trim()}return e}const Uc=t=>t;function Wc(t,e,i){var a=zi,r,n,l,c=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 s=e()(this.element,{from:r,to:n},i==null?void 0:i());l=ar(this.element,s,void 0,1,()=>{l==null||l.abort(),l=void 0})}},fix(){if(!t.getAnimations().length){var{position:s,width:d,height:u}=getComputedStyle(t);if(s!=="absolute"&&s!=="fixed"){var p=t.style;c={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(c){var s=t.style;s.position=c.position,s.width=c.width,s.height=c.height,s.transform=c.transform}}}),a.a.element=t}function Me(t,e,i,a){var r=(t&Ns)!==0,n=(t&Rs)!==0,l=r&&n,c=(t&Os)!==0,s=l?"both":r?"in":"out",d,u=e.inert,p=e.style.overflow,f,h;function g(){return Ii(()=>d??(d=i()(e,(a==null?void 0:a())??{},{direction:s})))}var m={is_global:c,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(),ir(e,"introstart"),f=ar(e,g(),h,1,()=>{ir(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,ir(e,"outrostart"),h=ar(e,g(),f,0,()=>{ir(e,"outroend"),x==null||x()})},stop:()=>{f==null||f.abort(),h==null||h.abort()}},w=xe;if((w.transitions??(w.transitions=[])).push(m),r&&$a){var y=c;if(!y){for(var _=w.parent;_&&_.f&jt;)for(;(_=_.parent)&&!(_.f&It););y=!_||(_.f&Ga)!==0}y&&ji(()=>{Ot(()=>m.in())})}}function ar(t,e,i,a,r){var n=a===1;if(Vi(e)){var l,c=!1;return ei(()=>{if(!c){var w=e({direction:n?"in":"out"});l=ar(t,w,i,a,r)}}),{abort:()=>{c=!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:vt,deactivate:vt,reset:vt,t:()=>a};const{delay:s=0,css:d,tick:u,easing:p=Uc}=e;var f=[];if(n&&i===void 0&&(u&&u(0,1),d)){var h=uo(d(0,1));f.push(h,h)}var g=()=>1-a,m=t.animate(f,{duration:s,fill:"forwards"});return m.onfinish=()=>{m.cancel();var w=(i==null?void 0:i.t())??1-a;i==null||i.abort();var y=a-w,_=e.duration*Math.abs(y),x=[];if(_>0){var T=!1;if(d)for(var A=Math.ceil(_/16.666666666666668),z=0;z<=A;z+=1){var E=w+y*p(z/A),N=uo(d(E,1-E));x.push(N),T||(T=N.overflow==="hidden")}T&&(t.style.overflow="hidden"),g=()=>{var L=m.currentTime;return w+y*p(L/_)},u&&Hc(()=>{if(m.playState!=="running")return!1;var L=g();return u(L,1-L),!0})}m=t.animate(x,{duration:_,fill:"forwards"}),m.onfinish=()=>{g=()=>a,u==null||u(a,1-a),r()}},{abort:()=>{m&&(m.cancel(),m.effect=null,m.onfinish=vt)},deactivate:()=>{r=vt},reset:()=>{a===0&&(u==null||u(1,0))},t:()=>g()}}function za(t,e,i=e){var a=new WeakSet;vc(t,"input",async r=>{var n=r?t.defaultValue:t.value;if(n=ln(t)?on(n):n,i(n),me!==null&&a.add(me),await Ta(),n!==(n=e())){var l=t.selectionStart,c=t.selectionEnd,s=t.value.length;if(t.value=n??"",c!==null){var d=t.value.length;l===c&&c===s&&d>s?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=l,t.selectionEnd=Math.min(c,d))}}}),Ot(e)==null&&t.value&&(i(ln(t)?on(t.value):t.value),me!==null&&a.add(me)),Ja(()=>{var r=e();if(t===document.activeElement){var n=Za??me;if(a.has(n))return}ln(t)&&r===on(t.value)||t.type==="date"&&!r&&!t.value||r!==t.value&&(t.value=r??"")})}function ln(t){var e=t.type;return e==="number"||e==="range"}function on(t){return t===""?null:+t}const Pr=class Pr{constructor(e){ue(this,Er);ue(this,ki,new WeakMap);ue(this,va);ue(this,Ba);ce(this,Ba,e)}observe(e,i){var a=D(this,ki).get(e)||new Set;return a.add(i),D(this,ki).set(e,a),ze(this,Er,us).call(this).observe(e,D(this,Ba)),()=>{var r=D(this,ki).get(e);r.delete(i),r.size===0&&(D(this,ki).delete(e),D(this,va).unobserve(e))}}};ki=new WeakMap,va=new WeakMap,Ba=new WeakMap,Er=new WeakSet,us=function(){return D(this,va)??ce(this,va,new ResizeObserver(e=>{for(var i of e){Pr.entries.set(i.target,i);for(var a of D(this,ki).get(i.target)||[])a(i)}}))},zt(Pr,"entries",new WeakMap);let sn=Pr;var Gc=new sn({box:"border-box"});function St(t,e,i){var a=Gc.observe(t,()=>i(t[e]));ji(()=>(Ot(()=>i(t[e])),a))}function po(t,e){return t===e||(t==null?void 0:t[At])===e}function Je(t={},e,i,a){return ji(()=>{var r,n;return Ja(()=>{r=n,n=[],Ot(()=>{t!==i(...n)&&(e(t,...n),r&&po(i(...r),t)&&e(null,...r))})}),()=>{ei(()=>{n&&po(i(...n),t)&&e(null,...n)})}}),t}function cn(t,e){pc(window,["resize"],()=>Ii(()=>e(window[t])))}function dn(t=!1){const e=Se,i=e.l.u;if(!i)return;let a=()=>Zl(e.s);if(t){let r=0,n={};const l=ya(()=>{let c=!1;const s=e.s;for(const d in s)s[d]!==n[d]&&(n[d]=s[d],c=!0);return c&&r++,r});a=()=>o(l)}i.b.length&&hc(()=>{vo(e,a),Mr(i.b)}),Be(()=>{const r=Ot(()=>i.m.map(ys));return()=>{for(const n of r)typeof n=="function"&&n()}}),i.a.length&&Be(()=>{vo(e,a),Mr(i.a)})}function vo(t,e){if(t.l.s)for(const i of t.l.s)o(i);e()}let rr=!1;function Kc(t){var e=rr;try{return rr=!1,[t(),rr]}finally{rr=e}}const Zc={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 fo(t,e,i){return new Proxy({props:t,exclude:e},Zc)}const Yc={get(t,e){let i=t.props.length;for(;i--;){let a=t.props[i];if(Vi(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];Vi(r)&&(r=r());const n=di(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(Vi(a)&&(a=a()),typeof a=="object"&&a!==null&&e in a){const r=di(a,e);return r&&!r.configurable&&(r.configurable=!0),r}}},has(t,e){if(e===At||e===tl)return!1;for(let i of t.props)if(Vi(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){const e=[];for(let i of t.props)if(Vi(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 un(...t){return new Proxy({props:t},Yc)}function O(t,e,i,a){var x;var r=!Ki||(i&Ls)!==0,n=(i&Ds)!==0,l=(i&qs)!==0,c=a,s=!0,d=()=>(s&&(s=!1,c=l?Ot(a):a),c),u;if(n){var p=At in t||tl in t;u=((x=di(t,e))==null?void 0:x.set)??(p&&e in t?T=>t[e]=T:void 0)}var f,h=!1;n?[f,h]=Kc(()=>t[e]):f=t[e],f===void 0&&a!==void 0&&(f=d(),u&&(r&&Ts(),u(f)));var g;if(r?g=()=>{var T=t[e];return T===void 0?d():(s=!0,T)}:g=()=>{var T=t[e];return T!==void 0&&(c=void 0),T===void 0?c:T},r&&!(i&Ms))return g;if(u){var m=t.$$legacy;return function(T,A){return arguments.length>0?((!r||!A||m||h)&&u(A?g():T),T):g()}}var w=!1,y=(i&As?ya:Vr)(()=>(w=!1,g()));n&&o(y);var _=xe;return function(T,A){if(arguments.length>0){const z=A?o(y):r&&n?Le(T):T;return R(y,z),w=!0,c!==void 0&&(c=z),T}return Ai&&w||_.f&$t?y.v:o(y)}}function st(t){Se===null&&Rr(),Ki&&Se.l!==null?Jc(Se).m.push(t):Be(()=>{const e=Ot(t);if(typeof e=="function")return e})}function pn(t){Se===null&&Rr(),st(()=>()=>Ot(t))}function Jc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const Qc="5";typeof window<"u"&&((ns=window.__svelte??(window.__svelte={})).v??(ns.v=new Set)).add(Qc);function gi(){var t;return(t=window.PlayPilotLinkInjections)==null?void 0:t.token}const Xc="https://www.playpilot.com",$c="https://partner-api.playpilot.tech/1.0",ed="https://img-external.playpilot.tech",td="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAB+CAMAAACNgsajAAAAb1BMVEU1Q2fI1N5YZoNVYoFndI9qd5JBT3FFU3S8yNS3xNC4xNFBTnDG0t2lscJJV3e9ytaptcWToLOOm6/BzdiZprh3hJ1aaIWJlatte5VPXHx7iJ9zgZlfbYk3RWmNmq5jcY1XZIO2wtCjsMB+i6I9S25IprTeAAABqUlEQVRo3u3W2ZKCMBCF4T5ExRmRVXBfZnn/Z5wKiU5pz1AJ7ZXV/x03HxVCB0jTNE3TNE3TNO0l2rbPNxcFdk8334AINTUD5eSaWbPoQs0qw0CVN98BzNNgE4NVv+ZHsJliuNVt7UgotATAafp/5mZiG4waAB0N5k0kUeg0wMykKDfLvRTl5pxyCFFupjQVo9ykiRTlphzl5nNQNu8C9Hv2lylDT0W2NMyUoeXdLC68KUNLuM7O9HskQ0uLLAEUR2aOQjfORE5LzHP2PMehxpl2k6otM8eh2aQGkBlieyRBYbs3y5Rk6IPZn8mT65XJR6LcROGErwaoxqLm4XvkiTVsy1FoYe5n06zcjazp1Wk0umHz3k9BT6+bXjXR6PnRtKpr755PfRjx4WPz7tXW/26gGYnOvOmrM7xtiK4qYtDOrpGZtnR7JFcSi+Z1XZt7k5d4NCZmcrWxqMzkbRgqN+nAULHpx1RiylFvftJwlxjUz2bWdpPB7NnSxZih5RFrD20Vai4izGOgeenPukMSUE6hte5denI7NMyU1xrSNE3TNE3TNE17hX4ADHsS0j0OCOoAAAAASUVORK5CYII=",Li=600,vn={};async function ri(t,{headers:e={},method:i="GET",body:a=null}={}){const r=!nr()&&i==="GET";if(r&&t in vn)return vn[t];const n=i==="GET"?{}:{"Content-Type":"application/json"},l=await fetch($c+t,{method:i,headers:new Headers({...n,...e}),body:a?JSON.stringify(a):null});if(!(l!=null&&l.ok))throw l;const c=await l.text();let s=c;try{c&&(s=JSON.parse(c))}catch{}return r&&(vn[t]=s),s}const ho="EncryptedToken",go="articleReplacementEditToken",id="playpilot-editorial-mode";async function mo({href:t=window.location.href,throwError:e=!1}={}){try{const i=gi();if(!i)throw new Error("No token was provided");const a=yo(t);if(!a)throw new Error("Could not be authenticated");return await ri(`/external-pages/edit-authorization?api-token=${i}`,{method:"POST",body:{private_token:a}}),ad(a),!0}catch(i){if(console.error(i),e)throw i}finally{rd()}return!1}function yo(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(go);if(n)return decodeURI(n)}return((r=("; "+document.cookie).split(`; ${ho}=`).pop())==null?void 0:r.split(";")[0])||""}function ad(t){const e=new Date;e.setTime(e.getTime()+30*24*60*60*1e3);const a="expires="+e.toUTCString();document.cookie=ho+"="+t+";"+a+";path=/"}function nr(){var e;const t=(e=window==null?void 0:window.PlayPilotLinkInjections)==null?void 0:e.editorial_token;return new URLSearchParams(window.location.search).get(id)==="true"||!!t}function rd(){const t=new URL(window.location.href);t.searchParams.delete(go),window.history.replaceState({},"",t)}function nd(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 fn(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 Ia(){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 bo(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(s=>{var d;return s.nodeType===Node.TEXT_NODE&&((d=s.nodeValue)==null?void 0:d.trim())!==""});if(n&&r.tagName==="LI"){const s=r.closest("ul, ol");s&&!i.includes(s)&&i.push(s);continue}const l=r.tagName==="P"&&!!r.textContent;if(n||l){i.push(r);continue}const c=Array.from(r.children);for(let s=c.length-1;s>=0;s--)a.push(c[s])}return i}function hn(){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 wo(t){return t.map(e=>e.innerText).join(`
|
|
4
4
|
|
|
5
|
-
`)}function ja(t=(e=>(e=window.PlayPilotLinkInjections)==null?void 0:e.config)()){const i=hn(),a=bo(i,t.exclude_elements_selector||""),r=wo(a);return{parentElement:i,elements:a,pageText:r}}function xo(){const t=hn();return{content_heading:ld(t),content_modified_time:od(t),content_published_time:sd(t)}}function ld(t){const e=t.querySelector("h1")||document.querySelector("h1");return(e==null?void 0:e.innerText.trim())||null}function od(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=_o().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?gn(i):null}function sd(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=_o().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?gn(i):null}function gn(t){try{return new Date(t).toISOString()}catch{return null}}function _o(){const e=Array.from(document.querySelectorAll('[type="application/ld+json"]')).find(i=>i.textContent.includes("dateModified")||i.textContent.includes("datePublished"));if(!e)return{};try{return JSON.parse(e.textContent||"")}catch{return{}}}function Mi(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function mn(t){return Object.entries(t).filter(([i,a])=>a!=null&&a!=="").map(([i,a])=>`${i}=${a}`).join("&")}function cd(t){return!!(t.exclude_urls_pattern&&Mi().match(new RegExp(t.exclude_urls_pattern)))}let yn=null;async function lr({url:t=Mi(),params:e={},method:i="GET"}={}){const a=gi(),r=nr()?await mo():!1,n=Ia(),{pageText:l}=ja(),c=nd(l||"");if(!a)throw new Error("No token was provided");const s=`/external-pages/?api-token=${a}&include_title_details=true${r?"&editorial_mode_enabled=true":""}&language=${n}`;let d;return console.log("page text in fetchLinkInjections",{pageText:l}),i==="POST"?(e.run_ai&&(e.hash=c,e.page_text=l),e.url=t,e.metadata=xo(),d=await ri(s,{method:"POST",body:e})):d=await ri(s+`&url=${t}`,{method:"GET"}),window.PlayPilotLinkInjections.last_successful_fetch=d,d}async function ko({requireCompletedResult:t=!1,runAiWhenRelevant:e=!1,pollInterval:i=3e3,maxTries:a=600,onpoll:r=()=>null}={}){const{pageText:n}=ja();let l=0;yn&&clearTimeout(yn),console.log("page text in pollLinkInjections",{pageText:n});const c=async(s,d)=>{let u;try{try{u=await lr()}catch(p){throw(p==null?void 0:p.status)===404&&(u=await lr({method:"POST"}),u.ai_enabled&&(u=await lr({params:{run_ai:!0},method:"POST"}))),new Error}if(u&&e&&(u=await dd(n,u)),t&&u.ai_enabled&&u.ai_running)throw new Error;u.manual_injections=So(u.manual_injections||[]),u.ai_injections=So(u.ai_injections||[]),s(u);return}catch{if(l++,l>=a){a>1&&console.error("Max poll limit exceeded. Please return later."),s();return}u&&r(u),yn=setTimeout(()=>c(s),i)}};return new Promise(c)}async function dd(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=xo().content_modified_time,a=e.content_modified_time?gn(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 lr({params:{run_ai:!0},method:"POST"})}function So(t){return t.map(e=>({...e,key:ud(e.sid)}))}function ud(t){return t+"-"+fn()}function pd(t,e,i){return t.filter(a=>i.every(r=>a[r]===e[r])).length}function vd(t,e){return e.some(i=>t>=i.start&&t<i.end)}function fd(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function bn(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function To(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 Eo(t){const e=t.parentNode;return e?e.nodeName==="A"||!!e.closest("a"):!1}function hd(t,e,i,a){const r=fd(e),n=bn(e),l=t.slice(0,a),c=t.slice(a),s=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${n.replace(s,"\\$&")}|${r.replace(s,"\\$&")}`),u=c.replace(d,i);return l+u}function gd(t,e,i,a){return t.substring(0,i)+e+t.substring(a)}function mi(t){return bn(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function md(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=Po(a.innerText.slice(0,e+r)),l=a.innerText.slice(i+r),c=Po(Co(n,2)),s=Co(l,2);return{before:c,after:s}}function Po(t){return t.split("").reverse().join("")}function Co(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function or(t,e){let i=0,a=0;for(;(a=t.indexOf(e,a))!==-1;)i++,a+=e.length;return i}function yd(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,c=i?t.indexOf(i,l):t.length;if(i&&c===-1)break;const s=t.slice(l,c);a.push({match:s,index:l}),r=i?c+i.length:t.length+1}return a}function bd(t,e,i,a){const n=yd(t,i,a).filter(({match:c})=>bn(c).includes(e));return n.length?n.reduce((c,s)=>!c||s.match.length<c.match.length?s:c):null}function wd(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 xd(t,e,i=0){const a=e.innerHTML,r=[],n=_d(e);let l=a.indexOf(t);for(;l!==-1;)vd(l,n)&&r.push(l),l=a.indexOf(t,l+t.length);return r[i]??-1}function _d(t){const e=[],i=t.innerHTML;let a=!1,r=!1,n=!1,l=0;for(let c=0;c<i.length;c++){const s=i[c];if(!r&&!a&&s==="<"){a=!0,n&&(e.push({start:l,end:c}),n=!1);continue}if(a&&s==='"'&&(r=!r),a&&!r&&s===">"){a=!1;continue}!a&&!r&&!n&&(l=c,n=!0)}return!e.length&&t.textContent.length&&e.push({start:l,end:t.innerHTML.length}),e}function kd(t,e){const i=[" ",".",",","<",">"];try{const a=i.map(c=>"\\"+c).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 zo(t){return t.ctrlKey||t.metaKey||t.button!==0}const oe={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",ExploreResultsError:"venus_explore_results_error",ExploreHomeRailError:"venus_explore_home_rail_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",CardToExploreCta:"ali_card_to_explore_cta",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed",ExploreTitleRailModalView:"venus_title_rail_modal_view",ExploreTitleRailExpandClick:"venus_title_rail_expand_click",ExploreTitleRailSetIndex:"venus_title_rail_set_index",ExploreNavigate:"venus_navigate",ExploreAnyClick:"venus_any_click",ExploreScrollDistance:"venus_scroll_distance"},Tt={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest",TitleInterest:"TitleInterest"},yi={Card:"tpi_card",Link:"tpi_link"};function Sd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function gt(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function sr(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const cr=[{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90}},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50}},{slug:"103",name:"Kids",categories:{kids:76}},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46}},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84}},{slug:"106",name:"Documentary",categories:{kids:50}},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44}},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28}},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88}},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40}},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38}},{slug:"112",name:"Film Noir",categories:{movie:37}},{slug:"113",name:"Game Show",categories:{series:36,kids:28}},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90}},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86}},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66}},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30}},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32}},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76}},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38}},{slug:"121",name:"Reality TV",categories:{series:24}},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74}},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32}},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80}},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20}},{slug:"126",name:"Talk Show",categories:{kids:34,series:16}},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70}},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24}},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48}},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44}},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36}},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42}},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34}},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74}},{slug:"232",name:"Stand-up",categories:{movie:18,series:18}},{slug:"240",name:"Concert",categories:{movie:45}},{slug:"900",name:"Independent",categories:{}},{slug:"901",name:"Arthouse",categories:{}},{slug:"902",name:"Bollywood",categories:{}},{slug:"903",name:"Alternate Version",categories:{}},{slug:"999",name:"Unscripted",categories:{}}];function Td(t=[]){return t.map(e=>{var i;return((i=cr.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const wn="playpilot_user_id";function Ed(){if(!Io())return null;try{const t=localStorage.getItem(wn);return t||(localStorage.setItem(wn,fn(16)),localStorage.getItem(wn))}catch{return null}}function Io(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)&>("tracking")}const Pd="https://insights.playpilot.net";async function se(t,e=null,i={}){var r,n,l,c,s;if(sr())return;if(!gt("tracking")){zd(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:Td(e.genres),providers:[...new Set(((r=e.providers)==null?void 0:r.map(d=>d.name))||[])],...i}),Io()&&(i.user_id=Ed(),i.region=window.PlayPilotLinkInjections.region),i.version="8.10.4-beta.2",i.time_since_initialize=(n=window.PlayPilotLinkInjections)!=null&&n.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=Mi(),i.organization_sid=((l=window.PlayPilotLinkInjections)==null?void 0:l.organization_sid)||"undefined",i.domain_sid=((c=window.PlayPilotLinkInjections)==null?void 0:c.domain_sid)||"undefined",i.device={type:window.innerWidth>Li?"desktop":"mobile",width:window.innerWidth,height:window.innerHeight,touch:window.matchMedia("(pointer: coarse)").matches,orientation:((s=screen.orientation)==null?void 0:s.type)||"undefined"},fetch(Pd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Cd({event:t,payload:i})}function Cd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function jo({organizationSid:t=null,domainSid:e=null}){window.PlayPilotLinkInjections.organization_sid=t||null,window.PlayPilotLinkInjections.domain_sid=e||null}function zd(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 Id(){if(gt("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])se(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}async function Ao(){if(!gt("ads"))return[];const t=gi();if(!t)throw new Error("No token was provided");try{return await ri(`/ads/browse/?api-token=${t}`)}catch(e){throw se(oe.AdsFetchFailed,null,{status:e.status}),e}}function Aa(t){var e;return!gt("ads")||window.PlayPilotLinkInjections.no_affiliate?null:(((e=window.PlayPilotLinkInjections)==null?void 0:e.ads)||[]).find(i=>i.campaign_format===t)||null}function jd(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 xn(t=5e3){var i,a,r,n;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.region;if(e)return e;try{const c=await(await fetch("https://api.country.is/",{signal:AbortSignal.timeout(t)})).json();let s=(a=c==null?void 0:c.country)==null?void 0:a.toLowerCase();if(!s)throw new Error("No country was returned by api.country.is");return s==="gb"&&(s="uk"),Ad(s),s}catch(l){return se(oe.RegionRequestFailed,null,{message:l.message}),((n=(r=window.PlayPilotLinkInjections)==null?void 0:r.config)==null?void 0:n.fallback_region)||""}}function Ad(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.region=t)}async function _n(t={}){const e=gi();if(!e)throw new Error("No token was provided");return t={...t,language:Ia(),include_count:"false"},t.region!==null&&(t.region=t.region||await xn()),await ri(`/titles/browse?api-token=${e}&`+mn(t))}async function Ld(t){return(await _n({related_to_sid:t.sid})).results}const Md={"Where To Stream Online":{[v.English]:"Where to stream online",[v.Swedish]:"Var kan man streama online",[v.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[v.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[v.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[v.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"In-Text Disclaimer":{[v.English]:"We may earn a commission from purchases made through some of the links below.",[v.Swedish]:"Vi kan få en provision för köp som görs via några av länkarna nedan.",[v.Danish]:"Vi kan modtage en kommission for køb foretaget gennem nogle af nedenstående links."},"An Error Occurred":{[v.English]:"An error occurred",[v.Swedish]:"Ett fel inträffade",[v.Danish]:"Der opstod en fejl"},Loading:{[v.English]:"Loading",[v.Swedish]:"Laddar",[v.Danish]:"Indlæser"},"Title Unavailable":{[v.English]:"This title is not currently available to stream.",[v.Swedish]:"Den här titeln går inte att streama just nu.",[v.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[v.English]:"is not currently available to stream.",[v.Swedish]:"går inte att streama just nu.",[v.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[v.English]:"is available to stream on",[v.Swedish]:"finns att streama på",[v.Danish]:"kan streames på"},"Is Available To Stream":{[v.English]:"is available to stream.",[v.Swedish]:"finns att streama.",[v.Danish]:"kan streames."},"View Streaming Options":{[v.English]:"View streaming options",[v.Swedish]:"Se streamingalternativ",[v.Danish]:"Se streamingmuligheder"},"Commission Disclaimer":{[v.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[v.Swedish]:"Vi kan tjäna en provision om du gör ett köp via dessa länkar. I samarbete med",[v.Danish]:"Vi kan tjene en kommission, hvis du foretager et køb via disse links. I samarbejde med"},And:{[v.English]:"and",[v.Swedish]:"och",[v.Danish]:"og"},Minutes:{[v.English]:"minutes",[v.Swedish]:"minuter",[v.Danish]:"minutter"},"Type: movie":{[v.English]:"Movie",[v.Swedish]:"Film",[v.Danish]:"Film"},"Type: series":{[v.English]:"Series",[v.Swedish]:"Serie",[v.Danish]:"Serie"},Stream:{[v.English]:"Stream",[v.Swedish]:"Streama",[v.Danish]:"Stream"},Buy:{[v.English]:"Buy",[v.Swedish]:"Köp",[v.Danish]:"Køb"},Rent:{[v.English]:"Rent",[v.Swedish]:"Hyr",[v.Danish]:"Lej"},"Rent Or Buy":{[v.English]:"Rent or Buy",[v.Swedish]:"Hyr/köp",[v.Danish]:"Lej eller køb"},Watch:{[v.English]:"Watch",[v.Swedish]:"Titta nu",[v.Danish]:"Se nu"},"Category: AVOD":{[v.English]:"Stream for free",[v.Swedish]:"Streama gratis",[v.Danish]:"Stream gratis"},"Category: SVOD":{[v.English]:"Streaming services",[v.Swedish]:"Streamingtjänster",[v.Danish]:"Streamingtjenester"},"Category: RENT":{[v.English]:"Rent it",[v.Swedish]:"Hyr den",[v.Danish]:"Lej den"},"Category: BUY":{[v.English]:"Buy it",[v.Swedish]:"Köp den",[v.Danish]:"Køb den"},"Category: Other":{[v.English]:"Other",[v.Swedish]:"Annat",[v.Danish]:"Andet"},Share:{[v.English]:"Share",[v.Swedish]:"Dela",[v.Danish]:"Del"},"Copy URL":{[v.English]:"Copy URL",[v.Swedish]:"Kopiera URL",[v.Danish]:"Kopiér URL"},Email:{[v.English]:"Email",[v.Swedish]:"E-post",[v.Danish]:"E-mail"},"Show More":{[v.English]:"Show more",[v.Swedish]:"Visa mer",[v.Danish]:"Vis mere"},Cast:{[v.English]:"Cast",[v.Swedish]:"Rollista",[v.Danish]:"Skuespillere"},"Similar Titles":{[v.English]:"Similar movies & shows",[v.Swedish]:"Liknande filmer och serier",[v.Danish]:"Lignende film og serier"},"Watch Trailer":{[v.English]:"Watch trailer",[v.Swedish]:"Se trailer",[v.Danish]:"Se trailer"},"Streaming Guide":{[v.English]:"Streaming Guide",[v.Swedish]:"Streaming Guide",[v.Danish]:"Streaming Guide"},"Streaming Guide Description":{[v.English]:"Find where to watch movies online - the ultimate guide that helps you find the best movies and shows across streaming services.",[v.Swedish]:"Sök bland alla filmer och serier för att ta reda på var du kan streama dem",[v.Danish]:"Find ud af, hvor du kan se film online - den ultimative guide, der hjælper dig med at finde de bedste film og serier på streamingtjenester."},"Search Movies And Shows":{[v.English]:"Search movies and shows",[v.Swedish]:"Sök filmer och serier",[v.Danish]:"Søg film og serier"},Services:{[v.English]:"Services",[v.Swedish]:"Tjänster",[v.Danish]:"Tjenester"},Genres:{[v.English]:"Genres",[v.Swedish]:"Genrer",[v.Danish]:"Genrer"},IMDb:{[v.English]:"IMDb",[v.Swedish]:"IMDb",[v.Danish]:"IMDb"},Year:{[v.English]:"Year",[v.Swedish]:"År",[v.Danish]:"År"},Runtime:{[v.English]:"Runtime",[v.Swedish]:"Speltid",[v.Danish]:"Spilletid"},Countries:{[v.English]:"Countries",[v.Swedish]:"Länder",[v.Danish]:"Lande"},"All Filters":{[v.English]:"All filters",[v.Swedish]:"Alla filter",[v.Danish]:"Alle filtre"},"Sort By":{[v.English]:"Sort by",[v.Swedish]:"Sortera efter",[v.Danish]:"Sortér efter"},Popularity:{[v.English]:"Popularity",[v.Swedish]:"Popularitet",[v.Danish]:"Popularitet"},New:{[v.English]:"New",[v.Swedish]:"Nytt",[v.Danish]:"Nyt"},"Top Rated":{[v.English]:"Top Rated",[v.Swedish]:"Toppbetyg",[v.Danish]:"Højst vurderet"},"-popularity":{[v.English]:"Popularity",[v.Swedish]:"Popularitet",[v.Danish]:"Popularitet"},"-new":{[v.English]:"New",[v.Swedish]:"Nytt",[v.Danish]:"Nyt"},"-best":{[v.English]:"Top Rated",[v.Swedish]:"Toppbetyg",[v.Danish]:"Højst vurderet"},Search:{[v.English]:"Search",[v.Swedish]:"Sök",[v.Danish]:"Søg"},"Born On":{[v.English]:"Born on",[v.Swedish]:"Född den",[v.Danish]:"Født den"},"Died On":{[v.English]:"Died on",[v.Swedish]:"Död den",[v.Danish]:"Død den"},Credits:{[v.English]:"Credits",[v.Swedish]:"Medverkande",[v.Danish]:"Medvirkende"},Home:{[v.English]:"Home",[v.Swedish]:"Hem",[v.Danish]:"Hjem"},Explore:{[v.English]:"Explore",[v.Swedish]:"Utforska",[v.Danish]:"Udforsk"},"List: Trending":{[v.English]:"Trending Movies & Shows",[v.Swedish]:"Trendande Titlar",[v.Danish]:"Populære film og serier"},"List: Upcoming":{[v.English]:"Upcoming Releases",[v.Swedish]:"Kommande Premiärer",[v.Danish]:"Mest ventede film"},"List: New":{[v.English]:"New Releases",[v.Swedish]:"Nya Filmer & Serier",[v.Danish]:"Nye film og serier"},"List: Demand":{[v.English]:"Always in Demand",[v.Swedish]:"Tidlösa Favoriter",[v.Danish]:"Tidløse favoritter"},"List: Cinema":{[v.English]:"Coming to Cinemas",[v.Swedish]:"Snart på Bio",[v.Danish]:"Kommende film"},All:{[v.English]:"All",[v.Swedish]:"Alla",[v.Danish]:"Alle"},Unscripted:{[v.English]:"Unscripted",[v.Swedish]:"Oscripterat",[v.Danish]:"Umanuskriptet"},Independent:{[v.English]:"Independent",[v.Swedish]:"Indie",[v.Danish]:"Indie"},"Game Show":{[v.English]:"Game Show",[v.Swedish]:"Gameshow",[v.Danish]:"Quizshow"},"Film Noir":{[v.English]:"Film Noir",[v.Swedish]:"Film noir",[v.Danish]:"Film noir"},Entertainment:{[v.English]:"Entertainment",[v.Swedish]:"Underhållning",[v.Danish]:"Underholdning"},News:{[v.English]:"News",[v.Swedish]:"Nyheter",[v.Danish]:"Nyheder"},Short:{[v.English]:"Short",[v.Swedish]:"Kortfilm",[v.Danish]:"Kortfilm"},Bollywood:{[v.English]:"Bollywood",[v.Swedish]:"Bollywood",[v.Danish]:"Bollywood"},Concert:{[v.English]:"Concert",[v.Swedish]:"Konsert",[v.Danish]:"Koncert"},Arthouse:{[v.English]:"Arthouse",[v.Swedish]:"Arthouse",[v.Danish]:"Arthouse"},"Alternate Version":{[v.English]:"Alternate Version",[v.Swedish]:"Alternativ version",[v.Danish]:"Alternativ version"},"Reality TV":{[v.English]:"Reality TV",[v.Swedish]:"Reality-TV",[v.Danish]:"Reality-TV"},Culture:{[v.English]:"Culture",[v.Swedish]:"Kultur",[v.Danish]:"Kultur"},Drama:{[v.English]:"Drama",[v.Swedish]:"Drama",[v.Danish]:"Drama"},Crime:{[v.English]:"Crime",[v.Swedish]:"Kriminal",[v.Danish]:"Krimi"},Western:{[v.English]:"Western",[v.Swedish]:"Western",[v.Danish]:"Western"},Thriller:{[v.English]:"Thriller",[v.Swedish]:"Thriller",[v.Danish]:"Thriller"},Animation:{[v.English]:"Animation",[v.Swedish]:"Animerat",[v.Danish]:"Animation"},Mystery:{[v.English]:"Mystery",[v.Swedish]:"Mysterium",[v.Danish]:"Mysterium"},Science:{[v.English]:"Science",[v.Swedish]:"Vetenskap",[v.Danish]:"Videnskab"},Nature:{[v.English]:"Nature",[v.Swedish]:"Natur",[v.Danish]:"Natur"},War:{[v.English]:"War",[v.Swedish]:"Krig",[v.Danish]:"Krig"},"Sci-Fi":{[v.English]:"Sci-Fi",[v.Swedish]:"Sci-fi",[v.Danish]:"Sci-fi"},Documentary:{[v.English]:"Documentary",[v.Swedish]:"Dokumentär",[v.Danish]:"Dokumentar"},"Stand-up":{[v.English]:"Stand-up",[v.Swedish]:"Standup",[v.Danish]:"Stand-up"},"Talk Show":{[v.English]:"Talk Show",[v.Swedish]:"Talkshow",[v.Danish]:"Talkshow"},Fantasy:{[v.English]:"Fantasy",[v.Swedish]:"Fantasy",[v.Danish]:"Fantasy"},History:{[v.English]:"History",[v.Swedish]:"Historia",[v.Danish]:"Historie"},Adventure:{[v.English]:"Adventure",[v.Swedish]:"Äventyr",[v.Danish]:"Eventyr"},Action:{[v.English]:"Action",[v.Swedish]:"Action",[v.Danish]:"Action"},Horror:{[v.English]:"Horror",[v.Swedish]:"Skräck",[v.Danish]:"Gyser"},Comedy:{[v.English]:"Comedy",[v.Swedish]:"Komedi",[v.Danish]:"Komedie"},Biography:{[v.English]:"Biography",[v.Swedish]:"Biografi",[v.Danish]:"Biografi"},Music:{[v.English]:"Music",[v.Swedish]:"Musik",[v.Danish]:"Musik"},Sport:{[v.English]:"Sport",[v.Swedish]:"Sport",[v.Danish]:"Sport"},Romance:{[v.English]:"Romance",[v.Swedish]:"Romantik",[v.Danish]:"Romantik"},Kids:{[v.English]:"Kids",[v.Swedish]:"Barn",[v.Danish]:"Børn"},Lifestyle:{[v.English]:"Lifestyle",[v.Swedish]:"Livsstil",[v.Danish]:"Livsstil"},Musical:{[v.English]:"Musical",[v.Swedish]:"Musikal",[v.Danish]:"Musical"},Anime:{[v.English]:"Anime",[v.Swedish]:"Anime",[v.Danish]:"Anime"},Family:{[v.English]:"Family",[v.Swedish]:"Familj",[v.Danish]:"Familie"}};function re(t,e=Ia()){var i;return((i=Md[t])==null?void 0:i[e])||t}const dr=Object.freeze({Popular:"-popularity",New:"-new",Best:"-best"}),Dd=t=>t;function Lo(t){const e=t-1;return e*e*e+1}function Mo(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function ni(t,{delay:e=0,duration:i=400,easing:a=Dd}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:n=>`opacity: ${n*r}`}}function La(t,{delay:e=0,duration:i=400,easing:a=Lo,x:r=0,y:n=0,opacity:l=0}={}){const c=getComputedStyle(t),s=+c.opacity,d=c.transform==="none"?"":c.transform,u=s*(1-l),[p,f]=Mo(r),[h,g]=Mo(n);return{delay:e,duration:i,easing:a,css:(m,w)=>`
|
|
5
|
+
`)}function ja(t=(e=>(e=window.PlayPilotLinkInjections)==null?void 0:e.config)()||null){const i=hn(),a=bo(i,(t==null?void 0:t.exclude_elements_selector)||""),r=wo(a);return{parentElement:i,elements:a,pageText:r}}function xo(){const t=hn();return{content_heading:ld(t),content_modified_time:od(t),content_published_time:sd(t)}}function ld(t){const e=t.querySelector("h1")||document.querySelector("h1");return(e==null?void 0:e.innerText.trim())||null}function od(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=_o().dateModified||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?gn(i):null}function sd(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=_o().datePublished||(e==null?void 0:e.getAttribute("content"))||(e==null?void 0:e.getAttribute("datetime"))||(e==null?void 0:e.innerText);return i?gn(i):null}function gn(t){try{return new Date(t).toISOString()}catch{return null}}function _o(){const e=Array.from(document.querySelectorAll('[type="application/ld+json"]')).find(i=>i.textContent.includes("dateModified")||i.textContent.includes("datePublished"));if(!e)return{};try{return JSON.parse(e.textContent||"")}catch{return{}}}function Mi(){const t=location.pathname.replace(/\/+/g,"/");return location.protocol+"//"+location.host+t}function mn(t){return Object.entries(t).filter(([i,a])=>a!=null&&a!=="").map(([i,a])=>`${i}=${a}`).join("&")}function cd(t){return!!(t.exclude_urls_pattern&&Mi().match(new RegExp(t.exclude_urls_pattern)))}let yn=null;async function lr({url:t=Mi(),params:e={},method:i="GET"}={}){const a=gi(),r=nr()?await mo():!1,n=Ia();if(!a)throw new Error("No token was provided");const l=`/external-pages/?api-token=${a}&include_title_details=true${r?"&editorial_mode_enabled=true":""}&language=${n}`;let c;if(i==="POST"){const{pageText:s}=ja();e.run_ai&&(e.hash=nd(s||""),e.page_text=s),e.url=t,e.metadata=xo(),c=await ri(l,{method:"POST",body:e})}else c=await ri(l+`&url=${t}`,{method:"GET"});return window.PlayPilotLinkInjections.last_successful_fetch=c,c}async function ko({requireCompletedResult:t=!1,runAiWhenRelevant:e=!1,pollInterval:i=3e3,maxTries:a=600,onpoll:r=()=>null}={}){let n=0;yn&&clearTimeout(yn);const l=async(c,s)=>{var u;let d;try{try{d=await lr()}catch(f){throw console.error(f),(f==null?void 0:f.status)===404&&(d=await lr({method:"POST"}),d.ai_enabled&&(d=await lr({params:{run_ai:!0},method:"POST"}))),new Error}const{pageText:p}=ja();if(console.log(p),console.log((u=document.querySelector("#content"))==null?void 0:u.innerText),d&&e&&(d=await dd(p,d)),t&&d.ai_enabled&&d.ai_running)throw new Error;d.manual_injections=So(d.manual_injections||[]),d.ai_injections=So(d.ai_injections||[]),c(d);return}catch{if(n++,n>=a){a>1&&console.error("Max poll limit exceeded. Please return later."),c();return}d&&r(d),yn=setTimeout(()=>l(c),i)}};return new Promise(l)}async function dd(t,e){if(!t||!e.ai_enabled||e.ai_running)return e;const i=xo().content_modified_time,a=e.content_modified_time?gn(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 lr({params:{run_ai:!0},method:"POST"})}function So(t){return t.map(e=>({...e,key:ud(e.sid)}))}function ud(t){return t+"-"+fn()}function pd(t,e,i){return t.filter(a=>i.every(r=>a[r]===e[r])).length}function vd(t,e){return e.some(i=>t>=i.start&&t<i.end)}function fd(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function bn(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||""}function To(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 Eo(t){const e=t.parentNode;return e?e.nodeName==="A"||!!e.closest("a"):!1}function hd(t,e,i,a){const r=fd(e),n=bn(e),l=t.slice(0,a),c=t.slice(a),s=/[-/\\^$*+?.()|[\]{}]/g,d=new RegExp(`${n.replace(s,"\\$&")}|${r.replace(s,"\\$&")}`),u=c.replace(d,i);return l+u}function gd(t,e,i,a){return t.substring(0,i)+e+t.substring(a)}function mi(t){return bn(t).toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/[^a-z0-9]+/g,"")}function md(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=Po(a.innerText.slice(0,e+r)),l=a.innerText.slice(i+r),c=Po(Co(n,2)),s=Co(l,2);return{before:c,after:s}}function Po(t){return t.split("").reverse().join("")}function Co(t,e=1){const i=t.match(/[^\s]+/g);return i?i.slice(0,e).join(" ").replace(/[.,!?;:]+$/u,""):""}function or(t,e){let i=0,a=0;for(;(a=t.indexOf(e,a))!==-1;)i++,a+=e.length;return i}function yd(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,c=i?t.indexOf(i,l):t.length;if(i&&c===-1)break;const s=t.slice(l,c);a.push({match:s,index:l}),r=i?c+i.length:t.length+1}return a}function bd(t,e,i,a){const n=yd(t,i,a).filter(({match:c})=>bn(c).includes(e));return n.length?n.reduce((c,s)=>!c||s.match.length<c.match.length?s:c):null}function wd(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 xd(t,e,i=0){const a=e.innerHTML,r=[],n=_d(e);let l=a.indexOf(t);for(;l!==-1;)vd(l,n)&&r.push(l),l=a.indexOf(t,l+t.length);return r[i]??-1}function _d(t){const e=[],i=t.innerHTML;let a=!1,r=!1,n=!1,l=0;for(let c=0;c<i.length;c++){const s=i[c];if(!r&&!a&&s==="<"){a=!0,n&&(e.push({start:l,end:c}),n=!1);continue}if(a&&s==='"'&&(r=!r),a&&!r&&s===">"){a=!1;continue}!a&&!r&&!n&&(l=c,n=!0)}return!e.length&&t.textContent.length&&e.push({start:l,end:t.innerHTML.length}),e}function kd(t,e){const i=[" ",".",",","<",">"];try{const a=i.map(c=>"\\"+c).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 zo(t){return t.ctrlKey||t.metaKey||t.button!==0}const oe={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",ExploreResultsError:"venus_explore_results_error",ExploreHomeRailError:"venus_explore_home_rail_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",CardToExploreCta:"ali_card_to_explore_cta",ExplorePageView:"venus_page_view",ExploreTitleClick:"venus_title_click",ExploreShowMore:"venus_show_more",ExploreSetFilter:"venus_set_filter",ExploreSearch:"venus_search",ExploreFetchProvidersFailed:"venus_fetch_providers_failed",ExploreTitleRailModalView:"venus_title_rail_modal_view",ExploreTitleRailExpandClick:"venus_title_rail_expand_click",ExploreTitleRailSetIndex:"venus_title_rail_set_index",ExploreNavigate:"venus_navigate",ExploreAnyClick:"venus_any_click",ExploreScrollDistance:"venus_scroll_distance"},Tt={ProviderInterest:"ProviderInterest",ProviderClick:"ProviderClick",ParticipantInterest:"ParticipantInterest",ParticipantView:"ParticipantView",SearchQuery:"SearchQuery",GenreInterest:"GenreInterest",TitleInterest:"TitleInterest"},yi={Card:"tpi_card",Link:"tpi_link"};function Sd(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.consents=t)}function gt(t){var e;return window.PlayPilotLinkInjections.require_consent===!1?!0:!!((e=window.PlayPilotLinkInjections.consents)!=null&&e[t])}function sr(){const t=navigator.userAgent.toLowerCase();return/bot|crawl|spider|google|baidu|bing|msn|teoma|slurp|yandex|facebookexternalhit|facebot/i.test(t)}const cr=[{slug:"101",name:"Action",categories:{documentary:50,kids:86,series:90,cinema:90,movie:90}},{slug:"102",name:"Animation",categories:{series:50,cinema:50,kids:90,documentary:48,movie:50}},{slug:"103",name:"Kids",categories:{kids:76}},{slug:"104",name:"Biography",categories:{series:46,documentary:88,cinema:10,movie:46}},{slug:"105",name:"Crime",categories:{series:84,documentary:86,cinema:64,movie:84}},{slug:"106",name:"Documentary",categories:{kids:50}},{slug:"107",name:"Drama",categories:{series:82,movie:82,cinema:88,documentary:44}},{slug:"108",name:"Nature",categories:{kids:48,documentary:76,series:28}},{slug:"109",name:"Adventure",categories:{kids:88,cinema:86,documentary:82,series:88,movie:88}},{slug:"110",name:"Family",categories:{series:40,cinema:40,movie:40}},{slug:"111",name:"Fantasy",categories:{kids:78,cinema:74,documentary:42,movie:38,series:38}},{slug:"112",name:"Film Noir",categories:{movie:37}},{slug:"113",name:"Game Show",categories:{series:36,kids:28}},{slug:"114",name:"History",categories:{movie:35,kids:44,cinema:10,series:80,documentary:90}},{slug:"115",name:"Comedy",categories:{cinema:84,documentary:46,series:86,kids:82,movie:86}},{slug:"116",name:"War",categories:{movie:14,documentary:68,series:14,cinema:66}},{slug:"117",name:"Musical",categories:{kids:30,movie:78,cinema:8,series:30}},{slug:"118",name:"Music",categories:{kids:72,cinema:9,documentary:78,movie:32,series:32}},{slug:"119",name:"Mystery",categories:{movie:76,cinema:70,kids:26,documentary:38,series:76}},{slug:"120",name:"News",categories:{series:26,documentary:36,kids:38}},{slug:"121",name:"Reality TV",categories:{series:24}},{slug:"122",name:"Romance",categories:{documentary:34,cinema:78,movie:74,series:74}},{slug:"123",name:"Sci-Fi",categories:{series:72,movie:72,cinema:68,kids:70,documentary:32}},{slug:"124",name:"Horror",categories:{cinema:76,documentary:40,series:78,movie:80}},{slug:"125",name:"Sport",categories:{cinema:7,kids:68,series:20,documentary:70,movie:20}},{slug:"126",name:"Talk Show",categories:{kids:34,series:16}},{slug:"127",name:"Thriller",categories:{series:70,documentary:28,cinema:80,movie:70}},{slug:"128",name:"Western",categories:{movie:12,series:12,documentary:24}},{slug:"129",name:"Anime",categories:{cinema:5,movie:48,kids:84,series:48}},{slug:"202",name:"Culture",categories:{kids:40,documentary:84,series:44}},{slug:"208",name:"Short",categories:{movie:21,documentary:30,kids:36}},{slug:"212",name:"Entertainment",categories:{kids:80,series:42,movie:42}},{slug:"222",name:"Lifestyle",categories:{documentary:80,kids:74,series:34}},{slug:"227",name:"Science",categories:{series:22,kids:46,documentary:74}},{slug:"232",name:"Stand-up",categories:{movie:18,series:18}},{slug:"240",name:"Concert",categories:{movie:45}},{slug:"900",name:"Independent",categories:{}},{slug:"901",name:"Arthouse",categories:{}},{slug:"902",name:"Bollywood",categories:{}},{slug:"903",name:"Alternate Version",categories:{}},{slug:"999",name:"Unscripted",categories:{}}];function Td(t=[]){return t.map(e=>{var i;return((i=cr.find(a=>a.slug===e))==null?void 0:i.name)||""}).filter(Boolean)}const wn="playpilot_user_id";function Ed(){if(!Io())return null;try{const t=localStorage.getItem(wn);return t||(localStorage.setItem(wn,fn(16)),localStorage.getItem(wn))}catch{return null}}function Io(){var t,e;return!!((e=(t=window.PlayPilotLinkInjections)==null?void 0:t.config)!=null&&e.allow_user_id_tracking)&>("tracking")}const Pd="https://insights.playpilot.net";async function se(t,e=null,i={}){var r,n,l,c,s;if(sr())return;if(!gt("tracking")){zd(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:Td(e.genres),providers:[...new Set(((r=e.providers)==null?void 0:r.map(d=>d.name))||[])],...i}),Io()&&(i.user_id=Ed(),i.region=window.PlayPilotLinkInjections.region),i.version="8.10.4-beta.3",i.time_since_initialize=(n=window.PlayPilotLinkInjections)!=null&&n.time_at_initialize?Date.now()-window.PlayPilotLinkInjections.time_at_initialize:0,i.url=Mi(),i.organization_sid=((l=window.PlayPilotLinkInjections)==null?void 0:l.organization_sid)||"undefined",i.domain_sid=((c=window.PlayPilotLinkInjections)==null?void 0:c.domain_sid)||"undefined",i.device={type:window.innerWidth>Li?"desktop":"mobile",width:window.innerWidth,height:window.innerHeight,touch:window.matchMedia("(pointer: coarse)").matches,orientation:((s=screen.orientation)==null?void 0:s.type)||"undefined"},fetch(Pd,{headers:a,method:"POST",body:JSON.stringify({event:t,payload:i,source:"ali",keepalive:!0})}),Cd({event:t,payload:i})}function Cd(t){var e;window.PlayPilotLinkInjections.tracked_events||(window.PlayPilotLinkInjections.tracked_events=[]),(e=window.PlayPilotLinkInjections.tracked_events)==null||e.push(t)}function jo({organizationSid:t=null,domainSid:e=null}){window.PlayPilotLinkInjections.organization_sid=t||null,window.PlayPilotLinkInjections.domain_sid=e||null}function zd(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 Id(){if(gt("tracking")){for(const{event:t,title:e,payload:i}of window.PlayPilotLinkInjections.queued_tracking_events||[])se(t,e,i);window.PlayPilotLinkInjections.queued_tracking_events=[]}}async function Ao(){if(!gt("ads"))return[];const t=gi();if(!t)throw new Error("No token was provided");try{return await ri(`/ads/browse/?api-token=${t}`)}catch(e){throw se(oe.AdsFetchFailed,null,{status:e.status}),e}}function Aa(t){var e;return!gt("ads")||window.PlayPilotLinkInjections.no_affiliate?null:(((e=window.PlayPilotLinkInjections)==null?void 0:e.ads)||[]).find(i=>i.campaign_format===t)||null}function jd(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 xn(t=5e3){var i,a,r,n;const e=(i=window.PlayPilotLinkInjections)==null?void 0:i.region;if(e)return e;try{const c=await(await fetch("https://api.country.is/",{signal:AbortSignal.timeout(t)})).json();let s=(a=c==null?void 0:c.country)==null?void 0:a.toLowerCase();if(!s)throw new Error("No country was returned by api.country.is");return s==="gb"&&(s="uk"),Ad(s),s}catch(l){return se(oe.RegionRequestFailed,null,{message:l.message}),((n=(r=window.PlayPilotLinkInjections)==null?void 0:r.config)==null?void 0:n.fallback_region)||""}}function Ad(t){window.PlayPilotLinkInjections&&(window.PlayPilotLinkInjections.region=t)}async function _n(t={}){const e=gi();if(!e)throw new Error("No token was provided");return t={...t,language:Ia(),include_count:"false"},t.region!==null&&(t.region=t.region||await xn()),await ri(`/titles/browse?api-token=${e}&`+mn(t))}async function Ld(t){return(await _n({related_to_sid:t.sid})).results}const Md={"Where To Stream Online":{[v.English]:"Where to stream online",[v.Swedish]:"Var kan man streama online",[v.Danish]:"Hvor kan man streame online"},"Affiliate Disclaimer":{[v.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[v.Swedish]:"Vi kan få provision om du gör ett köp via dessa länkar. I samarbete med",[v.Danish]:"Vi kan modtage en kommission, hvis du foretager et køb via disse links. I samarbejde med"},"In-Text Disclaimer":{[v.English]:"We may earn a commission from purchases made through some of the links below.",[v.Swedish]:"Vi kan få en provision för köp som görs via några av länkarna nedan.",[v.Danish]:"Vi kan modtage en kommission for køb foretaget gennem nogle af nedenstående links."},"An Error Occurred":{[v.English]:"An error occurred",[v.Swedish]:"Ett fel inträffade",[v.Danish]:"Der opstod en fejl"},Loading:{[v.English]:"Loading",[v.Swedish]:"Laddar",[v.Danish]:"Indlæser"},"Title Unavailable":{[v.English]:"This title is not currently available to stream.",[v.Swedish]:"Den här titeln går inte att streama just nu.",[v.Danish]:"Denne titel er i øjeblikket ikke tilgængelig for streaming."},"Title Unavailable Suffix":{[v.English]:"is not currently available to stream.",[v.Swedish]:"går inte att streama just nu.",[v.Danish]:"er i øjeblikket ikke tilgængelig for streaming."},"Is Available To Stream On":{[v.English]:"is available to stream on",[v.Swedish]:"finns att streama på",[v.Danish]:"kan streames på"},"Is Available To Stream":{[v.English]:"is available to stream.",[v.Swedish]:"finns att streama.",[v.Danish]:"kan streames."},"View Streaming Options":{[v.English]:"View streaming options",[v.Swedish]:"Se streamingalternativ",[v.Danish]:"Se streamingmuligheder"},"Commission Disclaimer":{[v.English]:"We may earn a commission if you make a purchase through these links. In collaboration with",[v.Swedish]:"Vi kan tjäna en provision om du gör ett köp via dessa länkar. I samarbete med",[v.Danish]:"Vi kan tjene en kommission, hvis du foretager et køb via disse links. I samarbejde med"},And:{[v.English]:"and",[v.Swedish]:"och",[v.Danish]:"og"},Minutes:{[v.English]:"minutes",[v.Swedish]:"minuter",[v.Danish]:"minutter"},"Type: movie":{[v.English]:"Movie",[v.Swedish]:"Film",[v.Danish]:"Film"},"Type: series":{[v.English]:"Series",[v.Swedish]:"Serie",[v.Danish]:"Serie"},Stream:{[v.English]:"Stream",[v.Swedish]:"Streama",[v.Danish]:"Stream"},Buy:{[v.English]:"Buy",[v.Swedish]:"Köp",[v.Danish]:"Køb"},Rent:{[v.English]:"Rent",[v.Swedish]:"Hyr",[v.Danish]:"Lej"},"Rent Or Buy":{[v.English]:"Rent or Buy",[v.Swedish]:"Hyr/köp",[v.Danish]:"Lej eller køb"},Watch:{[v.English]:"Watch",[v.Swedish]:"Titta nu",[v.Danish]:"Se nu"},"Category: AVOD":{[v.English]:"Stream for free",[v.Swedish]:"Streama gratis",[v.Danish]:"Stream gratis"},"Category: SVOD":{[v.English]:"Streaming services",[v.Swedish]:"Streamingtjänster",[v.Danish]:"Streamingtjenester"},"Category: RENT":{[v.English]:"Rent it",[v.Swedish]:"Hyr den",[v.Danish]:"Lej den"},"Category: BUY":{[v.English]:"Buy it",[v.Swedish]:"Köp den",[v.Danish]:"Køb den"},"Category: Other":{[v.English]:"Other",[v.Swedish]:"Annat",[v.Danish]:"Andet"},Share:{[v.English]:"Share",[v.Swedish]:"Dela",[v.Danish]:"Del"},"Copy URL":{[v.English]:"Copy URL",[v.Swedish]:"Kopiera URL",[v.Danish]:"Kopiér URL"},Email:{[v.English]:"Email",[v.Swedish]:"E-post",[v.Danish]:"E-mail"},"Show More":{[v.English]:"Show more",[v.Swedish]:"Visa mer",[v.Danish]:"Vis mere"},Cast:{[v.English]:"Cast",[v.Swedish]:"Rollista",[v.Danish]:"Skuespillere"},"Similar Titles":{[v.English]:"Similar movies & shows",[v.Swedish]:"Liknande filmer och serier",[v.Danish]:"Lignende film og serier"},"Watch Trailer":{[v.English]:"Watch trailer",[v.Swedish]:"Se trailer",[v.Danish]:"Se trailer"},"Streaming Guide":{[v.English]:"Streaming Guide",[v.Swedish]:"Streaming Guide",[v.Danish]:"Streaming Guide"},"Streaming Guide Description":{[v.English]:"Find where to watch movies online - the ultimate guide that helps you find the best movies and shows across streaming services.",[v.Swedish]:"Sök bland alla filmer och serier för att ta reda på var du kan streama dem",[v.Danish]:"Find ud af, hvor du kan se film online - den ultimative guide, der hjælper dig med at finde de bedste film og serier på streamingtjenester."},"Search Movies And Shows":{[v.English]:"Search movies and shows",[v.Swedish]:"Sök filmer och serier",[v.Danish]:"Søg film og serier"},Services:{[v.English]:"Services",[v.Swedish]:"Tjänster",[v.Danish]:"Tjenester"},Genres:{[v.English]:"Genres",[v.Swedish]:"Genrer",[v.Danish]:"Genrer"},IMDb:{[v.English]:"IMDb",[v.Swedish]:"IMDb",[v.Danish]:"IMDb"},Year:{[v.English]:"Year",[v.Swedish]:"År",[v.Danish]:"År"},Runtime:{[v.English]:"Runtime",[v.Swedish]:"Speltid",[v.Danish]:"Spilletid"},Countries:{[v.English]:"Countries",[v.Swedish]:"Länder",[v.Danish]:"Lande"},"All Filters":{[v.English]:"All filters",[v.Swedish]:"Alla filter",[v.Danish]:"Alle filtre"},"Sort By":{[v.English]:"Sort by",[v.Swedish]:"Sortera efter",[v.Danish]:"Sortér efter"},Popularity:{[v.English]:"Popularity",[v.Swedish]:"Popularitet",[v.Danish]:"Popularitet"},New:{[v.English]:"New",[v.Swedish]:"Nytt",[v.Danish]:"Nyt"},"Top Rated":{[v.English]:"Top Rated",[v.Swedish]:"Toppbetyg",[v.Danish]:"Højst vurderet"},"-popularity":{[v.English]:"Popularity",[v.Swedish]:"Popularitet",[v.Danish]:"Popularitet"},"-new":{[v.English]:"New",[v.Swedish]:"Nytt",[v.Danish]:"Nyt"},"-best":{[v.English]:"Top Rated",[v.Swedish]:"Toppbetyg",[v.Danish]:"Højst vurderet"},Search:{[v.English]:"Search",[v.Swedish]:"Sök",[v.Danish]:"Søg"},"Born On":{[v.English]:"Born on",[v.Swedish]:"Född den",[v.Danish]:"Født den"},"Died On":{[v.English]:"Died on",[v.Swedish]:"Död den",[v.Danish]:"Død den"},Credits:{[v.English]:"Credits",[v.Swedish]:"Medverkande",[v.Danish]:"Medvirkende"},Home:{[v.English]:"Home",[v.Swedish]:"Hem",[v.Danish]:"Hjem"},Explore:{[v.English]:"Explore",[v.Swedish]:"Utforska",[v.Danish]:"Udforsk"},"List: Trending":{[v.English]:"Trending Movies & Shows",[v.Swedish]:"Trendande Titlar",[v.Danish]:"Populære film og serier"},"List: Upcoming":{[v.English]:"Upcoming Releases",[v.Swedish]:"Kommande Premiärer",[v.Danish]:"Mest ventede film"},"List: New":{[v.English]:"New Releases",[v.Swedish]:"Nya Filmer & Serier",[v.Danish]:"Nye film og serier"},"List: Demand":{[v.English]:"Always in Demand",[v.Swedish]:"Tidlösa Favoriter",[v.Danish]:"Tidløse favoritter"},"List: Cinema":{[v.English]:"Coming to Cinemas",[v.Swedish]:"Snart på Bio",[v.Danish]:"Kommende film"},All:{[v.English]:"All",[v.Swedish]:"Alla",[v.Danish]:"Alle"},Unscripted:{[v.English]:"Unscripted",[v.Swedish]:"Oscripterat",[v.Danish]:"Umanuskriptet"},Independent:{[v.English]:"Independent",[v.Swedish]:"Indie",[v.Danish]:"Indie"},"Game Show":{[v.English]:"Game Show",[v.Swedish]:"Gameshow",[v.Danish]:"Quizshow"},"Film Noir":{[v.English]:"Film Noir",[v.Swedish]:"Film noir",[v.Danish]:"Film noir"},Entertainment:{[v.English]:"Entertainment",[v.Swedish]:"Underhållning",[v.Danish]:"Underholdning"},News:{[v.English]:"News",[v.Swedish]:"Nyheter",[v.Danish]:"Nyheder"},Short:{[v.English]:"Short",[v.Swedish]:"Kortfilm",[v.Danish]:"Kortfilm"},Bollywood:{[v.English]:"Bollywood",[v.Swedish]:"Bollywood",[v.Danish]:"Bollywood"},Concert:{[v.English]:"Concert",[v.Swedish]:"Konsert",[v.Danish]:"Koncert"},Arthouse:{[v.English]:"Arthouse",[v.Swedish]:"Arthouse",[v.Danish]:"Arthouse"},"Alternate Version":{[v.English]:"Alternate Version",[v.Swedish]:"Alternativ version",[v.Danish]:"Alternativ version"},"Reality TV":{[v.English]:"Reality TV",[v.Swedish]:"Reality-TV",[v.Danish]:"Reality-TV"},Culture:{[v.English]:"Culture",[v.Swedish]:"Kultur",[v.Danish]:"Kultur"},Drama:{[v.English]:"Drama",[v.Swedish]:"Drama",[v.Danish]:"Drama"},Crime:{[v.English]:"Crime",[v.Swedish]:"Kriminal",[v.Danish]:"Krimi"},Western:{[v.English]:"Western",[v.Swedish]:"Western",[v.Danish]:"Western"},Thriller:{[v.English]:"Thriller",[v.Swedish]:"Thriller",[v.Danish]:"Thriller"},Animation:{[v.English]:"Animation",[v.Swedish]:"Animerat",[v.Danish]:"Animation"},Mystery:{[v.English]:"Mystery",[v.Swedish]:"Mysterium",[v.Danish]:"Mysterium"},Science:{[v.English]:"Science",[v.Swedish]:"Vetenskap",[v.Danish]:"Videnskab"},Nature:{[v.English]:"Nature",[v.Swedish]:"Natur",[v.Danish]:"Natur"},War:{[v.English]:"War",[v.Swedish]:"Krig",[v.Danish]:"Krig"},"Sci-Fi":{[v.English]:"Sci-Fi",[v.Swedish]:"Sci-fi",[v.Danish]:"Sci-fi"},Documentary:{[v.English]:"Documentary",[v.Swedish]:"Dokumentär",[v.Danish]:"Dokumentar"},"Stand-up":{[v.English]:"Stand-up",[v.Swedish]:"Standup",[v.Danish]:"Stand-up"},"Talk Show":{[v.English]:"Talk Show",[v.Swedish]:"Talkshow",[v.Danish]:"Talkshow"},Fantasy:{[v.English]:"Fantasy",[v.Swedish]:"Fantasy",[v.Danish]:"Fantasy"},History:{[v.English]:"History",[v.Swedish]:"Historia",[v.Danish]:"Historie"},Adventure:{[v.English]:"Adventure",[v.Swedish]:"Äventyr",[v.Danish]:"Eventyr"},Action:{[v.English]:"Action",[v.Swedish]:"Action",[v.Danish]:"Action"},Horror:{[v.English]:"Horror",[v.Swedish]:"Skräck",[v.Danish]:"Gyser"},Comedy:{[v.English]:"Comedy",[v.Swedish]:"Komedi",[v.Danish]:"Komedie"},Biography:{[v.English]:"Biography",[v.Swedish]:"Biografi",[v.Danish]:"Biografi"},Music:{[v.English]:"Music",[v.Swedish]:"Musik",[v.Danish]:"Musik"},Sport:{[v.English]:"Sport",[v.Swedish]:"Sport",[v.Danish]:"Sport"},Romance:{[v.English]:"Romance",[v.Swedish]:"Romantik",[v.Danish]:"Romantik"},Kids:{[v.English]:"Kids",[v.Swedish]:"Barn",[v.Danish]:"Børn"},Lifestyle:{[v.English]:"Lifestyle",[v.Swedish]:"Livsstil",[v.Danish]:"Livsstil"},Musical:{[v.English]:"Musical",[v.Swedish]:"Musikal",[v.Danish]:"Musical"},Anime:{[v.English]:"Anime",[v.Swedish]:"Anime",[v.Danish]:"Anime"},Family:{[v.English]:"Family",[v.Swedish]:"Familj",[v.Danish]:"Familie"}};function re(t,e=Ia()){var i;return((i=Md[t])==null?void 0:i[e])||t}const dr=Object.freeze({Popular:"-popularity",New:"-new",Best:"-best"}),Dd=t=>t;function Lo(t){const e=t-1;return e*e*e+1}function Mo(t){const e=typeof t=="string"&&t.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[t,"px"]}function ni(t,{delay:e=0,duration:i=400,easing:a=Dd}={}){const r=+getComputedStyle(t).opacity;return{delay:e,duration:i,easing:a,css:n=>`opacity: ${n*r}`}}function La(t,{delay:e=0,duration:i=400,easing:a=Lo,x:r=0,y:n=0,opacity:l=0}={}){const c=getComputedStyle(t),s=+c.opacity,d=c.transform==="none"?"":c.transform,u=s*(1-l),[p,f]=Mo(r),[h,g]=Mo(n);return{delay:e,duration:i,easing:a,css:(m,w)=>`
|
|
6
6
|
transform: ${d} translate(${(1-m)*p}${f}, ${(1-m)*h}${g});
|
|
7
7
|
opacity: ${s-u*w}`}}function na(t,{delay:e=0,duration:i=400,easing:a=Lo,start:r=0,opacity:n=0}={}){const l=getComputedStyle(t),c=+l.opacity,s=l.transform==="none"?"":l.transform,d=1-r,u=c*(1-n);return{delay:e,duration:i,easing:a,css:(p,f)=>`
|
|
8
8
|
transform: ${s} scale(${1-d*f});
|
package/package.json
CHANGED
|
@@ -20,21 +20,19 @@ export async function fetchLinkInjections(
|
|
|
20
20
|
const apiToken = getApiToken()
|
|
21
21
|
const isEditorialMode = isEditorialModeEnabled() ? await authorize() : false
|
|
22
22
|
const language = getLanguage()
|
|
23
|
-
const { pageText } = getPageTextAndElements()
|
|
24
|
-
const hash = stringToHash(pageText || '')
|
|
25
23
|
|
|
26
24
|
if (!apiToken) throw new Error('No token was provided')
|
|
27
25
|
|
|
28
26
|
const apiUrl = `/external-pages/?api-token=${apiToken}&include_title_details=true${isEditorialMode ? '&editorial_mode_enabled=true' : ''}&language=${language}`
|
|
29
27
|
let response: LinkInjectionResponse
|
|
30
28
|
|
|
31
|
-
console.log('page text in fetchLinkInjections', { pageText })
|
|
32
|
-
|
|
33
29
|
// We use separate requests when running the AI or setting the editor session vs when only getting the results.
|
|
34
30
|
// For regular requests we use a GET endpoint, but when saving data we POST to the same url.
|
|
35
31
|
if (method === 'POST') {
|
|
32
|
+
const { pageText } = getPageTextAndElements()
|
|
33
|
+
|
|
36
34
|
if (params.run_ai) {
|
|
37
|
-
params.hash =
|
|
35
|
+
params.hash = stringToHash(pageText || '')
|
|
38
36
|
params.page_text = pageText
|
|
39
37
|
}
|
|
40
38
|
|
|
@@ -67,16 +65,12 @@ export async function pollLinkInjections(
|
|
|
67
65
|
{ requireCompletedResult = false, runAiWhenRelevant = false, pollInterval = 3000, maxTries = 600, onpoll = () => null }:
|
|
68
66
|
{ requireCompletedResult?: boolean, runAiWhenRelevant?: boolean, pollInterval?: number, maxTries?: number, onpoll?: (_response: LinkInjectionResponse) => void } = {},
|
|
69
67
|
): Promise<LinkInjectionResponse> {
|
|
70
|
-
const { pageText } = getPageTextAndElements()
|
|
71
|
-
|
|
72
68
|
let currentTry = 0
|
|
73
69
|
|
|
74
70
|
// Clear pollTimeout if it is already running to prevent multiple timeouts from running at the same time
|
|
75
71
|
// This is mostly handy during HMR, but also during navigation changes
|
|
76
72
|
if (pollTimeout) clearTimeout(pollTimeout)
|
|
77
73
|
|
|
78
|
-
console.log('page text in pollLinkInjections', { pageText })
|
|
79
|
-
|
|
80
74
|
const poll = async (resolve: Function, reject: Function): Promise<void> => {
|
|
81
75
|
let response
|
|
82
76
|
try {
|
|
@@ -86,6 +80,7 @@ export async function pollLinkInjections(
|
|
|
86
80
|
try {
|
|
87
81
|
response = await fetchLinkInjections()
|
|
88
82
|
} catch(error: any) {
|
|
83
|
+
console.error(error)
|
|
89
84
|
if (error?.status === 404) {
|
|
90
85
|
// If the GET endpoint returns a 404 no article has been generated yet and we can safely generate
|
|
91
86
|
// a new article. We can safely throw here (meaning we poll again) as nothing will be returned.
|
|
@@ -97,6 +92,11 @@ export async function pollLinkInjections(
|
|
|
97
92
|
throw new Error
|
|
98
93
|
}
|
|
99
94
|
|
|
95
|
+
const { pageText } = getPageTextAndElements()
|
|
96
|
+
|
|
97
|
+
console.log(pageText)
|
|
98
|
+
console.log(document.querySelector('#content')?.innerText)
|
|
99
|
+
|
|
100
100
|
if (response && runAiWhenRelevant) response = await runAiBasedOnResponse(pageText, response)
|
|
101
101
|
if (requireCompletedResult && (response.ai_enabled && response.ai_running)) throw new Error
|
|
102
102
|
|
|
@@ -91,9 +91,9 @@ export function getPageText(elements: HTMLElement[]): string {
|
|
|
91
91
|
return elements.map(element => element.innerText).join('\n\n')
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
export function getPageTextAndElements(config: ConfigResponse = window.PlayPilotLinkInjections?.config): { parentElement: HTMLElement, elements: HTMLElement[], pageText: string } {
|
|
94
|
+
export function getPageTextAndElements(config: ConfigResponse | null = window.PlayPilotLinkInjections?.config || null): { parentElement: HTMLElement, elements: HTMLElement[], pageText: string } {
|
|
95
95
|
const parentElement = getLinkInjectionsParentElement()
|
|
96
|
-
const elements = getLinkInjectionElements(parentElement, config
|
|
96
|
+
const elements = getLinkInjectionElements(parentElement, config?.exclude_elements_selector || '')
|
|
97
97
|
const pageText = getPageText(elements)
|
|
98
98
|
|
|
99
99
|
return { parentElement, elements, pageText }
|
|
@@ -36,7 +36,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
36
36
|
it('Should call api with GET method with given url', async () => {
|
|
37
37
|
vi.mocked(api).mockResolvedValueOnce('Some response')
|
|
38
38
|
|
|
39
|
-
const response = await fetchLinkInjections(
|
|
39
|
+
const response = await fetchLinkInjections({ url: 'https://some-url' })
|
|
40
40
|
|
|
41
41
|
expect(response).toBe('Some response')
|
|
42
42
|
expect(api).toHaveBeenCalledWith(
|
|
@@ -50,7 +50,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
50
50
|
it('Should call api with POST method and full details when fetching with method set to POST', async () => {
|
|
51
51
|
vi.mocked(api).mockResolvedValueOnce('Some response')
|
|
52
52
|
|
|
53
|
-
const response = await fetchLinkInjections(
|
|
53
|
+
const response = await fetchLinkInjections({ url: 'https://some-url', params: { key: 'value' }, method: 'POST' })
|
|
54
54
|
|
|
55
55
|
expect(response).toBe('Some response')
|
|
56
56
|
expect(api).toHaveBeenCalledWith(
|
|
@@ -69,14 +69,14 @@ describe('$lib/api/externalPages', () => {
|
|
|
69
69
|
it('Should call api with full details when fetching with run_ai as true and method is set to POST', async () => {
|
|
70
70
|
vi.mocked(api).mockResolvedValueOnce('Some response')
|
|
71
71
|
|
|
72
|
-
const response = await fetchLinkInjections(
|
|
72
|
+
const response = await fetchLinkInjections({ url: 'https://some-url', params: { run_ai: true }, method: 'POST' })
|
|
73
73
|
|
|
74
74
|
expect(response).toBe('Some response')
|
|
75
75
|
expect(api).toHaveBeenCalledWith(
|
|
76
76
|
expect.stringContaining('api-token'),
|
|
77
77
|
expect.objectContaining({
|
|
78
78
|
body: {
|
|
79
|
-
hash:
|
|
79
|
+
hash: expect.any(String),
|
|
80
80
|
url: 'https://some-url',
|
|
81
81
|
run_ai: true,
|
|
82
82
|
metadata: {
|
|
@@ -84,7 +84,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
84
84
|
content_modified_time: null,
|
|
85
85
|
content_published_time: null,
|
|
86
86
|
},
|
|
87
|
-
page_text:
|
|
87
|
+
page_text: expect.any(String),
|
|
88
88
|
},
|
|
89
89
|
method: 'POST',
|
|
90
90
|
}),
|
|
@@ -95,13 +95,13 @@ describe('$lib/api/externalPages', () => {
|
|
|
95
95
|
// @ts-ignore
|
|
96
96
|
window.PlayPilotLinkInjections = null
|
|
97
97
|
|
|
98
|
-
await expect(async () => await fetchLinkInjections(
|
|
98
|
+
await expect(async () => await fetchLinkInjections()).rejects.toThrowError('No token was provided')
|
|
99
99
|
})
|
|
100
100
|
|
|
101
101
|
it('Should throw when response was incorrect', async () => {
|
|
102
102
|
vi.mocked(api).mockRejectedValueOnce({ ok: false })
|
|
103
103
|
|
|
104
|
-
await expect(async () => await fetchLinkInjections(
|
|
104
|
+
await expect(async () => await fetchLinkInjections()).rejects.toThrowError()
|
|
105
105
|
})
|
|
106
106
|
|
|
107
107
|
it('Should use given api token', async () => {
|
|
@@ -110,7 +110,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
110
110
|
// @ts-ignore
|
|
111
111
|
window.PlayPilotLinkInjections = { token: 'token' }
|
|
112
112
|
|
|
113
|
-
await fetchLinkInjections(
|
|
113
|
+
await fetchLinkInjections()
|
|
114
114
|
|
|
115
115
|
expect(api).toHaveBeenCalledWith(
|
|
116
116
|
expect.stringContaining('api-token=token'),
|
|
@@ -124,7 +124,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
124
124
|
// @ts-ignore
|
|
125
125
|
window.PlayPilotLinkInjections = null
|
|
126
126
|
|
|
127
|
-
await expect(async () => await fetchLinkInjections(
|
|
127
|
+
await expect(async () => await fetchLinkInjections()).rejects.toThrowError()
|
|
128
128
|
expect(api).not.toHaveBeenCalled()
|
|
129
129
|
})
|
|
130
130
|
|
|
@@ -134,7 +134,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
134
134
|
vi.mocked(authorize).mockResolvedValueOnce(true)
|
|
135
135
|
vi.mocked(isEditorialModeEnabled).mockResolvedValueOnce(true)
|
|
136
136
|
|
|
137
|
-
const response = await fetchLinkInjections(
|
|
137
|
+
const response = await fetchLinkInjections()
|
|
138
138
|
|
|
139
139
|
expect(response).toBe('Some response')
|
|
140
140
|
expect(api).toHaveBeenCalledWith(
|
|
@@ -146,7 +146,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
146
146
|
it('Should call api with given language', async () => {
|
|
147
147
|
vi.mocked(api).mockResolvedValueOnce('Some response')
|
|
148
148
|
|
|
149
|
-
await fetchLinkInjections(
|
|
149
|
+
await fetchLinkInjections()
|
|
150
150
|
|
|
151
151
|
expect(api).toHaveBeenCalledWith(
|
|
152
152
|
expect.stringContaining(`&language=${Language.English}`),
|
|
@@ -156,7 +156,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
156
156
|
// @ts-ignore
|
|
157
157
|
window.PlayPilotLinkInjections = { token: 'token', language: Language.Swedish }
|
|
158
158
|
|
|
159
|
-
await fetchLinkInjections(
|
|
159
|
+
await fetchLinkInjections()
|
|
160
160
|
|
|
161
161
|
expect(api).toHaveBeenCalledWith(
|
|
162
162
|
expect.stringContaining(`&language=${Language.Swedish}`),
|
|
@@ -169,7 +169,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
169
169
|
it('Should poll endpoint while results are not yet ready when requireCompletedResults is true', async () => {
|
|
170
170
|
vi.mocked(api).mockResolvedValueOnce({ ai_enabled: true, ai_running: true })
|
|
171
171
|
|
|
172
|
-
pollLinkInjections(
|
|
172
|
+
pollLinkInjections({ requireCompletedResult: true, pollInterval: 500 })
|
|
173
173
|
|
|
174
174
|
expect(api).toHaveBeenCalled()
|
|
175
175
|
|
|
@@ -184,7 +184,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
184
184
|
vi.mocked(api).mockResolvedValue({ ai_enabled: true, ai_running: true })
|
|
185
185
|
|
|
186
186
|
const onpoll = vi.fn()
|
|
187
|
-
pollLinkInjections(
|
|
187
|
+
pollLinkInjections({ requireCompletedResult: true, pollInterval: 500, onpoll })
|
|
188
188
|
|
|
189
189
|
await waitFor(() => {
|
|
190
190
|
expect(onpoll).toHaveBeenCalledTimes(1)
|
|
@@ -201,7 +201,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
201
201
|
const response = { ai_enabled: true, ai_running: false, manual_injections: [{ title: 'value' }] }
|
|
202
202
|
vi.mocked(api).mockResolvedValueOnce(response)
|
|
203
203
|
|
|
204
|
-
const result = await pollLinkInjections(
|
|
204
|
+
const result = await pollLinkInjections({ requireCompletedResult: true, pollInterval: 500 })
|
|
205
205
|
|
|
206
206
|
expect(api).toHaveBeenCalled()
|
|
207
207
|
expect(result).toEqual(response)
|
|
@@ -213,7 +213,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
213
213
|
it('Should stop polling if max limit was exceeded', async () => {
|
|
214
214
|
vi.mocked(api).mockResolvedValueOnce({ ai_enabled: true, ai_running: true })
|
|
215
215
|
|
|
216
|
-
await pollLinkInjections(
|
|
216
|
+
await pollLinkInjections({ requireCompletedResult: true, pollInterval: 200, maxTries: 2 })
|
|
217
217
|
|
|
218
218
|
await new Promise(res => setTimeout(res, 1000)) // Wait for a potential poll
|
|
219
219
|
expect(api).toHaveBeenCalledTimes(2)
|
|
@@ -222,7 +222,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
222
222
|
it('Should continue polling if endpoint throws error', async () => {
|
|
223
223
|
vi.mocked(api).mockRejectedValueOnce({ ok: false })
|
|
224
224
|
|
|
225
|
-
pollLinkInjections(
|
|
225
|
+
pollLinkInjections({ pollInterval: 500 })
|
|
226
226
|
|
|
227
227
|
expect(api).toHaveBeenCalled()
|
|
228
228
|
|
|
@@ -233,16 +233,16 @@ describe('$lib/api/externalPages', () => {
|
|
|
233
233
|
it('Should return empty array if manual_injections are null', async () => {
|
|
234
234
|
vi.mocked(api).mockResolvedValueOnce({ ai_enabled: null, ai_running: null })
|
|
235
235
|
|
|
236
|
-
const result = await pollLinkInjections(
|
|
236
|
+
const result = await pollLinkInjections()
|
|
237
237
|
expect(result).toEqual(expect.objectContaining({ manual_injections: [], ai_injections: [] }))
|
|
238
238
|
})
|
|
239
239
|
|
|
240
240
|
it('Should call api twice if runAiWhenRelevant is true and results expects new run', async () => {
|
|
241
|
-
document.body.innerHTML = '<meta content="2025-04-20T00:00:00Z" property="article:modified_time">'
|
|
241
|
+
document.body.innerHTML = '<main>Some text</main> <meta content="2025-04-20T00:00:00Z" property="article:modified_time">'
|
|
242
242
|
|
|
243
243
|
vi.mocked(api).mockResolvedValueOnce({ ai_enabled: true })
|
|
244
244
|
|
|
245
|
-
await pollLinkInjections(
|
|
245
|
+
await pollLinkInjections({ runAiWhenRelevant: true, maxTries: 1 })
|
|
246
246
|
|
|
247
247
|
expect(api).toHaveBeenCalledTimes(2)
|
|
248
248
|
})
|
|
@@ -250,7 +250,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
250
250
|
it('Should call api twice if initial response returns 404', async () => {
|
|
251
251
|
vi.mocked(api).mockRejectedValueOnce({ status: 404 })
|
|
252
252
|
|
|
253
|
-
await pollLinkInjections(
|
|
253
|
+
await pollLinkInjections({ maxTries: 1 })
|
|
254
254
|
|
|
255
255
|
expect(api).toHaveBeenCalledTimes(2)
|
|
256
256
|
expect(api).toHaveBeenCalledWith(
|
|
@@ -266,7 +266,7 @@ describe('$lib/api/externalPages', () => {
|
|
|
266
266
|
it('Should call api three times if initial response returns 404 and second response returns ai_enabled set to true', async () => {
|
|
267
267
|
vi.mocked(api).mockRejectedValueOnce({ status: 404 }).mockResolvedValueOnce({ ai_enabled: true })
|
|
268
268
|
|
|
269
|
-
await pollLinkInjections(
|
|
269
|
+
await pollLinkInjections({ maxTries: 1 })
|
|
270
270
|
|
|
271
271
|
expect(api).toHaveBeenCalledTimes(3)
|
|
272
272
|
expect(api).toHaveBeenCalledWith(
|
|
@@ -287,6 +287,28 @@ describe('$lib/api/externalPages', () => {
|
|
|
287
287
|
}),
|
|
288
288
|
)
|
|
289
289
|
})
|
|
290
|
+
|
|
291
|
+
it('Should use the given selector when present', async () => {
|
|
292
|
+
vi.mocked(api).mockRejectedValueOnce({ status: 404 }).mockResolvedValueOnce({ ai_enabled: true })
|
|
293
|
+
|
|
294
|
+
document.body.innerHTML = '<div class="some-element"><p>Here</p></div> <p>Not here</p>'
|
|
295
|
+
|
|
296
|
+
// @ts-ignore
|
|
297
|
+
window.PlayPilotLinkInjections = { token: 'token', selector: '.some-element' }
|
|
298
|
+
|
|
299
|
+
await pollLinkInjections({ runAiWhenRelevant: true, maxTries: 1 })
|
|
300
|
+
|
|
301
|
+
await waitFor(() => {
|
|
302
|
+
expect(api).toHaveBeenCalledWith(
|
|
303
|
+
expect.any(String),
|
|
304
|
+
expect.objectContaining({
|
|
305
|
+
body: expect.objectContaining({
|
|
306
|
+
page_text: 'Here',
|
|
307
|
+
}),
|
|
308
|
+
}),
|
|
309
|
+
)
|
|
310
|
+
})
|
|
311
|
+
})
|
|
290
312
|
})
|
|
291
313
|
|
|
292
314
|
describe('runAiBasedOnResponse', () => {
|
package/src/tests/main.test.js
CHANGED
|
@@ -51,7 +51,6 @@ describe('main.ts', () => {
|
|
|
51
51
|
describe('initialize', () => {
|
|
52
52
|
it('Should not call setConsent when only a token is passed', () => {
|
|
53
53
|
window.PlayPilotLinkInjections.initialize({ token: 'a' })
|
|
54
|
-
console.log(window.PlayPilotLinkInjections)
|
|
55
54
|
|
|
56
55
|
expect(setConsent).not.toHaveBeenCalled()
|
|
57
56
|
|
|
@@ -134,8 +134,8 @@ describe('$routes/+page.svelte', () => {
|
|
|
134
134
|
render(page)
|
|
135
135
|
|
|
136
136
|
await waitFor(() => {
|
|
137
|
-
expect(pollLinkInjections).toHaveBeenCalledWith(
|
|
138
|
-
expect(pollLinkInjections).toHaveBeenCalledWith(
|
|
137
|
+
expect(pollLinkInjections).toHaveBeenCalledWith({ maxTries: 1, runAiWhenRelevant: true })
|
|
138
|
+
expect(pollLinkInjections).toHaveBeenCalledWith({ requireCompletedResult: true, onpoll: expect.any(Function) })
|
|
139
139
|
})
|
|
140
140
|
})
|
|
141
141
|
|
|
@@ -158,7 +158,7 @@ describe('$routes/+page.svelte', () => {
|
|
|
158
158
|
})
|
|
159
159
|
|
|
160
160
|
await waitFor(() => {
|
|
161
|
-
expect(pollLinkInjections).toHaveBeenCalledWith(
|
|
161
|
+
expect(pollLinkInjections).toHaveBeenCalledWith({ requireCompletedResult: true, onpoll: expect.any(Function) })
|
|
162
162
|
})
|
|
163
163
|
|
|
164
164
|
expect(pollLinkInjections).toHaveBeenCalledTimes(2)
|
|
@@ -221,7 +221,7 @@ describe('$routes/+page.svelte', () => {
|
|
|
221
221
|
render(page)
|
|
222
222
|
|
|
223
223
|
await waitFor(() => {
|
|
224
|
-
expect(pollLinkInjections).toHaveBeenCalledWith(
|
|
224
|
+
expect(pollLinkInjections).toHaveBeenCalledWith({ maxTries: 1, runAiWhenRelevant: true })
|
|
225
225
|
})
|
|
226
226
|
})
|
|
227
227
|
|