PageSourceSearch

https://theresatruong.ca/_next/static/chunks/67760-5cae86cdebc0b8ff.js?dpl=dpl_CR8xwLwwooYzgX8uaALa4Zrif5W1

js theresatruong.ca collected 2026-10-09 21:42:47 UTC 34,594 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[67760],{324752:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(695155),l=a(212115),r=a(306415),s=a(140980);let i=l.forwardRef(({className:e,size:t="default",variant:a="scale","aria-label":l,"aria-labelledby":i,"aria-valuetext":o,...c},u)=>{let d="media"===a;return(0,n.jsxs)(r.bL,{ref:u,className:(0,s.cn)("group/slider relative flex w-full touch-none select-none items-center",d?"h-4":"lg"===t?"h-11":"h-7",e),...c,children:[(0,n.jsx)(r.CC,{className:(0,s.cn)("relative w-full grow overflow-hidden rounded-full",d?"h-1 bg-[#e7e2dc] transition-[height] duration-150 group-hover/slider:h-1.5 group-focus-within/slider:h-1.5 dark:bg-[#2f3540]":(0,s.cn)("question-scale-track border border-[#ded8d1]/70 bg-[#ece8e3]/90 shadow-[inset_0_1px_2px_rgba(26,22,18,0.10)] dark:border-[#343a46]/80 dark:bg-[#282e38]","lg"===t?"h-3":"h-2.5")),children:(0,n.jsx)(r.Q6,{className:(0,s.cn)("absolute h-full rounded-full bg-brand-accent",!d&&"question-scale-range shadow-[inset_0_1px_0_rgba(255,255,255,0.28)]")})}),(0,n.jsx)(r.zi,{"aria-label":l,"aria-labelledby":i,"aria-valuetext":o,className:(0,s.cn)("block rounded-full bg-brand-accent disabled:pointer-events-none disabled:opacity-50",d?"h-3 w-3 border-2 border-white opacity-0 shadow-[0_1px_4px_rgba(26,22,18,0.28)] transition-[opacity,transform] duration-150 group-hover/slider:opacity-100 group-focus-within/slider:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-accent focus-visible:ring-offset-2 active:scale-125 dark:border-[#171b22]":(0,s.cn)("question-scale-thumb border-[3px] border-white shadow-[0_3px_12px_rgba(26,22,18,0.24)] transition-[transform,box-shadow] hover:scale-105 focus-visible:outline-none focus-visible:shadow-[0_0_0_4px_color-mix(in_srgb,var(--brand-accent-app,var(--brand-accent-light))_24%,transparent),0_3px_12px_rgba(26,22,18,0.24)] dark:border-[#f5f5f8]","lg"===t?"h-7 w-7":"h-5 w-5"))})]})});i.displayName=r.bL.displayName},467760:(e,t,a)=>{a.r(t),a.d(t,{VideoPlayer:()=>N});var n=a(695155),l=a(212115),r=a(253114),s=a(74643),i=a(506296),o=a(413545),c=a(20232),u=a(34152),d=a(498817),h=a(22164),p=a(267037),x=a(589363),b=a(541641),m=a(94514),f=a(156058),v=a(832880),g=a(140980),w=a(394537),y=a(769904),k=a(450910),j=a(324752);function N({src:e,poster:t,autoPlay:a=!1,startMuted:E=!1,showInitialUnmutePrompt:C=!1,interactionOnlyControls:S=!1,alwaysShowControls:T=!1,showVolumeSlider:L=!1,initialDurationSeconds:A,className:F,objectFit:$="contain",cropScale:_,onProgress:M,onTimeChange:R,seekToSeconds:q,seekKey:P,onVideoDimensions:I,onEnded:H,onPlayingChange:O,aspectRatio:z="16:9",compact:U=!1,externalLink:D,hideControls:V=!1,onPlaybackError:W,captions:B,chapters:J}){let G,Q=(0,k.c)("video"),X=(0,k.c)("audioPlayer"),{playerRef:K,setPlayerRef:Y}=(0,y.f)(),Z=(0,l.useRef)(null),ee=(0,l.useRef)(null),et=!(0,w.U)("(min-width: 640px)"),ea=U||et,en="number"==typeof A&&Number.isFinite(A)&&A>0?A:0,[el,er]=(0,l.useState)(!1);(0,l.useEffect)(()=>{O?.(el)},[el,O]);let[es,ei]=(0,l.useState)(V||E),[eo,ec]=(0,l.useState)(C),[eu,ed]=(0,l.useState)(1),[eh,ep]=(0,l.useState)(0),[ex,eb]=(0,l.useState)(0),[em,ef]=(0,l.useState)(en),[ev,eg]=(0,l.useState)(!1),[ew,ey]=(0,l.useState)(null),[ek,ej]=(0,l.useState)(!S),eN=(0,l.useMemo)(()=>{if(!J?.length||!Number.isFinite(em)||em<=0)return[];let e=J.filter(e=>Number.isFinite(e.start)&&e.start<em).sort((e,t)=>e.start-t.start);return e.length<2?[]:e.map((t,a)=>({...t,start:0===a?0:t.start,end:a===e.length-1?em:e[a+1].start}))},[J,em]),eE=(0,l.useMemo)(()=>{if(!eN.length)return null;let e=eh*em;return eN.find(t=>e>=t.start&&e<t.end)??eN[0]},[eN,eh,em]),eC=(0,l.useMemo)(()=>{if(null===ew||!eN.length)return null;let e=ew*em;return eN.find(t=>e>=t.start&&e<t.end)??null},[eN,ew,em]),eS=(0,l.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();t.width<=0||ey(Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)))},[]),[eT,eL]=(0,l.useState)(!1),[eA,eF]=(0,l.useState)(!1),[e$,e_]=(0,l.useState)(!1),[eM,eR]=(0,l.useState)(!1),[eq,eP]=(0,l.useState)(!1),[eI,eH]=(0,l.useState)(!1),[eO,ez]=(0,l.useState)(0),[eU,eD]=(0,l.useState)(0),[eV,eW]=(0,l.useState)(null),[eB,eJ]=(0,l.useState)(1),[eG,eQ]=(0,l.useState)(!1),[eX,eK]=(0,l.useState)("main"),[eY,eZ]=(0,l.useState)([]),[e0,e1]=(0,l.useState)("auto"),[e5,e2]=(0,l.useState)(null),[e3,e6]=(0,l.useState)([]),[e4,e8]=(0,l.useState)("off"),[e9,e7]=(0,l.useState)(""),te=(0,l.useRef)(null),tt=(0,l.useRef)(null),ta=(0,l.useRef)(!1),tn=(0,l.useRef)(0),tl="number"==typeof _&&Number.isFinite(_)&&_>0?_:1,tr="0.75rem",ts="number"==typeof z&&Number.isFinite(z)&&z>0?z:"string"==typeof z?({"16:9":16/9,"9:16":9/16,"4:3":4/3,"1:1":1})[z]:16/9;
1(0,l.useEffect)(()=>{let e=Z.current,t=ee.current;if(!e||!t)return;let a=()=>{e.style.setProperty("--video-settings-max-height",`${Math.max(0,e.clientHeight-t.offsetHeight-16)}px`)};if(a(),"u"<typeof ResizeObserver)return;let n=new ResizeObserver(a);return n.observe(e),n.observe(t),()=>n.disconnect()},[eI,V]);let ti=/(?:\.m3u8|\/playlist\.m3u8)(?:[?#].*)?$/i.test(e),to=ti?12:2,tc=eI&&eU<to,tu=eI&&!tc,td=(0,l.useMemo)(()=>({position:"absolute",inset:0,display:"block",width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",overflow:"hidden",borderRadius:tr,background:"transparent",backfaceVisibility:"hidden",objectFit:$,...ti?{clipPath:`inset(0 round ${tr})`}:{minWidth:"100%",minHeight:"100%",border:0,outline:"none",transform:tl>1?`scale(${tl})`:void 0,transformOrigin:"center center",clipPath:`inset(0.5px round ${tr})`}}),[ti,$,tl,tr]),th=t||((G=e.match(/^(https:\/\/[^/]*\.b-cdn\.net)\/([0-9a-f-]{36})\/playlist\.m3u8/i))?`${G[1]}/${G[2]}/thumbnail.jpg`:null)||eV||void 0,tp=eY.length>1;(0,l.useEffect)(()=>{tt.current&&(clearTimeout(tt.current),tt.current=null),te.current&&(clearTimeout(te.current),te.current=null),ta.current=!1,er(!1),ei(V||E),ec(C),ep(0),eb(0),ef(en),eg(!1),ej(!S),eF(!1),e_(!1),eR(!1),eP(!1),eH(!1),ez(0),eD(0),eW(null),eQ(!1),eK("main"),eZ([]),e1("auto"),e2(null),e6([]),e8("off");let e=K.current;if(e)try{e.currentTime=0}catch{}},[e,a,V,E,C,S,en]),(0,l.useEffect)(()=>()=>{tt.current&&clearTimeout(tt.current),te.current&&clearTimeout(te.current)},[]),(0,l.useEffect)(()=>{if(!eI||eU>=to)return;let e=setTimeout(()=>{eH(!1),eF(!0),eD(e=>e+1),ez(e=>e+1)},ti?Math.min(15e3,3e3+2e3*eU):1e3+1500*eU);return()=>clearTimeout(e)},[eI,eU,to,ti]),(0,l.useEffect)(()=>{if(!a||V||e$)return;let e=setTimeout(()=>eP(!0),2500);return()=>clearTimeout(e)},[e,a,V,e$]),(0,l.useEffect)(()=>{if(t||V||!e||e.includes(".m3u8"))return;let a=document.createElement("video");a.crossOrigin="anonymous",a.muted=!0,a.preload="metadata",a.playsInline=!0,a.src=e;let n=()=>{a.removeAttribute("src"),a.load()};return a.addEventListener("loadeddata",()=>{a.currentTime=.1},{once:!0}),a.addEventListener("seeked",()=>{try{let e=document.createElement("canvas");e.width=a.videoWidth,e.height=a.videoHeight;let t=e.getContext("2d");t&&(t.drawImage(a,0,0),eW(e.toDataURL("image/jpeg",.8)))}catch{}n()},{once:!0}),a.addEventListener("error",()=>n(),{once:!0}),()=>n()},[e,t,V]),(0,l.useEffect)(()=>{let e=Z.current;if(!e)return;let t=0,a=()=>{if(!ti)return!0;let t=e.querySelector("hls-video"),a=t?.nativeEl??t?.shadowRoot?.querySelector("video");return a instanceof HTMLVideoElement&&(a.style.display="block",a.style.width="100%",a.style.height="100%",a.style.minWidth="100%",a.style.minHeight="100%",a.style.maxWidth="100%",a.style.maxHeight="100%",a.style.backgroundColor="transparent",a.style.border="0",a.style.outline="none",a.style.objectFit=$,a.style.transform=tl>1?`scale(${tl})`:"",a.style.transformOrigin="center center",a.style.clipPath=`inset(0.5px round ${tr})`,!0)},n=()=>{t=0,a()||(t=requestAnimationFrame(n))},l=new MutationObserver(()=>{t&&(cancelAnimationFrame(t),t=0),a()||(t=requestAnimationFrame(n))});return l.observe(e,{childList:!0,subtree:!0}),n(),()=>{l.disconnect(),t&&cancelAnimationFrame(t)}},[e,ti,$,tl,tr,eO]),(0,l.useEffect)(()=>{K.current&&(K.current.playbackRate=eB);let e=Z.current?.querySelector("hls-video"),t=e?.nativeEl??e?.shadowRoot?.querySelector("video")??Z.current?.querySelector("video");t&&(t.playbackRate=eB)},[eB]);let tx=(0,l.useCallback)(e=>e&&Number.isFinite(e)?e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)} Mbps`:`${Math.round(e/1e3)} kbps`:null,[]),tb=(0,l.useCallback)(e=>e.height&&Number.isFinite(e.height)?`${e.height}p`:e.width&&Number.isFinite(e.width)?`${e.width}w`:tx(e.bitrate)??"Source",[tx]),tm=(0,l.useCallback)(()=>Z.current?.querySelector("hls-video"),[]),tf=(0,l.useCallback)(e=>{let t=e??tm(),a=t?.api;if(!a||!a.levels.length){eZ([]),e1("auto"),e2(null);return}eZ(a.levels.map((e,t)=>({bitrate:e.bitrate??null,label:tb(e),levelIndex:t,sortHeight:e.height??0})).sort((e,t)=>t.sortHeight!==e.sortHeight?t.sortHeight-e.sortHeight:(t.bitrate??0)!==(e.bitrate??0)?(t.bitrate??0)-(e.bitrate??0):e.levelIndex-t.levelIndex)),e1(a.autoLevelEnabled?"auto":a.manualLevel);let n=a.currentLevel>=0?a.currentLevel:a.nextLevel>=0?a.nextLevel:a.loadLevel>=0?a.loadLevel:null;e2(null!=n&&a.levels[n]?tb(a.levels[n]):null)},[tb,tm]),tv=(0,l.useCallback)(()=>{let e=tm();return e?.nativeEl??e?.shadowRoot?.querySelector("video")??Z.current?.querySelector("video")??null},[tm]),tg=(0,l.useCallback)(e=>e instanceof HTMLVideoElement?e:tv(),[tv]),tw=(0,l.useCallback)(e=>{e&&void 0!==q&&Number.isFinite(q)&&(e.currentTime=Math.max(0,Math.min(q,Number.isFinite(e.duration)?e.duration:q)),Number.isFinite(e.duration)&&e.duration>0&&(ep(e.currentTime/e.duration),R?.(e.currentTime,e.duration)))},[q,R]);(0,l.useEffect)(()=>{tw(tv())},[tw,tv,P]);let ty=(0,l.useCallback)(e=>{e&&e.videoWidth>0&&e.videoHeight>0&&I?.({width:e.videoWidth,height:e.videoHeight})},[I]),tk=(0,l.useCallback)(()=>{let e=tm()?.api;
1if(e&&Array.isArray(e.subtitleTracks)&&e.subtitleTracks.length>0){e6(e.subtitleTracks.map((e,t)=>({value:t,label:e.name||(e.lang?e.lang.toUpperCase():`Subtitles ${t+1}`),lang:e.lang??void 0}))),e8(e.subtitleDisplay&&e.subtitleTrack>=0?e.subtitleTrack:"off");return}let t=tv();if(!t){e6([]),e8("off");return}let a=[],n="off";for(let e=0;e<t.textTracks.length;e++){let l=t.textTracks[e];("subtitles"===l.kind||"captions"===l.kind)&&(a.push({value:e,label:l.label||(l.language?l.language.toUpperCase():`Subtitles ${a.length+1}`),lang:l.language||void 0}),("showing"===l.mode||"hidden"===l.mode)&&(n=e))}e6(a),e8(n)},[tm,tv]),tj=(0,l.useCallback)(e=>{"off"!==e&&(tn.current=e);let t=tm()?.api;if(t&&Array.isArray(t.subtitleTracks)&&t.subtitleTracks.length>0){"off"===e?(t.subtitleDisplay=!1,t.subtitleTrack=-1):(t.subtitleTrack=e,t.subtitleDisplay=!0),e8(e);return}let a=tv();if(a)for(let t=0;t<a.textTracks.length;t++){let n=a.textTracks[t];("subtitles"===n.kind||"captions"===n.kind)&&(n.mode="off"!==e&&t===e?"hidden":"disabled")}e8(e)},[tm,tv]);(0,l.useEffect)(()=>{if("off"===e4)return void e7("");let e=tv();if(!e)return;let t=e.textTracks[e4];if(!t)return;let a=()=>{let e=t.activeCues&&t.activeCues.length>0?t.activeCues[t.activeCues.length-1]:null;e7(e&&"string"==typeof e.text?e.text:"")};return t.addEventListener("cuechange",a),a(),()=>{t.removeEventListener("cuechange",a),e7("")}},[e4,e3,tv,eO]);let tN=e3.length>0,tE="off"!==e4,tC=(0,l.useCallback)(()=>{if(e3.length)if("off"===e4){let e=e3.find(e=>e.value===tn.current);tj(e?e.value:e3[0].value)}else tj("off")},[e3,e4,tj]),tS="off"===e4?"Off":e3.find(e=>e.value===e4)?.label??"On";(0,l.useEffect)(()=>{let e=Z.current;if(!e)return;let t=0,a=null,n=[],l=()=>{n.forEach(e=>e()),n=[],t&&(cancelAnimationFrame(t),t=0)},r=()=>{let e,s,i,o=tm();return o?(a!==o&&(l(),a=o),o.api)?(0===n.length&&(e=o.api,s=o.videoRenditions,i=()=>tf(o),s&&(s.addEventListener("change",i),s.addEventListener("addrendition",i),s.addEventListener("removerendition",i),n.push(()=>{s.removeEventListener("change",i),s.removeEventListener("addrendition",i),s.removeEventListener("removerendition",i)})),e&&(e.on("hlsManifestParsed",i),e.on("hlsLevelsUpdated",i),e.on("hlsLevelSwitched",i),n.push(()=>{e.off("hlsManifestParsed",i),e.off("hlsLevelsUpdated",i),e.off("hlsLevelSwitched",i)}))),tf(o),!0):(t=requestAnimationFrame(r),!0):(eZ([]),e1("auto"),e2(null),!1)};if(r())return()=>l();let s=new MutationObserver(()=>{r()});return s.observe(e,{childList:!0,subtree:!0}),()=>{s.disconnect(),l()}},[tm,e,tf]),(0,l.useEffect)(()=>{eG&&(tf(),tk())},[eG,tf,tk]);let tT=B&&B.length>0?JSON.stringify(B):"";(0,l.useEffect)(()=>{let t=!1,a=null,n=[],l=e=>{let t=tv();if(!t)return!1;for(let a of e){let e=a.srclang;if(!e||t.querySelector(`track[data-caption="${CSS.escape(e)}"]`))continue;/^https?:\/\//i.test(a.src)&&!t.crossOrigin&&(t.crossOrigin="anonymous");let l=document.createElement("track");l.kind="subtitles",l.srclang=e,l.label=a.label||e.toUpperCase(),l.src=a.src,l.dataset.caption=e,t.appendChild(l),n.push(l)}return!0},r=e=>{if(t||0===e.length||l(e))return;let n=0;a=setInterval(()=>{n+=1,(l(e)||n>60)&&(a&&clearInterval(a),a=null)},500)},s=tT?JSON.parse(tT):[],i=/^(https?:\/\/[^/]+)\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\/playlist\.m3u8/i.exec(e??"");if(s.length>0)r(s.map(e=>{var t;return{...e,src:(t=e.src,/^https?:\/\//i.test(t)?`/api/captions?u=${encodeURIComponent(t)}`:t)}}));else if(i){let[,e,a]=i;(async()=>{try{let n=await fetch(`/api/video-captions?videoId=${a}`);if(!n.ok||t)return;let l=await n.json().catch(()=>null),s=Array.isArray(l?.captions)?l.captions:[];r(s.filter(e=>"string"==typeof e.srclang&&e.srclang.length>0).map(t=>({src:`${e}/${a}/captions/${t.srclang}.vtt`,srclang:t.srclang,label:t.label})))}catch{}})()}return()=>{t=!0,a&&clearInterval(a),n.forEach(e=>e.remove())}},[e,tT,tv,eO]),(0,l.useEffect)(()=>{let e=Z.current;if(!e)return;let t=null,a=null,n=null,l=()=>tk(),r=()=>{a&&(a.removeEventListener("addtrack",l),a.removeEventListener("removetrack",l),a.removeEventListener("change",l),a=null)},s=()=>
1{if(n){try{n.off("hlsSubtitleTracksUpdated",l),n.off("hlsSubtitleTrackSwitch",l)}catch{}n=null}},i=()=>{let e=tv();e&&e!==t&&(r(),t=e,(a=e.textTracks).addEventListener("addtrack",l),a.addEventListener("removetrack",l),a.addEventListener("change",l));let i=tm()?.api;i&&i!==n&&(s(),n=i,i.on("hlsSubtitleTracksUpdated",l),i.on("hlsSubtitleTrackSwitch",l)),tk()};i();let o=new MutationObserver(()=>i());return o.observe(e,{childList:!0,subtree:!0}),()=>{o.disconnect(),r(),s()}},[tv,tm,e,tk]);let tL="auto"===e0?e5?`Auto (${e5})`:"Auto":eY.find(e=>e.levelIndex===e0)?.label??"Auto",tA=e=>{if(!e||isNaN(e))return"0:00";let t=Math.floor(e/3600),a=Math.floor(e%3600/60),n=Math.floor(e%60);return t>0?`${t}:${a.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`:`${a}:${n.toString().padStart(2,"0")}`},tF=(0,l.useCallback)(e=>{let t="object"==typeof e&&null!==e&&"name"in e&&"string"==typeof e.name?e.name:null;if("AbortError"!==t){if("NotAllowedError"===t){er(!1),eF(!1);return}if(e instanceof Event){let t=e.target;if(t?.error?.code===MediaError.MEDIA_ERR_ABORTED)return}console.error("[VideoPlayer] Playback error:",e),tt.current&&clearTimeout(tt.current),tt.current=setTimeout(()=>{tt.current=null,eH(!0),eF(!0),W?.()},1200)}},[W]),t$=(0,l.useCallback)(()=>{if(ta.current)return;ta.current=!0;let e=!el,t=tv()??K.current;if(e){e$||e_(!0);try{let e=t?.play();e&&e.catch(tF)}catch(e){tF(e),ta.current=!1;return}}else t?.pause();er(e),setTimeout(()=>{ta.current=!1},150)},[tv,tF,e$,el]),t_=(0,l.useCallback)(e=>{if(ev)return;let t=tg(e.target);if(!t)return;let a=Number.isFinite(t.duration)&&t.duration>0?t.duration:en;if(a>0){ef(e=>e===a?e:a);let e=Math.min(1,t.currentTime/a);ep(e),M?.(100*e),R?.(t.currentTime,a)}},[ev,en,M,R,tg]),tM=(0,l.useCallback)(e=>{let t=tg(e.target);t&&t.buffered.length>0&&Number.isFinite(t.duration)&&t.duration>0&&eb(t.buffered.end(t.buffered.length-1)/t.duration)},[tg]),tR=(0,l.useCallback)(e=>{let t=tg(e.target);ty(t),t&&Number.isFinite(t.duration)&&t.duration>0&&ef(t.duration)},[ty,tg]),tq=(0,l.useCallback)(e=>{let t=tv()??K.current;if(!t)return;let a=Number.isFinite(t.duration)&&t.duration>0?t.duration:em;if(a>0){let n=e*a;t.currentTime=n,M?.(100*e),R?.(n,a)}},[em,tv,M,R]),tP=(0,l.useCallback)(e=>{let t=parseFloat(e.target.value);ep(t),tq(t)},[tq]),tI=(0,l.useCallback)(()=>{eg(!0)},[]),tH=(0,l.useCallback)(e=>{eg(!1),tq(parseFloat(e.target.value))},[tq]),tO=(0,l.useCallback)(()=>{if(0===eu){ed(1),ei(!1),ec(!1);return}ei(e=>(e&&ec(!1),!e))},[eu]),tz=(0,l.useCallback)(e=>{let t=tm(),a=t?.api;if(a){if("auto"===e)a.nextLevel=-1,e1("auto"),tf(t);else{a.nextLevel=e,e1(e);let n=t?.videoRenditions;n&&n.selectedIndex!==e&&(n.selectedIndex=e),e2(eY.find(t=>t.levelIndex===e)?.label??e5)}eQ(!1),eK("main")}},[e5,tm,eY,tf]),tU=(0,l.useCallback)(async()=>{let e=Z.current;if(!e)return;let t=document,a=tv(),n=document.fullscreenElement||t.webkitFullscreenElement,l=/iPhone|iPad|iPod/i.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;try{if(n||a?.webkitDisplayingFullscreen){document.fullscreenElement&&document.exitFullscreen?await document.exitFullscreen():t.webkitFullscreenElement&&t.webkitExitFullscreen?t.webkitExitFullscreen():a?.webkitExitFullscreen?.(),eL(!1);return}if(l&&a?.webkitEnterFullscreen){a.webkitEnterFullscreen(),eL(!0);return}if(e.requestFullscreen)await e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else{if(!a?.webkitEnterFullscreen)return;a.webkitEnterFullscreen()}eL(!0)}catch(e){console.error("[VideoPlayer] Unable to toggle fullscreen:",e)}},[tv]);(0,l.useEffect)(()=>{let e=Z.current;if(!e)return;let t=document,a=()=>{eL(!!(document.fullscreenElement||t.webkitFullscreenElement))},n=()=>eL(!0),l=()=>eL(!1);return document.addEventListener("fullscreenchange",a),document.addEventListener("webkitfullscreenchange",a),e.addEventListener("webkitbeginfullscreen",n,!0),e.addEventListener("webkitendfullscreen",l,!0),()=>{document.removeEventListener("fullscreenchange",a),document.removeEventListener("webkitfullscreenchange",a),e.removeEventListener("webkitbeginfullscreen",n,!0),e.removeEventListener("webkitendfullscreen",l,!0)}},[]);let tD=(0,l.useCallback)(()=>{ej(!0),te.current&&clearTimeout(te.current),el&&!T&&(te.current=setTimeout(()=>{ej(!1)},3e3))},[el,T]),tV=(0,l.useCallback)(()=>{el&&(ej(!1),eQ(!1),eK("main"))},[el]),tW=(0,l.useCallback)(()=>{er(!1),ep(0),e_(!1),eR(!0);let e=tv()??K.current;e&&(e.currentTime=0),H?.()},[tv,H]),tB=T||ek||!el&&(!S||e$);return(0,n.jsx)("div",{className:(0,g.cn)("group w-full min-w-0",F),children:(0,n.jsxs)("div",{ref:Z,className:(0,g.cn)("@container/video relative isolate w-full min-w-0 rounded-xl overflow-hidden [&_video]:block [&_video]:!border-0 [&_video]:!outline-none [&>*]:!bg-transparent","contain"===$?"bg-black":"bg-transparent","string"==typeof z?({"16:9":"aspect-video","9:16":"aspect-[9/16]","4:3":"aspect-[4/3]","1:1":"aspect-square"})[z]:"aspect-video",F),onMouseMove:tD,onMouseEnter:tD,onMouseLeave:tV,onPointerDown:S?tD:void 0,style:{containerType:"inline-size",aspectRatio:ts,clipPath:"border-box","--media-object-fit":$,"--media-object-position":"50% 50%"},children:[(0,n.jsx)(r.default,{ref:Y,className:"react-player",src:e,autoPlay:a||V,muted:es,volume:eu,playbackRate:eB,loop:V,width:"100%",height:"100%",style:td,poster:V?void 0:th,playsInl
1ine:!0,preload:"auto",onTimeUpdate:t_,onDurationChange:tR,onProgress:tM,onEnded:tW,onWaiting:()=>eF(!0),onLoadedMetadata:e=>{tR(e),tw(tg(e.target)),tt.current&&(clearTimeout(tt.current),tt.current=null),eH(!1),eF(!1)},onCanPlay:()=>{ty(tv()),tt.current&&(clearTimeout(tt.current),tt.current=null),eH(!1),eF(!1)},onPlaying:()=>{er(!0),tt.current&&(clearTimeout(tt.current),tt.current=null),eH(!1),eD(0),eF(!1),e_(!0),eR(!1),K.current&&K.current.playbackRate!==eB&&(K.current.playbackRate=eB);let e=Z.current?.querySelector("hls-video"),t=e?.nativeEl??e?.shadowRoot?.querySelector("video")??Z.current?.querySelector("video");t&&t.playbackRate!==eB&&(t.playbackRate=eB)},onPause:()=>er(!1),onStart:()=>e_(!0),onError:tF,config:{hls:{startLevel:-1,capLevelToPlayerSize:!0,maxBufferLength:30,maxMaxBufferLength:60}}},eO),tE&&e9&&!eI&&(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 z-20 flex justify-center px-[6%]",style:{bottom:ea?"15%":"12%"},children:(0,n.jsx)("span",{className:"max-w-[88%] bg-black/75 text-center font-albert font-medium text-white whitespace-pre-line",style:{fontSize:"clamp(11px, 3.4cqw, 21px)",lineHeight:1.35,padding:"0.3em 0.7em",borderRadius:"0.5em"},children:e9})}),C&&eo&&e$&&es&&!eI&&(0,n.jsxs)("button",{type:"button",onPointerDown:e=>e.stopPropagation(),onClick:()=>{ei(!1),ec(!1)},className:"absolute left-3 top-3 z-30 inline-flex items-center gap-2 rounded-full border border-white/40 bg-[#0b3440]/55 px-3.5 py-2 font-albert text-[12px] font-semibold text-white shadow-[0_12px_32px_-12px_rgba(6,28,35,0.8),inset_0_1px_0_rgba(255,255,255,0.3)] backdrop-blur-xl backdrop-saturate-150 transition-all duration-200 hover:scale-[1.02] hover:bg-[#0b3440]/65 active:scale-[0.98] sm:left-4 sm:top-4 sm:px-4 sm:text-[13px]","aria-label":"Turn video sound on",children:[(0,n.jsx)("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-white/15 ring-1 ring-white/20",children:(0,n.jsx)(s.A,{className:"h-3.5 w-3.5"})}),"Tap for sound"]}),!e$&&th&&(0,n.jsx)("div",{className:(0,g.cn)("absolute inset-0 bg-center z-10","contain"===$?"bg-contain bg-no-repeat":"bg-cover"),style:{borderRadius:"inherit",backgroundImage:`url(${th})`,transform:tl>1?`scale(${tl})`:void 0,transformOrigin:"center center"}}),(eA||tc)&&!tu&&!V&&(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-20 bg-black/30",children:(0,n.jsx)(i.A,{className:"w-12 h-12 text-white animate-spin"})}),tu&&(0,n.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center z-20 bg-black/70",children:[(0,n.jsx)(o.A,{className:"w-12 h-12 text-red-400 mb-3"}),(0,n.jsx)("p",{className:"text-white/80 font-medium",children:"Video unavailable"}),(0,n.jsx)("p",{className:"text-white/50 text-sm mt-1",children:"Unable to load video"})]}),!V&&(!a||eM||eq)&&!e$&&!eI&&(0,n.jsx)("button",{type:"button",onClick:t$,"aria-label":X("play"),className:"absolute left-1/2 top-1/2 z-20 -translate-x-1/2 -translate-y-1/2 group/play",children:(0,n.jsx)("div",{className:"w-12 h-12 rounded-full bg-black/50 backdrop-blur-sm group-hover/play:bg-black/60 group-hover/play:scale-105 flex items-center justify-center transition-all shadow-md",children:(0,n.jsx)(c.A,{className:"w-5 h-5 text-white ml-0.5",fill:"currentColor"})})}),!eI&&!V&&(0,n.jsxs)("div",{className:(0,g.cn)("absolute inset-0 transition-opacity duration-300 z-[5]",tB?"opacity-100":"opacity-0 pointer-events-none"),children:[(0,n.jsx)("button",{type:"button",className:"absolute inset-0 w-full h-full cursor-pointer",onClick:t$,"aria-label":X(el?"pause":"play")}),(0,n.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-28 bg-gradient-to-t from-black/60 to-transparent pointer-events-none"}),(0,n.jsxs)("div",{ref:ee,className:(0,g.cn)("absolute bottom-0 left-0 right-0 z-[1]",ea?"px-3 pb-2.5 pt-1":"px-4 pb-3 pt-1"),children:[(0,n.jsxs)("div",{className:"relative h-[3px] mb-2 group/progress hover:h-[5px] transition-all",onMouseMove:eS,onMouseLeave:()=>ey(null),children:[eN.length>0?(0,n.jsx)("div",{className:"absolute inset-0 flex items-stretch gap-[2px]",children:eN.map(e=>{let t=e.end-e.start,a=a=>100*Math.min(1,Math.max(0,(a*em-e.start)/t));return(0,n.jsxs)("div",{style:{flexGrow:t,flexBasis:0},className:(0,g.cn)("relative h-full overflow-hidden rounded-full transition-colors",eC===e?"bg-white/40":"bg-white/20"),children:[(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 bg-white/30",style:{width:`${a(ex)}%`}}),(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 bg-brand-accent",style:{width:`${a(eh)}%`}})]},`${e.start}-${e.title}`)})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"absolute inset-0 bg-white/20 rounded-full"}),(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 bg-white/30 rounded-full",style:{width:`${100*ex}%`}}),(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 bg-brand-accent rounded-full",style:{width:`${100*eh}%`}})]}),eC&&null!==ew&&(0,n.jsxs)("div",{className:"pointer-events-none absolute bottom-full z-10 mb-2.5 max-w-[70%] -translate-x-1/2 truncate rounded-lg bg-black/85 px-2 py-1 font-albert text-[11px] text-white shadow-lg backdrop-blur-sm",style:{left:`clamp(4.5rem, ${100*ew}%, calc(100% - 4.5rem))`},children:[eC.title,(0,n.jsx)("span",{className:"ml-1.5 tabular-nums text-white/50",children:tA(ew*em)})]}),(0,n.jsx)("input",{type:"range","aria-label":X("seek"),"aria-valuetext":X("position",{current:tA(eh*em),total:tA(em)}),min:0,max:.999999,step:"any",value:eh,onChange:tP,onMouseDown:tI,onMouseUp:tH,onTouchStart:tI,onTouchEnd:tH,className:"absolute -inset-y-1.5 inset-x-0 w-full opacity-0 cursor-pointer"}),(0,n.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-[13px] h-[13px] bg-brand-accent rounded-full shadow-sm scale-0 group-hover/progress:scale-100 transition-transform pointer-events-none",style:{left:`calc(${100*eh}% - 6.5px)`}}
1)]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1 @[400px]/video:flex-nowrap",children:[(0,n.jsx)("button",{type:"button",onClick:t$,className:"shrink-0 p-1.5 text-white/90 hover:text-white transition-colors","aria-label":X(el?"pause":"play"),children:el?(0,n.jsx)(u.A,{className:"w-[18px] h-[18px]"}):(0,n.jsx)(c.A,{className:"w-[18px] h-[18px] ml-0.5"})}),(0,n.jsx)("button",{type:"button",onClick:tO,className:"shrink-0 p-1.5 text-white/90 hover:text-white transition-colors","aria-label":X(es||0===eu?"unmute":"mute"),children:es||0===eu?(0,n.jsx)(d.A,{className:"w-[18px] h-[18px]"}):(0,n.jsx)(s.A,{className:"w-[18px] h-[18px]"})}),L&&(0,n.jsx)(j.A,{variant:"media",min:0,max:1,step:.01,value:[es?0:eu],onValueChange:([e])=>{ed(e),ei(0===e),ec(!1)},"aria-label":X("volume"),"aria-valuetext":`${Math.round((es?0:eu)*100)}%`,className:"mx-1 h-8 w-16 shrink-0 @[400px]/video:w-20"}),(0,n.jsxs)("div",{className:(0,g.cn)("order-first w-full shrink-0 whitespace-nowrap text-white/70 font-albert tabular-nums @[400px]/video:order-none @[400px]/video:ml-1 @[400px]/video:w-auto",ea?"text-[11px]":"text-xs"),children:[tA(eh*em),(0,n.jsx)("span",{className:"text-white/40 mx-0.5",children:"/"}),tA(em)]}),eE&&!ea&&(0,n.jsxs)("div",{className:"ml-2 hidden min-w-0 items-center gap-2 text-xs font-albert text-white/70 @[400px]/video:flex",children:[(0,n.jsx)("span",{className:"text-white/30",children:"·"}),(0,n.jsx)("span",{className:"truncate",children:eE.title})]}),(0,n.jsx)("div",{className:"min-w-0 flex-1"}),D&&(0,n.jsx)("a",{href:D.url,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 p-1.5 text-white/70 hover:text-white transition-colors",title:D.label||"Open in new tab",onClick:e=>e.stopPropagation(),children:(0,n.jsx)(h.A,{className:"w-[16px] h-[16px]"})}),tN&&(0,n.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),tC()},className:(0,g.cn)("shrink-0 p-1.5 transition-colors",tE?"text-brand-accent":"text-white/70 hover:text-white"),"aria-label":tE?"Turn off captions":"Turn on captions","aria-pressed":tE,children:(0,n.jsx)(p.A,{className:"w-[16px] h-[16px]"})}),(0,n.jsxs)("div",{className:"shrink-0",children:[(0,n.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),eQ(e=>!e),eK("main")},className:(0,g.cn)("p-1.5 transition-colors",eG?"text-white":"text-white/70 hover:text-white"),"aria-label":Q("settings"),children:(0,n.jsx)(x.A,{className:"w-[16px] h-[16px]"})}),eG&&(0,n.jsx)("div",{className:"absolute bottom-full right-2 mb-2 w-[200px] max-w-[calc(100%_-_16px)] overflow-y-auto rounded-lg bg-black/90 shadow-xl backdrop-blur-md",style:{maxHeight:"min(200px, var(--video-settings-max-height, 200px))"},onClick:e=>e.stopPropagation(),children:"main"===eX?(0,n.jsxs)("div",{className:"py-1",children:[eN.length>0&&(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center justify-between gap-3 px-3 py-2 text-[13px] text-white/90 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("chapters"),children:[(0,n.jsx)("span",{children:"Sections"}),(0,n.jsx)("span",{className:"max-w-[110px] truncate text-white/50 text-[12px]",children:eE?.title??`${eN.length}`})]}),tN&&(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-2 text-[13px] text-white/90 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("subtitles"),children:[(0,n.jsx)("span",{children:"Subtitles"}),(0,n.jsx)("span",{className:"text-white/50 text-[12px]",children:tS})]}),tp&&(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-2 text-[13px] text-white/90 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("quality"),children:[(0,n.jsx)("span",{children:Q("quality")}),(0,n.jsx)("span",{className:"text-white/50 text-[12px]",children:tL})]}),(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center justify-between px-3 py-2 text-[13px] text-white/90 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("speed"),children:[(0,n.jsx)("span",{children:Q("playbackSpeed")}),(0,n.jsx)("span",{className:"text-white/50 text-[12px]",children:1===eB?Q("normal"):`${eB}x`})]})]}):"quality"===eX?(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-[13px] text-white/60 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("main"),children:[(0,n.jsx)(b.A,{className:"w-3.5 h-3.5"}),(0,n.jsx)("span",{children:Q("quality")}
1)]}),(0,n.jsx)("div",{className:"border-t border-white/10 my-0.5"}),(0,n.jsxs)("button",{type:"button",className:(0,g.cn)("w-full flex items-center justify-between gap-2.5 px-3 py-1.5 text-[13px] hover:bg-white/10 transition-colors font-albert","auto"===e0?"text-brand-accent":"text-white/80"),onClick:()=>tz("auto"),children:[(0,n.jsxs)("span",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("span",{className:"w-4 flex-shrink-0",children:"auto"===e0&&(0,n.jsx)(m.A,{className:"w-3.5 h-3.5"})}),(0,n.jsx)("span",{children:Q("auto")})]}),e5&&(0,n.jsx)("span",{className:"text-white/50 text-[12px]",children:e5})]}),eY.map(e=>(0,n.jsxs)("button",{type:"button",className:(0,g.cn)("w-full flex items-center justify-between gap-2.5 px-3 py-1.5 text-[13px] hover:bg-white/10 transition-colors font-albert",e0===e.levelIndex?"text-brand-accent":"text-white/80"),onClick:()=>tz(e.levelIndex),children:[(0,n.jsxs)("span",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("span",{className:"w-4 flex-shrink-0",children:e0===e.levelIndex&&(0,n.jsx)(m.A,{className:"w-3.5 h-3.5"})}),(0,n.jsx)("span",{children:e.label})]}),e.bitrate&&(0,n.jsx)("span",{className:"text-white/50 text-[12px]",children:tx(e.bitrate)})]},e.levelIndex))]}):"chapters"===eX?(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-[13px] text-white/60 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("main"),children:[(0,n.jsx)(b.A,{className:"w-3.5 h-3.5"}),(0,n.jsx)("span",{children:"Sections"})]}),(0,n.jsx)("div",{className:"border-t border-white/10 my-0.5"}),eN.map(e=>(0,n.jsxs)("button",{type:"button",className:(0,g.cn)("w-full flex items-center justify-between gap-3 px-3 py-1.5 text-[13px] hover:bg-white/10 transition-colors font-albert",eE===e?"text-brand-accent":"text-white/80"),onClick:()=>{em>0&&tq(e.start/em),eQ(!1),eK("main")},children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-2.5",children:[(0,n.jsx)("span",{className:"w-4 flex-shrink-0",children:eE===e&&(0,n.jsx)(m.A,{className:"w-3.5 h-3.5"})}),(0,n.jsx)("span",{className:"truncate",children:e.title})]}),(0,n.jsx)("span",{className:"flex-shrink-0 tabular-nums text-white/50 text-[12px]",children:tA(e.start)})]},`${e.start}-${e.title}`))]}):"subtitles"===eX?(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-[13px] text-white/60 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("main"),children:[(0,n.jsx)(b.A,{className:"w-3.5 h-3.5"}),(0,n.jsx)("span",{children:"Subtitles"})]}),(0,n.jsx)("div",{className:"border-t border-white/10 my-0.5"}),(0,n.jsx)("button",{type:"button",className:(0,g.cn)("w-full flex items-center justify-between gap-2.5 px-3 py-1.5 text-[13px] hover:bg-white/10 transition-colors font-albert","off"===e4?"text-brand-accent":"text-white/80"),onClick:()=>{tj("off"),eQ(!1),eK("main")},children:(0,n.jsxs)("span",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("span",{className:"w-4 flex-shrink-0",children:"off"===e4&&(0,n.jsx)(m.A,{className:"w-3.5 h-3.5"})}),(0,n.jsx)("span",{children:"Off"})]})}),e3.map(e=>(0,n.jsx)("button",{type:"button",className:(0,g.cn)("w-full flex items-center justify-between gap-2.5 px-3 py-1.5 text-[13px] hover:bg-white/10 transition-colors font-albert",e4===e.value?"text-brand-accent":"text-white/80"),onClick:()=>{tj(e.value),eQ(!1),eK("main")},children:(0,n.jsxs)("span",{className:"flex items-center gap-2.5",children:[(0,n.jsx)("span",{className:"w-4 flex-shrink-0",children:e4===e.value&&(0,n.jsx)(m.A,{className:"w-3.5 h-3.5"})}),(0,n.jsx)("span",{children:e.label})]})},e.value))]}):(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-1.5 text-[13px] text-white/60 hover:bg-white/10 transition-colors font-albert",onClick:()=>eK("main"),children:[(0,n.jsx)(b.A,{className:"w-3.5 h-3.5"}),(0,n.jsx)("span",{children:Q("speed")})]}),(0,n.jsx)("div",{className:"border-t border-white/10 my-0.5"}),[.5,.75,1,1.25,1.5,1.75,2].map(e=>(0,n.jsxs)("button",{type:"button",className:(0,g.cn)("w-full flex items-center gap-2.5 px-3 py-1.5 text-[13px] hover:bg-white/10 transition-colors font-albert",eB===e?"text-brand-accent":"text-white/80"),onClick:()=>{eJ(e),K.current&&(K.current.playbackRate=e);let t=Z.current?.querySelector("video");t&&(t.playbackRate=e),eQ(!1),eK("main")},children:[(0,n.jsx)("span",{className:"w-4 flex-shrink-0",children:eB===e&&(0,n.jsx)(m.A,{className:"w-3.5 h-3.5"})}),(0,n.jsx)("span",{children:1===e?Q("normal"):`${e}x`})]},e))]})})]}),(0,n.jsx)("button",{type:"button",onClick:tU,className:"shrink-0 p-1.5 text-white/70 hover:text-white transition-colors","aria-label":eT?"Exit fullscreen":"Enter fullscreen",children:eT?(0,n.jsx)(f.A,{className:"w-[16px] h-[16px]"}):(0,n.jsx)(v.A,{className:"w-[16px] h-[16px]"})})]})]})]})]})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.