50 lines
300 KiB
JavaScript
50 lines
300 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatPage-0cJYh78p.js","assets/chat-CR1al33K.js","assets/ChatWindow.vue_vue_type_script_setup_true_lang-CiskBM0U.js","assets/useNostr-zyhtrXba.js","assets/ChatWindow-KqUPCuYg.css","assets/FilmGrid.vue_vue_type_script_setup_true_lang-BDhsWNsb.js","assets/useContentImages-h7FPc94o.js","assets/SongGrid.vue_vue_type_script_setup_true_lang-BGfZFkPO.js","assets/FilmDetail.vue_vue_type_script_setup_true_lang-TCAQqc_e.js","assets/SongDetail.vue_vue_type_script_setup_true_lang-B41kpCIv.js","assets/ChatPage-UEkXBR6z.css","assets/GuidePage-BHJ1yOj7.js","assets/GuidePage-BvYaLEzG.css","assets/WidgetDemoPage-D7wMN-ak.js","assets/WidgetDemoPage-BSWX2CxO.css","assets/ConversationViewerPage-BEZVAgnq.js"])))=>i.map(i=>d[i]);
|
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();const td="modulepreload",nd=function(e){return"/"+e},Bl={},jt=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){let a=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");i=a(n.map(c=>{if(c=nd(c),c in Bl)return;Bl[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":td,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((p,v)=>{d.addEventListener("load",p),d.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};function el(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Me={},ys=[],sn=()=>{},kc=()=>!1,Er=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),tl=e=>e.startsWith("onUpdate:"),Je=Object.assign,nl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},sd=Object.prototype.hasOwnProperty,Se=(e,t)=>sd.call(e,t),ie=Array.isArray,bs=e=>Ai(e)==="[object Map]",Rs=e=>Ai(e)==="[object Set]",Vl=e=>Ai(e)==="[object Date]",ue=e=>typeof e=="function",Be=e=>typeof e=="string",Bt=e=>typeof e=="symbol",ke=e=>e!==null&&typeof e=="object",Cc=e=>(ke(e)||ue(e))&&ue(e.then)&&ue(e.catch),Sc=Object.prototype.toString,Ai=e=>Sc.call(e),id=e=>Ai(e).slice(8,-1),Pc=e=>Ai(e)==="[object Object]",xr=e=>Be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Qs=el(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ar=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},rd=/-\w/g,Nt=Ar(e=>e.replace(rd,t=>t.slice(1).toUpperCase())),od=/\B([A-Z])/g,Fn=Ar(e=>e.replace(od,"-$1").toLowerCase()),kr=Ar(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wr=Ar(e=>e?`on${kr(e)}`:""),$n=(e,t)=>!Object.is(e,t),Gi=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Rc=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Cr=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ld=e=>{const t=Be(e)?Number(e):NaN;return isNaN(t)?e:t};let zl;const Sr=()=>zl||(zl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Dn(e){if(ie(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],i=Be(s)?fd(s):Dn(s);if(i)for(const r in i)t[r]=i[r]}return t}else if(Be(e)||ke(e))return e}const ad=/;(?![^(]*\))/g,cd=/:([^]+)/,ud=/\/\*[^]*?\*\//g;function fd(e){const t={};return e.replace(ud,"").split(ad).forEach(n=>{if(n){const s=n.split(cd);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function qe(e){let t="";if(Be(e))t=e;else if(ie(e))for(let n=0;n<e.length;n++){const s=qe(e[n]);s&&(t+=s+" ")}else if(ke(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const dd="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",hd=el(dd);function Ic(e){return!!e||e===""}function pd(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Is(e[s],t[s]);return n}function Is(e,t){if(e===t)return!0;let n=Vl(e),s=Vl(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Bt(e),s=Bt(t),n||s)return e===t;if(n=ie(e),s=ie(t),n||s)return n&&s?pd(e,t):!1;if(n=ke(e),s=ke(t),n||s){if(!n||!s)return!1;const i=Object.keys(e).length,r=Object.keys(t).length;if(i!==r)return!1;for(const o in e){const l=e.hasOwnProperty(o),a=t.hasOwnProperty(o);if(l&&!a||!l&&a||!Is(e[o],t[o]))return!1}}return String(e)===String(t)}function sl(e,t){return e.findIndex(n=>Is(n,t))}const Mc=e=>!!(e&&e.__v_isRef===!0),tt=e=>Be(e)?e:e==null?"":ie(e)||ke(e)&&(e.toString===Sc||!ue(e.toString))?Mc(e)?tt(e.value):JSON.stringify(e,Oc,2):String(e),Oc=(e,t)=>Mc(t)?Oc(e,t.value):bs(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,i],r)=>(n[Kr(s,r)+" =>"]=i,n),{})}:Rs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Kr(n))}:Bt(t)?Kr(t):ke(t)&&!ie(t)&&!Pc(t)?String(t):t,Kr=(e,t="")=>{var n;return Bt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let dt;class Nc{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=dt,!t&&dt&&(this.index=(dt.scopes||(dt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=dt;try{return dt=this,t()}finally{dt=n}}}on(){++this._on===1&&(this.prevScope=dt,dt=this)}off(){this._on>0&&--this._on===0&&(dt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Lc(e){return new Nc(e)}function $c(){return dt}function md(e,t=!1){dt&&dt.cleanups.push(e)}let Oe;const Gr=new WeakSet;class Dc{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,dt&&dt.active&&dt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Gr.has(this)&&(Gr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||jc(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ql(this),Fc(this);const t=Oe,n=Ft;Oe=this,Ft=!0;try{return this.fn()}finally{Hc(this),Oe=t,Ft=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)ol(t);this.deps=this.depsTail=void 0,ql(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Gr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ao(this)&&this.run()}get dirty(){return Ao(this)}}let Uc=0,Zs,ei;function jc(e,t=!1){if(e.flags|=8,t){e.next=ei,ei=e;return}e.next=Zs,Zs=e}function il(){Uc++}function rl(){if(--Uc>0)return;if(ei){let t=ei;for(ei=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Zs;){let t=Zs;for(Zs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function Fc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hc(e){let t,n=e.depsTail,s=n;for(;s;){const i=s.prevDep;s.version===-1?(s===n&&(n=i),ol(s),gd(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=i}e.deps=t,e.depsTail=n}function Ao(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Bc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Bc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ci)||(e.globalVersion=ci,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ao(e))))return;e.flags|=2;const t=e.dep,n=Oe,s=Ft;Oe=e,Ft=!0;try{Fc(e);const i=e.fn(e._value);(t.version===0||$n(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{Oe=n,Ft=s,Hc(e),e.flags&=-3}}function ol(e,t=!1){const{dep:n,prevSub:s,nextSub:i}=e;if(s&&(s.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)ol(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function gd(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ft=!0;const Vc=[];function bn(){Vc.push(Ft),Ft=!1}function vn(){const e=Vc.pop();Ft=e===void 0?!0:e}function ql(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Oe;Oe=void 0;try{t()}finally{Oe=n}}}let ci=0;class yd{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ll{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Oe||!Ft||Oe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Oe)n=this.activeLink=new yd(Oe,this),Oe.deps?(n.prevDep=Oe.depsTail,Oe.depsTail.nextDep=n,Oe.depsTail=n):Oe.deps=Oe.depsTail=n,zc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Oe.depsTail,n.nextDep=void 0,Oe.depsTail.nextDep=n,Oe.depsTail=n,Oe.deps===n&&(Oe.deps=s)}return n}trigger(t){this.version++,ci++,this.notify(t)}notify(t){il();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{rl()}}}function zc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)zc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ar=new WeakMap,ts=Symbol(""),ko=Symbol(""),ui=Symbol("");function ht(e,t,n){if(Ft&&Oe){let s=ar.get(e);s||ar.set(e,s=new Map);let i=s.get(n);i||(s.set(n,i=new ll),i.map=s,i.key=n),i.track()}}function hn(e,t,n,s,i,r){const o=ar.get(e);if(!o){ci++;return}const l=a=>{a&&a.trigger()};if(il(),t==="clear")o.forEach(l);else{const a=ie(e),c=a&&xr(n);if(a&&n==="length"){const u=Number(s);o.forEach((f,d)=>{(d==="length"||d===ui||!Bt(d)&&d>=u)&&l(f)})}else switch((n!==void 0||o.has(void 0))&&l(o.get(n)),c&&l(o.get(ui)),t){case"add":a?c&&l(o.get("length")):(l(o.get(ts)),bs(e)&&l(o.get(ko)));break;case"delete":a||(l(o.get(ts)),bs(e)&&l(o.get(ko)));break;case"set":bs(e)&&l(o.get(ts));break}}rl()}function bd(e,t){const n=ar.get(e);return n&&n.get(t)}function cs(e){const t=Te(e);return t===e?t:(ht(t,"iterate",ui),It(e)?t:t.map(Vt))}function Pr(e){return ht(e=Te(e),"iterate",ui),e}function Rn(e,t){return wn(e)?Ts(gn(e)?Vt(t):t):Vt(t)}const vd={__proto__:null,[Symbol.iterator](){return Yr(this,Symbol.iterator,e=>Rn(this,e))},concat(...e){return cs(this).concat(...e.map(t=>ie(t)?cs(t):t))},entries(){return Yr(this,"entries",e=>(e[1]=Rn(this,e[1]),e))},every(e,t){return ln(this,"every",e,t,void 0,arguments)},filter(e,t){return ln(this,"filter",e,t,n=>n.map(s=>Rn(this,s)),arguments)},find(e,t){return ln(this,"find",e,t,n=>Rn(this,n),arguments)},findIndex(e,t){return ln(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ln(this,"findLast",e,t,n=>Rn(this,n),arguments)},findLastIndex(e,t){return ln(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ln(this,"forEach",e,t,void 0,arguments)},includes(...e){return Xr(this,"includes",e)},indexOf(...e){return Xr(this,"indexOf",e)},join(e){return cs(this).join(e)},lastIndexOf(...e){return Xr(this,"lastIndexOf",e)},map(e,t){return ln(this,"map",e,t,void 0,arguments)},pop(){return Ns(this,"pop")},push(...e){return Ns(this,"push",e)},reduce(e,...t){return Wl(this,"reduce",e,t)},reduceRight(e,...t){return Wl(this,"reduceRight",e,t)},shift(){return Ns(this,"shift")},some(e,t){return ln(this,"some",e,t,void 0,arguments)},splice(...e){return Ns(this,"splice",e)},toReversed(){return cs(this).toReversed()},toSorted(e){return cs(this).toSorted(e)},toSpliced(...e){return cs(this).toSpliced(...e)},unshift(...e){return Ns(this,"unshift",e)},values(){return Yr(this,"values",e=>Rn(this,e))}};function Yr(e,t,n){const s=Pr(e),i=s[t]();return s!==e&&!It(e)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=n(r.value)),r}),i}const wd=Array.prototype;function ln(e,t,n,s,i,r){const o=Pr(e),l=o!==e&&!It(e),a=o[t];if(a!==wd[t]){const f=a.apply(e,r);return l?Vt(f):f}let c=n;o!==e&&(l?c=function(f,d){return n.call(this,Rn(e,f),d,e)}:n.length>2&&(c=function(f,d){return n.call(this,f,d,e)}));const u=a.call(o,c,s);return l&&i?i(u):u}function Wl(e,t,n,s){const i=Pr(e);let r=n;return i!==e&&(It(e)?n.length>3&&(r=function(o,l,a){return n.call(this,o,l,a,e)}):r=function(o,l,a){return n.call(this,o,Rn(e,l),a,e)}),i[t](r,...s)}function Xr(e,t,n){const s=Te(e);ht(s,"iterate",ui);const i=s[t](...n);return(i===-1||i===!1)&&Rr(n[0])?(n[0]=Te(n[0]),s[t](...n)):i}function Ns(e,t,n=[]){bn(),il();const s=Te(e)[t].apply(e,n);return rl(),vn(),s}const _d=el("__proto__,__v_isRef,__isVue"),qc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Bt));function Td(e){Bt(e)||(e=String(e));const t=Te(this);return ht(t,"has",e),t.hasOwnProperty(e)}class Wc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return s===(i?r?Md:Xc:r?Yc:Gc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=ie(t);if(!i){let a;if(o&&(a=vd[n]))return a;if(n==="hasOwnProperty")return Td}const l=Reflect.get(t,n,Ue(t)?t:s);if((Bt(n)?qc.has(n):_d(n))||(i||ht(t,"get",n),r))return l;if(Ue(l)){const a=o&&xr(n)?l:l.value;return i&&ke(a)?St(a):a}return ke(l)?i?St(l):ki(l):l}}class Kc extends Wc{constructor(t=!1){super(!1,t)}set(t,n,s,i){let r=t[n];const o=ie(t)&&xr(n);if(!this._isShallow){const c=wn(r);if(!It(s)&&!wn(s)&&(r=Te(r),s=Te(s)),!o&&Ue(r)&&!Ue(s))return c||(r.value=s),!0}const l=o?Number(n)<t.length:Se(t,n),a=Reflect.set(t,n,s,Ue(t)?t:i);return t===Te(i)&&(l?$n(s,r)&&hn(t,"set",n,s):hn(t,"add",n,s)),a}deleteProperty(t,n){const s=Se(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&s&&hn(t,"delete",n,void 0),i}has(t,n){const s=Reflect.has(t,n);return(!Bt(n)||!qc.has(n))&&ht(t,"has",n),s}ownKeys(t){return ht(t,"iterate",ie(t)?"length":ts),Reflect.ownKeys(t)}}class Ed extends Wc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const xd=new Kc,Ad=new Ed,kd=new Kc(!0);const Co=e=>e,$i=e=>Reflect.getPrototypeOf(e);function Cd(e,t,n){return function(...s){const i=this.__v_raw,r=Te(i),o=bs(r),l=e==="entries"||e===Symbol.iterator&&o,a=e==="keys"&&o,c=i[e](...s),u=n?Co:t?Ts:Vt;return!t&&ht(r,"iterate",a?ko:ts),Je(Object.create(c),{next(){const{value:f,done:d}=c.next();return d?{value:f,done:d}:{value:l?[u(f[0]),u(f[1])]:u(f),done:d}}})}}function Di(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Sd(e,t){const n={get(i){const r=this.__v_raw,o=Te(r),l=Te(i);e||($n(i,l)&&ht(o,"get",i),ht(o,"get",l));const{has:a}=$i(o),c=t?Co:e?Ts:Vt;if(a.call(o,i))return c(r.get(i));if(a.call(o,l))return c(r.get(l));r!==o&&r.get(i)},get size(){const i=this.__v_raw;return!e&&ht(Te(i),"iterate",ts),i.size},has(i){const r=this.__v_raw,o=Te(r),l=Te(i);return e||($n(i,l)&&ht(o,"has",i),ht(o,"has",l)),i===l?r.has(i):r.has(i)||r.has(l)},forEach(i,r){const o=this,l=o.__v_raw,a=Te(l),c=t?Co:e?Ts:Vt;return!e&&ht(a,"iterate",ts),l.forEach((u,f)=>i.call(r,c(u),c(f),o))}};return Je(n,e?{add:Di("add"),set:Di("set"),delete:Di("delete"),clear:Di("clear")}:{add(i){!t&&!It(i)&&!wn(i)&&(i=Te(i));const r=Te(this);return $i(r).has.call(r,i)||(r.add(i),hn(r,"add",i,i)),this},set(i,r){!t&&!It(r)&&!wn(r)&&(r=Te(r));const o=Te(this),{has:l,get:a}=$i(o);let c=l.call(o,i);c||(i=Te(i),c=l.call(o,i));const u=a.call(o,i);return o.set(i,r),c?$n(r,u)&&hn(o,"set",i,r):hn(o,"add",i,r),this},delete(i){const r=Te(this),{has:o,get:l}=$i(r);let a=o.call(r,i);a||(i=Te(i),a=o.call(r,i)),l&&l.call(r,i);const c=r.delete(i);return a&&hn(r,"delete",i,void 0),c},clear(){const i=Te(this),r=i.size!==0,o=i.clear();return r&&hn(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Cd(i,e,t)}),n}function al(e,t){const n=Sd(e,t);return(s,i,r)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?s:Reflect.get(Se(n,i)&&i in s?n:s,i,r)}const Pd={get:al(!1,!1)},Rd={get:al(!1,!0)},Id={get:al(!0,!1)};const Gc=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,Md=new WeakMap;function Od(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Nd(e){return e.__v_skip||!Object.isExtensible(e)?0:Od(id(e))}function ki(e){return wn(e)?e:cl(e,!1,xd,Pd,Gc)}function Jc(e){return cl(e,!1,kd,Rd,Yc)}function St(e){return cl(e,!0,Ad,Id,Xc)}function cl(e,t,n,s,i){if(!ke(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Nd(e);if(r===0)return e;const o=i.get(e);if(o)return o;const l=new Proxy(e,r===2?s:n);return i.set(e,l),l}function gn(e){return wn(e)?gn(e.__v_raw):!!(e&&e.__v_isReactive)}function wn(e){return!!(e&&e.__v_isReadonly)}function It(e){return!!(e&&e.__v_isShallow)}function Rr(e){return e?!!e.__v_raw:!1}function Te(e){const t=e&&e.__v_raw;return t?Te(t):e}function ul(e){return!Se(e,"__v_skip")&&Object.isExtensible(e)&&Rc(e,"__v_skip",!0),e}const Vt=e=>ke(e)?ki(e):e,Ts=e=>ke(e)?St(e):e;function Ue(e){return e?e.__v_isRef===!0:!1}function Q(e){return Zc(e,!1)}function Qc(e){return Zc(e,!0)}function Zc(e,t){return Ue(e)?e:new Ld(e,t)}class Ld{constructor(t,n){this.dep=new ll,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Te(t),this._value=n?t:Vt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||It(t)||wn(t);t=s?t:Te(t),$n(t,n)&&(this._rawValue=t,this._value=s?t:Vt(t),this.dep.trigger())}}function Ov(e){e.dep&&e.dep.trigger()}function V(e){return Ue(e)?e.value:e}const $d={get:(e,t,n)=>t==="__v_raw"?e:V(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const i=e[t];return Ue(i)&&!Ue(n)?(i.value=n,!0):Reflect.set(e,t,n,s)}};function eu(e){return gn(e)?e:new Proxy(e,$d)}function Dd(e){const t=ie(e)?new Array(e.length):{};for(const n in e)t[n]=tu(e,n);return t}class Ud{constructor(t,n,s){this._object=t,this._key=n,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0,this._raw=Te(t);let i=!0,r=t;if(!ie(t)||!xr(String(n)))do i=!Rr(r)||It(r);while(i&&(r=r.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=V(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ue(this._raw[this._key])){const n=this._object[this._key];if(Ue(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return bd(this._raw,this._key)}}class jd{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Nv(e,t,n){return Ue(e)?e:ue(e)?new jd(e):ke(e)&&arguments.length>1?tu(e,t,n):Q(e)}function tu(e,t,n){return new Ud(e,t,n)}class Fd{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ll(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ci-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return jc(this,!0),!0}get value(){const t=this.dep.track();return Bc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Hd(e,t,n=!1){let s,i;return ue(e)?s=e:(s=e.get,i=e.set),new Fd(s,i,n)}const Ui={},cr=new WeakMap;let Jn;function Bd(e,t=!1,n=Jn){if(n){let s=cr.get(n);s||cr.set(n,s=[]),s.push(e)}}function Vd(e,t,n=Me){const{immediate:s,deep:i,once:r,scheduler:o,augmentJob:l,call:a}=n,c=T=>i?T:It(T)||i===!1||i===0?pn(T,1):pn(T);let u,f,d,p,v=!1,b=!1;if(Ue(e)?(f=()=>e.value,v=It(e)):gn(e)?(f=()=>c(e),v=!0):ie(e)?(b=!0,v=e.some(T=>gn(T)||It(T)),f=()=>e.map(T=>{if(Ue(T))return T.value;if(gn(T))return c(T);if(ue(T))return a?a(T,2):T()})):ue(e)?t?f=a?()=>a(e,2):e:f=()=>{if(d){bn();try{d()}finally{vn()}}const T=Jn;Jn=u;try{return a?a(e,3,[p]):e(p)}finally{Jn=T}}:f=sn,t&&i){const T=f,M=i===!0?1/0:i;f=()=>pn(T(),M)}const I=$c(),x=()=>{u.stop(),I&&I.active&&nl(I.effects,u)};if(r&&t){const T=t;t=(...M)=>{T(...M),x()}}let w=b?new Array(e.length).fill(Ui):Ui;const E=T=>{if(!(!(u.flags&1)||!u.dirty&&!T))if(t){const M=u.run();if(i||v||(b?M.some(($,G)=>$n($,w[G])):$n(M,w))){d&&d();const $=Jn;Jn=u;try{const G=[M,w===Ui?void 0:b&&w[0]===Ui?[]:w,p];w=M,a?a(t,3,G):t(...G)}finally{Jn=$}}}else u.run()};return l&&l(E),u=new Dc(f),u.scheduler=o?()=>o(E,!1):E,p=T=>Bd(T,!1,u),d=u.onStop=()=>{const T=cr.get(u);if(T){if(a)a(T,4);else for(const M of T)M();cr.delete(u)}},t?s?E(!0):w=u.run():o?o(E.bind(null,!0),!0):u.run(),x.pause=u.pause.bind(u),x.resume=u.resume.bind(u),x.stop=x,x}function pn(e,t=1/0,n){if(t<=0||!ke(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ue(e))pn(e.value,t,n);else if(ie(e))for(let s=0;s<e.length;s++)pn(e[s],t,n);else if(Rs(e)||bs(e))e.forEach(s=>{pn(s,t,n)});else if(Pc(e)){for(const s in e)pn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&pn(e[s],t,n)}return e}function Ci(e,t,n,s){try{return s?e(...s):e()}catch(i){Si(i,t,n)}}function zt(e,t,n,s){if(ue(e)){const i=Ci(e,t,n,s);return i&&Cc(i)&&i.catch(r=>{Si(r,t,n)}),i}if(ie(e)){const i=[];for(let r=0;r<e.length;r++)i.push(zt(e[r],t,n,s));return i}}function Si(e,t,n,s=!0){const i=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Me;if(t){let l=t.parent;const a=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const u=l.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,a,c)===!1)return}l=l.parent}if(r){bn(),Ci(r,null,10,[e,a,c]),vn();return}}zd(e,n,i,s,o)}function zd(e,t,n,s=!0,i=!1){if(i)throw e;console.error(e)}const vt=[];let Qt=-1;const vs=[];let In=null,ps=0;const nu=Promise.resolve();let ur=null;function ss(e){const t=ur||nu;return e?t.then(this?e.bind(this):e):t}function qd(e){let t=Qt+1,n=vt.length;for(;t<n;){const s=t+n>>>1,i=vt[s],r=fi(i);r<e||r===e&&i.flags&2?t=s+1:n=s}return t}function fl(e){if(!(e.flags&1)){const t=fi(e),n=vt[vt.length-1];!n||!(e.flags&2)&&t>=fi(n)?vt.push(e):vt.splice(qd(t),0,e),e.flags|=1,su()}}function su(){ur||(ur=nu.then(ru))}function Wd(e){ie(e)?vs.push(...e):In&&e.id===-1?In.splice(ps+1,0,e):e.flags&1||(vs.push(e),e.flags|=1),su()}function Kl(e,t,n=Qt+1){for(;n<vt.length;n++){const s=vt[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;vt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function iu(e){if(vs.length){const t=[...new Set(vs)].sort((n,s)=>fi(n)-fi(s));if(vs.length=0,In){In.push(...t);return}for(In=t,ps=0;ps<In.length;ps++){const n=In[ps];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}In=null,ps=0}}const fi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ru(e){try{for(Qt=0;Qt<vt.length;Qt++){const t=vt[Qt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ci(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qt<vt.length;Qt++){const t=vt[Qt];t&&(t.flags&=-2)}Qt=-1,vt.length=0,iu(),ur=null,(vt.length||vs.length)&&ru()}}let at=null,ou=null;function fr(e){const t=at;return at=e,ou=e&&e.type.__scopeId||null,t}function di(e,t=at,n){if(!t||e._n)return e;const s=(...i)=>{s._d&&pr(-1);const r=fr(t);let o;try{o=e(...i)}finally{fr(r),s._d&&pr(1)}return o};return s._n=!0,s._c=!0,s._d=!0,s}function Gl(e,t){if(at===null)return e;const n=$r(at),s=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[r,o,l,a=Me]=t[i];r&&(ue(r)&&(r={mounted:r,updated:r}),r.deep&&pn(o),s.push({dir:r,instance:n,value:o,oldValue:void 0,arg:l,modifiers:a}))}return e}function zn(e,t,n,s){const i=e.dirs,r=t&&t.dirs;for(let o=0;o<i.length;o++){const l=i[o];r&&(l.oldValue=r[o].value);let a=l.dir[s];a&&(bn(),zt(a,n,8,[e.el,l,e,t]),vn())}}function Yi(e,t){if(lt){let n=lt.provides;const s=lt.parent&<.parent.provides;s===n&&(n=lt.provides=Object.create(s)),n[e]=t}}function Ot(e,t,n=!1){const s=bl();if(s||ns){let i=ns?ns._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&ue(t)?t.call(s&&s.proxy):t}}function Kd(){return!!(bl()||ns)}const Gd=Symbol.for("v-scx"),Yd=()=>Ot(Gd);function Ht(e,t,n){return lu(e,t,n)}function lu(e,t,n=Me){const{immediate:s,deep:i,flush:r,once:o}=n,l=Je({},n),a=t&&s||!t&&r!=="post";let c;if(Es){if(r==="sync"){const p=Yd();c=p.__watcherHandles||(p.__watcherHandles=[])}else if(!a){const p=()=>{};return p.stop=sn,p.resume=sn,p.pause=sn,p}}const u=lt;l.call=(p,v,b)=>zt(p,u,v,b);let f=!1;r==="post"?l.scheduler=p=>{ft(p,u&&u.suspense)}:r!=="sync"&&(f=!0,l.scheduler=(p,v)=>{v?p():fl(p)}),l.augmentJob=p=>{t&&(p.flags|=4),f&&(p.flags|=2,u&&(p.id=u.uid,p.i=u))};const d=Vd(e,t,l);return Es&&(c?c.push(d):a&&d()),d}function Xd(e,t,n){const s=this.proxy,i=Be(e)?e.includes(".")?au(s,e):()=>s[e]:e.bind(s,s);let r;ue(t)?r=t:(r=t.handler,n=t);const o=Ri(this),l=lu(i,r.bind(s),n);return o(),l}function au(e,t){const n=t.split(".");return()=>{let s=e;for(let i=0;i<n.length&&s;i++)s=s[n[i]];return s}}const cu=Symbol("_vte"),uu=e=>e.__isTeleport,ti=e=>e&&(e.disabled||e.disabled===""),Yl=e=>e&&(e.defer||e.defer===""),Xl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Jl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,So=(e,t)=>{const n=e&&e.to;return Be(n)?t?t(n):null:n},fu={name:"Teleport",__isTeleport:!0,process(e,t,n,s,i,r,o,l,a,c){const{mc:u,pc:f,pbc:d,o:{insert:p,querySelector:v,createText:b,createComment:I}}=c,x=ti(t.props);let{shapeFlag:w,children:E,dynamicChildren:T}=t;if(e==null){const M=t.el=b(""),$=t.anchor=b("");p(M,n,s),p($,n,s);const G=(S,P)=>{w&16&&u(E,S,P,i,r,o,l,a)},L=()=>{const S=t.target=So(t.props,v),P=Po(S,t,b,p);S&&(o!=="svg"&&Xl(S)?o="svg":o!=="mathml"&&Jl(S)&&(o="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(S),x||(G(S,P),Xi(t,!1)))};x&&(G(n,$),Xi(t,!0)),Yl(t.props)?(t.el.__isMounted=!1,ft(()=>{L(),delete t.el.__isMounted},r)):L()}else{if(Yl(t.props)&&e.el.__isMounted===!1){ft(()=>{fu.process(e,t,n,s,i,r,o,l,a,c)},r);return}t.el=e.el,t.targetStart=e.targetStart;const M=t.anchor=e.anchor,$=t.target=e.target,G=t.targetAnchor=e.targetAnchor,L=ti(e.props),S=L?n:$,P=L?M:G;if(o==="svg"||Xl($)?o="svg":(o==="mathml"||Jl($))&&(o="mathml"),T?(d(e.dynamicChildren,T,S,i,r,o,l),gl(e,t,!0)):a||f(e,t,S,P,i,r,o,l,!1),x)L?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ji(t,n,M,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const D=t.target=So(t.props,v);D&&ji(t,D,null,c,0)}else L&&ji(t,$,G,c,1);Xi(t,x)}},remove(e,t,n,{um:s,o:{remove:i}},r){const{shapeFlag:o,children:l,anchor:a,targetStart:c,targetAnchor:u,target:f,props:d}=e;if(f&&(i(c),i(u)),r&&i(a),o&16){const p=r||!ti(d);for(let v=0;v<l.length;v++){const b=l[v];s(b,t,n,p,!!b.dynamicChildren)}}},move:ji,hydrate:Jd};function ji(e,t,n,{o:{insert:s},m:i},r=2){r===0&&s(e.targetAnchor,t,n);const{el:o,anchor:l,shapeFlag:a,children:c,props:u}=e,f=r===2;if(f&&s(o,t,n),(!f||ti(u))&&a&16)for(let d=0;d<c.length;d++)i(c[d],t,n,2);f&&s(l,t,n)}function Jd(e,t,n,s,i,r,{o:{nextSibling:o,parentNode:l,querySelector:a,insert:c,createText:u}},f){function d(I,x){let w=x;for(;w;){if(w&&w.nodeType===8){if(w.data==="teleport start anchor")t.targetStart=w;else if(w.data==="teleport anchor"){t.targetAnchor=w,I._lpa=t.targetAnchor&&o(t.targetAnchor);break}}w=o(w)}}function p(I,x){x.anchor=f(o(I),x,l(I),n,s,i,r)}const v=t.target=So(t.props,a),b=ti(t.props);if(v){const I=v._lpa||v.firstChild;t.shapeFlag&16&&(b?(p(e,t),d(v,I),t.targetAnchor||Po(v,t,u,c,l(e)===v?e:null)):(t.anchor=o(e),d(v,I),t.targetAnchor||Po(v,t,u,c),f(I&&o(I),t,v,n,s,i,r))),Xi(t,b)}else b&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}const dl=fu;function Xi(e,t){const n=e.ctx;if(n&&n.ut){let s,i;for(t?(s=e.el,i=e.anchor):(s=e.targetStart,i=e.targetAnchor);s&&s!==i;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Po(e,t,n,s,i=null){const r=t.targetStart=n(""),o=t.targetAnchor=n("");return r[cu]=o,e&&(s(r,e,i),s(o,e,i)),o}const en=Symbol("_leaveCb"),Ls=Symbol("_enterCb");function Qd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return is(()=>{e.isMounted=!0}),Mr(()=>{e.isUnmounting=!0}),e}const Mt=[Function,Array],du={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mt,onEnter:Mt,onAfterEnter:Mt,onEnterCancelled:Mt,onBeforeLeave:Mt,onLeave:Mt,onAfterLeave:Mt,onLeaveCancelled:Mt,onBeforeAppear:Mt,onAppear:Mt,onAfterAppear:Mt,onAppearCancelled:Mt},hu=e=>{const t=e.subTree;return t.component?hu(t.component):t},Zd={name:"BaseTransition",props:du,setup(e,{slots:t}){const n=bl(),s=Qd();return()=>{const i=t.default&&gu(t.default(),!0);if(!i||!i.length)return;const r=pu(i),o=Te(e),{mode:l}=o;if(s.isLeaving)return Jr(r);const a=Ql(r);if(!a)return Jr(r);let c=Ro(a,o,s,n,f=>c=f);a.type!==pt&&hi(a,c);let u=n.subTree&&Ql(n.subTree);if(u&&u.type!==pt&&!Qn(u,a)&&hu(n).type!==pt){let f=Ro(u,o,s,n);if(hi(u,f),l==="out-in"&&a.type!==pt)return s.isLeaving=!0,f.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},Jr(r);l==="in-out"&&a.type!==pt?f.delayLeave=(d,p,v)=>{const b=mu(s,u);b[String(u.key)]=u,d[en]=()=>{p(),d[en]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{v(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return r}}};function pu(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==pt){t=n;break}}return t}const eh=Zd;function mu(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function Ro(e,t,n,s,i){const{appear:r,mode:o,persisted:l=!1,onBeforeEnter:a,onEnter:c,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:d,onLeave:p,onAfterLeave:v,onLeaveCancelled:b,onBeforeAppear:I,onAppear:x,onAfterAppear:w,onAppearCancelled:E}=t,T=String(e.key),M=mu(n,e),$=(S,P)=>{S&&zt(S,s,9,P)},G=(S,P)=>{const D=P[1];$(S,P),ie(S)?S.every(F=>F.length<=1)&&D():S.length<=1&&D()},L={mode:o,persisted:l,beforeEnter(S){let P=a;if(!n.isMounted)if(r)P=I||a;else return;S[en]&&S[en](!0);const D=M[T];D&&Qn(e,D)&&D.el[en]&&D.el[en](),$(P,[S])},enter(S){if(M[T]===e)return;let P=c,D=u,F=f;if(!n.isMounted)if(r)P=x||c,D=w||u,F=E||f;else return;let se=!1;S[Ls]=je=>{se||(se=!0,je?$(F,[S]):$(D,[S]),L.delayedLeave&&L.delayedLeave(),S[Ls]=void 0)};const be=S[Ls].bind(null,!1);P?G(P,[S,be]):be()},leave(S,P){const D=String(e.key);if(S[Ls]&&S[Ls](!0),n.isUnmounting)return P();$(d,[S]);let F=!1;S[en]=be=>{F||(F=!0,P(),be?$(b,[S]):$(v,[S]),S[en]=void 0,M[D]===e&&delete M[D])};const se=S[en].bind(null,!1);M[D]=e,p?G(p,[S,se]):se()},clone(S){const P=Ro(S,t,n,s,i);return i&&i(P),P}};return L}function Jr(e){if(Pi(e))return e=jn(e),e.children=null,e}function Ql(e){if(!Pi(e))return uu(e.type)&&e.children?pu(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&ue(n.default))return n.default()}}function hi(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hi(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function gu(e,t=!1,n){let s=[],i=0;for(let r=0;r<e.length;r++){let o=e[r];const l=n==null?o.key:String(n)+String(o.key!=null?o.key:r);o.type===Pt?(o.patchFlag&128&&i++,s=s.concat(gu(o.children,t,l))):(t||o.type!==pt)&&s.push(l!=null?jn(o,{key:l}):o)}if(i>1)for(let r=0;r<s.length;r++)s[r].patchFlag=-2;return s}function Hn(e,t){return ue(e)?Je({name:e.name},t,{setup:e}):e}function hl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Zl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const dr=new WeakMap;function ni(e,t,n,s,i=!1){if(ie(e)){e.forEach((b,I)=>ni(b,t&&(ie(t)?t[I]:t),n,s,i));return}if(ws(s)&&!i){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ni(e,t,n,s.component.subTree);return}const r=s.shapeFlag&4?$r(s.component):s.el,o=i?null:r,{i:l,r:a}=e,c=t&&t.r,u=l.refs===Me?l.refs={}:l.refs,f=l.setupState,d=Te(f),p=f===Me?kc:b=>Zl(u,b)?!1:Se(d,b),v=(b,I)=>!(I&&Zl(u,I));if(c!=null&&c!==a){if(ea(t),Be(c))u[c]=null,p(c)&&(f[c]=null);else if(Ue(c)){const b=t;v(c,b.k)&&(c.value=null),b.k&&(u[b.k]=null)}}if(ue(a))Ci(a,l,12,[o,u]);else{const b=Be(a),I=Ue(a);if(b||I){const x=()=>{if(e.f){const w=b?p(a)?f[a]:u[a]:v()||!e.k?a.value:u[e.k];if(i)ie(w)&&nl(w,r);else if(ie(w))w.includes(r)||w.push(r);else if(b)u[a]=[r],p(a)&&(f[a]=u[a]);else{const E=[r];v(a,e.k)&&(a.value=E),e.k&&(u[e.k]=E)}}else b?(u[a]=o,p(a)&&(f[a]=o)):I&&(v(a,e.k)&&(a.value=o),e.k&&(u[e.k]=o))};if(o){const w=()=>{x(),dr.delete(e)};w.id=-1,dr.set(e,w),ft(w,n)}else ea(e),x()}}}function ea(e){const t=dr.get(e);t&&(t.flags|=8,dr.delete(e))}const ta=e=>e.nodeType===8;Sr().requestIdleCallback;Sr().cancelIdleCallback;function th(e,t){if(ta(e)&&e.data==="["){let n=1,s=e.nextSibling;for(;s;){if(s.nodeType===1){if(t(s)===!1)break}else if(ta(s))if(s.data==="]"){if(--n===0)break}else s.data==="["&&n++;s=s.nextSibling}}else t(e)}const ws=e=>!!e.type.__asyncLoader;function Lv(e){ue(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:s,delay:i=200,hydrate:r,timeout:o,suspensible:l=!0,onError:a}=e;let c=null,u,f=0;const d=()=>(f++,c=null,p()),p=()=>{let v;return c||(v=c=t().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),a)return new Promise((I,x)=>{a(b,()=>I(d()),()=>x(b),f+1)});throw b}).then(b=>v!==c&&c?c:(b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),u=b,b)))};return Hn({name:"AsyncComponentWrapper",__asyncLoader:p,__asyncHydrate(v,b,I){let x=!1;(b.bu||(b.bu=[])).push(()=>x=!0);const w=()=>{x||I()},E=r?()=>{const T=r(w,M=>th(v,M));T&&(b.bum||(b.bum=[])).push(T)}:w;u?E():p().then(()=>!b.isUnmounted&&E())},get __asyncResolved(){return u},setup(){const v=lt;if(hl(v),u)return()=>Fi(u,v);const b=E=>{c=null,Si(E,v,13,!s)};if(l&&v.suspense||Es)return p().then(E=>()=>Fi(E,v)).catch(E=>(b(E),()=>s?Ne(s,{error:E}):null));const I=Q(!1),x=Q(),w=Q(!!i);return i&&setTimeout(()=>{w.value=!1},i),o!=null&&setTimeout(()=>{if(!I.value&&!x.value){const E=new Error(`Async component timed out after ${o}ms.`);b(E),x.value=E}},o),p().then(()=>{I.value=!0,v.parent&&Pi(v.parent.vnode)&&v.parent.update()}).catch(E=>{b(E),x.value=E}),()=>{if(I.value&&u)return Fi(u,v);if(x.value&&s)return Ne(s,{error:x.value});if(n&&!w.value)return Fi(n,v)}}})}function Fi(e,t){const{ref:n,props:s,children:i,ce:r}=t.vnode,o=Ne(e,s,i);return o.ref=n,o.ce=r,delete t.vnode.ce,o}const Pi=e=>e.type.__isKeepAlive;function nh(e,t){yu(e,"a",t)}function sh(e,t){yu(e,"da",t)}function yu(e,t,n=lt){const s=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(Ir(t,s,n),n){let i=n.parent;for(;i&&i.parent;)Pi(i.parent.vnode)&&ih(s,t,n,i),i=i.parent}}function ih(e,t,n,s){const i=Ir(t,e,s,!0);Or(()=>{nl(s[t],i)},n)}function Ir(e,t,n=lt,s=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...o)=>{bn();const l=Ri(n),a=zt(t,n,e,o);return l(),vn(),a});return s?i.unshift(r):i.push(r),r}}const Tn=e=>(t,n=lt)=>{(!Es||e==="sp")&&Ir(e,(...s)=>t(...s),n)},rh=Tn("bm"),is=Tn("m"),oh=Tn("bu"),lh=Tn("u"),Mr=Tn("bum"),Or=Tn("um"),ah=Tn("sp"),ch=Tn("rtg"),uh=Tn("rtc");function fh(e,t=lt){Ir("ec",e,t)}const dh="components";function $v(e,t){return ph(dh,e,!0,t)||e}const hh=Symbol.for("v-ndc");function ph(e,t,n=!0,s=!1){const i=at||lt;if(i){const r=i.type;{const l=Qh(r,!1);if(l&&(l===t||l===Nt(t)||l===kr(Nt(t))))return r}const o=na(i[e]||r[e],t)||na(i.appContext[e],t);return!o&&s?r:o}}function na(e,t){return e&&(e[t]||e[Nt(t)]||e[kr(Nt(t))])}function Dv(e,t,n,s){let i;const r=n,o=ie(e);if(o||Be(e)){const l=o&&gn(e);let a=!1,c=!1;l&&(a=!It(e),c=wn(e),e=Pr(e)),i=new Array(e.length);for(let u=0,f=e.length;u<f;u++)i[u]=t(a?c?Ts(Vt(e[u])):Vt(e[u]):e[u],u,void 0,r)}else if(typeof e=="number"){i=new Array(e);for(let l=0;l<e;l++)i[l]=t(l+1,l,void 0,r)}else if(ke(e))if(e[Symbol.iterator])i=Array.from(e,(l,a)=>t(l,a,void 0,r));else{const l=Object.keys(e);i=new Array(l.length);for(let a=0,c=l.length;a<c;a++){const u=l[a];i[a]=t(e[u],u,a,r)}}else i=[];return i}function Uv(e,t,n={},s,i){if(at.ce||at.parent&&ws(at.parent)&&at.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),de(),Un(Pt,null,[Ne("slot",n,s)],c?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),de();const o=r&&bu(r(n)),l=n.key||o&&o.key,a=Un(Pt,{key:(l&&!Bt(l)?l:`_${t}`)+(!o&&s?"_fb":"")},o||[],o&&e._===1?64:-2);return!i&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),r&&r._c&&(r._d=!0),a}function bu(e){return e.some(t=>mi(t)?!(t.type===pt||t.type===Pt&&!bu(t.children)):!0)?e:null}const Io=e=>e?Uu(e)?$r(e):Io(e.parent):null,si=Je(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Io(e.parent),$root:e=>Io(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>wu(e),$forceUpdate:e=>e.f||(e.f=()=>{fl(e.update)}),$nextTick:e=>e.n||(e.n=ss.bind(e.proxy)),$watch:e=>Xd.bind(e)}),Qr=(e,t)=>e!==Me&&!e.__isScriptSetup&&Se(e,t),mh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:i,props:r,accessCache:o,type:l,appContext:a}=e;if(t[0]!=="$"){const d=o[t];if(d!==void 0)switch(d){case 1:return s[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(Qr(s,t))return o[t]=1,s[t];if(i!==Me&&Se(i,t))return o[t]=2,i[t];if(Se(r,t))return o[t]=3,r[t];if(n!==Me&&Se(n,t))return o[t]=4,n[t];Mo&&(o[t]=0)}}const c=si[t];let u,f;if(c)return t==="$attrs"&&ht(e.attrs,"get",""),c(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==Me&&Se(n,t))return o[t]=4,n[t];if(f=a.config.globalProperties,Se(f,t))return f[t]},set({_:e},t,n){const{data:s,setupState:i,ctx:r}=e;return Qr(i,t)?(i[t]=n,!0):s!==Me&&Se(s,t)?(s[t]=n,!0):Se(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:i,props:r,type:o}},l){let a;return!!(n[l]||e!==Me&&l[0]!=="$"&&Se(e,l)||Qr(t,l)||Se(r,l)||Se(s,l)||Se(si,l)||Se(i.config.globalProperties,l)||(a=o.__cssModules)&&a[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Se(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function sa(e){return ie(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Mo=!0;function gh(e){const t=wu(e),n=e.proxy,s=e.ctx;Mo=!1,t.beforeCreate&&ia(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:o,watch:l,provide:a,inject:c,created:u,beforeMount:f,mounted:d,beforeUpdate:p,updated:v,activated:b,deactivated:I,beforeDestroy:x,beforeUnmount:w,destroyed:E,unmounted:T,render:M,renderTracked:$,renderTriggered:G,errorCaptured:L,serverPrefetch:S,expose:P,inheritAttrs:D,components:F,directives:se,filters:be}=t;if(c&&yh(c,s,null),o)for(const fe in o){const pe=o[fe];ue(pe)&&(s[fe]=pe.bind(n))}if(i){const fe=i.call(n,n);ke(fe)&&(e.data=ki(fe))}if(Mo=!0,r)for(const fe in r){const pe=r[fe],At=ue(pe)?pe.bind(n,n):ue(pe.get)?pe.get.bind(n,n):sn,kt=!ue(pe)&&ue(pe.set)?pe.set.bind(n):sn,Ee=He({get:At,set:kt});Object.defineProperty(s,fe,{enumerable:!0,configurable:!0,get:()=>Ee.value,set:We=>Ee.value=We})}if(l)for(const fe in l)vu(l[fe],s,n,fe);if(a){const fe=ue(a)?a.call(n):a;Reflect.ownKeys(fe).forEach(pe=>{Yi(pe,fe[pe])})}u&&ia(u,e,"c");function Ae(fe,pe){ie(pe)?pe.forEach(At=>fe(At.bind(n))):pe&&fe(pe.bind(n))}if(Ae(rh,f),Ae(is,d),Ae(oh,p),Ae(lh,v),Ae(nh,b),Ae(sh,I),Ae(fh,L),Ae(uh,$),Ae(ch,G),Ae(Mr,w),Ae(Or,T),Ae(ah,S),ie(P))if(P.length){const fe=e.exposed||(e.exposed={});P.forEach(pe=>{Object.defineProperty(fe,pe,{get:()=>n[pe],set:At=>n[pe]=At,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===sn&&(e.render=M),D!=null&&(e.inheritAttrs=D),F&&(e.components=F),se&&(e.directives=se),S&&hl(e)}function yh(e,t,n=sn){ie(e)&&(e=Oo(e));for(const s in e){const i=e[s];let r;ke(i)?"default"in i?r=Ot(i.from||s,i.default,!0):r=Ot(i.from||s):r=Ot(i),Ue(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[s]=r}}function ia(e,t,n){zt(ie(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function vu(e,t,n,s){let i=s.includes(".")?au(n,s):()=>n[s];if(Be(e)){const r=t[e];ue(r)&&Ht(i,r)}else if(ue(e))Ht(i,e.bind(n));else if(ke(e))if(ie(e))e.forEach(r=>vu(r,t,n,s));else{const r=ue(e.handler)?e.handler.bind(n):t[e.handler];ue(r)&&Ht(i,r,e)}}function wu(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,l=r.get(t);let a;return l?a=l:!i.length&&!n&&!s?a=t:(a={},i.length&&i.forEach(c=>hr(a,c,o,!0)),hr(a,t,o)),ke(t)&&r.set(t,a),a}function hr(e,t,n,s=!1){const{mixins:i,extends:r}=t;r&&hr(e,r,n,!0),i&&i.forEach(o=>hr(e,o,n,!0));for(const o in t)if(!(s&&o==="expose")){const l=bh[o]||n&&n[o];e[o]=l?l(e[o],t[o]):t[o]}return e}const bh={data:ra,props:oa,emits:oa,methods:Js,computed:Js,beforeCreate:yt,created:yt,beforeMount:yt,mounted:yt,beforeUpdate:yt,updated:yt,beforeDestroy:yt,beforeUnmount:yt,destroyed:yt,unmounted:yt,activated:yt,deactivated:yt,errorCaptured:yt,serverPrefetch:yt,components:Js,directives:Js,watch:wh,provide:ra,inject:vh};function ra(e,t){return t?e?function(){return Je(ue(e)?e.call(this,this):e,ue(t)?t.call(this,this):t)}:t:e}function vh(e,t){return Js(Oo(e),Oo(t))}function Oo(e){if(ie(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function yt(e,t){return e?[...new Set([].concat(e,t))]:t}function Js(e,t){return e?Je(Object.create(null),e,t):t}function oa(e,t){return e?ie(e)&&ie(t)?[...new Set([...e,...t])]:Je(Object.create(null),sa(e),sa(t??{})):t}function wh(e,t){if(!e)return t;if(!t)return e;const n=Je(Object.create(null),e);for(const s in t)n[s]=yt(e[s],t[s]);return n}function _u(){return{app:null,config:{isNativeTag:kc,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let _h=0;function Th(e,t){return function(s,i=null){ue(s)||(s=Je({},s)),i!=null&&!ke(i)&&(i=null);const r=_u(),o=new WeakSet,l=[];let a=!1;const c=r.app={_uid:_h++,_component:s,_props:i,_container:null,_context:r,_instance:null,version:ep,get config(){return r.config},set config(u){},use(u,...f){return o.has(u)||(u&&ue(u.install)?(o.add(u),u.install(c,...f)):ue(u)&&(o.add(u),u(c,...f))),c},mixin(u){return r.mixins.includes(u)||r.mixins.push(u),c},component(u,f){return f?(r.components[u]=f,c):r.components[u]},directive(u,f){return f?(r.directives[u]=f,c):r.directives[u]},mount(u,f,d){if(!a){const p=c._ceVNode||Ne(s,i);return p.appContext=r,d===!0?d="svg":d===!1&&(d=void 0),e(p,u,d),a=!0,c._container=u,u.__vue_app__=c,$r(p.component)}},onUnmount(u){l.push(u)},unmount(){a&&(zt(l,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(u,f){return r.provides[u]=f,c},runWithContext(u){const f=ns;ns=c;try{return u()}finally{ns=f}}};return c}}let ns=null;const Eh=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Nt(t)}Modifiers`]||e[`${Fn(t)}Modifiers`];function xh(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||Me;let i=n;const r=t.startsWith("update:"),o=r&&Eh(s,t.slice(7));o&&(o.trim&&(i=n.map(u=>Be(u)?u.trim():u)),o.number&&(i=n.map(Cr)));let l,a=s[l=Wr(t)]||s[l=Wr(Nt(t))];!a&&r&&(a=s[l=Wr(Fn(t))]),a&&zt(a,e,6,i);const c=s[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,zt(c,e,6,i)}}const Ah=new WeakMap;function Tu(e,t,n=!1){const s=n?Ah:t.emitsCache,i=s.get(e);if(i!==void 0)return i;const r=e.emits;let o={},l=!1;if(!ue(e)){const a=c=>{const u=Tu(c,t,!0);u&&(l=!0,Je(o,u))};!n&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!r&&!l?(ke(e)&&s.set(e,null),null):(ie(r)?r.forEach(a=>o[a]=null):Je(o,r),ke(e)&&s.set(e,o),o)}function Nr(e,t){return!e||!Er(t)?!1:(t=t.slice(2).replace(/Once$/,""),Se(e,t[0].toLowerCase()+t.slice(1))||Se(e,Fn(t))||Se(e,t))}function la(e){const{type:t,vnode:n,proxy:s,withProxy:i,propsOptions:[r],slots:o,attrs:l,emit:a,render:c,renderCache:u,props:f,data:d,setupState:p,ctx:v,inheritAttrs:b}=e,I=fr(e);let x,w;try{if(n.shapeFlag&4){const T=i||s,M=T;x=tn(c.call(M,T,u,f,p,d,v)),w=l}else{const T=t;x=tn(T.length>1?T(f,{attrs:l,slots:o,emit:a}):T(f,null)),w=t.props?l:kh(l)}}catch(T){ii.length=0,Si(T,e,1),x=Ne(pt)}let E=x;if(w&&b!==!1){const T=Object.keys(w),{shapeFlag:M}=E;T.length&&M&7&&(r&&T.some(tl)&&(w=Ch(w,r)),E=jn(E,w,!1,!0))}return n.dirs&&(E=jn(E,null,!1,!0),E.dirs=E.dirs?E.dirs.concat(n.dirs):n.dirs),n.transition&&hi(E,n.transition),x=E,fr(I),x}const kh=e=>{let t;for(const n in e)(n==="class"||n==="style"||Er(n))&&((t||(t={}))[n]=e[n]);return t},Ch=(e,t)=>{const n={};for(const s in e)(!tl(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Sh(e,t,n){const{props:s,children:i,component:r}=e,{props:o,children:l,patchFlag:a}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&a>=0){if(a&1024)return!0;if(a&16)return s?aa(s,o,c):!!o;if(a&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const d=u[f];if(Eu(o,s,d)&&!Nr(c,d))return!0}}}else return(i||l)&&(!l||!l.$stable)?!0:s===o?!1:s?o?aa(s,o,c):!0:!!o;return!1}function aa(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let i=0;i<s.length;i++){const r=s[i];if(Eu(t,e,r)&&!Nr(n,r))return!0}return!1}function Eu(e,t,n){const s=e[n],i=t[n];return n==="style"&&ke(s)&&ke(i)?!Is(s,i):s!==i}function Ph({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s===e)(e=t.vnode).el=n,t=t.parent;else break}}const xu={},Au=()=>Object.create(xu),ku=e=>Object.getPrototypeOf(e)===xu;function Rh(e,t,n,s=!1){const i={},r=Au();e.propsDefaults=Object.create(null),Cu(e,t,i,r);for(const o in e.propsOptions[0])o in i||(i[o]=void 0);n?e.props=s?i:Jc(i):e.type.props?e.props=i:e.props=r,e.attrs=r}function Ih(e,t,n,s){const{props:i,attrs:r,vnode:{patchFlag:o}}=e,l=Te(i),[a]=e.propsOptions;let c=!1;if((s||o>0)&&!(o&16)){if(o&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let d=u[f];if(Nr(e.emitsOptions,d))continue;const p=t[d];if(a)if(Se(r,d))p!==r[d]&&(r[d]=p,c=!0);else{const v=Nt(d);i[v]=No(a,l,v,p,e,!1)}else p!==r[d]&&(r[d]=p,c=!0)}}}else{Cu(e,t,i,r)&&(c=!0);let u;for(const f in l)(!t||!Se(t,f)&&((u=Fn(f))===f||!Se(t,u)))&&(a?n&&(n[f]!==void 0||n[u]!==void 0)&&(i[f]=No(a,l,f,void 0,e,!0)):delete i[f]);if(r!==l)for(const f in r)(!t||!Se(t,f))&&(delete r[f],c=!0)}c&&hn(e.attrs,"set","")}function Cu(e,t,n,s){const[i,r]=e.propsOptions;let o=!1,l;if(t)for(let a in t){if(Qs(a))continue;const c=t[a];let u;i&&Se(i,u=Nt(a))?!r||!r.includes(u)?n[u]=c:(l||(l={}))[u]=c:Nr(e.emitsOptions,a)||(!(a in s)||c!==s[a])&&(s[a]=c,o=!0)}if(r){const a=Te(n),c=l||Me;for(let u=0;u<r.length;u++){const f=r[u];n[f]=No(i,a,f,c[f],e,!Se(c,f))}}return o}function No(e,t,n,s,i,r){const o=e[n];if(o!=null){const l=Se(o,"default");if(l&&s===void 0){const a=o.default;if(o.type!==Function&&!o.skipFactory&&ue(a)){const{propsDefaults:c}=i;if(n in c)s=c[n];else{const u=Ri(i);s=c[n]=a.call(null,t),u()}}else s=a;i.ce&&i.ce._setProp(n,s)}o[0]&&(r&&!l?s=!1:o[1]&&(s===""||s===Fn(n))&&(s=!0))}return s}const Mh=new WeakMap;function Su(e,t,n=!1){const s=n?Mh:t.propsCache,i=s.get(e);if(i)return i;const r=e.props,o={},l=[];let a=!1;if(!ue(e)){const u=f=>{a=!0;const[d,p]=Su(f,t,!0);Je(o,d),p&&l.push(...p)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!r&&!a)return ke(e)&&s.set(e,ys),ys;if(ie(r))for(let u=0;u<r.length;u++){const f=Nt(r[u]);ca(f)&&(o[f]=Me)}else if(r)for(const u in r){const f=Nt(u);if(ca(f)){const d=r[u],p=o[f]=ie(d)||ue(d)?{type:d}:Je({},d),v=p.type;let b=!1,I=!0;if(ie(v))for(let x=0;x<v.length;++x){const w=v[x],E=ue(w)&&w.name;if(E==="Boolean"){b=!0;break}else E==="String"&&(I=!1)}else b=ue(v)&&v.name==="Boolean";p[0]=b,p[1]=I,(b||Se(p,"default"))&&l.push(f)}}const c=[o,l];return ke(e)&&s.set(e,c),c}function ca(e){return e[0]!=="$"&&!Qs(e)}const pl=e=>e==="_"||e==="_ctx"||e==="$stable",ml=e=>ie(e)?e.map(tn):[tn(e)],Oh=(e,t,n)=>{if(t._n)return t;const s=di((...i)=>ml(t(...i)),n);return s._c=!1,s},Pu=(e,t,n)=>{const s=e._ctx;for(const i in e){if(pl(i))continue;const r=e[i];if(ue(r))t[i]=Oh(i,r,s);else if(r!=null){const o=ml(r);t[i]=()=>o}}},Ru=(e,t)=>{const n=ml(t);e.slots.default=()=>n},Iu=(e,t,n)=>{for(const s in t)(n||!pl(s))&&(e[s]=t[s])},Nh=(e,t,n)=>{const s=e.slots=Au();if(e.vnode.shapeFlag&32){const i=t._;i?(Iu(s,t,n),n&&Rc(s,"_",i,!0)):Pu(t,s)}else t&&Ru(e,t)},Lh=(e,t,n)=>{const{vnode:s,slots:i}=e;let r=!0,o=Me;if(s.shapeFlag&32){const l=t._;l?n&&l===1?r=!1:Iu(i,t,n):(r=!t.$stable,Pu(t,i)),o=t}else t&&(Ru(e,t),o={default:1});if(r)for(const l in i)!pl(l)&&o[l]==null&&delete i[l]},ft=Fh;function $h(e){return Dh(e)}function Dh(e,t){const n=Sr();n.__VUE__=!0;const{insert:s,remove:i,patchProp:r,createElement:o,createText:l,createComment:a,setText:c,setElementText:u,parentNode:f,nextSibling:d,setScopeId:p=sn,insertStaticContent:v}=e,b=(m,g,_,A=null,O=null,R=null,B=void 0,H=null,j=!!g.dynamicChildren)=>{if(m===g)return;m&&!Qn(m,g)&&(A=C(m),We(m,O,R,!0),m=null),g.patchFlag===-2&&(j=!1,g.dynamicChildren=null);const{type:N,ref:re,shapeFlag:Y}=g;switch(N){case Lr:I(m,g,_,A);break;case pt:x(m,g,_,A);break;case Ji:m==null&&w(g,_,A,B);break;case Pt:F(m,g,_,A,O,R,B,H,j);break;default:Y&1?M(m,g,_,A,O,R,B,H,j):Y&6?se(m,g,_,A,O,R,B,H,j):(Y&64||Y&128)&&N.process(m,g,_,A,O,R,B,H,j,ee)}re!=null&&O?ni(re,m&&m.ref,R,g||m,!g):re==null&&m&&m.ref!=null&&ni(m.ref,null,R,m,!0)},I=(m,g,_,A)=>{if(m==null)s(g.el=l(g.children),_,A);else{const O=g.el=m.el;g.children!==m.children&&c(O,g.children)}},x=(m,g,_,A)=>{m==null?s(g.el=a(g.children||""),_,A):g.el=m.el},w=(m,g,_,A)=>{[m.el,m.anchor]=v(m.children,g,_,A,m.el,m.anchor)},E=({el:m,anchor:g},_,A)=>{let O;for(;m&&m!==g;)O=d(m),s(m,_,A),m=O;s(g,_,A)},T=({el:m,anchor:g})=>{let _;for(;m&&m!==g;)_=d(m),i(m),m=_;i(g)},M=(m,g,_,A,O,R,B,H,j)=>{if(g.type==="svg"?B="svg":g.type==="math"&&(B="mathml"),m==null)$(g,_,A,O,R,B,H,j);else{const N=m.el&&m.el._isVueCE?m.el:null;try{N&&N._beginPatch(),S(m,g,O,R,B,H,j)}finally{N&&N._endPatch()}}},$=(m,g,_,A,O,R,B,H)=>{let j,N;const{props:re,shapeFlag:Y,transition:te,dirs:oe}=m;if(j=m.el=o(m.type,R,re&&re.is,re),Y&8?u(j,m.children):Y&16&&L(m.children,j,null,A,O,Zr(m,R),B,H),oe&&zn(m,null,A,"created"),G(j,m,m.scopeId,B,A),re){for(const ye in re)ye!=="value"&&!Qs(ye)&&r(j,ye,null,re[ye],R,A);"value"in re&&r(j,"value",null,re.value,R),(N=re.onVnodeBeforeMount)&&Gt(N,A,m)}oe&&zn(m,null,A,"beforeMount");const he=Uh(O,te);he&&te.beforeEnter(j),s(j,g,_),((N=re&&re.onVnodeMounted)||he||oe)&&ft(()=>{N&&Gt(N,A,m),he&&te.enter(j),oe&&zn(m,null,A,"mounted")},O)},G=(m,g,_,A,O)=>{if(_&&p(m,_),A)for(let R=0;R<A.length;R++)p(m,A[R]);if(O){let R=O.subTree;if(g===R||Nu(R.type)&&(R.ssContent===g||R.ssFallback===g)){const B=O.vnode;G(m,B,B.scopeId,B.slotScopeIds,O.parent)}}},L=(m,g,_,A,O,R,B,H,j=0)=>{for(let N=j;N<m.length;N++){const re=m[N]=H?fn(m[N]):tn(m[N]);b(null,re,g,_,A,O,R,B,H)}},S=(m,g,_,A,O,R,B)=>{const H=g.el=m.el;let{patchFlag:j,dynamicChildren:N,dirs:re}=g;j|=m.patchFlag&16;const Y=m.props||Me,te=g.props||Me;let oe;if(_&&qn(_,!1),(oe=te.onVnodeBeforeUpdate)&&Gt(oe,_,g,m),re&&zn(g,m,_,"beforeUpdate"),_&&qn(_,!0),(Y.innerHTML&&te.innerHTML==null||Y.textContent&&te.textContent==null)&&u(H,""),N?P(m.dynamicChildren,N,H,_,A,Zr(g,O),R):B||pe(m,g,H,null,_,A,Zr(g,O),R,!1),j>0){if(j&16)D(H,Y,te,_,O);else if(j&2&&Y.class!==te.class&&r(H,"class",null,te.class,O),j&4&&r(H,"style",Y.style,te.style,O),j&8){const he=g.dynamicProps;for(let ye=0;ye<he.length;ye++){const we=he[ye],nt=Y[we],st=te[we];(st!==nt||we==="value")&&r(H,we,nt,st,O,_)}}j&1&&m.children!==g.children&&u(H,g.children)}else!B&&N==null&&D(H,Y,te,_,O);((oe=te.onVnodeUpdated)||re)&&ft(()=>{oe&&Gt(oe,_,g,m),re&&zn(g,m,_,"updated")},A)},P=(m,g,_,A,O,R,B)=>{for(let H=0;H<g.length;H++){const j=m[H],N=g[H],re=j.el&&(j.type===Pt||!Qn(j,N)||j.shapeFlag&198)?f(j.el):_;b(j,N,re,null,A,O,R,B,!0)}},D=(m,g,_,A,O)=>{if(g!==_){if(g!==Me)for(const R in g)!Qs(R)&&!(R in _)&&r(m,R,g[R],null,O,A);for(const R in _){if(Qs(R))continue;const B=_[R],H=g[R];B!==H&&R!=="value"&&r(m,R,H,B,O,A)}"value"in _&&r(m,"value",g.value,_.value,O)}},F=(m,g,_,A,O,R,B,H,j)=>{const N=g.el=m?m.el:l(""),re=g.anchor=m?m.anchor:l("");let{patchFlag:Y,dynamicChildren:te,slotScopeIds:oe}=g;oe&&(H=H?H.concat(oe):oe),m==null?(s(N,_,A),s(re,_,A),L(g.children||[],_,re,O,R,B,H,j)):Y>0&&Y&64&&te&&m.dynamicChildren&&m.dynamicChildren.length===te.length?(P(m.dynamicChildren,te,_,O,R,B,H),(g.key!=null||O&&g===O.subTree)&&gl(m,g,!0)):pe(m,g,_,re,O,R,B,H,j)},se=(m,g,_,A,O,R,B,H,j)=>{g.slotScopeIds=H,m==null?g.shapeFlag&512?O.ctx.activate(g,_,A,B,j):be(g,_,A,O,R,B,j):je(m,g,j)},be=(m,g,_,A,O,R,B)=>{const H=m.component=Kh(m,A,O);if(Pi(m)&&(H.ctx.renderer=ee),Gh(H,!1,B),H.asyncDep){if(O&&O.registerDep(H,Ae,B),!m.el){const j=H.subTree=Ne(pt);x(null,j,g,_),m.placeholder=j.el}}else Ae(H,m,g,_,O,R,B)},je=(m,g,_)=>{const A=g.component=m.component;if(Sh(m,g,_))if(A.asyncDep&&!A.asyncResolved){fe(A,g,_);return}else A.next=g,A.update();else g.el=m.el,A.vnode=g},Ae=(m,g,_,A,O,R,B)=>{const H=()=>{if(m.isMounted){let{next:Y,bu:te,u:oe,parent:he,vnode:ye}=m;{const Ct=Mu(m);if(Ct){Y&&(Y.el=ye.el,fe(m,Y,B)),Ct.asyncDep.then(()=>{ft(()=>{m.isUnmounted||N()},O)});return}}let we=Y,nt;qn(m,!1),Y?(Y.el=ye.el,fe(m,Y,B)):Y=ye,te&&Gi(te),(nt=Y.props&&Y.props.onVnodeBeforeUpdate)&&Gt(nt,he,Y,ye),qn(m,!0);const st=la(m),Tt=m.subTree;m.subTree=st,b(Tt,st,f(Tt.el),C(Tt),m,O,R),Y.el=st.el,we===null&&Ph(m,st.el),oe&&ft(oe,O),(nt=Y.props&&Y.props.onVnodeUpdated)&&ft(()=>Gt(nt,he,Y,ye),O)}else{let Y;const{el:te,props:oe}=g,{bm:he,m:ye,parent:we,root:nt,type:st}=m,Tt=ws(g);qn(m,!1),he&&Gi(he),!Tt&&(Y=oe&&oe.onVnodeBeforeMount)&&Gt(Y,we,g),qn(m,!0);{nt.ce&&nt.ce._hasShadowRoot()&&nt.ce._injectChildStyle(st);const Ct=m.subTree=la(m);b(null,Ct,_,A,m,O,R),g.el=Ct.el}if(ye&&ft(ye,O),!Tt&&(Y=oe&&oe.onVnodeMounted)){const Ct=g;ft(()=>Gt(Y,we,Ct),O)}(g.shapeFlag&256||we&&ws(we.vnode)&&we.vnode.shapeFlag&256)&&m.a&&ft(m.a,O),m.isMounted=!0,g=_=A=null}};m.scope.on();const j=m.effect=new Dc(H);m.scope.off();const N=m.update=j.run.bind(j),re=m.job=j.runIfDirty.bind(j);re.i=m,re.id=m.uid,j.scheduler=()=>fl(re),qn(m,!0),N()},fe=(m,g,_)=>{g.component=m;const A=m.vnode.props;m.vnode=g,m.next=null,Ih(m,g.props,A,_),Lh(m,g.children,_),bn(),Kl(m),vn()},pe=(m,g,_,A,O,R,B,H,j=!1)=>{const N=m&&m.children,re=m?m.shapeFlag:0,Y=g.children,{patchFlag:te,shapeFlag:oe}=g;if(te>0){if(te&128){kt(N,Y,_,A,O,R,B,H,j);return}else if(te&256){At(N,Y,_,A,O,R,B,H,j);return}}oe&8?(re&16&&Re(N,O,R),Y!==N&&u(_,Y)):re&16?oe&16?kt(N,Y,_,A,O,R,B,H,j):Re(N,O,R,!0):(re&8&&u(_,""),oe&16&&L(Y,_,A,O,R,B,H,j))},At=(m,g,_,A,O,R,B,H,j)=>{m=m||ys,g=g||ys;const N=m.length,re=g.length,Y=Math.min(N,re);let te;for(te=0;te<Y;te++){const oe=g[te]=j?fn(g[te]):tn(g[te]);b(m[te],oe,_,null,O,R,B,H,j)}N>re?Re(m,O,R,!0,!1,Y):L(g,_,A,O,R,B,H,j,Y)},kt=(m,g,_,A,O,R,B,H,j)=>{let N=0;const re=g.length;let Y=m.length-1,te=re-1;for(;N<=Y&&N<=te;){const oe=m[N],he=g[N]=j?fn(g[N]):tn(g[N]);if(Qn(oe,he))b(oe,he,_,null,O,R,B,H,j);else break;N++}for(;N<=Y&&N<=te;){const oe=m[Y],he=g[te]=j?fn(g[te]):tn(g[te]);if(Qn(oe,he))b(oe,he,_,null,O,R,B,H,j);else break;Y--,te--}if(N>Y){if(N<=te){const oe=te+1,he=oe<re?g[oe].el:A;for(;N<=te;)b(null,g[N]=j?fn(g[N]):tn(g[N]),_,he,O,R,B,H,j),N++}}else if(N>te)for(;N<=Y;)We(m[N],O,R,!0),N++;else{const oe=N,he=N,ye=new Map;for(N=he;N<=te;N++){const $e=g[N]=j?fn(g[N]):tn(g[N]);$e.key!=null&&ye.set($e.key,N)}let we,nt=0;const st=te-he+1;let Tt=!1,Ct=0;const Wt=new Array(st);for(N=0;N<st;N++)Wt[N]=0;for(N=oe;N<=Y;N++){const $e=m[N];if(nt>=st){We($e,O,R,!0);continue}let it;if($e.key!=null)it=ye.get($e.key);else for(we=he;we<=te;we++)if(Wt[we-he]===0&&Qn($e,g[we])){it=we;break}it===void 0?We($e,O,R,!0):(Wt[it-he]=N+1,it>=Ct?Ct=it:Tt=!0,b($e,g[it],_,null,O,R,B,H,j),nt++)}const Bn=Tt?jh(Wt):ys;for(we=Bn.length-1,N=st-1;N>=0;N--){const $e=he+N,it=g[$e],rs=g[$e+1],os=$e+1<re?rs.el||Ou(rs):A;Wt[N]===0?b(null,it,_,os,O,R,B,H,j):Tt&&(we<0||N!==Bn[we]?Ee(it,_,os,2):we--)}}},Ee=(m,g,_,A,O=null)=>{const{el:R,type:B,transition:H,children:j,shapeFlag:N}=m;if(N&6){Ee(m.component.subTree,g,_,A);return}if(N&128){m.suspense.move(g,_,A);return}if(N&64){B.move(m,g,_,ee);return}if(B===Pt){s(R,g,_);for(let Y=0;Y<j.length;Y++)Ee(j[Y],g,_,A);s(m.anchor,g,_);return}if(B===Ji){E(m,g,_);return}if(A!==2&&N&1&&H)if(A===0)H.beforeEnter(R),s(R,g,_),ft(()=>H.enter(R),O);else{const{leave:Y,delayLeave:te,afterLeave:oe}=H,he=()=>{m.ctx.isUnmounted?i(R):s(R,g,_)},ye=()=>{R._isLeaving&&R[en](!0),Y(R,()=>{he(),oe&&oe()})};te?te(R,he,ye):ye()}else s(R,g,_)},We=(m,g,_,A=!1,O=!1)=>{const{type:R,props:B,ref:H,children:j,dynamicChildren:N,shapeFlag:re,patchFlag:Y,dirs:te,cacheIndex:oe}=m;if(Y===-2&&(O=!1),H!=null&&(bn(),ni(H,null,_,m,!0),vn()),oe!=null&&(g.renderCache[oe]=void 0),re&256){g.ctx.deactivate(m);return}const he=re&1&&te,ye=!ws(m);let we;if(ye&&(we=B&&B.onVnodeBeforeUnmount)&&Gt(we,g,m),re&6)ce(m.component,_,A);else{if(re&128){m.suspense.unmount(_,A);return}he&&zn(m,null,g,"beforeUnmount"),re&64?m.type.remove(m,g,_,ee,A):N&&!N.hasOnce&&(R!==Pt||Y>0&&Y&64)?Re(N,g,_,!1,!0):(R===Pt&&Y&384||!O&&re&16)&&Re(j,g,_),A&&X(m)}(ye&&(we=B&&B.onVnodeUnmounted)||he)&&ft(()=>{we&&Gt(we,g,m),he&&zn(m,null,g,"unmounted")},_)},X=m=>{const{type:g,el:_,anchor:A,transition:O}=m;if(g===Pt){J(_,A);return}if(g===Ji){T(m);return}const R=()=>{i(_),O&&!O.persisted&&O.afterLeave&&O.afterLeave()};if(m.shapeFlag&1&&O&&!O.persisted){const{leave:B,delayLeave:H}=O,j=()=>B(_,R);H?H(m.el,R,j):j()}else R()},J=(m,g)=>{let _;for(;m!==g;)_=d(m),i(m),m=_;i(g)},ce=(m,g,_)=>{const{bum:A,scope:O,job:R,subTree:B,um:H,m:j,a:N}=m;ua(j),ua(N),A&&Gi(A),O.stop(),R&&(R.flags|=8,We(B,m,g,_)),H&&ft(H,g),ft(()=>{m.isUnmounted=!0},g)},Re=(m,g,_,A=!1,O=!1,R=0)=>{for(let B=R;B<m.length;B++)We(m[B],g,_,A,O)},C=m=>{if(m.shapeFlag&6)return C(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const g=d(m.anchor||m.el),_=g&&g[cu];return _?d(_):g};let q=!1;const W=(m,g,_)=>{let A;m==null?g._vnode&&(We(g._vnode,null,null,!0),A=g._vnode.component):b(g._vnode||null,m,g,null,null,null,_),g._vnode=m,q||(q=!0,Kl(A),iu(),q=!1)},ee={p:b,um:We,m:Ee,r:X,mt:be,mc:L,pc:pe,pbc:P,n:C,o:e};return{render:W,hydrate:void 0,createApp:Th(W)}}function Zr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function qn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Uh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function gl(e,t,n=!1){const s=e.children,i=t.children;if(ie(s)&&ie(i))for(let r=0;r<s.length;r++){const o=s[r];let l=i[r];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=i[r]=fn(i[r]),l.el=o.el),!n&&l.patchFlag!==-2&&gl(o,l)),l.type===Lr&&(l.patchFlag===-1&&(l=i[r]=fn(l)),l.el=o.el),l.type===pt&&!l.el&&(l.el=o.el)}}function jh(e){const t=e.slice(),n=[0];let s,i,r,o,l;const a=e.length;for(s=0;s<a;s++){const c=e[s];if(c!==0){if(i=n[n.length-1],e[i]<c){t[s]=i,n.push(s);continue}for(r=0,o=n.length-1;r<o;)l=r+o>>1,e[n[l]]<c?r=l+1:o=l;c<e[n[r]]&&(r>0&&(t[s]=n[r-1]),n[r]=s)}}for(r=n.length,o=n[r-1];r-- >0;)n[r]=o,o=t[o];return n}function Mu(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Mu(t)}function ua(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Ou(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Ou(t.subTree):null}const Nu=e=>e.__isSuspense;function Fh(e,t){t&&t.pendingBranch?ie(e)?t.effects.push(...e):t.effects.push(e):Wd(e)}const Pt=Symbol.for("v-fgt"),Lr=Symbol.for("v-txt"),pt=Symbol.for("v-cmt"),Ji=Symbol.for("v-stc"),ii=[];let Rt=null;function de(e=!1){ii.push(Rt=e?null:[])}function Hh(){ii.pop(),Rt=ii[ii.length-1]||null}let pi=1;function pr(e,t=!1){pi+=e,e<0&&Rt&&t&&(Rt.hasOnce=!0)}function Lu(e){return e.dynamicChildren=pi>0?Rt||ys:null,Hh(),pi>0&&Rt&&Rt.push(e),e}function ve(e,t,n,s,i,r){return Lu(k(e,t,n,s,i,r,!0))}function Un(e,t,n,s,i){return Lu(Ne(e,t,n,s,i,!0))}function mi(e){return e?e.__v_isVNode===!0:!1}function Qn(e,t){return e.type===t.type&&e.key===t.key}const $u=({key:e})=>e??null,Qi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Be(e)||Ue(e)||ue(e)?{i:at,r:e,k:t,f:!!n}:e:null);function k(e,t=null,n=null,s=0,i=null,r=e===Pt?0:1,o=!1,l=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&$u(t),ref:t&&Qi(t),scopeId:ou,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:at};return l?(yl(a,n),r&128&&e.normalize(a)):n&&(a.shapeFlag|=Be(n)?8:16),pi>0&&!o&&Rt&&(a.patchFlag>0||r&6)&&a.patchFlag!==32&&Rt.push(a),a}const Ne=Bh;function Bh(e,t=null,n=null,s=0,i=null,r=!1){if((!e||e===hh)&&(e=pt),mi(e)){const l=jn(e,t,!0);return n&&yl(l,n),pi>0&&!r&&Rt&&(l.shapeFlag&6?Rt[Rt.indexOf(e)]=l:Rt.push(l)),l.patchFlag=-2,l}if(Zh(e)&&(e=e.__vccOpts),t){t=Vh(t);let{class:l,style:a}=t;l&&!Be(l)&&(t.class=qe(l)),ke(a)&&(Rr(a)&&!ie(a)&&(a=Je({},a)),t.style=Dn(a))}const o=Be(e)?1:Nu(e)?128:uu(e)?64:ke(e)?4:ue(e)?2:0;return k(e,t,n,s,i,o,r,!0)}function Vh(e){return e?Rr(e)||ku(e)?Je({},e):e:null}function jn(e,t,n=!1,s=!1){const{props:i,ref:r,patchFlag:o,children:l,transition:a}=e,c=t?zh(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&$u(c),ref:t&&t.ref?n&&r?ie(r)?r.concat(Qi(t)):[r,Qi(t)]:Qi(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Pt?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&jn(e.ssContent),ssFallback:e.ssFallback&&jn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&s&&hi(u,a.clone(u)),u}function Du(e=" ",t=0){return Ne(Lr,null,e,t)}function jv(e,t){const n=Ne(Ji,null,e);return n.staticCount=t,n}function mt(e="",t=!1){return t?(de(),Un(pt,null,e)):Ne(pt,null,e)}function tn(e){return e==null||typeof e=="boolean"?Ne(pt):ie(e)?Ne(Pt,null,e.slice()):mi(e)?fn(e):Ne(Lr,null,String(e))}function fn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:jn(e)}function yl(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(ie(t))n=16;else if(typeof t=="object")if(s&65){const i=t.default;i&&(i._c&&(i._d=!1),yl(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!ku(t)?t._ctx=at:i===3&&at&&(at.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ue(t)?(t={default:t,_ctx:at},n=32):(t=String(t),s&64?(n=16,t=[Du(t)]):n=8);e.children=t,e.shapeFlag|=n}function zh(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const i in s)if(i==="class")t.class!==s.class&&(t.class=qe([t.class,s.class]));else if(i==="style")t.style=Dn([t.style,s.style]);else if(Er(i)){const r=t[i],o=s[i];o&&r!==o&&!(ie(r)&&r.includes(o))&&(t[i]=r?[].concat(r,o):o)}else i!==""&&(t[i]=s[i])}return t}function Gt(e,t,n,s=null){zt(e,t,7,[n,s])}const qh=_u();let Wh=0;function Kh(e,t,n){const s=e.type,i=(t?t.appContext:e.appContext)||qh,r={uid:Wh++,vnode:e,type:s,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Nc(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Su(s,i),emitsOptions:Tu(s,i),emit:null,emitted:null,propsDefaults:Me,inheritAttrs:s.inheritAttrs,ctx:Me,data:Me,props:Me,attrs:Me,slots:Me,refs:Me,setupState:Me,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=xh.bind(null,r),e.ce&&e.ce(r),r}let lt=null;const bl=()=>lt||at;let mr,Lo;{const e=Sr(),t=(n,s)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(s),r=>{i.length>1?i.forEach(o=>o(r)):i[0](r)}};mr=t("__VUE_INSTANCE_SETTERS__",n=>lt=n),Lo=t("__VUE_SSR_SETTERS__",n=>Es=n)}const Ri=e=>{const t=lt;return mr(e),e.scope.on(),()=>{e.scope.off(),mr(t)}},fa=()=>{lt&<.scope.off(),mr(null)};function Uu(e){return e.vnode.shapeFlag&4}let Es=!1;function Gh(e,t=!1,n=!1){t&&Lo(t);const{props:s,children:i}=e.vnode,r=Uu(e);Rh(e,s,r,t),Nh(e,i,n||t);const o=r?Yh(e,t):void 0;return t&&Lo(!1),o}function Yh(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,mh);const{setup:s}=n;if(s){bn();const i=e.setupContext=s.length>1?Jh(e):null,r=Ri(e),o=Ci(s,e,0,[e.props,i]),l=Cc(o);if(vn(),r(),(l||e.sp)&&!ws(e)&&hl(e),l){if(o.then(fa,fa),t)return o.then(a=>{da(e,a)}).catch(a=>{Si(a,e,0)});e.asyncDep=o}else da(e,o)}else ju(e)}function da(e,t,n){ue(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ke(t)&&(e.setupState=eu(t)),ju(e)}function ju(e,t,n){const s=e.type;e.render||(e.render=s.render||sn);{const i=Ri(e);bn();try{gh(e)}finally{vn(),i()}}}const Xh={get(e,t){return ht(e,"get",""),e[t]}};function Jh(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Xh),slots:e.slots,emit:e.emit,expose:t}}function $r(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(eu(ul(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in si)return si[n](e)},has(t,n){return n in t||n in si}})):e.proxy}function Qh(e,t=!0){return ue(e)?e.displayName||e.name:e.name||t&&e.__name}function Zh(e){return ue(e)&&"__vccOpts"in e}const He=(e,t)=>Hd(e,t,Es);function vl(e,t,n){try{pr(-1);const s=arguments.length;return s===2?ke(t)&&!ie(t)?mi(t)?Ne(e,null,[t]):Ne(e,t):Ne(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&mi(n)&&(n=[n]),Ne(e,t,n))}finally{pr(1)}}const ep="3.5.29";let $o;const ha=typeof window<"u"&&window.trustedTypes;if(ha)try{$o=ha.createPolicy("vue",{createHTML:e=>e})}catch{}const Fu=$o?e=>$o.createHTML(e):e=>e,tp="http://www.w3.org/2000/svg",np="http://www.w3.org/1998/Math/MathML",un=typeof document<"u"?document:null,pa=un&&un.createElement("template"),sp={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const i=t==="svg"?un.createElementNS(tp,e):t==="mathml"?un.createElementNS(np,e):n?un.createElement(e,{is:n}):un.createElement(e);return e==="select"&&s&&s.multiple!=null&&i.setAttribute("multiple",s.multiple),i},createText:e=>un.createTextNode(e),createComment:e=>un.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>un.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,i,r){const o=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{pa.innerHTML=Fu(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const l=pa.content;if(s==="svg"||s==="mathml"){const a=l.firstChild;for(;a.firstChild;)l.appendChild(a.firstChild);l.removeChild(a)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},En="transition",$s="animation",gi=Symbol("_vtc"),Hu={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ip=Je({},du,Hu),rp=e=>(e.displayName="Transition",e.props=ip,e),gr=rp((e,{slots:t})=>vl(eh,op(e),t)),Wn=(e,t=[])=>{ie(e)?e.forEach(n=>n(...t)):e&&e(...t)},ma=e=>e?ie(e)?e.some(t=>t.length>1):e.length>1:!1;function op(e){const t={};for(const F in e)F in Hu||(t[F]=e[F]);if(e.css===!1)return t;const{name:n="v",type:s,duration:i,enterFromClass:r=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:a=r,appearActiveClass:c=o,appearToClass:u=l,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:d=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,v=lp(i),b=v&&v[0],I=v&&v[1],{onBeforeEnter:x,onEnter:w,onEnterCancelled:E,onLeave:T,onLeaveCancelled:M,onBeforeAppear:$=x,onAppear:G=w,onAppearCancelled:L=E}=t,S=(F,se,be,je)=>{F._enterCancelled=je,Kn(F,se?u:l),Kn(F,se?c:o),be&&be()},P=(F,se)=>{F._isLeaving=!1,Kn(F,f),Kn(F,p),Kn(F,d),se&&se()},D=F=>(se,be)=>{const je=F?G:w,Ae=()=>S(se,F,be);Wn(je,[se,Ae]),ga(()=>{Kn(se,F?a:r),an(se,F?u:l),ma(je)||ya(se,s,b,Ae)})};return Je(t,{onBeforeEnter(F){Wn(x,[F]),an(F,r),an(F,o)},onBeforeAppear(F){Wn($,[F]),an(F,a),an(F,c)},onEnter:D(!1),onAppear:D(!0),onLeave(F,se){F._isLeaving=!0;const be=()=>P(F,se);an(F,f),F._enterCancelled?(an(F,d),wa(F)):(wa(F),an(F,d)),ga(()=>{F._isLeaving&&(Kn(F,f),an(F,p),ma(T)||ya(F,s,I,be))}),Wn(T,[F,be])},onEnterCancelled(F){S(F,!1,void 0,!0),Wn(E,[F])},onAppearCancelled(F){S(F,!0,void 0,!0),Wn(L,[F])},onLeaveCancelled(F){P(F),Wn(M,[F])}})}function lp(e){if(e==null)return null;if(ke(e))return[eo(e.enter),eo(e.leave)];{const t=eo(e);return[t,t]}}function eo(e){return ld(e)}function an(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[gi]||(e[gi]=new Set)).add(t)}function Kn(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[gi];n&&(n.delete(t),n.size||(e[gi]=void 0))}function ga(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ap=0;function ya(e,t,n,s){const i=e._endId=++ap,r=()=>{i===e._endId&&s()};if(n!=null)return setTimeout(r,n);const{type:o,timeout:l,propCount:a}=cp(e,t);if(!o)return s();const c=o+"end";let u=0;const f=()=>{e.removeEventListener(c,d),r()},d=p=>{p.target===e&&++u>=a&&f()};setTimeout(()=>{u<a&&f()},l+1),e.addEventListener(c,d)}function cp(e,t){const n=window.getComputedStyle(e),s=v=>(n[v]||"").split(", "),i=s(`${En}Delay`),r=s(`${En}Duration`),o=ba(i,r),l=s(`${$s}Delay`),a=s(`${$s}Duration`),c=ba(l,a);let u=null,f=0,d=0;t===En?o>0&&(u=En,f=o,d=r.length):t===$s?c>0&&(u=$s,f=c,d=a.length):(f=Math.max(o,c),u=f>0?o>c?En:$s:null,d=u?u===En?r.length:a.length:0);const p=u===En&&/\b(?:transform|all)(?:,|$)/.test(s(`${En}Property`).toString());return{type:u,timeout:f,propCount:d,hasTransform:p}}function ba(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>va(n)+va(e[s])))}function va(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function wa(e){return(e?e.ownerDocument:document).body.offsetHeight}function up(e,t,n){const s=e[gi];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const yr=Symbol("_vod"),Bu=Symbol("_vsh"),Fv={name:"show",beforeMount(e,{value:t},{transition:n}){e[yr]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ds(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),Ds(e,!0),s.enter(e)):s.leave(e,()=>{Ds(e,!1)}):Ds(e,t))},beforeUnmount(e,{value:t}){Ds(e,t)}};function Ds(e,t){e.style.display=t?e[yr]:"none",e[Bu]=!t}const fp=Symbol(""),dp=/(?:^|;)\s*display\s*:/;function hp(e,t,n){const s=e.style,i=Be(n);let r=!1;if(n&&!i){if(t)if(Be(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&Zi(s,l,"")}else for(const o in t)n[o]==null&&Zi(s,o,"");for(const o in n)o==="display"&&(r=!0),Zi(s,o,n[o])}else if(i){if(t!==n){const o=s[fp];o&&(n+=";"+o),s.cssText=n,r=dp.test(n)}}else t&&e.removeAttribute("style");yr in e&&(e[yr]=r?s.display:"",e[Bu]&&(s.display="none"))}const _a=/\s*!important$/;function Zi(e,t,n){if(ie(n))n.forEach(s=>Zi(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=pp(e,t);_a.test(n)?e.setProperty(Fn(s),n.replace(_a,""),"important"):e[s]=n}}const Ta=["Webkit","Moz","ms"],to={};function pp(e,t){const n=to[t];if(n)return n;let s=Nt(t);if(s!=="filter"&&s in e)return to[t]=s;s=kr(s);for(let i=0;i<Ta.length;i++){const r=Ta[i]+s;if(r in e)return to[t]=r}return t}const Ea="http://www.w3.org/1999/xlink";function xa(e,t,n,s,i,r=hd(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Ea,t.slice(6,t.length)):e.setAttributeNS(Ea,t,n):n==null||r&&!Ic(n)?e.removeAttribute(t):e.setAttribute(t,r?"":Bt(n)?String(n):n)}function Aa(e,t,n,s,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Fu(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const l=r==="OPTION"?e.getAttribute("value")||"":e.value,a=n==null?e.type==="checkbox"?"on":"":String(n);(l!==a||!("_value"in e))&&(e.value=a),n==null&&e.removeAttribute(t),e._value=n;return}let o=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Ic(n):n==null&&l==="string"?(n="",o=!0):l==="number"&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function On(e,t,n,s){e.addEventListener(t,n,s)}function mp(e,t,n,s){e.removeEventListener(t,n,s)}const ka=Symbol("_vei");function gp(e,t,n,s,i=null){const r=e[ka]||(e[ka]={}),o=r[t];if(s&&o)o.value=s;else{const[l,a]=yp(t);if(s){const c=r[t]=wp(s,i);On(e,l,c,a)}else o&&(mp(e,l,o,a),r[t]=void 0)}}const Ca=/(?:Once|Passive|Capture)$/;function yp(e){let t;if(Ca.test(e)){t={};let s;for(;s=e.match(Ca);)e=e.slice(0,e.length-s[0].length),t[s[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Fn(e.slice(2)),t]}let no=0;const bp=Promise.resolve(),vp=()=>no||(bp.then(()=>no=0),no=Date.now());function wp(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;zt(_p(s,n.value),t,5,[s])};return n.value=e,n.attached=vp(),n}function _p(e,t){if(ie(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(s=>i=>!i._stopped&&s&&s(i))}else return t}const Sa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Tp=(e,t,n,s,i,r)=>{const o=i==="svg";t==="class"?up(e,s,o):t==="style"?hp(e,n,s):Er(t)?tl(t)||gp(e,t,n,s,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ep(e,t,s,o))?(Aa(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&xa(e,t,s,o,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Be(s))?Aa(e,Nt(t),s,r,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),xa(e,t,s,o))};function Ep(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Sa(t)&&ue(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Sa(t)&&Be(n)?!1:t in e}const xs=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ie(t)?n=>Gi(t,n):t};function xp(e){e.target.composing=!0}function Pa(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yn=Symbol("_assign");function Ra(e,t,n){return t&&(e=e.trim()),n&&(e=Cr(e)),e}const Ia={created(e,{modifiers:{lazy:t,trim:n,number:s}},i){e[yn]=xs(i);const r=s||i.props&&i.props.type==="number";On(e,t?"change":"input",o=>{o.target.composing||e[yn](Ra(e.value,n,r))}),(n||r)&&On(e,"change",()=>{e.value=Ra(e.value,n,r)}),t||(On(e,"compositionstart",xp),On(e,"compositionend",Pa),On(e,"change",Pa))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:i,number:r}},o){if(e[yn]=xs(o),e.composing)return;const l=(r||e.type==="number")&&!/^0\d/.test(e.value)?Cr(e.value):e.value,a=t??"";l!==a&&(document.activeElement===e&&e.type!=="range"&&(s&&t===n||i&&e.value.trim()===a)||(e.value=a))}},Hv={deep:!0,created(e,t,n){e[yn]=xs(n),On(e,"change",()=>{const s=e._modelValue,i=yi(e),r=e.checked,o=e[yn];if(ie(s)){const l=sl(s,i),a=l!==-1;if(r&&!a)o(s.concat(i));else if(!r&&a){const c=[...s];c.splice(l,1),o(c)}}else if(Rs(s)){const l=new Set(s);r?l.add(i):l.delete(i),o(l)}else o(Vu(e,r))})},mounted:Ma,beforeUpdate(e,t,n){e[yn]=xs(n),Ma(e,t,n)}};function Ma(e,{value:t,oldValue:n},s){e._modelValue=t;let i;if(ie(t))i=sl(t,s.props.value)>-1;else if(Rs(t))i=t.has(s.props.value);else{if(t===n)return;i=Is(t,Vu(e,!0))}e.checked!==i&&(e.checked=i)}const Bv={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const i=Rs(t);On(e,"change",()=>{const r=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>n?Cr(yi(o)):yi(o));e[yn](e.multiple?i?new Set(r):r:r[0]),e._assigning=!0,ss(()=>{e._assigning=!1})}),e[yn]=xs(s)},mounted(e,{value:t}){Oa(e,t)},beforeUpdate(e,t,n){e[yn]=xs(n)},updated(e,{value:t}){e._assigning||Oa(e,t)}};function Oa(e,t){const n=e.multiple,s=ie(t);if(!(n&&!s&&!Rs(t))){for(let i=0,r=e.options.length;i<r;i++){const o=e.options[i],l=yi(o);if(n)if(s){const a=typeof l;a==="string"||a==="number"?o.selected=t.some(c=>String(c)===String(l)):o.selected=sl(t,l)>-1}else o.selected=t.has(l);else if(Is(yi(o),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function yi(e){return"_value"in e?e._value:e.value}function Vu(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ap=["ctrl","shift","alt","meta"],kp={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Ap.some(n=>e[`${n}Key`]&&!t.includes(n))},dn=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((i,...r)=>{for(let o=0;o<t.length;o++){const l=kp[t[o]];if(l&&l(i,t))return}return e(i,...r)}))},Cp={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Na=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(i=>{if(!("key"in i))return;const r=Fn(i.key);if(t.some(o=>o===r||Cp[o]===r))return e(i)}))},Sp=Je({patchProp:Tp},sp);let La;function Pp(){return La||(La=$h(Sp))}const Rp=((...e)=>{const t=Pp().createApp(...e),{mount:n}=t;return t.mount=s=>{const i=Mp(s);if(!i)return;const r=t._component;!ue(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,Ip(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},t});function Ip(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Mp(e){return Be(e)?document.querySelector(e):e}let zu;const Dr=e=>zu=e,qu=Symbol();function Do(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var ri;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(ri||(ri={}));function Op(){const e=Lc(!0),t=e.run(()=>Q({}));let n=[],s=[];const i=ul({install(r){Dr(i),i._a=r,r.provide(qu,i),r.config.globalProperties.$pinia=i,s.forEach(o=>n.push(o)),s=[]},use(r){return this._a?n.push(r):s.push(r),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const Wu=()=>{};function $a(e,t,n,s=Wu){e.add(t);const i=()=>{e.delete(t)&&s()};return!n&&$c()&&md(i),i}function us(e,...t){e.forEach(n=>{n(...t)})}const Np=e=>e(),Da=Symbol(),so=Symbol();function Uo(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];Do(i)&&Do(s)&&e.hasOwnProperty(n)&&!Ue(s)&&!gn(s)?e[n]=Uo(i,s):e[n]=s}return e}const Lp=Symbol();function $p(e){return!Do(e)||!Object.prototype.hasOwnProperty.call(e,Lp)}const{assign:Pn}=Object;function Dp(e){return!!(Ue(e)&&e.effect)}function Up(e,t,n,s){const{state:i,actions:r,getters:o}=t,l=n.state.value[e];let a;function c(){l||(n.state.value[e]=i?i():{});const u=Dd(n.state.value[e]);return Pn(u,r,Object.keys(o||{}).reduce((f,d)=>(f[d]=ul(He(()=>{Dr(n);const p=n._s.get(e);return o[d].call(p,p)})),f),{}))}return a=Ku(e,c,t,n,s,!0),a}function Ku(e,t,n={},s,i,r){let o;const l=Pn({actions:{}},n),a={deep:!0};let c,u,f=new Set,d=new Set,p;const v=s.state.value[e];!r&&!v&&(s.state.value[e]={});let b;function I(L){let S;c=u=!1,typeof L=="function"?(L(s.state.value[e]),S={type:ri.patchFunction,storeId:e,events:p}):(Uo(s.state.value[e],L),S={type:ri.patchObject,payload:L,storeId:e,events:p});const P=b=Symbol();ss().then(()=>{b===P&&(c=!0)}),u=!0,us(f,S,s.state.value[e])}const x=r?function(){const{state:S}=n,P=S?S():{};this.$patch(D=>{Pn(D,P)})}:Wu;function w(){o.stop(),f.clear(),d.clear(),s._s.delete(e)}const E=(L,S="")=>{if(Da in L)return L[so]=S,L;const P=function(){Dr(s);const D=Array.from(arguments),F=new Set,se=new Set;function be(fe){F.add(fe)}function je(fe){se.add(fe)}us(d,{args:D,name:P[so],store:M,after:be,onError:je});let Ae;try{Ae=L.apply(this&&this.$id===e?this:M,D)}catch(fe){throw us(se,fe),fe}return Ae instanceof Promise?Ae.then(fe=>(us(F,fe),fe)).catch(fe=>(us(se,fe),Promise.reject(fe))):(us(F,Ae),Ae)};return P[Da]=!0,P[so]=S,P},T={_p:s,$id:e,$onAction:$a.bind(null,d),$patch:I,$reset:x,$subscribe(L,S={}){const P=$a(f,L,S.detached,()=>D()),D=o.run(()=>Ht(()=>s.state.value[e],F=>{(S.flush==="sync"?u:c)&&L({storeId:e,type:ri.direct,events:p},F)},Pn({},a,S)));return P},$dispose:w},M=ki(T);s._s.set(e,M);const G=(s._a&&s._a.runWithContext||Np)(()=>s._e.run(()=>(o=Lc()).run(()=>t({action:E}))));for(const L in G){const S=G[L];if(Ue(S)&&!Dp(S)||gn(S))r||(v&&$p(S)&&(Ue(S)?S.value=v[L]:Uo(S,v[L])),s.state.value[e][L]=S);else if(typeof S=="function"){const P=E(S,L);G[L]=P,l.actions[L]=S}}return Pn(M,G),Pn(Te(M),G),Object.defineProperty(M,"$state",{get:()=>s.state.value[e],set:L=>{I(S=>{Pn(S,L)})}}),s._p.forEach(L=>{Pn(M,o.run(()=>L({store:M,app:s._a,pinia:s,options:l})))}),v&&r&&n.hydrate&&n.hydrate(M.$state,v),c=!0,u=!0,M}function Gu(e,t,n){let s;const i=typeof t=="function";s=i?n:t;function r(o,l){const a=Kd();return o=o||(a?Ot(qu,null):null),o&&Dr(o),o=zu,o._s.has(e)||(i?Ku(e,t,s,o):Up(e,s,o)),o._s.get(e)}return r.$id=e,r}const ms=typeof document<"u";function Yu(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function jp(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Yu(e.default)}const Ce=Object.assign;function io(e,t){const n={};for(const s in t){const i=t[s];n[s]=qt(i)?i.map(e):e(i)}return n}const oi=()=>{},qt=Array.isArray;function Ua(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}let Fe=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Xu=Symbol("");Fe.MATCHER_NOT_FOUND+"",Fe.NAVIGATION_GUARD_REDIRECT+"",Fe.NAVIGATION_ABORTED+"",Fe.NAVIGATION_CANCELLED+"",Fe.NAVIGATION_DUPLICATED+"";function As(e,t){return Ce(new Error,{type:e,[Xu]:!0},t)}function cn(e,t){return e instanceof Error&&Xu in e&&(t==null||!!(e.type&t))}const Fp=["params","query","hash"];function Hp(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Fp)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const Bp=Symbol(""),ja=Symbol(""),Ur=Symbol(""),wl=Symbol(""),jo=Symbol("");function Vv(){return Ot(Ur)}function zv(e){return Ot(wl)}const Ju=/#/g,Vp=/&/g,zp=/\//g,qp=/=/g,Wp=/\?/g,Qu=/\+/g,Kp=/%5B/g,Gp=/%5D/g,Zu=/%5E/g,Yp=/%60/g,ef=/%7B/g,Xp=/%7C/g,tf=/%7D/g,Jp=/%20/g;function _l(e){return e==null?"":encodeURI(""+e).replace(Xp,"|").replace(Kp,"[").replace(Gp,"]")}function Qp(e){return _l(e).replace(ef,"{").replace(tf,"}").replace(Zu,"^")}function Fo(e){return _l(e).replace(Qu,"%2B").replace(Jp,"+").replace(Ju,"%23").replace(Vp,"%26").replace(Yp,"`").replace(ef,"{").replace(tf,"}").replace(Zu,"^")}function Zp(e){return Fo(e).replace(qp,"%3D")}function em(e){return _l(e).replace(Ju,"%23").replace(Wp,"%3F")}function tm(e){return em(e).replace(zp,"%2F")}function bi(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const nm=/\/$/,sm=e=>e.replace(nm,"");function ro(e,t,n="/"){let s,i={},r="",o="";const l=t.indexOf("#");let a=t.indexOf("?");return a=l>=0&&a>l?-1:a,a>=0&&(s=t.slice(0,a),r=t.slice(a,l>0?l:t.length),i=e(r.slice(1))),l>=0&&(s=s||t.slice(0,l),o=t.slice(l,t.length)),s=lm(s??t,n),{fullPath:s+r+o,path:s,query:i,hash:bi(o)}}function im(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Fa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function rm(e,t,n){const s=t.matched.length-1,i=n.matched.length-1;return s>-1&&s===i&&ks(t.matched[s],n.matched[i])&&nf(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ks(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function nf(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!om(e[n],t[n]))return!1;return!0}function om(e,t){return qt(e)?Ha(e,t):qt(t)?Ha(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Ha(e,t){return qt(t)?e.length===t.length&&e.every((n,s)=>n===t[s]):e.length===1&&e[0]===t}function lm(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),i=s[s.length-1];(i===".."||i===".")&&s.push("");let r=n.length-1,o,l;for(o=0;o<s.length;o++)if(l=s[o],l!==".")if(l==="..")r>1&&r--;else break;return n.slice(0,r).join("/")+"/"+s.slice(o).join("/")}const xn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ho=(function(e){return e.pop="pop",e.push="push",e})({}),oo=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function am(e){if(!e)if(ms){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),sm(e)}const cm=/^[^#]+#/;function um(e,t){return e.replace(cm,"#")+t}function fm(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}const jr=()=>({left:window.scrollX,top:window.scrollY});function dm(e){let t;if("el"in e){const n=e.el,s=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=fm(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ba(e,t){return(history.state?history.state.position-t:-1)+e}const Bo=new Map;function hm(e,t){Bo.set(e,t)}function pm(e){const t=Bo.get(e);return Bo.delete(e),t}function mm(e){return typeof e=="string"||e&&typeof e=="object"}function sf(e){return typeof e=="string"||typeof e=="symbol"}function gm(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const i=n[s].replace(Qu," "),r=i.indexOf("="),o=bi(r<0?i:i.slice(0,r)),l=r<0?null:bi(i.slice(r+1));if(o in t){let a=t[o];qt(a)||(a=t[o]=[a]),a.push(l)}else t[o]=l}return t}function Va(e){let t="";for(let n in e){const s=e[n];if(n=Zp(n),s==null){s!==void 0&&(t+=(t.length?"&":"")+n);continue}(qt(s)?s.map(i=>i&&Fo(i)):[s&&Fo(s)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function ym(e){const t={};for(const n in e){const s=e[n];s!==void 0&&(t[n]=qt(s)?s.map(i=>i==null?null:""+i):s==null?s:""+s)}return t}function Us(){let e=[];function t(s){return e.push(s),()=>{const i=e.indexOf(s);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Mn(e,t,n,s,i,r=o=>o()){const o=s&&(s.enterCallbacks[i]=s.enterCallbacks[i]||[]);return()=>new Promise((l,a)=>{const c=d=>{d===!1?a(As(Fe.NAVIGATION_ABORTED,{from:n,to:t})):d instanceof Error?a(d):mm(d)?a(As(Fe.NAVIGATION_GUARD_REDIRECT,{from:t,to:d})):(o&&s.enterCallbacks[i]===o&&typeof d=="function"&&o.push(d),l())},u=r(()=>e.call(s&&s.instances[i],t,n,c));let f=Promise.resolve(u);e.length<3&&(f=f.then(c)),f.catch(d=>a(d))})}function lo(e,t,n,s,i=r=>r()){const r=[];for(const o of e)for(const l in o.components){let a=o.components[l];if(!(t!=="beforeRouteEnter"&&!o.instances[l]))if(Yu(a)){const c=(a.__vccOpts||a)[t];c&&r.push(Mn(c,n,s,o,l,i))}else{let c=a();r.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${l}" at "${o.path}"`);const f=jp(u)?u.default:u;o.mods[l]=u,o.components[l]=f;const d=(f.__vccOpts||f)[t];return d&&Mn(d,n,s,o,l,i)()}))}}return r}function bm(e,t){const n=[],s=[],i=[],r=Math.max(t.matched.length,e.matched.length);for(let o=0;o<r;o++){const l=t.matched[o];l&&(e.matched.find(c=>ks(c,l))?s.push(l):n.push(l));const a=e.matched[o];a&&(t.matched.find(c=>ks(c,a))||i.push(a))}return[n,s,i]}let vm=()=>location.protocol+"//"+location.host;function rf(e,t){const{pathname:n,search:s,hash:i}=t,r=e.indexOf("#");if(r>-1){let o=i.includes(e.slice(r))?e.slice(r).length:1,l=i.slice(o);return l[0]!=="/"&&(l="/"+l),Fa(l,"")}return Fa(n,e)+s+i}function wm(e,t,n,s){let i=[],r=[],o=null;const l=({state:d})=>{const p=rf(e,location),v=n.value,b=t.value;let I=0;if(d){if(n.value=p,t.value=d,o&&o===v){o=null;return}I=b?d.position-b.position:0}else s(p);i.forEach(x=>{x(n.value,v,{delta:I,type:Ho.pop,direction:I?I>0?oo.forward:oo.back:oo.unknown})})};function a(){o=n.value}function c(d){i.push(d);const p=()=>{const v=i.indexOf(d);v>-1&&i.splice(v,1)};return r.push(p),p}function u(){if(document.visibilityState==="hidden"){const{history:d}=window;if(!d.state)return;d.replaceState(Ce({},d.state,{scroll:jr()}),"")}}function f(){for(const d of r)d();r=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:a,listen:c,destroy:f}}function za(e,t,n,s=!1,i=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:i?jr():null}}function _m(e){const{history:t,location:n}=window,s={value:rf(e,n)},i={value:t.state};i.value||r(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(a,c,u){const f=e.indexOf("#"),d=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+a:vm()+e+a;try{t[u?"replaceState":"pushState"](c,"",d),i.value=c}catch(p){console.error(p),n[u?"replace":"assign"](d)}}function o(a,c){r(a,Ce({},t.state,za(i.value.back,a,i.value.forward,!0),c,{position:i.value.position}),!0),s.value=a}function l(a,c){const u=Ce({},i.value,t.state,{forward:a,scroll:jr()});r(u.current,u,!0),r(a,Ce({},za(s.value,a,null),{position:u.position+1},c),!1),s.value=a}return{location:s,state:i,push:l,replace:o}}function Tm(e){e=am(e);const t=_m(e),n=wm(e,t.state,t.location,t.replace);function s(r,o=!0){o||n.pauseListeners(),history.go(r)}const i=Ce({location:"",base:e,go:s,createHref:um.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}let Zn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ye=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Ye||{});const Em={type:Zn.Static,value:""},xm=/[a-zA-Z0-9_]/;function Am(e){if(!e)return[[]];if(e==="/")return[[Em]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(p){throw new Error(`ERR (${n})/"${c}": ${p}`)}let n=Ye.Static,s=n;const i=[];let r;function o(){r&&i.push(r),r=[]}let l=0,a,c="",u="";function f(){c&&(n===Ye.Static?r.push({type:Zn.Static,value:c}):n===Ye.Param||n===Ye.ParamRegExp||n===Ye.ParamRegExpEnd?(r.length>1&&(a==="*"||a==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:Zn.Param,value:c,regexp:u,repeatable:a==="*"||a==="+",optional:a==="*"||a==="?"})):t("Invalid state to consume buffer"),c="")}function d(){c+=a}for(;l<e.length;){if(a=e[l++],a==="\\"&&n!==Ye.ParamRegExp){s=n,n=Ye.EscapeNext;continue}switch(n){case Ye.Static:a==="/"?(c&&f(),o()):a===":"?(f(),n=Ye.Param):d();break;case Ye.EscapeNext:d(),n=s;break;case Ye.Param:a==="("?n=Ye.ParamRegExp:xm.test(a)?d():(f(),n=Ye.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--);break;case Ye.ParamRegExp:a===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+a:n=Ye.ParamRegExpEnd:u+=a;break;case Ye.ParamRegExpEnd:f(),n=Ye.Static,a!=="*"&&a!=="?"&&a!=="+"&&l--,u="";break;default:t("Unknown state");break}}return n===Ye.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),f(),o(),i}const qa="[^/]+?",km={sensitive:!1,strict:!1,start:!0,end:!0};var bt=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(bt||{});const Cm=/[.+*?^${}()[\]/\\]/g;function Sm(e,t){const n=Ce({},km,t),s=[];let i=n.start?"^":"";const r=[];for(const c of e){const u=c.length?[]:[bt.Root];n.strict&&!c.length&&(i+="/");for(let f=0;f<c.length;f++){const d=c[f];let p=bt.Segment+(n.sensitive?bt.BonusCaseSensitive:0);if(d.type===Zn.Static)f||(i+="/"),i+=d.value.replace(Cm,"\\$&"),p+=bt.Static;else if(d.type===Zn.Param){const{value:v,repeatable:b,optional:I,regexp:x}=d;r.push({name:v,repeatable:b,optional:I});const w=x||qa;if(w!==qa){p+=bt.BonusCustomRegExp;try{new RegExp(`(${w})`)}catch(T){throw new Error(`Invalid custom RegExp for param "${v}" (${w}): `+T.message)}}let E=b?`((?:${w})(?:/(?:${w}))*)`:`(${w})`;f||(E=I&&c.length<2?`(?:/${E})`:"/"+E),I&&(E+="?"),i+=E,p+=bt.Dynamic,I&&(p+=bt.BonusOptional),b&&(p+=bt.BonusRepeatable),w===".*"&&(p+=bt.BonusWildcard)}u.push(p)}s.push(u)}if(n.strict&&n.end){const c=s.length-1;s[c][s[c].length-1]+=bt.BonusStrict}n.strict||(i+="/?"),n.end?i+="$":n.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const o=new RegExp(i,n.sensitive?"":"i");function l(c){const u=c.match(o),f={};if(!u)return null;for(let d=1;d<u.length;d++){const p=u[d]||"",v=r[d-1];f[v.name]=p&&v.repeatable?p.split("/"):p}return f}function a(c){let u="",f=!1;for(const d of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const p of d)if(p.type===Zn.Static)u+=p.value;else if(p.type===Zn.Param){const{value:v,repeatable:b,optional:I}=p,x=v in c?c[v]:"";if(qt(x)&&!b)throw new Error(`Provided param "${v}" is an array but it is not repeatable (* or + modifiers)`);const w=qt(x)?x.join("/"):x;if(!w)if(I)d.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${v}"`);u+=w}}return u||"/"}return{re:o,score:s,keys:r,parse:l,stringify:a}}function Pm(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?e.length===1&&e[0]===bt.Static+bt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===bt.Static+bt.Segment?1:-1:0}function of(e,t){let n=0;const s=e.score,i=t.score;for(;n<s.length&&n<i.length;){const r=Pm(s[n],i[n]);if(r)return r;n++}if(Math.abs(i.length-s.length)===1){if(Wa(s))return 1;if(Wa(i))return-1}return i.length-s.length}function Wa(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Rm={strict:!1,end:!0,sensitive:!1};function Im(e,t,n){const s=Sm(Am(e.path),n),i=Ce(s,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Mm(e,t){const n=[],s=new Map;t=Ua(Rm,t);function i(f){return s.get(f)}function r(f,d,p){const v=!p,b=Ga(f);b.aliasOf=p&&p.record;const I=Ua(t,f),x=[b];if("alias"in f){const T=typeof f.alias=="string"?[f.alias]:f.alias;for(const M of T)x.push(Ga(Ce({},b,{components:p?p.record.components:b.components,path:M,aliasOf:p?p.record:b})))}let w,E;for(const T of x){const{path:M}=T;if(d&&M[0]!=="/"){const $=d.record.path,G=$[$.length-1]==="/"?"":"/";T.path=d.record.path+(M&&G+M)}if(w=Im(T,d,I),p?p.alias.push(w):(E=E||w,E!==w&&E.alias.push(w),v&&f.name&&!Ya(w)&&o(f.name)),lf(w)&&a(w),b.children){const $=b.children;for(let G=0;G<$.length;G++)r($[G],w,p&&p.children[G])}p=p||w}return E?()=>{o(E)}:oi}function o(f){if(sf(f)){const d=s.get(f);d&&(s.delete(f),n.splice(n.indexOf(d),1),d.children.forEach(o),d.alias.forEach(o))}else{const d=n.indexOf(f);d>-1&&(n.splice(d,1),f.record.name&&s.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function l(){return n}function a(f){const d=Lm(f,n);n.splice(d,0,f),f.record.name&&!Ya(f)&&s.set(f.record.name,f)}function c(f,d){let p,v={},b,I;if("name"in f&&f.name){if(p=s.get(f.name),!p)throw As(Fe.MATCHER_NOT_FOUND,{location:f});I=p.record.name,v=Ce(Ka(d.params,p.keys.filter(E=>!E.optional).concat(p.parent?p.parent.keys.filter(E=>E.optional):[]).map(E=>E.name)),f.params&&Ka(f.params,p.keys.map(E=>E.name))),b=p.stringify(v)}else if(f.path!=null)b=f.path,p=n.find(E=>E.re.test(b)),p&&(v=p.parse(b),I=p.record.name);else{if(p=d.name?s.get(d.name):n.find(E=>E.re.test(d.path)),!p)throw As(Fe.MATCHER_NOT_FOUND,{location:f,currentLocation:d});I=p.record.name,v=Ce({},d.params,f.params),b=p.stringify(v)}const x=[];let w=p;for(;w;)x.unshift(w.record),w=w.parent;return{name:I,path:b,params:v,matched:x,meta:Nm(x)}}e.forEach(f=>r(f));function u(){n.length=0,s.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:u,getRoutes:l,getRecordMatcher:i}}function Ka(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function Ga(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Om(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Om(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]=typeof n=="object"?n[s]:n;return t}function Ya(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Nm(e){return e.reduce((t,n)=>Ce(t,n.meta),{})}function Lm(e,t){let n=0,s=t.length;for(;n!==s;){const r=n+s>>1;of(e,t[r])<0?s=r:n=r+1}const i=$m(e);return i&&(s=t.lastIndexOf(i,s-1)),s}function $m(e){let t=e;for(;t=t.parent;)if(lf(t)&&of(e,t)===0)return t}function lf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Xa(e){const t=Ot(Ur),n=Ot(wl),s=He(()=>{const a=V(e.to);return t.resolve(a)}),i=He(()=>{const{matched:a}=s.value,{length:c}=a,u=a[c-1],f=n.matched;if(!u||!f.length)return-1;const d=f.findIndex(ks.bind(null,u));if(d>-1)return d;const p=Ja(a[c-2]);return c>1&&Ja(u)===p&&f[f.length-1].path!==p?f.findIndex(ks.bind(null,a[c-2])):d}),r=He(()=>i.value>-1&&Hm(n.params,s.value.params)),o=He(()=>i.value>-1&&i.value===n.matched.length-1&&nf(n.params,s.value.params));function l(a={}){if(Fm(a)){const c=t[V(e.replace)?"replace":"push"](V(e.to)).catch(oi);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:s,href:He(()=>s.value.href),isActive:r,isExactActive:o,navigate:l}}function Dm(e){return e.length===1?e[0]:e}const Um=Hn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Xa,setup(e,{slots:t}){const n=ki(Xa(e)),{options:s}=Ot(Ur),i=He(()=>({[Qa(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Qa(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const r=t.default&&Dm(t.default(n));return e.custom?r:vl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}}),jm=Um;function Fm(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Hm(e,t){for(const n in t){const s=t[n],i=e[n];if(typeof s=="string"){if(s!==i)return!1}else if(!qt(i)||i.length!==s.length||s.some((r,o)=>r.valueOf()!==i[o].valueOf()))return!1}return!0}function Ja(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Qa=(e,t,n)=>e??t??n,Bm=Hn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=Ot(jo),i=He(()=>e.route||s.value),r=Ot(ja,0),o=He(()=>{let c=V(r);const{matched:u}=i.value;let f;for(;(f=u[c])&&!f.components;)c++;return c}),l=He(()=>i.value.matched[o.value]);Yi(ja,He(()=>o.value+1)),Yi(Bp,l),Yi(jo,i);const a=Q();return Ht(()=>[a.value,l.value,e.name],([c,u,f],[d,p,v])=>{u&&(u.instances[f]=c,p&&p!==u&&c&&c===d&&(u.leaveGuards.size||(u.leaveGuards=p.leaveGuards),u.updateGuards.size||(u.updateGuards=p.updateGuards))),c&&u&&(!p||!ks(u,p)||!d)&&(u.enterCallbacks[f]||[]).forEach(b=>b(c))},{flush:"post"}),()=>{const c=i.value,u=e.name,f=l.value,d=f&&f.components[u];if(!d)return Za(n.default,{Component:d,route:c});const p=f.props[u],v=p?p===!0?c.params:typeof p=="function"?p(c):p:null,I=vl(d,Ce({},v,t,{onVnodeUnmounted:x=>{x.component.isUnmounted&&(f.instances[u]=null)},ref:a}));return Za(n.default,{Component:I,route:c})||I}}});function Za(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const af=Bm;function Vm(e){const t=Mm(e.routes,e),n=e.parseQuery||gm,s=e.stringifyQuery||Va,i=e.history,r=Us(),o=Us(),l=Us(),a=Qc(xn);let c=xn;ms&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=io.bind(null,C=>""+C),f=io.bind(null,tm),d=io.bind(null,bi);function p(C,q){let W,ee;return sf(C)?(W=t.getRecordMatcher(C),ee=q):ee=C,t.addRoute(ee,W)}function v(C){const q=t.getRecordMatcher(C);q&&t.removeRoute(q)}function b(){return t.getRoutes().map(C=>C.record)}function I(C){return!!t.getRecordMatcher(C)}function x(C,q){if(q=Ce({},q||a.value),typeof C=="string"){const _=ro(n,C,q.path),A=t.resolve({path:_.path},q),O=i.createHref(_.fullPath);return Ce(_,A,{params:d(A.params),hash:bi(_.hash),redirectedFrom:void 0,href:O})}let W;if(C.path!=null)W=Ce({},C,{path:ro(n,C.path,q.path).path});else{const _=Ce({},C.params);for(const A in _)_[A]==null&&delete _[A];W=Ce({},C,{params:f(_)}),q.params=f(q.params)}const ee=t.resolve(W,q),ge=C.hash||"";ee.params=u(d(ee.params));const m=im(s,Ce({},C,{hash:Qp(ge),path:ee.path})),g=i.createHref(m);return Ce({fullPath:m,hash:ge,query:s===Va?ym(C.query):C.query||{}},ee,{redirectedFrom:void 0,href:g})}function w(C){return typeof C=="string"?ro(n,C,a.value.path):Ce({},C)}function E(C,q){if(c!==C)return As(Fe.NAVIGATION_CANCELLED,{from:q,to:C})}function T(C){return G(C)}function M(C){return T(Ce(w(C),{replace:!0}))}function $(C,q){const W=C.matched[C.matched.length-1];if(W&&W.redirect){const{redirect:ee}=W;let ge=typeof ee=="function"?ee(C,q):ee;return typeof ge=="string"&&(ge=ge.includes("?")||ge.includes("#")?ge=w(ge):{path:ge},ge.params={}),Ce({query:C.query,hash:C.hash,params:ge.path!=null?{}:C.params},ge)}}function G(C,q){const W=c=x(C),ee=a.value,ge=C.state,m=C.force,g=C.replace===!0,_=$(W,ee);if(_)return G(Ce(w(_),{state:typeof _=="object"?Ce({},ge,_.state):ge,force:m,replace:g}),q||W);const A=W;A.redirectedFrom=q;let O;return!m&&rm(s,ee,W)&&(O=As(Fe.NAVIGATION_DUPLICATED,{to:A,from:ee}),Ee(ee,ee,!0,!1)),(O?Promise.resolve(O):P(A,ee)).catch(R=>cn(R)?cn(R,Fe.NAVIGATION_GUARD_REDIRECT)?R:kt(R):pe(R,A,ee)).then(R=>{if(R){if(cn(R,Fe.NAVIGATION_GUARD_REDIRECT))return G(Ce({replace:g},w(R.to),{state:typeof R.to=="object"?Ce({},ge,R.to.state):ge,force:m}),q||A)}else R=F(A,ee,!0,g,ge);return D(A,ee,R),R})}function L(C,q){const W=E(C,q);return W?Promise.reject(W):Promise.resolve()}function S(C){const q=J.values().next().value;return q&&typeof q.runWithContext=="function"?q.runWithContext(C):C()}function P(C,q){let W;const[ee,ge,m]=bm(C,q);W=lo(ee.reverse(),"beforeRouteLeave",C,q);for(const _ of ee)_.leaveGuards.forEach(A=>{W.push(Mn(A,C,q))});const g=L.bind(null,C,q);return W.push(g),Re(W).then(()=>{W=[];for(const _ of r.list())W.push(Mn(_,C,q));return W.push(g),Re(W)}).then(()=>{W=lo(ge,"beforeRouteUpdate",C,q);for(const _ of ge)_.updateGuards.forEach(A=>{W.push(Mn(A,C,q))});return W.push(g),Re(W)}).then(()=>{W=[];for(const _ of m)if(_.beforeEnter)if(qt(_.beforeEnter))for(const A of _.beforeEnter)W.push(Mn(A,C,q));else W.push(Mn(_.beforeEnter,C,q));return W.push(g),Re(W)}).then(()=>(C.matched.forEach(_=>_.enterCallbacks={}),W=lo(m,"beforeRouteEnter",C,q,S),W.push(g),Re(W))).then(()=>{W=[];for(const _ of o.list())W.push(Mn(_,C,q));return W.push(g),Re(W)}).catch(_=>cn(_,Fe.NAVIGATION_CANCELLED)?_:Promise.reject(_))}function D(C,q,W){l.list().forEach(ee=>S(()=>ee(C,q,W)))}function F(C,q,W,ee,ge){const m=E(C,q);if(m)return m;const g=q===xn,_=ms?history.state:{};W&&(ee||g?i.replace(C.fullPath,Ce({scroll:g&&_&&_.scroll},ge)):i.push(C.fullPath,ge)),a.value=C,Ee(C,q,W,g),kt()}let se;function be(){se||(se=i.listen((C,q,W)=>{if(!ce.listening)return;const ee=x(C),ge=$(ee,ce.currentRoute.value);if(ge){G(Ce(ge,{replace:!0,force:!0}),ee).catch(oi);return}c=ee;const m=a.value;ms&&hm(Ba(m.fullPath,W.delta),jr()),P(ee,m).catch(g=>cn(g,Fe.NAVIGATION_ABORTED|Fe.NAVIGATION_CANCELLED)?g:cn(g,Fe.NAVIGATION_GUARD_REDIRECT)?(G(Ce(w(g.to),{force:!0}),ee).then(_=>{cn(_,Fe.NAVIGATION_ABORTED|Fe.NAVIGATION_DUPLICATED)&&!W.delta&&W.type===Ho.pop&&i.go(-1,!1)}).catch(oi),Promise.reject()):(W.delta&&i.go(-W.delta,!1),pe(g,ee,m))).then(g=>{g=g||F(ee,m,!1),g&&(W.delta&&!cn(g,Fe.NAVIGATION_CANCELLED)?i.go(-W.delta,!1):W.type===Ho.pop&&cn(g,Fe.NAVIGATION_ABORTED|Fe.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),D(ee,m,g)}).catch(oi)}))}let je=Us(),Ae=Us(),fe;function pe(C,q,W){kt(C);const ee=Ae.list();return ee.length?ee.forEach(ge=>ge(C,q,W)):console.error(C),Promise.reject(C)}function At(){return fe&&a.value!==xn?Promise.resolve():new Promise((C,q)=>{je.add([C,q])})}function kt(C){return fe||(fe=!C,be(),je.list().forEach(([q,W])=>C?W(C):q()),je.reset()),C}function Ee(C,q,W,ee){const{scrollBehavior:ge}=e;if(!ms||!ge)return Promise.resolve();const m=!W&&pm(Ba(C.fullPath,0))||(ee||!W)&&history.state&&history.state.scroll||null;return ss().then(()=>ge(C,q,m)).then(g=>g&&dm(g)).catch(g=>pe(g,C,q))}const We=C=>i.go(C);let X;const J=new Set,ce={currentRoute:a,listening:!0,addRoute:p,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:I,getRoutes:b,resolve:x,options:e,push:T,replace:M,go:We,back:()=>We(-1),forward:()=>We(1),beforeEach:r.add,beforeResolve:o.add,afterEach:l.add,onError:Ae.add,isReady:At,install(C){C.component("RouterLink",jm),C.component("RouterView",af),C.config.globalProperties.$router=ce,Object.defineProperty(C.config.globalProperties,"$route",{enumerable:!0,get:()=>V(a)}),ms&&!X&&a.value===xn&&(X=!0,T(i.location).catch(ee=>{}));const q={};for(const ee in xn)Object.defineProperty(q,ee,{get:()=>a.value[ee],enumerable:!0});C.provide(Ur,ce),C.provide(wl,Jc(q)),C.provide(jo,a);const W=C.unmount;J.add(C),C.unmount=function(){J.delete(C),J.size<1&&(c=xn,se&&se(),se=null,a.value=xn,X=!1,fe=!1),W()}}};function Re(C){return C.reduce((q,W)=>q.then(()=>S(W)),Promise.resolve())}return ce}const ao=Q("dark");function cf(){const e=He(()=>ao.value==="dark"),t=i=>{ao.value=i,localStorage.setItem("aiui-theme",i),document.documentElement.classList.toggle("dark",i==="dark"),document.documentElement.classList.toggle("light",i==="light")};return{currentTheme:ao,isDark:e,setTheme:t,toggleTheme:()=>{t(e.value?"light":"dark")},initTheme:()=>{const i=localStorage.getItem("aiui-theme");i?t(i):window.matchMedia("(prefers-color-scheme: dark)").matches?t("dark"):t("light")}}}let zm=0;const Ut=new Map,er=[],tr=[];let li=[],nr=null,co=!1,vi=null;function ec(){return`aiui-${++zm}-${Date.now()}`}function Hi(e){window.parent!==window&&vi&&window.parent.postMessage(e,vi)}function tc(e){if(!vi||e.origin!==vi)return;const t=e.data;if(!(!t||typeof t.type!="string"))switch(t.type){case"context:response":{const n=Ut.get(t.id);n&&(Ut.delete(t.id),n.resolve({data:t.data,permitted:t.permitted}));break}case"action:response":{const n=Ut.get(t.id);n&&(Ut.delete(t.id),n.resolve({success:t.success,error:t.error}));break}case"permissions:update":{li=t.categories||[];for(const n of er)n(li);break}case"theme:response":{const n=t.theme;if(n){nr=n;for(const s of tr)s(n)}break}}}const An={init(e){co||(co=!0,vi=e??window.location.origin,window.addEventListener("message",tc),Hi({type:"ready"}))},destroy(){window.removeEventListener("message",tc),Ut.clear(),co=!1},isInArchy(){return window.parent!==window},requestContext(e,t){const n=ec();return new Promise((s,i)=>{Ut.set(n,{resolve:s,reject:i}),Hi({type:"context:request",id:n,category:e,query:t}),setTimeout(()=>{Ut.has(n)&&(Ut.delete(n),i(new Error(`Context request timed out: ${e}`)))},1e4)})},requestAction(e,t={}){const n=ec();return new Promise((s,i)=>{Ut.set(n,{resolve:s,reject:i}),Hi({type:"action:request",id:n,action:e,params:t}),setTimeout(()=>{Ut.has(n)&&(Ut.delete(n),i(new Error(`Action request timed out: ${e}`)))},3e4)})},requestTheme(){Hi({type:"theme:request"})},onPermissionsUpdate(e){return er.push(e),li.length>0&&e(li),()=>{const t=er.indexOf(e);t!==-1&&er.splice(t,1)}},onThemeUpdate(e){return tr.push(e),nr&&e(nr),()=>{const t=tr.indexOf(e);t!==-1&&tr.splice(t,1)}},getPermissions(){return[...li]},getTheme(){return nr}},qm=[{id:"bitcoin-core",name:"Bitcoin Core",state:"running",status:"Synced — Block 893,412"},{id:"lnd",name:"LND",state:"running",status:"6 channels, 12 peers"},{id:"mempool",name:"Mempool",state:"running",status:"Healthy"},{id:"btcpay-server",name:"BTCPay Server",state:"running",status:"Healthy"},{id:"nextcloud",name:"Nextcloud",state:"running",status:"847 files, 12.4 GB used"},{id:"immich",name:"Immich",state:"running",status:"2,341 photos, 89 videos"},{id:"nostr-rs-relay",name:"nostr-rs-relay",state:"running",status:"14,203 events"},{id:"home-assistant",name:"Home Assistant",state:"stopped",status:"Stopped"},{id:"searxng",name:"SearXNG",state:"running",status:"Healthy"},{id:"grafana",name:"Grafana",state:"running",status:"Healthy"},{id:"ollama",name:"Ollama",state:"running",status:"3 models loaded"}],Wm={name:"Archipelago",version:"0.9.2"},Km={connected:!0},Gm={available:!0,status:"active",alias:"MyNode",num_active_channels:6,num_peers:12,synced_to_chain:!0,block_height:893412,balance_sats:125e4,channel_balance_sats:35e5,pending_open_balance:0},Ym={available:!0,block_height:893412,sync_progress:1,chain:"mainnet",mempool_tx_count:42350,mempool_size:128e6},Xm=[{name:"Documents",path:"/Documents",type:"folder"},{name:"Photos",path:"/Photos",type:"folder"},{name:"Music",path:"/Music",type:"folder"},{name:"Videos",path:"/Videos",type:"folder"},{name:"family-reunion-2024.jpg",path:"/Photos/family-reunion-2024.jpg",type:"file",size:42e5,modified:"2024-12-25"},{name:"sunset-beach.jpg",path:"/Photos/sunset-beach.jpg",type:"file",size:38e5,modified:"2024-11-15"},{name:"node-setup-guide.pdf",path:"/Documents/node-setup-guide.pdf",type:"file",size:21e5,modified:"2024-10-01"},{name:"bitcoin-whitepaper.pdf",path:"/Documents/bitcoin-whitepaper.pdf",type:"file",size:184e3,modified:"2024-01-03"},{name:"household-budget.ods",path:"/Documents/household-budget.ods",type:"file",size:45e3,modified:"2025-02-28"},{name:"birthday-video.mp4",path:"/Videos/birthday-video.mp4",type:"file",size:25e7,modified:"2025-01-15"},{name:"conference-talk.mp4",path:"/Videos/conference-talk.mp4",type:"file",size:18e7,modified:"2024-09-20"},{name:"podcast-episode.mp3",path:"/Music/podcast-episode.mp3",type:"file",size:45e6,modified:"2025-03-01"},{name:"backup-keys.txt",path:"/Documents/backup-keys.txt",type:"file",size:1200,modified:"2024-06-15"},{name:"recipes.md",path:"/Documents/recipes.md",type:"file",size:8500,modified:"2025-02-14"},{name:"travel-plans.md",path:"/Documents/travel-plans.md",type:"file",size:3200,modified:"2025-03-05"},{name:"mountain-hike.jpg",path:"/Photos/mountain-hike.jpg",type:"file",size:51e5,modified:"2025-01-20"},{name:"holiday-dinner.jpg",path:"/Photos/holiday-dinner.jpg",type:"file",size:32e5,modified:"2024-12-24"},{name:"garden-spring.heic",path:"/Photos/garden-spring.heic",type:"file",size:48e5,modified:"2025-03-01"},{name:"city-skyline.png",path:"/Photos/city-skyline.png",type:"file",size:29e5,modified:"2025-02-10"},{name:"kid-birthday.jpg",path:"/Photos/kid-birthday.jpg",type:"file",size:36e5,modified:"2025-02-28"},{name:"bitcoin-standard-audiobook.mp3",path:"/Music/bitcoin-standard-audiobook.mp3",type:"file",size:95e6,modified:"2024-11-10"},{name:"morning-jazz.flac",path:"/Music/morning-jazz.flac",type:"file",size:42e6,modified:"2025-01-05"},{name:"focus-beats.ogg",path:"/Music/focus-beats.ogg",type:"file",size:28e6,modified:"2025-02-20"},{name:"live-concert-2024.m4a",path:"/Music/live-concert-2024.m4a",type:"file",size:67e6,modified:"2024-10-15"},{name:"lightning-channels-notes.md",path:"/Documents/lightning-channels-notes.md",type:"file",size:4200,modified:"2025-03-03"},{name:"tax-records-2025.xlsx",path:"/Documents/tax-records-2025.xlsx",type:"file",size:128e3,modified:"2025-02-28"}],uo=Q(!1),kn=Q(!1),Yt=Q([]),nc=Q(null),js=Q([]),Fs=Q({}),Bi=Q({}),Hs=Q({}),Bs=Q([]),Vs=Q({available:!1});let Vi=[];function Jm(){function e(){if(kn.value)return;const c=!!window.__AIUI_EMBEDDED__;if(uo.value=c,new URLSearchParams(window.location.search).has("mockArchy")&&!c){kn.value=!0,uo.value=!0,Yt.value=["apps","system","network","wallet","bitcoin","files"],js.value=qm,Fs.value=Wm,Bi.value=Km,Hs.value=Gm,Vs.value=Ym,Bs.value=Xm,console.log("[AIUI] Mock Archy data loaded for dev testing");return}if(!c||!An.isInArchy())return;An.init(),kn.value=!0;const f=An.onPermissionsUpdate(p=>{Yt.value=p,t(p)});Vi.push(f);const d=An.onThemeUpdate(p=>{nc.value=p.accent,o(p.accent)});Vi.push(d),An.requestTheme()}async function t(c){const u=[];function f(d,p,v=()=>!0){return An.requestContext(d).then(b=>{if(!b.permitted){console.warn(`[AIUI Archy] ${d}: not permitted — user should enable in Archy Settings`);return}b.data&&v(b.data)&&p(b.data)}).catch(b=>{console.warn(`[AIUI Archy] ${d} fetch failed:`,b?.message??b)})}c.includes("apps")&&u.push(f("apps",d=>{js.value=d},Array.isArray)),c.includes("system")&&u.push(f("system",d=>{Fs.value=d})),c.includes("network")&&u.push(f("network",d=>{Bi.value=d})),c.includes("wallet")&&u.push(f("wallet",d=>{Hs.value=d})),c.includes("bitcoin")&&u.push(f("bitcoin",d=>{Vs.value=d})),c.includes("files")&&u.push(f("files",d=>{Bs.value=d},Array.isArray)),await Promise.all(u)}async function n(){kn.value&&await t(Yt.value)}async function s(c,u={}){return kn.value?An.requestAction(c,u):{success:!1,error:"Not initialized"}}async function i(c){const u=await s("read-file",{path:c}),f=u.data;return u.success&&f?f:null}async function r(c,u=50){const f=await s("tail-logs",{appId:c,lines:String(u)}),d=f.data;return f.success&&d?d.lines:null}function o(c){document.documentElement.style.setProperty("--color-accent",c)}function l(){if(!kn.value)return"";const c=[];if(Yt.value.includes("apps")&&js.value.length>0){const u=js.value.map(f=>`- ${f.name} (${f.state}${f.status?", "+f.status:""})`).join(`
|
|
`);c.push(`**Installed apps on this node:**
|
|
${u}
|
|
You can view recent app logs by requesting the tail-logs action with an appId.`)}if(Yt.value.includes("system")&&Fs.value.name){const u=Fs.value;c.push(`**System:** ${u.name}${u.version?" v"+u.version:""}`)}if(Yt.value.includes("network")){const u=Bi.value;c.push(`**Network:** ${u.connected?"Connected":"Disconnected"}`)}if(Yt.value.includes("wallet")&&Hs.value.available){const u=Hs.value,f=[];u.alias&&f.push(u.alias),u.num_active_channels!==void 0&&f.push(`${u.num_active_channels} channels`),u.num_peers!==void 0&&f.push(`${u.num_peers} peers`),u.balance_sats!==void 0&&f.push(`On-chain: ${u.balance_sats.toLocaleString()} sats`),u.channel_balance_sats!==void 0&&f.push(`In channels: ${u.channel_balance_sats.toLocaleString()} sats`),u.synced_to_chain!==void 0&&f.push(u.synced_to_chain?"synced":"syncing"),c.push(`**Lightning (LND):** ${f.join(" | ")}`)}if(Yt.value.includes("bitcoin")&&Vs.value.available){const u=Vs.value,f=u.sync_progress?(u.sync_progress*100).toFixed(2)+"%":"unknown",d=[`Block ${u.block_height?.toLocaleString()??"?"}`,`${f} synced`];u.chain&&d.push(u.chain),u.mempool_tx_count&&d.push(`mempool: ${u.mempool_tx_count.toLocaleString()} txs`),c.push(`**Bitcoin:** ${d.join(", ")}`)}if(Yt.value.includes("files")&&Bs.value.length>0){const u=Bs.value,f=u.filter(E=>E.type==="folder"),d=u.filter(E=>E.type==="file"),p=d.filter(E=>/\.(jpg|jpeg|png|gif|webp|svg|heic|heif)$/i.test(E.name)),v=d.filter(E=>/\.(mp4|mkv|avi|mov|webm)$/i.test(E.name)),b=d.filter(E=>/\.(mp3|flac|wav|ogg|m4a|aac|opus)$/i.test(E.name)),I=d.filter(E=>/\.(pdf|doc|docx|txt|md|ods|xlsx|csv)$/i.test(E.name)),x=[`${u.length} items`];f.length>0&&x.push(`${f.length} folders (${f.map(E=>E.name).join(", ")})`),p.length>0&&x.push(`${p.length} images`),v.length>0&&x.push(`${v.length} videos`),b.length>0&&x.push(`${b.length} audio files`),I.length>0&&x.push(`${I.length} documents`);const w=d.slice(0,15).map(E=>E.name).join(", ");c.push(`**Files:** ${x.join(" | ")}
|
|
Recent: ${w}
|
|
You can read file contents by requesting the read-file action with a file path.`)}return c.length===0?"":`
|
|
|
|
**Archy Node Context** (this user is running AIUI on their Archipelago node):
|
|
${c.join(`
|
|
`)}
|
|
|
|
You can help the user manage their node, check service status, browse files, and recommend apps. Available actions: open an app (open-app), install an app (install-app), tail app logs (tail-logs), read a file (read-file), navigate in Archy (navigate). When recommending apps, use [[app_ext:...]] tags and check if they're already installed. When discussing the user's files, mention specific files you can see. If the user asks about their photos, videos, or music, reference the file counts above.`}function a(){for(const c of Vi)c();Vi=[],An.destroy(),kn.value=!1}return{isEmbedded:St(uo),isInitialized:St(kn),permissions:St(Yt),accentColor:St(nc),installedApps:St(js),systemInfo:St(Fs),networkInfo:St(Bi),walletInfo:St(Hs),fileList:St(Bs),bitcoinInfo:St(Vs),init:e,destroy:a,refreshContext:n,requestAction:s,readFile:i,tailLogs:r,buildArchyContext:l}}function Qm(){const e=Q(0),t=Q(!1),n=Q(typeof window<"u"?window.innerHeight:0);let s=typeof window<"u"?window.innerHeight:0,i=null;function r(){i&&clearTimeout(i),i=setTimeout(()=>{const l=window.visualViewport;if(!l)return;const a=Math.max(0,s-l.height);e.value=a,t.value=a>100,n.value=l.height},50)}function o(){const l=window.visualViewport;l&&!t.value&&(s=l.height,n.value=l.height)}return is(()=>{const l=window.visualViewport;l&&(s=l.height,n.value=l.height,l.addEventListener("resize",r),l.addEventListener("scroll",r)),window.addEventListener("resize",o)}),Or(()=>{const l=window.visualViewport;l&&(l.removeEventListener("resize",r),l.removeEventListener("scroll",r)),window.removeEventListener("resize",o)}),{keyboardHeight:e,isKeyboardOpen:t,viewportHeight:n}}const Zm=/^https?:\/\//i,eg=Gu("articleOverlay",()=>{const e=Q(!1),t=Q(null),n=Q(""),s=Q(null),i=Q(null);function r(l,a="",c,u){const f=String(l??"").trim();if(Zm.test(f)){try{new URL(f)}catch{return}t.value=f,n.value=String(a??"Article").slice(0,200),s.value=typeof c=="string"&&c.trim().length>0?c.trim():null,i.value=typeof u=="string"&&u.trim().length>0?u.trim():null,e.value=!0}}function o(){e.value=!1,t.value=null,n.value="",s.value=null,i.value=null}return{isOpen:e,url:t,title:n,content:s,imgSrc:i,open:r,close:o}});const{entries:uf,setPrototypeOf:sc,isFrozen:tg,getPrototypeOf:ng,getOwnPropertyDescriptor:sg}=Object;let{freeze:wt,seal:Lt,create:Vo}=Object,{apply:zo,construct:qo}=typeof Reflect<"u"&&Reflect;wt||(wt=function(t){return t});Lt||(Lt=function(t){return t});zo||(zo=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),r=2;r<s;r++)i[r-2]=arguments[r];return t.apply(n,i)});qo||(qo=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return new t(...s)});const zi=_t(Array.prototype.forEach),ig=_t(Array.prototype.lastIndexOf),ic=_t(Array.prototype.pop),zs=_t(Array.prototype.push),rg=_t(Array.prototype.splice),sr=_t(String.prototype.toLowerCase),fo=_t(String.prototype.toString),ho=_t(String.prototype.match),qs=_t(String.prototype.replace),og=_t(String.prototype.indexOf),lg=_t(String.prototype.trim),$t=_t(Object.prototype.hasOwnProperty),gt=_t(RegExp.prototype.test),Ws=ag(TypeError);function _t(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return zo(e,t,s)}}function ag(e){return function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return qo(e,n)}}function me(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:sr;sc&&sc(e,null);let s=t.length;for(;s--;){let i=t[s];if(typeof i=="string"){const r=n(i);r!==i&&(tg(t)||(t[s]=r),i=r)}e[i]=!0}return e}function cg(e){for(let t=0;t<e.length;t++)$t(e,t)||(e[t]=null);return e}function Jt(e){const t=Vo(null);for(const[n,s]of uf(e))$t(e,n)&&(Array.isArray(s)?t[n]=cg(s):s&&typeof s=="object"&&s.constructor===Object?t[n]=Jt(s):t[n]=s);return t}function Ks(e,t){for(;e!==null;){const s=sg(e,t);if(s){if(s.get)return _t(s.get);if(typeof s.value=="function")return _t(s.value)}e=ng(e)}function n(){return null}return n}const rc=wt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),po=wt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),mo=wt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ug=wt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),go=wt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),fg=wt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),oc=wt(["#text"]),lc=wt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),yo=wt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ac=wt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),qi=wt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),dg=Lt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),hg=Lt(/<%[\w\W]*|[\w\W]*%>/gm),pg=Lt(/\$\{[\w\W]*/gm),mg=Lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),gg=Lt(/^aria-[\-\w]+$/),ff=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yg=Lt(/^(?:\w+script|data):/i),bg=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),df=Lt(/^html$/i),vg=Lt(/^[a-z][.\w]*(-[.\w]+)+$/i);var cc=Object.freeze({__proto__:null,ARIA_ATTR:gg,ATTR_WHITESPACE:bg,CUSTOM_ELEMENT:vg,DATA_ATTR:mg,DOCTYPE_NAME:df,ERB_EXPR:hg,IS_ALLOWED_URI:ff,IS_SCRIPT_OR_DATA:yg,MUSTACHE_EXPR:dg,TMPLIT_EXPR:pg});const Gs={element:1,text:3,progressingInstruction:7,comment:8,document:9},wg=function(){return typeof window>"u"?null:window},_g=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let s=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));const r="dompurify"+(s?"#"+s:"");try{return t.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},uc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function hf(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wg();const t=ne=>hf(ne);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==Gs.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const s=n,i=s.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:l,Element:a,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:p}=e,v=a.prototype,b=Ks(v,"cloneNode"),I=Ks(v,"remove"),x=Ks(v,"nextSibling"),w=Ks(v,"childNodes"),E=Ks(v,"parentNode");if(typeof o=="function"){const ne=n.createElement("template");ne.content&&ne.content.ownerDocument&&(n=ne.content.ownerDocument)}let T,M="";const{implementation:$,createNodeIterator:G,createDocumentFragment:L,getElementsByTagName:S}=n,{importNode:P}=s;let D=uc();t.isSupported=typeof uf=="function"&&typeof E=="function"&&$&&$.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:se,TMPLIT_EXPR:be,DATA_ATTR:je,ARIA_ATTR:Ae,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:At}=cc;let{IS_ALLOWED_URI:kt}=cc,Ee=null;const We=me({},[...rc,...po,...mo,...go,...oc]);let X=null;const J=me({},[...lc,...yo,...ac,...qi]);let ce=Object.seal(Vo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Re=null,C=null;const q=Object.seal(Vo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let W=!0,ee=!0,ge=!1,m=!0,g=!1,_=!0,A=!1,O=!1,R=!1,B=!1,H=!1,j=!1,N=!0,re=!1;const Y="user-content-";let te=!0,oe=!1,he={},ye=null;const we=me({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let nt=null;const st=me({},["audio","video","img","source","image","track"]);let Tt=null;const Ct=me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wt="http://www.w3.org/1998/Math/MathML",Bn="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let it=$e,rs=!1,os=null;const Gf=me({},[Wt,Bn,$e],fo);let Ni=me({},["mi","mo","mn","ms","mtext"]),Li=me({},["annotation-xml"]);const Yf=me({},["title","style","font","a","script"]);let Os=null;const Xf=["application/xhtml+xml","text/html"],Jf="text/html";let Ge=null,ls=null;const Qf=n.createElement("form"),Rl=function(y){return y instanceof RegExp||y instanceof Function},Vr=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ls&&ls===y)){if((!y||typeof y!="object")&&(y={}),y=Jt(y),Os=Xf.indexOf(y.PARSER_MEDIA_TYPE)===-1?Jf:y.PARSER_MEDIA_TYPE,Ge=Os==="application/xhtml+xml"?fo:sr,Ee=$t(y,"ALLOWED_TAGS")?me({},y.ALLOWED_TAGS,Ge):We,X=$t(y,"ALLOWED_ATTR")?me({},y.ALLOWED_ATTR,Ge):J,os=$t(y,"ALLOWED_NAMESPACES")?me({},y.ALLOWED_NAMESPACES,fo):Gf,Tt=$t(y,"ADD_URI_SAFE_ATTR")?me(Jt(Ct),y.ADD_URI_SAFE_ATTR,Ge):Ct,nt=$t(y,"ADD_DATA_URI_TAGS")?me(Jt(st),y.ADD_DATA_URI_TAGS,Ge):st,ye=$t(y,"FORBID_CONTENTS")?me({},y.FORBID_CONTENTS,Ge):we,Re=$t(y,"FORBID_TAGS")?me({},y.FORBID_TAGS,Ge):Jt({}),C=$t(y,"FORBID_ATTR")?me({},y.FORBID_ATTR,Ge):Jt({}),he=$t(y,"USE_PROFILES")?y.USE_PROFILES:!1,W=y.ALLOW_ARIA_ATTR!==!1,ee=y.ALLOW_DATA_ATTR!==!1,ge=y.ALLOW_UNKNOWN_PROTOCOLS||!1,m=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,g=y.SAFE_FOR_TEMPLATES||!1,_=y.SAFE_FOR_XML!==!1,A=y.WHOLE_DOCUMENT||!1,B=y.RETURN_DOM||!1,H=y.RETURN_DOM_FRAGMENT||!1,j=y.RETURN_TRUSTED_TYPE||!1,R=y.FORCE_BODY||!1,N=y.SANITIZE_DOM!==!1,re=y.SANITIZE_NAMED_PROPS||!1,te=y.KEEP_CONTENT!==!1,oe=y.IN_PLACE||!1,kt=y.ALLOWED_URI_REGEXP||ff,it=y.NAMESPACE||$e,Ni=y.MATHML_TEXT_INTEGRATION_POINTS||Ni,Li=y.HTML_INTEGRATION_POINTS||Li,ce=y.CUSTOM_ELEMENT_HANDLING||{},y.CUSTOM_ELEMENT_HANDLING&&Rl(y.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=y.CUSTOM_ELEMENT_HANDLING.tagNameCheck),y.CUSTOM_ELEMENT_HANDLING&&Rl(y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=y.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),y.CUSTOM_ELEMENT_HANDLING&&typeof y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=y.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),g&&(ee=!1),H&&(B=!0),he&&(Ee=me({},oc),X=[],he.html===!0&&(me(Ee,rc),me(X,lc)),he.svg===!0&&(me(Ee,po),me(X,yo),me(X,qi)),he.svgFilters===!0&&(me(Ee,mo),me(X,yo),me(X,qi)),he.mathMl===!0&&(me(Ee,go),me(X,ac),me(X,qi))),y.ADD_TAGS&&(typeof y.ADD_TAGS=="function"?q.tagCheck=y.ADD_TAGS:(Ee===We&&(Ee=Jt(Ee)),me(Ee,y.ADD_TAGS,Ge))),y.ADD_ATTR&&(typeof y.ADD_ATTR=="function"?q.attributeCheck=y.ADD_ATTR:(X===J&&(X=Jt(X)),me(X,y.ADD_ATTR,Ge))),y.ADD_URI_SAFE_ATTR&&me(Tt,y.ADD_URI_SAFE_ATTR,Ge),y.FORBID_CONTENTS&&(ye===we&&(ye=Jt(ye)),me(ye,y.FORBID_CONTENTS,Ge)),y.ADD_FORBID_CONTENTS&&(ye===we&&(ye=Jt(ye)),me(ye,y.ADD_FORBID_CONTENTS,Ge)),te&&(Ee["#text"]=!0),A&&me(Ee,["html","head","body"]),Ee.table&&(me(Ee,["tbody"]),delete Re.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ws('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ws('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=y.TRUSTED_TYPES_POLICY,M=T.createHTML("")}else T===void 0&&(T=_g(p,i)),T!==null&&typeof M=="string"&&(M=T.createHTML(""));wt&&wt(y),ls=y}},Il=me({},[...po,...mo,...ug]),Ml=me({},[...go,...fg]),Zf=function(y){let U=E(y);(!U||!U.tagName)&&(U={namespaceURI:it,tagName:"template"});const Z=sr(y.tagName),Le=sr(U.tagName);return os[y.namespaceURI]?y.namespaceURI===Bn?U.namespaceURI===$e?Z==="svg":U.namespaceURI===Wt?Z==="svg"&&(Le==="annotation-xml"||Ni[Le]):!!Il[Z]:y.namespaceURI===Wt?U.namespaceURI===$e?Z==="math":U.namespaceURI===Bn?Z==="math"&&Li[Le]:!!Ml[Z]:y.namespaceURI===$e?U.namespaceURI===Bn&&!Li[Le]||U.namespaceURI===Wt&&!Ni[Le]?!1:!Ml[Z]&&(Yf[Z]||!Il[Z]):!!(Os==="application/xhtml+xml"&&os[y.namespaceURI]):!1},Kt=function(y){zs(t.removed,{element:y});try{E(y).removeChild(y)}catch{I(y)}},Vn=function(y,U){try{zs(t.removed,{attribute:U.getAttributeNode(y),from:U})}catch{zs(t.removed,{attribute:null,from:U})}if(U.removeAttribute(y),y==="is")if(B||H)try{Kt(U)}catch{}else try{U.setAttribute(y,"")}catch{}},Ol=function(y){let U=null,Z=null;if(R)y="<remove></remove>"+y;else{const Ke=ho(y,/^[\r\n\t ]+/);Z=Ke&&Ke[0]}Os==="application/xhtml+xml"&&it===$e&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const Le=T?T.createHTML(y):y;if(it===$e)try{U=new d().parseFromString(Le,Os)}catch{}if(!U||!U.documentElement){U=$.createDocument(it,"template",null);try{U.documentElement.innerHTML=rs?M:Le}catch{}}const ct=U.body||U.documentElement;return y&&Z&&ct.insertBefore(n.createTextNode(Z),ct.childNodes[0]||null),it===$e?S.call(U,A?"html":"body")[0]:A?U.documentElement:ct},Nl=function(y){return G.call(y.ownerDocument||y,y,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},zr=function(y){return y instanceof f&&(typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||!(y.attributes instanceof u)||typeof y.removeAttribute!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function")},Ll=function(y){return typeof l=="function"&&y instanceof l};function rn(ne,y,U){zi(ne,Z=>{Z.call(t,y,U,ls)})}const $l=function(y){let U=null;if(rn(D.beforeSanitizeElements,y,null),zr(y))return Kt(y),!0;const Z=Ge(y.nodeName);if(rn(D.uponSanitizeElement,y,{tagName:Z,allowedTags:Ee}),_&&y.hasChildNodes()&&!Ll(y.firstElementChild)&>(/<[/\w!]/g,y.innerHTML)&>(/<[/\w!]/g,y.textContent)||y.nodeType===Gs.progressingInstruction||_&&y.nodeType===Gs.comment&>(/<[/\w]/g,y.data))return Kt(y),!0;if(!(q.tagCheck instanceof Function&&q.tagCheck(Z))&&(!Ee[Z]||Re[Z])){if(!Re[Z]&&Ul(Z)&&(ce.tagNameCheck instanceof RegExp&>(ce.tagNameCheck,Z)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Z)))return!1;if(te&&!ye[Z]){const Le=E(y)||y.parentNode,ct=w(y)||y.childNodes;if(ct&&Le){const Ke=ct.length;for(let Et=Ke-1;Et>=0;--Et){const on=b(ct[Et],!0);on.__removalCount=(y.__removalCount||0)+1,Le.insertBefore(on,x(y))}}}return Kt(y),!0}return y instanceof a&&!Zf(y)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&>(/<\/no(script|embed|frames)/i,y.innerHTML)?(Kt(y),!0):(g&&y.nodeType===Gs.text&&(U=y.textContent,zi([F,se,be],Le=>{U=qs(U,Le," ")}),y.textContent!==U&&(zs(t.removed,{element:y.cloneNode()}),y.textContent=U)),rn(D.afterSanitizeElements,y,null),!1)},Dl=function(y,U,Z){if(N&&(U==="id"||U==="name")&&(Z in n||Z in Qf))return!1;if(!(ee&&!C[U]&>(je,U))){if(!(W&>(Ae,U))){if(!(q.attributeCheck instanceof Function&&q.attributeCheck(U,y))){if(!X[U]||C[U]){if(!(Ul(y)&&(ce.tagNameCheck instanceof RegExp&>(ce.tagNameCheck,y)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(y))&&(ce.attributeNameCheck instanceof RegExp&>(ce.attributeNameCheck,U)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(U,y))||U==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&>(ce.tagNameCheck,Z)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(Z))))return!1}else if(!Tt[U]){if(!gt(kt,qs(Z,pe,""))){if(!((U==="src"||U==="xlink:href"||U==="href")&&y!=="script"&&og(Z,"data:")===0&&nt[y])){if(!(ge&&!gt(fe,qs(Z,pe,"")))){if(Z)return!1}}}}}}}return!0},Ul=function(y){return y!=="annotation-xml"&&ho(y,At)},jl=function(y){rn(D.beforeSanitizeAttributes,y,null);const{attributes:U}=y;if(!U||zr(y))return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Le=U.length;for(;Le--;){const ct=U[Le],{name:Ke,namespaceURI:Et,value:on}=ct,as=Ge(Ke),qr=on;let rt=Ke==="value"?qr:lg(qr);if(Z.attrName=as,Z.attrValue=rt,Z.keepAttr=!0,Z.forceKeepAttr=void 0,rn(D.uponSanitizeAttribute,y,Z),rt=Z.attrValue,re&&(as==="id"||as==="name")&&(Vn(Ke,y),rt=Y+rt),_&>(/((--!?|])>)|<\/(style|title|textarea)/i,rt)){Vn(Ke,y);continue}if(as==="attributename"&&ho(rt,"href")){Vn(Ke,y);continue}if(Z.forceKeepAttr)continue;if(!Z.keepAttr){Vn(Ke,y);continue}if(!m&>(/\/>/i,rt)){Vn(Ke,y);continue}g&&zi([F,se,be],Hl=>{rt=qs(rt,Hl," ")});const Fl=Ge(y.nodeName);if(!Dl(Fl,as,rt)){Vn(Ke,y);continue}if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Et)switch(p.getAttributeType(Fl,as)){case"TrustedHTML":{rt=T.createHTML(rt);break}case"TrustedScriptURL":{rt=T.createScriptURL(rt);break}}if(rt!==qr)try{Et?y.setAttributeNS(Et,Ke,rt):y.setAttribute(Ke,rt),zr(y)?Kt(y):ic(t.removed)}catch{Vn(Ke,y)}}rn(D.afterSanitizeAttributes,y,null)},ed=function ne(y){let U=null;const Z=Nl(y);for(rn(D.beforeSanitizeShadowDOM,y,null);U=Z.nextNode();)rn(D.uponSanitizeShadowNode,U,null),$l(U),jl(U),U.content instanceof r&&ne(U.content);rn(D.afterSanitizeShadowDOM,y,null)};return t.sanitize=function(ne){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=null,Z=null,Le=null,ct=null;if(rs=!ne,rs&&(ne="<!-->"),typeof ne!="string"&&!Ll(ne))if(typeof ne.toString=="function"){if(ne=ne.toString(),typeof ne!="string")throw Ws("dirty is not a string, aborting")}else throw Ws("toString is not a function");if(!t.isSupported)return ne;if(O||Vr(y),t.removed=[],typeof ne=="string"&&(oe=!1),oe){if(ne.nodeName){const on=Ge(ne.nodeName);if(!Ee[on]||Re[on])throw Ws("root node is forbidden and cannot be sanitized in-place")}}else if(ne instanceof l)U=Ol("<!---->"),Z=U.ownerDocument.importNode(ne,!0),Z.nodeType===Gs.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?U=Z:U.appendChild(Z);else{if(!B&&!g&&!A&&ne.indexOf("<")===-1)return T&&j?T.createHTML(ne):ne;if(U=Ol(ne),!U)return B?null:j?M:""}U&&R&&Kt(U.firstChild);const Ke=Nl(oe?ne:U);for(;Le=Ke.nextNode();)$l(Le),jl(Le),Le.content instanceof r&&ed(Le.content);if(oe)return ne;if(B){if(H)for(ct=L.call(U.ownerDocument);U.firstChild;)ct.appendChild(U.firstChild);else ct=U;return(X.shadowroot||X.shadowrootmode)&&(ct=P.call(s,ct,!0)),ct}let Et=A?U.outerHTML:U.innerHTML;return A&&Ee["!doctype"]&&U.ownerDocument&&U.ownerDocument.doctype&&U.ownerDocument.doctype.name&>(df,U.ownerDocument.doctype.name)&&(Et="<!DOCTYPE "+U.ownerDocument.doctype.name+`>
|
|
`+Et),g&&zi([F,se,be],on=>{Et=qs(Et,on," ")}),T&&j?T.createHTML(Et):Et},t.setConfig=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vr(ne),O=!0},t.clearConfig=function(){ls=null,O=!1},t.isValidAttribute=function(ne,y,U){ls||Vr({});const Z=Ge(ne),Le=Ge(y);return Dl(Z,Le,U)},t.addHook=function(ne,y){typeof y=="function"&&zs(D[ne],y)},t.removeHook=function(ne,y){if(y!==void 0){const U=ig(D[ne],y);return U===-1?void 0:rg(D[ne],U,1)[0]}return ic(D[ne])},t.removeHooks=function(ne){D[ne]=[]},t.removeAllHooks=function(){D=uc()},t}var Tg=hf();function Eg(e){try{const t=new URL(e);return/^https?:$/i.test(t.protocol)}catch{return!1}}function qv(e){return!!e&&typeof e=="string"&&/^https?:\/\//i.test(e.trim())}const xg=["p","br","a","strong","em","b","i","ul","ol","li","blockquote","h1","h2","h3","h4","span","div"];function Ag(e){return Tg.sanitize(e,{ALLOWED_TAGS:xg,ALLOWED_ATTR:["href","src","target","rel"]})}function kg(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Wv(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}const Cg=["disabled"],Sg=["href"],Pg={class:"relative flex-1 min-h-0 bg-black/20 overflow-hidden"},Rg={class:"[&_p]:mb-3 [&_ul]:list-disc [&_ol]:list-decimal [&_li]:ml-4 [&_a]:underline [&_a]:underline-offset-2 [&_h1]:text-lg [&_h2]:text-base [&_h3]:text-sm [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_blockquote]:italic"},Ig=["src","alt"],Mg=["innerHTML"],Og=["href"],Ng=["src"],Lg=Hn({__name:"ArticleOverlay",setup(e){const t=eg(),{isDark:n}=cf(),s=He(()=>{const f=t.content;return f?/<[a-z][\s\S]*>/i.test(f)?Ag(f):`<p class="whitespace-pre-wrap">${kg(f)}</p>`:""}),i=Q(null),r=Q(0),o=Q(!1);function l(){o.value=!0,r.value++}function a(){o.value=!1}function c(f){f.key==="Escape"&&t.isOpen&&(t.close(),f.preventDefault(),f.stopPropagation())}Ht(()=>t.isOpen,f=>{f||(o.value=!1)}),is(()=>{window.addEventListener("keydown",c,!0)}),Mr(()=>{window.removeEventListener("keydown",c,!0)});const u=["w-full max-w-[calc(100vw-3rem)] h-[80vh] max-h-[calc(100vh-5rem)]","md:max-w-[calc(100vw-5rem)]"];return(f,d)=>(de(),Un(dl,{to:"body"},[Ne(gr,{name:"app-launcher"},{default:di(()=>[V(t).isOpen?(de(),ve("div",{key:0,class:"fixed inset-0 z-[2400] flex items-center justify-center p-6 md:p-10",onClick:d[2]||(d[2]=dn(p=>V(t).close(),["self"]))},[d[7]||(d[7]=k("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md"},null,-1)),k("div",{class:qe(["article-overlay-panel relative z-10 flex flex-col overflow-hidden rounded-2xl shadow-2xl path-glass-card",u])},[k("div",{class:"flex items-center gap-3 px-4 py-3 shrink-0",style:Dn(V(n)?"border-bottom: 1px solid rgba(255, 255, 255, 0.08)":"border-bottom: 1px solid rgba(0, 0, 0, 0.06)")},[V(t).content?mt("",!0):(de(),ve("button",{key:0,type:"button",class:qe(["flex items-center justify-center w-9 h-9 rounded-lg transition-colors transition-transform duration-300 disabled:opacity-70 disabled:cursor-not-allowed",V(n)?"hover:bg-white/10 text-white/70":"hover:bg-black/5 text-gray-600"]),"aria-label":"Refresh page",title:"Refresh",disabled:o.value,onClick:l},[(de(),ve("svg",{class:qe(["w-5 h-5",{"animate-spin":o.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true"},[...d[3]||(d[3]=[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)])],2))],10,Cg)),k("span",{class:qe(["flex-1 truncate text-sm font-medium min-w-0",V(n)?"text-white/90":"text-gray-900"])},tt(V(t).title||"Article"),3),V(t).url?(de(),ve("a",{key:1,href:V(t).url,target:"_blank",rel:"noopener noreferrer",class:qe(["flex items-center justify-center w-9 h-9 rounded-lg transition-colors shrink-0",V(n)?"hover:bg-white/10 text-white/70":"hover:bg-black/5 text-gray-600"]),"aria-label":"Open in new tab",title:"Open in new tab",onClick:d[0]||(d[0]=dn(()=>{},["stop"]))},[...d[4]||(d[4]=[k("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,Sg)):mt("",!0),k("button",{type:"button",class:qe(["flex items-center justify-center w-9 h-9 rounded-lg transition-colors shrink-0",V(n)?"hover:bg-white/10 text-white/70":"hover:bg-black/5 text-gray-600"]),"aria-label":"Close",onClick:d[1]||(d[1]=p=>V(t).close())},[...d[5]||(d[5]=[k("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],2)],4),k("div",Pg,[V(t).content?(de(),ve("div",{key:0,class:qe(["absolute inset-0 overflow-y-auto p-4 md:p-6 text-sm leading-relaxed",V(n)?"text-white/90":"text-gray-900"])},[k("article",Rg,[V(t).imgSrc&&V(Eg)(V(t).imgSrc)?(de(),ve("img",{key:0,src:V(t).imgSrc,alt:V(t).title,class:"w-full rounded-lg object-cover max-h-48 mb-4"},null,8,Ig)):mt("",!0),k("div",{innerHTML:s.value},null,8,Mg)]),k("a",{href:V(t).url??void 0,target:"_blank",rel:"noopener noreferrer",class:qe(["inline-flex items-center gap-1.5 mt-4 text-sm",V(n)?"text-white/70 hover:text-white":"text-gray-500 hover:text-gray-800"])},[...d[6]||(d[6]=[Du(" Read full article ",-1),k("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)])],10,Og)],2)):V(t).url?(de(),ve("iframe",{ref_key:"iframeRef",ref:i,key:r.value,src:V(t).url,class:"absolute inset-0 w-full h-full border-0",style:{"-ms-overflow-style":"none","scrollbar-width":"none"},title:"Article content",onLoad:a},null,40,Ng)):mt("",!0)])])])):mt("",!0)]),_:1})]))}}),Tl=(e,t)=>{const n=e.__vccOpts||e;for(const[s,i]of t)n[s]=i;return n},$g=Tl(Lg,[["__scopeId","data-v-1860e4c6"]]),Dg=Gu("videoPlayer",()=>{const e=Q(!1),t=Q(""),n=Q(""),s=Q(null);function i(o,l,a){t.value=o,n.value=l,s.value=a??null,e.value=!0}function r(){e.value=!1,t.value="",n.value="",s.value=null}return{isOpen:e,videoUrl:t,title:n,posterUrl:s,open:i,close:r}}),Ug={class:"flex-1 min-h-0 relative flex items-center justify-center"},jg={key:0,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},Fg={class:"w-20 h-20 rounded-full flex items-center justify-center bg-black/40 backdrop-blur-sm"},Hg={key:0,class:"w-10 h-10 text-white",fill:"currentColor",viewBox:"0 0 24 24"},Bg={key:1,class:"w-10 h-10 text-white",fill:"currentColor",viewBox:"0 0 24 24"},Vg={key:0,class:"absolute inset-0 flex items-center justify-center pointer-events-none"},zg={class:"path-glass-card !rounded-none px-4 py-3 space-y-2"},qg={class:"flex items-center gap-3"},Wg={class:"min-w-0 flex-1 max-w-[280px]"},Kg={class:"text-sm font-semibold truncate text-white/90"},Gg={class:"flex items-center gap-2 flex-1 justify-center"},Yg={key:0,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},Xg={key:1,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},Jg={class:"text-xs font-mono tabular-nums text-white/40 ml-1"},Qg={class:"flex items-center gap-1 shrink-0"},Zg={class:"h-16 bg-gradient-to-b from-black/60 to-transparent flex items-start justify-end px-4 pt-3"},ey=Hn({__name:"VideoPlayerOverlay",setup(e){const t=Dg(),n=Q(null),s=Q(null),i=Q(null),r=Q(!1),o=Q(!1),l=Q(0),a=Q(0),c=Q(0),u=Q(!0),f=Q(!1);let d=null,p=null,v=null,b=null,I=!1;const x=[];function w(){return I?Promise.resolve():new Promise(X=>{if(window.YT?.Player){I=!0,X();return}if(x.push(X),!document.getElementById("yt-iframe-api")){const J=document.createElement("script");J.id="yt-iframe-api",J.src="https://www.youtube.com/iframe_api",document.head.appendChild(J),window.onYouTubeIframeAPIReady=()=>{I=!0,x.forEach(ce=>ce()),x.length=0}}})}function E(X){const J=X.match(/\/embed\/([a-zA-Z0-9_-]{11})/);if(J)return J[1];const ce=X.match(/[?&]v=([a-zA-Z0-9_-]{11})/);if(ce)return ce[1];const Re=X.match(/youtu\.be\/([a-zA-Z0-9_-]{11})/);return Re?Re[1]:null}async function T(X){const J=E(X);if(!J||!s.value)return;o.value=!0,await w();const ce=window.YT,Re=document.createElement("div");Re.id="yt-video-player",s.value.innerHTML="",s.value.appendChild(Re),v=new ce.Player("yt-video-player",{videoId:J,width:"100%",height:"100%",playerVars:{autoplay:1,controls:0,modestbranding:1,rel:0,showinfo:0,iv_load_policy:3,fs:0,playsinline:1},events:{onReady:()=>{o.value=!1,r.value=!0,M(),pe()},onStateChange:C=>{const q=C.data;r.value=q===1,o.value=q===3,q===0&&(r.value=!1,u.value=!0)}}})}function M(){p&&cancelAnimationFrame(p);function X(){v?.getCurrentTime&&v?.getDuration&&(l.value=v.getCurrentTime()??0,a.value=v.getDuration()??0,c.value=a.value>0?l.value/a.value*100:0),p=requestAnimationFrame(X)}X()}function $(){p&&(cancelAnimationFrame(p),p=null)}function G(){if($(),v?.destroy)try{v.destroy()}catch{}v=null,s.value&&(s.value.innerHTML=""),r.value=!1,o.value=!1,l.value=0,a.value=0,c.value=0}function L(){v&&(r.value?v.pauseVideo():v.playVideo(),Ae())}function S(X){if(!v?.seekTo)return;const J=Math.max(0,Math.min(a.value,l.value+X));v.seekTo(J,!0),pe()}function P(X){if(!v?.seekTo||a.value<=0)return;const J=X/100*a.value;v.seekTo(J,!0)}function D(X){if(!i.value)return;const J=i.value.getBoundingClientRect(),ce=Math.max(0,Math.min(100,(X.clientX-J.left)/J.width*100));P(ce)}let F=!1;function se(X){F=!0,D(X);const J=Re=>{F&&D(Re)},ce=()=>{F=!1,window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",ce)};window.addEventListener("mousemove",J),window.addEventListener("mouseup",ce)}function be(){n.value&&(document.fullscreenElement?document.exitFullscreen():n.value.requestFullscreen())}function je(){G(),t.close()}function Ae(){f.value=!0,b&&clearTimeout(b),b=setTimeout(()=>{f.value=!1},600)}function fe(X){const J=X.target;(J===n.value||J.closest(".flex-1.min-h-0"))&&L()}function pe(){u.value=!0,At()}function At(){d&&clearTimeout(d),d=setTimeout(()=>{r.value&&(u.value=!1)},3e3)}function kt(X){if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),je();return}if(X.key===" "||X.key==="k"){X.preventDefault(),L(),pe();return}if(X.key==="ArrowLeft"){X.preventDefault(),S(-10);return}if(X.key==="ArrowRight"){X.preventDefault(),S(10);return}if(X.key==="f"){X.preventDefault(),be();return}}function Ee(X){const J=Math.floor(X),ce=Math.floor(J/3600),Re=Math.floor(J%3600/60),C=J%60;return ce>0?`${ce}:${String(Re).padStart(2,"0")}:${String(C).padStart(2,"0")}`:`${Re}:${String(C).padStart(2,"0")}`}function We(X){X.key==="Escape"&&t.isOpen&&(X.preventDefault(),X.stopPropagation(),je())}return Ht(()=>t.isOpen,async X=>{X?(await ss(),n.value?.focus(),T(t.videoUrl),pe()):G()}),is(()=>{window.addEventListener("keydown",We,!0)}),Mr(()=>{G(),window.removeEventListener("keydown",We,!0),d&&clearTimeout(d),b&&clearTimeout(b)}),(X,J)=>(de(),Un(dl,{to:"body"},[Ne(gr,{name:"video-player"},{default:di(()=>[V(t).isOpen?(de(),ve("div",{key:0,ref_key:"containerRef",ref:n,class:qe(["fixed inset-0 z-[2500] flex flex-col bg-black",u.value?"":"cursor-none"]),onMousemove:pe,onTouchstartPassive:pe,onKeydown:kt,onClick:fe,tabindex:"0"},[k("div",Ug,[k("div",{ref_key:"playerRef",ref:s,class:"w-full h-full"},null,512),Ne(gr,{name:"center-icon"},{default:di(()=>[f.value?(de(),ve("div",jg,[k("div",Fg,[r.value?(de(),ve("svg",Hg,[...J[2]||(J[2]=[k("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(de(),ve("svg",Bg,[...J[3]||(J[3]=[k("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))])])):mt("",!0)]),_:1}),o.value?(de(),ve("div",Vg,[...J[4]||(J[4]=[k("svg",{class:"w-12 h-12 animate-spin text-white/60",fill:"none",viewBox:"0 0 24 24"},[k("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),k("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})],-1)])])):mt("",!0)]),k("div",{class:qe(["absolute bottom-0 left-0 right-0 transition-all duration-300 z-20",u.value?"opacity-100 translate-y-0":"opacity-0 translate-y-4"])},[J[13]||(J[13]=k("div",{class:"h-24 bg-gradient-to-t from-black/80 to-transparent pointer-events-none"},null,-1)),k("div",zg,[k("div",{ref_key:"scrubberRef",ref:i,class:"group w-full h-1.5 rounded-full cursor-pointer bg-white/15 transition-all hover:h-2.5",onClick:D,onMousedown:se},[k("div",{class:"h-full bg-accent rounded-full transition-[width] duration-75 relative",style:Dn({width:`${c.value}%`})},[...J[5]||(J[5]=[k("div",{class:"absolute right-0 top-1/2 -translate-y-1/2 w-3 h-3 rounded-full bg-white shadow-md opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)])],4)],544),k("div",qg,[k("div",Wg,[k("p",Kg,tt(V(t).title),1),J[6]||(J[6]=k("p",{class:"text-xs truncate text-white/40"},"Free Documentary",-1))]),k("div",Gg,[k("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/70 hover:text-white/90 transition-all hover:scale-105 active:scale-95","aria-label":"Rewind 10 seconds",onClick:J[0]||(J[0]=dn(ce=>S(-10),["stop"]))},[...J[7]||(J[7]=[k("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[k("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"})],-1)])]),k("button",{class:"w-12 h-12 rounded-full flex items-center justify-center glass-button shrink-0 transition-all hover:scale-105 active:scale-95","aria-label":"Play or pause",onClick:dn(L,["stop"])},[r.value?(de(),ve("svg",Yg,[...J[8]||(J[8]=[k("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(de(),ve("svg",Xg,[...J[9]||(J[9]=[k("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),k("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/70 hover:text-white/90 transition-all hover:scale-105 active:scale-95","aria-label":"Forward 10 seconds",onClick:J[1]||(J[1]=dn(ce=>S(10),["stop"]))},[...J[10]||(J[10]=[k("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[k("path",{d:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8h-2z"})],-1)])]),k("span",Jg,tt(Ee(l.value))+" / "+tt(Ee(a.value)),1)]),k("div",Qg,[k("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/60 hover:text-white/90 transition-colors","aria-label":"Toggle fullscreen",onClick:dn(be,["stop"])},[...J[11]||(J[11]=[k("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})],-1)])]),k("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/60 hover:text-white/90 transition-colors","aria-label":"Close video player",onClick:dn(je,["stop"])},[...J[12]||(J[12]=[k("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])])])],2),k("div",{class:qe(["absolute top-0 left-0 right-0 transition-all duration-300 z-20",u.value?"opacity-100 translate-y-0":"opacity-0 -translate-y-4"])},[k("div",Zg,[k("button",{class:"min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center text-white/70 hover:text-white/90 hover:bg-white/10 transition-colors","aria-label":"Close",onClick:dn(je,["stop"])},[...J[14]||(J[14]=[k("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])],2)],34)):mt("",!0)]),_:1})]))}}),ty=Tl(ey,[["__scopeId","data-v-1316aff3"]]);function K(e,t,n){return(t=sy(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ny(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sy(e){var t=ny(e,"string");return typeof t=="symbol"?t:t+""}function iy(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fc(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function ry(e,t,n){return t&&fc(e.prototype,t),n&&fc(e,n),e}function oy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function hc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dc(Object(n),!0).forEach(function(s){oy(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}var pc={addCSS:!0,thumbWidth:15,watch:!0};function ly(e,t){return(function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function ay(e,t){if(e&&t){var n=new Event(t,{bubbles:!0});e.dispatchEvent(n)}}var Ii=function(e){return e!=null?e.constructor:null},El=function(e,t){return!!(e&&t&&e instanceof t)},pf=function(e){return e==null},mf=function(e){return Ii(e)===Object},cy=function(e){return Ii(e)===Number&&!Number.isNaN(e)},gf=function(e){return Ii(e)===String},uy=function(e){return Ii(e)===Boolean},fy=function(e){return Ii(e)===Function},yf=function(e){return Array.isArray(e)},bf=function(e){return El(e,NodeList)},dy=function(e){return El(e,Element)},hy=function(e){return El(e,Event)},py=function(e){return pf(e)||(gf(e)||yf(e)||bf(e))&&!e.length||mf(e)&&!Object.keys(e).length},ut={nullOrUndefined:pf,object:mf,number:cy,string:gf,boolean:uy,function:fy,array:yf,nodeList:bf,element:dy,event:hy,empty:py};function my(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function gy(e,t){if(1>t){var n=my(t);return parseFloat(e.toFixed(n))}return Math.round(e/t)*t}var yy=(function(){function e(t,n){iy(this,e),ut.element(t)?this.element=t:ut.string(t)&&(this.element=document.querySelector(t)),ut.element(this.element)&&ut.empty(this.element.rangeTouch)&&(this.config=hc({},pc,{},n),this.init())}return ry(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(t){var n=this,s=t?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(i){n.element[s](i,function(r){return n.set(r)},!1)})}},{key:"get",value:function(t){if(!e.enabled||!ut.event(t))return null;var n,s=t.target,i=t.changedTouches[0],r=parseFloat(s.getAttribute("min"))||0,o=parseFloat(s.getAttribute("max"))||100,l=parseFloat(s.getAttribute("step"))||1,a=s.getBoundingClientRect(),c=100/a.width*(this.config.thumbWidth/2)/100;return 0>(n=100/a.width*(i.clientX-a.left))?n=0:100<n&&(n=100),50>n?n-=(100-2*n)*c:50<n&&(n+=2*(n-50)*c),r+gy(n/100*(o-r),l)}},{key:"set",value:function(t){e.enabled&&ut.event(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),ay(t.target,t.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(t){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},s=null;if(ut.empty(t)||ut.string(t)?s=Array.from(document.querySelectorAll(ut.string(t)?t:'input[type="range"]')):ut.element(t)?s=[t]:ut.nodeList(t)?s=Array.from(t):ut.array(t)&&(s=t.filter(ut.element)),ut.empty(s))return null;var i=hc({},pc,{},n);if(ut.string(t)&&i.watch){var r=new MutationObserver(function(o){Array.from(o).forEach(function(l){Array.from(l.addedNodes).forEach(function(a){ut.element(a)&&ly(a,t)&&new e(a,i)})})});r.observe(document.body,{childList:!0,subtree:!0})}return s.map(function(o){return new e(o,n)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e})();const Mi=e=>e!==null&&typeof e<"u"?e.constructor:null,_n=(e,t)=>!!(e&&t&&e instanceof t),xl=e=>e===null||typeof e>"u",vf=e=>Mi(e)===Object,by=e=>Mi(e)===Number&&!Number.isNaN(e),Fr=e=>Mi(e)===String,vy=e=>Mi(e)===Boolean,wf=e=>typeof e=="function",_f=e=>Array.isArray(e),wy=e=>_n(e,WeakMap),Tf=e=>_n(e,NodeList),_y=e=>Mi(e)===Text,Ty=e=>_n(e,Event),Ey=e=>_n(e,KeyboardEvent),xy=e=>_n(e,window.TextTrackCue)||_n(e,window.VTTCue),Ay=e=>_n(e,TextTrack)||!xl(e)&&Fr(e.kind),ky=e=>_n(e,Promise)&&wf(e.then);function Cy(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}function Ef(e){return xl(e)||(Fr(e)||_f(e)||Tf(e))&&!e.length||vf(e)&&!Object.keys(e).length}function Sy(e){if(_n(e,window.URL))return!0;if(!Fr(e))return!1;let t=e;(!e.startsWith("http://")||!e.startsWith("https://"))&&(t=`http://${e}`);try{return!Ef(new URL(t).hostname)}catch{return!1}}var h={nullOrUndefined:xl,object:vf,number:by,string:Fr,boolean:vy,function:wf,array:_f,weakMap:wy,nodeList:Tf,element:Cy,textNode:_y,event:Ty,keyboardEvent:Ey,cue:xy,track:Ay,promise:ky,url:Sy,empty:Ef};const Wo=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n=Object.keys(t).find(s=>e.style[s]!==void 0);return h.string(n)?t[n]:!1})();function xf(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}function Py(e){return JSON.parse(JSON.stringify(e))}function Af(e,t){return t.split(".").reduce((n,s)=>n&&n[s],e)}function Ve(e={},...t){if(!t.length)return e;const n=t.shift();return h.object(n)?(Object.keys(n).forEach(s=>{h.object(n[s])?(Object.keys(e).includes(s)||Object.assign(e,{[s]:{}}),Ve(e[s],n[s])):Object.assign(e,{[s]:n[s]})}),Ve(e,...t)):e}function kf(e,t){const n=e.length?e:[e];Array.from(n).reverse().forEach((s,i)=>{const r=i>0?t.cloneNode(!0):t,o=s.parentNode,l=s.nextSibling;r.appendChild(s),l?o.insertBefore(r,l):o.appendChild(r)})}function Ko(e,t){!h.element(e)||h.empty(t)||Object.entries(t).filter(([,n])=>!h.nullOrUndefined(n)).forEach(([n,s])=>e.setAttribute(n,s))}function le(e,t,n){const s=document.createElement(e);return h.object(t)&&Ko(s,t),h.string(n)&&(s.textContent=n),s}function Ry(e,t){!h.element(e)||!h.element(t)||t.parentNode.insertBefore(e,t.nextSibling)}function mc(e,t,n,s){h.element(t)&&t.appendChild(le(e,n,s))}function mn(e){if(h.nodeList(e)||h.array(e)){Array.from(e).forEach(mn);return}!h.element(e)||!h.element(e.parentNode)||e.parentNode.removeChild(e)}function ir(e){if(!h.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function br(e,t){return!h.element(t)||!h.element(t.parentNode)||!h.element(e)?null:(t.parentNode.replaceChild(e,t),e)}function Zt(e,t){if(!h.string(e)||h.empty(e))return{};const n={},s=Ve({},t);return e.split(",").forEach(i=>{const r=i.trim(),o=r.replace(".",""),a=r.replace(/[[\]]/g,"").split("="),[c]=a,u=a.length>1?a[1].replace(/["']/g,""):"";switch(r.charAt(0)){case".":h.string(s.class)?n.class=`${s.class} ${o}`:n.class=o;break;case"#":n.id=r.replace("#","");break;case"[":n[c]=u;break}}),Ve(s,n)}function Gn(e,t){if(!h.element(e))return;let n=t;h.boolean(n)||(n=!e.hidden),e.hidden=n}function Pe(e,t,n){if(h.nodeList(e))return Array.from(e).map(s=>Pe(s,t,n));if(h.element(e)){let s="toggle";return typeof n<"u"&&(s=n?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function vr(e,t){return h.element(e)&&e.classList.contains(t)}function es(e,t){const{prototype:n}=Element;function s(){return Array.from(document.querySelectorAll(t)).includes(this)}return(n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||s).call(e,t)}function Iy(e,t){const{prototype:n}=Element;function s(){let r=this;do{if(es.matches(r,t))return r;r=r.parentElement||r.parentNode}while(r!==null&&r.nodeType===1);return null}return(n.closest||s).call(e,t)}function wi(e){return this.elements.container.querySelectorAll(e)}function Xe(e){return this.elements.container.querySelector(e)}function bo(e=null,t=!1){h.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const gc={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},ze={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const n=ze[e]||t!=="html5",s=n&&ze.rangeInput;return{api:n,ui:s}},pip:document.pictureInPictureEnabled&&!le("video").disablePictureInPicture,airplay:h.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(h.empty(e))return!1;const[t]=e.split("/");let n=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(gc).includes(n)&&(n+=`; codecs="${gc[e]}"`);try{return!!(n&&this.media.canPlayType(n).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range",e.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:Wo!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},My=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get(){return e=!0,null}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function _i(e,t,n,s=!1,i=!0,r=!1){if(!e||!("addEventListener"in e)||h.empty(t)||!h.function(n))return;const o=t.split(" ");let l=r;My&&(l={passive:i,capture:r}),o.forEach(a=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:a,callback:n,options:l}),e[s?"addEventListener":"removeEventListener"](a,n,l)})}function _e(e,t="",n,s=!0,i=!1){_i.call(this,e,t,n,!0,s,i)}function Hr(e,t="",n,s=!0,i=!1){_i.call(this,e,t,n,!1,s,i)}function Al(e,t="",n,s=!0,i=!1){const r=(...o)=>{Hr(e,t,r,s,i),n.apply(this,o)};_i.call(this,e,t,r,!0,s,i)}function ae(e,t="",n=!1,s={}){if(!h.element(e)||h.empty(t))return;const i=new CustomEvent(t,{bubbles:n,detail:{...s,plyr:this}});e.dispatchEvent(i)}function Oy(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:n,callback:s,options:i}=e;t.removeEventListener(n,s,i)}),this.eventListeners=[])}function Ny(){return new Promise(e=>this.ready?setTimeout(e,0):_e.call(this,this.elements.container,"ready",e)).then(()=>{})}function nn(e){h.promise(e)&&e.then(null,()=>{})}function Go(e){return h.array(e)?e.filter((t,n)=>e.indexOf(t)===n):e}function Cf(e,t){return!h.array(e)||!e.length?null:e.reduce((n,s)=>Math.abs(s-t)<Math.abs(n-t)?s:n)}function Sf(e){return!window||!window.CSS?!1:window.CSS.supports(e)}const yc=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[t,n])=>({...e,[t/n]:[t,n]}),{});function Pf(e){return!h.array(e)&&(!h.string(e)||!e.includes(":"))?!1:(h.array(e)?e:e.split(":")).map(Number).every(h.number)}function wr(e){if(!h.array(e)||!e.every(h.number))return null;const[t,n]=e,s=(r,o)=>o===0?r:s(o,r%o),i=s(t,n);return[t/i,n/i]}function kl(e){const t=s=>Pf(s)?s.split(":").map(Number):null;let n=t(e);if(n===null&&(n=t(this.config.ratio)),n===null&&!h.empty(this.embed)&&h.array(this.embed.ratio)&&({ratio:n}=this.embed),n===null&&this.isHTML5){const{videoWidth:s,videoHeight:i}=this.media;n=[s,i]}return wr(n)}function Cs(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,n=kl.call(this,e);if(!h.array(n))return{};const[s,i]=wr(n),r=Sf(`aspect-ratio: ${s}/${i}`),o=100/s*i;if(r?t.style.aspectRatio=`${s}/${i}`:t.style.paddingBottom=`${o}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const l=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),a=(l-o)/(l/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${a}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:o,ratio:n}}function Rf(e,t,n=.05){const s=e/t,i=Cf(Object.keys(yc),s);return Math.abs(i-s)<=n?yc[i]:[e,t]}function Ly(){const e=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0);return[e,t]}const Ln={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(t=>{const n=t.getAttribute("type");return h.empty(n)?!0:ze.mime.call(this,n)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ln.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,h.empty(this.config.ratio)||Cs.call(e),Object.defineProperty(e.media,"quality",{get(){const n=Ln.getSources.call(e).find(s=>s.getAttribute("src")===e.source);return n&&Number(n.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&h.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const s=Ln.getSources.call(e).find(c=>Number(c.getAttribute("size"))===t);if(!s)return;const{currentTime:i,paused:r,preload:o,readyState:l,playbackRate:a}=e.media;e.media.src=s.getAttribute("src"),(o!=="none"||l)&&(e.once("loadedmetadata",()=>{e.speed=a,e.currentTime=i,r||nn(e.play())}),e.media.load())}ae.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(mn(Ln.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}},$y=!!window.document.documentMode,Dy=/Edge/.test(navigator.userAgent),Uy="WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),jy=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,Fy=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var ot={isIE:$y,isEdge:Dy,isWebKit:Uy,isIPadOS:jy,isIos:Fy};function Hy(e){return`${e}-${Math.floor(Math.random()*1e4)}`}function Yo(e,...t){return h.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(n,s)=>t[s].toString())}function By(e,t){return e===0||t===0||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)}function ai(e="",t="",n=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),n.toString())}function If(e=""){return e.toString().replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())}function Vy(e=""){let t=e.toString();return t=ai(t,"-"," "),t=ai(t,"_"," "),t=If(t),ai(t," ","")}function zy(e=""){let t=e.toString();return t=Vy(t),t.charAt(0).toLowerCase()+t.slice(1)}function qy(e){const t=document.createDocumentFragment(),n=document.createElement("div");return t.appendChild(n),n.innerHTML=e,t.firstChild.textContent}function Wy(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const bc={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},et={get(e="",t={}){if(h.empty(e)||h.empty(t))return"";let n=Af(t.i18n,e);if(h.empty(n))return Object.keys(bc).includes(e)?bc[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach(([i,r])=>{n=ai(n,i,r)}),n}};class Ti{constructor(t){K(this,"get",n=>{if(!Ti.supported||!this.enabled)return null;const s=window.localStorage.getItem(this.key);if(h.empty(s))return null;const i=JSON.parse(s);return h.string(n)&&n.length?i[n]:i}),K(this,"set",n=>{if(!Ti.supported||!this.enabled||!h.object(n))return;let s=this.get();h.empty(s)&&(s={}),Ve(s,n);try{window.localStorage.setItem(this.key,JSON.stringify(s))}catch{}}),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const t="___test";return window.localStorage.setItem(t,t),window.localStorage.removeItem(t),!0}catch{return!1}}}function Oi(e,t="text",n=!1){return new Promise((s,i)=>{try{const r=new XMLHttpRequest;if(!("withCredentials"in r))return;n&&(r.withCredentials=!0),r.addEventListener("load",()=>{if(t==="text")try{s(JSON.parse(r.responseText))}catch{s(r.responseText)}else s(r.response)}),r.addEventListener("error",()=>{throw new Error(r.status)}),r.open("GET",e,!0),r.responseType=t,r.send()}catch(r){i(r)}})}function Mf(e,t){if(!h.string(e))return;const n="cache",s=h.string(t);let i=!1;const r=()=>document.getElementById(t)!==null,o=(l,a)=>{l.innerHTML=a,!(s&&r())&&document.body.insertAdjacentElement("afterbegin",l)};if(!s||!r()){const l=Ti.supported,a=document.createElement("div");if(a.setAttribute("hidden",""),s&&a.setAttribute("id",t),l){const c=window.localStorage.getItem(`${n}-${t}`);if(i=c!==null,i){const u=JSON.parse(c);o(a,u.content)}}Oi(e).then(c=>{if(!h.empty(c)){if(l)try{window.localStorage.setItem(`${n}-${t}`,JSON.stringify({content:c}))}catch{}o(a,c)}}).catch(()=>{})}}const Of=e=>Math.trunc(e/60/60%60,10),Ky=e=>Math.trunc(e/60%60,10),Gy=e=>Math.trunc(e%60,10);function Br(e=0,t=!1,n=!1){if(!h.number(e))return Br(void 0,t,n);const s=l=>`0${l}`.slice(-2);let i=Of(e);const r=Ky(e),o=Gy(e);return t||i>0?i=`${i}:`:i="",`${n&&e>0?"-":""}${i}${s(r)}:${s(o)}`}const z={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,n=e.host!==t||ot.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:n}},findElements(){try{return this.elements.controls=Xe.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:wi.call(this,this.config.selectors.buttons.play),pause:Xe.call(this,this.config.selectors.buttons.pause),restart:Xe.call(this,this.config.selectors.buttons.restart),rewind:Xe.call(this,this.config.selectors.buttons.rewind),fastForward:Xe.call(this,this.config.selectors.buttons.fastForward),mute:Xe.call(this,this.config.selectors.buttons.mute),pip:Xe.call(this,this.config.selectors.buttons.pip),airplay:Xe.call(this,this.config.selectors.buttons.airplay),settings:Xe.call(this,this.config.selectors.buttons.settings),captions:Xe.call(this,this.config.selectors.buttons.captions),fullscreen:Xe.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Xe.call(this,this.config.selectors.progress),this.elements.inputs={seek:Xe.call(this,this.config.selectors.inputs.seek),volume:Xe.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Xe.call(this,this.config.selectors.display.buffer),currentTime:Xe.call(this,this.config.selectors.display.currentTime),duration:Xe.call(this,this.config.selectors.display.duration)},h.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const n="http://www.w3.org/2000/svg",s=z.getIconUrl.call(this),i=`${s.cors?"":s.url}#${this.config.iconPrefix}`,r=document.createElementNS(n,"svg");Ko(r,Ve(t,{"aria-hidden":"true",focusable:"false"}));const o=document.createElementNS(n,"use"),l=`${i}-${e}`;return"href"in o&&o.setAttributeNS("http://www.w3.org/1999/xlink","href",l),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l),r.appendChild(o),r},createLabel(e,t={}){const n=et.get(e,this.config),s={...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")};return le("span",s,n)},createBadge(e){if(h.empty(e))return null;const t=le("span",{class:this.config.classNames.menu.value});return t.appendChild(le("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const n=Ve({},t);let s=zy(e);const i={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(o=>{Object.keys(n).includes(o)&&(i[o]=n[o],delete n[o])}),i.element==="button"&&!Object.keys(n).includes("type")&&(n.type="button"),Object.keys(n).includes("class")?n.class.split(" ").includes(this.config.classNames.control)||Ve(n,{class:`${n.class} ${this.config.classNames.control}`}):n.class=this.config.classNames.control,e){case"play":i.toggle=!0,i.label="play",i.labelPressed="pause",i.icon="play",i.iconPressed="pause";break;case"mute":i.toggle=!0,i.label="mute",i.labelPressed="unmute",i.icon="volume",i.iconPressed="muted";break;case"captions":i.toggle=!0,i.label="enableCaptions",i.labelPressed="disableCaptions",i.icon="captions-off",i.iconPressed="captions-on";break;case"fullscreen":i.toggle=!0,i.label="enterFullscreen",i.labelPressed="exitFullscreen",i.icon="enter-fullscreen",i.iconPressed="exit-fullscreen";break;case"play-large":n.class+=` ${this.config.classNames.control}--overlaid`,s="play",i.label="play",i.icon="play";break;default:h.empty(i.label)&&(i.label=s),h.empty(i.icon)&&(i.icon=e)}const r=le(i.element);return i.toggle?(r.appendChild(z.createIcon.call(this,i.iconPressed,{class:"icon--pressed"})),r.appendChild(z.createIcon.call(this,i.icon,{class:"icon--not-pressed"})),r.appendChild(z.createLabel.call(this,i.labelPressed,{class:"label--pressed"})),r.appendChild(z.createLabel.call(this,i.label,{class:"label--not-pressed"}))):(r.appendChild(z.createIcon.call(this,i.icon)),r.appendChild(z.createLabel.call(this,i.label))),Ve(n,Zt(this.config.selectors.buttons[s],n)),Ko(r,n),s==="play"?(h.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(r)):this.elements.buttons[s]=r,r},createRange(e,t){const n=le("input",Ve(Zt(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":et.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=n,z.updateRangeFill.call(this,n),yy.setup(n),n},createProgress(e,t){const n=le("progress",Ve(Zt(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if(e!=="volume"){n.appendChild(le("span",null,"0"));const s={played:"played",buffer:"buffered"}[e],i=s?et.get(s,this.config):"";n.textContent=`% ${i.toLowerCase()}`}return this.elements.display[e]=n,n},createTime(e,t){const n=Zt(this.config.selectors.display[e],t),s=le("div",Ve(n,{class:`${n.class?n.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":et.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){_e.call(this,e,"keydown keyup",n=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(n.key)||(n.preventDefault(),n.stopPropagation(),n.type==="keydown"))return;const s=es(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(n.key))z.showMenuPanel.call(this,t,!0);else{let i;n.key!==" "&&(n.key==="ArrowDown"||s&&n.key==="ArrowRight"?(i=e.nextElementSibling,h.element(i)||(i=e.parentNode.firstElementChild)):(i=e.previousElementSibling,h.element(i)||(i=e.parentNode.lastElementChild)),bo.call(this,i,!0))}},!1),_e.call(this,e,"keyup",n=>{n.key==="Return"&&z.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:n,title:s,badge:i=null,checked:r=!1}){const o=Zt(this.config.selectors.inputs[n]),l=le("button",Ve(o,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${o.class?o.class:""}`.trim(),"aria-checked":r,value:e})),a=le("span");a.innerHTML=s,h.element(i)&&a.appendChild(i),l.appendChild(a),Object.defineProperty(l,"checked",{enumerable:!0,get(){return l.getAttribute("aria-checked")==="true"},set(c){c&&Array.from(l.parentNode.children).filter(u=>es(u,'[role="menuitemradio"]')).forEach(u=>u.setAttribute("aria-checked","false")),l.setAttribute("aria-checked",c?"true":"false")}}),this.listeners.bind(l,"click keyup",c=>{if(!(h.keyboardEvent(c)&&c.key!==" ")){switch(c.preventDefault(),c.stopPropagation(),l.checked=!0,n){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e);break}z.showMenuPanel.call(this,"home",h.keyboardEvent(c))}},n,!1),z.bindMenuItemShortcuts.call(this,l,n),t.appendChild(l)},formatTime(e=0,t=!1){if(!h.number(e))return e;const n=Of(this.duration)>0;return Br(e,n,t)},updateTimeDisplay(e=null,t=0,n=!1){!h.element(e)||!h.number(t)||(e.textContent=z.formatTime(t,n))},updateVolume(){this.supported.ui&&(h.element(this.elements.inputs.volume)&&z.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),h.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,t=0){h.element(e)&&(e.value=t,z.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!h.event(e))return;let t=0;const n=(s,i)=>{const r=h.number(i)?i:0,o=h.element(s)?s:this.elements.display.buffer;if(h.element(o)){o.value=r;const l=o.getElementsByTagName("span")[0];h.element(l)&&(l.childNodes[0].nodeValue=r)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":t=By(this.currentTime,this.duration),e.type==="timeupdate"&&z.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":n(this.elements.display.buffer,this.buffered*100);break}},updateRangeFill(e){const t=h.event(e)?e.target:e;if(!(!h.element(t)||t.getAttribute("type")!=="range")){if(es(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const n=z.formatTime(this.currentTime),s=z.formatTime(this.duration),i=et.get("seekLabel",this.config);t.setAttribute("aria-valuetext",i.replace("{currentTime}",n).replace("{duration}",s))}else if(es(t,this.config.selectors.inputs.volume)){const n=t.value*100;t.setAttribute("aria-valuenow",n),t.setAttribute("aria-valuetext",`${n.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);!ot.isWebKit&&!ot.isIPadOS||t.style.setProperty("--value",`${t.value/t.max*100}%`)}},updateSeekTooltip(e){var t,n;if(!this.config.tooltips.seek||!h.element(this.elements.inputs.seek)||!h.element(this.elements.display.seekTooltip)||this.duration===0)return;const s=this.elements.display.seekTooltip,i=`${this.config.classNames.tooltip}--visible`,r=u=>Pe(s,i,u);if(this.touch){r(!1);return}let o=0;const l=this.elements.progress.getBoundingClientRect();if(h.event(e)){const u=e.pageX-e.clientX;o=100/l.width*(e.pageX-l.left-u)}else if(vr(s,i))o=Number.parseFloat(s.style.left,10);else return;o<0?o=0:o>100&&(o=100);const a=this.duration/100*o;s.textContent=z.formatTime(a);const c=(t=this.config.markers)===null||t===void 0||(n=t.points)===null||n===void 0?void 0:n.find(({time:u})=>u===Math.round(a));c&&s.insertAdjacentHTML("afterbegin",`${c.label}<br>`),s.style.left=`${o}%`,h.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&r(e.type==="mouseenter")},timeUpdate(e){const t=!h.element(this.elements.display.duration)&&this.config.invertTime;z.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),!(e&&e.type==="timeupdate"&&this.media.seeking)&&z.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32){Gn(this.elements.display.currentTime,!0),Gn(this.elements.progress,!0);return}h.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=h.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&z.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&z.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&z.setMarkers.call(this),z.updateSeekTooltip.call(this)},toggleMenuButton(e,t){Gn(this.elements.settings.buttons[e],!t)},updateSetting(e,t,n){const s=this.elements.settings.panels[e];let i=null,r=t;if(e==="captions")i=this.currentTrack;else{if(i=h.empty(n)?this[e]:n,h.empty(i)&&(i=this.config[e].default),!h.empty(this.options[e])&&!this.options[e].includes(i)){this.debug.warn(`Unsupported value of '${i}' for ${e}`);return}if(!this.config[e].options.includes(i)){this.debug.warn(`Disabled value of '${i}' for ${e}`);return}}if(h.element(r)||(r=s&&s.querySelector('[role="menu"]')),!h.element(r))return;const o=this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`);o.innerHTML=z.getLabel.call(this,e,i);const l=r&&r.querySelector(`[value="${i}"]`);h.element(l)&&(l.checked=!0)},getLabel(e,t){switch(e){case"speed":return t===1?et.get("normal",this.config):`${t}×`;case"quality":if(h.number(t)){const n=et.get(`qualityLabel.${t}`,this.config);return n.length?n:`${t}p`}return If(t);case"captions":return xe.getLabel.call(this);default:return null}},setQualityMenu(e){if(!h.element(this.elements.settings.panels.quality))return;const t="quality",n=this.elements.settings.panels.quality.querySelector('[role="menu"]');h.array(e)&&(this.options.quality=Go(e).filter(r=>this.config.quality.options.includes(r)));const s=!h.empty(this.options.quality)&&this.options.quality.length>1;if(z.toggleMenuButton.call(this,t,s),ir(n),z.checkMenu.call(this),!s)return;const i=r=>{const o=et.get(`qualityBadge.${r}`,this.config);return o.length?z.createBadge.call(this,o):null};this.options.quality.sort((r,o)=>{const l=this.config.quality.options;return l.indexOf(r)>l.indexOf(o)?1:-1}).forEach(r=>{z.createMenuItem.call(this,{value:r,list:n,type:t,title:z.getLabel.call(this,"quality",r),badge:i(r)})}),z.updateSetting.call(this,t,n)},setCaptionsMenu(){if(!h.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),n=xe.getTracks.call(this),s=!!n.length;if(z.toggleMenuButton.call(this,e,s),ir(t),z.checkMenu.call(this),!s)return;const i=n.map((r,o)=>({value:o,checked:this.captions.toggled&&this.currentTrack===o,title:xe.getLabel.call(this,r),badge:r.language&&z.createBadge.call(this,r.language.toUpperCase()),list:t,type:"language"}));i.unshift({value:-1,checked:!this.captions.toggled,title:et.get("disabled",this.config),list:t,type:"language"}),i.forEach(z.createMenuItem.bind(this)),z.updateSetting.call(this,e,t)},setSpeedMenu(){if(!h.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(s=>s>=this.minimumSpeed&&s<=this.maximumSpeed);const n=!h.empty(this.options.speed)&&this.options.speed.length>1;z.toggleMenuButton.call(this,e,n),ir(t),z.checkMenu.call(this),n&&(this.options.speed.forEach(s=>{z.createMenuItem.call(this,{value:s,list:t,type:e,title:z.getLabel.call(this,"speed",s)})}),z.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!h.empty(e)&&Object.values(e).some(n=>!n.hidden);Gn(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let n=e;h.element(n)||(n=Object.values(this.elements.settings.panels).find(i=>!i.hidden));const s=n.querySelector('[role^="menuitem"]');bo.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,n=this.elements.buttons.settings;if(!h.element(t)||!h.element(n))return;const{hidden:s}=t;let i=s;if(h.boolean(e))i=e;else if(h.keyboardEvent(e)&&e.key==="Escape")i=!1;else if(h.event(e)){const r=h.function(e.composedPath)?e.composedPath()[0]:e.target,o=t.contains(r);if(o||!o&&e.target!==n&&i)return}n.setAttribute("aria-expanded",i),Gn(t,!i),Pe(this.elements.container,this.config.classNames.menu.open,i),i&&h.keyboardEvent(e)?z.focusFirstMenuItem.call(this,null,!0):!i&&!s&&bo.call(this,n,h.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const n=t.scrollWidth,s=t.scrollHeight;return mn(t),{width:n,height:s}},showMenuPanel(e="",t=!1){const n=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!h.element(n))return;const s=n.parentNode,i=Array.from(s.children).find(r=>!r.hidden);if(ze.transitions&&!ze.reducedMotion){s.style.width=`${i.scrollWidth}px`,s.style.height=`${i.scrollHeight}px`;const r=z.getMenuSize.call(this,n),o=l=>{l.target!==s||!["width","height"].includes(l.propertyName)||(s.style.width="",s.style.height="",Hr.call(this,s,Wo,o))};_e.call(this,s,Wo,o),s.style.width=`${r.width}px`,s.style.height=`${r.height}px`}Gn(i,!0),Gn(n,!1),z.focusFirstMenuItem.call(this,n,t)},setDownloadUrl(){const e=this.elements.buttons.download;h.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:n,createProgress:s,createRange:i,createTime:r,setQualityMenu:o,setSpeedMenu:l,showMenuPanel:a}=z;this.elements.controls=null,h.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(n.call(this,"play-large"));const c=le("div",Zt(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return Go(h.array(this.config.controls)?this.config.controls:[]).forEach(f=>{if(f==="restart"&&c.appendChild(n.call(this,"restart",u)),f==="rewind"&&c.appendChild(n.call(this,"rewind",u)),f==="play"&&c.appendChild(n.call(this,"play",u)),f==="fast-forward"&&c.appendChild(n.call(this,"fast-forward",u)),f==="progress"){const d=le("div",{class:`${u.class} plyr__progress__container`}),p=le("div",Zt(this.config.selectors.progress));if(p.appendChild(i.call(this,"seek",{id:`plyr-seek-${e.id}`})),p.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const v=le("span",{class:this.config.classNames.tooltip},"00:00");p.appendChild(v),this.elements.display.seekTooltip=v}this.elements.progress=p,d.appendChild(this.elements.progress),c.appendChild(d)}if(f==="current-time"&&c.appendChild(r.call(this,"currentTime",u)),f==="duration"&&c.appendChild(r.call(this,"duration",u)),f==="mute"||f==="volume"){let{volume:d}=this.elements;if((!h.element(d)||!c.contains(d))&&(d=le("div",Ve({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=d,c.appendChild(d)),f==="mute"&&d.appendChild(n.call(this,"mute")),f==="volume"&&!ot.isIos&&!ot.isIPadOS){const p={max:1,step:.05,value:this.config.volume};d.appendChild(i.call(this,"volume",Ve(p,{id:`plyr-volume-${e.id}`})))}}if(f==="captions"&&c.appendChild(n.call(this,"captions",u)),f==="settings"&&!h.empty(this.config.settings)){const d=le("div",Ve({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));d.appendChild(n.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const p=le("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),v=le("div"),b=le("div",{id:`plyr-settings-${e.id}-home`}),I=le("div",{role:"menu"});b.appendChild(I),v.appendChild(b),this.elements.settings.panels.home=b,this.config.settings.forEach(x=>{const w=le("button",Ve(Zt(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,w,x),_e.call(this,w,"click",()=>{a.call(this,x,!1)});const E=le("span",null,et.get(x,this.config)),T=le("span",{class:this.config.classNames.menu.value});T.innerHTML=e[x],E.appendChild(T),w.appendChild(E),I.appendChild(w);const M=le("div",{id:`plyr-settings-${e.id}-${x}`,hidden:""}),$=le("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});$.appendChild(le("span",{"aria-hidden":!0},et.get(x,this.config))),$.appendChild(le("span",{class:this.config.classNames.hidden},et.get("menuBack",this.config))),_e.call(this,M,"keydown",G=>{G.key==="ArrowLeft"&&(G.preventDefault(),G.stopPropagation(),a.call(this,"home",!0))},!1),_e.call(this,$,"click",()=>{a.call(this,"home",!1)}),M.appendChild($),M.appendChild(le("div",{role:"menu"})),v.appendChild(M),this.elements.settings.buttons[x]=w,this.elements.settings.panels[x]=M}),p.appendChild(v),d.appendChild(p),c.appendChild(d),this.elements.settings.popup=p,this.elements.settings.menu=d}if(f==="pip"&&ze.pip&&c.appendChild(n.call(this,"pip",u)),f==="airplay"&&ze.airplay&&c.appendChild(n.call(this,"airplay",u)),f==="download"){const d=Ve({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(d.download="");const{download:p}=this.config.urls;!h.url(p)&&this.isEmbed&&Ve(d,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(n.call(this,"download",d))}f==="fullscreen"&&c.appendChild(n.call(this,"fullscreen",u))}),this.isHTML5&&o.call(this,Ln.getQualityOptions.call(this)),l.call(this),c},inject(){if(this.config.loadSprite){const o=z.getIconUrl.call(this);o.cors&&Mf(o.url,"sprite-plyr")}this.id=Math.floor(Math.random()*1e4);let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let n=!0;h.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),h.element(this.config.controls)||h.string(this.config.controls)?e=this.config.controls:(e=z.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:xe.getLabel.call(this)}),n=!1);const s=o=>{let l=o;return Object.entries(t).forEach(([a,c])=>{l=ai(l,`{${a}}`,c)}),l};n&&h.string(this.config.controls)&&(e=s(e));let i;h.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),h.element(i)||(i=this.elements.container);const r=h.element(e)?"insertAdjacentElement":"insertAdjacentHTML";if(i[r]("afterbegin",e),h.element(this.elements.controls)||z.findElements.call(this),!h.empty(this.elements.buttons)){const o=l=>{const a=this.config.classNames.controlPressed;l.setAttribute("aria-pressed","false"),Object.defineProperty(l,"pressed",{configurable:!0,enumerable:!0,get(){return vr(l,a)},set(c=!1){Pe(l,a,c),l.setAttribute("aria-pressed",c?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(l=>{h.array(l)||h.nodeList(l)?Array.from(l).filter(Boolean).forEach(o):o(l)})}if(ot.isEdge&&xf(i),this.config.tooltips.controls){const{classNames:o,selectors:l}=this.config,a=`${l.controls.wrapper} ${l.labels} .${o.hidden}`,c=wi.call(this,a);Array.from(c).forEach(u=>{Pe(u,this.config.classNames.hidden,!1),Pe(u,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const n=(e=this.config.markers)===null||e===void 0||(t=e.points)===null||t===void 0?void 0:t.filter(({time:a})=>a>0&&a<this.duration);if(!(n!=null&&n.length))return;const s=document.createDocumentFragment(),i=document.createDocumentFragment();let r=null;const o=`${this.config.classNames.tooltip}--visible`,l=a=>Pe(r,o,a);n.forEach(a=>{const c=le("span",{class:this.config.classNames.marker},""),u=`${a.time/this.duration*100}%`;r&&(c.addEventListener("mouseenter",()=>{a.label||(r.style.left=u,r.innerHTML=a.label,l(!0))}),c.addEventListener("mouseleave",()=>{l(!1)})),c.addEventListener("click",()=>{this.currentTime=a.time}),c.style.left=u,i.appendChild(c)}),s.appendChild(i),this.config.tooltips.seek||(r=le("span",{class:this.config.classNames.tooltip},""),s.appendChild(r)),this.elements.markers={points:i,tip:r},this.elements.progress.appendChild(s)}};function Nf(e,t=!0){let n=e;if(t){const s=document.createElement("a");s.href=n,n=s.href}try{return new URL(n)}catch{return null}}function Lf(e){const t=new URLSearchParams;return h.object(e)&&Object.entries(e).forEach(([n,s])=>{t.set(n,s)}),t}const xe={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!ze.textTracks){h.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&z.setCaptionsMenu.call(this);return}if(h.element(this.elements.captions)||(this.elements.captions=le("div",Zt(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),Ry(this.elements.captions,this.elements.wrapper)),ot.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(r=>{const o=r.getAttribute("src"),l=Nf(o);l!==null&&l.hostname!==window.location.href.hostname&&["http:","https:"].includes(l.protocol)&&Oi(o,"blob").then(a=>{r.setAttribute("src",window.URL.createObjectURL(a))}).catch(()=>{mn(r)})})}const e=navigator.languages||[navigator.language||navigator.userLanguage||"en"],t=Go(e.map(i=>i.split("-")[0]));let n=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();n==="auto"&&([n]=t);let s=this.storage.get("captions")||this.captions.active;if(h.boolean(s)||({active:s}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:s,language:n,languages:t}),this.isHTML5){const i=this.config.captions.update?"addtrack removetrack":"removetrack";_e.call(this,this.media.textTracks,i,xe.update.bind(this))}setTimeout(xe.update.bind(this),0)},update(){const e=xe.getTracks.call(this,!0),{active:t,language:n,meta:s,currentTrackNode:i}=this.captions,r=!!e.find(o=>o.language===n);this.isHTML5&&this.isVideo&&e.filter(o=>!s.get(o)).forEach(o=>{this.debug.log("Track added",o),s.set(o,{default:o.mode==="showing"}),o.mode==="showing"&&(o.mode="hidden"),_e.call(this,o,"cuechange",()=>xe.updateCues.call(this))}),(r&&this.language!==n||!e.includes(i))&&(xe.setLanguage.call(this,n),xe.toggle.call(this,t&&r)),this.elements&&Pe(this.elements.container,this.config.classNames.captions.enabled,!h.empty(e)),h.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&z.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:n}=this.captions,s=this.config.classNames.captions.active,i=h.nullOrUndefined(e)?!n:e;if(i!==n){if(t||(this.captions.active=i,this.storage.set({captions:i})),!this.language&&i&&!t){const r=xe.getTracks.call(this),o=xe.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);this.captions.language=o.language,xe.set.call(this,r.indexOf(o));return}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=i),Pe(this.elements.container,s,i),this.captions.toggled=i,z.updateSetting.call(this,"captions"),ae.call(this,this.media,i?"captionsenabled":"captionsdisabled")}setTimeout(()=>{i&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const n=xe.getTracks.call(this);if(e===-1){xe.toggle.call(this,!1,t);return}if(!h.number(e)){this.debug.warn("Invalid caption argument",e);return}if(!(e in n)){this.debug.warn("Track not found",e);return}if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=n[e],{language:i}=s||{};this.captions.currentTrackNode=s,z.updateSetting.call(this,"captions"),t||(this.captions.language=i,this.storage.set({language:i})),this.isVimeo&&this.embed.enableTextTrack(i,null,!1),ae.call(this,this.media,"languagechange")}xe.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&xe.updateCues.call(this)},setLanguage(e,t=!0){if(!h.string(e)){this.debug.warn("Invalid language argument",e);return}const n=e.toLowerCase();this.captions.language=n;const s=xe.getTracks.call(this),i=xe.findTrack.call(this,[n]);xe.set.call(this,s.indexOf(i),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(n=>!this.isHTML5||e||this.captions.meta.has(n)).filter(n=>["captions","subtitles"].includes(n.kind))},findTrack(e,t=!1){const n=xe.getTracks.call(this),s=o=>Number((this.captions.meta.get(o)||{}).default),i=Array.from(n).sort((o,l)=>s(l)-s(o));let r;return e.every(o=>(r=i.find(l=>l.language===o),!r)),r||(t?i[0]:void 0)},getCurrentTrack(){return xe.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!h.track(t)&&ze.textTracks&&this.captions.toggled&&(t=xe.getCurrentTrack.call(this)),h.track(t)?h.empty(t.label)?h.empty(t.language)?et.get("enabled",this.config):e.language.toUpperCase():t.label:et.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!h.element(this.elements.captions)){this.debug.warn("No captions element to render to");return}if(!h.nullOrUndefined(e)&&!Array.isArray(e)){this.debug.warn("updateCues: Invalid input",e);return}let t=e;if(!t){const i=xe.getCurrentTrack.call(this);t=Array.from((i||{}).activeCues||[]).map(r=>r.getCueAsHTML()).map(Wy)}const n=t.map(i=>i.trim()).join(`
|
|
`);if(n!==this.elements.captions.innerHTML){ir(this.elements.captions);const i=le("span",Zt(this.config.selectors.caption));i.innerHTML=n,this.elements.captions.appendChild(i),ae.call(this,this.media,"cuechange")}}},$f={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.8.4/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},vo={active:"picture-in-picture",inactive:"inline"},Nn={html5:"html5",youtube:"youtube",vimeo:"vimeo"},wo={audio:"audio",video:"video"};function Yy(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Nn.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Nn.vimeo:null}function _o(){}class Xy{constructor(t=!1){this.enabled=window.console&&t,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):_o}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):_o}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):_o}}class Dt{constructor(t){K(this,"onChange",()=>{if(!this.supported)return;const n=this.player.elements.buttons.fullscreen;h.element(n)&&(n.pressed=this.active);const s=this.target===this.player.media?this.target:this.player.elements.container;ae.call(this.player,s,this.active?"enterfullscreen":"exitfullscreen",!0)}),K(this,"toggleFallback",(n=!1)=>{if(n){var s,i;this.scrollPosition={x:(s=window.scrollX)!==null&&s!==void 0?s:0,y:(i=window.scrollY)!==null&&i!==void 0?i:0}}else window.scrollTo(this.scrollPosition.x,this.scrollPosition.y);if(document.body.style.overflow=n?"hidden":"",Pe(this.target,this.player.config.classNames.fullscreen.fallback,n),ot.isIos){let r=document.head.querySelector('meta[name="viewport"]');const o="viewport-fit=cover";r||(r=document.createElement("meta"),r.setAttribute("name","viewport"));const l=h.string(r.content)&&r.content.includes(o);n?(this.cleanupViewport=!l,l||(r.content+=`,${o}`)):this.cleanupViewport&&(r.content=r.content.split(",").filter(a=>a.trim()!==o).join(","))}this.onChange()}),K(this,"trapFocus",n=>{if(ot.isIos||ot.isIPadOS||!this.active||n.key!=="Tab")return;const s=document.activeElement,i=wi.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[r]=i,o=i[i.length-1];s===o&&!n.shiftKey?(r.focus(),n.preventDefault()):s===r&&n.shiftKey&&(o.focus(),n.preventDefault())}),K(this,"update",()=>{if(this.supported){let n;this.forceFallback?n="Fallback (forced)":Dt.nativeSupported?n="Native":n="Fallback",this.player.debug.log(`${n} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");Pe(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),K(this,"enter",()=>{this.supported&&(ot.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Dt.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?h.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),K(this,"exit",()=>{if(this.supported){if(ot.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),nn(this.player.play());else if(!Dt.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(!this.prefix)(document.cancelFullScreen||document.exitFullscreen).call(document);else if(!h.empty(this.prefix)){const n=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${n}${this.property}`]()}}}),K(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=t,this.prefix=Dt.prefix,this.property=Dt.property,this.scrollPosition={x:0,y:0},this.forceFallback=t.config.fullscreen.fallback==="force",this.player.elements.fullscreen=t.config.fullscreen.container&&Iy(this.player.elements.container,t.config.fullscreen.container),_e.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),_e.call(this.player,this.player.elements.container,"dblclick",n=>{h.element(this.player.elements.controls)&&this.player.elements.controls.contains(n.target)||this.player.listeners.proxy(n,this.toggle,"fullscreen")}),_e.call(this,this.player.elements.container,"keydown",n=>this.trapFocus(n)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return Dt.nativeSupported&&!this.forceFallback}static get prefix(){if(h.function(document.exitFullscreen))return"";let t="";return["webkit","moz","ms"].some(s=>h.function(document[`${s}ExitFullscreen`])||h.function(document[`${s}CancelFullScreen`])?(t=s,!0):!1),t}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,Dt.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Dt.nativeSupported||!ot.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Dt.nativeSupported||this.forceFallback)return vr(this.target,this.player.config.classNames.fullscreen.fallback);const t=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return t&&t.shadowRoot?t===this.target.getRootNode().host:t===this.target}get target(){var t;return ot.isIos&&this.player.config.fullscreen.iosNative?this.player.media:(t=this.player.elements.fullscreen)!==null&&t!==void 0?t:this.player.elements.container}}function rr(e,t=1){return new Promise((n,s)=>{const i=new Image,r=()=>{delete i.onload,delete i.onerror,(i.naturalWidth>=t?n:s)(i)};Object.assign(i,{onload:r,onerror:r,src:e})})}const Ie={addStyleHook(){Pe(this.elements.container,this.config.selectors.container.replace(".",""),!0),Pe(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui){this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),Ie.toggleNativeControls.call(this,!0);return}h.element(this.elements.controls)||(z.inject.call(this),this.listeners.controls()),Ie.toggleNativeControls.call(this),this.isHTML5&&xe.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,z.updateVolume.call(this),z.timeUpdate.call(this),z.durationUpdate.call(this),Ie.checkPlaying.call(this),Pe(this.elements.container,this.config.classNames.pip.supported,ze.pip&&this.isHTML5&&this.isVideo),Pe(this.elements.container,this.config.classNames.airplay.supported,ze.airplay&&this.isHTML5),Pe(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{ae.call(this,this.media,"ready")},0),Ie.setTitle.call(this),this.poster&&Ie.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&z.durationUpdate.call(this),this.config.mediaMetadata&&z.setMediaMetadata.call(this)},setTitle(){let e=et.get("play",this.config);if(h.string(this.config.title)&&!h.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const t=Xe.call(this,"iframe");if(!h.element(t))return;const n=h.empty(this.config.title)?"video":this.config.title,s=et.get("frameTitle",this.config);t.setAttribute("title",s.replace("{title}",n))}},togglePoster(e){Pe(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),Ny.call(this).then(()=>rr(e)).catch(n=>{throw e===this.poster&&Ie.togglePoster.call(this,!1),n}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Ie.togglePoster.call(this,!0),e)))},checkPlaying(e){Pe(this.elements.container,this.config.classNames.playing,this.playing),Pe(this.elements.container,this.config.classNames.paused,this.paused),Pe(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(t=>{Object.assign(t,{pressed:this.playing}),t.setAttribute("aria-label",et.get(this.playing?"pause":"play",this.config))}),!(h.event(e)&&e.type==="timeupdate")&&Ie.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{Pe(this.elements.container,this.config.classNames.loading,this.loading),Ie.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const n=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(!!(e||this.loading||this.paused||t.pressed||t.hover||n))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!h.empty(e)&&h.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),h.empty(this.media.style)&&this.media.removeAttribute("style")}};class Jy{constructor(t){K(this,"firstTouch",()=>{const{player:n}=this,{elements:s}=n;n.touch=!0,Pe(s.container,n.config.classNames.isTouch,!0)}),K(this,"global",(n=!0)=>{const{player:s}=this;s.config.keyboard.global&&_i.call(s,window,"keydown keyup",this.handleKey,n,!1),_i.call(s,document.body,"click",this.toggleMenu,n),Al.call(s,document.body,"touchstart",this.firstTouch)}),K(this,"container",()=>{const{player:n}=this,{config:s,elements:i,timers:r}=n;!s.keyboard.global&&s.keyboard.focused&&_e.call(n,i.container,"keydown keyup",this.handleKey,!1),_e.call(n,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",a=>{const{controls:c}=i;c&&a.type==="enterfullscreen"&&(c.pressed=!1,c.hover=!1);const u=["touchstart","touchmove","mousemove"].includes(a.type);let f=0;u&&(Ie.toggleControls.call(n,!0),f=n.touch?3e3:2e3),clearTimeout(r.controls),r.controls=setTimeout(()=>Ie.toggleControls.call(n,!1),f)});const o=()=>{if(!n.isVimeo||n.config.vimeo.premium)return;const a=i.wrapper,{active:c}=n.fullscreen,[u,f]=kl.call(n),d=Sf(`aspect-ratio: ${u} / ${f}`);if(!c){d?(a.style.width=null,a.style.height=null):(a.style.maxWidth=null,a.style.margin=null);return}const[p,v]=Ly(),b=p/v>u/f;d?(a.style.width=b?"auto":"100%",a.style.height=b?"100%":"auto"):(a.style.maxWidth=b?`${v/f*u}px`:null,a.style.margin=b?"0 auto":null)},l=()=>{clearTimeout(r.resized),r.resized=setTimeout(o,50)};_e.call(n,i.container,"enterfullscreen exitfullscreen",a=>{const{target:c}=n.fullscreen;if(c!==i.container||!n.isEmbed&&h.empty(n.config.ratio))return;o(),(a.type==="enterfullscreen"?_e:Hr).call(n,window,"resize",l)})}),K(this,"media",()=>{const{player:n}=this,{elements:s}=n;if(_e.call(n,n.media,"timeupdate seeking seeked",r=>z.timeUpdate.call(n,r)),_e.call(n,n.media,"durationchange loadeddata loadedmetadata",r=>z.durationUpdate.call(n,r)),_e.call(n,n.media,"ended",()=>{n.isHTML5&&n.isVideo&&n.config.resetOnEnd&&(n.restart(),n.pause())}),_e.call(n,n.media,"progress playing seeking seeked",r=>z.updateProgress.call(n,r)),_e.call(n,n.media,"volumechange",r=>z.updateVolume.call(n,r)),_e.call(n,n.media,"playing play pause ended emptied timeupdate",r=>Ie.checkPlaying.call(n,r)),_e.call(n,n.media,"waiting canplay seeked playing",r=>Ie.checkLoading.call(n,r)),n.supported.ui&&n.config.clickToPlay&&!n.isAudio){const r=Xe.call(n,`.${n.config.classNames.video}`);if(!h.element(r))return;_e.call(n,s.container,"click",o=>{![s.container,r].includes(o.target)&&!r.contains(o.target)||n.touch&&n.config.hideControls||(n.ended?(this.proxy(o,n.restart,"restart"),this.proxy(o,()=>{nn(n.play())},"play")):this.proxy(o,()=>{nn(n.togglePlay())},"play"))})}n.supported.ui&&n.config.disableContextMenu&&_e.call(n,s.wrapper,"contextmenu",r=>{r.preventDefault()},!1),_e.call(n,n.media,"volumechange",()=>{n.storage.set({volume:n.volume,muted:n.muted})}),_e.call(n,n.media,"ratechange",()=>{z.updateSetting.call(n,"speed"),n.storage.set({speed:n.speed})}),_e.call(n,n.media,"qualitychange",r=>{z.updateSetting.call(n,"quality",null,r.detail.quality)}),_e.call(n,n.media,"ready qualitychange",()=>{z.setDownloadUrl.call(n)});const i=n.config.events.concat(["keyup","keydown"]).join(" ");_e.call(n,n.media,i,r=>{let{detail:o={}}=r;r.type==="error"&&(o=n.media.error),ae.call(n,s.container,r.type,!0,o)})}),K(this,"proxy",(n,s,i)=>{const{player:r}=this,o=r.config.listeners[i],l=h.function(o);let a=!0;l&&(a=o.call(r,n)),a!==!1&&h.function(s)&&s.call(r,n)}),K(this,"bind",(n,s,i,r,o=!0)=>{const{player:l}=this,a=l.config.listeners[r],c=h.function(a);_e.call(l,n,s,u=>this.proxy(u,i,r),o&&!c)}),K(this,"controls",()=>{const{player:n}=this,{elements:s}=n,i=ot.isIE?"change":"input";if(s.buttons.play&&Array.from(s.buttons.play).forEach(r=>{this.bind(r,"click",()=>{nn(n.togglePlay())},"play")}),this.bind(s.buttons.restart,"click",n.restart,"restart"),this.bind(s.buttons.rewind,"click",()=>{n.lastSeekTime=Date.now(),n.rewind()},"rewind"),this.bind(s.buttons.fastForward,"click",()=>{n.lastSeekTime=Date.now(),n.forward()},"fastForward"),this.bind(s.buttons.mute,"click",()=>{n.muted=!n.muted},"mute"),this.bind(s.buttons.captions,"click",()=>n.toggleCaptions()),this.bind(s.buttons.download,"click",()=>{ae.call(n,n.media,"download")},"download"),this.bind(s.buttons.fullscreen,"click",()=>{n.fullscreen.toggle()},"fullscreen"),this.bind(s.buttons.pip,"click",()=>{n.pip="toggle"},"pip"),this.bind(s.buttons.airplay,"click",n.airplay,"airplay"),this.bind(s.buttons.settings,"click",r=>{r.stopPropagation(),r.preventDefault(),z.toggleMenu.call(n,r)},null,!1),this.bind(s.buttons.settings,"keyup",r=>{if([" ","Enter"].includes(r.key)){if(r.key==="Enter"){z.focusFirstMenuItem.call(n,null,!0);return}r.preventDefault(),r.stopPropagation(),z.toggleMenu.call(n,r)}},null,!1),this.bind(s.settings.menu,"keydown",r=>{r.key==="Escape"&&z.toggleMenu.call(n,r)}),this.bind(s.inputs.seek,"mousedown mousemove",r=>{const o=s.progress.getBoundingClientRect(),l=r.pageX-r.clientX,a=100/o.width*(r.pageX-o.left-l);r.currentTarget.setAttribute("seek-value",a)}),this.bind(s.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",r=>{const o=r.currentTarget,l="play-on-seeked";if(h.keyboardEvent(r)&&!["ArrowLeft","ArrowRight"].includes(r.key))return;n.lastSeekTime=Date.now();const a=o.hasAttribute(l),c=["mouseup","touchend","keyup"].includes(r.type);a&&c?(o.removeAttribute(l),nn(n.play())):!c&&n.playing&&(o.setAttribute(l,""),n.pause())}),ot.isIos){const r=wi.call(n,'input[type="range"]');Array.from(r).forEach(o=>this.bind(o,i,l=>xf(l.target)))}this.bind(s.inputs.seek,i,r=>{const o=r.currentTarget;let l=o.getAttribute("seek-value");h.empty(l)&&(l=o.value),o.removeAttribute("seek-value"),n.currentTime=l/o.max*n.duration},"seek"),this.bind(s.progress,"mouseenter mouseleave mousemove",r=>z.updateSeekTooltip.call(n,r)),this.bind(s.progress,"mousemove touchmove",r=>{const{previewThumbnails:o}=n;o&&o.loaded&&o.startMove(r)}),this.bind(s.progress,"mouseleave touchend click",()=>{const{previewThumbnails:r}=n;r&&r.loaded&&r.endMove(!1,!0)}),this.bind(s.progress,"mousedown touchstart",r=>{const{previewThumbnails:o}=n;o&&o.loaded&&o.startScrubbing(r)}),this.bind(s.progress,"mouseup touchend",r=>{const{previewThumbnails:o}=n;o&&o.loaded&&o.endScrubbing(r)}),ot.isWebKit&&Array.from(wi.call(n,'input[type="range"]')).forEach(r=>{this.bind(r,"input",o=>z.updateRangeFill.call(n,o.target))}),n.config.toggleInvert&&!h.element(s.display.duration)&&this.bind(s.display.currentTime,"click",()=>{n.currentTime!==0&&(n.config.invertTime=!n.config.invertTime,z.timeUpdate.call(n))}),this.bind(s.inputs.volume,i,r=>{n.volume=r.target.value},"volume"),this.bind(s.controls,"mouseenter mouseleave",r=>{s.controls.hover=!n.touch&&r.type==="mouseenter"}),s.fullscreen&&Array.from(s.fullscreen.children).filter(r=>!r.contains(s.container)).forEach(r=>{this.bind(r,"mouseenter mouseleave",o=>{s.controls&&(s.controls.hover=!n.touch&&o.type==="mouseenter")})}),this.bind(s.controls,"mousedown mouseup touchstart touchend touchcancel",r=>{s.controls.pressed=["mousedown","touchstart"].includes(r.type)}),this.bind(s.controls,"focusin",()=>{const{config:r,timers:o}=n;Pe(s.controls,r.classNames.noTransition,!0),Ie.toggleControls.call(n,!0),setTimeout(()=>{Pe(s.controls,r.classNames.noTransition,!1)},0);const l=this.touch?3e3:4e3;clearTimeout(o.controls),o.controls=setTimeout(()=>Ie.toggleControls.call(n,!1),l)}),this.bind(s.inputs.volume,"wheel",r=>{const o=r.webkitDirectionInvertedFromDevice,[l,a]=[r.deltaX,-r.deltaY].map(f=>o?-f:f),c=Math.sign(Math.abs(l)>Math.abs(a)?l:a);n.increaseVolume(c/50);const{volume:u}=n.media;(c===1&&u<1||c===-1&&u>0)&&r.preventDefault()},"volume",!1)}),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(t){const{player:n}=this,{elements:s}=n,{key:i,type:r,altKey:o,ctrlKey:l,metaKey:a,shiftKey:c}=t,u=r==="keydown",f=u&&i===this.lastKey;if(o||l||a||c||!i)return;const d=p=>{n.currentTime=n.duration/10*p};if(u){const p=document.activeElement;if(h.element(p)){const{editable:b}=n.config.selectors,{seek:I}=s.inputs;if(p!==I&&es(p,b)||t.key===" "&&es(p,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(i)&&(t.preventDefault(),t.stopPropagation()),i){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":f||d(Number.parseInt(i,10));break;case" ":case"k":f||nn(n.togglePlay());break;case"ArrowUp":n.increaseVolume(.1);break;case"ArrowDown":n.decreaseVolume(.1);break;case"m":f||(n.muted=!n.muted);break;case"ArrowRight":n.forward();break;case"ArrowLeft":n.rewind();break;case"f":n.fullscreen.toggle();break;case"c":f||n.toggleCaptions();break;case"l":n.loop=!n.loop;break}i==="Escape"&&!n.fullscreen.usingNative&&n.fullscreen.active&&n.fullscreen.toggle(),this.lastKey=i}else this.lastKey=null}toggleMenu(t){z.toggleMenu.call(this.player,t)}}function Qy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var or={exports:{}},Zy=or.exports,vc;function eb(){return vc||(vc=1,(function(e,t){(function(n,s){e.exports=s()})(Zy,function(){var n=function(){},s={},i={},r={};function o(d,p){d=d.push?d:[d];var v=[],b=d.length,I=b,x,w,E,T;for(x=function(M,$){$.length&&v.push(M),I--,I||p(v)};b--;){if(w=d[b],E=i[w],E){x(w,E);continue}T=r[w]=r[w]||[],T.push(x)}}function l(d,p){if(d){var v=r[d];if(i[d]=p,!!v)for(;v.length;)v[0](d,p),v.splice(0,1)}}function a(d,p){d.call&&(d={success:d}),p.length?(d.error||n)(p):(d.success||n)(d)}function c(d,p,v,b){var I=document,x=v.async,w=(v.numRetries||0)+1,E=v.before||n,T=d.replace(/[\?|#].*$/,""),M=d.replace(/^(css|img|module|nomodule)!/,""),$,G,L;if(b=b||0,/(^css!|\.css$)/.test(T))L=I.createElement("link"),L.rel="stylesheet",L.href=M,$="hideFocus"in L,$&&L.relList&&($=0,L.rel="preload",L.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(T))L=I.createElement("img"),L.src=M;else if(L=I.createElement("script"),L.src=M,L.async=x===void 0?!0:x,G="noModule"in L,/^module!/.test(T)){if(!G)return p(d,"l");L.type="module"}else if(/^nomodule!/.test(T)&&G)return p(d,"l");L.onload=L.onerror=L.onbeforeload=function(S){var P=S.type[0];if($)try{L.sheet.cssText.length||(P="e")}catch(D){D.code!=18&&(P="e")}if(P=="e"){if(b+=1,b<w)return c(d,p,v,b)}else if(L.rel=="preload"&&L.as=="style")return L.rel="stylesheet";p(d,P,S.defaultPrevented)},E(d,L)!==!1&&I.head.appendChild(L)}function u(d,p,v){d=d.push?d:[d];var b=d.length,I=b,x=[],w,E;for(w=function(T,M,$){if(M=="e"&&x.push(T),M=="b")if($)x.push(T);else return;b--,b||p(x)},E=0;E<I;E++)c(d[E],w,v)}function f(d,p,v){var b,I;if(p&&p.trim&&(b=p),I=(b?v:p)||{},b){if(b in s)throw"LoadJS";s[b]=!0}function x(w,E){u(d,function(T){a(I,T),w&&a({success:w,error:E},T),l(b,T)},I)}if(I.returnPromise)return new Promise(x);x()}return f.ready=function(p,v){return o(p,function(b){a(v,b)}),f},f.done=function(p){l(p,[])},f.reset=function(){s={},i={},r={}},f.isDefined=function(p){return p in s},f})})(or)),or.exports}var tb=eb(),nb=Qy(tb);function Cl(e){return new Promise((t,n)=>{nb(e,{success:t,error:n})})}function sb(e){if(h.empty(e))return null;if(h.number(Number(e)))return e;const t=/^.*(vimeo.com\/|video\/)(\d+).*/,n=e.match(t);return n?n[2]:e}function ib(e){const t=/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/,n=e.match(t);return n&&n.length===5?n[4]:null}function Ys(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ae.call(this,this.media,e?"play":"pause"))}const Xo={setup(){const e=this;Pe(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Cs.call(e),h.object(window.Vimeo)?Xo.ready.call(e):Cl(e.config.urls.vimeo.sdk).then(()=>{Xo.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:n,referrerPolicy:s,...i}=t;let r=e.media.getAttribute("src"),o="";h.empty(r)?(r=e.media.getAttribute(e.config.attributes.embed.id),o=e.media.getAttribute(e.config.attributes.embed.hash)):o=ib(r);const l=o?{h:o}:{};n&&Object.assign(i,{controls:!1,sidedock:!1});const a=Lf({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...l,...i}),c=sb(r),u=le("iframe"),f=Yo(e.config.urls.vimeo.iframe,c,a);if(u.setAttribute("src",f),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),h.empty(s)||u.setAttribute("referrerPolicy",s),n||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=br(u,e.media);else{const w=le("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});w.appendChild(u),e.media=br(w,e.media)}t.customControls||Oi(Yo(e.config.urls.vimeo.api,f)).then(w=>{h.empty(w)||!w.thumbnail_url||Ie.setPoster.call(e,w.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Ys.call(e,!0),e.embed.play()),e.media.pause=()=>(Ys.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:d}=e.media;Object.defineProperty(e.media,"currentTime",{get(){return d},set(w){const{embed:E,media:T,paused:M,volume:$}=e,G=M&&!E.hasPlayed;T.seeking=!0,ae.call(e,T,"seeking"),Promise.resolve(G&&E.setVolume(0)).then(()=>E.setCurrentTime(w)).then(()=>G&&E.pause()).then(()=>G&&E.setVolume($)).catch(()=>{})}});let p=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get(){return p},set(w){e.embed.setPlaybackRate(w).then(()=>{p=w,ae.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:v}=e.config;Object.defineProperty(e.media,"volume",{get(){return v},set(w){e.embed.setVolume(w).then(()=>{v=w,ae.call(e,e.media,"volumechange")})}});let{muted:b}=e.config;Object.defineProperty(e.media,"muted",{get(){return b},set(w){const E=h.boolean(w)?w:!1;e.embed.setMuted(E?!0:e.config.muted).then(()=>{b=E,ae.call(e,e.media,"volumechange")})}});let{loop:I}=e.config;Object.defineProperty(e.media,"loop",{get(){return I},set(w){const E=h.boolean(w)?w:e.config.loop.active;e.embed.setLoop(E).then(()=>{I=E})}});let x;e.embed.getVideoUrl().then(w=>{x=w,z.setDownloadUrl.call(e)}).catch(w=>{this.debug.warn(w)}),Object.defineProperty(e.media,"currentSrc",{get(){return x}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(w=>{const[E,T]=w;e.embed.ratio=Rf(E,T),Cs.call(this)}),e.embed.setAutopause(e.config.autopause).then(w=>{e.config.autopause=w}),e.embed.getVideoTitle().then(w=>{e.config.title=w,Ie.setTitle.call(this)}),e.embed.getCurrentTime().then(w=>{d=w,ae.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(w=>{e.media.duration=w,ae.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(w=>{e.media.textTracks=w,xe.setup.call(e)}),e.embed.on("cuechange",({cues:w=[]})=>{const E=w.map(T=>qy(T.text));xe.updateCues.call(e,E)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(w=>{Ys.call(e,!w),w||ae.call(e,e.media,"playing")}),h.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)}),e.embed.on("bufferstart",()=>{ae.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{ae.call(e,e.media,"playing")}),e.embed.on("play",()=>{Ys.call(e,!0),ae.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Ys.call(e,!1)}),e.embed.on("timeupdate",w=>{e.media.seeking=!1,d=w.seconds,ae.call(e,e.media,"timeupdate")}),e.embed.on("progress",w=>{e.media.buffered=w.percent,ae.call(e,e.media,"progress"),Number.parseInt(w.percent,10)===1&&ae.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(E=>{E!==e.media.duration&&(e.media.duration=E,ae.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,ae.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,ae.call(e,e.media,"ended")}),e.embed.on("error",w=>{e.media.error=w,ae.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>Ie.build.call(e),0)}};function rb(e){if(h.empty(e))return null;const t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,n=e.match(t);return n&&n[2]?n[2]:e}function Xs(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,ae.call(this,this.media,e?"play":"pause"))}function ob(e){if(e.noCookie)return"https://www.youtube-nocookie.com";if(window.location.protocol==="http:")return"http://www.youtube.com"}const lr={setup(){if(Pe(this.elements.wrapper,this.config.classNames.embed,!0),h.object(window.YT)&&h.function(window.YT.Player))lr.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{h.function(e)&&e(),lr.ready.call(this)},Cl(this.config.urls.youtube.sdk).catch(t=>{this.debug.warn("YouTube API failed to load",t)})}},getTitle(e){const t=Yo(this.config.urls.youtube.api,e);Oi(t).then(n=>{if(h.object(n)){const{title:s,height:i,width:r}=n;this.config.title=s,Ie.setTitle.call(this),this.embed.ratio=Rf(r,i)}Cs.call(this)}).catch(()=>{Cs.call(this)})},ready(){const e=this,t=e.config.youtube,n=e.media&&e.media.getAttribute("id");if(!h.empty(n)&&n.startsWith("youtube-"))return;let s=e.media.getAttribute("src");h.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const i=rb(s),r=Hy(e.provider),o=le("div",{id:r,"data-poster":t.customControls?e.poster:void 0});if(e.media=br(o,e.media),t.customControls){const l=a=>`https://i.ytimg.com/vi/${i}/${a}default.jpg`;rr(l("maxres"),121).catch(()=>rr(l("sd"),121)).catch(()=>rr(l("hq"))).then(a=>Ie.setPoster.call(e,a.src)).then(a=>{a.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:i,host:ob(t),playerVars:Ve({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(l){if(!e.media.error){const a=l.data,c={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[a]||"An unknown error occurred";e.media.error={code:a,message:c},ae.call(e,e.media,"error")}},onPlaybackRateChange(l){const a=l.target;e.media.playbackRate=a.getPlaybackRate(),ae.call(e,e.media,"ratechange")},onReady(l){if(h.function(e.media.play))return;const a=l.target;lr.getTitle.call(e,i),e.media.play=()=>{Xs.call(e,!0),a.playVideo()},e.media.pause=()=>{Xs.call(e,!1),a.pauseVideo()},e.media.stop=()=>{a.stopVideo()},e.media.duration=a.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get(){return Number(a.getCurrentTime())},set(d){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,ae.call(e,e.media,"seeking"),a.seekTo(d)}}),Object.defineProperty(e.media,"playbackRate",{get(){return a.getPlaybackRate()},set(d){a.setPlaybackRate(d)}});let{volume:c}=e.config;Object.defineProperty(e.media,"volume",{get(){return c},set(d){c=d,a.setVolume(c*100),ae.call(e,e.media,"volumechange")}});let{muted:u}=e.config;Object.defineProperty(e.media,"muted",{get(){return u},set(d){const p=h.boolean(d)?d:u;u=p,a[p?"mute":"unMute"](),a.setVolume(c*100),ae.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get(){return a.getVideoUrl()}}),Object.defineProperty(e.media,"ended",{get(){return e.currentTime===e.duration}});const f=a.getAvailablePlaybackRates();e.options.speed=f.filter(d=>e.config.speed.options.includes(d)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),ae.call(e,e.media,"timeupdate"),ae.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=a.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBuffered<e.media.buffered)&&ae.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,e.media.buffered===1&&(clearInterval(e.timers.buffering),ae.call(e,e.media,"canplaythrough"))},200),t.customControls&&setTimeout(()=>Ie.build.call(e),50)},onStateChange(l){const a=l.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(l.data)&&(e.media.seeking=!1,ae.call(e,e.media,"seeked")),l.data){case-1:ae.call(e,e.media,"timeupdate"),e.media.buffered=a.getVideoLoadedFraction(),ae.call(e,e.media,"progress");break;case 0:Xs.call(e,!1),e.media.loop?(a.stopVideo(),a.playVideo()):ae.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(Xs.call(e,!0),ae.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{ae.call(e,e.media,"timeupdate")},50),e.media.duration!==a.getDuration()&&(e.media.duration=a.getDuration(),ae.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),Xs.call(e,!1);break;case 3:ae.call(e,e.media,"waiting");break}ae.call(e,e.elements.container,"statechange",!1,{code:l.data})}}})}},Df={setup(){if(!this.media){this.debug.warn("No media element found!");return}Pe(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Pe(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Pe(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=le("div",{class:this.config.classNames.video}),kf(this.media,this.elements.wrapper),this.elements.poster=le("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ln.setup.call(this):this.isYouTube?lr.setup.call(this):this.isVimeo&&Xo.setup.call(this)}};function lb(e){e.manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()}class ab{constructor(t){K(this,"load",()=>{this.enabled&&(!h.object(window.google)||!h.object(window.google.ima)?Cl(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}):this.ready())}),K(this,"ready",()=>{this.enabled||lb(this),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),K(this,"setupIMA",()=>{this.elements.container=le("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,n=>this.onAdsManagerLoaded(n),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,n=>this.onAdError(n),!1),this.requestAds()}),K(this,"requestAds",()=>{const{container:n}=this.player.elements;try{const s=new google.ima.AdsRequest;s.adTagUrl=this.tagUrl,s.linearAdSlotWidth=n.offsetWidth,s.linearAdSlotHeight=n.offsetHeight,s.nonLinearAdSlotWidth=n.offsetWidth,s.nonLinearAdSlotHeight=n.offsetHeight,s.forceNonLinearFullSlot=!1,s.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(s)}catch(s){this.onAdError(s)}}),K(this,"pollCountdown",(n=!1)=>{if(!n){clearInterval(this.countdownTimer),this.elements.container.removeAttribute("data-badge-text");return}const s=()=>{const i=Br(Math.max(this.manager.getRemainingTime(),0)),r=`${et.get("advertisement",this.player.config)} - ${i}`;this.elements.container.setAttribute("data-badge-text",r)};this.countdownTimer=setInterval(s,100)}),K(this,"onAdsManagerLoaded",n=>{if(!this.enabled)return;const s=new google.ima.AdsRenderingSettings;s.restoreCustomPlaybackStateOnAdBreakComplete=!0,s.enablePreloading=!0,this.manager=n.getAdsManager(this.player,s),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,i=>this.onAdError(i)),Object.keys(google.ima.AdEvent.Type).forEach(i=>{this.manager.addEventListener(google.ima.AdEvent.Type[i],r=>this.onAdEvent(r))}),this.trigger("loaded")}),K(this,"addCuePoints",()=>{h.empty(this.cuePoints)||this.cuePoints.forEach(n=>{if(n!==0&&n!==-1&&n<this.player.duration){const s=this.player.elements.progress;if(h.element(s)){const i=100/this.player.duration*n,r=le("span",{class:this.player.config.classNames.cues});r.style.left=`${i.toString()}%`,s.appendChild(r)}}})}),K(this,"onAdEvent",n=>{const{container:s}=this.player.elements,i=n.getAd(),r=n.getAdData();switch((l=>{ae.call(this.player,this.player.media,`ads${l.replace(/_/g,"").toLowerCase()}`)})(n.type),n.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=s.offsetWidth,i.height=s.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:r.adError&&this.player.debug.warn(`Non-fatal ad error: ${r.adError.getMessage()}`);break}}),K(this,"onAdError",n=>{this.cancel(),this.player.debug.warn("Ads error",n)}),K(this,"listeners",()=>{const{container:n}=this.player.elements;let s;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{s=this.player.currentTime}),this.player.on("seeked",()=>{const i=this.player.currentTime;h.empty(this.cuePoints)||this.cuePoints.forEach((r,o)=>{s<r&&r<i&&(this.manager.discardAdBreak(),this.cuePoints.splice(o,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL)})}),K(this,"play",()=>{const{container:n}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(n.offsetWidth,n.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(s){this.onAdError(s)}}).catch(()=>{})}),K(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,nn(this.player.media.play())}),K(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),K(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),K(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(n=>{this.on("loaded",n),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),K(this,"trigger",(n,...s)=>{const i=this.events[n];h.array(i)&&i.forEach(r=>{h.function(r)&&r.apply(this,s)})}),K(this,"on",(n,s)=>(h.array(this.events[n])||(this.events[n]=[]),this.events[n].push(s),this)),K(this,"startSafetyTimer",(n,s)=>{this.player.debug.log(`Safety timer invoked from: ${s}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},n)}),K(this,"clearSafetyTimer",n=>{h.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${n}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((n,s)=>{this.on("loaded",n),this.on("error",s)}),this.load()}get enabled(){const{config:t}=this;return this.player.isHTML5&&this.player.isVideo&&t.enabled&&(!h.empty(t.publisherId)||h.url(t.tagUrl))}get tagUrl(){const{config:t}=this;if(h.url(t.tagUrl))return t.tagUrl;const n={AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:t.publisherId};return`https://go.aniview.com/api/adserver6/vast/?${Lf(n)}`}}function Uf(e=0,t=0,n=255){return Math.min(Math.max(e,t),n)}function cb(e){const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(s=>{const i={};s.split(/\r\n|\n|\r/).forEach(o=>{if(h.number(i.startTime)){if(!h.empty(o.trim())&&h.empty(i.text)){const l=o.trim().split("#xywh=");[i.text]=l,l[1]&&([i.x,i.y,i.w,i.h]=l[1].split(","))}}else{const l=o.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);l&&(i.startTime=Number(l[1]||0)*60*60+Number(l[2])*60+Number(l[3])+ +`0.${l[4]}`,i.endTime=Number(l[6]||0)*60*60+Number(l[7])*60+Number(l[8])+ +`0.${l[9]}`)}}),i.text&&t.push(i)}),t}function wc(e,t){const n=t.width/t.height,s={};return e>n?(s.width=t.width,s.height=1/e*t.width):(s.height=t.height,s.width=e*t.height),s}class Jo{constructor(t){K(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),K(this,"getThumbnails",()=>new Promise(n=>{const{src:s}=this.player.config.previewThumbnails;if(h.empty(s))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort((r,o)=>r.height-o.height),this.player.debug.log("Preview thumbnails",this.thumbnails),n()};if(h.function(s))s(r=>{this.thumbnails=r,i()});else{const o=(h.string(s)?[s]:s).map(l=>this.getThumbnail(l));Promise.all(o).then(i)}})),K(this,"getThumbnail",n=>new Promise(s=>{Oi(n,void 0,this.player.config.previewThumbnails.withCredentials).then(i=>{const r={frames:cb(i),height:null,urlPrefix:""};!r.frames[0].text.startsWith("/")&&!r.frames[0].text.startsWith("http://")&&!r.frames[0].text.startsWith("https://")&&(r.urlPrefix=n.substring(0,n.lastIndexOf("/")+1));const o=new Image;o.onload=()=>{r.height=o.naturalHeight,r.width=o.naturalWidth,this.thumbnails.push(r),s()},o.src=r.urlPrefix+r.frames[0].text})})),K(this,"startMove",n=>{if(this.loaded&&!(!h.event(n)||!["touchmove","mousemove"].includes(n.type))&&this.player.media.duration){if(n.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var s,i;const r=this.player.elements.progress.getBoundingClientRect(),o=100/r.width*(n.pageX-r.left);this.seekTime=this.player.media.duration*(o/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=n.pageX,this.elements.thumb.time.textContent=Br(this.seekTime);const l=(s=this.player.config.markers)===null||s===void 0||(i=s.points)===null||i===void 0?void 0:i.find(({time:a})=>a===Math.round(this.seekTime));l&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${l.label}<br>`)}this.showImageAtCurrentTime()}}),K(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),K(this,"startScrubbing",n=>{(h.nullOrUndefined(n.button)||n.button===!1||n.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),K(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):Al.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),K(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),K(this,"render",()=>{this.elements.thumb.container=le("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=le("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const n=le("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=le("span",{},"00:00"),n.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(n),h.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=le("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),K(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),K(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const n=this.thumbnails[0].frames.findIndex(r=>this.seekTime>=r.startTime&&this.seekTime<=r.endTime),s=n>=0;let i=0;this.mouseDown||this.toggleThumbContainer(s),s&&(this.thumbnails.forEach((r,o)=>{this.loadedImages.includes(r.frames[n].text)&&(i=o)}),n!==this.showingThumb&&(this.showingThumb=n,this.loadImage(i)))}),K(this,"loadImage",(n=0)=>{const s=this.showingThumb,i=this.thumbnails[n],{urlPrefix:r}=i,o=i.frames[s],l=i.frames[s].text,a=r+l;if(!this.currentImageElement||this.currentImageElement.dataset.filename!==l){this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const c=new Image;c.src=a,c.dataset.index=s,c.dataset.filename=l,this.showingThumbFilename=l,this.player.debug.log(`Loading image: ${a}`),c.onload=()=>this.showImage(c,o,n,s,l,!0),this.loadingImage=c,this.removeOldImages(c)}else this.showImage(this.currentImageElement,o,n,s,l,!1),this.currentImageElement.dataset.index=s,this.removeOldImages(this.currentImageElement)}),K(this,"showImage",(n,s,i,r,o,l=!0)=>{this.player.debug.log(`Showing thumb: ${o}. num: ${r}. qual: ${i}. newimg: ${l}`),this.setImageSizeAndOffset(n,s),l&&(this.currentImageContainer.appendChild(n),this.currentImageElement=n,this.loadedImages.includes(o)||this.loadedImages.push(o)),this.preloadNearby(r,!0).then(this.preloadNearby(r,!1)).then(this.getHigherQuality(i,n,s,o))}),K(this,"removeOldImages",n=>{Array.from(this.currentImageContainer.children).forEach(s=>{if(s.tagName.toLowerCase()!=="img")return;const i=this.usingSprites?500:1e3;if(s.dataset.index!==n.dataset.index&&!s.dataset.deleting){s.dataset.deleting=!0;const{currentImageContainer:r}=this;setTimeout(()=>{r.removeChild(s),this.player.debug.log(`Removing thumb: ${s.dataset.filename}`)},i)}})}),K(this,"preloadNearby",(n,s=!0)=>new Promise(i=>{setTimeout(()=>{const r=this.thumbnails[0].frames[n].text;if(this.showingThumbFilename===r){let o;s?o=this.thumbnails[0].frames.slice(n):o=this.thumbnails[0].frames.slice(0,n).reverse();let l=!1;o.forEach(a=>{const c=a.text;if(c!==r&&!this.loadedImages.includes(c)){l=!0,this.player.debug.log(`Preloading thumb filename: ${c}`);const{urlPrefix:u}=this.thumbnails[0],f=u+c,d=new Image;d.src=f,d.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${c}`),this.loadedImages.includes(c)||this.loadedImages.push(c),i()}}}),l||i()}},300)})),K(this,"getHigherQuality",(n,s,i,r)=>{if(n<this.thumbnails.length-1){let o=s.naturalHeight;this.usingSprites&&(o=i.h),o<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===r&&(this.player.debug.log(`Showing higher quality thumb for: ${r}`),this.loadImage(n+1))},300)}}),K(this,"toggleThumbContainer",(n=!1,s=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,n),!n&&s&&(this.showingThumb=null,this.showingThumbFilename=null)}),K(this,"toggleScrubbingContainer",(n=!1)=>{const s=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(s,n),n||(this.showingThumb=null,this.showingThumbFilename=null)}),K(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),K(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:n}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(n.clientHeight>20&&n.clientWidth<20){const s=Math.floor(n.clientHeight*this.thumbAspectRatio);n.style.width=`${s}px`}else if(n.clientHeight<20&&n.clientWidth>20){const s=Math.floor(n.clientWidth/this.thumbAspectRatio);n.style.height=`${s}px`}}else{const s=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);n.style.height=`${this.thumbContainerHeight}px`,n.style.width=`${s}px`}this.setThumbContainerPos()}),K(this,"setThumbContainerPos",()=>{const n=this.player.elements.progress.getBoundingClientRect(),s=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,r=s.left-n.left+10,o=s.right-n.left-i.clientWidth-10,l=this.mousePosX-n.left-i.clientWidth/2,a=Uf(l,r,o);i.style.left=`${a}px`,i.style.setProperty("--preview-arrow-offset",`${l-a}px`)}),K(this,"setScrubbingContainerSize",()=>{const{width:n,height:s}=wc(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${n}px`,this.elements.scrubbing.container.style.height=`${s}px`}),K(this,"setImageSizeAndOffset",(n,s)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/s.h;n.style.height=`${n.naturalHeight*i}px`,n.style.width=`${n.naturalWidth*i}px`,n.style.left=`-${s.x*i}px`,n.style.top=`-${s.y*i}px`}),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:t}=wc(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return t}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(t){this.mouseDown?this.currentScrubbingImageElement=t:this.currentThumbnailImageElement=t}}const Qo={insertElements(e,t){h.string(t)?mc(e,this.media,{src:t}):h.array(t)&&t.forEach(n=>{mc(e,this.media,n)})},change(e){if(!Af(e,"sources.length")){this.debug.warn("Invalid source format");return}Ln.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],mn(this.media),this.media=null,h.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:n}=e,[{provider:s=Nn.html5,src:i}]=t,r=s==="html5"?n:"div",o=s==="html5"?{}:{src:i};Object.assign(this,{provider:s,type:n,supported:ze.check(n,s,this.config.playsinline),media:le(r,o)}),this.elements.container.appendChild(this.media),h.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),h.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Ie.addStyleHook.call(this),this.isHTML5&&Qo.insertElements.call(this,"source",t),this.config.title=e.title,Df.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Qo.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Ie.build.call(this),this.isHTML5&&this.media.load(),h.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Jo(this))),this.fullscreen.update()},!0)}};class Ei{constructor(t,n){if(K(this,"play",()=>h.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>nn(this.media.play())),this.media.play()):null),K(this,"pause",()=>!this.playing||!h.function(this.media.pause)?null:this.media.pause()),K(this,"togglePlay",l=>(h.boolean(l)?l:!this.playing)?this.play():this.pause()),K(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):h.function(this.media.stop)&&this.media.stop()}),K(this,"restart",()=>{this.currentTime=0}),K(this,"rewind",l=>{this.currentTime-=h.number(l)?l:this.config.seekTime}),K(this,"forward",l=>{this.currentTime+=h.number(l)?l:this.config.seekTime}),K(this,"increaseVolume",l=>{const a=this.media.muted?0:this.volume;this.volume=a+(h.number(l)?l:0)}),K(this,"decreaseVolume",l=>{this.increaseVolume(-l)}),K(this,"airplay",()=>{ze.airplay&&this.media.webkitShowPlaybackTargetPicker()}),K(this,"toggleControls",l=>{if(this.supported.ui&&!this.isAudio){const a=vr(this.elements.container,this.config.classNames.hideControls),c=typeof l>"u"?void 0:!l,u=Pe(this.elements.container,this.config.classNames.hideControls,c);if(u&&h.array(this.config.controls)&&this.config.controls.includes("settings")&&!h.empty(this.config.settings)&&z.toggleMenu.call(this,!1),u!==a){const f=u?"controlshidden":"controlsshown";ae.call(this,this.media,f)}return!u}return!1}),K(this,"on",(l,a)=>{_e.call(this,this.elements.container,l,a)}),K(this,"once",(l,a)=>{Al.call(this,this.elements.container,l,a)}),K(this,"off",(l,a)=>{Hr(this.elements.container,l,a)}),K(this,"destroy",(l,a=!1)=>{if(!this.ready)return;const c=()=>{document.body.style.overflow="",this.embed=null,a?(Object.keys(this.elements).length&&(mn(this.elements.buttons.play),mn(this.elements.captions),mn(this.elements.controls),mn(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),h.function(l)&&l()):(Oy.call(this),Ln.cancelRequests.call(this),br(this.elements.original,this.elements.container),ae.call(this,this.elements.original,"destroyed",!0),h.function(l)&&l.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Ie.toggleNativeControls.call(this,!0),c()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&h.function(this.embed.destroy)&&this.embed.destroy(),c()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(c),setTimeout(c,200))}),K(this,"supports",l=>ze.mime.call(this,l)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=ze.touch,this.media=t,h.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||h.nodeList(this.media)||h.array(this.media))&&(this.media=this.media[0]),this.config=Ve({},$f,Ei.defaults,n||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Xy(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",ze),h.nullOrUndefined(this.media)||!h.element(this.media)){this.debug.error("Setup failed: no suitable element passed");return}if(this.media.plyr){this.debug.warn("Target already setup");return}if(!this.config.enabled){this.debug.error("Setup failed: disabled by config");return}if(!ze.check().api){this.debug.error("Setup failed: no support");return}const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const i=this.media.tagName.toLowerCase();let r=null,o=null;switch(i){case"div":if(r=this.media.querySelector("iframe"),h.element(r)){if(o=Nf(r.getAttribute("src")),this.provider=Yy(o.toString()),this.elements.container=this.media,this.media=r,this.elements.container.className="",o.search.length){const l=["1","true"];l.includes(o.searchParams.get("autoplay"))&&(this.config.autoplay=!0),l.includes(o.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=l.includes(o.searchParams.get("playsinline")),this.config.youtube.hl=o.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(h.empty(this.provider)||!Object.values(Nn).includes(this.provider)){this.debug.error("Setup failed: Invalid provider");return}this.type=wo.video;break;case"video":case"audio":this.type=i,this.provider=Nn.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:this.debug.error("Setup failed: unsupported type");return}if(this.supported=ze.check(this.type,this.provider),!this.supported.api){this.debug.error("Setup failed: no support");return}this.eventListeners=[],this.listeners=new Jy(this),this.storage=new Ti(this),this.media.plyr=this,h.element(this.elements.container)||(this.elements.container=le("div"),kf(this.media,this.elements.container)),Ie.migrateStyles.call(this),Ie.addStyleHook.call(this),Df.setup.call(this),this.config.debug&&_e.call(this,this.elements.container,this.config.events.join(" "),l=>{this.debug.log(`event: ${l.type}`)}),this.fullscreen=new Dt(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Ie.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new ab(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>nn(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Jo(this))}get isHTML5(){return this.provider===Nn.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Nn.youtube}get isVimeo(){return this.provider===Nn.vimeo}get isVideo(){return this.type===wo.video}get isAudio(){return this.type===wo.audio}get playing(){return!!(this.ready&&!this.paused&&!this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(t){if(!this.duration)return;const n=h.number(t)&&t>0;this.media.currentTime=n?Math.min(t,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:t}=this.media;return h.number(t)?t:t&&t.length&&this.duration>0?t.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){const t=Number.parseFloat(this.config.duration),n=(this.media||{}).duration,s=!h.number(n)||n===1/0?0:n;return t||s}set volume(t){let n=t;const s=1,i=0;h.string(n)&&(n=Number(n)),h.number(n)||(n=this.storage.get("volume")),h.number(n)||({volume:n}=this.config),n>s&&(n=s),n<i&&(n=i),this.config.volume=n,this.media.volume=n,!h.empty(t)&&this.muted&&n>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(t){let n=t;h.boolean(n)||(n=this.storage.get("muted")),h.boolean(n)||(n=this.config.muted),this.config.muted=n,this.media.muted=n}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||this.isAudio?!0:!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(t){let n=null;h.number(t)&&(n=t),h.number(n)||(n=this.storage.get("speed")),h.number(n)||(n=this.config.speed.selected);const{minimumSpeed:s,maximumSpeed:i}=this;n=Uf(n,s,i),this.config.speed.selected=n,setTimeout(()=>{this.media&&(this.media.playbackRate=n)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(t){const n=this.config.quality,s=this.options.quality;if(!s.length)return;let i=[!h.empty(t)&&Number(t),this.storage.get("quality"),n.selected,n.default].find(h.number),r=!0;if(!s.includes(i)){const o=Cf(s,i);this.debug.warn(`Unsupported quality option: ${i}, using ${o} instead`),i=o,r=!1}n.selected=i,this.media.quality=i,r&&this.storage.set({quality:i})}get quality(){return this.media.quality}set loop(t){const n=h.boolean(t)?t:this.config.loop.active;this.config.loop.active=n,this.media.loop=n}get loop(){return!!this.media.loop}set source(t){Qo.change.call(this,t)}get source(){return this.media.currentSrc}get download(){const{download:t}=this.config.urls;return h.url(t)?t:this.source}set download(t){h.url(t)&&(this.config.urls.download=t,z.setDownloadUrl.call(this))}set poster(t){if(!this.isVideo){this.debug.warn("Poster can only be set for video");return}Ie.setPoster.call(this,t,!1).catch(()=>{})}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const t=wr(kl.call(this));return h.array(t)?t.join(":"):t}set ratio(t){if(!this.isVideo){this.debug.warn("Aspect ratio can only be set for video");return}if(!h.string(t)||!Pf(t)){this.debug.error(`Invalid aspect ratio specified (${t})`);return}this.config.ratio=wr(t),Cs.call(this)}set autoplay(t){this.config.autoplay=h.boolean(t)?t:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(t){xe.toggle.call(this,t,!1)}set currentTrack(t){xe.set.call(this,t,!1),xe.setup.call(this)}get currentTrack(){const{toggled:t,currentTrack:n}=this.captions;return t?n:-1}set language(t){xe.setLanguage.call(this,t,!1)}get language(){return(xe.getCurrentTrack.call(this)||{}).language}set pip(t){if(!ze.pip)return;const n=h.boolean(t)?t:!this.pip;h.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(n?vo.active:vo.inactive),h.function(this.media.requestPictureInPicture)&&(!this.pip&&n?this.media.requestPictureInPicture():this.pip&&!n&&document.exitPictureInPicture())}get pip(){return ze.pip?h.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===vo.active:null}setPreviewThumbnails(t){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,t),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Jo(this))}static supported(t,n){return ze.check(t,n)}static loadSprite(t,n){return Mf(t,n)}static setup(t,n={}){let s=null;return h.string(t)?s=Array.from(document.querySelectorAll(t)):h.nodeList(t)?s=Array.from(t):h.array(t)&&(s=t.filter(h.element)),h.empty(s)?null:s.map(i=>new Ei(i,n))}}Ei.defaults=Py($f);function Sl(e,t){return fetch(e,t)}const xt=Q(null),fs=Q(null),Yn=Q(!1),ds=Q(!1),Cn=Q(null),hs=Q(0),Sn=Q(0),Qe=Qc([]),Ze=Q(-1);let De=null,Xn=null,Xt=null;const ub=120*1e3,Wi=new Map,To=new Map;let _c=null;function fb(){const e=He(()=>!!xt.value),t=He(()=>Sn.value<=0?0:hs.value/Sn.value*100);async function n(T,M,$,G){const L=[];M&&L.push(M),M&&$&&L.push(`${M} ${$}`),$&&L.push($),!M&&!$&&L.push(T);for(const S of L)try{const P=await fetch(`https://wavlake.com/api/v1/content/search?term=${encodeURIComponent(S)}`,{signal:G,headers:{Accept:"application/json"}});if(!P.ok)continue;const D=await P.json();if(!Array.isArray(D))continue;const F=D.filter(be=>be.type==="track"&&!!be.mediaUrl);if(F.length===0)continue;const se=F[0];return{source:"wavlake",type:"stream",url:se.mediaUrl,title:se.title??se.name,artist:se.artist,coverUrl:se.albumArtUrl??se.artistArtUrl,duration:se.duration,trackId:se.id,albumTitle:se.albumTitle,wavlakeUrl:`https://wavlake.com/track/${se.id}`}}catch(P){if(P.name==="AbortError")return null}return null}async function s(T,M,$){const G=`${M??T}|${$??""}`,L=Wi.get(G);if(L!==void 0){if(L!==null)return L;const D=To.get(G);if(D&&Date.now()-D<ub)return null;Wi.delete(G),To.delete(G)}_c?.abort();const S=new AbortController;_c=S;let P=null;try{const D=new URLSearchParams({q:T});M&&D.set("title",M),$&&D.set("artist",$);const se=await Sl(`/api/music/search?${D}`,{signal:S.signal});if(se.ok){const be=await se.json();!be.error&&be.url&&(P=be)}}catch(D){if(D.name==="AbortError")return null}return P||(P=await n(T,M,$,S.signal)),P?(Wi.set(G,P),P):(Cn.value="Not found on Wavlake",Wi.set(G,null),To.set(G,Date.now()),null)}function i(T){Xn=T,T&&fs.value&&r(fs.value)}function r(T){if(Xn){if(Xt&&De){Xt.src=T.url,Xt.load(),Promise.resolve(De.play()).catch(()=>{});return}o(),Xt=document.createElement("audio"),Xt.src=T.url,Xt.preload="auto",Xn.textContent="",Xn.appendChild(Xt),De=new Ei(Xt,{controls:[],autoplay:!0,muted:!1}),De.on("ready",()=>{Promise.resolve(De.play()).catch(()=>{})}),De.on("timeupdate",()=>{hs.value=De.currentTime??0}),De.on("loadedmetadata",()=>{Sn.value=De.duration??0}),De.on("ended",()=>{Yn.value=!1,Ze.value>=0&&Ze.value<Qe.value.length-1&&d()}),De.on("playing",()=>{Yn.value=!0,ds.value=!1}),De.on("pause",()=>{Yn.value=!1}),De.on("error",M=>{const $=Xt?.error;console.error("[player] Audio error:",$?.code,$?.message),ds.value=!1,Cn.value="Audio failed to load"})}}function o(){De&&(De.destroy(),De=null),Xt=null,Xn&&(Xn.textContent="")}async function l(T){if(Cn.value=null,xt.value?.id===T.id&&fs.value){De&&(Promise.resolve(De.play()).catch(()=>{}),Yn.value=!0);return}xt.value=T,ds.value=!0,hs.value=0,Sn.value=0;const M=`${T.title} ${T.artist}`.trim(),$=await s(M,T.title,T.artist);if(xt.value?.id===T.id){if(ds.value=!1,!$){Cn.value||(Cn.value="Not found on Wavlake");return}$.coverUrl&&xt.value&&!xt.value.coverUrl&&(xt.value={...xt.value,coverUrl:$.coverUrl}),$.duration&&xt.value&&!xt.value.duration&&(xt.value={...xt.value,duration:$.duration}),Cn.value=null,fs.value=$,Xn&&r($)}}function a(){De?.pause(),Yn.value=!1}function c(){ds.value||De&&(Yn.value?a():Promise.resolve(De.play()).catch(()=>{}))}function u(T){if(!De||!Sn.value)return;const M=T/100*Sn.value;De.currentTime=M,hs.value=M}function f(T){Qe.value.find($=>$.id===T.id)||(Qe.value=[...Qe.value,T])}function d(){if(Qe.value.length===0)return;const T=Ze.value+1;T<Qe.value.length&&(Ze.value=T,l(Qe.value[T]))}function p(){if(Qe.value.length===0)return;const T=Ze.value-1;T>=0&&(Ze.value=T,l(Qe.value[T]))}function v(T){const M=[...Qe.value];M.splice(T,1),Qe.value=M,T<Ze.value?Ze.value--:T===Ze.value&&(Ze.value=Math.min(Ze.value,M.length-1))}async function b(T){const M=Qe.value.findIndex($=>$.id===T.id);M===-1?(f(T),Ze.value=Qe.value.length-1):Ze.value=M,await l(T)}Ht(Ze,T=>{const M=T+1;if(M<Qe.value.length){const $=Qe.value[M],G=`${$.title} ${$.artist}`.trim();s(G,$.title,$.artist)}});function I(){a(),o(),xt.value=null,fs.value=null,hs.value=0,Sn.value=0,Cn.value=null}function x(){I(),Qe.value=[],Ze.value=-1}const w=He(()=>Ze.value<Qe.value.length-1),E=He(()=>Ze.value>0);return{currentSong:xt,playableSource:fs,isPlaying:Yn,isLoading:ds,error:Cn,currentTime:hs,duration:Sn,hasTrack:e,progress:t,queue:Qe,currentIndex:Ze,hasNext:w,hasPrevious:E,play:b,pause:a,toggle:c,seek:u,clear:I,clearQueue:x,addToQueue:f,playNext:d,playPrevious:p,removeFromQueue:v,setContainer:i}}const xi=new Map,jf="aiui-poster-cache",db=new Set,gs=new Map,Ff="aiui-music-cover-cache",_r=new Map,Hf="aiui-podcast-cover-cache";function hb(e,t){return`${e.toLowerCase().trim()}|${t.toLowerCase().trim()}`}function pb(e,t){return`${e.toLowerCase().trim()}|${(t??"").toLowerCase().trim()}`}function mb(){try{const e=sessionStorage.getItem(Ff);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>gs.set(n,s))}}catch{}}function Eo(){try{const e=[...gs.entries()].slice(-300);sessionStorage.setItem(Ff,JSON.stringify(Object.fromEntries(e)))}catch{}}mb();function Bf(e,t){return`${e.toLowerCase().trim()}|${t??""}`}function gb(){try{const e=sessionStorage.getItem(jf);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>xi.set(n,s))}}catch{}}function yb(){try{const e=[...xi.entries()].slice(-200);sessionStorage.setItem(jf,JSON.stringify(Object.fromEntries(e)))}catch{}}gb();function bb(){try{const e=sessionStorage.getItem(Hf);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>_r.set(n,s))}}catch{}}function vb(){try{const e=[..._r.entries()].slice(-200);sessionStorage.setItem(Hf,JSON.stringify(Object.fromEntries(e)))}catch{}}bb();function Ms(e,t,n,s,i){const o=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
|
|
<rect width="200" height="200" fill="hsl(${s}, ${i}%, 28%)"/>
|
|
<rect x="3" y="3" width="194" height="194" rx="12" fill="none" stroke="hsl(${s}, ${i+5}%, 38%)" stroke-width="1"/>
|
|
<text x="100" y="82" text-anchor="middle" fill="hsl(${s}, ${i}%, 48%)" font-family="system-ui,sans-serif" font-size="10" font-weight="400" letter-spacing="4">${e}</text>
|
|
<line x1="60" y1="92" x2="140" y2="92" stroke="hsl(${s}, ${i+5}%, 40%)" stroke-width="1"/>
|
|
<text x="100" y="118" text-anchor="middle" fill="hsl(${s}, ${i+15}%, 78%)" font-family="system-ui,sans-serif" font-size="13" font-weight="700">${Ss(t.length>18?t.slice(0,16)+"…":t)}</text>
|
|
${n?`<text x="100" y="138" text-anchor="middle" fill="hsl(${s}, ${i}%, 60%)" font-family="system-ui,sans-serif" font-size="10" font-weight="300">${Ss(n.length>22?n.slice(0,20)+"…":n)}</text>`:""}
|
|
</svg>`;return`data:image/svg+xml,${encodeURIComponent(o)}`}function Kv(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return Ms("PODCAST",e,t,n,30)}function Gv(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return Ms("MUSIC",e,t,n,30)}function Yv(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return Ms("NEWS",e,t,n,22)}function Xv(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return Ms("WEBSITE",e,t,n,25)}function wb(e,t){const n=[...e].reduce((i,r)=>i+r.charCodeAt(0),0)%360,s=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 342 513">
|
|
<rect width="342" height="513" fill="hsl(${n}, 25%, 28%)"/>
|
|
<rect x="3" y="3" width="336" height="507" rx="6" fill="none" stroke="hsl(${n}, 30%, 38%)" stroke-width="1"/>
|
|
<text x="171" y="210" text-anchor="middle" fill="hsl(${n}, 25%, 48%)" font-family="'Helvetica Neue',Helvetica,Arial,sans-serif" font-size="13" font-weight="400" letter-spacing="5">FILM</text>
|
|
<line x1="121" y1="225" x2="221" y2="225" stroke="hsl(${n}, 30%, 40%)" stroke-width="1"/>
|
|
<text x="171" y="265" text-anchor="middle" fill="hsl(${n}, 45%, 78%)" font-family="'Helvetica Neue',Helvetica,Arial,sans-serif" font-size="18" font-weight="700">
|
|
${Ss(e.length>20?e.slice(0,18)+"…":e)}
|
|
</text>
|
|
${t?`<text x="171" y="295" text-anchor="middle" fill="hsl(${n}, 30%, 60%)" font-family="'Helvetica Neue',Helvetica,Arial,sans-serif" font-size="14" font-weight="300">${t}</text>`:""}
|
|
</svg>`;return`data:image/svg+xml,${encodeURIComponent(s)}`}function Jv(e,t){const n=[...e].reduce((i,r)=>i+r.charCodeAt(0),0)%360,s=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 342 513">
|
|
<rect width="342" height="513" fill="hsl(${n}, 22%, 28%)"/>
|
|
<rect x="3" y="3" width="336" height="507" rx="6" fill="none" stroke="hsl(${n}, 28%, 38%)" stroke-width="1"/>
|
|
<text x="171" y="210" text-anchor="middle" fill="hsl(${n}, 22%, 48%)" font-family="'SF Pro Display',system-ui,sans-serif" font-size="13" font-weight="400" letter-spacing="5">SERIES</text>
|
|
<line x1="111" y1="225" x2="231" y2="225" stroke="hsl(${n}, 28%, 40%)" stroke-width="1"/>
|
|
<text x="171" y="265" text-anchor="middle" fill="hsl(${n}, 40%, 78%)" font-family="'SF Pro Display',system-ui,sans-serif" font-size="18" font-weight="700">
|
|
${Ss(e.length>20?e.slice(0,18)+"…":e)}
|
|
</text>
|
|
${t?`<text x="171" y="295" text-anchor="middle" fill="hsl(${n}, 28%, 60%)" font-family="'SF Pro Display',system-ui,sans-serif" font-size="14" font-weight="300">${t}</text>`:""}
|
|
</svg>`;return`data:image/svg+xml,${encodeURIComponent(s)}`}function Ss(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}async function Vf(e,t,n){const s=`${e}:${Bf(t,n)}`,i=xi.get(s);if(i)return i;const r={posterUrl:null,backdropUrl:null};try{const o=new URLSearchParams({q:t.trim()});n&&n>0&&o.set("y",String(n));const l=await Sl(`/api/tmdb/${e}?${o}`);if(!l.ok)return r;const a=await l.json(),c={posterUrl:a.posterUrl??null,backdropUrl:a.backdropUrl??null};return(c.posterUrl||c.backdropUrl)&&(xi.set(s,c),yb()),c}catch{return r}}async function zf(e,t){return Vf("search",e,t)}async function Qv(e,t,n){const s=e.target;if(s.dataset.fallback==="done")return;const i=s.src;db.add(i);const r=Bf(t,n),o=xi.get(r);if(o?.posterUrl&&o.posterUrl!==i){s.dataset.fallback="tmdb",s.src=o.posterUrl;return}if(s.dataset.fallback!=="tmdb"){const{posterUrl:l}=await zf(t,n);if(l&&l!==i){s.dataset.fallback="tmdb",s.src=l;return}}if(s.dataset.fallback!=="wiki"){const l=await Ps(t,"film");if(l){s.dataset.fallback="wiki",s.src=l;return}}s.dataset.fallback="done",s.src=wb(t,n)}async function _b(e,t){return Vf("search-tv",e,t)}async function Zv(e,t){const n=pb(e,t),s=_r.get(n);if(s)return s;try{const i=t?`${e} ${t}`:e,r=await fetch(`https://itunes.apple.com/search?term=${encodeURIComponent(i.trim())}&media=podcast&limit=3`);if(!r.ok)return null;const a=(await r.json()).results?.[0]?.artworkUrl100;if(!a)return null;const c=a.replace(/100x100/g,"600x600");return _r.set(n,c),vb(),c}catch{return null}}const Tr=new Map,qf="aiui-book-cover-cache";function Wf(e,t){return`${e.toLowerCase().trim()}|${t.toLowerCase().trim()}`}function Tb(){try{const e=sessionStorage.getItem(qf);if(e){const t=JSON.parse(e);Object.entries(t).forEach(([n,s])=>Tr.set(n,s))}}catch{}}function Eb(){try{const e=[...Tr.entries()].slice(-200);sessionStorage.setItem(qf,JSON.stringify(Object.fromEntries(e)))}catch{}}Tb();function ew(e,t){const n=[...e+(t??"")].reduce((i,r)=>i+r.charCodeAt(0),0)%360,s=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 342 513">
|
|
<rect width="342" height="513" fill="hsl(${n}, 20%, 28%)"/>
|
|
<rect x="3" y="3" width="336" height="507" rx="6" fill="none" stroke="hsl(${n}, 25%, 38%)" stroke-width="1"/>
|
|
<text x="171" y="210" text-anchor="middle" fill="hsl(${n}, 18%, 48%)" font-family="Georgia,'Times New Roman',serif" font-size="13" font-weight="400" letter-spacing="5">BOOK</text>
|
|
<line x1="121" y1="225" x2="221" y2="225" stroke="hsl(${n}, 22%, 40%)" stroke-width="1"/>
|
|
<text x="171" y="265" text-anchor="middle" fill="hsl(${n}, 35%, 78%)" font-family="Georgia,'Times New Roman',serif" font-size="18" font-weight="700">
|
|
${Ss(e.length>20?e.slice(0,18)+"…":e)}
|
|
</text>
|
|
${t?`<text x="171" y="295" text-anchor="middle" fill="hsl(${n}, 22%, 60%)" font-family="Georgia,'Times New Roman',serif" font-size="14" font-weight="300">${Ss(t.length>24?t.slice(0,22)+"…":t)}</text>`:""}
|
|
</svg>`;return`data:image/svg+xml,${encodeURIComponent(s)}`}async function xb(e,t){const n=Wf(e,t),s=Tr.get(n);if(s)return s;try{const i=`${e} ${t}`.trim(),r=await fetch(`https://openlibrary.org/search.json?q=${encodeURIComponent(i)}&limit=1&fields=cover_i`);if(!r.ok)return null;const l=(await r.json()).docs?.[0]?.cover_i;if(!l)return null;const a=`https://covers.openlibrary.org/b/id/${l}-L.jpg`;return Tr.set(n,a),Eb(),a}catch{return null}}function tw(e,t){const n=[...e+(t??"")].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return Ms("PLACE",e,t,n,20)}function nw(e,t){const n=[...e].reduce((s,i)=>s+i.charCodeAt(0),0)%360;return Ms("RECIPE",e,t,n,30)}async function sw(e,t){if(t){const s=await Ps(e,t);if(s)return s}const n=await Ps(e,"restaurant");return n||null}async function Ab(e,t,n){const s=hb(t,e),i=gs.get(s);if(i)return i;try{const o=new URLSearchParams({q:e,title:e,artist:t}),l=await Sl(`/api/music/search?${o}`);if(l.ok){const a=await l.json();if(a.coverUrl)return gs.set(s,a.coverUrl),Eo(),a.coverUrl}}catch{}try{const r=`${e} ${t}`.trim(),o=await fetch(`https://wavlake.com/api/v1/content/search?term=${encodeURIComponent(r)}`,{headers:{Accept:"application/json"}});if(o.ok){const l=await o.json();if(Array.isArray(l)){const a=l.find(u=>u.type==="track"),c=a?.albumArtUrl??a?.artistArtUrl;if(c)return gs.set(s,c),Eo(),c}}}catch{}try{const r=`${t} ${e}`.trim().replace(/\s+/g,"+"),o=await fetch(`https://itunes.apple.com/search?term=${encodeURIComponent(r)}&media=music&limit=3`);if(!o.ok)return null;const c=(await o.json()).results?.[0]?.artworkUrl100;if(!c)return null;const u=c.replace(/100x100/g,"600x600");return gs.set(s,u),Eo(),u}catch{return null}}const _s=new Map;async function Ps(e,t){const n=`${e.toLowerCase().trim()}|${(t??"").toLowerCase()}`;if(_s.has(n))return _s.get(n)??null;const s=async r=>{try{const o=encodeURIComponent(r.trim().replace(/\s+/g,"_")),l=await fetch(`https://en.wikipedia.org/api/rest_v1/page/summary/${o}`);if(!l.ok)return null;const a=await l.json();return a.originalimage?.source??a.thumbnail?.source??null}catch{return null}};let i=null;return t&&(i=await s(`${e} (${t})`)),i||(i=await s(e)),_s.set(n,i),i}async function kb(e,t){const s=`gbooks:${Wf(e,t??"")}`;if(_s.has(s))return _s.get(s)??null;try{const i=t?`intitle:${e}+inauthor:${t}`:`intitle:${e}`,r=await fetch(`https://www.googleapis.com/books/v1/volumes?q=${encodeURIComponent(i)}&maxResults=1`);if(!r.ok)return null;const l=(await r.json()).items?.[0]?.volumeInfo?.imageLinks;let a=l?.thumbnail??l?.smallThumbnail??null;return a&&(a=a.replace(/^http:/,"https:").replace(/&edge=curl/g,""),a.includes("zoom=")||(a+="&zoom=2")),_s.set(s,a),a}catch{return null}}async function iw(e,t){const n=await zf(e,t);if(n.posterUrl||n.backdropUrl)return n;const s=await Ps(e,"film");return s?{posterUrl:s,backdropUrl:null}:{posterUrl:null,backdropUrl:null}}async function rw(e,t){const n=await _b(e,t);if(n.posterUrl||n.backdropUrl)return n;const s=await Ps(e,"TV series");return s?{posterUrl:s,backdropUrl:null}:{posterUrl:null,backdropUrl:null}}async function ow(e,t){const n=await xb(e,t??"");if(n)return n;const s=await kb(e,t);return s||await Ps(e,"novel")}const Cb={key:0,class:"flex flex-col"},Sb={class:"flex items-center gap-3 px-3 py-2"},Pb={class:"w-10 h-10 rounded-lg overflow-hidden shrink-0 flex items-center justify-center path-glass-icon"},Rb=["src","alt"],Ib={key:1,class:"text-base"},Mb={class:"min-w-0 flex-1"},Ob={class:"text-sm font-semibold truncate text-white/90"},Nb={class:"text-xs truncate text-white/50"},Lb=["disabled"],$b={key:0,class:"w-6 h-6 animate-spin text-white/90",fill:"none",viewBox:"0 0 24 24"},Db={key:1,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},Ub={key:2,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},jb=["disabled"],Fb={key:0,class:"text-xs text-red-400/60 px-3 pb-1 truncate"},Hb={key:1,class:"flex items-center gap-4 px-4 py-3"},Bb={class:"flex items-center gap-3 min-w-0 flex-1 max-w-[280px]"},Vb={class:"w-12 h-12 rounded-lg overflow-hidden shrink-0 flex items-center justify-center path-glass-icon"},zb=["src","alt"],qb={key:1,class:"text-lg"},Wb={class:"min-w-0"},Kb={class:"text-sm font-semibold truncate text-white/90"},Gb={class:"text-xs truncate text-white/50"},Yb={class:"flex flex-col gap-1 flex-1 max-w-xl mx-4"},Xb={class:"flex items-center gap-2"},Jb=["disabled"],Qb={key:0,class:"w-6 h-6 animate-spin text-white/90",fill:"none",viewBox:"0 0 24 24"},Zb={key:1,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},ev={key:2,class:"w-6 h-6 text-white/90",fill:"currentColor",viewBox:"0 0 24 24"},tv=["disabled"],nv={class:"text-xs font-mono tabular-nums text-white/40"},sv={class:"text-xs font-mono tabular-nums text-white/40"},iv={key:0,class:"text-xs text-red-400/60 truncate"},rv={key:0,class:"text-xs font-mono tabular-nums shrink-0 text-white/30"},ov=Hn({__name:"PlayerBar",props:{variant:{default:"fixed"},compact:{type:Boolean,default:!1}},setup(e){const t=e,{currentSong:n,hasTrack:s,isPlaying:i,isLoading:r,error:o,currentTime:l,duration:a,progress:c,queue:u,hasNext:f,hasPrevious:d,toggle:p,seek:v,clear:b,playNext:I,playPrevious:x,setContainer:w}=fb(),E=Q(null),T=Q(null),M=He(()=>{const S=n.value;return S?S.coverUrl||T.value:null});function $(S){return S.replace(/^(?:song|film|podcast|book|tv)_ext:/i,"").replace(/\|.*$/,"")}function G(S){const P=Math.floor(S/60),D=Math.floor(S%60);return`${P}:${D.toString().padStart(2,"0")}`}function L(S){const D=S.currentTarget.getBoundingClientRect(),F=Math.max(0,Math.min(100,(S.clientX-D.left)/D.width*100));v(F)}return is(async()=>{await ss(),w(E.value)}),Ht(()=>E.value,S=>w(S),{flush:"post"}),Ht(n,S=>{T.value=null,S&&!S.coverUrl&&Ab(S.title,S.artist).then(P=>{P&&(T.value=P)})},{immediate:!0}),(S,P)=>(de(),Un(gr,{name:"player-slide"},{default:di(()=>[V(s)?(de(),ve("div",{key:0,class:qe([t.variant==="fixed"?"fixed bottom-0 left-0 right-0 z-[999]":"w-full shrink-0","path-glass-card !rounded-none"])},[k("div",{ref_key:"plyrContainerRef",ref:E,class:"absolute left-[-9999px] w-[320px] h-[180px] overflow-hidden","aria-hidden":"true"},null,512),t.compact?(de(),ve("div",Cb,[k("div",{class:"w-full h-1 cursor-pointer bg-white/10",onClick:L},[k("div",{class:"h-full bg-accent transition-all duration-150",style:Dn({width:`${V(c)}%`})},null,4)]),k("div",Sb,[k("div",Pb,[M.value?(de(),ve("img",{key:0,src:M.value,alt:V(n).title,class:"w-full h-full object-cover"},null,8,Rb)):(de(),ve("span",Ib,"🎵"))]),k("div",Mb,[k("p",Ob,tt($(V(n).title)),1),k("p",Nb,tt(V(n).artist),1)]),k("button",{class:qe(["w-11 h-11 rounded-full flex items-center justify-center shrink-0 active:scale-95",V(d)?"text-white/70":"text-white/20"]),disabled:!V(d),"aria-label":"Previous track",onClick:P[0]||(P[0]=(...D)=>V(x)&&V(x)(...D))},[...P[8]||(P[8]=[k("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[k("path",{d:"M6 6h2v12H6V6zm3.5 6l8.5 6V6l-8.5 6z"})],-1)])],10,Lb),k("button",{class:"w-12 h-12 rounded-full flex items-center justify-center glass-button shrink-0 active:scale-95","aria-label":"Play or pause",onClick:P[1]||(P[1]=(...D)=>V(p)&&V(p)(...D))},[V(r)?(de(),ve("svg",$b,[...P[9]||(P[9]=[k("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),k("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):V(i)?(de(),ve("svg",Db,[...P[10]||(P[10]=[k("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(de(),ve("svg",Ub,[...P[11]||(P[11]=[k("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),k("button",{class:qe(["w-11 h-11 rounded-full flex items-center justify-center shrink-0 active:scale-95",V(f)?"text-white/70":"text-white/20"]),disabled:!V(f),"aria-label":"Next track",onClick:P[2]||(P[2]=(...D)=>V(I)&&V(I)(...D))},[...P[12]||(P[12]=[k("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[k("path",{d:"M6 18l8.5-6L6 6v12zm10-12v12h2V6h-2z"})],-1)])],10,jb),k("button",{class:"w-9 h-9 rounded-lg flex items-center justify-center shrink-0 active:scale-95 text-white/40","aria-label":"Close player",onClick:P[3]||(P[3]=(...D)=>V(b)&&V(b)(...D))},[...P[13]||(P[13]=[k("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),V(o)?(de(),ve("p",Fb,tt(V(o)),1)):mt("",!0)])):(de(),ve("div",Hb,[k("div",Bb,[k("div",Vb,[M.value?(de(),ve("img",{key:0,src:M.value,alt:V(n).title,class:"w-full h-full object-cover"},null,8,zb)):(de(),ve("span",qb,"🎵"))]),k("div",Wb,[k("p",Kb,tt($(V(n).title)),1),k("p",Gb,tt(V(n).artist),1)])]),k("div",Yb,[k("div",Xb,[k("button",{class:qe(["min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center shrink-0 transition-all hover:scale-105 active:scale-95",V(d)?"text-white/70 hover:text-white/90":"text-white/20"]),disabled:!V(d),"aria-label":"Previous track",onClick:P[4]||(P[4]=(...D)=>V(x)&&V(x)(...D))},[...P[14]||(P[14]=[k("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[k("path",{d:"M6 6h2v12H6V6zm3.5 6l8.5 6V6l-8.5 6z"})],-1)])],10,Jb),k("button",{class:"w-12 h-12 rounded-full flex items-center justify-center glass-button shrink-0 transition-all hover:scale-105 active:scale-95","aria-label":"Play or pause",onClick:P[5]||(P[5]=(...D)=>V(p)&&V(p)(...D))},[V(r)?(de(),ve("svg",Qb,[...P[15]||(P[15]=[k("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),k("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"},null,-1)])])):V(i)?(de(),ve("svg",Zb,[...P[16]||(P[16]=[k("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"},null,-1)])])):(de(),ve("svg",ev,[...P[17]||(P[17]=[k("path",{d:"M8 5v14l11-7L8 5z"},null,-1)])]))]),k("button",{class:qe(["min-w-[44px] min-h-[44px] rounded-full flex items-center justify-center shrink-0 transition-all hover:scale-105 active:scale-95",V(f)?"text-white/70 hover:text-white/90":"text-white/20"]),disabled:!V(f),"aria-label":"Next track",onClick:P[6]||(P[6]=(...D)=>V(I)&&V(I)(...D))},[...P[18]||(P[18]=[k("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24"},[k("path",{d:"M6 18l8.5-6L6 6v12zm10-12v12h2V6h-2z"})],-1)])],10,tv),k("span",nv,tt(G(V(l))),1),k("div",{class:"flex-1 h-1.5 rounded-full cursor-pointer group bg-white/15",onClick:L},[k("div",{class:"h-full rounded-full transition-all duration-150 group-hover:h-2 bg-accent",style:Dn({width:`${V(c)}%`})},null,4)]),k("span",sv,tt(G(V(a))),1)]),V(o)?(de(),ve("p",iv,tt(V(o)),1)):mt("",!0)]),V(u).length>1?(de(),ve("span",rv,tt(V(u).length)+" songs",1)):mt("",!0),k("button",{class:"touch-target rounded-xl path-glass-button path-glass-button-sm shrink-0 transition-all hover:scale-105","aria-label":"Close player",onClick:P[7]||(P[7]=(...D)=>V(b)&&V(b)(...D)),title:"Close player"},[...P[19]||(P[19]=[k("svg",{class:"w-4 h-4 text-white/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]))],2)):mt("",!0)]),_:1}))}}),lv=Tl(ov,[["__scopeId","data-v-94cfd389"]]),av={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4"},cv={class:"glass-card relative w-full max-w-sm p-6 space-y-5 animate-scale-in"},uv={class:"flex items-center gap-3"},fv={class:"text-base font-semibold text-white/96 leading-tight"},dv={class:"text-xs text-white/40 mt-0.5"},hv={class:"space-y-2.5"},pv=["placeholder"],mv={key:1,class:"text-xs text-red-400 px-1"},gv={class:"flex gap-2"},yv=["disabled"],bv=Hn({__name:"PassphraseDialog",props:{visible:{type:Boolean},isCreating:{type:Boolean},error:{}},emits:["submit","skip"],setup(e,{emit:t}){const n=e,s=t,i=Q(""),r=Q(""),o=Q(""),l=Q(null),a=He(()=>!(!i.value.trim()||n.isCreating&&i.value!==r.value));function c(){if(!a.value){n.isCreating&&i.value!==r.value&&(o.value="Passphrases do not match");return}o.value="",s("submit",i.value)}function u(){s("skip")}return Ht(()=>n.visible,f=>{f&&ss(()=>l.value?.focus())},{immediate:!0}),(f,d)=>(de(),Un(dl,{to:"body"},[e.visible?(de(),ve("div",av,[k("div",{class:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:dn(u,["self"])}),k("div",cv,[k("div",uv,[d[2]||(d[2]=k("div",{class:"flex items-center justify-center w-10 h-10 rounded-xl bg-accent/15 border border-accent/30 shrink-0"},[k("svg",{class:"w-5 h-5 text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[k("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})])],-1)),k("div",null,[k("h2",fv,tt(e.isCreating?"Create Passphrase":"Unlock AIUI"),1),k("p",dv,tt(e.isCreating?"Encrypts all your data locally":"Enter your passphrase to decrypt"),1)])]),k("div",hv,[Gl(k("input",{ref_key:"inputRef",ref:l,"onUpdate:modelValue":d[0]||(d[0]=p=>i.value=p),type:"password",placeholder:e.isCreating?"Create a passphrase…":"Enter passphrase…",class:"w-full px-4 py-3 rounded-xl bg-white/5 border border-white/10 text-white/90 placeholder:text-white/25 outline-none focus:border-white/30 focus:bg-white/8 transition-colors",style:{"font-size":"16px"},autocomplete:"current-password",onKeydown:Na(c,["enter"])},null,40,pv),[[Ia,i.value]]),e.isCreating?Gl((de(),ve("input",{key:0,"onUpdate:modelValue":d[1]||(d[1]=p=>r.value=p),type:"password",placeholder:"Confirm passphrase…",class:"w-full px-4 py-3 rounded-xl bg-white/5 border border-white/10 text-white/90 placeholder:text-white/25 outline-none focus:border-white/30 focus:bg-white/8 transition-colors",style:{"font-size":"16px"},autocomplete:"new-password",onKeydown:Na(c,["enter"])},null,544)),[[Ia,r.value]]):mt("",!0),o.value||n.error?(de(),ve("p",mv,tt(o.value||n.error),1)):mt("",!0)]),k("div",gv,[k("button",{class:"glass-button glass-button-sm flex-1 rounded-xl text-sm text-white/50 hover:text-white/80 transition-colors",onClick:u}," Skip "),k("button",{class:qe(["glass-button flex-1 h-11 rounded-xl text-sm font-medium text-white transition-opacity",{"opacity-40 cursor-not-allowed":!a.value}]),disabled:!a.value,onClick:c},tt(e.isCreating?"Create":"Unlock"),11,yv)]),d[3]||(d[3]=k("p",{class:"text-xs text-white/25 text-center"}," Data never leaves your device · AES-256-GCM ",-1))])])):mt("",!0)]))}}),vv=1e5,wv=16,Zo=12;async function _v(){return crypto.getRandomValues(new Uint8Array(wv))}async function Tv(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:vv,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Ev(e,t){const n=new TextEncoder,s=crypto.getRandomValues(new Uint8Array(Zo));return{ciphertext:await crypto.subtle.encrypt({name:"AES-GCM",iv:s},t,n.encode(e)),iv:s}}async function xv(e,t,n){const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},n,e);return new TextDecoder().decode(s)}async function lw(e,t){const{ciphertext:n,iv:s}=await Ev(e,t),i=new Uint8Array(s.length+n.byteLength);return i.set(s),i.set(new Uint8Array(n),s.length),Av(i)}async function aw(e,t){const n=kv(e),s=n.slice(0,Zo),i=n.slice(Zo);return xv(i.buffer,s,t)}function Av(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function kv(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function Cv(){try{return!(typeof globalThis.crypto?.subtle>"u")}catch{return!1}}let Kf=null;function Sv(e,t){Kf=e}function cw(){return Kf}const xo="aiui-crypto-salt",Pv=Hn({__name:"App",setup(e){const{currentTheme:t,initTheme:n}=cf(),s=Jm(),i=Q(window.innerWidth),r=He(()=>i.value<1024),{viewportHeight:o}=Qm();function l(){i.value=window.innerWidth}const a=He(()=>r.value&&o.value>0?{height:`${o.value}px`,overflow:"hidden"}:{}),c=Q(!1),u=Q(!1),f=Q("");async function d(p){f.value="";try{let v=localStorage.getItem(xo),b;v?b=new Uint8Array(v.match(/.{2}/g).map(x=>parseInt(x,16))):(b=await _v(),v=Array.from(b).map(x=>x.toString(16).padStart(2,"0")).join(""),localStorage.setItem(xo,v));const I=await Tv(p,b);Sv(I,b),c.value=!1}catch(v){console.error("[AIUI] Passphrase error:",v),f.value="Encryption failed — check your passphrase or try skipping"}}return is(()=>{if(n(),window.addEventListener("resize",l),s.init(),Cv()&&!s.isEmbedded.value){const p=!!localStorage.getItem(xo);u.value=!p,c.value=!0}}),Or(()=>{window.removeEventListener("resize",l),s.destroy()}),(p,v)=>(de(),ve("div",{class:qe(["h-dvh flex flex-col",V(t)]),style:Dn(a.value)},[Ne(V(af)),Ne($g),Ne(ty),r.value?mt("",!0):(de(),Un(lv,{key:0})),Ne(bv,{visible:c.value,"is-creating":u.value,error:f.value,onSubmit:d,onSkip:v[0]||(v[0]=b=>c.value=!1)},null,8,["visible","is-creating","error"])],6))}}),Tc=Q(new Map),Ec=Q(new Map);function Ki(e){if(Tc.value.has(e.id)){console.warn(`Plugin "${e.id}" is already registered. Skipping.`);return}Tc.value.set(e.id,e)}function xc(e){if(Ec.value.has(e.id)){console.warn(`Renderer "${e.id}" is already registered. Skipping.`);return}Ec.value.set(e.id,e)}async function Rv(){const{claudeProvider:e}=await jt(async()=>{const{claudeProvider:o}=await import("./claude-provider-DnmgFFcN.js");return{claudeProvider:o}},[]);Ki(e),await e.init({settings:{get:()=>{},set:()=>{}},events:{emit:()=>{},on:()=>()=>{}},logger:{info:console.info.bind(console,"[AIUI plugin]"),warn:console.warn.bind(console,"[AIUI plugin]"),error:console.error.bind(console,"[AIUI plugin]")}});const{ollamaProvider:t}=await jt(async()=>{const{ollamaProvider:o}=await import("./ollama-provider-BPRxN1UO.js");return{ollamaProvider:o}},[]);Ki(t),await t.init({settings:{get:()=>{},set:()=>{}},events:{emit:()=>{},on:()=>()=>{}},logger:{info:console.info.bind(console,"[AIUI ollama]"),warn:console.warn.bind(console,"[AIUI ollama]"),error:console.error.bind(console,"[AIUI ollama]")}});const{filmRenderer:n}=await jt(async()=>{const{filmRenderer:o}=await import("./film-renderer-BjBNXUs-.js");return{filmRenderer:o}},[]),{songRenderer:s}=await jt(async()=>{const{songRenderer:o}=await import("./song-renderer-DThhTKU4.js");return{songRenderer:o}},[]);xc(n),xc(s);const{wikipediaPlugin:i}=await jt(async()=>{const{wikipediaPlugin:o}=await import("./wikipedia-BNDKhpH7.js");return{wikipediaPlugin:o}},[]),{openLibraryPlugin:r}=await jt(async()=>{const{openLibraryPlugin:o}=await import("./openlibrary-B8IPeH2e.js");return{openLibraryPlugin:o}},[]);Ki(i),Ki(r)}const Ac="2";(async()=>{const e="aiui-cache-version",t=localStorage.getItem(e);if(t!==Ac){if(localStorage.setItem(e,Ac),"caches"in window){const n=await caches.keys();await Promise.all(n.map(s=>caches.delete(s)))}if("serviceWorker"in navigator){const n=await navigator.serviceWorker.getRegistrations();await Promise.all(n.map(s=>s.unregister()))}t!==null&&window.location.reload()}})();const Iv=new URLSearchParams(window.location.search).has("embedded");window.__AIUI_EMBEDDED__=Iv;const Mv=Vm({history:Tm("/"),routes:[{path:"/",name:"chat",component:()=>jt(()=>import("./ChatPage-0cJYh78p.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))},{path:"/guide",name:"guide",component:()=>jt(()=>import("./GuidePage-BHJ1yOj7.js"),__vite__mapDeps([11,1,12]))},{path:"/widget-demo",name:"widget-demo",component:()=>jt(()=>import("./WidgetDemoPage-D7wMN-ak.js"),__vite__mapDeps([13,2,1,3,4,14]))},{path:"/browse",name:"file-browser",component:()=>jt(()=>import("./BrowsePage-DDnfUhk3.js"),[])},{path:"/view/:nostrAddr",name:"conversation-viewer",component:()=>jt(()=>import("./ConversationViewerPage-BEZVAgnq.js"),__vite__mapDeps([15,3]))}]}),Pl=Rp(Pv);Pl.use(Op());Pl.use(Mv);Rv().catch(e=>{console.error("[AIUI] Failed to initialize plugins:",e)});Pl.mount("#app");export{ow as $,Ht as A,ki as B,Ue as C,Te as D,Cv as E,Pt as F,lw as G,aw as H,cw as I,Gu as J,is as K,Ne as L,di as M,Du as N,zv as O,$v as P,Un as Q,Dg as R,jv as S,Vv as T,Tl as U,dl as V,Sl as W,gr as X,jm as Y,ew as Z,jt as _,Hn as a,Jv as a0,rw as a1,tw as a2,sw as a3,Kv as a4,Zv as a5,Xv as a6,Yv as a7,nw as a8,Na as a9,ss as aa,Mr as ab,Jm as ac,Eg as ad,Ag as ae,kg as af,Qm as ag,Fv as ah,lv as ai,St as aj,md as ak,Ov as al,Qv as am,Wv as an,qv as ao,Bv as ap,Hv as aq,fh as ar,Tg as as,de as b,ve as c,Lv as d,k as e,Uv as f,Dv as g,Dn as h,mt as i,cf as j,He as k,wb as l,iw as m,qe as n,Or as o,Nv as p,fb as q,Q as r,Qc as s,tt as t,V as u,Ia as v,Gl as w,Gv as x,Ab as y,dn as z};
|