@banou/stub 0.0.56 → 0.0.57
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/README.md +2 -2
- package/build/assets/anime-index-BEkCRogm.js +1 -0
- package/build/assets/anime-seasons-B76P0Y3X.js +1 -0
- package/build/assets/country-Cg7CfAmX.js +72 -0
- package/build/assets/dist-k1lV5fLd.js +1328 -0
- package/build/assets/embed-CvUavYUV.js +392 -0
- package/build/assets/embed-title-B8J34NSF.js +1 -0
- package/build/assets/index-QkhLG9eC.js +2654 -0
- package/build/assets/{lib-emotion-react-jsx-runtime.browser.esm-C5mAgoyK.js → lib-player-volume-Cj__TqOH.js} +577 -553
- package/build/assets/{lib-theme-player-w0MKAikK.js → lib-theme-player-4uF0yCCA.js} +2488 -2271
- package/build/assets/{lib-worker-DxgAerh1.js → lib-worker-CWhdV26-.js} +1 -1
- package/build/assets/{lib-worker-uEoF-jLP.js → lib-worker-CxxbWsMo.js} +2762 -2201
- package/build/assets/lib-worker-anime-index-BEkCRogm.js +1 -0
- package/build/assets/lib-worker-anime-seasons-B76P0Y3X.js +1 -0
- package/build/assets/lib-worker-index-DkGAwfbK.js +2654 -0
- package/build/assets/main-Dn8WJvvc.js +5750 -0
- package/build/assets/{preload-helper-Bx4ePS05.js → player-volume-ChubmlGg.js} +1 -1
- package/build/assets/theme-player-CyPxG_F7.js +1 -0
- package/build/assets/worker-8lj-R-8y.js +1 -0
- package/build/assets/{worker-Buc1-1GE.js → worker-D1Q7LumD.js} +1 -1
- package/build/embed.html +5 -5
- package/build/index.html +5 -5
- package/build/index.js +10199 -8496
- package/fkn.json +1 -1
- package/package.json +3 -4
- package/store/home.webp +0 -0
- package/store/movie.webp +0 -0
- package/store/phone.webp +0 -0
- package/store/search.webp +0 -0
- package/store/series.webp +0 -0
- package/store/title.webp +0 -0
- package/build/assets/anime-index-Dl2tJrXZ.js +0 -1
- package/build/assets/anime-seasons-Egf79hrL.js +0 -1
- package/build/assets/dist-D2Wlyi7R.js +0 -1328
- package/build/assets/embed-C1Cncaqj.js +0 -392
- package/build/assets/embed-title-DY0iSLZj.js +0 -1
- package/build/assets/index-GI3b_BTS.js +0 -2600
- package/build/assets/lib-worker-anime-index-Dl2tJrXZ.js +0 -1
- package/build/assets/lib-worker-anime-seasons-Egf79hrL.js +0 -1
- package/build/assets/lib-worker-index-uCN9UHKr.js +0 -2600
- package/build/assets/main-BvwWBTz2.js +0 -5228
- package/build/assets/site-status-BWHbNndL.js +0 -72
- package/build/assets/theme-player-B-ZX9FYo.js +0 -1
- package/build/assets/worker-DmLPM08h.js +0 -1
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t,b as n,c as r,d as i,f as a,h as o,i as s,l as c,m as l,p as u,t as d,w as f}from"./embed-title-DY0iSLZj.js";import{$ as p,B as m,J as h,L as g,Q as _,R as v,W as y,Y as b,Z as x,at as S,ct as C,dt as w,ft as T,i as E,it as D,lt as O,n as k,nt as A,ot as j,q as ee,r as M,rt as N,st as te,tt as P,ut as ne,w as F}from"./preload-helper-Bx4ePS05.js";import{C as re,S as ie,a as ae,c as oe,d as se,l as ce,o as le,s as ue,w as de}from"./site-status-BWHbNndL.js";import{A as I,B as fe,C as pe,D as L,E as me,F as R,G as z,H as he,I as ge,J as _e,K as ve,L as ye,M as be,N as xe,O as Se,P as Ce,Q as B,R as we,S as Te,T as Ee,U as V,V as H,W as De,X as Oe,Y as ke,Z as Ae,_ as je,a as Me,b as Ne,c as Pe,d as Fe,f as Ie,g as Le,h as Re,i as U,j as ze,k as Be,l as Ve,m as He,n as Ue,o as We,p as Ge,q as Ke,r as qe,s as Je,t as Ye,u as Xe,v as Ze,w as Qe,x as $e,y as et,z as tt}from"./dist-D2Wlyi7R.js";import{n as nt}from"./remote-DQ5KVR01.js";function W(e,t){let n={...t};for(let t in e)B(e[t])||(n[t]=e[t]);return n}function rt(e,t){let n={};for(let r of t)Object.hasOwn(e,r)&&(n[r]=e[r]);return n}function it(e){return typeof e==`string`?e:e.text}function at(e){return Oe(e)&&`key`in e&&`text`in e}function G(e,t,n){return typeof e==`string`?e:typeof t==`function`?t(e,n):ve(it(e),t??n)}function ot(e){let t=e.closest(`[dir]`)?.getAttribute(`dir`);return t?t.toLowerCase()===`rtl`:getComputedStyle(e).direction===`rtl`}function st(){return typeof CSS<`u`&&CSS.supports(`anchor-name: --a`)}function ct(){return typeof navigator<`u`&&/mac/i.test(navigator.userAgent)}var lt={sideOffset:0,boundaryOffset:0},ut={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function dt(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 ft(e,t,n,r,i=lt){let a=r.side,o=ut[a],s=a===`top`||a===`bottom`?t.height:t.width,c=dt(e,n,a,i);return c>=s?a:dt(e,n,o,i)>c?o:a}function pt(e){try{e?.showPopover?.()}catch{}}function mt(e){try{e?.hidePopover?.()}catch{}}function ht(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 gt(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 _t(e,t,n){return we(t=>e.subscribe(t),()=>e.current,t??ye,n)}var vt={target:Se,signals:new Be,get:Se,set:Se};function K(e){let t=e.state(vt),n=Object.keys(t),r=n[0];return Object.assign(r?e=>{if(r in e)return rt(e,n)}:()=>void 0,{displayName:e.name})}var yt=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]??``}},bt={ON_DEMAND:`on-demand`,LIVE:`live`,UNKNOWN:`unknown`},xt=me({name:`live`,state:()=>({liveEdgeStart:NaN,targetLiveWindow:NaN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!pe(r))return;let i=()=>n({liveEdgeStart:r.liveEdgeStart,targetLiveWindow:r.targetLiveWindow});i(),H(r,`targetlivewindowchange`,i,{signal:t}),H(r,`streamtypechange`,i,{signal:t}),H(r,`loadedmetadata`,i,{signal:t}),H(r,`canplay`,i,{signal:t}),H(r,`progress`,i,{signal:t}),H(r,`durationchange`,i,{signal:t}),H(r,`timeupdate`,i,{signal:t}),H(r,`emptied`,i,{signal:t})}}),St=me({name:`streamType`,state:()=>({streamType:bt.UNKNOWN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(Ee(r)){let e=()=>n({streamType:r.streamType});e(),H(r,`streamtypechange`,e,{signal:t});return}if(!Qe(r))return;let i=()=>{let{duration:e}=r;return e===1/0?bt.LIVE:Number.isFinite(e)&&e>0?bt.ON_DEMAND:bt.UNKNOWN},a=()=>n({streamType:i()});a(),H(r,`durationchange`,a,{signal:t}),H(r,`loadedmetadata`,a,{signal:t}),H(r,`emptied`,a,{signal:t}),Te(r)&&H(r,`progress`,a,{signal:t})}});K($e);var Ct=K(Ne),wt=K(Ze),Tt=K(je),Et=K(Le);K(xt);var Dt=K(Re),Ot=K(He),kt=K(Ge);K(Ie),K(Fe),K(Xe),K(St);var At=K(Ve),jt=K(Pe),Mt=K(Je),Nt={seekStep({store:e,value:t}){if(B(t))return;let n=jt(e.state);n&&n.seek(n.currentTime+t)},volumeStep({store:e,value:t}){if(B(t))return;let n=Mt(e.state);n&&n.setVolume(n.volume+t)},speedUp({store:e}){let t=kt(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=kt(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])}},Pt={seekStep:Nt.seekStep,volumeStep:Nt.volumeStep,speedUp:Nt.speedUp,speedDown:Nt.speedDown};function Ft(e){return Pt[e]||(({store:t})=>{let n=t.state[e];Ke(n)&&n()})}var It=200,Lt=class{#e=0;#t=null;handleUp(e,t){if(e.resolve(`doubletap`).length>0){let n=Date.now();if(n-this.#e<It){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)},It);return}e.resolve(`tap`)[0]?.onActivate(t)}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}reset(){this.#n(),this.#e=0}},Rt=new WeakMap;function zt(e){let t=Rt.get(e);return t||(t=new Lt,Rt.set(e,t),t)}function Bt(e,t,n){return et(e).add({type:`tap`,recognizer:zt(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Vt(e,t,n){return et(e).add({type:`doubletap`,recognizer:zt(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Ht(e){return e.startsWith(`toggle`)}var Ut={togglePaused({store:e}){let t=Ot(e.state);t&&(t.paused?t.play():t.pause())},toggleMuted({store:e}){Mt(e.state)?.toggleMuted()},toggleFullscreen({store:e}){let t=Et(e.state);t&&(t.fullscreen?t.exitFullscreen():t.requestFullscreen())},toggleSubtitles({store:e}){At(e.state)?.toggleSubtitles()},togglePictureInPicture({store:e}){let t=Dt(e.state);t&&(t.pip?t.exitPictureInPicture():t.requestPictureInPicture())},seekStep:Nt.seekStep,volumeStep:Nt.volumeStep,speedUp:Nt.speedUp,speedDown:Nt.speedDown,seekToPercent({store:e,value:t,key:n}){let r=jt(e.state);if(!r||r.duration<=0)return;let i;if(!B(t))i=t;else if(n>=`0`&&n<=`9`)i=Number(n)*10;else return;r.seek(i/100*r.duration)}};function Wt(e){return Ut[e]}var Gt={shift:`Shift`,ctrl:`Control`,alt:`Alt`,meta:`Meta`},Kt={shift:`Shift`,ctrl:`Ctrl`,alt:`Alt`,meta:`Meta`},qt=[`ctrl`,`shift`,`alt`,`meta`];function Jt(e){return e.map(e=>{let t=[];for(let n of qt)e.modifiers.has(n)&&t.push(Gt[n]);return t.push(e.originalKey),t.join(`+`)}).join(` `)}function Yt(e){let t=[];for(let n of qt)e.modifiers.has(n)&&t.push(Kt[n]);return t.push(Xt(e.originalKey)),t.join(`+`)}function Xt(e){return e.length===1?e.toUpperCase():e}var Zt=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:$t(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:Jt(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,H(this.#e,`keydown`,this.#f,{signal:this.#r.signal}))}#u(){this.#i||(this.#i=new AbortController,H(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`||V(e)||e.defaultPrevented)return;let t=he(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(tn(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:B(t)?!0:n.options.value===t).sort((e,t)=>e.id-t.id)}#m(e){return e.options.keys===`0-9`?e.options.keys:Yt(e.parsed[0])}#h(){for(let e of this.#o)e()}},Qt=new Set([`shift`,`ctrl`,`alt`,`meta`]);function $t(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(ct()?`meta`:`ctrl`):Qt.has(t)&&r.add(t)}return[{modifiers:r,key:n===`Space`?` `:n.toLowerCase(),originalKey:n}]}function en(e){return e.length===1&&!/[a-z]/i.test(e)}function tn(e,t){if(t.key===`Unidentified`||t.key.toLowerCase()!==e.key)return!1;let n=en(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 nn=new WeakMap;function rn(e){let t=nn.get(e);return t||(t=new Zt(e),nn.set(e,t)),t}function an(e,t){return rn(e).add(t)}function on(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;H(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 sn(e){let{onOpenChange:t}=e,n=null,r=null,i=null,a=on({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;H(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 cn(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 ln={transitionStarting:`data-starting-style`,transitionEnding:`data-ending-style`};function un(e){return{transitionStarting:e===`starting`,transitionEnding:e===`ending`}}function dn(e){let{onOpenChange:t,closeOnOutsideClick:n}=e,r=null,i=null,a=null,o=new Set,s=!1,c=null,l=on({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.preventDefault(),x(`escape`,e)},onDocumentActive(e){H(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||(mt(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&&mt(i),i=e,e&&u.current.active&&pt(e)}return{input:u,triggerProps:T,popupProps:E,get triggerElement(){return r},setTriggerElement:D,setPopupElement:O,open:S,close:C,destroy:l.destroy}}function fn(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 pn(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 fn(n,r,Math.max(0,i-n),Math.max(0,a-r))}function mn(e){let t=document.documentElement.getBoundingClientRect();return e?pn(t,e.getBoundingClientRect()):t}function hn(e,t={}){if(!e)return null;if(!Ae(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 gn={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 _n(e,t,n){return Math.max(t,Math.min(n,e))}function vn(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 yn={sideOffset:0,alignOffset:0,boundaryOffset:0},bn={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function xn(e){return`${_n(e,0,1/0)}px`}function Sn(e,t,n,r){let i=n-r;return i<t?t:_n(e,t,i)}function Cn(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 wn(e,t,n,r,i,a,o=gn){if(st())return{...Tn(e,t,o,n,i,a),...n&&i?En(n,i,t,a,o):{}};if(n&&r){let e=a??yn;return{position:`fixed`,margin:`0`,...Dn(n,r,t,e,i),...i?En(n,i,t,e,o):{}}}return{}}function Tn(e,t,n=gn,r,i,a=yn){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=bn[c];if(c===`top`||c===`bottom`){if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=Cn(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}=Cn(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 En(e,t,n,r=yn,i=gn){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]=xn(t-r.sideOffset),a[i.availableWidth]=xn(l-c)}else{let t=o===`left`?e.left-c:l-e.right;a[i.availableWidth]=xn(t-r.sideOffset),a[i.availableHeight]=xn(d-u)}return a}function Dn(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=Sn(d,i.left+e,i.right-e,t.width):l=Sn(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 On(e,t=gn){let n=getComputedStyle(e);return{sideOffset:ht(e,n.getPropertyValue(t.sideOffset)),alignOffset:ht(e,n.getPropertyValue(t.alignOffset)),boundaryOffset:ht(e,n.getPropertyValue(t.boundaryOffset))}}function kn(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width,i=e.offsetHeight||n.height;return fn(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 An(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)?_n(i*100,0,100):0}function jn(e){let t=L({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?gt(t=>e.onValueChange?.(t),r,{leading:!0}):null;function d(t,n){n&&u?u(t):e.onValueChange?.(t)}function f(){if(_e(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=An(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(!_e(s)){if(n.pointerType!==`touch`&&n.buttons===0){p();return}let r=An(n,o,e.getOrientation(),a);c=r,t.patch({dragPercent:r,pointerPercent:r}),d(r,!0);return}let r=An(n,e.getElement().getBoundingClientRect(),e.getOrientation(),e.isRTL());t.patch({pointing:!0,pointerPercent:r})},onPointerUp(t){if(e.isDisabled()||(t.stopPropagation(),_e(s)))return;let n=An(t,o,e.getOrientation(),a);u?.cancel(),e.onValueChange?.(n),e.onValueCommit?.(n),l=!0},onPointerLeave(){_e(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=vn(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=_n(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 Mn={fill:`--media-slider-fill`,pointer:`--media-slider-pointer`,buffer:`--media-slider-buffer`};function Nn(e){return{[Mn.fill]:`${e.fillPercent.toFixed(3)}%`,[Mn.pointer]:`${e.pointerPercent.toFixed(3)}%`}}function Pn(e){return{...Nn(e),[Mn.buffer]:`${e.bufferPercent.toFixed(3)}%`}}function Fn(e,t){let n=e/2;return{position:`absolute`,left:t===`visible`?`calc(var(${Mn.pointer}) - ${n}px)`:`min(max(0px, calc(var(${Mn.pointer}) - ${n}px)), calc(100% - ${e}px))`,width:`max-content`,pointerEvents:`none`}}var In=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 Ln(e){let{getContainer:t,getImg:n,onStateChange:r}=e,i=new In,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){H(e,`load`,m,{signal:o}),H(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 Rn={hover:`hover`,focus:`focus`,escape:`escape`,blur:`blur`,"imperative-action":`imperative-action`};function zn(e){let t={transition:e.transition,onOpenChange(t,n){let r=Rn[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=dn(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 Bn(){let e=L({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&&(Hn(i),Vn(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();Un(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 Vn(e){e&&e.offsetHeight}function Hn(e){let t=e?.getAnimations?.({subtree:!0})??[];for(let e of t)e.cancel()}function Un(e){if(!e)return Promise.resolve();let t=e.getAnimations?.()??[];return t.length===0?Promise.resolve():Promise.all(t.map(e=>e.finished)).then(ge,ge)}function Wn(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=_n(e.getPercent()-n*r,0,100);e.onValueChange?.(i)}}}function Gn(e,t){if(!t)return!1;if(Ke(e.composedPath))return e.composedPath().includes(t);let n=e.target;return n instanceof Node&&t.contains(n)}function Kn(e,t){let n={};for(let r in e){if(t&&!(r in t))continue;let i=t?.[r]??qn(r),a=e[r];a===!0?n[i]=``:a&&(n[i]=String(a))}return n}function qn(e){return`data-${e.toLowerCase()}`}function Jn(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90}function Yn(e,t){return Jn(e)&&(typeof t==`function`||t===void 0)}function Xn(e,t){return t?e?n=>{t(n),e(n)}:t:e}function Zn(e,t){return t&&e?`${t} ${e}`:t||e}function Qn(e,t){return t?e?{...e,...t}:t:e}function $n(e,t){if(!t)return e;for(let n in t){let r=t[n];n===`className`?e.className=Zn(e.className,r):n===`style`?e.style=Qn(e.style,r):e[n]=Yn(n,r)?Xn(e[n],r):r}return e}function er(...e){let t={};for(let n of e)t=$n(t,n);return t}h();function tr(e,t){return Ke(e)?e(t):e}function nr(e,t){return Ke(e)?e(t):e}function rr(e){let t=e;return t.ref??t.props?.ref}function q(e,t,n){let{className:r,style:i,render:a}=t,{state:o,ref:s,props:c,stateAttrMap:l}=n,u=tr(r,o),d=nr(i,o),f=er(l?Kn(o,l):{},...Array.isArray(c)?c:c?[c]:[]);if(u!==void 0&&(f.className=f.className?`${f.className} ${u}`:u),d!==void 0&&(f.style=f.style?{...f.style,...d}:d),Ke(a)){let e=tt(s,f.ref);return a({...f,ref:e},o)}if(b(a)){let e=rr(a),t=tt(s,f.ref,e),n=er(f,a.props);return n.ref=t,ee(a,n)}return f.ref=tt(s,f.ref),ne(e,f)}h();function ir(e){let{displayName:t,onActivate:n,isDisabled:r}=e,i=A(e=>{},[t]);return{getButtonProps:A(e=>er(cn({onActivate:n,isDisabled:r}),e),[n,r]),buttonRef:i}}h();function ar(e,t){let n=I(),[r,i]=N({});return P(()=>{if(!n||!e){i({});return}let r=rn(n),a=()=>i(r.getShortcut(e,t));return a(),r.subscribeShortcutChanges(a)},[n,e,t]),r}h(),O(null).Provider,O(null).Provider,O(null).Provider,O(null).Provider;var or=O(!1);or.Provider;function sr(){return S(or)}O(null).Provider,h();var cr=O(null),lr=cr.Provider;function ur(){let e=S(cr);if(!e)throw Error(`Tooltip compound components must be used within a Tooltip.Root`);return e}function dr(){return S(cr)}h();function fr(e,t){return e.getLabelParams?.(t)}function pr(e){let{displayName:t,core:n,stateAttrMap:r,selector:i,action:a,hotkeyAction:o,hotkeyValue:s,tooltipLabel:c,isSupported:l}=e,u=new Set(Object.keys(n.defaultProps)),d=y(function(e,d){let{render:f,className:p,style:m,...h}=e,g={},_={};for(let e of Object.keys(h))u.has(e)?g[e]=h[e]:_[e]=h[e];let v=dr(),y=sr(),b=v?.setContent,S=R(i),C=ar(o,s?.(g)),w=z(),[T]=N(()=>new n);u.has(`menuTrigger`)&&B(g.menuTrigger)&&(g.menuTrigger=y),T.setProps(g);let{getButtonProps:E,buttonRef:D}=ir({displayName:t,onActivate:()=>{Promise.resolve(a(T,S)).catch(e=>{})},isDisabled:()=>!!g.disabled||!S});S&&T.setMedia(S);let O=S?T.getState():null,k=O?l?.(O)??!0:!1,A=O&&k?G(T.getLabel(O),w,fr(T,O)):void 0,j=O&&k?c?.(T,O)??A:void 0;if(x(()=>{if(b)return b(j?{label:j,shortcut:C.shortcut}:void 0),()=>b(void 0)},[b,j,C.shortcut]),!S||!O||!k)return null;let ee=T.getAttrs(O),M=ee[`aria-label`],te={...ee,...at(M)?{"aria-label":G(M,w,fr(T,O))}:void 0,"aria-keyshortcuts":C.aria};return q(`button`,{render:f,className:p,style:m},{state:O,stateAttrMap:r,ref:[d,D],props:[E(),te,_]})});return d.displayName=t,d}function J(e,t){return Ke(e)?e(t)||void 0:e||void 0}var mr=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,...un(e.status)}}getAttrs(e){return{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":e.titleId,"aria-describedby":e.descriptionId}}},hr={open:`data-open`,...ln},gr=class e{static defaultProps={delay:500};state=L({visible:!1});#e={...e.defaultProps};#t=null;setProps(t){this.#e=W(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)}},_r={visible:`data-visible`},vr=class{#e=null;setMedia(e){this.#e=e}getState(){let e=this.#e;return{visible:e.controlsVisible,userActive:e.userActive}}},yr={visible:`data-visible`,userActive:`data-user-active`},br=class extends mr{setProps(){}},xr=`common.`,Sr={key:`${xr}empty`,text:``},Cr={key:`${xr}ok`,text:`OK`},wr=`errors.`,Tr={key:`${wr}aborted`,text:`You stopped media playback before it finished.`},Er={key:`${wr}network`,text:`This media could not be loaded due to a network or server issue.`},Dr={key:`${wr}decode`,text:`This media could not be played. It may be corrupted, or your browser may not support its format.`},Or={key:`${wr}source`,text:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`},kr={key:`${wr}encrypted`,text:`This media could not be played because it could not be decrypted.`},Ar={key:`${wr}title`,text:`Something went wrong.`},jr={key:`${wr}unexpected`,text:`An unexpected error occurred.`},Mr={[yt.MEDIA_ERR_ABORTED]:Tr,[yt.MEDIA_ERR_NETWORK]:Er,[yt.MEDIA_ERR_DECODE]:Dr,[yt.MEDIA_ERR_SRC_NOT_SUPPORTED]:Or,[yt.MEDIA_ERR_ENCRYPTED]:kr,[yt.MEDIA_ERR_CUSTOM]:Sr},Nr={[yt.MEDIA_ERR_SRC_NOT_SUPPORTED]:[`Failed to open media`]};function Pr(e){return e>=yt.MEDIA_ERR_ABORTED&&e<=yt.MEDIA_ERR_ENCRYPTED}function Fr(){return Ar}function Ir(){return Cr}function Lr(e,t){if(e){let t=Mr[e.code],n=e.message?.trim();if(n){let r=yt.defaultMessages[e.code];if(t&&r&&n===r)return t;let i=Nr[e.code];return t&&Pr(e.code)&&!e.context&&i?.includes(n)?t:n}if(t)return t}return t?.trim()||jr}var Rr=`fullscreen.`,zr={key:`${Rr}enter`,text:`Enter fullscreen`},Br={key:`${Rr}exit`,text:`Exit fullscreen`},Vr=class e{static defaultProps={label:``,disabled:!1};state=L({fullscreen:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=W(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.fullscreen?Br:zr)}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:it(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()}},Hr={fullscreen:`data-fullscreen`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},Ur={key:`playback.rate`,text:`Playback rate {rate}`},Wr=`volume.`,Gr={key:`${Wr}mutedValue`,text:`{percent}, muted`};`${Wr}`;var Kr={key:`${Wr}label`,text:`Volume`};`${Wr}`;var qr=Intl.DurationFormat,Jr=new Map;function Yr(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 Xr(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function Zr(e){let t=Array.isArray(e)?e[0]:e;return!t||t===`en`||t.startsWith(`en-`)}function Qr(e,t=`long`,n){let r=`${Xr(e)}:${t}:${n??``}`,i=Jr.get(r);return i||(i=qr?new qr(e,n===void 0?{style:t}:{style:t,hoursDisplay:n}):Yr(t,n),Jr.set(r,i)),i}function $r(e){return ke(e)&&Number.isFinite(e)}function ei(e,t){if(!$r(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=$r(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=Qr(`en`,`digital`,u?`always`:`auto`).format(f);return d||(p=p.replace(/^0(?=\d:)/,``)),`${n?`-`:``}${p}`}function ti(e){if(!$r(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 ni(e,t){if(!$r(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=Qr(t?.locale,t?.style??`long`).format(s);if(n){let e=t?.formatRemaining;return e?e(c):Zr(t?.locale)?`${c} remaining`:c}return c}var ri=`buttons.`,ii={key:`${ri}play`,text:`Play`},ai={key:`${ri}pause`,text:`Pause`},oi={key:`${ri}replay`,text:`Replay`},si={key:`${ri}mute`,text:`Mute`},ci={key:`${ri}unmute`,text:`Unmute`},li=class e{static defaultProps={label:``,disabled:!1};state=L({muted:!1,volumeLevel:`off`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=W(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.muted?ci:si)}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:ui(e)}),this.state.patch({label:it(this.getLabel(this.state.current))}),this.state.current}toggle(e){this.#e.disabled||e.toggleMuted()}};function ui(e){return e.muted||e.volume===0?`off`:e.volume<.5?`low`:e.volume<.75?`medium`:`high`}var di={muted:`data-muted`,volumeLevel:`data-volume-level`},fi=`pip.`,pi={key:`${fi}enter`,text:`Enter picture-in-picture`},mi={key:`${fi}exit`,text:`Exit picture-in-picture`},hi=class e{static defaultProps={label:``,disabled:!1};state=L({pip:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=W(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.pip?mi:pi)}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:it(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()}},gi={pip:`data-pip`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},_i=class e{static defaultProps={label:``,disabled:!1};state=L({paused:!0,ended:!1,started:!1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=W(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.ended?oi:e.paused?ii:ai)}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:it(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()}}},vi={paused:`data-paused`,ended:`data-ended`,started:`data-started`},yi=class e{static defaultProps={label:``,disabled:!1,menuTrigger:!1};state=L({rate:1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=W(t,e.defaultProps)}getLabel(e){let t=J(this.#e.label,e);return t===void 0?Ur:t}getLabelParams(e){if(J(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:it(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)}},bi={rate:`data-rate`},xi=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=W(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,...un(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}}},Si={open:`data-open`,side:`data-side`,align:`data-align`,...ln},Ci=`seek.`,wi={key:`${Ci}forward`,text:`Seek forward {seconds} seconds`},Ti={key:`${Ci}backward`,text:`Seek backward {seconds} seconds`},Ei=class e{static defaultProps={seconds:30,label:``,disabled:!1};state=L({seeking:!1,direction:`forward`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=W(t,e.defaultProps)}getLabel(e){let t=J(this.#e.label,e);return t===void 0?e.direction===`backward`?Ti:wi:t}getLabelParams(e){if(J(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:it(this.getLabel(this.state.current))}),this.state.current}async seek(e){this.#e.disabled||await e.seek(e.currentTime+this.#e.seconds)}},Di={seeking:`data-seeking`,direction:`data-direction`},Oi=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=W(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 J(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 vn(_n(t+e/100*(n-t),t,n),r,t)}rawValueFromPercent(e){let{min:t,max:n}=this.#e;return _n(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)}},ki={dragging:`data-dragging`,pointing:`data-pointing`,interactive:`data-interactive`,orientation:`data-orientation`,disabled:`data-disabled`},Ai={loading:`data-loading`,error:`data-error`,hidden:`data-hidden`};function ji(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&&ke(n)&&!Number.isNaN(n)&&(l[t]=n)}let u={url:a};return ke(l.w)&&(u.width=l.w),ke(l.h)&&(u.height=l.h),ke(l.x)&&ke(l.y)&&(u.coords={x:l.x,y:l.y}),u}function Mi(e,t){let n=[];for(let r of e){let e=ji(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 Ni=`time.`,Pi={key:`${Ni}current`,text:`Current time`},Fi={key:`${Ni}duration`,text:`Duration`},Ii={key:`${Ni}remaining`,text:`Remaining`},Li={key:`${Ni}remainingSuffix`,text:`{duration} remaining`},Ri={key:`${Ni}showElapsed`,text:`{duration}. Show elapsed time.`},zi={key:`${Ni}showDuration`,text:`{duration}. Show duration.`},Bi={key:`${Ni}showRemaining`,text:`{duration}. Show remaining time.`},Vi={key:`${Ni}position`,text:`{current} of {duration}`},Hi={current:Ri,duration:zi,remaining:Bi},Ui={current:Pi,duration:Fi,remaining:Ii},Wi=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=W(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 ei(Math.abs(t),e.duration)}#i(){let{type:e}=this.#e,t=this.#n();return ni(e===`remaining`?t<0?t:-Math.abs(t):t)}#a(){let e=this.#n();return ti(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=J(this.#e.label,e);return n===void 0?this.#e.toggle?Hi[this.#o(t,e.type)]:Ui[this.#e.type]:n}getLabelParams(e){return J(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()}}},Gi={type:`data-type`},Ki={key:`slider.seek`,text:`Seek`},qi=class e extends Oi{static defaultProps={...Oi.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=W(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)||Ki}#i(e){return e.dragging?this.rawValueFromPercent(e.pointerPercent):e.value}#a(e){return this.#n===void 0?ni(e):ni(e,{locale:this.#n})}getValueText(e){return Number.isFinite(e.duration)?Vi: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)}}},Ji={...ki,seeking:`data-seeking`},Yi=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=W(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,...un(e.status)}}getPopupAttrs(e){return{popover:`manual`,role:`presentation`}}},Xi={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`},Zi={open:`data-open`,side:`data-side`,align:`data-align`,...ln},Qi=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=W(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()}},$i=new Map;function ea(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function ta(e){let t=ea(e),n=$i.get(t);if(!n)try{n=new Intl.NumberFormat(e,{style:`percent`,maximumFractionDigits:0}),$i.set(t,n)}catch{return}return n}function na(e){return`${Math.round(Math.min(1,Math.max(0,e))*100)}%`}function ra(e,t){let n=!ke(e)||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e));try{let e=ta(t)??ta(void 0);if(e)return e.format(n)}catch{}return na(n)}var ia=class e extends Oi{static defaultProps={...Oi.defaultProps,label:``,wheelStep:5};#e=null;#t;constructor(e){super(),e&&this.setProps(e)}setProps(t){super.setProps(W(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)||Kr}getValueText(e){return e.muted?Gr:this.getValueTextParams(e).percent}getValueTextParams(e){return{percent:ra(e.value/100,this.#t)}}getAttrs(e){return{...super.getAttrs(e),"aria-valuetext":this.getValueText(e)}}},aa={...ki,availability:`data-availability`};h();var oa=O(null),sa=oa.Provider;function ca(){let e=S(oa);if(!e)throw Error(`AlertDialog compound components must be used within an AlertDialog.Root`);return e}var la=Object.defineProperty,ua=(e,t)=>{let n={};for(var r in e)la(n,r,{get:e[r],enumerable:!0});return t||la(n,Symbol.toStringTag,{value:`Module`}),n};h();var da=y(function({render:e,className:t,style:n,disabled:r,...i},a){let{dialog:o,state:s}=ca(),c=A(()=>{r||o.close()},[o,r]);return q(`button`,{render:e,className:t,style:n},{state:s,ref:[a],props:[{type:`button`,disabled:r,onClick:c},i]})});h();function fa(e){let{displayName:t,tag:n,useContext:r,staticProps:i,getProps:a}=e,o=y(function(e,t){let{render:o,className:s,style:c,...l}=e,u=r(),d=a?.(u.state);return q(n,{render:o,className:s,style:c},{state:u.state,stateAttrMap:u.stateAttrMap,ref:t,props:[i,d,l].filter(Boolean)})});return o.displayName=t,o}var pa=fa({displayName:`AlertDialogDescription`,tag:`p`,useContext:ca,getProps:e=>({id:e.descriptionId})});h();var ma=y(function({render:e,className:t,style:n,...r},i){let{core:a,dialog:o,state:s,stateAttrMap:c}=ca(),l=fe(i,A(e=>{o.setElement(e)},[o]));return s.open?q(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:l,props:[{tabIndex:-1,...a.getAttrs(s)},r]}):null});h();var ha=/[^a-zA-Z0-9_-]/g;function ga(e){let t=p().replace(ha,``);return e?`${e}-${t}`:t}h();function _a({open:e,defaultOpen:t=mr.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,children:i}){let[a]=N(()=>new mr),o=e!==void 0,s=U(n),c=U(r),[l]=N(()=>{let e=sn({transition:Bn(),onOpenChange:e=>{s.current?.(e)},onOpenChangeComplete:e=>{c.current?.(e)}});return!o&&t&&e.open(),e}),u=ga(`alert-dialog-title`),d=ga(`alert-dialog-desc`);a.setTitleId(u),a.setDescriptionId(d),P(()=>{if(e===void 0)return;let{active:t}=l.input.current;e!==t&&(e?l.open():l.close())},[e,l]),qe(l);let f=_t(l.input);return a.setInput(f),F(sa,{value:{core:a,dialog:l,state:a.getState(),stateAttrMap:hr},children:i})}var va=fa({displayName:`AlertDialogTitle`,tag:`h2`,useContext:ca,getProps:e=>({id:e.titleId})}),ya=ua({Close:()=>da,Description:()=>pa,Popup:()=>ma,Root:()=>_a,Title:()=>va});h();var ba=y(function(e,t){let{render:n,className:r,style:i,delay:a,...o}=e,s=R(Ot),[c]=N(()=>new gr);qe(c),c.setProps({delay:a}),s&&c.update(s);let l=m(e=>c.state.subscribe(e),()=>c.state.current,()=>c.state.current);return s?q(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:_r,ref:[t],props:[o]}):null});h();var xa=O(null),Sa=xa.Provider;function Ca(){let e=S(xa);if(!e)throw Error(`Controls compound components must be used within a Controls.Root`);return e}function wa(){return S(xa)}h();var Ta=y(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{state:s,stateAttrMap:c}=Ca(),l=o[`aria-label`]||o[`aria-labelledby`]?`group`:void 0;return q(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:c,ref:[t],props:[{role:l,children:a},o]})});h();var Ea=y(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=R(wt),[c]=N(()=>new vr);if(!s)return null;c.setMedia(s);let l=c.getState();return F(Sa,{value:{state:l,stateAttrMap:yr},children:q(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:yr,ref:[t],props:[{children:a},o,{"data-interactive":``}]})})}),Da=ua({Group:()=>Ta,Root:()=>Ea});h();var Oa=O(null),ka=Oa.Provider;function Aa(){let e=S(Oa);if(!e)throw Error(`ErrorDialog compound components must be used within an ErrorDialog.Root`);return e}h();var ja=y(function({render:e,className:t,style:n,disabled:r,children:i,...a},o){let s=z(),{dialog:c,state:l,stateAttrMap:u}=ca(),d=A(()=>{r||c.close()},[c,r]),f=i??G(Ir(),s);return q(`button`,{render:e,className:t,style:n},{state:l,stateAttrMap:u,ref:o,props:[{type:`button`,disabled:r,onClick:d,children:f},a]})});h();var Ma=y(function({render:e,className:t,style:n,children:r,...i},a){let o=z(),{state:s,stateAttrMap:c}=ca(),{lastError:l}=Aa(),u=Lr(l),d=r??G(u,o);return q(`p`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.descriptionId,children:d},i]})});h();function Na({children:e}){let[t]=N(()=>new br),n=R(Tt),r=_(n?.error??null);n?.error&&(r.current=n.error);let i=U(n),[a]=N(()=>sn({transition:Bn(),onOpenChange:e=>{e||i.current?.dismissError()}})),o=ga(`error-dialog-title`),s=ga(`error-dialog-desc`);t.setTitleId(o),t.setDescriptionId(s),P(()=>{let e=!!n?.error,{active:t}=a.input.current;e&&!t?a.open():!e&&t&&a.close()},[n?.error,a]),qe(a);let c=_t(a.input);t.setInput(c);let l=t.getState();return n?F(ka,{value:{lastError:r.current},children:F(sa,{value:{core:t,dialog:a,state:l,stateAttrMap:hr},children:e})}):null}h();var Pa=y(function({render:e,className:t,style:n,children:r,...i},a){let o=z(),{state:s,stateAttrMap:c}=ca(),l=r??G(Fr(),o);return q(`h2`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.titleId,children:l},i]})}),Fa=ua({Close:()=>ja,Description:()=>Ma,Popup:()=>ma,Root:()=>Na,Title:()=>Pa}),Ia=pr({displayName:`FullscreenButton`,core:Vr,stateAttrMap:Hr,selector:Et,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleFullscreen`,isSupported:e=>!e.hidden});h();function La({type:e,action:t,value:n,pointer:r,region:i,disabled:a}){let o=R(),s=I();return P(()=>{if(!s||!e||!t||a)return;let c=Ft(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`?Vt(s,l,u):Bt(s,l,u)},[s,o,e,t,n,r,i,a]),null}var Ra=La;h();function za(){let[,e]=te(e=>e+1,0);return e}h();function Ba(e){let t=U(e),n=_(null),r=_(null),i=za(),[a]=N(()=>jn({getElement:()=>n.current,getThumbElement:()=>r.current,getOrientation:()=>t.current.orientation??`horizontal`,isRTL:()=>n.current?ot(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?.()}));qe(a);let o=_t(a.input),s=e.computeState(o);return x(()=>{s.thumbAlignment===`edge`&&n.current&&r.current&&i()},[s.thumbAlignment]),{state:s,cssVars:e.getCSSVars(a.adjustForAlignment(s)),rootRef:A(e=>{n.current=e},[]),thumbRef:A(e=>{r.current=e},[]),rootProps:a.rootProps,rootStyle:a.rootStyle,thumbProps:a.thumbProps}}h();function Va({keys:e,action:t,value:n,disabled:r,target:i}){let a=R(),o=I();return P(()=>{if(!o||!e||!t||r)return;let s=Wt(t);if(s)return an(o,{keys:e,action:t,value:n,target:i,disabled:r,repeatable:!Ht(t),onActivate:(e,t)=>{s({store:a,key:t,value:n})}})},[o,a,e,t,n,r,i]),null}var Ha=Va;h();function Ua(e){let t=e.side,[n,r]=N({preferred:t,side:t}),i=e.open&&n.preferred===t?n.side:t,a=j(()=>i===t?e:{...e,side:i},[i,e,t]),o=A(e=>r(n=>n.preferred===t&&n.side===e?n:{preferred:t,side:e}),[t]);return P(()=>{e.open||o(t)},[e.open,t,o]),{state:a,preferredSide:t,setPositionedSide:o}}var Wa=pr({displayName:`MuteButton`,core:li,stateAttrMap:di,selector:Mt,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleMuted`}),Ga=pr({displayName:`PiPButton`,core:hi,stateAttrMap:gi,selector:Dt,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePictureInPicture`,isSupported:e=>!e.hidden}),Ka=pr({displayName:`PlayButton`,core:_i,stateAttrMap:vi,selector:Ot,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePaused`}),qa=pr({displayName:`PlaybackRateButton`,core:yi,stateAttrMap:bi,selector:kt,action:(e,t)=>e.cycle(t),hotkeyAction:`speedUp`});h();var Ja=O(null),Ya=Ja.Provider;function Xa(){let e=S(Ja);if(!e)throw Error(`Popover compound components must be used within a Popover.Root`);return e}var Za=fa({displayName:`PopoverArrow`,tag:`div`,useContext:Xa,staticProps:{"aria-hidden":`true`}});h();var Qa={position:`fixed`,inset:`auto`,margin:0},$a=y(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}=Xa(),h=_(null),g=fe(i,A(e=>{o.setPopupElement(e),e&&st()&&e.style.setProperty(`position-anchor`,`--${d}`)},[o,d]),h),v=j(()=>({side:c,align:s.align}),[c,s.align]),y=j(()=>{if(!st())return null;let{positionAnchor:e,...t}=wn(d,v);return t},[d,v]),[b,S]=N(null);x(()=>{if(!s.open){S(null);return}function e(){let e=o.triggerElement,t=h.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=hn(p,{container:m,root:r}),a=kn(t,v.side),s=mn(i),c=On(t),u=ft(n,a,s,v,c),{positionAnchor:f,...g}=wn(d,{...v,side:u},n,st()?void 0:a,s,c);S(g),l(u)}e();let t=o.triggerElement,n=h.current,r=n?hn(p,{container:m,root:n.getRootNode()}):null,i=0;function a(t){t&&Gn(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,v,o,p,m,l]);let C=b??y??Qa;if(!s.open)return null;let{onFocusOut:w,...T}=o.popupProps;return q(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:u,ref:g,props:[{id:f,style:C,...a.getPopupAttrs(s)},{...T,onBlur:w},r]})});h();function eo({open:e,defaultOpen:t=xi.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,openOnHover:i=xi.defaultProps.openOnHover,delay:a=xi.defaultProps.delay,closeDelay:o=xi.defaultProps.closeDelay,boundary:s=`container`,children:c,...l}){let u=be(),d=Ce(),f=wa(),[p]=N(()=>new xi(l));p.setProps(l);let m=!B(e),h=U(n),g=U(r),_=U(l.closeOnEscape),v=U(l.closeOnOutsideClick),y=U(i),b=U(a),x=U(o),S=U(d),[C]=N(()=>{let e=dn({transition:Bn(),onOpenChange:(e,t)=>{h.current?.(e,t)},onOpenChangeComplete:e=>{g.current?.(e)},closeOnEscape:()=>_.current??xi.defaultProps.closeOnEscape,closeOnOutsideClick:()=>v.current??xi.defaultProps.closeOnOutsideClick,openOnHover:()=>y.current,delay:()=>b.current,closeDelay:()=>x.current,group:()=>S.current});return!m&&t&&e.open(`click`),e}),w=ga(),T=ga(`popup`);P(()=>{if(B(e))return;let{active:t}=C.input.current;e!==t&&(e?C.open(`click`):C.close(`click`))},[e,C]),P(()=>{B(f?.state.visible)||f.state.visible||C.close(`imperative-action`)},[f?.state.visible,C]),qe(C);let E=_t(C.input);p.setInput(E);let{state:D,preferredSide:O,setPositionedSide:k}=Ua(p.getState());return F(Ya,{value:{core:p,popover:C,state:D,preferredSide:O,setPositionedSide:k,stateAttrMap:Si,anchorName:w,popupId:T,boundary:s,container:u},children:c})}h();var to=y(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,stateAttrMap:c,anchorName:l,popupId:u}=Xa(),d=A(e=>{o.setTriggerElement(e),e&&st()&&e.style.setProperty(`anchor-name`,`--${l}`)},[o,l]),{onFocusIn:f,onFocusOut:p,...m}=o.triggerProps;return q(`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]})}),no=ua({Arrow:()=>Za,Popup:()=>$a,Root:()=>eo,Trigger:()=>to}),ro=pr({displayName:`SeekButton`,core:Ei,stateAttrMap:Di,selector:jt,action:(e,t)=>e.seek(t),hotkeyAction:`seekStep`,hotkeyValue:e=>typeof e.seconds==`number`?e.seconds:Ei.defaultProps.seconds});h();var io=y(function(e,t){let{render:n,className:r,style:i,time:a=0,thumbnails:o,crossOrigin:s,loading:c,fetchPriority:l,...u}=e,[d]=N(()=>new In),f=_(null),p=_(null),m=xe(At),[,h]=N(0),[g]=N(()=>Ln({getContainer:()=>f.current,getImg:()=>p.current,onStateChange:()=>h(e=>e+1)}));qe(g,()=>g.connect());let v=j(()=>o&&o.length>0?o:m&&m.thumbnailCues.length>0?Mi(m.thumbnailCues,m.thumbnailTrackSrc??void 0):[],[o,m]),y=j(()=>d.findActiveThumbnail(v,a),[d,v,a]);g.updateSrc(y?.url);let b=d.getState(g.loading,g.error,y),x={overflow:`hidden`},S;if(y&&g.naturalWidth&&g.naturalHeight){let e=g.readConstraints(),t=d.resize(y,g.naturalWidth,g.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 q(`div`,{render:n,className:r,style:i},{state:b,stateAttrMap:Ai,ref:[t,f],props:[d.getAttrs(b),{style:x},u,{children:F(`img`,{ref:p,alt:``,"aria-hidden":`true`,decoding:`async`,src:y?.url,crossOrigin:s===``||s===null?void 0:s,loading:c,style:S,fetchPriority:l})}]})});h();var ao=O(null);function oo({value:e,children:t}){return F(ao.Provider,{value:e,children:t})}function so(){let e=S(ao);if(!e)throw Error(`Slider compound components must be used within a Slider.Root`);return e}var co=fa({displayName:`SliderBuffer`,tag:`div`,useContext:so}),lo=fa({displayName:`SliderFill`,tag:`div`,useContext:so});h();var uo=y(function(e,t){let{render:n,className:r,style:i,overflow:a=`clamp`,...o}=e,s=so(),{state:c}=s,l=_(null),[u,d]=N(0);P(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>{d(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let f=Fn(u,a);return q(`div`,{render:n,className:r,style:i},{state:c,stateAttrMap:s.stateAttrMap,ref:[t,l],props:[{style:f},o]})});h();var fo=y(function(e,t){let{render:n,className:r,style:i,label:a,min:o,max:s,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f,value:p=0,onValueChange:m,onValueCommit:h,onDragStart:g,onDragEnd:_,...v}=e,[y]=N(()=>new Oi),b=z();y.setProps({label:a,min:o,max:s,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f});let{state:x,cssVars:S,rootRef:C,thumbRef:w,rootProps:T,rootStyle:E,thumbProps:D}=Ba({computeState:e=>(y.setInput(e),y.getSliderState(p)),getPercent:()=>y.percentFromValue(p),getStepPercent:()=>y.getStepPercent(),getLargeStepPercent:()=>y.getLargeStepPercent(),orientation:u,disabled:d,adjustPercent:(e,t,n)=>y.adjustPercentForAlignment(e,t,n),getCSSVars:Nn,onValueChange:e=>m?.(y.valueFromPercent(e)),onValueCommit:e=>h?.(y.valueFromPercent(e)),onDragStart:g,onDragEnd:_});return F(oo,{value:{state:x,pointerValue:y.valueFromPercent(x.pointerPercent),thumbRef:w,thumbProps:D,stateAttrMap:ki,getAttrs:e=>{let t=y.getAttrs(e);return{...t,"aria-label":G(t[`aria-label`],b)}},formatValue:void 0},children:q(`div`,{render:n,className:r,style:i},{state:x,stateAttrMap:ki,ref:[t,C],props:[{style:{...S,...E}},T,v]})})});h();var po=y(function(e,t){let{render:n,className:r,style:i,...a}=e,o=so(),{state:s,thumbRef:c,thumbProps:l,getAttrs:u}=o,d=u(s);return q(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:o.stateAttrMap,ref:[t,c],props:[d,l,a]})});h();var mo=y(function(e,t){let{pointerValue:n}=so();return F(io,{ref:t,...e,time:n})}),ho=fa({displayName:`SliderTrack`,tag:`div`,useContext:so});h();var go=y(function(e,t){let{render:n,className:r,style:i,type:a=`current`,format:o,...s}=e,c=so(),{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 q(`output`,{render:n,className:r,style:i},{state:l,stateAttrMap:c.stateAttrMap,ref:t,props:[{"aria-live":`off`,children:p},s]})}),_o=ua({Buffer:()=>co,Fill:()=>lo,Preview:()=>uo,Root:()=>fo,Thumb:()=>po,Thumbnail:()=>mo,Track:()=>ho,Value:()=>go});h();var vo=y(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e;return q(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{children:a},o]})});h();var yo=y(function(e,t){let{render:n,className:r,style:i,children:a=`/`,...o}=e;return q(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{"aria-hidden":`true`,children:a},o]})});h(),w();var bo=y(function(e,t){let{render:n,className:r,style:i,type:a,negativeSign:o,label:s,toggle:c=!1,...l}=e,u=R(jt),d=z(),f=De(),[p]=N(()=>new Wi),m=a??Wi.defaultProps.type,[h,g]=N(m);if(P(()=>{g(m)},[m,c]),p.setProps({type:h,negativeSign:o,label:s,toggle:c}),!u)return null;p.setMedia(u);let _=p.getState(),v=p.getAttrs(_,m),y=p.getLabelParams(_)?{duration:_.type===`remaining`?G(Li,d,{duration:ni(Math.abs(_.seconds),{locale:f})}):ni(Math.abs(_.seconds),{locale:f})}:void 0,b=_.negative?F(T,{children:[F(`span`,{"aria-hidden":`true`,children:o??Wi.defaultProps.negativeSign}),_.text]}):_.text,x=()=>{g(e=>m===`current`?e===`remaining`?`current`:`remaining`:e===`duration`?`remaining`:`duration`)},S=e=>{e.defaultPrevented||x()},C=e=>{!e.defaultPrevented&&V(e.nativeEvent)&&(e.preventDefault(),!e.repeat&&x())};return q(`time`,{render:n,className:r,style:i},{state:_,stateAttrMap:Gi,ref:[t],props:[{dateTime:_.datetime,children:b,...v,"aria-label":G(v[`aria-label`],d,y),...c?{onClick:S,onKeyDown:C}:void 0},l]})}),xo=ua({Group:()=>vo,Separator:()=>yo,Value:()=>bo});h();var So=()=>Promise.resolve(0),Co=y(function(e,t){let{render:n,className:r,style:i,label:a,changeThrottle:o=qi.defaultProps.changeThrottle,step:s=qi.defaultProps.step,largeStep:c=qi.defaultProps.largeStep,orientation:l,disabled:u,thumbAlignment:d,onDragStart:f,onDragEnd:p,pauseOnDrag:m,...h}=e,g=R(jt),_=R(Ct),v=R(Ot),y=z(),b=De(),[x]=N(()=>new qi);x.setProps({label:a,step:s,largeStep:c,orientation:l,disabled:u,thumbAlignment:d,pauseOnDrag:m,changeThrottle:o}),x.setFormatLocale(b);let S=U(g&&_?{...g,..._}:null),C=U(v);P(()=>()=>x.endDrag(C.current),[x]);let w=g?.duration??0,{state:T,cssVars:E,rootRef:D,thumbRef:O,rootProps:k,rootStyle:A,thumbProps:j}=Ba({computeState:e=>(x.setInput(e),!g||!_?x.setMedia({currentTime:0,duration:0,seeking:!1,seek:So,buffered:[],seekable:[]}):x.setMedia({...g,..._}),x.getState()),getPercent:()=>w>0?(g?.currentTime??0)/w*100:0,getStepPercent:()=>x.getStepPercent(),getLargeStepPercent:()=>x.getLargeStepPercent(),orientation:l,disabled:u,changeThrottle:o,adjustPercent:(e,t,n)=>x.adjustPercentForAlignment(e,t,n),getCSSVars:Pn,onValueCommit:e=>{let t=S.current;t&&t.seek(x.rawValueFromPercent(e))},onDragStart:()=>{x.startDrag(C.current),f?.()},onDragEnd:()=>{x.endDrag(C.current),p?.()}});return g?F(oo,{value:{state:T,pointerValue:x.valueFromPercent(T.pointerPercent),thumbRef:O,thumbProps:j,stateAttrMap:Ji,getAttrs:e=>{let t=x.getAttrs(e);return{...t,"aria-label":G(t[`aria-label`],y),"aria-valuetext":G(t[`aria-valuetext`],y,x.getValueTextParams(e))}},formatValue:e=>ei(e,w)},children:q(`div`,{render:n,className:r,style:i},{state:T,stateAttrMap:Ji,ref:[t,D],props:[{style:{...E,...A}},k,h]})}):null}),wo=ua({Buffer:()=>co,Fill:()=>lo,Preview:()=>uo,Root:()=>Co,Thumb:()=>po,Track:()=>ho,Value:()=>go}),To=fa({displayName:`TooltipArrow`,tag:`div`,useContext:ur,staticProps:{"aria-hidden":`true`}});h();var Eo=y(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=ur(),l=r===void 0?c?.label??``:r;return q(`span`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]})});h();var Do=y(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=ur(),l=r??c?.shortcut??null;return l?q(`kbd`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]}):null});h(),w();var Oo={position:`fixed`,inset:`auto`,margin:0},ko=y(function({render:e,className:t,style:n,children:r,...i},a){let{core:o,tooltip:s,state:c,preferredSide:l,setPositionedSide:u,stateAttrMap:d,anchorName:f,popupId:p,boundary:m,container:h}=ur(),g=_(null),v=fe(a,A(e=>{s.setPopupElement(e),e&&st()&&e.style.setProperty(`position-anchor`,`--${f}`)},[s,f]),g),y=j(()=>({side:l,align:c.align}),[l,c.align]),b=j(()=>{if(!st())return null;let{positionAnchor:e,...t}=wn(f,y,void 0,void 0,void 0,void 0,Xi);return t},[f,y]),[S,C]=N(null);x(()=>{if(!c.open){C(null);return}function e(){let e=s.triggerElement,t=g.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=hn(m,{container:h,root:r}),a=kn(t,y.side),o=mn(i),c=On(t,Xi),l=ft(n,a,o,y,c),{positionAnchor:d,...p}=wn(f,{...y,side:l},n,st()?void 0:a,o,c,Xi);C(p),u(l)}e();let t=s.triggerElement,n=g.current,r=n?hn(m,{container:h,root:n.getRootNode()}):null,i=0;function a(t){t&&Gn(t,g.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)}},[c.open,f,y,s,m,h,u]);let w=S??b??Oo;if(!c.open)return null;let E=r===void 0?F(T,{children:[F(Eo,{}),F(Do,{})]}):r,{onFocusOut:D,...O}=s.popupProps;return q(`div`,{render:e,className:t,style:n},{state:c,stateAttrMap:d,ref:v,props:[{id:p,style:w,...o.getPopupAttrs(c)},{children:E},{...O,onBlur:D},i]})});h();var Ao=O(null),jo=Ao.Provider;function Mo(){return S(Ao)?.group}h();function No({delay:e,closeDelay:t,timeout:n,children:r}){let[i]=N(()=>new Qi({delay:e,closeDelay:t,timeout:n}));return i.setProps({delay:e,closeDelay:t,timeout:n}),F(jo,{value:{group:i},children:r})}h();function Po({open:e,defaultOpen:t=Yi.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,delay:i=Yi.defaultProps.delay,closeDelay:a=Yi.defaultProps.closeDelay,disableHoverablePopup:o=Yi.defaultProps.disableHoverablePopup,disabled:s=Yi.defaultProps.disabled,boundary:c=`container`,children:l,...u}){let d=be(),f=wa(),[p]=N(()=>new Yi(u));p.setProps(u);let m=!B(e),h=Mo(),g=U(n),_=U(r),v=U(i),y=U(a),b=U(o),x=U(s),S=U(h),[C]=N(()=>{let e=zn({transition:Bn(),onOpenChange:(e,t)=>{g.current?.(e,t)},onOpenChangeComplete:e=>{_.current?.(e)},delay:()=>v.current,closeDelay:()=>y.current,disableHoverablePopup:()=>b.current,disabled:()=>x.current,group:()=>S.current});return!m&&t&&e.open(),e}),[w,T]=N(),E=ga(),D=ga(`tooltip`);P(()=>{if(B(e))return;let{active:t}=C.input.current;e!==t&&(e?C.open():C.close())},[e,C]),P(()=>{B(f?.state.visible)||f.state.visible||C.close(`imperative-action`)},[f?.state.visible,C]),qe(C);let O=_t(C.input);p.setInput(O);let{state:k,preferredSide:A,setPositionedSide:j}=Ua(p.getState());return F(lr,{value:{core:p,tooltip:C,state:k,preferredSide:A,setPositionedSide:j,stateAttrMap:Zi,anchorName:E,popupId:D,content:w,setContent:T,boundary:c,container:d},children:l})}h();var Fo=y(function({render:e,className:t,style:n,...r},i){let{tooltip:a,state:o,stateAttrMap:s,anchorName:c}=ur(),l=A(e=>{a.setTriggerElement(e),e&&st()&&e.style.setProperty(`anchor-name`,`--${c}`)},[a,c]),{onFocusIn:u,onFocusOut:d,...f}=a.triggerProps;return q(`button`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:[i,l],props:[{type:`button`},{...f,onFocus:u,onBlur:d},r]})}),Io=ua({Arrow:()=>To,Label:()=>Eo,Popup:()=>ko,Provider:()=>No,Root:()=>Po,Shortcut:()=>Do,Trigger:()=>Fo});h();var Lo={volume:0,muted:!1,volumeAvailability:`unsupported`,setVolume:()=>0,toggleMuted:()=>!1},Ro=y(function(e,t){let{render:n,className:r,style:i,label:a,orientation:o,step:s=ia.defaultProps.step,largeStep:c=ia.defaultProps.largeStep,wheelStep:l=ia.defaultProps.wheelStep,disabled:u,thumbAlignment:d,onDragStart:f,onDragEnd:p,...m}=e,h=R(Mt),g=z(),v=De(),[y]=N(()=>new ia);y.setProps({label:a,orientation:o,step:s,largeStep:c,wheelStep:l,disabled:u,thumbAlignment:d}),y.setFormatLocale(v);let b=U(h),x=U(u),S=()=>(b.current?.volume??0)*100,C=()=>y.getStepPercent(),w=e=>b.current?.setVolume(e/100),{state:T,cssVars:E,rootRef:D,thumbRef:O,rootProps:k,rootStyle:j,thumbProps:ee}=Ba({computeState:e=>(y.setInput(e),y.setMedia(h??Lo),y.getState()),getPercent:S,getStepPercent:C,getLargeStepPercent:()=>y.getLargeStepPercent(),orientation:o,disabled:u,adjustPercent:(e,t,n)=>y.adjustPercentForAlignment(e,t,n),getCSSVars:Nn,onValueChange:w,onValueCommit:w,onDragStart:f,onDragEnd:p}),[M]=N(()=>Wn({isDisabled:()=>!!x.current||!b.current,getPercent:()=>(b.current?.volume??0)*100,getStepPercent:()=>y.getWheelStepPercent(),onValueChange:e=>b.current?.setVolume(e/100)})),te=_(null),P=A(e=>{te.current?.(),te.current=null,e&&(te.current=H(e,`wheel`,M.onWheel,{passive:!1}))},[M]);return h?F(oo,{value:{state:T,pointerValue:y.valueFromPercent(T.pointerPercent),thumbRef:O,thumbProps:ee,stateAttrMap:aa,getAttrs:e=>{let t=y.getAttrs(e);return{...t,"aria-label":G(t[`aria-label`],g),"aria-valuetext":G(t[`aria-valuetext`],g,y.getValueTextParams(e))}},formatValue:e=>`${Math.round(e)}%`},children:q(`div`,{render:n,className:r,style:i},{state:T,stateAttrMap:aa,ref:[t,D,P],props:[{style:{...E,...j}},k,m]})}):null}),zo=ua({Fill:()=>lo,Preview:()=>uo,Root:()=>Ro,Thumb:()=>po,Track:()=>ho,Value:()=>go});w(),D();var Bo=({title:t,remote:n,children:r})=>{let i=j(()=>n?e(n):null,[n]);return P(()=>i?.hold(),[i]),M(Ye,{expose:!0,media:i?.media??null,title:t,children:r})},Vo=({play:e,signIn:t,rent:n})=>/^\/(ap\/signin|ax\/claim)\b|\/auth-redirect\b/.test(location.pathname)?`signed-out`:document.querySelector(e)?`play`:document.querySelector(t)?`signed-out`:document.querySelector(n)?`rent`:`pending`,Ho=({play:e})=>{let t=document.querySelector(e);if(!t)throw Object.assign(Error(`Prime Video Play is not on the page`),{name:`PrimeControlMissingError`});t.click()},Uo=({videos:e})=>[...document.querySelectorAll(e)].findIndex(e=>e.readyState>0);D();var Wo={play:`[data-testid="dp-atf-play-button"]`,signIn:u,rent:`[data-automation-id^="ab-"][data-automation-id*="tvod"]`},Go=`#dv-web-player video`,Ko=`
|
|
2
|
-
html, body {
|
|
3
|
-
margin: 0 !important;
|
|
4
|
-
padding: 0 !important;
|
|
5
|
-
width: 100% !important;
|
|
6
|
-
height: 100% !important;
|
|
7
|
-
overflow: hidden !important;
|
|
8
|
-
background: #000 !important;
|
|
9
|
-
}
|
|
10
|
-
*:not(:has(#dv-web-player)):not(#dv-web-player):not(#dv-web-player *) {
|
|
11
|
-
display: none !important;
|
|
12
|
-
}
|
|
13
|
-
#dv-web-player {
|
|
14
|
-
position: fixed !important;
|
|
15
|
-
inset: 0 !important;
|
|
16
|
-
width: 100% !important;
|
|
17
|
-
height: 100% !important;
|
|
18
|
-
z-index: 9999999 !important;
|
|
19
|
-
}
|
|
20
|
-
#dv-web-player :has(video),
|
|
21
|
-
#dv-web-player video {
|
|
22
|
-
position: absolute !important;
|
|
23
|
-
inset: 0 !important;
|
|
24
|
-
width: 100% !important;
|
|
25
|
-
height: 100% !important;
|
|
26
|
-
transform: none !important;
|
|
27
|
-
}
|
|
28
|
-
#dv-web-player video {
|
|
29
|
-
object-fit: contain !important;
|
|
30
|
-
}
|
|
31
|
-
#dv-web-player *:not(:has(video)):not(video) {
|
|
32
|
-
opacity: 0 !important;
|
|
33
|
-
pointer-events: none !important;
|
|
34
|
-
}
|
|
35
|
-
`,qo=3e4,Jo=3e4,Yo=e=>{let t=new URL(e);return t.pathname===`/watch`&&(t.pathname=`/detail`),t.href},Xo=async(e,t,n)=>{let r=Date.now()+n;for(;!t()&&Date.now()<r;){try{let t=await e();if(t!==void 0)return t}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,200))}},Zo=v`
|
|
36
|
-
to { transform: rotate(360deg); }
|
|
37
|
-
`,Qo=g`
|
|
38
|
-
position: relative;
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 100%;
|
|
41
|
-
background: #000;
|
|
42
|
-
user-select: none;
|
|
43
|
-
-webkit-user-select: none;
|
|
44
|
-
|
|
45
|
-
.pv-frame {
|
|
46
|
-
position: absolute;
|
|
47
|
-
inset: 0;
|
|
48
|
-
width: 100%;
|
|
49
|
-
height: 100%;
|
|
50
|
-
border: none;
|
|
51
|
-
background: #000;
|
|
52
|
-
/* taps belong to the player's controls stacked above it */
|
|
53
|
-
pointer-events: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.overlay {
|
|
57
|
-
position: absolute;
|
|
58
|
-
inset: 0;
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-direction: column;
|
|
61
|
-
align-items: center;
|
|
62
|
-
justify-content: center;
|
|
63
|
-
gap: 1.6rem;
|
|
64
|
-
background: #000;
|
|
65
|
-
font-size: 1.4rem;
|
|
66
|
-
color: rgba(255, 255, 255, 0.8);
|
|
67
|
-
z-index: 30;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.login-button {
|
|
71
|
-
padding: 0.8rem 2rem;
|
|
72
|
-
background: #00a8e1;
|
|
73
|
-
color: #fff;
|
|
74
|
-
border: none;
|
|
75
|
-
border-radius: 0.4rem;
|
|
76
|
-
font-size: 1.4rem;
|
|
77
|
-
font-weight: 600;
|
|
78
|
-
text-decoration: none;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
|
|
81
|
-
&:hover {
|
|
82
|
-
background: #0090c2;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&:disabled {
|
|
86
|
-
opacity: 0.6;
|
|
87
|
-
cursor: default;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.loading-spinner {
|
|
92
|
-
box-sizing: border-box;
|
|
93
|
-
width: calc(4 * var(--mp-unit, 10px));
|
|
94
|
-
height: calc(4 * var(--mp-unit, 10px));
|
|
95
|
-
border-radius: 50%;
|
|
96
|
-
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
97
|
-
border-top-color: #fff;
|
|
98
|
-
animation: ${Zo} 0.8s linear infinite;
|
|
99
|
-
}
|
|
100
|
-
`,$o=({url:e,title:t})=>{let[n,r]=N(`detecting`),[i,s]=N(null),[c,u]=N(null),[d,f]=N(!0),[p,m]=N(!1),[h,g]=N(!1),[v,y]=N(),[b,x]=N(null),[S,C]=N(0),[w,T]=N(0),[D,O]=N(!1),[j,ee]=N(!1),te=_(void 0),ne=_(!0);P(()=>()=>{ne.current=!1,clearInterval(te.current)},[]),P(()=>{let e=!1;return oe().then(t=>{e||r(t)}),()=>{e=!0}},[]),P(()=>{if(!i||n===`detecting`)return;let e=!1;return se({iframe:i,domains:a,cookies:ue(n),permissions:[{category:`evaluation`,reason:`Press Play on the episode and see whether you are signed in`}]}).then(t=>{e||u(t)}).catch(t=>{e||(console.error(`Failed to attach Prime Video frame`,t),y(t?.message||`Failed to load player`),f(!1))}),()=>{e=!0}},[i,n]),P(()=>{if(!c)return;let t=!1,n=()=>t;return f(!0),y(void 0),m(!1),g(!1),x(null),(async()=>{await c.goto(Yo(e),{waitUntil:`commit`});let r=await Xo(async()=>{let e=await c.evaluate(Vo,Wo);return e===`pending`?void 0:e},n,qo);if(t)return;if(r&&ae.record(`prime`,r===`signed-out`?`signed-out`:`signed-in`),r===`signed-out`){f(!1),m(!0);return}if(r===`rent`){f(!1),g(!0);return}if(!r)throw Error(`Prime Video shows no Play button for this episode.`);await c.evaluate(Ho,Wo);let i=await Xo(async()=>{let e=await c.evaluate(Uo,{videos:Go});return e<0?void 0:c.locator(Go).nth(e).videoElement()},n,Jo);if(!t){if(!i)throw Error(`The episode did not load a player.`);await c.addStyleTag({content:Ko}),!t&&(f(!1),x(i))}})().catch(e=>{t||(console.error(`Failed to load Prime Video player`,e),y(e?.message||`Failed to load player`),f(!1))}),()=>{t=!0}},[c,e,S]);let F=A(()=>{u(null),y(void 0),x(null),m(!1),g(!1),ee(!1),f(!0),T(e=>e+1)},[]),re=A(()=>{if(ee(!1),n===`extension`){let e=globalThis.open(l,`_blank`,`width=500,height=700`);if(!e)return ee(!0);O(!0),clearInterval(te.current),te.current=setInterval(()=>{e.closed&&(clearInterval(te.current),O(!1),C(e=>e+1))},500);return}let e=le({url:l,domains:a,isSignedIn:o});O(!0),e.then(e=>{if(ne.current){if(e===`blocked`)return ee(!0);if(e===`unsupported`)return y(`The Prime Video sign-in window could not open here.`);if(e===`authed`)return F();C(e=>e+1)}},e=>{ne.current&&(console.error(`Prime Video sign-in window failed`,e),y(e?.message||`The sign-in window failed`))}).finally(()=>{ne.current&&O(!1)})},[n,F]),ie=M(`a`,{className:`login-button`,href:Yo(e),target:`_blank`,rel:`noreferrer`,children:`Open on Prime Video`}),ce=(d||v||p||h)&&M(`div`,{className:`overlay`,children:v?E(k,{children:[v,M(`button`,{className:`login-button`,onClick:F,children:`Retry`}),ie]}):p?E(k,{children:[j?`Allow popups for this page to sign in.`:`Sign in to Prime Video to watch.`,M(`button`,{className:`login-button`,onClick:re,disabled:D,children:D?`Finish signing in the window...`:`Sign in to Prime Video`})]}):h?E(k,{children:[`Prime Video offers this episode only to rent or buy here.`,ie]}):M(`div`,{className:`loading-spinner`,role:`status`,"aria-label":`Loading`})});return E(`div`,{css:Qo,children:[n!==`detecting`&&M(Bo,{title:t,remote:b,children:M(`iframe`,{ref:s,className:`pv-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`},`${n}-${w}`)}),ce]})},es=({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`})),ts=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 button is not on the page: ${e}`),{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}))},ns=({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 option ${i} is not in the menu: ${e}`),{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}))},rs=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}))},is=`stub:pictureinpicturerefused`,as=({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},os=`[data-testid="track-selection-button"]`,ss=`[data-testid="audio-text-track-menu"]`,cs=`[data-testid="player-settings-menu-button"]`,ls=`.timeline-slider`,us=`[role="menu"]`,ds=`[role="menuitemradio"]`,fs=1e4,ps=2e3,ms=2e4,hs=5e3,gs=100,_s=/^(off|none|disabled)$/i,vs={button:os,open:ss,menu:ss,section:us,option:ds,timeout:fs},ys={button:cs,open:`${cs}[aria-expanded="true"]`,menu:`:has(> ${cs}) + [role="menu"]`,section:`${us}:has(${ds})`,option:ds,timeout:ps},bs={audio:{...vs,sectionIndex:0},subtitles:{...vs,sectionIndex:1},quality:{...ys,sectionIndex:0}},xs=e=>new Promise(t=>setTimeout(t,e)),Ss=()=>!1,Y=e=>{if(e())throw Error(`Crunchyroll track operation cancelled`)},Cs=e=>e.replace(/\s+/g,` `).trim(),ws=(e,t)=>{let n=[...new Map(t.map(e=>({...e,label:Cs(e.label)})).filter(e=>e.label).map(e=>[e.id,e])).values()],r=n.find(e=>e.selected);if(!r&&e!==`quality`)return;let i=e===`subtitles`?n.find(e=>_s.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||r===i?null:r.id,...i?{offLabel:i.label}:{}}},Ts=async(e,{button:t,open:n,timeout:r},i)=>{Y(i);let a=e.locator(n);if(await a.exists({timeout:1e3})){Y(i);return}Y(i),await e.evaluate(ts,{button:t,timeout:r});let o=Date.now()+r;for(;Date.now()<o;){if(Y(i),await a.exists({timeout:1e3}))return;await xs(gs)}throw Error(`Crunchyroll menu did not open: ${t}`)},Es=async(e,t,n)=>{Y(n);let r=await e.evaluate(es,bs[t]);Y(n);let i=r.map((e,t)=>({...e,label:Cs(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}`}})},Ds=async(e,t,n)=>ws(t,await Es(e,t,n)),Os=async(e,t)=>{try{return await e.locator(cs).exists({timeout:1e3})?(await Ts(e,bs.quality,t),await Ds(e,`quality`,t)):void 0}catch(e){if(t())throw e;return}},ks=async(e,t=Ss)=>{await Ts(e,bs.audio,t);let[n,r]=await Promise.all([Ds(e,`audio`,t),Ds(e,`subtitles`,t)]);return{audio:n,subtitles:r,quality:await Os(e,t)}},As=async(e,t,n,r)=>(await Es(e,t,r)).find(e=>n===null?_s.test(e.label):e.id===n)?.index??-1,js=async(e,t,n,r)=>{let i=Date.now()+ms;for(;Date.now()<i;){Y(r),await Ts(e,bs[t],r);let i=(await Es(e,t,r)).find(e=>e.selected);if(i&&(n===null?_s.test(i.label):i.id===n))return;await xs(gs)}throw Error(`Crunchyroll did not apply the ${t} option`)},Ms=(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))},Ns=e=>({currentTime:e.currentTime,paused:e.paused,playbackRate:e.playbackRate}),Ps=(e,t)=>e.evaluate(rs,{timeline:ls,time:t,timeout:ms}),Fs=async(e,t,n)=>{let r=Date.now()+5e3;for(;Date.now()<r&&(Y(n),!(e.currentSrc!==t||e.readyState<2));)await xs(gs);if(e.currentSrc===t&&e.readyState>=2)return!1;let i=Date.now()+ms;for(;Date.now()<i;){if(Y(n),e.readyState>=2)return!0;await xs(gs)}throw Error(`Crunchyroll playback did not become ready after changing tracks`)},Is=async(e,t,n,r)=>{Y(r),t.playbackRate=n.playbackRate;let i=Ms(n.currentTime,t.duration);Math.abs(t.currentTime-i)>2&&await Ps(e,i);let a=Date.now()+ms;for(;Date.now()<a&&(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2);)Y(r),await xs(gs);if(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2)throw Error(`Crunchyroll playback position was not restored after changing tracks`);Y(r),n.paused?t.pause():await t.play();let o=Date.now()+hs;for(;Date.now()<o&&t.paused!==n.paused;)Y(r),await xs(gs);if(t.paused!==n.paused)throw Error(`Crunchyroll playback state was not restored after changing tracks`)},Ls=async(e,t,n,r,i=Ss)=>{await Ts(e,bs[n],i);let a=await As(e,n,r,i);if(a<0)throw Error(`Crunchyroll ${n} option is no longer available`);Y(i);let o=t.currentSrc,s=Ns(t);return await e.evaluate(ns,{...bs[n],optionIndex:a}),await js(e,n,r,i),n!==`quality`&&await Fs(t,o,i)&&await Is(e,t,s,i),ks(e,i)},Rs=(e,t)=>{Ps(e,t).catch(e=>console.warn(`[cr] timeline seek failed:`,e))},zs=(e,t)=>new Proxy(e,{set(e,n,r,i){return n===`currentTime`&&typeof r==`number`&&Number.isFinite(r)&&Rs(t,r),Reflect.set(e,n,r,i)}});D();var Bs=({title:t,remote:n,frame:r,subtitles:i,audioTracks:a,quality:o,thumbnails:s,chapters:c,pictureInPicture:l,children:u})=>{let d=j(()=>n?e(n):null,[n]);P(()=>d?.hold(),[d]);let f=j(()=>d&&r?zs(d.media,r):null,[d,r]);return M(Ye,{expose:!0,media:f,title:t,subtitles:i,audioTracks:a,quality:o,thumbnails:s,chapters:c,pictureInPicture:l,children:u})},Vs=3e4,Hs=async(e,t)=>{let n=Date.now()+Vs,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`)};D();var Us=`video`,Ws=(e,t,n)=>{let[r,i]=N(null);return P(()=>{if(!e||!t)return;let n=!1;(async()=>e.evaluate(as,{video:Us}))().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(is,r),()=>{n=!0,t.removeEventListener(is,r),i(null)}},[e,t]),j(()=>r&&r===t&&n?{onArmedChange:e=>{n.style.pointerEvents=e?`auto`:``}}:void 0,[r,t,n])},Gs=class extends Error{name=`BifParseError`},Ks=[137,66,73,70,13,10,26,10],qs=64,Js=8,Ys=4294967295,Xs=36e3,Zs=e=>{if(e.byteLength<qs)throw new Gs(`truncated header: ${e.byteLength} bytes`);let t=new DataView(e);if(Ks.some((e,n)=>t.getUint8(n)!==e))throw new Gs(`bad magic`);let n=t.getUint32(12,!0),r=t.getUint32(16,!0)||1e3;if(n>Xs)throw new Gs(`implausible frame count ${n}`);let i=qs+(n+1)*Js;if(i>e.byteLength)throw new Gs(`truncated index: ${n} frames need ${i} bytes, have ${e.byteLength}`);let a=e=>t.getUint32(qs+e*Js,!0),o=e=>t.getUint32(qs+e*Js+4,!0);if(a(n)!==Ys)throw new Gs(`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 Gs(`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 Gs(`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},Qs=(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]},$s=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)}}},ec={waitMs:1e4,fetchMs:15e3,maxBytes:31457280},tc=e=>{let t=new Map,n=!1;return{at:r=>{if(n)return;let i=Qs(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()}}},nc=async e=>{let t=await e.evaluate($s,ec);if(`none`in t)throw Error(`no BIF: ${t.none}${t.detail?` (${t.detail})`:``}`);let n=Zs(t.bytes);if(!n.length)throw Error(`no BIF: the file has no images`);return tc(n)};D();var rc=e=>`https://static.crunchyroll.com/skip-events/production/${e}.json`,ic=e=>{try{return new URL(e).pathname.match(/\/watch\/([A-Z0-9]+)(?:\/|$)/)?.[1]}catch{return}},ac=[[`intro`,`Opening`],[`recap`,`Recap`],[`credits`,`Ending`],[`preview`,`Preview`]],oc=`Episode`,sc=e=>typeof e==`object`&&!!e&&!Array.isArray(e),cc=(e,t)=>{if(!sc(e))return[];let n=t!==void 0&&Number.isFinite(t)&&t>0?t:1/0,r=ac.flatMap(([t,r])=>{let i=e[t];if(!sc(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:oc}),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:oc}),i},lc=new Set([403,404]),uc=async(e,t=ce)=>{let n=await t(rc(e));if(!n.ok){if(await n.body?.cancel().catch(()=>{}),lc.has(n.status))return{};throw Error(`${rc(e)} answered ${n.status}`)}return n.json()},dc=e=>{let[t,n]=N();return P(()=>{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},fc=[],pc=(e,t)=>{let n=ic(e),[r,i]=N(),a=dc(t);return P(()=>{if(!n)return;let e=!1;return uc(n).then(t=>{e||i({episodeId:n,events:t})},t=>{e||console.warn(`[cr] skip events unavailable:`,t)}),()=>{e=!0}},[n]),j(()=>{if(!r||r.episodeId!==n)return fc;let e=cc(r.events,a);return e.length?e:fc},[r,n,a])},mc=async(e,t)=>{for(;!t();){if(await e.locator(`.erc-region-restricted, .erc-blocked-stream [data-t="unavailable-svg"], .erc-not-found`).exists().catch(()=>!1))return!0;await new Promise(e=>setTimeout(e,250))}return!1};D();var hc=`
|
|
101
|
-
html, body {
|
|
102
|
-
margin: 0 !important;
|
|
103
|
-
padding: 0 !important;
|
|
104
|
-
width: 100% !important;
|
|
105
|
-
height: 100% !important;
|
|
106
|
-
background: #000 !important;
|
|
107
|
-
}
|
|
108
|
-
*:not(:has(.video-player-wrapper)):not(.video-player-wrapper):not(.video-player-wrapper *) {
|
|
109
|
-
display: none !important;
|
|
110
|
-
}
|
|
111
|
-
div[data-testid="player-controls-root"] {
|
|
112
|
-
display: none !important;
|
|
113
|
-
}
|
|
114
|
-
.video-player-wrapper,
|
|
115
|
-
.video-player,
|
|
116
|
-
.player-container,
|
|
117
|
-
.video-player-wrapper > *,
|
|
118
|
-
.video-player > *,
|
|
119
|
-
.player-container > * {
|
|
120
|
-
position: absolute !important;
|
|
121
|
-
inset: 0 !important;
|
|
122
|
-
width: 100% !important;
|
|
123
|
-
height: 100% !important;
|
|
124
|
-
z-index: 9999999;
|
|
125
|
-
}
|
|
126
|
-
.video-player-wrapper video,
|
|
127
|
-
.video-player video,
|
|
128
|
-
.player-container video {
|
|
129
|
-
width: 100% !important;
|
|
130
|
-
height: 100% !important;
|
|
131
|
-
object-fit: contain !important;
|
|
132
|
-
}
|
|
133
|
-
.video-player-wrapper *:not(:has(video)):not(video):not(:has(.timeline-slider)):not(.timeline-slider) {
|
|
134
|
-
display: none !important;
|
|
135
|
-
}
|
|
136
|
-
.timeline-container,
|
|
137
|
-
.timeline-container *,
|
|
138
|
-
.timeline-slider {
|
|
139
|
-
opacity: 0 !important;
|
|
140
|
-
pointer-events: none !important;
|
|
141
|
-
}
|
|
142
|
-
/* shows only where the frame takes pointer events: the player's picture in picture control, armed */
|
|
143
|
-
html, html * {
|
|
144
|
-
cursor: pointer !important;
|
|
145
|
-
}
|
|
146
|
-
`,gc=`This episode is not available on Crunchyroll in your region. Try another source.`,_c=3e4,vc=async(e,t)=>{let n=Date.now()+_c;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},yc=v`
|
|
147
|
-
to { transform: rotate(360deg); }
|
|
148
|
-
`,bc=g`
|
|
149
|
-
position: relative;
|
|
150
|
-
width: 100%;
|
|
151
|
-
height: 100%;
|
|
152
|
-
background: #000;
|
|
153
|
-
/* The double-tap-to-fullscreen gesture otherwise word-selects the
|
|
154
|
-
skin's labels/time readouts, flashing them blue. Player chrome isn't
|
|
155
|
-
meant to be selected, so suppress it across the whole player. */
|
|
156
|
-
user-select: none;
|
|
157
|
-
-webkit-user-select: none;
|
|
158
|
-
|
|
159
|
-
.cr-frame {
|
|
160
|
-
position: absolute;
|
|
161
|
-
inset: 0;
|
|
162
|
-
width: 100%;
|
|
163
|
-
height: 100%;
|
|
164
|
-
border: none;
|
|
165
|
-
background: #000;
|
|
166
|
-
/* CR's own chrome is hidden, so the iframe must not swallow clicks -
|
|
167
|
-
taps belong to the videojs gesture layer stacked above it. The one
|
|
168
|
-
exception is picture-in-picture.ts, which lifts this while the
|
|
169
|
-
player's picture in picture control is under the pointer. */
|
|
170
|
-
pointer-events: none;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.overlay {
|
|
174
|
-
position: absolute;
|
|
175
|
-
inset: 0;
|
|
176
|
-
display: flex;
|
|
177
|
-
flex-direction: column;
|
|
178
|
-
align-items: center;
|
|
179
|
-
justify-content: center;
|
|
180
|
-
gap: 1.6rem;
|
|
181
|
-
background: #000;
|
|
182
|
-
font-size: 1.4rem;
|
|
183
|
-
color: rgba(255, 255, 255, 0.8);
|
|
184
|
-
/* Above the skin's own layers (its controls/error dialog top out at
|
|
185
|
-
z-index 20) so the login/loading screen fully covers them. */
|
|
186
|
-
z-index: 30;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.login-button {
|
|
190
|
-
padding: 0.8rem 2rem;
|
|
191
|
-
background: #f47521;
|
|
192
|
-
color: #fff;
|
|
193
|
-
border: none;
|
|
194
|
-
border-radius: 0.4rem;
|
|
195
|
-
font-size: 1.4rem;
|
|
196
|
-
font-weight: 600;
|
|
197
|
-
cursor: pointer;
|
|
198
|
-
|
|
199
|
-
&:hover {
|
|
200
|
-
background: #e0651a;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
&:disabled {
|
|
204
|
-
opacity: 0.6;
|
|
205
|
-
cursor: default;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/* @banou/media-player's own buffering spinner (overlay.tsx), same box and centre, so when the video
|
|
210
|
-
arrives still buffering the player's spinner takes over from this one without a jump */
|
|
211
|
-
.loading-spinner {
|
|
212
|
-
box-sizing: border-box;
|
|
213
|
-
width: calc(4 * var(--mp-unit, 10px));
|
|
214
|
-
height: calc(4 * var(--mp-unit, 10px));
|
|
215
|
-
border-radius: 50%;
|
|
216
|
-
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
217
|
-
border-top-color: #fff;
|
|
218
|
-
animation: ${yc} 0.8s linear infinite;
|
|
219
|
-
}
|
|
220
|
-
`,xc=({url:e,title:t,triedRelays:a=[]})=>{let[o,l]=N(`detecting`),[u,d]=N(null),[f,p]=N(null),[m,h]=N(!0),[g,v]=N(!1),[y,b]=N(),[x,S]=N(!1),C=_(a),[w,T]=N(null),[D,O]=N(0),[ee,te]=N(0),[ne,F]=N(!1),[ce,de]=N(!1),I=_(null),fe=_(null),[pe,L]=N(!1),me=_(!1),[R,z]=N(),[he,ge]=N(0),[_e,ve]=N(),ye=pc(e,w),be=Ws(f,w,u),xe=_(0),Se=_({generation:0,tail:Promise.resolve()}),Ce=_(!0),B=A(()=>{let e=xe.current+1;return xe.current=e,Se.current={generation:e,tail:Promise.resolve()},z(void 0),e},[]),we=A((e,t)=>{if(Se.current.generation!==e)return Promise.reject(Error(`Crunchyroll track operation cancelled`));let n=Se.current,r=n.tail.then(t);return n.tail=r.then(()=>{},()=>{}),r},[]);P(()=>()=>{Ce.current=!1,xe.current+=1},[]),P(()=>{let e=!1;return oe().then(t=>{e||l(t)}),()=>{e=!0}},[]),P(()=>{if(!u||o===`detecting`)return;let e=!1;return se({iframe:u,domains:r,cookies:ue(o),relay:C.current.length?{exclude:C.current}:void 0,permissions:[{category:`evaluation`,reason:`Switch audio, subtitles and quality, seek, show seek thumbnails and open picture in picture`}]}).then(t=>{e||p(t)}).catch(t=>{if(!e){if(h(!1),ie(t))return S(!0);console.error(`Failed to attach Crunchyroll frame`,t),b(t?.message||`Failed to load player`)}}),()=>{e=!0}},[u,o]);let Te=A(()=>{p(null),b(void 0),T(null),B(),v(!1),h(!0),te(e=>e+1)},[B]);P(()=>{if(!f)return;let t=!1,n=!1,r=()=>t||n;h(!0),b(void 0),v(!1),T(null),B();let i=async()=>{o!==`cloud`&&await f.addStyleTag({content:hc});let{isLoggedIn:e}=await Hs(f,r);return r()?null:(ae.record(`crunchyroll`,e?`signed-in`:`signed-out`),e?(o===`cloud`&&await f.addStyleTag({content:hc}),r()?null:vc(f,r)):`signed-out`)};return(async()=>{if(await f.goto(e,{waitUntil:`commit`}),t)return;let o=i(),c=mc(f,r).then(async e=>e?`unavailable`:o),l=await Promise.race([o,c]).finally(()=>{n=!0});if(!t){if(l===`unavailable`){let e=re(f);if(e&&!C.current.includes(e)){C.current=[...C.current,e],Te();return}h(!1),S(!0);return}if(h(!1),l===`signed-out`){v(!0);return}if(!l)throw Error(`The episode did not load a player.`);for(let e of C.current)a.includes(e)||s(e);T(l)}})().catch(e=>{t||(console.error(`Failed to load Crunchyroll player`,e),b(e?.message||`Failed to load player`),h(!1))}),()=>{t=!0}},[f,e,D,o,B,Te]),P(()=>{if(!f||!w)return;let e=B(),t=!1,n=()=>t||!Ce.current||e!==xe.current;return(async()=>{let t,r;for(let i=0;i<5&&!n();i+=1){try{if(r=await we(e,()=>ks(f,n)),t=void 0,n()||(z(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}},[f,w,B,we]),P(()=>{if(!f||!w)return;let e=!1,t;return nc(f).then(n=>{if(e)return n.dispose();t=n,ve(n)},t=>{e||console.warn(`[cr] seek thumbnails unavailable:`,t)}),()=>{e=!0,t?.dispose(),ve(void 0)}},[f,w]);let Ee=xe.current,V=A((e,t)=>{if(!f||!w)return Promise.reject(Error(`Crunchyroll player is not ready`));let n=()=>!Ce.current||Ee!==xe.current;return ge(e=>e+1),we(Ee,async()=>{try{let r=await Ls(f,w,e,t,n);if(n())throw Error(`Crunchyroll track operation cancelled`);z(r)}catch(e){if(!n())try{let e=await ks(f,n);n()||z(e)}catch{}throw e}}).finally(()=>ge(e=>e-1))},[f,w,we,Ee]),H=j(()=>R?.subtitles&&{selection:{...R.subtitles,select:e=>V(`subtitles`,e)}},[R?.subtitles,V]),De=j(()=>R?.audio&&{selection:{...R.audio,select:e=>V(`audio`,e)}},[R?.audio,V]),Oe=j(()=>R?.quality&&{selection:{...R.quality,select:e=>V(`quality`,e)}},[R?.quality,V]),ke=j(()=>{let e=e=>e&&{ids:e.options.filter(e=>!e.disabled).map(e=>e.id),selected:e.selectedId};return{subtitles:e(R?.subtitles),audio:e(R?.audio),busy:he>0}},[R,he]);P(()=>n(ke,(e,t)=>{V(e,t).catch(()=>{})}),[ke,V]);let Ae=A(()=>{if(I.current!==null)return;let e=globalThis.open(c,`_blank`,`width=500,height=700`);if(!e){de(!0),h(!1);return}de(!1),F(!0),fe.current=e;let t=setInterval(()=>{e.closed&&(clearInterval(t),I.current===t&&(I.current=null),fe.current===e&&(fe.current=null),F(!1),O(e=>e+1))},500);I.current=t},[]),je=A(()=>{if(me.current)return;me.current=!0;let e=le({url:c,domains:r,isSignedIn:i});de(!1),L(!0),e.then(e=>{if(Ce.current){if(e===`blocked`){de(!0);return}if(e===`unsupported`){b(`The Crunchyroll sign-in window could not be opened here.`);return}if(e===`authed`){Te();return}v(!1),h(!0),O(e=>e+1)}},e=>{Ce.current&&(console.error(`Crunchyroll sign-in window failed`,e),b(e?.message||`The sign-in window failed`))}).finally(()=>{me.current=!1,Ce.current&&L(!1)})},[Te]);P(()=>()=>{I.current!==null&&(clearInterval(I.current),I.current=null)},[]),P(()=>{I.current!==null&&(clearInterval(I.current),I.current=null,F(!1)),de(!1)},[e]);let Me=A(()=>{fe.current!==null&&(fe.current.close(),fe.current=null),I.current!==null&&(clearInterval(I.current),I.current=null),de(!1),F(!1),Te()},[Te]),Ne=(m||y||ce||g||x)&&E(`div`,{className:`overlay`,children:[x&&gc,g&&!y&&!ce&&E(k,{children:[`Sign in to Crunchyroll to watch.`,o===`extension`?M(`button`,{className:`login-button`,onClick:Ae,disabled:ne,children:ne?`Finish signing in the popup...`:`Open Crunchyroll Login Page`}):M(`button`,{className:`login-button`,onClick:je,disabled:pe,children:pe?`Finish signing in the window...`:`Sign in to Crunchyroll`})]}),ce&&!y&&E(k,{children:[`The login popup was blocked. Allow popups for this page and try again.`,M(`button`,{className:`login-button`,onClick:o===`extension`?Ae:je,children:`Open Crunchyroll Login Page`})]}),y&&E(k,{children:[y,M(`button`,{className:`login-button`,onClick:Me,children:`Retry`})]}),m&&!y&&!g&&M(`div`,{className:`loading-spinner`,role:`status`,"aria-label":`Loading`})]});return E(`div`,{css:bc,children:[o!==`detecting`&&M(Bs,{title:t,remote:w,frame:f,subtitles:H,audioTracks:De,quality:Oe,thumbnails:_e,chapters:ye,pictureInPicture:be,children:M(`iframe`,{ref:d,className:`cr-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`},`${o}-${ee}`)}),Ne]})},X=e=>e,Z=X(({className:e,children:t})=>M(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,fill:`none`,"aria-hidden":`true`,className:e,children:t})),Sc=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Cc=X(({className:e})=>E(Z,{className:e,children:[M(`rect`,{width:5,height:14,x:2,y:2,fill:`currentColor`,rx:1.75}),M(`rect`,{width:5,height:14,x:11,y:2,fill:`currentColor`,rx:1.75})]})),wc=X(({className:e})=>E(Z,{className:e,children:[M(`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`}),M(`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`})]})),Tc=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Ec=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Dc=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Oc=X(({className:e})=>E(Z,{className:e,children:[M(`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`}),M(`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`})]})),kc=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Ac=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),jc=X(({className:e})=>E(Z,{className:e,children:[M(`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`}),M(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),M(`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`})]})),Mc=X(({className:e})=>E(Z,{className:e,children:[M(`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`}),M(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),M(`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`})]})),Nc=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Pc=X(({className:e})=>E(Z,{className:e,children:[M(`rect`,{width:16,height:12,x:1,y:3,stroke:`currentColor`,strokeWidth:2,rx:3}),M(`rect`,{width:3,height:2,x:3,y:8,fill:`currentColor`,rx:1}),M(`rect`,{width:2,height:2,x:13,y:8,fill:`currentColor`,rx:1}),M(`rect`,{width:4,height:2,x:11,y:11,fill:`currentColor`,rx:1}),M(`rect`,{width:5,height:2,x:7,y:8,fill:`currentColor`,rx:1}),M(`rect`,{width:7,height:2,x:3,y:11,fill:`currentColor`,rx:1})]})),Fc=X(({className:e})=>M(Z,{className:e,children:E(`g`,{fill:`currentColor`,children:[M(`rect`,{width:2,height:5,x:8,y:.5,opacity:.5,rx:1,children:M(`animate`,{attributeName:`opacity`,begin:`0s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:2,height:5,x:12.243,y:2.257,opacity:.45,rx:1,transform:`rotate(45 13.243 4.757)`,children:M(`animate`,{attributeName:`opacity`,begin:`0.125s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:5,height:2,x:12.5,y:8,opacity:.4,rx:1,children:M(`animate`,{attributeName:`opacity`,begin:`0.25s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:5,height:2,x:10.743,y:12.243,opacity:.35,rx:1,transform:`rotate(45 13.243 13.243)`,children:M(`animate`,{attributeName:`opacity`,begin:`0.375s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:2,height:5,x:8,y:12.5,opacity:.3,rx:1,children:M(`animate`,{attributeName:`opacity`,begin:`0.5s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:2,height:5,x:3.757,y:10.743,opacity:.25,rx:1,transform:`rotate(45 4.757 13.243)`,children:M(`animate`,{attributeName:`opacity`,begin:`0.625s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:5,height:2,x:.5,y:8,opacity:.15,rx:1,children:M(`animate`,{attributeName:`opacity`,begin:`0.75s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),M(`rect`,{width:5,height:2,x:2.257,y:3.757,opacity:.1,rx:1,transform:`rotate(45 4.757 4.757)`,children:M(`animate`,{attributeName:`opacity`,begin:`0.875s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})})]})})),Ic=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Lc=X(({className:e})=>M(Z,{className:e,children:M(`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`})})),Rc=X(({className:e})=>M(Z,{className:e,children:M(`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`})}));D();var zc=10,Q=e=>e,Bc=Q(Da.Root),Vc=Q(ba),Hc=Q(Fa.Root),Uc=Q(ya.Popup),Wc=Q(ya.Title),Gc=Q(ya.Close),Kc=Q(Fa.Description),qc=Q(Io.Provider),Jc=Q(Io.Root),Yc=Q(Io.Trigger),Xc=Q(Io.Popup),Zc=Q(no.Root),Qc=Q(no.Trigger),$c=Q(no.Popup),el=Q(Ka),tl=Q(ro),nl=Q(Wa),rl=Q(Ga),il=Q(Ia),al=Q(qa),ol=Q(xo.Value),sl=Q(wo.Root),cl=Q(_o.Track),ll=Q(_o.Fill),ul=Q(_o.Buffer),dl=Q(_o.Thumb),fl=Q(_o.Value),pl=Q(zo.Root),$=Q(Ha),ml=Q(Ra),hl=Q(Me),gl=({className:e,...t})=>M(`button`,{type:`button`,className:`media-button media-button--subtle media-button--icon${e?` ${e}`:``}`,...t}),_l=({selection:e,icon:t})=>{let[n,r]=N(!1),[i,a]=N(!1),[o,s]=N(!1);P(()=>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 E(Zc,{open:n,onOpenChange:e=>r(e),children:[M(Qc,{render:M(gl,{className:`media-button--menu${o?` media-button--error`:``}`,"aria-label":e.label}),children:t}),M($c,{className:`media-surface media-popover media-popover--menu`,children:E(`div`,{className:`stub-menu`,role:`menu`,"aria-label":e.label,children:[M(`div`,{className:`stub-menu__heading`,children:e.label}),c.map(t=>{let n=t.id===e.selectedId;return E(`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:[M(`span`,{className:`stub-menu__check`,children:n?M(Rc,{className:`media-icon`}):null}),M(`span`,{className:`stub-menu__label`,children:t.label}),`description`in t&&t.description?M(`span`,{className:`stub-menu__description`,children:t.description}):null]},t.id??`__off__`)})]})})]})},vl=()=>E(Zc,{openOnHover:!0,delay:200,closeDelay:100,side:`top`,children:[M(Qc,{render:E(nl,{className:`media-button--mute`,render:M(gl,{}),children:[M(Ec,{className:`media-icon media-icon--volume-off`}),M(Dc,{className:`media-icon media-icon--volume-low`}),M(Oc,{className:`media-icon media-icon--volume-high`})]})}),M($c,{className:`media-surface media-popover media-popover--volume`,children:E(pl,{className:`media-slider`,orientation:`vertical`,thumbAlignment:`edge`,children:[M(cl,{className:`media-slider__track`,children:M(ll,{className:`media-slider__fill`})}),M(dl,{className:`media-slider__thumb media-slider__thumb--persistent`})]})})]}),yl=({capabilities:e,children:t,className:n,...r})=>E(hl,{className:`media-default-skin media-default-skin--video${n?` ${n}`:``}`,...r,children:[t,M(Vc,{render:e=>M(`div`,{...e,className:`media-buffering-indicator`,children:M(`div`,{className:`media-surface`,children:M(Fc,{className:`media-icon`})})})}),M(Hc,{children:M(Uc,{className:`media-error`,children:E(`div`,{className:`media-error__dialog media-surface`,children:[E(`div`,{className:`media-error__content`,children:[M(Wc,{className:`media-error__title`,children:`Something went wrong.`}),M(Kc,{className:`media-error__description`})]}),M(`div`,{className:`media-error__actions`,children:M(Gc,{className:`media-button media-button--primary`,children:`OK`})})]})})}),M(Bc,{className:`media-surface media-controls`,children:E(qc,{children:[E(`div`,{className:`media-button-group`,children:[E(Jc,{side:`top`,children:[M(Yc,{render:E(el,{className:`media-button--play`,render:M(gl,{}),children:[M(wc,{className:`media-icon media-icon--restart`}),M(Sc,{className:`media-icon media-icon--play`}),M(Cc,{className:`media-icon media-icon--pause`})]})}),M(Xc,{className:`media-surface media-tooltip`})]}),E(Jc,{side:`top`,children:[M(Yc,{render:M(tl,{seconds:-10,className:`media-button--seek`,render:M(gl,{}),children:E(`span`,{className:`media-icon__container`,children:[M(Tc,{className:`media-icon media-icon--seek media-icon--flipped`}),M(`span`,{className:`media-icon__label`,children:zc})]})})}),E(Xc,{className:`media-surface media-tooltip`,children:[`Seek backward `,zc,` seconds`]})]}),E(Jc,{side:`top`,children:[M(Yc,{render:M(tl,{seconds:zc,className:`media-button--seek`,render:M(gl,{}),children:E(`span`,{className:`media-icon__container`,children:[M(Tc,{className:`media-icon media-icon--seek`}),M(`span`,{className:`media-icon__label`,children:zc})]})})}),E(Xc,{className:`media-surface media-tooltip`,children:[`Seek forward `,zc,` seconds`]})]})]}),E(`div`,{className:`media-time-controls`,children:[M(ol,{type:`current`,className:`media-time`}),E(sl,{className:`media-slider`,children:[E(cl,{className:`media-slider__track`,children:[M(ll,{className:`media-slider__fill`}),M(ul,{className:`media-slider__buffer`})]}),M(dl,{className:`media-slider__thumb`}),M(`div`,{className:`media-surface media-thumbnail media-slider__preview`,children:M(fl,{type:`pointer`,className:`media-time media-thumbnail__time`})})]}),M(ol,{type:`duration`,className:`media-time`})]}),E(`div`,{className:`media-button-group`,children:[E(Jc,{side:`top`,children:[M(Yc,{render:M(al,{className:`media-button--playback-rate`,render:M(gl,{})})}),M(Xc,{className:`media-surface media-tooltip`,children:`Toggle playback rate`})]}),M(vl,{}),e?.subtitles&&M(_l,{selection:e.subtitles,icon:e.subtitles.selectedId?M(Nc,{className:`media-icon`}):M(Pc,{className:`media-icon`})},`subtitles`),e?.audioTracks&&M(_l,{selection:e.audioTracks,icon:M(Ic,{className:`media-icon`})},`audio`),e?.qualityLevels&&M(_l,{selection:e.qualityLevels,icon:M(Lc,{className:`media-icon`})},`quality`),E(Jc,{side:`top`,children:[M(Yc,{render:E(rl,{className:`media-button--pip`,render:M(gl,{}),children:[M(jc,{className:`media-icon media-icon--pip-enter`}),M(Mc,{className:`media-icon media-icon--pip-exit`})]})}),M(Xc,{className:`media-surface media-tooltip`})]}),E(Jc,{side:`top`,children:[M(Yc,{render:E(il,{className:`media-button--fullscreen`,render:M(gl,{}),children:[M(kc,{className:`media-icon media-icon--fullscreen-enter`}),M(Ac,{className:`media-icon media-icon--fullscreen-exit`})]})}),M(Xc,{className:`media-surface media-tooltip`})]})]})]})}),M(`div`,{className:`media-overlay`}),M($,{keys:`Space`,action:`togglePaused`}),M($,{keys:`k`,action:`togglePaused`}),M($,{keys:`m`,action:`toggleMuted`}),M($,{keys:`f`,action:`toggleFullscreen`}),M($,{keys:`i`,action:`togglePictureInPicture`}),M($,{keys:`ArrowRight`,action:`seekStep`,value:5}),M($,{keys:`ArrowLeft`,action:`seekStep`,value:-5}),M($,{keys:`l`,action:`seekStep`,value:10}),M($,{keys:`j`,action:`seekStep`,value:-10}),M($,{keys:`ArrowUp`,action:`volumeStep`,value:.05}),M($,{keys:`ArrowDown`,action:`volumeStep`,value:-.05}),M($,{keys:`0-9`,action:`seekToPercent`}),M($,{keys:`Home`,action:`seekToPercent`,value:0}),M($,{keys:`End`,action:`seekToPercent`,value:100}),M($,{keys:`>`,action:`speedUp`}),M($,{keys:`<`,action:`speedDown`}),M(ml,{type:`tap`,action:`togglePaused`,pointer:`mouse`,region:`center`}),M(ml,{type:`tap`,action:`toggleControls`,pointer:`touch`}),M(ml,{type:`doubletap`,action:`seekStep`,value:-10,region:`left`}),M(ml,{type:`doubletap`,action:`toggleFullscreen`,region:`center`}),M(ml,{type:`doubletap`,action:`seekStep`,value:10,region:`right`})]});D();var{Provider:bl}=Ue({features:We}),xl=e=>`media`in e?e:{media:e},Sl=({remote:t,frame:n,adapter:r})=>{let i=ze();return P(()=>{if(!i||!t||!n)return;let a=e(t),o=r?r(a.media,n):a.media;if(!o)return;let s=xl(o),c=a.hold();i(s.media);let l=nt(s.media);return()=>{l(),c(),i(null),s.dispose?.()}},[t,n,r,i]),null},Cl=g`
|
|
221
|
-
position: absolute;
|
|
222
|
-
inset: 0;
|
|
223
|
-
border-radius: 0.8rem;
|
|
224
|
-
background: transparent !important;
|
|
225
|
-
&.media-default-skin--video {
|
|
226
|
-
background: transparent !important;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.media-popover--menu {
|
|
230
|
-
padding: 0.4rem;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* The track menu is stub's own markup, so it carries a stub prefix rather than a media one.
|
|
235
|
-
*
|
|
236
|
-
* It was named \`media-menu\` when the skin had no menu of its own. videojs beta.26 added one, and
|
|
237
|
-
* upstream's nested \`.media-default-skin .media-menu .media-menu__item\` is specificity (0,3,0)
|
|
238
|
-
* against this file's (0,2,0), so it silently took over padding, gap, cursor and justification the
|
|
239
|
-
* moment the dependency moved. A prefix upstream will never mint is the only durable fix; matching
|
|
240
|
-
* their specificity would just move the race to insertion order.
|
|
241
|
-
*/
|
|
242
|
-
.stub-menu {
|
|
243
|
-
display: flex;
|
|
244
|
-
flex-direction: column;
|
|
245
|
-
min-width: 18rem;
|
|
246
|
-
max-height: 32rem;
|
|
247
|
-
overflow-y: auto;
|
|
248
|
-
}
|
|
249
|
-
.stub-menu__heading {
|
|
250
|
-
padding: 0.6rem 1rem 0.4rem;
|
|
251
|
-
font-size: 1.1rem;
|
|
252
|
-
font-weight: 600;
|
|
253
|
-
letter-spacing: 0.04em;
|
|
254
|
-
text-transform: uppercase;
|
|
255
|
-
opacity: 0.6;
|
|
256
|
-
}
|
|
257
|
-
.stub-menu__item {
|
|
258
|
-
display: flex;
|
|
259
|
-
align-items: center;
|
|
260
|
-
gap: 0.6rem;
|
|
261
|
-
width: 100%;
|
|
262
|
-
padding: 0.6rem 1rem;
|
|
263
|
-
border: none;
|
|
264
|
-
border-radius: 0.4rem;
|
|
265
|
-
background: transparent;
|
|
266
|
-
color: inherit;
|
|
267
|
-
font-size: 1.3rem;
|
|
268
|
-
text-align: left;
|
|
269
|
-
cursor: pointer;
|
|
270
|
-
|
|
271
|
-
&:hover:not(:disabled) {
|
|
272
|
-
background: rgba(255, 255, 255, 0.12);
|
|
273
|
-
}
|
|
274
|
-
&:disabled {
|
|
275
|
-
opacity: 0.5;
|
|
276
|
-
cursor: default;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
.stub-menu__check {
|
|
280
|
-
display: inline-flex;
|
|
281
|
-
width: 1.6rem;
|
|
282
|
-
flex: none;
|
|
283
|
-
}
|
|
284
|
-
.stub-menu__label {
|
|
285
|
-
flex: 1;
|
|
286
|
-
}
|
|
287
|
-
.stub-menu__description {
|
|
288
|
-
opacity: 0.6;
|
|
289
|
-
font-size: 1.1rem;
|
|
290
|
-
}
|
|
291
|
-
.media-button--error {
|
|
292
|
-
color: #f66;
|
|
293
|
-
}
|
|
294
|
-
`,wl=({remote:e,frame:t,adapter:n,capabilities:r,children:i})=>E(bl,{children:[M(Sl,{remote:e,frame:t,adapter:n}),M(yl,{capabilities:r,css:Cl,children:i})]}),Tl=`[data-uia="timeline"]`,El=`[data-uia="video-canvas"]`,Dl=`[data-uia="player"]`,Ol=`Seeks the video to the point you pick on the timeline.`,kl=`Reveals the player controls so the timeline can be used.`,Al=140,jl=2,Ml=12e3,Nl=26,Pl=110,Fl={"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"]`},Il=e=>new Promise(t=>setTimeout(t,e)),Ll=e=>e<0?0:e>1?1:e,Rl=0,zl=()=>{let e=Rl*1.1;return Rl++,{x:.5+Math.cos(e)*.05,y:.5+Math.sin(e)*.05}},Bl=(e,t)=>{let n=null,r,i,a=!1,o=async()=>{if(!a){a=!0;try{await Promise.all([t.locator(El).ensure(`hover`,{reason:kl}),t.locator(Dl).ensure(`hover`,{reason:kl}),t.locator(Tl).ensure(`click`,{reason:Ol})])}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)<jl&&(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=Ll(n/r);o();let a=t.locator(Tl),s=e.paused===!0;if(s)try{await e.play()}catch{}let c=!1;for(let e=0;e<Nl;e++){if(e%2==0&&(await t.locator(El).hover({relativePosition:zl(),reason:kl}).catch(()=>{}),await t.locator(Dl).hover({relativePosition:zl(),reason:kl}).catch(()=>{})),await a.exists().catch(()=>!1)){c=!0;break}await Il(Pl)}if(!c){let n=await Promise.all(Object.entries(Fl).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:Ol}).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))},Al),i&&clearTimeout(i),i=setTimeout(()=>{n=null},Ml),!0):Reflect.set(e,t,a,o)}}),dispose:()=>{e.removeEventListener(`timeupdate`,s),r&&clearTimeout(r),i&&clearTimeout(i)}}},Vl=({remote:e,frame:t,capabilities:n,children:r})=>M(wl,{remote:e,frame:t,adapter:Bl,capabilities:n,children:r});D();var Hl=[`netflix.com`,`www.netflix.com`,`nflxvideo.net`,`nflxso.net`,`nflxext.com`,`nflximg.net`,`assets.nflxext.com`],Ul=`https://www.netflix.com/login`,Wl=`
|
|
295
|
-
html, body {
|
|
296
|
-
margin: 0 !important;
|
|
297
|
-
padding: 0 !important;
|
|
298
|
-
width: 100% !important;
|
|
299
|
-
height: 100% !important;
|
|
300
|
-
overflow: hidden !important;
|
|
301
|
-
background: #000 !important;
|
|
302
|
-
}
|
|
303
|
-
/* Truly-unwanted chrome - collapse it entirely. */
|
|
304
|
-
.watch-video--evidence-overlay-container,
|
|
305
|
-
.watch-video--skip-content,
|
|
306
|
-
.watch-video--nextEpisode-seamless-button,
|
|
307
|
-
.watch-video--back-container,
|
|
308
|
-
[data-uia="player-back-to-browse"],
|
|
309
|
-
[data-uia="control-nav-back"],
|
|
310
|
-
[data-uia="control-flag"] {
|
|
311
|
-
display: none !important;
|
|
312
|
-
pointer-events: none !important;
|
|
313
|
-
}
|
|
314
|
-
/* Keep the controls bar in LAYOUT (so the seek adapter can locate + click the
|
|
315
|
-
[data-uia="timeline"] scrubber) but invisible and inert to real taps. NEVER
|
|
316
|
-
display:none here, or the scrubber loses its box and the seek no-ops - mirrors
|
|
317
|
-
Crunchyroll's opacity:0 timeline trick. The skin draws the visible controls. */
|
|
318
|
-
[data-uia="controls-standard"],
|
|
319
|
-
.watch-video--bottom-controls-container,
|
|
320
|
-
.PlayerControlsNeo__layout,
|
|
321
|
-
.PlayerControlsNeo__core-controls,
|
|
322
|
-
.PlayerControlsNeo__button-control-row {
|
|
323
|
-
opacity: 0 !important;
|
|
324
|
-
pointer-events: none !important;
|
|
325
|
-
}
|
|
326
|
-
[data-uia="timeline"],
|
|
327
|
-
[data-uia="timeline"] * {
|
|
328
|
-
pointer-events: auto !important;
|
|
329
|
-
}
|
|
330
|
-
.watch-video,
|
|
331
|
-
[data-uia="video-canvas"] {
|
|
332
|
-
position: fixed !important;
|
|
333
|
-
inset: 0 !important;
|
|
334
|
-
width: 100% !important;
|
|
335
|
-
height: 100% !important;
|
|
336
|
-
z-index: 9999999 !important;
|
|
337
|
-
}
|
|
338
|
-
.watch-video video,
|
|
339
|
-
[data-uia="video-canvas"] video {
|
|
340
|
-
width: 100% !important;
|
|
341
|
-
height: 100% !important;
|
|
342
|
-
object-fit: contain !important;
|
|
343
|
-
}
|
|
344
|
-
`,Gl=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`)},Kl=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},ql=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},Jl=g`
|
|
345
|
-
position: relative;
|
|
346
|
-
width: 100%;
|
|
347
|
-
height: 100%;
|
|
348
|
-
background: #000;
|
|
349
|
-
user-select: none;
|
|
350
|
-
-webkit-user-select: none;
|
|
351
|
-
|
|
352
|
-
.nf-frame {
|
|
353
|
-
position: absolute;
|
|
354
|
-
inset: 0;
|
|
355
|
-
width: 100%;
|
|
356
|
-
height: 100%;
|
|
357
|
-
border: none;
|
|
358
|
-
background: #000;
|
|
359
|
-
/* Netflix's own chrome is hidden, so the iframe must not swallow taps -
|
|
360
|
-
they belong to the skin's gesture layer stacked above it. */
|
|
361
|
-
pointer-events: none;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.overlay {
|
|
365
|
-
position: absolute;
|
|
366
|
-
inset: 0;
|
|
367
|
-
display: flex;
|
|
368
|
-
flex-direction: column;
|
|
369
|
-
align-items: center;
|
|
370
|
-
justify-content: center;
|
|
371
|
-
gap: 1.6rem;
|
|
372
|
-
background: #000;
|
|
373
|
-
font-size: 1.4rem;
|
|
374
|
-
color: rgba(255, 255, 255, 0.8);
|
|
375
|
-
z-index: 30;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
.login-button {
|
|
379
|
-
padding: 0.8rem 2rem;
|
|
380
|
-
background: #e50914;
|
|
381
|
-
color: #fff;
|
|
382
|
-
border: none;
|
|
383
|
-
border-radius: 0.4rem;
|
|
384
|
-
font-size: 1.4rem;
|
|
385
|
-
font-weight: 600;
|
|
386
|
-
cursor: pointer;
|
|
387
|
-
|
|
388
|
-
&:hover {
|
|
389
|
-
background: #c11119;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
`,Yl={cr:xc,nf:({url:e})=>{let[t,n]=N(null),[r,i]=N(null),[a,o]=N(!0),[s,c]=N(!1),[l,u]=N(),[d,f]=N(null),[p,m]=N(0);P(()=>{if(!t)return;let e=!1;return(async()=>{for(let n=0;!e;n++)try{let n=await se({iframe:t,domains:Hl,cookies:`native`});if(e)return;i(n);return}catch(t){if(e)return;if(!de()){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]),P(()=>{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 Gl(()=>r.addStyleTag({content:Wl})),t)return;o(!1);let i=await Kl(r);if(t)return;if(!i){c(!0);return}let a=await ql(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=A(()=>{let e=globalThis.open(Ul,`_blank`,`width=500,height=700`);if(!e)return;let t=setInterval(()=>{e.closed&&(clearInterval(t),m(e=>e+1))},500)},[]);return E(`div`,{css:Jl,children:[M(Vl,{remote:d,frame:r,children:M(`iframe`,{ref:n,className:`nf-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`})}),(s||l||a)&&E(`div`,{className:`overlay`,children:[s&&E(k,{children:[`Sign in to Netflix to watch.`,M(`button`,{className:`login-button`,onClick:h,children:`Open Netflix Login Page`})]}),l&&!s&&l,a&&!l&&!s&&`Loading Netflix player...`]})]})},amazon:$o},Xl=e=>Yl[e];D();var Zl=new URLSearchParams(globalThis.location.search),Ql=Zl.get(`mediaUri`),$l=Zl.get(`episodeUri`),eu=Zl.get(`sourceUri`),tu=Zl.get(`url`),nu=t(Zl),ru=eu?f(eu).origin:void 0,iu=ru?Xl(ru):void 0;C(M(()=>{let[e,t]=N();return P(()=>d(t),[]),!Ql||!$l||!eu||!tu||!iu?M(`div`,{children:`Unsupported or missing parameters`}):M(iu,{url:tu,mediaUri:Ql,episodeUri:$l,sourceUri:eu,title:e,triedRelays:nu})},{}),document.getElementById(`app`));
|