@banou/stub 0.0.52 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -28
- package/build/assets/anime-index-CWT8EUVb.js +1 -0
- package/build/assets/anime-seasons-CoquI0pK.js +1 -0
- package/build/assets/dist-BhdcN4JK.js +1328 -0
- package/build/assets/embed-BXVON2cN.js +293 -0
- package/build/assets/embed-title-BD9cgqvV.js +1 -0
- package/build/assets/emotion-react-jsx-runtime.browser.esm-BQbalngd.js +1 -0
- package/build/assets/index-CKS-vpo7.js +2631 -0
- package/build/assets/{lib-account-D3OycIgO.js → lib-account-COp-RaN5.js} +1 -1
- package/build/assets/lib-account-CiFA5y4M.js +2 -0
- package/build/assets/lib-api-DIgTslNb-DP1_yG_t.js +374 -0
- package/build/assets/lib-api-Dqph3zoA.js +2 -0
- package/build/assets/{lib-api-DIgTslNb-Dy8pDGuW.js → lib-build-JdIfVZn7.js} +549 -918
- package/build/assets/lib-dist-DvqYL0NS.js +112 -0
- package/build/assets/lib-emotion-react-jsx-runtime.browser.esm-BXK3nCt6.js +2741 -0
- package/build/assets/lib-jassub-worker-CLcXAXXL.wasm +0 -0
- package/build/assets/lib-jassub-worker-modern-C7bYVPj4.wasm +0 -0
- package/build/assets/lib-remote-C1YHVUVa.js +2 -0
- package/build/assets/lib-remote-Cgazpbxo.js +416 -0
- package/build/assets/lib-theme-player-Ca8vejFM.js +8749 -0
- package/build/assets/{lib-worker-fbrqP6pm.js → lib-worker-PtOuAkPf.js} +1750 -1856
- package/build/assets/{lib-worker-CvSIFpg3.js → lib-worker-Z6aSHw7w.js} +1 -1
- package/build/assets/lib-worker-anime-index-CWT8EUVb.js +1 -0
- package/build/assets/lib-worker-anime-seasons-CoquI0pK.js +1 -0
- package/build/assets/lib-worker-fonts-pE_hQFbP.js +1 -0
- package/build/assets/lib-worker-index-wTApHofM.js +2631 -0
- package/build/assets/lib-worker-jassub-worker-5YNtWxS6.js +1 -0
- package/build/assets/lib-worker-worker-BNxa-Gim.js +150 -0
- package/build/assets/main-L3DMTKgc.js +5095 -0
- package/build/assets/preload-helper-BXrbqLIp.js +1 -0
- package/build/assets/site-status-c5cvFL2q.js +71 -0
- package/build/assets/theme-player-kjqP6iMr.js +1 -0
- package/build/assets/{worker-CrS-zxdF.js → worker-DuBkNi7w.js} +1 -1
- package/build/assets/worker-DxIvGCqk.js +1 -0
- package/build/embed.html +6 -3
- package/build/index.html +6 -4
- package/build/index.js +13460 -14229
- package/fkn.json +1 -1
- package/package.json +15 -4
- package/store/background.webp +0 -0
- package/store/cover.webp +0 -0
- package/store/home.webp +0 -0
- package/store/search.webp +0 -0
- package/store/season.webp +0 -0
- package/store/sources.webp +0 -0
- package/store/title.webp +0 -0
- package/build/assets/anime-index-Jbe1K3rX.js +0 -1
- package/build/assets/anime-seasons-DrpjiWUr.js +0 -1
- package/build/assets/embed-CV2x4LBa.js +0 -1609
- package/build/assets/embed-title-MMtofoQC.js +0 -1
- package/build/assets/index-qhMrnlXc.js +0 -2453
- package/build/assets/lib-account-B1yNOmvG.js +0 -2
- package/build/assets/lib-api-BH2vA5gl.js +0 -2
- package/build/assets/lib-rolldown-runtime-Cb76FRpK.js +0 -27
- package/build/assets/lib-worker-anime-index-Jbe1K3rX.js +0 -1
- package/build/assets/lib-worker-anime-seasons-DrpjiWUr.js +0 -1
- package/build/assets/lib-worker-index-CQP5MZBp.js +0 -2453
- package/build/assets/main-Bf72Kvvx.js +0 -4499
- package/build/assets/site-status--bPTCMnf.js +0 -71
- package/build/assets/worker-CpMTiYu3.js +0 -1
|
@@ -1,1609 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./remote-BwnfCi4M.js","./remote-CAlKhZLk.js","./build-mcPaLDi_.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as e,C as t,E as n,G as r,H as i,J as a,K as o,O as s,Q as c,S as l,St as u,T as d,V as f,W as p,Z as m,a as h,at as g,b as _,ct as v,dt as y,ft as b,gt as x,ht as S,i as C,it as w,l as T,lt as E,mt as D,nt as O,ot as k,p as A,pt as j,rt as ee,s as te,st as M,t as ne,tt as N,ut as P,v as F,vt as I,w as re,x as ie,y as L}from"./embed-title-MMtofoQC.js";import{S as ae,a as oe,c as R,g as z,h as se,i as ce,l as le,o as ue,p as de,s as fe}from"./site-status--bPTCMnf.js";import{n as pe}from"./remote-CAlKhZLk.js";S(),v();var me={};(function(e){var t=Object.prototype.hasOwnProperty,n=`~`;function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,r,a,o){if(typeof r!=`function`)throw TypeError(`The listener must be a function`);var s=new i(r,a||e,o),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function o(e,t){--e._eventsCount===0?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var e=[],r,i;if(this._eventsCount===0)return e;for(i in r=this._events)t.call(r,i)&&e.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=Array(a);i<a;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,a),!0;case 6:return c.fn.call(c.context,t,r,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},s.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn===t&&(!i||s.once)&&(!r||s.context===r)&&o(this,a);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==t||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[a]=l.length===1?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&o(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})({get exports(){return me},set exports(e){me=e}});var he=me,ge=class extends Error{constructor(e){super(e),this.name=`TimeoutError`}},_e=class extends Error{constructor(e){super(),this.name=`AbortError`,this.message=e}},ve=e=>globalThis.DOMException===void 0?new _e(e):new DOMException(e),ye=e=>{let t=e.reason===void 0?ve(`This operation was aborted.`):e.reason;return t instanceof Error?t:ve(t)};function be(e,t,n,r){let i,a=new Promise((a,o)=>{if(typeof t!=`number`||Math.sign(t)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===1/0){a(e);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){let{signal:e}=r;e.aborted&&o(ye(e)),e.addEventListener(`abort`,()=>{o(ye(e))})}i=r.customTimers.setTimeout.call(void 0,()=>{if(typeof n==`function`){try{a(n())}catch(e){o(e)}return}let r=typeof n==`string`?n:`Promise timed out after ${t} milliseconds`,i=n instanceof Error?n:new ge(r);typeof e.cancel==`function`&&e.cancel(),o(i)},t),(async()=>{try{a(await e)}catch(e){o(e)}finally{r.customTimers.clearTimeout.call(void 0,i)}})()});return a.clear=()=>{clearTimeout(i),i=void 0},a}function xe(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var Se=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},B,Ce=class{constructor(){B.set(this,[])}enqueue(e,t){t={priority:0,...t};let n={priority:t.priority,run:e};if(this.size&&Se(this,B,`f`)[this.size-1].priority>=t.priority){Se(this,B,`f`).push(n);return}let r=xe(Se(this,B,`f`),n,(e,t)=>t.priority-e.priority);Se(this,B,`f`).splice(r,0,n)}dequeue(){return Se(this,B,`f`).shift()?.run}filter(e){return Se(this,B,`f`).filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return Se(this,B,`f`).length}};B=new WeakMap;var V=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},H=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},U,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,W,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je=new ge,Ye=class extends Error{},Xe=class extends he{constructor(e){if(super(),U.add(this),we.set(this,void 0),Te.set(this,void 0),Ee.set(this,0),De.set(this,void 0),Oe.set(this,void 0),ke.set(this,0),Ae.set(this,void 0),je.set(this,void 0),Me.set(this,void 0),Ne.set(this,void 0),W.set(this,0),Pe.set(this,void 0),Fe.set(this,void 0),Ie.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Ce,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);V(this,we,e.carryoverConcurrencyCount,`f`),V(this,Te,e.intervalCap===1/0||e.interval===0,`f`),V(this,De,e.intervalCap,`f`),V(this,Oe,e.interval,`f`),V(this,Me,new e.queueClass,`f`),V(this,Ne,e.queueClass,`f`),this.concurrency=e.concurrency,this.timeout=e.timeout,V(this,Ie,e.throwOnTimeout===!0,`f`),V(this,Fe,e.autoStart===!1,`f`)}get concurrency(){return H(this,Pe,`f`)}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);V(this,Pe,e,`f`),H(this,U,`m`,Ke).call(this)}async add(e,t={}){return new Promise((n,r)=>{H(this,Me,`f`).enqueue(async()=>{var i,a;V(this,W,(i=H(this,W,`f`),i++,i),`f`),V(this,Ee,(a=H(this,Ee,`f`),a++,a),`f`);try{if(t.signal?.aborted){r(new Ye(`The task was aborted.`));return}let i=await(this.timeout===void 0&&t.timeout===void 0?e({signal:t.signal}):be(Promise.resolve(e({signal:t.signal})),t.timeout===void 0?this.timeout:t.timeout,()=>{(t.throwOnTimeout===void 0?H(this,Ie,`f`):t.throwOnTimeout)&&r(Je)}));n(i),this.emit(`completed`,i)}catch(e){r(e),this.emit(`error`,e)}H(this,U,`m`,ze).call(this)},t),H(this,U,`m`,Ue).call(this),this.emit(`add`)})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return H(this,Fe,`f`)?(V(this,Fe,!1,`f`),H(this,U,`m`,Ke).call(this),this):this}pause(){V(this,Fe,!0,`f`)}clear(){V(this,Me,new(H(this,Ne,`f`)),`f`)}async onEmpty(){H(this,Me,`f`).size!==0&&await H(this,U,`m`,qe).call(this,`empty`)}async onSizeLessThan(e){H(this,Me,`f`).size<e||await H(this,U,`m`,qe).call(this,`next`,()=>H(this,Me,`f`).size<e)}async onIdle(){(H(this,W,`f`)!==0||H(this,Me,`f`).size!==0)&&await H(this,U,`m`,qe).call(this,`idle`)}get size(){return H(this,Me,`f`).size}sizeBy(e){return H(this,Me,`f`).filter(e).length}get pending(){return H(this,W,`f`)}get isPaused(){return H(this,Fe,`f`)}};we=new WeakMap,Te=new WeakMap,Ee=new WeakMap,De=new WeakMap,Oe=new WeakMap,ke=new WeakMap,Ae=new WeakMap,je=new WeakMap,Me=new WeakMap,Ne=new WeakMap,W=new WeakMap,Pe=new WeakMap,Fe=new WeakMap,Ie=new WeakMap,U=new WeakSet,Le=function(){return H(this,Te,`f`)||H(this,Ee,`f`)<H(this,De,`f`)},Re=function(){return H(this,W,`f`)<H(this,Pe,`f`)},ze=function(){var e;V(this,W,(e=H(this,W,`f`),e--,e),`f`),H(this,U,`m`,Ue).call(this),this.emit(`next`)},Be=function(){this.emit(`empty`),H(this,W,`f`)===0&&this.emit(`idle`)},Ve=function(){H(this,U,`m`,Ge).call(this),H(this,U,`m`,We).call(this),V(this,je,void 0,`f`)},He=function(){let e=Date.now();if(H(this,Ae,`f`)===void 0){let t=H(this,ke,`f`)-e;if(t<0)V(this,Ee,H(this,we,`f`)?H(this,W,`f`):0,`f`);else return H(this,je,`f`)===void 0&&V(this,je,setTimeout(()=>{H(this,U,`m`,Ve).call(this)},t),`f`),!0}return!1},Ue=function(){if(H(this,Me,`f`).size===0)return H(this,Ae,`f`)&&clearInterval(H(this,Ae,`f`)),V(this,Ae,void 0,`f`),H(this,U,`m`,Be).call(this),!1;if(!H(this,Fe,`f`)){let e=!H(this,U,`a`,He);if(H(this,U,`a`,Le)&&H(this,U,`a`,Re)){let t=H(this,Me,`f`).dequeue();return t?(this.emit(`active`),t(),e&&H(this,U,`m`,We).call(this),!0):!1}}return!1},We=function(){H(this,Te,`f`)||H(this,Ae,`f`)!==void 0||(V(this,Ae,setInterval(()=>{H(this,U,`m`,Ge).call(this)},H(this,Oe,`f`)),`f`),V(this,ke,Date.now()+H(this,Oe,`f`),`f`))},Ge=function(){H(this,Ee,`f`)===0&&H(this,W,`f`)===0&&H(this,Ae,`f`)&&(clearInterval(H(this,Ae,`f`)),V(this,Ae,void 0,`f`)),V(this,Ee,H(this,we,`f`)?H(this,W,`f`):0,`f`),H(this,U,`m`,Ke).call(this)},Ke=function(){for(;H(this,U,`m`,Ue).call(this););},qe=async function(e,t){return new Promise(n=>{let r=()=>{(!t||t())&&(this.off(e,r),n())};this.on(e,r)})};var Ze=Object.defineProperty,Qe=(e,t)=>{let n={};for(var r in e)Ze(n,r,{get:e[r],enumerable:!0});return t||Ze(n,Symbol.toStringTag,{value:`Module`}),n},$e=`__OSRA_KEY__`,et=`__OSRA_DEFAULT_KEY__`,tt=`__OSRA_BOX__`,nt=()=>globalThis.browser??globalThis.chrome,rt=()=>nt()?.runtime,it=(e,t)=>Ct(e)&&e.__OSRA_KEY__===t,at=(e,t)=>{if(e){if(e.aborted){t();return}e.addEventListener(`abort`,t,{once:!0})}},ot=({listener:e,transport:t,remoteName:n,key:r=et,origin:i=`*`,unregisterSignal:a})=>{if(a?.aborted)return;let o=Vt(t)?t.receive:t;if(typeof o==`function`){let t=o((t,i)=>{a?.aborted||it(t,r)&&(n&&t.name!==n||e(t,i))});typeof t==`function`&&at(a,t);return}if(Dt(o)||Ot(o)||At(o)||jt(o)){let t=(t,i)=>{let o=(t,a)=>{it(t,r)&&(n&&t.name!==n||e(t,{port:i,sender:a}))};t.addListener(o),at(a,()=>t.removeListener(o))};if(Dt(o))t(o.onMessage);else if(At(o)){let e=e=>t(e.onMessage,e);o.addListener(e),at(a,()=>o.removeListener(e))}else jt(o)?t(o):t(o.onMessage);return}let s=xt(o)?o.port:o,c=i!==`*`&&Mt(o),l=t=>{let a=t.data;if(typeof a==`string`)try{a=JSON.parse(a)}catch{return}it(a,r)&&(n&&a.name!==n||c&&t.origin&&t.origin!==i||e(a,{receiveTransport:o,source:t.source,origin:t.origin}))};s.addEventListener(`message`,l),s instanceof MessagePort&&s.start(),at(a,()=>s.removeEventListener(`message`,l))},st=new WeakSet,ct=e=>String(e?.message??e).includes(`disconnected port`),lt=(e,t,n=`*`,r=[])=>{let i=Vt(e)?e.emit:e;if(typeof i==`function`)i(t,r);else if(Mt(i))i.postMessage(t,n,r);else if(Ot(i)){if(st.has(i))return;try{i.postMessage(t)}catch(e){if(!ct(e))throw e;st.add(i)}}else if(Dt(i))i.sendMessage(t)?.catch?.(e=>{if(!String(e?.message).includes(`Receiving end does not exist`))throw e});else if(gt(i)){let e=JSON.stringify(t);i.readyState===WebSocket.CONNECTING?i.addEventListener(`open`,()=>i.send(e),{once:!0}):i.send(e)}else xt(i)?i.port.postMessage(t,r):i.postMessage(t,r)},ut=globalThis.Float16Array,dt={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float16Array:ut,Float32Array,Float64Array,BigInt64Array,BigUint64Array},ft=Object.values(dt),pt=e=>{let t=e.constructor.name;if(t in dt)return t;for(let[t,n]of Object.entries(dt))if(n&&e instanceof n)return t;throw Error(`Unknown typed array type`)},mt=e=>{let t=dt[e];if(!t)throw Error(`Unknown typed array type`);return t},ht=e=>wt(e,ft),gt=e=>e instanceof WebSocket,_t=e=>!!globalThis.ServiceWorkerContainer&&e instanceof ServiceWorkerContainer,vt=e=>!!globalThis.ServiceWorker&&e instanceof ServiceWorker,yt=e=>!!globalThis.Worker&&e instanceof Worker,bt=e=>{let t=globalThis.DedicatedWorkerGlobalScope;return!!t&&e instanceof t},xt=e=>!!globalThis.SharedWorker&&e instanceof SharedWorker,St=e=>e instanceof MessagePort,Ct=e=>!!e&&typeof e==`object`&&`__OSRA_KEY__`in e&&!!e.__OSRA_KEY__,wt=(e,t)=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return!1;for(let n of t)if(n&&e instanceof n)return!0;return!1},Tt=e=>wt(e,[globalThis.SharedArrayBuffer]),Et=e=>wt(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Dt=e=>{let t=rt();return t?e===t:!1},Ot=(e,t=!1)=>!e||typeof e!=`object`||Mt(e)||!(`name`in e)||!(`disconnect`in e)||!(`postMessage`in e)?!1:!t||`sender`in e&&`onMessage`in e&&`onDisconnect`in e,kt=e=>!!e&&typeof e==`object`&&!Mt(e)&&`addListener`in e&&`hasListener`in e&&`removeListener`in e,At=e=>{let t=rt();return t?e===t.onConnect||e===t.onConnectExternal:!1},jt=e=>kt(e),Mt=e=>{if(!e||typeof e!=`object`)return!1;try{return`window`in e&&e.window===e}catch{try{return`closed`in e&&typeof e.closed==`boolean`&&`close`in e&&typeof e.close==`function`}catch{return!1}}},Nt=e=>gt(e)||Ot(e)||Dt(e),Pt=e=>gt(e)||Ot(e)||At(e)||jt(e)||Dt(e),Ft=e=>!!e&&typeof e==`object`&&!Mt(e)&&`isJson`in e&&e.isJson===!0||Nt(e)||Pt(e),It=e=>Mt(e)||Nt(e)||vt(e)||yt(e)||bt(e)||xt(e)||St(e)||zt(e),Lt=e=>Mt(e)||Pt(e)||_t(e)||yt(e)||bt(e)||xt(e)||St(e)||Bt(e),Rt=e=>{if(!e||typeof e!=`object`||Mt(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},zt=e=>!Rt(e)||!(`emit`in e)?!1:It(e.emit)||typeof e.emit==`function`,Bt=e=>!Rt(e)||!(`receive`in e)?!1:Lt(e.receive)||typeof e.receive==`function`,Vt=e=>zt(e)||Bt(e),Ht=()=>globalThis.Buffer,Ut=32768,Wt=e=>{let t=e.toBase64;if(typeof t==`function`)return t.call(e);let n=Ht();if(n)return n.from(e).toString(`base64`);let r=``;for(let t=0;t<e.length;t+=Ut)r+=String.fromCharCode(...e.subarray(t,t+Ut));return btoa(r)},Gt=e=>{let t=Uint8Array.fromBase64;if(typeof t==`function`)return t(e);let n=Ht();if(n)return new Uint8Array(n.from(e,`base64`));let r=atob(e),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);return i},G={[tt]:`revivable`},Kt=e=>!!e&&typeof e==`object`&&`__OSRA_BOX__`in e&&e.__OSRA_BOX__===`revivable`,qt=(e,t)=>Ft(t.transport)?{base64Buffer:Wt(new Uint8Array(e))}:{arrayBuffer:e},Jt=e=>`arrayBuffer`in e?e.arrayBuffer:Gt(e.base64Buffer).buffer,Yt=Qe({box:()=>Qt,isType:()=>Zt,objectsOnly:()=>!0,revive:()=>$t,type:()=>Xt}),Xt=`arrayBuffer`,Zt=e=>e instanceof ArrayBuffer,Qt=(e,t)=>({...G,type:Xt,...qt(e,t)}),$t=(e,t)=>Jt(e),en=Qe({box:()=>rn,isType:()=>nn,objectsOnly:()=>!0,revive:()=>an,type:()=>tn}),tn=`date`,nn=e=>e instanceof Date,rn=(e,t)=>({...G,type:tn,ISOString:e.toISOString()}),an=(e,t)=>new Date(e.ISOString),on=Qe({box:()=>ln,isType:()=>cn,objectsOnly:()=>!0,revive:()=>un,type:()=>sn}),sn=`headers`,cn=e=>e instanceof Headers,ln=(e,t)=>({...G,type:sn,entries:[...e.entries()]}),un=(e,t)=>new Headers(e.entries),dn=Qe({box:()=>hn,isType:()=>mn,objectsOnly:()=>!0,revive:()=>gn,type:()=>fn}),fn=`error`,pn={Error,TypeError,RangeError,SyntaxError,ReferenceError,EvalError,URIError},mn=e=>e instanceof Error,hn=(e,t)=>{let n=`cause`in e&&e.cause!==void 0,r=typeof AggregateError<`u`&&e instanceof AggregateError,i=typeof DOMException<`u`&&e instanceof DOMException;return{...G,type:fn,name:e.name,message:e.message,stack:e.stack||e.toString(),...n?{cause:Pa(e.cause,t)}:{},...r?{errors:Pa(e.errors,t)}:{},...i?{isDOMException:!0}:{}}},gn=(e,t)=>{let n=e.cause===void 0?void 0:Ia(e.cause,t),r=n===void 0?void 0:{cause:n};if(e.isDOMException&&typeof DOMException<`u`){let t=new DOMException(e.message,e.name);if(e.stack)try{Object.defineProperty(t,"stack",{value:e.stack,configurable:!0})}catch{}return t}let i;if(e.errors!==void 0&&typeof AggregateError<`u`)i=AggregateError(Ia(e.errors,t),e.message,r);else{let t=pn[e.name]??Error;i=r===void 0?new t(e.message):new t(e.message,r)}return e.name&&i.name!==e.name&&(i.name=e.name),e.stack&&(i.stack=e.stack),i},_n=Qe({box:()=>bn,isType:()=>yn,objectsOnly:()=>!0,revive:()=>xn,type:()=>vn}),vn=`typedArray`,yn=ht,bn=(e,t)=>{let n=e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return{...G,type:vn,typedArrayType:pt(e),...qt(n,t)}},xn=(e,t)=>new(mt(e.typedArrayType))(Jt(e)),Sn=new WeakMap,Cn=new WeakSet,wn=(e,t)=>{if(Cn.has(e))return t(),()=>{};let n=Sn.get(e);return n||Sn.set(e,n=new Set),n.add(t),()=>n.delete(t)},Tn=e=>Cn.has(e),En=e=>{if(Cn.has(e))return;Cn.add(e);let t=Sn.get(e);if(t){Sn.delete(e);for(let e of t)try{e()}catch{}}},Dn=Qe({box:()=>zn,forceTransfer:()=>In,isInTransfer:()=>Fn,isType:()=>Rn,objectsOnly:()=>!0,outsideTransfer:()=>Ln,revive:()=>Bn,transfer:()=>Nn,type:()=>On}),On=`transfer`,kn=Symbol.for(`osra.transfer`),An=e=>typeof e==`object`&&!!e,jn=e=>An(e)&&kn in e&&e[kn]===!0,Mn=e=>An(e)?ArrayBuffer.isView(e)?!0:wt(e,[globalThis.ArrayBuffer,globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.Request,globalThis.Response,globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.VideoFrame,globalThis.AudioData]):!1,Nn=e=>Mn(e)?{[kn]:!0,value:e}:e,Pn=0,Fn=()=>Pn>0,In=e=>An(e)&&!jn(e)?{[kn]:!0,value:e}:e,Ln=e=>{let t=Pn;Pn=0;try{return e()}finally{Pn=t}},Rn=e=>jn(e),zn=(e,t)=>{Pn++;try{return{...G,type:On,inner:Pa(e.value,t),degraded:Ft(t.transport)}}finally{Pn--}},Bn=(e,t)=>Ia(e.inner,t),Vn=e=>wt(e,[globalThis.MessagePort,globalThis.ReadableStream,globalThis.WritableStream,globalThis.TransformStream,globalThis.OffscreenCanvas,globalThis.MediaSourceHandle,globalThis.MediaStreamTrack,globalThis.MIDIAccess,globalThis.RTCDataChannel,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream]),Hn=e=>Kt(e)&&e.type===`transfer`,Un=e=>{let t=[],n=new WeakSet,r=(e,i)=>{if(e&&typeof e==`object`&&!n.has(e)&&(n.add(e),!Tt(e))){if(Hn(e)){r(e.inner,i||!e.degraded);return}if(Vn(e)){t.push(e);return}if(Et(e)){i&&t.push(e);return}if(ArrayBuffer.isView(e)){i&&e instanceof DataView&&!Tt(e.buffer)&&!n.has(e.buffer)&&(n.add(e.buffer),t.push(e.buffer));return}if(Array.isArray(e)){for(let t of e)r(t,i);return}for(let t of Object.values(e))r(t,i)}};return r(e,!1),t},Wn=class{_listeners=new Map;addEventListener(e,t,n){if(!t)return;let r=this._listeners.get(e);r||(r=new Map,this._listeners.set(e,r)),r.has(t)||r.set(t,typeof n==`object`&&!!n?.once)}removeEventListener(e,t,n){t&&this._listeners.get(e)?.delete(t)}_peer;_queue=[];_started=!1;_closed=!1;_onClose;_onmessage=null;get onmessage(){return this._onmessage}set onmessage(e){this._onmessage=e,e!==null&&this.start()}onmessageerror=null;dispatchEvent(e){e.type===`message`?this._onmessage?.call(this,e):e.type===`messageerror`&&this.onmessageerror?.call(this,e);let t=this._listeners.get(e.type);if(t)for(let[n,r]of[...t])r&&t.delete(n),typeof n==`function`?n.call(this,e):n.handleEvent(e);return!0}postMessage(e,t){let n=this._peer;!n||n._closed||queueMicrotask(()=>{if(n._closed)return;let t=new MessageEvent(`message`,{data:e});n._started?n.dispatchEvent(t):n._queue.push(t)})}start(){if(!this._started){this._started=!0;for(let e of this._queue.splice(0))this.dispatchEvent(e)}}close(){if(this._closed)return;this._closed=!0,this._queue.length=0,this._onClose?.();let e=this._peer;e&&!e._closed&&queueMicrotask(()=>{e._closed||e.dispatchEvent(new Event(`close`))})}},Gn=class{port1;port2;constructor(){let e=new Wn,t=new Wn;e._peer=t,t._peer=e,this.port1=e,this.port2=t}},Kn=new FinalizationRegistry(e=>{try{e()}catch{}}),qn=(e,t)=>{let n={};return Kn.register(e,t,n),()=>Kn.unregister(n)},Jn=Qe({box:()=>gr,createRevivableChannel:()=>xr,init:()=>or,isType:()=>sr,markPortsShipped:()=>yr,objectsOnly:()=>!0,postPreBoxed:()=>mr,revive:()=>_r,type:()=>Yn}),Yn=`messagePort`,Xn=2048,Zn=128,Qn=1024,$n=new WeakMap,er=e=>{let t=$n.get(e);if(!t)throw Error(`osra message-port: connection state missing; did init() run?`);return t},tr=(e,t)=>{let n=e.ports.get(t);return n||(n={nextSeq:0,buffer:new Map,outSeq:0},e.ports.set(t,n),e.pendingPorts++),n},nr=(e,t)=>{let n=e.ports.get(t);if(n&&!n.handler&&e.pendingPorts--,e.ports.delete(t),e.tombstones.size>=Zn){let t=e.tombstones.values().next().value;t!==void 0&&e.tombstones.delete(t)}e.tombstones.add(t)},rr=e=>{if(e.handler)for(let t=e.buffer.get(e.nextSeq);t!==void 0;t=e.buffer.get(e.nextSeq))e.buffer.delete(e.nextSeq),e.nextSeq++,e.handler(t)},ir=(e,t)=>tr(er(e),t).outSeq++,ar=(e,t,n)=>{let r=er(e);if(r.tombstones.has(t)){setTimeout(()=>n({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t}));return}let i=tr(r,t);i.handler||r.pendingPorts--,i.handler=n,rr(i)},or=e=>{let t={ports:new Map,tombstones:new Set,pendingPorts:0};$n.set(e,t),e.eventTarget.addEventListener(`message`,({detail:n})=>{if(n.type!==`message`&&n.type!==`message-port-close`||t.tombstones.has(n.portId))return;let r=t.ports.get(n.portId);if(n.seq===void 0){r?.handler?.(n);return}if(!r){if(t.pendingPorts>=Qn)return;r=tr(t,n.portId)}if(!(n.seq<r.nextSeq)){if(r.buffer.size>=Xn&&!(n.seq===r.nextSeq&&r.handler)){r.buffer.clear(),nr(t,n.portId),r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n.portId});return}r.buffer.set(n.seq,n),rr(r)}}),wn(e,()=>{for(let[n,r]of[...t.ports])r.handler?.({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:n});t.ports.clear(),t.tombstones.clear(),t.pendingPorts=0})},sr=e=>e instanceof MessagePort||e instanceof Wn,cr=(e,t)=>{try{let n=er(e).ports.get(t);e.sendMessage({type:`message-port-close`,remoteUuid:e.remoteUuid,portId:t,seq:n?n.outSeq++:0})}catch{}},lr=(e,t,n)=>{if(n){e.postMessage(t);return}let r=Un(t);e.postMessage(t,r),yr(r)},ur=(e,t,n,r)=>{let i;try{i=Ia(e,t)}catch(e){r(),globalThis.reportError?.(e);return}n(i)},dr=(e,t,n)=>()=>{let r=e.deref();r&&cr(r,n);let i=t.deref();i&&nr(i,n)},fr=new WeakSet,pr=e=>e!==null&&(typeof e==`object`||typeof e==`function`),mr=(e,t,n)=>{pr(t)&&fr.add(t),e.postMessage(t,n??[])},hr=(e,t)=>pr(e)&&fr.delete(e)?e:Ln(()=>Pa(e,t)),gr=(e,t,n)=>{let r=e instanceof Wn;if(!r&&!Ft(t.transport))return{...G,type:Yn,port:e,...n?.autoBox?{autoBox:!0}:{}};let i=er(t),a=e,o=globalThis.crypto.randomUUID(),s=new WeakRef(a),c=new WeakRef(t),l=new WeakRef(i),u=!1,d=()=>{if(u)return;u=!0;let e=l.deref();e&&nr(e,o),m?.();let t=s.deref();t?.removeEventListener(`message`,p),t instanceof Wn&&(t._onClose=void 0)},f=e=>{if(e.type===`message-port-close`){d(),a.dispatchEvent(new Event(`close`)),a.close();return}ur(e.data,t,e=>lr(a,e,!1),()=>{})};function p({data:e}){t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:hr(e,t),portId:o,seq:ir(t,o)})}let m=qn(a,dr(c,l,o));return a.addEventListener(`message`,p),a.start(),a instanceof Wn&&(a._onClose=()=>{u||(cr(t,o),d())}),ar(t,o,f),{...G,type:Yn,portId:o,synthetic:r}},_r=(e,t)=>`port`in e?(yr([e.port]),e.autoBox?br(e.port,t):e.port):Sr(e.portId,t,e.synthetic),vr=new WeakMap,yr=e=>{for(let t of e){let e=vr.get(t);if(e){vr.delete(t),e.shipped=!0;for(let t of e.pending.splice(0))t()}}},br=(e,t,n)=>{let r=new EventTarget,i=({data:e})=>{ur(e,t,e=>r.dispatchEvent(new MessageEvent(`message`,{data:e})),()=>r.dispatchEvent(new Event(`messageerror`)))},a=()=>{r.dispatchEvent(new Event(`messageerror`))},o=()=>{r.dispatchEvent(new Event(`close`))};e.addEventListener(`message`,i),e.addEventListener(`messageerror`,a),e.addEventListener(`close`,o),r.postMessage=(r,i)=>{let a=Ln(()=>Pa(r,t)),o=Un(a),s=Array.isArray(i)?i:[],c=s.length?[...o,...s]:o,l=()=>{e.postMessage(a,c),yr(c)};if(n&&!n.shipped){n.pending.push(l);return}l()},r.start=()=>e.start();let s=()=>{e.removeEventListener(`message`,i),e.removeEventListener(`messageerror`,a),e.removeEventListener(`close`,o),e.close()};return r.close=()=>{if(n&&!n.shipped){n.pending.push(s);return}s()},r},xr=e=>{if(Ft(e.transport)){let{port1:t,port2:n}=new Gn;return{localPort:t,boxedRemote:gr(n,e)}}let{port1:t,port2:n}=new MessageChannel,r={shipped:!1,pending:[]};return vr.set(n,r),{localPort:br(t,e,r),boxedRemote:gr(n,e,{autoBox:!0})}},Sr=(e,t,n)=>{let r=er(t),{port1:i,port2:a}=n?new Gn:new MessageChannel,o=new WeakRef(i),s=new WeakRef(a),c=!1,l=!1;i instanceof Wn||i.addEventListener(`close`,e=>{l&&e.stopImmediatePropagation()});let u=()=>{if(c)return;c=!0,nr(r,e);let t=s.deref();t?.removeEventListener(`message`,f),t?.close(),p?.()},d=e=>{if(e.type===`message-port-close`){u();let e=o.deref();e?.dispatchEvent(new Event(`close`)),l=!0,e?.close();return}if(!o.deref()){u();return}let r=s.deref();r&&ur(e.data,t,e=>lr(r,e,n),()=>o.deref()?.dispatchEvent(new Event(`messageerror`)))},f=({data:n})=>{t.sendMessage({type:`message`,remoteUuid:t.remoteUuid,data:hr(n,t),portId:e,seq:ir(t,e)})},p=qn(i,()=>{cr(t,e),u()});return i instanceof Wn&&(i._onClose=()=>{c||(cr(t,e),u())}),a.addEventListener(`message`,f),a.start(),ar(t,e,d),i},Cr=Qe({box:()=>Or,isType:()=>Dr,objectsOnly:()=>!0,revive:()=>kr,type:()=>wr}),wr=`promise`,Tr=e=>e instanceof Promise,Er=new Set,Dr=e=>e instanceof Promise,Or=(e,t)=>{if(!Tr(e))throw TypeError(`Expected Promise`);let{localPort:n,boxedRemote:r}=xr(t),i=e=>{n.postMessage(e),n.close()};return e.then(e=>i({type:`resolve`,data:e})).catch(e=>i({type:`reject`,error:e})),{...G,type:wr,port:r}},kr=(e,t)=>{let n=_r(e.port,t);Er.add(n);let r=`portId`in e.port;return new Promise((e,i)=>{let a,o=()=>{n.close(),Er.delete(n),a?.()};if(r&&Tn(t)){i(Error(`osra: connection closed`)),o();return}a=r?wn(t,()=>{i(Error(`osra: connection closed`)),o()}):void 0,n.addEventListener(`message`,({data:t})=>{t.type===`resolve`?e(t.data):i(t.error),o()},{once:!0}),n.start()})},Ar=Qe({box:()=>Fr,isType:()=>Pr,objectsOnly:()=>!0,revive:()=>Ir,type:()=>jr}),jr=`function`,Mr=new Set,Nr=e=>{e instanceof ReadableStream?e.locked||e.cancel(Error(`osra: connection closed`)).catch(()=>{}):typeof WritableStream<`u`&&e instanceof WritableStream&&(e.locked||e.abort(Error(`osra: connection closed`)).catch(()=>{}))},Pr=e=>typeof e==`function`,Fr=(e,t)=>{let{port1:n,port2:r}=new Gn;return n.addEventListener(`message`,({data:n})=>{let[r,i]=n;(async()=>{let n;try{n={type:`return`,value:await e(...i)}}catch(e){n={type:`throw`,error:e}}if(Tn(t)){n.type===`return`&&Nr(n.value);try{r.close()}catch{}return}let a=(()=>{try{return Pa(n,t)}catch(e){return Pa({type:`throw`,error:e},t)}})();mr(r,a),queueMicrotask(()=>{try{r.close()}catch{}})})()}),n.start(),{...G,type:jr,port:gr(r,t)}},Ir=(e,t)=>{let n=_r(e.port,t);return((...e)=>new Promise((r,i)=>{if(Tn(t)){i(Error(`osra: connection closed`));return}let{port1:a,port2:o}=new Gn;Mr.add(a);let s,c=()=>{a.close(),Mr.delete(a),s?.()};s=wn(t,()=>{i(Error(`osra: connection closed`)),c()}),a.addEventListener(`message`,({data:e})=>{let t=e;t.type===`return`?r(t.value):i(t.error),c()},{once:!0}),a.start();let l=Ln(()=>Pa([o,e],t));mr(n,l)}))},Lr=Qe({MAX_CREDIT_WINDOW:()=>64,box:()=>Ur,isType:()=>zr,objectsOnly:()=>!0,revive:()=>qr,type:()=>Rr}),Rr=`readableStream`,zr=e=>e instanceof ReadableStream,Br=2,Vr=8,Hr=4194304,Ur=(e,t)=>{let{localPort:n,boxedRemote:r}=xr(t),i=e.getReader(),a=Fn(),o=0,s=!1,c=!1,l=e=>{c=!0;try{n.postMessage(e)}catch{}n.close()},u=async()=>{if(!(s||c)){for(s=!0;o>0;){let e;try{e=await i.read()}catch(e){c||l({type:`error`,error:e});return}if(c)return;if(e.done){l({type:`end`});return}o--;let t=a?In(e.value):e.value;try{n.postMessage({type:`chunk`,value:t})}catch(e){l({type:`error`,error:e}),i.cancel(e).catch(()=>{});return}}s=!1}};return n.addEventListener(`message`,({data:e})=>{e instanceof Promise||!(`type`in e)||(e.type===`pull`?n.postMessage(i.read()):e.type===`credit`?(o+=e.n,u()):e.type===`cancel`&&(c=!0,i.cancel(e.reason).catch(()=>{}),n.close()))}),n.addEventListener(`close`,()=>{c||(c=!0,i.cancel(Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...G,type:Rr,credit:!0,port:r}},Wr=e=>ArrayBuffer.isView(e)||e instanceof ArrayBuffer?e.byteLength:typeof e==`string`?e.length*2:typeof Blob<`u`&&e instanceof Blob?e.size:void 0,Gr=e=>{let t=!1,n=0,r,i=[],a=!1,o=!1,s,c,l=()=>r===void 0?Vr:Math.max(Br,Math.min(64,Math.floor(Hr/r))),u=()=>{let t=l(),r=n+i.length;if(r>t/2)return;let a=t-r;n+=a,e.postMessage({type:`credit`,n:a})},d=()=>{t=!0,queueMicrotask(()=>e.close())},f=e=>{if(o=!0,s=e,!c||i.length)return;let t=c;c=void 0,d(),t.reject(e)};return new ReadableStream({start:()=>{e.addEventListener(`message`,({data:o})=>{if(!(o instanceof Promise||!(`type`in o))){if(o.type===`chunk`){if(t)return;if(n<=0){i.length=0,f(Error(`osra: stream exceeded its credit window`)),queueMicrotask(()=>e.close());return}n--;let a=Wr(o.value);if(a!==void 0&&(r=r===void 0?a:r*.875+a*.125),c){let e=c;c=void 0,e.controller.enqueue(o.value),e.resolve()}else i.push(o.value)}else if(o.type===`end`){if(t||(a=!0,!c||i.length))return;let e=c;c=void 0,d(),e.controller.close(),e.resolve()}else if(o.type===`error`){if(t)return;f(o.error)}}}),e.addEventListener(`messageerror`,()=>{t||f(Error(`osra: a chunk failed to deserialize on this platform`))}),e.addEventListener(`close`,()=>{t||a||o||f(Error(`osra: connection closed`))},{once:!0})},pull:e=>{if(!t){if(i.length){e.enqueue(i.shift()),!a&&!o&&u();return}if(o)return d(),Promise.reject(s);if(a){d(),e.close();return}return u(),new Promise((t,n)=>{c={controller:e,resolve:t,reject:n}})}},cancel:n=>{t=!0,i.length=0;let r=c;c=void 0,r?.resolve(),e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},Kr=e=>{let t=!1;return new ReadableStream({start:n=>{e.addEventListener(`messageerror`,()=>{if(!t){t=!0;try{n.error(Error(`osra: a chunk failed to deserialize on this platform`))}catch{}queueMicrotask(()=>e.close())}}),e.addEventListener(`close`,()=>{if(!t){t=!0;try{n.error(Error(`osra: connection closed`))}catch{}}},{once:!0})},pull:n=>new Promise((r,i)=>{e.addEventListener(`message`,({data:a})=>{a instanceof Promise&&a.then(i=>{i.done?(t=!0,n.close(),e.postMessage({type:`cancel`}),queueMicrotask(()=>e.close())):n.enqueue(i.value),r()}).catch(e=>{t=!0,i(e)})},{once:!0}),e.postMessage({type:`pull`})}),cancel:n=>{t=!0,e.postMessage({type:`cancel`,reason:n}),queueMicrotask(()=>e.close())}})},qr=(e,t)=>{let n=_r(e.port,t);return n.start(),e.credit?Gr(n):Kr(n)},Jr=Qe({box:()=>Zr,isType:()=>Xr,objectsOnly:()=>!0,revive:()=>Qr,type:()=>Yr}),Yr=`writableStream`,Xr=e=>e instanceof WritableStream,Zr=(e,t)=>{let{localPort:n,boxedRemote:r}=xr(t),i=e.getWriter(),a=!1,o=(e,t)=>e.then(()=>n.postMessage({type:`ack`})).catch(e=>n.postMessage({type:`err`,error:e?.message??String(e)})).then(()=>{t&&(a=!0,queueMicrotask(()=>n.close()))});return n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`write`?o(i.write(e.chunk),!1):e.type===`close`?o(i.close(),!0):e.type===`abort`&&o(i.abort(e.reason),!0))}),n.addEventListener(`messageerror`,()=>{n.postMessage({type:`err`,error:`osra: a chunk failed to deserialize on this platform`})}),n.addEventListener(`close`,()=>{a||(a=!0,i.abort(Error(`osra: connection closed`)).catch(()=>{}))},{once:!0}),n.start(),{...G,type:Yr,port:r,...Fn()?{transferChunks:!0}:{}}},Qr=(e,t)=>{let n=_r(e.port,t);n.start();let r=new Set,i=!1;n.addEventListener(`close`,()=>{i=!0;let e=Error(`osra: connection closed`);for(let t of[...r])t(e);r.clear()},{once:!0});let a=Promise.resolve(),o=e=>{let t=a.then(()=>new Promise((t,a)=>{if(i){a(Error(`osra: connection closed`));return}let o=e=>{r.delete(a),e()};r.add(a),n.addEventListener(`message`,({data:e})=>{!e||typeof e!=`object`||!(`type`in e)||(e.type===`ack`?o(t):e.type===`err`&&o(()=>a(Error(e.error))))},{once:!0}),n.postMessage(e)}));return a=t.catch(()=>{}),t},s=e.transferChunks===!0;return new WritableStream({write:e=>o({type:`write`,chunk:s?In(e):e}),close:()=>o({type:`close`}),abort:e=>o({type:`abort`,reason:e})})},$r=Qe({box:()=>ri,isType:()=>ti,objectsOnly:()=>!0,revive:()=>ii,type:()=>ei}),ei=`abortSignal`,ti=e=>e instanceof AbortSignal,ni=new WeakMap,ri=(e,t)=>{if(e.aborted)return{...G,type:ei,aborted:!0,reason:Pa(e.reason,t)};let{localPort:n,boxedRemote:r}=xr(t),i=()=>{n.postMessage({type:`abort`,reason:e.reason}),n.close(),a()},a=wn(t,()=>{e.removeEventListener(`abort`,i),n.close()});return e.addEventListener(`abort`,i,{once:!0}),{...G,type:ei,aborted:!1,reason:void 0,port:r}},ii=(e,t)=>{let n=new AbortController;if(e.aborted||e.port===void 0)return n.abort(Ia(e.reason,t)),n.signal;let r=_r(e.port,t);return ni.set(n.signal,r),r.start(),r.addEventListener(`message`,({data:e})=>{e.type===`abort`&&(n.abort(Ia(e.reason,t)),ni.delete(n.signal),r.close())}),n.signal},ai=Qe({box:()=>ci,isType:()=>si,objectsOnly:()=>!0,revive:()=>li,type:()=>oi}),oi=`response`,si=e=>e instanceof Response,ci=(e,t)=>({...G,type:oi,status:e.status,statusText:e.statusText,headers:ln(e.headers,t),body:e.body?Ur(e.body,t):null,url:e.url,redirected:e.redirected}),li=(e,t)=>{if(e.status===0)return Response.error();let n=un(e.headers,t),r=e.body?qr(e.body,t):null,i=e.status===101||e.status===204||e.status===205||e.status===304;r&&i&&r.cancel().catch(()=>{});let a=new Response(i?null:r,{status:e.status,statusText:e.statusText,headers:n});return e.url&&Object.defineProperty(a,"url",{value:e.url,configurable:!0}),e.redirected&&Object.defineProperty(a,"redirected",{value:!0,configurable:!0}),a},ui=Qe({box:()=>pi,isType:()=>fi,objectsOnly:()=>!0,revive:()=>mi,type:()=>di}),di=`request`,fi=e=>e instanceof Request,pi=(e,t)=>({...G,type:di,method:e.method,url:e.url,headers:ln(e.headers,t),body:e.body?Ur(e.body,t):null,credentials:e.credentials,cache:e.cache,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:ri(e.signal,t)}),mi=(e,t)=>{let n=un(e.headers,t),r={method:e.method,headers:n,credentials:e.credentials,cache:e.cache,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,integrity:e.integrity,keepalive:e.keepalive,signal:ii(e.signal,t)};return e.mode!==`navigate`&&(r.mode=e.mode),e.body&&(r.body=qr(e.body,t),r.duplex=`half`),new Request(e.url,r)},hi=Qe({box:()=>Di,boxByReference:()=>Oi,identity:()=>xi,isType:()=>wi,objectsOnly:()=>!0,revive:()=>ki,type:()=>gi}),gi=`identity`,_i=e=>e!==null&&(typeof e==`object`||typeof e==`function`),vi=e=>{if(e===null)return!1;let t=typeof e;return t===`object`||t===`function`||t===`symbol`&&Symbol.keyFor(e)===void 0},yi=new WeakMap,bi=e=>{let t=yi.get(e);if(t!==void 0)return t;let n=globalThis.crypto.randomUUID();return yi.set(e,n),n},xi=e=>(_i(e)&&bi(e),e),Si=new WeakMap,Ci=e=>{let t=Si.get(e);if(t)return t;let n=new Map,r={idToLocal:n,pins:new Map,aliasIds:new WeakMap,disposeRegistry:new FinalizationRegistry(t=>{if(n.delete(t),!Tn(e))try{e.sendMessage({type:`identity-dispose`,remoteUuid:e.remoteUuid,id:t})}catch{}})};return Si.set(e,r),e.eventTarget.addEventListener(`message`,({detail:e})=>{e?.type===`identity-dispose`&&(r.pins.delete(e.id),r.idToLocal.delete(e.id))}),wn(e,()=>{r.pins.clear(),r.idToLocal.clear()}),r},wi=e=>_i(e)&&yi.has(e),Ti=(e,t)=>{let n=t.aliasIds.get(e);if(n!==void 0)return n;let r=bi(e),i=t.idToLocal.get(r);if(i===void 0||i.deref()===e)return r;let a=globalThis.crypto.randomUUID();return t.aliasIds.set(e,a),a},Ei=(e,t,n)=>{let r=Ti(e,n);if(n.idToLocal.has(r))return{...G,type:gi,id:r};let i=t();return n.idToLocal.set(r,new WeakRef(e)),n.disposeRegistry.register(e,r,e),Oa(()=>{},()=>{n.idToLocal.delete(r),n.disposeRegistry.unregister(e)}),{...G,type:gi,id:r,inner:i}},Di=(e,t)=>{let n=Ci(t),r=()=>Fa(e,t,gi);return vi(e)?Ei(e,r,n):{...G,type:gi,id:globalThis.crypto.randomUUID(),inner:r()}},Oi=(e,t,n)=>Ei(e,()=>t,Ci(n)),ki=(e,t)=>{let n=Ci(t);if(n.pins.has(e.id))return n.pins.get(e.id);let r=n.idToLocal.get(e.id)?.deref();if(r!==void 0)return r;if(!(`inner`in e)||e.inner===void 0){try{t.sendMessage({type:`identity-dispose`,remoteUuid:t.remoteUuid,id:e.id})}catch{}throw Error(`osra identity: received id=${e.id} with no inner payload and nothing local to resolve it to`)}let i=Ia(e.inner,t);return n.pins.set(e.id,i),vi(i)&&(yi.has(i)||yi.set(i,e.id),n.idToLocal.set(e.id,new WeakRef(i))),i},Ai=Qe({box:()=>Mi,isType:()=>ji,objectsOnly:()=>!0,revive:()=>Ni,type:()=>`map`}),ji=e=>e instanceof Map,Mi=(e,t)=>({...G,type:`map`,entries:Array.from(e,([e,n])=>[Pa(e,t),Pa(n,t)])}),Ni=(e,t)=>new Map(e.entries.map(([e,n])=>[Ia(e,t),Ia(n,t)])),Pi=Qe({box:()=>Ii,isType:()=>Fi,objectsOnly:()=>!0,revive:()=>Li,type:()=>`set`}),Fi=e=>e instanceof Set,Ii=(e,t)=>({...G,type:`set`,values:Array.from(e,e=>Pa(e,t))}),Li=(e,t)=>new Set(e.values.map(e=>Ia(e,t))),Ri=Qe({box:()=>Vi,isType:()=>Bi,revive:()=>Hi,type:()=>zi}),zi=`bigint`,Bi=e=>typeof e==`bigint`,Vi=(e,t)=>({...G,type:zi,value:e.toString()}),Hi=(e,t)=>BigInt(e.value),Ui=Qe({box:()=>Ki,isType:()=>Gi,objectsOnly:()=>!0,revive:()=>qi,type:()=>Wi}),Wi=`event`,Gi=e=>e instanceof Event,Ki=(e,t)=>({...G,type:Wi,eventType:e.type,bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed,...e instanceof CustomEvent?{detail:Pa(e.detail,t)}:{}}),qi=(e,t)=>{let n={bubbles:e.bubbles,cancelable:e.cancelable,composed:e.composed};return`detail`in e?new CustomEvent(e.eventType,{...n,detail:Ia(e.detail,t)}):new Event(e.eventType,n)},Ji=Qe({box:()=>Zi,isType:()=>Xi,objectsOnly:()=>!0,revive:()=>ta,type:()=>Yi}),Yi=`eventTarget`,Xi=e=>e instanceof EventTarget,Zi=(e,t)=>{let n=[],r=e=>typeof e==`boolean`?e:!!e?.capture;return{...G,type:Yi,addListener:Fr((t,i,a)=>{n.push({eventType:t,listener:i,capture:r(a)}),e.addEventListener(t,i,a)},t),removeListener:Fr((t,i,a)=>{let o=r(a),s=n.findIndex(e=>e.eventType===t&&e.listener===i&&e.capture===o);s!==-1&&n.splice(s,1),e.removeEventListener(t,i,a)},t),removeAllListeners:Fr(()=>{for(let{eventType:t,listener:r,capture:i}of n.splice(0))e.removeEventListener(t,r,{capture:i})},t)}},Qi=new WeakMap,$i=e=>{if(typeof e==`function`)return e;let t=Qi.get(e);return t||Qi.set(e,t=t=>e.handleEvent(t)),t},ea=(e,t,n,r)=>e.find(e=>e.eventType===t&&e.listener===n&&e.capture===r),ta=(e,t)=>{let n=Ir(e.addListener,t),r=Ir(e.removeListener,t),i=Ir(e.removeAllListeners,t),a=new EventTarget,o=[],s=e=>{let t=o.indexOf(e);t!==-1&&o.splice(t,1)};return Object.defineProperty(a,"addEventListener",{value:(e,t,r)=>{if(t===null)return;let i=$i(t),a=typeof r==`boolean`?r:!!r?.capture;if(ea(o,e,i,a))return;let c=typeof r==`object`&&r?.once?e=>(s(l),i(e)):i,l={eventType:e,listener:i,capture:a,wire:c};o.push(l),(typeof r==`object`?r?.signal:void 0)?.addEventListener(`abort`,()=>s(l),{once:!0}),n(e,xi(c),r).catch(()=>{})}}),Object.defineProperty(a,"removeEventListener",{value:(e,t,n)=>{if(t===null)return;let i=$i(t),a=typeof n==`boolean`?n:!!n?.capture,c=ea(o,e,i,a);c&&(s(c),r(e,xi(c.wire),{capture:a}).catch(()=>{}))}}),qn(a,()=>{i().catch(()=>{})}),a},na=Qe({box:()=>aa,isType:()=>ia,revive:()=>oa,type:()=>ra}),ra=`symbol`,ia=e=>typeof e==`symbol`,aa=(e,t)=>{let n=Symbol.keyFor(e);return n===void 0?Oi(e,{...G,type:ra,description:e.description},t):{...G,type:ra,registryKey:n}},oa=(e,t)=>`registryKey`in e?Symbol.for(e.registryKey):Symbol(e.description),sa=Qe({box:()=>ua,isType:()=>la,objectsOnly:()=>!0,revive:()=>da,type:()=>ca}),ca=`asyncIterator`,la=e=>!e||typeof e!=`object`||typeof ReadableStream<`u`&&e instanceof ReadableStream?!1:typeof e[Symbol.asyncIterator]==`function`,ua=(e,t)=>{let n=e[Symbol.asyncIterator]();return{...G,type:ca,next:Fr((e=>n.next(e)),t),return:Fr((e=>n.return?.(e)??Promise.resolve({done:!0,value:e})),t),throw:Fr((e=>n.throw?.(e)??Promise.reject(e)),t)}},da=(e,t)=>{let n=Ir(e.next,t),r=Ir(e.return,t),i=Ir(e.throw,t),a={next:(...e)=>n(...e),return:e=>r(e),throw:e=>i(e),[Symbol.asyncIterator]:()=>a};return a},fa=[globalThis.File,globalThis.FileList,globalThis.RegExp,globalThis.DataView,globalThis.ImageData,globalThis.FormData,globalThis.DOMException,globalThis.DOMMatrix,globalThis.DOMMatrixReadOnly,globalThis.DOMPoint,globalThis.DOMPointReadOnly,globalThis.DOMQuad,globalThis.DOMRect,globalThis.DOMRectReadOnly,globalThis.CryptoKey,globalThis.FileSystemHandle,globalThis.FileSystemFileHandle,globalThis.FileSystemDirectoryHandle,globalThis.RTCCertificate],pa=[globalThis.CropTarget,globalThis.EncodedAudioChunk,globalThis.EncodedVideoChunk,globalThis.FencedFrameConfig,globalThis.GPUCompilationInfo,globalThis.GPUCompilationMessage,globalThis.GPUPipelineError,globalThis.RTCEncodedAudioFrame,globalThis.RTCEncodedVideoFrame,globalThis.WebTransportError],ma={type:`clonable`,capableOnly:!0,objectsOnly:!0,isType:e=>wt(e,fa)||wt(e,pa),box:(e,t)=>e,revive:(e,t)=>e},ha=[globalThis.ImageBitmap,globalThis.OffscreenCanvas,globalThis.WritableStream,globalThis.TransformStream,globalThis.MediaStreamTrack,globalThis.RTCDataChannel],ga=[globalThis.AudioData,globalThis.VideoFrame,globalThis.MediaSourceHandle,globalThis.MIDIAccess,globalThis.WebTransportReceiveStream,globalThis.WebTransportSendStream],_a={type:`transferable`,capableOnly:!0,objectsOnly:!0,isType:e=>wt(e,ha)||wt(e,ga),box:(e,t)=>e,revive:(e,t)=>e},va={type:`blob`,capableOnly:!0,objectsOnly:!0,isType:e=>typeof Blob<`u`&&e instanceof Blob,box:(e,t)=>{if(Ft(t.transport))throw TypeError(`osra: Blob is only supported on structured-clone transports, send an ArrayBuffer or Uint8Array instead`);return e},revive:(e,t)=>e},ya=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ba=[Dn,hi,Yt,en,on,dn,_n,Cr,Ar,Jn,Lr,Jr,$r,ai,ui,Ai,Pi,Ri,na,Ui,sa,{type:`nonFiniteNumber`,isType:e=>typeof e==`number`&&!Number.isFinite(e),box:(e,t)=>Ft(t.transport)?{...G,type:`nonFiniteNumber`,value:String(e)}:e,revive:(e,t)=>Number(e.value)},{type:`undefined`,isType:e=>e===void 0,box:(e,t)=>Ft(t.transport)?{...G,type:`undefined`}:e,revive:(e,t)=>void 0},ma,_a,va,Ji,{type:`unclonable`,objectsOnly:!0,isType:e=>{if(typeof e!=`object`||!e||Array.isArray(e)||ya(e))return!1;try{return structuredClone(e),!1}catch{return!0}},box:(e,t)=>({...G,type:`unclonable`}),revive:(e,t)=>({})}],xa=(e,t)=>t.find(t=>t.type===e.type),Sa=e=>!!e&&typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype,Ca=(e,t)=>Array.isArray(e)?e.map(e=>t(e)):Sa(e)?Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n)])):e,wa=new WeakSet,Ta=new WeakSet,Ea=0,Da=[],Oa=(e,t)=>{if(Ea===0){e();return}Da.push({commit:e,rollback:t})},ka=e=>{let t=Da;Da=[];for(let n of t)try{e?n.rollback():n.commit()}catch{}},Aa=e=>e!==null&&(typeof e==`object`||typeof e==`function`),ja=new WeakMap,Ma=e=>{let t=ja.get(e);if(t)return t;let n=e.filter(e=>!e.objectsOnly);return ja.set(e,n),n},Na=(e,t,n)=>{let r=(e===null||typeof e!=`object`&&typeof e!=`function`?Ma(t.revivableModules):t.revivableModules).find(t=>t.type!==n&&t.isType(e));return r?r.box(e,t):Ca(e,e=>Pa(e,t))},Pa=(e,t)=>{if(Kt(e))return e;let n=Aa(e);if(n){if(wa.has(e))throw TypeError(`osra: cannot serialize a circular structure - break the cycle or send the container by reference`);wa.add(e)}Ea++;let r=!0;try{let n=Na(e,t);return r=!1,n}finally{n&&wa.delete(e),Ea--,Ea===0&&ka(r)}},Fa=(e,t,n)=>Na(e,t,n),Ia=(e,t)=>{let n=Aa(e);if(n){if(Ta.has(e))throw TypeError(`osra: cannot revive a circular structure`);Ta.add(e)}try{if(Kt(e)){let n=xa(e,t.revivableModules);if(n)return n.revive(e,t)}return Ca(e,e=>Ia(e,t))}finally{n&&Ta.delete(e)}},La=Qe({init:()=>Ba,startBidirectionalConnection:()=>za,type:()=>Ra}),Ra=`bidirectional`,za=({transport:e,value:t,remoteUuid:n,eventTarget:r,send:i,revivableModules:a})=>{let o={transport:e,remoteUuid:n,sendMessage:i,eventTarget:r,revivableModules:a};for(let e of a)e.init?.(o);let{promise:s,resolve:c}=Promise.withResolvers();return r.addEventListener(`message`,function e({detail:t}){t.type===`init`&&(c(t.data),r.removeEventListener(`message`,e))}),i({type:`init`,remoteUuid:n,data:Pa(t,o)}),{revivableContext:o,remoteValue:s.then(e=>Ia(e,o))}},Ba=e=>{if(!(It(e.transport)&&Lt(e.transport)))return;if(e.protocolEventTarget.addEventListener(`message`,({detail:{message:t,peer:n}})=>{if(t.type===`announce`){if(!t.remoteUuid){e.sendMessage({type:`announce`,remoteUuid:t.uuid});return}if(t.remoteUuid!==e.getUuid()||e.connectionContexts.has(t.uuid))return;e.sendMessage({type:`announce`,remoteUuid:t.uuid});let r=e.createConnectionEventTarget(),i={...n(),abort:()=>e.abortConnection(t.uuid)},a;try{let n=e.valueFor(i);if(e.claimPendingAbort(t.uuid)){e.sendMessage({type:`close`,remoteUuid:t.uuid});return}a=za({transport:e.transport,value:n,remoteUuid:t.uuid,eventTarget:r,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t.uuid}),e.rejectRemoteValue(n);return}let o={type:`bidirectional`,eventTarget:r,connection:a};e.connectionContexts.set(t.uuid,o),o.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}if(t.type===`close`){if(t.remoteUuid!==e.getUuid())return;let n=e.connectionContexts.get(t.uuid);if(!n)return;e.connectionContexts.delete(t.uuid),En(n.connection.revivableContext),e.rejectRemoteValue(Error(`osra: peer closed the connection`));return}if(t.remoteUuid!==e.getUuid())return;let r=e.connectionContexts.get(t.uuid);r&&r.eventTarget.dispatchEvent(new CustomEvent(`message`,{detail:t}))}),e.presetRemoteUuid!==void 0){let t=e.presetRemoteUuid,n=e.createConnectionEventTarget(),r,i;try{i={abort:()=>e.abortConnection(t)};let a=e.valueFor(i);if(e.claimPendingAbort(t)){e.sendMessage({type:`close`,remoteUuid:t});return}r=za({transport:e.transport,value:a,remoteUuid:e.presetRemoteUuid,eventTarget:n,send:t=>e.sendMessage(t),revivableModules:e.revivableModules})}catch(n){e.sendMessage({type:`close`,remoteUuid:t}),e.rejectRemoteValue(n);return}let a={type:`bidirectional`,eventTarget:n,connection:r};e.connectionContexts.set(e.presetRemoteUuid,a),a.connection.remoteValue.then(t=>e.addConnection(i,t),t=>e.rejectRemoteValue(t));return}let t=50,n,r=()=>{if(!(e.unregisterSignal?.aborted||e.connectionContexts.size>0)){try{e.sendMessage({type:`announce`},`*`)}catch{}n=setTimeout(r,t),t=Math.min(t*2,1e3)}};e.unregisterSignal?.addEventListener(`abort`,()=>clearTimeout(n),{once:!0}),r()},Va=()=>new EventTarget,Ha=e=>{let t=Vt(e),n=t?e.emit:e,r=t?e.receive:e;return{isJson:t&&`isJson`in e&&e.isJson!==void 0?e.isJson:n!==void 0&&Ft(n)||r!==void 0&&Ft(r),...n===void 0?{}:{emit:n},...r===void 0?{}:{receive:r}}},Ua=e=>e?e(ba):ba,Wa=32,Ga=()=>{let e=[],t=new Set,n=!1,r=()=>({value:void 0,done:!0});return{push:r=>{if(!n){if(t.size===0){e.push(r),e.length>Wa&&e.shift();return}for(let e of t){let t=e.wake;if(t){e.wake=void 0,t({value:r,done:!1});continue}e.buffered.push(r)}}},close:()=>{n=!0;for(let e of t){let t=e.wake;e.wake=void 0,t?.(r())}},iterate:()=>{let i={buffered:[...e]};t.add(i);let a=!1;return{[Symbol.asyncIterator](){return this},next:()=>{if(a)return Promise.resolve(r());let e=i.buffered.shift();return e?Promise.resolve({value:e,done:!1}):n?Promise.resolve(r()):new Promise(e=>{i.wake=e})},return:()=>{a=!0,t.delete(i);let e=i.wake;return i.wake=void 0,e?.(r()),Promise.resolve(r())}}}}},Ka=(e,t,n)=>{let r=e.then(n);r.catch(()=>{});let i=()=>{let e=t.iterate();return{[Symbol.asyncIterator](){return this},next:()=>e.next().then(e=>e.done?{value:void 0,done:!0}:{value:n(e.value),done:!1}),return:()=>e.return?.()??Promise.resolve({value:void 0,done:!0})}};return Object.assign(r,{[Symbol.asyncIterator]:i})},qa=Symbol.for(`osra.context`),Ja=e=>typeof e==`object`&&!!e&&qa in e,Ya=[La],Xa=(e,{transport:t,name:n,remoteName:r,key:i=et,origin:a=`*`,unregisterSignal:o,revivableModules:s,uuid:c,remoteUuid:l,connection:u=({value:e})=>e})=>{let d=u,f=Ha(t);if(!(It(f)&&Lt(f))){let e=Ga();e.close();let t=Promise.reject(Error(`osra: transport must be able to both emit and receive to establish a connection; pass a bidirectional platform transport or a custom { emit, receive } pair`));return t.catch(()=>{}),Ka(t,e,d)}let p=Ua(s),m=new Map,h=new Set,g=Ga(),{promise:_,resolve:v,reject:y}=Promise.withResolvers();_.catch(()=>{});let b=c??globalThis.crypto.randomUUID(),x=(e,t=a)=>{let r={[$e]:i,name:n,uuid:b,...e},o=Un(r);lt(f,r,t,o),yr(o)},S=(e,t)=>{o?.aborted||x(e,t)},C=Va(),w={transport:f,valueFor:t=>Ja(e)?e[qa](t):e,revivableModules:p,connectionContexts:m,getUuid:()=>b,presetRemoteUuid:l,sendMessage:S,protocolEventTarget:C,rejectRemoteValue:y,abortConnection:e=>{let t=m.get(e);if(!t){h.add(e);return}m.delete(e),x({type:`close`,remoteUuid:e}),En(t.connection.revivableContext),y(Error(`osra: connection aborted`))},claimPendingAbort:e=>h.delete(e),addConnection:(e,t)=>{let n={value:t,context:e};v(n),g.push(n)},createConnectionEventTarget:Va,unregisterSignal:o};if(ot({listener:(e,t)=>{e.uuid!==b&&C.dispatchEvent(new CustomEvent(`message`,{detail:{message:e,peer:()=>({...t.origin?{origin:t.origin}:{},...t.source?{source:t.source}:{},...t.port?{port:t.port}:{},...t.sender?{sender:t.sender}:{}})}}))},transport:f,remoteName:r,key:i,origin:a,unregisterSignal:o}),o?.aborted)return y(o.reason),g.close(),Ka(_,g,d);o?.addEventListener(`abort`,()=>{for(let[e,t]of m)x({type:`close`,remoteUuid:e}),En(t.connection.revivableContext);m.clear(),g.close(),y(o.reason)},{once:!0});for(let e of Ya)e.init(w);return Ka(_,g,d)},Za=(e,t)=>Xa(e,t),Qa=[[`aac`,`audio/mp4; codecs="mp4a.40.2"`],[`opus`,`audio/mp4; codecs="opus"`],[`flac`,`audio/mp4; codecs="flac"`],[`ac3`,`audio/mp4; codecs="ac-3"`],[`eac3`,`audio/mp4; codecs="ec-3"`]],$a=[`aac`,`opus`,`flac`],eo=()=>{let e=globalThis.MediaSource;if(typeof e?.isTypeSupported!=`function`)return[...$a];let t=Qa.filter(([,t])=>{try{return e.isTypeSupported(t)}catch{return!1}}).map(([e])=>e);return t.includes(`aac`)?t:[...$a]},to=e=>new Promise((t,n)=>{if(e.aborted)return n();e.addEventListener(`abort`,()=>{n()})}),no=async({publicPath:e,workerUrl:t,workerOptions:n,read:r,length:i,bufferSize:a,audioStreamIndex:o,audioCodecs:s,transferReads:c=!0})=>{let l=new Worker(t,n),{makeRemuxer:u}=await Za({},{transport:l}),d=await u({publicPath:e,length:i,bufferSize:a,audioStreamIndex:o,audioCodecs:s??eo()}),f=new Xe({concurrency:1}),p=!1,m=(e,t)=>{p||!c||e.byteLength>0||t>=i||(p=!0,console.warn(`libav-wasm: read(${t}) returned 0 bytes, ${i-t} bytes before the end of the file. Reads are transferred, so the buffer read() returns is detached in the caller and handing back bytes you keep returns that same detached buffer. Return a copy, or pass transferReads: false.`))},h=e=>(t,n)=>e.signal.aborted?Promise.resolve({resolved:new Uint8Array().buffer,rejected:!0}):Promise.race([r(Number(t),Number(n)).then(e=>{m(e,Number(t));let n=new Uint8Array(e).buffer;return{resolved:c?Nn(n):n,rejected:!1}},()=>({resolved:new Uint8Array().buffer,rejected:!0})),to(e.signal).then(()=>({resolved:new Uint8Array().buffer,rejected:!0}),()=>({resolved:new Uint8Array().buffer,rejected:!0}))]),g=[];return{worker:l,remuxer:d,wasmRead:h,addTask:e=>{let t=[...g];g=[],f.clear(),t.forEach(e=>e.abort());let n=new AbortController;return g=[...g,n],Promise.race([f.add(async()=>e(n),{signal:n.signal}),to(n.signal).then(()=>Promise.reject(Error(`Cancelled`)),()=>Promise.reject(Error(`Cancelled`)))])},destroy:async()=>{let e=[...g];g=[],f.clear(),e.forEach(e=>e.abort()),await d.destroy(),l.terminate()}}},ro=async e=>{let{worker:t,remuxer:n,wasmRead:r,addTask:i,destroy:a}=await no({...e,bufferSize:e.bufferSize??25e5});return{worker:t,init:()=>i(e=>n.init(r(e))),destroy:a,seek:e=>i(t=>n.seek(r(t),e)),read:()=>i(e=>n.read(r(e))),readKeyframe:e=>i(t=>n.readKeyframe(r(t),e)),setAudioStreamIndex:e=>n.setAudioStreamIndex(e)}},io=async e=>{let{worker:t,remuxer:n,wasmRead:r,addTask:i,destroy:a}=await no({...e,bufferSize:e.bufferSize??1e6});return{worker:t,init:()=>i(e=>n.initThumbnail(r(e))),readKeyframe:e=>i(t=>n.readKeyframe(r(t),e)),destroy:a}},ao=typeof HTMLVideoElement<`u`?HTMLVideoElement.prototype:{},oo=`getVideoPlaybackQuality`in ao||`webkitDecodedFrameCount`in ao||`mozPresentedFrames`in ao||`mozPaintedFrames`in ao;if(!(`requestVideoFrameCallback`in ao)&&oo&&typeof requestAnimationFrame==`function`){ao._rvfcpolyfillmap={};let e=`getVideoPlaybackQuality`in ao?e=>{let{totalFrameDelay:t,totalVideoFrames:n,droppedVideoFrames:r}=e.getVideoPlaybackQuality();return{presentedFrames:n-r,totalFrameDelay:t}}:e=>({presentedFrames:e.mozPresentedFrames||e.mozPaintedFrames||e.webkitDecodedFrameCount-(e.webkitDroppedFrameCount||0),totalFrameDelay:e.mozFrameDelay||0});ao.requestVideoFrameCallback=function(t){let n=performance.now(),r=e(this),i=r.presentedFrames,a=(o,s)=>{let c=e(this),l=c.presentedFrames;if(l>i){let e=c.totalFrameDelay-r.totalFrameDelay||0,i=s-o;t(s,{presentationTime:s+e*1e3,expectedDisplayTime:s+i,width:this.videoWidth,height:this.videoHeight,mediaTime:Math.max(0,this.currentTime||0)+i/1e3,presentedFrames:l,processingDuration:e}),delete this._rvfcpolyfillmap[n]}else this._rvfcpolyfillmap[n]=requestAnimationFrame(e=>a(s,e))};return this._rvfcpolyfillmap[n]=requestAnimationFrame(e=>a(n,e)),n},ao.cancelVideoFrameCallback=function(e){cancelAnimationFrame(this._rvfcpolyfillmap[e]),delete this._rvfcpolyfillmap[e]}}var so={RAW:`RAW`,PROXY:`PROXY`,THROW:`THROW`,HANDLER:`HANDLER`},co={GET:`GET`,SET:`SET`,APPLY:`APPLY`,CONSTRUCT:`CONSTRUCT`,RELEASE:`RELEASE`},lo=Symbol(`Abslink.proxy`),uo=Symbol(`Abslink.releaseProxy`),fo=Symbol(`Abslink.finalizer`),po=Symbol(`Abslink.thrown`),mo=e=>typeof e==`object`&&!!e||typeof e==`function`,ho=new Map([[`proxy`,{canHandle:e=>mo(e)&&lo in e,serialize(e,t){let n=e[lo];return _o(e,t,n),[n,[]]},deserialize(e,t){return vo(t,e)}}],[`throw`,{canHandle:e=>mo(e)&&po in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(Error(e.value.message),e.value):e.value}}]]);function go(e,t){let n=t,r=e.slice(0,-1);for(let e of r)Object.prototype.hasOwnProperty.call(n,e)&&(n=n[e]);let i=e[e.length-1],a=i?n[i]:n;return{parent:n,RawValue:a,lastSegment:i}}function _o(e,t,n){return t.on(`message`,function r(i){if(!i)return;let{id:a,type:o,path:s,markerID:c}={path:[],...i};if(c!==n)return;let l=(i.argumentList??[]).map(e=>jo(e,t)),u;try{let{parent:n,RawValue:r,lastSegment:a}=go(s,e);switch(o){case co.GET:u=r;break;case co.SET:n[a]=jo(i.value,t),u=!0;break;case co.APPLY:u=r.apply(n,l);break;case co.CONSTRUCT:u=new r(...l);break;case co.RELEASE:u=void 0;break;default:return}}catch(e){u={value:e,[po]:0}}Promise.resolve(u).catch(e=>({value:e,[po]:0})).then(i=>{o===co.CONSTRUCT&&(i=ko(i));let[s,c]=Ao(i,t);t.postMessage({...s,id:a,markerID:n},c),o===co.RELEASE&&(t.off(`message`,r),e[fo]?.())}).catch(e=>{let[r,i]=Ao({value:TypeError(`Unserializable return value`),[po]:0},t);t.postMessage({...r,id:a,markerID:n},i)})}),e}function vo(e,t){let n=new Map;return e.on(`message`,e=>{if(!e?.id)return;let t=n.get(e.id);if(t)try{t(e)}finally{n.delete(e.id)}}),To({endpoint:e,pendingListeners:n,rootMarkerID:t})}function yo(e){if(e)throw Error(`Proxy has been released and is not useable`)}async function bo(e){await Mo(e,{type:co.RELEASE})}var xo=new WeakMap,So=`FinalizationRegistry`in globalThis&&new FinalizationRegistry(e=>{let t=(xo.get(e)??0)-1;xo.set(e,t),t===0&&bo(e).finally(()=>{e.pendingListeners.clear()})});function Co(e,t){let n=(xo.get(t)??0)+1;xo.set(t,n),So&&So.register(e,t,e)}function wo(e){So&&So.unregister(e)}function To(e,t=[]){let n=!1,r=new Map,i=new Proxy(function(){},{get(a,o){if(yo(n),o===uo)return async()=>{for(let e of r.values())e[uo]();r.clear(),wo(i),bo(e).finally(()=>{e.pendingListeners.clear()}),n=!0};if(o===`then`){if(t.length===0)return{then:()=>i};let n=Mo(e,{type:co.GET,path:t.map(e=>e.toString())}).then(t=>jo(t,e.endpoint));return n.then.bind(n)}let s=r.get(o);if(s)return s;let c=To(e,[...t,o]);return r.set(o,c),c},set(r,i,a){yo(n);let[o,s]=Ao(a,e.endpoint);return Mo(e,{type:co.SET,path:[...t,i].map(e=>e.toString()),value:o},s).then(t=>jo(t,e.endpoint))},apply(r,i,a){if(yo(n),t[t.length-1]===`bind`)return To(e,t.slice(0,-1));let[o,s]=Oo(a,e);return Mo(e,{type:co.APPLY,path:t.map(e=>e.toString()),argumentList:o},s).then(t=>jo(t,e.endpoint))},construct(r,i){yo(n);let[a,o]=Oo(i,e);return Mo(e,{type:co.CONSTRUCT,path:t.map(e=>e.toString()),argumentList:a},o).then(t=>jo(t,e.endpoint))}});return Co(i,e),i}var Eo=new WeakMap;function Do(e,t){return Eo.set(e,t),e}function Oo(e,t){let n=[],r=[];for(let i of e){let[e,a]=Ao(i,t.endpoint);n.push(e),r.push(...a)}return[n,r]}function ko(e){return Object.assign(e,{[lo]:Lo()})}function Ao(e,t){for(let[n,r]of ho)if(r.canHandle(e)){let[i,a]=r.serialize(e,t);return[{type:so.HANDLER,name:n,value:i},a]}return[{type:so.RAW,value:e},Eo.get(e)??[]]}function jo(e,t){switch(e.type){case so.HANDLER:return ho.get(e.name).deserialize(e.value,t);case so.RAW:return e.value}}function Mo(e,t,n=[]){return new Promise(r=>{let i=Lo();e.pendingListeners.set(i,r),e.endpoint.postMessage({id:i,...t,markerID:e.rootMarkerID},n)})}var No=[],Po=`0123456789abcdef`;for(let e=0;e<256;e++)No[e]=Po[e>>4&15]+Po[e&15];var Fo=0,Io=``;function Lo(){let e=0;if(!Io||Fo+16>512)for(Io=``,Fo=0;e<256;++e)Io+=No[Math.random()*256|0];return Io.substring(Fo,++Fo+16)}function Ro(e,t){let n=new WeakMap;return e.start?.(),t.start?.(),{on(t,r){let i=e=>r(e.data);`addEventListener`in e?e.addEventListener(t,i):`addListener`in e?e.addListener(t,i):e.on(t,i),n.set(r,i)},off(t,r){let i=n.get(r);`removeEventListener`in e?e.removeEventListener(t,i):`removeListener`in e?e.removeListener(t,i):e.off(t,i),n.delete(r)},postMessage(e,n=[]){t.postMessage(e,n)}}}function zo(e,t=e){return vo(Ro(e,t))}var Bo=u(I(((e,t)=>{se();var n=z!==void 0&&!!z.hrtime,r=65535,i=10,a=n?1e9/i:1e3/i,o=n?()=>{let[e,t]=z.hrtime();return e*1e9+t}:()=>performance.now();function s(e){return(o()-e)/a&r}t.exports=function(e){let t=o(),n=i*(e||5),a=[0],c=1,l=s(t)-1&r;return function(e){let o=s(t),u=o-l&r;for(u>n&&(u=n),l=o;u--;)c===n&&(c=0),a[c]=a[c===0?n-1:c-1],c++;e&&(a[c-1]+=e);let d=a[c-1],f=a.length<n?0:a[c===n?0:c];return a.length<i?d:(d-f)*i/a.length}}}))(),1),Vo=class{fps=(0,Bo.default)(5);processingDuration=(0,Bo.default)(5);droppedFrames=0;presentedFrames=0;mistimedFrames=0;_drop(){++this.droppedFrames}_startTime=0;_startFrame(){this._startTime=performance.now()}onsubtitleFrameCallback=(e,{fps:t,processingDuration:n,droppedFrames:r})=>console.info(`%cFPS: %c%f %c| Frame Time: %c%d ms %c| Dropped Frames: %c%d %c| 5s Avg`,`color: #888`,`color: #0f0; font-weight: bold`,t.toFixed(1),`color: #888`,`color: #0ff; font-weight: bold`,n,`color: #888`,`color: #f00; font-weight: bold`,r,`color: #888`);_endFrame(e){++this.presentedFrames;let t=this.fps(1),n=performance.now(),r=this.processingDuration((n-this._startTime)/t),i=Math.max(0,n-e.expectedDisplayTime);i&&++this.mistimedFrames,this.onsubtitleFrameCallback?.(n,{fps:t,processingDuration:r,droppedFrames:this.droppedFrames,presentedFrames:this.presentedFrames,mistimedFrames:this.mistimedFrames,presentationTime:n,expectedDisplayTime:e.expectedDisplayTime+(i>0?t/1e3:0),frameDelay:i,width:e.width,height:e.height,mediaTime:e.mediaTime})}},Ho={rgb:`RGB`,bt709:`BT709`,bt470bg:`BT601`,smpte170m:`BT601`},Uo=class e{timeOffset;prescaleFactor;prescaleHeightLimit;maxRenderHeight;debug;renderer;ready;busy=!1;_video;_videoWidth=0;_videoHeight=0;_videoColorSpace=null;_canvas;_ro=new ResizeObserver(async()=>{await this.ready,this.resize()});_destroyed=!1;_lastDemandTime;_skipped=!1;_worker;constructor(t){if(!globalThis.Worker)throw Error(`Worker not supported`);if(!t)throw Error(`No options provided`);if(!t.video&&!t.canvas)throw Error(`You should give video or canvas in options.`);e._test(),this.timeOffset=t.timeOffset??0,this._video=t.video,this._canvas=t.canvas??document.createElement(`canvas`),this._video&&!t.canvas&&(this._canvas.className=`JASSUB`,this._canvas.style.position=`absolute`,this._canvas.style.pointerEvents=`none`,this._video.insertAdjacentElement(`afterend`,this._canvas));let n=this._canvas.transferControlToOffscreen();this.debug=t.debug?new Vo:null,this.prescaleFactor=t.prescaleFactor??1,this.prescaleHeightLimit=t.prescaleHeightLimit??1080,this.maxRenderHeight=t.maxRenderHeight??0,this._worker=t.workerUrl?new Worker(t.workerUrl,{name:`jassub-worker`,type:`module`}):new Worker(new URL(new URL(`worker-dPoC1jvm.js`,import.meta.url).href,``+import.meta.url),{name:`jassub-worker`,type:`module`});let r=zo(this._worker),i=t.modernWasmUrl??new URL(new URL(`jassub-worker-modern-C7bYVPj4.wasm`,import.meta.url).href,``+import.meta.url).href,a=t.wasmUrl??new URL(new URL(`jassub-worker-CLcXAXXL.wasm`,import.meta.url).href,``+import.meta.url).href,o=t.availableFonts??{};!o[`liberation sans`]&&!t.defaultFont&&(o[`liberation sans`]=new URL(new URL(`default-jVcJgvWm.woff2`,import.meta.url).href,``+import.meta.url).href),this.ready=new r({wasmUrl:e._supportsSIMD?i:a,width:n.width,height:n.height,subUrl:t.subUrl,subContent:t.subContent??null,fonts:t.fonts??[],availableFonts:o,defaultFont:t.defaultFont??`liberation sans`,debug:!!t.debug,libassMemoryLimit:t.libassMemoryLimit??0,libassGlyphLimit:t.libassGlyphLimit??0,queryFonts:t.queryFonts??`local`},ko(e=>this._getLocalFont(e)),Do(n,[n])).then(e=>{this.renderer=e}),this._video?this.setVideo(this._video):this._ro.observe(this._canvas)}static _supportsSIMD;static _test(){if(e._supportsSIMD!=null)return;try{e._supportsSIMD=WebAssembly.validate(Uint8Array.of(0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,43,1,41,0,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,128,2,11))}catch{e._supportsSIMD=!1}let t=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(!(t instanceof WebAssembly.Module)||!(new WebAssembly.Instance(t)instanceof WebAssembly.Instance))throw Error(`WASM not supported`)}async resize(e=!!this._video?.paused,t=0,n=0){let r=this._video?.videoWidth??this._videoWidth,i=this._video?.videoHeight??this._videoHeight,a=this._getElementBoundingBox(this._video??this._canvas,r,i);if(!t||!n){let e=this._videoWidth/r||1,o=this._videoHeight/i||1,{width:s,height:c}=this._computeRenderSize(a.width*e,a.height*o);t=Math.round(s),n=Math.round(c)}this._video&&(this._canvas.style.width=Math.round(a.width)+`px`,this._canvas.style.height=Math.round(a.height)+`px`,this._canvas.style.top=a.y+`px`,this._canvas.style.left=a.x+`px`),await this.renderer._resizeCanvas(t,n,this._videoWidth||t,this._videoHeight||n),this._lastDemandTime&&await this._demandRender(e)}_getElementBoundingBox(e,t,n){let{clientWidth:r,clientHeight:i,offsetLeft:a,offsetTop:o}=e,s=t/n;return r/i>s?(n=i,t=i*s):(n=r/s,t=r),{x:a+(r-t)/2,y:o+(i-n)/2,width:t,height:n}}_computeRenderSize(e=0,t=0){if(t<=0||e<=0)return{width:0,height:0};let n=this.prescaleFactor<=0?1:this.prescaleFactor,r=self.devicePixelRatio||1,i=n<1?-1:1,a=t*r;return i*a*n<=i*this.prescaleHeightLimit?a*=n:i*a<i*this.prescaleHeightLimit&&(a=this.prescaleHeightLimit),this.maxRenderHeight>0&&a>this.maxRenderHeight&&(a=this.maxRenderHeight),e*=a/t,t=a,{width:e,height:t}}async setVideo(e){this._removeListeners(),this._video=e,this._ro.observe(e),typeof VideoFrame<`u`&&(e.addEventListener(`loadedmetadata`,this._boundUpdateColorSpace),this._updateColorSpace({target:e})),await this.ready,this._video.requestVideoFrameCallback((e,t)=>this._handleRVFC(t))}async _getLocalFont(e,t=`regular`){if(navigator.permissions?.query){let{state:e}=await navigator.permissions.query({name:`local-fonts`});if(e!==`granted`)return}for(let n of await self.queryLocalFonts()){let r=n.family.toLowerCase(),i=n.style.toLowerCase();if(r===e&&i===t){let e=await n.blob();return new Uint8Array(await e.arrayBuffer())}}}_handleRVFC(e){this._destroyed||(this.manualRender(e),this._video.requestVideoFrameCallback((e,t)=>this._handleRVFC(t)))}manualRender(e,t=!1){return this._lastDemandTime=e,this._demandRender(t)}async _demandRender(e=!1){let{mediaTime:t,width:n,height:r}=this._lastDemandTime;if(n!==this._videoWidth||r!==this._videoHeight)return this._videoWidth=n,this._videoHeight=r,await this.resize(e);if(this.busy){this._skipped=!0,this.debug?._drop();return}this.busy=!0,this._skipped=!1,this.debug?._startFrame(),await this.renderer._draw(t+this.timeOffset,e),this.debug?._endFrame(this._lastDemandTime),this.busy=!1,this._skipped&&await this._demandRender()}_boundUpdateColorSpace=this._updateColorSpace.bind(this);_updateColorSpace({target:e}){this._video.requestVideoFrameCallback(async()=>{if(!(this._destroyed||this._video!==e))try{let e=new VideoFrame(this._video);e.close(),await this.ready,await this.renderer._setColorSpace(Ho[e.colorSpace.matrix])}catch(e){console.warn(e)}})}_removeListeners(){this._ro.disconnect(),this._video?.removeEventListener(`loadedmetadata`,this._boundUpdateColorSpace)}async destroy(){if(!this._destroyed){this._destroyed=!0,this._canvas.remove(),this._removeListeners();try{await this.ready,await this.renderer?.[uo]()}finally{this._worker.terminate()}}}};function Wo(e){var t=e.toLowerCase().trim().split(/\s*;\s*/);return t[0]===`banner`?{name:t[0],delay:t[1]*1||0,leftToRight:t[2]*1||0,fadeAwayWidth:t[3]*1||0}:/^scroll\s/.test(t[0])?{name:t[0],y1:Math.min(t[1]*1,t[2]*1),y2:Math.max(t[1]*1,t[2]*1),delay:t[3]*1||0,fadeAwayHeight:t[4]*1||0}:e===``?null:{name:e}}function Go(e){return e?e.toLowerCase().replace(/([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/g,` $1 `).replace(/([mnlbspc])/g,` $1 `).trim().replace(/\s+/g,` `).split(/\s(?=[mnlbspc])/).map(function(e){return e.split(` `).filter(function(e,t){return!(t&&isNaN(e*1))})}):[]}var Ko=`b.i.u.s.fsp.k.K.kf.ko.kt.fe.q.p.pbo.a.an.fscx.fscy.fax.fay.frx.fry.frz.fr.be.blur.bord.xbord.ybord.shad.xshad.yshad`.split(`.`).map(function(e){return{name:e,regex:RegExp(`^`+e+`-?\\d`)}});function qo(e){for(var t,n={},r=0;r<Ko.length;r++){var i=Ko[r],a=i.name;if(i.regex.test(e))return n[a]=e.slice(a.length)*1,n}if(/^fn/.test(e))n.fn=e.slice(2);else if(/^r/.test(e))n.r=e.slice(1);else if(/^fs[\d+-]/.test(e))n.fs=e.slice(2);else if(/^\d?c&?H?[0-9a-fA-F]+|^\d?c$/.test(e)){var o=e.match(/^(\d?)c&?H?(\w*)/),s=o[1],c=o[2];n[`c`+(s||1)]=c&&(`000000`+c).slice(-6)}else if(/^\da&?H?[0-9a-fA-F]+/.test(e)){var l=e.match(/^(\d)a&?H?([0-9a-f]+)/i),u=l[1],d=l[2];n[`a`+u]=(`00`+d).slice(-2)}else if(/^alpha&?H?[0-9a-fA-F]+/.test(e))t=e.match(/^alpha&?H?([0-9a-f]+)/i),n.alpha=t[1],n.alpha=(`00`+n.alpha).slice(-2);else if(/^(?:pos|org|move|fad|fade)\([^)]+/.test(e)){var f=e.match(/^(\w+)\((.*?)\)?$/),p=f[1];n[p]=f[2].trim().split(/\s*,\s*/).map(Number)}else if(/^i?clip\([^)]+/.test(e)){var m=e.match(/^i?clip\((.*?)\)?$/)[1].trim().split(/\s*,\s*/);n.clip={inverse:/iclip/.test(e),scale:1,drawing:null,dots:null},m.length===1&&(n.clip.drawing=Go(m[0])),m.length===2&&(n.clip.scale=m[0]*1,n.clip.drawing=Go(m[1])),m.length===4&&(n.clip.dots=m.map(Number))}else if(/^t\(/.test(e)){var h=e.match(/^t\((.*?)\)?$/)[1].trim().replace(/\\.*/,function(e){return e.replace(/,/g,`
|
|
3
|
-
`)}).split(/\s*,\s*/);if(!h[0])return n;n.t={t1:0,t2:0,accel:1,tags:h[h.length-1].replace(/\n/g,`,`).split(`\\`).slice(1).map(qo)},h.length===2&&(n.t.accel=h[0]*1),h.length===3&&(n.t.t1=h[0]*1,n.t.t2=h[1]*1),h.length===4&&(n.t.t1=h[0]*1,n.t.t2=h[1]*1,n.t.accel=h[2]*1)}return n}function Jo(e){for(var t=[],n=0,r=``,i=e.split(`\\`).slice(1).concat(``).join(`\\`),a=0;a<i.length;a++){var o=i[a];o===`(`&&n++,o===`)`&&n--,n<0&&(n=0),!n&&o===`\\`?(r&&t.push(r),r=``):r+=o}return t.map(qo)}function Yo(e){var t=e.split(/{(.*?)}/),n=[];t[0].length&&n.push({tags:[],text:t[0],drawing:[]});for(var r=1;r<t.length;r+=2){var i=Jo(t[r]),a=i.reduce(function(e,t){return t.p===void 0?e:!!t.p},!1);n.push({tags:i,text:a?``:t[r+1],drawing:a?Go(t[r+1]):[]})}return{raw:e,combined:n.map(function(e){return e.text}).join(``),parsed:n}}function Xo(e){var t=e.split(`:`);return t[0]*3600+t[1]*60+t[2]*1}function Zo(e,t){var n=e.split(`,`);if(n.length>t.length){var r=n.slice(t.length-1).join();n=n.slice(0,t.length-1),n.push(r)}for(var i={},a=0;a<n.length;a++){var o=t[a],s=n[a].trim();switch(o){case`Layer`:case`MarginL`:case`MarginR`:case`MarginV`:i[o]=s*1;break;case`Start`:case`End`:i[o]=Xo(s);break;case`Effect`:i[o]=Wo(s);break;case`Text`:i[o]=Yo(s);break;default:i[o]=s}}return i}var Qo=[`Name`,`Fontname`,`Fontsize`,`PrimaryColour`,`SecondaryColour`,`OutlineColour`,`BackColour`,`Bold`,`Italic`,`Underline`,`StrikeOut`,`ScaleX`,`ScaleY`,`Spacing`,`Angle`,`BorderStyle`,`Outline`,`Shadow`,`Alignment`,`MarginL`,`MarginR`,`MarginV`,`Encoding`],$o=[`Layer`,`Start`,`End`,`Style`,`Name`,`MarginL`,`MarginR`,`MarginV`,`Effect`,`Text`];function es(e){var t=Qo.concat($o);return e.match(/Format\s*:\s*(.*)/i)[1].split(/\s*,\s*/).map(function(e){return t.find(function(t){return t.toLowerCase()===e.toLowerCase()})||e})}function ts(e,t){var n=e.match(/Style\s*:\s*(.*)/i)[1].split(/\s*,\s*/);return Object.assign.apply(Object,[{}].concat(t.map(function(e,t){var r={};return r[e]=n[t],r})))}function ns(e){for(var t={info:{},styles:{format:[],style:[]},events:{format:[],comment:[],dialogue:[]}},n=e.split(/\r?\n/),r=0,i=0;i<n.length;i++){var a=n[i].trim();if(!/^;/.test(a)&&(/^\[Script Info\]/i.test(a)?r=1:/^\[V4\+? Styles\]/i.test(a)?r=2:/^\[Events\]/i.test(a)?r=3:/^\[.*\]/.test(a)&&(r=0),r!==0)){if(r===1&&/:/.test(a)){var o=a.match(/(.*?)\s*:\s*(.*)/),s=o[1],c=o[2];t.info[s]=c}if(r===2&&(/^Format\s*:/i.test(a)&&(t.styles.format=es(a)),/^Style\s*:/i.test(a)&&t.styles.style.push(ts(a,t.styles.format))),r===3&&(/^Format\s*:/i.test(a)&&(t.events.format=es(a)),/^(?:Comment|Dialogue)\s*:/i.test(a))){var l=a.match(/^(\w+?)\s*:\s*(.*)/i),u=l[1],d=l[2];t.events[u.toLowerCase()].push(Zo(d,t.events.format))}}}return t}var rs={M:`m`,L:`l`,C:`b`};function is(e){return e.instructions.map(function(e){var t,n=e.type,r=e.points;return(t=[rs[n]]).concat.apply(t,r.map(function(e){return[e.x,e.y]})).join(` `)}).join(` `)}var as=function(e){return function(t){return function(n){return``+t+e+`&H`+n+`&`}}},os=as(`c`),ss=as(`a`),cs={c1:os(1),c2:os(2),c3:os(3),c4:os(4),a1:ss(1),a2:ss(2),a3:ss(3),a4:ss(4),pos:function(e){return`pos(`+[e.x,e.y]+`)`},org:function(e){return`org(`+[e.x,e.y]+`)`},move:function(e){return`move(`+[e.x1,e.y1,e.x2,e.y2,e.t1,e.t2]+`)`},fade:function(e){return e.type===`fad`?`fad(`+[e.t1,e.t2]+`)`:`fade(`+[e.a1,e.a2,e.a3,e.t1,e.t2,e.t3,e.t4]+`)`},clip:function(e){return(e.inverse?`i`:``)+`clip(`+(e.dots?``+[e.dots.x1,e.dots.y1,e.dots.x2,e.dots.y2]:(e.scale===1?``:e.scale+`,`)+is(e.drawing))+`)`},t:function(e){return e.map(function(e){return`t(`+[e.t1,e.t2,e.accel,ls(e.tag)]+`)`}).join(`\\`)}};function ls(e){return Object.keys(e).map(function(t){return`\\`+(cs[t]||(function(e){return``+t+e}))(e[t])}).join(``)}var us=e=>Array(e.buffered.length).fill(void 0).map((t,n)=>({index:n,start:e.buffered.start(n),end:e.buffered.end(n)})),ds=e=>new Promise((t,n)=>{let r=()=>{e.removeEventListener(`updateend`,i),e.removeEventListener(`abort`,i),e.removeEventListener(`error`,a)},i=()=>{r(),t()},a=e=>{r(),n(Error(`The browser rejected a media segment`,{cause:e}))};e.addEventListener(`updateend`,i,{once:!0}),e.addEventListener(`abort`,i,{once:!0}),e.addEventListener(`error`,a,{once:!0})}),fs=(e,t)=>{let n=Promise.resolve(),r=e=>{let t=n.then(e,e);return n=t.catch(()=>{}),t};return{appendBuffer:t=>r(()=>(e.appendBuffer(t),ds(e))),unbufferRange:(t,n)=>r(()=>t>=n?Promise.resolve():(e.remove(t,n),ds(e))),updateTimestampOffset:t=>r(async()=>{e.timestampOffset=t}),endOfStream:()=>r(async()=>{if(!(t.readyState!==`open`||e.updating))try{t.endOfStream()}catch{}})}},ps=e=>e===void 0?void 0:new URL(e,document.baseURI).toString(),ms=e=>new Date(e).toISOString().slice(11,22),hs=1,gs=e=>new Map(ns(e).styles.style.map((e,t)=>[e.Name,t+hs])),_s=(e,t)=>{let n=t.replace(/^\*+/,``),r=n.toLowerCase()==="default"?`Default`:n;return e.styles.get(r)??e.styles.get(`Default`)??0},vs=e=>{let t=e.content.match(/\r?\n\[Events\]\r?\nFormat: (.*)/)?.[0];return t?{type:`header`,streamIndex:e.streamIndex,content:e.content,eventsContent:t,styles:gs(e.content)}:(console.warn(`subtitle stream ${e.streamIndex} has no Events format, ignoring the track`),null)},ys=(e,t)=>{let[n,r]=t.content.split(`,`),i=Number(n),a=`Dialogue: ${r},${ms(t.start)},${ms(t.end)},${t.content.replace(`${i},${r},`,``)}`,o=ns(`${e.eventsContent}\r\n${a}`).events.dialogue[0];if(!o)throw Error(`dialogue event is undefined`);return{type:`dialogue`,streamIndex:t.streamIndex,index:i,assEvent:{Name:o.Name??``,Effect:o.Effect?.name??``,Layer:o.Layer,MarginL:o.MarginL,MarginR:o.MarginR,MarginV:o.MarginV,Style:_s(e,o.Style),Text:o.Text.raw,Start:o.Start*1e3,Duration:(o.End-o.Start)*1e3,ReadOrder:i}}},bs=e=>{let{video:t,container:n,workerUrl:r}=e,i=ps(e.wasmUrl),a=ps(e.legacyWasmUrl),o=ps(e.defaultFontUrl),s,c=[],l=new Map,u=[],d=new Map,f,p=e.onStreams,m=!1,h=e=>{console.warn(`the subtitle renderer failed; the file plays without subtitles`,e)},g=e=>{let t=s;t&&t.ready.then(()=>s===t?e(t.renderer):void 0).catch(h)},_=!1,v=()=>{_||(_=!0,queueMicrotask(()=>{_=!1;let e=s;e&&t.videoWidth&&e.ready.then(()=>{if(s===e)return e.manualRender({expectedDisplayTime:performance.now(),width:t.videoWidth,height:t.videoHeight,mediaTime:t.currentTime},!0)}).catch(h)}))},y=[`loadedmetadata`,`seeked`,`pause`],b=()=>v(),x=e=>{let l=document.createElement(`canvas`);n.append(l);try{s=new Uo({video:t,canvas:l,subContent:e.content,workerUrl:r,modernWasmUrl:i,...a?{wasmUrl:a}:{},fonts:c.map(([,e])=>e),availableFonts:{...Object.fromEntries(c),...o?{"liberation sans":o}:{}},queryFonts:!1})}catch(e){l.remove(),h(e);return}s.ready.catch(h);for(let e of y)t.addEventListener(e,b);o&&g(e=>{Promise.resolve(e.addFonts([o])).then(v,h)}),v()};return{pushAttachments:e=>{c=[...c,...e.map(e=>[e.filename,new Uint8Array(e.data)])]},pushFragments:e=>{let t=[];for(let n of e)if(n.type===`header`){if(l.has(n.streamIndex))continue;let e=vs(n);if(!e)continue;l.set(n.streamIndex,e),u.push({streamIndex:n.streamIndex,title:n.title,language:n.language}),p?.([...u]),f===void 0&&(f=n.streamIndex),!s&&!m&&x(e)}else{let e=l.get(n.streamIndex);if(!e)continue;let r=d.get(n.streamIndex);r||(r=new Map,d.set(n.streamIndex,r));let i=ys(e,n);if(r.has(i.index))continue;r.set(i.index,i),f===n.streamIndex&&t.push(i.assEvent)}t.length&&(g(e=>Promise.all(t.map(t=>e.createEvent(t)))),v())},selectStream:e=>{let t=e??-1;if(t===f||!s)return;f=t;let n=l.get(t),r=[...d.get(t)?.values()??[]].map(e=>e.assEvent);g(e=>{let t=[e.freeTrack()];if(n){t.push(e.setTrack(n.content));for(let n of r)t.push(e.createEvent(n))}return Promise.all(t)}),v()},getStreams:()=>[...u],getSelectedStream:()=>f,setOnStreams:e=>{p=e},destroy:()=>{m=!0;let e=s;s=void 0;for(let e of y)t.removeEventListener(e,b);e?.destroy().catch(()=>{})}}},xs=class extends Error{mediaElement=!0;constructor(e,t){super(e,t),this.name=`MediaElementError`}},Ss=e=>!!e&&typeof e==`object`&&e.mediaElement===!0,Cs=-20,ws=60,Ts=30,Es=-5,Ds=20,Os=5,ks=15e3,As=1,js=3,Ms=12,Ns=200,Ps=250,Fs=25e5,Is=e=>{let{worker:t}=e,n=setTimeout(()=>t.terminate(),2e3);e.destroy().catch(()=>{}).finally(()=>{clearTimeout(n),t.terminate()})},Ls=async e=>{let{videoElement:t,subtitleContainer:n,read:r,length:i,publicPath:a,libavWorkerUrl:o,jassubWorkerUrl:s,jassubWasmUrl:c,jassubLegacyWasmUrl:l,defaultFontUrl:u,bufferSize:d=Fs,audioStreamIndex:f,onReady:p,onError:m,onRecovered:h,onSeek:g,onSubtitleStreams:_,onAudioStreams:v}=e,y=await ro({publicPath:a,workerUrl:o,workerOptions:{type:`module`},bufferSize:d,length:i,audioStreamIndex:f,read:r}),b=[],x=!1,S=()=>{if(!x){x=!0;for(let e of[...b].reverse())try{e()}catch{}}};b.push(()=>Is(y));try{let e=await y.init(),r=e.audioStreams??[],i=r.some(e=>e.streamIndex===f)?f:r[0]?.streamIndex??-1;v?.(r,i);let a=bs({video:t,container:n,workerUrl:s,wasmUrl:c,legacyWasmUrl:l,defaultFontUrl:u,onStreams:_});if(b.push(()=>a.destroy()),e.attachments?.length&&a.pushAttachments(e.attachments),!e.info.output.videoMimeType)throw Error(`The video codec in this file could not be identified`);let o=[e.info.output.videoMimeType,e.info.output.audioMimeType].filter(Boolean).join(`,`),d=`video/mp4; codecs="${o}"`;if(!MediaSource.isTypeSupported(d))throw Error(`This browser cannot play the codecs in this file: ${o}`);let C=new MediaSource,w=URL.createObjectURL(C);b.push(()=>URL.revokeObjectURL(w)),t.src=w,b.push(()=>{try{t.pause()}catch{}t.removeAttribute(`src`),t.load()});let T=await new Promise((t,n)=>{let r=setTimeout(()=>{i(),n(Error(`The MediaSource never opened`))},ks),i=()=>{clearTimeout(r),C.removeEventListener(`sourceopen`,a),C.removeEventListener(`sourceclose`,o),C.removeEventListener(`error`,o)},a=()=>{try{let n=C.addSourceBuffer(d);n.mode=`segments`;let r=e.info.input.duration;Number.isFinite(r)&&r>0&&(C.duration=r),i(),t(n)}catch(e){i(),n(e)}},o=()=>{i(),n(Error(`The MediaSource closed before a SourceBuffer could be created`))};C.addEventListener(`sourceopen`,a,{once:!0}),C.addEventListener(`sourceclose`,o,{once:!0}),C.addEventListener(`error`,o,{once:!0})}),{appendBuffer:E,unbufferRange:D,updateTimestampOffset:O,endOfStream:k}=fs(T,C);await E(e.data),e.subtitles?.length&&a.pushFragments(e.subtitles),p?.();let A=!1,j=!1,ee=0,te,M=()=>te??t.currentTime,ne=!1,N=0,P=0,F=null,I=0,re=0,ie=!1,L=0,ae=(e,t,n=!1)=>{let r=e?.message===`Cancelled`;t&&r||(console.error(e),(!ie||n)&&(ie=!0,m?.(r?Error(`Reading the video file failed`,{cause:e}):e)))},oe=async(e=!1)=>{if(ee>0&&!e)return;let n=t.currentTime,r=e?Es:Cs,i=e?Ds:ws;for(let{start:e,end:t}of us(T))e<n+r&&await D(e,n+r),t>n+i&&await D(n+i,t)},R=()=>{let e=us(T);if(!e.length)return!0;let t=M(),n=e.find(e=>e.start<=t+As&&t<e.end);return n&&n.end>=t+ws?!1:!n||n.end<t+Ts},z=()=>{let e=t.currentTime;return us(T).find(t=>t.start<=e+As&&e<t.end)},se=()=>{let e=z();return!!e&&e.end>=re-.1},ce=()=>{let e=us(T).map(e=>e.end);e.length&&(re=Math.max(re,...e))},le=async e=>{j=!0,F=null,I=0,L=e;let t=++P;try{let{data:n,pts:r,subtitles:i,finished:o}=await y.seek(e);if(x||t!==P||(o&&(ne=!0),i?.length&&a.pushFragments(i),await O(r),x||t!==P))return;n.byteLength&&(await E(n),ce())}catch(e){ae(e,x||t!==P)}finally{t===P&&(j=!1)}},ue=async()=>{let e=F;if(e)try{await E(e),ce(),F===e&&(F=null,I=0)}catch(n){if(F!==e)return;if(n?.name===`QuotaExceededError`){let n=await oe(!0).then(()=>!0,()=>!1);if(F!==e)return;if(n){ne=!1,await le(z()?.end??t.currentTime);return}}if(I+=1,I<Os)return;throw F=null,n}},de=async()=>{if(A||j||xe!==void 0||x||!F&&(ne||!R()))return;let e=++N,t=P,n=()=>x||e!==N||t!==P;A=!0;try{if(!F){let{data:e,subtitles:t,finished:r}=await y.read();if(n()||(r&&(ne=!0),t?.length&&a.pushFragments(t),!e.byteLength))return;F=e,I=0}await ue(),!n()&&ie&&(ie=!1,h?.())}catch(e){ae(e,n())}finally{e===N&&(A=!1)}},fe=e=>e>=L&&!!z(),pe=e=>us(T).some(t=>t.start<=e+As&&e<t.end),me=e=>{let t=us(T).find(t=>t.start<=e+As&&e<t.end);return t?t.end-e:0},he=async e=>{if(!x&&!(me(e)>=js)){ne=!1,ee++,te=e;try{pe(e)||await le(e);let t=P;for(let n=0;n<Ms&&!(x||t!==P||ne||me(e)>=js);n++){let t=me(e);if(await de(),me(e)<=t)break}}finally{ee--,te===e&&(te=void 0)}}},ge=0,_e=null,ve,ye=e=>{let t=performance.now(),n=t-ge;if(n>=Ns){ge=t,_e=null,g?.(e);return}_e=e,!ve&&(ve=setTimeout(()=>{ve=void 0;let e=_e;_e=null,!(e===null||x)&&(ge=performance.now(),g?.(e))},Ns-n))};b.push(()=>{ve&&clearTimeout(ve)});let be=0,xe;b.push(()=>{xe&&clearTimeout(xe)});let Se=()=>{let n=t.currentTime,r=e.info.input.duration||t.duration;r>0&&ye(Math.min(Math.max(n/r,0),1));let i=performance.now(),a=i-be<Ps;if(be=i,!fe(n)&&!(j&&Math.abs(n-L)<.001)){if(ne=!1,xe&&clearTimeout(xe),!a){xe=void 0,le(n);return}xe=setTimeout(()=>{if(xe=void 0,x)return;let e=t.currentTime;fe(e)||(ne=!1,le(e))},Ps)}};t.addEventListener(`seeking`,Se),b.push(()=>t.removeEventListener(`seeking`,Se));let B=!1,Ce=()=>{if(B)return;B=!0;let e=t.error;ae(new xs(`the media element failed: ${e?.message??`unknown`}`,{cause:e}),!1,!0)};t.addEventListener(`error`,Ce),b.push(()=>t.removeEventListener(`error`,Ce));let V=setInterval(()=>{B||t.error||(oe().catch(()=>{}),de().catch(e=>ae(e,!1)),ne&&!F&&se()&&C.readyState===`open`&&k().catch(()=>{}))},100);return b.push(()=>clearInterval(V)),{destroy:S,prepareSeek:he,videoElement:t,selectSubtitleStream:e=>a.selectStream(e),indexes:e.indexes??[],chapters:e.chapters??[],duration:e.info.input.duration,videoMimeType:e.info.output.videoMimeType,audioMimeType:e.info.output.audioMimeType}}catch(e){throw S(),e}},Rs=5,zs=500,Bs=320,Vs=1e6,Hs=3,Us=1e4,Ws=1.5,Gs=4e6,Ks=3e4,qs=async e=>{let{publicPath:t,workerUrl:n,length:r,read:i,onThumbnails:a,width:o=Bs}=e,s=await io({publicPath:t,workerUrl:n,workerOptions:{type:`module`},length:r,read:i});try{let t=await s.init(),n=t.duration,i=Math.max(e.interval??Rs,n/zs),c=[],l=e=>{let t=[];for(let[a,o]of e.entries()){let s=t.at(-1);s&&o.timestamp-s.timestamp<i||t.push({timestamp:o.timestamp,endTime:n,startByte:o.pos,endByte:Math.min((e[a+1]?.pos??r)+Vs,r),done:!1,attempts:0})}for(let[e,r]of t.entries())r.endTime=t[e+1]?.timestamp??n;return t.length>1&&t.at(-1).timestamp>n-i*2&&t.pop(),t};c=l(t.indexes);let u=[],d=!1,f=[],p=!1,m,h=-1,g=!1,_=!1,v,y=()=>{let e=m;if(e!==void 0){let t=f.findIndex(({timestamp:t,endTime:n})=>t<=e&&e<n);if(t>=0)return t}return 0},b=()=>{let e=[];for(let[t,n]of u.entries()){n.startTime-(e.at(-1)?.endTime??0)>.01&&e.push({url:``,startTime:e.at(-1)?.endTime??0,endTime:n.startTime}),e.push(n);let r=u[t+1];r&&r.startTime-n.endTime>.01&&e.push({url:``,startTime:n.endTime,endTime:r.startTime})}let t=e.at(-1)?.endTime??0;n-t>.01&&e.push({url:``,startTime:t,endTime:n}),a(e)},x=async e=>{if(d)return;let t=await Promise.race([s.readKeyframe(e.timestamp),new Promise((e,t)=>setTimeout(()=>t(Error(`timed out`)),Us))]),n=await createImageBitmap(new Blob([t],{type:`image/png`})),r=new OffscreenCanvas(o,Math.max(1,Math.round(n.height*(o/n.width))));r.getContext(`2d`).drawImage(n,0,0,r.width,r.height),n.close();let i=await r.convertToBlob({type:`image/webp`,quality:.7});d||(u=[...u,{url:URL.createObjectURL(i),startTime:e.timestamp,endTime:e.endTime}].sort((e,t)=>e.startTime-t.startTime),b())},S=()=>{if(p||d||_)return;if(g){g=!1;let e=v;w(T(e)).then(()=>{E(e),S()});return}if(!f.length)return;let e=f.splice(y(),1)[0];p=!0,x(e).catch(()=>{e.attempts+=1,e.done=e.attempts>=Hs}).finally(()=>{p=!1,S()})},C=e=>{e.done=!0,f.push(e),S()},w=async e=>{_=!0;try{let t=await Promise.race([s.init(),new Promise((e,t)=>setTimeout(()=>t(Error(`timed out`)),Ks))]);if(d)return;h=e;let n=l(t.indexes);if(!n.length)return;let r=new Map(u.map(e=>[e.startTime,e]));for(let e of n)r.has(e.timestamp)&&(e.done=!0);c=n;let i=new Set(n.map(e=>e.timestamp));for(let e of u)i.has(e.startTime)||URL.revokeObjectURL(e.url);u=n.filter(e=>r.has(e.timestamp)).map(e=>({url:r.get(e.timestamp).url,startTime:e.timestamp,endTime:e.endTime})),f.length=0,b()}catch{}finally{_=!1}},T=e=>e?e.reduce((e,[,t])=>Math.max(e,t),0):r,E=e=>{for(let t of c)t.done||(!e||e.some(([e,n])=>e<=t.startByte&&t.endByte<=n))&&C(t)};return b(),{update:e=>{if(d)return;v=e;let t=T(e);h<0?h=t:(t>=Math.max(h*Ws,h+Gs)||t>=r&&h<r)&&(g=!0),E(e),S()},prioritize:e=>{d||(m=e)},destroy:()=>{d=!0,f.length=0;for(let e of u)URL.revokeObjectURL(e.url);u=[],Is(s)}}}catch(e){throw Is(s),e}},Js=1280,Ys=1920,Xs=250,Zs=100,Qs=()=>typeof HTMLCanvasElement<`u`&&`captureStream`in HTMLCanvasElement.prototype,$s=()=>typeof document<`u`&&typeof HTMLVideoElement<`u`&&typeof HTMLVideoElement.prototype.requestPictureInPicture==`function`&&!!document.pictureInPictureEnabled,ec=()=>typeof HTMLVideoElement<`u`&&`mozCaptureStream`in HTMLVideoElement.prototype,tc=()=>Qs()?$s()?`window`:ec()?`burn-in`:null:null,nc=e=>{let{video:t,subtitles:n}=e,r=e.mode??tc()??`window`,i=e.maxWidth??(r===`burn-in`?Ys:Js),a,o,s,c=!1,l=!1,u=!1,d=!1,f,p=()=>r===`burn-in`?!!a:!!a&&document.pictureInPictureElement===a.mirror,m=(e,r)=>{r.drawImage(t,0,0,e.width,e.height);let i=n.querySelector(`canvas`);i&&i.width>0&&i.height>0&&r.drawImage(i,0,0,e.width,e.height)},h=()=>{a&&m(a.composite,a.context)},g=`requestVideoFrameCallback`in t,_=()=>{h(),v()},v=()=>{!d&&a&&(o=g?t.requestVideoFrameCallback(_):requestAnimationFrame(_))},y=()=>{o!==void 0&&(g?t.cancelVideoFrameCallback(o):cancelAnimationFrame(o)),s!==void 0&&clearInterval(s),o=void 0,s=void 0},b=()=>{`mediaSession`in navigator&&(navigator.mediaSession.playbackState=t.paused?`paused`:`playing`)},x=()=>{c||l||!t.paused||t.play().catch(()=>{})},S=()=>{c||l||(t.paused||t.pause(),r!==`burn-in`&&(c=!0,a?.mirror.play().catch(()=>{}).finally(()=>{c=!1})))},C=()=>{b(),a?.mirror.play().catch(()=>{})},w=()=>{b(),r===`burn-in`&&a?.mirror.pause()},T=()=>{if(r!==`burn-in`||!a||!t.paused||l)return;l=!0;let{mirror:e}=a;h(),e.play().then(()=>new Promise(e=>{setTimeout(e,Zs)})).catch(()=>{}).finally(()=>{e.pause(),setTimeout(()=>{l=!1},Zs)})},E=[[`play`,()=>{t.play().catch(()=>{})}],[`pause`,()=>t.pause()]],D=e=>{if(`mediaSession`in navigator)for(let[t,n]of E)try{navigator.mediaSession.setActionHandler(t,e?n:null)}catch{}},O=()=>{if(y(),D(!1),t.removeEventListener(`play`,C),t.removeEventListener(`pause`,w),t.removeEventListener(`seeked`,T),!a){f?.();return}let{stream:e,mirror:n}=a;n.removeEventListener(`play`,x),n.removeEventListener(`pause`,S),n.removeEventListener(`leavepictureinpicture`,k);for(let t of e.getTracks())t.stop();n.remove(),a=void 0,f?.()},k=()=>O(),A=e=>{let r=t.style.opacity,i=n.style.display;e.style.cssText=`position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000;z-index:1`,t.style.opacity=`0`,n.style.display=`none`,f=()=>{f=void 0,t.style.opacity=r,n.style.display=i}},j=async()=>{let n=Math.min(t.videoWidth||i,i),o=Math.round(n*((t.videoHeight||9)/(t.videoWidth||16))),c=document.createElement(`canvas`);c.width=n,c.height=o;let l=c.getContext(`2d`);if(!l)throw Error(`the picture in picture composite has no 2d context`);let u=document.createElement(`video`);u.muted=!0,u.playsInline=!0,r===`burn-in`?A(u):u.style.cssText=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;left:-1px;top:-1px`,m(c,l);let f={composite:c,context:l,stream:c.captureStream(),mirror:u};if(a=f,u.srcObject=f.stream,(e.container??t.parentElement??document.body).appendChild(u),v(),s=setInterval(()=>{t.paused&&h()},Xs),u.play().catch(()=>{}),u.readyState===0&&await new Promise(e=>{let t=()=>{clearTimeout(n),e()},n=setTimeout(t,1e3);u.addEventListener(`loadedmetadata`,t,{once:!0})}),d||a!==f){u.remove();return}if(u.addEventListener(`play`,x),u.addEventListener(`pause`,S),u.addEventListener(`leavepictureinpicture`,k),t.addEventListener(`play`,C),t.addEventListener(`pause`,w),t.addEventListener(`seeked`,T),D(!0),b(),r===`burn-in`){t.paused&&u.pause(),e.onBurnedInChange?.(!0);return}await u.requestPictureInPicture()};return{toggle:async()=>{if(!(d||u)){u=!0;try{if(p()){if(r===`burn-in`){O(),e.onBurnedInChange?.(!1);return}await document.exitPictureInPicture().catch(()=>{});return}r!==`burn-in`&&document.pictureInPictureElement&&await document.exitPictureInPicture().catch(()=>{});try{await j()}catch(t){console.warn(`subtitle compositing for picture in picture failed`,t),O(),r===`burn-in`&&e.onBurnedInChange?.(!1)}}finally{u=!1}}},mode:r,destroy:()=>{d=!0,r!==`burn-in`&&p()&&document.exitPictureInPicture().catch(()=>{}),O(),r===`burn-in`&&e.onBurnedInChange?.(!1)}}};function rc(e){return typeof e==`string`}function ic(e){return typeof e==`number`}function K(e){return typeof e==`function`}function ac(e){return e===null}function q(e){return e===void 0}function oc(e){return typeof e==`object`&&!!e}function sc(e,t){let n={...t};for(let t in e)q(e[t])||(n[t]=e[t]);return n}function cc(e,t){let n={};for(let r of t)Object.hasOwn(e,r)&&(n[r]=e[r]);return n}var lc=Object.prototype.hasOwnProperty;function uc(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!lc.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var dc=new Map,fc=new Set;function pc(e){return e.trim().replaceAll(`_`,`-`).toLowerCase()}function mc(e){let t=e.indexOf(`-x-`),n=(t===-1?e:e.slice(0,t)).indexOf(`-u-`);return n===-1?e:e.slice(0,n)+(t===-1?``:e.slice(t))}function hc(e){if(e[0]!==`zh`)return;let t=e.find(e=>e===`hant`||e===`hans`);return t===`hant`?`zh-tw`:t===`hans`?`zh-cn`:void 0}function gc(e){return mc(pc(e))}function _c(e){let t=gc(e);if(!t)return[`en`];let n=t.split(`-`).filter(Boolean),r=[];for(let e=n.length;e>=1;e--)r.push(n.slice(0,e).join(`-`));let i=hc(n),a=r.indexOf(`zh`);i&&a!==-1&&r.splice(a,0,i);let o=[],s=new Set;for(let e of r)s.has(e)||(s.add(e),o.push(e));return s.has(`en`)||o.push(`en`),o}function vc(e){let t={};for(let n=e.length-1;n>=0;n--){let r=e[n],i=dc.get(r);i&&Object.assign(t,i)}return t}function yc(e){return vc(_c(e))}function bc(e){return fc.add(e),()=>{fc.delete(e)}}function xc(e){return typeof e==`string`?e:e.text}function Sc(e){return oc(e)&&`key`in e&&`text`in e}var Cc=/\{([^{}]+)\}/g;function wc(e,t){return t?e.replace(Cc,(e,n)=>Object.hasOwn(t,n)?String(t[n]):e):e}function Tc(e,t,n){return typeof e==`string`?e:typeof t==`function`?t(e,n):wc(xc(e),t??n)}function Ec(e,t){return(t,n)=>{let r=n,i=typeof t!=`string`,a=i?t.key:t,o=e[a],s=r?.default,c=r?{...r}:void 0;return c&&delete c.default,wc(o??(i?t.text:s)??String(a),c)}}c();var Dc=j(null);j(void 0);function Oc(){let e=E(Dc),[t,n]=y(e=>e+1,0);g(()=>bc(()=>n()),[]);let r=P(()=>Ec(yc(`en`),`en`),[t]);return e?e.translator:r}function kc(){return E(Dc)?.locale??`en`}function Ac(e){let t=e.closest(`[dir]`)?.getAttribute(`dir`);return t?t.toLowerCase()===`rtl`:getComputedStyle(e).direction===`rtl`}function jc(e){let t=e.composedPath();return t.length>0?t[0]:e.target}function Mc(e,t,n){return new Promise((r,i)=>{let a=()=>{i(n?.signal?.reason??`Aborted`)};if(n?.signal?.aborted){a();return}n?.signal?.addEventListener(`abort`,a,{once:!0}),e.addEventListener(t,e=>{n?.signal?.removeEventListener(`abort`,a),r(e)},{...n,once:!0})})}function Nc(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function Pc(){return typeof CSS<`u`&&CSS.supports(`anchor-name: --a`)}var Fc=[`button`,`input`,`select`,`textarea`,`a[href]`,`[role="button"]`,`[role="menu"]`,`[role="menuitem"]`,`[role="menuitemcheckbox"]`,`[role="menuitemradio"]`,`[role="slider"]`,`[data-interactive]`].join(`,`),Ic=[`textarea`,`select`,`input:not([type])`,...[`text`,`search`,`url`,`tel`,`email`,`password`,`number`].map(e=>`input[type="${e}"]`),`[contenteditable]:not([contenteditable="false"])`].join(`,`);function Lc(e){return e.matches(Ic)}function Rc(e){let t=jc(e);return t instanceof Element&&Lc(t)}function zc(e){let t=jc(e);return t instanceof Element&&t.closest(Fc)!==null}var Bc=new Set([` `,`Enter`]),Vc=`button,a[href],[role="slider"],[role="button"]`;function Hc(e){if(!Bc.has(e.key))return!1;let t=jc(e);return t instanceof Element&&t.matches(Vc)}function J(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Uc(){return typeof navigator<`u`&&/mac/i.test(navigator.userAgent)}var Wc={sideOffset:0,boundaryOffset:0},Gc={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function Kc(e,t,n,r){let i=r.boundaryOffset??0;switch(n){case`top`:return e.top-t.top-i-r.sideOffset;case`bottom`:return t.bottom-e.bottom-i-r.sideOffset;case`left`:return e.left-t.left-i-r.sideOffset;case`right`:return t.right-e.right-i-r.sideOffset}}function qc(e,t,n,r,i=Wc){let a=r.side,o=Gc[a],s=a===`top`||a===`bottom`?t.height:t.width,c=Kc(e,n,a,i);return c>=s?a:Kc(e,n,o,i)>c?o:a}function Jc(e){try{e?.showPopover?.()}catch{}}function Yc(e){try{e?.hidePopover?.()}catch{}}function Xc(e){return e instanceof Node&&e.nodeType===11&&`host`in e}function Zc(e,t){let n=t.trim();if(!n)return 0;let r=Number.parseFloat(n);if(!Number.isNaN(r)&&(/^-?\d*\.?\d+$/.test(n)||n.endsWith(`px`)))return r;let i=e.ownerDocument,a=i?.documentElement;if(!Number.isNaN(r)&&n.endsWith(`rem`))return r*(a&&Number.parseFloat(getComputedStyle(a).fontSize)||16);if(!Number.isNaN(r)&&n.endsWith(`em`))return r*(e instanceof HTMLElement&&Number.parseFloat(getComputedStyle(e).fontSize)||16);if(!i)return Number.isNaN(r)?0:r;let o=i.createElement(`div`);if(o.style.position=`absolute`,o.style.visibility=`hidden`,o.style.pointerEvents=`none`,o.style.inlineSize=n,!o.style.inlineSize)return 0;o.style.blockSize=`0`,o.style.padding=`0`,o.style.border=`0`,o.style.inset=`0`;let s=getComputedStyle(e);o.style.fontSize=s.fontSize;for(let e=0;e<s.length;e++){let t=s.item(e);t.startsWith(`--`)&&o.style.setProperty(t,s.getPropertyValue(t))}let c=i.body??i.documentElement;if(!c)return Number.isNaN(r)?0:r;if(c.appendChild(o),getComputedStyle(o).inlineSize===`auto`)return o.remove(),0;let l=o.getBoundingClientRect().width;return o.remove(),Number.isFinite(l)?l:Number.isNaN(r)?0:r}function Qc(e){return e.kind===`captions`||e.kind===`subtitles`}function $c(e,t){if(!(e instanceof HTMLElement))return null;for(let n of e.querySelectorAll(`track`))if(n.track===t)return n;return null}function el(e,t){return e.textTracks?Array.from(e.textTracks).filter(t).sort(tl):[]}function tl(e,t){return e.kind>t.kind?1:e.kind<t.kind?-1:0}function nl(e){let t=[];for(let n=0;n<e.length;n++)t.push([e.start(n),e.end(n)]);return t}function rl(e,t){let n=t;for(;n;){if(n===e||e.contains(n))return!0;let t=n.getRootNode();n=Xc(t)?t.host:n.parentNode}return!1}function il(){return`WebKitPlaybackTargetAvailabilityEvent`in globalThis}function al(e){return il()&&`webkitCurrentPlaybackTargetIsWireless`in e}c();function ol(e,t){if(K(e))return e(t);e!=null&&(e.current=t)}function sl(...e){let t=e.flat();return e=>{let n=t.map(t=>ol(t,e));if(n.some(K))return()=>{for(let e=0;e<n.length;e++){let r=n[e];K(r)?r():ol(t[e],null)}}}}function cl(...e){return k(sl(...e),[...e])}c();function ll(e,t,n,r=uc){let i=O(void 0),a=()=>{let e=n(t());return i.current!==void 0&&r(i.current,e)?i.current:(i.current=e,e)};return p(e,a,a)}function ul(e){return e}function dl(...e){}function fl(e,t,n){let r=n?.leading??!1,i=null,a,o=!1;function s(){i=setTimeout(()=>{i=null,o&&(o=!1,e(...a),s())},t)}let c=(...n)=>{if(a=n,r)i===null?(e(...a),s()):o=!0;else{if(i!==null)return;i=setTimeout(()=>{i=null,e(...a)},t)}};return c.cancel=()=>{i!==null&&(clearTimeout(i),i=null),o=!1},c}function pl(e,t,n){return ll(t=>e.subscribe(t),()=>e.current,t??ul,n)}var ml=()=>dl;function hl(e,t,n){return ll(t?t=>e.subscribe(t):ml,t?()=>e.state:()=>e,t??ul,n)}c();var gl=j(null),_l=()=>{},vl={state:{},subscribe:()=>_l};function yl({value:e,children:t}){return s(gl.Provider,{value:e,children:t})}function bl(){let e=E(gl);if(!e)throw Error(`usePlayerContext must be used within a Player Provider`);return e}function xl(e){let{store:t}=bl();return hl(t,e)}function Sl(e){let t=E(gl),n=hl(t?.store??vl,t?e:void 0);return t?n:void 0}function Cl(){let{media:e}=bl();return e}function wl(){let{container:e}=bl();return e}function Tl(){return E(gl)?.container??null}function El(){return E(gl)?.popupGroup}function Dl(){return E(gl)?.setMedia}function Ol(){return E(gl)?.setContainer}function kl(e){if(`any`in AbortSignal)return AbortSignal.any(e);let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(n.reason),t.signal;n.addEventListener(`abort`,()=>t.abort(n.reason),{signal:t.signal})}return t.signal}var Al=class{#e=new AbortController;#t=new Map;get base(){return this.#e.signal}clear(){for(let e of this.#t.values())e.abort();this.#t.clear()}reset(){this.clear(),this.#e.abort(),this.#e=new AbortController}supersede(e){this.#t.get(e)?.abort();let t=new AbortController;return this.#t.set(e,t),kl([this.#e.signal,t.signal])}};function jl(...e){return{state:t=>{let n=e.map(e=>e.state(t));return Object.assign({},...n)},attach:t=>{for(let n of e)try{n.attach?.(t)}catch(e){t.reportError(e)}}}}var Ml=class extends Error{code;cause;constructor(e,t){super(t?.message??e),this.name=`StoreError`,this.code=e,this.cause=t?.cause}};function Nl(){throw new Ml(`NO_TARGET`)}function Pl(){throw new Ml(`DESTROYED`)}var Fl={target:Nl,signals:new Al,get:Nl,set:Nl};function Il(e){let t=e.state(Fl),n=Object.keys(t),r=n[0];return Object.assign(r?e=>{if(r in e)return cc(e,n)}:()=>void 0,{displayName:e.name})}function Ll(){return e=>e}var Rl=!1;function zl(){Rl||(Rl=!0,queueMicrotask(Vl))}var Bl=new Set;function Vl(){Rl=!1;for(let e of Bl)e.flush();Bl.clear()}var Hl=Object.prototype.hasOwnProperty,Ul=class{#e;#t=new Set;#n=!1;constructor(e){this.#e=Object.freeze({...e})}get current(){return this.#e}patch(e){let t={...this.#e},n=!1;for(let r in e){if(!Hl.call(e,r))continue;let i=e[r];Object.is(this.#e[r],i)||(t[r]=i,n=!0)}n&&(this.#e=Object.freeze(t),this.#r())}subscribe(e,t){let n=t?.signal;if(n?.aborted)return dl;if(this.#t.add(e),!n)return()=>this.#t.delete(e);let r=()=>this.#t.delete(e);return n.addEventListener(`abort`,r,{once:!0}),()=>{n.removeEventListener(`abort`,r),this.#t.delete(e)}}flush(){if(this.#n){this.#n=!1;for(let e of this.#t)e()}}#r(){this.#n=!0,Bl.add(this),zl()}};function Wl(e){return new Ul(e)}var Gl=Symbol.for(`@videojs/store`);function Kl(){return(e,t={})=>{let n=null,r=!1,i=new AbortController,a=new Al,o;function s(){r&&Pl(),n||Nl()}let c=e.state({target:()=>(s(),n),signals:a,get:()=>o.current,set:e=>o.patch(e)});o=Wl(c);let l={[Gl]:!0,get $state(){return o},get target(){return n},get destroyed(){return r},get state(){return o.current},attach:u,destroy:f,subscribe:p};for(let e of Object.keys(c))Object.defineProperty(l,e,{get:()=>o.current[e],enumerable:!0});try{t.onSetup?.({store:l,signal:i.signal})}catch(e){m(e)}return l;function u(i){r&&Pl(),a.reset(),n=i;let s={target:i,signal:a.base,get:()=>o.current,set:e=>o.patch(e),reportError:m,store:{get state(){return o.current},subscribe:p}};try{e.attach?.(s)}catch(e){m(e)}try{t.onAttach?.({store:l,target:i,signal:a.base})}catch(e){m(e)}return d}function d(){ac(n)||(a.reset(),n=null,o.patch(c))}function f(){r||(r=!0,d(),i.abort())}function p(e,t){return o.subscribe(e,t)}function m(e){t.onError?t.onError({store:l,error:e}):console.error(`[vjs-store]`,e)}}}var ql=Ll();function Jl(e,t){if(arguments.length===1)return ql(e);let{name:n,state:r,attach:i}=e,a=e=>ql({...q(n)?{}:{name:n},state:t=>r(t,e),...i?{attach:t=>i(t,e)}:{}}),o=a(t),s=(e=>q(e)?o:a(e));return s.state=o.state,o.attach&&(s.attach=o.attach),q(n)||Object.defineProperty(s,"name",{value:n}),s}var Yl=Object.freeze({length:0,start:()=>0,end:()=>0}),Xl=Object.assign(new EventTarget,{length:0,*[Symbol.iterator](){},getTrackById:()=>null}),Zl=new EventTarget;Object.freeze({});var Ql=class e extends Error{static MEDIA_ERR_ABORTED=1;static MEDIA_ERR_NETWORK=2;static MEDIA_ERR_DECODE=3;static MEDIA_ERR_SRC_NOT_SUPPORTED=4;static MEDIA_ERR_ENCRYPTED=5;static MEDIA_ERR_CUSTOM=100;static defaultMessages={1:`You stopped media playback before it finished.`,2:`This media could not be loaded due to a network or server issue.`,3:`This media could not be played. It may be corrupted, or your browser may not support its format.`,4:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`,5:`This media could not be played because it could not be decrypted.`};name;code;context;fatal;data;constructor(t,n=e.MEDIA_ERR_CUSTOM,r,i){super(t),this.name=`MediaError`,this.code=n,this.context=i,this.fatal=r??(n>=e.MEDIA_ERR_NETWORK&&n<=e.MEDIA_ERR_ENCRYPTED),this.message||=e.defaultMessages[this.code]??``}};function $l(e){return e.readyState>=1}function eu(e){if(!oc(e))return!1;let t=e;return!q(t.paused)&&!q(t.ended)&&K(t.pause)}function tu(e){if(!oc(e))return!1;let t=e;return!q(t.currentTime)&&!q(t.duration)&&!q(t.seeking)}function nu(e){if(!oc(e))return!1;let t=e;return!q(t.src)&&!q(t.currentSrc)&&!q(t.readyState)&&K(t.load)}function ru(e){if(!oc(e))return!1;let t=e;return!q(t.volume)&&!q(t.muted)}function iu(e){return oc(e)?!q(e.playbackRate):!1}function au(e){if(!oc(e))return!1;let t=e;return!q(t.buffered)&&t.buffered!==Yl&&!q(t.seekable)&&t.seekable!==Yl}function ou(e){return oc(e)?!q(e.error):!1}function su(e){if(!oc(e))return!1;let t=e;return!q(t.textTracks)&&t.textTracks!==Xl}function cu(e){return oc(e)?!q(e.videoRenditions):!1}function lu(e){return oc(e)?!q(e.audioTracks):!1}function uu(e){if(!oc(e))return!1;let t=e;return!q(t.videoWidth)&&!q(t.videoHeight)}function du(e){if(!oc(e))return!1;let t=e;return oc(t.remote)&&t.remote!==Zl}function fu(e){return oc(e)?!q(e.streamType):!1}function pu(e){if(!oc(e))return!1;let t=e;return!q(t.liveEdgeStart)&&!q(t.targetLiveWindow)}function mu(e){return oc(e)&&`querySelectorAll`in e&&K(e.querySelectorAll)}var hu={ON_DEMAND:`on-demand`,LIVE:`live`,UNKNOWN:`unknown`};function gu(e,t){return e.id||String(t)}function _u(e){return{...e.id!==void 0&&{id:e.id},...e.kind!==void 0&&{kind:e.kind},label:e.label,language:e.language,enabled:e.enabled}}var vu=Jl({name:`audioTrack`,state:({target:e})=>({audioTrackList:[],selectAudioTrack(t){let{media:n}=e();if(!lu(n))return;let r=[...n.audioTracks],i=r.find((e,n)=>gu(e,n)===t);if(i)for(let e of r)e.enabled=e===i}}),attach({target:e,signal:t,set:n}){let{media:r}=e,i=null,a=null,o=()=>lu(r)?r.audioTracks:null,s=(e=o())=>{n({audioTrackList:e?[...e].map(_u):[]})},c=()=>{let e=o();if(e===i){s(e);return}a?.abort(),a=new AbortController,i=e,i&&(J(i,`addtrack`,()=>s(i),{signal:a.signal}),J(i,`removetrack`,()=>s(i),{signal:a.signal}),J(i,`change`,()=>s(i),{signal:a.signal})),s(i)};c(),J(r,`loadstart`,c,{signal:t}),t.addEventListener(`abort`,()=>a?.abort(),{once:!0})}}),yu=Jl({name:`buffer`,state:()=>({buffered:[],seekable:[]}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!au(r))return;let i=()=>n({buffered:nl(r.buffered),seekable:nl(r.seekable)});i(),J(r,`progress`,i,{signal:t}),J(r,`emptied`,i,{signal:t})}});function bu(e,t,n){if(n.size===0)return null;let r=e-t.left,i=t.width;if(i===0)return null;let a=r/i;return n.size===2&&n.has(`left`)&&n.has(`right`)?a<.5?`left`:`right`:n.size===3?a<1/3?`left`:a<2/3?`center`:`right`:n.has(`left`)&&a<.5?`left`:n.has(`right`)&&a>=.5?`right`:n.has(`center`)&&(n.size===1||a>=1/3&&a<2/3)?`center`:null}var xu=250,Su=class{#e;#t=[];#n=new Set;#r=null;#i=new Set;constructor(e){this.#e=e}get bindings(){return this.#t}subscribe(e){return this.#i.add(e),()=>this.#i.delete(e)}claimsTap(e,t){return!zc(e)&&this.#t.some(n=>n.type===`tap`&&n.action===t&&(!n.pointer||n.pointer===e.pointerType))}add(e){let t={...e,onActivate:t=>{if(this.#i.size>0){let n={type:e.type,source:`gesture`,action:e.action,value:e.value,region:e.region,pointer:e.pointer,event:t};for(let e of this.#i)try{e(n)}catch{}}e.onActivate(t)}};this.#t.push(t),this.#n.add(t.recognizer),this.#a();let n=!1;return()=>{if(n)return;n=!0;let e=this.#t.indexOf(t);e!==-1&&this.#t.splice(e,1),this.#o()}}#a(){if(this.#r)return;this.#r=new AbortController;let{signal:e}=this.#r,t=0;J(this.#e,`pointerdown`,e=>{e.button===0&&(t=Date.now())},{signal:e}),J(this.#e,`pointerup`,e=>{if(e.button!==0||Date.now()-t>xu||zc(e))return;let n=e.pointerType,r=e.clientX,i=this.#e,a=this.#t,o={resolve:e=>Eu(a,e,n,r,i)};for(let t of this.#n)t.handleUp(o,e)},{signal:e})}#o(){if(!(this.#t.length>0)){for(let e of this.#n)e.reset();this.#n.clear(),this.#r?.abort(),this.#r=null}}},Cu=new WeakMap;function wu(e){return Cu.get(e)}function Tu(e){let t=Cu.get(e);return t||(t=new Su(e),Cu.set(e,t)),t}function Eu(e,t,n,r,i){let a=i.getBoundingClientRect(),o=Du(e,t,n),s=o.size>0?bu(r,a,o):null,c=[];for(let r of e)if(!r.disabled&&r.type===t&&!(r.pointer&&r.pointer!==n)){if(r.region){if(r.region!==s)continue}else if(s!==null)continue;c.push(r)}return c}function Du(e,t,n){let r=new Set;for(let i of e)i.disabled||i.type===t&&(i.pointer&&i.pointer!==n||i.region&&r.add(i.region));return r}function Ou(e){let t=e;if(oc(t.remote)&&`state`in t.remote&&`prompt`in t.remote)return t.remote}function ku(e){return Ou(e)?.state===`connected`}function Au(e){return Ou(e)?.state===`connecting`}async function ju(e){let t=Ou(e);if(!t)throw new DOMException(`Remote playback not supported`,`NotSupportedError`);return t.prompt()}var Mu=2e3,Nu=250,Pu=500,Fu=Jl({name:`controls`,state:({get:e,set:t})=>({userActive:!0,controlsVisible:!0,toggleControls(){let n=!e().userActive;return t({userActive:n,controlsVisible:n}),n}}),attach({target:e,signal:t,get:n,set:r}){let{media:i,container:a}=e;if(!eu(i)||ac(a))return;let o=e=>e||i.paused||ku(i)||Au(i),s;function c(){clearTimeout(s),s=void 0}function l(){c(),s=setTimeout(d,Mu)}function u(){n().userActive||r({userActive:!0,controlsVisible:!0}),l()}function d(){c(),r({userActive:!1,controlsVisible:o(!1)})}r({toggleControls(){return n().controlsVisible?d():u(),n().controlsVisible}});let f=0,p=0,m=()=>p>0&&Date.now()-p<Pu;function h(e){f=Date.now(),e.pointerType===`touch`&&(p=f)}function g(e){if(e.pointerType===`touch`&&(p=Date.now()),e.pointerType===`touch`&&Date.now()-f<Nu){if(wu(a)?.claimsTap(e,`toggleControls`))return;let t=[i,a].includes(e.target);n().controlsVisible&&t?d():u()}else u()}let _=()=>{let{userActive:e}=n();r({controlsVisible:o(e)}),!i.paused&&e&&l()};function v(e){if(e.pointerType===`touch`){n().userActive&&l();return}u()}if(J(a,`pointermove`,v,{signal:t}),J(a,`pointerdown`,h,{signal:t}),J(a,`pointerup`,g,{signal:t}),J(a,`keyup`,u,{signal:t}),J(a,`focusin`,()=>{m()||u()},{signal:t}),J(a,`mouseleave`,()=>{m()||d()},{signal:t}),J(i,`play`,_,{signal:t}),J(i,`pause`,_,{signal:t}),J(i,`ended`,_,{signal:t}),du(i)){let e=()=>{let{userActive:e}=n();r({controlsVisible:o(e)})};J(i.remote,`connect`,e,{signal:t}),J(i.remote,`connecting`,e,{signal:t}),J(i.remote,`disconnect`,e,{signal:t})}t.addEventListener(`abort`,c,{once:!0}),l()}}),Iu=Jl({name:`error`,state:({set:e})=>({error:null,dismissError(){e({error:null})}}),attach({target:e,signal:t,set:n}){let{media:r}=e;ou(r)&&(J(r,`error`,()=>n({error:r.error}),{signal:t}),J(r,`emptied`,()=>n({error:null}),{signal:t}))}});function Lu(){let e=document;return e.fullscreenEnabled||e.webkitFullscreenEnabled?!0:K(document.createElement(`video`).webkitSetPresentationMode)}function Ru(){let e=document;return e.fullscreenElement??e.webkitFullscreenElement??null}function zu(e){if(!(e instanceof Element))return!1;try{return e.matches(`:fullscreen`)}catch{return!1}}function Bu(e,t){if(t.webkitPresentationMode===`fullscreen`)return!0;let n=Ru();return n&&(n===e||n===t)||zu(e)||zu(t)?!0:t.isFullscreen??!1}async function Vu(e,t){let n=document;if(e&&(n.fullscreenEnabled||n.webkitFullscreenEnabled)){let t=e;if(K(t.requestFullscreen))return t.requestFullscreen();if(K(t.webkitRequestFullscreen))return t.webkitRequestFullscreen()}let r=t;if(K(r.webkitSetPresentationMode)){r.webkitSetPresentationMode(`fullscreen`);return}let i=t;if(K(i.requestFullscreen))return i.requestFullscreen()}async function Hu(e){let t=document,n=e;if(n.webkitPresentationMode===`fullscreen`&&K(n.webkitSetPresentationMode)){n.webkitSetPresentationMode(`inline`);return}if(K(t.exitFullscreen))return t.exitFullscreen();if(K(t.webkitExitFullscreen))return t.webkitExitFullscreen();let r=e;if(K(r.exitFullscreen))return r.exitFullscreen()}function Uu(){if(document.pictureInPictureEnabled){let e=/.*Version\/.*Safari\/.*/.test(navigator.userAgent),t=typeof matchMedia==`function`&&matchMedia(`(display-mode: standalone)`).matches;return!e||!t}return K(document.createElement(`video`).webkitSetPresentationMode)}function Wu(e){return e.webkitPresentationMode===`picture-in-picture`||document.pictureInPictureElement===e?!0:e.isPictureInPicture??!1}async function Gu(e){let t=e;if(K(t.webkitSetPresentationMode)){t.webkitSetPresentationMode(`picture-in-picture`);return}let n=e;if(K(n.requestPictureInPicture))return n.requestPictureInPicture()}async function Ku(e){let t=e;if(t.webkitPresentationMode===`picture-in-picture`&&K(t.webkitSetPresentationMode)){t.webkitSetPresentationMode(`inline`);return}if(K(document.exitPictureInPicture))return document.exitPictureInPicture();let n=e;if(K(n.exitPictureInPicture))return n.exitPictureInPicture()}var qu=Jl({name:`fullscreen`,state:({target:e})=>({fullscreen:!1,fullscreenAvailability:`unavailable`,async requestFullscreen(){let{media:t,container:n}=e();return Wu(t)&&await Ku(t),Vu(n,t)},async exitFullscreen(){let{media:t}=e();return Hu(t)},async toggleFullscreen(){let{media:t,container:n}=e();return Bu(n,t)?Hu(t):(Wu(t)&&await Ku(t),Vu(n,t))}}),attach({target:e,signal:t,set:n}){let{media:r,container:i}=e;n({fullscreenAvailability:Lu()?`available`:`unsupported`});let a=()=>n({fullscreen:Bu(i,r)});a(),J(document,`fullscreenchange`,a,{signal:t}),J(document,`webkitfullscreenchange`,a,{signal:t}),`webkitPresentationMode`in r&&J(r,`webkitpresentationmodechanged`,a,{signal:t})}}),Ju=Jl({name:`live`,state:()=>({liveEdgeStart:NaN,targetLiveWindow:NaN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!pu(r))return;let i=()=>n({liveEdgeStart:r.liveEdgeStart,targetLiveWindow:r.targetLiveWindow});i(),J(r,`targetlivewindowchange`,i,{signal:t}),J(r,`streamtypechange`,i,{signal:t}),J(r,`loadedmetadata`,i,{signal:t}),J(r,`canplay`,i,{signal:t}),J(r,`progress`,i,{signal:t}),J(r,`durationchange`,i,{signal:t}),J(r,`timeupdate`,i,{signal:t}),J(r,`emptied`,i,{signal:t})}}),Yu=Jl({name:`pip`,state:({target:e})=>({pip:!1,pipAvailability:`unavailable`,async requestPictureInPicture(){let{media:t,container:n}=e();return Bu(n,t)&&await Hu(t),Gu(t)},async exitPictureInPicture(){let{media:t}=e();return Ku(t)},async togglePictureInPicture(){let{media:t,container:n}=e();return Wu(t)?Ku(t):(Bu(n,t)&&await Hu(t),Gu(t))}}),attach({target:e,signal:t,set:n}){let{media:r}=e;n({pipAvailability:Uu()?`available`:`unsupported`});let i=()=>n({pip:Wu(r)});i(),J(r,`enterpictureinpicture`,i,{signal:t}),J(r,`leavepictureinpicture`,i,{signal:t}),`webkitPresentationMode`in r&&J(r,`webkitpresentationmodechanged`,i,{signal:t})}}),Xu=Jl({name:`playback`,state:({target:e})=>({paused:!0,ended:!1,started:!1,waiting:!1,play(){return e().media.play()},pause(){let{media:t}=e();eu(t)&&t.pause()},togglePaused(){let t=e().media;return eu(t)?t.paused?(t.play(),!0):(t.pause(),!1):!1}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!eu(r)||!tu(r)||!nu(r))return;let i=()=>n({paused:r.paused,ended:r.ended,started:!r.paused||r.currentTime>0,waiting:r.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&!r.paused});i(),J(r,`emptied`,i,{signal:t}),J(r,`play`,i,{signal:t}),J(r,`pause`,i,{signal:t}),J(r,`ended`,i,{signal:t}),J(r,`playing`,i,{signal:t}),J(r,`waiting`,i,{signal:t}),J(r,`seeked`,i,{signal:t})}}),Zu=[.2,.5,.7,1,1.2,1.5,1.7,2],Qu=Jl({name:`playbackRate`,state:({target:e})=>({playbackRates:Zu,playbackRate:1,setPlaybackRate(t){let{media:n}=e();iu(n)&&(n.playbackRate=t)}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!iu(r))return;let i=()=>n({playbackRate:r.playbackRate});i(),J(r,`ratechange`,i,{signal:t})}}),$u=`auto`;function ed(e,t){return e.id||String(t)}function td(e){return{...e.id!==void 0&&{id:e.id},...e.width!==void 0&&{width:e.width},...e.height!==void 0&&{height:e.height},...e.bitrate!==void 0&&{bitrate:e.bitrate},...e.frameRate!==void 0&&{frameRate:e.frameRate},...e.codec!==void 0&&{codec:e.codec},selected:e.selected}}function nd(e){return e.width&&e.height?Math.min(e.width,e.height):e.height??e.width}var rd=Jl({name:`quality`,state:({target:e})=>({videoRenditionList:[],activeVideoRendition:null,selectVideoRendition(t){let{media:n}=e();if(!cu(n))return;if(t===$u){n.videoRenditions.selectedIndex=-1;return}let r=[...n.videoRenditions].findIndex((e,n)=>ed(e,n)===t);r!==-1&&(n.videoRenditions.selectedIndex=r)}}),attach({target:e,signal:t,set:n}){let{media:r}=e,i=null,a=null,o=()=>cu(r)?r.videoRenditions:null,s=e=>{if(!e)return null;let t=[...e],n=t.find(e=>e.active);if(n)return n;if(!uu(r)||!r.videoWidth&&!r.videoHeight)return null;let i=nd({width:r.videoWidth||void 0,height:r.videoHeight||void 0}),a=t.filter(e=>nd(e)===i);return a.length===1?a[0]:null},c=(e=o())=>{let t=s(e);n({videoRenditionList:e?[...e].map(td):[],activeVideoRendition:t?td(t):null})},l=()=>{let e=o();if(e===i){c(e);return}a?.abort(),a=new AbortController,i=e,i&&(J(i,`addrendition`,()=>c(i),{signal:a.signal}),J(i,`removerendition`,()=>c(i),{signal:a.signal}),J(i,`change`,()=>c(i),{signal:a.signal}),J(i,`activechange`,()=>c(i),{signal:a.signal})),c(i)};l(),J(r,`loadstart`,l,{signal:t}),J(r,`resize`,()=>c(i),{signal:t}),t.addEventListener(`abort`,()=>a?.abort(),{once:!0})}}),id=Jl({name:`remotePlayback`,state:({target:e})=>({remotePlaybackState:`disconnected`,remotePlaybackAvailability:`unsupported`,async toggleRemotePlayback(){let{media:t,container:n}=e();return ku(t)?ju(t):(Bu(n,t)&&await Hu(t),await ju(t))}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!du(r))return;if(al(r)){let e=()=>{n({remotePlaybackState:r.webkitCurrentPlaybackTargetIsWireless?`connected`:`disconnected`})};J(r,`webkitplaybacktargetavailabilitychanged`,e=>{let{availability:t}=e;n({remotePlaybackAvailability:t===`available`?`available`:`unavailable`})},{signal:t}),J(r,`webkitcurrentplaybacktargetiswirelesschanged`,e,{signal:t}),e();return}let i=()=>n({remotePlaybackState:r.remote.state});i(),J(r.remote,`connect`,i,{signal:t}),J(r.remote,`connecting`,i,{signal:t}),J(r.remote,`disconnect`,i,{signal:t}),r.remote.watchAvailability(e=>{n({remotePlaybackAvailability:e?`available`:`unavailable`})}).catch(()=>{n({remotePlaybackAvailability:`unsupported`})}),t.addEventListener(`abort`,()=>{r.remote?.cancelWatchAvailability?.().catch(()=>{})})}}),ad=Jl({name:`source`,state:({target:e,signals:t})=>({source:null,canPlay:!1,loadSource(n){t.clear();let{media:r}=e();return nu(r)?(r.src=n,r.load(),n):n}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!nu(r))return;let i=()=>n({source:r.currentSrc||r.src||null,canPlay:r.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA});i(),J(r,`canplay`,i,{signal:t}),J(r,`canplaythrough`,i,{signal:t}),J(r,`loadstart`,i,{signal:t}),J(r,`emptied`,i,{signal:t})}}),od=Jl({name:`streamType`,state:()=>({streamType:hu.UNKNOWN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(fu(r)){let e=()=>n({streamType:r.streamType});e(),J(r,`streamtypechange`,e,{signal:t});return}if(!tu(r))return;let i=()=>{let{duration:e}=r;return e===1/0?hu.LIVE:Number.isFinite(e)&&e>0?hu.ON_DEMAND:hu.UNKNOWN},a=()=>n({streamType:i()});a(),J(r,`durationchange`,a,{signal:t}),J(r,`loadedmetadata`,a,{signal:t}),J(r,`emptied`,a,{signal:t}),au(r)&&J(r,`progress`,a,{signal:t})}});function sd(e,t){return e.id||`track:${t}:${e.kind}:${e.language}:${e.label}`}var cd=Jl({name:`textTrack`,state:({target:e})=>({chaptersCues:[],thumbnailCues:[],thumbnailTrackSrc:null,textTrackList:[],subtitlesShowing:!1,toggleSubtitles(t){let{media:n}=e();if(!su(n))return!1;let r=el(n,Qc);if(!r.length)return!1;let i=r.some(e=>e.mode===`showing`),a=t??!i;for(let e of r)e.mode=a?`showing`:`disabled`;return a},selectSubtitlesTrack(t){let{media:n}=e();if(!su(n))return;let r=Array.from(n.textTracks).map((e,t)=>({index:t,track:e})).filter(({track:e})=>Qc(e));if(!r.length)return;if(t===`off`){for(let{track:e}of r)e.mode=`disabled`;return}let i=r.find(({index:e,track:n})=>sd(n,e)===t)?.track;if(i)for(let{track:e}of r)e.mode=e===i?`showing`:`disabled`}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!su(r))return;let i=null,a=()=>{i?.abort(),i=new AbortController;let e=null,t=null,o=[],s=!1;for(let n=0;n<r.textTracks.length;n++){let i=r.textTracks[n];!e&&i.kind===`chapters`&&(e=i),!t&&i.kind===`metadata`&&i.label===`thumbnails`&&(t=i),o.push({id:sd(i,n),kind:i.kind,label:i.label,language:i.language,mode:i.mode}),Qc(i)&&i.mode===`showing`&&(s=!0)}let c=e?.cues?Array.from(e.cues):[],l=t?.cues?Array.from(t.cues):[],u=null;t&&(u=$c(r,t)?.src??null);let d=mu(r)&&r.querySelectorAll(`track`)||[],f=r instanceof HTMLElement&&r.shadowRoot?.querySelectorAll(`track`)||[];for(let e of[...d,...f])e.track?.cues?.length||J(e,`load`,a,{signal:i.signal});n({chaptersCues:c,thumbnailCues:l,thumbnailTrackSrc:u,textTrackList:o,subtitlesShowing:s})};a();let o=r.textTracks;o instanceof EventTarget&&(J(o,`addtrack`,a,{signal:t}),J(o,`removetrack`,a,{signal:t}),J(o,`change`,a,{signal:t})),J(r,`loadstart`,a,{signal:t}),t.addEventListener(`abort`,()=>i?.abort(),{once:!0})}}),ld={seek:Symbol.for(`@videojs/seek`)},ud=Jl({name:`time`,state:({target:e,signals:t,set:n})=>({currentTime:0,duration:0,seeking:!1,async seek(r){let{media:i}=e(),a=t.supersede(ld.seek);if(!tu(i)||!nu(i))return 0;if(!$l(i)&&!await Mc(i,`loadedmetadata`,{signal:a}).catch(()=>!1))return i.currentTime;let o=Math.max(0,Math.min(r,i.duration||1/0));return n({currentTime:o,seeking:!0}),i.currentTime=o,await Mc(i,`seeked`,{signal:a}).catch(dl),i.currentTime}}),attach({target:e,signal:t,set:n,get:r}){let{media:i}=e;if(!tu(i))return;let a=()=>{let{duration:e}=i;if(e===1/0&&au(i)){let{seekable:e}=i;return e.length>0?e.end(e.length-1):0}return Number.isFinite(e)?e:0},o=()=>n({currentTime:i.currentTime,duration:a(),seeking:i.seeking}),s=()=>{r().seeking||o()};o(),J(i,`timeupdate`,s,{signal:t}),J(i,`durationchange`,o,{signal:t}),J(i,`seeking`,o,{signal:t}),J(i,`seeked`,o,{signal:t}),J(i,`loadedmetadata`,o,{signal:t}),J(i,`emptied`,o,{signal:t}),J(i,`progress`,s,{signal:t})}}),dd=.25,fd=Jl({name:`volume`,state:({target:e})=>({volume:1,muted:!1,volumeAvailability:`unavailable`,setVolume(t){let{media:n}=e();if(!ru(n))return 0;let r=Math.max(0,Math.min(1,t));return r>0&&n.muted&&(n.muted=!1),n.volume=r,n.volume},toggleMuted(){let{media:t}=e();return ru(t)?(t.muted||t.volume===0?(t.muted=!1,t.volume===0&&(t.volume=dd)):t.muted=!0,t.muted):!1}}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!ru(r))return;n({volumeAvailability:pd()});let i=()=>n({volume:r.volume,muted:r.muted});i(),J(r,`volumechange`,i,{signal:t})}});function pd(){let e=document.createElement(`video`);try{return e.volume=.5,e.volume===.5?`available`:`unsupported`}catch{return`unsupported`}}Il(vu);var md=Il(yu),hd=Il(Fu),gd=Il(Iu),_d=Il(qu);Il(Ju);var vd=Il(Yu),yd=Il(Xu),bd=Il(Qu);Il(rd),Il(id),Il(ad),Il(od);var xd=Il(cd),Sd=Il(ud),Cd=Il(fd),wd={seekStep({store:e,value:t}){if(q(t))return;let n=Sd(e.state);n&&n.seek(n.currentTime+t)},volumeStep({store:e,value:t}){if(q(t))return;let n=Cd(e.state);n&&n.setVolume(n.volume+t)},speedUp({store:e}){let t=bd(e.state);if(!t)return;let{playbackRates:n,playbackRate:r}=t,i=n.indexOf(r),a=i<0||i>=n.length-1?0:i+1;t.setPlaybackRate(n[a])},speedDown({store:e}){let t=bd(e.state);if(!t)return;let{playbackRates:n,playbackRate:r}=t,i=n.indexOf(r),a=i<=0?n.length-1:i-1;t.setPlaybackRate(n[a])}},Td={seekStep:wd.seekStep,volumeStep:wd.volumeStep,speedUp:wd.speedUp,speedDown:wd.speedDown};function Ed(e){return Td[e]||(({store:t})=>{let n=t.state[e];K(n)&&n()})}var Dd=200,Od=class{#e=0;#t=null;handleUp(e,t){if(e.resolve(`doubletap`).length>0){let n=Date.now();if(n-this.#e<Dd){this.#n(),this.#e=0,e.resolve(`doubletap`)[0]?.onActivate(t);return}this.#e=n,this.#n(),this.#t=setTimeout(()=>{this.#t=null,this.#e=0,e.resolve(`tap`)[0]?.onActivate(t)},Dd);return}e.resolve(`tap`)[0]?.onActivate(t)}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}reset(){this.#n(),this.#e=0}},kd=new WeakMap;function Ad(e){let t=kd.get(e);return t||(t=new Od,kd.set(e,t),t)}function jd(e,t,n){return Tu(e).add({type:`tap`,recognizer:Ad(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Md(e,t,n){return Tu(e).add({type:`doubletap`,recognizer:Ad(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Nd(e){return e.startsWith(`toggle`)}var Pd={togglePaused({store:e}){let t=yd(e.state);t&&(t.paused?t.play():t.pause())},toggleMuted({store:e}){Cd(e.state)?.toggleMuted()},toggleFullscreen({store:e}){let t=_d(e.state);t&&(t.fullscreen?t.exitFullscreen():t.requestFullscreen())},toggleSubtitles({store:e}){xd(e.state)?.toggleSubtitles()},togglePictureInPicture({store:e}){let t=vd(e.state);t&&(t.pip?t.exitPictureInPicture():t.requestPictureInPicture())},seekStep:wd.seekStep,volumeStep:wd.volumeStep,speedUp:wd.speedUp,speedDown:wd.speedDown,seekToPercent({store:e,value:t,key:n}){let r=Sd(e.state);if(!r||r.duration<=0)return;let i;if(!q(t))i=t;else if(n>=`0`&&n<=`9`)i=Number(n)*10;else return;r.seek(i/100*r.duration)}};function Fd(e){return Pd[e]}var Id={shift:`Shift`,ctrl:`Control`,alt:`Alt`,meta:`Meta`},Ld={shift:`Shift`,ctrl:`Ctrl`,alt:`Alt`,meta:`Meta`},Rd=[`ctrl`,`shift`,`alt`,`meta`];function zd(e){return e.map(e=>{let t=[];for(let n of Rd)e.modifiers.has(n)&&t.push(Id[n]);return t.push(e.originalKey),t.join(`+`)}).join(` `)}function Bd(e){let t=[];for(let n of Rd)e.modifiers.has(n)&&t.push(Ld[n]);return t.push(Vd(e.originalKey)),t.join(`+`)}function Vd(e){return e.length===1?e.toUpperCase():e}var Hd=class{#e;#t=[];#n=0;#r=null;#i=null;#a=new Set;#o=new Set;#s=!1;constructor(e){this.#e=e}subscribe(e){return this.#a.add(e),()=>this.#a.delete(e)}subscribeShortcutChanges(e){return this.#o.add(e),()=>this.#o.delete(e)}add(e){let t={parsed:Wd(e.keys),options:e,id:this.#n++};this.#t.push(t),this.#c(),e.target===`document`?this.#u():this.#l(),this.#h();let n=!1;return()=>{if(n)return;n=!0;let e=this.#t.indexOf(t);e!==-1&&this.#t.splice(e,1),this.#d(),this.#h()}}getAriaKeys(e){return this.getShortcut(e).aria}getShortcut(e,t){let n=this.#p(e,t);if(!n.length)return{};let r=n.flatMap(e=>e.parsed),i=n[n.length-1];return{aria:zd(r),shortcut:this.#m(i)}}destroy(){this.#s||(this.#s=!0,this.#r?.abort(),this.#r=null,this.#i?.abort(),this.#i=null,this.#t=[],this.#h(),this.#a.clear(),this.#o.clear())}#c(){this.#t.sort((e,t)=>{let n=t.parsed[0].modifiers.size-e.parsed[0].modifiers.size;return n===0?e.id-t.id:n})}#l(){this.#r||(this.#r=new AbortController,J(this.#e,`keydown`,this.#f,{signal:this.#r.signal}))}#u(){this.#i||(this.#i=new AbortController,J(document,`keydown`,this.#f,{signal:this.#i.signal}))}#d(){let e=this.#t.some(e=>e.options.target!==`document`),t=this.#t.some(e=>e.options.target===`document`);e||(this.#r?.abort(),this.#r=null),t||(this.#i?.abort(),this.#i=null)}#f=e=>{if(e.key===`Unidentified`||Hc(e)||e.defaultPrevented)return;let t=Rc(e);for(let n of this.#t){let{options:r,parsed:i}=n;if(!r.disabled&&!(e.repeat&&r.repeatable===!1)&&r.target===`document`==(e.currentTarget===document)){for(let n of i)if(Kd(n,e)&&!(t&&n.modifiers.size===0)){if(this.#a.size>0){let t={source:`hotkey`,action:r.action,value:r.value,event:e};for(let e of this.#a)try{e(t)}catch{}}e.preventDefault(),r.onActivate(e,n.originalKey);return}}}};#p(e,t){return this.#t.filter(n=>n.options.disabled||n.options.action!==e?!1:q(t)?!0:n.options.value===t).sort((e,t)=>e.id-t.id)}#m(e){return e.options.keys===`0-9`?e.options.keys:Bd(e.parsed[0])}#h(){for(let e of this.#o)e()}},Ud=new Set([`shift`,`ctrl`,`alt`,`meta`]);function Wd(e){if(e===`0-9`)return Array.from({length:10},(e,t)=>({modifiers:new Set,key:String(t),originalKey:String(t)}));let t=e.split(`+`),n=t.pop(),r=new Set;for(let e of t){let t=e.toLowerCase();t===`mod`?r.add(Uc()?`meta`:`ctrl`):Ud.has(t)&&r.add(t)}return[{modifiers:r,key:n===`Space`?` `:n.toLowerCase(),originalKey:n}]}function Gd(e){return e.length===1&&!/[a-z]/i.test(e)}function Kd(e,t){if(t.key===`Unidentified`||t.key.toLowerCase()!==e.key)return!1;let n=Gd(t.key),r=n?t.shiftKey&&e.modifiers.has(`shift`):t.shiftKey,i=n?t.altKey&&e.modifiers.has(`alt`):t.altKey;return r===e.modifiers.has(`shift`)&&t.ctrlKey===e.modifiers.has(`ctrl`)&&i===e.modifiers.has(`alt`)&&t.metaKey===e.modifiers.has(`meta`)}var qd=new WeakMap;function Jd(e){let t=qd.get(e);return t||(t=new Hd(e),qd.set(e,t)),t}function Yd(e,t){return Jd(e).add(t)}var Xd=[Xu,Qu,rd,vu,fd,ud,ad,yu,qu,Yu,id,Fu,cd,Iu];function Zd(e){let{transition:t}=e,n=t.state,r=new AbortController,i=null;function a(){if(r.signal.aborted)return null;let{active:e,status:i}=n.current;return e&&i!==`ending`?null:(i===`ending`&&t.cancel(),t.open())}function o(e){let{active:i,status:a}=n.current;return r.signal.aborted||!i||a===`ending`?null:t.close(e)}function s(){if(c(),typeof document>`u`)return;i=new AbortController;let{signal:t}=i;J(document,`keydown`,l,{signal:t}),e.onDocumentActive?.(t)}function c(){i?.abort(),i=null}function l(t){t.key===`Escape`&&(t.defaultPrevented||n.current.active&&(e.closeOnEscape?.()??!0)&&e.onEscapeDismiss(t))}let u=n.subscribe(()=>{n.current.active?s():c()});r.signal.addEventListener(`abort`,()=>{u(),t.destroy(),c()});function d(){r.signal.aborted||r.abort()}return{input:n,open:a,close:o,signal:r.signal,destroy:d}}function Qd(e){let{onOpenChange:t}=e,n=null,r=null,i=null,a=Zd({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.stopPropagation(),c()}}),o=a.input;function s(){r=document.activeElement;let i=a.open();i&&(t(!0),requestAnimationFrame(()=>{!a.signal.aborted&&o.current.active&&n?.focus()}),i.then(()=>{!a.signal.aborted&&o.current.active&&e.onOpenChangeComplete?.(!0)}))}function c(){let i=a.close(n);i&&(t(!1),i.then(()=>{a.signal.aborted||(r&&=(r.focus(),null),e.onOpenChangeComplete?.(!1))}))}function l(){if(u(),!n)return;i=new AbortController;let{signal:e}=i;J(n,`click`,d,{signal:e})}function u(){i?.abort(),i=null}function d(e){e.target instanceof HTMLButtonElement&&c()}function f(e){n=e,l()}return a.signal.addEventListener(`abort`,()=>{u(),n=null,r=null}),{input:o,open:s,close:c,setElement:f,destroy:a.destroy}}function $d(e){let{onActivate:t,isDisabled:n}=e;return{role:`button`,tabIndex:0,onClick(e){if(n()){e.preventDefault();return}t(e)},onPointerDown(e){n()&&e.preventDefault()},onMouseDown(e){n()&&e.preventDefault()},onKeyDown(e){if(e.target===e.currentTarget){if(n()){e.key!==`Tab`&&e.preventDefault();return}e.key===`Enter`?(e.preventDefault(),t(e)):e.key===` `&&e.preventDefault()}},onKeyUp(e){e.target===e.currentTarget&&(n()||e.key===` `&&t(e))}}}var ef=`group`;function tf(e){let t=Nc(e.ownerDocument);(!t||t===e.ownerDocument.body||!rl(e,t))&&e.focus({preventScroll:!0})}var nf={transitionStarting:`data-starting-style`,transitionEnding:`data-ending-style`};function rf(e){return{transitionStarting:e===`starting`,transitionEnding:e===`ending`}}function af(e){let{onOpenChange:t,closeOnOutsideClick:n}=e,r=null,i=null,a=null,o=new Set,s=!1,c=null,l=Zd({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.preventDefault(),x(`escape`,e)},onDocumentActive(e){J(document,`pointerdown`,w,{capture:!0,signal:e})}}),u=l.input,d={close(e){x(e)}};function f(){a!==null&&(clearTimeout(a),a=null)}function p(){return globalThis.matchMedia?.(`(hover: hover)`)?.matches??!1}function m(){return p()?globalThis.matchMedia?.(`(pointer: fine)`)?.matches??!1:!1}function h(){return!e.openOnHover?.()||p()}function g(){s=!1,c!==null&&(clearTimeout(c),c=null)}function _(){s=!0,c!==null&&clearTimeout(c),c=setTimeout(g,500)}function v(){return s?(g(),!0):!1}function y(){return r?r.hasAttribute(`disabled`)?!0:r.getAttribute(`aria-disabled`)===`true`:!1}function b(n,r){let i=l.open();i&&(e.group?.()?.open(d),t(!0,r?{reason:n,event:r}:{reason:n}),i.then(()=>{!l.signal.aborted&&u.current.active&&e.onOpenChangeComplete?.(!0)}))}function x(n,r){let a=l.close(i);a&&(e.group?.()?.close(d),t(!1,r?{reason:n,event:r}:{reason:n}),a.then(()=>{l.signal.aborted||(Yc(i),e.onOpenChangeComplete?.(!1))}))}function S(e=`click`){b(e)}function C(e=`click`){x(e)}function w(e){if(!n()||!u.current.active)return;let t=e.composedPath();if(r&&t.includes(r)||i&&t.includes(i)){_();return}g(),x(`outside-click`,e)}l.signal.addEventListener(`abort`,()=>{e.group?.()?.close(d),f(),g(),o.clear(),r=null,i=null});let T={onClick(e){h()&&(y()||(u.current.active&&u.current.status!==`ending`?x(`click`,e):b(`click`,e)))},onPointerEnter(t){if(!e.openOnHover?.()||!p()||(f(),u.current.active))return;let n=e.delay?.()??300;a=setTimeout(()=>b(`hover`),n)},onPointerLeave(t){if(!e.openOnHover?.()||!p()||(f(),!u.current.active))return;let n=e.closeDelay?.()??0;a=setTimeout(()=>x(`hover`),n)},onFocusIn(t){if(e.openOnHover?.()){if(!m())return;b(`focus`)}},onFocusOut(t){let n=t.relatedTarget;n&&(r?.contains(n)||i?.contains(n))||e.openOnHover?.()&&x(`blur`)}},E={onPointerEnter(t){e.openOnHover?.()&&f()},onPointerLeave(t){if(!e.openOnHover?.()||o.size>0||(f(),!u.current.active))return;let n=e.closeDelay?.()??0;a=setTimeout(()=>x(`hover`),n)},onGotPointerCapture(e){o.add(e.pointerId)},onLostPointerCapture(e){o.delete(e.pointerId)},onFocusOut(e){let t=e.relatedTarget;if(!(t&&(r?.contains(t)||i?.contains(t)))&&!v()){if(t!==null){x(`blur`);return}requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!u.current.active||u.current.status===`ending`||u.current.status===`starting`)return;let e=document.activeElement;e&&(r?.contains(e)||i?.contains(e))||x(`blur`)})})}}};function D(e){r=e}function O(e){!e&&i&&u.current.active&&Yc(i),i=e,e&&u.current.active&&Jc(e)}return{input:u,triggerProps:T,popupProps:E,get triggerElement(){return r},setTriggerElement:D,setPopupElement:O,open:S,close:C,destroy:l.destroy}}function of(e,t,n,r){let i=e+n,a=t+r;return{x:e,y:t,width:n,height:r,top:t,right:i,bottom:a,left:e,toJSON(){return{x:e,y:t,width:n,height:r,top:t,right:i,bottom:a,left:e}}}}function sf(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return of(n,r,Math.max(0,i-n),Math.max(0,a-r))}function cf(e){let t=document.documentElement.getBoundingClientRect();return e?sf(t,e.getBoundingClientRect()):t}function lf(e,t={}){if(!e)return null;if(!rc(e))return e;if(e===`viewport`)return null;if(e===`container`)return t.container??null;try{return(t.root??document).querySelector(e)}catch{return null}}var uf={sideOffset:`--media-popover-side-offset`,alignOffset:`--media-popover-align-offset`,boundaryOffset:`--media-popover-boundary-offset`,anchorWidth:`--media-popover-anchor-width`,anchorHeight:`--media-popover-anchor-height`,availableWidth:`--media-popover-available-width`,availableHeight:`--media-popover-available-height`};function df(e,t,n){return Math.max(t,Math.min(n,e))}function ff(e,t,n){let r=Math.round((e-n)/t)*t+n,i=`${t}`.indexOf(`.`);return i===-1?r:Number(r.toFixed(`${t}`.length-i-1))}var pf={sideOffset:0,alignOffset:0,boundaryOffset:0},mf={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function hf(e){return`${df(e,0,1/0)}px`}function gf(e,t,n,r){let i=n-r;return i<t?t:df(e,t,i)}function _f(e,t,n,r,i,a,o,s){let c=a===`start`?e+o:a===`end`?t+o:e+n/2+o,l=a===`start`?`0px`:a===`end`?`-100%`:`-50%`;return{base:`${c}px`,translate:`clamp(${r+s-c}px, ${l}, calc(${i-s-c}px - 100%))`}}function vf(e,t,n,r,i,a,o=uf){if(Pc())return{...yf(e,t,o,n,i,a),...n&&i?bf(n,i,t,a,o):{}};if(n&&r){let e=a??pf;return{position:`fixed`,margin:`0`,...xf(n,r,t,e,i),...i?bf(n,i,t,e,o):{}}}return{}}function yf(e,t,n=uf,r,i,a=pf){let o=`var(${n.sideOffset}, 0px)`,s=`var(${n.alignOffset}, 0px)`,{side:c,align:l}=t,u=a.boundaryOffset??0,d={positionAnchor:`--${e}`,position:`fixed`,inset:`auto`,margin:`0`,justifySelf:`normal`,alignSelf:`normal`,marginInlineStart:`0`,marginBlockStart:`0`,translate:`none`},f=mf[c];if(c===`top`||c===`bottom`){if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=_f(r.left,r.right,r.width,i.left,i.right,l,a.alignOffset,u);return d.left=e,d.translate=`${t} 0`,d}l===`start`?d.left=`calc(anchor(left) + ${s})`:l===`end`?d.right=`calc(anchor(right) + ${s})`:(d.justifySelf=`anchor-center`,d.marginInlineStart=s)}else{if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=_f(r.top,r.bottom,r.height,i.top,i.bottom,l,a.alignOffset,u);return d.top=e,d.translate=`0 ${t}`,d}l===`start`?d.top=`calc(anchor(top) + ${s})`:l===`end`?d.bottom=`calc(anchor(bottom) + ${s})`:(d.alignSelf=`anchor-center`,d.marginBlockStart=s)}return d}function bf(e,t,n,r=pf,i=uf){let a={},{side:o}=n,s=r.boundaryOffset??0,c=t.left+s,l=t.right-s,u=t.top+s,d=t.bottom-s;if(a[i.anchorWidth]=`${e.width}px`,a[i.anchorHeight]=`${e.height}px`,o===`top`||o===`bottom`){let t=o===`top`?e.top-u:d-e.bottom;a[i.availableHeight]=hf(t-r.sideOffset),a[i.availableWidth]=hf(l-c)}else{let t=o===`left`?e.left-c:l-e.right;a[i.availableWidth]=hf(t-r.sideOffset),a[i.availableHeight]=hf(d-u)}return a}function xf(e,t,n,r={sideOffset:0,alignOffset:0},i){let{side:a,align:o}=n,{sideOffset:s,alignOffset:c}=r,l=0,u,d=0,f;if(a===`top`?u=`calc(100% - ${e.top}px + ${s}px)`:a===`bottom`?l=e.bottom+s:a===`left`?f=`calc(100% - ${e.left}px + ${s}px)`:d=e.right+s,a===`top`||a===`bottom`?d=o===`start`?e.left+c:o===`end`?e.right-t.width+c:e.left+(e.width-t.width)/2+c:l=o===`start`?e.top+c:o===`end`?e.bottom-t.height+c:e.top+(e.height-t.height)/2+c,i){let e=r.boundaryOffset??0;a===`top`||a===`bottom`?d=gf(d,i.left+e,i.right-e,t.width):l=gf(l,i.top+e,i.bottom-e,t.height)}return{top:a===`top`?`auto`:`${l}px`,bottom:u??`auto`,left:a===`left`?`auto`:`${d}px`,right:f??`auto`}}function Sf(e,t=uf){let n=getComputedStyle(e);return{sideOffset:Zc(e,n.getPropertyValue(t.sideOffset)),alignOffset:Zc(e,n.getPropertyValue(t.alignOffset)),boundaryOffset:Zc(e,n.getPropertyValue(t.boundaryOffset))}}function Cf(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width,i=e.offsetHeight||n.height;return of(n.left,n.top,t===`left`||t===`right`?Math.max(r,e.scrollWidth):r,t===`top`||t===`bottom`?Math.max(i,e.scrollHeight):i)}function wf(){let e=null;return{open(t){e!==t&&(e?.close(`group-open`),e=t)},close(t){e===t&&(e=null)}}}function Tf(e,t,n,r){let i;return i=n===`vertical`?1-(e.clientY-t.top)/t.height:r?(t.right-e.clientX)/t.width:(e.clientX-t.left)/t.width,Number.isFinite(i)?df(i*100,0,100):0}function Ef(e){let t=Wl({pointerPercent:0,dragPercent:0,dragging:!1,pointing:!1,focused:!1}),n=new AbortController,r=e.changeThrottle??0,i=!1,a=!1,o=null,s=null,c=0,l=!1,u=r>0?fl(t=>e.onValueChange?.(t),r,{leading:!0}):null;function d(t,n){n&&u?u(t):e.onValueChange?.(t)}function f(){if(ac(s))return;let t=s;s=null;try{e.getElement().releasePointerCapture(t)}catch{}}function p(){i?(l||e.onValueCommit?.(c),i=!1,t.patch({dragging:!1,pointing:!1}),e.onDragEnd?.()):t.patch({pointing:!1}),l=!1,m()}function m(){u?.cancel(),s=null,o=null}let h={onPointerDown(n){if(e.isDisabled())return;n.stopPropagation(),n.preventDefault();let r=e.getElement();o=r.getBoundingClientRect(),a=e.isRTL(),l=!1,f(),s=n.pointerId,r.setPointerCapture(n.pointerId);let u=Tf(n,o,e.getOrientation(),a);i=!0,c=u,t.patch({pointing:!0,dragging:!0,pointerPercent:u,dragPercent:u}),e.onDragStart?.(),e.onValueChange?.(u),e.getThumbElement?.()?.focus({preventScroll:!0,focusVisible:!1})},onPointerMove(n){if(e.isDisabled())return;if(!ac(s)){if(n.pointerType!==`touch`&&n.buttons===0){p();return}let r=Tf(n,o,e.getOrientation(),a);c=r,t.patch({dragPercent:r,pointerPercent:r}),d(r,!0);return}let r=Tf(n,e.getElement().getBoundingClientRect(),e.getOrientation(),e.isRTL());t.patch({pointing:!0,pointerPercent:r})},onPointerUp(t){if(e.isDisabled()||(t.stopPropagation(),ac(s)))return;let n=Tf(t,o,e.getOrientation(),a);u?.cancel(),e.onValueChange?.(n),e.onValueCommit?.(n),l=!0},onPointerLeave(){ac(s)&&t.patch({pointing:!1})},onLostPointerCapture(){p()}},g={onKeyDown(n){if(e.isDisabled()){n.key!==`Tab`&&n.preventDefault();return}let r=e.getStepPercent(),i=e.getLargeStepPercent(),a=ff(e.getPercent(),r,0),o=e.isRTL()?-1:1,s=n.shiftKey?i:r,c=null;switch(n.key){case`ArrowRight`:c=a+s*o;break;case`ArrowLeft`:c=a-s*o;break;case`ArrowUp`:c=a+s;break;case`ArrowDown`:c=a-s;break;case`PageUp`:c=a+i;break;case`PageDown`:c=a-i;break;case`Home`:c=0;break;case`End`:c=100}c!==null&&(n.preventDefault(),c=df(c,0,100),t.patch({pointerPercent:c,dragPercent:c}),e.onValueChange?.(c),e.onValueCommit?.(c))},onFocus(){t.patch({focused:!0})},onBlur(){t.patch({focused:!1})}};function _(t){if(!e.adjustPercent||t.thumbAlignment!==`edge`)return t;let n=e.getElement(),r=e.getThumbElement?.();if(!r)return t;let i=t.orientation===`horizontal`,a=i?r.offsetWidth:r.offsetHeight,o=i?n.offsetWidth:n.offsetHeight;return{...t,fillPercent:e.adjustPercent(t.fillPercent,a,o),pointerPercent:e.adjustPercent(t.pointerPercent,a,o)}}let v=null;return e.onResize&&(v=new ResizeObserver(()=>e.onResize()),v.observe(e.getElement())),{input:t,rootProps:h,rootStyle:{touchAction:`none`,userSelect:`none`},thumbProps:g,adjustForAlignment:_,destroy(){n.signal.aborted||(n.abort(),v?.disconnect(),f(),m())}}}var Df={fill:`--media-slider-fill`,pointer:`--media-slider-pointer`,buffer:`--media-slider-buffer`};function Of(e){return{[Df.fill]:`${e.fillPercent.toFixed(3)}%`,[Df.pointer]:`${e.pointerPercent.toFixed(3)}%`}}function kf(e){return{...Of(e),[Df.buffer]:`${e.bufferPercent.toFixed(3)}%`}}function Af(e,t){let n=e/2;return{position:`absolute`,left:t===`visible`?`calc(var(${Df.pointer}) - ${n}px)`:`min(max(0px, calc(var(${Df.pointer}) - ${n}px)), calc(100% - ${e}px))`,width:`max-content`,pointerEvents:`none`}}var jf=class{findActiveThumbnail(e,t){if(e.length===0)return;let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1,o=e[a];t>=o.startTime?(i=o,n=a+1):r=a-1}return i}parseConstraints(e){let t=parseFloat(e.minWidth),n=parseFloat(e.maxWidth),r=parseFloat(e.minHeight),i=parseFloat(e.maxHeight);return{minWidth:Number.isFinite(t)?t:0,maxWidth:Number.isFinite(n)?n:1/0,minHeight:Number.isFinite(r)?r:0,maxHeight:Number.isFinite(i)?i:1/0}}calculateScale(e,t,n){let{minWidth:r,maxWidth:i,minHeight:a,maxHeight:o}=n,s=Math.min(i/e,o/t),c=Math.max(r/e,a/t);return Number.isFinite(s)&&s<1?s:Number.isFinite(c)&&c>1?c:1}resize(e,t,n,r){let i=e.width??t,a=e.height??n;if(!i||!a)return;let o=this.calculateScale(i,a,r),s=e.coords?.x??0,c=e.coords?.y??0,l=o===1?0:1;return{scale:o,containerWidth:Math.max(0,Math.floor(i*o)-l*2),containerHeight:Math.max(0,Math.floor(a*o)-l*2),imageWidth:Math.ceil(t*o),imageHeight:Math.ceil(n*o),offsetX:Math.ceil(s*o)+l,offsetY:Math.ceil(c*o)+l}}getState(e,t,n){return{loading:e,error:t,hidden:!e&&!n}}getAttrs(e){return{role:`img`,"aria-hidden":`true`}}};function Mf(e){let{getContainer:t,getImg:n,onStateChange:r}=e,i=new jf,a=new AbortController,o=a.signal,s=!1,c=!1,l=0,u=0,d=``,f=!1,p=null;function m(){let e=n();e&&(l=e.naturalWidth,u=e.naturalHeight),s=!1,c=!1,r()}function h(){s=!1,c=!0,r()}function g(e){J(e,`load`,m,{signal:o}),J(e,`error`,h,{signal:o})}function _(){if(!f){let e=n();e&&(g(e),f=!0)}if(!p){let e=t();e&&(p=new ResizeObserver(r),p.observe(e))}}function v(e){_();let t=e??``;t!==d&&(d=t,t?(s=!0,c=!1):(s=!1,c=!1,l=0,u=0))}function y(){_();let e=n();e?.complete&&d&&(e.naturalWidth>0?(l=e.naturalWidth,u=e.naturalHeight,s=!1,c=!1):(s=!1,c=!0),r())}function b(){a.abort(),p?.disconnect(),p=null}return{get loading(){return s},get error(){return c},get naturalWidth(){return l},get naturalHeight(){return u},readConstraints(){let e=t();return e?i.parseConstraints(getComputedStyle(e)):{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0}},updateSrc:v,connect:y,destroy:b}}var Nf={hover:`hover`,focus:`focus`,escape:`escape`,blur:`blur`,"imperative-action":`imperative-action`};function Pf(e){let t={transition:e.transition,onOpenChange(t,n){let r=Nf[n.reason];if(!r)return;let i=e.group?.();t?i?.notifyOpen():i?.notifyClose();let a=n.event?{reason:r,event:n.event}:{reason:r};e.onOpenChange(t,a)},closeOnEscape:()=>!0,closeOnOutsideClick:()=>!1,openOnHover:()=>!0,delay:()=>{let t=e.group?.();return t?.shouldSkipDelay()?0:e.delay?.()??t?.delay??600},closeDelay:()=>{let t=e.group?.();return e.closeDelay?.()??t?.closeDelay??0}};e.onOpenChangeComplete&&(t.onOpenChangeComplete=e.onOpenChangeComplete);let n=af(t),r=!1,{onClick:i,...a}=n.triggerProps,o={...a,onPointerDown(){r=!0},onPointerEnter(t){e.disabled?.()||t.pointerType!==`touch`&&a.onPointerEnter(t)},onFocusIn(t){if(!e.disabled?.()){if(r){r=!1;return}a.onFocusIn(t)}}},s={...n.popupProps,onPointerEnter(t){e.disableHoverablePopup?.()||n.popupProps.onPointerEnter(t)}};return{...n,triggerProps:o,popupProps:s,get triggerElement(){return n.triggerElement},open:()=>n.open(`hover`),close:(e=`hover`)=>n.close(e)}}function Ff(){let e=Wl({active:!1,status:`idle`}),t=!1,n=0,r=0;function i(i=null){cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0;let a=e.current.active;return a&&e.patch({status:`idle`}),e.patch({active:!0,status:`starting`}),new Promise(o=>{n=requestAnimationFrame(()=>{n=0,a&&(Lf(i),If(i)),r=requestAnimationFrame(()=>{if(r=0,t||!e.current.active)return o();e.patch({status:`idle`}),o()})})})}function a(i){return cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0,e.patch({status:`ending`}),new Promise(a=>{n=requestAnimationFrame(()=>{n=0,r=requestAnimationFrame(()=>{if(r=0,t)return a();Rf(i).finally(()=>{if(t||e.current.status!==`ending`)return a();e.patch({active:!1,status:`idle`}),a()})})})})}function o(){cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0,e.current.status!==`idle`&&e.patch({status:`idle`})}return{state:e,open:i,close:a,cancel:o,destroy(){t||(t=!0,o())}}}function If(e){e&&e.offsetHeight}function Lf(e){let t=e?.getAnimations?.({subtree:!0})??[];for(let e of t)e.cancel()}function Rf(e){if(!e)return Promise.resolve();let t=e.getAnimations?.()??[];return t.length===0?Promise.resolve():Promise.all(t.map(e=>e.finished)).then(dl,dl)}function zf(e){return{onWheel(t){if(e.isDisabled())return;let n=Math.sign(t.deltaY);if(n===0)return;t.preventDefault();let r=e.getStepPercent(),i=df(e.getPercent()-n*r,0,100);e.onValueChange?.(i)}}}function Bf(e,t){if(!t)return!1;if(K(e.composedPath))return e.composedPath().includes(t);let n=e.target;return n instanceof Node&&t.contains(n)}function Vf(e,t){let n={};for(let r in e){if(t&&!(r in t))continue;let i=t?.[r]??Hf(r),a=e[r];a===!0?n[i]=``:a&&(n[i]=String(a))}return n}function Hf(e){return`data-${e.toLowerCase()}`}var Uf={key:`container.label`,text:`Media player`};c();var Wf=a(function({children:e,tabIndex:t=0,role:n=ef,"aria-label":r,"aria-labelledby":i,...a},o){let c=Ol(),l=Oc(),u=O(null),d=cl(o,u);g(()=>(c?.(u.current),()=>c?.(null)),[c]);let f=e=>{a.onPointerUp?.(e);let t=u.current;t&&tf(t)};return s(`div`,{ref:d,role:n,tabIndex:t,...r!==void 0||i!==void 0?{"aria-label":r,"aria-labelledby":i}:{"aria-label":l(Uf)},...a,onPointerUp:f,children:e})});c();function Y(e){let t=O(e);return t.current=e,t}c();function Gf(e,t,n){let r=O(null),i=Y(t),a=Y(n);g(()=>(r.current===null?i.current?.():(clearTimeout(r.current),r.current=null),()=>{r.current=setTimeout(()=>{a.current?.(),e.destroy()},0)}),[e])}c();function Kf(e){function t({children:t}){let[n,r]=M(()=>Kl()(jl(...e.features))),[i]=M(()=>wf()),[a,o]=M(null),[c,l]=M(null);return Gf(n),g(()=>{if(a){if(n.destroyed){r(Kl()(jl(...e.features)));return}return n.attach({media:a,container:c})}},[a,c,n]),s(yl,{value:P(()=>({store:n,media:a,setMedia:o,container:c,setContainer:l,popupGroup:i}),[n,a,c,i]),children:t})}function n(e){let{store:t}=bl();return hl(t,e)}return{Provider:t,Container:Wf,usePlayer:n,useMedia:Cl}}function qf(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90}function Jf(e,t){return qf(e)&&(typeof t==`function`||t===void 0)}function Yf(e,t){return t?e?n=>{t(n),e(n)}:t:e}function Xf(e,t){return t&&e?`${t} ${e}`:t||e}function Zf(e,t){return t?e?{...e,...t}:t:e}function Qf(e,t){if(!t)return e;for(let n in t){let r=t[n];n===`className`?e.className=Xf(e.className,r):n===`style`?e.style=Zf(e.style,r):e[n]=Jf(n,r)?Yf(e[n],r):r}return e}function $f(...e){let t={};for(let n of e)t=Qf(t,n);return t}c();function ep(e,t){return K(e)?e(t):e}function tp(e,t){return K(e)?e(t):e}function np(e){let t=e;return t.ref??t.props?.ref}function X(t,n,r){let{className:i,style:a,render:o}=n,{state:s,ref:c,props:l,stateAttrMap:u}=r,d=ep(i,s),f=tp(a,s),p=$f(u?Vf(s,u):{},...Array.isArray(l)?l:l?[l]:[]);if(d!==void 0&&(p.className=p.className?`${p.className} ${d}`:d),f!==void 0&&(p.style=p.style?{...p.style,...f}:f),K(o)){let e=sl(c,p.ref);return o({...p,ref:e},s)}if(e(o)){let e=np(o),t=sl(c,p.ref,e),n=$f(p,o.props);return n.ref=t,m(o,n)}return p.ref=sl(c,p.ref),D(t,p)}c();function rp(e){let{displayName:t,onActivate:n,isDisabled:r}=e,i=k(e=>{},[t]);return{getButtonProps:k(e=>$f($d({onActivate:n,isDisabled:r}),e),[n,r]),buttonRef:i}}c();function ip(e,t){let n=wl(),[r,i]=M({});return g(()=>{if(!n||!e){i({});return}let r=Jd(n),a=()=>i(r.getShortcut(e,t));return a(),r.subscribeShortcutChanges(a)},[n,e,t]),r}c(),j(null).Provider,j(null).Provider,j(null).Provider,j(null).Provider;var ap=j(!1);ap.Provider;function op(){return E(ap)}j(null).Provider,c();var sp=j(null),cp=sp.Provider;function lp(){let e=E(sp);if(!e)throw Error(`Tooltip compound components must be used within a Tooltip.Root`);return e}function up(){return E(sp)}c();function dp(e,t){return e.getLabelParams?.(t)}function fp(e){let{displayName:t,core:n,stateAttrMap:r,selector:i,action:o,hotkeyAction:s,hotkeyValue:c,tooltipLabel:l,isSupported:u}=e,d=new Set(Object.keys(n.defaultProps)),f=a(function(e,a){let{render:f,className:p,style:m,...h}=e,g={},_={};for(let e of Object.keys(h))d.has(e)?g[e]=h[e]:_[e]=h[e];let v=up(),y=op(),b=v?.setContent,x=xl(i),S=ip(s,c?.(g)),C=Oc(),[w]=M(()=>new n);d.has(`menuTrigger`)&&q(g.menuTrigger)&&(g.menuTrigger=y),w.setProps(g);let{getButtonProps:T,buttonRef:E}=rp({displayName:t,onActivate:()=>{Promise.resolve(o(w,x)).catch(e=>{})},isDisabled:()=>!!g.disabled||!x});x&&w.setMedia(x);let D=x?w.getState():null,O=D?u?.(D)??!0:!1,k=D&&O?Tc(w.getLabel(D),C,dp(w,D)):void 0,A=D&&O?l?.(w,D)??k:void 0;if(N(()=>{if(b)return b(A?{label:A,shortcut:S.shortcut}:void 0),()=>b(void 0)},[b,A,S.shortcut]),!x||!D||!O)return null;let j=w.getAttrs(D),ee=j[`aria-label`],te={...j,...Sc(ee)?{"aria-label":Tc(ee,C,dp(w,D))}:void 0,"aria-keyshortcuts":S.aria};return X(`button`,{render:f,className:p,style:m},{state:D,stateAttrMap:r,ref:[a,E],props:[T(),te,_]})});return f.displayName=t,f}function pp(e,t){return K(e)?e(t)||void 0:e||void 0}var mp=class{static defaultProps={open:!1,defaultOpen:!1};setProps(e){}#e=null;#t=void 0;#n=void 0;setInput(e){this.#e=e}setTitleId(e){this.#t=e}setDescriptionId(e){this.#n=e}getState(){let e=this.#e;return{open:e.active,status:e.status,titleId:this.#t,descriptionId:this.#n,...rf(e.status)}}getAttrs(e){return{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":e.titleId,"aria-describedby":e.descriptionId}}},hp={open:`data-open`,...nf},gp=class e{static defaultProps={delay:500};state=Wl({visible:!1});#e={...e.defaultProps};#t=null;setProps(t){this.#e=sc(t,e.defaultProps)}destroy(){this.#n()}update(e){let t=e.waiting&&!e.paused;t&&!this.state.current.visible&&!this.#t?this.#t=setTimeout(()=>{this.#t=null,this.state.patch({visible:!0})},this.#e.delay):t||(this.#n(),this.state.patch({visible:!1}))}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}},_p={visible:`data-visible`},vp=class{#e=null;setMedia(e){this.#e=e}getState(){let e=this.#e;return{visible:e.controlsVisible,userActive:e.userActive}}},yp={visible:`data-visible`,userActive:`data-user-active`},bp=class extends mp{setProps(){}},xp=`common.`,Sp={key:`${xp}empty`,text:``},Cp={key:`${xp}ok`,text:`OK`},wp=`errors.`,Tp={key:`${wp}aborted`,text:`You stopped media playback before it finished.`},Ep={key:`${wp}network`,text:`This media could not be loaded due to a network or server issue.`},Dp={key:`${wp}decode`,text:`This media could not be played. It may be corrupted, or your browser may not support its format.`},Op={key:`${wp}source`,text:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`},kp={key:`${wp}encrypted`,text:`This media could not be played because it could not be decrypted.`},Ap={key:`${wp}title`,text:`Something went wrong.`},jp={key:`${wp}unexpected`,text:`An unexpected error occurred.`},Mp={[Ql.MEDIA_ERR_ABORTED]:Tp,[Ql.MEDIA_ERR_NETWORK]:Ep,[Ql.MEDIA_ERR_DECODE]:Dp,[Ql.MEDIA_ERR_SRC_NOT_SUPPORTED]:Op,[Ql.MEDIA_ERR_ENCRYPTED]:kp,[Ql.MEDIA_ERR_CUSTOM]:Sp},Np={[Ql.MEDIA_ERR_SRC_NOT_SUPPORTED]:[`Failed to open media`]};function Pp(e){return e>=Ql.MEDIA_ERR_ABORTED&&e<=Ql.MEDIA_ERR_ENCRYPTED}function Fp(){return Ap}function Ip(){return Cp}function Lp(e,t){if(e){let t=Mp[e.code],n=e.message?.trim();if(n){let r=Ql.defaultMessages[e.code];if(t&&r&&n===r)return t;let i=Np[e.code];return t&&Pp(e.code)&&!e.context&&i?.includes(n)?t:n}if(t)return t}return t?.trim()||jp}var Rp=`fullscreen.`,zp={key:`${Rp}enter`,text:`Enter fullscreen`},Bp={key:`${Rp}exit`,text:`Exit fullscreen`},Vp=class e{static defaultProps={label:``,disabled:!1};state=Wl({fullscreen:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}getLabel(e){return pp(this.#e.label,e)||(e.fullscreen?Bp:zp)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":e.disabled?`true`:void 0,hidden:e.hidden?``:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=e.fullscreenAvailability;return this.state.patch({fullscreen:e.fullscreen,availability:t,disabled:this.#e.disabled||t!==`available`,hidden:t!==`available`}),this.state.patch({label:xc(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(this.setMedia(e),!this.getState().disabled)return e.fullscreen?e.exitFullscreen():e.requestFullscreen()}},Hp={fullscreen:`data-fullscreen`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},Up={key:`playback.rate`,text:`Playback rate {rate}`},Wp=`volume.`,Gp={key:`${Wp}mutedValue`,text:`{percent}, muted`};`${Wp}`;var Kp={key:`${Wp}label`,text:`Volume`};`${Wp}`;var qp=Intl.DurationFormat,Jp=new Map;function Yp(e,t){if(e===`digital`){let e=e=>String(e).padStart(2,`0`);return{format:n=>{let r=`${e(n.minutes??0)}:${e(n.seconds??0)}`;return t===`always`||n.hours!==void 0?`${n.hours??0}:${r}`:r}}}let n=[[`hours`,`hour`],[`minutes`,`minute`],[`seconds`,`second`]];return{format:e=>n.filter(([t])=>e[t]!==void 0).map(([t,n])=>{let r=e[t]??0;return`${r} ${n}${r===1?``:`s`}`}).join(`, `)}}function Xp(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function Zp(e){let t=Array.isArray(e)?e[0]:e;return!t||t===`en`||t.startsWith(`en-`)}function Qp(e,t=`long`,n){let r=`${Xp(e)}:${t}:${n??``}`,i=Jp.get(r);return i||(i=qp?new qp(e,n===void 0?{style:t}:{style:t,hoursDisplay:n}):Yp(t,n),Jp.set(r,i)),i}function $p(e){return ic(e)&&Number.isFinite(e)}function em(e,t){if(!$p(e))return`0:00`;let n=e<0,r=Math.floor(Math.abs(e)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s=$p(t??0)?Math.abs(t??0):0,c=Math.floor(s/3600),l=Math.floor(s/60%60),u=i>0||c>0,d=u||l>=10,f=u?{hours:i,minutes:a,seconds:o}:{minutes:a,seconds:o},p=Qp(`en`,`digital`,u?`always`:`auto`).format(f);return d||(p=p.replace(/^0(?=\d:)/,``)),`${n?`-`:``}${p}`}function tm(e){if(!$p(e))return`PT0S`;let t=Math.abs(e),n=Math.floor(t/3600),r=Math.floor(t/60%60),i=Math.floor(t%60),a=`PT`;return n>0&&(a+=`${n}H`),r>0&&(a+=`${r}M`),(i>0||a===`PT`)&&(a+=`${i}S`),a}function nm(e,t){if(!$p(e))return``;let n=e<0,r=Math.floor(Math.abs(e)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s={};i>0&&(s.hours=i),a>0&&(s.minutes=a),(o>0||i===0&&a===0)&&(s.seconds=o);let c=Qp(t?.locale,t?.style??`long`).format(s);if(n){let e=t?.formatRemaining;return e?e(c):Zp(t?.locale)?`${c} remaining`:c}return c}var rm=`buttons.`,im={key:`${rm}play`,text:`Play`},am={key:`${rm}pause`,text:`Pause`},om={key:`${rm}replay`,text:`Replay`},sm={key:`${rm}mute`,text:`Mute`},cm={key:`${rm}unmute`,text:`Unmute`},lm=class e{static defaultProps={label:``,disabled:!1};state=Wl({muted:!1,volumeLevel:`off`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}getLabel(e){return pp(this.#e.label,e)||(e.muted?cm:sm)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({muted:e.muted||e.volume===0,volumeLevel:um(e)}),this.state.patch({label:xc(this.getLabel(this.state.current))}),this.state.current}toggle(e){this.#e.disabled||e.toggleMuted()}};function um(e){return e.muted||e.volume===0?`off`:e.volume<.5?`low`:e.volume<.75?`medium`:`high`}var dm={muted:`data-muted`,volumeLevel:`data-volume-level`},fm=`pip.`,pm={key:`${fm}enter`,text:`Enter picture-in-picture`},mm={key:`${fm}exit`,text:`Exit picture-in-picture`},hm=class e{static defaultProps={label:``,disabled:!1};state=Wl({pip:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}getLabel(e){return pp(this.#e.label,e)||(e.pip?mm:pm)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":e.disabled?`true`:void 0,hidden:e.hidden?``:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=e.pipAvailability;return this.state.patch({pip:e.pip,availability:t,disabled:this.#e.disabled||t!==`available`,hidden:t!==`available`}),this.state.patch({label:xc(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(this.setMedia(e),!this.getState().disabled)return e.pip?e.exitPictureInPicture():e.requestPictureInPicture()}},gm={pip:`data-pip`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},_m=class e{static defaultProps={label:``,disabled:!1};state=Wl({paused:!0,ended:!1,started:!1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}getLabel(e){return pp(this.#e.label,e)||(e.ended?om:e.paused?im:am)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({paused:e.paused,ended:e.ended,started:e.started}),this.state.patch({label:xc(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(!this.#e.disabled){if(e.paused||e.ended)return e.play();e.pause()}}},vm={paused:`data-paused`,ended:`data-ended`,started:`data-started`},ym=class e{static defaultProps={label:``,disabled:!1,menuTrigger:!1};state=Wl({rate:1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}getLabel(e){let t=pp(this.#e.label,e);return t===void 0?Up:t}getLabelParams(e){if(pp(this.#e.label,e)===void 0)return{rate:e.rate}}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({rate:e.playbackRate}),this.state.patch({label:xc(this.getLabel(this.state.current))}),this.state.current}cycle(e){if(this.#e.disabled||this.#e.menuTrigger)return;let{playbackRates:t,playbackRate:n}=e;if(t.length===0)return;let r=t.indexOf(n),i=r===-1?t.find(e=>e>n)??t[0]:t[(r+1)%t.length];e.setPlaybackRate(i)}},bm={rate:`data-rate`},xm=class e{static defaultProps={side:`top`,align:`center`,modal:!1,closeOnEscape:!0,closeOnOutsideClick:!0,open:!1,defaultOpen:!1,openOnHover:!1,delay:300,closeDelay:0};#e={...e.defaultProps};constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}#t=null;setInput(e){this.#t=e}getState(){let e=this.#t;return{open:e.active,status:e.status,side:this.#e.side,align:this.#e.align,modal:this.#e.modal,...rf(e.status)}}getTriggerAttrs(e,t){return{"aria-expanded":e.open&&e.status!==`ending`?`true`:`false`,"aria-haspopup":`dialog`,"aria-controls":t}}getPopupAttrs(e){return{popover:`manual`,role:`dialog`,"aria-modal":e.modal===!0?`true`:void 0}}},Sm={open:`data-open`,side:`data-side`,align:`data-align`,...nf},Cm=`seek.`,wm={key:`${Cm}forward`,text:`Seek forward {seconds} seconds`},Tm={key:`${Cm}backward`,text:`Seek backward {seconds} seconds`},Em=class e{static defaultProps={seconds:30,label:``,disabled:!1};state=Wl({seeking:!1,direction:`forward`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}getLabel(e){let t=pp(this.#e.label,e);return t===void 0?e.direction===`backward`?Tm:wm:t}getLabelParams(e){if(pp(this.#e.label,e)===void 0)return{seconds:Math.abs(this.#e.seconds)}}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=this.#e.seconds<0?`backward`:`forward`;return this.state.patch({seeking:e.seeking,direction:t}),this.state.patch({label:xc(this.getLabel(this.state.current))}),this.state.current}async seek(e){this.#e.disabled||await e.seek(e.currentTime+this.#e.seconds)}},Dm={seeking:`data-seeking`,direction:`data-direction`},Om=class e{static defaultProps={label:``,step:1,largeStep:10,orientation:`horizontal`,disabled:!1,thumbAlignment:`center`,value:0,min:0,max:100};static defaultInput={pointerPercent:0,dragPercent:0,dragging:!1,pointing:!1,focused:!1};#e={...e.defaultProps};#t={...e.defaultInput};get props(){return this.#e}get input(){return this.#t}constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}setInput(e){this.#t=e}getSliderState(e){let{orientation:t,disabled:n,thumbAlignment:r}=this.#e,{pointerPercent:i,dragging:a,pointing:o,focused:s}=this.#t;return{value:e,fillPercent:this.percentFromValue(e),pointerPercent:i,dragging:a,pointing:o,interactive:a||o||s,orientation:t,disabled:n,thumbAlignment:r}}getLabel(e){return pp(this.#e.label,e)||``}getAttrs(e){return{role:`slider`,tabIndex:e.disabled?-1:0,autoComplete:`off`,"aria-label":this.getLabel(e),"aria-valuemin":this.#e.min,"aria-valuemax":this.#e.max,"aria-valuenow":e.value,"aria-orientation":e.orientation,"aria-disabled":e.disabled?`true`:void 0}}valueFromPercent(e){let{min:t,max:n,step:r}=this.#e;return ff(df(t+e/100*(n-t),t,n),r,t)}rawValueFromPercent(e){let{min:t,max:n}=this.#e;return df(t+e/100*(n-t),t,n)}percentFromValue(e){let{min:t,max:n}=this.#e;return n===t?0:(e-t)/(n-t)*100}getStepPercent(){let{step:e,min:t,max:n}=this.#e,r=n-t;return r>0?e/r*100:0}getLargeStepPercent(){let{largeStep:e,min:t,max:n}=this.#e,r=n-t;return r>0?e/r*100:0}adjustPercentForAlignment(e,t,n){if(this.#e.thumbAlignment===`center`||n===0)return e;let r=t/n*100/2,i=r,a=100-r;return i+e/100*(a-i)}},km={dragging:`data-dragging`,pointing:`data-pointing`,interactive:`data-interactive`,orientation:`data-orientation`,disabled:`data-disabled`},Am={loading:`data-loading`,error:`data-error`,hidden:`data-hidden`};function jm(e,t){let n=e.trim().split(`#`),r=n[0]??``,i=n[1],a=t?new URL(r,t).href:r;if(!i)return{url:a};let o=i.indexOf(`=`);if(o===-1)return{url:a};let s=i.slice(0,o),c=i.slice(o+1).split(`,`).map(Number),l={};for(let e=0;e<s.length;e++){let t=s[e],n=c[e];t&&ic(n)&&!Number.isNaN(n)&&(l[t]=n)}let u={url:a};return ic(l.w)&&(u.width=l.w),ic(l.h)&&(u.height=l.h),ic(l.x)&&ic(l.y)&&(u.coords={x:l.x,y:l.y}),u}function Mm(e,t){let n=[];for(let r of e){let e=jm(r.text,t),i={url:e.url,startTime:r.startTime,endTime:r.endTime};e.width&&(i.width=e.width),e.height&&(i.height=e.height),e.coords&&(i.coords=e.coords),n.push(i)}return n}var Nm=`time.`,Pm={key:`${Nm}current`,text:`Current time`},Fm={key:`${Nm}duration`,text:`Duration`},Im={key:`${Nm}remaining`,text:`Remaining`},Lm={key:`${Nm}remainingSuffix`,text:`{duration} remaining`},Rm={key:`${Nm}showElapsed`,text:`{duration}. Show elapsed time.`},zm={key:`${Nm}showDuration`,text:`{duration}. Show duration.`},Bm={key:`${Nm}showRemaining`,text:`{duration}. Show remaining time.`},Vm={key:`${Nm}position`,text:`{current} of {duration}`},Hm={current:Rm,duration:zm,remaining:Bm},Um={current:Pm,duration:Fm,remaining:Im},Wm=class e{static defaultProps={type:`current`,negativeSign:`-`,label:``,toggle:!1};#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}setMedia(e){this.#t=e}#n(){let e=this.#t,{type:t}=this.#e;switch(t){case`current`:return e.currentTime;case`duration`:return e.duration;case`remaining`:return e.currentTime-e.duration;default:return 0}}#r(){let e=this.#t,t=this.#n();return em(Math.abs(t),e.duration)}#i(){let{type:e}=this.#e,t=this.#n();return nm(e===`remaining`?t<0?t:-Math.abs(t):t)}#a(){let e=this.#n();return tm(Math.abs(e))}#o(e,t){return e===`current`?t===`remaining`?`current`:`remaining`:t===`duration`?`remaining`:`duration`}getLabel(e,t=this.#e.type){let n=pp(this.#e.label,e);return n===void 0?this.#e.toggle?Hm[this.#o(t,e.type)]:Um[this.#e.type]:n}getLabelParams(e){return pp(this.#e.label,e)===void 0&&this.#e.toggle?{duration:e.phrase}:void 0}getAttrs(e,t=this.#e.type){return{"aria-label":this.getLabel(e,t),role:this.#e.toggle?`button`:void 0,tabIndex:this.#e.toggle?0:void 0}}getState(){let e=this.#n();return{type:this.#e.type,seconds:e,negative:this.#e.type===`remaining`&&e<0,text:this.#r(),phrase:this.#i(),datetime:this.#a()}}},Gm={type:`data-type`},Km={key:`slider.seek`,text:`Seek`},qm=class e extends Om{static defaultProps={...Om.defaultProps,label:``,changeThrottle:100,pauseOnDrag:!1};#e={...e.defaultProps};#t=null;#n;#r=!1;constructor(e){super(),e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps),super.setProps({...t,min:0})}setMedia(e){this.#t=e}setFormatLocale(e){this.#n=e}getState(){let{duration:e,currentTime:t,seeking:n,buffered:r}=this.#t;super.setProps({...this.#e,min:0,max:e});let i=super.getSliderState(t),a=r.length>0?r[r.length-1][1]:0,o=e>0?a/e*100:0;return{...i,currentTime:t,duration:e,seeking:n,bufferPercent:o}}getLabel(e){return super.getLabel(e)||Km}#i(e){return e.dragging?this.rawValueFromPercent(e.pointerPercent):e.value}#a(e){return this.#n===void 0?nm(e):nm(e,{locale:this.#n})}getValueText(e){return Number.isFinite(e.duration)?Vm:this.getValueTextParams(e).current}getValueTextParams(e){let t=this.#a(this.#i(e));return Number.isFinite(e.duration)?{current:t,duration:this.#a(e.duration)}:{current:t}}startDrag(e){this.#r=!1,this.#e.pauseOnDrag&&e&&!e.paused&&(this.#r=!0,e.pause())}endDrag(e){this.#r&&e?.play().catch(()=>{}),this.#r=!1}getAttrs(e){let t=super.getAttrs(e),n=this.#i(e);return{...t,"aria-valuenow":n,"aria-valuetext":this.getValueText(e)}}},Jm={...km,seeking:`data-seeking`},Ym=class e{static defaultProps={side:`top`,align:`center`,open:!1,defaultOpen:!1,delay:600,closeDelay:0,disableHoverablePopup:!0,disabled:!1};#e={...e.defaultProps};constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}#t=null;setInput(e){this.#t=e}getState(){let e=this.#t;return{open:e.active,status:e.status,side:this.#e.side,align:this.#e.align,...rf(e.status)}}getPopupAttrs(e){return{popover:`manual`,role:`presentation`}}},Xm={sideOffset:`--media-tooltip-side-offset`,alignOffset:`--media-tooltip-align-offset`,boundaryOffset:`--media-tooltip-boundary-offset`,anchorWidth:`--media-tooltip-anchor-width`,anchorHeight:`--media-tooltip-anchor-height`,availableWidth:`--media-tooltip-available-width`,availableHeight:`--media-tooltip-available-height`},Zm={open:`data-open`,side:`data-side`,align:`data-align`,...nf},Qm=class e{static defaultProps={delay:600,closeDelay:0,timeout:400};#e={...e.defaultProps};#t=0;#n=!1;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=sc(t,e.defaultProps)}get delay(){return this.#e.delay}get closeDelay(){return this.#e.closeDelay}shouldSkipDelay(){return this.#n?!0:Date.now()-this.#t<this.#e.timeout}notifyOpen(){this.#n=!0}notifyClose(){this.#n=!1,this.#t=Date.now()}},$m=new Map;function eh(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function th(e){let t=eh(e),n=$m.get(t);if(!n)try{n=new Intl.NumberFormat(e,{style:`percent`,maximumFractionDigits:0}),$m.set(t,n)}catch{return}return n}function nh(e){return`${Math.round(Math.min(1,Math.max(0,e))*100)}%`}function rh(e,t){let n=!ic(e)||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e));try{let e=th(t)??th(void 0);if(e)return e.format(n)}catch{}return nh(n)}var ih=class e extends Om{static defaultProps={...Om.defaultProps,label:``,wheelStep:5};#e=null;#t;constructor(e){super(),e&&this.setProps(e)}setProps(t){super.setProps(sc(t,e.defaultProps))}setMedia(e){this.#e=e}setFormatLocale(e){this.#t=e}getState(){let e=this.#e,{volume:t,muted:n}=e,r=n||t===0,{dragging:i,dragPercent:a}=this.input,o=t*100,s=i?this.valueFromPercent(a):o,c=super.getSliderState(s);return{...c,fillPercent:r?0:c.fillPercent,volume:t,muted:r,availability:e.volumeAvailability}}getWheelStepPercent(){let e=this.props,t=e.max-e.min;return t>0?e.wheelStep/t*100:0}getLabel(e){return super.getLabel(e)||Kp}getValueText(e){return e.muted?Gp:this.getValueTextParams(e).percent}getValueTextParams(e){return{percent:rh(e.value/100,this.#t)}}getAttrs(e){return{...super.getAttrs(e),"aria-valuetext":this.getValueText(e)}}},ah={...km,availability:`data-availability`};c();var oh=j(null),sh=oh.Provider;function ch(){let e=E(oh);if(!e)throw Error(`AlertDialog compound components must be used within an AlertDialog.Root`);return e}var lh=Object.defineProperty,uh=(e,t)=>{let n={};for(var r in e)lh(n,r,{get:e[r],enumerable:!0});return t||lh(n,Symbol.toStringTag,{value:`Module`}),n};c();var dh=a(function({render:e,className:t,style:n,disabled:r,...i},a){let{dialog:o,state:s}=ch(),c=k(()=>{r||o.close()},[o,r]);return X(`button`,{render:e,className:t,style:n},{state:s,ref:[a],props:[{type:`button`,disabled:r,onClick:c},i]})});c();function fh(e){let{displayName:t,tag:n,useContext:r,staticProps:i,getProps:o}=e,s=a(function(e,t){let{render:a,className:s,style:c,...l}=e,u=r(),d=o?.(u.state);return X(n,{render:a,className:s,style:c},{state:u.state,stateAttrMap:u.stateAttrMap,ref:t,props:[i,d,l].filter(Boolean)})});return s.displayName=t,s}var ph=fh({displayName:`AlertDialogDescription`,tag:`p`,useContext:ch,getProps:e=>({id:e.descriptionId})});c();var mh=a(function({render:e,className:t,style:n,...r},i){let{core:a,dialog:o,state:s,stateAttrMap:c}=ch(),l=cl(i,k(e=>{o.setElement(e)},[o]));return s.open?X(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:l,props:[{tabIndex:-1,...a.getAttrs(s)},r]}):null});c();var hh=/[^a-zA-Z0-9_-]/g;function gh(e){let t=ee().replace(hh,``);return e?`${e}-${t}`:t}c();function _h({open:e,defaultOpen:t=mp.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,children:i}){let[a]=M(()=>new mp),o=e!==void 0,c=Y(n),l=Y(r),[u]=M(()=>{let e=Qd({transition:Ff(),onOpenChange:e=>{c.current?.(e)},onOpenChangeComplete:e=>{l.current?.(e)}});return!o&&t&&e.open(),e}),d=gh(`alert-dialog-title`),f=gh(`alert-dialog-desc`);a.setTitleId(d),a.setDescriptionId(f),g(()=>{if(e===void 0)return;let{active:t}=u.input.current;e!==t&&(e?u.open():u.close())},[e,u]),Gf(u);let p=pl(u.input);return a.setInput(p),s(sh,{value:{core:a,dialog:u,state:a.getState(),stateAttrMap:hp},children:i})}var vh=fh({displayName:`AlertDialogTitle`,tag:`h2`,useContext:ch,getProps:e=>({id:e.titleId})}),yh=uh({Close:()=>dh,Description:()=>ph,Popup:()=>mh,Root:()=>_h,Title:()=>vh});c();var bh=a(function(e,t){let{render:n,className:r,style:i,delay:a,...o}=e,s=xl(yd),[c]=M(()=>new gp);Gf(c),c.setProps({delay:a}),s&&c.update(s);let l=p(e=>c.state.subscribe(e),()=>c.state.current,()=>c.state.current);return s?X(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:_p,ref:[t],props:[o]}):null});c();var xh=j(null),Sh=xh.Provider;function Ch(){let e=E(xh);if(!e)throw Error(`Controls compound components must be used within a Controls.Root`);return e}function wh(){return E(xh)}c();var Th=a(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{state:s,stateAttrMap:c}=Ch(),l=o[`aria-label`]||o[`aria-labelledby`]?`group`:void 0;return X(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:c,ref:[t],props:[{role:l,children:a},o]})});c();var Eh=a(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,c=xl(hd),[l]=M(()=>new vp);if(!c)return null;l.setMedia(c);let u=l.getState();return s(Sh,{value:{state:u,stateAttrMap:yp},children:X(`div`,{render:n,className:r,style:i},{state:u,stateAttrMap:yp,ref:[t],props:[{children:a},o,{"data-interactive":``}]})})}),Dh=uh({Group:()=>Th,Root:()=>Eh});c();var Oh=j(null),kh=Oh.Provider;function Ah(){let e=E(Oh);if(!e)throw Error(`ErrorDialog compound components must be used within an ErrorDialog.Root`);return e}c();var jh=a(function({render:e,className:t,style:n,disabled:r,children:i,...a},o){let s=Oc(),{dialog:c,state:l,stateAttrMap:u}=ch(),d=k(()=>{r||c.close()},[c,r]),f=i??Tc(Ip(),s);return X(`button`,{render:e,className:t,style:n},{state:l,stateAttrMap:u,ref:o,props:[{type:`button`,disabled:r,onClick:d,children:f},a]})});c();var Mh=a(function({render:e,className:t,style:n,children:r,...i},a){let o=Oc(),{state:s,stateAttrMap:c}=ch(),{lastError:l}=Ah(),u=Lp(l),d=r??Tc(u,o);return X(`p`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.descriptionId,children:d},i]})});c();function Nh({children:e}){let[t]=M(()=>new bp),n=xl(gd),r=O(n?.error??null);n?.error&&(r.current=n.error);let i=Y(n),[a]=M(()=>Qd({transition:Ff(),onOpenChange:e=>{e||i.current?.dismissError()}})),o=gh(`error-dialog-title`),c=gh(`error-dialog-desc`);t.setTitleId(o),t.setDescriptionId(c),g(()=>{let e=!!n?.error,{active:t}=a.input.current;e&&!t?a.open():!e&&t&&a.close()},[n?.error,a]),Gf(a);let l=pl(a.input);t.setInput(l);let u=t.getState();return n?s(kh,{value:{lastError:r.current},children:s(sh,{value:{core:t,dialog:a,state:u,stateAttrMap:hp},children:e})}):null}c();var Ph=a(function({render:e,className:t,style:n,children:r,...i},a){let o=Oc(),{state:s,stateAttrMap:c}=ch(),l=r??Tc(Fp(),o);return X(`h2`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.titleId,children:l},i]})}),Fh=uh({Close:()=>jh,Description:()=>Mh,Popup:()=>mh,Root:()=>Nh,Title:()=>Ph}),Ih=fp({displayName:`FullscreenButton`,core:Vp,stateAttrMap:Hp,selector:_d,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleFullscreen`,isSupported:e=>!e.hidden});c();function Lh({type:e,action:t,value:n,pointer:r,region:i,disabled:a}){let o=xl(),s=wl();return g(()=>{if(!s||!e||!t||a)return;let c=Ed(t);if(!c)return;let l=e=>{c({store:o,value:n,event:e})},u={pointer:r,region:i,action:t,value:n};return e===`doubletap`?Md(s,l,u):jd(s,l,u)},[s,o,e,t,n,r,i,a]),null}var Rh=Lh;c();function zh(){let[,e]=y(e=>e+1,0);return e}c();function Bh(e){let t=Y(e),n=O(null),r=O(null),i=zh(),[a]=M(()=>Ef({getElement:()=>n.current,getThumbElement:()=>r.current,getOrientation:()=>t.current.orientation??`horizontal`,isRTL:()=>n.current?Ac(n.current):!1,isDisabled:()=>t.current.disabled??!1,getPercent:()=>t.current.getPercent(),getStepPercent:()=>t.current.getStepPercent(),getLargeStepPercent:()=>t.current.getLargeStepPercent(),changeThrottle:t.current.changeThrottle,adjustPercent:t.current.adjustPercent,onValueChange:e=>t.current.onValueChange?.(e),onValueCommit:e=>t.current.onValueCommit?.(e),onDragStart:()=>t.current.onDragStart?.(),onDragEnd:()=>t.current.onDragEnd?.()}));Gf(a);let o=pl(a.input),s=e.computeState(o);return N(()=>{s.thumbAlignment===`edge`&&n.current&&r.current&&i()},[s.thumbAlignment]),{state:s,cssVars:e.getCSSVars(a.adjustForAlignment(s)),rootRef:k(e=>{n.current=e},[]),thumbRef:k(e=>{r.current=e},[]),rootProps:a.rootProps,rootStyle:a.rootStyle,thumbProps:a.thumbProps}}c();function Vh({keys:e,action:t,value:n,disabled:r,target:i}){let a=xl(),o=wl();return g(()=>{if(!o||!e||!t||r)return;let s=Fd(t);if(s)return Yd(o,{keys:e,action:t,value:n,target:i,disabled:r,repeatable:!Nd(t),onActivate:(e,t)=>{s({store:a,key:t,value:n})}})},[o,a,e,t,n,r,i]),null}var Hh=Vh;c();function Uh(e){let t=e.side,[n,r]=M({preferred:t,side:t}),i=e.open&&n.preferred===t?n.side:t,a=P(()=>i===t?e:{...e,side:i},[i,e,t]),o=k(e=>r(n=>n.preferred===t&&n.side===e?n:{preferred:t,side:e}),[t]);return g(()=>{e.open||o(t)},[e.open,t,o]),{state:a,preferredSide:t,setPositionedSide:o}}var Wh=fp({displayName:`MuteButton`,core:lm,stateAttrMap:dm,selector:Cd,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleMuted`}),Gh=fp({displayName:`PiPButton`,core:hm,stateAttrMap:gm,selector:vd,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePictureInPicture`,isSupported:e=>!e.hidden}),Kh=fp({displayName:`PlayButton`,core:_m,stateAttrMap:vm,selector:yd,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePaused`}),qh=fp({displayName:`PlaybackRateButton`,core:ym,stateAttrMap:bm,selector:bd,action:(e,t)=>e.cycle(t),hotkeyAction:`speedUp`});c();var Jh=j(null),Yh=Jh.Provider;function Xh(){let e=E(Jh);if(!e)throw Error(`Popover compound components must be used within a Popover.Root`);return e}var Zh=fh({displayName:`PopoverArrow`,tag:`div`,useContext:Xh,staticProps:{"aria-hidden":`true`}});c();var Qh={position:`fixed`,inset:`auto`,margin:0},$h=a(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,preferredSide:c,setPositionedSide:l,stateAttrMap:u,anchorName:d,popupId:f,boundary:p,container:m}=Xh(),h=O(null),g=cl(i,k(e=>{o.setPopupElement(e),e&&Pc()&&e.style.setProperty(`position-anchor`,`--${d}`)},[o,d]),h),_=P(()=>({side:c,align:s.align}),[c,s.align]),v=P(()=>{if(!Pc())return null;let{positionAnchor:e,...t}=vf(d,_);return t},[d,_]),[y,b]=M(null);N(()=>{if(!s.open){b(null);return}function e(){let e=o.triggerElement,t=h.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=lf(p,{container:m,root:r}),a=Cf(t,_.side),s=cf(i),c=Sf(t),u=qc(n,a,s,_,c),{positionAnchor:f,...g}=vf(d,{..._,side:u},n,Pc()?void 0:a,s,c);b(g),l(u)}e();let t=o.triggerElement,n=h.current,r=n?lf(p,{container:m,root:n.getRootNode()}):null,i=0;function a(t){t&&Bf(t,h.current)||(cancelAnimationFrame(i),i=requestAnimationFrame(e))}a();let c=typeof ResizeObserver==`function`?new ResizeObserver(()=>{a()}):null;return t&&c&&c.observe(t),n&&c&&c.observe(n),r&&c&&c.observe(r),window.addEventListener(`scroll`,a,{capture:!0,passive:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(i),c?.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[s.open,d,_,o,p,m,l]);let x=y??v??Qh;if(!s.open)return null;let{onFocusOut:S,...C}=o.popupProps;return X(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:u,ref:g,props:[{id:f,style:x,...a.getPopupAttrs(s)},{...C,onBlur:S},r]})});c();function eg({open:e,defaultOpen:t=xm.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,openOnHover:i=xm.defaultProps.openOnHover,delay:a=xm.defaultProps.delay,closeDelay:o=xm.defaultProps.closeDelay,boundary:c=`container`,children:l,...u}){let d=Tl(),f=El(),p=wh(),[m]=M(()=>new xm(u));m.setProps(u);let h=!q(e),_=Y(n),v=Y(r),y=Y(u.closeOnEscape),b=Y(u.closeOnOutsideClick),x=Y(i),S=Y(a),C=Y(o),w=Y(f),[T]=M(()=>{let e=af({transition:Ff(),onOpenChange:(e,t)=>{_.current?.(e,t)},onOpenChangeComplete:e=>{v.current?.(e)},closeOnEscape:()=>y.current??xm.defaultProps.closeOnEscape,closeOnOutsideClick:()=>b.current??xm.defaultProps.closeOnOutsideClick,openOnHover:()=>x.current,delay:()=>S.current,closeDelay:()=>C.current,group:()=>w.current});return!h&&t&&e.open(`click`),e}),E=gh(),D=gh(`popup`);g(()=>{if(q(e))return;let{active:t}=T.input.current;e!==t&&(e?T.open(`click`):T.close(`click`))},[e,T]),g(()=>{q(p?.state.visible)||p.state.visible||T.close(`imperative-action`)},[p?.state.visible,T]),Gf(T);let O=pl(T.input);m.setInput(O);let{state:k,preferredSide:A,setPositionedSide:j}=Uh(m.getState());return s(Yh,{value:{core:m,popover:T,state:k,preferredSide:A,setPositionedSide:j,stateAttrMap:Sm,anchorName:E,popupId:D,boundary:c,container:d},children:l})}c();var tg=a(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,stateAttrMap:c,anchorName:l,popupId:u}=Xh(),d=k(e=>{o.setTriggerElement(e),e&&Pc()&&e.style.setProperty(`anchor-name`,`--${l}`)},[o,l]),{onFocusIn:f,onFocusOut:p,...m}=o.triggerProps;return X(`button`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:[i,d],props:[{type:`button`,...a.getTriggerAttrs(s,u)},{...m,onFocus:f,onBlur:p},r]})}),ng=uh({Arrow:()=>Zh,Popup:()=>$h,Root:()=>eg,Trigger:()=>tg}),rg=fp({displayName:`SeekButton`,core:Em,stateAttrMap:Dm,selector:Sd,action:(e,t)=>e.seek(t),hotkeyAction:`seekStep`,hotkeyValue:e=>typeof e.seconds==`number`?e.seconds:Em.defaultProps.seconds});c();var ig=a(function(e,t){let{render:n,className:r,style:i,time:a=0,thumbnails:o,crossOrigin:c,loading:l,fetchPriority:u,...d}=e,[f]=M(()=>new jf),p=O(null),m=O(null),h=Sl(xd),[,g]=M(0),[_]=M(()=>Mf({getContainer:()=>p.current,getImg:()=>m.current,onStateChange:()=>g(e=>e+1)}));Gf(_,()=>_.connect());let v=P(()=>o&&o.length>0?o:h&&h.thumbnailCues.length>0?Mm(h.thumbnailCues,h.thumbnailTrackSrc??void 0):[],[o,h]),y=P(()=>f.findActiveThumbnail(v,a),[f,v,a]);_.updateSrc(y?.url);let b=f.getState(_.loading,_.error,y),x={overflow:`hidden`},S;if(y&&_.naturalWidth&&_.naturalHeight){let e=_.readConstraints(),t=f.resize(y,_.naturalWidth,_.naturalHeight,e);t&&(x={overflow:`hidden`,width:t.containerWidth,height:t.containerHeight},S={width:t.imageWidth,height:t.imageHeight,maxWidth:`none`,transform:t.offsetX||t.offsetY?`translate(-${t.offsetX}px, -${t.offsetY}px)`:void 0})}return X(`div`,{render:n,className:r,style:i},{state:b,stateAttrMap:Am,ref:[t,p],props:[f.getAttrs(b),{style:x},d,{children:s(`img`,{ref:m,alt:``,"aria-hidden":`true`,decoding:`async`,src:y?.url,crossOrigin:c===``||c===null?void 0:c,loading:l,style:S,fetchPriority:u})}]})});c();var ag=j(null);function og({value:e,children:t}){return s(ag.Provider,{value:e,children:t})}function sg(){let e=E(ag);if(!e)throw Error(`Slider compound components must be used within a Slider.Root`);return e}var cg=fh({displayName:`SliderBuffer`,tag:`div`,useContext:sg}),lg=fh({displayName:`SliderFill`,tag:`div`,useContext:sg});c();var ug=a(function(e,t){let{render:n,className:r,style:i,overflow:a=`clamp`,...o}=e,s=sg(),{state:c}=s,l=O(null),[u,d]=M(0);g(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>{d(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let f=Af(u,a);return X(`div`,{render:n,className:r,style:i},{state:c,stateAttrMap:s.stateAttrMap,ref:[t,l],props:[{style:f},o]})});c();var dg=a(function(e,t){let{render:n,className:r,style:i,label:a,min:o,max:c,step:l,largeStep:u,orientation:d,disabled:f,thumbAlignment:p,value:m=0,onValueChange:h,onValueCommit:g,onDragStart:_,onDragEnd:v,...y}=e,[b]=M(()=>new Om),x=Oc();b.setProps({label:a,min:o,max:c,step:l,largeStep:u,orientation:d,disabled:f,thumbAlignment:p});let{state:S,cssVars:C,rootRef:w,thumbRef:T,rootProps:E,rootStyle:D,thumbProps:O}=Bh({computeState:e=>(b.setInput(e),b.getSliderState(m)),getPercent:()=>b.percentFromValue(m),getStepPercent:()=>b.getStepPercent(),getLargeStepPercent:()=>b.getLargeStepPercent(),orientation:d,disabled:f,adjustPercent:(e,t,n)=>b.adjustPercentForAlignment(e,t,n),getCSSVars:Of,onValueChange:e=>h?.(b.valueFromPercent(e)),onValueCommit:e=>g?.(b.valueFromPercent(e)),onDragStart:_,onDragEnd:v});return s(og,{value:{state:S,pointerValue:b.valueFromPercent(S.pointerPercent),thumbRef:T,thumbProps:O,stateAttrMap:km,getAttrs:e=>{let t=b.getAttrs(e);return{...t,"aria-label":Tc(t[`aria-label`],x)}},formatValue:void 0},children:X(`div`,{render:n,className:r,style:i},{state:S,stateAttrMap:km,ref:[t,w],props:[{style:{...C,...D}},E,y]})})});c();var fg=a(function(e,t){let{render:n,className:r,style:i,...a}=e,o=sg(),{state:s,thumbRef:c,thumbProps:l,getAttrs:u}=o,d=u(s);return X(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:o.stateAttrMap,ref:[t,c],props:[d,l,a]})});c();var pg=a(function(e,t){let{pointerValue:n}=sg();return s(ig,{ref:t,...e,time:n})}),mg=fh({displayName:`SliderTrack`,tag:`div`,useContext:sg});c();var hg=a(function(e,t){let{render:n,className:r,style:i,type:a=`current`,format:o,...s}=e,c=sg(),{state:l,pointerValue:u,formatValue:d}=c,f=a===`pointer`?u:l.value,p=o?o(f):d?d(f,a):String(Math.round(f));return X(`output`,{render:n,className:r,style:i},{state:l,stateAttrMap:c.stateAttrMap,ref:t,props:[{"aria-live":`off`,children:p},s]})}),gg=uh({Buffer:()=>cg,Fill:()=>lg,Preview:()=>ug,Root:()=>dg,Thumb:()=>fg,Thumbnail:()=>pg,Track:()=>mg,Value:()=>hg});c();var _g=a(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e;return X(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{children:a},o]})});c();var vg=a(function(e,t){let{render:n,className:r,style:i,children:a=`/`,...o}=e;return X(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{"aria-hidden":`true`,children:a},o]})});c(),S();var yg=a(function(e,t){let{render:n,className:r,style:i,type:a,negativeSign:o,label:c,toggle:l=!1,...u}=e,d=xl(Sd),f=Oc(),p=kc(),[m]=M(()=>new Wm),h=a??Wm.defaultProps.type,[_,v]=M(h);if(g(()=>{v(h)},[h,l]),m.setProps({type:_,negativeSign:o,label:c,toggle:l}),!d)return null;m.setMedia(d);let y=m.getState(),b=m.getAttrs(y,h),S=m.getLabelParams(y)?{duration:y.type===`remaining`?Tc(Lm,f,{duration:nm(Math.abs(y.seconds),{locale:p})}):nm(Math.abs(y.seconds),{locale:p})}:void 0,C=y.negative?s(x,{children:[s(`span`,{"aria-hidden":`true`,children:o??Wm.defaultProps.negativeSign}),y.text]}):y.text,w=()=>{v(e=>h===`current`?e===`remaining`?`current`:`remaining`:e===`duration`?`remaining`:`duration`)},T=e=>{e.defaultPrevented||w()},E=e=>{!e.defaultPrevented&&Hc(e.nativeEvent)&&(e.preventDefault(),!e.repeat&&w())};return X(`time`,{render:n,className:r,style:i},{state:y,stateAttrMap:Gm,ref:[t],props:[{dateTime:y.datetime,children:C,...b,"aria-label":Tc(b[`aria-label`],f,S),...l?{onClick:T,onKeyDown:E}:void 0},u]})}),bg=uh({Group:()=>_g,Separator:()=>vg,Value:()=>yg});c();var xg=()=>Promise.resolve(0),Sg=a(function(e,t){let{render:n,className:r,style:i,label:a,changeThrottle:o=qm.defaultProps.changeThrottle,step:c=qm.defaultProps.step,largeStep:l=qm.defaultProps.largeStep,orientation:u,disabled:d,thumbAlignment:f,onDragStart:p,onDragEnd:m,pauseOnDrag:h,..._}=e,v=xl(Sd),y=xl(md),b=xl(yd),x=Oc(),S=kc(),[C]=M(()=>new qm);C.setProps({label:a,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f,pauseOnDrag:h,changeThrottle:o}),C.setFormatLocale(S);let w=Y(v&&y?{...v,...y}:null),T=Y(b);g(()=>()=>C.endDrag(T.current),[C]);let E=v?.duration??0,{state:D,cssVars:O,rootRef:k,thumbRef:A,rootProps:j,rootStyle:ee,thumbProps:te}=Bh({computeState:e=>(C.setInput(e),!v||!y?C.setMedia({currentTime:0,duration:0,seeking:!1,seek:xg,buffered:[],seekable:[]}):C.setMedia({...v,...y}),C.getState()),getPercent:()=>E>0?(v?.currentTime??0)/E*100:0,getStepPercent:()=>C.getStepPercent(),getLargeStepPercent:()=>C.getLargeStepPercent(),orientation:u,disabled:d,changeThrottle:o,adjustPercent:(e,t,n)=>C.adjustPercentForAlignment(e,t,n),getCSSVars:kf,onValueCommit:e=>{let t=w.current;t&&t.seek(C.rawValueFromPercent(e))},onDragStart:()=>{C.startDrag(T.current),p?.()},onDragEnd:()=>{C.endDrag(T.current),m?.()}});return v?s(og,{value:{state:D,pointerValue:C.valueFromPercent(D.pointerPercent),thumbRef:A,thumbProps:te,stateAttrMap:Jm,getAttrs:e=>{let t=C.getAttrs(e);return{...t,"aria-label":Tc(t[`aria-label`],x),"aria-valuetext":Tc(t[`aria-valuetext`],x,C.getValueTextParams(e))}},formatValue:e=>em(e,E)},children:X(`div`,{render:n,className:r,style:i},{state:D,stateAttrMap:Jm,ref:[t,k],props:[{style:{...O,...ee}},j,_]})}):null}),Cg=uh({Buffer:()=>cg,Fill:()=>lg,Preview:()=>ug,Root:()=>Sg,Thumb:()=>fg,Track:()=>mg,Value:()=>hg}),wg=fh({displayName:`TooltipArrow`,tag:`div`,useContext:lp,staticProps:{"aria-hidden":`true`}});c();var Tg=a(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=lp(),l=r===void 0?c?.label??``:r;return X(`span`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]})});c();var Eg=a(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=lp(),l=r??c?.shortcut??null;return l?X(`kbd`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]}):null});c(),S();var Dg={position:`fixed`,inset:`auto`,margin:0},Og=a(function({render:e,className:t,style:n,children:r,...i},a){let{core:o,tooltip:c,state:l,preferredSide:u,setPositionedSide:d,stateAttrMap:f,anchorName:p,popupId:m,boundary:h,container:g}=lp(),_=O(null),v=cl(a,k(e=>{c.setPopupElement(e),e&&Pc()&&e.style.setProperty(`position-anchor`,`--${p}`)},[c,p]),_),y=P(()=>({side:u,align:l.align}),[u,l.align]),b=P(()=>{if(!Pc())return null;let{positionAnchor:e,...t}=vf(p,y,void 0,void 0,void 0,void 0,Xm);return t},[p,y]),[S,C]=M(null);N(()=>{if(!l.open){C(null);return}function e(){let e=c.triggerElement,t=_.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=lf(h,{container:g,root:r}),a=Cf(t,y.side),o=cf(i),s=Sf(t,Xm),l=qc(n,a,o,y,s),{positionAnchor:u,...f}=vf(p,{...y,side:l},n,Pc()?void 0:a,o,s,Xm);C(f),d(l)}e();let t=c.triggerElement,n=_.current,r=n?lf(h,{container:g,root:n.getRootNode()}):null,i=0;function a(t){t&&Bf(t,_.current)||(cancelAnimationFrame(i),i=requestAnimationFrame(e))}a();let o=typeof ResizeObserver==`function`?new ResizeObserver(()=>{a()}):null;return t&&o&&o.observe(t),n&&o&&o.observe(n),r&&o&&o.observe(r),window.addEventListener(`scroll`,a,{capture:!0,passive:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(i),o?.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[l.open,p,y,c,h,g,d]);let w=S??b??Dg;if(!l.open)return null;let T=r===void 0?s(x,{children:[s(Tg,{}),s(Eg,{})]}):r,{onFocusOut:E,...D}=c.popupProps;return X(`div`,{render:e,className:t,style:n},{state:l,stateAttrMap:f,ref:v,props:[{id:m,style:w,...o.getPopupAttrs(l)},{children:T},{...D,onBlur:E},i]})});c();var kg=j(null),Ag=kg.Provider;function jg(){return E(kg)?.group}c();function Mg({delay:e,closeDelay:t,timeout:n,children:r}){let[i]=M(()=>new Qm({delay:e,closeDelay:t,timeout:n}));return i.setProps({delay:e,closeDelay:t,timeout:n}),s(Ag,{value:{group:i},children:r})}c();function Ng({open:e,defaultOpen:t=Ym.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,delay:i=Ym.defaultProps.delay,closeDelay:a=Ym.defaultProps.closeDelay,disableHoverablePopup:o=Ym.defaultProps.disableHoverablePopup,disabled:c=Ym.defaultProps.disabled,boundary:l=`container`,children:u,...d}){let f=Tl(),p=wh(),[m]=M(()=>new Ym(d));m.setProps(d);let h=!q(e),_=jg(),v=Y(n),y=Y(r),b=Y(i),x=Y(a),S=Y(o),C=Y(c),w=Y(_),[T]=M(()=>{let e=Pf({transition:Ff(),onOpenChange:(e,t)=>{v.current?.(e,t)},onOpenChangeComplete:e=>{y.current?.(e)},delay:()=>b.current,closeDelay:()=>x.current,disableHoverablePopup:()=>S.current,disabled:()=>C.current,group:()=>w.current});return!h&&t&&e.open(),e}),[E,D]=M(),O=gh(),k=gh(`tooltip`);g(()=>{if(q(e))return;let{active:t}=T.input.current;e!==t&&(e?T.open():T.close())},[e,T]),g(()=>{q(p?.state.visible)||p.state.visible||T.close(`imperative-action`)},[p?.state.visible,T]),Gf(T);let A=pl(T.input);m.setInput(A);let{state:j,preferredSide:ee,setPositionedSide:te}=Uh(m.getState());return s(cp,{value:{core:m,tooltip:T,state:j,preferredSide:ee,setPositionedSide:te,stateAttrMap:Zm,anchorName:O,popupId:k,content:E,setContent:D,boundary:l,container:f},children:u})}c();var Pg=a(function({render:e,className:t,style:n,...r},i){let{tooltip:a,state:o,stateAttrMap:s,anchorName:c}=lp(),l=k(e=>{a.setTriggerElement(e),e&&Pc()&&e.style.setProperty(`anchor-name`,`--${c}`)},[a,c]),{onFocusIn:u,onFocusOut:d,...f}=a.triggerProps;return X(`button`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:[i,l],props:[{type:`button`},{...f,onFocus:u,onBlur:d},r]})}),Fg=uh({Arrow:()=>wg,Label:()=>Tg,Popup:()=>Og,Provider:()=>Mg,Root:()=>Ng,Shortcut:()=>Eg,Trigger:()=>Pg});c();var Ig={volume:0,muted:!1,volumeAvailability:`unsupported`,setVolume:()=>0,toggleMuted:()=>!1},Lg=a(function(e,t){let{render:n,className:r,style:i,label:a,orientation:o,step:c=ih.defaultProps.step,largeStep:l=ih.defaultProps.largeStep,wheelStep:u=ih.defaultProps.wheelStep,disabled:d,thumbAlignment:f,onDragStart:p,onDragEnd:m,...h}=e,g=xl(Cd),_=Oc(),v=kc(),[y]=M(()=>new ih);y.setProps({label:a,orientation:o,step:c,largeStep:l,wheelStep:u,disabled:d,thumbAlignment:f}),y.setFormatLocale(v);let b=Y(g),x=Y(d),S=()=>(b.current?.volume??0)*100,C=()=>y.getStepPercent(),w=e=>b.current?.setVolume(e/100),{state:T,cssVars:E,rootRef:D,thumbRef:A,rootProps:j,rootStyle:ee,thumbProps:te}=Bh({computeState:e=>(y.setInput(e),y.setMedia(g??Ig),y.getState()),getPercent:S,getStepPercent:C,getLargeStepPercent:()=>y.getLargeStepPercent(),orientation:o,disabled:d,adjustPercent:(e,t,n)=>y.adjustPercentForAlignment(e,t,n),getCSSVars:Of,onValueChange:w,onValueCommit:w,onDragStart:p,onDragEnd:m}),[ne]=M(()=>zf({isDisabled:()=>!!x.current||!b.current,getPercent:()=>(b.current?.volume??0)*100,getStepPercent:()=>y.getWheelStepPercent(),onValueChange:e=>b.current?.setVolume(e/100)})),N=O(null),P=k(e=>{N.current?.(),N.current=null,e&&(N.current=J(e,`wheel`,ne.onWheel,{passive:!1}))},[ne]);return g?s(og,{value:{state:T,pointerValue:y.valueFromPercent(T.pointerPercent),thumbRef:A,thumbProps:te,stateAttrMap:ah,getAttrs:e=>{let t=y.getAttrs(e);return{...t,"aria-label":Tc(t[`aria-label`],_),"aria-valuetext":Tc(t[`aria-valuetext`],_,y.getValueTextParams(e))}},formatValue:e=>`${Math.round(e)}%`},children:X(`div`,{render:n,className:r,style:i},{state:T,stateAttrMap:ah,ref:[t,D,P],props:[{style:{...E,...ee}},j,h]})}):null}),Rg=uh({Fill:()=>lg,Preview:()=>ug,Root:()=>Lg,Thumb:()=>fg,Track:()=>mg,Value:()=>hg}),zg=I(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Bg=I(((e,t)=>{var n=zg();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),Vg=I(((e,t)=>{t.exports=Bg()()}));c();var Z=u(Vg());function Hg(){return Hg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hg.apply(this,arguments)}function Ug(e,t){if(e==null)return{};var n=Wg(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wg(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Gg=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=Ug(e,[`color`,`size`]);return r.createElement(`svg`,Hg({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),r.createElement(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),r.createElement(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`}))});Gg.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},Gg.displayName=`AlertTriangle`,c();function Kg(){return Kg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kg.apply(this,arguments)}function qg(e,t){if(e==null)return{};var n=Jg(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jg(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Yg=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=qg(e,[`color`,`size`]);return r.createElement(`svg`,Kg({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polyline`,{points:`20 6 9 17 4 12`}))});Yg.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},Yg.displayName=`Check`,c();function Xg(){return Xg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xg.apply(this,arguments)}function Zg(e,t){if(e==null)return{};var n=Qg(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qg(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var $g=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=Zg(e,[`color`,`size`]);return r.createElement(`svg`,Xg({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polyline`,{points:`15 18 9 12 15 6`}))});$g.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},$g.displayName=`ChevronLeft`,c();function e_(){return e_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e_.apply(this,arguments)}function t_(e,t){if(e==null)return{};var n=n_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function n_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var r_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=t_(e,[`color`,`size`]);return r.createElement(`svg`,e_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polyline`,{points:`9 18 15 12 9 6`}))});r_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},r_.displayName=`ChevronRight`,c();function i_(){return i_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i_.apply(this,arguments)}function a_(e,t){if(e==null)return{};var n=o_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function o_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var s_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=a_(e,[`color`,`size`]);return r.createElement(`svg`,i_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),r.createElement(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`}))});s_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},s_.displayName=`Copy`,c();function c_(){return c_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c_.apply(this,arguments)}function l_(e,t){if(e==null)return{};var n=u_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function u_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var d_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=l_(e,[`color`,`size`]);return r.createElement(`svg`,c_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3`}))});d_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},d_.displayName=`Maximize`,c();function f_(){return f_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f_.apply(this,arguments)}function p_(e,t){if(e==null)return{};var n=m_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function m_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var h_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=p_(e,[`color`,`size`]);return r.createElement(`svg`,f_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3`}))});h_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},h_.displayName=`Minimize`,c();function g_(){return g_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},g_.apply(this,arguments)}function __(e,t){if(e==null)return{};var n=v_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function v_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var y_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=__(e,[`color`,`size`]);return r.createElement(`svg`,g_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`}),r.createElement(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`}))});y_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},y_.displayName=`Pause`,c();function b_(){return b_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b_.apply(this,arguments)}function x_(e,t){if(e==null)return{};var n=S_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function S_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var C_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=x_(e,[`color`,`size`]);return r.createElement(`svg`,b_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polygon`,{points:`5 3 19 12 5 21 5 3`}))});C_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},C_.displayName=`Play`,c();function w_(){return w_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w_.apply(this,arguments)}function T_(e,t){if(e==null)return{};var n=E_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function E_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var D_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=T_(e,[`color`,`size`]);return r.createElement(`svg`,w_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polyline`,{points:`1 4 1 10 7 10`}),r.createElement(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`}))});D_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},D_.displayName=`RotateCcw`,c();function O_(){return O_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O_.apply(this,arguments)}function k_(e,t){if(e==null)return{};var n=A_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function A_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var j_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=k_(e,[`color`,`size`]);return r.createElement(`svg`,O_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`circle`,{cx:`12`,cy:`12`,r:`3`}),r.createElement(`path`,{d:`M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z`}))});j_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},j_.displayName=`Settings`,c();function M_(){return M_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M_.apply(this,arguments)}function N_(e,t){if(e==null)return{};var n=P_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function P_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var F_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=N_(e,[`color`,`size`]);return r.createElement(`svg`,M_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),r.createElement(`path`,{d:`M15.54 8.46a5 5 0 0 1 0 7.07`}))});F_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},F_.displayName=`Volume1`,c();function I_(){return I_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},I_.apply(this,arguments)}function L_(e,t){if(e==null)return{};var n=R_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function R_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var z_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=L_(e,[`color`,`size`]);return r.createElement(`svg`,I_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),r.createElement(`path`,{d:`M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07`}))});z_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},z_.displayName=`Volume2`,c();function B_(){return B_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B_.apply(this,arguments)}function V_(e,t){if(e==null)return{};var n=H_(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function H_(e,t){if(e==null)return{};for(var n={},r=Object.keys(e),i,a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var U_=a(function(e,t){var n=e.color,i=n===void 0?`currentColor`:n,a=e.size,o=a===void 0?24:a,s=V_(e,[`color`,`size`]);return r.createElement(`svg`,B_({ref:t,xmlns:`http://www.w3.org/2000/svg`,width:o,height:o,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},s),r.createElement(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),r.createElement(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),r.createElement(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`}))});U_.propTypes={color:Z.default.string,size:Z.default.oneOfType([Z.default.string,Z.default.number])},U_.displayName=`VolumeX`;var W_=I(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));se(),c();var G_=u(W_(),1),K_=`react-tooltip-core-styles`,q_=`react-tooltip-base-styles`,J_={core:!1,base:!1};function Y_({css:e,id:t=q_,type:n=`base`,ref:r}){if(!e||typeof document>`u`||J_[n]||n===`core`&&z!==void 0&&(z==null?void 0:{})?.REACT_TOOLTIP_DISABLE_CORE_STYLES||n!==`base`&&z!==void 0&&(z==null?void 0:{})?.REACT_TOOLTIP_DISABLE_BASE_STYLES)return;n===`core`&&(t=K_),r||={};let{insertAt:i}=r;if(document.getElementById(t))return;let a=document.head||document.getElementsByTagName(`head`)[0],o=document.createElement(`style`);o.id=t,o.type=`text/css`,i===`top`&&a.firstChild?a.insertBefore(o,a.firstChild):a.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e)),J_[n]=!0}var X_=async({elementReference:e=null,tooltipReference:r=null,tooltipArrowReference:i=null,place:a=`top`,offset:o=10,strategy:s=`absolute`,middlewares:c=[d(Number(o)),re({fallbackAxisSideDirection:`start`}),n({padding:5})],border:l,arrowSize:u=8})=>{if(!e||r===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};let f=c;return i?(f.push(ie({element:i,padding:5})),t(e,r,{placement:a,strategy:s,middleware:f}).then((({x:e,y:t,placement:n,middlewareData:r})=>{let i={left:`${e}px`,top:`${t}px`,border:l},{x:a,y:o}=r.arrow??{x:0,y:0},s={top:`bottom`,right:`left`,bottom:`top`,left:`right`}[n.split(`-`)[0]]??`bottom`,c=l&&{borderBottom:l,borderRight:l},d=0;if(l){let e=`${l}`.match(/(\d+)px/);d=e?.[1]?Number(e[1]):1}return{tooltipStyles:i,tooltipArrowStyles:{left:a==null?``:`${a}px`,top:o==null?``:`${o}px`,right:``,bottom:``,...c,[s]:`-${u/2+d-1}px`},place:n}}))):t(e,r,{placement:`bottom`,strategy:s,middleware:f}).then((({x:e,y:t,placement:n})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{},place:n})))},Z_=(e,t)=>!(`CSS`in window&&`supports`in window.CSS)||window.CSS.supports(e,t),Q_=(e,t,n)=>{let r=null,i=function(...i){let a=()=>{r=null,n||e.apply(this,i)};n&&!r&&(e.apply(this,i),r=setTimeout(a,t)),n||(r&&clearTimeout(r),r=setTimeout(a,t))};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i},$_=e=>e!==null&&!Array.isArray(e)&&typeof e==`object`,ev=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,n)=>ev(e,t[n])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!$_(e)||!$_(t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((n=>ev(e[n],t[n])))},tv=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;let t=getComputedStyle(e);return[`overflow`,`overflow-x`,`overflow-y`].some((e=>{let n=t.getPropertyValue(e);return n===`auto`||n===`scroll`}))},nv=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(tv(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},rv=typeof window<`u`?N:g,iv=e=>{e.current&&=(clearTimeout(e.current),null)},av=`DEFAULT_TOOLTIP_ID`,ov={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},sv=j({getTooltipData:()=>ov});function cv(e=av){return E(sv).getTooltipData(e)}var lv={tooltip:`core-styles-module_tooltip__3vRRp`,fixed:`core-styles-module_fixed__pcSol`,arrow:`core-styles-module_arrow__cvMwQ`,content:`core-styles-module_content__BRKdB`,noArrow:`core-styles-module_noArrow__xock6`,clickable:`core-styles-module_clickable__ZuTTB`,show:`core-styles-module_show__Nt9eE`,closing:`core-styles-module_closing__sGnxF`},uv={tooltip:`styles-module_tooltip__mnnfp`,content:`styles-module_content__ydYdI`,arrow:`styles-module_arrow__K0L3T`,dark:`styles-module_dark__xNqje`,light:`styles-module_light__Z6W-X`,success:`styles-module_success__A2AKt`,warning:`styles-module_warning__SCK0X`,error:`styles-module_error__JvumD`,info:`styles-module_info__BWdHW`},dv=({forwardRef:e,id:t,className:n,classNameArrow:i,variant:a=`dark`,anchorId:o,anchorSelect:s,place:c=`top`,offset:u=10,events:d=[`hover`],openOnClick:f=!1,positionStrategy:p=`absolute`,middlewares:m,wrapper:h,delayShow:_=0,delayHide:v=0,float:y=!1,hidden:b=!1,noArrow:x=!1,clickable:S=!1,closeOnEsc:C=!1,closeOnScroll:T=!1,closeOnResize:E=!1,openEvents:D,closeEvents:A,globalCloseEvents:j,imperativeModeOnly:ee,style:te,position:ne,afterShow:N,afterHide:P,disableTooltip:F,content:I,contentWrapperRef:re,isOpen:ie,defaultIsOpen:L=!1,setIsOpen:ae,previousActiveAnchor:oe,activeAnchor:R,setActiveAnchor:z,border:se,opacity:ce,arrowColor:le,arrowSize:ue=8,role:de=`tooltip`})=>{let fe=O(null),pe=O(null),me=O(null),he=O(null),ge=O(null),[_e,ve]=M({tooltipStyles:{},tooltipArrowStyles:{},place:c}),[ye,be]=M(!1),[xe,Se]=M(!1),[B,Ce]=M(null),V=O(!1),H=O(null),{anchorRefs:U,setActiveAnchor:we}=cv(t),Te=O(!1),[Ee,De]=M([]),Oe=O(!1),ke=f||d.includes(`click`),Ae=ke||D?.click||D?.dblclick||D?.mousedown,je=D?{...D}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!D&&ke&&Object.assign(je,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});let Me=A?{...A}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!A&&ke&&Object.assign(Me,{mouseleave:!1,blur:!1,mouseout:!1});let Ne=j?{...j}:{escape:C||!1,scroll:T||!1,resize:E||!1,clickOutsideAnchor:Ae||!1};ee&&(Object.assign(je,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(Me,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ne,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),rv((()=>(Oe.current=!0,()=>{Oe.current=!1})),[]);let W=e=>{Oe.current&&(e&&Se(!0),setTimeout((()=>{Oe.current&&(ae?.(e),ie===void 0&&be(e))}),10))};g((()=>{if(t){if(ye){n(oe);let r=e(R),i=[...new Set([...r,t])].filter(Boolean).join(` `);R?.setAttribute(`aria-describedby`,i)}else n(R);return()=>{n(R),n(oe)}}function e(e){return(e?.getAttribute(`aria-describedby`))?.split(` `)||[]}function n(n){let r=e(n).filter((e=>e!==t));r.length?n?.setAttribute(`aria-describedby`,r.join(` `)):n?.removeAttribute(`aria-describedby`)}}),[R,ye,t,oe]),g((()=>{if(ie===void 0)return()=>null;ie&&Se(!0);let e=setTimeout((()=>{be(ie)}),10);return()=>{clearTimeout(e)}}),[ie]),g((()=>{if(ye!==V.current){if(iv(ge),V.current=ye,ye)N?.();else{let e=(e=>{let t=e.match(/^([\d.]+)(ms|s)$/);if(!t)return 0;let[,n,r]=t;return Number(n)*(r===`ms`?1:1e3)})(getComputedStyle(document.body).getPropertyValue(`--rt-transition-show-delay`));ge.current=setTimeout((()=>{Se(!1),Ce(null),P?.()}),e+25)}}}),[ye]);let Pe=e=>{ve((t=>ev(t,e)?t:e))},Fe=(e=_)=>{iv(me),xe?W(!0):me.current=setTimeout((()=>{W(!0)}),e)},Ie=(e=v)=>{iv(he),he.current=setTimeout((()=>{Te.current||W(!1)}),e)},Le=e=>{if(!e)return;let t=e.currentTarget??e.target;if(!t?.isConnected)return z(null),void we({current:null});_?Fe():W(!0),z(t),we({current:t}),iv(he)},Re=()=>{S?Ie(v||100):v?Ie():W(!1),iv(me)},ze=({x:e,y:t})=>{X_({place:B?.place??c,offset:u,elementReference:{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t})},tooltipReference:fe.current,tooltipArrowReference:pe.current,strategy:p,middlewares:m,border:se,arrowSize:ue}).then((e=>{Pe(e)}))},Be=e=>{if(!e)return;let t=e,n={x:t.clientX,y:t.clientY};ze(n),H.current=n},Ve=e=>{if(!ye)return;let t=e.target;t.isConnected&&(fe.current?.contains(t)||[document.querySelector(`[id='${o}']`),...Ee].some((e=>e?.contains(t)))||(W(!1),iv(me)))},He=Q_(Le,50,!0),Ue=Q_(Re,50,!0),We=e=>{Ue.cancel(),He(e)},Ge=()=>{He.cancel(),Ue()},Ke=k((()=>{let e=B?.position??ne;e?ze(e):y?H.current&&ze(H.current):R!=null&&R.isConnected&&X_({place:B?.place??c,offset:u,elementReference:R,tooltipReference:fe.current,tooltipArrowReference:pe.current,strategy:p,middlewares:m,border:se,arrowSize:ue}).then((e=>{Oe.current&&Pe(e)}))}),[ye,R,I,te,c,B?.place,u,p,ne,B?.position,y,ue]);g((()=>{var e,t;let n=new Set(U);Ee.forEach((e=>{F!=null&&F(e)||n.add({current:e})}));let r=document.querySelector(`[id='${o}']`);r&&!(F!=null&&F(r))&&n.add({current:r});let i=()=>{W(!1)},a=nv(R),s=nv(fe.current);Ne.scroll&&(window.addEventListener(`scroll`,i),a?.addEventListener(`scroll`,i),s?.addEventListener(`scroll`,i));let c=null;Ne.resize?window.addEventListener(`resize`,i):R&&fe.current&&(c=l(R,fe.current,Ke,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));let u=e=>{e.key===`Escape`&&W(!1)};Ne.escape&&window.addEventListener(`keydown`,u),Ne.clickOutsideAnchor&&window.addEventListener(`click`,Ve);let d=[],f=e=>!!(e?.target&&R?.contains(e.target)),p=e=>{ye&&f(e)||Le(e)},m=e=>{ye&&f(e)&&Re()},h=[`mouseover`,`mouseout`,`mouseenter`,`mouseleave`,`focus`,`blur`],g=[`click`,`dblclick`,`mousedown`,`mouseup`];Object.entries(je).forEach((([e,t])=>{t&&(h.includes(e)?d.push({event:e,listener:We}):g.includes(e)&&d.push({event:e,listener:p}))})),Object.entries(Me).forEach((([e,t])=>{t&&(h.includes(e)?d.push({event:e,listener:Ge}):g.includes(e)&&d.push({event:e,listener:m}))})),y&&d.push({event:`pointermove`,listener:Be});let _=()=>{Te.current=!0},v=()=>{Te.current=!1,Re()},b=S&&(Me.mouseout||Me.mouseleave);return b&&((e=fe.current)==null||e.addEventListener(`mouseover`,_),(t=fe.current)==null||t.addEventListener(`mouseout`,v)),d.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;(r=n.current)==null||r.addEventListener(e,t)}))})),()=>{var e,t;Ne.scroll&&(window.removeEventListener(`scroll`,i),a?.removeEventListener(`scroll`,i),s?.removeEventListener(`scroll`,i)),Ne.resize?window.removeEventListener(`resize`,i):c?.(),Ne.clickOutsideAnchor&&window.removeEventListener(`click`,Ve),Ne.escape&&window.removeEventListener(`keydown`,u),b&&((e=fe.current)==null||e.removeEventListener(`mouseover`,_),(t=fe.current)==null||t.removeEventListener(`mouseout`,v)),d.forEach((({event:e,listener:t})=>{n.forEach((n=>{var r;(r=n.current)==null||r.removeEventListener(e,t)}))}))}}),[R,Ke,xe,U,Ee,D,A,j,ke,_,v]),g((()=>{let e=B?.anchorSelect??s??``;!e&&t&&(e=`[data-tooltip-id='${t.replace(/'/g,`\\'`)}']`);let n=new MutationObserver((n=>{let r=[],i=[];n.forEach((n=>{if(n.type===`attributes`&&n.attributeName===`data-tooltip-id`&&(n.target.getAttribute(`data-tooltip-id`)===t?r.push(n.target):n.oldValue===t&&i.push(n.target)),n.type===`childList`){if(R){let t=[...n.removedNodes].filter((e=>e.nodeType===1));if(e)try{i.push(...t.filter((t=>t.matches(e)))),i.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch{}t.some((e=>!!(e?.contains)?.call(e,R)&&(Se(!1),W(!1),z(null),iv(me),iv(he),!0)))}if(e)try{let t=[...n.addedNodes].filter((e=>e.nodeType===1));r.push(...t.filter((t=>t.matches(e)))),r.push(...t.flatMap((t=>[...t.querySelectorAll(e)])))}catch{}}})),(r.length||i.length)&&De((e=>[...e.filter((e=>!i.includes(e))),...r]))}));return n.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-tooltip-id`],attributeOldValue:!0}),()=>{n.disconnect()}}),[t,s,B?.anchorSelect,R]),g((()=>{Ke()}),[Ke]),g((()=>{if(!re?.current)return()=>null;let e=new ResizeObserver((()=>{setTimeout((()=>Ke()))}));return e.observe(re.current),()=>{e.disconnect()}}),[I,re?.current]),g((()=>{let e=document.querySelector(`[id='${o}']`),t=[...Ee,e];R&&t.includes(R)||z(Ee[0]??e)}),[o,Ee,R]),g((()=>(L&&W(!0),()=>{iv(me),iv(he)})),[]),g((()=>{let e=B?.anchorSelect??s;if(!e&&t&&(e=`[data-tooltip-id='${t.replace(/'/g,`\\'`)}']`),e)try{let t=Array.from(document.querySelectorAll(e));De(t)}catch{De([])}}),[t,s,B?.anchorSelect]),g((()=>{me.current&&(iv(me),Fe(_))}),[_]);let qe=B?.content??I,Je=ye&&Object.keys(_e.tooltipStyles).length>0;return w(e,(()=>({open:e=>{if(e?.anchorSelect)try{document.querySelector(e.anchorSelect)}catch{console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`);return}Ce(e??null),e?.delay?Fe(e.delay):W(!0)},close:e=>{e?.delay?Ie(e.delay):W(!1)},activeAnchor:R,place:_e.place,isOpen:!!(xe&&!b&&qe&&Je)}))),xe&&!b&&qe?r.createElement(h,{id:t,role:de,className:(0,G_.default)(`react-tooltip`,lv.tooltip,uv.tooltip,uv[a],n,`react-tooltip__place-${_e.place}`,lv[Je?`show`:`closing`],Je?`react-tooltip__show`:`react-tooltip__closing`,p===`fixed`&&lv.fixed,S&&lv.clickable),onTransitionEnd:e=>{iv(ge),ye||e.propertyName!==`opacity`||(Se(!1),Ce(null),P?.())},style:{...te,..._e.tooltipStyles,opacity:ce!==void 0&&Je?ce:void 0},ref:fe},r.createElement(h,{className:(0,G_.default)(`react-tooltip-content-wrapper`,lv.content,uv.content)},qe),r.createElement(h,{className:(0,G_.default)(`react-tooltip-arrow`,lv.arrow,uv.arrow,i,x&&lv.noArrow),style:{..._e.tooltipArrowStyles,background:le?`linear-gradient(to right bottom, transparent 50%, ${le} 50%)`:void 0,"--rt-arrow-size":`${ue}px`},ref:pe})):null},fv=({content:e})=>r.createElement(`span`,{dangerouslySetInnerHTML:{__html:e}}),pv=r.forwardRef((({id:e,anchorId:t,anchorSelect:n,content:i,html:a,render:o,className:s,classNameArrow:c,variant:l=`dark`,place:u=`top`,offset:d=10,wrapper:f=`div`,children:p=null,events:m=[`hover`],openOnClick:h=!1,positionStrategy:_=`absolute`,middlewares:v,delayShow:y=0,delayHide:b=0,float:x=!1,hidden:S=!1,noArrow:C=!1,clickable:w=!1,closeOnEsc:T=!1,closeOnScroll:E=!1,closeOnResize:D=!1,openEvents:k,closeEvents:A,globalCloseEvents:j,imperativeModeOnly:ee=!1,style:te,position:ne,isOpen:N,defaultIsOpen:P=!1,disableStyleInjection:F=!1,border:I,opacity:re,arrowColor:ie,arrowSize:L,setIsOpen:ae,afterShow:oe,afterHide:R,disableTooltip:z,role:se=`tooltip`},ce)=>{let[le,ue]=M(i),[de,fe]=M(a),[pe,me]=M(u),[he,ge]=M(l),[_e,ve]=M(d),[ye,be]=M(y),[xe,Se]=M(b),[B,Ce]=M(x),[V,H]=M(S),[U,we]=M(f),[Te,Ee]=M(m),[De,Oe]=M(_),[ke,Ae]=M(null),[je,Me]=M(null),Ne=O(null),W=O(F),{anchorRefs:Pe,activeAnchor:Fe}=cv(e),Ie=e=>e?.getAttributeNames().reduce(((t,n)=>(n.startsWith(`data-tooltip-`)&&(t[n.replace(/^data-tooltip-/,``)]=e?.getAttribute(n)??null),t)),{}),Le=e=>{let t={place:e=>{me(e??u)},content:e=>{ue(e??i)},html:e=>{fe(e??a)},variant:e=>{ge(e??l)},offset:e=>{ve(e===null?d:Number(e))},wrapper:e=>{we(e??f)},events:e=>{let t=e?.split(` `);Ee(t??m)},"position-strategy":e=>{Oe(e??_)},"delay-show":e=>{be(e===null?y:Number(e))},"delay-hide":e=>{Se(e===null?b:Number(e))},float:e=>{Ce(e===null?x:e===`true`)},hidden:e=>{H(e===null?S:e===`true`)},"class-name":e=>{Ae(e)}};Object.values(t).forEach((e=>e(null))),Object.entries(e).forEach((([e,n])=>{var r;(r=t[e])==null||r.call(t,n)}))};g((()=>{ue(i)}),[i]),g((()=>{fe(a)}),[a]),g((()=>{me(u)}),[u]),g((()=>{ge(l)}),[l]),g((()=>{ve(d)}),[d]),g((()=>{be(y)}),[y]),g((()=>{Se(b)}),[b]),g((()=>{Ce(x)}),[x]),g((()=>{H(S)}),[S]),g((()=>{Oe(_)}),[_]),g((()=>{W.current!==F&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[F]),g((()=>{typeof window<`u`&&window.dispatchEvent(new CustomEvent(`react-tooltip-inject-styles`,{detail:{disableCore:F===`core`,disableBase:F}}))}),[]),g((()=>{let r=new Set(Pe),i=n;if(!i&&e&&(i=`[data-tooltip-id='${e.replace(/'/g,`\\'`)}']`),i)try{document.querySelectorAll(i).forEach((e=>{r.add({current:e})}))}catch{console.warn(`[react-tooltip] "${i}" is not a valid CSS selector`)}let a=document.querySelector(`[id='${t}']`);if(a&&r.add({current:a}),!r.size)return()=>null;let o=je??a??Fe.current,s=new MutationObserver((e=>{e.forEach((e=>{if(!o||e.type!==`attributes`||!e.attributeName?.startsWith(`data-tooltip-`))return;let t=Ie(o);Le(t)}))})),c={attributes:!0,childList:!1,subtree:!1};if(o){let e=Ie(o);Le(e),s.observe(o,c)}return()=>{s.disconnect()}}),[Pe,Fe,je,t,n]),g((()=>{te!=null&&te.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),I&&!Z_(`border`,`${I}`)&&console.warn(`[react-tooltip] "${I}" is not a valid \`border\`.`),te!=null&&te.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),re&&!Z_(`opacity`,`${re}`)&&console.warn(`[react-tooltip] "${re}" is not a valid \`opacity\`.`)}),[]);let Re=p,ze=O(null);if(o){let e=o({content:je?.getAttribute(`data-tooltip-content`)||le||null,activeAnchor:je});Re=e?r.createElement(`div`,{ref:ze,className:`react-tooltip-content-wrapper`},e):null}else le&&(Re=le);de&&(Re=r.createElement(fv,{content:de}));let Be={forwardRef:ce,id:e,anchorId:t,anchorSelect:n,className:(0,G_.default)(s,ke),classNameArrow:c,content:Re,contentWrapperRef:ze,place:pe,variant:he,offset:_e,wrapper:U,events:Te,openOnClick:h,positionStrategy:De,middlewares:v,delayShow:ye,delayHide:xe,float:B,hidden:V,noArrow:C,clickable:w,closeOnEsc:T,closeOnScroll:E,closeOnResize:D,openEvents:k,closeEvents:A,globalCloseEvents:j,imperativeModeOnly:ee,style:te,position:ne,isOpen:N,defaultIsOpen:P,border:I,opacity:re,arrowColor:ie,arrowSize:L,setIsOpen:ae,afterShow:oe,afterHide:R,disableTooltip:z,activeAnchor:je,previousActiveAnchor:Ne.current,setActiveAnchor:e=>{Me((t=>(e!=null&&e.isSameNode(t)||(Ne.current=t),e)))},role:se};return r.createElement(dv,{...Be})}));typeof window<`u`&&window.addEventListener(`react-tooltip-inject-styles`,(e=>{e.detail.disableCore||Y_({css:`:root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.core-styles-module_content__BRKdB{position:relative;z-index:1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}`,type:`core`}),e.detail.disableBase||Y_({css:`
|
|
4
|
-
.styles-module_tooltip__mnnfp{border-radius:3px;font-size:90%;width:max-content}.styles-module_content__ydYdI{background:inherit;border-radius:inherit;padding:8px 16px}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:`base`})})),c();var mv={indexes:[],chapters:[],thumbnails:[],requestThumbnail:()=>{},seekPreview:!1,subtitleTracks:[],selectedSubtitleTrack:void 0,selectSubtitleTrack:()=>{},audioTracks:[],selectedAudioTrack:void 0,selectAudioTrack:()=>{},hideUI:!1,setHideUI:()=>{},hasMedia:!1,togglePictureInPicture:null,passThroughPictureInPicture:null,pictureInPictureMode:null,burnedInSubtitles:!1,playbackError:null,playbackErrors:[],ready:!1,setSourceState:()=>{}},hv=Jl({name:`source`,state:()=>({...mv}),attach({set:e}){e({setSourceState:t=>e(t),setHideUI:t=>e({hideUI:t})})}}),gv=Kf({features:[...Xd,hv],displayName:`MediaPlayer`}),Q=gv.usePlayer,_v=e=>{if(e&&e!==`und`)try{return new Intl.DisplayNames([navigator.language||`en`],{type:`language`,fallback:`none`}).of(e)||void 0}catch{return}},vv=e=>e?.replace(/_/g,` `).trim()||void 0,yv=e=>{let t=e.map(e=>_v(e.language)??vv(e.title)??`Track ${e.streamIndex}`),n=t.reduce((e,t)=>({...e,[t]:(e[t]??0)+1}),{});return e.map((e,r)=>{let i=t[r],a=vv(e.title);return{track:e,label:(n[i]??0)>1&&a&&a!==i?`${i} (${a})`:i}})},bv=e=>yv(e).map(({track:e,label:t})=>({id:e.streamIndex,label:t})),xv=[0,250,1e3,3e3,1e4],Sv=6e4,Cv=500,wv=15e3,Tv=e=>e instanceof Error?e.message:String(e),Ev=e=>{let t=[],n=e?.cause;for(let e=0;n!=null&&e<8;e++){if(typeof MediaError<`u`&&n instanceof MediaError){t.push(`MediaError code ${n.code}${n.message?`: ${n.message}`:``}`);break}t.push(Tv(n)),n=n?.cause}return t.length?t.join(`
|
|
5
|
-
`):void 0},Dv=(e,t,n)=>{let r=Q(),{read:i,size:a,publicPath:o=``,libavWorkerUrl:s=``,jassubWorkerUrl:c=``,jassubWasmUrl:l=``,jassubLegacyWasmUrl:u,defaultFontUrl:d,bufferSize:f,autoplay:p=!1,chapters:m,seekPrepareBudgetMs:h=Cv}=n??{},_=O(m);_.current=m;let[v,y]=M(void 0),[b,x]=M(0),S=O({count:0,at:0}),C=O(void 0);g(()=>(S.current={count:0,at:0},r.setSourceState({playbackErrors:[]}),()=>{C.current&&clearTimeout(C.current)}),[a]);let w=O(null),T=O(null),E=O(!1),D=O(i);D.current=i;let A=O(n?.onSeek);A.current=n?.onSeek;let j=O(n?.onPlaybackError);j.current=n?.onPlaybackError;let ee=k(e=>{let t=typeof e==`number`?e:void 0;E.current=!0,r.setSourceState({selectedSubtitleTrack:t}),w.current?.selectSubtitleStream(t)},[r]),te=k(e=>{let t=w.current;if(!t||h<=0){r.seek(e);return}let n=typeof window<`u`&&window.__mediaPlayerSeekDebug,i=performance.now(),a=!1,o=`prepared`,s=()=>{if(!a&&(a=!0,r.seek(e),n)){let n=t.videoElement,r=0;if(n)for(let t=0;t<n.buffered.length;t++)n.buffered.start(t)<=e+1&&e<n.buffered.end(t)&&(r=n.buffered.end(t)-e);console.warn(`[media-player] seek to ${e.toFixed(2)} moved after ${Math.round(performance.now()-i)}ms via ${o}, runway ${r.toFixed(1)}s${o===`deadline`?` (EXPOSED: moved before its data was ready)`:``}`)}};r.setSourceState({seekingTo:e});let c=t.videoElement,l=()=>{c?.removeEventListener(`seeked`,l),clearTimeout(u),r.setSourceState({seekingTo:void 0})},u=setTimeout(l,wv);c?.addEventListener(`seeked`,l);let d=setTimeout(()=>{o=`deadline`,s()},h);t.prepareSeek(e).catch(()=>{}).finally(()=>{clearTimeout(d),s()})},[r,h]),ne=k(e=>{typeof e==`number`&&(r.setSourceState({selectedAudioTrack:e}),y(e))},[r]),N=Q(e=>e.setSourceState);g(()=>{N({selectSubtitleTrack:ee,selectAudioTrack:ne,requestSeek:te})},[N,ee,ne,te]),g(()=>{if(!e||!t||!a||!i)return;let n=!1;r.setSourceState({playbackError:null,ready:!1});let m=(t,n)=>{let i=Date.now(),a=Tv(t),o=Ev(t),s=r.playbackErrors,c=s[s.length-1];if(c&&c.message===a&&c.detail===o&&c.recovered===n){let e={...c,count:c.count+1,lastAt:i};r.setSourceState({playbackErrors:[...s.slice(0,-1),e]});return}let l={at:i,lastAt:i,count:1,atMediaTime:Number.isFinite(e.currentTime)?e.currentTime:void 0,message:a,detail:o,recovered:n};r.setSourceState({playbackErrors:[...s,l]})},h=e=>{if(n)return;let t=Ss(e);if(m(e,t),t){let t=performance.now();t-S.current.at>Sv&&(S.current={count:0,at:t});let n=xv[Math.min(S.current.count,xv.length-1)];S.current={count:S.current.count+1,at:t},console.warn(`the media element failed; rebuilding the pipeline${n?` in ${n}ms`:``}`,e),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>x(e=>e+1),n);return}console.error(`playback failed`,e),r.setSourceState({playbackError:e}),j.current?.(e)};return(async()=>{try{let i=await Ls({videoElement:e,subtitleContainer:t,read:(e,t)=>D.current(e,t),length:a,publicPath:o,libavWorkerUrl:s,jassubWorkerUrl:c,jassubWasmUrl:l,jassubLegacyWasmUrl:u,defaultFontUrl:d,bufferSize:f,audioStreamIndex:v,onReady:()=>{if(n)return;r.setSourceState({ready:!0});let t=T.current;T.current=null,t&&t.size===a&&t.time>0&&(e.currentTime=t.time),p&&e.play().catch(()=>{})},onError:h,onRecovered:()=>{n||r.setSourceState({playbackError:null})},onSeek:e=>A.current?.(e),onSubtitleStreams:e=>{n||r.setSourceState({subtitleTracks:bv(e),...E.current?{}:{selectedSubtitleTrack:e[0]?.streamIndex}})},onAudioStreams:(e,t)=>{n||r.setSourceState({audioTracks:bv(e),selectedAudioTrack:t})}});if(n){i.destroy();return}w.current=i,r.setSourceState({indexes:i.indexes,chapters:_.current??i.chapters});let m=r.selectedSubtitleTrack;typeof m==`number`&&i.selectSubtitleStream(m)}catch(e){h(e)}})(),()=>{n=!0,T.current={time:e.currentTime,size:a},w.current?.destroy(),w.current=null,r.setSourceState({ready:!1})}},[r,e,t,a,o,s,c,l,u,d,f,v,p,b])},Ov=5e3,kv=6e4,Av=({publicPath:e,workerUrl:t,length:n,read:r,downloadedRanges:i})=>{let[a,o]=M([]),s=O(null),c=O(r);c.current=r;let l=P(()=>i?.map(({startByteOffset:e,endByteOffset:t})=>[e,t]),[i?.map(({startByteOffset:e,endByteOffset:t})=>`${e}-${t}`).join(`,`)]),u=O(l);return u.current=l,g(()=>{if(!n||!r||!e||!t)return;let i=!1,a=null,l,d=Ov,f=()=>{qs({publicPath:e,workerUrl:t,length:n,read:(e,t)=>c.current(e,t),onThumbnails:e=>{i||o(e)}}).then(e=>{if(i){e.destroy();return}a=e,s.current=e,e.update(u.current)},()=>{i||(l=setTimeout(f,d),d=Math.min(d*2,kv))})};return f(),()=>{i=!0,clearTimeout(l),s.current=null,a?.destroy(),o([])}},[n,e,t]),g(()=>{s.current?.update(l)},[l]),{thumbnails:a,requestThumbnail:k(e=>{s.current?.prioritize(e)},[])}},jv=(e,t)=>{let n=O(null),[r,i]=M(!1),[a]=M(()=>tc());g(()=>{if(!e||!t||!a)return;let r=nc({video:e,subtitles:t,mode:a,onBurnedInChange:i});return n.current=r,()=>{r.destroy(),n.current=null,i(!1)}},[e,t,a]);let o=k(()=>{n.current?.toggle().catch(e=>{console.warn(`picture in picture was refused`,e)})},[]);return{toggle:e&&t&&a?o:null,mode:a,burnedIn:r}},Mv=`(hover: hover) and (pointer: fine)`,Nv=()=>typeof matchMedia==`function`?matchMedia(Mv):void 0,Pv=e=>{let t=Nv();return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},Fv=()=>!!Nv()?.matches,Iv=()=>!1,Lv=(e,t)=>{let[n,r]=M(!1),[i,a]=M(),o=O(t);t&&(o.current=t);let s=O(!1),c=k(e=>{s.current!==e&&(s.current=e,o.current?.onArmedChange(e))},[]),l=k(t=>{!e||e.readyState<1||e.error||(a(t),c(!0))},[e,c]),u=k(()=>{a(void 0),c(!1)},[c]),d=!!t&&!!e;g(()=>{if(!d||!e)return;let t=()=>{r(!0),u()},n=()=>r(!1);return e.addEventListener(`enterpictureinpicture`,t),e.addEventListener(`leavepictureinpicture`,n),()=>{e.removeEventListener(`enterpictureinpicture`,t),e.removeEventListener(`leavepictureinpicture`,n),r(!1),u()}},[e,d,u]);let f=p(Pv,Fv,Iv),[m,h]=M(!1);g(()=>{if(!d)return;let e=e=>{e.pointerType===`touch`&&h(!0)},t=e=>{e.pointerType!==`touch`&&h(!1)};return window.addEventListener(`pointerdown`,e,{capture:!0,passive:!0}),window.addEventListener(`pointermove`,t,{capture:!0,passive:!0}),()=>{window.removeEventListener(`pointerdown`,e,{capture:!0}),window.removeEventListener(`pointermove`,t,{capture:!0})}},[d]);let _=d&&f&&!m;g(()=>{_||u()},[_,u]);let v=k(()=>{Promise.resolve(e?.exitPictureInPicture?.()).catch(e=>{console.warn(`leaving picture in picture was refused`,e)})},[e]);return P(()=>_?{active:n,armed:i,arm:l,disarm:u,exit:v}:null,[_,n,i,l,u,v])},Rv={headings:{large:`
|
|
6
|
-
font-weight: 600;
|
|
7
|
-
font-size: calc(2.8 * var(--mp-unit));
|
|
8
|
-
line-height: calc(3.4 * var(--mp-unit));
|
|
9
|
-
@media (min-width: 960px) {
|
|
10
|
-
font-size: calc(3.4 * var(--mp-unit));
|
|
11
|
-
line-height: calc(4.1 * var(--mp-unit));
|
|
12
|
-
}
|
|
13
|
-
`,medium:`
|
|
14
|
-
font-weight: 600;
|
|
15
|
-
font-size: calc(2.4 * var(--mp-unit));
|
|
16
|
-
line-height: calc(2.9 * var(--mp-unit));
|
|
17
|
-
@media (min-width: 960px) {
|
|
18
|
-
font-size: calc(2.8 * var(--mp-unit));
|
|
19
|
-
line-height: calc(3.4 * var(--mp-unit));
|
|
20
|
-
}
|
|
21
|
-
`,small:`
|
|
22
|
-
font-weight: 500;
|
|
23
|
-
font-size: calc(1.8 * var(--mp-unit));
|
|
24
|
-
line-height: calc(1.9 * var(--mp-unit));
|
|
25
|
-
@media (min-width: 960px) {
|
|
26
|
-
font-size: calc(1.8 * var(--mp-unit));
|
|
27
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
28
|
-
}
|
|
29
|
-
@media (min-width: 2560px) {
|
|
30
|
-
font-size: calc(2.2 * var(--mp-unit));
|
|
31
|
-
line-height: calc(2.6 * var(--mp-unit));
|
|
32
|
-
}
|
|
33
|
-
`,extraSmall:`
|
|
34
|
-
font-weight: 500;
|
|
35
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
36
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
37
|
-
@media (min-width: 960px) {
|
|
38
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
39
|
-
line-height: calc(1.9 * var(--mp-unit));
|
|
40
|
-
}
|
|
41
|
-
`},bLarge:{bold:`
|
|
42
|
-
font-weight: 600;
|
|
43
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
44
|
-
line-height: calc(2 * var(--mp-unit));
|
|
45
|
-
@media (min-width: 960px) {
|
|
46
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
47
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
48
|
-
}
|
|
49
|
-
`,medium:`
|
|
50
|
-
font-weight: 500;
|
|
51
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
52
|
-
line-height: calc(2 * var(--mp-unit));
|
|
53
|
-
@media (min-width: 960px) {
|
|
54
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
55
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
56
|
-
}
|
|
57
|
-
`,regular:`
|
|
58
|
-
font-weight: 400;
|
|
59
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
60
|
-
line-height: calc(2 * var(--mp-unit));
|
|
61
|
-
@media (min-width: 960px) {
|
|
62
|
-
font-size: calc(1.6 * var(--mp-unit));
|
|
63
|
-
line-height: calc(2.2 * var(--mp-unit));
|
|
64
|
-
}
|
|
65
|
-
`},bMedium:{bold:`
|
|
66
|
-
font-weight: 600;
|
|
67
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
68
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
69
|
-
@media (min-width: 960px) {
|
|
70
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
71
|
-
line-height: calc(2 * var(--mp-unit));
|
|
72
|
-
}
|
|
73
|
-
`,medium:`
|
|
74
|
-
font-weight: 500;
|
|
75
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
76
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
77
|
-
@media (min-width: 960px) {
|
|
78
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
79
|
-
line-height: calc(2 * var(--mp-unit));
|
|
80
|
-
}
|
|
81
|
-
`,regular:`
|
|
82
|
-
font-weight: 400;
|
|
83
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
84
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
85
|
-
@media (min-width: 960px) {
|
|
86
|
-
font-size: calc(1.4 * var(--mp-unit));
|
|
87
|
-
line-height: calc(2 * var(--mp-unit));
|
|
88
|
-
}
|
|
89
|
-
`},bSmall:{bold:`
|
|
90
|
-
font-weight: 600;
|
|
91
|
-
font-size: calc(1 * var(--mp-unit));
|
|
92
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
93
|
-
@media (min-width: 960px) {
|
|
94
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
95
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
96
|
-
}
|
|
97
|
-
`,medium:`
|
|
98
|
-
font-weight: 500;
|
|
99
|
-
font-size: calc(1 * var(--mp-unit));
|
|
100
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
101
|
-
@media (min-width: 960px) {
|
|
102
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
103
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
104
|
-
}
|
|
105
|
-
`,regular:`
|
|
106
|
-
font-weight: 400;
|
|
107
|
-
font-size: calc(1 * var(--mp-unit));
|
|
108
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
109
|
-
@media (min-width: 960px) {
|
|
110
|
-
font-size: calc(1.2 * var(--mp-unit));
|
|
111
|
-
line-height: calc(1.7 * var(--mp-unit));
|
|
112
|
-
}
|
|
113
|
-
`},bExtraSmall:{bold:`
|
|
114
|
-
font-weight: 600;
|
|
115
|
-
font-size: calc(0.8 * var(--mp-unit));
|
|
116
|
-
line-height: calc(1.1 * var(--mp-unit));
|
|
117
|
-
@media (min-width: 960px) {
|
|
118
|
-
font-size: calc(1 * var(--mp-unit));
|
|
119
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
120
|
-
}
|
|
121
|
-
`,medium:`
|
|
122
|
-
font-weight: 500;
|
|
123
|
-
font-size: calc(0.8 * var(--mp-unit));
|
|
124
|
-
line-height: calc(1.1 * var(--mp-unit));
|
|
125
|
-
@media (min-width: 960px) {
|
|
126
|
-
font-size: calc(1 * var(--mp-unit));
|
|
127
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
128
|
-
}
|
|
129
|
-
`,regular:`
|
|
130
|
-
font-weight: 400;
|
|
131
|
-
font-size: calc(0.8 * var(--mp-unit));
|
|
132
|
-
line-height: calc(1.1 * var(--mp-unit));
|
|
133
|
-
@media (min-width: 960px) {
|
|
134
|
-
font-size: calc(1 * var(--mp-unit));
|
|
135
|
-
line-height: calc(1.4 * var(--mp-unit));
|
|
136
|
-
}
|
|
137
|
-
`}},zv=f`
|
|
138
|
-
display: flex;
|
|
139
|
-
justify-content: center;
|
|
140
|
-
align-items: center;
|
|
141
|
-
|
|
142
|
-
canvas {
|
|
143
|
-
top: unset !important;
|
|
144
|
-
left: unset !important;
|
|
145
|
-
width: 100%;
|
|
146
|
-
height: 100%;
|
|
147
|
-
margin: auto;
|
|
148
|
-
pointer-events: none;
|
|
149
|
-
}
|
|
150
|
-
`,Bv=f`
|
|
151
|
-
position: absolute;
|
|
152
|
-
top: 0;
|
|
153
|
-
left: 0;
|
|
154
|
-
width: 100%;
|
|
155
|
-
padding: calc(1.2 * var(--mp-unit)) calc(1.6 * var(--mp-unit));
|
|
156
|
-
/* clears a notch once the player is fullscreen; resolves to zero everywhere else */
|
|
157
|
-
padding-top: calc(calc(1.2 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
|
|
158
|
-
${Rv.headings.small}
|
|
159
|
-
color: white;
|
|
160
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
161
|
-
z-index: 2;
|
|
162
|
-
pointer-events: none;
|
|
163
|
-
|
|
164
|
-
/* one line with an ellipsis until there is width to wrap, since a release filename would
|
|
165
|
-
otherwise run to four lines on a phone */
|
|
166
|
-
white-space: nowrap;
|
|
167
|
-
overflow: hidden;
|
|
168
|
-
text-overflow: ellipsis;
|
|
169
|
-
|
|
170
|
-
@media (min-width: 768px) {
|
|
171
|
-
padding: calc(2.4 * var(--mp-unit));
|
|
172
|
-
padding-top: calc(calc(2.4 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
|
|
173
|
-
white-space: normal;
|
|
174
|
-
overflow: visible;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.1) 80%, transparent 100%);
|
|
178
|
-
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
179
|
-
`,Vv=i`
|
|
180
|
-
to { transform: rotate(360deg); }
|
|
181
|
-
`,Hv=f`
|
|
182
|
-
position: absolute;
|
|
183
|
-
inset: 0;
|
|
184
|
-
z-index: 2;
|
|
185
|
-
display: flex;
|
|
186
|
-
justify-content: center;
|
|
187
|
-
align-items: center;
|
|
188
|
-
pointer-events: none;
|
|
189
|
-
|
|
190
|
-
::after {
|
|
191
|
-
content: '';
|
|
192
|
-
width: calc(4 * var(--mp-unit));
|
|
193
|
-
height: calc(4 * var(--mp-unit));
|
|
194
|
-
border-radius: 50%;
|
|
195
|
-
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
196
|
-
border-top-color: #fff;
|
|
197
|
-
animation: ${Vv} 0.8s linear infinite;
|
|
198
|
-
}
|
|
199
|
-
`,Uv=f`
|
|
200
|
-
position: absolute;
|
|
201
|
-
inset: auto 0 20%;
|
|
202
|
-
z-index: 3;
|
|
203
|
-
padding: 0 calc(2 * var(--mp-unit));
|
|
204
|
-
text-align: center;
|
|
205
|
-
color: #fff;
|
|
206
|
-
${Rv.bLarge.regular}
|
|
207
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
208
|
-
pointer-events: none;
|
|
209
|
-
`,Wv=e=>e instanceof Error?e.message:typeof e==`string`?e:`Playback failed`,Gv=({onSubtitleRef:e})=>{let t=Q(e=>e.title),n=Q(e=>e.hideUI),r=Q(e=>e.playbackError),i=Q(e=>e.ready),a=Q(e=>e.size),o=Q(e=>e.waiting),s=Q(e=>e.seekingTo);return _(F,{children:[t?L(`div`,{className:`title`,css:Bv,style:{...n?{opacity:`0`,pointerEvents:`none`}:{}},children:t}):void 0,((a?!i:o)||s!==void 0)&&!r?L(`div`,{css:Hv}):void 0,r?L(`div`,{css:Uv,children:Wv(r)}):void 0,L(`div`,{className:`subtitles`,ref:e,css:zv})]})},Kv=1e-4,qv=1,Jv=e=>Math.max(Kv,Math.min(qv,e))**2,Yv=e=>Math.max(Kv,Math.min(qv,e))**(qv/2),Xv=e=>{if(e===void 0)return`0:00`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${n<10?`0`:``}${n}:${r<10?`0`:``}${r}`:`${n}:${r<10?`0`:``}${r}`},Zv=(e,t)=>`${Xv(e)} / ${Xv(t)}`,Qv=e=>f`
|
|
210
|
-
display: flex;
|
|
211
|
-
justify-content: flex-start;
|
|
212
|
-
|
|
213
|
-
/*
|
|
214
|
-
* Bounded here rather than at each call site.
|
|
215
|
-
*
|
|
216
|
-
* react-tooltip's own chip rule carries width: max-content, so with nothing opposing it a chip
|
|
217
|
-
* grows to the widest UNWRAPPED line of its content: a two sentence tooltip measured 1178px
|
|
218
|
-
* through this component. Both declarations are load bearing, since a bound with no wrapping only
|
|
219
|
-
* moves the overflow inside a narrow box. 26 units is the width control-bar.tsx was already
|
|
220
|
-
* imposing on its own two line tooltip by hand, so nothing in the bar changes shape.
|
|
221
|
-
*/
|
|
222
|
-
max-width: min(calc(26 * var(--mp-unit)), calc(100vw - calc(2.4 * var(--mp-unit))));
|
|
223
|
-
white-space: normal;
|
|
224
|
-
overflow-wrap: anywhere;
|
|
225
|
-
text-align: left;
|
|
226
|
-
|
|
227
|
-
/*
|
|
228
|
-
* The radius carries !important for the same reason the paddings below do.
|
|
229
|
-
*
|
|
230
|
-
* react-tooltip injects its stylesheet from a passive effect while emotion inserts through
|
|
231
|
-
* useInsertionEffect, which runs earlier, so react-tooltip's sheet lands in the head LAST at
|
|
232
|
-
* exactly this specificity and wins every tie. Its own radius is 3px, which is what was drawn
|
|
233
|
-
* here until this was stated.
|
|
234
|
-
*/
|
|
235
|
-
border-radius: calc(0.4 * var(--mp-unit))!important;
|
|
236
|
-
user-select: none;
|
|
237
|
-
|
|
238
|
-
z-index: 3;
|
|
239
|
-
|
|
240
|
-
* {
|
|
241
|
-
${Rv.bMedium.regular}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
${e===`sm`&&f`
|
|
245
|
-
padding: calc(0.4 * var(--mp-unit))!important;
|
|
246
|
-
`}
|
|
247
|
-
${e===`md`&&f`
|
|
248
|
-
padding: calc(0.6 * var(--mp-unit))!important;
|
|
249
|
-
`}
|
|
250
|
-
${e===`lg`&&f`
|
|
251
|
-
padding: calc(1.2 * var(--mp-unit))!important;
|
|
252
|
-
`}
|
|
253
|
-
`,$v={x:-1,y:-1,anchors:0},ey=e=>{$v.x=e.clientX,$v.y=e.clientY},ty=()=>($v.anchors++===0&&window.addEventListener(`pointermove`,ey,{capture:!0,passive:!0}),()=>{--$v.anchors===0&&window.removeEventListener(`pointermove`,ey,{capture:!0})}),ny=({id:e,toolTipText:t,text:n,delayShow:r=0,closeDelay:i=0,offset:a=20,tooltipPlace:o=`top`,disabled:s=!1,size:c=`md`})=>{let l=O(null),u=O(null);return g(()=>{let e=ty(),t=()=>{let e=l.current;if(!e)return;let{left:t,right:n,top:r,bottom:i}=e.getBoundingClientRect();$v.x>=t&&$v.x<n&&$v.y>=r&&$v.y<i||u.current?.close()},n=[`fullscreenchange`,`webkitfullscreenchange`];for(let e of n)document.addEventListener(e,t);return()=>{e();for(let e of n)document.removeEventListener(e,t)}},[]),_(F,{children:[L(`div`,{ref:l,"data-tooltip-id":e,"data-open":!0,"data-tooltip-offset":a,"data-tooltip-delay-show":r,"data-tooltip-delay-hide":i,"data-tooltip-place":o,children:n}),!s&&L(pv,{ref:u,css:Qv(c),id:e,noArrow:!0,children:t})]})},ry=({ref:e,onChange:t,orientation:n=`horizontal`,disabled:r=!1})=>{let[i,a]=M(!1),o=O(t);o.current=t;let s=O(null),c=k((t,r)=>{let i=e.current;if(!i)return 0;let{left:a,right:o,top:s,bottom:c}=i.getBoundingClientRect(),l=n===`horizontal`?(t-a)/(o-a):(c-r)/(c-s);return Math.min(Math.max(l,0),1)},[e,n]),l=k(e=>{if(!(r||e.button>0)){s.current=e.pointerId;try{e.currentTarget.setPointerCapture?.(e.pointerId)}catch{}a(!0),o.current(c(e.clientX,e.clientY))}},[r,c]),u=k(e=>{s.current===e.pointerId&&o.current(c(e.clientX,e.clientY))},[c]),d=k(e=>{if(s.current===e.pointerId){s.current=null;try{e.currentTarget.releasePointerCapture?.(e.pointerId)}catch{}a(!1)}},[]);return g(()=>{r&&(s.current=null,a(!1))},[r]),{dragging:i,handlers:{onPointerDown:l,onPointerMove:u,onPointerUp:d,onPointerCancel:d,style:{touchAction:`none`}}}},iy=2,ay=.005,oy=`#000`,sy=`#0000`,cy=(e,t)=>{if(!t)return[];let n=new Set;for(let{start:r,end:i}of e)for(let e of[r,i]){let r=e/t;r<=ay||r>=.995||n.add(Number((r*100).toFixed(4)))}return n.size?[0,...[...n].sort((e,t)=>e-t),100]:[]},ly=(e,t)=>{let n=iy/2,r=e.length-2,i=[];for(let a=0;a<=r;a+=1){let o=e[a],s=e[a+1],c=a===0?`0%`:`calc(${o}% + ${n}px)`,l=a===r?`100%`:`calc(${s}% - ${n}px)`;i.push(`${t(a)?oy:sy} ${c} ${l}`),a!==r&&i.push(`${sy} calc(${s}% - ${n}px) calc(${s}% + ${n}px)`)}return`linear-gradient(90deg, ${i.join(`, `)})`},uy=new Set([`op`,`ops`,`opening`,`openings`,`ncop`,`オープニング`,`op主題歌`]),dy=new Set([`ed`,`eds`,`ending`,`endings`,`nced`,`credits`,`endcard`,`endroll`,`エンディング`,`エンドカード`,`エンドロール`,`ed主題歌`]),fy=new Set([`intro`,`イントロ`]),py=new Set([`outro`,`アウトロ`]),my={"credits start":`ending`,"credits end":null,"preview end":null,"end credits":`ending`,"closing credits":`ending`},hy=new Set([`theme`,`themes`,`song`,`sequence`,`nc`,`non`,`credit`,`creditless`,`textless`,`clean`,`tv`,`size`,`version`,`ver`,`full`,`the`,`主題歌`,`ノンクレジット`]),gy=new Set([`post`,`pre`,`after`,`before`,`non`]),_y=/[-:|~/\\[\]()「」『』【】,.!?"'’]|\s+by\s+/u,vy=e=>!e.trim()||/^chapter\s*\d+$/i.test(e.trim())||/^\d{1,2}:\d{2}:\d{2}([.,]\d+)?$/.test(e.trim()),yy=e=>e.replace(/([a-z-ヿ一-鿿])\s*\d+\s*$/u,`$1`).split(/[\s_]+/u).map(e=>e.replace(/^[^\w-ヿ一-鿿]+|[^\w-ヿ一-鿿]+$/gu,``)).filter(e=>e&&!/^\d+$/.test(e)&&!hy.has(e)),by=(e,t)=>{if(uy.has(e))return`opening`;if(dy.has(e))return`ending`;if(t){if(fy.has(e))return`opening`;if(py.has(e))return`ending`}},xy=(e,t)=>{if(vy(e))return;let n=e.trim().toLowerCase().replace(/\s+/gu,` `);if(n in my)return my[n]??void 0;let r=n.split(_y).map(e=>e.trim()).filter(Boolean);if(r.some(e=>e.split(/[\s_]+/u).some(e=>gy.has(e))))return;let i=r.length>1?[r[0],r.at(-1)]:r;for(let e of i){let n=yy(e);if(n.length!==1)continue;let r=by(n[0],t);if(r)return r}},Sy=15,Cy=87,wy=93,Ty=e=>{let t=e.map(()=>void 0),n=e.at(-1)?.end??0;if(!n)return t;let r=e.map((e,t)=>({index:t,start:e.start,length:e.end-e.start})).filter(({length:e})=>e>=Cy&&e<=wy),i=n/2,a=r.filter(({start:e})=>e<i),o=r.filter(({start:e})=>e>=i);return a.length===1&&(t[a[0].index]=`opening`),o.length===1&&(t[o[0].index]=`ending`),t},Ey=e=>{let t=e.map(({title:e})=>xy(e,!1)),n=e.reduce((e,n,r)=>e+(t[r]?n.end-n.start:0),0),r=e.reduce((e,t)=>e+(t.end-t.start),0);if(r>0&&n*2>r)return e.map(()=>void 0);let i=e.map((e,n)=>{if(e.end-e.start<Sy)return;let r=t[n];if(r)return r;let i=xy(e.title,!0);return i&&!t.includes(i)?i:void 0});return e.every(({title:e})=>vy(e))?Ty(e):i},Dy=f`
|
|
254
|
-
position: relative;
|
|
255
|
-
height: calc(.4 * var(--mp-unit));
|
|
256
|
-
|
|
257
|
-
--thumbnail-width: calc(25 * var(--mp-unit));
|
|
258
|
-
--thumbnail-half: calc(12.5 * var(--mp-unit));
|
|
259
|
-
|
|
260
|
-
transition: transform .2s ease-in-out;
|
|
261
|
-
|
|
262
|
-
margin: 0 12px;
|
|
263
|
-
@media (min-width: 768px) {
|
|
264
|
-
margin: 0 16px;
|
|
265
|
-
}
|
|
266
|
-
@media (min-width: 2560px) {
|
|
267
|
-
margin: 0 24px;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
user-select: none;
|
|
271
|
-
cursor: pointer;
|
|
272
|
-
|
|
273
|
-
:hover {
|
|
274
|
-
.background-bar {
|
|
275
|
-
transform: scaleY(1.5);
|
|
276
|
-
}
|
|
277
|
-
.loaded {
|
|
278
|
-
transform: scaleY(1.5);
|
|
279
|
-
top: calc(-.1 * var(--mp-unit));
|
|
280
|
-
}
|
|
281
|
-
.play-container {
|
|
282
|
-
transform: scaleY(1.5);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/*
|
|
287
|
-
* One copy of the track per mask, stacked.
|
|
288
|
-
*
|
|
289
|
-
* The rest track paints every segment except the one under the pointer, the focus track paints only that one and
|
|
290
|
-
* is the only element that grows. Both are full bar width, which is what keeps every percentage
|
|
291
|
-
* and every scaleX inside them meaning exactly what it meant before chapters existed: the gaps are
|
|
292
|
-
* cut by a mask, not by resizing anything.
|
|
293
|
-
*
|
|
294
|
-
* The mask sits HERE and never on .loaded-part or .play. Those two carry a scaleX, and a mask
|
|
295
|
-
* travels with its element's transform, so a gap drawn on them would slide with the fill.
|
|
296
|
-
*/
|
|
297
|
-
.track {
|
|
298
|
-
position: absolute;
|
|
299
|
-
inset: 0;
|
|
300
|
-
/* never a hit target: .padding is the only one, and a second would break the drag gesture and
|
|
301
|
-
fire a bubbling mouseout at every boundary crossing */
|
|
302
|
-
pointer-events: none;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/*
|
|
306
|
-
* The segment under the pointer, on TOP of the growth the whole bar already got.
|
|
307
|
-
*
|
|
308
|
-
* Measured off YouTube's live player, hovering one chapter of five: every other segment goes 4px
|
|
309
|
-
* to 6px, and the one under the pointer goes to 10px. Both grow about the bar's centre line, so
|
|
310
|
-
* the emphasised segment bulges above and below its neighbours rather than sitting on them. 6 x
|
|
311
|
-
* 1.667 is 10, and the 1.5 the layers inside already carry gets this track from 4 to exactly that.
|
|
312
|
-
*/
|
|
313
|
-
.track.focus {
|
|
314
|
-
transform: scaleY(1.667);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
.background-bar {
|
|
319
|
-
position: absolute;
|
|
320
|
-
inset: 0;
|
|
321
|
-
background-color: hsla(0, 100%, 100%, .2);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.cursor-time {
|
|
325
|
-
display: flex;
|
|
326
|
-
justify-content: center;
|
|
327
|
-
|
|
328
|
-
/* The seekbar's other hover affordance, the thumbnail below, gets a rounded box and a drop
|
|
329
|
-
shadow. A source that ships no thumbnails, which is every source whose media the player does
|
|
330
|
-
not own, leaves this readout as the entire preview, so it carries the same treatment instead
|
|
331
|
-
of sitting as bare text on the picture. The ink comes from the player root. */
|
|
332
|
-
background-color: rgba(28, 28, 28, .95);
|
|
333
|
-
border-radius: calc(.4 * var(--mp-unit));
|
|
334
|
-
padding: 0 calc(.6 * var(--mp-unit));
|
|
335
|
-
box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
|
|
336
|
-
|
|
337
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
338
|
-
${Rv.bMedium.bold}
|
|
339
|
-
|
|
340
|
-
gap: calc(.6 * var(--mp-unit));
|
|
341
|
-
|
|
342
|
-
/*
|
|
343
|
-
* The chapter under the pointer, next to the time, which is where the reference puts it.
|
|
344
|
-
*
|
|
345
|
-
* It is the one part of this pill whose width the player does not control, so it is capped and
|
|
346
|
-
* ellipsised rather than allowed to push the box outside the picture. The cap and the clamp that
|
|
347
|
-
* positions the pill are set together on the element, since a centred box can only be kept
|
|
348
|
-
* inside the bar if the clamp knows its half width.
|
|
349
|
-
*/
|
|
350
|
-
.chapter-title {
|
|
351
|
-
overflow: hidden;
|
|
352
|
-
text-overflow: ellipsis;
|
|
353
|
-
min-width: 0;
|
|
354
|
-
font-weight: normal;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
position: absolute;
|
|
358
|
-
/* Anchored on its bottom edge rather than its top: now that it has a background its height
|
|
359
|
-
follows the font size, and a top-anchored box would grow downward into the track. */
|
|
360
|
-
bottom: calc(1.2 * var(--mp-unit));
|
|
361
|
-
/* Sized to its content, replacing a fixed 5 unit box that \`1:04:09\` overflows. Transparent, that
|
|
362
|
-
overflow was invisible; filled, it would not be. */
|
|
363
|
-
width: max-content;
|
|
364
|
-
white-space: nowrap;
|
|
365
|
-
transform: translateX(-50%);
|
|
366
|
-
|
|
367
|
-
pointer-events: none;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.loaded {
|
|
371
|
-
transform-origin: 0 0;
|
|
372
|
-
position: absolute;
|
|
373
|
-
bottom: 0;
|
|
374
|
-
height: calc(.4 * var(--mp-unit));
|
|
375
|
-
width: 100%;
|
|
376
|
-
.loaded-part {
|
|
377
|
-
transform-origin: 0 0;
|
|
378
|
-
bottom: 0;
|
|
379
|
-
height: calc(.4 * var(--mp-unit));
|
|
380
|
-
width: 100%;
|
|
381
|
-
position: absolute;
|
|
382
|
-
background-color: hsla(0, 100%, 100%, .4);
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.play-container {
|
|
387
|
-
position: absolute;
|
|
388
|
-
bottom: 0;
|
|
389
|
-
width: 100%;
|
|
390
|
-
height: calc(.4 * var(--mp-unit));
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.play {
|
|
394
|
-
transform-origin: 0 0;
|
|
395
|
-
background-color: #f03;
|
|
396
|
-
position: absolute;
|
|
397
|
-
bottom: 0;
|
|
398
|
-
height: calc(.4 * var(--mp-unit));
|
|
399
|
-
width: 100%;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
.padding {
|
|
403
|
-
position: absolute;
|
|
404
|
-
bottom: -7.5px;
|
|
405
|
-
height: calc(2 * var(--mp-unit));
|
|
406
|
-
width: 100%;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.thumbnail {
|
|
410
|
-
display: flex;
|
|
411
|
-
justify-content: center;
|
|
412
|
-
|
|
413
|
-
position: absolute;
|
|
414
|
-
top: calc(calc(-3.4375 * var(--mp-unit)) - var(--thumbnail-width) * 9/16);
|
|
415
|
-
height: calc(var(--thumbnail-width) * 9/16);
|
|
416
|
-
width: var(--thumbnail-width);
|
|
417
|
-
|
|
418
|
-
margin-left: calc(var(--thumbnail-half) * -1);
|
|
419
|
-
pointer-events: none;
|
|
420
|
-
|
|
421
|
-
img {
|
|
422
|
-
border-radius: calc(.4 * var(--mp-unit));
|
|
423
|
-
box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
|
|
424
|
-
|
|
425
|
-
width: 100%;
|
|
426
|
-
height: 100%;
|
|
427
|
-
object-fit: cover;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/* a thumb is far wider than a cursor, so the hit strip grows to 44px and the track thickens */
|
|
432
|
-
@media (pointer: coarse) {
|
|
433
|
-
height: calc(.6 * var(--mp-unit));
|
|
434
|
-
|
|
435
|
-
/* press feedback, coarse only: a finger has no hover, so without this the bar gives no sign
|
|
436
|
-
it is being dragged */
|
|
437
|
-
&.dragging {
|
|
438
|
-
.background-bar, .loaded, .play-container {
|
|
439
|
-
transform: scaleY(1.5);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
.loaded {
|
|
444
|
-
height: calc(.6 * var(--mp-unit));
|
|
445
|
-
.loaded-part {
|
|
446
|
-
height: calc(.6 * var(--mp-unit));
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.play-container {
|
|
451
|
-
height: calc(.6 * var(--mp-unit));
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.play {
|
|
455
|
-
height: calc(.6 * var(--mp-unit));
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/* grows upward into the video: centred, it would hang over the control row and win hit
|
|
459
|
-
testing against taps meant for play, mute and fullscreen */
|
|
460
|
-
.padding {
|
|
461
|
-
height: 44px;
|
|
462
|
-
bottom: 0;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/* the clamp only holds the preview inside the bar while the bar is the wider of the two, so
|
|
467
|
-
below that the preview is narrowed instead */
|
|
468
|
-
@media (max-width: 480px) {
|
|
469
|
-
--thumbnail-width: calc(18 * var(--mp-unit));
|
|
470
|
-
--thumbnail-half: calc(9 * var(--mp-unit));
|
|
471
|
-
}
|
|
472
|
-
`,Oy=4,ky=()=>{let e=Q(),t=Q(e=>e.currentTime),n=Q(e=>e.requestSeek),r=Q(e=>e.duration),i=Q(e=>e.size),a=Q(e=>e.downloadedRanges),o=Q(e=>e.buffered),s=Q(e=>e.indexes),c=Q(e=>e.thumbnails),l=Q(e=>e.thumbnailAt),u=Q(e=>e.requestThumbnail),d=Q(e=>e.chapters),f=Q(e=>e.seekingTo),p=Q(e=>e.setSourceState),m=Q(e=>e.hideUI),h=O(null),[v,y]=M(void 0),[b,x]=M(void 0),S=e=>{x(e),u(e)},C=!!b;g(()=>{if(C)return p({seekPreview:!0}),()=>p({seekPreview:!1})},[p,C]),g(()=>{m&&S(void 0)},[m]);let w=O(void 0),T=O(0),E=O(void 0),D=O(void 0),k=O(!1),{dragging:A,handlers:j}=ry({ref:h,onChange:e=>{if(T.current+=1,E.current=e,D.current===void 0)D.current=e;else if(!k.current){let t=h.current?.getBoundingClientRect().width??0;Math.abs(e-D.current)*t>Oy&&(k.current=!0)}y(e),w.current!==`mouse`&&S(e*r)}}),ee=e=>{w.current=e.pointerType,T.current=0,D.current=void 0,k.current=!1,j.onPointerDown(e)},te=t=>{j.onPointerUp(t);let i=T.current>0?E.current:void 0;if(i!==void 0&&r){let t=i*r;n?n(t):e.seek(t)}T.current=0,k.current=!1,D.current=void 0,t.pointerType!==`mouse`&&S(void 0)},ne=e=>{if(!h.current)return;let{left:t,right:n}=h.current.getBoundingClientRect();return Math.min(Math.max((e-t)/(n-t),0),1)*r},N=O(`mouse`),F=e=>{N.current=e.pointerType},I=e=>{N.current!==`touch`&&S(ne(e.clientX))},re=()=>{h.current&&S(void 0)},ie=e=>r?e/r*100:0,ae=(e,t,n)=>{let r=Number((n-t).toFixed(4)),i=t*100;return L(`div`,{className:`loaded-part`,style:{transform:`scaleX(${r})`,marginLeft:`${i}%`}},e)},oe=P(()=>i===void 0?r?o.map(([e,t],n)=>ae(n,e/r,t/r)):[]:a?.map((e,t)=>{if(!i||!r)return null;let n=s.filter(t=>e.startByteOffset<=t.pos&&t.pos<=e.endByteOffset),a=n.at(0),o=n.at(-1);return!a||!o?null:ae(t,a.timestamp/r,o.timestamp/r)})??[],[r,i,i===void 0?o:void 0,s.length,a?.map(({startByteOffset:e,endByteOffset:t})=>`${e}/${t}`).join(`,`)]);g(()=>{v!==void 0&&r&&A&&k.current&&e.seek(v*r)},[e,A,v,r]);let R=P(()=>{if(!r)return 0;if(A&&v!==void 0)return v;let e=f??t;return typeof e==`number`?e/r:0},[r,t,A,v,f]),z=P(()=>cy(d,r),[d,r]),se=z.length>0,ce=P(()=>{if(!se||b===void 0||!r)return-1;let e=b/r*100,t=z.findIndex((t,n)=>n<z.length-1&&e>=t&&e<z[n+1]);return t>=0?t:z.length-2},[se,z,b,r]),le=P(()=>se?ly(z,e=>e!==ce):void 0,[se,z,ce]),ue=P(()=>ce>=0?ly(z,e=>e===ce):void 0,[z,ce]),de=P(()=>{if(b!==void 0)return d.find(({start:e,end:t})=>e<=b&&b<t)},[d,b]),fe=P(()=>{if(b){if(l)return l(b);if(c.length)return c.find(({startTime:e,endTime:t})=>e<=b&&b<t)}},[c,l,b]),pe=(e,t)=>_(`div`,{className:e?`track ${e}`:`track`,style:t?{maskImage:t}:void 0,children:[L(`div`,{className:`background-bar`}),L(`div`,{className:`loaded`,children:oe}),L(`div`,{className:`play-container`,children:L(`div`,{className:`play`,style:{transform:`scaleX(${R})`}})})]});return _(`div`,{css:Dy,ref:h,className:[`progress-bar`,A?`dragging`:``,se?`segmented`:``].filter(Boolean).join(` `),onPointerDown:F,onPointerMove:F,onMouseMove:I,onMouseOut:re,children:[pe(void 0,le),b?_(`div`,{className:`cursor-time`,style:{left:de?`clamp(var(--thumbnail-half), ${ie(b)}%, calc(100% - var(--thumbnail-half)))`:`clamp(calc(3 * var(--mp-unit)), ${ie(b)}%, calc(100% - calc(3 * var(--mp-unit))))`,maxWidth:de?`var(--thumbnail-width)`:void 0},children:[L(`span`,{className:`cursor-time-value`,children:Xv(b)}),de?L(`span`,{className:`chapter-title`,children:de.title}):void 0]}):void 0,L(`div`,{className:`progress`}),L(`div`,{className:`hover`}),ue?pe(`focus`,ue):void 0,L(`div`,{className:`scrubber`}),L(`div`,{className:`padding`,...j,onPointerDown:ee,onPointerUp:te,onPointerCancel:te}),L(`div`,{className:`thumbnail`,style:{left:`clamp(var(--thumbnail-half), ${ie(b??1)}%, calc(100% - var(--thumbnail-half)))`},children:fe?.url?L(`img`,{src:fe.url}):void 0})]})},Ay=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='icon%20icon-tabler%20icons-tabler-outline%20icon-tabler-picture-in-picture'%3e%3cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'%20/%3e%3cpath%20d='M11%2019h-6a2%202%200%200%201%20-2%20-2v-10a2%202%200%200%201%202%20-2h14a2%202%200%200%201%202%202v4'%20/%3e%3cpath%20d='M14%2014m0%201a1%201%200%200%201%201%20-1h5a1%201%200%200%201%201%201v3a1%201%200%200%201%20-1%201h-5a1%201%200%200%201%20-1%20-1z'%20/%3e%3c/svg%3e`,jy={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},My=e=>_(`svg`,{...jy,...e,children:[L(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`,ry:`2`}),L(`path`,{d:`M7 15h4m4 0h2M7 11h2m4 0h4`})]}),Ny=e=>_(`svg`,{...jy,...e,children:[L(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`,ry:`2`}),L(`path`,{d:`M7 15h4m4 0h2M7 11h2m4 0h4`}),L(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})]}),Py=e=>_(`svg`,{...jy,...e,children:[L(`path`,{d:`M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5`}),L(`rect`,{x:`12`,y:`13`,width:`10`,height:`8`,rx:`1`,ry:`1`}),L(`path`,{d:`M14.5 18.5h2m2 0h1`})]}),Fy=e=>_(`svg`,{...jy,...e,children:[L(`path`,{d:`M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5`}),L(`rect`,{x:`12`,y:`13`,width:`10`,height:`8`,rx:`1`,ry:`1`}),L(`path`,{d:`M6 9h3m2 0h2`})]}),Iy=f`
|
|
473
|
-
.popover {
|
|
474
|
-
position: absolute;
|
|
475
|
-
/* Anchored to the PLAYER's right edge, never to the gear. The gear is not the last control in the
|
|
476
|
-
bar, so a menu centred on it puts its own edges wherever the button happens to sit: with no
|
|
477
|
-
picture-in-picture button, which is every source whose media the player does not own, an edge
|
|
478
|
-
landed outside the box, and the root's \`overflow: hidden\` cut it off, taking the rows under it
|
|
479
|
-
out of reach. The inset matches the bar's own padding so the menu lines up with the last button. */
|
|
480
|
-
right: calc(12px + env(safe-area-inset-right, 0px));
|
|
481
|
-
bottom: calc(100% + 8px);
|
|
482
|
-
|
|
483
|
-
overflow-y: auto;
|
|
484
|
-
width: 180px;
|
|
485
|
-
/* \`100%\` is the control bar, which is the width of the PLAYER. The old \`100vw\` was the viewport,
|
|
486
|
-
which equals the player only when the player is the whole document, and it is the wrong kind of
|
|
487
|
-
guard besides: a max-width shrinks the box, it never moves it back inside. */
|
|
488
|
-
max-width: calc(100% - 24px);
|
|
489
|
-
/* Sized to its rows, capped at what fits. A fixed height left the settings menu two thirds empty
|
|
490
|
-
once subtitles moved out to its own button, and a long track list scrolls at the cap either way. */
|
|
491
|
-
height: max-content;
|
|
492
|
-
/* The room actually above the bar. A short player had the top of the menu clipped by that same
|
|
493
|
-
\`overflow: hidden\`. With no size container in the ancestry this resolves against the small
|
|
494
|
-
viewport, so it can only ever shrink the box, never grow it. */
|
|
495
|
-
max-height: min(160px, calc(100cqh - 100% - 16px));
|
|
496
|
-
@media (min-width: 768px) {
|
|
497
|
-
right: calc(16px + env(safe-area-inset-right, 0px));
|
|
498
|
-
width: 250px;
|
|
499
|
-
max-width: calc(100% - 32px);
|
|
500
|
-
}
|
|
501
|
-
@media (min-width: 2560px) {
|
|
502
|
-
right: calc(24px + env(safe-area-inset-right, 0px));
|
|
503
|
-
max-width: calc(100% - 48px);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
display: flex;
|
|
507
|
-
flex-direction: column;
|
|
508
|
-
|
|
509
|
-
border-radius: 8px;
|
|
510
|
-
background-color: rgba(28,28,28,0.95);
|
|
511
|
-
${Rv.bMedium.regular}
|
|
512
|
-
|
|
513
|
-
z-index: 4;
|
|
514
|
-
|
|
515
|
-
> div {
|
|
516
|
-
display: flex;
|
|
517
|
-
align-items: center;
|
|
518
|
-
justify-content: space-between;
|
|
519
|
-
|
|
520
|
-
color: #fff;
|
|
521
|
-
outline: none;
|
|
522
|
-
|
|
523
|
-
padding: 8px 6px 8px 12px;
|
|
524
|
-
|
|
525
|
-
width: 100%;
|
|
526
|
-
/* rows keep their own height inside the fixed height column, so a long page scrolls rather than
|
|
527
|
-
squashing every row into it */
|
|
528
|
-
flex-shrink: 0;
|
|
529
|
-
@media (pointer: coarse) {
|
|
530
|
-
box-sizing: border-box;
|
|
531
|
-
min-height: 44px;
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
:first-of-type {
|
|
535
|
-
border-radius: 8px 8px 0 0;
|
|
536
|
-
}
|
|
537
|
-
:last-of-type {
|
|
538
|
-
border-radius: 0 0 8px 8px;
|
|
539
|
-
}
|
|
540
|
-
&:not(.no-hover) {
|
|
541
|
-
cursor: pointer;
|
|
542
|
-
}
|
|
543
|
-
&:not(.no-hover):hover {
|
|
544
|
-
background-color: rgba(255,255,255,.1);
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
> div {
|
|
548
|
-
display: flex;
|
|
549
|
-
align-items: center;
|
|
550
|
-
justify-content: center;
|
|
551
|
-
|
|
552
|
-
.secondary {
|
|
553
|
-
color: #eee;
|
|
554
|
-
${Rv.bSmall.regular}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
.back {
|
|
560
|
-
display: flex;
|
|
561
|
-
align-items: center;
|
|
562
|
-
justify-content: flex-start;
|
|
563
|
-
border-bottom: 1px solid #4D4D4E;
|
|
564
|
-
|
|
565
|
-
svg {
|
|
566
|
-
transform: translateX(-4px);
|
|
567
|
-
transition: transform 0.2s ease-in-out;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
:hover {
|
|
571
|
-
svg {
|
|
572
|
-
transform: translateX(-8px);
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
.track-list {
|
|
579
|
-
.description {
|
|
580
|
-
word-break: break-word;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/* Dimmed and inert, but still listed. A source that names a track it cannot serve right now is
|
|
584
|
-
saying the track exists, and dropping the row would read as the source having nothing. */
|
|
585
|
-
.unavailable {
|
|
586
|
-
opacity: 0.5;
|
|
587
|
-
cursor: default;
|
|
588
|
-
:hover {
|
|
589
|
-
background-color: transparent;
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
.failed {
|
|
594
|
-
border-bottom: 1px solid #4D4D4E;
|
|
595
|
-
color: #f66;
|
|
596
|
-
${Rv.bSmall.regular}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
`,Ly=({title:e,tracks:t,selected:n,onSelect:r,onBack:i,offLabel:a,pending:o,failed:s})=>{let c=o!==void 0,l=(e,i,a)=>{let s=c&&o===e,l=c||t.find(t=>t.id===e)?.disabled;return _(`div`,{onClick:()=>{l||r(e??void 0)},className:[a,l?`unavailable`:null].filter(Boolean).join(` `)||void 0,children:[L(`span`,{children:i}),L(`span`,{children:s?`…`:(n??null)===e?`✓`:``})]},e??`__off__`)};return _(`div`,{className:`popover track-list`,children:[_(`div`,{className:i?`back`:`back no-hover`,onClick:i,children:[i?L($g,{}):null,L(`span`,{children:e})]}),s?L(`div`,{className:`no-hover failed`,children:`Could not switch. Try again.`}):null,a?l(null,a):null,t.map(({id:e,label:t})=>l(e,t,`description`))]})},Ry=({onReset:e}={})=>{let t=O(null),[n,r]=M(!1),[i,a]=M(void 0),[o,s]=M(!1),c=O(e);c.current=e;let l=()=>{r(!1),c.current?.()};return g(()=>{let e=e=>{n&&t.current&&!t.current.contains(e.target)&&l()};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[n]),{open:n,toggle:()=>{r(e=>!e),s(!1),c.current?.()},close:l,containerRef:t,pending:i,failed:o,runSelect:(e,t)=>{if(i!==void 0)return;s(!1);let n;try{n=t()}catch(e){console.warn(`[media-player] track selection failed:`,e),s(!0);return}if(!(n instanceof Promise)){l();return}a(e),n.then(()=>{a(void 0),l()},e=>{console.warn(`[media-player] track selection failed:`,e),a(void 0),s(!0)})}}},zy=f`
|
|
600
|
-
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
601
|
-
which is the width of the player box, so it can be clamped to it. */
|
|
602
|
-
position: static;
|
|
603
|
-
|
|
604
|
-
.errors {
|
|
605
|
-
/* the icon keeps its size, the pressable box grows around it */
|
|
606
|
-
@media (pointer: coarse) {
|
|
607
|
-
box-sizing: border-box;
|
|
608
|
-
justify-content: center;
|
|
609
|
-
|
|
610
|
-
min-width: 44px;
|
|
611
|
-
min-height: 44px;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
${Iy}
|
|
616
|
-
|
|
617
|
-
.popover.error-list {
|
|
618
|
-
/* Wider than a track menu and taller, because these rows are sentences rather than labels, and a
|
|
619
|
-
decoder message that has been ellipsized is not worth copying. */
|
|
620
|
-
width: 420px;
|
|
621
|
-
max-height: min(300px, calc(100cqh - 100% - 16px));
|
|
622
|
-
|
|
623
|
-
/* track-menu's header is a left-aligned label row; here it carries a control too, so the two
|
|
624
|
-
ends go to the two ends */
|
|
625
|
-
.back {
|
|
626
|
-
justify-content: space-between;
|
|
627
|
-
gap: 8px;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
.copy {
|
|
631
|
-
/* sits in the header row, which track-menu styles as .back */
|
|
632
|
-
display: flex;
|
|
633
|
-
align-items: center;
|
|
634
|
-
gap: 6px;
|
|
635
|
-
|
|
636
|
-
background: none;
|
|
637
|
-
border: none;
|
|
638
|
-
padding: 4px 6px;
|
|
639
|
-
border-radius: 4px;
|
|
640
|
-
|
|
641
|
-
color: #fff;
|
|
642
|
-
cursor: pointer;
|
|
643
|
-
${Rv.bSmall.regular}
|
|
644
|
-
|
|
645
|
-
&:hover {
|
|
646
|
-
background-color: rgba(255,255,255,.1);
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
svg {
|
|
650
|
-
width: 14px;
|
|
651
|
-
height: 14px;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
.entry {
|
|
656
|
-
/* one failure is a block of text, so it stacks instead of sitting on one line */
|
|
657
|
-
display: flex;
|
|
658
|
-
flex-direction: column;
|
|
659
|
-
align-items: flex-start;
|
|
660
|
-
gap: 2px;
|
|
661
|
-
|
|
662
|
-
.when {
|
|
663
|
-
color: #bbb;
|
|
664
|
-
${Rv.bSmall.regular}
|
|
665
|
-
|
|
666
|
-
/* the one part of the line worth scanning for, so it is the one part at full brightness */
|
|
667
|
-
.count {
|
|
668
|
-
margin-left: 6px;
|
|
669
|
-
color: #fff;
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
.what {
|
|
674
|
-
/* the decoder's own words, which are long and must not be cut */
|
|
675
|
-
overflow-wrap: anywhere;
|
|
676
|
-
white-space: pre-wrap;
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
.cause {
|
|
680
|
-
color: #ddd;
|
|
681
|
-
overflow-wrap: anywhere;
|
|
682
|
-
white-space: pre-wrap;
|
|
683
|
-
${Rv.bSmall.regular}
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
`,By=e=>new Date(e).toLocaleTimeString(),Vy=e=>e===void 0||!Number.isFinite(e)?void 0:Xv(Math.max(0,e)),Hy=e=>e.reduce((e,t)=>e+t.count,0),Uy=e=>e.map((e,t)=>{let n=Vy(e.atMediaTime),r=e.count>1?`${new Date(e.at).toISOString()} to ${new Date(e.lastAt).toISOString()} ×${e.count}`:new Date(e.at).toISOString();return[`${t+1}. ${r}${n?` (at ${n})`:``}${e.recovered?` [recovered]`:``}`,e.message,e.detail].filter(Boolean).join(`
|
|
688
|
-
`)}).join(`
|
|
689
|
-
|
|
690
|
-
`),Wy=()=>{let e=Q(e=>e.playbackErrors),{open:t,toggle:n,containerRef:r}=Ry(),[i,a]=M(!1);if(e.length===0)return null;let o=()=>{navigator.clipboard?.writeText(Uy(e)).then(()=>{a(!0),setTimeout(()=>a(!1),2e3)},e=>console.warn(`[media-player] could not copy the errors:`,e))},s=`Playback errors (${Hy(e)})`;return _(`div`,{css:zy,ref:r,children:[L(ny,{id:`errors`,disabled:t,text:L(`button`,{className:`errors`,type:`button`,onClick:n,"aria-label":s,"aria-expanded":t,children:L(Gg,{className:`alert-triangle`})}),toolTipText:L(`span`,{children:s})}),t&&_(`div`,{className:`popover error-list`,children:[_(`div`,{className:`back no-hover`,children:[L(`span`,{children:s}),_(`button`,{className:`copy`,type:`button`,onClick:o,"aria-label":`Copy the errors`,children:[L(i?Yg:s_,{}),L(`span`,{children:i?`Copied`:`Copy`})]})]}),e.map((e,t)=>_(`div`,{className:`entry no-hover`,children:[_(`span`,{className:`when`,children:[By(e.at),e.count>1?` to ${By(e.lastAt)}`:``,Vy(e.atMediaTime)?` at ${Vy(e.atMediaTime)}`:``,e.recovered?` recovered`:``,e.count>1?L(`span`,{className:`count`,children:`×${e.count}`}):null]}),L(`span`,{className:`what`,children:e.message}),e.detail?L(`span`,{className:`cause`,children:e.detail}):null]},`${e.at}-${t}`))]})]})},Gy=f`
|
|
691
|
-
display: flex;
|
|
692
|
-
align-items: center;
|
|
693
|
-
justify-content: center;
|
|
694
|
-
flex-direction: column;
|
|
695
|
-
width: 100%;
|
|
696
|
-
|
|
697
|
-
.playback-slider {
|
|
698
|
-
display: flex;
|
|
699
|
-
align-items: center;
|
|
700
|
-
|
|
701
|
-
padding: 8px 4px;
|
|
702
|
-
margin: 0 2px;
|
|
703
|
-
/* a finger needs a 44px band to press, so the padding grows while the track stays 3px */
|
|
704
|
-
@media (pointer: coarse) {
|
|
705
|
-
padding: 20px 8px;
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
cursor: pointer;
|
|
709
|
-
|
|
710
|
-
> div {
|
|
711
|
-
position: relative;
|
|
712
|
-
|
|
713
|
-
background: #ccc;
|
|
714
|
-
border-radius: 4px;
|
|
715
|
-
|
|
716
|
-
width: 120px;
|
|
717
|
-
max-width: 100%;
|
|
718
|
-
height: 3px;
|
|
719
|
-
@media (min-width: 768px) {
|
|
720
|
-
height: 4px;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
.playback-handle {
|
|
725
|
-
position: absolute;
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
background: #ffffff;
|
|
729
|
-
border-radius: 50%;
|
|
730
|
-
transform: translateX(-50%);
|
|
731
|
-
pointer-events: none;
|
|
732
|
-
|
|
733
|
-
width: 10px;
|
|
734
|
-
height: 10px;
|
|
735
|
-
top: -3.5px;
|
|
736
|
-
@media (min-width: 768px) {
|
|
737
|
-
width: 12px;
|
|
738
|
-
height: 12px;
|
|
739
|
-
top: -4px;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
`,Ky=()=>{let e=Q(),t=Q(e=>e.playbackRate),n=O(null),r=O(null),i=.25,a=2.75,o=(e,t=.05)=>Math.round(e/t)*t,s=o(t||1),c=e=>(e-i)/a*100,l=e=>o(i+e*a),{handlers:u}=ry({ref:r,onChange:t=>e.setPlaybackRate(l(t))}),d=t=>{t.preventDefault();let n=.05,r=s;r=t.deltaY<0?Math.min(3,r+n):Math.max(i,r-n),e.setPlaybackRate(r)};g(()=>{let e=n.current;return e&&e.addEventListener(`wheel`,d,{passive:!1}),()=>{e&&e.removeEventListener(`wheel`,d)}},[t]);let f=c(s);return _(`div`,{css:Gy,children:[_(`div`,{children:[s.toFixed(2),`x`]}),L(`div`,{className:`playback-slider`,ref:n,...u,children:L(`div`,{ref:r,style:{background:`linear-gradient(to right,
|
|
744
|
-
#fff 0% ${f}%,
|
|
745
|
-
#3A3A3A ${f}% 100%
|
|
746
|
-
)`},children:L(`div`,{className:`playback-handle`,style:{left:`${f}%`}})})})]})},qy=f`
|
|
747
|
-
/* Deliberately NOT a containing block. The menu anchors to the control bar instead, which is exactly
|
|
748
|
-
as wide as the player box and can therefore be clamped to it. The outside-click check uses
|
|
749
|
-
\`contains\` on the ref, which is DOM containment and needs no position, and the bar's other
|
|
750
|
-
tooltips already resolve against the control bar with no positioned wrapper of their own. */
|
|
751
|
-
position: static;
|
|
752
|
-
|
|
753
|
-
.settings {
|
|
754
|
-
/* the icon keeps its size, the pressable box grows around it */
|
|
755
|
-
@media (pointer: coarse) {
|
|
756
|
-
box-sizing: border-box;
|
|
757
|
-
justify-content: center;
|
|
758
|
-
|
|
759
|
-
min-width: 44px;
|
|
760
|
-
min-height: 44px;
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
${Iy}
|
|
765
|
-
|
|
766
|
-
.playback-rate {
|
|
767
|
-
.slider {
|
|
768
|
-
width: 100%;
|
|
769
|
-
}
|
|
770
|
-
.options {
|
|
771
|
-
display: grid;
|
|
772
|
-
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
773
|
-
align-items: center;
|
|
774
|
-
|
|
775
|
-
padding: 8px 12px;
|
|
776
|
-
/* four presets across a 180px popover leave targets 34px wide, so a finger gets two rows of two
|
|
777
|
-
until the popover is wide enough for the row of four */
|
|
778
|
-
@media (pointer: coarse) {
|
|
779
|
-
grid-template-columns: 1fr 1fr;
|
|
780
|
-
}
|
|
781
|
-
@media (pointer: coarse) and (min-width: 768px) {
|
|
782
|
-
grid-template-columns: 1fr 1fr 1fr 1fr;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
> div {
|
|
786
|
-
display: flex;
|
|
787
|
-
align-items: center;
|
|
788
|
-
border-radius: 4px;
|
|
789
|
-
|
|
790
|
-
padding: 8px 6px;
|
|
791
|
-
height: 100%;
|
|
792
|
-
@media (pointer: coarse) {
|
|
793
|
-
box-sizing: border-box;
|
|
794
|
-
min-height: 44px;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
cursor: pointer;
|
|
798
|
-
:hover {
|
|
799
|
-
background-color: rgba(255,255,255,.1);
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
`,Jy=()=>{let e=Q(),t=Q(e=>e.playbackRate),n=Q(e=>e.audioTracks),r=Q(e=>e.selectedAudioTrack),i=Q(e=>e.selectAudioTrack),[a,o]=M(0),{open:s,toggle:c,containerRef:l,pending:u,failed:d,runSelect:f}=Ry({onReset:()=>o(0)}),p=t=>{e.setPlaybackRate(t),o(0)},m=e=>{e!==void 0&&f(e,()=>i(e))},h=e=>()=>{o(e)};return _(`div`,{css:qy,ref:l,children:[L(ny,{id:`settings`,disabled:s,text:L(`button`,{className:`settings`,type:`button`,onClick:c,"aria-label":`Settings`,"aria-expanded":s,children:L(j_,{})}),toolTipText:L(`span`,{children:`Settings`})}),s&&a===0&&_(`div`,{className:`popover menu`,children:[n.length>1?_(`div`,{onClick:h(2),children:[L(`div`,{children:`Audio`}),L(`div`,{children:L(r_,{})})]}):null,_(`div`,{onClick:h(1),children:[L(`div`,{children:`Playback speed`}),_(`div`,{children:[L(`span`,{className:`secondary`,children:t===1?`(Default)`:t.toFixed(2)}),L(r_,{})]})]})]}),s&&a===1&&_(`div`,{className:`popover playback-rate`,children:[_(`div`,{className:`back`,onClick:h(0),children:[L($g,{}),L(`span`,{children:`Playback speed`})]}),L(`div`,{className:`slider no-hover`,children:L(Ky,{})}),_(`div`,{className:`options no-hover`,children:[L(`div`,{onClick:()=>p(.5),children:`0.5x`}),L(`div`,{onClick:()=>p(1),children:`1x`}),L(`div`,{onClick:()=>p(1.5),children:`1.5x`}),L(`div`,{onClick:()=>p(2),children:`2x`})]})]}),s&&a===2&&L(Ly,{title:`Audio`,tracks:n,selected:r,onSelect:m,onBack:h(0),pending:u,failed:d})]})},Yy=f`
|
|
806
|
-
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
807
|
-
which is the width of the player box, so it can be clamped to it. */
|
|
808
|
-
position: static;
|
|
809
|
-
|
|
810
|
-
.subtitles {
|
|
811
|
-
/* the icon keeps its size, the pressable box grows around it */
|
|
812
|
-
@media (pointer: coarse) {
|
|
813
|
-
box-sizing: border-box;
|
|
814
|
-
justify-content: center;
|
|
815
|
-
|
|
816
|
-
min-width: 44px;
|
|
817
|
-
min-height: 44px;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
${Iy}
|
|
822
|
-
`,Xy=()=>{let e=Q(e=>e.subtitleTracks),t=Q(e=>e.selectedSubtitleTrack),n=Q(e=>e.selectSubtitleTrack),r=Q(e=>e.subtitleOffLabel),{open:i,toggle:a,containerRef:o,pending:s,failed:c,runSelect:l}=Ry();if(e.length===0)return null;let u=t!==void 0;return _(`div`,{css:Yy,ref:o,children:[L(ny,{id:`subtitles`,disabled:i,text:L(`button`,{className:`subtitles`,type:`button`,onClick:a,"aria-label":`Subtitles`,"aria-expanded":i,"aria-pressed":u,children:u?L(My,{className:`captions`}):L(Ny,{className:`captions-off`})}),toolTipText:L(`span`,{children:`Subtitles`})}),i&&L(Ly,{title:`Subtitles`,tracks:e,selected:t,onSelect:e=>l(e??null,()=>n(e)),offLabel:r??`Disable`,pending:s,failed:c})]})},Zy={primary:`#EAEBEE`,secondary:`#D0D0D9`,hover:`rgba(255, 255, 255, 0.13)`,borderPrimary:`#384F70`,backgroundTooltip:`#222222`},Qy=f`
|
|
823
|
-
display: flex;
|
|
824
|
-
align-items: center;
|
|
825
|
-
|
|
826
|
-
padding: 16px 4px;
|
|
827
|
-
margin: 0 2px;
|
|
828
|
-
/* a finger needs a 44px band to press, so the padding grows while the track stays 3px */
|
|
829
|
-
@media (pointer: coarse) {
|
|
830
|
-
padding: 22px 4px;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
cursor: pointer;
|
|
834
|
-
|
|
835
|
-
> div {
|
|
836
|
-
position: relative;
|
|
837
|
-
|
|
838
|
-
background: #ccc;
|
|
839
|
-
border-radius: 4px;
|
|
840
|
-
|
|
841
|
-
width: 80px;
|
|
842
|
-
height: 3px;
|
|
843
|
-
/* the control bar has under 360px to fit every button once the slider is always open, so the
|
|
844
|
-
track lends some of its length back on a phone and takes it again on anything wider */
|
|
845
|
-
@media (pointer: coarse) {
|
|
846
|
-
width: 64px;
|
|
847
|
-
}
|
|
848
|
-
@media (pointer: coarse) and (min-width: 768px) {
|
|
849
|
-
width: 80px;
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
.volume-handle {
|
|
854
|
-
position: absolute;
|
|
855
|
-
top: -3.5px;
|
|
856
|
-
|
|
857
|
-
background: #ffffff;
|
|
858
|
-
border-radius: 50%;
|
|
859
|
-
transform: translateX(-50%);
|
|
860
|
-
pointer-events: none;
|
|
861
|
-
|
|
862
|
-
width: 10px;
|
|
863
|
-
height: 10px;
|
|
864
|
-
}
|
|
865
|
-
`,$y=({value:e,onChange:t})=>{let n=Q(e=>e.volume),r=Q(e=>e.muted),i=O(null),a=O(null),{handlers:o}=ry({ref:a,onChange:t}),s=n=>{n.preventDefault();let r=.05,i=e;i=n.deltaY<0?Math.min(1,i+r):Math.max(0,i-r),t(i)};g(()=>{let e=i.current;return e&&e.addEventListener(`wheel`,s,{passive:!1}),()=>{e&&e.removeEventListener(`wheel`,s)}},[e]);let c=e*100,l=P(()=>Math.round(r?0:Yv(n)*100),[n,r]);return L(ny,{id:`volume-slider`,text:L(`div`,{ref:i,css:Qy,...o,children:L(`div`,{ref:a,style:{background:`linear-gradient(to right,
|
|
866
|
-
#fff 0% ${c}%,
|
|
867
|
-
#3A3A3A ${c}% 100%
|
|
868
|
-
)`},children:L(`div`,{className:`volume-handle`,style:{left:`${e*100}%`}})})}),toolTipText:_(`div`,{className:`volume-value`,children:[l,`%`]})})},eb=f`
|
|
869
|
-
position: relative;
|
|
870
|
-
display: flex;
|
|
871
|
-
align-items: center;
|
|
872
|
-
|
|
873
|
-
.volume-slider-container {
|
|
874
|
-
display: flex;
|
|
875
|
-
align-items: center;
|
|
876
|
-
|
|
877
|
-
width: 0;
|
|
878
|
-
margin-right: 0;
|
|
879
|
-
overflow: hidden;
|
|
880
|
-
pointer-events: none;
|
|
881
|
-
|
|
882
|
-
transition: margin .2s cubic-bezier(0.4,0,1,1), width .2s cubic-bezier(0.4,0,1,1);
|
|
883
|
-
-webkit-transition: margin .2s cubic-bezier(0.4,0,1,1), width .2s cubic-bezier(0.4,0,1,1);
|
|
884
|
-
|
|
885
|
-
.volume-slider-background {
|
|
886
|
-
display: flex;
|
|
887
|
-
flex-direction: row;
|
|
888
|
-
align-items: center;
|
|
889
|
-
|
|
890
|
-
border-radius: 4px;
|
|
891
|
-
|
|
892
|
-
.volume-value {
|
|
893
|
-
${Rv.bMedium.regular};
|
|
894
|
-
color: #ffffff;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
&:hover .volume-slider-container {
|
|
900
|
-
width: calc(9 * var(--mp-unit));
|
|
901
|
-
|
|
902
|
-
transition: margin .2s cubic-bezier(0,0,0.2,1), width .2s cubic-bezier(0,0,0.2,1);
|
|
903
|
-
-webkit-transition: margin .2s cubic-bezier(0,0,0.2,1), width .2s cubic-bezier(0,0,0.2,1);
|
|
904
|
-
|
|
905
|
-
pointer-events: auto;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
/* a touch screen has no hover, so the slider stays open there and the button only mutes */
|
|
909
|
-
@media (pointer: coarse) {
|
|
910
|
-
/* auto, not a fixed rem: the container keeps overflow: hidden, so a narrower fixed width
|
|
911
|
-
silently clips the track and makes the clipped part unhittable */
|
|
912
|
-
.volume-slider-container,
|
|
913
|
-
&:hover .volume-slider-container {
|
|
914
|
-
width: auto;
|
|
915
|
-
|
|
916
|
-
pointer-events: auto;
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
/* a 44px press target around an 18px icon, floored here because the control bar sets the
|
|
920
|
-
padding at a higher specificity */
|
|
921
|
-
.sound {
|
|
922
|
-
/* border-box explicitly, since a consumer reset cannot be assumed */
|
|
923
|
-
box-sizing: border-box;
|
|
924
|
-
justify-content: center;
|
|
925
|
-
|
|
926
|
-
min-width: 44px;
|
|
927
|
-
min-height: 44px;
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
`,tb=({ref:e})=>{let t=Q(),n=Q(e=>e.volume),r=Q(e=>e.muted),i=P(()=>Yv(n),[n]);return _(`div`,{css:eb,children:[L(ny,{id:`sound`,text:L(`button`,{className:`sound`,type:`button`,onClick:()=>t.toggleMuted(),ref:e,"aria-label":`Mute`,"aria-pressed":r||n===0,children:L(r||n===0?U_:n<=.5?F_:z_,{size:18,color:`#fff`})}),toolTipText:L(`span`,{children:r?`Unmute (m)`:`Mute (m)`})}),L(`div`,{className:`volume-slider-container`,children:L(`div`,{className:`volume-slider-background`,children:L($y,{value:r?0:i,onChange:e=>{t.setVolume(Jv(e))}})})})]})},nb=.05,rb=5,ib=50,ab=1e3,ob=f`
|
|
932
|
-
display: flex;
|
|
933
|
-
flex-direction: column;
|
|
934
|
-
gap: calc(0.4 * var(--mp-unit));
|
|
935
|
-
|
|
936
|
-
.hint {
|
|
937
|
-
opacity: 0.72;
|
|
938
|
-
font-size: 0.9em;
|
|
939
|
-
}
|
|
940
|
-
`,sb=f`
|
|
941
|
-
position: absolute;
|
|
942
|
-
bottom: 0;
|
|
943
|
-
width: 100%;
|
|
944
|
-
|
|
945
|
-
background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.45) 20%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.15) 70%, transparent 100%);
|
|
946
|
-
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
947
|
-
|
|
948
|
-
.actions {
|
|
949
|
-
display: flex;
|
|
950
|
-
justify-content: space-between;
|
|
951
|
-
|
|
952
|
-
/* repeated per breakpoint: nested at-rules are hoisted after the rule, so a shorthand inside a
|
|
953
|
-
media query would override a longhand above it and silently drop the safe-area inset */
|
|
954
|
-
padding: 6px calc(12px + env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
|
|
955
|
-
@media (min-width: 768px) {
|
|
956
|
-
padding: 8px calc(16px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
|
|
957
|
-
}
|
|
958
|
-
@media (min-width: 2560px) {
|
|
959
|
-
padding: 8px calc(24px + env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
.left, .right {
|
|
963
|
-
display: flex;
|
|
964
|
-
align-items: center;
|
|
965
|
-
|
|
966
|
-
button {
|
|
967
|
-
display: flex;
|
|
968
|
-
align-items: center;
|
|
969
|
-
|
|
970
|
-
outline: none;
|
|
971
|
-
border: none;
|
|
972
|
-
background: none;
|
|
973
|
-
|
|
974
|
-
svg {
|
|
975
|
-
width: 18px;
|
|
976
|
-
height: 18px;
|
|
977
|
-
@media (min-width: 768px) {
|
|
978
|
-
width: 24px;
|
|
979
|
-
height: 24px;
|
|
980
|
-
}
|
|
981
|
-
@media (min-width: 2560px) {
|
|
982
|
-
width: 28px;
|
|
983
|
-
height: 28px;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
svg {
|
|
988
|
-
stroke: #fff;
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
/* Reads as unavailable rather than absent, so the bar does not reflow when tracks land. */
|
|
992
|
-
&:disabled {
|
|
993
|
-
cursor: default;
|
|
994
|
-
opacity: .4;
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
.play, .sound, .time, .errors, .subtitles, .settings, .picture-in-picture, .full-screen {
|
|
999
|
-
display: flex;
|
|
1000
|
-
align-items: center;
|
|
1001
|
-
|
|
1002
|
-
height: 100%;
|
|
1003
|
-
|
|
1004
|
-
border-radius: 4px;
|
|
1005
|
-
user-select: none;
|
|
1006
|
-
|
|
1007
|
-
padding: 8px;
|
|
1008
|
-
@media (min-width: 768px) {
|
|
1009
|
-
padding: 8px 12px;
|
|
1010
|
-
}
|
|
1011
|
-
@media (min-width: 2560px) {
|
|
1012
|
-
padding: 8px 12px;
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
.play, .sound, .errors, .subtitles, .settings, .picture-in-picture, .full-screen {
|
|
1017
|
-
border-radius: 4px;
|
|
1018
|
-
|
|
1019
|
-
padding: 8px;
|
|
1020
|
-
@media (min-width: 768px) {
|
|
1021
|
-
padding: 8px 12px;
|
|
1022
|
-
}
|
|
1023
|
-
@media (min-width: 2560px) {
|
|
1024
|
-
padding: 8px 12px;
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
cursor: pointer;
|
|
1028
|
-
|
|
1029
|
-
/* .armed is the hover of a control letting its click through, which takes no pointer events
|
|
1030
|
-
of its own and so is never :hover */
|
|
1031
|
-
:hover, &.armed {
|
|
1032
|
-
background-color: ${Zy.hover};
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
/* the hit area grows, the icon does not, keyed on the pointer because a narrow desktop
|
|
1036
|
-
window still has a mouse */
|
|
1037
|
-
@media (pointer: coarse) {
|
|
1038
|
-
/* border-box explicitly, since a consumer reset cannot be assumed */
|
|
1039
|
-
box-sizing: border-box;
|
|
1040
|
-
min-width: 44px;
|
|
1041
|
-
min-height: 44px;
|
|
1042
|
-
justify-content: center;
|
|
1043
|
-
}
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
.left {
|
|
1048
|
-
.time {
|
|
1049
|
-
${Rv.bMedium.regular}
|
|
1050
|
-
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
.right {
|
|
1054
|
-
.picture-in-picture {
|
|
1055
|
-
img {
|
|
1056
|
-
width: 22px;
|
|
1057
|
-
height: 22px;
|
|
1058
|
-
@media (min-width: 768px) {
|
|
1059
|
-
width: 28px;
|
|
1060
|
-
height: 28px;
|
|
1061
|
-
}
|
|
1062
|
-
@media (min-width: 2560px) {
|
|
1063
|
-
width: 32px;
|
|
1064
|
-
height: 32px;
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
`,cb=()=>{let e=Q(),t=Q(e=>e.paused),n=Q(e=>e.currentTime),r=Q(e=>e.duration),i=Q(e=>e.seekingTo),a=Q(e=>e.fullscreen),o=Q(e=>e.hideUI),s=Q(e=>e.togglePictureInPicture),c=Q(e=>e.pictureInPictureMode),l=Q(e=>e.burnedInSubtitles),u=Q(e=>e.passThroughPictureInPicture),d=Q(e=>e.subtitleTracks),f=Q(e=>e.requestSeek),[p,m]=M(null),h=O(null),v=O(void 0),y=c===`burn-in`,b=d.length>0,x=r>0&&n===r,S=k(({direction:t,stepSize:n})=>{let r=Yv(e.volume),i=t===`up`?n:-n,a=Math.max(0,Math.min(1,r+i)),o=e.muted;e.setVolume(Jv(a)),o&&!e.muted&&e.toggleMuted()},[e]);g(()=>{let t=t=>f?f(t):e.seek(t),n=n=>{let r=n.target;if(r?.isContentEditable||/^(input|textarea|select)$/i.test(r?.tagName??``))return;let i=!0;if(n.key===`f`)e.toggleFullscreen();else if(n.key===`k`)e.togglePaused();else if(n.key===` `)e.togglePaused();else if(n.key===`m`)e.toggleMuted();else if(n.key===`ArrowUp`)S({direction:`up`,stepSize:nb});else if(n.key===`ArrowDown`)S({direction:`down`,stepSize:nb});else if(n.key===`ArrowRight`){if(!e.duration)return;t(Math.min(e.currentTime+rb,e.duration))}else n.key===`ArrowLeft`?t(Math.max(e.currentTime-rb,0)):i=!1;i&&n.preventDefault()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,S,f]);let C=k(e=>{e.preventDefault(),e.deltaY<0?S({direction:`up`,stepSize:nb}):S({direction:`down`,stepSize:nb})},[S]);g(()=>{if(p)return p.addEventListener(`wheel`,C,{passive:!1}),()=>p.removeEventListener(`wheel`,C)},[p,C]);let w=e=>{if(!u||u.active||u.armed||e.pointerType===`touch`)return;let{left:t,top:n,width:r,height:i}=e.currentTarget.getBoundingClientRect();u.arm({left:t,top:n,width:r,height:i})},T=!!u?.armed;return g(()=>{if(!T)return;clearInterval(v.current);let e=1/0,t=setInterval(()=>{if(Date.now()>e){clearInterval(t);return}let n=h.current,r=document.activeElement;n&&r?.tagName===`IFRAME`&&r.closest(`.video`)?.parentElement?.contains(n)&&n.focus({preventScroll:!0})},ib);return v.current=t,()=>{e=Date.now()+ab}},[T]),g(()=>()=>clearInterval(v.current),[]),_(`div`,{css:sb,style:{...o?{opacity:`0`,pointerEvents:`none`}:T?{pointerEvents:`none`}:{}},children:[L(ky,{}),_(`div`,{className:`actions`,children:[_(`div`,{className:`left`,children:[L(ny,{id:`play`,tooltipPlace:`top-start`,text:L(`button`,{className:`play`,type:`button`,onClick:()=>e.togglePaused(),"aria-label":x?`Replay`:t?`Play`:`Pause`,children:L(x?D_:t?C_:y_,{})}),toolTipText:L(`span`,{children:x?`Replay (k)`:t?`Play (k)`:`Pause (k)`})}),L(tb,{ref:m}),L(`div`,{className:`time`,children:Zv(i??n,r)})]}),_(`div`,{className:`right`,children:[L(Wy,{}),L(Xy,{}),L(Jy,{}),u?L(ny,{id:`picture-in-picture`,tooltipPlace:`top-end`,text:L(`button`,{ref:h,className:u.armed?`picture-in-picture armed`:`picture-in-picture`,type:`button`,onPointerEnter:w,onPointerMove:w,onClick:u.active?u.exit:void 0,"aria-label":`Picture in picture`,"aria-pressed":u.active,children:L(`img`,{src:Ay,alt:``})}),toolTipText:L(`span`,{children:u.active?`Exit picture in picture`:`Picture in picture`})}):s?L(ny,{id:`picture-in-picture`,tooltipPlace:`top-end`,text:L(`button`,{className:`picture-in-picture`,type:`button`,onClick:s,disabled:y&&!b,"aria-label":y?`Put the subtitles in the video`:`Picture in picture`,"aria-pressed":y?l:void 0,children:y?L(l?Py:Fy,{}):L(`img`,{src:Ay,alt:``})}),toolTipText:_(`span`,{css:ob,children:[L(`span`,{className:`lead`,children:y?b?l?`Subtitles are in the picture`:`Put the subtitles in the picture`:`This file has no subtitles`:`Picture in picture`}),y&&b?L(`span`,{className:`hint`,children:`Then hover the video and click your browser's own pop out button`}):null]})}):null,L(ny,{id:`full-screen`,tooltipPlace:`top-end`,text:L(`button`,{className:`full-screen`,type:`button`,onClick:()=>e.toggleFullscreen(),"aria-label":`Full screen`,"aria-pressed":a,children:L(a?h_:d_,{})}),toolTipText:L(`span`,{children:a?`Exit full screen (f)`:`Full screen (f)`})})]})]})]})},lb=9e3,ub=f`
|
|
1071
|
-
position: absolute;
|
|
1072
|
-
inset: 0;
|
|
1073
|
-
z-index: 2;
|
|
1074
|
-
pointer-events: none;
|
|
1075
|
-
|
|
1076
|
-
.card {
|
|
1077
|
-
position: absolute;
|
|
1078
|
-
/* Where Firefox draws its own toggle: right aligned, a little past the middle of the height. */
|
|
1079
|
-
top: 52%;
|
|
1080
|
-
right: calc(7 * var(--mp-unit));
|
|
1081
|
-
transform: translateY(-50%);
|
|
1082
|
-
|
|
1083
|
-
display: flex;
|
|
1084
|
-
align-items: center;
|
|
1085
|
-
gap: calc(1.2 * var(--mp-unit));
|
|
1086
|
-
|
|
1087
|
-
max-width: min(calc(42 * var(--mp-unit)), 60%);
|
|
1088
|
-
padding: calc(1.4 * var(--mp-unit)) calc(1.8 * var(--mp-unit));
|
|
1089
|
-
border-radius: calc(0.8 * var(--mp-unit));
|
|
1090
|
-
background-color: rgba(20, 20, 22, 0.94);
|
|
1091
|
-
box-shadow: 0 0 calc(2 * var(--mp-unit)) rgba(0, 0, 0, 0.6);
|
|
1092
|
-
|
|
1093
|
-
opacity: 0;
|
|
1094
|
-
transition: opacity 0.25s ease;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
&.show .card {
|
|
1098
|
-
opacity: 1;
|
|
1099
|
-
}
|
|
1100
|
-
|
|
1101
|
-
.words {
|
|
1102
|
-
display: flex;
|
|
1103
|
-
flex-direction: column;
|
|
1104
|
-
gap: calc(0.3 * var(--mp-unit));
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
.title {
|
|
1108
|
-
${Rv.bMedium.bold}
|
|
1109
|
-
color: #fff;
|
|
1110
|
-
}
|
|
1111
|
-
|
|
1112
|
-
.body {
|
|
1113
|
-
${Rv.bSmall.regular}
|
|
1114
|
-
color: rgba(255, 255, 255, 0.75);
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
/* Points at the edge the browser's control lives on, which is the whole message. */
|
|
1118
|
-
.arrow {
|
|
1119
|
-
flex: none;
|
|
1120
|
-
font-size: calc(2.6 * var(--mp-unit));
|
|
1121
|
-
line-height: 1;
|
|
1122
|
-
color: #fff;
|
|
1123
|
-
}
|
|
1124
|
-
`,db=()=>{let e=Q(e=>e.burnedInSubtitles),t=Q(e=>e.pictureInPictureMode),[n,r]=M(!1);return g(()=>{if(t!==`burn-in`||!e){r(!1);return}r(!0);let n=setTimeout(()=>r(!1),lb);return()=>clearTimeout(n)},[t,e]),t!==`burn-in`||!e?null:L(`div`,{css:ub,className:n?`show`:``,role:`status`,children:_(`div`,{className:`card`,children:[_(`div`,{className:`words`,children:[L(`div`,{className:`title`,children:`Subtitles are in the picture`}),L(`div`,{className:`body`,children:`Now hover the video and click your browser's own pop out button`})]}),L(`div`,{className:`arrow`,"aria-hidden":`true`,children:`→`})]})})},fb=1,pb=6e3,mb=1,hb={opening:`Skip Opening`,ending:`Skip Ending`},gb=f`
|
|
1125
|
-
position: absolute;
|
|
1126
|
-
inset: 0;
|
|
1127
|
-
z-index: 2;
|
|
1128
|
-
pointer-events: none;
|
|
1129
|
-
|
|
1130
|
-
button {
|
|
1131
|
-
position: absolute;
|
|
1132
|
-
/* clear of the control bar, which is 6 to 8px of padding plus a row of 18 to 28px controls and
|
|
1133
|
-
the seekbar above them */
|
|
1134
|
-
bottom: calc(7 * var(--mp-unit));
|
|
1135
|
-
right: calc(2.4 * var(--mp-unit));
|
|
1136
|
-
|
|
1137
|
-
/* the one thing in this layer that can be pressed */
|
|
1138
|
-
pointer-events: auto;
|
|
1139
|
-
cursor: pointer;
|
|
1140
|
-
|
|
1141
|
-
${Rv.bMedium.bold}
|
|
1142
|
-
color: #fff;
|
|
1143
|
-
padding: calc(1 * var(--mp-unit)) calc(1.8 * var(--mp-unit));
|
|
1144
|
-
border: 1px solid rgba(255, 255, 255, .55);
|
|
1145
|
-
border-radius: calc(.4 * var(--mp-unit));
|
|
1146
|
-
background-color: rgba(20, 20, 22, .8);
|
|
1147
|
-
box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
|
|
1148
|
-
|
|
1149
|
-
opacity: 0;
|
|
1150
|
-
transform: translateY(calc(.6 * var(--mp-unit)));
|
|
1151
|
-
/* visibility as well as opacity, so a faded button cannot be hovered or pressed */
|
|
1152
|
-
visibility: hidden;
|
|
1153
|
-
transition: opacity .18s ease, transform .18s ease, visibility .18s;
|
|
1154
|
-
|
|
1155
|
-
&:hover, &:focus-visible {
|
|
1156
|
-
background-color: rgba(255, 255, 255, .92);
|
|
1157
|
-
color: #111;
|
|
1158
|
-
border-color: transparent;
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
&.show button {
|
|
1163
|
-
opacity: 1;
|
|
1164
|
-
transform: none;
|
|
1165
|
-
visibility: visible;
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
@media (pointer: coarse) {
|
|
1169
|
-
button {
|
|
1170
|
-
/* a finger needs a target, and the control row below is already 44px */
|
|
1171
|
-
min-height: 44px;
|
|
1172
|
-
bottom: calc(9 * var(--mp-unit));
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
`,_b=()=>{let e=Q(e=>e.chapters),t=Q(e=>e.currentTime),n=Q(e=>e.requestSeek),r=Q(e=>e.seekPreview),i=Q(),a=P(()=>Ey(e),[e]),o=P(()=>{if(typeof t!=`number`)return;let n=e.findIndex((e,n)=>a[n]!==void 0&&e.start-fb<=t&&t<e.end),r=n>=0?a[n]:void 0;return r?{kind:r,end:e[n].end}:void 0},[e,a,t]),s=O(0),[c,l]=M(0);g(()=>{let e=typeof t==`number`?t:0,n=s.current;s.current=e,e<n-mb&&l(e=>e+1)},[t]);let[u,d]=M(!1),f=o?`${o.kind}@${o.end}`:``;return g(()=>{if(!f){d(!1);return}d(!0);let e=setTimeout(()=>d(!1),pb);return()=>clearTimeout(e)},[f,c]),g(()=>{o||d(!1)},[o]),o?L(`div`,{css:gb,className:u&&!r?`show`:``,children:L(`button`,{type:`button`,className:`skip-chapter`,onClick:()=>{d(!1),n?n(o.end):i.seek(o.end)},children:hb[o.kind]})}):null},vb=3e3,yb=f`
|
|
1176
|
-
position: absolute;
|
|
1177
|
-
inset: 0;
|
|
1178
|
-
z-index: 2;
|
|
1179
|
-
/* Never eats a click: click-to-pause still reaches the video underneath, and an item that needs a
|
|
1180
|
-
pointer (a tooltip anchor, a button) sets \`pointer-events: auto\` on itself. */
|
|
1181
|
-
pointer-events: none;
|
|
1182
|
-
/* visibility, not only opacity: an item that took pointer events back would otherwise stay
|
|
1183
|
-
hoverable while faded out, popping a tooltip over nothing. It cascades where pointer-events does
|
|
1184
|
-
not, and transitioning it holds the item on screen for the length of the fade. */
|
|
1185
|
-
transition: opacity 0.1s cubic-bezier(.4,0,1,1), visibility 0.1s;
|
|
1186
|
-
`,bb=(e,t)=>{let n=e.left-t.left,r=e.top-t.top;return`path(evenodd, 'M0 0H${t.width}V${t.height}H0Z M${n} ${r}H${n+e.width}V${r+e.height}H${n}Z')`},xb=f`
|
|
1187
|
-
position: relative;
|
|
1188
|
-
background-color: black;
|
|
1189
|
-
display: flex;
|
|
1190
|
-
justify-content: center;
|
|
1191
|
-
align-items: center;
|
|
1192
|
-
height: 100%;
|
|
1193
|
-
width: 100%;
|
|
1194
|
-
|
|
1195
|
-
& > div:not(:last-of-type) {
|
|
1196
|
-
position: absolute;
|
|
1197
|
-
z-index: 2;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
/* The subtitle layer sits UNDER the title and the spinner, where the canvas itself used to sit.
|
|
1201
|
-
As a plain child div it is matched by the rule above and raised to the overlay items' level,
|
|
1202
|
-
which paints subtitles over the title's gradient, over the spinner and over the error text.
|
|
1203
|
-
Naming the type as well is what takes it back: :not() carries the specificity of its argument,
|
|
1204
|
-
so the rule above is (0,2,1) and a bare .subtitles at (0,2,0) loses to it whatever the source
|
|
1205
|
-
order, while div.subtitles ties at (0,2,1) and second place in the same block then wins.
|
|
1206
|
-
subtitle-layering.browser.test.tsx measures the computed value rather than trusting this. */
|
|
1207
|
-
& > div.subtitles {
|
|
1208
|
-
inset: 0;
|
|
1209
|
-
z-index: 1;
|
|
1210
|
-
pointer-events: none;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
/* Over everything, the control bar included, while a click on the picture in picture control is let
|
|
1214
|
-
through, with a hole at the control. Inside the hole every pointer event goes to the host's
|
|
1215
|
-
document and this one hears nothing, so the pointer arriving on this layer is the only sign here
|
|
1216
|
-
that it left the control. Named with its type for the specificity reason just above. */
|
|
1217
|
-
& > div.pass-through {
|
|
1218
|
-
inset: 0;
|
|
1219
|
-
z-index: 5;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
canvas {
|
|
1223
|
-
height: 100%;
|
|
1224
|
-
width: 100%;
|
|
1225
|
-
pointer-events: none;
|
|
1226
|
-
position: absolute;
|
|
1227
|
-
z-index: 1;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
.video, video {
|
|
1231
|
-
height: 100%;
|
|
1232
|
-
width: 100%;
|
|
1233
|
-
background-color: black;
|
|
1234
|
-
object-fit: contain;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
&.hide {
|
|
1238
|
-
cursor: none;
|
|
1239
|
-
}
|
|
1240
|
-
`,Sb=(t,n=``)=>o.toArray(t).flatMap((t,r)=>{let i=`${n}${e(t)&&t.key!=null?t.key:r}`;return e(t)&&t.type===x?Sb(t.props.children,`${i}/`):[{key:i,item:t}]}),Cb=({ref:e,onVideoRef:t,onSubtitleRef:n,overlay:r,controls:i,children:a})=>{let o=Q(),s=Q(e=>e.hideUI),c=Q(e=>e.setHideUI),l=Q(e=>e.hasMedia),u=Q(e=>e.passThroughPictureInPicture),d=O(void 0),f=O(`mouse`),p=O({x:-1,y:-1}),m=O(null);g(()=>()=>clearTimeout(d.current),[]),g(()=>{l||(clearTimeout(d.current),c(!1))},[l,c]);let h=()=>{l&&c(!0)},v=t=>{m.current=t,typeof e==`function`?e(t):e&&(e.current=t)},y=()=>{if(o.passThroughPictureInPicture?.armed)return!0;if(f.current!==`mouse`)return!1;let{x:e,y:t}=p.current;if(!m.current||e<0)return!1;let n=document.elementFromPoint(e,t);return!!n&&m.current.contains(n)&&!n.closest(`.video`)},b=()=>{if(y()){d.current=setTimeout(b,vb);return}h()},x=()=>{c(!1),clearTimeout(d.current),d.current=setTimeout(b,vb)};return _(`div`,{css:xb,ref:v,onPointerMove:e=>{f.current=e.pointerType,e.pointerType===`mouse`&&(p.current={x:e.clientX,y:e.clientY},x())},onPointerDown:e=>{f.current=e.pointerType},onMouseOut:e=>{let t=e.relatedTarget;if(t&&e.currentTarget.contains(t))return;let{left:n,right:r,top:i,bottom:a}=e.currentTarget.getBoundingClientRect();e.clientX>=n&&e.clientX<r&&e.clientY>=i&&e.clientY<a||(clearTimeout(d.current),h())},className:s?`hide`:``,children:[L(Gv,{onSubtitleRef:n}),Sb(r).map(({key:e,item:t})=>L(`div`,{css:yb,style:{...s?{opacity:`0`,visibility:`hidden`,pointerEvents:`none`}:{}},children:t},e)),i===!1?null:L(cb,{}),L(db,{}),L(_b,{}),u?.armed&&m.current?L(`div`,{className:`pass-through`,style:{clipPath:bb(u.armed,m.current.getBoundingClientRect())},onPointerOver:u.disarm}):null,_(`div`,{className:`video`,onClick:()=>{if(f.current===`mouse`){o.togglePaused();return}s?x():(clearTimeout(d.current),h())},children:[t?L(`video`,{ref:t,playsInline:!0}):null,a]})]})},wb=({options:e,children:t})=>{let n=`media`in e?e:null,r=n?null:e,{title:i,chapters:a}=e,{size:o,downloadedRanges:s,publicPath:c,libavWorkerUrl:l,read:u,thumbnailRead:d,thumbnailsEnabled:f}=r??{},p=Dl(),m=Ol(),[h,_]=M(null),[v,y]=M(null),b=n?.media??h;g(()=>(p?.(b),()=>p?.(null)),[b,p]);let{expose:x}=e,S=x===!0?{}:x||void 0,C=O(S);C.current=S;let w=S?S.id:void 0,T=S?S.origin:void 0,E=S?S.channel:void 0;g(()=>{if(!x||!b)return;let e,t=!1;return de(async()=>{let{exposePlayer:e}=await import(`./remote-BwnfCi4M.js`);return{exposePlayer:e}},__vite__mapDeps([0,1,2]),import.meta.url).then(({exposePlayer:n})=>{t||(e=n(b,C.current??{}))}).catch(()=>{}),()=>{t=!0,e?.()}},[b,!!x,w,T,E]),Dv(h,v,r);let{thumbnails:D,requestThumbnail:k}=Av({publicPath:c,workerUrl:l,length:f===!1?void 0:o,read:d??u,downloadedRanges:s}),A=n?.thumbnails?.all??D,{toggle:j,mode:ee,burnedIn:te}=jv(h,v),ne=Lv(n?.media??null,n?.pictureInPicture),N=Q(e=>e.setSourceState),P=n?!!n.media:o!==void 0;g(()=>{N({title:i,size:o,downloadedRanges:s,hasMedia:P})},[N,i,o,s,P]);let F=n?.thumbnails?.at;g(()=>{N({thumbnails:A,thumbnailAt:F,requestThumbnail:k,togglePictureInPicture:j,pictureInPictureMode:ee,burnedInSubtitles:te})},[N,A,F,k,j,ee,te]),g(()=>{N({passThroughPictureInPicture:ne})},[N,ne]);let I=n?.subtitles?.selection,re=n?.audioTracks?.selection;return g(()=>{I&&N({subtitleTracks:I.options.map(({id:e,label:t,disabled:n})=>({id:e,label:t,disabled:n})),selectedSubtitleTrack:I.selectedId??void 0,selectSubtitleTrack:e=>I.select(e==null?null:String(e)),subtitleOffLabel:I.offLabel})},[N,I]),g(()=>{re&&N({audioTracks:re.options.map(({id:e,label:t,disabled:n})=>({id:e,label:t,disabled:n})),selectedAudioTrack:re.selectedId??void 0,selectAudioTrack:e=>re.select(String(e))})},[N,re]),g(()=>{a&&N({chapters:a})},[N,a]),L(Cb,{ref:m,onVideoRef:n?void 0:_,onSubtitleRef:y,overlay:e.overlay,controls:e.controls,children:t})},Tb=f`
|
|
1241
|
-
/**
|
|
1242
|
-
* The chrome's whole scale, in one place.
|
|
1243
|
-
*
|
|
1244
|
-
* Everything inside is sized against this rather than against \`rem\`, because \`rem\` is root
|
|
1245
|
-
* relative and a library cannot own the host page's root font. The old contract was that the host
|
|
1246
|
-
* set \`html { font-size: 62.5% }\`, which silently rendered every control 1.6x too large in any app
|
|
1247
|
-
* that did not, and could not be met by an app whose own screens are sized against the default.
|
|
1248
|
-
* Override it on the player element to rescale the whole chrome.
|
|
1249
|
-
*/
|
|
1250
|
-
--mp-unit: 10px;
|
|
1251
|
-
|
|
1252
|
-
/**
|
|
1253
|
-
* The chrome's own typeface, for exactly the reason the unit above exists.
|
|
1254
|
-
*
|
|
1255
|
-
* \`font-family\` inherits, and this library declared it nowhere, so every label drew in whatever the
|
|
1256
|
-
* embedding document happened to set, and in the UA's serif where it set nothing. Not hypothetical:
|
|
1257
|
-
* stub mounts the player in a second document, \`embed.html\`, which sets no font and loads no face,
|
|
1258
|
-
* and the entire settings menu came out in Times New Roman.
|
|
1259
|
-
*
|
|
1260
|
-
* Named faces only, no bundled webfont. The chrome is a handful of short labels, so a font request
|
|
1261
|
-
* on the critical path of a document whose job is to paint video buys a round trip and a flash of
|
|
1262
|
-
* unstyled text for nothing.
|
|
1263
|
-
*
|
|
1264
|
-
* Read through \`var()\` so a host with a brand face sets \`--mp-font-family\` on any ancestor and it
|
|
1265
|
-
* inherits in. A bare \`font-family\` on the host can no longer reach the chrome: this declaration is
|
|
1266
|
-
* on the player element itself and beats anything inherited.
|
|
1267
|
-
*/
|
|
1268
|
-
font-family: var(
|
|
1269
|
-
--mp-font-family,
|
|
1270
|
-
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
1271
|
-
'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji'
|
|
1272
|
-
);
|
|
1273
|
-
|
|
1274
|
-
/**
|
|
1275
|
-
* The chrome's default ink, same argument again.
|
|
1276
|
-
*
|
|
1277
|
-
* Most text here names its own colour, but the two time readouts do not: the elapsed/duration pair
|
|
1278
|
-
* and the seekbar's hover time carry a font token and a black text-shadow and nothing else.
|
|
1279
|
-
* Inherited from a host that declares none that resolves to \`canvastext\`, which is black text under
|
|
1280
|
-
* a black halo on a dark gradient.
|
|
1281
|
-
*/
|
|
1282
|
-
color: #fff;
|
|
1283
|
-
|
|
1284
|
-
/**
|
|
1285
|
-
* The settings menu scrolls, and a UA that has not been told the surface is dark paints that
|
|
1286
|
-
* scrollbar in its light theme: a white track down the side of a #1c1c1c menu. Declared here rather
|
|
1287
|
-
* than asked of the host, so it reaches the menu and nothing outside the player.
|
|
1288
|
-
*/
|
|
1289
|
-
color-scheme: dark;
|
|
1290
|
-
|
|
1291
|
-
/**
|
|
1292
|
-
* The other half of owning the chrome's own scale.
|
|
1293
|
-
*
|
|
1294
|
-
* Every control here is authored against a border box, which this library's dev app sets globally
|
|
1295
|
-
* and a host page has no reason to. Shipped without it, anything that is \`width: 100%\` AND carries
|
|
1296
|
-
* padding overflows its own box: the top bar ran 32px past the player and clipped the right end of
|
|
1297
|
-
* whatever the app had put there. Scoped to the player's subtree so it cannot reach the host's
|
|
1298
|
-
* layout, and only \`box-sizing\`, because zeroing margins here would reach the app's own content.
|
|
1299
|
-
*/
|
|
1300
|
-
&, & *, & *::before, & *::after {
|
|
1301
|
-
box-sizing: border-box;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
display: flex;
|
|
1305
|
-
justify-content: center;
|
|
1306
|
-
background-color: #111;
|
|
1307
|
-
height: 100%;
|
|
1308
|
-
width: 100%;
|
|
1309
|
-
overflow: hidden;
|
|
1310
|
-
`,Eb=e=>L(`div`,{css:Tb,children:L(gv.Provider,{children:L(wb,{options:e,children:e.children})})}),Db=({menu:e,section:t,option:n,sectionIndex:r})=>[...[...document.querySelectorAll(e)].flatMap(e=>[...e.querySelectorAll(t)])[r]?.querySelectorAll(n)??[]].map(e=>({label:e.getAttribute(`aria-label`)??``,selected:e.getAttribute(`aria-checked`)===`true`,disabled:e.getAttribute(`aria-disabled`)===`true`})),Ob=async({button:e,timeout:t})=>{let n=Date.now()+t,r=document.querySelector(e);for(;!r&&Date.now()<n;)await new Promise(e=>setTimeout(e,100)),r=document.querySelector(e);if(!r)throw Object.assign(Error(`Crunchyroll track button is not on the page`),{name:`CrunchyrollControlMissingError`});let i=r.getBoundingClientRect(),a={bubbles:!0,cancelable:!0,composed:!0,clientX:i.left+i.width/2,clientY:i.top+i.height/2,button:0},o={...a,pointerType:`mouse`,pointerId:1,isPrimary:!0};r.dispatchEvent(new PointerEvent(`pointerdown`,{...o,buttons:1})),r.dispatchEvent(new MouseEvent(`mousedown`,{...a,buttons:1})),r.dispatchEvent(new PointerEvent(`pointerup`,{...o,buttons:0})),r.dispatchEvent(new MouseEvent(`mouseup`,{...a,buttons:0})),r.dispatchEvent(new MouseEvent(`click`,{...a,buttons:0}))},kb=({menu:e,section:t,option:n,sectionIndex:r,optionIndex:i})=>{let a=[...document.querySelectorAll(e)].flatMap(e=>[...e.querySelectorAll(t)])[r]?.querySelectorAll(n)[i];if(!a)throw Object.assign(Error(`Crunchyroll track option ${i} is not in the menu`),{name:`CrunchyrollControlMissingError`});let o=a.getBoundingClientRect(),s={bubbles:!0,cancelable:!0,composed:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2,button:0},c={...s,pointerType:`mouse`,pointerId:1,isPrimary:!0};a.dispatchEvent(new PointerEvent(`pointerdown`,{...c,buttons:1})),a.dispatchEvent(new MouseEvent(`mousedown`,{...s,buttons:1})),a.dispatchEvent(new PointerEvent(`pointerup`,{...c,buttons:0})),a.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0})),a.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0}))},Ab=async({timeline:e,time:t,timeout:n})=>{let r=Date.now()+n,i=document.querySelector(e);for(;!i&&Date.now()<r;)await new Promise(e=>setTimeout(e,100)),i=document.querySelector(e);if(i?.tagName!==`INPUT`)throw Object.assign(Error(`Crunchyroll timeline is not on the page`),{name:`CrunchyrollControlMissingError`});let a=i,o=Number(a.min||0),s=Number(a.max||100),c=a.getBoundingClientRect(),l=Math.max(0,Math.min(1,(t-o)/(s-o))),u={bubbles:!0,cancelable:!0,composed:!0,clientX:c.left+c.width*l,clientY:c.top+c.height/2,button:0},d={...u,pointerType:`mouse`,pointerId:1,isPrimary:!0},f=a.type===`range`&&Number.isFinite(o)&&Number.isFinite(s)&&s>o;f&&(a.dispatchEvent(new PointerEvent(`pointerdown`,{...d,buttons:1})),a.dispatchEvent(new MouseEvent(`mousedown`,{...u,buttons:1}))),a._valueTracker?.setValue(``),Object.getOwnPropertyDescriptor(Object.getPrototypeOf(a),`value`).set.call(a,String(t)),a.dispatchEvent(new Event(`input`,{bubbles:!0})),f&&(a.dispatchEvent(new PointerEvent(`pointerup`,{...d,buttons:0})),a.dispatchEvent(new MouseEvent(`mouseup`,{...u,buttons:0}))),a.dispatchEvent(new Event(`change`,{bubbles:!0}))},jb=`stub:pictureinpicturerefused`,Mb=({video:e})=>{let t=document.querySelector(e);if(!document.pictureInPictureEnabled||typeof t?.requestPictureInPicture!=`function`)return!1;let n=(e,t)=>e.dispatchEvent(new CustomEvent(`stub:pictureinpicturerefused`,{detail:`${t.name}: ${t.message}`})),r=t=>{if(!t.isTrusted||(t.stopImmediatePropagation(),t.type!==`click`))return;t.preventDefault();let r=document.querySelector(e);r&&(r.disablePictureInPicture=!1,r.requestPictureInPicture().catch(e=>n(r,e)))};for(let e of[`pointerdown`,`mousedown`,`pointerup`,`mouseup`,`click`,`dblclick`])window.addEventListener(e,r,!0);return!0},Nb=`[data-testid="track-selection-button"]`,Pb=`[data-testid="audio-text-track-menu"]`,Fb=`.timeline-slider`,Ib=`[role="menu"]`,Lb=`[role="menuitemradio"]`,Rb=1e4,zb=2e4,Bb=5e3,Vb=100,Hb={menu:Pb,section:Ib,option:Lb},Ub=/^(off|none|disabled)$/i,Wb=e=>new Promise(t=>setTimeout(t,e)),Gb=()=>!1,Kb=e=>{if(e())throw Error(`Crunchyroll track operation cancelled`)},qb=e=>e===`audio`?0:1,Jb=e=>e.replace(/\s+/g,` `).trim(),Yb=(e,t)=>{let n=[...new Map(t.map(e=>({...e,label:Jb(e.label)})).filter(e=>e.label).map(e=>[e.id,e])).values()],r=n.find(e=>e.selected);if(!r)return;let i=e===`subtitles`?n.find(e=>Ub.test(e.label)):void 0,a=n.filter(e=>e!==i).map(e=>({id:e.id,label:e.label,disabled:e.disabled||void 0}));if(!(a.length<2&&!i)&&a.length)return{options:a,selectedId:r===i?null:r.id,...i?{offLabel:i.label}:{}}},Xb=async(e,t)=>{Kb(t);let n=e.locator(Pb);if(await n.exists({timeout:1e3})){Kb(t);return}Kb(t),await e.evaluate(Ob,{button:Nb,timeout:Rb});let r=Date.now()+Rb;for(;Date.now()<r;){if(Kb(t),await n.exists({timeout:1e3}))return;await Wb(Vb)}throw Error(`Crunchyroll track menu did not open`)},Zb=async(e,t,n)=>{Kb(n);let r=await e.evaluate(Db,{...Hb,sectionIndex:qb(t)});Kb(n);let i=r.map((e,t)=>({...e,label:Jb(e.label),index:t})),a=new Map;for(let e of i)a.set(e.label,(a.get(e.label)??0)+1);let o=new Map;return i.map(e=>{let t=(o.get(e.label)??0)+1;return o.set(e.label,t),{...e,id:a.get(e.label)===1?e.label:`${e.label}#${t}`}})},Qb=async(e,t)=>{let[n,r]=await Promise.all([Zb(e,`audio`,t),Zb(e,`subtitles`,t)]);return{audio:Yb(`audio`,n),subtitles:Yb(`subtitles`,r)}},$b=async(e,t=Gb)=>(await Xb(e,t),Qb(e,t)),ex=async(e,t,n,r)=>(await Zb(e,t,r)).find(e=>n===null?Ub.test(e.label):e.id===n)?.index??-1,tx=async(e,t,n,r)=>{let i=Date.now()+zb;for(;Date.now()<i;){Kb(r),await Xb(e,r);let i=(await Zb(e,t,r)).find(e=>e.selected);if(i&&(n===null?Ub.test(i.label):i.id===n))return;await Wb(Vb)}throw Error(`Crunchyroll did not apply the ${t} option`)},nx=(e,t)=>{let n=Number.isFinite(e)?Math.max(0,e):0;return!Number.isFinite(t)||t<=0?n:Math.min(n,Math.max(0,t-.1))},rx=e=>({currentTime:e.currentTime,paused:e.paused,volume:e.volume,muted:e.muted,playbackRate:e.playbackRate}),ix=(e,t)=>e.evaluate(Ab,{timeline:Fb,time:t,timeout:zb}),ax=async(e,t,n)=>{let r=Date.now()+5e3;for(;Date.now()<r&&(Kb(n),!(e.currentSrc!==t||e.readyState<2));)await Wb(Vb);if(e.currentSrc===t&&e.readyState>=2)return!1;let i=Date.now()+zb;for(;Date.now()<i;){if(Kb(n),e.readyState>=2)return!0;await Wb(Vb)}throw Error(`Crunchyroll playback did not become ready after changing tracks`)},ox=async(e,t,n,r)=>{Kb(r),t.volume=n.volume,t.muted=n.muted,t.playbackRate=n.playbackRate;let i=nx(n.currentTime,t.duration);Math.abs(t.currentTime-i)>2&&await ix(e,i);let a=Date.now()+zb;for(;Date.now()<a&&(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2);)Kb(r),await Wb(Vb);if(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2)throw Error(`Crunchyroll playback position was not restored after changing tracks`);Kb(r),n.paused?t.pause():await t.play();let o=Date.now()+Bb;for(;Date.now()<o&&t.paused!==n.paused;)Kb(r),await Wb(Vb);if(t.paused!==n.paused)throw Error(`Crunchyroll playback state was not restored after changing tracks`)},sx=async(e,t,n,r,i=Gb)=>{await Xb(e,i);let a=await ex(e,n,r,i);if(a<0)throw Error(`Crunchyroll ${n} option is no longer available`);Kb(i);let o=t.currentSrc,s=rx(t);return await e.evaluate(kb,{...Hb,sectionIndex:qb(n),optionIndex:a}),await tx(e,n,r,i),await ax(t,o,i)&&await ox(e,t,s,i),$b(e,i)},cx=(e,t)=>{ix(e,t).catch(e=>console.warn(`[cr] timeline seek failed:`,e))},lx=(e,t)=>new Proxy(e,{set(e,n,r,i){return n===`currentTime`&&typeof r==`number`&&Number.isFinite(r)&&cx(t,r),Reflect.set(e,n,r,i)}}),ux=({title:e,remote:t,frame:n,subtitles:r,audioTracks:i,thumbnails:a,chapters:o,pictureInPicture:s,children:c})=>{let l=P(()=>t&&n?lx(t,n):null,[t,n]);return g(()=>t?T(t):void 0,[t]),L(Eb,{expose:!0,media:l,title:e,subtitles:r,audioTracks:i,thumbnails:a,chapters:o,pictureInPicture:s,children:c})},dx=3e4,fx=async(e,t)=>{let n=Date.now()+dx,r=!1;for(;!t();){let i=await e.locator(`.shell-header`).exists();r||=i;let[a,o]=await Promise.all([e.locator(`#user-menu-anonymous`).exists(),e.locator(`#user-menu-authenticated`).exists()]);if(t())break;if(o)return{isLoggedIn:o,isLoggedOut:!1};let s=Date.now()>=n;if(a&&!i&&(r||s))return{isLoggedIn:o,isLoggedOut:a};if(s)break;await new Promise(e=>setTimeout(e,100))}throw Error(`Login state check timed out`)};v();var px=`video`,mx=(e,t,n)=>{let[r,i]=M(null);return g(()=>{if(!e||!t)return;let n=!1;(async()=>e.evaluate(Mb,{video:px}))().then(e=>{!n&&e&&i(t)},e=>{n||console.warn(`[cr] picture in picture unavailable:`,e)});let r=e=>console.warn(`[cr] picture in picture refused:`,e.detail);return t.addEventListener(jb,r),()=>{n=!0,t.removeEventListener(jb,r),i(null)}},[e,t]),P(()=>r&&r===t&&n?{onArmedChange:e=>{n.style.pointerEvents=e?`auto`:``}}:void 0,[r,t,n])},hx=class extends Error{name=`BifParseError`},gx=[137,66,73,70,13,10,26,10],_x=64,vx=8,yx=4294967295,bx=36e3,xx=e=>{if(e.byteLength<_x)throw new hx(`truncated header: ${e.byteLength} bytes`);let t=new DataView(e);if(gx.some((e,n)=>t.getUint8(n)!==e))throw new hx(`bad magic`);let n=t.getUint32(12,!0),r=t.getUint32(16,!0)||1e3;if(n>bx)throw new hx(`implausible frame count ${n}`);let i=_x+(n+1)*vx;if(i>e.byteLength)throw new hx(`truncated index: ${n} frames need ${i} bytes, have ${e.byteLength}`);let a=e=>t.getUint32(_x+e*vx,!0),o=e=>t.getUint32(_x+e*vx+4,!0);if(a(n)!==yx)throw new hx(`the index does not end on the 0xffffffff entry`);let s=[];for(let t=0;t<n;t+=1){let c=o(t),l=o(t+1);if(c<i||l<=c||l>e.byteLength)throw new hx(`image ${t} spans ${c}..${l}, outside ${i}..${e.byteLength}`);let u=a(t),d=t+1===n;if(!d&&a(t+1)<=u)throw new hx(`timestamps do not increase at image ${t}`);s.push({start:u*r,end:d?1/0:a(t+1)*r,bytes:new Uint8Array(e,c,l-c)})}return s},Sx=(e,t)=>{if(!e.length||!Number.isFinite(t))return;let n=0,r=e.length-1;for(;n<r;){let i=Math.ceil((n+r)/2);e[i].start<=t?n=i:r=i-1}return e[n]},Cx=async({waitMs:e,fetchMs:t,maxBytes:n})=>{let r=/^(?:https?:\/\/|\/)\S*\.bif(?:[?#]\S*)?$/i,i=e=>typeof e==`string`&&e.length<8192&&e.includes(`.bif`)&&r.test(e),a=(e,t)=>{try{return e?.[t]}catch{return}},o=e=>{let t=Object.keys(e).find(e=>e.startsWith(`__reactFiber$`)||e.startsWith(`__reactInternalInstance$`));return t?a(e,t):void 0},s=e=>{let t=[],n=new Set,r=[e,...Array.from(e.querySelectorAll(`*`)).slice(0,3e3)];for(let e of r){let r=o(e);for(let e=0;r&&e<40&&!n.has(r);e+=1){n.add(r);let e=a(a(r,`memoizedProps`),`value`);e&&typeof e==`object`&&t.push(e),r=a(r,`return`)}}return t},c=e=>{let t=new Set,n=e,r=0;for(let e=0;e<=8&&n.length;e+=1){let e=[];for(let o of n){if(t.has(o))continue;if(t.add(o),r+=1,r>2e4)return;let n;try{n=Object.keys(o).slice(0,500)}catch{continue}for(let t of n){let n=a(o,t);if(i(n))return n;n&&typeof n==`object`&&(n===window||typeof a(n,`nodeType`)==`number`||ArrayBuffer.isView(n)||n instanceof ArrayBuffer||e.push(n))}}n=e}},l=e=>{let t=[];for(let n of e){let e=a(a(n,`volumeVM`),`_player`);if(!e||typeof e!=`object`)continue;let r=a(a(a(e,`playerOrchestrator`),`thumbnailOrchestrator`),`_currentBifUrl`);if(i(r))return{url:r,via:`named`};t.push(e)}let n=c(t.length?t:e);return n?{url:n,via:`search`}:void 0},u=async(e,r)=>{let i=new AbortController,a=setTimeout(()=>i.abort(),t);try{let t=await fetch(e,{signal:i.signal});if(!t.ok)return{none:`fetch-failed`,detail:`HTTP ${t.status}`};let a=Number(t.headers.get(`content-length`));if(a>n)return{none:`too-large`,detail:`${a} bytes`};let o=await t.arrayBuffer();return o.byteLength>n?{none:`too-large`,detail:`${o.byteLength} bytes`}:{bytes:o,via:r}}catch(e){return{none:`fetch-failed`,detail:String(e)}}finally{clearTimeout(a)}};try{let t=Date.now()+e,n=!1;for(;;){let e=document.querySelector(`.video-player-wrapper`);if(e?.querySelector(`video`)){n=!0;let t=l(s(e));if(t)return await u(t.url,t.via)}if(Date.now()>=t)return{none:n?`no-bif`:`no-player`};await new Promise(e=>setTimeout(e,500))}}catch(e){return{none:`failed`,detail:String(e)}}},wx={waitMs:1e4,fetchMs:15e3,maxBytes:31457280},Tx=e=>{let t=new Map,n=!1;return{at:r=>{if(n)return;let i=Sx(e,r*1e3);if(!i)return;let a=t.get(i);return a||(a={url:URL.createObjectURL(new Blob([i.bytes],{type:`image/jpeg`})),startTime:i.start/1e3,endTime:i.end/1e3},t.set(i,a)),a},dispose:()=>{n=!0;for(let{url:e}of t.values())URL.revokeObjectURL(e);t.clear()}}},Ex=async e=>{let t=await e.evaluate(Cx,wx);if(`none`in t)throw Error(`no BIF: ${t.none}${t.detail?` (${t.detail})`:``}`);let n=xx(t.bytes);if(!n.length)throw Error(`no BIF: the file has no images`);return Tx(n)};v();var Dx=e=>`https://static.crunchyroll.com/skip-events/production/${e}.json`,Ox=e=>{try{return new URL(e).pathname.match(/\/watch\/([A-Z0-9]+)(?:\/|$)/)?.[1]}catch{return}},kx=[[`intro`,`Opening`],[`recap`,`Recap`],[`credits`,`Ending`],[`preview`,`Preview`]],Ax=`Episode`,jx=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Mx=(e,t)=>{if(!jx(e))return[];let n=t!==void 0&&Number.isFinite(t)&&t>0?t:1/0,r=kx.flatMap(([t,r])=>{let i=e[t];if(!jx(i))return[];let{start:a,end:o}=i;if(typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o))return[];let s={start:Math.max(0,a),end:Math.min(o,n),title:r};return s.end>s.start?[s]:[]}).sort((e,t)=>e.start-t.start),i=[],a=0;for(let e of r){let t=Math.max(e.start,a);e.end<=t||(t>a&&i.push({start:a,end:t,title:Ax}),i.push({start:t,end:e.end,title:e.title}),a=e.end)}return i.length&&n!==1/0&&a<n&&i.push({start:a,end:n,title:Ax}),i},Nx=new Set([403,404]),Px=async(e,t=R)=>{let n=await t(Dx(e));if(!n.ok){if(await n.body?.cancel().catch(()=>{}),Nx.has(n.status))return{};throw Error(`${Dx(e)} answered ${n.status}`)}return n.json()},Fx=e=>{let[t,n]=M();return g(()=>{if(n(e?.duration),!e)return;let t=()=>n(e.duration);return e.addEventListener(`durationchange`,t),e.addEventListener(`loadedmetadata`,t),()=>{e.removeEventListener(`durationchange`,t),e.removeEventListener(`loadedmetadata`,t)}},[e]),t},Ix=[],Lx=(e,t)=>{let n=Ox(e),[r,i]=M(),a=Fx(t);return g(()=>{if(!n)return;let e=!1;return Px(n).then(t=>{e||i({episodeId:n,events:t})},t=>{e||console.warn(`[cr] skip events unavailable:`,t)}),()=>{e=!0}},[n]),P(()=>{if(!r||r.episodeId!==n)return Ix;let e=Mx(r.events,a);return e.length?e:Ix},[r,n,a])};v();var Rx=`
|
|
1311
|
-
html, body {
|
|
1312
|
-
margin: 0 !important;
|
|
1313
|
-
padding: 0 !important;
|
|
1314
|
-
width: 100% !important;
|
|
1315
|
-
height: 100% !important;
|
|
1316
|
-
background: #000 !important;
|
|
1317
|
-
}
|
|
1318
|
-
*:not(:has(.video-player-wrapper)):not(.video-player-wrapper):not(.video-player-wrapper *) {
|
|
1319
|
-
display: none !important;
|
|
1320
|
-
}
|
|
1321
|
-
div[data-testid="player-controls-root"] {
|
|
1322
|
-
display: none !important;
|
|
1323
|
-
}
|
|
1324
|
-
.video-player-wrapper,
|
|
1325
|
-
.video-player,
|
|
1326
|
-
.player-container,
|
|
1327
|
-
.video-player-wrapper > *,
|
|
1328
|
-
.video-player > *,
|
|
1329
|
-
.player-container > * {
|
|
1330
|
-
position: absolute !important;
|
|
1331
|
-
inset: 0 !important;
|
|
1332
|
-
width: 100% !important;
|
|
1333
|
-
height: 100% !important;
|
|
1334
|
-
z-index: 9999999;
|
|
1335
|
-
}
|
|
1336
|
-
.video-player-wrapper video,
|
|
1337
|
-
.video-player video,
|
|
1338
|
-
.player-container video {
|
|
1339
|
-
width: 100% !important;
|
|
1340
|
-
height: 100% !important;
|
|
1341
|
-
object-fit: contain !important;
|
|
1342
|
-
}
|
|
1343
|
-
.video-player-wrapper *:not(:has(video)):not(video):not(:has(.timeline-slider)):not(.timeline-slider) {
|
|
1344
|
-
display: none !important;
|
|
1345
|
-
}
|
|
1346
|
-
.timeline-container,
|
|
1347
|
-
.timeline-container *,
|
|
1348
|
-
.timeline-slider {
|
|
1349
|
-
opacity: 0 !important;
|
|
1350
|
-
pointer-events: none !important;
|
|
1351
|
-
}
|
|
1352
|
-
/* shows only where the frame takes pointer events: the player's picture in picture control, armed */
|
|
1353
|
-
html, html * {
|
|
1354
|
-
cursor: pointer !important;
|
|
1355
|
-
}
|
|
1356
|
-
`,zx=3e4,Bx=async(e,t)=>{let n=Date.now()+zx;for(;!t()&&Date.now()<n;){try{if(await e.locator(`video`).exists())return t()?null:await e.locator(`video`).videoElement()}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,100))}return null},Vx=i`
|
|
1357
|
-
to { transform: rotate(360deg); }
|
|
1358
|
-
`,Hx=f`
|
|
1359
|
-
position: relative;
|
|
1360
|
-
width: 100%;
|
|
1361
|
-
height: 100%;
|
|
1362
|
-
background: #000;
|
|
1363
|
-
/* The double-tap-to-fullscreen gesture otherwise word-selects the
|
|
1364
|
-
skin's labels/time readouts, flashing them blue. Player chrome isn't
|
|
1365
|
-
meant to be selected, so suppress it across the whole player. */
|
|
1366
|
-
user-select: none;
|
|
1367
|
-
-webkit-user-select: none;
|
|
1368
|
-
|
|
1369
|
-
.cr-frame {
|
|
1370
|
-
position: absolute;
|
|
1371
|
-
inset: 0;
|
|
1372
|
-
width: 100%;
|
|
1373
|
-
height: 100%;
|
|
1374
|
-
border: none;
|
|
1375
|
-
background: #000;
|
|
1376
|
-
/* CR's own chrome is hidden, so the iframe must not swallow clicks -
|
|
1377
|
-
taps belong to the videojs gesture layer stacked above it. The one
|
|
1378
|
-
exception is picture-in-picture.ts, which lifts this while the
|
|
1379
|
-
player's picture in picture control is under the pointer. */
|
|
1380
|
-
pointer-events: none;
|
|
1381
|
-
}
|
|
1382
|
-
|
|
1383
|
-
.overlay {
|
|
1384
|
-
position: absolute;
|
|
1385
|
-
inset: 0;
|
|
1386
|
-
display: flex;
|
|
1387
|
-
flex-direction: column;
|
|
1388
|
-
align-items: center;
|
|
1389
|
-
justify-content: center;
|
|
1390
|
-
gap: 1.6rem;
|
|
1391
|
-
background: #000;
|
|
1392
|
-
font-size: 1.4rem;
|
|
1393
|
-
color: rgba(255, 255, 255, 0.8);
|
|
1394
|
-
/* Above the skin's own layers (its controls/error dialog top out at
|
|
1395
|
-
z-index 20) so the login/loading screen fully covers them. */
|
|
1396
|
-
z-index: 30;
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
.login-button {
|
|
1400
|
-
padding: 0.8rem 2rem;
|
|
1401
|
-
background: #f47521;
|
|
1402
|
-
color: #fff;
|
|
1403
|
-
border: none;
|
|
1404
|
-
border-radius: 0.4rem;
|
|
1405
|
-
font-size: 1.4rem;
|
|
1406
|
-
font-weight: 600;
|
|
1407
|
-
cursor: pointer;
|
|
1408
|
-
|
|
1409
|
-
&:hover {
|
|
1410
|
-
background: #e0651a;
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
&:disabled {
|
|
1414
|
-
opacity: 0.6;
|
|
1415
|
-
cursor: default;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
.login-note {
|
|
1420
|
-
max-width: 36rem;
|
|
1421
|
-
font-size: 1.2rem;
|
|
1422
|
-
text-align: center;
|
|
1423
|
-
color: rgba(255, 255, 255, 0.6);
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
/* @banou/media-player's own buffering spinner (overlay.tsx), same box and centre, so when the video
|
|
1427
|
-
arrives still buffering the player's spinner takes over from this one without a jump */
|
|
1428
|
-
.loading-spinner {
|
|
1429
|
-
box-sizing: border-box;
|
|
1430
|
-
width: calc(4 * var(--mp-unit, 10px));
|
|
1431
|
-
height: calc(4 * var(--mp-unit, 10px));
|
|
1432
|
-
border-radius: 50%;
|
|
1433
|
-
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
1434
|
-
border-top-color: #fff;
|
|
1435
|
-
animation: ${Vx} 0.8s linear infinite;
|
|
1436
|
-
}
|
|
1437
|
-
`,Ux=({url:e,title:t})=>{let[n,r]=M(`detecting`),[i,a]=M(null),[o,s]=M(null),[c,l]=M(!0),[u,d]=M(!1),[f,p]=M(),[m,v]=M(null),[y,b]=M(0),[x,S]=M(0),[w,T]=M(!1),[E,D]=M(!1),A=O(null),j=O(null),[ee,ne]=M(!1),N=O(!1),[I,re]=M(),[ie,ae]=M(),R=Lx(e,m),z=mx(o,m,i),se=O(0),de=O({generation:0,tail:Promise.resolve()}),pe=O(!0),me=k(()=>{let e=se.current+1;return se.current=e,de.current={generation:e,tail:Promise.resolve()},re(void 0),e},[]),he=k((e,t)=>{if(de.current.generation!==e)return Promise.reject(Error(`Crunchyroll track operation cancelled`));let n=de.current,r=n.tail.then(t);return n.tail=r.then(()=>{},()=>{}),r},[]);g(()=>()=>{pe.current=!1,se.current+=1},[]),g(()=>{let e=!1;return fe().then(t=>{e||r(t)}),()=>{e=!0}},[]),g(()=>{if(!i||n===`detecting`)return;let e=!1;return le({iframe:i,domains:C,cookies:ue(n),permissions:[{category:`evaluation`,reason:`Switch audio and subtitles, seek the video, show seek thumbnails and open picture in picture`}]}).then(t=>{e||s(t)}).catch(t=>{e||(console.error(`Failed to attach Crunchyroll frame`,t),p(t?.message||`Failed to load player`),l(!1))}),()=>{e=!0}},[i,n]),g(()=>{if(!o)return;let t=!1,r=()=>t;return l(!0),p(void 0),d(!1),v(null),me(),(async()=>{if(n===`cloud`){if(await o.goto(e,{waitUntil:`commit`}),t)return;let{isLoggedIn:n}=await fx(o,r);if(t)return;if(ce.record(`crunchyroll`,n?`signed-in`:`signed-out`),!n){l(!1),d(!0);return}if(await o.addStyleTag({content:Rx}),t)return;let i=await Bx(o,r);if(t)return;if(l(!1),!i)throw Error(`The episode did not load a player. It may be unavailable or require a different plan.`);v(i);return}if(await o.goto(e,{waitUntil:`commit`}),t||(await o.addStyleTag({content:Rx}),t))return;let{isLoggedIn:i}=await fx(o,r);if(t)return;if(ce.record(`crunchyroll`,i?`signed-in`:`signed-out`),!i){l(!1),d(!0);return}let a=await Bx(o,r);if(!t){if(l(!1),!a)throw Error(`The episode did not load a player. It may be unavailable or require a different plan.`);v(a)}})().catch(e=>{t||(console.error(`Failed to load Crunchyroll player`,e),p(e?.message||`Failed to load player`),l(!1))}),()=>{t=!0}},[o,e,y,n,me]),g(()=>{if(!o||!m)return;let e=me(),t=!1,n=()=>t||!pe.current||e!==se.current;return(async()=>{let t,r;for(let i=0;i<5&&!n();i+=1){try{if(r=await he(e,()=>$b(o,n)),t=void 0,n()||(re(r),r.audio&&r.subtitles))return}catch(e){t=e}await new Promise(e=>setTimeout(e,500))}if(!r&&t)throw t})().then(()=>{},e=>{n()||console.warn(`[cr] track discovery failed:`,e)}),()=>{t=!0}},[o,m,me,he]),g(()=>{if(!o||!m)return;let e=!1,t;return Ex(o).then(n=>{if(e)return n.dispose();t=n,ae(n)},t=>{e||console.warn(`[cr] seek thumbnails unavailable:`,t)}),()=>{e=!0,t?.dispose(),ae(void 0)}},[o,m]);let ge=se.current,_e=k((e,t)=>{if(!o||!m)return Promise.reject(Error(`Crunchyroll player is not ready`));let n=()=>!pe.current||ge!==se.current;return he(ge,async()=>{try{let r=await sx(o,m,e,t,n);if(n())throw Error(`Crunchyroll track operation cancelled`);re(r)}catch(e){if(!n())try{let e=await $b(o,n);n()||re(e)}catch{}throw e}})},[o,m,he,ge]),ve=P(()=>I?.subtitles&&{selection:{...I.subtitles,select:e=>_e(`subtitles`,e)}},[I?.subtitles,_e]),ye=P(()=>I?.audio&&{selection:{...I.audio,select:e=>_e(`audio`,e)}},[I?.audio,_e]),be=k(()=>{if(A.current!==null)return;let e=globalThis.open(h,`_blank`,`width=500,height=700`);if(!e){D(!0),l(!1);return}D(!1),T(!0),j.current=e;let t=setInterval(()=>{e.closed&&(clearInterval(t),A.current===t&&(A.current=null),j.current===e&&(j.current=null),T(!1),b(e=>e+1))},500);A.current=t},[]),xe=k(()=>{s(null),p(void 0),v(null),me(),d(!1),l(!0),S(e=>e+1)},[me]),Se=k(()=>{if(N.current)return;N.current=!0;let e=oe({url:h,domains:C,isSignedIn:te});D(!1),ne(!0),e.then(e=>{if(pe.current){if(e===`blocked`){D(!0);return}if(e===`unsupported`){p(`The Crunchyroll sign-in window could not be opened here.`);return}if(e===`authed`){xe();return}d(!1),l(!0),b(e=>e+1)}},e=>{pe.current&&(console.error(`Crunchyroll sign-in window failed`,e),p(e?.message||`The sign-in window failed`))}).finally(()=>{N.current=!1,pe.current&&ne(!1)})},[xe]);g(()=>()=>{A.current!==null&&(clearInterval(A.current),A.current=null)},[]),g(()=>{A.current!==null&&(clearInterval(A.current),A.current=null,T(!1)),D(!1)},[e]);let B=k(()=>{j.current!==null&&(j.current.close(),j.current=null),A.current!==null&&(clearInterval(A.current),A.current=null),D(!1),T(!1),xe()},[xe]),Ce=(c||f||E||u)&&_(`div`,{className:`overlay`,children:[u&&!f&&!E&&_(F,{children:[`You need to be logged in to Crunchyroll to watch this content.`,n===`extension`?L(`button`,{className:`login-button`,onClick:be,disabled:w,children:w?`Finish signing in the popup...`:`Open Crunchyroll Login Page`}):_(F,{children:[L(`button`,{className:`login-button`,onClick:Se,disabled:ee,children:ee?`Finish signing in the window...`:`Sign in to Crunchyroll`}),L(`span`,{className:`login-note`,children:`Sign-in happens in a window served through FKN, so your browser will not autofill saved passwords or offer passkeys there.`})]})]}),E&&!f&&_(F,{children:[`The login popup was blocked. Allow popups for this page and try again.`,L(`button`,{className:`login-button`,onClick:n===`extension`?be:Se,children:`Open Crunchyroll Login Page`})]}),f&&_(F,{children:[f,L(`button`,{className:`login-button`,onClick:B,children:`Retry`})]}),c&&!f&&!u&&L(`div`,{className:`loading-spinner`,role:`status`,"aria-label":`Loading`})]});return _(`div`,{css:Hx,children:[n!==`detecting`&&L(ux,{title:t,remote:m,frame:o,subtitles:ve,audioTracks:ye,thumbnails:ie,chapters:R,pictureInPicture:z,children:L(`iframe`,{ref:a,className:`cr-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`},`${n}-${x}`)}),Ce]})},Wx=e=>e,Gx=Wx(({className:e,children:t})=>L(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,fill:`none`,"aria-hidden":`true`,className:e,children:t})),Kx=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`m14.051 10.723-7.985 4.964a1.98 1.98 0 0 1-2.758-.638A2.06 2.06 0 0 1 3 13.964V4.036C3 2.91 3.895 2 5 2c.377 0 .747.109 1.066.313l7.985 4.964a2.057 2.057 0 0 1 .627 2.808c-.16.257-.373.475-.627.637`})})),qx=Wx(({className:e})=>_(Gx,{className:e,children:[L(`rect`,{width:5,height:14,x:2,y:2,fill:`currentColor`,rx:1.75}),L(`rect`,{width:5,height:14,x:11,y:2,fill:`currentColor`,rx:1.75})]})),Jx=Wx(({className:e})=>_(Gx,{className:e,children:[L(`path`,{fill:`currentColor`,d:`M9 17a8 8 0 0 1-8-8h2a6 6 0 1 0 1.287-3.713l1.286 1.286A.25.25 0 0 1 5.396 7H1.25A.25.25 0 0 1 1 6.75V2.604a.25.25 0 0 1 .427-.177l1.438 1.438A8 8 0 1 1 9 17`}),L(`path`,{fill:`currentColor`,d:`m11.61 9.639-3.331 2.07a.826.826 0 0 1-1.15-.266.86.86 0 0 1-.129-.452V6.849C7 6.38 7.374 6 7.834 6c.158 0 .312.045.445.13l3.331 2.071a.858.858 0 0 1 0 1.438`})]})),Yx=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M1 9c0 2.21.895 4.21 2.343 5.657l1.414-1.414a6 6 0 1 1 8.956-7.956l-1.286 1.286a.25.25 0 0 0 .177.427h4.146a.25.25 0 0 0 .25-.25V2.604a.25.25 0 0 0-.427-.177l-1.438 1.438A8 8 0 0 0 1 9`})})),Xx=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752M14.5 7.586l-1.768-1.768a1 1 0 1 0-1.414 1.414L13.085 9l-1.767 1.768a1 1 0 0 0 1.414 1.414l1.768-1.768 1.768 1.768a1 1 0 0 0 1.414-1.414L15.914 9l1.768-1.768a1 1 0 0 0-1.414-1.414z`})})),Zx=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752m10.568.59a.91.91 0 0 1 0-1.316.91.91 0 0 1 1.316 0c1.203 1.203 1.47 2.216 1.522 3.208q.012.255.011.51c0 1.16-.358 2.733-1.533 3.803a.7.7 0 0 1-.298.156c-.382.106-.873-.011-1.018-.156a.91.91 0 0 1 0-1.316c.57-.57.995-1.551.995-2.487 0-.944-.26-1.667-.995-2.402`})})),Qx=Wx(({className:e})=>_(Gx,{className:e,children:[L(`path`,{fill:`currentColor`,d:`M15.6 3.3c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4C15.4 5.9 16 7.4 16 9s-.6 3.1-1.8 4.3c-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7`}),L(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752m10.568.59a.91.91 0 0 1 0-1.316.91.91 0 0 1 1.316 0c1.203 1.203 1.47 2.216 1.522 3.208q.012.255.011.51c0 1.16-.358 2.733-1.533 3.803a.7.7 0 0 1-.298.156c-.382.106-.873-.011-1.018-.156a.91.91 0 0 1 0-1.316c.57-.57.995-1.551.995-2.487 0-.944-.26-1.667-.995-2.402`})]})),$x=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M9.57 3.617A1 1 0 0 0 8.646 3H4c-.552 0-1 .449-1 1v4.646a.996.996 0 0 0 1.001 1 1 1 0 0 0 .706-.293l4.647-4.647a1 1 0 0 0 .216-1.089m4.812 4.812a1 1 0 0 0-1.089.217l-4.647 4.647a.998.998 0 0 0 .708 1.706H14c.552 0 1-.449 1-1V9.353a1 1 0 0 0-.618-.924`})})),eS=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M7.883 1.93a.99.99 0 0 0-1.09.217L2.146 6.793A.998.998 0 0 0 2.853 8.5H7.5c.551 0 1-.449 1-1V2.854a1 1 0 0 0-.617-.924m7.263 7.57H10.5c-.551 0-1 .449-1 1v4.646a.996.996 0 0 0 1.001 1.001 1 1 0 0 0 .706-.293l4.646-4.646a.998.998 0 0 0-.707-1.707z`})})),tS=Wx(({className:e})=>_(Gx,{className:e,children:[L(`path`,{fill:`currentColor`,d:`M13 2a4 4 0 0 1 4 4v2.035A3.5 3.5 0 0 0 16.5 8H15V6.273C15 5.018 13.96 4 12.679 4H4.32C3.04 4 2 5.018 2 6.273v5.454C2 12.982 3.04 14 4.321 14H6v1.5q0 .255.035.5H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4z`}),L(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),L(`path`,{fill:`currentColor`,d:`M7.129 5.547a.6.6 0 0 0-.656.13L3.677 8.473A.6.6 0 0 0 4.102 9.5h2.796c.332 0 .602-.27.602-.602V6.103a.6.6 0 0 0-.371-.556`})]})),nS=Wx(({className:e})=>_(Gx,{className:e,children:[L(`path`,{fill:`currentColor`,d:`M13 2a4 4 0 0 1 4 4v2.036A3.5 3.5 0 0 0 16.5 8H15V6.273C15 5.018 13.96 4 12.679 4H4.32C3.04 4 2 5.018 2 6.273v5.454C2 12.982 3.04 14 4.321 14H6v1.5q0 .255.036.5H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4z`}),L(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),L(`path`,{fill:`currentColor`,d:`M4.871 10.454a.6.6 0 0 0 .656-.131l2.796-2.796A.6.6 0 0 0 7.898 6.5H5.102a.603.603 0 0 0-.602.602v2.795a.6.6 0 0 0 .371.556`})]})),rS=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M15 2a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3zM4 11a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2zM4 8a1 1 0 0 0 0 2h1a1 1 0 0 0 0-2zm4 0a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm6 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2`})})),iS=Wx(({className:e})=>_(Gx,{className:e,children:[L(`rect`,{width:16,height:12,x:1,y:3,stroke:`currentColor`,strokeWidth:2,rx:3}),L(`rect`,{width:3,height:2,x:3,y:8,fill:`currentColor`,rx:1}),L(`rect`,{width:2,height:2,x:13,y:8,fill:`currentColor`,rx:1}),L(`rect`,{width:4,height:2,x:11,y:11,fill:`currentColor`,rx:1}),L(`rect`,{width:5,height:2,x:7,y:8,fill:`currentColor`,rx:1}),L(`rect`,{width:7,height:2,x:3,y:11,fill:`currentColor`,rx:1})]})),aS=Wx(({className:e})=>L(Gx,{className:e,children:_(`g`,{fill:`currentColor`,children:[L(`rect`,{width:2,height:5,x:8,y:.5,opacity:.5,rx:1,children:L(`animate`,{attributeName:`opacity`,begin:`0s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:2,height:5,x:12.243,y:2.257,opacity:.45,rx:1,transform:`rotate(45 13.243 4.757)`,children:L(`animate`,{attributeName:`opacity`,begin:`0.125s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:5,height:2,x:12.5,y:8,opacity:.4,rx:1,children:L(`animate`,{attributeName:`opacity`,begin:`0.25s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:5,height:2,x:10.743,y:12.243,opacity:.35,rx:1,transform:`rotate(45 13.243 13.243)`,children:L(`animate`,{attributeName:`opacity`,begin:`0.375s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:2,height:5,x:8,y:12.5,opacity:.3,rx:1,children:L(`animate`,{attributeName:`opacity`,begin:`0.5s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:2,height:5,x:3.757,y:10.743,opacity:.25,rx:1,transform:`rotate(45 4.757 13.243)`,children:L(`animate`,{attributeName:`opacity`,begin:`0.625s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:5,height:2,x:.5,y:8,opacity:.15,rx:1,children:L(`animate`,{attributeName:`opacity`,begin:`0.75s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),L(`rect`,{width:5,height:2,x:2.257,y:3.757,opacity:.1,rx:1,transform:`rotate(45 4.757 4.757)`,children:L(`animate`,{attributeName:`opacity`,begin:`0.875s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})})]})})),oS=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M9 2a1 1 0 0 1 1 1v12a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1zm4 3a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1zM5 5a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1zm8 4a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1zM5 9a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1z`})})),sS=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M3 5a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1zm0 4a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1zm1 3a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H4z`})})),cS=Wx(({className:e})=>L(Gx,{className:e,children:L(`path`,{fill:`currentColor`,d:`M14.53 4.53a.75.75 0 0 0-1.06-1.06L7 9.94 4.53 7.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l7-7z`})}));v();var lS=10,$=e=>e,uS=$(Dh.Root),dS=$(bh),fS=$(Fh.Root),pS=$(yh.Popup),mS=$(yh.Title),hS=$(yh.Close),gS=$(Fh.Description),_S=$(Fg.Provider),vS=$(Fg.Root),yS=$(Fg.Trigger),bS=$(Fg.Popup),xS=$(ng.Root),SS=$(ng.Trigger),CS=$(ng.Popup),wS=$(Kh),TS=$(rg),ES=$(Wh),DS=$(Gh),OS=$(Ih),kS=$(qh),AS=$(bg.Value),jS=$(Cg.Root),MS=$(gg.Track),NS=$(gg.Fill),PS=$(gg.Buffer),FS=$(gg.Thumb),IS=$(gg.Value),LS=$(Rg.Root),RS=$(Hh),zS=$(Rh),BS=$(Wf),VS=({className:e,...t})=>L(`button`,{type:`button`,className:`media-button media-button--subtle media-button--icon${e?` ${e}`:``}`,...t}),HS=({selection:e,icon:t})=>{let[n,r]=M(!1),[i,a]=M(!1),[o,s]=M(!1);g(()=>s(!1),[e.selectedId]);let c=[...e.offLabel?[{id:null,label:e.offLabel}]:[],...e.options],l=t=>{if(t===e.selectedId){r(!1);return}s(!1),a(!0),Promise.resolve().then(()=>e.onSelect(t)).then(()=>r(!1)).catch(t=>{console.warn(`[player] ${e.label} selection failed:`,t),s(!0)}).finally(()=>a(!1))};return _(xS,{open:n,onOpenChange:e=>r(e),children:[L(SS,{render:L(VS,{className:`media-button--menu${o?` media-button--error`:``}`,"aria-label":e.label}),children:t}),L(CS,{className:`media-surface media-popover media-popover--menu`,children:_(`div`,{className:`stub-menu`,role:`menu`,"aria-label":e.label,children:[L(`div`,{className:`stub-menu__heading`,children:e.label}),c.map(t=>{let n=t.id===e.selectedId;return _(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,className:`stub-menu__item${n?` stub-menu__item--active`:``}`,disabled:i||`disabled`in t&&t.disabled,onClick:()=>l(t.id),children:[L(`span`,{className:`stub-menu__check`,children:n?L(cS,{className:`media-icon`}):null}),L(`span`,{className:`stub-menu__label`,children:t.label}),`description`in t&&t.description?L(`span`,{className:`stub-menu__description`,children:t.description}):null]},t.id??`__off__`)})]})})]})},US=()=>_(xS,{openOnHover:!0,delay:200,closeDelay:100,side:`top`,children:[L(SS,{render:_(ES,{className:`media-button--mute`,render:L(VS,{}),children:[L(Xx,{className:`media-icon media-icon--volume-off`}),L(Zx,{className:`media-icon media-icon--volume-low`}),L(Qx,{className:`media-icon media-icon--volume-high`})]})}),L(CS,{className:`media-surface media-popover media-popover--volume`,children:_(LS,{className:`media-slider`,orientation:`vertical`,thumbAlignment:`edge`,children:[L(MS,{className:`media-slider__track`,children:L(NS,{className:`media-slider__fill`})}),L(FS,{className:`media-slider__thumb media-slider__thumb--persistent`})]})})]}),WS=({capabilities:e,children:t,className:n,...r})=>_(BS,{className:`media-default-skin media-default-skin--video${n?` ${n}`:``}`,...r,children:[t,L(dS,{render:e=>L(`div`,{...e,className:`media-buffering-indicator`,children:L(`div`,{className:`media-surface`,children:L(aS,{className:`media-icon`})})})}),L(fS,{children:L(pS,{className:`media-error`,children:_(`div`,{className:`media-error__dialog media-surface`,children:[_(`div`,{className:`media-error__content`,children:[L(mS,{className:`media-error__title`,children:`Something went wrong.`}),L(gS,{className:`media-error__description`})]}),L(`div`,{className:`media-error__actions`,children:L(hS,{className:`media-button media-button--primary`,children:`OK`})})]})})}),L(uS,{className:`media-surface media-controls`,children:_(_S,{children:[_(`div`,{className:`media-button-group`,children:[_(vS,{side:`top`,children:[L(yS,{render:_(wS,{className:`media-button--play`,render:L(VS,{}),children:[L(Jx,{className:`media-icon media-icon--restart`}),L(Kx,{className:`media-icon media-icon--play`}),L(qx,{className:`media-icon media-icon--pause`})]})}),L(bS,{className:`media-surface media-tooltip`})]}),_(vS,{side:`top`,children:[L(yS,{render:L(TS,{seconds:-10,className:`media-button--seek`,render:L(VS,{}),children:_(`span`,{className:`media-icon__container`,children:[L(Yx,{className:`media-icon media-icon--seek media-icon--flipped`}),L(`span`,{className:`media-icon__label`,children:lS})]})})}),_(bS,{className:`media-surface media-tooltip`,children:[`Seek backward `,lS,` seconds`]})]}),_(vS,{side:`top`,children:[L(yS,{render:L(TS,{seconds:lS,className:`media-button--seek`,render:L(VS,{}),children:_(`span`,{className:`media-icon__container`,children:[L(Yx,{className:`media-icon media-icon--seek`}),L(`span`,{className:`media-icon__label`,children:lS})]})})}),_(bS,{className:`media-surface media-tooltip`,children:[`Seek forward `,lS,` seconds`]})]})]}),_(`div`,{className:`media-time-controls`,children:[L(AS,{type:`current`,className:`media-time`}),_(jS,{className:`media-slider`,children:[_(MS,{className:`media-slider__track`,children:[L(NS,{className:`media-slider__fill`}),L(PS,{className:`media-slider__buffer`})]}),L(FS,{className:`media-slider__thumb`}),L(`div`,{className:`media-surface media-thumbnail media-slider__preview`,children:L(IS,{type:`pointer`,className:`media-time media-thumbnail__time`})})]}),L(AS,{type:`duration`,className:`media-time`})]}),_(`div`,{className:`media-button-group`,children:[_(vS,{side:`top`,children:[L(yS,{render:L(kS,{className:`media-button--playback-rate`,render:L(VS,{})})}),L(bS,{className:`media-surface media-tooltip`,children:`Toggle playback rate`})]}),L(US,{}),e?.subtitles&&L(HS,{selection:e.subtitles,icon:e.subtitles.selectedId?L(rS,{className:`media-icon`}):L(iS,{className:`media-icon`})},`subtitles`),e?.audioTracks&&L(HS,{selection:e.audioTracks,icon:L(oS,{className:`media-icon`})},`audio`),e?.qualityLevels&&L(HS,{selection:e.qualityLevels,icon:L(sS,{className:`media-icon`})},`quality`),_(vS,{side:`top`,children:[L(yS,{render:_(DS,{className:`media-button--pip`,render:L(VS,{}),children:[L(tS,{className:`media-icon media-icon--pip-enter`}),L(nS,{className:`media-icon media-icon--pip-exit`})]})}),L(bS,{className:`media-surface media-tooltip`})]}),_(vS,{side:`top`,children:[L(yS,{render:_(OS,{className:`media-button--fullscreen`,render:L(VS,{}),children:[L($x,{className:`media-icon media-icon--fullscreen-enter`}),L(eS,{className:`media-icon media-icon--fullscreen-exit`})]})}),L(bS,{className:`media-surface media-tooltip`})]})]})]})}),L(`div`,{className:`media-overlay`}),L(RS,{keys:`Space`,action:`togglePaused`}),L(RS,{keys:`k`,action:`togglePaused`}),L(RS,{keys:`m`,action:`toggleMuted`}),L(RS,{keys:`f`,action:`toggleFullscreen`}),L(RS,{keys:`i`,action:`togglePictureInPicture`}),L(RS,{keys:`ArrowRight`,action:`seekStep`,value:5}),L(RS,{keys:`ArrowLeft`,action:`seekStep`,value:-5}),L(RS,{keys:`l`,action:`seekStep`,value:10}),L(RS,{keys:`j`,action:`seekStep`,value:-10}),L(RS,{keys:`ArrowUp`,action:`volumeStep`,value:.05}),L(RS,{keys:`ArrowDown`,action:`volumeStep`,value:-.05}),L(RS,{keys:`0-9`,action:`seekToPercent`}),L(RS,{keys:`Home`,action:`seekToPercent`,value:0}),L(RS,{keys:`End`,action:`seekToPercent`,value:100}),L(RS,{keys:`>`,action:`speedUp`}),L(RS,{keys:`<`,action:`speedDown`}),L(zS,{type:`tap`,action:`togglePaused`,pointer:`mouse`,region:`center`}),L(zS,{type:`tap`,action:`toggleControls`,pointer:`touch`}),L(zS,{type:`doubletap`,action:`seekStep`,value:-10,region:`left`}),L(zS,{type:`doubletap`,action:`toggleFullscreen`,region:`center`}),L(zS,{type:`doubletap`,action:`seekStep`,value:10,region:`right`})]});v();var{Provider:GS}=Kf({features:Xd}),KS=e=>`media`in e?e:{media:e},qS=({remote:e,frame:t,adapter:n})=>{let r=Dl();return g(()=>{if(!r||!e||!t)return;let i=n?n(e,t):e;if(!i)return;let a=KS(i),o=T(e);r(a.media);let s=pe(a.media);return()=>{s(),o(),r(null),a.dispose?.()}},[e,t,n,r]),null},JS=f`
|
|
1438
|
-
position: absolute;
|
|
1439
|
-
inset: 0;
|
|
1440
|
-
border-radius: 0.8rem;
|
|
1441
|
-
background: transparent !important;
|
|
1442
|
-
&.media-default-skin--video {
|
|
1443
|
-
background: transparent !important;
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
.media-popover--menu {
|
|
1447
|
-
padding: 0.4rem;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
/**
|
|
1451
|
-
* The track menu is stub's own markup, so it carries a stub prefix rather than a media one.
|
|
1452
|
-
*
|
|
1453
|
-
* It was named \`media-menu\` when the skin had no menu of its own. videojs beta.26 added one, and
|
|
1454
|
-
* upstream's nested \`.media-default-skin .media-menu .media-menu__item\` is specificity (0,3,0)
|
|
1455
|
-
* against this file's (0,2,0), so it silently took over padding, gap, cursor and justification the
|
|
1456
|
-
* moment the dependency moved. A prefix upstream will never mint is the only durable fix; matching
|
|
1457
|
-
* their specificity would just move the race to insertion order.
|
|
1458
|
-
*/
|
|
1459
|
-
.stub-menu {
|
|
1460
|
-
display: flex;
|
|
1461
|
-
flex-direction: column;
|
|
1462
|
-
min-width: 18rem;
|
|
1463
|
-
max-height: 32rem;
|
|
1464
|
-
overflow-y: auto;
|
|
1465
|
-
}
|
|
1466
|
-
.stub-menu__heading {
|
|
1467
|
-
padding: 0.6rem 1rem 0.4rem;
|
|
1468
|
-
font-size: 1.1rem;
|
|
1469
|
-
font-weight: 600;
|
|
1470
|
-
letter-spacing: 0.04em;
|
|
1471
|
-
text-transform: uppercase;
|
|
1472
|
-
opacity: 0.6;
|
|
1473
|
-
}
|
|
1474
|
-
.stub-menu__item {
|
|
1475
|
-
display: flex;
|
|
1476
|
-
align-items: center;
|
|
1477
|
-
gap: 0.6rem;
|
|
1478
|
-
width: 100%;
|
|
1479
|
-
padding: 0.6rem 1rem;
|
|
1480
|
-
border: none;
|
|
1481
|
-
border-radius: 0.4rem;
|
|
1482
|
-
background: transparent;
|
|
1483
|
-
color: inherit;
|
|
1484
|
-
font-size: 1.3rem;
|
|
1485
|
-
text-align: left;
|
|
1486
|
-
cursor: pointer;
|
|
1487
|
-
|
|
1488
|
-
&:hover:not(:disabled) {
|
|
1489
|
-
background: rgba(255, 255, 255, 0.12);
|
|
1490
|
-
}
|
|
1491
|
-
&:disabled {
|
|
1492
|
-
opacity: 0.5;
|
|
1493
|
-
cursor: default;
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
.stub-menu__check {
|
|
1497
|
-
display: inline-flex;
|
|
1498
|
-
width: 1.6rem;
|
|
1499
|
-
flex: none;
|
|
1500
|
-
}
|
|
1501
|
-
.stub-menu__label {
|
|
1502
|
-
flex: 1;
|
|
1503
|
-
}
|
|
1504
|
-
.stub-menu__description {
|
|
1505
|
-
opacity: 0.6;
|
|
1506
|
-
font-size: 1.1rem;
|
|
1507
|
-
}
|
|
1508
|
-
.media-button--error {
|
|
1509
|
-
color: #f66;
|
|
1510
|
-
}
|
|
1511
|
-
`,YS=({remote:e,frame:t,adapter:n,capabilities:r,children:i})=>_(GS,{children:[L(qS,{remote:e,frame:t,adapter:n}),L(WS,{capabilities:r,css:JS,children:i})]}),XS=`[data-uia="timeline"]`,ZS=`[data-uia="video-canvas"]`,QS=`[data-uia="player"]`,$S=`Seeks the video to the point you pick on the timeline.`,eC=`Reveals the player controls so the timeline can be used.`,tC=140,nC=2,rC=12e3,iC=26,aC=110,oC={"still-watching":`[data-uia="interrupt-autoplay-continue"], [data-uia="interrupter-title"]`,"next-episode":`[data-uia="next-episode-seamless-button"], [data-uia="next-episode-seamless-button-draining"]`,error:`[data-uia="error-container"], [data-uia="nfp-error"]`},sC=e=>new Promise(t=>setTimeout(t,e)),cC=e=>e<0?0:e>1?1:e,lC=0,uC=()=>{let e=lC*1.1;return lC++,{x:.5+Math.cos(e)*.05,y:.5+Math.sin(e)*.05}},dC=(e,t)=>{let n=null,r,i,a=!1,o=async()=>{if(!a){a=!0;try{await Promise.all([t.locator(ZS).ensure(`hover`,{reason:eC}),t.locator(QS).ensure(`hover`,{reason:eC}),t.locator(XS).ensure(`click`,{reason:$S})])}catch(e){a=!1,console.warn(`[nf] permission request failed:`,e)}}},s=()=>{if(n==null)return;let t=e.currentTime;Number.isFinite(t)&&Math.abs(t-n)<nC&&(n=null,i&&clearTimeout(i))};e.addEventListener(`timeupdate`,s);let c=async n=>{let r=e.duration;if(!Number.isFinite(r)||r<=0){console.warn(`[nf] seek: duration unknown`,r);return}let i=cC(n/r);o();let a=t.locator(XS),s=e.paused===!0;if(s)try{await e.play()}catch{}let c=!1;for(let e=0;e<iC;e++){if(e%2==0&&(await t.locator(ZS).hover({relativePosition:uC(),reason:eC}).catch(()=>{}),await t.locator(QS).hover({relativePosition:uC(),reason:eC}).catch(()=>{})),await a.exists().catch(()=>!1)){c=!0;break}await sC(aC)}if(!c){let n=await Promise.all(Object.entries(oC).map(async([e,n])=>await t.locator(n).exists().catch(()=>!1)?e:``)).then(e=>e.filter(Boolean).join(`, `)).catch(()=>``);if(console.warn(`[nf] seek aborted: controls never revealed${n?` (blocked by ${n})`:``}`),s)try{await e.pause()}catch{}return}if(await a.click({relativePosition:{x:i,y:.5},reason:$S}).catch(e=>console.warn(`[nf] timeline click failed:`,e?.message??e)),s)try{await e.pause()}catch{}};return{media:new Proxy(e,{get(e,t,r){return t===`currentTime`&&n!=null?n:Reflect.get(e,t,r)},set(e,t,a,o){return t===`currentTime`&&typeof a==`number`&&Number.isFinite(a)?(n=a,r&&clearTimeout(r),r=setTimeout(()=>{c(a).catch(e=>console.warn(`[nf] timeline seek failed:`,e))},tC),i&&clearTimeout(i),i=setTimeout(()=>{n=null},rC),!0):Reflect.set(e,t,a,o)}}),dispose:()=>{e.removeEventListener(`timeupdate`,s),r&&clearTimeout(r),i&&clearTimeout(i)}}},fC=({remote:e,frame:t,capabilities:n,children:r})=>L(YS,{remote:e,frame:t,adapter:dC,capabilities:n,children:r});v();var pC=[`netflix.com`,`www.netflix.com`,`nflxvideo.net`,`nflxso.net`,`nflxext.com`,`nflximg.net`,`assets.nflxext.com`],mC=`https://www.netflix.com/login`,hC=`
|
|
1512
|
-
html, body {
|
|
1513
|
-
margin: 0 !important;
|
|
1514
|
-
padding: 0 !important;
|
|
1515
|
-
width: 100% !important;
|
|
1516
|
-
height: 100% !important;
|
|
1517
|
-
overflow: hidden !important;
|
|
1518
|
-
background: #000 !important;
|
|
1519
|
-
}
|
|
1520
|
-
/* Truly-unwanted chrome - collapse it entirely. */
|
|
1521
|
-
.watch-video--evidence-overlay-container,
|
|
1522
|
-
.watch-video--skip-content,
|
|
1523
|
-
.watch-video--nextEpisode-seamless-button,
|
|
1524
|
-
.watch-video--back-container,
|
|
1525
|
-
[data-uia="player-back-to-browse"],
|
|
1526
|
-
[data-uia="control-nav-back"],
|
|
1527
|
-
[data-uia="control-flag"] {
|
|
1528
|
-
display: none !important;
|
|
1529
|
-
pointer-events: none !important;
|
|
1530
|
-
}
|
|
1531
|
-
/* Keep the controls bar in LAYOUT (so the seek adapter can locate + click the
|
|
1532
|
-
[data-uia="timeline"] scrubber) but invisible and inert to real taps. NEVER
|
|
1533
|
-
display:none here, or the scrubber loses its box and the seek no-ops - mirrors
|
|
1534
|
-
Crunchyroll's opacity:0 timeline trick. The skin draws the visible controls. */
|
|
1535
|
-
[data-uia="controls-standard"],
|
|
1536
|
-
.watch-video--bottom-controls-container,
|
|
1537
|
-
.PlayerControlsNeo__layout,
|
|
1538
|
-
.PlayerControlsNeo__core-controls,
|
|
1539
|
-
.PlayerControlsNeo__button-control-row {
|
|
1540
|
-
opacity: 0 !important;
|
|
1541
|
-
pointer-events: none !important;
|
|
1542
|
-
}
|
|
1543
|
-
[data-uia="timeline"],
|
|
1544
|
-
[data-uia="timeline"] * {
|
|
1545
|
-
pointer-events: auto !important;
|
|
1546
|
-
}
|
|
1547
|
-
.watch-video,
|
|
1548
|
-
[data-uia="video-canvas"] {
|
|
1549
|
-
position: fixed !important;
|
|
1550
|
-
inset: 0 !important;
|
|
1551
|
-
width: 100% !important;
|
|
1552
|
-
height: 100% !important;
|
|
1553
|
-
z-index: 9999999 !important;
|
|
1554
|
-
}
|
|
1555
|
-
.watch-video video,
|
|
1556
|
-
[data-uia="video-canvas"] video {
|
|
1557
|
-
width: 100% !important;
|
|
1558
|
-
height: 100% !important;
|
|
1559
|
-
object-fit: contain !important;
|
|
1560
|
-
}
|
|
1561
|
-
`,gC=async(e,t=10,n=500)=>{for(let r=0;r<t;r++)try{return await e()}catch(e){if(r===t-1||!(e instanceof Error)||!e.message.includes(`not registered`))throw e;await new Promise(e=>setTimeout(e,n))}throw Error(`unreachable`)},_C=async e=>{for(let t=0;t<50;t++){if(await e.locator(`[data-uia="header"] a[href*="/login"]`).exists())return!1;if(await e.locator(`.watch-video, [data-uia="video-canvas"]`).exists())return!0;await new Promise(e=>setTimeout(e,200))}return!1},vC=async(e,t)=>{for(;!t();){try{if(await e.locator(`video`).exists())return await e.locator(`video`).videoElement()}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,200))}return null},yC=f`
|
|
1562
|
-
position: relative;
|
|
1563
|
-
width: 100%;
|
|
1564
|
-
height: 100%;
|
|
1565
|
-
background: #000;
|
|
1566
|
-
user-select: none;
|
|
1567
|
-
-webkit-user-select: none;
|
|
1568
|
-
|
|
1569
|
-
.nf-frame {
|
|
1570
|
-
position: absolute;
|
|
1571
|
-
inset: 0;
|
|
1572
|
-
width: 100%;
|
|
1573
|
-
height: 100%;
|
|
1574
|
-
border: none;
|
|
1575
|
-
background: #000;
|
|
1576
|
-
/* Netflix's own chrome is hidden, so the iframe must not swallow taps -
|
|
1577
|
-
they belong to the skin's gesture layer stacked above it. */
|
|
1578
|
-
pointer-events: none;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
.overlay {
|
|
1582
|
-
position: absolute;
|
|
1583
|
-
inset: 0;
|
|
1584
|
-
display: flex;
|
|
1585
|
-
flex-direction: column;
|
|
1586
|
-
align-items: center;
|
|
1587
|
-
justify-content: center;
|
|
1588
|
-
gap: 1.6rem;
|
|
1589
|
-
background: #000;
|
|
1590
|
-
font-size: 1.4rem;
|
|
1591
|
-
color: rgba(255, 255, 255, 0.8);
|
|
1592
|
-
z-index: 30;
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
.login-button {
|
|
1596
|
-
padding: 0.8rem 2rem;
|
|
1597
|
-
background: #e50914;
|
|
1598
|
-
color: #fff;
|
|
1599
|
-
border: none;
|
|
1600
|
-
border-radius: 0.4rem;
|
|
1601
|
-
font-size: 1.4rem;
|
|
1602
|
-
font-weight: 600;
|
|
1603
|
-
cursor: pointer;
|
|
1604
|
-
|
|
1605
|
-
&:hover {
|
|
1606
|
-
background: #c11119;
|
|
1607
|
-
}
|
|
1608
|
-
}
|
|
1609
|
-
`,bC={cr:Ux,nf:({url:e})=>{let[t,n]=M(null),[r,i]=M(null),[a,o]=M(!0),[s,c]=M(!1),[l,u]=M(),[d,f]=M(null),[p,m]=M(0);g(()=>{if(!t)return;let e=!1;return(async()=>{for(let n=0;!e;n++)try{let n=await le({iframe:t,domains:pC,cookies:`native`});if(e)return;i(n);return}catch(t){if(e)return;if(!ae()){u(`Netflix playback currently needs the FKN browser extension.`),o(!1);return}if(n>=4){console.error(`Failed to attach Netflix frame`,t),u(t instanceof Error?t.message:`Failed to load player`),o(!1);return}await new Promise(e=>setTimeout(e,300*(n+1)))}})(),()=>{e=!0}},[t]),g(()=>{if(!r)return;let t=!1,n=()=>t;return o(!0),u(void 0),c(!1),f(null),(async()=>{if(await r.goto(e,{waitUntil:`load`}),await gC(()=>r.addStyleTag({content:hC})),t)return;o(!1);let i=await _C(r);if(t)return;if(!i){c(!0);return}let a=await vC(r,n);!t&&a&&f(a)})().catch(e=>{t||(console.error(`Failed to load Netflix player`,e),u(e?.message??`Failed to load player`),o(!1))}),()=>{t=!0}},[r,e,p]);let h=k(()=>{let e=globalThis.open(mC,`_blank`,`width=500,height=700`);if(!e)return;let t=setInterval(()=>{e.closed&&(clearInterval(t),m(e=>e+1))},500)},[]);return _(`div`,{css:yC,children:[L(fC,{remote:d,frame:r,children:L(`iframe`,{ref:n,className:`nf-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`})}),(s||l||a)&&_(`div`,{className:`overlay`,children:[s&&_(F,{children:[`You need to be logged in to Netflix to watch this content.`,L(`button`,{className:`login-button`,onClick:h,children:`Open Netflix Login Page`})]}),l&&!s&&l,a&&!l&&!s&&`Loading Netflix player...`]})]})}},xC=e=>bC[e];v();var SC=new URLSearchParams(globalThis.location.search),CC=SC.get(`mediaUri`),wC=SC.get(`episodeUri`),TC=SC.get(`sourceUri`),EC=SC.get(`url`),DC=TC?A(TC).origin:void 0,OC=DC?xC(DC):void 0;b(L(()=>{let[e,t]=M();return g(()=>ne(t),[]),!CC||!wC||!TC||!EC||!OC?L(`div`,{children:`Unsupported or missing parameters`}):L(OC,{url:EC,mediaUri:CC,episodeUri:wC,sourceUri:TC,title:e})},{}),document.getElementById(`app`));
|