');function Gt(t,e){z(e,!0);function s(p){e.onHomeClick&&(p.preventDefault(),e.onHomeClick())}var r=It(),o=y(r),a=y(o);G(2),w(o),G(2),w(r),gt("click",a,s),Z(t,r),tt()}dt(["click"]);export{Gt as F,Yt as W,E as a,Wt as b,Kt as c,Ht as d,Ot as e,Dt as f,Vt as g,v as h,Pt as i,Nt as l,qt as r,j as s,Bt as t};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/6qGwBjhj.js b/.svelte-kit/output/client/_app/immutable/chunks/6qGwBjhj.js
deleted file mode 100644
index 7a68b4d..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/6qGwBjhj.js
+++ /dev/null
@@ -1 +0,0 @@
-import{ae as v,v as u,af as T,ag as p,ah as h,b as l,j as i,k as s,ai as g,F as E,g as d,aj as y,t as w,ak as N}from"./BuZ8u_VS.js";const M=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function b(t){return M?.createHTML(t)??t}function x(t){var r=v("template");return r.innerHTML=b(t.replaceAll("","")),r.content}function n(t,r){var e=l;e.nodes===null&&(e.nodes={start:t,end:r,a:null,t:null})}function O(t,r){var e=(r&p)!==0,f=(r&h)!==0,a,_=!t.startsWith("");return()=>{if(i)return n(s,null),s;a===void 0&&(a=x(_?t:""+t),e||(a=u(a)));var o=f||T?document.importNode(a,!0):a.cloneNode(!0);if(e){var c=u(o),m=o.lastChild;n(c,m)}else n(o,o);return o}}function P(t=""){if(!i){var r=d(t+"");return n(r,r),r}var e=s;return e.nodeType!==y?(e.before(e=d()),w(e)):N(e),n(e,e),e}function R(){if(i)return n(s,null),s;var t=document.createDocumentFragment(),r=document.createComment(""),e=d();return t.append(r,e),n(r,e),t}function C(t,r){if(i){var e=l;((e.f&g)===0||e.nodes.end===null)&&(e.nodes.end=s),E();return}t!==null&&t.before(r)}const A="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(A);export{C as a,n as b,R as c,O as f,P as t};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/BKjtTD7m.js b/.svelte-kit/output/client/_app/immutable/chunks/BKjtTD7m.js
deleted file mode 100644
index 970475b..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/BKjtTD7m.js
+++ /dev/null
@@ -1 +0,0 @@
-import{ab as L,A as U,B as T,aO as te,b2 as gt}from"./BuZ8u_VS.js";import{w as Ee,o as qe}from"./pNsQzX0r.js";class Se{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class xe extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function _t(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function mt(e){return e.split("%25").map(decodeURI).join("%25")}function vt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function pe({href:e}){return e.split("#")[0]}function wt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function yt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&W.delete(Ae(e)),bt(e,t));const W=new Map;function kt(e,t){const n=Ae(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&W.set(n,{body:a,init:i,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=yt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Et(e,t,n){if(W.size>0){const r=Ae(e,n),a=W.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ge(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ge(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const f=St.exec(l),[,p,v,h,u]=f;return t.push({name:h,matcher:u,optional:!!p,rest:!!v,chained:v?c===1&&o[0]==="":!1}),v?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ge(l)}).join("")}).join("")}/?$`),params:t}}function xt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function At(e){return e.slice(1).split("/").filter(xt)}function Lt(e,t,n){const r={},a=e.slice(1),i=a.filter(s=>s!==void 0);let o=0;for(let s=0;sf).join("/"),o=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const f=t[s+1],p=a[s+1];f&&!f.rest&&f.optional&&p&&l.chained&&(o=0),!f&&!p&&Object.keys(r).length===i.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function ge(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ut({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([s,[l,c,f]])=>{const{pattern:p,params:v}=Rt(s),h={id:s,exec:u=>{const _=p.exec(u);if(_)return Lt(_,v,r)},errors:[1,...f||[]].map(u=>e[u]),layouts:[0,...c||[]].map(o),leaf:i(l)};return h.errors.length=h.layouts.length=Math.max(h.errors.length,h.layouts.length),h});function i(s){const l=s<0;return l&&(s=~s),[l,e[s]]}function o(s){return s===void 0?s:[a.has(s),e[s]]}}function Ye(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function De(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_lq47rm?.base??"",Tt=globalThis.__sveltekit_lq47rm?.assets??x??"",It="1774913971226",ze="sveltekit:snapshot",He="sveltekit:scroll",Je="sveltekit:states",Ot="sveltekit:pageurl",V="sveltekit:history",z="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Le=location.origin;function Xe(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function q(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Ze(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const s=location.hash.split("#")[1]||"/";r.hash=`#${s}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),o=r?.origin===Le&&e.hasAttribute("download");return{url:r,external:i,target:a,download:o}}function ne(e){let t=null,n=null,r=null,a=null,i=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,"preload-code")),a===null&&(a=D(s,"preload-data")),t===null&&(t=D(s,"keepfocus")),n===null&&(n=D(s,"noscroll")),i===null&&(i=D(s,"reload")),o===null&&(o=D(s,"replacestate")),s=Qe(s);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(o)}}function Be(e){const t=Ee(e);let n=!0;function r(){n=!0,t.update(o=>o)}function a(o){n=!1,t.set(o)}function i(o){let s;return t.subscribe(l=>{(s===void 0||n&&l!==s)&&o(s=l)})}return{notify:r,set:a,subscribe:i}}const et={v:()=>{}};function Pt(){const{set:e,subscribe:t}=Ee(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Tt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==It;return o&&(e(!0),et.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==Le||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function ln(e){}const tt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...tt];const $t=new Set([...tt]);[...$t];function Ct(e){return e.filter(t=>t!=null)}function Ue(e){return e instanceof Se||e instanceof xe?e.status:500}function jt(e){return e instanceof xe?e.text:"Internal Error"}let k,H,_e;const Nt=qe.toString().includes("$$")||/function \w+\(\) \{\}/.test(qe.toString()),Ke="a:";Nt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},H={current:null},_e={current:!1}):(k=new class{#e=L({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=L(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=L(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=L({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=L({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=L({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=L(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=L(new URL(Ke));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},H=new class{#e=L(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},_e=new class{#e=L(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},et.v=()=>_e.current=!0);function qt(e){Object.assign(k,e)}const Dt=new Set(["icon","shortcut icon","apple-touch-icon"]);let F=null;const C=Ye(He)??{},J=Ye(ze)??{},$={url:Be({}),page:Be({}),navigating:Ee(null),updated:Pt()};function Te(e){C[e]=q()}function Vt(e,t){let n=e+1;for(;C[n];)delete C[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function X(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function nt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Me(){}let Ie,we,re,I,ye,y;const ae=[],oe=[];let A=null;function be(){A?.fork?.then(e=>e?.discard()),A=null}const ee=new Map,rt=new Set,Bt=new Set,Y=new Set;let m={branch:[],error:null,url:null},at=!1,se=!1,Fe=!0,Q=!1,G=!1,ot=!1,Oe=!1,st,w,R,N;const ie=new Set,Ge=new Map;async function dn(e,t,n){globalThis.__sveltekit_lq47rm?.data&&globalThis.__sveltekit_lq47rm.data,document.URL!==location.href&&(location.href=location.href),y=e,await e.hooks.init?.(),Ie=Ut(e),I=document.documentElement,ye=t,we=e.nodes[0],re=e.nodes[1],we(),re(),w=history.state?.[V],R=history.state?.[z],w||(w=R=Date.now(),history.replaceState({...history.state,[V]:w,[z]:R},""));const r=C[w];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await tn(ye,n)):(await B({type:"enter",url:Xe(y.hash?an(new URL(location.href)):location.href),replace_state:!0}),a()),en()}function Kt(){ae.length=0,Oe=!1}function it(e){oe.some(t=>t?.snapshot)&&(J[e]=oe.map(t=>t?.snapshot?.capture()))}function lt(e){J[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function We(){Te(w),De(He,C),it(R),De(ze,J)}async function Mt(e,t,n,r){let a;t.invalidateAll&&be(),await B({type:"goto",url:Xe(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Oe=!0,a=[...Ge.keys()]),t.invalidate&&t.invalidate.forEach(Zt)}}),t.invalidateAll&&te().then(te).then(()=>{Ge.forEach(({resource:i},o)=>{a?.includes(o)&&i.refresh?.()})})}async function Ft(e){if(e.id!==A?.id){be();const t={};ie.add(t),A={id:e.id,token:t,promise:ut({...e,preload:t}).then(n=>(ie.delete(t),n.type==="loaded"&&n.state.error&&be(),n)),fork:null}}return A.promise}async function me(e){const t=(await fe(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function ct(e,t,n){const r={params:m.params,route:{id:m.route?.id??null},url:new URL(location.href)};m={...e.state,nav:r};const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(k,e.props.page),st=new y.root({target:t,props:{...e.props,stores:$,components:oe},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),lt(R),n){const i={from:null,to:{...r,scroll:C[w]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};Y.forEach(o=>o(i))}se=!0}async function le({url:e,params:t,branch:n,errors:r,status:a,error:i,route:o,form:s}){let l="never";if(x&&(e.pathname===x||e.pathname===x+"/"))l="always";else for(const u of n)u?.slash!==void 0&&(l=u.slash);e.pathname=_t(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:o},props:{constructors:Ct(n).map(u=>u.node.component),page:Ne(k)}};s!==void 0&&(c.props.form=s);let f={},p=!k,v=0;for(let u=0;us(new URL(o))))return!0;return!1}function $e(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Yt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(o=>i.includes(o))&&i.every(o=>a.includes(o))&&n.delete(r)}return n}function zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Ne(k),constructors:[]}}}async function ut({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(A?.id===e)return ie.delete(A.token),A.promise;const{errors:o,layouts:s,leaf:l}=a,c=[...s,l];o.forEach(g=>g?.().catch(()=>{})),c.forEach(g=>g?.[1]().catch(()=>{}));const f=m.url?e!==ce(m.url):!1,p=m.route?a.id!==m.route.id:!1,v=Yt(m.url,n);let h=!1;const u=c.map(async(g,d)=>{if(!g)return;const E=m.branch[d];return g[1]===E?.loader&&!Wt(h,p,f,v,E.universal?.uses,r)?E:(h=!0,Pe({loader:g[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let P=0;P{});const _=[];for(let g=0;gPromise.resolve({}),server_data_node:$e(i)}),s={node:await re(),loader:re,universal:null,server:null,data:null};return le({url:n,params:a,branch:[o,s],status:e,error:t,errors:[],route:null})}catch(o){if(o instanceof Re)return Mt(new URL(o.location,location.href),{},0);throw o}}async function Jt(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await y.hooks.reroute({url:new URL(e),fetch:async(i,o)=>Gt(i,o,e).promise})??e;if(typeof a=="string"){const i=new URL(e);y.hash?i.hash=a:i.pathname=a,a=i}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function fe(e,t){if(e&&!ue(e,x,y.hash)){const n=await Jt(e);if(!n)return;const r=Xt(n);for(const a of Ie){const i=a.exec(r);if(i)return{id:ce(e),invalidating:t,route:a,params:vt(i),url:e}}}}function Xt(e){return mt(y.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function ce(e){return(y.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ft({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let o=!1;const s=je(m,n,e,t,i??null);r!==void 0&&(s.navigation.delta=r),a!==void 0&&(s.navigation.event=a);const l={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return Q||rt.forEach(c=>c(l)),o?null:s}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o={},redirect_count:s=0,nav_token:l={},accept:c=Me,block:f=Me,event:p}){const v=N;N=l;const h=await fe(t,!1),u=e==="enter"?je(m,h,t,e):ft({url:t,type:e,delta:n?.delta,intent:h,scroll:n?.scroll,event:p});if(!u){f(),N===l&&(N=v);return}const _=w,g=R;c(),Q=!0,se&&u.navigation.type!=="enter"&&$.navigating.set(H.current=u.navigation);let d=h&&await ut(h);if(!d){if(ue(t,x,y.hash))return await X(t,i);d=await dt(t,{id:null},await Z(new xe(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=h?.url||t,N!==l)return u.reject(new Error("navigation aborted")),!1;if(d.type==="redirect"){if(s<20){await B({type:e,url:new URL(d.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:o,redirect_count:s+1,nav_token:l}),u.fulfil(void 0);return}d=await Ce({status:500,error:await Z(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else d.props.page.status>=400&&await $.updated.check()&&(await nt(),await X(t,i));if(Kt(),Te(_),it(g),d.props.page.url.pathname!==t.pathname&&(t.pathname=d.props.page.url.pathname),o=n?n.state:o,!n){const b=i?0:1,K={[V]:w+=b,[z]:R+=b,[Je]:o};(i?history.replaceState:history.pushState).call(history,K,"",t),i||Vt(w,R)}const E=h&&A?.id===h.id?A.fork:null;A=null,d.props.page.state=o;let S;if(se){const b=(await Promise.all(Array.from(Bt,M=>M(u.navigation)))).filter(M=>typeof M=="function");if(b.length>0){let M=function(){b.forEach(he=>{Y.delete(he)})};b.push(M),b.forEach(he=>{Y.add(he)})}const K=u.navigation.to;m={...d.state,nav:{params:K.params,route:K.route,url:K.url}},d.props.page&&(d.props.page.url=t);const de=E&&await E;de?S=de.commit():(F=null,st.$set(d.props),F&&Object.assign(d.props.page,F),qt(d.props.page),S=gt?.()),ot=!0}else await ct(d,ye,!1);const{activeElement:O}=document;await S,await te(),await te();let P=null;if(Fe){const b=n?n.scroll:a?q():null;b?scrollTo(b.x,b.y):(P=t.hash&&document.getElementById(ht(t)))?P.scrollIntoView():scrollTo(0,0)}const pt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!pt&&rn(t,!P),Fe=!0,d.props.page&&(F&&Object.assign(d.props.page,F),Object.assign(k,d.props.page)),Q=!1,e==="popstate"&<(R),u.fulfil(void 0),u.navigation.to&&(u.navigation.to.scroll=q()),Y.forEach(b=>b(u.navigation)),$.navigating.set(H.current=null)}async function dt(e,t,n,r,a){return e.origin===Le&&e.pathname===location.pathname&&!at?await Ce({status:r,error:n,url:e,route:t}):await X(e,a)}function Qt(){let e,t={element:void 0,href:void 0},n;I.addEventListener("mousemove",s=>{const l=s.target;clearTimeout(e),e=setTimeout(()=>{i(l,j.hover)},20)});function r(s){s.defaultPrevented||i(s.composedPath()[0],j.tap)}I.addEventListener("mousedown",r),I.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(s=>{for(const l of s)l.isIntersecting&&(me(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(s,l){const c=Ze(s,I),f=c===t.element&&c?.href===t.href&&l>=n;if(!c||f)return;const{url:p,external:v,download:h}=ve(c,x,y.hash);if(v||h)return;const u=ne(c),_=p&&ce(m.url)===ce(p);if(!(u.reload||_))if(l<=u.preload_data){t={element:c,href:c.href},n=j.tap;const g=await fe(p,!1);if(!g)return;Ft(g)}else l<=u.preload_code&&(t={element:c,href:c.href},n=l,me(p))}function o(){a.disconnect();for(const s of I.querySelectorAll("a")){const{url:l,external:c,download:f}=ve(s,x,y.hash);if(c||f)continue;const p=ne(s);p.reload||(p.preload_code===j.viewport&&a.observe(s),p.preload_code===j.eager&&me(l))}}Y.add(o),o()}function Z(e,t){if(e instanceof Se)return e.body;const n=Ue(e),r=jt(e);return y.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Zt(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function en(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(We(),!Q){const r=je(m,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};rt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&We()}),navigator.connection?.saveData||Qt(),I.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Ze(t.composedPath()[0],I);if(!n)return;const{url:r,external:a,target:i,download:o}=ve(n,x,y.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const s=ne(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||o)return;const[c,f]=(y.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===pe(location);if(a||s.reload&&(!p||!f)){ft({url:r,type:"link",event:t})?Q=!0:t.preventDefault();return}if(f!==void 0&&p){const[,v]=m.url.href.split("#");if(v===f){if(t.preventDefault(),f===""||f==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const h=n.ownerDocument.getElementById(decodeURIComponent(f));h&&(h.scrollIntoView(),h.focus())}return}if(G=!0,Te(w),e(r),!s.replace_state)return;G=!1}t.preventDefault(),await new Promise(v=>{requestAnimationFrame(()=>{setTimeout(v,0)}),setTimeout(v,100)}),await B({type:"link",url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),I.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const o=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(o,x,!1))return;const s=t.target,l=ne(s);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(s,r);o.search=new URLSearchParams(c).toString(),B({type:"form",url:o,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??o.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ke){if(t.state?.[V]){const n=t.state[V];if(N={},n===w)return;const r=C[n],a=t.state[Je]??{},i=new URL(t.state[Ot]??location.href),o=t.state[z],s=m.url?pe(location)===pe(m.url):!1;if(o===R&&(ot||s)){a!==k.state&&(k.state=a),e(i),C[w]=q(),r&&scrollTo(r.x,r.y),w=n;return}const c=n-w;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{w=n,R=o},block:()=>{history.go(-c)},nav_token:N,event:t})}else if(!G){const n=new URL(location.href);e(n),y.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[V]:++w,[z]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Dt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&$.navigating.set(H.current=null)});function e(t){m.url=k.url=t,$.page.set(Ne(k)),$.page.notify()}}async function tn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:o,data:s,form:l}){at=!0;const c=new URL(location.href);let f;({params:a={},route:i={id:null}}=await fe(c,!1)||{}),f=Ie.find(({id:h})=>h===i.id);let p,v=!0;try{const h=r.map(async(_,g)=>{const d=s[g];return d?.uses&&(d.uses=nn(d.uses)),Pe({loader:y.nodes[_],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S{const s=history.state;ke=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(s,"",e),t&&scrollTo(i,o),ke=!1})}else{const i=document.body,o=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),o!==null?i.setAttribute("tabindex",o):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let o=0;o{if(a.rangeCount===i.length){for(let o=0;o{i=c,o=f});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:s},fulfil:i,reject:o}}function Ne(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function an(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function ht(e){let t;if(y.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{dn as a,ln as l,k as p,$ as s};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/BuZ8u_VS.js b/.svelte-kit/output/client/_app/immutable/chunks/BuZ8u_VS.js
deleted file mode 100644
index 1d4dc6f..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/BuZ8u_VS.js
+++ /dev/null
@@ -1 +0,0 @@
-var Ht=Array.isArray,Ut=Array.prototype.indexOf,ie=Array.prototype.includes,Cn=Array.from,Mn=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,Vt=Object.getOwnPropertyDescriptors,Bt=Object.prototype,zt=Array.prototype,it=Object.getPrototypeOf,Qe=Object.isExtensible;const Gt=()=>{};function Fn(e){return e()}function Kt(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}const E=2,Q=4,we=8,ut=1<<24,q=16,F=32,ee=64,$t=128,k=512,g=1024,b=2048,j=4096,P=8192,C=16384,le=32768,et=1<<25,Ae=65536,Me=1<<17,Xt=1<<18,ye=1<<19,ot=1<<20,jn=1<<25,te=65536,Fe=1<<21,Oe=1<<22,B=1<<23,de=Symbol("$state"),Ln=Symbol("legacy props"),Yn=Symbol(""),Y=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Hn=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml"),Ne=3,ct=8;function Zt(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Un(e,t,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Wt(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Jt(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Qt(e){throw new Error("https://svelte.dev/e/effect_orphan")}function en(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Vn(){throw new Error("https://svelte.dev/e/hydration_failed")}function Bn(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function tn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function nn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function rn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function zn(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const Gn=1,Kn=2,$n=16,Xn=1,Zn=2,Wn=4,Jn=8,Qn=16,er=1,tr=2,sn="[",ln="[!",nr="[?",an="]",Ue={},m=Symbol(),fn="http://www.w3.org/1999/xhtml";function Ve(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function rr(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let ne=!1;function sr(e){ne=e}let S;function fe(e){if(e===null)throw Ve(),Ue;return S=e}function lr(){return fe($(S))}function ar(e){if(ne){if($(S)!==null)throw Ve(),Ue;S=e}}function ir(e=1){if(ne){for(var t=e,n=S;t--;)n=$(n);S=n}}function fr(e=!0){for(var t=0,n=S;;){if(n.nodeType===ct){var r=n.data;if(r===an){if(t===0)return n;t-=1}else(r===sn||r===ln||r[0]==="["&&!isNaN(Number(r.slice(1))))&&(t+=1)}var s=$(n);e&&n.remove(),n=s}}function ur(e){if(!e||e.nodeType!==ct)throw Ve(),Ue;return e.data}function _t(e){return e===this.v}function un(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function vt(e){return!un(e,this.v)}let De=!1;function or(){De=!0}let T=null;function Se(e){T=e}function cr(e,t=!1,n){T={p:T,i:!1,c:null,e:null,s:e,x:null,r:d,l:De&&!t?{s:null,u:null,$:[]}:null}}function _r(e){var t=T,n=t.e;if(n!==null){t.e=null;for(var r of n)Ot(r)}return t.i=!0,T=t.p,{}}function ge(){return!De||T!==null&&T.l===null}let X=[];function dt(){var e=X;X=[],Kt(e)}function tt(e){if(X.length===0&&!he){var t=X;queueMicrotask(()=>{t===X&&dt()})}X.push(e)}function on(){for(;X.length>0;)dt()}function cn(e){var t=d;if(t===null)return v.f|=B,e;if((t.f&le)===0&&(t.f&Q)===0)throw e;Re(e,t)}function Re(e,t){for(;t!==null;){if((t.f&$t)!==0){if((t.f&le)===0)throw e;try{t.b.error(e);return}catch(n){e=n}}t=t.parent}throw e}const _n=-7169;function y(e,t){e.f=e.f&_n|t}function Be(e){(e.f&k)!==0||e.deps===null?y(e,g):y(e,j)}function ht(e){if(e!==null)for(const t of e)(t.f&E)===0||(t.f&te)===0||(t.f^=te,ht(t.deps))}function vn(e,t,n){(e.f&b)!==0?t.add(e):(e.f&j)!==0&&n.add(e),ht(e.deps),y(e,g)}const H=new Set;let w=null,D=null,je=null,he=!1,Pe=!1,ae=null,be=null;var nt=0;let dn=1;class G{id=dn++;current=new Map;previous=new Map;#i=new Set;#f=new Set;#r=new Map;#t=new Map;#_=null;#e=[];#v=[];#l=new Set;#s=new Set;#n=new Map;is_fork=!1;#u=!1;#a=new Set;#o(){return this.is_fork||this.#t.size>0}#p(){for(const r of this.#a)for(const s of r.#t.keys()){for(var t=!1,n=s;n.parent!==null;){if(this.#n.has(n)){t=!0;break}n=n.parent}if(!t)return!0}return!1}skip_effect(t){this.#n.has(t)||this.#n.set(t,{d:[],m:[]})}unskip_effect(t){var n=this.#n.get(t);if(n){this.#n.delete(t);for(var r of n.d)y(r,b),this.schedule(r);for(r of n.m)y(r,j),this.schedule(r)}}#c(){if(nt++>1e3&&(H.delete(this),pn()),!this.#o()){for(const a of this.#l)this.#s.delete(a),y(a,b),this.schedule(a);for(const a of this.#s)y(a,j),this.schedule(a)}const t=this.#e;this.#e=[],this.apply();var n=ae=[],r=[],s=be=[];for(const a of t)try{this.#d(a,n,r)}catch(i){throw yt(a),i}if(w=null,s.length>0){var l=G.ensure();for(const a of s)l.schedule(a)}if(ae=null,be=null,this.#o()||this.#p()){this.#h(r),this.#h(n);for(const[a,i]of this.#n)wt(a,i)}else{this.#r.size===0&&H.delete(this),this.#l.clear(),this.#s.clear();for(const a of this.#i)a(this);this.#i.clear(),rt(r),rt(n),this.#_?.resolve()}var u=w;if(this.#e.length>0){const a=u??=this;a.#e.push(...this.#e.filter(i=>!a.#e.includes(i)))}u!==null&&(H.add(u),u.#c()),H.has(this)||this.#w()}#d(t,n,r){t.f^=g;for(var s=t.first;s!==null;){var l=s.f,u=(l&(F|ee))!==0,a=u&&(l&g)!==0,i=a||(l&P)!==0||this.#n.has(s);if(!i&&s.fn!==null){u?s.f^=g:(l&Q)!==0?n.push(s):Ee(s)&&((l&q)!==0&&this.#s.add(s),oe(s));var o=s.first;if(o!==null){s=o;continue}}for(;s!==null;){var f=s.next;if(f!==null){s=f;break}s=s.parent}}}#h(t){for(var n=0;n!this.current.has(c));if(s.length===0)t&&f.discard();else if(n.length>0){f.activate();var l=new Set,u=new Map;for(var a of n)pt(a,s,l,u);u=new Map;var i=[...f.current.keys()].filter(c=>this.current.has(c)?this.current.get(c)[0]!==c:!0);for(const c of this.#v)(c.f&(C|P|Me))===0&&ze(c,i,u)&&((c.f&(Oe|q))!==0?(y(c,b),f.schedule(c)):f.#l.add(c));if(f.#e.length>0){f.apply();for(var o of f.#e)f.#d(o,[],[]);f.#e=[]}f.deactivate()}}for(const f of H)f.#a.has(this)&&(f.#a.delete(this),f.#a.size===0&&!f.#o()&&(f.activate(),f.#c()))}increment(t,n){let r=this.#r.get(n)??0;if(this.#r.set(n,r+1),t){let s=this.#t.get(n)??0;this.#t.set(n,s+1)}}decrement(t,n,r){let s=this.#r.get(n)??0;if(s===1?this.#r.delete(n):this.#r.set(n,s-1),t){let l=this.#t.get(n)??0;l===1?this.#t.delete(n):this.#t.set(n,l-1)}this.#u||r||(this.#u=!0,tt(()=>{this.#u=!1,this.flush()}))}transfer_effects(t,n){for(const r of t)this.#l.add(r);for(const r of n)this.#s.add(r);t.clear(),n.clear()}oncommit(t){this.#i.add(t)}ondiscard(t){this.#f.add(t)}settled(){return(this.#_??=ft()).promise}static ensure(){if(w===null){const t=w=new G;Pe||(H.add(w),he||tt(()=>{w===t&&t.flush()}))}return w}apply(){{D=null;return}}schedule(t){if(je=t,t.b?.is_pending&&(t.f&(Q|we|ut))!==0&&(t.f&le)===0){t.b.defer_effect(t);return}for(var n=t;n.parent!==null;){n=n.parent;var r=n.f;if(ae!==null&&n===d&&(v===null||(v.f&E)===0))return;if((r&(ee|F))!==0){if((r&g)===0)return;n.f^=g}}this.#e.push(n)}}function hn(e){var t=he;he=!0;try{for(var n;;){if(on(),w===null)return n;w.flush()}}finally{he=t}}function pn(){try{en()}catch(e){Re(e,je)}}let L=null;function rt(e){var t=e.length;if(t!==0){for(var n=0;n0)){z.clear();for(const s of L){if((s.f&(C|P))!==0)continue;const l=[s];let u=s.parent;for(;u!==null;)L.has(u)&&(L.delete(u),l.push(u)),u=u.parent;for(let a=l.length-1;a>=0;a--){const i=l[a];(i.f&(C|P))===0&&oe(i)}}L.clear()}}L=null}}function pt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(const s of e.reactions){const l=s.f;(l&E)!==0?pt(s,t,n,r):(l&(Oe|q))!==0&&(l&b)===0&&ze(s,t,r)&&(y(s,b),Ge(s))}}function ze(e,t,n){const r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(const s of e.deps){if(ie.call(t,s))return!0;if((s.f&E)!==0&&ze(s,t,n))return n.set(s,!0),!0}return n.set(e,!1),!1}function Ge(e){w.schedule(e)}function wt(e,t){if(!((e.f&F)!==0&&(e.f&g)!==0)){(e.f&b)!==0?t.d.push(e):(e.f&j)!==0&&t.m.push(e),y(e,g);for(var n=e.first;n!==null;)wt(n,t),n=n.next}}function yt(e){y(e,g);for(var t=e.first;t!==null;)yt(t),t=t.next}function gt(e,t,n,r){const s=ge()?$e:gn;var l=e.filter(_=>!_.settled);if(n.length===0&&l.length===0){r(t.map(s));return}var u=d,a=wn(),i=l.length===1?l[0].promise:l.length>1?Promise.all(l.map(_=>_.promise)):null;function o(_){a();try{r(_)}catch(p){(u.f&C)===0&&Re(p,u)}xe()}if(n.length===0){i.then(()=>o(t.map(s)));return}var f=Ke();function c(){Promise.all(n.map(_=>yn(_))).then(_=>o([...t.map(s),..._])).catch(_=>Re(_,u)).finally(()=>f())}i?i.then(()=>{a(),c(),xe()}):c()}function wn(){var e=d,t=v,n=T,r=w;return function(l=!0){ue(e),K(t),Se(n),l&&(e.f&C)===0&&(r?.activate(),r?.apply())}}function xe(e=!0){ue(null),K(null),Se(null),e&&w?.deactivate()}function Ke(){var e=d,t=e.b,n=w,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(s=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,s)}}function $e(e){var t=E|b,n=v!==null&&(v.f&E)!==0?v:null;return d!==null&&(d.f|=ye),{ctx:T,deps:null,effects:null,equals:_t,f:t,fn:e,reactions:null,rv:0,v:m,wv:0,parent:n??d,ac:null}}function yn(e,t,n){let r=d;r===null&&Zt();var s=void 0,l=Ze(m),u=!v,a=new Map;return kn(()=>{var i=d,o=ft();s=o.promise;try{Promise.resolve(e()).then(o.resolve,o.reject).finally(xe)}catch(p){o.reject(p),xe()}var f=w;if(u){if((i.f&le)!==0)var c=Ke();if(r.b.is_rendered())a.get(f)?.reject(Y),a.delete(f);else{for(const p of a.values())p.reject(Y);a.clear()}a.set(f,o)}const _=(p,h=void 0)=>{if(c){var N=h===Y;c(N)}if(!(h===Y||(i.f&C)!==0)){if(f.activate(),h)l.f|=B,Ye(l,h);else{(l.f&B)!==0&&(l.f^=B),Ye(l,p);for(const[ce,me]of a){if(a.delete(ce),ce===f)break;me.reject(Y)}}f.deactivate()}};o.promise.then(_,p=>_(null,p||"unknown"))}),xn(()=>{for(const i of a.values())i.reject(Y)}),new Promise(i=>{function o(f){function c(){f===s?i(l):o(s)}f.then(c,c)}o(s)})}function vr(e){const t=$e(e);return Ct(t),t}function gn(e){const t=$e(e);return t.equals=vt,t}function En(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n0&&!bt&&Tn()}return t}function Tn(){bt=!1;for(const e of Le)(e.f&g)!==0&&y(e,j),Ee(e)&&oe(e);Le.clear()}function hr(e,t=1){var n=W(e),r=t===1?n++:n--;return V(e,n),r}function Ce(e){V(e,e.v+1)}function Tt(e,t,n){var r=e.reactions;if(r!==null)for(var s=ge(),l=r.length,u=0;u{if(J===l)return a();var i=v,o=J;K(null),at(l);var f=a();return K(i),at(o),f};return r&&n.set("length",U(e.length)),new Proxy(e,{defineProperty(a,i,o){(!("value"in o)||o.configurable===!1||o.enumerable===!1||o.writable===!1)&&tn();var f=n.get(i);return f===void 0?u(()=>{var c=U(o.value);return n.set(i,c),c}):V(f,o.value,!0),!0},deleteProperty(a,i){var o=n.get(i);if(o===void 0){if(i in a){const f=u(()=>U(m));n.set(i,f),Ce(s)}}else V(o,m),Ce(s);return!0},get(a,i,o){if(i===de)return e;var f=n.get(i),c=i in a;if(f===void 0&&(!c||ve(a,i)?.writable)&&(f=u(()=>{var p=_e(c?a[i]:m),h=U(p);return h}),n.set(i,f)),f!==void 0){var _=W(f);return _===m?void 0:_}return Reflect.get(a,i,o)},getOwnPropertyDescriptor(a,i){var o=Reflect.getOwnPropertyDescriptor(a,i);if(o&&"value"in o){var f=n.get(i);f&&(o.value=W(f))}else if(o===void 0){var c=n.get(i),_=c?.v;if(c!==void 0&&_!==m)return{enumerable:!0,configurable:!0,value:_,writable:!0}}return o},has(a,i){if(i===de)return!0;var o=n.get(i),f=o!==void 0&&o.v!==m||Reflect.has(a,i);if(o!==void 0||d!==null&&(!f||ve(a,i)?.writable)){o===void 0&&(o=u(()=>{var _=f?_e(a[i]):m,p=U(_);return p}),n.set(i,o));var c=W(o);if(c===m)return!1}return f},set(a,i,o,f){var c=n.get(i),_=i in a;if(r&&i==="length")for(var p=o;pU(m)),n.set(p+"",h))}if(c===void 0)(!_||ve(a,i)?.writable)&&(c=u(()=>U(void 0)),V(c,_e(o)),n.set(i,c));else{_=c.v!==m;var N=u(()=>_e(o));V(c,N)}var ce=Reflect.getOwnPropertyDescriptor(a,i);if(ce?.set&&ce.set.call(f,o),!_){if(r&&typeof i=="string"){var me=n.get("length"),Ie=Number(i);Number.isInteger(Ie)&&Ie>=me.v&&V(me,Ie+1)}Ce(s)}return!0},ownKeys(a){W(s);var i=Reflect.ownKeys(a).filter(c=>{var _=n.get(c);return _===void 0||_.v!==m});for(var[o,f]of n)f.v!==m&&!(o in a)&&i.push(o);return i},setPrototypeOf(){nn()}})}var st,An,Sn,At,St;function pr(){if(st===void 0){st=window,An=document,Sn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;At=ve(t,"firstChild").get,St=ve(t,"nextSibling").get,Qe(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Qe(n)&&(n.__t=void 0)}}function ke(e=""){return document.createTextNode(e)}function qe(e){return At.call(e)}function $(e){return St.call(e)}function wr(e,t){if(!ne)return qe(e);var n=qe(S);if(n===null)n=S.appendChild(ke());else if(t&&n.nodeType!==Ne){var r=ke();return n?.before(r),fe(r),r}return t&&We(n),fe(n),n}function yr(e,t=!1){if(!ne){var n=qe(e);return n instanceof Comment&&n.data===""?$(n):n}if(t){if(S?.nodeType!==Ne){var r=ke();return S?.before(r),fe(r),r}We(S)}return S}function gr(e,t=1,n=!1){let r=ne?S:e;for(var s;t--;)s=r,r=$(r);if(!ne)return r;if(n){if(r?.nodeType!==Ne){var l=ke();return r===null?s?.after(l):r.before(l),fe(l),l}We(r)}return fe(r),r}function Er(e){e.textContent=""}function mr(){return!1}function br(e,t,n){return document.createElementNS(fn,e,void 0)}function We(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===Ne;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Rt(e){var t=v,n=d;K(null),ue(null);try{return e()}finally{K(t),ue(n)}}function xt(e){d===null&&(v===null&&Qt(),Jt()),se&&Wt()}function Rn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function M(e,t){var n=d;n!==null&&(n.f&P)!==0&&(e|=P);var r={ctx:T,deps:null,nodes:null,f:e|b|k,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};w?.register_created_effect(r);var s=r;if((e&Q)!==0)ae!==null?ae.push(r):G.ensure().schedule(r);else if(t!==null){try{oe(r)}catch(u){throw re(r),u}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&ye)===0&&(s=s.first,(e&q)!==0&&(e&Ae)!==0&&s!==null&&(s.f|=Ae))}if(s!==null&&(s.parent=n,n!==null&&Rn(s,n),v!==null&&(v.f&E)!==0&&(e&ee)===0)){var l=v;(l.effects??=[]).push(s)}return r}function kt(){return v!==null&&!I}function xn(e){const t=M(we,null);return y(t,g),t.teardown=e,t}function Tr(e){xt();var t=d.f,n=!v&&(t&F)!==0&&(t&le)===0;if(n){var r=T;(r.e??=[]).push(e)}else return Ot(e)}function Ot(e){return M(Q|ot,e)}function Ar(e){return xt(),M(we|ot,e)}function Sr(e){G.ensure();const t=M(ee|ye,e);return(n={})=>new Promise(r=>{n.outro?Dn(t,()=>{re(t),r(void 0)}):(re(t),r(void 0))})}function Rr(e){return M(Q,e)}function kn(e){return M(Oe|ye,e)}function xr(e,t=0){return M(we|t,e)}function kr(e,t=[],n=[],r=[]){gt(r,t,n,s=>{M(we,()=>e(...s.map(W)))})}function Or(e,t=[],n=[],r=[]){if(n.length>0||r.length>0)var s=Ke();gt(r,t,n,l=>{M(Q,()=>e(...l.map(W))),s&&s()})}function Nr(e,t=0){var n=M(q|t,e);return n}function Dr(e){return M(F|ye,e)}function Nt(e){var t=e.teardown;if(t!==null){const n=se,r=v;lt(!0),K(null);try{t.call(null)}finally{lt(n),K(r)}}}function Je(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){const s=n.ac;s!==null&&Rt(()=>{s.abort(Y)});var r=n.next;(n.f&ee)!==0?n.parent=null:re(n,t),n=r}}function On(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&F)===0&&re(t),t=n}}function re(e,t=!0){var n=!1;(t||(e.f&Xt)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(Nn(e.nodes.start,e.nodes.end),n=!0),y(e,et),Je(e,t&&!n),pe(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(const l of r)l.stop();Nt(e),e.f^=et,e.f|=C;var s=e.parent;s!==null&&s.first!==null&&Dt(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Nn(e,t){for(;e!==null;){var n=e===t?null:$(e);e.remove(),e=n}}function Dt(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Dn(e,t,n=!0){var r=[];It(e,r,!0);var s=()=>{n&&re(e),t&&t()},l=r.length;if(l>0){var u=()=>--l||s();for(var a of r)a.out(u)}else s()}function It(e,t,n){if((e.f&P)===0){e.f^=P;var r=e.nodes&&e.nodes.t;if(r!==null)for(const a of r)(a.is_global||n)&&t.push(a);for(var s=e.first;s!==null;){var l=s.next,u=(s.f&Ae)!==0||(s.f&F)!==0&&(e.f&q)!==0;It(s,t,u?n:!1),s=l}}}function Ir(e){Pt(e,!0)}function Pt(e,t){if((e.f&P)!==0){e.f^=P,(e.f&g)===0&&(y(e,b),G.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Ae)!==0||(n.f&F)!==0;Pt(n,s?t:!1),n=r}var l=e.nodes&&e.nodes.t;if(l!==null)for(const u of l)(u.is_global||t)&&u.in()}}function Pr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var s=n===r?null:$(n);t.append(n),n=s}}let Te=!1,se=!1;function lt(e){se=e}let v=null,I=!1;function K(e){v=e}let d=null;function ue(e){d=e}let O=null;function Ct(e){v!==null&&(O===null?O=[e]:O.push(e))}let A=null,R=0,x=null;function In(e){x=e}let Mt=1,Z=0,J=Z;function at(e){J=e}function Ft(){return++Mt}function Ee(e){var t=e.f;if((t&b)!==0)return!0;if(t&E&&(e.f&=~te),(t&j)!==0){for(var n=e.deps,r=n.length,s=0;se.wv)return!0}(t&k)!==0&&D===null&&y(e,g)}return!1}function jt(e,t,n=!0){var r=e.reactions;if(r!==null&&!(O!==null&&ie.call(O,e)))for(var s=0;s{e.ac.abort(Y)}),e.ac=null);try{e.f|=Fe;var f=e.fn,c=f();e.f|=le;var _=e.deps,p=w?.is_fork;if(A!==null){var h;if(p||pe(e,R),_!==null&&R>0)for(_.length=R+A.length,h=0;h{Z()&&(j(r),ee(()=>(e===0&&(i=te(()=>t(()=>Y(r)))),e+=1,()=>{T(()=>{e-=1,e===0&&(i?.(),i=void 0,Y(r))})})))}}var ke=ce|ue;function Ie(t,e,r,i){new Le(t,e,r,i)}class Le{parent;is_pending=!1;transform_error;#t;#_=v?g:null;#i;#o;#e;#n=null;#r=null;#s=null;#a=null;#l=0;#h=0;#d=!1;#p=new Set;#g=new Set;#f=null;#b=xe(()=>(this.#f=z(this.#l),()=>{this.#f=null}));constructor(e,r,i,n){this.#t=e,this.#i=r,this.#o=s=>{var a=m;a.b=this,a.f|=q,i(s)},this.parent=m.b,this.transform_error=n??this.parent?.transform_error??(s=>s),this.#e=re(()=>{if(v){const s=this.#_;se();const a=s.data===ie;if(s.data.startsWith(P)){const f=JSON.parse(s.data.slice(P.length));this.#E(f)}else a?this.#w():this.#m()}else this.#v()},ke),v&&(this.#t=g)}#m(){try{this.#n=p(()=>this.#o(this.#t))}catch(e){this.error(e)}}#E(e){const r=this.#i.failed;r&&(this.#s=p(()=>{r(this.#t,()=>e,()=>()=>{})}))}#w(){const e=this.#i.pending;e&&(this.is_pending=!0,this.#r=p(()=>e(this.#t)),T(()=>{var r=this.#a=document.createDocumentFragment(),i=J();r.append(i),this.#n=this.#u(()=>p(()=>this.#o(i))),this.#h===0&&(this.#t.before(r),this.#a=null,x(this.#r,()=>{this.#r=null}),this.#c(V))}))}#v(){try{if(this.is_pending=this.has_pending_snippet(),this.#h=0,this.#l=0,this.#n=p(()=>{this.#o(this.#t)}),this.#h>0){var e=this.#a=document.createDocumentFragment();ne(this.#n,e);const r=this.#i.pending;this.#r=p(()=>r(this.#t))}else this.#c(V)}catch(r){this.error(r)}}#c(e){this.is_pending=!1,e.transfer_effects(this.#p,this.#g)}defer_effect(e){ae(e,this.#p,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#i.pending}#u(e){var r=m,i=G,n=K;N(this.#e),D(this.#e),W(this.#e.ctx);try{return fe.ensure(),e()}catch(s){return he(s),null}finally{N(r),D(i),W(n)}}#y(e,r){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e,r);return}this.#h+=e,this.#h===0&&(this.#c(r),this.#r&&x(this.#r,()=>{this.#r=null}),this.#a&&(this.#t.before(this.#a),this.#a=null))}update_pending_count(e,r){this.#y(e,r),this.#l+=e,!(!this.#f||this.#d)&&(this.#d=!0,T(()=>{this.#d=!1,this.#f&&oe(this.#f,this.#l)}))}get_effect_pending(){return this.#b(),j(this.#f)}error(e){var r=this.#i.onerror;let i=this.#i.failed;if(!r&&!i)throw e;this.#n&&(k(this.#n),this.#n=null),this.#r&&(k(this.#r),this.#r=null),this.#s&&(k(this.#s),this.#s=null),v&&(F(this.#_),le(),F(de()));var n=!1,s=!1;const a=()=>{if(n){pe();return}n=!0,s&&_e(),this.#s!==null&&x(this.#s,()=>{this.#s=null}),this.#u(()=>{this.#v()})},c=f=>{try{s=!0,r?.(f,a),s=!1}catch(h){S(h,this.#e&&this.#e.parent)}i&&(this.#s=this.#u(()=>{try{return p(()=>{var h=m;h.b=this,h.f|=q,i(this.#t,()=>f,()=>a)})}catch(h){return S(h,this.#e.parent),null}}))};T(()=>{var f;try{f=this.transform_error(e)}catch(h){S(h,this.#e&&this.#e.parent);return}f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(c,h=>S(h,this.#e&&this.#e.parent)):c(f)})}}const Me=["touchstart","touchmove"];function Ce(t){return Me.includes(t)}const w=Symbol("events"),Q=new Set,M=new Set;function He(t,e,r,i={}){function n(s){if(i.capture||C.call(e,s),!s.cancelBubble)return ve(()=>r?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?T(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function Pe(t,e,r,i,n){var s={capture:i,passive:n},a=He(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ge(()=>{e.removeEventListener(t,a,s)})}function Ve(t,e,r){(e[w]??={})[t]=r}function We(t){for(var e=0;e{throw u});throw _}}finally{t[w]=e,delete t.currentTarget,D(y),N(E)}}}function $e(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=`${r}`)}function Be(t,e){return X(t,e)}function je(t,e){I(),e.intro=e.intro??!1;const r=e.target,i=v,n=g;try{for(var s=be(r);s&&(s.nodeType!==U||s.data!==me);)s=Ee(s);if(!s)throw L;R(!0),F(s);const a=X(t,{...e,anchor:s});return R(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
-`).some(c=>c.startsWith("https://svelte.dev/e/")))throw a;return a!==L&&console.warn("Failed to hydrate: ",a),e.recover===!1&&we(),I(),Te(r),R(!1),Be(t,e)}finally{R(i),F(n)}}const A=new Map;function X(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0,transformError:c}){I();var f=void 0,h=Se(()=>{var y=r??e.appendChild(J());Ie(y,{pending:()=>{}},l=>{Ae({});var o=K;if(s&&(o.c=s),n&&(i.$$events=n),v&&Oe(l,null),f=t(l,i)||{},v&&(m.nodes.end=g,g===null||g.nodeType!==U||g.data!==Ne))throw De(),L;Fe()},c);var E=new Set,_=l=>{for(var o=0;o{for(var l of E)for(const u of[e,document]){var o=A.get(u),d=o.get(l);--d==0?(u.removeEventListener(l,C),o.delete(l),o.size===0&&A.delete(u)):o.set(l,d)}M.delete(_),y!==r&&y.parentNode?.removeChild(y)}});return H.set(f,h),f}let H=new WeakMap;function ze(t,e){const r=H.get(t);return r?(H.delete(t),r(e)):Promise.resolve()}export{Ve as a,We as d,Pe as e,je as h,Be as m,$e as s,ze as u};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/CvWmAKek.js b/.svelte-kit/output/client/_app/immutable/chunks/CvWmAKek.js
deleted file mode 100644
index b97b2ad..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/CvWmAKek.js
+++ /dev/null
@@ -1 +0,0 @@
-import{w as B,x as L,y as m,z as D,A as S,B as A,l as M,j as R,F as U,E as p,G as w,I as x,t as Y,q as T,k as F,J as $,K as q,P as z,L as C,M as G,b as j,N as J,O as K,u as Q,Q as V,R as W,T as X,U as Z,V as H,W as k,S as ee,X as re}from"./BuZ8u_VS.js";import{B as ne}from"./D1Ae0CO3.js";import{s as ae,g as se}from"./pNsQzX0r.js";let g=!1,E=Symbol();function _e(e,n,s){const r=s[n]??={store:null,source:D(void 0),unsubscribe:m};if(r.store!==e&&!(E in s))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=m;else{var i=!0;r.unsubscribe=ae(e,u=>{i?r.source.v=u:A(r.source,u)}),i=!1}return e&&E in s?se(e):S(r.source)}function de(){const e={};function n(){B(()=>{for(var s in e)e[s].unsubscribe();L(e,E,{enumerable:!1,value:!0})})}return[e,n]}function te(e){var n=g;try{return g=!1,[e(),g]}finally{g=n}}function le(e,n,s=!1){var r;R&&(r=F,U());var i=new ne(e),u=s?p:0;function v(t,f){if(R){var d=w(r);if(t!==parseInt(d.substring(1))){var _=x();Y(_),i.anchor=_,T(!1),i.ensure(t,f),T(!0);return}}i.ensure(t,f)}M(()=>{var t=!1;n((f,d=0)=>{t=!0,v(d,f)}),t||v(-1,null)},u)}function oe(e,n,s,r){var i=!V||(s&W)!==0,u=(s&K)!==0,v=(s&k)!==0,t=r,f=!0,d=()=>(f&&(f=!1,t=v?Q(r):r),t);let _;if(u){var O=ee in e||re in e;_=$(e,n)?.set??(O&&n in e?a=>e[n]=a:void 0)}var o,I=!1;u?[o,I]=te(()=>e[n]):o=e[n],o===void 0&&r!==void 0&&(o=d(),_&&(i&&q(),_(o)));var l;if(i?l=()=>{var a=e[n];return a===void 0?d():(f=!0,a)}:l=()=>{var a=e[n];return a!==void 0&&(t=void 0),a===void 0?t:a},i&&(s&z)===0)return l;if(_){var y=e.$$legacy;return(function(a,b){return arguments.length>0?((!i||!b||y||I)&&_(b?l():a),a):l()})}var P=!1,c=((s&X)!==0?Z:H)(()=>(P=!1,l()));u&&S(c);var N=j;return(function(a,b){if(arguments.length>0){const h=b?S(c):i&&u?C(a):a;return A(c,h),P=!0,t!==void 0&&(t=h),a}return G&&P||(N.f&J)!==0?c.v:S(c)})}export{_e as a,le as i,oe as p,de as s};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/D1Ae0CO3.js b/.svelte-kit/output/client/_app/immutable/chunks/D1Ae0CO3.js
deleted file mode 100644
index 99b8f75..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/D1Ae0CO3.js
+++ /dev/null
@@ -1 +0,0 @@
-import{d as l,f as o,p as u,g as n,h as d,i as m,j as p,k as _,m as v,s as k}from"./BuZ8u_VS.js";class w{anchor;#t=new Map;#s=new Map;#e=new Map;#i=new Set;#f=!0;constructor(t,s=!0){this.anchor=t,this.#f=s}#a=t=>{if(this.#t.has(t)){var s=this.#t.get(t),e=this.#s.get(s);if(e)l(e),this.#i.delete(s);else{var f=this.#e.get(s);f&&(this.#s.set(s,f.effect),this.#e.delete(s),f.fragment.lastChild.remove(),this.anchor.before(f.fragment),e=f.effect)}for(const[i,a]of this.#t){if(this.#t.delete(i),i===t)break;const r=this.#e.get(a);r&&(o(r.effect),this.#e.delete(a))}for(const[i,a]of this.#s){if(i===s||this.#i.has(i))continue;const r=()=>{if(Array.from(this.#t.values()).includes(i)){var c=document.createDocumentFragment();v(a,c),c.append(n()),this.#e.set(i,{effect:a,fragment:c})}else o(a);this.#i.delete(i),this.#s.delete(i)};this.#f||!e?(this.#i.add(i),u(a,r,!1)):r()}}};#r=t=>{this.#t.delete(t);const s=Array.from(this.#t.values());for(const[e,f]of this.#e)s.includes(e)||(o(f.effect),this.#e.delete(e))};ensure(t,s){var e=m,f=k();if(s&&!this.#s.has(t)&&!this.#e.has(t))if(f){var i=document.createDocumentFragment(),a=n();i.append(a),this.#e.set(t,{effect:d(()=>s(a)),fragment:i})}else this.#s.set(t,d(()=>s(this.anchor)));if(this.#t.set(e,t),f){for(const[r,h]of this.#s)r===t?e.unskip_effect(h):e.skip_effect(h);for(const[r,h]of this.#e)r===t?e.unskip_effect(h.effect):e.skip_effect(h.effect);e.oncommit(this.#a),e.ondiscard(this.#r)}else p&&(this.anchor=_),this.#a(e)}}export{w as B};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/iHYN8FkY.js b/.svelte-kit/output/client/_app/immutable/chunks/iHYN8FkY.js
deleted file mode 100644
index dce228e..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/iHYN8FkY.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as o,E as p,g as u,H as y,n as _,j as l,C as g,o as r,q as E,t as d,k as m,v}from"./BuZ8u_VS.js";import{B as T}from"./D1Ae0CO3.js";function c(a,n,...s){var i=new T(a);o(()=>{const t=n()??null;i.ensure(t,t&&(e=>t(e,...s)))},p)}function N(a,n){let s=null,i=l;var t;if(l){s=m;for(var e=v(document.head);e!==null&&(e.nodeType!==g||e.data!==a);)e=r(e);if(e===null)E(!1);else{var f=r(e);e.remove(),d(f)}}l||(t=document.head.appendChild(u()));try{o(()=>n(t),y|_)}finally{i&&(E(!0),d(s))}}export{N as h,c as s};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/lKBsgujO.js b/.svelte-kit/output/client/_app/immutable/chunks/lKBsgujO.js
deleted file mode 100644
index 43631cc..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/lKBsgujO.js
+++ /dev/null
@@ -1 +0,0 @@
-import{c as w,a as S,r as b,u as h,b as o,D as T,S as e}from"./BuZ8u_VS.js";function n(r,s){return r===s||r?.[e]===s}function x(r={},s,i,l){var c=w.r,d=o;return S(()=>{var f,a;return b(()=>{f=a,a=[],h(()=>{r!==i(...a)&&(s(r,...a),f&&n(i(...f),r)&&s(null,...f))})}),()=>{let t=d;for(;t!==c&&t.parent!==null&&t.parent.f&T;)t=t.parent;const p=()=>{a&&n(i(...a),r)&&s(null,...a)},u=t.teardown;t.teardown=()=>{p(),u?.()}}}),r}export{x as b};
diff --git a/.svelte-kit/output/client/_app/immutable/chunks/pNsQzX0r.js b/.svelte-kit/output/client/_app/immutable/chunks/pNsQzX0r.js
deleted file mode 100644
index fa4ce5c..0000000
--- a/.svelte-kit/output/client/_app/immutable/chunks/pNsQzX0r.js
+++ /dev/null
@@ -1 +0,0 @@
-import{y as i,u as a,ad as d,Z as m,c as r,Q as g}from"./BuZ8u_VS.js";function _(n){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function h(n,e,s){if(n==null)return e(void 0),i;const u=a(()=>n.subscribe(e,s));return u.unsubscribe?()=>u.unsubscribe():u}const c=[];function k(n,e=i){let s=null;const u=new Set;function f(o){if(d(n,o)&&(n=o,s)){const l=!c.length;for(const t of u)t[1](),c.push(t,n);if(l){for(let t=0;t{u.delete(t),u.size===0&&s&&(s(),s=null)}}return{set:f,update:b,subscribe:p}}function x(n){let e;return h(n,s=>e=s)(),e}function y(n){r===null&&_(),g&&r.l!==null?w(r).m.push(n):m(()=>{const e=a(n);if(typeof e=="function")return e})}function z(n){r===null&&_(),y(()=>()=>a(n))}function w(n){var e=n.l;return e.u??={a:[],b:[],m:[]}}export{z as a,x as g,y as o,h as s,k as w};
diff --git a/.svelte-kit/output/client/_app/immutable/entry/app.D1MwiwKn.js b/.svelte-kit/output/client/_app/immutable/entry/app.D1MwiwKn.js
deleted file mode 100644
index 8157d12..0000000
--- a/.svelte-kit/output/client/_app/immutable/entry/app.D1MwiwKn.js
+++ /dev/null
@@ -1,2 +0,0 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.Bkiv3Mo1.js","../chunks/6qGwBjhj.js","../chunks/BuZ8u_VS.js","../chunks/iHYN8FkY.js","../chunks/D1Ae0CO3.js","../chunks/C8Fv-wU3.js","../assets/0.DKk5J4IK.css","../nodes/1.kjxH651Z.js","../chunks/CCoS_Egr.js","../chunks/BKjtTD7m.js","../chunks/pNsQzX0r.js","../nodes/2.BZdgRwqQ.js","../chunks/CvWmAKek.js","../chunks/4YFwho-X.js","../assets/FrogHeader.D-WUJdl3.css","../chunks/lKBsgujO.js","../assets/2.tHQ608Ax.css","../nodes/3.Bx_OPh6d.js","../assets/3.JMkiik8G.css"])))=>i.map(i=>d[i]);
-import{j as I,F as U,l as z,E as H,G as W,I as X,t as Z,q as D,aF as J,k as K,B as O,X as Q,A as f,aN as $,x as ee,z as te,a1 as re,Y as se,Z as ae,aO as ne,a2 as k,a7 as oe,a4 as ce,ab as x,a5 as ie,a6 as le,a3 as ue,ac as A}from"../chunks/BuZ8u_VS.js";import{h as de,m as fe,u as me,s as he}from"../chunks/CCoS_Egr.js";import{a as P,c as S,f as F,t as _e}from"../chunks/6qGwBjhj.js";import{o as ve}from"../chunks/pNsQzX0r.js";import{p as T,i as j}from"../chunks/CvWmAKek.js";import{B as ge}from"../chunks/D1Ae0CO3.js";import{b as L}from"../chunks/lKBsgujO.js";function C(o,e,s){var l;I&&(l=K,U());var c=new ge(o);z(()=>{var t=e()??null;if(I){var r=W(l),a=r===J,E=t!==null;if(a!==E){var m=X();Z(m),c.anchor=m,D(!1),c.ensure(t,t&&(n=>s(n,t))),D(!0);return}}c.ensure(t,t&&(n=>s(n,t)))},H)}function ye(o){return class extends Ee{constructor(e){super({component:o,...e})}}}class Ee{#t;#e;constructor(e){var s=new Map,l=(t,r)=>{var a=te(r,!1,!1);return s.set(t,a),a};const c=new Proxy({...e.props||{},$$events:{}},{get(t,r){return f(s.get(r)??l(r,Reflect.get(t,r)))},has(t,r){return r===Q?!0:(f(s.get(r)??l(r,Reflect.get(t,r))),Reflect.has(t,r))},set(t,r,a){return O(s.get(r)??l(r,a),a),Reflect.set(t,r,a)}});this.#e=(e.hydrate?de:fe)(e.component,{target:e.target,anchor:e.anchor,props:c,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&$(),this.#t=c.$$events;for(const t of Object.keys(this.#e))t==="$set"||t==="$destroy"||t==="$on"||ee(this,t,{get(){return this.#e[t]},set(r){this.#e[t]=r},enumerable:!0});this.#e.$set=t=>{Object.assign(c,t)},this.#e.$destroy=()=>{me(this.#e)}}$set(e){this.#e.$set(e)}$on(e,s){this.#t[e]=this.#t[e]||[];const l=(...c)=>s.call(this,...c);return this.#t[e].push(l),()=>{this.#t[e]=this.#t[e].filter(c=>c!==l)}}$destroy(){this.#e.$destroy()}}const be="modulepreload",Pe=function(o,e){return new URL(o,e).href},B={},w=function(e,s,l){let c=Promise.resolve();if(s&&s.length>0){let m=function(n){return Promise.all(n.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),E=a?.nonce||a?.getAttribute("nonce");c=m(s.map(n=>{if(n=Pe(n,l),n in B)return;B[n]=!0;const d=n.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(l)for(let _=r.length-1;_>=0;_--){const i=r[_];if(i.href===n&&(!d||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${n}"]${h}`))return;const u=document.createElement("link");if(u.rel=d?"stylesheet":be,d||(u.as="script"),u.crossOrigin="",u.href=n,E&&u.setAttribute("nonce",E),document.head.appendChild(u),d)return new Promise((_,i)=>{u.addEventListener("load",_),u.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${n}`)))})}))}function t(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return c.then(r=>{for(const a of r||[])a.status==="rejected"&&t(a.reason);return e().catch(t)})},Ne={};var Re=F(''),pe=F(" ",1);function ke(o,e){re(e,!0);let s=T(e,"components",23,()=>[]),l=T(e,"data_0",3,null),c=T(e,"data_1",3,null);se(()=>e.stores.page.set(e.page)),ae(()=>{e.stores,e.page,e.constructors,s(),e.form,l(),c(),e.stores.page.notify()});let t=x(!1),r=x(!1),a=x(null);ve(()=>{const i=e.stores.page.subscribe(()=>{f(t)&&(O(r,!0),ne().then(()=>{O(a,document.title||"untitled page",!0)}))});return O(t,!0),i});const E=A(()=>e.constructors[1]);var m=pe(),n=k(m);{var d=i=>{const v=A(()=>e.constructors[0]);var g=S(),R=k(g);C(R,()=>f(v),(y,b)=>{L(b(y,{get data(){return l()},get form(){return e.form},get params(){return e.page.params},children:(p,Oe)=>{var N=S(),V=k(N);C(V,()=>f(E),(q,Y)=>{L(Y(q,{get data(){return c()},get form(){return e.form},get params(){return e.page.params}}),G=>s()[1]=G,()=>s()?.[1])}),P(p,N)},$$slots:{default:!0}}),p=>s()[0]=p,()=>s()?.[0])}),P(i,g)},h=i=>{const v=A(()=>e.constructors[0]);var g=S(),R=k(g);C(R,()=>f(v),(y,b)=>{L(b(y,{get data(){return l()},get form(){return e.form},get params(){return e.page.params}}),p=>s()[0]=p,()=>s()?.[0])}),P(i,g)};j(n,i=>{e.constructors[1]?i(d):i(h,-1)})}var u=oe(n,2);{var _=i=>{var v=Re(),g=ie(v);{var R=y=>{var b=_e();ue(()=>he(b,f(a))),P(y,b)};j(g,y=>{f(r)&&y(R)})}le(v),P(i,v)};j(u,i=>{f(t)&&i(_)})}P(o,m),ce()}const Ie=ye(ke),De=[()=>w(()=>import("../nodes/0.Bkiv3Mo1.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),()=>w(()=>import("../nodes/1.kjxH651Z.js"),__vite__mapDeps([7,1,2,5,8,9,10]),import.meta.url),()=>w(()=>import("../nodes/2.BZdgRwqQ.js"),__vite__mapDeps([11,1,2,10,8,12,4,3,13,14,15,16]),import.meta.url),()=>w(()=>import("../nodes/3.Bx_OPh6d.js"),__vite__mapDeps([17,1,2,10,8,12,4,3,13,14,9,18]),import.meta.url)],Be=[],Fe={"/":[2],"/profile/[handle]":[3]},M={handleError:(({error:o})=>{console.error(o)}),reroute:(()=>{}),transport:{}},we=Object.fromEntries(Object.entries(M.transport).map(([o,e])=>[o,e.decode])),Me=Object.fromEntries(Object.entries(M.transport).map(([o,e])=>[o,e.encode])),Ve=!1,qe=(o,e)=>we[o](e);export{qe as decode,we as decoders,Fe as dictionary,Me as encoders,Ve as hash,M as hooks,Ne as matchers,De as nodes,Ie as root,Be as server_loads};
diff --git a/.svelte-kit/output/client/_app/immutable/entry/start.CgMVs50r.js b/.svelte-kit/output/client/_app/immutable/entry/start.CgMVs50r.js
deleted file mode 100644
index 21655d9..0000000
--- a/.svelte-kit/output/client/_app/immutable/entry/start.CgMVs50r.js
+++ /dev/null
@@ -1 +0,0 @@
-import{l as o,a as r}from"../chunks/BKjtTD7m.js";export{o as load_css,r as start};
diff --git a/.svelte-kit/output/client/_app/immutable/nodes/0.Bkiv3Mo1.js b/.svelte-kit/output/client/_app/immutable/nodes/0.Bkiv3Mo1.js
deleted file mode 100644
index 66a2449..0000000
--- a/.svelte-kit/output/client/_app/immutable/nodes/0.Bkiv3Mo1.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import{a as r,f as s}from"../chunks/6qGwBjhj.js";import{a2 as c,aa as d,a7 as l}from"../chunks/BuZ8u_VS.js";import{h as g,s as y}from"../chunks/iHYN8FkY.js";import"../chunks/C8Fv-wU3.js";const m=!0,v=!1,P=Object.freeze(Object.defineProperty({__proto__:null,prerender:m,ssr:v},Symbol.toStringTag,{value:"Module"}));var u=s('');function h(t){var o=u();r(t,o)}var F=s('
');function w(t){var o=F();r(t,o)}var _=s(` `,1),b=s(" ",1);function A(t,o){var a=b();g("12qhfyh",n=>{var f=_();d(2),r(n,f)});var e=c(a);h(e);var i=l(e,2);w(i);var p=l(i,2);y(p,()=>o.children),r(t,a)}export{A as component,P as universal};
diff --git a/.svelte-kit/output/client/_app/immutable/nodes/1.kjxH651Z.js b/.svelte-kit/output/client/_app/immutable/nodes/1.kjxH651Z.js
deleted file mode 100644
index c0726b9..0000000
--- a/.svelte-kit/output/client/_app/immutable/nodes/1.kjxH651Z.js
+++ /dev/null
@@ -1 +0,0 @@
-import{a as b,f as k}from"../chunks/6qGwBjhj.js";import"../chunks/C8Fv-wU3.js";import{c as x,Y as $,Z as i,u as y,_ as l,$ as A,A as v,a0 as E,U,a1 as Y,a2 as Z,a3 as j,a4 as q,a5 as u,a6 as m,a7 as w}from"../chunks/BuZ8u_VS.js";import{s as _}from"../chunks/CCoS_Egr.js";import{s as z,p as g}from"../chunks/BKjtTD7m.js";function B(r=!1){const e=x,t=e.l.u;if(!t)return;let a=()=>E(e.s);if(r){let o=0,s={};const f=U(()=>{let p=!1;const c=e.s;for(const n in c)c[n]!==s[n]&&(s[n]=c[n],p=!0);return p&&o++,o});a=()=>v(f)}t.b.length&&$(()=>{h(e,a),l(t.b)}),i(()=>{const o=y(()=>t.m.map(A));return()=>{for(const s of o)typeof s=="function"&&s()}}),t.a.length&&i(()=>{h(e,a),l(t.a)})}function h(r,e){if(r.l.s)for(const t of r.l.s)v(t);e()}const C={get error(){return g.error},get status(){return g.status}};z.updated.check;const d=C;var D=k("
",1);function K(r,e){Y(e,!1),B();var t=D(),a=Z(t),o=u(a,!0);m(a);var s=w(a,2),f=u(s,!0);m(s),j(()=>{_(o,d.status),_(f,d.error?.message)}),b(r,t),q()}export{K as component};
diff --git a/.svelte-kit/output/client/_app/immutable/nodes/2.BZdgRwqQ.js b/.svelte-kit/output/client/_app/immutable/nodes/2.BZdgRwqQ.js
deleted file mode 100644
index 4c7ff27..0000000
--- a/.svelte-kit/output/client/_app/immutable/nodes/2.BZdgRwqQ.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import{a as _e,f as De}from"../chunks/6qGwBjhj.js";import{o as Zn,a as Uo}from"../chunks/pNsQzX0r.js";import{g as ii,l as $o,j as Tt,t as ri,v as Go,F as Ko,A as F,G as Vo,aq as Ho,I as _r,q as ni,k as fs,C as Yo,aL as Wo,az as Dr,i as qo,aU as pt,h as ki,aV as jo,s as zo,V as Xo,aW as Qo,aK as er,aX as Zo,aY as Jo,z as el,am as Cr,aZ as tl,N as sl,d as Jn,p as ea,a_ as ai,a$ as il,aI as rl,m as nl,f as al,o as ol,a1 as Qs,Z as oi,B as q,a5 as ne,a7 as fe,a6 as ie,a3 as Me,a4 as Zs,ab as re,L as ta,a2 as sa,aa as ll,ac as ia,a as cl,b0 as hl,a9 as ul,b1 as Pr}from"../chunks/BuZ8u_VS.js";import{d as tr,a as rt,e as At,s as Ze}from"../chunks/CCoS_Egr.js";import{i as nt,p as gs}from"../chunks/CvWmAKek.js";import{s as dl,h as fl}from"../chunks/iHYN8FkY.js";import{t as gl,W as Bs,s as Ne,a as kt,b as ml,r as wi,c as pl,f as ra,d as na,e as aa,h as Xt,F as yl,i as kr,l as El,g as vl}from"../chunks/4YFwho-X.js";import{b as Us}from"../chunks/lKBsgujO.js";function Tl(a,e,t){for(var s=[],i=e.length,r,n=e.length,o=0;o{if(r){if(r.pending.delete(u),r.done.add(u),r.pending.size===0){var d=a.outrogroups;Oi(a,er(r.done)),d.delete(r),d.size===0&&(a.outrogroups=null)}}else n-=1},!1)}if(n===0){var c=s.length===0&&t!==null;if(c){var l=t,h=l.parentNode;rl(h),h.append(l),a.items.clear()}Oi(a,e,!c)}else r={pending:new Set(e),done:new Set},(a.outrogroups??=new Set).add(r)}function Oi(a,e,t=!0){var s;if(a.pending.size>0){s=new Set;for(const n of a.pending.values())for(const o of n)s.add(a.items.get(o).e)}for(var i=0;i{var v=t();return Qo(v)?v:v==null?[]:er(v)}),u,d=new Map,g=!0;function f(v){(E.effect.f&sl)===0&&(E.pending.delete(v),E.fallback=l,xl(E,u,n,e,s),l!==null&&(u.length===0?(l.f&pt)===0?Jn(l):(l.f^=pt,Jt(l,null,n)):ea(l,()=>{l=null})))}function p(v){E.pending.delete(v)}var y=$o(()=>{u=F(h);var v=u.length;let T=!1;if(Tt){var S=Vo(n)===Ho;S!==(v===0)&&(n=_r(),ri(n),ni(!1),T=!0)}for(var x=new Set,D=qo,A=zo(),L=0;Lr(n)):(l=ki(()=>r(wr??=ii())),l.f|=pt)),v>x.size&&jo(),Tt&&v>0&&ri(_r()),!g)if(d.set(D,x),A){for(const[$,V]of o)x.has($)||D.skip_effect(V.e);D.oncommit(f),D.ondiscard(p)}else f(D);T&&ni(!0),F(h)}),E={effect:y,items:o,pending:d,outrogroups:null,fallback:l};g=!1,Tt&&(n=fs)}function Qt(a){for(;a!==null&&(a.f&il)===0;)a=a.next;return a}function xl(a,e,t,s,i){var r=e.length,n=a.items,o=Qt(a.effect.first),c,l=null,h=[],u=[],d,g,f,p;for(p=0;p0){var A=r===0?t:null;Tl(a,x,A)}}}function Al(a,e,t,s,i,r,n,o){var c=(n&Zo)!==0?(n&Jo)===0?el(t,!1,!1):Cr(t):null,l=(n&tl)!==0?Cr(i):null;return{v:c,i:l,e:ki(()=>(r(e,c??t,l??i,o),()=>{a.delete(s)}))}}function Jt(a,e,t){if(a.nodes)for(var s=a.nodes.start,i=a.nodes.end,r=e&&(e.f&pt)===0?e.nodes.start:t;s!==null;){var n=ol(s);if(r.before(s),s===i)return;s=n}}function yt(a,e,t){e===null?a.effect.first=t:e.next=t,t===null?a.effect.last=e:t.prev=e}function ts(a,e,t,s,i,r){var n=a.__className;if(Tt||n!==t||n===void 0){var o=gl(t,s,r);(!Tt||o!==a.getAttribute("class"))&&(o==null?a.removeAttribute("class"):a.className=o),a.__className=t}else if(r&&i!==r)for(var c in r){var l=!!r[c];(i==null||l!==!!i[c])&&a.classList.toggle(c,l)}return r}const H=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},Il=Number.isSafeInteger||function(a){return typeof a=="number"&&Math.abs(a)<=Ll},Ll=Number.MAX_SAFE_INTEGER||9007199254740991;let W=(function(a){return a.NETWORK_ERROR="networkError",a.MEDIA_ERROR="mediaError",a.KEY_SYSTEM_ERROR="keySystemError",a.MUX_ERROR="muxError",a.OTHER_ERROR="otherError",a})({}),_=(function(a){return a.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",a.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",a.KEY_SYSTEM_NO_SESSION="keySystemNoSession",a.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",a.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",a.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",a.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",a.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",a.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",a.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",a.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",a.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",a.MANIFEST_LOAD_ERROR="manifestLoadError",a.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",a.MANIFEST_PARSING_ERROR="manifestParsingError",a.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",a.LEVEL_EMPTY_ERROR="levelEmptyError",a.LEVEL_LOAD_ERROR="levelLoadError",a.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",a.LEVEL_PARSING_ERROR="levelParsingError",a.LEVEL_SWITCH_ERROR="levelSwitchError",a.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",a.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",a.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",a.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",a.FRAG_LOAD_ERROR="fragLoadError",a.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",a.FRAG_DECRYPT_ERROR="fragDecryptError",a.FRAG_PARSING_ERROR="fragParsingError",a.FRAG_GAP="fragGap",a.REMUX_ALLOC_ERROR="remuxAllocError",a.KEY_LOAD_ERROR="keyLoadError",a.KEY_LOAD_TIMEOUT="keyLoadTimeOut",a.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",a.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",a.BUFFER_APPEND_ERROR="bufferAppendError",a.BUFFER_APPENDING_ERROR="bufferAppendingError",a.BUFFER_STALLED_ERROR="bufferStalledError",a.BUFFER_FULL_ERROR="bufferFullError",a.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",a.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",a.ASSET_LIST_LOAD_ERROR="assetListLoadError",a.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",a.ASSET_LIST_PARSING_ERROR="assetListParsingError",a.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",a.INTERNAL_EXCEPTION="internalException",a.INTERNAL_ABORTED="aborted",a.ATTACH_MEDIA_ERROR="attachMediaError",a.UNKNOWN="unknown",a})({}),m=(function(a){return a.MEDIA_ATTACHING="hlsMediaAttaching",a.MEDIA_ATTACHED="hlsMediaAttached",a.MEDIA_DETACHING="hlsMediaDetaching",a.MEDIA_DETACHED="hlsMediaDetached",a.MEDIA_ENDED="hlsMediaEnded",a.STALL_RESOLVED="hlsStallResolved",a.BUFFER_RESET="hlsBufferReset",a.BUFFER_CODECS="hlsBufferCodecs",a.BUFFER_CREATED="hlsBufferCreated",a.BUFFER_APPENDING="hlsBufferAppending",a.BUFFER_APPENDED="hlsBufferAppended",a.BUFFER_EOS="hlsBufferEos",a.BUFFERED_TO_END="hlsBufferedToEnd",a.BUFFER_FLUSHING="hlsBufferFlushing",a.BUFFER_FLUSHED="hlsBufferFlushed",a.MANIFEST_LOADING="hlsManifestLoading",a.MANIFEST_LOADED="hlsManifestLoaded",a.MANIFEST_PARSED="hlsManifestParsed",a.LEVEL_SWITCHING="hlsLevelSwitching",a.LEVEL_SWITCHED="hlsLevelSwitched",a.LEVEL_LOADING="hlsLevelLoading",a.LEVEL_LOADED="hlsLevelLoaded",a.LEVEL_UPDATED="hlsLevelUpdated",a.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",a.LEVELS_UPDATED="hlsLevelsUpdated",a.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",a.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",a.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",a.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",a.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",a.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",a.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",a.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",a.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",a.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",a.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",a.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",a.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",a.CUES_PARSED="hlsCuesParsed",a.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",a.INIT_PTS_FOUND="hlsInitPtsFound",a.FRAG_LOADING="hlsFragLoading",a.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",a.FRAG_LOADED="hlsFragLoaded",a.FRAG_DECRYPTED="hlsFragDecrypted",a.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",a.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",a.FRAG_PARSING_METADATA="hlsFragParsingMetadata",a.FRAG_PARSED="hlsFragParsed",a.FRAG_BUFFERED="hlsFragBuffered",a.FRAG_CHANGED="hlsFragChanged",a.FPS_DROP="hlsFpsDrop",a.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",a.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",a.ERROR="hlsError",a.DESTROYING="hlsDestroying",a.KEY_LOADING="hlsKeyLoading",a.KEY_LOADED="hlsKeyLoaded",a.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",a.BACK_BUFFER_REACHED="hlsBackBufferReached",a.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",a.ASSET_LIST_LOADING="hlsAssetListLoading",a.ASSET_LIST_LOADED="hlsAssetListLoaded",a.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",a.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",a.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",a.INTERSTITIAL_STARTED="hlsInterstitialStarted",a.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",a.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",a.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",a.INTERSTITIAL_ENDED="hlsInterstitialEnded",a.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",a.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",a.EVENT_CUE_ENTER="hlsEventCueEnter",a})({});var se={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Y={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class Mt{constructor(e,t=0,s=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=s}sample(e,t){const s=Math.pow(this.alpha_,e);this.estimate_=t*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class Rl{constructor(e,t,s,i=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Mt(e),this.fast_=new Mt(t),this.defaultTTFB_=i,this.ttfb_=new Mt(e)}update(e,t){const{slow_:s,fast_:i,ttfb_:r}=this;s.halfLife!==e&&(this.slow_=new Mt(e,s.getEstimate(),s.getTotalWeight())),i.halfLife!==t&&(this.fast_=new Mt(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new Mt(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const s=8*t,i=e/1e3,r=s/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(e){const t=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function bl(a,e,t){return(e=Dl(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function le(){return le=Object.assign?Object.assign.bind():function(a){for(var e=1;e`):St}function Fr(a,e,t){return e[a]?e[a].bind(e):Pl(a,t)}const Mi=Fi();function kl(a,e,t){const s=Fi();if(typeof console=="object"&&a===!0||typeof a=="object"){const i=["debug","log","info","warn","error"];i.forEach(r=>{s[r]=Fr(r,a,t)});try{s.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch{return Fi()}i.forEach(r=>{Mi[r]=Fr(r,a)})}else le(Mi,s);return s}const oe=Mi;function Lt(a=!0){return typeof self>"u"?void 0:(a||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function wl(a){return typeof self<"u"&&a===self.ManagedMediaSource}function oa(a,e){const t=Object.keys(a),s=Object.keys(e),i=t.length,r=s.length;return!i||!r||i===r&&!t.some(n=>s.indexOf(n)===-1)}function qe(a,e=!1){if(typeof TextDecoder<"u"){const l=new TextDecoder("utf-8").decode(a);if(e){const h=l.indexOf("\0");return h!==-1?l.substring(0,h):l}return l.replace(/\0/g,"")}const t=a.length;let s,i,r,n="",o=0;for(;o>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(s);break;case 12:case 13:i=a[o++],n+=String.fromCharCode((s&31)<<6|i&63);break;case 14:i=a[o++],r=a[o++],n+=String.fromCharCode((s&15)<<12|(i&63)<<6|(r&63)<<0);break}}return n}function Pe(a){let e="";for(let t=0;t1||i===1&&(t=this.levelkeys[s[0]])!=null&&t.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!H(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Se(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const t=this.levelkeys;if(t){var s;const i=t[e];i&&!((s=this._decryptdata)!=null&&s.keyId)&&(this._decryptdata=i.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,s,i,r,n=!1){const{elementaryStreams:o}=this,c=o[e];if(!c){o[e]={startPTS:t,endPTS:s,startDTS:i,endDTS:r,partial:n};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,s),c.startDTS=Math.min(c.startDTS,i),c.endDTS=Math.max(c.endDTS,r)}}class Ml extends ca{constructor(e,t,s,i,r){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=i;const n=e.enumeratedString("BYTERANGE");n&&this.setByteRange(n,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function ha(a,e){const t=Object.getPrototypeOf(a);if(t){const s=Object.getOwnPropertyDescriptor(t,e);return s||ha(t,e)}}function Nl(a,e){const t=ha(a,e);t&&(t.enumerable=!0,Object.defineProperty(a,e,t))}const Nr=Math.pow(2,32)-1,Bl=[].push,ua={video:1,audio:2,id3:3,text:4};function Ae(a){return String.fromCharCode.apply(null,a)}function da(a,e){const t=a[e]<<8|a[e+1];return t<0?65536+t:t}function X(a,e){const t=fa(a,e);return t<0?4294967296+t:t}function Br(a,e){let t=X(a,e);return t*=Math.pow(2,32),t+=X(a,e+4),t}function fa(a,e){return a[e]<<24|a[e+1]<<16|a[e+2]<<8|a[e+3]}function Ul(a){const e=a.byteLength;for(let t=0;t8&&a[t+4]===109&&a[t+5]===111&&a[t+6]===111&&a[t+7]===102)return!0;t=s>1?t+s:e}return!1}function ee(a,e){const t=[];if(!e.length)return t;const s=a.byteLength;for(let i=0;i1?i+r:s;if(n===e[0])if(e.length===1)t.push(a.subarray(i+8,o));else{const c=ee(a.subarray(i+8,o),e.slice(1));c.length&&Bl.apply(t,c)}i=o}return t}function $l(a){const e=[],t=a[0];let s=8;const i=X(a,s);s+=4;let r=0,n=0;t===0?(r=X(a,s),n=X(a,s+4),s+=8):(r=Br(a,s),n=Br(a,s+8),s+=16),s+=2;let o=a.length+n;const c=da(a,s);s+=2;for(let l=0;l>>31===1)return oe.warn("SIDX has hierarchical references (not supported)"),null;const f=X(a,h);h+=4,e.push({referenceSize:d,subsegmentDuration:f,info:{duration:f/i,start:o,end:o+d-1}}),o+=d,h+=4,s=h}return{earliestPresentationTime:r,timescale:i,version:t,referencesCount:c,references:e}}function ga(a){const e=[],t=ee(a,["moov","trak"]);for(let i=0;i{const r=X(i,4),n=e[r];n&&(n.default={duration:X(i,12),flags:X(i,20)})}),e}function Gl(a){const e=a.subarray(8),t=e.subarray(86),s=Ae(e.subarray(4,8));let i=s,r;const n=s==="enca"||s==="encv";if(n){const l=ee(e,[s])[0].subarray(s==="enca"?28:78);ee(l,["sinf"]).forEach(u=>{const d=ee(u,["schm"])[0];if(d){const g=Ae(d.subarray(4,8));if(g==="cbcs"||g==="cenc"){const f=ee(u,["frma"])[0];f&&(i=Ae(f))}}})}const o=i;switch(i){case"avc1":case"avc2":case"avc3":case"avc4":{const c=ee(t,["avcC"])[0];c&&c.length>3&&(i+="."+ps(c[1])+ps(c[2])+ps(c[3]),r=ms(o==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=ee(e,[s])[0],l=ee(c.subarray(28),["esds"])[0];if(l&&l.length>7){let h=4;if(l[h++]!==3)break;h=hi(l,h),h+=2;const u=l[h++];if(u&128&&(h+=2),u&64&&(h+=l[h++]),l[h++]!==4)break;h=hi(l,h);const d=l[h++];if(d===64)i+="."+ps(d);else break;if(h+=12,l[h++]!==5)break;h=hi(l,h);const g=l[h++];let f=(g&248)>>3;f===31&&(f+=1+((g&7)<<3)+((l[h]&224)>>5)),i+="."+f}break}case"hvc1":case"hev1":{const c=ee(t,["hvcC"])[0];if(c&&c.length>12){const l=c[1],h=["","A","B","C"][l>>6],u=l&31,d=X(c,2),g=(l&32)>>5?"H":"L",f=c[12],p=c.subarray(6,12);i+="."+h+u,i+="."+Kl(d).toString(16).toUpperCase(),i+="."+g+f;let y="";for(let E=p.length;E--;){const v=p[E];(v||y)&&(y="."+v.toString(16).toUpperCase()+y)}i+=y}r=ms(o=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{i=ms(i,t)||i;break}case"vp09":{const c=ee(t,["vpcC"])[0];if(c&&c.length>6){const l=c[4],h=c[5],u=c[6]>>4&15;i+="."+st(l)+"."+st(h)+"."+st(u)}break}case"av01":{const c=ee(t,["av1C"])[0];if(c&&c.length>2){const l=c[1]>>>5,h=c[1]&31,u=c[2]>>>7?"H":"M",d=(c[2]&64)>>6,g=(c[2]&32)>>5,f=l===2&&d?g?12:10:d?10:8,p=(c[2]&16)>>4,y=(c[2]&8)>>3,E=(c[2]&4)>>2,v=c[2]&3;i+="."+l+"."+st(h)+u+"."+st(f)+"."+p+"."+y+E+v+"."+st(1)+"."+st(1)+"."+st(1)+"."+0,r=ms("dav1",t)}break}}return{codec:i,encrypted:n,supplemental:r}}function ms(a,e){const t=ee(e,["dvvC"]),s=t.length?t[0]:ee(e,["dvcC"])[0];if(s){const i=s[2]>>1&127,r=s[2]<<5&32|s[3]>>3&31;return a+"."+st(i)+"."+st(r)}}function Kl(a){let e=0;for(let t=0;t<32;t++)e|=(a>>t&1)<<31-t;return e>>>0}function hi(a,e){const t=e+5;for(;a[e++]&128&&e{const r=s.subarray(8,24);r.some(n=>n!==0)||(oe.log(`[eme] Patching keyId in 'enc${i?"a":"v"}>sinf>>tenc' box: ${Pe(r)} -> ${Pe(t)}`),s.set(t,8))})}function Hl(a){const e=[];return ma(a,t=>e.push(t.subarray(8,24))),e}function ma(a,e){ee(a,["moov","trak"]).forEach(s=>{const i=ee(s,["mdia","minf","stbl","stsd"])[0];if(!i)return;const r=i.subarray(8);let n=ee(r,["enca"]);const o=n.length>0;o||(n=ee(r,["encv"])),n.forEach(c=>{const l=o?c.subarray(28):c.subarray(78);ee(l,["sinf"]).forEach(u=>{const d=pa(u);d&&e(d,o)})})})}function pa(a){const e=ee(a,["schm"])[0];if(e){const t=Ae(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const s=ee(a,["schi","tenc"])[0];if(s)return s}}}function Yl(a,e,t){const s={},i=ee(a,["moof","traf"]);for(let r=0;rs[r].duration)){let r=1/0,n=0;const o=ee(a,["sidx"]);for(let c=0;cu+d.info.duration||0,0);n=Math.max(n,h+l.earliestPresentationTime/l.timescale)}}n&&H(n)&&Object.keys(s).forEach(c=>{s[c].duration||(s[c].duration=n*s[c].timescale-s[c].start)})}return s}function Wl(a){const e={valid:null,remainder:null},t=ee(a,["moof"]);if(t.length<2)return e.remainder=a,e;const s=t[t.length-1];return e.valid=a.slice(0,s.byteOffset-8),e.remainder=a.slice(s.byteOffset-8),e}function je(a,e){const t=new Uint8Array(a.length+e.length);return t.set(a),t.set(e,a.length),t}function Ur(a,e){const t=[],s=e.samples,i=e.timescale,r=e.id;let n=!1;return ee(s,["moof"]).map(c=>{const l=c.byteOffset-8;ee(c,["traf"]).map(u=>{const d=ee(u,["tfdt"]).map(g=>{const f=g[0];let p=X(g,4);return f===1&&(p*=Math.pow(2,32),p+=X(g,8)),p/i})[0];return d!==void 0&&(a=d),ee(u,["tfhd"]).map(g=>{const f=X(g,4),p=X(g,0)&16777215,y=(p&1)!==0,E=(p&2)!==0,v=(p&8)!==0;let T=0;const S=(p&16)!==0;let x=0;const D=(p&32)!==0;let A=8;f===r&&(y&&(A+=8),E&&(A+=4),v&&(T=X(g,A),A+=4),S&&(x=X(g,A),A+=4),D&&(A+=4),e.type==="video"&&(n=Js(e.codec)),ee(u,["trun"]).map(L=>{const R=L[0],I=X(L,0)&16777215,C=(I&1)!==0;let $=0;const V=(I&4)!==0,G=(I&256)!==0;let O=0;const k=(I&512)!==0;let N=0;const P=(I&1024)!==0,M=(I&2048)!==0;let K=0;const B=X(L,4);let U=8;C&&($=X(L,U),U+=4),V&&(U+=4);let z=$+l;for(let Z=0;Z>1&63;return t===39||t===40}else return(e&31)===6}function rr(a,e,t,s){const i=ya(a);let r=0;r+=e;let n=0,o=0,c=0;for(;r=i.length)break;c=i[r++],n+=c}while(c===255);o=0;do{if(r>=i.length)break;c=i[r++],o+=c}while(c===255);const l=i.length-r;let h=r;if(ol){oe.error(`Malformed SEI payload. ${o} is too small, only ${l} bytes left to parse.`);break}if(n===4){if(i[h++]===181){const d=da(i,h);if(h+=2,d===49){const g=X(i,h);if(h+=4,g===1195456820){const f=i[h++];if(f===3){const p=i[h++],y=31&p,E=64&p,v=E?2+y*3:0,T=new Uint8Array(v);if(E){T[0]=p;for(let S=1;S16){const u=[];for(let f=0;f<16;f++){const p=i[h++].toString(16);u.push(p.length==1?"0"+p:p),(f===3||f===5||f===7||f===9)&&u.push("-")}const d=o-16,g=new Uint8Array(d);for(let f=0;f>24&255,r[1]=s>>16&255,r[2]=s>>8&255,r[3]=s&255,r.set(a,4),i=0,s=8;i0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const n=new Uint8Array(4);return t.byteLength>0&&new DataView(n.buffer).setUint32(0,t.byteLength,!1),zl([112,115,115,104],new Uint8Array([s,0,0,0]),a,r,i,n,t)}function Ql(a){const e=[];if(a instanceof ArrayBuffer){const t=a.byteLength;let s=0;for(;s+32>>24;if(r!==0&&r!==1)return{offset:t,size:e};const n=a.buffer,o=Pe(new Uint8Array(n,t+12,16));let c=null,l=null,h=0;if(r===0)h=28;else{const d=a.getUint32(28);if(!d||s<32+d*16)return{offset:t,size:e};c=[];for(let g=0;g/\(Windows.+Firefox\//i.test(navigator.userAgent),qt={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function nr(a,e){const t=qt[e];return!!t&&!!t[a.slice(0,4)]}function ns(a,e,t=!0){return!a.split(",").some(s=>!ar(s,e,t))}function ar(a,e,t=!0){var s;const i=Lt(t);return(s=i?.isTypeSupported(as(a,e)))!=null?s:!1}function as(a,e){return`${e}/mp4;codecs=${a}`}function $r(a){if(a){const e=a.substring(0,4);return qt.video[e]}return 2}function $s(a){const e=Ea();return a.split(",").reduce((t,s)=>{const r=e&&Js(s)?9:qt.video[s];return r?(r*2+t)/(t?3:2):(qt.audio[s]+t)/(t?2:1)},0)}const ui={};function Jl(a,e=!0){if(ui[a])return ui[a];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[a];for(let i=0;iJl(t.toLowerCase(),e))}function tc(a,e){const t=[];if(a){const s=a.split(",");for(let i=0;i4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(a)!==-1)&&(Gr(a,"audio")||Gr(a,"video")))return a;if(e){const t=e.split(",");if(t.length>1){if(a){for(let s=t.length;s--;)if(t[s].substring(0,4)===a.substring(0,4))return t[s]}return t[0]}}return e||a}function Gr(a,e){return nr(a,e)&&ar(a,e)}function sc(a){const e=a.split(",");for(let t=0;t2&&s[0]==="avc1"&&(e[t]=`avc1.${parseInt(s[1]).toString(16)}${("000"+parseInt(s[2]).toString(16)).slice(-4)}`)}return e.join(",")}function ic(a){if(a.startsWith("av01.")){const e=a.split("."),t=["0","111","01","01","01","0"];for(let s=e.length;s>4&&s<10;s++)e[s]=t[s-4];return e.join(".")}return a}function Kr(a){const e=Lt(a)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function Ni(a){return a.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const rc={supported:!0,powerEfficient:!0,smooth:!0},nc={supported:!1,smooth:!1,powerEfficient:!1},va={supported:!0,configurations:[],decodingInfoResults:[rc]};function Ta(a,e){return{supported:!1,configurations:e,decodingInfoResults:[nc],error:a}}function ac(a,e,t,s,i,r){const n=a.videoCodec,o=a.audioCodec?a.audioGroups:null,c=r?.audioCodec,l=r?.channels,h=l?parseInt(l):c?1/0:2;let u=null;if(o!=null&&o.length)try{o.length===1&&o[0]?u=e.groups[o[0]].channels:u=o.reduce((d,g)=>{if(g){const f=e.groups[g];if(!f)throw new Error(`Audio track group ${g} not found`);Object.keys(f.channels).forEach(p=>{d[p]=(d[p]||0)+f.channels[p]})}return d},{2:0})}catch{return!0}return n!==void 0&&(n.split(",").some(d=>Js(d))||a.width>1920&&a.height>1088||a.height>1920&&a.width>1088||a.frameRate>Math.max(s,30)||a.videoRange!=="SDR"&&a.videoRange!==t||a.bitrate>Math.max(i,8e6))||!!u&&H(h)&&Object.keys(u).some(d=>parseInt(d)>h)}function Sa(a,e,t,s={}){const i=a.videoCodec;if(!i&&!a.audioCodec||!t)return Promise.resolve(va);const r=[],n=oc(a),o=n.length,c=lc(a,e,o>0),l=c.length;for(let h=o||1*l||1;h--;){const u={type:"media-source"};if(o&&(u.video=n[h%o]),l){u.audio=c[h%l];const d=u.audio.bitrate;u.video&&d&&(u.video.bitrate-=d)}r.push(u)}if(i){const h=navigator.userAgent;if(i.split(",").some(u=>Js(u))&&Ea())return Promise.resolve(Ta(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${h})`),r))}return Promise.all(r.map(h=>{const u=hc(h);return s[u]||(s[u]=t.decodingInfo(h))})).then(h=>({supported:!h.some(u=>!u.supported),configurations:r,decodingInfoResults:h})).catch(h=>({supported:!1,configurations:r,decodingInfoResults:[],error:h}))}function oc(a){var e;const t=(e=a.videoCodec)==null?void 0:e.split(","),s=xa(a),i=a.width||640,r=a.height||480,n=a.frameRate||30,o=a.videoRange.toLowerCase();return t?t.map(c=>{const l={contentType:as(ic(c),"video"),width:i,height:r,bitrate:s,framerate:n};return o!=="sdr"&&(l.transferFunction=o),l}):[]}function lc(a,e,t){var s;const i=(s=a.audioCodec)==null?void 0:s.split(","),r=xa(a);return i&&a.audioGroups?a.audioGroups.reduce((n,o)=>{var c;const l=o?(c=e.groups[o])==null?void 0:c.tracks:null;return l?l.reduce((h,u)=>{if(u.groupId===o){const d=parseFloat(u.channels||"");i.forEach(g=>{const f={contentType:as(g,"audio"),bitrate:t?cc(g,r):r};d&&(f.channels=""+d),h.push(f)})}return h},n):n},[]):[]}function cc(a,e){if(e<=1)return 1;let t=128e3;return a==="ec-3"?t=768e3:a==="ac-3"&&(t=64e4),Math.min(e/2,t)}function xa(a){return Math.ceil(Math.max(a.bitrate*.9,a.averageBitrate)/1e3)*1e3||1}function hc(a){let e="";const{audio:t,video:s}=a;if(s){const i=Ni(s.contentType);e+=`${i}_r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${Math.ceil(s.bitrate/1e5)}`}if(t){const i=Ni(t.contentType);e+=`${s?"_":""}${i}_c${t.channels}`}return e}const Bi=["NONE","TYPE-0","TYPE-1",null];function uc(a){return Bi.indexOf(a)>-1}const Ks=["SDR","PQ","HLG"];function dc(a){return!!a&&Ks.indexOf(a)>-1}var Ps={No:"",Yes:"YES",v2:"v2"};function Vr(a){const{canSkipUntil:e,canSkipDateRanges:t,age:s}=a,i=s!!s).map(s=>s.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const s=(t=e.supplemental)==null?void 0:t.videoCodec;s&&s!==e.videoCodec&&(this.codecSet+=`,${s.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return Yr(this._audioGroups,e)}hasSubtitleGroup(e){return Yr(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(t)===-1&&s.push(t)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(t)===-1&&s.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function Yr(a,e){return!e||!a?!1:a.indexOf(e)!==-1}function fc(){if(typeof matchMedia=="function"){const a=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(a.media!==e.media)return a.matches===!0}return!1}function gc(a,e){let t=!1,s=[];if(a&&(t=a!=="SDR",s=[a]),e){s=e.allowedVideoRanges||Ks.slice(0);const i=s.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:i&&fc(),t||(s=["SDR"])}return{preferHDR:t,allowedVideoRanges:s}}const mc=a=>{const e=new WeakSet;return(t,s)=>{if(a&&(s=a(t,s)),typeof s=="object"&&s!==null){if(e.has(s))return;e.add(s)}return s}},ue=(a,e)=>JSON.stringify(a,mc(e));function pc(a,e,t,s,i){const r=Object.keys(a),n=s?.channels,o=s?.audioCodec,c=i?.videoCodec,l=n&&parseInt(n)===2;let h=!1,u=!1,d=1/0,g=1/0,f=1/0,p=1/0,y=0,E=[];const{preferHDR:v,allowedVideoRanges:T}=gc(e,i);for(let L=r.length;L--;){const R=a[r[L]];h||(h=R.channels[2]>0),d=Math.min(d,R.minHeight),g=Math.min(g,R.minFramerate),f=Math.min(f,R.minBitrate),T.filter(C=>R.videoRanges[C]>0).length>0&&(u=!0)}d=H(d)?d:0,g=H(g)?g:0;const S=Math.max(1080,d),x=Math.max(30,g);f=H(f)?f:t,t=Math.max(f,t),u||(e=void 0);const D=r.length>1;return{codecSet:r.reduce((L,R)=>{const I=a[R];if(R===L)return L;if(E=u?T.filter(C=>I.videoRanges[C]>0):[],D){if(I.minBitrate>t)return et(R,`min bitrate of ${I.minBitrate} > current estimate of ${t}`),L;if(!I.hasDefaultAudio)return et(R,"no renditions with default or auto-select sound found"),L;if(o&&R.indexOf(o.substring(0,4))%5!==0)return et(R,`audio codec preference "${o}" not found`),L;if(n&&!l){if(!I.channels[n])return et(R,`no renditions with ${n} channel sound found (channels options: ${Object.keys(I.channels)})`),L}else if((!o||l)&&h&&I.channels[2]===0)return et(R,"no renditions with stereo sound found"),L;if(I.minHeight>S)return et(R,`min resolution of ${I.minHeight} > maximum of ${S}`),L;if(I.minFramerate>x)return et(R,`min framerate of ${I.minFramerate} > maximum of ${x}`),L;if(!E.some(C=>I.videoRanges[C]>0))return et(R,`no variants with VIDEO-RANGE of ${ue(E)} found`),L;if(c&&R.indexOf(c.substring(0,4))%5!==0)return et(R,`video codec preference "${c}" not found`),L;if(I.maxScore=$s(L)||I.fragmentError>a[L].fragmentError)?L:(p=I.minIndex,y=I.maxScore,R)},void 0),videoRanges:E,preferHDR:v,minFramerate:g,minBitrate:f,minIndex:p}}function et(a,e){oe.log(`[abr] start candidates with "${a}" ignored because ${e}`)}function Aa(a){return a.reduce((e,t)=>{let s=e.groups[t.groupId];s||(s=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(t);const i=t.channels||"2";return s.channels[i]=(s.channels[i]||0)+1,s.hasDefault=s.hasDefault||t.default,s.hasAutoSelect=s.hasAutoSelect||t.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function yc(a,e,t,s){return a.slice(t,s+1).reduce((i,r,n)=>{if(!r.codecSet)return i;const o=r.audioGroups;let c=i[r.codecSet];c||(i[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:n,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!o,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,l),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,n),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,o&&o.forEach(h=>{if(!h)return;const u=e.groups[h];u&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?u.hasDefault:u.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(u.channels).forEach(d=>{c.channels[d]=(c.channels[d]||0)+u.channels[d]}))}),i},{})}function Wr(a){if(!a)return a;const{lang:e,assocLang:t,characteristics:s,channels:i,audioCodec:r}=a;return{lang:e,assocLang:t,characteristics:s,channels:i,audioCodec:r}}function at(a,e,t){if("attrs"in a){const s=e.indexOf(a);if(s!==-1)return s}for(let s=0;ss.indexOf(i)===-1)}function Pt(a,e){const{audioCodec:t,channels:s}=a;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function Tc(a,e,t,s,i){const r=e[s],o=e.reduce((d,g,f)=>{const p=g.uri;return(d[p]||(d[p]=[])).push(f),d},{})[r.uri];o.length>1&&(s=Math.max.apply(Math,o));const c=r.videoRange,l=r.frameRate,h=r.codecSet.substring(0,4),u=qr(e,s,d=>{if(d.videoRange!==c||d.frameRate!==l||d.codecSet.substring(0,4)!==h)return!1;const g=d.audioGroups,f=t.filter(p=>!g||g.indexOf(p.groupId)!==-1);return at(a,f,i)>-1});return u>-1?u:qr(e,s,d=>{const g=d.audioGroups,f=t.filter(p=>!g||g.indexOf(p.groupId)!==-1);return at(a,f,i)>-1})}function qr(a,e,t){for(let s=e;s>-1;s--)if(t(a[s]))return s;for(let s=e+1;s{var s;const{fragCurrent:i,partCurrent:r,hls:n}=this,{autoLevelEnabled:o,media:c}=n;if(!i||!c)return;const l=performance.now(),h=r?r.stats:i.stats,u=r?r.duration:i.duration,d=l-h.loading.start,g=n.minAutoLevel,f=i.level,p=this._nextAutoLevel;if(h.aborted||h.loaded&&h.loaded===h.total||f<=g){this.clearTimer(),this._nextAutoLevel=-1;return}if(!o)return;const y=p>-1&&p!==f,E=!!t||y;if(!E&&(c.paused||!c.playbackRate||!c.readyState))return;const v=n.mainForwardBufferInfo;if(!E&&v===null)return;const T=this.bwEstimator.getEstimateTTFB(),S=Math.abs(c.playbackRate);if(d<=Math.max(T,1e3*(u/(S*2))))return;const x=v?v.len/S:0,D=h.loading.first?h.loading.first-h.loading.start:-1,A=h.loaded&&D>-1,L=this.getBwEstimate(),R=n.levels,I=R[f],C=Math.max(h.loaded,Math.round(u*(i.bitrate||I.averageBitrate)/8));let $=A?d-D:d;$<1&&A&&($=Math.min(d,h.loaded*8/L));const V=A?h.loaded*1e3/$:0,G=T/1e3,O=V?(C-h.loaded)/V:C*8/L+G;if(O<=x)return;const k=V?V*8:L,N=((s=t?.details||this.hls.latestLevelDetails)==null?void 0:s.live)===!0,P=this.hls.config.abrBandWidthUpFactor;let M=Number.POSITIVE_INFINITY,K;for(K=f-1;K>g;K--){const Z=R[K].maxBitrate,j=!R[K].details||N;if(M=this.getTimeToLoadFrag(G,k,u*Z,j),M=O||M>u*10)return;A?this.bwEstimator.sample(d-Math.min(T,D),h.loaded):this.bwEstimator.sampleTTFB(d);const B=R[K].maxBitrate;this.getBwEstimate()*P>B&&this.resetEstimator(B);const U=this.findBestLevel(B,g,K,0,x,1,1);U>-1&&(K=U),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${f} is loading too slowly;
- Fragment duration: ${i.duration.toFixed(3)}
- Time to underbuffer: ${x.toFixed(3)} s
- Estimated load time for current fragment: ${O.toFixed(3)} s
- Estimated load time for down switch fragment: ${M.toFixed(3)} s
- TTFB estimate: ${D|0} ms
- Current BW estimate: ${H(L)?L|0:"Unknown"} bps
- New BW estimate: ${this.getBwEstimate()|0} bps
- Switching to level ${K} @ ${B|0} bps`),n.nextLoadLevel=n.nextAutoLevel=K,this.clearTimer();const z=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===K&&K>0){const Z=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${K>0?"and switching down":""}
- Fragment duration: ${i.duration.toFixed(3)} s
- Time to underbuffer: ${Z.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,K>g){let j=this.findBestLevel(this.hls.levels[g].bitrate,g,K,0,Z,1,1);j===-1&&(j=g),this.hls.nextLoadLevel=this.hls.nextAutoLevel=j,this.resetEstimator(this.hls.levels[j].bitrate)}}};y||O>M*2?z():this.timer=self.setInterval(z,M*1e3),n.trigger(m.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:h})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new Rl(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.FRAG_LOADING,this.onFragLoading,this),e.on(m.FRAG_LOADED,this.onFragLoaded,this),e.on(m.FRAG_BUFFERED,this.onFragBuffered,this),e.on(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(m.LEVEL_LOADED,this.onLevelLoaded,this),e.on(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(m.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.FRAG_LOADING,this.onFragLoading,this),e.off(m.FRAG_LOADED,this.onFragLoaded,this),e.off(m.FRAG_BUFFERED,this.onFragBuffered,this),e.off(m.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(m.LEVEL_LOADED,this.onLevelLoaded,this),e.off(m.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(m.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(m.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const s=t.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var i;this.fragCurrent=s,this.partCurrent=(i=t.part)!=null?i:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case _.BUFFER_ADD_CODEC_ERROR:case _.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case _.FRAG_LOAD_TIMEOUT:{const s=t.frag,{fragCurrent:i,partCurrent:r}=this;if(s&&i&&s.sn===i.sn&&s.level===i.level){const n=performance.now(),o=r?r.stats:s.stats,c=n-o.loading.start,l=o.loading.first?o.loading.first-o.loading.start:-1;if(o.loaded&&l>-1){const u=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(u,l),o.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,s,i){const r=e+s/t,n=i?e+this.lastLevelLoadSec:0;return r+n}onLevelLoaded(e,t){const s=this.hls.config,{loading:i}=t.stats,r=i.end-i.first;H(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:s}){const i=s?s.stats:t.stats;if(t.type===Y.MAIN&&this.bwEstimator.sampleTTFB(i.loading.first-i.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=s?s.duration:t.duration,n=this.hls.levels[t.level],o=(n.loaded?n.loaded.bytes:0)+i.loaded,c=(n.loaded?n.loaded.duration:0)+r;n.loaded={bytes:o,duration:c},n.realBitrate=Math.round(8*o/c)}if(t.bitrateTest){const r={stats:i,frag:t,part:s,id:t.type};this.onFragBuffered(m.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:s,part:i}=t,r=i!=null&&i.stats.loaded?i.stats:s.stats;if(r.aborted||this.ignoreFragment(s))return;const n=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,r.loaded),r.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Y.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,s=this.getBwEstimate(),i=this.hls.config.maxStarvationDelay,r=this.findBestLevel(s,t,e,0,i,1,1);if(r>-1)return r;const n=this.hls.firstLevel,o=Math.min(Math.max(n,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${n} clamped to ${o}`),o}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!i||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=s&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const n=this.hls.levels;if(n.length>Math.max(e,r)&&n[e].loadError<=n[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:s}=this;if(s.levels.length<=1)return s.loadLevel;const{maxAutoLevel:i,config:r,minAutoLevel:n}=s,o=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),l=this.getStarvationDelay();let h=r.abrBandWidthFactor,u=r.abrBandWidthUpFactor;if(l){const y=this.findBestLevel(c,n,i,l,0,h,u);if(y>=0)return this.rebufferNotice=-1,y}let d=o?Math.min(o,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const y=this.bitrateTestDelay;y&&(d=(o?Math.min(o,r.maxLoadingDelay):r.maxLoadingDelay)-y,this.info(`bitrate test took ${Math.round(1e3*y)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),h=u=1)}const g=this.findBestLevel(c,n,i,l,d,h,u);if(this.rebufferNotice!==g&&(this.rebufferNotice=g,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${g}`)),g>-1)return g;const f=s.levels[n],p=s.loadLevelObj;return p&&f?.bitrate=t;k--){var O;const N=f[k],P=k>u;if(!N)continue;if(E.useMediaCapabilities&&!N.supportedResult&&!N.supportedPromise){const j=navigator.mediaCapabilities;typeof j?.decodingInfo=="function"&&ac(N,I,D,A,e,L)?(N.supportedPromise=Sa(N,I,j,this.supportedCache),N.supportedPromise.then(J=>{if(!this.hls)return;N.supportedResult=J;const de=this.hls.levels,ce=de.indexOf(N);J.error?this.warn(`MediaCapabilities decodingInfo error: "${J.error}" for level ${ce} ${ue(J)}`):J.supported?J.decodingInfoResults.some(ge=>ge.smooth===!1||ge.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${ce} not smooth or powerEfficient: ${ue(J)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${ce} ${ue(J)}`),ce>-1&&de.length>1&&(this.log(`Removing unsupported level ${ce}`),this.hls.removeLevel(ce),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(J=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${J}`)})):N.supportedResult=va}if((x&&N.codecSet!==x||D&&N.videoRange!==D||P&&A>N.frameRate||!P&&A>0&&Aj.smooth===!1))&&(!S||k!==C)){G.push(k);continue}const M=N.details,K=(g?M?.partTarget:M?.averagetargetduration)||$;let B;P?B=o*e:B=n*e;const U=$&&i>=$*2&&r===0?N.averageBitrate:N.maxBitrate,z=this.getTimeToLoadFrag(V,B,U*K,M===void 0);if(B>=U&&(k===h||N.loadError===0&&N.fragmentError===0)&&(z<=V||!H(z)||T&&!this.bitrateTestDelay||z${k} adjustedbw(${Math.round(B)})-bitrate=${Math.round(B-U)} ttfb:${V.toFixed(1)} avgDuration:${K.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${z.toFixed(1)} firstSelection:${S} codecSet:${N.codecSet} videoRange:${N.videoRange} hls.loadLevel:${y}`)),S&&(this.firstSelection=k),k}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:s}=this.hls;return Math.min(Math.max(e,s),t)}}const Ia={search:function(a,e){let t=0,s=a.length-1,i=null,r=null;for(;t<=s;){i=(t+s)/2|0,r=a[i];const n=e(r);if(n>0)t=i+1;else if(n<0)s=i-1;else return r}return null}};function xc(a,e,t){if(e===null||!Array.isArray(a)||!a.length||!H(e))return null;const s=a[0].programDateTime;if(e<(s||0))return null;const i=a[a.length-1].endProgramDateTime;if(e>=(i||0))return null;for(let r=0;r0&&o<15e-7&&(t+=15e-7),r&&a.level!==r.level&&r.end<=a.end&&(r=e[2+a.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!a||a.level===r.level)&&jr(t,s,r)===0||Ac(r,a,Math.min(i,s))))return r;const n=Ia.search(e,jr.bind(null,t,s));return n&&(n!==a||!r)?n:r}function Ac(a,e,t){if(e&&e.start===0&&e.level0){const s=e.tagList.reduce((i,r)=>(r[0]==="INF"&&(i+=parseFloat(r[1])),i),t);return a.start<=s}return!1}function jr(a=0,e=0,t){if(t.start<=a&&t.start+t.duration>a)return 0;const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-s<=a?1:t.start-s>a&&t.start?-1:0}function Ic(a,e,t){const s=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-s>a}function La(a,e,t){if(a&&a.startCC<=e&&a.endCC>=e){let s=a.fragments;const{fragmentHint:i}=a;i&&(s=s.concat(i));let r;return Ia.search(s,n=>n.cce?-1:(r=n,n.end<=t?1:n.start>t?-1:0)),r||null}return null}function Hs(a){switch(a.details){case _.FRAG_LOAD_TIMEOUT:case _.KEY_LOAD_TIMEOUT:case _.LEVEL_LOAD_TIMEOUT:case _.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Ra(a){return a.details.startsWith("key")}function ba(a){return Ra(a)&&!!a.frag&&!a.frag.decryptdata}function zr(a,e){const t=Hs(e);return a.default[`${t?"timeout":"error"}Retry`]}function or(a,e){const t=a.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*a.retryDelayMs,a.maxRetryDelayMs)}function Xr(a){return ae(ae({},a),{errorRetry:null,timeoutRetry:null})}function Ys(a,e,t,s){if(!a)return!1;const i=s?.code,r=e499)}function Ui(a){return a===0&&navigator.onLine===!1}var Ce={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},He={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4};class Rc extends ze{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(m.ERROR,this.onError,this),e.on(m.MANIFEST_LOADING,this.onManifestLoading,this),e.on(m.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(m.ERROR,this.onError,this),e.off(m.ERROR,this.onErrorOut,this),e.off(m.MANIFEST_LOADING,this.onManifestLoading,this),e.off(m.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return e?.type===Y.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,s=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||s===-1?t.loadLevel:s}variantHasKey(e,t){if(e){var s;if((s=e.details)!=null&&s.hasKey(t))return!0;const i=e.audioGroups;if(i)return this.hls.allAudioTracks.filter(n=>i.indexOf(n.groupId)>=0).some(n=>{var o;return(o=n.details)==null?void 0:o.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var s;if(t.fatal)return;const i=this.hls,r=t.context;switch(t.details){case _.FRAG_LOAD_ERROR:case _.FRAG_LOAD_TIMEOUT:case _.KEY_LOAD_ERROR:case _.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case _.FRAG_PARSING_ERROR:if((s=t.frag)!=null&&s.gap){t.errorAction=Vt();return}case _.FRAG_GAP:case _.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Ce.SendAlternateToPenaltyBox;return}case _.LEVEL_EMPTY_ERROR:case _.LEVEL_PARSING_ERROR:{var n;const c=t.parent===Y.MAIN?t.level:i.loadLevel;t.details===_.LEVEL_EMPTY_ERROR&&((n=t.context)!=null&&(n=n.levelDetails)!=null&&n.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case _.LEVEL_LOAD_ERROR:case _.LEVEL_LOAD_TIMEOUT:typeof r?.level=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case _.AUDIO_TRACK_LOAD_ERROR:case _.AUDIO_TRACK_LOAD_TIMEOUT:case _.SUBTITLE_LOAD_ERROR:case _.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const c=i.loadLevelObj;if(c&&(r.type===se.AUDIO_TRACK&&c.hasAudioGroup(r.groupId)||r.type===se.SUBTITLE_TRACK&&c.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,i.loadLevel),t.errorAction.action=Ce.SendAlternateToPenaltyBox,t.errorAction.flags=He.MoveAllAlternatesMatchingHost;return}}return;case _.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:Ce.SendAlternateToPenaltyBox,flags:He.MoveAllAlternatesMatchingHDCP};return;case _.KEY_SYSTEM_SESSION_UPDATE_FAILED:case _.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case _.KEY_SYSTEM_NO_SESSION:t.errorAction={action:Ce.SendAlternateToPenaltyBox,flags:He.MoveAllAlternatesMatchingKey};return;case _.BUFFER_ADD_CODEC_ERROR:case _.REMUX_ALLOC_ERROR:case _.BUFFER_APPEND_ERROR:if(!t.errorAction){var o;t.errorAction=this.getLevelSwitchAction(t,(o=t.level)!=null?o:i.loadLevel)}return;case _.INTERNAL_EXCEPTION:case _.BUFFER_APPENDING_ERROR:case _.BUFFER_FULL_ERROR:case _.LEVEL_SWITCH_ERROR:case _.BUFFER_STALLED_ERROR:case _.BUFFER_SEEK_OVER_HOLE:case _.BUFFER_NUDGE_ON_STALL:t.errorAction=Vt();return}t.type===W.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=Vt())}getPlaylistRetryOrSwitchAction(e,t){const s=this.hls,i=zr(s.config.playlistLoadPolicy,e),r=this.playlistError++;if(Ys(i,r,Hs(e),e.response))return{action:Ce.RetryRequest,flags:He.None,retryConfig:i,retryCount:r};const o=this.getLevelSwitchAction(e,t);return i&&(o.retryConfig=i,o.retryCount=r),o}getFragRetryOrSwitchAction(e){const t=this.hls,s=this.getVariantLevelIndex(e.frag),i=t.levels[s],{fragLoadPolicy:r,keyLoadPolicy:n}=t.config,o=zr(Ra(e)?n:r,e),c=t.levels.reduce((h,u)=>h+u.fragmentError,0);if(i&&(e.details!==_.FRAG_GAP&&i.fragmentError++,!ba(e)&&Ys(o,c,Hs(e),e.response)))return{action:Ce.RetryRequest,flags:He.None,retryConfig:o,retryCount:c};const l=this.getLevelSwitchAction(e,s);return o&&(l.retryConfig=o,l.retryCount=c),l}getLevelSwitchAction(e,t){const s=this.hls;t==null&&(t=s.loadLevel);const i=this.hls.levels[t];if(i){var r,n;const l=e.details;i.loadError++,l===_.BUFFER_APPEND_ERROR&&i.fragmentError++;let h=-1;const{levels:u,loadLevel:d,minAutoLevel:g,maxAutoLevel:f}=s;!s.autoLevelEnabled&&!s.config.preserveManualLevelOnError&&(s.loadLevel=-1);const p=(r=e.frag)==null?void 0:r.type,E=(p===Y.AUDIO&&l===_.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===_.BUFFER_ADD_CODEC_ERROR||l===_.BUFFER_APPEND_ERROR))&&u.some(({audioCodec:D})=>i.audioCodec!==D),T=e.sourceBufferName==="video"&&(l===_.BUFFER_ADD_CODEC_ERROR||l===_.BUFFER_APPEND_ERROR)&&u.some(({codecSet:D,audioCodec:A})=>i.codecSet!==D&&i.audioCodec===A),{type:S,groupId:x}=(n=e.context)!=null?n:{};for(let D=u.length;D--;){const A=(D+d)%u.length;if(A!==d&&A>=g&&A<=f&&u[A].loadError===0){var o,c;const L=u[A];if(l===_.FRAG_GAP&&p===Y.MAIN&&e.frag){const R=u[A].details;if(R){const I=Ot(e.frag,R.fragments,e.frag.start);if(I!=null&&I.gap)continue}}else{if(S===se.AUDIO_TRACK&&L.hasAudioGroup(x)||S===se.SUBTITLE_TRACK&&L.hasSubtitleGroup(x))continue;if(p===Y.AUDIO&&(o=i.audioGroups)!=null&&o.some(R=>L.hasAudioGroup(R))||p===Y.SUBTITLE&&(c=i.subtitleGroups)!=null&&c.some(R=>L.hasSubtitleGroup(R))||E&&i.audioCodec===L.audioCodec||T&&i.codecSet===L.codecSet||!E&&i.codecSet!==L.codecSet)continue}h=A;break}}if(h>-1&&s.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:Ce.SendAlternateToPenaltyBox,flags:He.None,nextAutoLevel:h}}return{action:Ce.SendAlternateToPenaltyBox,flags:He.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var s;switch((s=t.errorAction)==null?void 0:s.action){case Ce.DoNothing:break;case Ce.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==_.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,s=e.errorAction;if(!s)return;const{flags:i}=s,r=s.nextAutoLevel;switch(i){case He.None:this.switchLevel(e,r);break;case He.MoveAllAlternatesMatchingHDCP:{const c=this.getVariantLevelIndex(e.frag),l=t.levels[c],h=l?.attrs["HDCP-LEVEL"];if(s.hdcpLevel=h,h==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(h){t.maxHdcpLevel=Bi[Bi.indexOf(h)-1],s.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case He.MoveAllAlternatesMatchingKey:{const c=e.decryptdata;if(c){const l=this.hls.levels,h=l.length;for(let d=h;d--;)if(this.variantHasKey(l[d],c)){var n,o;this.log(`Banned key found in level ${d} (${l[d].bitrate}bps) or audio group "${(n=l[d].audioGroups)==null?void 0:n.join(",")}" (${(o=e.frag)==null?void 0:o.type} fragment) ${Pe(c.keyId||[])}`),l[d].fragmentError++,l[d].loadError++,this.log(`Removing level ${d} with key error (${e.error})`),this.hls.removeLevel(d)}const u=e.frag;if(this.hls.levels.length{const c=this.fragments[o];if(!c||n>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===s&&this.removeFragment(c.body);return}const l=c.range[e];if(l){if(l.time.length===0){this.removeFragment(c.body);return}l.time.some(h=>{const u=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return u&&this.removeFragment(c.body),u})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const s=e.frag,i=Nt(s),r=this.fragments[i];if(!r||r.buffered&&s.gap)return;const n=!s.relurl;Object.keys(t).forEach(o=>{const c=s.elementaryStreams[o];if(!c)return;const l=t[o],h=n||c.partial===!0;r.range[o]=this.getBufferedTimes(s,e.part,h,l)}),r.loaded=null,Object.keys(r.range).length?(this.bufferedEnd(r,s),ys(r)||this.removeParts(s.sn-1,s.type)):this.removeFragment(r.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const s=this.activePartLists[t];s&&(this.activePartLists[t]=Qr(s,i=>i.fragment.sn>=e))}fragBuffered(e,t){const s=Nt(e);let i=this.fragments[s];!i&&t&&(i=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),i&&(i.loaded=null,this.bufferedEnd(i,e))}getBufferedTimes(e,t,s,i){const r={time:[],partial:s},n=e.start,o=e.end,c=e.minEndPTS||o,l=e.maxStartPTS||n;for(let h=0;h=u&&c<=d){r.time.push({startPTS:Math.max(n,i.start(h)),endPTS:Math.min(o,i.end(h))});break}else if(nu){const g=Math.max(n,i.start(h)),f=Math.min(o,i.end(h));f>g&&(r.partial=!0,r.time.push({startPTS:g,endPTS:f}))}else if(o<=u)break}return r}getPartialFragment(e){let t=null,s,i,r,n=0;const{bufferPadding:o,fragments:c}=this;return Object.keys(c).forEach(l=>{const h=c[l];h&&ys(h)&&(i=h.body.start-o,r=h.body.end+o,e>=i&&e<=r&&(s=Math.min(e-i,r-e),n<=s&&(t=h.body,n=s)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||ys(t))}getState(e){const t=Nt(e),s=this.fragments[t];return s?s.buffered?ys(s)?Ie.PARTIAL:Ie.OK:Ie.APPENDING:Ie.NOT_LOADED}isTimeBuffered(e,t,s){let i,r;for(let n=0;n=i&&t<=r)return!0;if(t<=i)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const s=t.frag,i=t.part?null:t,r=Nt(s);this.fragments[r]={body:s,appendedPTS:null,loaded:i,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:s,part:i,timeRanges:r,type:n}=t;if(s.sn==="initSegment")return;const o=s.type;if(i){let l=this.activePartLists[o];l||(this.activePartLists[o]=l=[]),l.push(i)}this.timeRanges=r;const c=r[n];this.detectEvictedFragments(n,c,o,i)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Nt(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,s=Object.keys(t);if(!e)return s.length>0;for(let i=s.length;i--;){const r=t[s[i]];if(r?.body.type===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,s,i,r){i&&!this.hasGaps||Object.keys(this.fragments).forEach(n=>{const o=this.fragments[n];if(!o)return;const c=o.body;c.type!==s||i&&!c.gap||c.starte&&(o.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=Nt(e);e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const i=e.sn;this.activePartLists[e.type]=Qr(s,r=>r.fragment.sn!==i)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(s=>s.clearElementaryStreamInfo())}}function ys(a){var e,t,s;return a.buffered&&!!(a.body.gap||(e=a.range.video)!=null&&e.partial||(t=a.range.audio)!=null&&t.partial||(s=a.range.audiovideo)!=null&&s.partial)}function Nt(a){return`${a.type}_${a.level}_${a.sn}`}function Qr(a,e){return a.filter(t=>{const s=e(t);return s||t.clearElementaryStreamInfo(),s})}var Rt={cbc:0,ctr:1};class _c{constructor(e,t,s){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=s}decrypt(e,t){switch(this.aesMode){case Rt.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Rt.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function Dc(a){const e=a.byteLength,t=e&&new DataView(a.buffer).getUint8(e-1);return t?a.slice(0,e-t):a}class Cc{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),s=new Uint32Array(4);for(let i=0;i<4;i++)s[i]=t.getUint32(i*4);return s}initTable(){const e=this.sBox,t=this.invSBox,s=this.subMix,i=s[0],r=s[1],n=s[2],o=s[3],c=this.invSubMix,l=c[0],h=c[1],u=c[2],d=c[3],g=new Uint32Array(256);let f=0,p=0,y=0;for(y=0;y<256;y++)y<128?g[y]=y<<1:g[y]=y<<1^283;for(y=0;y<256;y++){let E=p^p<<1^p<<2^p<<3^p<<4;E=E>>>8^E&255^99,e[f]=E,t[E]=f;const v=g[f],T=g[v],S=g[T];let x=g[E]*257^E*16843008;i[f]=x<<24|x>>>8,r[f]=x<<16|x>>>16,n[f]=x<<8|x>>>24,o[f]=x,x=S*16843009^T*65537^v*257^f*16843008,l[E]=x<<24|x>>>8,h[E]=x<<16|x>>>16,u[E]=x<<8|x>>>24,d[E]=x,f?(f=v^g[g[g[S^v]]],p^=g[g[p]]):f=p=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let s=!0,i=0;for(;i{const o=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(o,t,s,i);const c=this.flush();c?r(c.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,s,i)}softwareDecrypt(e,t,s,i){const{currentIV:r,currentResult:n,remainderData:o}=this;if(i!==Rt.cbc||t.byteLength!==16)return oe.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),o&&(e=je(o,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(s=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Cc),l.expandKey(t);const h=n;return this.currentResult=l.decrypt(c.buffer,0,s),this.currentIV=c.slice(-16).buffer,h||null}webCryptoDecrypt(e,t,s,i){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,s,i));this.key=t,this.fastAesKey=new Pc(this.subtle,t,i)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new _c(this.subtle,new Uint8Array(s),i).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(oe.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,s,i)))}onWebCryptoError(e,t,s,i){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,s,i);const n=this.flush();if(n)return n.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const s=e.length-e.length%wc;return s!==e.length&&(t=e.slice(0,s),this.remainderData=e.slice(s)),t}logOnce(e){this.logEnabled&&(oe.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const Zr=Math.pow(2,17);class Oc{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const s=e.url;if(!s)return Promise.reject(new gt({type:W.NETWORK_ERROR,details:_.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${s?"part list":"url"}`),networkDetails:null}));this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(f=>f[0]==="GAP")){c(en(e));return}else e.gap=!1;const l=this.loader=r?new r(i):new n(i),h=Jr(e);e.loader=l;const u=Xr(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:Zr};e.stats=l.stats;const g={onSuccess:(f,p,y,E)=>{this.resetLoader(e,l);let v=f.data;y.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(v.slice(0,16)),v=v.slice(16)),o({frag:e,part:null,payload:v,networkDetails:E})},onError:(f,p,y,E)=>{this.resetLoader(e,l),c(new gt({type:W.NETWORK_ERROR,details:_.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:ae({url:s,data:void 0},f),error:new Error(`HTTP Error ${f.code} ${f.text}`),networkDetails:y,stats:E}))},onAbort:(f,p,y)=>{this.resetLoader(e,l),c(new gt({type:W.NETWORK_ERROR,details:_.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:y,stats:f}))},onTimeout:(f,p,y)=>{this.resetLoader(e,l),c(new gt({type:W.NETWORK_ERROR,details:_.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:y,stats:f}))}};t&&(g.onProgress=(f,p,y,E)=>t({frag:e,part:null,payload:y,networkDetails:E})),l.load(h,d,g)})}loadPart(e,t,s){this.abort();const i=this.config,r=i.fLoader,n=i.loader;return new Promise((o,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(en(e,t));return}const l=this.loader=r?new r(i):new n(i),h=Jr(e,t);e.loader=l;const u=Xr(i.fragLoadPolicy.default),d={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Zr};t.stats=l.stats,l.load(h,d,{onSuccess:(g,f,p,y)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const E={frag:e,part:t,payload:g.data,networkDetails:y};s(E),o(E)},onError:(g,f,p,y)=>{this.resetLoader(e,l),c(new gt({type:W.NETWORK_ERROR,details:_.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:ae({url:h.url,data:void 0},g),error:new Error(`HTTP Error ${g.code} ${g.text}`),networkDetails:p,stats:y}))},onAbort:(g,f,p)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),c(new gt({type:W.NETWORK_ERROR,details:_.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:p,stats:g}))},onTimeout:(g,f,p)=>{this.resetLoader(e,l),c(new gt({type:W.NETWORK_ERROR,details:_.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:p,stats:g}))}})})}updateStatsFromPart(e,t){const s=e.stats,i=t.stats,r=i.total;if(s.loaded+=i.loaded,r){const c=Math.round(e.duration/t.duration),l=Math.min(Math.round(s.loaded/r),c),u=(c-l)*Math.round(s.loaded/l);s.total=s.loaded+u}else s.total=Math.max(s.loaded,s.total);const n=s.loading,o=i.loading;n.start?n.first+=o.first-o.start:(n.start=o.start,n.first=o.first),n.end=o.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Jr(a,e=null){const t=e||a,s={frag:a,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(H(i)&&H(r)){var n;let o=i,c=r;if(a.sn==="initSegment"&&Fc((n=a.decryptdata)==null?void 0:n.method)){const l=r-i;l%16&&(c=r+(16-l%16)),i!==0&&(s.resetIV=!0,o=i-16)}s.rangeStart=o,s.rangeEnd=c}return s}function en(a,e){const t=new Error(`GAP ${a.gap?"tag":"attribute"} found`),s={type:W.MEDIA_ERROR,details:_.FRAG_GAP,fatal:!1,frag:a,error:t,networkDetails:null};return e&&(s.part=e),(e||a).stats.aborted=!0,new gt(s)}function Fc(a){return a==="AES-128"||a==="AES-256"}class gt extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class _a extends ze{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class cr{constructor(e,t,s,i=0,r=-1,n=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Es(),this.buffering={audio:Es(),video:Es(),audiovideo:Es()},this.level=e,this.sn=t,this.id=s,this.size=i,this.part=r,this.partial=n}}function Es(){return{start:0,executeStart:0,executeEnd:0,end:0}}const tn={length:0,start:()=>0,end:()=>0};class Q{static isBuffered(e,t){if(e){const s=Q.getBuffered(e);for(let i=s.length;i--;)if(t>=s.start(i)&&t<=s.end(i))return!0}return!1}static bufferedRanges(e){if(e){const t=Q.getBuffered(e);return Q.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let s=0;s1&&e.sort((h,u)=>h.start-u.start||u.end-h.end);let i=-1,r=[];if(s)for(let h=0;h=e[h].start&&t<=e[h].end&&(i=h);const u=r.length;if(u){const d=r[u-1].end;e[h].start-dd&&(r[u-1].end=e[h].end):r.push(e[h])}else r.push(e[h])}else r=e;let n=0,o,c=t,l=t;for(let h=0;h=u&&t<=d&&(i=h),t+s>=u&&t{const i=s.substring(2,s.length-1),r=t?.[i];return r===void 0?(a.playlistParsingError||(a.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${i}"`)),s):r})}return e}function rn(a,e,t){let s=a.variableList;s||(a.variableList=s={});let i,r;if("QUERYPARAM"in e){i=e.QUERYPARAM;try{const n=new self.URL(t).searchParams;if(n.has(i))r=n.get(i);else throw new Error(`"${i}" does not match any query parameter in URI: "${t}"`)}catch(n){a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${n.message}`))}}else i=e.NAME,r=e.VALUE;i in s?a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${i}"`)):s[i]=r||""}function Mc(a,e,t){const s=e.IMPORT;if(t&&s in t){let i=a.variableList;i||(a.variableList=i={}),i[s]=t[s]}else a.playlistParsingError||(a.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}const Nc=/^(\d+)x(\d+)$/,nn=/(.+?)=(".*?"|.*?)(?:,|$)/g;class me{constructor(e,t){typeof e=="string"&&(e=me.parseAttrList(e,t)),le(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const s=new Uint8Array(t.length/2);for(let i=0;iNumber.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const s=this[e];return s?parseFloat(s):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const s=this[e];return(s?s.split(/[ ,]+/):[]).reduce((i,r)=>(i[r.toLowerCase()]=!0,i),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=Nc.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let s;const i={};for(nn.lastIndex=0;(s=nn.exec(e))!==null;){const n=s[1].trim();let o=s[2];const c=o.indexOf('"')===0&&o.lastIndexOf('"')===o.length-1;let l=!1;if(c)o=o.slice(1,-1);else switch(n){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":l=!0}if(t&&(c||l))o=$i(t,o);else if(!l&&!c)switch(n){case"CLOSED-CAPTIONS":if(o==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":oe.warn(`${e}: attribute ${n} is missing quotes`)}i[n]=o}return i}}const Bc="com.apple.hls.interstitial";function Uc(a){return a!=="ID"&&a!=="CLASS"&&a!=="CUE"&&a!=="START-DATE"&&a!=="DURATION"&&a!=="END-DATE"&&a!=="END-ON-NEXT"}function $c(a){return a==="SCTE35-OUT"||a==="SCTE35-IN"||a==="SCTE35-CMD"}class Ca{constructor(e,t,s=0){var i;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=t?.tagAnchor||null,this.tagOrder=(i=t?.tagOrder)!=null?i:s,t){const r=t.attr;for(const n in r)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==r[n]){oe.warn(`DATERANGE tag attribute: "${n}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=n;break}e=le(new me({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=t?.endDate||new Date(this.attr["END-DATE"]);H(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(oe.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(H(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===Bc}get isValid(){return!!this.id&&!this._badValueForSameId&&H(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const Gc=10;class Kc{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let s=t.decryptdata;return s||(t.setKeyFormat(e.keyFormat),s=t.decryptdata),!!s&&e.matches(s)})}get hasProgramDateTime(){return this.fragments.length?H(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||Gc}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let s=e.length;s--;)if(e[s].index>t)return e[s].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function Ws(a,e){return a.length===e.length?!a.some((t,s)=>t!==e[s]):!1}function an(a,e){return!a&&!e?!0:!a||!e?!1:Ws(a,e)}function Ht(a){return a==="AES-128"||a==="AES-256"||a==="AES-256-CTR"}function hr(a){switch(a){case"AES-128":case"AES-256":return Rt.cbc;case"AES-256-CTR":return Rt.ctr;default:throw new Error(`invalid full segment method ${a}`)}}function ur(a){return Uint8Array.from(atob(a),e=>e.charCodeAt(0))}function Gi(a){return Uint8Array.from(unescape(encodeURIComponent(a)),e=>e.charCodeAt(0))}function Vc(a){const e=Gi(a).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function Pa(a){const e=function(s,i,r){const n=s[i];s[i]=s[r],s[r]=n};e(a,0,3),e(a,1,2),e(a,4,5),e(a,6,7)}function ka(a){const e=a.split(":");let t=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),i=s[s.length-1].split(",");if(i.length===2){const r=i[0]==="base64",n=i[1];r?(s.splice(-1,1),t=ur(n)):t=Vc(n)}}return t}const qs=typeof self<"u"?self:void 0;var pe={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ke={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function ks(a){switch(a){case ke.FAIRPLAY:return pe.FAIRPLAY;case ke.PLAYREADY:return pe.PLAYREADY;case ke.WIDEVINE:return pe.WIDEVINE;case ke.CLEARKEY:return pe.CLEARKEY}}function di(a){switch(a){case pe.FAIRPLAY:return ke.FAIRPLAY;case pe.PLAYREADY:return ke.PLAYREADY;case pe.WIDEVINE:return ke.WIDEVINE;case pe.CLEARKEY:return ke.CLEARKEY}}function es(a){const{drmSystems:e,widevineLicenseUrl:t}=a,s=e?[pe.FAIRPLAY,pe.WIDEVINE,pe.PLAYREADY,pe.CLEARKEY].filter(i=>!!e[i]):[];return!s[pe.WIDEVINE]&&t&&s.push(pe.WIDEVINE),s}const wa=(function(a){return qs!=null&&(a=qs.navigator)!=null&&a.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null})();function Hc(a,e,t,s){let i;switch(a){case pe.FAIRPLAY:i=["cenc","sinf"];break;case pe.WIDEVINE:case pe.PLAYREADY:i=["cenc"];break;case pe.CLEARKEY:i=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${a}`)}return Yc(i,e,t,s)}function Yc(a,e,t,s){return[{initDataTypes:a,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function Wc(a){var e;return!!a&&(a.sessionType==="persistent-license"||!!((e=a.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function Oa(a){const e=new Uint16Array(a.buffer,a.byteOffset,a.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),s=t.substring(t.indexOf("<"),t.length),n=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(n){const o=n.childNodes[0]?n.childNodes[0].nodeValue:n.getAttribute("VALUE");if(o){const c=ur(o).subarray(0,16);return Pa(c),c}}return null}let Bt={};class It{static clearKeyUriToKeyIdMap(){Bt={}}static setKeyIdForUri(e,t){Bt[e]=t}static addKeyIdForUri(e){const t=Object.keys(Bt).length%Number.MAX_SAFE_INTEGER,s=new Uint8Array(16);return new DataView(s.buffer,12,4).setUint32(0,t),Bt[e]=s,s}constructor(e,t,s,i=[1],r=null,n){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=s,this.keyFormatVersions=i,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!Ht(e),n!=null&&n.startsWith("0x")&&(this.keyId=new Uint8Array(la(n)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&Ws(e.keyFormatVersions,this.keyFormatVersions)&&an(e.iv,this.iv)&&an(e.keyId,this.keyId)}isSupported(){if(this.method){if(Ht(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case ke.FAIRPLAY:case ke.WIDEVINE:case ke.PLAYREADY:case ke.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(Ht(this.method)){let r=this.iv;return r||(typeof e!="number"&&(oe.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),r=jc(e)),new It(this.method,this.uri,"identity",this.keyFormatVersions,r)}if(this.keyId){const r=Bt[this.uri];if(r&&!Ws(this.keyId,r)&&It.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const s=ka(this.uri);if(s)switch(this.keyFormat){case ke.WIDEVINE:if(this.pssh=s,!this.keyId){const r=Ql(s.buffer);if(r.length){var i;const n=r[0];this.keyId=(i=n.kids)!=null&&i.length?n.kids[0]:null}}this.keyId||(this.keyId=on(t));break;case ke.PLAYREADY:{const r=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Xl(r,null,s),this.keyId=Oa(s);break}default:{let r=s.subarray(0,16);if(r.length!==16){const n=new Uint8Array(16);n.set(r,16-r.length),r=n}this.keyId=r;break}}if(!this.keyId||this.keyId.byteLength!==16){let r;r=qc(t),r||(r=on(t),r||(r=Bt[this.uri])),r&&(this.keyId=r,It.setKeyIdForUri(this.uri,r))}return this}}function qc(a){const e=a?.[ke.WIDEVINE];return e?e.keyId:null}function on(a){const e=a?.[ke.PLAYREADY];if(e){const t=ka(e.uri);if(t)return Oa(t)}return null}function jc(a){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=a>>8*(15-t)&255;return e}const ln=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,cn=/#EXT-X-MEDIA:(.*)/g,zc=/^#EXT(?:INF|-X-TARGETDURATION):/m,fi=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Xc=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class ot{static findGroup(e,t){for(let s=0;s0&&r.length({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:n.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(cn.lastIndex=0;(i=cn.exec(e))!==null;){const l=new me(i[1],s),h=l.TYPE;if(h){const u=o[h],d=r[h]||[];r[h]=d;const g=l.LANGUAGE,f=l["ASSOC-LANGUAGE"],p=l.CHANNELS,y=l.CHARACTERISTICS,E=l["INSTREAM-ID"],v={attrs:l,bitrate:0,id:c++,groupId:l["GROUP-ID"]||"",name:l.NAME||g||"",type:h,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:g,url:l.URI?ot.resolve(l.URI,t):""};if(f&&(v.assocLang=f),p&&(v.channels=p),y&&(v.characteristics=y),E&&(v.instreamId=E),u!=null&&u.length){const T=ot.findGroup(u,v.groupId)||u[0];fn(v,T,"audioCodec"),fn(v,T,"textCodec")}d.push(v)}}return r}static parseLevelPlaylist(e,t,s,i,r,n){var o;const c={url:t},l=new Kc(t),h=l.fragments,u=[];let d=null,g=0,f=0,p=0,y=0,E=0,v=null,T=new ci(i,c),S,x,D,A=-1,L=!1,R=null,I;if(fi.lastIndex=0,l.m3u8=e,l.hasVariableRefs=sn(e),((o=fi.exec(e))==null?void 0:o[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(S=fi.exec(e))!==null;){L&&(L=!1,T=new ci(i,c),T.playlistOffset=p,T.setStart(p),T.sn=g,T.cc=y,E&&(T.bitrate=E),T.level=s,d&&(T.initSegment=d,d.rawProgramDateTime&&(T.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null),R&&(T.setByteRange(R),R=null)));const G=S[1];if(G){T.duration=parseFloat(G);const O=(" "+S[2]).slice(1);T.title=O||null,T.tagList.push(O?["INF",G,O]:["INF",G])}else if(S[3]){if(H(T.duration)){T.playlistOffset=p,T.setStart(p),D&&mn(T,D,l),T.sn=g,T.level=s,T.cc=y,h.push(T);const O=(" "+S[3]).slice(1);T.relurl=$i(l,O),Ki(T,v,u),v=T,p+=T.duration,g++,f=0,L=!0}}else{if(S=S[0].match(Xc),!S){oe.warn("No matches on slow regex match for level playlist!");continue}for(x=1;x0&&pn(l,O,S),g=l.startSN=parseInt(k);break;case"SKIP":{l.skippedSegments&&dt(l,O,S);const P=new me(k,l),M=P.decimalInteger("SKIPPED-SEGMENTS");if(H(M)){l.skippedSegments+=M;for(let B=M;B--;)h.push(null);g+=M}const K=P.enumeratedString("RECENTLY-REMOVED-DATERANGES");K&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(K.split(" ")));break}case"TARGETDURATION":l.targetduration!==0&&dt(l,O,S),l.targetduration=Math.max(parseInt(k),1);break;case"VERSION":l.version!==null&&dt(l,O,S),l.version=parseInt(k);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||dt(l,O,S),l.live=!1;break;case"#":(k||N)&&T.tagList.push(N?[k,N]:[k]);break;case"DISCONTINUITY":y++,T.tagList.push(["DIS"]);break;case"GAP":T.gap=!0,T.tagList.push([O]);break;case"BITRATE":T.tagList.push([O,k]),E=parseInt(k)*1e3,H(E)?T.bitrate=E:E=0;break;case"DATERANGE":{const P=new me(k,l),M=new Ca(P,l.dateRanges[P.ID],l.dateRangeTagCount);l.dateRangeTagCount++,M.isValid||l.skippedSegments?l.dateRanges[M.id]=M:oe.warn(`Ignoring invalid DATERANGE tag: "${k}"`),T.tagList.push(["EXT-X-DATERANGE",k]);break}case"DEFINE":{{const P=new me(k,l);"IMPORT"in P?Mc(l,P,n):rn(l,P,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?dt(l,O,S):h.length>0&&pn(l,O,S),l.startCC=y=parseInt(k);break;case"KEY":{const P=hn(k,t,l);if(P.isSupported()){if(P.method==="NONE"){D=void 0;break}D||(D={});const M=D[P.keyFormat];M!=null&&M.matches(P)||(M&&(D=le({},D)),D[P.keyFormat]=P)}else oe.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${k}"`);break}case"START":l.startTimeOffset=un(k);break;case"MAP":{const P=new me(k,l);if(T.duration){const M=new ci(i,c);gn(M,P,s,D),d=M,T.initSegment=d,d.rawProgramDateTime&&!T.rawProgramDateTime&&(T.rawProgramDateTime=d.rawProgramDateTime)}else{const M=T.byteRangeEndOffset;if(M){const K=T.byteRangeStartOffset;R=`${M-K}@${K}`}else R=null;gn(T,P,s,D),d=T,L=!0}d.cc=y;break}case"SERVER-CONTROL":{I&&dt(l,O,S),I=new me(k),l.canBlockReload=I.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=I.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&I.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=I.optionalFloat("PART-HOLD-BACK",0),l.holdBack=I.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{l.partTarget&&dt(l,O,S);const P=new me(k);l.partTarget=P.decimalFloatingPoint("PART-TARGET");break}case"PART":{let P=l.partList;P||(P=l.partList=[]);const M=f>0?P[P.length-1]:void 0,K=f++,B=new me(k,l),U=new Ml(B,T,c,K,M);P.push(U),T.duration+=U.duration;break}case"PRELOAD-HINT":{const P=new me(k,l);l.preloadHint=P;break}case"RENDITION-REPORT":{const P=new me(k,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(P);break}default:oe.warn(`line parsed but not handled: ${S}`);break}}}v&&!v.relurl?(h.pop(),p-=v.duration,l.partList&&(l.fragmentHint=v)):l.partList&&(Ki(T,v,u),T.cc=y,l.fragmentHint=T,D&&mn(T,D,l)),l.targetduration||(l.playlistParsingError=new Error("Missing Target Duration"));const C=h.length,$=h[0],V=h[C-1];if(p+=l.skippedSegments*l.targetduration,p>0&&C&&V){l.averagetargetduration=p/C;const G=V.sn;l.endSN=G!=="initSegment"?G:0,l.live||(V.endList=!0),A>0&&(Zc(h,A),$&&u.unshift($))}return l.fragmentHint&&(p+=l.fragmentHint.duration),l.totalduration=p,u.length&&l.dateRangeTagCount&&$&&Fa(u,l),l.endCC=y,l}}function Fa(a,e){let t=a.length;if(!t)if(e.hasProgramDateTime){const o=e.fragments[e.fragments.length-1];a.push(o),t++}else return;const s=a[t-1],i=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let o=r.length;o--;){const c=e.dateRanges[r[o]],l=c.startDate.getTime();c.tagAnchor=s.ref;for(let h=t;h--;){var n;if(((n=a[h])==null?void 0:n.sn)=o||s===0){var n;const c=(((n=t[s+1])==null?void 0:n.start)||i)-r.start;if(e<=o+c*1e3){const l=t[s].sn-a.startSN;if(l<0)return-1;const h=a.fragments;if(h.length>t.length){const d=(t[s+1]||h[h.length-1]).sn-a.startSN;for(let g=d;g>l;g--){const f=h[g].programDateTime;if(e>=f&&es);["video","audio","text"].forEach(s=>{const i=t.filter(r=>nr(r,s));i.length&&(e[`${s}Codec`]=i.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>i.indexOf(r)===-1))}),e.unknownCodecs=t}function fn(a,e,t){const s=e[t];s&&(a[t]=s)}function Zc(a,e){let t=a[e];for(let s=e;s--;){const i=a[s];if(!i)return;i.programDateTime=t.programDateTime-i.duration*1e3,t=i}}function Ki(a,e,t){a.rawProgramDateTime?t.push(a):e!=null&&e.programDateTime&&(a.programDateTime=e.endProgramDateTime)}function gn(a,e,t,s){a.relurl=e.URI,e.BYTERANGE&&a.setByteRange(e.BYTERANGE),a.level=t,a.sn="initSegment",s&&(a.levelkeys=s),a.initSegment=null}function mn(a,e,t){a.levelkeys=e;const{encryptedFragments:s}=t;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(i=>e[i].isCommonEncryption)&&s.push(a)}function dt(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function pn(a,e,t){a.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function gi(a,e){const t=e.startPTS;if(H(t)){let s=0,i;e.sn>a.sn?(s=t-a.start,i=a):(s=a.start-t,i=e),i.duration!==s&&i.setDuration(s)}else e.sn>a.sn?a.cc===e.cc&&a.minEndPTS?e.setStart(a.start+(a.minEndPTS-a.start)):e.setStart(a.start+a.duration):e.setStart(Math.max(a.start-e.duration,0))}function Ma(a,e,t,s,i,r,n){s-t<=0&&(n.warn("Fragment should have a positive duration",e),s=t+e.duration,r=i+e.duration);let c=t,l=s;const h=e.startPTS,u=e.endPTS;if(H(h)){const E=Math.abs(h-t);a&&E>a.totalduration?n.warn(`media timestamps and playlist times differ by ${E}s for level ${e.level} ${a.url}`):H(e.deltaPTS)?e.deltaPTS=Math.max(E,e.deltaPTS):e.deltaPTS=E,c=Math.max(t,h),t=Math.min(t,h),i=e.startDTS!==void 0?Math.min(i,e.startDTS):i,l=Math.min(s,u),s=Math.max(s,u),r=e.endDTS!==void 0?Math.max(r,e.endDTS):r}const d=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(s-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=i,e.endPTS=s,e.minEndPTS=l,e.endDTS=r;const g=e.sn;if(!a||ga.endSN)return 0;let f;const p=g-a.startSN,y=a.fragments;for(y[p]=e,f=p;f>0;f--)gi(y[f],y[f-1]);for(f=p;f=0;h--){const u=i[h].initSegment;if(u){s=u;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;let r;sh(a,e,(h,u,d,g)=>{if((!e.startCC||e.skippedSegments)&&u.cc!==h.cc){const f=h.cc-u.cc;for(let p=d;p{var u;h&&(!h.initSegment||h.initSegment.relurl===((u=s)==null?void 0:u.relurl))&&(h.initSegment=s)}),e.skippedSegments){if(e.deltaUpdateFailed=n.some(h=>!h),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let h=e.skippedSegments;h--;)n.shift();e.startSN=n[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=eh(a.dateRanges,e,t));const h=a.fragments.filter(u=>u.rawProgramDateTime);if(a.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u{u.elementaryStreams=h.elementaryStreams,u.stats=h.stats}),r?Ma(e,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS,t):Na(a,e),n.length&&(e.totalduration=e.edge-n[0].start),e.driftStartTime=a.driftStartTime,e.driftStart=a.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const h=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=h),e.driftEndTime=l,e.driftEnd=h}else e.driftEndTime=a.driftEndTime,e.driftEnd=a.driftEnd,e.advancedDateTime=a.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=a.requestScheduled)}function eh(a,e,t){const{dateRanges:s,recentlyRemovedDateranges:i}=e,r=le({},a);i&&i.forEach(c=>{delete r[c]});const o=Object.keys(r).length;return o?(Object.keys(s).forEach(c=>{const l=r[c],h=new Ca(s[c].attr,l);h.isValid?(r[c]=h,l||(h.tagOrder+=o)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${ue(s[c].attr)}"`)}),r):s}function th(a,e,t){if(a&&e){let s=0;for(let i=0,r=a.length;i<=r;i++){const n=a[i],o=e[i+s];n&&o&&n.index===o.index&&n.fragment.sn===o.fragment.sn?t(n,o):s--}}}function sh(a,e,t){const s=e.skippedSegments,i=Math.max(a.startSN,e.startSN)-e.startSN,r=(a.fragmentHint?1:0)+(s?e.endSN:Math.min(a.endSN,e.endSN))-e.startSN,n=e.startSN-a.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=a.fragmentHint?a.fragments.concat(a.fragmentHint):a.fragments;for(let l=i;l<=r;l++){const h=c[n+l];let u=o[l];if(s&&!u&&h&&(u=e.fragments[l]=h),h&&u){t(h,u,l,o);const d=h.relurl,g=u.relurl;if(d&&ih(d,g)){e.playlistParsingError=yn(`media sequence mismatch ${u.sn}:`,a,e,h,u);return}else if(h.cc!==u.cc){e.playlistParsingError=yn(`discontinuity sequence mismatch (${h.cc}!=${u.cc})`,a,e,h,u);return}}}}function yn(a,e,t,s,i){return new Error(`${a} ${i.url}
-Playlist starting @${e.startSN}
-${e.m3u8}
-
-Playlist starting @${t.startSN}
-${t.m3u8}`)}function Na(a,e,t=!0){const s=e.startSN+e.skippedSegments-a.startSN,i=a.fragments,r=s>=0;let n=0;if(r&&se){const r=s[s.length-1].duration*1e3;r{var s;(s=e.details)==null||s.fragments.forEach(i=>{i.level=t,i.initSegment&&(i.initSegment.level=t)})})}function ih(a,e){return a!==e&&e?vn(a)!==vn(e):!1}function vn(a){return a.replace(/\?[^?]*$/,"")}function ss(a,e){for(let s=0,i=a.length;sa.startCC)}function Tn(a,e){const t=a.start+e;a.startPTS=t,a.setStart(t),a.endPTS=t+a.duration}function Ka(a,e){const t=e.fragments;for(let s=0,i=t.length;s{const{config:n,fragCurrent:o,media:c,mediaBuffer:l,state:h}=this,u=c?c.currentTime:0,d=Q.bufferInfo(l||c,u,n.maxBufferHole),g=!d.len;if(this.log(`Media seeking to ${H(u)?u.toFixed(3):u}, state: ${h}, ${g?"out of":"in"} buffer`),this.state===w.ENDED)this.resetLoadingState();else if(o){const f=n.maxFragLookUpTolerance,p=o.start-f,y=o.start+o.duration+f;if(g||yd.end){const E=u>y;(u
');function ng(a,e){Qs(e,!0);const t=9;let s=re(ta([])),i=re(!1),r=re(null),n=re(""),o=re(""),c=re(""),l=re(0),h=re(!0);async function u(){q(i,!0),q(c,"");try{const O=await El(F(l),t);q(s,O.records,!0),q(h,O.hasMore,!0)}catch(O){q(c,O.message,!0)}q(i,!1)}function d(){!F(h)||F(i)||(Pr(l),u(),window.scrollTo({top:0,behavior:"smooth"}))}function g(){F(l)<=0||F(i)||(Pr(l,-1),u(),window.scrollTo({top:0,behavior:"smooth"}))}function f(O){q(r,O,!0),q(o,""),wi(O.value.creator).then(N=>{q(n,N,!0);const P=N.replace("@","");vl(P).then(M=>{M.avatar&&q(o,M.avatar,!0)}).catch(()=>{})});const k=new URL(window.location.href);k.searchParams.set("v",O.uri),window.history.pushState({},"",k.toString()),window.scrollTo({top:0,behavior:"smooth"})}function p(){q(r,null);const O=new URL(window.location.href);O.searchParams.delete("v"),window.history.pushState({},"",O.toString())}Zn(async()=>{await u();const k=new URLSearchParams(window.location.search).get("v");if(k){const P=(await kr()).find(M=>M.uri===k);P&&f(P)}});async function y(){const k=new URLSearchParams(window.location.search).get("v");if(k){const P=(await kr()).find(M=>M.uri===k);P&&(q(r,P,!0),wi(P.value.creator).then(M=>q(n,M,!0)))}else q(r,null)}var E=jf();At("popstate",hl,y),fl("1uha8ag",O=>{cl(()=>{ul.title="vod frog"})});var v=ne(E);yl(v,{onHomeClick:p});var T=fe(v,2);{var S=O=>{var k=Hf(),N=ne(k);{let K=ia(()=>aa(F(r).uri));Cf(N,{get src(){return F(K)}})}var P=fe(N,2),M=ne(P);Bs(M,{seed:"player-info",fill:"#39FF44",strokeColor:"#0A182B",strokeWidth:1.8,padding:"32px clamp(40px, 6vw, 80px)",children:(K,B)=>{var U=Vf(),z=sa(U),Z=ne(z,!0);ie(z);var j=fe(z,2),J=ne(j);{var de=Fe=>{var xe=Kf(),bt=ne(xe);$f(bt,{get seed(){return F(r).value.creator},fill:"#FFDEED",strokeColor:"#0A182B",strokeWidth:1.5,size:40,children:(te,ve)=>{var Re=Gf();Me(()=>Ne(Re,"src",F(o))),_e(te,Re)},$$slots:{default:!0}}),ie(xe),Me(te=>Ne(xe,"href",`/profile/${te??""}`),[()=>F(n)?.replace("@","")||F(r).value.creator]),_e(Fe,xe)};nt(J,Fe=>{F(o)&&Fe(de)})}var ce=fe(J,2),ge=ne(ce),Oe=ne(ge,!0);ie(ge);var Le=fe(ge,3),Be=fe(Le,2);ie(ce),ie(j),Me((Fe,xe,bt)=>{Ze(Z,F(r).value.title),Ne(ge,"href",`/profile/${Fe??""}`),Ze(Oe,F(n)||F(r).value.creator),Ze(Le,` ${xe??""} `),Ze(Be,` ${bt??""}`)},[()=>F(n)?.replace("@","")||F(r).value.creator,()=>na(F(r).value.createdAt),()=>ra(F(r).value.duration)]),_e(K,U)},$$slots:{default:!0}}),ie(P),ie(k),_e(O,k)};nt(T,O=>{F(r)&&O(S)})}var x=fe(T,2);{var D=O=>{var k=Yf(),N=ne(k,!0);ie(k),Me(()=>Ze(N,F(c))),_e(O,k)};nt(x,O=>{F(c)&&O(D)})}var A=fe(x,2);Sl(A,21,()=>F(s),O=>O.uri,(O,k)=>{Bf(O,{get video(){return F(k)},onSelect:f})}),ie(A);var L=fe(A,2),R=ne(L);{var I=O=>{var k=Wf();Me(()=>k.disabled=F(i)),rt("click",k,g),_e(O,k)};nt(R,O=>{F(l)>0&&O(I)})}var C=fe(R,2),$=ne(C);ie(C);var V=fe(C,2);{var G=O=>{var k=qf();Me(()=>k.disabled=F(i)),rt("click",k,d),_e(O,k)};nt(V,O=>{F(h)&&O(G)})}ie(L),ie(E),Me(()=>Ze($,`page ${F(l)+1}`)),_e(a,E),Zs()}tr(["click"]);export{ng as component};
diff --git a/.svelte-kit/output/client/_app/immutable/nodes/3.Bx_OPh6d.js b/.svelte-kit/output/client/_app/immutable/nodes/3.Bx_OPh6d.js
deleted file mode 100644
index 904caa8..0000000
--- a/.svelte-kit/output/client/_app/immutable/nodes/3.Bx_OPh6d.js
+++ /dev/null
@@ -1 +0,0 @@
-import{a as i,f as n}from"../chunks/6qGwBjhj.js";import{o as oa}from"../chunks/pNsQzX0r.js";import{a1 as la,a4 as va,a8 as ia,a5 as r,B as b,A as a,a9 as na,a7 as p,aa as y,a6 as o,ab as j,ac as da,a3 as c}from"../chunks/BuZ8u_VS.js";import{s as _}from"../chunks/CCoS_Egr.js";import{i as u,s as pa,a as ca}from"../chunks/CvWmAKek.js";import{h as ma}from"../chunks/iHYN8FkY.js";import{F as fa,g as _a,W as N,s as w}from"../chunks/4YFwho-X.js";import{s as ua}from"../chunks/BKjtTD7m.js";const ga=!1,xa=!1,Ga=Object.freeze(Object.defineProperty({__proto__:null,prerender:ga,ssr:xa},Symbol.toStringTag,{value:"Module"})),ba=()=>{const m=ua;return{page:{subscribe:m.page.subscribe},navigating:{subscribe:m.navigating.subscribe},updated:m.updated}},ha={subscribe(m){return ba().page.subscribe(m)}};var $a=n('