@hyperframes/studio 0.6.0-alpha.8 → 0.6.0

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.
Files changed (66) hide show
  1. package/dist/assets/{hyperframes-player-DjsVzYFP.js → hyperframes-player-DOFETgjy.js} +1 -1
  2. package/dist/assets/index-D1JDq7Gg.css +1 -0
  3. package/dist/assets/index-DUqUmaoH.js +117 -0
  4. package/dist/favicon.svg +14 -0
  5. package/dist/index.html +3 -2
  6. package/package.json +9 -9
  7. package/src/App.tsx +428 -4299
  8. package/src/components/AskAgentModal.tsx +120 -0
  9. package/src/components/StudioHeader.tsx +133 -0
  10. package/src/components/StudioLeftSidebar.tsx +125 -0
  11. package/src/components/StudioPreviewArea.tsx +163 -0
  12. package/src/components/StudioRightPanel.tsx +198 -0
  13. package/src/components/TimelineToolbar.tsx +89 -0
  14. package/src/components/editor/DomEditOverlay.tsx +15 -1
  15. package/src/components/editor/PropertyPanel.test.ts +0 -49
  16. package/src/components/editor/PropertyPanel.tsx +132 -2763
  17. package/src/components/editor/domEditing.ts +38 -5
  18. package/src/components/editor/manualEditingAvailability.test.ts +2 -2
  19. package/src/components/editor/manualEditingAvailability.ts +1 -1
  20. package/src/components/editor/manualEdits.ts +32 -0
  21. package/src/components/editor/propertyPanelColor.tsx +371 -0
  22. package/src/components/editor/propertyPanelFill.tsx +421 -0
  23. package/src/components/editor/propertyPanelFont.tsx +455 -0
  24. package/src/components/editor/propertyPanelHelpers.ts +401 -0
  25. package/src/components/editor/propertyPanelPrimitives.tsx +357 -0
  26. package/src/components/editor/propertyPanelSections.tsx +453 -0
  27. package/src/components/editor/propertyPanelStyleSections.tsx +411 -0
  28. package/src/components/nle/NLELayout.tsx +8 -11
  29. package/src/components/nle/NLEPreview.tsx +3 -0
  30. package/src/components/renders/RenderQueue.tsx +102 -31
  31. package/src/components/renders/useRenderQueue.ts +8 -2
  32. package/src/components/sidebar/LeftSidebar.tsx +186 -186
  33. package/src/contexts/DomEditContext.tsx +137 -0
  34. package/src/contexts/FileManagerContext.tsx +110 -0
  35. package/src/contexts/PanelLayoutContext.tsx +68 -0
  36. package/src/contexts/StudioContext.tsx +135 -0
  37. package/src/hooks/useAppHotkeys.ts +326 -0
  38. package/src/hooks/useAskAgentModal.ts +162 -0
  39. package/src/hooks/useCaptionDetection.ts +132 -0
  40. package/src/hooks/useCompositionDimensions.ts +25 -0
  41. package/src/hooks/useConsoleErrorCapture.ts +60 -0
  42. package/src/hooks/useDomEditCommits.ts +437 -0
  43. package/src/hooks/useDomEditSession.ts +342 -0
  44. package/src/hooks/useDomEditTextCommits.ts +330 -0
  45. package/src/hooks/useDomSelection.ts +398 -0
  46. package/src/hooks/useFileManager.ts +431 -0
  47. package/src/hooks/useFrameCapture.ts +77 -0
  48. package/src/hooks/useLintModal.ts +35 -0
  49. package/src/hooks/useManifestPersistence.ts +492 -0
  50. package/src/hooks/usePanelLayout.ts +68 -0
  51. package/src/hooks/usePreviewInteraction.ts +153 -0
  52. package/src/hooks/useRenderClipContent.ts +124 -0
  53. package/src/hooks/useTimelineEditing.ts +472 -0
  54. package/src/player/components/Player.tsx +35 -4
  55. package/src/player/components/Timeline.test.ts +0 -8
  56. package/src/player/components/Timeline.tsx +10 -103
  57. package/src/player/components/TimelineClip.tsx +9 -244
  58. package/src/player/hooks/useTimelinePlayer.ts +140 -103
  59. package/src/utils/domEditHelpers.ts +50 -0
  60. package/src/utils/studioFontHelpers.ts +83 -0
  61. package/src/utils/studioHelpers.ts +214 -0
  62. package/src/utils/studioPreviewHelpers.ts +185 -0
  63. package/src/utils/timelineDiscovery.ts +1 -1
  64. package/dist/assets/index-14zH9lqh.css +0 -1
  65. package/dist/assets/index-ClYcrksa.js +0 -108
  66. package/src/player/components/TimelineClip.test.ts +0 -92
@@ -415,4 +415,4 @@ var oe=Object.defineProperty;var de=(a,h,e)=>h in a?oe(a,h,{enumerable:!0,config
415
415
  background: var(--hfp-accent, #fff);
416
416
  pointer-events: none;
417
417
  }
418
- `,Z='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><polygon points="4,2 16,9 4,16"/></svg>',le='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><rect x="3" y="2" width="4" height="14"/><rect x="11" y="2" width="4" height="14"/></svg>',K='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/><path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',ee='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>',he='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z" opacity="0.3"/><line x1="18" y1="7" x2="14" y2="17" stroke="currentColor" stroke-width="2"/></svg>',ce=[.25,.5,1,1.5,2,4];function O(a){return Number.isInteger(a)?`${a}x`:`${a}x`}function te(a){if(!Number.isFinite(a)||a<0)return"0:00";const h=Math.floor(a),e=Math.floor(h/60),t=h%60;return`${e}:${t.toString().padStart(2,"0")}`}function pe(a,h,e={}){const t=e.speedPresets??ce,i=document.createElement("div");i.className="hfp-controls",i.addEventListener("click",s=>{s.stopPropagation()});const r=document.createElement("button");r.className="hfp-play-btn",r.type="button",r.innerHTML=Z,r.setAttribute("aria-label","Play");const n=document.createElement("div");n.className="hfp-scrubber";const d=document.createElement("div");d.className="hfp-progress",d.style.width="0%",n.appendChild(d);const l=document.createElement("span");l.className="hfp-time",l.textContent="0:00 / 0:00";const c=document.createElement("div");c.className="hfp-speed-wrap";const u=document.createElement("button");u.className="hfp-speed-btn",u.type="button",u.textContent="1x",u.setAttribute("aria-label","Playback speed");const p=document.createElement("div");p.className="hfp-speed-menu",p.setAttribute("role","menu");for(const s of t){const o=document.createElement("button");o.className="hfp-speed-option",o.type="button",o.setAttribute("role","menuitem"),o.dataset.speed=String(s),o.textContent=O(s),s===1&&o.classList.add("hfp-active"),p.appendChild(o)}c.appendChild(p),c.appendChild(u);const _=document.createElement("div");_.className="hfp-volume-wrap";const g=document.createElement("button");g.className="hfp-mute-btn",g.type="button",g.innerHTML=K,g.setAttribute("aria-label","Mute");const b=document.createElement("div");b.className="hfp-volume-slider-wrap";const f=document.createElement("div");f.className="hfp-volume-slider",f.setAttribute("role","slider"),f.setAttribute("aria-label","Volume"),f.setAttribute("aria-valuemin","0"),f.setAttribute("aria-valuemax","100"),f.setAttribute("aria-valuenow","100"),f.tabIndex=0;const y=document.createElement("div");y.className="hfp-volume-fill",y.style.width="100%",f.appendChild(y),b.appendChild(f),_.appendChild(b),_.appendChild(g),i.appendChild(r),i.appendChild(n),i.appendChild(l),i.appendChild(_),i.appendChild(c),a.appendChild(i);let E=!1,w=!1,L=1,M=null;t.indexOf(1);const k=(s,o)=>s?he:o===0||o<.5?ee:K;r.addEventListener("click",s=>{s.stopPropagation(),E?h.onPause():h.onPlay()}),g.addEventListener("click",s=>{s.stopPropagation(),h.onMuteToggle()});let x=!1;const P=s=>{const o=f.getBoundingClientRect(),v=Math.max(0,Math.min(1,(s-o.left)/o.width));L=v,y.style.width=`${v*100}%`,f.setAttribute("aria-valuenow",String(Math.round(v*100))),w&&v>0&&h.onMuteToggle(),g.innerHTML=k(w,v),h.onVolumeChange(v)};f.addEventListener("mousedown",s=>{s.stopPropagation(),x=!0,P(s.clientX)});const U=s=>{x&&P(s.clientX)},V=()=>{x=!1};document.addEventListener("mousemove",U),document.addEventListener("mouseup",V),f.addEventListener("touchstart",s=>{x=!0;const o=s.touches[0];o&&P(o.clientX)},{passive:!0});const $=s=>{if(x){const o=s.touches[0];o&&P(o.clientX)}},z=()=>{x=!1};document.addEventListener("touchmove",$,{passive:!0}),document.addEventListener("touchend",z);const j=.05;f.addEventListener("keydown",s=>{let o=L;if(s.key==="ArrowRight"||s.key==="ArrowUp")o=Math.min(1,L+j);else if(s.key==="ArrowLeft"||s.key==="ArrowDown")o=Math.max(0,L-j);else return;s.preventDefault(),s.stopPropagation(),L=o,y.style.width=`${o*100}%`,f.setAttribute("aria-valuenow",String(Math.round(o*100))),w&&o>0&&h.onMuteToggle(),g.innerHTML=k(w,o),h.onVolumeChange(o)});const B=s=>{for(const o of p.querySelectorAll(".hfp-speed-option"))o.classList.toggle("hfp-active",o.dataset.speed===String(s))};u.addEventListener("click",s=>{s.stopPropagation();const o=p.classList.toggle("hfp-open");u.setAttribute("aria-expanded",String(o))}),p.addEventListener("click",s=>{s.stopPropagation();const o=s.target.closest(".hfp-speed-option");if(!o)return;const v=parseFloat(o.dataset.speed);t.indexOf(v),u.textContent=O(v),B(v),p.classList.remove("hfp-open"),u.setAttribute("aria-expanded","false"),h.onSpeedChange(v)});const W=()=>{p.classList.remove("hfp-open"),u.setAttribute("aria-expanded","false")};document.addEventListener("click",W);const R=s=>{const o=n.getBoundingClientRect(),v=Math.max(0,Math.min(1,(s-o.left)/o.width));h.onSeek(v)};let A=!1;n.addEventListener("mousedown",s=>{s.stopPropagation(),A=!0,R(s.clientX)});const q=s=>{A&&R(s.clientX)},X=()=>{A=!1};document.addEventListener("mousemove",q),document.addEventListener("mouseup",X),n.addEventListener("touchstart",s=>{A=!0;const o=s.touches[0];o&&R(o.clientX)},{passive:!0});const G=s=>{if(A){const o=s.touches[0];o&&R(o.clientX)}},Q=()=>{A=!1};document.addEventListener("touchmove",G,{passive:!0}),document.addEventListener("touchend",Q);const Y=()=>{M&&clearTimeout(M),M=setTimeout(()=>{E&&i.classList.add("hfp-hidden")},3e3)},J=a instanceof ShadowRoot?a.host:a;return J.addEventListener("mousemove",()=>{i.classList.remove("hfp-hidden"),Y()}),J.addEventListener("mouseleave",()=>{E&&i.classList.add("hfp-hidden")}),{updateTime(s,o){const v=o>0?Math.min(s,o):s,ne=o>0?v/o*100:0;d.style.width=`${ne}%`,l.textContent=`${te(v)} / ${te(o)}`},updatePlaying(s){E=s,r.innerHTML=s?le:Z,r.setAttribute("aria-label",s?"Pause":"Play"),s?Y():i.classList.remove("hfp-hidden")},updateSpeed(s){t.indexOf(s),u.textContent=O(s),B(s)},updateMuted(s){w=s,g.innerHTML=k(s,L),g.setAttribute("aria-label",s?"Unmute":"Mute")},updateVolume(s){L=s,y.style.width=`${s*100}%`,f.setAttribute("aria-valuenow",String(Math.round(s*100))),g.innerHTML=k(w,s)},show(){i.style.display=""},hide(){i.style.display="none"},destroy(){document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",X),document.removeEventListener("touchmove",G),document.removeEventListener("touchend",Q),document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",V),document.removeEventListener("touchmove",$),document.removeEventListener("touchend",z),document.removeEventListener("click",W),M&&clearTimeout(M)}}}function ue(a){return a.hasRuntime||a.runtimeInjected?!1:!!(a.hasNestedCompositions||a.hasTimelines&&a.attempts>=5)}let N=null;function me(){if(N)return N;if(typeof CSSStyleSheet>"u")return null;try{const a=new CSSStyleSheet;return a.replaceSync(ae),N=a,a}catch{return null}}const F=30,fe="https://cdn.jsdelivr.net/npm/@hyperframes/core/dist/hyperframe.runtime.iife.js",C="shader-capture-scale",T="shader-loading",_e="__hf_shader_capture_scale",ge="__hf_shader_loading",I=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"];function ie(a){if(a===null)return null;const h=Number(a);return!Number.isFinite(h)||h<=0?null:String(Math.min(1,Math.max(.25,h)))}function re(a){if(a===null||a.trim()==="")return"composition";const h=a.trim().toLowerCase();return h==="none"||h==="false"||h==="0"||h==="off"?"none":h==="player"||h==="true"||h==="1"||h==="on"?"player":"composition"}function se(a,h,e){e===null?a.delete(h):a.set(h,e)}function be(a,h,e){const t=a.indexOf("#"),i=t>=0?a.slice(0,t):a,r=t>=0?a.slice(t):"",n=i.indexOf("?"),d=n>=0?i.slice(0,n):i,l=n>=0?i.slice(n+1):"",c=new URLSearchParams(l);se(c,_e,h),se(c,ge,e==="composition"?null:e);const u=c.toString();return`${d}${u?`?${u}`:""}${r}`}function D(a){return typeof a=="object"&&a!==null}function ve(a){return D(a)&&typeof a.getDuration=="function"}function ye(a){return D(a)&&typeof a.duration=="function"&&typeof a.time=="function"&&typeof a.seek=="function"&&typeof a.play=="function"&&typeof a.pause=="function"}function we(a,h,e){if(h===null&&e==="composition")return a;const t=[];h!==null&&t.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(h)};`),e!=="composition"&&t.push(`window.__HF_SHADER_LOADING=${JSON.stringify(e)};`);const i=`<script data-hyperframes-player-shader-options>${t.join("")}<\/script>`;return/<head\b[^>]*>/i.test(a)?a.replace(/<head\b[^>]*>/i,r=>`${r}${i}`):/<html\b[^>]*>/i.test(a)?a.replace(/<html\b[^>]*>/i,r=>`${r}${i}`):`${i}${a}`}const S=class S extends HTMLElement{constructor(){super();m(this,"shadow");m(this,"container");m(this,"iframe");m(this,"posterEl",null);m(this,"controlsApi",null);m(this,"resizeObserver");m(this,"shaderLoaderEl");m(this,"shaderLoaderFillEl");m(this,"shaderLoaderTitleEl");m(this,"shaderLoaderDetailEl");m(this,"shaderLoaderTransitionValueEl");m(this,"shaderLoaderFrameLabelEl");m(this,"shaderLoaderFrameValueEl");m(this,"shaderLoaderFrameRowEl");m(this,"shaderLoaderHideTimeout",null);m(this,"_ready",!1);m(this,"_duration",0);m(this,"_currentTime",0);m(this,"_paused",!0);m(this,"_volume",1);m(this,"_compositionWidth",1920);m(this,"_compositionHeight",1080);m(this,"_probeInterval",null);m(this,"_lastUpdateMs",0);m(this,"_directTimelineAdapter",null);m(this,"_directTimelineRaf",null);m(this,"_parentMedia",[]);m(this,"_audioOwner","runtime");m(this,"_mediaObserver");m(this,"_playbackErrorPosted",!1);m(this,"_runtimeInjected",!1);this.shadow=this.attachShadow({mode:"open"});const e=me();if(e)this.shadow.adoptedStyleSheets=[e];else{const i=document.createElement("style");i.textContent=ae,this.shadow.appendChild(i)}this.container=document.createElement("div"),this.container.className="hfp-container",this.iframe=document.createElement("iframe"),this.iframe.className="hfp-iframe",this.iframe.sandbox.add("allow-scripts","allow-same-origin"),this.iframe.allow="autoplay; fullscreen",this.iframe.referrerPolicy="no-referrer",this.iframe.title="HyperFrames Composition",this.container.appendChild(this.iframe),this.shadow.appendChild(this.container);const t=this._createShaderLoader();this.shaderLoaderEl=t.root,this.shaderLoaderFillEl=t.fill,this.shaderLoaderTitleEl=t.title,this.shaderLoaderDetailEl=t.detail,this.shaderLoaderTransitionValueEl=t.transitionValue,this.shaderLoaderFrameLabelEl=t.frameLabel,this.shaderLoaderFrameValueEl=t.frameValue,this.shaderLoaderFrameRowEl=t.frameRow,this.shadow.appendChild(this.shaderLoaderEl),this.addEventListener("click",i=>{this._isControlsClick(i)||(this._paused?this.play():this.pause())}),this.resizeObserver=new ResizeObserver(()=>this._updateScale()),this._onMessage=this._onMessage.bind(this),this._onIframeLoad=this._onIframeLoad.bind(this)}static get observedAttributes(){return["src","srcdoc","width","height","controls","muted","volume","poster","playback-rate","audio-src",C,T]}connectedCallback(){this.resizeObserver.observe(this),window.addEventListener("message",this._onMessage),this.iframe.addEventListener("load",this._onIframeLoad),this.hasAttribute("controls")&&this._setupControls(),this.hasAttribute("poster")&&this._setupPoster(),this.hasAttribute("audio-src")&&this._setupParentAudioFromUrl(this.getAttribute("audio-src")),this.hasAttribute("srcdoc")&&(this.iframe.srcdoc=this._prepareSrcdoc(this.getAttribute("srcdoc"))),this.hasAttribute("src")&&(this.iframe.src=this._prepareSrc(this.getAttribute("src")))}disconnectedCallback(){var e;this.resizeObserver.disconnect(),window.removeEventListener("message",this._onMessage),this.iframe.removeEventListener("load",this._onIframeLoad),this._probeInterval&&clearInterval(this._probeInterval),this._stopDirectTimelineClock(),this._directTimelineAdapter=null,this.shaderLoaderHideTimeout&&clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=null,this._teardownMediaObserver(),(e=this.controlsApi)==null||e.destroy();for(const t of this._parentMedia)t.el.pause(),t.el.src="";this._parentMedia=[]}attributeChangedCallback(e,t,i){var r,n,d,l;switch(e){case"src":i&&(this._ready=!1,this.iframe.src=this._prepareSrc(i));break;case"srcdoc":this._ready=!1,i!==null?this.iframe.srcdoc=this._prepareSrcdoc(i):this.iframe.removeAttribute("srcdoc");break;case"width":this._compositionWidth=parseInt(i||"1920",10),this._updateScale();break;case"height":this._compositionHeight=parseInt(i||"1080",10),this._updateScale();break;case"controls":i!==null?this._setupControls():((r=this.controlsApi)==null||r.destroy(),this.controlsApi=null);break;case"poster":this._setupPoster();break;case"playback-rate":{const c=parseFloat(i||"1");for(const u of this._parentMedia)u.el.playbackRate=c;this._sendControl("set-playback-rate",{playbackRate:c}),(n=this.controlsApi)==null||n.updateSpeed(c),this.dispatchEvent(new Event("ratechange"));break}case"muted":for(const c of this._parentMedia)c.el.muted=i!==null;this._sendControl("set-muted",{muted:i!==null}),(d=this.controlsApi)==null||d.updateMuted(i!==null),this.dispatchEvent(new Event("volumechange"));break;case"volume":{const c=Math.max(0,Math.min(1,parseFloat(i||"1")));this._volume=c;for(const u of this._parentMedia)u.el.volume=c;this._sendControl("set-volume",{volume:c}),(l=this.controlsApi)==null||l.updateVolume(c),this.dispatchEvent(new Event("volumechange"));break}case"audio-src":i&&this._setupParentAudioFromUrl(i);break;case C:case T:this._reloadShaderOptions();break}}get iframeElement(){return this.iframe}play(){var t;this._hidePoster(),this._duration>0&&this._currentTime>=this._duration&&this.seek(0);const e=this._tryDirectTimelinePlay();e||this._sendControl("play"),this._audioOwner==="parent"&&this._playParentMedia(),this._paused=!1,(t=this.controlsApi)==null||t.updatePlaying(!0),this.dispatchEvent(new Event("play")),e&&this._startDirectTimelineClock()}pause(){var e;this._tryDirectTimelinePause()||this._sendControl("pause"),this._stopDirectTimelineClock(),this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=!0,(e=this.controlsApi)==null||e.updatePlaying(!1),this.dispatchEvent(new Event("pause"))}seek(e){var t,i;if(!this._trySyncSeek(e)&&!this._tryDirectTimelineSeek(e)){const r=Math.round(e*F);this._sendControl("seek",{frame:r})}if(this._stopDirectTimelineClock(),this._currentTime=e,this._audioOwner==="parent")for(const r of this._parentMedia){const n=e-r.start;n>=0&&n<r.duration&&(r.el.currentTime=n)}this._paused=!0,(t=this.controlsApi)==null||t.updatePlaying(!1),(i=this.controlsApi)==null||i.updateTime(this._currentTime,this._duration)}get currentTime(){return this._currentTime}set currentTime(e){this.seek(e)}get duration(){return this._duration}get paused(){return this._paused}get ready(){return this._ready}get playbackRate(){return parseFloat(this.getAttribute("playback-rate")||"1")}set playbackRate(e){this.setAttribute("playback-rate",String(e))}get shaderCaptureScale(){return Number(ie(this.getAttribute(C))??"1")}set shaderCaptureScale(e){this.setAttribute(C,String(e))}get shaderLoading(){return re(this.getAttribute(T))}set shaderLoading(e){e==="composition"?this.removeAttribute(T):this.setAttribute(T,e)}get muted(){return this.hasAttribute("muted")}set muted(e){e?this.setAttribute("muted",""):this.removeAttribute("muted")}get volume(){return this._volume}set volume(e){this.setAttribute("volume",String(Math.max(0,Math.min(1,e))))}get loop(){return this.hasAttribute("loop")}set loop(e){e?this.setAttribute("loop",""):this.removeAttribute("loop")}_sendControl(e,t={}){var i;try{(i=this.iframe.contentWindow)==null||i.postMessage({source:"hf-parent",type:"control",action:e,...t},"*")}catch{}}_shaderCaptureScaleParam(){return ie(this.getAttribute(C))}_shaderLoadingMode(){return re(this.getAttribute(T))}_prepareSrc(e){return be(e,this._shaderCaptureScaleParam(),this._shaderLoadingMode())}_prepareSrcdoc(e){return we(e,this._shaderCaptureScaleParam(),this._shaderLoadingMode())}_reloadShaderOptions(){if(this._shaderLoadingMode()!=="player"&&this._resetShaderLoader(),this.hasAttribute("srcdoc")){this.iframe.srcdoc=this._prepareSrcdoc(this.getAttribute("srcdoc")||"");return}this.hasAttribute("src")&&(this.iframe.src=this._prepareSrc(this.getAttribute("src")||""))}_createShaderLoader(){const e=document.createElement("div");e.className="hfp-shader-loader",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-label","Preparing scene transitions"),e.setAttribute("data-hyperframes-ignore",""),e.draggable=!1;const t=f=>{f.preventDefault(),f.stopPropagation()};for(const f of["selectstart","dragstart","pointerdown","mousedown","click","dblclick","contextmenu","touchstart"])e.addEventListener(f,t,{capture:!0});const i=document.createElement("div");i.className="hfp-shader-loader-panel",i.draggable=!1;const r=document.createElement("div");r.className="hfp-shader-loader-mark",r.draggable=!1,r.innerHTML=['<svg width="78" height="78" viewBox="0 0 100 100" fill="none" aria-hidden="true" draggable="false">','<path d="M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z" fill="url(#hfp-shader-loader-grad-left)"/>','<path d="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z" fill="url(#hfp-shader-loader-grad-right)"/>',"<defs>",'<linearGradient id="hfp-shader-loader-grad-left" x1="48.5676" y1="25" x2="44.7804" y2="71.9384" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>",'<linearGradient id="hfp-shader-loader-grad-right" x1="54.8282" y1="73.8392" x2="72.0989" y2="32.8932" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>","</defs>","</svg>"].join("");const n=document.createElement("div");n.className="hfp-shader-loader-title";const d=document.createElement("span");d.className="hfp-shader-loader-title-text",d.textContent=I[0],n.appendChild(d);const l=document.createElement("div");l.className="hfp-shader-loader-detail",l.textContent="Rendering animated scene samples for shader transitions.";const c=document.createElement("div");c.className="hfp-shader-loader-track",c.setAttribute("aria-hidden","true");const u=document.createElement("div");u.className="hfp-shader-loader-fill",c.appendChild(u);const p=document.createElement("div");p.className="hfp-shader-loader-progress";const _=f=>{const y=document.createElement("div");y.className="hfp-shader-loader-row";const E=document.createElement("span");E.className="hfp-shader-loader-label",E.textContent=f;const w=document.createElement("span");return w.className="hfp-shader-loader-value",y.appendChild(E),y.appendChild(w),p.appendChild(y),{row:y,label:E,value:w}},g=_("transition"),b=_("transition frame");return i.appendChild(r),i.appendChild(n),i.appendChild(l),i.appendChild(c),i.appendChild(p),e.appendChild(i),{root:e,fill:u,title:d,detail:l,transitionValue:g.value,frameLabel:b.label,frameValue:b.value,frameRow:b.row}}_showShaderLoader(){this.shaderLoaderHideTimeout&&(clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=null),this.shaderLoaderEl.classList.remove("hfp-hiding"),this.shaderLoaderEl.classList.add("hfp-visible")}_hideShaderLoader(){if(this.shaderLoaderEl.classList.contains("hfp-hiding")){this.shaderLoaderHideTimeout||this._scheduleShaderLoaderHideCleanup();return}this.shaderLoaderEl.classList.contains("hfp-visible")&&(this.shaderLoaderEl.classList.add("hfp-hiding"),this.shaderLoaderEl.classList.remove("hfp-visible"),this._scheduleShaderLoaderHideCleanup())}_scheduleShaderLoaderHideCleanup(){this.shaderLoaderHideTimeout&&clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=setTimeout(()=>{this.shaderLoaderEl.classList.remove("hfp-hiding"),this.shaderLoaderHideTimeout=null},420)}_resetShaderLoader(){this.shaderLoaderHideTimeout&&(clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=null),this.shaderLoaderEl.classList.remove("hfp-visible","hfp-hiding"),this.shaderLoaderFillEl.style.transform="scaleX(0)",this.shaderLoaderTransitionValueEl.textContent="",this.shaderLoaderFrameValueEl.textContent="",this.shaderLoaderFrameRowEl.style.visibility="hidden"}_updateShaderLoader(e){if(this._shaderLoadingMode()!=="player"){this._resetShaderLoader();return}if(e.ready||!e.loading){this._hideShaderLoader();return}const t=typeof e.progress=="number"&&Number.isFinite(e.progress)?e.progress:0,i=typeof e.total=="number"&&Number.isFinite(e.total)?e.total:0,r=i>0?Math.min(1,Math.max(0,t/i)):0,n=Math.min(I.length-1,Math.floor(r*I.length));this.shaderLoaderTitleEl.textContent=I[n]||"Preparing scene transitions",this.shaderLoaderDetailEl.textContent=e.phase==="cached"?"Loading cached transition frames before playback.":e.phase==="finalizing"?"Uploading transition textures for smooth playback.":"Rendering animated scene samples for shader transitions.",this.shaderLoaderFillEl.style.transform=`scaleX(${r})`,this.shaderLoaderTransitionValueEl.textContent=e.currentTransition!==void 0&&e.transitionTotal!==void 0?`${e.currentTransition}/${e.transitionTotal}`:i>0?`${t}/${i}`:"";const d=e.transitionFrame!==void 0&&e.transitionFrames!==void 0?`${e.transitionFrame}/${e.transitionFrames}`:"";this.shaderLoaderFrameLabelEl.textContent=e.phase==="cached"?"cached transition frames":e.phase==="finalizing"?"finalizing transition frames":"rendering transition frames",this.shaderLoaderFrameValueEl.textContent=d,this.shaderLoaderFrameRowEl.style.visibility=d?"visible":"hidden",this.shaderLoaderEl.setAttribute("aria-valuenow",String(Math.round(r*100))),this._showShaderLoader()}_trySyncSeek(e){try{const t=this.iframe.contentWindow,i=t==null?void 0:t.__player,r=i==null?void 0:i.seek;return typeof r!="function"?!1:(r.call(i,e),!0)}catch{return!1}}_tryDirectTimelineSeek(e){const t=this._directTimelineAdapter||this._resolveDirectTimelineAdapter();if(!t)return!1;try{return t.seek(e),t.pause(),this._directTimelineAdapter=t,!0}catch{return!1}}_tryDirectTimelinePlay(){const e=this._directTimelineAdapter||this._resolveDirectTimelineAdapter();if(!e)return!1;try{return e.play(),this._directTimelineAdapter=e,!0}catch{return!1}}_tryDirectTimelinePause(){const e=this._directTimelineAdapter||this._resolveDirectTimelineAdapter();if(!e)return!1;try{return e.pause(),this._directTimelineAdapter=e,!0}catch{return!1}}_startDirectTimelineClock(){this._stopDirectTimelineClock();const e=()=>{var d,l;const t=this._directTimelineAdapter;if(!t||this._paused){this._directTimelineRaf=null;return}let i;try{i=t.time()}catch{this._directTimelineRaf=null;return}this._duration>0&&(i=Math.min(i,this._duration)),this._currentTime=i;const r=this._duration>0&&i>=this._duration,n=performance.now();if((n-this._lastUpdateMs>100||r)&&(this._lastUpdateMs=n,(d=this.controlsApi)==null||d.updateTime(this._currentTime,this._duration),this.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:this._currentTime}}))),r){if(this.loop){this.seek(0),this.play();return}t.pause(),this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=!0,(l=this.controlsApi)==null||l.updatePlaying(!1),this.dispatchEvent(new Event("ended")),this._directTimelineRaf=null;return}this._directTimelineRaf=requestAnimationFrame(e)};this._directTimelineRaf=requestAnimationFrame(e)}_stopDirectTimelineClock(){this._directTimelineRaf!==null&&(cancelAnimationFrame(this._directTimelineRaf),this._directTimelineRaf=null)}_resolveDirectTimelineAdapter(){try{const e=this.iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}_resolveDirectTimelineAdapterFromWindow(e){var l,c;if(this._hasRuntimeBridge(e))return null;const t=Reflect.get(e,"__timelines");if(!D(t))return null;const i=Object.keys(t);if(i.length===0)return null;const r=(c=(l=this.iframe.contentDocument)==null?void 0:l.querySelector("[data-composition-id]"))==null?void 0:c.getAttribute("data-composition-id"),n=r&&r in t?r:i[i.length-1],d=t[n];return ye(d)?d:null}_hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||D(Reflect.get(e,"__player"))}_resolvePlaybackDurationAdapter(e){const t=Reflect.get(e,"__player");if(ve(t))return{kind:"runtime",getDuration:()=>t.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(e);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}_isControlsClick(e){return e.composedPath().some(t=>t instanceof HTMLElement&&t.classList.contains("hfp-controls"))}_onMessage(e){var i,r,n,d;if(e.source!==this.iframe.contentWindow)return;const t=e.data;if(!(!t||t.source!=="hf-preview")){if(t.type==="shader-transition-state"){const l=t.state&&typeof t.state=="object"?t.state:{};this._updateShaderLoader(l),this.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:t.compositionId,state:l}}));return}if(t.type==="state"){const l=(t.frame??0)/F;this._currentTime=this._duration>0?Math.min(l,this._duration):l;const c=!this._paused,u=!t.isPlaying,p=this._duration>0&&this._currentTime>=this._duration&&(c||t.isPlaying);if(p&&this.loop){this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=u,this.seek(0),this.play();return}this._paused=u,this._audioOwner==="parent"&&(c&&this._paused?this._pauseParentMedia():!c&&!this._paused&&this._playParentMedia(),this._mirrorParentMediaTime(this._currentTime));const _=performance.now();(_-this._lastUpdateMs>100||this._paused!==c)&&(this._lastUpdateMs=_,(i=this.controlsApi)==null||i.updateTime(this._currentTime,this._duration),(r=this.controlsApi)==null||r.updatePlaying(!this._paused),this.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:this._currentTime}}))),p&&(this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=!0,(n=this.controlsApi)==null||n.updatePlaying(!1),this.dispatchEvent(new Event("ended")))}t.type==="media-autoplay-blocked"&&this._promoteToParentProxy(),t.type==="timeline"&&t.durationInFrames>0&&Number.isFinite(t.durationInFrames)&&(this._duration=t.durationInFrames/F,(d=this.controlsApi)==null||d.updateTime(this._currentTime,this._duration)),t.type==="stage-size"&&t.width>0&&t.height>0&&(this._compositionWidth=t.width,this._compositionHeight=t.height,this._updateScale())}}_onIframeLoad(){let e=0;this._runtimeInjected=!1,this._directTimelineAdapter=null,this._stopDirectTimelineClock(),this._resetShaderLoader();const t=this._audioOwner==="parent";this._audioOwner="runtime",this._playbackErrorPosted=!1,this._pauseParentMedia(),this._teardownMediaObserver(),t&&this.dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}})),this._probeInterval&&clearInterval(this._probeInterval),this._probeInterval=setInterval(()=>{var i,r;e++;try{const n=this.iframe.contentWindow;if(!n)return;const d=!!(n.__hf||n.__player),l=!!(n.__timelines&&Object.keys(n.__timelines).length>0),c=!!((i=this.iframe.contentDocument)!=null&&i.querySelector("[data-composition-src]"));if(ue({hasRuntime:d,hasTimelines:l,hasNestedCompositions:c,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!d)return;const u=this._resolvePlaybackDurationAdapter(n);if(u&&u.getDuration()>0){clearInterval(this._probeInterval),this._duration=u.getDuration(),this._directTimelineAdapter=u.kind==="direct-timeline"?u.timeline:null,this._ready=!0,(r=this.controlsApi)==null||r.updateTime(0,this._duration),this.dispatchEvent(new CustomEvent("ready",{detail:{duration:this._duration}}));const p=this.iframe.contentDocument,_=p==null?void 0:p.querySelector("[data-composition-id]");if(_){const g=parseInt(_.getAttribute("data-width")||"0",10),b=parseInt(_.getAttribute("data-height")||"0",10);g>0&&b>0&&(this._compositionWidth=g,this._compositionHeight=b,this._updateScale())}this._setupParentMedia(),this.hasAttribute("autoplay")&&this.play();return}}catch{}e>=40&&(clearInterval(this._probeInterval),this.dispatchEvent(new CustomEvent("error",{detail:{message:"Composition timeline not found after 8s"}})))},200)}_injectRuntime(){this._runtimeInjected=!0;try{const e=this.iframe.contentDocument;if(!e)return;const t=e.createElement("script");t.src=fe,t.onload=()=>{},t.onerror=()=>{},(e.head||e.documentElement).appendChild(t)}catch{}}_updateScale(){const e=this.getBoundingClientRect();if(e.width===0||e.height===0)return;const t=Math.min(e.width/this._compositionWidth,e.height/this._compositionHeight);this.iframe.style.width=`${this._compositionWidth}px`,this.iframe.style.height=`${this._compositionHeight}px`,this.iframe.style.transform=`translate(-50%, -50%) scale(${t})`}_setupControls(){if(this.controlsApi)return;const e={onPlay:()=>this.play(),onPause:()=>this.pause(),onSeek:r=>this.seek(r*this._duration),onSpeedChange:r=>{this.playbackRate=r},onMuteToggle:()=>{this.muted=!this.muted},onVolumeChange:r=>{this.volume=r}},t=this.getAttribute("speed-presets"),i=t?t.split(",").map(Number).filter(r=>!isNaN(r)&&r>0):void 0;this.controlsApi=pe(this.shadow,e,{speedPresets:i}),this.controlsApi.updateMuted(this.muted),this.controlsApi.updateVolume(this._volume)}_setupPoster(){var t;const e=this.getAttribute("poster");if(!e){(t=this.posterEl)==null||t.remove(),this.posterEl=null;return}this.posterEl||(this.posterEl=document.createElement("img"),this.posterEl.className="hfp-poster",this.shadow.appendChild(this.posterEl)),this.posterEl.src=e}_playParentMedia(){for(const e of this._parentMedia)e.el.src&&e.el.play().catch(t=>this._reportPlaybackError(t))}_reportPlaybackError(e){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this.dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:e}})))}_pauseParentMedia(){for(const e of this._parentMedia)e.el.pause()}_mirrorParentMediaTime(e,t){const i=(t==null?void 0:t.force)===!0,r=S.MIRROR_REQUIRED_CONSECUTIVE_DRIFT_SAMPLES,n=S.MIRROR_DRIFT_THRESHOLD_SECONDS;for(const d of this._parentMedia){const l=e-d.start;if(l<0||l>=d.duration){d.driftSamples=0;continue}Math.abs(d.el.currentTime-l)>n?(d.driftSamples+=1,(i||d.driftSamples>=r)&&(d.el.currentTime=l,d.driftSamples=0)):d.driftSamples=0}}_promoteToParentProxy(){this._audioOwner!=="parent"&&(this._audioOwner="parent",this._sendControl("set-media-output-muted",{muted:!0}),this._mirrorParentMediaTime(this._currentTime,{force:!0}),this._paused||this._playParentMedia(),this.dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}})))}_createParentMedia(e,t,i,r){if(this._parentMedia.some(l=>l.el.src===e))return null;const n=t==="video"?document.createElement("video"):new Audio;n.preload="auto",n.src=e,n.load(),n.muted=this.muted,n.volume=this._volume,this.playbackRate!==1&&(n.playbackRate=this.playbackRate);const d={el:n,start:i,duration:r,driftSamples:0};return this._parentMedia.push(d),d}_setupParentAudioFromUrl(e){this._createParentMedia(e,"audio",0,1/0)}_setupParentMedia(){try{const e=this.iframe.contentDocument;if(!e)return;const t=e.querySelectorAll("audio[data-start], video[data-start]");for(const i of t)this._adoptIframeMedia(i);this._observeDynamicMedia(e)}catch{}}_adoptIframeMedia(e){var c;const t=e.getAttribute("src")||((c=e.querySelector("source"))==null?void 0:c.getAttribute("src"));if(!t)return;const i=new URL(t,e.ownerDocument.baseURI).href,r=parseFloat(e.getAttribute("data-start")||"0"),n=parseFloat(e.getAttribute("data-duration")||"Infinity"),d=e.tagName==="VIDEO"?"video":"audio",l=this._createParentMedia(i,d,r,n);l&&this._audioOwner==="parent"&&(this._mirrorParentMediaTime(this._currentTime,{force:!0}),!this._paused&&l.el.src&&l.el.play().catch(u=>this._reportPlaybackError(u)))}_observeDynamicMedia(e){if(this._teardownMediaObserver(),typeof MutationObserver>"u"||!e.body)return;const t=new MutationObserver(r=>{var n,d,l,c;for(const u of r){for(const p of u.addedNodes){if(!(p instanceof Element))continue;const _=[];(n=p.matches)!=null&&n.call(p,"audio[data-start], video[data-start]")&&_.push(p);const g=(d=p.querySelectorAll)==null?void 0:d.call(p,"audio[data-start], video[data-start]");if(g)for(const b of g)_.push(b);for(const b of _)this._adoptIframeMedia(b)}for(const p of u.removedNodes){if(!(p instanceof Element))continue;const _=[];(l=p.matches)!=null&&l.call(p,"audio[data-start], video[data-start]")&&_.push(p);const g=(c=p.querySelectorAll)==null?void 0:c.call(p,"audio[data-start], video[data-start]");if(g)for(const b of g)_.push(b);for(const b of _)this._detachIframeMedia(b)}}}),i=e.querySelectorAll("[data-composition-id]");if(i.length>0)for(const r of i)t.observe(r,{childList:!0,subtree:!0});else t.observe(e.body,{childList:!0,subtree:!0});this._mediaObserver=t}_teardownMediaObserver(){var e;(e=this._mediaObserver)==null||e.disconnect(),this._mediaObserver=void 0}_detachIframeMedia(e){var d;const t=e.getAttribute("src")||((d=e.querySelector("source"))==null?void 0:d.getAttribute("src"));if(!t)return;const i=new URL(t,e.ownerDocument.baseURI).href,r=this._parentMedia.findIndex(l=>l.el.src===i);if(r===-1)return;const n=this._parentMedia[r];n.el.pause(),n.el.src="",this._parentMedia.splice(r,1)}_hidePoster(){var e;(e=this.posterEl)==null||e.remove(),this.posterEl=null}};m(S,"MIRROR_DRIFT_THRESHOLD_SECONDS",.05),m(S,"MIRROR_REQUIRED_CONSECUTIVE_DRIFT_SAMPLES",2);let H=S;customElements.get("hyperframes-player")||customElements.define("hyperframes-player",H);export{H as HyperframesPlayer,ce as SPEED_PRESETS,O as formatSpeed,te as formatTime};
418
+ `,Z='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><polygon points="4,2 16,9 4,16"/></svg>',le='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><rect x="3" y="2" width="4" height="14"/><rect x="11" y="2" width="4" height="14"/></svg>',K='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/><path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',ee='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>',he='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z" opacity="0.3"/><line x1="18" y1="7" x2="14" y2="17" stroke="currentColor" stroke-width="2"/></svg>',ce=[.25,.5,1,1.5,2,4];function O(a){return Number.isInteger(a)?`${a}x`:`${a}x`}function te(a){if(!Number.isFinite(a)||a<0)return"0:00";const h=Math.floor(a),e=Math.floor(h/60),t=h%60;return`${e}:${t.toString().padStart(2,"0")}`}function pe(a,h,e={}){const t=e.speedPresets??ce,i=document.createElement("div");i.className="hfp-controls",i.addEventListener("click",s=>{s.stopPropagation()});const r=document.createElement("button");r.className="hfp-play-btn",r.type="button",r.innerHTML=Z,r.setAttribute("aria-label","Play");const n=document.createElement("div");n.className="hfp-scrubber";const d=document.createElement("div");d.className="hfp-progress",d.style.width="0%",n.appendChild(d);const l=document.createElement("span");l.className="hfp-time",l.textContent="0:00 / 0:00";const c=document.createElement("div");c.className="hfp-speed-wrap";const u=document.createElement("button");u.className="hfp-speed-btn",u.type="button",u.textContent="1x",u.setAttribute("aria-label","Playback speed");const _=document.createElement("div");_.className="hfp-speed-menu",_.setAttribute("role","menu");for(const s of t){const o=document.createElement("button");o.className="hfp-speed-option",o.type="button",o.setAttribute("role","menuitem"),o.dataset.speed=String(s),o.textContent=O(s),s===1&&o.classList.add("hfp-active"),_.appendChild(o)}c.appendChild(_),c.appendChild(u);const p=document.createElement("div");p.className="hfp-volume-wrap";const g=document.createElement("button");g.className="hfp-mute-btn",g.type="button",g.innerHTML=K,g.setAttribute("aria-label","Mute");const b=document.createElement("div");b.className="hfp-volume-slider-wrap";const f=document.createElement("div");f.className="hfp-volume-slider",f.setAttribute("role","slider"),f.setAttribute("aria-label","Volume"),f.setAttribute("aria-valuemin","0"),f.setAttribute("aria-valuemax","100"),f.setAttribute("aria-valuenow","100"),f.tabIndex=0;const y=document.createElement("div");y.className="hfp-volume-fill",y.style.width="100%",f.appendChild(y),b.appendChild(f),p.appendChild(b),p.appendChild(g),i.appendChild(r),i.appendChild(n),i.appendChild(l),i.appendChild(p),i.appendChild(c),a.appendChild(i);let E=!1,w=!1,L=1,M=null;t.indexOf(1);const k=(s,o)=>s?he:o===0||o<.5?ee:K;r.addEventListener("click",s=>{s.stopPropagation(),E?h.onPause():h.onPlay()}),g.addEventListener("click",s=>{s.stopPropagation(),h.onMuteToggle()});let x=!1;const P=s=>{const o=f.getBoundingClientRect(),v=Math.max(0,Math.min(1,(s-o.left)/o.width));L=v,y.style.width=`${v*100}%`,f.setAttribute("aria-valuenow",String(Math.round(v*100))),w&&v>0&&h.onMuteToggle(),g.innerHTML=k(w,v),h.onVolumeChange(v)};f.addEventListener("mousedown",s=>{s.stopPropagation(),x=!0,P(s.clientX)});const U=s=>{x&&P(s.clientX)},V=()=>{x=!1};document.addEventListener("mousemove",U),document.addEventListener("mouseup",V),f.addEventListener("touchstart",s=>{x=!0;const o=s.touches[0];o&&P(o.clientX)},{passive:!0});const $=s=>{if(x){const o=s.touches[0];o&&P(o.clientX)}},z=()=>{x=!1};document.addEventListener("touchmove",$,{passive:!0}),document.addEventListener("touchend",z);const j=.05;f.addEventListener("keydown",s=>{let o=L;if(s.key==="ArrowRight"||s.key==="ArrowUp")o=Math.min(1,L+j);else if(s.key==="ArrowLeft"||s.key==="ArrowDown")o=Math.max(0,L-j);else return;s.preventDefault(),s.stopPropagation(),L=o,y.style.width=`${o*100}%`,f.setAttribute("aria-valuenow",String(Math.round(o*100))),w&&o>0&&h.onMuteToggle(),g.innerHTML=k(w,o),h.onVolumeChange(o)});const B=s=>{for(const o of _.querySelectorAll(".hfp-speed-option"))o.classList.toggle("hfp-active",o.dataset.speed===String(s))};u.addEventListener("click",s=>{s.stopPropagation();const o=_.classList.toggle("hfp-open");u.setAttribute("aria-expanded",String(o))}),_.addEventListener("click",s=>{s.stopPropagation();const o=s.target.closest(".hfp-speed-option");if(!o)return;const v=parseFloat(o.dataset.speed);t.indexOf(v),u.textContent=O(v),B(v),_.classList.remove("hfp-open"),u.setAttribute("aria-expanded","false"),h.onSpeedChange(v)});const W=()=>{_.classList.remove("hfp-open"),u.setAttribute("aria-expanded","false")};document.addEventListener("click",W);const R=s=>{const o=n.getBoundingClientRect(),v=Math.max(0,Math.min(1,(s-o.left)/o.width));h.onSeek(v)};let A=!1;n.addEventListener("mousedown",s=>{s.stopPropagation(),A=!0,R(s.clientX)});const q=s=>{A&&R(s.clientX)},X=()=>{A=!1};document.addEventListener("mousemove",q),document.addEventListener("mouseup",X),n.addEventListener("touchstart",s=>{A=!0;const o=s.touches[0];o&&R(o.clientX)},{passive:!0});const G=s=>{if(A){const o=s.touches[0];o&&R(o.clientX)}},Q=()=>{A=!1};document.addEventListener("touchmove",G,{passive:!0}),document.addEventListener("touchend",Q);const Y=()=>{M&&clearTimeout(M),M=setTimeout(()=>{E&&i.classList.add("hfp-hidden")},3e3)},J=a instanceof ShadowRoot?a.host:a;return J.addEventListener("mousemove",()=>{i.classList.remove("hfp-hidden"),Y()}),J.addEventListener("mouseleave",()=>{E&&i.classList.add("hfp-hidden")}),{updateTime(s,o){const v=o>0?Math.min(s,o):s,ne=o>0?v/o*100:0;d.style.width=`${ne}%`,l.textContent=`${te(v)} / ${te(o)}`},updatePlaying(s){E=s,r.innerHTML=s?le:Z,r.setAttribute("aria-label",s?"Pause":"Play"),s?Y():i.classList.remove("hfp-hidden")},updateSpeed(s){t.indexOf(s),u.textContent=O(s),B(s)},updateMuted(s){w=s,g.innerHTML=k(s,L),g.setAttribute("aria-label",s?"Unmute":"Mute")},updateVolume(s){L=s,y.style.width=`${s*100}%`,f.setAttribute("aria-valuenow",String(Math.round(s*100))),g.innerHTML=k(w,s)},show(){i.style.display=""},hide(){i.style.display="none"},destroy(){document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",X),document.removeEventListener("touchmove",G),document.removeEventListener("touchend",Q),document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",V),document.removeEventListener("touchmove",$),document.removeEventListener("touchend",z),document.removeEventListener("click",W),M&&clearTimeout(M)}}}function ue(a){return a.hasRuntime||a.runtimeInjected?!1:!!(a.hasNestedCompositions||a.hasTimelines&&a.attempts>=5)}let N=null;function me(){if(N)return N;if(typeof CSSStyleSheet>"u")return null;try{const a=new CSSStyleSheet;return a.replaceSync(ae),N=a,a}catch{return null}}const F=30,fe="https://cdn.jsdelivr.net/npm/@hyperframes/core/dist/hyperframe.runtime.iife.js",C="shader-capture-scale",T="shader-loading",_e="__hf_shader_capture_scale",ge="__hf_shader_loading",I=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"];function ie(a){if(a===null)return null;const h=Number(a);return!Number.isFinite(h)||h<=0?null:String(Math.min(1,Math.max(.25,h)))}function re(a){if(a===null||a.trim()==="")return"composition";const h=a.trim().toLowerCase();return h==="none"||h==="false"||h==="0"||h==="off"?"none":h==="player"||h==="true"||h==="1"||h==="on"?"player":"composition"}function se(a,h,e){e===null?a.delete(h):a.set(h,e)}function be(a,h,e){const t=a.indexOf("#"),i=t>=0?a.slice(0,t):a,r=t>=0?a.slice(t):"",n=i.indexOf("?"),d=n>=0?i.slice(0,n):i,l=n>=0?i.slice(n+1):"",c=new URLSearchParams(l);se(c,_e,h),se(c,ge,e==="composition"?null:e);const u=c.toString();return`${d}${u?`?${u}`:""}${r}`}function D(a){return typeof a=="object"&&a!==null}function ve(a){return D(a)&&typeof a.getDuration=="function"}function ye(a){return D(a)&&typeof a.duration=="function"&&typeof a.time=="function"&&typeof a.seek=="function"&&typeof a.play=="function"&&typeof a.pause=="function"}function we(a,h,e){if(h===null&&e==="composition")return a;const t=[];h!==null&&t.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(h)};`),e!=="composition"&&t.push(`window.__HF_SHADER_LOADING=${JSON.stringify(e)};`);const i=`<script data-hyperframes-player-shader-options>${t.join("")}<\/script>`;return/<head\b[^>]*>/i.test(a)?a.replace(/<head\b[^>]*>/i,r=>`${r}${i}`):/<html\b[^>]*>/i.test(a)?a.replace(/<html\b[^>]*>/i,r=>`${r}${i}`):`${i}${a}`}const S=class S extends HTMLElement{constructor(){super();m(this,"shadow");m(this,"container");m(this,"iframe");m(this,"posterEl",null);m(this,"controlsApi",null);m(this,"resizeObserver");m(this,"shaderLoaderEl");m(this,"shaderLoaderFillEl");m(this,"shaderLoaderTitleEl");m(this,"shaderLoaderDetailEl");m(this,"shaderLoaderTransitionValueEl");m(this,"shaderLoaderFrameLabelEl");m(this,"shaderLoaderFrameValueEl");m(this,"shaderLoaderFrameRowEl");m(this,"shaderLoaderHideTimeout",null);m(this,"_ready",!1);m(this,"_duration",0);m(this,"_currentTime",0);m(this,"_paused",!0);m(this,"_volume",1);m(this,"_compositionWidth",1920);m(this,"_compositionHeight",1080);m(this,"_probeInterval",null);m(this,"_lastUpdateMs",0);m(this,"_directTimelineAdapter",null);m(this,"_directTimelineRaf",null);m(this,"_parentMedia",[]);m(this,"_audioOwner","runtime");m(this,"_mediaObserver");m(this,"_playbackErrorPosted",!1);m(this,"_runtimeInjected",!1);this.shadow=this.attachShadow({mode:"open"});const e=me();if(e)this.shadow.adoptedStyleSheets=[e];else{const i=document.createElement("style");i.textContent=ae,this.shadow.appendChild(i)}this.container=document.createElement("div"),this.container.className="hfp-container",this.iframe=document.createElement("iframe"),this.iframe.className="hfp-iframe",this.iframe.sandbox.add("allow-scripts","allow-same-origin"),this.iframe.allow="autoplay; fullscreen",this.iframe.referrerPolicy="no-referrer",this.iframe.title="HyperFrames Composition",this.container.appendChild(this.iframe),this.shadow.appendChild(this.container);const t=this._createShaderLoader();this.shaderLoaderEl=t.root,this.shaderLoaderFillEl=t.fill,this.shaderLoaderTitleEl=t.title,this.shaderLoaderDetailEl=t.detail,this.shaderLoaderTransitionValueEl=t.transitionValue,this.shaderLoaderFrameLabelEl=t.frameLabel,this.shaderLoaderFrameValueEl=t.frameValue,this.shaderLoaderFrameRowEl=t.frameRow,this.shadow.appendChild(this.shaderLoaderEl),this.addEventListener("click",i=>{this._isControlsClick(i)||(this._paused?this.play():this.pause())}),this.resizeObserver=new ResizeObserver(()=>this._updateScale()),this._onMessage=this._onMessage.bind(this),this._onIframeLoad=this._onIframeLoad.bind(this)}static get observedAttributes(){return["src","srcdoc","width","height","controls","muted","volume","poster","playback-rate","audio-src",C,T]}connectedCallback(){this.resizeObserver.observe(this),window.addEventListener("message",this._onMessage),this.iframe.addEventListener("load",this._onIframeLoad),this.hasAttribute("controls")&&this._setupControls(),this.hasAttribute("poster")&&this._setupPoster(),this.hasAttribute("audio-src")&&this._setupParentAudioFromUrl(this.getAttribute("audio-src")),this.hasAttribute("srcdoc")&&(this.iframe.srcdoc=this._prepareSrcdoc(this.getAttribute("srcdoc"))),this.hasAttribute("src")&&(this.iframe.src=this._prepareSrc(this.getAttribute("src")))}disconnectedCallback(){var e;this.resizeObserver.disconnect(),window.removeEventListener("message",this._onMessage),this.iframe.removeEventListener("load",this._onIframeLoad),this._probeInterval&&clearInterval(this._probeInterval),this._stopDirectTimelineClock(),this._directTimelineAdapter=null,this.shaderLoaderHideTimeout&&clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=null,this._teardownMediaObserver(),(e=this.controlsApi)==null||e.destroy();for(const t of this._parentMedia)t.el.pause(),t.el.src="";this._parentMedia=[]}attributeChangedCallback(e,t,i){var r,n,d,l;switch(e){case"src":i&&(this._ready=!1,this.iframe.src=this._prepareSrc(i));break;case"srcdoc":this._ready=!1,i!==null?this.iframe.srcdoc=this._prepareSrcdoc(i):this.iframe.removeAttribute("srcdoc");break;case"width":this._compositionWidth=parseInt(i||"1920",10),this._updateScale();break;case"height":this._compositionHeight=parseInt(i||"1080",10),this._updateScale();break;case"controls":i!==null?this._setupControls():((r=this.controlsApi)==null||r.destroy(),this.controlsApi=null);break;case"poster":this._setupPoster();break;case"playback-rate":{const c=parseFloat(i||"1");for(const u of this._parentMedia)u.el.playbackRate=c;this._sendControl("set-playback-rate",{playbackRate:c}),(n=this.controlsApi)==null||n.updateSpeed(c),this.dispatchEvent(new Event("ratechange"));break}case"muted":for(const c of this._parentMedia)c.el.muted=i!==null;this._sendControl("set-muted",{muted:i!==null}),(d=this.controlsApi)==null||d.updateMuted(i!==null),this.dispatchEvent(new Event("volumechange"));break;case"volume":{const c=Math.max(0,Math.min(1,parseFloat(i||"1")));this._volume=c;for(const u of this._parentMedia)u.el.volume=c;this._sendControl("set-volume",{volume:c}),(l=this.controlsApi)==null||l.updateVolume(c),this.dispatchEvent(new Event("volumechange"));break}case"audio-src":i&&this._setupParentAudioFromUrl(i);break;case C:case T:this._reloadShaderOptions();break}}get iframeElement(){return this.iframe}play(){var t;this._hidePoster(),this._duration>0&&this._currentTime>=this._duration&&this.seek(0);const e=this._tryDirectTimelinePlay();e||this._sendControl("play"),this._audioOwner==="parent"&&this._playParentMedia(),this._paused=!1,(t=this.controlsApi)==null||t.updatePlaying(!0),this.dispatchEvent(new Event("play")),e&&this._startDirectTimelineClock()}pause(){var e;this._tryDirectTimelinePause()||this._sendControl("pause"),this._stopDirectTimelineClock(),this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=!0,(e=this.controlsApi)==null||e.updatePlaying(!1),this.dispatchEvent(new Event("pause"))}seek(e){var t,i;if(!this._trySyncSeek(e)&&!this._tryDirectTimelineSeek(e)){const r=Math.round(e*F);this._sendControl("seek",{frame:r})}if(this._stopDirectTimelineClock(),this._currentTime=e,this._audioOwner==="parent")for(const r of this._parentMedia){const n=e-r.start;n>=0&&n<r.duration&&(r.el.currentTime=n)}this._paused=!0,(t=this.controlsApi)==null||t.updatePlaying(!1),(i=this.controlsApi)==null||i.updateTime(this._currentTime,this._duration)}get currentTime(){return this._currentTime}set currentTime(e){this.seek(e)}get duration(){return this._duration}get paused(){return this._paused}get ready(){return this._ready}get playbackRate(){return parseFloat(this.getAttribute("playback-rate")||"1")}set playbackRate(e){this.setAttribute("playback-rate",String(e))}get shaderCaptureScale(){return Number(ie(this.getAttribute(C))??"1")}set shaderCaptureScale(e){this.setAttribute(C,String(e))}get shaderLoading(){return re(this.getAttribute(T))}set shaderLoading(e){e==="composition"?this.removeAttribute(T):this.setAttribute(T,e)}get muted(){return this.hasAttribute("muted")}set muted(e){e?this.setAttribute("muted",""):this.removeAttribute("muted")}get volume(){return this._volume}set volume(e){this.setAttribute("volume",String(Math.max(0,Math.min(1,e))))}get loop(){return this.hasAttribute("loop")}set loop(e){e?this.setAttribute("loop",""):this.removeAttribute("loop")}_sendControl(e,t={}){var i;try{(i=this.iframe.contentWindow)==null||i.postMessage({source:"hf-parent",type:"control",action:e,...t},"*")}catch{}}_shaderCaptureScaleParam(){return ie(this.getAttribute(C))}_shaderLoadingMode(){return re(this.getAttribute(T))}_prepareSrc(e){return be(e,this._shaderCaptureScaleParam(),this._shaderLoadingMode())}_prepareSrcdoc(e){return we(e,this._shaderCaptureScaleParam(),this._shaderLoadingMode())}_reloadShaderOptions(){if(this._shaderLoadingMode()!=="player"&&this._resetShaderLoader(),this.hasAttribute("srcdoc")){this.iframe.srcdoc=this._prepareSrcdoc(this.getAttribute("srcdoc")||"");return}this.hasAttribute("src")&&(this.iframe.src=this._prepareSrc(this.getAttribute("src")||""))}_createShaderLoader(){const e=document.createElement("div");e.className="hfp-shader-loader",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-label","Preparing scene transitions"),e.setAttribute("data-hyperframes-ignore",""),e.draggable=!1;const t=f=>{f.preventDefault(),f.stopPropagation()};for(const f of["selectstart","dragstart","pointerdown","mousedown","click","dblclick","contextmenu","touchstart"])e.addEventListener(f,t,{capture:!0});const i=document.createElement("div");i.className="hfp-shader-loader-panel",i.draggable=!1;const r=document.createElement("div");r.className="hfp-shader-loader-mark",r.draggable=!1,r.innerHTML=['<svg width="78" height="78" viewBox="0 0 100 100" fill="none" aria-hidden="true" draggable="false">','<path d="M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z" fill="url(#hfp-shader-loader-grad-left)"/>','<path d="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z" fill="url(#hfp-shader-loader-grad-right)"/>',"<defs>",'<linearGradient id="hfp-shader-loader-grad-left" x1="48.5676" y1="25" x2="44.7804" y2="71.9384" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>",'<linearGradient id="hfp-shader-loader-grad-right" x1="54.8282" y1="73.8392" x2="72.0989" y2="32.8932" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>","</defs>","</svg>"].join("");const n=document.createElement("div");n.className="hfp-shader-loader-title";const d=document.createElement("span");d.className="hfp-shader-loader-title-text",d.textContent=I[0],n.appendChild(d);const l=document.createElement("div");l.className="hfp-shader-loader-detail",l.textContent="Rendering animated scene samples for shader transitions.";const c=document.createElement("div");c.className="hfp-shader-loader-track",c.setAttribute("aria-hidden","true");const u=document.createElement("div");u.className="hfp-shader-loader-fill",c.appendChild(u);const _=document.createElement("div");_.className="hfp-shader-loader-progress";const p=f=>{const y=document.createElement("div");y.className="hfp-shader-loader-row";const E=document.createElement("span");E.className="hfp-shader-loader-label",E.textContent=f;const w=document.createElement("span");return w.className="hfp-shader-loader-value",y.appendChild(E),y.appendChild(w),_.appendChild(y),{row:y,label:E,value:w}},g=p("transition"),b=p("transition frame");return i.appendChild(r),i.appendChild(n),i.appendChild(l),i.appendChild(c),i.appendChild(_),e.appendChild(i),{root:e,fill:u,title:d,detail:l,transitionValue:g.value,frameLabel:b.label,frameValue:b.value,frameRow:b.row}}_showShaderLoader(){this.shaderLoaderHideTimeout&&(clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=null),this.shaderLoaderEl.classList.remove("hfp-hiding"),this.shaderLoaderEl.classList.add("hfp-visible")}_hideShaderLoader(){if(this.shaderLoaderEl.classList.contains("hfp-hiding")){this.shaderLoaderHideTimeout||this._scheduleShaderLoaderHideCleanup();return}this.shaderLoaderEl.classList.contains("hfp-visible")&&(this.shaderLoaderEl.classList.add("hfp-hiding"),this.shaderLoaderEl.classList.remove("hfp-visible"),this._scheduleShaderLoaderHideCleanup())}_scheduleShaderLoaderHideCleanup(){this.shaderLoaderHideTimeout&&clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=setTimeout(()=>{this.shaderLoaderEl.classList.remove("hfp-hiding"),this.shaderLoaderHideTimeout=null},420)}_resetShaderLoader(){this.shaderLoaderHideTimeout&&(clearTimeout(this.shaderLoaderHideTimeout),this.shaderLoaderHideTimeout=null),this.shaderLoaderEl.classList.remove("hfp-visible","hfp-hiding"),this.shaderLoaderFillEl.style.transform="scaleX(0)",this.shaderLoaderTransitionValueEl.textContent="",this.shaderLoaderFrameValueEl.textContent="",this.shaderLoaderFrameRowEl.style.visibility="hidden"}_updateShaderLoader(e){if(this._shaderLoadingMode()!=="player"){this._resetShaderLoader();return}if(e.ready||!e.loading){this._hideShaderLoader();return}const t=typeof e.progress=="number"&&Number.isFinite(e.progress)?e.progress:0,i=typeof e.total=="number"&&Number.isFinite(e.total)?e.total:0,r=i>0?Math.min(1,Math.max(0,t/i)):0,n=Math.min(I.length-1,Math.floor(r*I.length));this.shaderLoaderTitleEl.textContent=I[n]||"Preparing scene transitions",this.shaderLoaderDetailEl.textContent=e.phase==="cached"?"Loading cached transition frames before playback.":e.phase==="finalizing"?"Uploading transition textures for smooth playback.":"Rendering animated scene samples for shader transitions.",this.shaderLoaderFillEl.style.transform=`scaleX(${r})`,this.shaderLoaderTransitionValueEl.textContent=e.currentTransition!==void 0&&e.transitionTotal!==void 0?`${e.currentTransition}/${e.transitionTotal}`:i>0?`${t}/${i}`:"";const d=e.transitionFrame!==void 0&&e.transitionFrames!==void 0?`${e.transitionFrame}/${e.transitionFrames}`:"";this.shaderLoaderFrameLabelEl.textContent=e.phase==="cached"?"cached transition frames":e.phase==="finalizing"?"finalizing transition frames":"rendering transition frames",this.shaderLoaderFrameValueEl.textContent=d,this.shaderLoaderFrameRowEl.style.visibility=d?"visible":"hidden",this.shaderLoaderEl.setAttribute("aria-valuenow",String(Math.round(r*100))),this._showShaderLoader()}_trySyncSeek(e){try{const t=this.iframe.contentWindow,i=t==null?void 0:t.__player,r=i==null?void 0:i.seek;return typeof r!="function"?!1:(r.call(i,e),!0)}catch{return!1}}_tryDirectTimelineSeek(e){const t=this._directTimelineAdapter||this._resolveDirectTimelineAdapter();if(!t)return!1;try{return t.seek(e),t.pause(),this._directTimelineAdapter=t,!0}catch{return!1}}_tryDirectTimelinePlay(){const e=this._directTimelineAdapter||this._resolveDirectTimelineAdapter();if(!e)return!1;try{return e.play(),this._directTimelineAdapter=e,!0}catch{return!1}}_tryDirectTimelinePause(){const e=this._directTimelineAdapter||this._resolveDirectTimelineAdapter();if(!e)return!1;try{return e.pause(),this._directTimelineAdapter=e,!0}catch{return!1}}_startDirectTimelineClock(){this._stopDirectTimelineClock();const e=()=>{var d,l;const t=this._directTimelineAdapter;if(!t||this._paused){this._directTimelineRaf=null;return}let i;try{i=t.time()}catch{this._directTimelineRaf=null;return}this._duration>0&&(i=Math.min(i,this._duration)),this._currentTime=i;const r=this._duration>0&&i>=this._duration,n=performance.now();if((n-this._lastUpdateMs>100||r)&&(this._lastUpdateMs=n,(d=this.controlsApi)==null||d.updateTime(this._currentTime,this._duration),this.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:this._currentTime}}))),r){if(this.loop){this.seek(0),this.play();return}t.pause(),this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=!0,(l=this.controlsApi)==null||l.updatePlaying(!1),this.dispatchEvent(new Event("ended")),this._directTimelineRaf=null;return}this._directTimelineRaf=requestAnimationFrame(e)};this._directTimelineRaf=requestAnimationFrame(e)}_stopDirectTimelineClock(){this._directTimelineRaf!==null&&(cancelAnimationFrame(this._directTimelineRaf),this._directTimelineRaf=null)}_resolveDirectTimelineAdapter(){try{const e=this.iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}_resolveDirectTimelineAdapterFromWindow(e){var l,c;if(this._hasRuntimeBridge(e))return null;const t=Reflect.get(e,"__timelines");if(!D(t))return null;const i=Object.keys(t);if(i.length===0)return null;const r=(c=(l=this.iframe.contentDocument)==null?void 0:l.querySelector("[data-composition-id]"))==null?void 0:c.getAttribute("data-composition-id"),n=r&&r in t?r:i[i.length-1],d=t[n];return ye(d)?d:null}_hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||D(Reflect.get(e,"__player"))}_resolvePlaybackDurationAdapter(e){const t=Reflect.get(e,"__player");if(ve(t))return{kind:"runtime",getDuration:()=>t.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(e);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}_isControlsClick(e){return e.composedPath().some(t=>t instanceof HTMLElement&&t.classList.contains("hfp-controls"))}_onMessage(e){var i,r,n,d;if(e.source!==this.iframe.contentWindow)return;const t=e.data;if(!(!t||t.source!=="hf-preview")){if(t.type==="shader-transition-state"){const l=t.state&&typeof t.state=="object"?t.state:{};this._updateShaderLoader(l),this.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:t.compositionId,state:l}}));return}if(t.type==="state"){const l=(t.frame??0)/F;this._currentTime=this._duration>0?Math.min(l,this._duration):l;const c=!this._paused,u=!t.isPlaying,_=this._duration>0&&this._currentTime>=this._duration&&(c||t.isPlaying);if(_&&this.loop){this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=u,this.seek(0),this.play();return}this._paused=u,this._audioOwner==="parent"&&(c&&this._paused?this._pauseParentMedia():!c&&!this._paused&&this._playParentMedia(),this._mirrorParentMediaTime(this._currentTime));const p=performance.now();(p-this._lastUpdateMs>100||this._paused!==c)&&(this._lastUpdateMs=p,(i=this.controlsApi)==null||i.updateTime(this._currentTime,this._duration),(r=this.controlsApi)==null||r.updatePlaying(!this._paused),this.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:this._currentTime}}))),_&&(this._audioOwner==="parent"&&this._pauseParentMedia(),this._paused=!0,(n=this.controlsApi)==null||n.updatePlaying(!1),this.dispatchEvent(new Event("ended")))}t.type==="media-autoplay-blocked"&&this._promoteToParentProxy(),t.type==="timeline"&&t.durationInFrames>0&&Number.isFinite(t.durationInFrames)&&(this._duration=t.durationInFrames/F,(d=this.controlsApi)==null||d.updateTime(this._currentTime,this._duration)),t.type==="stage-size"&&t.width>0&&t.height>0&&(this._compositionWidth=t.width,this._compositionHeight=t.height,this._updateScale())}}_onIframeLoad(){let e=0;this._runtimeInjected=!1,this._directTimelineAdapter=null,this._stopDirectTimelineClock(),this._resetShaderLoader();const t=this._audioOwner==="parent";this._audioOwner="runtime",this._playbackErrorPosted=!1,this._pauseParentMedia(),this._teardownMediaObserver(),t&&this.dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}})),this._probeInterval&&clearInterval(this._probeInterval),this._probeInterval=setInterval(()=>{var i,r;e++;try{const n=this.iframe.contentWindow;if(!n)return;const d=!!(n.__hf||n.__player),l=!!(n.__timelines&&Object.keys(n.__timelines).length>0),c=!!((i=this.iframe.contentDocument)!=null&&i.querySelector("[data-composition-src]"));if(ue({hasRuntime:d,hasTimelines:l,hasNestedCompositions:c,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!d)return;const u=this._resolvePlaybackDurationAdapter(n);if(u&&u.getDuration()>0){clearInterval(this._probeInterval),this._duration=u.getDuration(),this._directTimelineAdapter=u.kind==="direct-timeline"?u.timeline:null,this._ready=!0,(r=this.controlsApi)==null||r.updateTime(0,this._duration),this.dispatchEvent(new CustomEvent("ready",{detail:{duration:this._duration}}));const _=this.iframe.contentDocument,p=_==null?void 0:_.querySelector("[data-composition-id]");if(p){const g=parseInt(p.getAttribute("data-width")||"0",10),b=parseInt(p.getAttribute("data-height")||"0",10);g>0&&b>0&&(this._compositionWidth=g,this._compositionHeight=b,this._updateScale())}this._setupParentMedia(),this.hasAttribute("autoplay")&&this.play();return}}catch{}e>=40&&(clearInterval(this._probeInterval),this.dispatchEvent(new CustomEvent("error",{detail:{message:"Composition timeline not found after 8s"}})))},200)}_injectRuntime(){this._runtimeInjected=!0;try{const e=this.iframe.contentDocument;if(!e)return;const t=e.createElement("script");t.src=fe,t.onload=()=>{},t.onerror=()=>{},(e.head||e.documentElement).appendChild(t)}catch{}}_updateScale(){const e=this.getBoundingClientRect();if(e.width===0||e.height===0)return;const t=Math.min(e.width/this._compositionWidth,e.height/this._compositionHeight);this.iframe.style.width=`${this._compositionWidth}px`,this.iframe.style.height=`${this._compositionHeight}px`,this.iframe.style.transform=`translate(-50%, -50%) scale(${t})`}_setupControls(){if(this.controlsApi)return;const e={onPlay:()=>this.play(),onPause:()=>this.pause(),onSeek:r=>this.seek(r*this._duration),onSpeedChange:r=>{this.playbackRate=r},onMuteToggle:()=>{this.muted=!this.muted},onVolumeChange:r=>{this.volume=r}},t=this.getAttribute("speed-presets"),i=t?t.split(",").map(Number).filter(r=>!isNaN(r)&&r>0):void 0;this.controlsApi=pe(this.shadow,e,{speedPresets:i}),this.controlsApi.updateMuted(this.muted),this.controlsApi.updateVolume(this._volume)}_setupPoster(){var t;const e=this.getAttribute("poster");if(!e){(t=this.posterEl)==null||t.remove(),this.posterEl=null;return}this.posterEl||(this.posterEl=document.createElement("img"),this.posterEl.className="hfp-poster",this.shadow.appendChild(this.posterEl)),this.posterEl.src=e}_playParentMedia(){for(const e of this._parentMedia)e.el.src&&e.el.play().catch(t=>this._reportPlaybackError(t))}_reportPlaybackError(e){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this.dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:e}})))}_pauseParentMedia(){for(const e of this._parentMedia)e.el.pause()}_mirrorParentMediaTime(e,t){const i=(t==null?void 0:t.force)===!0,r=S.MIRROR_REQUIRED_CONSECUTIVE_DRIFT_SAMPLES,n=S.MIRROR_DRIFT_THRESHOLD_SECONDS;for(const d of this._parentMedia){const l=e-d.start;if(l<0||l>=d.duration){d.driftSamples=0;continue}Math.abs(d.el.currentTime-l)>n?(d.driftSamples+=1,(i||d.driftSamples>=r)&&(d.el.currentTime=l,d.driftSamples=0)):d.driftSamples=0}}_promoteToParentProxy(){if(this._audioOwner!=="parent"){this._audioOwner="parent";try{const e=this.iframe.contentDocument;if(e)for(const t of e.querySelectorAll("video, audio"))t.muted=!0}catch{}this._sendControl("set-media-output-muted",{muted:!0}),this._mirrorParentMediaTime(this._currentTime,{force:!0}),this._paused||this._playParentMedia(),this.dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}}))}}_createParentMedia(e,t,i,r){if(this._parentMedia.some(l=>l.el.src===e))return null;const n=t==="video"?document.createElement("video"):new Audio;n.preload="auto",n.src=e,n.load(),n.muted=this.muted,n.volume=this._volume,this.playbackRate!==1&&(n.playbackRate=this.playbackRate);const d={el:n,start:i,duration:r,driftSamples:0};return this._parentMedia.push(d),d}_setupParentAudioFromUrl(e){this._createParentMedia(e,"audio",0,1/0)}_setupParentMedia(){try{const e=this.iframe.contentDocument;if(!e)return;const t=e.querySelectorAll("audio[data-start], video[data-start]");for(const i of t)this._adoptIframeMedia(i);this._observeDynamicMedia(e)}catch{}}_adoptIframeMedia(e){var c;if(e.preload==="metadata"||e.preload==="none")return;const t=e.getAttribute("src")||((c=e.querySelector("source"))==null?void 0:c.getAttribute("src"));if(!t)return;const i=new URL(t,e.ownerDocument.baseURI).href,r=parseFloat(e.getAttribute("data-start")||"0"),n=parseFloat(e.getAttribute("data-duration")||"Infinity"),d=e.tagName==="VIDEO"?"video":"audio",l=this._createParentMedia(i,d,r,n);l&&this._audioOwner==="parent"&&(this._mirrorParentMediaTime(this._currentTime,{force:!0}),!this._paused&&l.el.src&&l.el.play().catch(u=>this._reportPlaybackError(u)))}_observeDynamicMedia(e){if(this._teardownMediaObserver(),typeof MutationObserver>"u"||!e.body)return;const t=new MutationObserver(n=>{var d,l,c,u;for(const _ of n){if(_.type==="attributes"&&_.attributeName==="preload"){const p=_.target;p instanceof HTMLMediaElement&&p.matches("audio[data-start], video[data-start]")&&p.preload==="auto"&&this._adoptIframeMedia(p);continue}for(const p of _.addedNodes){if(!(p instanceof Element))continue;const g=[];(d=p.matches)!=null&&d.call(p,"audio[data-start], video[data-start]")&&g.push(p);const b=(l=p.querySelectorAll)==null?void 0:l.call(p,"audio[data-start], video[data-start]");if(b)for(const f of b)g.push(f);for(const f of g)this._adoptIframeMedia(f)}for(const p of _.removedNodes){if(!(p instanceof Element))continue;const g=[];(c=p.matches)!=null&&c.call(p,"audio[data-start], video[data-start]")&&g.push(p);const b=(u=p.querySelectorAll)==null?void 0:u.call(p,"audio[data-start], video[data-start]");if(b)for(const f of b)g.push(f);for(const f of g)this._detachIframeMedia(f)}}}),i={childList:!0,subtree:!0,attributes:!0,attributeFilter:["preload"]},r=e.querySelectorAll("[data-composition-id]");if(r.length>0)for(const n of r)t.observe(n,i);else t.observe(e.body,i);this._mediaObserver=t}_teardownMediaObserver(){var e;(e=this._mediaObserver)==null||e.disconnect(),this._mediaObserver=void 0}_detachIframeMedia(e){var d;const t=e.getAttribute("src")||((d=e.querySelector("source"))==null?void 0:d.getAttribute("src"));if(!t)return;const i=new URL(t,e.ownerDocument.baseURI).href,r=this._parentMedia.findIndex(l=>l.el.src===i);if(r===-1)return;const n=this._parentMedia[r];n.el.pause(),n.el.src="",this._parentMedia.splice(r,1)}_hidePoster(){var e;(e=this.posterEl)==null||e.remove(),this.posterEl=null}};m(S,"MIRROR_DRIFT_THRESHOLD_SECONDS",.05),m(S,"MIRROR_REQUIRED_CONSECUTIVE_DRIFT_SAMPLES",2);let H=S;customElements.get("hyperframes-player")||customElements.define("hyperframes-player",H);export{H as HyperframesPlayer,ce as SPEED_PRESETS,O as formatSpeed,te as formatTime};
@@ -0,0 +1 @@
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-1\.5{bottom:-.375rem}.-right-1\.5{right:-.375rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.bottom-2{bottom:.5rem}.bottom-6{bottom:1.5rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-\[100px\]{left:100px}.left-\[176px\]{left:176px}.left-\[24px\]{left:24px}.left-\[31px\]{left:31px}.left-\[34px\]{left:34px}.left-\[52px\]{left:52px}.left-\[82px\]{left:82px}.right-0{right:0}.right-3{right:.75rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3{top:.75rem}.top-\[18px\]{top:18px}.top-\[21px\]{top:21px}.top-\[27px\]{top:27px}.top-\[3px\]{top:3px}.top-\[51px\]{top:51px}.top-\[calc\(100\%\+6px\)\]{top:calc(100% + 6px)}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.z-\[200\]{z-index:200}.z-\[2\]{z-index:2}.z-\[90\]{z-index:90}.z-\[91\]{z-index:91}.z-\[9999\]{z-index:9999}.mx-1{margin-left:.25rem;margin-right:.25rem}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-0\.5{margin-bottom:.125rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-\[22px\]{margin-top:22px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-2{height:.5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-36{height:9rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[18px\]{height:18px}.h-\[3px\]{height:3px}.h-\[45px\]{height:45px}.h-\[52px\]{height:52px}.h-\[5px\]{height:5px}.h-\[70px\]{height:70px}.h-full{height:100%}.h-px{height:1px}.max-h-24{max-height:6rem}.max-h-64{max-height:16rem}.max-h-\[70\%\]{max-height:70%}.max-h-\[80vh\]{max-height:80vh}.max-h-full{max-height:100%}.min-h-0{min-height:0px}.min-h-7{min-height:1.75rem}.min-h-8{min-height:2rem}.min-h-9{min-height:2.25rem}.w-0{width:0px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-52{width:13rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[110px\]{width:110px}.w-\[118px\]{width:118px}.w-\[160px\]{width:160px}.w-\[292px\]{width:292px}.w-\[320px\]{width:320px}.w-\[480px\]{width:480px}.w-\[56px\]{width:56px}.w-\[58px\]{width:58px}.w-\[72px\]{width:72px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-7{min-width:1.75rem}.min-w-8{min-width:2rem}.min-w-9{min-width:2.25rem}.min-w-\[140px\]{min-width:140px}.min-w-\[160px\]{min-width:160px}.min-w-\[52px\]{min-width:52px}.min-w-\[56px\]{min-width:56px}.min-w-\[58px\]{min-width:58px}.min-w-\[96px\]{min-width:96px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-\[calc\(100vw-2rem\)\]{max-width:calc(100vw - 2rem)}.max-w-full{max-width:100%}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.flex-grow,.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\!transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.\!resize{resize:both!important}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[minmax\(0\,1fr\)_68px_28px\]{grid-template-columns:minmax(0,1fr) 68px 28px}.grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}.grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.grid-cols-\[repeat\(auto-fit\,minmax\(118px\,1fr\)\)\]{grid-template-columns:repeat(auto-fit,minmax(118px,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-y-1{row-gap:.25rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[11px\]{border-radius:11px}.rounded-\[14px\]{border-radius:14px}.rounded-\[18px\]{border-radius:18px}.rounded-\[9px\]{border-radius:9px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-green-500\/30{border-color:#22c55e4d}.border-neutral-600{--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.border-neutral-700{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.border-neutral-700\/40{border-color:#40404066}.border-neutral-700\/50{border-color:#40404080}.border-neutral-700\/60{border-color:#40404099}.border-neutral-800{--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.border-neutral-800\/30{border-color:#2626264d}.border-neutral-800\/40{border-color:#26262666}.border-neutral-800\/50{border-color:#26262680}.border-neutral-800\/60{border-color:#26262699}.border-neutral-800\/80{border-color:#262626cc}.border-neutral-900{--tw-border-opacity: 1;border-color:rgb(23 23 23 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-red-700\/50{border-color:#b91c1c80}.border-studio-accent{--tw-border-opacity: 1;border-color:rgb(60 230 172 / var(--tw-border-opacity, 1))}.border-studio-accent\/25{border-color:#3ce6ac40}.border-studio-accent\/30{border-color:#3ce6ac4d}.border-studio-accent\/40{border-color:#3ce6ac66}.border-studio-accent\/50{border-color:#3ce6ac80}.border-studio-accent\/60{border-color:#3ce6ac99}.border-studio-accent\/70{border-color:#3ce6acb3}.border-studio-accent\/80{border-color:#3ce6accc}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-white\/10{border-color:#ffffff1a}.border-white\/90{border-color:#ffffffe6}.border-yellow-400\/30{border-color:#facc154d}.bg-\[\#0a0a0b\]{--tw-bg-opacity: 1;background-color:rgb(10 10 11 / var(--tw-bg-opacity, 1))}.bg-\[\#0d1117\]{--tw-bg-opacity: 1;background-color:rgb(13 17 23 / var(--tw-bg-opacity, 1))}.bg-\[\#0f141c\]{--tw-bg-opacity: 1;background-color:rgb(15 20 28 / var(--tw-bg-opacity, 1))}.bg-\[\#3CE6AC\]\/10{background-color:#3ce6ac1a}.bg-\[\#3CE6AC\]\/5{background-color:#3ce6ac0d}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/20{background-color:#0003}.bg-black\/25{background-color:#00000040}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/60{background-color:#0009}.bg-green-500\/20{background-color:#22c55e33}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-neutral-600{--tw-bg-opacity: 1;background-color:rgb(82 82 82 / var(--tw-bg-opacity, 1))}.bg-neutral-700{--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.bg-neutral-700\/40{background-color:#40404066}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.bg-neutral-800\/60{background-color:#26262699}.bg-neutral-800\/70{background-color:#262626b3}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.bg-neutral-900\/50{background-color:#17171780}.bg-neutral-900\/60{background-color:#17171799}.bg-neutral-900\/80{background-color:#171717cc}.bg-neutral-900\/95{background-color:#171717f2}.bg-neutral-950{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-neutral-950\/80{background-color:#0a0a0acc}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-900\/60{background-color:#7f1d1d99}.bg-red-900\/90{background-color:#7f1d1de6}.bg-red-950\/30{background-color:#450a0a4d}.bg-studio-accent{--tw-bg-opacity: 1;background-color:rgb(60 230 172 / var(--tw-bg-opacity, 1))}.bg-studio-accent\/10{background-color:#3ce6ac1a}.bg-studio-accent\/15{background-color:#3ce6ac26}.bg-studio-accent\/20{background-color:#3ce6ac33}.bg-studio-accent\/5{background-color:#3ce6ac0d}.bg-studio-accent\/60{background-color:#3ce6ac99}.bg-studio-accent\/90{background-color:#3ce6ace6}.bg-studio-accent\/\[0\.03\]{background-color:#3ce6ac08}.bg-studio-accent\/\[0\.05\]{background-color:#3ce6ac0d}.bg-studio-accent\/\[0\.06\]{background-color:#3ce6ac0f}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/5{background-color:#ffffff0d}.bg-white\/70{background-color:#ffffffb3}.bg-white\/\[0\.035\]{background-color:#ffffff09}.bg-white\/\[0\.04\]{background-color:#ffffff0a}.bg-white\/\[0\.07\]{background-color:#ffffff12}.bg-yellow-400\/10{background-color:#facc151a}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black{--tw-gradient-from: #000 var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-white{--tw-gradient-from: #fff var(--tw-gradient-from-position);--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.fill-neutral-400{fill:#a3a3a3}.fill-neutral-500{fill:#737373}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0\.5{padding-bottom:.125rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-6{padding-left:1.5rem}.pr-1{padding-right:.25rem}.pr-9{padding-right:2.25rem}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\[0\.08em\]{letter-spacing:.08em}.tracking-\[0\.12em\]{letter-spacing:.12em}.tracking-\[0\.14em\]{letter-spacing:.14em}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.22em\]{letter-spacing:.22em}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-\[\#09090B\]{--tw-text-opacity: 1;color:rgb(9 9 11 / var(--tw-text-opacity, 1))}.text-\[\#3ce6ac\]{--tw-text-opacity: 1;color:rgb(60 230 172 / var(--tw-text-opacity, 1))}.text-\[\#7f8796\]{--tw-text-opacity: 1;color:rgb(127 135 150 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-neutral-100{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.text-neutral-200{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-neutral-50{--tw-text-opacity: 1;color:rgb(250 250 250 / var(--tw-text-opacity, 1))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.text-neutral-600{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.text-neutral-700{--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.text-neutral-950{--tw-text-opacity: 1;color:rgb(10 10 10 / var(--tw-text-opacity, 1))}.text-purple-400{--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-studio-accent{--tw-text-opacity: 1;color:rgb(60 230 172 / var(--tw-text-opacity, 1))}.text-studio-accent\/50{color:#3ce6ac80}.text-studio-accent\/80{color:#3ce6accc}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.placeholder-neutral-600::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(82 82 82 / var(--tw-placeholder-opacity, 1))}.placeholder-neutral-600::placeholder{--tw-placeholder-opacity: 1;color:rgb(82 82 82 / var(--tw-placeholder-opacity, 1))}.accent-\[\#3ce6ac\]{accent-color:#3ce6ac}.accent-studio-accent{accent-color:#3CE6AC}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.mix-blend-difference{mix-blend-mode:difference}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.35\)\]{--tw-shadow: 0 0 0 1px rgba(0,0,0,.35);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow: 0 0 0 1px rgba(0,0,0,.45);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.85\)\,0_6px_14px_rgba\(0\,0\,0\,0\.5\)\]{--tw-shadow: 0 0 0 1px rgba(0,0,0,.85),0 6px 14px rgba(0,0,0,.5);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 0 6px 14px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(0\,0\,0\,0\.85\)\,0_8px_18px_rgba\(0\,0\,0\,0\.45\)\]{--tw-shadow: 0 0 0 1px rgba(0,0,0,.85),0 8px 18px rgba(0,0,0,.45);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color), 0 8px 18px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(60\,230\,172\,0\.25\)\]{--tw-shadow: 0 0 0 1px rgba(60,230,172,.25);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_rgba\(60\,230\,172\,0\.3\)\]{--tw-shadow: 0 0 0 1px rgba(60,230,172,.3);--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_2px_rgba\(60\,230\,172\,0\.18\)\]{--tw-shadow: 0 0 0 2px rgba(60,230,172,.18);--tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_18px_40px_rgba\(0\,0\,0\,0\.3\)\,0_4px_14px_rgba\(0\,0\,0\,0\.18\)\]{--tw-shadow: 0 18px 40px rgba(0,0,0,.3),0 4px 14px rgba(0,0,0,.18);--tw-shadow-colored: 0 18px 40px var(--tw-shadow-color), 0 4px 14px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_2px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow: 0 1px 2px rgba(0,0,0,.2);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_3px_rgba\(0\,0\,0\,0\.28\)\]{--tw-shadow: 0 1px 3px rgba(0,0,0,.28);--tw-shadow-colored: 0 1px 3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_0_0_1px_rgba\(255\,255\,255\,0\.06\)\]{--tw-shadow: inset 0 0 0 1px rgba(255,255,255,.06);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.03\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.03);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.04\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.04);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.08\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.08);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_2px_rgba\(0\,0\,0\,0\.55\)\]{--tw-shadow: inset 0 1px 2px rgba(0,0,0,.55);--tw-shadow-colored: inset 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-black\/40{--tw-shadow-color: rgb(0 0 0 / .4);--tw-shadow: var(--tw-shadow-colored)}.shadow-black\/50{--tw-shadow-color: rgb(0 0 0 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-1{outline-width:1px}.-outline-offset-1{outline-offset:-1px}.outline-\[\#3CE6AC\]\/30{outline-color:#3ce6ac4d}.outline-\[\#3CE6AC\]\/40{outline-color:#3ce6ac66}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-studio-accent{--tw-ring-opacity: 1;--tw-ring-color: rgb(60 230 172 / var(--tw-ring-opacity, 1))}.ring-white\/50{--tw-ring-color: rgb(255 255 255 / .5)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert: invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:root{color-scheme:dark}body{margin:0;padding:0;background:#0a0a0a;color:#e5e5e5;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;overflow:hidden}#root{width:100vw;height:100vh;height:100dvh}.cm-editor{height:100%;font-size:13px}.cm-editor .cm-scroller{font-family:JetBrains Mono,Fira Code,SF Mono,monospace}.cm-editor.cm-focused{outline:none}.hf-loader{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:min(34rem,100%);padding:1.5rem;box-sizing:border-box;text-align:center;cursor:default;-moz-user-select:none;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}.hf-frame{display:grid;place-items:center;width:100%;height:100%;min-height:12rem;border:1px solid rgba(255,255,255,.08);background:#00000085}.hf-loader-mark-frame{display:grid;place-items:center;overflow:visible;transform-origin:50% 50%;-moz-user-select:none;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}.hf-loader-mark{display:block;overflow:visible;filter:drop-shadow(0 0 7px rgba(79,219,94,.2));-moz-user-select:none;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}.hf-loader-title{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:1rem;font-weight:600;letter-spacing:0;color:var(--hf-heading, #f4f4f5);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hf-loader-detail{max-width:32rem;min-height:2.5rem;overflow:hidden;color:var(--hf-text-secondary, rgba(244, 244, 245, .68));font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:.82rem;line-height:1.6}.hf-loader-mono{width:min(36rem,100%);min-height:1.5rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--hf-text-tertiary, rgba(244, 244, 245, .46));font-family:IBM Plex Mono,SF Mono,Fira Code,monospace;font-size:.75rem;letter-spacing:0;font-variant-numeric:tabular-nums}.hf-loader-progress{width:min(18rem,72vw);height:.375rem;overflow:hidden;border-radius:999px;background:#ffffff1a}.hf-loader-progress__fill{width:100%;height:100%;transform:scaleX(0);transform-origin:left center;border-radius:inherit;background:linear-gradient(90deg,#06e3fa,#4fdb5e);transition:transform .16s ease}.placeholder\:text-neutral-600::-moz-placeholder{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.placeholder\:text-neutral-600::placeholder{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.last\:border-0:last-child{border-width:0px}.focus-within\:border-neutral-600:focus-within{--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.hover\:border-neutral-500:hover{--tw-border-opacity: 1;border-color:rgb(115 115 115 / var(--tw-border-opacity, 1))}.hover\:border-neutral-600:hover{--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.hover\:border-neutral-700:hover{--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.hover\:border-neutral-800:hover{--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.hover\:border-studio-accent\/40:hover{border-color:#3ce6ac66}.hover\:border-studio-accent\/50:hover{border-color:#3ce6ac80}.hover\:border-white\/20:hover{border-color:#fff3}.hover\:bg-neutral-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-600:hover{--tw-bg-opacity: 1;background-color:rgb(82 82 82 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-800:hover{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-800\/30:hover{background-color:#2626264d}.hover\:bg-neutral-800\/50:hover{background-color:#26262680}.hover\:bg-neutral-800\/70:hover{background-color:#262626b3}.hover\:bg-neutral-900:hover{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.hover\:bg-red-500:hover{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-red-800\/60:hover{background-color:#991b1b99}.hover\:bg-red-900\/30:hover{background-color:#7f1d1d4d}.hover\:bg-studio-accent:hover{--tw-bg-opacity: 1;background-color:rgb(60 230 172 / var(--tw-bg-opacity, 1))}.hover\:bg-studio-accent\/25:hover{background-color:#3ce6ac40}.hover\:bg-studio-accent\/80:hover{background-color:#3ce6accc}.hover\:bg-white\/\[0\.04\]:hover{background-color:#ffffff0a}.hover\:bg-white\/\[0\.06\]:hover{background-color:#ffffff0f}.hover\:text-amber-300:hover{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.hover\:text-green-400:hover{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.hover\:text-neutral-100:hover{--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.hover\:text-neutral-200:hover{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.hover\:text-neutral-300:hover{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.hover\:text-neutral-400:hover{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-studio-accent:hover{--tw-text-opacity: 1;color:rgb(60 230 172 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:ring-1:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-white\/30:hover{--tw-ring-color: rgb(255 255 255 / .3)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-\[\#3CE6AC\]:focus{--tw-border-opacity: 1;border-color:rgb(60 230 172 / var(--tw-border-opacity, 1))}.focus\:border-\[\#f5a400\]:focus{--tw-border-opacity: 1;border-color:rgb(245 164 0 / var(--tw-border-opacity, 1))}.focus\:border-neutral-600:focus{--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.focus\:border-studio-accent:focus{--tw-border-opacity: 1;border-color:rgb(60 230 172 / var(--tw-border-opacity, 1))}.focus\:border-studio-accent\/40:focus{border-color:#3ce6ac66}.focus\:border-studio-accent\/60:focus{border-color:#3ce6ac99}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[\#3ce6ac\]:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(60 230 172 / var(--tw-ring-opacity, 1))}.focus\:ring-\[\#f5a400\]\/40:focus{--tw-ring-color: rgb(245 164 0 / .4)}.focus\:ring-studio-accent\/30:focus{--tw-ring-color: rgb(60 230 172 / .3)}.focus\:ring-studio-accent\/40:focus{--tw-ring-color: rgb(60 230 172 / .4)}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-studio-accent\/50:focus-visible{--tw-ring-color: rgb(60 230 172 / .5)}.active\:scale-\[0\.97\]:active{--tw-scale-x: .97;--tw-scale-y: .97;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:border-neutral-800:disabled{--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.disabled\:text-neutral-600:disabled{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.disabled\:text-neutral-700:disabled{--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:block{display:block}.group:hover .group-hover\:scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}@media(min-width:640px){.sm\:inline{display:inline}.sm\:flex{display:flex}}@media(min-width:1024px){.lg\:flex{display:flex}}