hyperframes 0.7.64 → 0.7.66

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 (30) hide show
  1. package/dist/cli.js +2456 -2102
  2. package/dist/hyperframe-runtime.js +1 -1
  3. package/dist/hyperframe.manifest.json +1 -1
  4. package/dist/hyperframe.runtime.iife.js +1 -1
  5. package/dist/hyperframes-player.global.js +2 -2
  6. package/dist/skills/hyperframes/SKILL.md +11 -75
  7. package/dist/skills/hyperframes/references/capability-menu.md +1 -1
  8. package/dist/skills/hyperframes/references/intent-interview.md +71 -0
  9. package/dist/skills/hyperframes/references/pitch-round.md +1 -1
  10. package/dist/skills/hyperframes/references/route-briefs.md +8 -82
  11. package/dist/skills/hyperframes/references/routes/embedded-captions.md +11 -0
  12. package/dist/skills/hyperframes/references/routes/faceless-explainer.md +12 -0
  13. package/dist/skills/hyperframes/references/routes/general-video.md +12 -0
  14. package/dist/skills/hyperframes/references/routes/motion-graphics.md +11 -0
  15. package/dist/skills/hyperframes/references/routes/music-to-video.md +12 -0
  16. package/dist/skills/hyperframes/references/routes/pr-to-video.md +28 -0
  17. package/dist/skills/hyperframes/references/routes/product-launch-video.md +13 -0
  18. package/dist/skills/hyperframes/references/routes/remotion-to-hyperframes.md +9 -0
  19. package/dist/skills/hyperframes/references/routes/slideshow.md +11 -0
  20. package/dist/skills/hyperframes/references/routes/talking-head-recut.md +11 -0
  21. package/dist/skills/hyperframes/references/workflow-catalog.md +7 -67
  22. package/dist/skills/hyperframes-cli/references/doctor-browser.md +12 -0
  23. package/dist/studio/assets/{hyperframes-player-D4jpio27.js → hyperframes-player-BiCGkoKi.js} +1 -1
  24. package/dist/studio/assets/{index-srObT-DA.js → index-CnL24iBm.js} +1 -1
  25. package/dist/studio/assets/{index-CqjWmIbE.js → index-Cp6reNm_.js} +1 -1
  26. package/dist/studio/assets/{index-BOMWJSjh.js → index-wCPvBGsm.js} +144 -144
  27. package/dist/studio/index.html +1 -1
  28. package/dist/studio/index.js +2562 -2538
  29. package/dist/studio/index.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Xe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Ye.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var Qe=i=>Ze(J({},"__esModule",{value:!0}),i);var xt={};Xe(xt,{HyperframesPlayer:()=>Q,SPEED_PRESETS:()=>te,formatSpeed:()=>N,formatTime:()=>$});function ye(i){return i.hasRuntime||i.runtimeInjected?!1:!!(i.hasNestedCompositions||i.hasTimelines&&i.attempts>=5)}function I(i){return typeof i=="object"&&i!==null}function Ee(i){return I(i)&&typeof i.getDuration=="function"}function Se(i){return I(i)&&typeof i.duration=="function"&&typeof i.time=="function"&&typeof i.seek=="function"&&typeof i.play=="function"&&typeof i.pause=="function"}var Je="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.64/dist/hyperframe.runtime.iife.js";function D(i){if(i===null)return null;let e=Number.parseInt(i,10);return Number.isFinite(e)&&e>0?e:null}function Ke(i){let e=i?.querySelector("[data-composition-id][data-width][data-height]")??i?.querySelector("[data-width][data-height]");if(!e)return null;let t=D(e.getAttribute("data-width")),r=D(e.getAttribute("data-height"));return t!==null&&r!==null?{width:t,height:r}:null}var j=class{constructor(e,t){this._iframe=e;this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;try{let t=this._iframe.contentWindow;if(!t)return;let r=!!(t.__hf||t.__player),n=!!(t.__timelines&&Object.keys(t.__timelines).length>0),o=!!this._iframe.contentDocument?.querySelector("[data-composition-src]");if(ye({hasRuntime:r,hasTimelines:n,hasNestedCompositions:o,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;let s=this._resolvePlaybackDurationAdapter(t);if(s&&s.getDuration()>0){this.stop();let l=Ke(this._iframe.contentDocument);this._callbacks.onReady({duration:s.getDuration(),adapter:s,compositionSize:l});return}}catch{}e>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||I(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement("script");t.src=Je,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let t=Reflect.get(e,"__timelines");if(!I(t))return null;let r=Object.keys(t);if(r.length===0)return null;let n=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=n&&n in t?n:r[r.length-1],s=t[o];return Se(s)?s:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,"__player");if(Ee(t))return{kind:"runtime",getDuration:()=>t.getDuration()};let r=this._resolveDirectTimelineAdapterFromWindow(e);return r?{kind:"direct-timeline",timeline:r,getDuration:()=>r.duration()}:null}};var Te=`
1
+ "use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Xe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Ye.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var Qe=i=>Ze(J({},"__esModule",{value:!0}),i);var Lt={};Xe(Lt,{HyperframesPlayer:()=>Q,SPEED_PRESETS:()=>te,formatSpeed:()=>N,formatTime:()=>$});function ye(i){return i.hasRuntime||i.runtimeInjected?!1:!!(i.hasNestedCompositions||i.hasTimelines&&i.attempts>=5)}function I(i){return typeof i=="object"&&i!==null}function Ee(i){return I(i)&&typeof i.getDuration=="function"}function Se(i){return I(i)&&typeof i.duration=="function"&&typeof i.time=="function"&&typeof i.seek=="function"&&typeof i.play=="function"&&typeof i.pause=="function"}var Je="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.66/dist/hyperframe.runtime.iife.js";function D(i){if(i===null)return null;let e=Number.parseInt(i,10);return Number.isFinite(e)&&e>0?e:null}function Ke(i){let e=i?.querySelector("[data-composition-id][data-width][data-height]")??i?.querySelector("[data-width][data-height]");if(!e)return null;let t=D(e.getAttribute("data-width")),r=D(e.getAttribute("data-height"));return t!==null&&r!==null?{width:t,height:r}:null}var j=class{constructor(e,t){this._iframe=e;this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;try{let t=this._iframe.contentWindow;if(!t)return;let r=!!(t.__hf||t.__player),n=!!(t.__timelines&&Object.keys(t.__timelines).length>0),o=!!this._iframe.contentDocument?.querySelector("[data-composition-src]");if(ye({hasRuntime:r,hasTimelines:n,hasNestedCompositions:o,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;let s=this._resolvePlaybackDurationAdapter(t);if(s&&s.getDuration()>0){this.stop();let l=Ke(this._iframe.contentDocument);this._callbacks.onReady({duration:s.getDuration(),adapter:s,compositionSize:l});return}}catch{}e>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||I(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement("script");t.src=Je,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let t=Reflect.get(e,"__timelines");if(!I(t))return null;let r=Object.keys(t);if(r.length===0)return null;let n=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=n&&n in t?n:r[r.length-1],s=t[o];return Se(s)?s:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,"__player");if(Ee(t))return{kind:"runtime",getDuration:()=>t.getDuration()};let r=this._resolveDirectTimelineAdapterFromWindow(e);return r?{kind:"direct-timeline",timeline:r,getDuration:()=>r.duration()}:null}};var Te=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -456,5 +456,5 @@
456
456
  background: var(--hfp-accent, #fff);
457
457
  pointer-events: none;
458
458
  }
459
- `,Ae='<svg width="24" height="24" viewBox="46 21 54 56" fill="currentColor"><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"/></svg>',we='<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>',Ce='<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>';var te=[.25,.5,1,1.5,2,4];function N(i){return Number.isInteger(i)?`${i}x`:`${i}x`}function $(i){if(!Number.isFinite(i)||i<0)return"0:00";let e=Math.floor(i),t=Math.floor(e/60),r=e%60;return`${t}:${r.toString().padStart(2,"0")}`}function ke(i,e,t={}){let r=t.speedPresets??te,n=document.createElement("div");n.className="hfp-controls",n.addEventListener("click",a=>{a.stopPropagation()});let o=document.createElement("button");o.className="hfp-play-btn",o.type="button",o.innerHTML=`<span class="hfp-ico hfp-ico-play">${Ae}</span><span class="hfp-ico hfp-ico-pause">${we}</span>`,o.setAttribute("aria-label","Play");let s=document.createElement("div");s.className="hfp-scrubber";let l=document.createElement("div");l.className="hfp-progress",l.style.width="0%",s.appendChild(l);let u=document.createElement("span");u.className="hfp-time",u.textContent="0:00 / 0:00";let p=document.createElement("div");p.className="hfp-speed-wrap";let c=document.createElement("button");c.className="hfp-speed-btn",c.type="button",c.textContent="1x",c.setAttribute("aria-label","Playback speed");let v=document.createElement("div");v.className="hfp-speed-menu",v.setAttribute("role","menu");for(let a of r){let d=document.createElement("button");d.className="hfp-speed-option",d.type="button",d.setAttribute("role","menuitem"),d.dataset.speed=String(a),d.textContent=N(a),a===1&&d.classList.add("hfp-active"),v.appendChild(d)}p.appendChild(v),p.appendChild(c);let y=document.createElement("div");y.className="hfp-volume-wrap";let f=document.createElement("button");f.className="hfp-mute-btn",f.type="button",f.innerHTML=K,f.setAttribute("aria-label","Mute");let S=document.createElement("div");S.className="hfp-volume-slider-wrap";let m=document.createElement("div");m.className="hfp-volume-slider",m.setAttribute("role","slider"),m.setAttribute("aria-label","Volume"),m.setAttribute("aria-valuemin","0"),m.setAttribute("aria-valuemax","100"),m.setAttribute("aria-valuenow","100"),m.tabIndex=0;let E=document.createElement("div");E.className="hfp-volume-fill",E.style.width="100%",m.appendChild(E),S.appendChild(m),y.appendChild(S),y.appendChild(f),t.audioLocked&&(y.style.display="none"),n.appendChild(o),n.appendChild(s),n.appendChild(u),n.appendChild(y),n.appendChild(p),i.appendChild(n);let O=!1,C=!1,A=1,R=null,F=r.indexOf(1);F===-1&&(F=0);let H=(a,d)=>a?Ce:d===0?ee:d<.5?ee:K;o.addEventListener("click",a=>{a.stopPropagation(),O?e.onPause():e.onPlay()}),f.addEventListener("click",a=>{a.stopPropagation(),e.onMuteToggle()});let k=!1,U=a=>{let d=m.getBoundingClientRect(),b=Math.max(0,Math.min(1,(a-d.left)/d.width));A=b,E.style.width=`${b*100}%`,m.setAttribute("aria-valuenow",String(Math.round(b*100))),C&&b>0&&e.onMuteToggle(),f.innerHTML=H(C,b),e.onVolumeChange(b)};m.addEventListener("mousedown",a=>{a.stopPropagation(),k=!0,U(a.clientX)});let ae=a=>{k&&U(a.clientX)},se=()=>{k=!1};document.addEventListener("mousemove",ae),document.addEventListener("mouseup",se),m.addEventListener("touchstart",a=>{k=!0;let d=a.touches[0];d&&U(d.clientX)},{passive:!0});let le=a=>{if(k){let d=a.touches[0];d&&U(d.clientX)}},de=()=>{k=!1};document.addEventListener("touchmove",le,{passive:!0}),document.addEventListener("touchend",de);let ue=.05;m.addEventListener("keydown",a=>{let d=A;if(a.key==="ArrowRight"||a.key==="ArrowUp")d=Math.min(1,A+ue);else if(a.key==="ArrowLeft"||a.key==="ArrowDown")d=Math.max(0,A-ue);else return;a.preventDefault(),a.stopPropagation(),A=d,E.style.width=`${d*100}%`,m.setAttribute("aria-valuenow",String(Math.round(d*100))),C&&d>0&&e.onMuteToggle(),f.innerHTML=H(C,d),e.onVolumeChange(d)});let ce=a=>{for(let d of v.querySelectorAll(".hfp-speed-option"))d.classList.toggle("hfp-active",d.dataset.speed===String(a))};c.addEventListener("click",a=>{a.stopPropagation();let d=v.classList.toggle("hfp-open");c.setAttribute("aria-expanded",String(d))}),v.addEventListener("click",a=>{a.stopPropagation();let d=a.target.closest(".hfp-speed-option");if(!d)return;let b=parseFloat(d.dataset.speed);F=r.indexOf(b),c.textContent=N(b),ce(b),v.classList.remove("hfp-open"),c.setAttribute("aria-expanded","false"),e.onSpeedChange(b)});let pe=()=>{v.classList.remove("hfp-open"),c.setAttribute("aria-expanded","false")};document.addEventListener("click",pe);let V=a=>{let d=s.getBoundingClientRect(),b=Math.max(0,Math.min(1,(a-d.left)/d.width));e.onSeek(b)},T=!1;s.addEventListener("mousedown",a=>{a.stopPropagation(),T=!0,e.onScrubStart?.(),V(a.clientX)});let he=a=>{T&&V(a.clientX)},me=()=>{T&&(T=!1,e.onScrubEnd?.())};document.addEventListener("mousemove",he),document.addEventListener("mouseup",me),s.addEventListener("touchstart",a=>{T=!0,e.onScrubStart?.();let d=a.touches[0];d&&V(d.clientX)},{passive:!0});let fe=a=>{if(T){let d=a.touches[0];d&&V(d.clientX)}},be=()=>{T&&(T=!1,e.onScrubEnd?.())};document.addEventListener("touchmove",fe,{passive:!0}),document.addEventListener("touchend",be);let ve=()=>{R&&clearTimeout(R),R=setTimeout(()=>{O&&n.classList.add("hfp-hidden")},3e3)},z=i instanceof ShadowRoot?i.host:i,ge=()=>{n.classList.remove("hfp-hidden"),ve()},_e=()=>{O&&n.classList.add("hfp-hidden")};return z.addEventListener("mousemove",ge),z.addEventListener("mouseleave",_e),{updateTime(a,d){let b=d>0?Math.min(a,d):a,Be=d>0?b/d*100:0;l.style.width=`${Be}%`,u.textContent=`${$(b)} / ${$(d)}`},updatePlaying(a){O=a,o.classList.toggle("hfp-playing",a),o.setAttribute("aria-label",a?"Pause":"Play"),a?ve():n.classList.remove("hfp-hidden")},updateSpeed(a){let d=r.indexOf(a);d!==-1&&(F=d),c.textContent=N(a),ce(a)},updateMuted(a){C=a,f.innerHTML=H(a,A),f.setAttribute("aria-label",a?"Unmute":"Mute")},updateVolume(a){A=a,E.style.width=`${a*100}%`,m.setAttribute("aria-valuenow",String(Math.round(a*100))),f.innerHTML=H(C,a)},setVolumeControlsHidden(a){y.style.display=a?"none":""},show(){n.style.display=""},hide(){n.style.display="none"},destroy(){document.removeEventListener("mousemove",he),document.removeEventListener("mouseup",me),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",be),document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",se),document.removeEventListener("touchmove",le),document.removeEventListener("touchend",de),document.removeEventListener("click",pe),z.removeEventListener("mousemove",ge),z.removeEventListener("mouseleave",_e),R&&clearTimeout(R),n.remove()}}}function xe(i,e,t,r,n,o=!1){let s=r?r.split(",").map(Number).filter(p=>!isNaN(p)&&p>0):void 0,l={...s?{speedPresets:s}:{},audioLocked:o},u=ke(i,n,l);return u.updateMuted(e),u.updateVolume(t),u}function re(i,e,t){return e?(t||(t=document.createElement("img"),t.className="hfp-poster",i.appendChild(t)),t.src=e,t):(t?.remove(),null)}function Me(i){return i.composedPath().some(e=>e instanceof HTMLElement&&e.classList.contains("hfp-controls"))}var W=null;function Le(i,e){if(typeof CSSStyleSheet<"u")try{W||(W=new CSSStyleSheet,W.replaceSync(e)),i.adoptedStyleSheets=[W];return}catch{}let t=document.createElement("style");t.textContent=e,i.appendChild(t)}function Pe(){let i=document.createElement("div");i.className="hfp-container";let e=document.createElement("iframe");return e.className="hfp-iframe",e.sandbox.add("allow-scripts","allow-same-origin"),e.allow="autoplay; fullscreen",e.referrerPolicy="no-referrer",e.title="HyperFrames Composition",i.appendChild(e),{container:i,iframe:e}}function Re(i,e,t,r){let n=i.offsetWidth,o=i.offsetHeight;if(n===0||o===0)return!1;let s=Math.min(n/t,o/r);return e.style.width=`${t}px`,e.style.height=`${r}px`,e.style.transform=`translate(-50%, -50%) scale(${s})`,!0}var B=class{constructor(e){this._callbacks=e}_callbacks;_raf=null;_lastUpdateMs=0;start(e,t,r,n){this.stop();let o=()=>{if(n()){this._raf=null;return}let s;try{s=e.time()}catch{this._raf=null;return}let l=r();l>0&&(s=Math.min(s,l));let u=l>0&&s>=l,p=performance.now();if((p-this._lastUpdateMs>100||u)&&(this._lastUpdateMs=p,this._callbacks.onTimeUpdate(s,l)),u){if(this._callbacks.getLoop()){this._callbacks.restart();return}try{e.pause()}catch{}this._callbacks.onPaused(),this._raf=null;return}this._raf=requestAnimationFrame(o)};this._raf=requestAnimationFrame(o)}stop(){this._raf!==null&&(cancelAnimationFrame(this._raf),this._raf=null)}get isRunning(){return this._raf!==null}};function Ie(i){let e=Array.from(i.querySelectorAll("[data-composition-id]"));if(e.length===0)return i.body?[i.body]:[];let t=[];for(let r of e)tt(r)||t.push(r);return et(i),t}function et(i){let e=i.body;if(!e||typeof console>"u"||typeof console.warn!="function")return;let t=e.querySelectorAll("audio[data-start], video[data-start]");if(t.length===0)return;let r=[];for(let n of t)n.closest("[data-composition-id]")||r.push(n);r.length!==0&&console.warn(`[hyperframes-player] selectMediaObserverTargets: composition hosts are present, but ${r.length} body-level timed media element(s) sit outside every [data-composition-id] subtree and will not be observed. Move them inside a composition host or the parent-frame proxy will never adopt them.`,r)}function tt(i){let e=i.parentElement;for(;e;){if(e.hasAttribute("data-composition-id"))return!0;e=e.parentElement}return!1}function G(i){let e=i.ownerDocument?.defaultView;return e&&i instanceof e.Element?!0:i instanceof Element}function _(i){if(!G(i)||i.tagName!=="AUDIO"&&i.tagName!=="VIDEO")return!1;let e=i.ownerDocument?.defaultView;return e&&i instanceof e.HTMLMediaElement?!0:i instanceof HTMLMediaElement}var h=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),Wt=Object.freeze([h.start,h.duration,h.trackIndex]),Bt=Object.freeze([h.derivedEnd]),Gt=Object.freeze([h.derivedEnd,h.legacyTrack]);function x(i){if(i==null||i.trim()==="")return null;let e=Number(i);return Number.isFinite(e)?e:null}var Oe=/^[A-Za-z0-9_.:-]+$/;function Fe(i,e){let t=i.charCodeAt(e);return t>=48&&t<=57}function De(i,e){let t=e;for(;t>=0&&Fe(i,t);)t--;return t}function rt(i,e){let t=e;for(;t>=0&&(i[t]??"").trim()==="";)t--;return t}function it(i){let e=i.length-1;if(!Fe(i,e))return null;let t=De(i,e);return i[t]==="."&&(t=De(i,t-1)),t+1}function nt(i){let e=it(i);if(e==null)return null;let t=rt(i,e-1),r=i[t];if(r!=="+"&&r!=="-")return null;let n=i.slice(0,t).trim();if(!Oe.test(n))return null;let o=Number(i.slice(e));return Number.isFinite(o)?{refId:n,operator:r,magnitude:o}:null}function ot(i){let e=(i??"").trim();if(!e)return null;let t=x(e);if(t!=null)return{kind:"absolute",value:t};if(Oe.test(e))return{kind:"reference",refId:e,offset:0};let r=nt(e);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function g(i,e,t,r){i.push({code:e,attribute:t,value:r})}function at(i,e,t,r){if(e==null||e.trim()==="")return t.defaultStart===void 0?0:t.defaultStart;if(!i)return g(r,"invalid-start",h.start,e),null;if(i.kind==="absolute")return Math.max(0,i.value);let n=t.resolveReferenceEnd?.(i.refId);return n==null||!Number.isFinite(n)?(g(r,"unresolved-start-reference",h.start,e),null):Math.max(0,n+i.offset)}function st(i,e,t){g(t,"deprecated-end",h.derivedEnd,i);let r=x(i);r==null?g(t,"invalid-end",h.derivedEnd,i):e!=null&&r!==e&&g(t,"conflicting-end",h.derivedEnd,i)}function lt(i,e,t){let r=x(i);return r==null||r<0?(g(t,"invalid-duration",h.duration,i),{duration:null,end:null,durationSource:"invalid"}):{duration:r,end:e==null?null:e+r,durationSource:"duration"}}function dt(i,e,t){g(t,"deprecated-end",h.derivedEnd,i);let r=x(i);return r==null?(g(t,"invalid-end",h.derivedEnd,i),{duration:null,end:null,durationSource:"invalid"}):e==null?{duration:null,end:r,durationSource:"legacy-end"}:r<e?(g(t,"end-before-start",h.derivedEnd,i),{duration:null,end:null,durationSource:"invalid"}):{duration:r-e,end:r,durationSource:"legacy-end"}}function ut(i,e,t){let r=i.getAttribute(h.duration),n=i.getAttribute(h.derivedEnd);if(r==null)return n==null?{duration:null,end:null,durationSource:"missing"}:dt(n,e,t);let o=lt(r,e,t);return n!=null&&st(n,o.end,t),o}function Ne(i,e,t,r){let n=x(i);return n==null||!Number.isInteger(n)?(g(r,"invalid-track-index",e,i),{trackIndex:0,trackSource:"invalid"}):{trackIndex:n,trackSource:t}}function ct(i,e){let t=i.getAttribute(h.trackIndex),r=i.getAttribute(h.legacyTrack);if(t==null&&r==null)return{trackIndex:0,trackSource:"default"};if(t==null&&r!=null)return g(e,"deprecated-layer",h.legacyTrack,r),Ne(r,h.legacyTrack,"legacy-layer",e);let n=Ne(t??"",h.trackIndex,"track-index",e);if(r==null)return n;g(e,"deprecated-layer",h.legacyTrack,r);let o=x(r);return o!=null&&o!==n.trackIndex&&g(e,"conflicting-layer",h.legacyTrack,r),n}function ie(i,e={}){let t=[],r=i.getAttribute(h.start),n=ot(r),o=at(n,r,e,t),s=ut(i,o,t),l=ct(i,t);return{startExpression:n,start:o,...s,...l,diagnostics:t}}var pt=.05,ht=2,q=class{_entries=[];_mediaObserver;_playbackErrorPosted=!1;_audioOwner="runtime";_urlAudioEntry=null;_urlAudioSrc=null;_dispatchEvent;_getMuted;_getVolume;_getPlaybackRate;_getCurrentTime;_isPaused;constructor(e){this._dispatchEvent=e.dispatchEvent,this._getMuted=e.getMuted,this._getVolume=e.getVolume,this._getPlaybackRate=e.getPlaybackRate,this._getCurrentTime=e.getCurrentTime,this._isPaused=e.isPaused}get audioOwner(){return this._audioOwner}get entries(){return this._entries}resetForIframeLoad(){this._playbackErrorPosted=!1;let e=this._audioOwner==="parent";this._audioOwner="runtime",this.pauseAll(),this.teardownObserver(),e&&this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}}))}destroy(){this.teardownObserver();for(let e of this._entries)e.el.pause(),e.el.src="";this._entries=[],this._urlAudioEntry=null,this._urlAudioSrc=null,this._audioOwner="runtime",this._playbackErrorPosted=!1}updateMuted(e){for(let t of this._entries)t.el.muted=e}updateVolume(e){for(let t of this._entries)t.el.volume=e}updatePlaybackRate(e){for(let t of this._entries)t.el.playbackRate=e}_playEntry(e){e.el.src&&e.el.play().catch(t=>this._reportPlaybackError(t))}_playEntryIfActive(e){this._refreshEntryBounds(e);let t=this._getCurrentTime()-e.start;t<0||t>=e.duration||this._playEntry(e)}_refreshEntryBounds(e){if(!e.source?.isConnected)return;let t=ie(e.source);e.start=t.start??0,e.duration=t.duration!=null&&t.duration>0?t.duration:Number.POSITIVE_INFINITY}_gateEntryPlayback(e,t){return t<0||t>=e.duration?(e.el.paused||e.el.pause(),e.driftSamples=0,!1):(this._audioOwner==="parent"&&!this._isPaused()&&e.el.paused&&this._playEntry(e),!0)}playAll(){for(let e of this._entries)this._playEntryIfActive(e)}pauseAll(){for(let e of this._entries)e.el.pause()}stopAdoptedMedia(){for(let e of this._entries)e.source&&e.el.pause()}seekAll(e){for(let t of this._entries){this._refreshEntryBounds(t);let r=e-t.start;r>=0&&r<t.duration&&(t.el.currentTime=r)}}scrubAll(e){for(let t of this._entries){this._refreshEntryBounds(t);let r=e-t.start;r>=0&&r<t.duration?(t.el.currentTime=r,this._playEntry(t)):t.el.paused||t.el.pause()}}mirrorTime(e,t){let r=t?.force===!0;for(let n of this._entries){this._refreshEntryBounds(n);let o=e-n.start;this._gateEntryPlayback(n,o)&&(Math.abs(n.el.currentTime-o)>pt?(n.driftSamples+=1,(r||n.driftSamples>=ht)&&(n.el.currentTime=o,n.driftSamples=0)):n.driftSamples=0)}}promoteToParentProxy(e,t){if(this._audioOwner==="parent")return;if(this._audioOwner="parent",e)for(let n of e.querySelectorAll("video, audio"))_(n)&&(n.muted=!0);let r=this._getCurrentTime();t?t(r,{force:!0}):this.mirrorTime(r,{force:!0}),this._isPaused()||this.playAll(),this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}}))}setupFromIframe(e){let t=e.querySelectorAll("audio[data-start], video[data-start]");for(let r of t)_(r)&&this._adoptIframeMedia(r);this._observeDynamicMedia(e)}setupFromUrl(e){if(this._urlAudioSrc===e&&this._urlAudioEntry)return;this.teardownUrlAudio();let t=this._createEntry(e,"audio",0,1/0);this._urlAudioEntry=t,this._urlAudioSrc=t?e:null,t&&this._audioOwner==="parent"&&!this._isPaused()&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this.playAll())}teardownUrlAudio(){let e=this._urlAudioEntry;if(this._urlAudioEntry=null,this._urlAudioSrc=null,!e)return;e.el.pause(),e.el.src="";let t=this._entries.indexOf(e);t!==-1&&this._entries.splice(t,1)}teardownObserver(){this._mediaObserver?.disconnect(),this._mediaObserver=void 0}_reportPlaybackError(e){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this._dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:e}})))}_createEntry(e,t,r,n,o){if(this._entries.some(p=>p.el.src===e))return null;let s=t==="video"?document.createElement("video"):new Audio;s.preload="auto",s.src=e,s.load(),s.muted=this._getMuted(),s.volume=this._getVolume();let l=this._getPlaybackRate();l!==1&&(s.playbackRate=l);let u={el:s,start:r,duration:n,driftSamples:0,source:o};return this._entries.push(u),u}_resolveIframeMediaSrc(e){let t=e.getAttribute("src")||e.querySelector("source")?.getAttribute("src");return t?new URL(t,e.ownerDocument.baseURI).href:null}_adoptIframeMedia(e){if(e.preload==="metadata"||e.preload==="none")return;let t=this._resolveIframeMediaSrc(e);if(!t)return;let r=ie(e),n=r.start??0,o=r.duration??Number.POSITIVE_INFINITY,s=e.tagName==="VIDEO"?"video":"audio",l=this._createEntry(t,s,n,o,e);l&&this._audioOwner==="parent"&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(l))}_detachIframeMedia(e){let t=this._resolveIframeMediaSrc(e);if(!t)return;let r=this._entries.findIndex(o=>o.el.src===t);if(r===-1)return;let n=this._entries[r];n.el.pause(),n.el.src="",this._entries.splice(r,1)}_observeDynamicMedia(e){if(this.teardownObserver(),typeof MutationObserver>"u"||!e.body)return;let t=new MutationObserver(o=>{for(let s of o){if(s.type==="attributes"&&s.attributeName==="preload"){let l=s.target;_(l)&&l.matches("audio[data-start], video[data-start]")&&l.preload==="auto"&&this._adoptIframeMedia(l);continue}for(let l of s.addedNodes){if(!G(l))continue;let u=[];_(l)&&l.matches("audio[data-start], video[data-start]")&&u.push(l);let p=l.querySelectorAll("audio[data-start], video[data-start]");for(let c of p)_(c)&&u.push(c);for(let c of u)this._adoptIframeMedia(c)}for(let l of s.removedNodes){if(!G(l))continue;let u=[];_(l)&&l.matches("audio[data-start], video[data-start]")&&u.push(l);let p=l.querySelectorAll("audio[data-start], video[data-start]");for(let c of p)_(c)&&u.push(c);for(let c of u)this._detachIframeMedia(c)}}}),r={childList:!0,subtree:!0,attributes:!0,attributeFilter:["preload"]},n=Ie(e);for(let o of n)t.observe(o,r);this._mediaObserver=t}};function He(i,e,t,r){let n=(i.frame??0)/e,o=t.duration>0?Math.min(n,t.duration):n,s=!t.paused,l=!i.isPlaying,u=t.duration>0&&o>=t.duration&&(s||i.isPlaying);if(u&&r.getLoop())return r.media.audioOwner==="parent"&&r.media.pauseAll(),r.seek(0),r.play(),{...t,currentTime:o,paused:!1};let p={...t,currentTime:o,paused:l};r.media.audioOwner==="parent"&&(s&&l?r.media.pauseAll():!s&&!l&&r.media.playAll(),r.media.mirrorTime(o));let c=performance.now(),v=l!==t.paused;return(c-t.lastUpdateMs>100||v)&&(p.lastUpdateMs=c,r.updateControlsTime(o,t.duration),r.updateControlsPlaying(!l),r.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:o}}))),u&&(r.media.audioOwner==="parent"&&r.media.pauseAll(),p.paused=!0,r.updateControlsPlaying(!1),r.dispatchEvent(new Event("ended"))),p}var mt=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1"];function ft(i,e){let t=Math.abs(i),r=Math.abs(e);for(;r!==0;){let n=t%r;t=r,r=n}return t||1}function bt(i){let e=Number.isFinite(i)&&i>0?i:30,t=Number.isInteger(e)?1:1e6,r=Math.round(e*t),n=ft(r,t);return{numerator:r/n,denominator:t/n}}function vt(i){if(typeof i!="object"||i===null)return null;let e=i;return!Number.isFinite(e.numerator)||!Number.isFinite(e.denominator)||(e.numerator??0)<=0||(e.denominator??0)<=0?null:Number(e.numerator)/Number(e.denominator)}function Ue(i){return{protocolVersion:1,capabilities:mt,fps:bt(i)}}function gt(i){return Array.isArray(i)&&i.every(e=>typeof e=="string")}function Ve(i,e=30){if(typeof i!="object"||i===null)return{status:"legacy",fps:e};let t=i;if(t.protocolVersion===void 0)return{status:"legacy",fps:e};if(t.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:t.protocolVersion};let r=vt(t.fps);return r===null||!gt(t.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:t.protocolVersion}:{status:"supported",fps:r,metadata:t}}function _t(i){return Array.isArray(i)?i.filter(e=>typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.start=="number"&&typeof e.duration=="number"):[]}function ze(i,e,t){if(i.source!==e)return;let r=i.data;if(!r||r.source!=="hf-preview")return;let n=Ve(r);if(n.status==="unsupported"){t.dispatchEvent(new CustomEvent("runtimeprotocolerror",{detail:{code:n.code,receivedVersion:n.receivedVersion}}));return}if(t.setRuntimeFps?.(n.fps),r.type==="shader-transition-state"){let o=r.state&&typeof r.state=="object"?r.state:{};t.shaderLoader.update(o,t.getShaderLoadingMode()),t.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:r.compositionId,state:o}}));return}if(r.type==="ready"){t.onRuntimeReady();return}if(r.type==="state"){t.setPlaybackState(He({frame:r.frame??0,isPlaying:!!r.isPlaying},n.fps,t.getPlaybackState(),t));return}if(r.type==="media-autoplay-blocked"){if(t.shouldPromoteMediaAutoplayFallback?.()===!1)return;let o=null;try{o=t.getIframeDoc()}catch{}t.media.promoteToParentProxy(o,(s,l)=>t.media.mirrorTime(s,l)),t.sendControl("set-media-output-muted",{muted:!0});return}if(r.type==="timeline"&&r.durationInFrames>0){let o=Number(r.durationSeconds),s=Number(r.durationInFrames),l=Number.isFinite(o)&&o>0?o:s/n.fps;if(Number.isFinite(l)&&l>0){let u=t.getPlaybackState();t.setPlaybackState({...u,duration:l}),t.updateControlsTime(u.currentTime,l),t.onRuntimeTimelineReady(l)}Number.isFinite(r.compositionWidth)&&r.compositionWidth>0&&Number.isFinite(r.compositionHeight)&&r.compositionHeight>0&&t.setCompositionSize(r.compositionWidth,r.compositionHeight),t.setScenes(_t(r.scenes));return}r.type==="stage-size"&&Number.isFinite(r.width)&&r.width>0&&Number.isFinite(r.height)&&r.height>0&&t.setCompositionSize(r.width,r.height)}var w="shader-capture-scale",M="shader-loading",yt="__hf_shader_capture_scale",Et="__hf_shader_loading",L=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"];function ne(i){if(i===null)return null;let e=Number(i);return!Number.isFinite(e)||e<=0?null:String(Math.min(1,Math.max(.25,e)))}function St(i){if(i===null||i.trim()==="")return"composition";let e=i.trim().toLowerCase();return e==="none"||e==="false"||e==="0"||e==="off"?"none":e==="player"||e==="true"||e==="1"||e==="on"?"player":"composition"}function je(i,e,t){t===null?i.delete(e):i.set(e,t)}function Tt(i,e,t){let r=i.indexOf("#"),n=r>=0?i.slice(0,r):i,o=r>=0?i.slice(r):"",s=n.indexOf("?"),l=s>=0?n.slice(0,s):n,u=s>=0?n.slice(s+1):"",p=new URLSearchParams(u);je(p,yt,e),je(p,Et,t==="composition"?null:t);let c=p.toString();return`${l}${c?`?${c}`:""}${o}`}function At(i,e,t){if(e===null&&t==="composition")return i;let r=[];e!==null&&r.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(e)};`),t!=="composition"&&r.push(`window.__HF_SHADER_LOADING=${JSON.stringify(t)};`);let n=`<script data-hyperframes-player-shader-options>${r.join("")}</script>`;return/<head\b[^>]*>/i.test(i)?i.replace(/<head\b[^>]*>/i,o=>`${o}${n}`):/<html\b[^>]*>/i.test(i)?i.replace(/<html\b[^>]*>/i,o=>`${o}${n}`):`${n}${i}`}function P(i){return St(i.getAttribute(M))}function $e(i){return Number(ne(i.getAttribute(w))??"1")}function Y(i,e){return Tt(e,ne(i.getAttribute(w)),P(i))}function X(i,e){return At(e,ne(i.getAttribute(w)),P(i))}function We(){let i=document.createElement("div");i.className="hfp-shader-loader",i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label","Preparing scene transitions"),i.setAttribute("data-hyperframes-ignore",""),i.draggable=!1;let e=f=>{f.preventDefault(),f.stopPropagation()};for(let f of["selectstart","dragstart","pointerdown","mousedown","click","dblclick","contextmenu","touchstart"])i.addEventListener(f,e,{capture:!0});let t=document.createElement("div");t.className="hfp-shader-loader-panel",t.draggable=!1;let 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("");let n=document.createElement("div");n.className="hfp-shader-loader-title";let o=document.createElement("span");o.className="hfp-shader-loader-title-text",o.textContent=L[0]||"Preparing scene transitions",n.appendChild(o);let s=document.createElement("div");s.className="hfp-shader-loader-detail",s.textContent="Rendering animated scene samples for shader transitions.";let l=document.createElement("div");l.className="hfp-shader-loader-track",l.setAttribute("aria-hidden","true");let u=document.createElement("div");u.className="hfp-shader-loader-fill",l.appendChild(u);let p=document.createElement("div");p.className="hfp-shader-loader-progress";let c=f=>{let S=document.createElement("div");S.className="hfp-shader-loader-row";let m=document.createElement("span");m.className="hfp-shader-loader-label",m.textContent=f;let E=document.createElement("span");return E.className="hfp-shader-loader-value",S.appendChild(m),S.appendChild(E),p.appendChild(S),{row:S,label:m,value:E}},v=c("transition"),y=c("transition frame");return t.appendChild(r),t.appendChild(n),t.appendChild(s),t.appendChild(l),t.appendChild(p),i.appendChild(t),{root:i,fill:u,title:o,detail:s,transitionValue:v.value,frameLabel:y.label,frameValue:y.value,frameRow:y.row}}var wt=420,Z=class{_el;_hideTimeout=null;constructor(e){this._el=e}show(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-hiding"),this._el.root.classList.add("hfp-visible")}hide(){if(this._el.root.classList.contains("hfp-hiding")){this._hideTimeout||this._scheduleCleanup();return}this._el.root.classList.contains("hfp-visible")&&(this._el.root.classList.add("hfp-hiding"),this._el.root.classList.remove("hfp-visible"),this._scheduleCleanup())}reset(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-visible","hfp-hiding"),this._el.fill.style.transform="scaleX(0)",this._el.transitionValue.textContent="",this._el.frameValue.textContent="",this._el.frameRow.style.visibility="hidden"}update(e,t){if(t!=="player"){this.reset();return}if(e.ready||!e.loading){this.hide();return}let r=typeof e.progress=="number"&&Number.isFinite(e.progress)?e.progress:0,n=typeof e.total=="number"&&Number.isFinite(e.total)?e.total:0,o=n>0?Math.min(1,Math.max(0,r/n)):0,s=Math.min(L.length-1,Math.floor(o*L.length));this._el.title.textContent=L[s]||"Preparing scene transitions",this._el.detail.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._el.fill.style.transform=`scaleX(${o})`,this._el.transitionValue.textContent=e.currentTransition!==void 0&&e.transitionTotal!==void 0?`${e.currentTransition}/${e.transitionTotal}`:n>0?`${r}/${n}`:"";let l=e.transitionFrame!==void 0&&e.transitionFrames!==void 0?`${e.transitionFrame}/${e.transitionFrames}`:"";this._el.frameLabel.textContent=e.phase==="cached"?"cached transition frames":e.phase==="finalizing"?"finalizing transition frames":"rendering transition frames",this._el.frameValue.textContent=l,this._el.frameRow.style.visibility=l?"visible":"hidden",this._el.root.setAttribute("aria-valuenow",String(Math.round(o*100))),this.show()}get hideTimeout(){return this._hideTimeout}destroy(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null)}_scheduleCleanup(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>{this._el.root.classList.remove("hfp-hiding"),this._hideTimeout=null},wt)}};var Ct=.1,kt=5;function oe(i){return!Number.isFinite(i)||i<=0?1:Math.max(Ct,Math.min(kt,i))}var Q=class extends HTMLElement{static get observedAttributes(){return["src","srcdoc","width","height","controls","muted","audio-locked","volume","poster","playback-rate","audio-src",w,M]}shadow;container;iframe;posterEl=null;controlsApi=null;resizeObserver;shaderLoader;probe;_ready=!1;_currentTime=0;_duration=0;_paused=!0;_scrubbing=!1;_lastUpdateMs=0;_volume=1;_compositionWidth=1920;_compositionHeight=1080;_rescaleWarned=!1;_directTimelineAdapter=null;_directTimelineClock;_parentTickRaf=null;_media;_scenes=[];_runtimeFps=30;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),Le(this.shadow,Te),{container:this.container,iframe:this.iframe}=Pe(),this.shadow.appendChild(this.container);let e=We();this.shadow.appendChild(e.root),this.shaderLoader=new Z(e),this._media=new q({dispatchEvent:t=>this.dispatchEvent(t),getMuted:()=>this.muted,getVolume:()=>this._volume,getPlaybackRate:()=>this.playbackRate,getCurrentTime:()=>this._currentTime,isPaused:()=>this._paused}),this._directTimelineClock=new B({onTimeUpdate:(t,r)=>{this._currentTime=t,this.controlsApi?.updateTime(t,r),this.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:t}}))},getLoop:()=>this.loop,restart:()=>{this.seek(0),this.play()},onPaused:()=>{this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.dispatchEvent(new Event("ended"))},onEnded:()=>this.loop}),this.probe=new j(this.iframe,{onReady:t=>this._onProbeReady(t),onError:t=>this.dispatchEvent(new CustomEvent("error",{detail:{message:t}}))}),this.addEventListener("click",t=>{Me(t)||(this._paused?this.play():this.pause())}),this.resizeObserver=new ResizeObserver(()=>this._rescale()),this._onMessage=this._onMessage.bind(this),this._onIframeLoad=this._onIframeLoad.bind(this)}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.posterEl=re(this.shadow,this.getAttribute("poster"),this.posterEl)),this.hasAttribute("audio-src")&&this._media.setupFromUrl(this.getAttribute("audio-src")),this.hasAttribute("srcdoc")&&(this.iframe.srcdoc=X(this,this.getAttribute("srcdoc"))),this.hasAttribute("src")&&(this.iframe.src=Y(this,this.getAttribute("src"))),!this.hasAttribute("audio-locked")&&this._isLockedHostEnvironment()&&this._applyAudioLock(!0)}disconnectedCallback(){this._sendControl("pause"),this._stopIframeMedia(),this.resizeObserver.disconnect(),window.removeEventListener("message",this._onMessage),this.iframe.removeEventListener("load",this._onIframeLoad),this.probe.stop(),this._directTimelineClock.stop(),this._stopParentTickClock(),this._directTimelineAdapter=null,this.shaderLoader.destroy(),this._media.destroy(),this.controlsApi?.destroy(),this.controlsApi=null,this._paused=!0,this._ready=!1}attributeChangedCallback(e,t,r){switch(e){case"src":r&&(this._ready=!1,this.iframe.src=Y(this,r));break;case"srcdoc":this._ready=!1,r!==null?this.iframe.srcdoc=X(this,r):this.iframe.removeAttribute("srcdoc");break;case"width":this._compositionWidth=D(r)??1920,this._rescale();break;case"height":this._compositionHeight=D(r)??1080,this._rescale();break;case"controls":r!==null?this._setupControls():(this.controlsApi?.destroy(),this.controlsApi=null);break;case"poster":this.posterEl=re(this.shadow,r,this.posterEl);break;case"playback-rate":{let n=oe(parseFloat(r||"1"));this._media.updatePlaybackRate(n),this._sendControl("set-playback-rate",{playbackRate:n}),this._directTimelineAdapter?.timeScale?.(n),this.controlsApi?.updateSpeed(n),this.dispatchEvent(new Event("ratechange"));break}case"muted":this._handleMutedChange(r);break;case"audio-locked":this._applyAudioLock(r!==null);break;case"volume":{let n=Math.max(0,Math.min(1,parseFloat(r||"1")));this._volume=n,this._media.updateVolume(n),this._sendControl("set-volume",{volume:n}),this.controlsApi?.updateVolume(n),this.dispatchEvent(new Event("volumechange"));break}case"audio-src":r?this._media.setupFromUrl(r):this._media.teardownUrlAudio();break;case w:case M:this._reloadShaderOptions();break}}get iframeElement(){return this.iframe}get scenes(){return this._scenes}play(){this.posterEl?.remove(),this.posterEl=null,this._duration>0&&this._currentTime>=this._duration&&this.seek(0),this._paused=!1;let e=this._tryDirectTimelinePlay();e||(this._sendControl("play"),this._ready&&!this._directTimelineAdapter&&this._startParentTickClock()),this._media.audioOwner==="parent"&&this._media.playAll(),this.controlsApi?.updatePlaying(!0),this.dispatchEvent(new Event("play")),e&&this._directTimelineAdapter&&this._directTimelineClock.start(this._directTimelineAdapter,()=>this._currentTime,()=>this._duration,()=>this._paused)}pause(){this._tryDirectTimelinePause()||this._sendControl("pause"),this._directTimelineClock.stop(),this._stopParentTickClock(),this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.dispatchEvent(new Event("pause"))}stopMedia(){this._sendControl("stop-media"),this._stopIframeMedia(),this._media.stopAdoptedMedia()}seek(e){!this._trySyncSeek(e)&&!this._tryDirectTimelineSeek(e)&&this._sendControl("seek",{timeSeconds:e,frame:Math.round(e*this._runtimeFps)}),this._directTimelineClock.stop(),this._stopParentTickClock(),this._currentTime=e,this._media.audioOwner==="parent"&&(this._scrubbing?this._media.scrubAll(e):(this._media.pauseAll(),this._media.seekAll(e))),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.controlsApi?.updateTime(this._currentTime,this._duration)}setColorGrading(e,t){this._sendControl("set-color-grading",{target:e,grading:t})}clearColorGrading(e){this._sendControl("set-color-grading",{target:e,grading:null})}setColorGradingCompare(e,t){this._sendControl("set-color-grading-compare",{target:e,compare:t})}clearColorGradingCompare(e){this._sendControl("set-color-grading-compare",{target:e,compare:{enabled:!1}})}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 oe(parseFloat(this.getAttribute("playback-rate")||"1"))}set playbackRate(e){this.setAttribute("playback-rate",String(oe(e)))}get shaderCaptureScale(){return $e(this)}set shaderCaptureScale(e){this.setAttribute(w,String(e))}get shaderLoading(){return P(this)}set shaderLoading(e){e==="composition"?this.removeAttribute(M):this.setAttribute(M,e)}get muted(){return this.hasAttribute("muted")}set muted(e){e?this.setAttribute("muted",""):this.removeAttribute("muted")}get audioLocked(){return this.hasAttribute("audio-locked")}set audioLocked(e){e?this.setAttribute("audio-locked",""):this.removeAttribute("audio-locked")}_isLockedHostEnvironment(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"";return/\bClaude\/\d/.test(e)&&/\bElectron\b/.test(e)}_isAudioLocked(){return this.hasAttribute("audio-locked")||this._isLockedHostEnvironment()}_isSlideshowPlayer(){return this.closest("hyperframes-slideshow")!==null}_handleMutedChange(e){if(e===null&&this._isAudioLocked()){this.setAttribute("muted","");return}this._media.updateMuted(e!==null),this._setIframeMediaMuted(e!==null),this._sendControl("set-muted",{muted:e!==null}),this.controlsApi?.updateMuted(e!==null),this.dispatchEvent(new Event("volumechange"))}_applyAudioLock(e){e&&(this.muted=!0),this.controlsApi?.setVolumeControlsHidden(e)}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={}){try{this.iframe.contentWindow?.postMessage({...t,source:"hf-parent",type:"control",action:e,...Ue(this._runtimeFps)},"*")}catch{}}_getSameOriginIframeDocument(){try{return this.iframe.contentDocument}catch{return null}}_setIframeMediaMuted(e){let t=this._getSameOriginIframeDocument();if(t)for(let r of t.querySelectorAll("video, audio"))_(r)&&(r.muted=e||r.defaultMuted)}_stopIframeMedia(){let e=this._getSameOriginIframeDocument();if(e)for(let t of e.querySelectorAll("video, audio"))_(t)&&t.pause()}_replayBridgeState(){this._sendControl("set-muted",{muted:this.muted}),this._sendControl("set-volume",{volume:this._volume}),this._sendControl("set-playback-rate",{playbackRate:this.playbackRate}),this._sendControl("set-native-media-sync-disabled",{disabled:this._isSlideshowPlayer()}),this._sendControl("set-web-audio-media-disabled",{disabled:this._isSlideshowPlayer()})}_reloadShaderOptions(){if(P(this)!=="player"&&this.shaderLoader.reset(),this.hasAttribute("srcdoc")){this.iframe.srcdoc=X(this,this.getAttribute("srcdoc")||"");return}this.hasAttribute("src")&&(this.iframe.src=Y(this,this.getAttribute("src")||""))}_trySyncSeek(e){try{let r=this.iframe.contentWindow?.__player;return typeof r?.seek!="function"?!1:(r.seek.call(r,e),!0)}catch{return!1}}_withDirectTimeline(e){let t=this._directTimelineAdapter||this.probe.resolveDirectTimelineAdapter();if(!t)return!1;try{return e(t),this._directTimelineAdapter=t,!0}catch{return!1}}_tryDirectTimelineSeek(e){return this._withDirectTimeline(t=>{t.seek(e,!1),t.pause()})}_tryDirectTimelinePlay(){return this._withDirectTimeline(e=>{e.play()})}_tryDirectTimelinePause(){return this._withDirectTimeline(e=>{e.pause()})}_startParentTickClock(){this._stopParentTickClock();let e=()=>{if(this._paused){this._parentTickRaf=null;return}this._sendControl("tick"),this._parentTickRaf=requestAnimationFrame(e)};this._parentTickRaf=requestAnimationFrame(e)}_stopParentTickClock(){this._parentTickRaf!==null&&(cancelAnimationFrame(this._parentTickRaf),this._parentTickRaf=null)}_onMessage(e){ze(e,this.iframe.contentWindow,{getPlaybackState:()=>({currentTime:this._currentTime,duration:this._duration,paused:this._paused,lastUpdateMs:this._lastUpdateMs}),setPlaybackState:({currentTime:t,duration:r,paused:n,lastUpdateMs:o})=>{this._currentTime=t,this._duration=r,this._paused=n,this._lastUpdateMs=o},getShaderLoadingMode:()=>P(this),shaderLoader:this.shaderLoader,setCompositionSize:(t,r)=>{this._compositionWidth=t,this._compositionHeight=r,this._rescale()},sendControl:(t,r)=>this._sendControl(t,r),getIframeDoc:()=>this.iframe.contentDocument,onRuntimeReady:()=>this._replayBridgeState(),onRuntimeTimelineReady:t=>this._onRuntimeTimelineReady(t),setRuntimeFps:t=>{this._runtimeFps=t},shouldPromoteMediaAutoplayFallback:()=>!this._isSlideshowPlayer(),setScenes:t=>{this._scenes=t,this.dispatchEvent(new CustomEvent("scenes",{detail:{scenes:t}}))},updateControlsTime:(t,r)=>this.controlsApi?.updateTime(t,r),updateControlsPlaying:t=>this.controlsApi?.updatePlaying(t),dispatchEvent:t=>this.dispatchEvent(t),seek:t=>this.seek(t),play:()=>this.play(),getLoop:()=>this.loop,media:this._media})}_onRuntimeTimelineReady(e){if(this._ready)return;this.probe.stop(),this._duration=e,this._directTimelineAdapter=null,this._ready=!0,this.controlsApi?.updateTime(this._currentTime,e),this.dispatchEvent(new CustomEvent("ready",{detail:{duration:e}})),this._rescale();let t=this._getSameOriginIframeDocument();t&&this._media.setupFromIframe(t),this._replayBridgeState(),this._setIframeMediaMuted(this.muted),this.hasAttribute("autoplay")&&this.play()}_onProbeReady({duration:e,adapter:t,compositionSize:r}){this._duration=e,this._directTimelineAdapter=t.kind==="direct-timeline"?t.timeline:null,this._ready=!0,this.controlsApi?.updateTime(0,e),this.dispatchEvent(new CustomEvent("ready",{detail:{duration:e}})),r&&(this._compositionWidth=r.width,this._compositionHeight=r.height,this._rescale());try{let n=this.iframe.contentDocument;n&&this._media.setupFromIframe(n)}catch{}this._setIframeMediaMuted(this.muted),this.hasAttribute("autoplay")&&this.play()}_rescale(){!Re(this,this.iframe,this._compositionWidth,this._compositionHeight)&&this._ready&&!this._rescaleWarned&&(this._rescaleWarned=!0,console.warn("[hyperframes-player] rescale no-op after ready \u2014 zero-size player element",{src:this.getAttribute("src"),offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight,compositionWidth:this._compositionWidth,compositionHeight:this._compositionHeight}))}_onIframeLoad(){this._ready=!1,this._directTimelineAdapter=null,this._directTimelineClock.stop(),this._stopParentTickClock(),this.shaderLoader.reset(),this._media.resetForIframeLoad(),this.probe.start()}_setupControls(){this.controlsApi||(this.controlsApi=xe(this.shadow,this.muted,this._volume,this.getAttribute("speed-presets"),{onPlay:()=>this.play(),onPause:()=>this.pause(),onSeek:e=>this.seek(e*this._duration),onScrubStart:()=>{this._scrubbing=!0},onScrubEnd:()=>{this._scrubbing=!1,this.seek(this._currentTime)},onSpeedChange:e=>{this.playbackRate=e},onMuteToggle:()=>{this.muted=!this.muted},onVolumeChange:e=>{this.volume=e}},this._isAudioLocked()))}get _audioOwner(){return this._media.audioOwner}get _parentMedia(){return this._media.entries}_mirrorParentMediaTime(e,t){this._media.mirrorTime(e,t)}_promoteToParentProxy(){let e=null;try{e=this.iframe.contentDocument}catch{}this._media.promoteToParentProxy(e,(t,r)=>this._mirrorParentMediaTime(t,r)),this._sendControl("set-media-output-muted",{muted:!0})}_observeDynamicMedia(e){this._media.setupFromIframe(e)}};customElements.get("hyperframes-player")||customElements.define("hyperframes-player",Q);return Qe(xt);})();
459
+ `,Ae='<svg width="24" height="24" viewBox="46 21 54 56" fill="currentColor"><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"/></svg>',we='<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>',Ce='<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>';var te=[.25,.5,1,1.5,2,4];function N(i){return Number.isInteger(i)?`${i}x`:`${i}x`}function $(i){if(!Number.isFinite(i)||i<0)return"0:00";let e=Math.floor(i),t=Math.floor(e/60),r=e%60;return`${t}:${r.toString().padStart(2,"0")}`}function ke(i,e,t={}){let r=t.speedPresets??te,n=document.createElement("div");n.className="hfp-controls",n.addEventListener("click",a=>{a.stopPropagation()});let o=document.createElement("button");o.className="hfp-play-btn",o.type="button",o.innerHTML=`<span class="hfp-ico hfp-ico-play">${Ae}</span><span class="hfp-ico hfp-ico-pause">${we}</span>`,o.setAttribute("aria-label","Play");let s=document.createElement("div");s.className="hfp-scrubber";let l=document.createElement("div");l.className="hfp-progress",l.style.width="0%",s.appendChild(l);let u=document.createElement("span");u.className="hfp-time",u.textContent="0:00 / 0:00";let p=document.createElement("div");p.className="hfp-speed-wrap";let c=document.createElement("button");c.className="hfp-speed-btn",c.type="button",c.textContent="1x",c.setAttribute("aria-label","Playback speed");let g=document.createElement("div");g.className="hfp-speed-menu",g.setAttribute("role","menu");for(let a of r){let d=document.createElement("button");d.className="hfp-speed-option",d.type="button",d.setAttribute("role","menuitem"),d.dataset.speed=String(a),d.textContent=N(a),a===1&&d.classList.add("hfp-active"),g.appendChild(d)}p.appendChild(g),p.appendChild(c);let y=document.createElement("div");y.className="hfp-volume-wrap";let f=document.createElement("button");f.className="hfp-mute-btn",f.type="button",f.innerHTML=K,f.setAttribute("aria-label","Mute");let S=document.createElement("div");S.className="hfp-volume-slider-wrap";let m=document.createElement("div");m.className="hfp-volume-slider",m.setAttribute("role","slider"),m.setAttribute("aria-label","Volume"),m.setAttribute("aria-valuemin","0"),m.setAttribute("aria-valuemax","100"),m.setAttribute("aria-valuenow","100"),m.tabIndex=0;let E=document.createElement("div");E.className="hfp-volume-fill",E.style.width="100%",m.appendChild(E),S.appendChild(m),y.appendChild(S),y.appendChild(f),t.audioLocked&&(y.style.display="none"),n.appendChild(o),n.appendChild(s),n.appendChild(u),n.appendChild(y),n.appendChild(p),i.appendChild(n);let O=!1,C=!1,A=1,R=null,F=r.indexOf(1);F===-1&&(F=0);let H=(a,d)=>a?Ce:d===0?ee:d<.5?ee:K;o.addEventListener("click",a=>{a.stopPropagation(),O?e.onPause():e.onPlay()}),f.addEventListener("click",a=>{a.stopPropagation(),e.onMuteToggle()});let k=!1,U=a=>{let d=m.getBoundingClientRect(),b=Math.max(0,Math.min(1,(a-d.left)/d.width));A=b,E.style.width=`${b*100}%`,m.setAttribute("aria-valuenow",String(Math.round(b*100))),C&&b>0&&e.onMuteToggle(),f.innerHTML=H(C,b),e.onVolumeChange(b)};m.addEventListener("mousedown",a=>{a.stopPropagation(),k=!0,U(a.clientX)});let ae=a=>{k&&U(a.clientX)},se=()=>{k=!1};document.addEventListener("mousemove",ae),document.addEventListener("mouseup",se),m.addEventListener("touchstart",a=>{k=!0;let d=a.touches[0];d&&U(d.clientX)},{passive:!0});let le=a=>{if(k){let d=a.touches[0];d&&U(d.clientX)}},de=()=>{k=!1};document.addEventListener("touchmove",le,{passive:!0}),document.addEventListener("touchend",de);let ue=.05;m.addEventListener("keydown",a=>{let d=A;if(a.key==="ArrowRight"||a.key==="ArrowUp")d=Math.min(1,A+ue);else if(a.key==="ArrowLeft"||a.key==="ArrowDown")d=Math.max(0,A-ue);else return;a.preventDefault(),a.stopPropagation(),A=d,E.style.width=`${d*100}%`,m.setAttribute("aria-valuenow",String(Math.round(d*100))),C&&d>0&&e.onMuteToggle(),f.innerHTML=H(C,d),e.onVolumeChange(d)});let ce=a=>{for(let d of g.querySelectorAll(".hfp-speed-option"))d.classList.toggle("hfp-active",d.dataset.speed===String(a))};c.addEventListener("click",a=>{a.stopPropagation();let d=g.classList.toggle("hfp-open");c.setAttribute("aria-expanded",String(d))}),g.addEventListener("click",a=>{a.stopPropagation();let d=a.target.closest(".hfp-speed-option");if(!d)return;let b=parseFloat(d.dataset.speed);F=r.indexOf(b),c.textContent=N(b),ce(b),g.classList.remove("hfp-open"),c.setAttribute("aria-expanded","false"),e.onSpeedChange(b)});let pe=()=>{g.classList.remove("hfp-open"),c.setAttribute("aria-expanded","false")};document.addEventListener("click",pe);let V=a=>{let d=s.getBoundingClientRect(),b=Math.max(0,Math.min(1,(a-d.left)/d.width));e.onSeek(b)},T=!1;s.addEventListener("mousedown",a=>{a.stopPropagation(),T=!0,e.onScrubStart?.(),V(a.clientX)});let he=a=>{T&&V(a.clientX)},me=()=>{T&&(T=!1,e.onScrubEnd?.())};document.addEventListener("mousemove",he),document.addEventListener("mouseup",me),s.addEventListener("touchstart",a=>{T=!0,e.onScrubStart?.();let d=a.touches[0];d&&V(d.clientX)},{passive:!0});let fe=a=>{if(T){let d=a.touches[0];d&&V(d.clientX)}},be=()=>{T&&(T=!1,e.onScrubEnd?.())};document.addEventListener("touchmove",fe,{passive:!0}),document.addEventListener("touchend",be);let ve=()=>{R&&clearTimeout(R),R=setTimeout(()=>{O&&n.classList.add("hfp-hidden")},3e3)},z=i instanceof ShadowRoot?i.host:i,ge=()=>{n.classList.remove("hfp-hidden"),ve()},_e=()=>{O&&n.classList.add("hfp-hidden")};return z.addEventListener("mousemove",ge),z.addEventListener("mouseleave",_e),{updateTime(a,d){let b=d>0?Math.min(a,d):a,Be=d>0?b/d*100:0;l.style.width=`${Be}%`,u.textContent=`${$(b)} / ${$(d)}`},updatePlaying(a){O=a,o.classList.toggle("hfp-playing",a),o.setAttribute("aria-label",a?"Pause":"Play"),a?ve():n.classList.remove("hfp-hidden")},updateSpeed(a){let d=r.indexOf(a);d!==-1&&(F=d),c.textContent=N(a),ce(a)},updateMuted(a){C=a,f.innerHTML=H(a,A),f.setAttribute("aria-label",a?"Unmute":"Mute")},updateVolume(a){A=a,E.style.width=`${a*100}%`,m.setAttribute("aria-valuenow",String(Math.round(a*100))),f.innerHTML=H(C,a)},setVolumeControlsHidden(a){y.style.display=a?"none":""},show(){n.style.display=""},hide(){n.style.display="none"},destroy(){document.removeEventListener("mousemove",he),document.removeEventListener("mouseup",me),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",be),document.removeEventListener("mousemove",ae),document.removeEventListener("mouseup",se),document.removeEventListener("touchmove",le),document.removeEventListener("touchend",de),document.removeEventListener("click",pe),z.removeEventListener("mousemove",ge),z.removeEventListener("mouseleave",_e),R&&clearTimeout(R),n.remove()}}}function xe(i,e,t,r,n,o=!1){let s=r?r.split(",").map(Number).filter(p=>!isNaN(p)&&p>0):void 0,l={...s?{speedPresets:s}:{},audioLocked:o},u=ke(i,n,l);return u.updateMuted(e),u.updateVolume(t),u}function re(i,e,t){return e?(t||(t=document.createElement("img"),t.className="hfp-poster",i.appendChild(t)),t.src=e,t):(t?.remove(),null)}function Me(i){return i.composedPath().some(e=>e instanceof HTMLElement&&e.classList.contains("hfp-controls"))}var W=null;function Le(i,e){if(typeof CSSStyleSheet<"u")try{W||(W=new CSSStyleSheet,W.replaceSync(e)),i.adoptedStyleSheets=[W];return}catch{}let t=document.createElement("style");t.textContent=e,i.appendChild(t)}function Pe(){let i=document.createElement("div");i.className="hfp-container";let e=document.createElement("iframe");return e.className="hfp-iframe",e.sandbox.add("allow-scripts","allow-same-origin"),e.allow="autoplay; fullscreen",e.referrerPolicy="no-referrer",e.title="HyperFrames Composition",i.appendChild(e),{container:i,iframe:e}}function Re(i,e,t,r){let n=i.offsetWidth,o=i.offsetHeight;if(n===0||o===0)return!1;let s=Math.min(n/t,o/r);return e.style.width=`${t}px`,e.style.height=`${r}px`,e.style.transform=`translate(-50%, -50%) scale(${s})`,!0}var B=class{constructor(e){this._callbacks=e}_callbacks;_raf=null;_lastUpdateMs=0;start(e,t,r,n){this.stop();let o=()=>{if(n()){this._raf=null;return}let s;try{s=e.time()}catch{this._raf=null;return}let l=r();l>0&&(s=Math.min(s,l));let u=l>0&&s>=l,p=performance.now();if((p-this._lastUpdateMs>100||u)&&(this._lastUpdateMs=p,this._callbacks.onTimeUpdate(s,l)),u){if(this._callbacks.getLoop()){this._callbacks.restart();return}try{e.pause()}catch{}this._callbacks.onPaused(),this._raf=null;return}this._raf=requestAnimationFrame(o)};this._raf=requestAnimationFrame(o)}stop(){this._raf!==null&&(cancelAnimationFrame(this._raf),this._raf=null)}get isRunning(){return this._raf!==null}};function Ie(i){let e=Array.from(i.querySelectorAll("[data-composition-id]"));if(e.length===0)return i.body?[i.body]:[];let t=[];for(let r of e)tt(r)||t.push(r);return et(i),t}function et(i){let e=i.body;if(!e||typeof console>"u"||typeof console.warn!="function")return;let t=e.querySelectorAll("audio[data-start], video[data-start]");if(t.length===0)return;let r=[];for(let n of t)n.closest("[data-composition-id]")||r.push(n);r.length!==0&&console.warn(`[hyperframes-player] selectMediaObserverTargets: composition hosts are present, but ${r.length} body-level timed media element(s) sit outside every [data-composition-id] subtree and will not be observed. Move them inside a composition host or the parent-frame proxy will never adopt them.`,r)}function tt(i){let e=i.parentElement;for(;e;){if(e.hasAttribute("data-composition-id"))return!0;e=e.parentElement}return!1}function G(i){let e=i.ownerDocument?.defaultView;return e&&i instanceof e.Element?!0:i instanceof Element}function _(i){if(!G(i)||i.tagName!=="AUDIO"&&i.tagName!=="VIDEO")return!1;let e=i.ownerDocument?.defaultView;return e&&i instanceof e.HTMLMediaElement?!0:i instanceof HTMLMediaElement}var h=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),Gt=Object.freeze([h.start,h.duration,h.trackIndex]),qt=Object.freeze([h.derivedEnd]),Yt=Object.freeze([h.derivedEnd,h.legacyTrack]);function x(i){if(i==null||i.trim()==="")return null;let e=Number(i);return Number.isFinite(e)?e:null}var Oe=/^[A-Za-z0-9_.:-]+$/;function Fe(i,e){let t=i.charCodeAt(e);return t>=48&&t<=57}function De(i,e){let t=e;for(;t>=0&&Fe(i,t);)t--;return t}function rt(i,e){let t=e;for(;t>=0&&(i[t]??"").trim()==="";)t--;return t}function it(i){let e=i.length-1;if(!Fe(i,e))return null;let t=De(i,e);return i[t]==="."&&(t=De(i,t-1)),t+1}function nt(i){let e=it(i);if(e==null)return null;let t=rt(i,e-1),r=i[t];if(r!=="+"&&r!=="-")return null;let n=i.slice(0,t).trim();if(!Oe.test(n))return null;let o=Number(i.slice(e));return Number.isFinite(o)?{refId:n,operator:r,magnitude:o}:null}function ot(i){let e=(i??"").trim();if(!e)return null;let t=x(e);if(t!=null)return{kind:"absolute",value:t};if(Oe.test(e))return{kind:"reference",refId:e,offset:0};let r=nt(e);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}function v(i,e,t,r){i.push({code:e,attribute:t,value:r})}function at(i,e,t,r){if(e==null||e.trim()==="")return t.defaultStart===void 0?0:t.defaultStart;if(!i)return v(r,"invalid-start",h.start,e),null;if(i.kind==="absolute")return Math.max(0,i.value);let n=t.resolveReferenceEnd?.(i.refId);return n==null||!Number.isFinite(n)?(v(r,"unresolved-start-reference",h.start,e),null):Math.max(0,n+i.offset)}var st=1e-9;function lt(i,e){return Math.abs(i-e)<=st}function dt(i,e,t){let r=x(i);if(r==null){v(t,"deprecated-end",h.derivedEnd,i),v(t,"invalid-end",h.derivedEnd,i);return}if(e==null){v(t,"deprecated-end",h.derivedEnd,i);return}lt(r,e)||(v(t,"deprecated-end",h.derivedEnd,i),v(t,"conflicting-end",h.derivedEnd,i))}function ut(i,e,t){let r=x(i);return r==null||r<0?(v(t,"invalid-duration",h.duration,i),{duration:null,end:null,durationSource:"invalid"}):{duration:r,end:e==null?null:e+r,durationSource:"duration"}}function ct(i,e,t){v(t,"deprecated-end",h.derivedEnd,i);let r=x(i);return r==null?(v(t,"invalid-end",h.derivedEnd,i),{duration:null,end:null,durationSource:"invalid"}):e==null?{duration:null,end:r,durationSource:"legacy-end"}:r<e?(v(t,"end-before-start",h.derivedEnd,i),{duration:null,end:null,durationSource:"invalid"}):{duration:r-e,end:r,durationSource:"legacy-end"}}function pt(i,e,t){let r=i.getAttribute(h.duration),n=i.getAttribute(h.derivedEnd);if(r==null)return n==null?{duration:null,end:null,durationSource:"missing"}:ct(n,e,t);let o=ut(r,e,t);return n!=null&&dt(n,o.end,t),o}function Ne(i,e,t,r){let n=x(i);return n==null||!Number.isInteger(n)?(v(r,"invalid-track-index",e,i),{trackIndex:0,trackSource:"invalid"}):{trackIndex:n,trackSource:t}}function ht(i,e){let t=i.getAttribute(h.trackIndex),r=i.getAttribute(h.legacyTrack);if(t==null&&r==null)return{trackIndex:0,trackSource:"default"};if(t==null&&r!=null)return v(e,"deprecated-layer",h.legacyTrack,r),Ne(r,h.legacyTrack,"legacy-layer",e);let n=Ne(t??"",h.trackIndex,"track-index",e);if(r==null)return n;v(e,"deprecated-layer",h.legacyTrack,r);let o=x(r);return o!=null&&o!==n.trackIndex&&v(e,"conflicting-layer",h.legacyTrack,r),n}function ie(i,e={}){let t=[],r=i.getAttribute(h.start),n=ot(r),o=at(n,r,e,t),s=pt(i,o,t),l=ht(i,t);return{startExpression:n,start:o,...s,...l,diagnostics:t}}var mt=.05,ft=2,q=class{_entries=[];_mediaObserver;_playbackErrorPosted=!1;_audioOwner="runtime";_urlAudioEntry=null;_urlAudioSrc=null;_dispatchEvent;_getMuted;_getVolume;_getPlaybackRate;_getCurrentTime;_isPaused;constructor(e){this._dispatchEvent=e.dispatchEvent,this._getMuted=e.getMuted,this._getVolume=e.getVolume,this._getPlaybackRate=e.getPlaybackRate,this._getCurrentTime=e.getCurrentTime,this._isPaused=e.isPaused}get audioOwner(){return this._audioOwner}get entries(){return this._entries}resetForIframeLoad(){this._playbackErrorPosted=!1;let e=this._audioOwner==="parent";this._audioOwner="runtime",this.pauseAll(),this.teardownObserver(),e&&this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}}))}destroy(){this.teardownObserver();for(let e of this._entries)e.el.pause(),e.el.src="";this._entries=[],this._urlAudioEntry=null,this._urlAudioSrc=null,this._audioOwner="runtime",this._playbackErrorPosted=!1}updateMuted(e){for(let t of this._entries)t.el.muted=e}updateVolume(e){for(let t of this._entries)t.el.volume=e}updatePlaybackRate(e){for(let t of this._entries)t.el.playbackRate=e}_playEntry(e){e.el.src&&e.el.play().catch(t=>this._reportPlaybackError(t))}_playEntryIfActive(e){this._refreshEntryBounds(e);let t=this._getCurrentTime()-e.start;t<0||t>=e.duration||this._playEntry(e)}_refreshEntryBounds(e){if(!e.source?.isConnected)return;let t=ie(e.source);e.start=t.start??0,e.duration=t.duration!=null&&t.duration>0?t.duration:Number.POSITIVE_INFINITY}_gateEntryPlayback(e,t){return t<0||t>=e.duration?(e.el.paused||e.el.pause(),e.driftSamples=0,!1):(this._audioOwner==="parent"&&!this._isPaused()&&e.el.paused&&this._playEntry(e),!0)}playAll(){for(let e of this._entries)this._playEntryIfActive(e)}pauseAll(){for(let e of this._entries)e.el.pause()}stopAdoptedMedia(){for(let e of this._entries)e.source&&e.el.pause()}seekAll(e){for(let t of this._entries){this._refreshEntryBounds(t);let r=e-t.start;r>=0&&r<t.duration&&(t.el.currentTime=r)}}scrubAll(e){for(let t of this._entries){this._refreshEntryBounds(t);let r=e-t.start;r>=0&&r<t.duration?(t.el.currentTime=r,this._playEntry(t)):t.el.paused||t.el.pause()}}mirrorTime(e,t){let r=t?.force===!0;for(let n of this._entries){this._refreshEntryBounds(n);let o=e-n.start;this._gateEntryPlayback(n,o)&&(Math.abs(n.el.currentTime-o)>mt?(n.driftSamples+=1,(r||n.driftSamples>=ft)&&(n.el.currentTime=o,n.driftSamples=0)):n.driftSamples=0)}}promoteToParentProxy(e,t){if(this._audioOwner==="parent")return;if(this._audioOwner="parent",e)for(let n of e.querySelectorAll("video, audio"))_(n)&&(n.muted=!0);let r=this._getCurrentTime();t?t(r,{force:!0}):this.mirrorTime(r,{force:!0}),this._isPaused()||this.playAll(),this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}}))}setupFromIframe(e){let t=e.querySelectorAll("audio[data-start], video[data-start]");for(let r of t)_(r)&&this._adoptIframeMedia(r);this._observeDynamicMedia(e)}setupFromUrl(e){if(this._urlAudioSrc===e&&this._urlAudioEntry)return;this.teardownUrlAudio();let t=this._createEntry(e,"audio",0,1/0);this._urlAudioEntry=t,this._urlAudioSrc=t?e:null,t&&this._audioOwner==="parent"&&!this._isPaused()&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this.playAll())}teardownUrlAudio(){let e=this._urlAudioEntry;if(this._urlAudioEntry=null,this._urlAudioSrc=null,!e)return;e.el.pause(),e.el.src="";let t=this._entries.indexOf(e);t!==-1&&this._entries.splice(t,1)}teardownObserver(){this._mediaObserver?.disconnect(),this._mediaObserver=void 0}_reportPlaybackError(e){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this._dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:e}})))}_createEntry(e,t,r,n,o){if(this._entries.some(p=>p.el.src===e))return null;let s=t==="video"?document.createElement("video"):new Audio;s.preload="auto",s.src=e,s.load(),s.muted=this._getMuted(),s.volume=this._getVolume();let l=this._getPlaybackRate();l!==1&&(s.playbackRate=l);let u={el:s,start:r,duration:n,driftSamples:0,source:o};return this._entries.push(u),u}_resolveIframeMediaSrc(e){let t=e.getAttribute("src")||e.querySelector("source")?.getAttribute("src");return t?new URL(t,e.ownerDocument.baseURI).href:null}_adoptIframeMedia(e){if(e.preload==="metadata"||e.preload==="none")return;let t=this._resolveIframeMediaSrc(e);if(!t)return;let r=ie(e),n=r.start??0,o=r.duration??Number.POSITIVE_INFINITY,s=e.tagName==="VIDEO"?"video":"audio",l=this._createEntry(t,s,n,o,e);l&&this._audioOwner==="parent"&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(l))}_detachIframeMedia(e){let t=this._resolveIframeMediaSrc(e);if(!t)return;let r=this._entries.findIndex(o=>o.el.src===t);if(r===-1)return;let n=this._entries[r];n.el.pause(),n.el.src="",this._entries.splice(r,1)}_observeDynamicMedia(e){if(this.teardownObserver(),typeof MutationObserver>"u"||!e.body)return;let t=new MutationObserver(o=>{for(let s of o){if(s.type==="attributes"&&s.attributeName==="preload"){let l=s.target;_(l)&&l.matches("audio[data-start], video[data-start]")&&l.preload==="auto"&&this._adoptIframeMedia(l);continue}for(let l of s.addedNodes){if(!G(l))continue;let u=[];_(l)&&l.matches("audio[data-start], video[data-start]")&&u.push(l);let p=l.querySelectorAll("audio[data-start], video[data-start]");for(let c of p)_(c)&&u.push(c);for(let c of u)this._adoptIframeMedia(c)}for(let l of s.removedNodes){if(!G(l))continue;let u=[];_(l)&&l.matches("audio[data-start], video[data-start]")&&u.push(l);let p=l.querySelectorAll("audio[data-start], video[data-start]");for(let c of p)_(c)&&u.push(c);for(let c of u)this._detachIframeMedia(c)}}}),r={childList:!0,subtree:!0,attributes:!0,attributeFilter:["preload"]},n=Ie(e);for(let o of n)t.observe(o,r);this._mediaObserver=t}};function He(i,e,t,r){let n=(i.frame??0)/e,o=t.duration>0?Math.min(n,t.duration):n,s=!t.paused,l=!i.isPlaying,u=t.duration>0&&o>=t.duration&&(s||i.isPlaying);if(u&&r.getLoop())return r.media.audioOwner==="parent"&&r.media.pauseAll(),r.seek(0),r.play(),{...t,currentTime:o,paused:!1};let p={...t,currentTime:o,paused:l};r.media.audioOwner==="parent"&&(s&&l?r.media.pauseAll():!s&&!l&&r.media.playAll(),r.media.mirrorTime(o));let c=performance.now(),g=l!==t.paused;return(c-t.lastUpdateMs>100||g)&&(p.lastUpdateMs=c,r.updateControlsTime(o,t.duration),r.updateControlsPlaying(!l),r.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:o}}))),u&&(r.media.audioOwner==="parent"&&r.media.pauseAll(),p.paused=!0,r.updateControlsPlaying(!1),r.dispatchEvent(new Event("ended"))),p}var bt=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1"];function vt(i,e){let t=Math.abs(i),r=Math.abs(e);for(;r!==0;){let n=t%r;t=r,r=n}return t||1}function gt(i){let e=Number.isFinite(i)&&i>0?i:30,t=Number.isInteger(e)?1:1e6,r=Math.round(e*t),n=vt(r,t);return{numerator:r/n,denominator:t/n}}function _t(i){if(typeof i!="object"||i===null)return null;let e=i;return!Number.isFinite(e.numerator)||!Number.isFinite(e.denominator)||(e.numerator??0)<=0||(e.denominator??0)<=0?null:Number(e.numerator)/Number(e.denominator)}function Ue(i){return{protocolVersion:1,capabilities:bt,fps:gt(i)}}function yt(i){return Array.isArray(i)&&i.every(e=>typeof e=="string")}function Ve(i,e=30){if(typeof i!="object"||i===null)return{status:"legacy",fps:e};let t=i;if(t.protocolVersion===void 0)return{status:"legacy",fps:e};if(t.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:t.protocolVersion};let r=_t(t.fps);return r===null||!yt(t.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:t.protocolVersion}:{status:"supported",fps:r,metadata:t}}function Et(i){return Array.isArray(i)?i.filter(e=>typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.start=="number"&&typeof e.duration=="number"):[]}function ze(i,e,t){if(i.source!==e)return;let r=i.data;if(!r||r.source!=="hf-preview")return;let n=Ve(r);if(n.status==="unsupported"){t.dispatchEvent(new CustomEvent("runtimeprotocolerror",{detail:{code:n.code,receivedVersion:n.receivedVersion}}));return}if(t.setRuntimeFps?.(n.fps),r.type==="shader-transition-state"){let o=r.state&&typeof r.state=="object"?r.state:{};t.shaderLoader.update(o,t.getShaderLoadingMode()),t.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:r.compositionId,state:o}}));return}if(r.type==="ready"){t.onRuntimeReady();return}if(r.type==="state"){t.setPlaybackState(He({frame:r.frame??0,isPlaying:!!r.isPlaying},n.fps,t.getPlaybackState(),t));return}if(r.type==="media-autoplay-blocked"){if(t.shouldPromoteMediaAutoplayFallback?.()===!1)return;let o=null;try{o=t.getIframeDoc()}catch{}t.media.promoteToParentProxy(o,(s,l)=>t.media.mirrorTime(s,l)),t.sendControl("set-media-output-muted",{muted:!0});return}if(r.type==="timeline"&&r.durationInFrames>0){let o=Number(r.durationSeconds),s=Number(r.durationInFrames),l=Number.isFinite(o)&&o>0?o:s/n.fps;if(Number.isFinite(l)&&l>0){let u=t.getPlaybackState();t.setPlaybackState({...u,duration:l}),t.updateControlsTime(u.currentTime,l),t.onRuntimeTimelineReady(l)}Number.isFinite(r.compositionWidth)&&r.compositionWidth>0&&Number.isFinite(r.compositionHeight)&&r.compositionHeight>0&&t.setCompositionSize(r.compositionWidth,r.compositionHeight),t.setScenes(Et(r.scenes));return}r.type==="stage-size"&&Number.isFinite(r.width)&&r.width>0&&Number.isFinite(r.height)&&r.height>0&&t.setCompositionSize(r.width,r.height)}var w="shader-capture-scale",M="shader-loading",St="__hf_shader_capture_scale",Tt="__hf_shader_loading",L=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"];function ne(i){if(i===null)return null;let e=Number(i);return!Number.isFinite(e)||e<=0?null:String(Math.min(1,Math.max(.25,e)))}function At(i){if(i===null||i.trim()==="")return"composition";let e=i.trim().toLowerCase();return e==="none"||e==="false"||e==="0"||e==="off"?"none":e==="player"||e==="true"||e==="1"||e==="on"?"player":"composition"}function je(i,e,t){t===null?i.delete(e):i.set(e,t)}function wt(i,e,t){let r=i.indexOf("#"),n=r>=0?i.slice(0,r):i,o=r>=0?i.slice(r):"",s=n.indexOf("?"),l=s>=0?n.slice(0,s):n,u=s>=0?n.slice(s+1):"",p=new URLSearchParams(u);je(p,St,e),je(p,Tt,t==="composition"?null:t);let c=p.toString();return`${l}${c?`?${c}`:""}${o}`}function Ct(i,e,t){if(e===null&&t==="composition")return i;let r=[];e!==null&&r.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(e)};`),t!=="composition"&&r.push(`window.__HF_SHADER_LOADING=${JSON.stringify(t)};`);let n=`<script data-hyperframes-player-shader-options>${r.join("")}</script>`;return/<head\b[^>]*>/i.test(i)?i.replace(/<head\b[^>]*>/i,o=>`${o}${n}`):/<html\b[^>]*>/i.test(i)?i.replace(/<html\b[^>]*>/i,o=>`${o}${n}`):`${n}${i}`}function P(i){return At(i.getAttribute(M))}function $e(i){return Number(ne(i.getAttribute(w))??"1")}function Y(i,e){return wt(e,ne(i.getAttribute(w)),P(i))}function X(i,e){return Ct(e,ne(i.getAttribute(w)),P(i))}function We(){let i=document.createElement("div");i.className="hfp-shader-loader",i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),i.setAttribute("aria-label","Preparing scene transitions"),i.setAttribute("data-hyperframes-ignore",""),i.draggable=!1;let e=f=>{f.preventDefault(),f.stopPropagation()};for(let f of["selectstart","dragstart","pointerdown","mousedown","click","dblclick","contextmenu","touchstart"])i.addEventListener(f,e,{capture:!0});let t=document.createElement("div");t.className="hfp-shader-loader-panel",t.draggable=!1;let 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("");let n=document.createElement("div");n.className="hfp-shader-loader-title";let o=document.createElement("span");o.className="hfp-shader-loader-title-text",o.textContent=L[0]||"Preparing scene transitions",n.appendChild(o);let s=document.createElement("div");s.className="hfp-shader-loader-detail",s.textContent="Rendering animated scene samples for shader transitions.";let l=document.createElement("div");l.className="hfp-shader-loader-track",l.setAttribute("aria-hidden","true");let u=document.createElement("div");u.className="hfp-shader-loader-fill",l.appendChild(u);let p=document.createElement("div");p.className="hfp-shader-loader-progress";let c=f=>{let S=document.createElement("div");S.className="hfp-shader-loader-row";let m=document.createElement("span");m.className="hfp-shader-loader-label",m.textContent=f;let E=document.createElement("span");return E.className="hfp-shader-loader-value",S.appendChild(m),S.appendChild(E),p.appendChild(S),{row:S,label:m,value:E}},g=c("transition"),y=c("transition frame");return t.appendChild(r),t.appendChild(n),t.appendChild(s),t.appendChild(l),t.appendChild(p),i.appendChild(t),{root:i,fill:u,title:o,detail:s,transitionValue:g.value,frameLabel:y.label,frameValue:y.value,frameRow:y.row}}var kt=420,Z=class{_el;_hideTimeout=null;constructor(e){this._el=e}show(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-hiding"),this._el.root.classList.add("hfp-visible")}hide(){if(this._el.root.classList.contains("hfp-hiding")){this._hideTimeout||this._scheduleCleanup();return}this._el.root.classList.contains("hfp-visible")&&(this._el.root.classList.add("hfp-hiding"),this._el.root.classList.remove("hfp-visible"),this._scheduleCleanup())}reset(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-visible","hfp-hiding"),this._el.fill.style.transform="scaleX(0)",this._el.transitionValue.textContent="",this._el.frameValue.textContent="",this._el.frameRow.style.visibility="hidden"}update(e,t){if(t!=="player"){this.reset();return}if(e.ready||!e.loading){this.hide();return}let r=typeof e.progress=="number"&&Number.isFinite(e.progress)?e.progress:0,n=typeof e.total=="number"&&Number.isFinite(e.total)?e.total:0,o=n>0?Math.min(1,Math.max(0,r/n)):0,s=Math.min(L.length-1,Math.floor(o*L.length));this._el.title.textContent=L[s]||"Preparing scene transitions",this._el.detail.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._el.fill.style.transform=`scaleX(${o})`,this._el.transitionValue.textContent=e.currentTransition!==void 0&&e.transitionTotal!==void 0?`${e.currentTransition}/${e.transitionTotal}`:n>0?`${r}/${n}`:"";let l=e.transitionFrame!==void 0&&e.transitionFrames!==void 0?`${e.transitionFrame}/${e.transitionFrames}`:"";this._el.frameLabel.textContent=e.phase==="cached"?"cached transition frames":e.phase==="finalizing"?"finalizing transition frames":"rendering transition frames",this._el.frameValue.textContent=l,this._el.frameRow.style.visibility=l?"visible":"hidden",this._el.root.setAttribute("aria-valuenow",String(Math.round(o*100))),this.show()}get hideTimeout(){return this._hideTimeout}destroy(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null)}_scheduleCleanup(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>{this._el.root.classList.remove("hfp-hiding"),this._hideTimeout=null},kt)}};var xt=.1,Mt=5;function oe(i){return!Number.isFinite(i)||i<=0?1:Math.max(xt,Math.min(Mt,i))}var Q=class extends HTMLElement{static get observedAttributes(){return["src","srcdoc","width","height","controls","muted","audio-locked","volume","poster","playback-rate","audio-src",w,M]}shadow;container;iframe;posterEl=null;controlsApi=null;resizeObserver;shaderLoader;probe;_ready=!1;_currentTime=0;_duration=0;_paused=!0;_scrubbing=!1;_lastUpdateMs=0;_volume=1;_compositionWidth=1920;_compositionHeight=1080;_rescaleWarned=!1;_directTimelineAdapter=null;_directTimelineClock;_parentTickRaf=null;_media;_scenes=[];_runtimeFps=30;constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),Le(this.shadow,Te),{container:this.container,iframe:this.iframe}=Pe(),this.shadow.appendChild(this.container);let e=We();this.shadow.appendChild(e.root),this.shaderLoader=new Z(e),this._media=new q({dispatchEvent:t=>this.dispatchEvent(t),getMuted:()=>this.muted,getVolume:()=>this._volume,getPlaybackRate:()=>this.playbackRate,getCurrentTime:()=>this._currentTime,isPaused:()=>this._paused}),this._directTimelineClock=new B({onTimeUpdate:(t,r)=>{this._currentTime=t,this.controlsApi?.updateTime(t,r),this.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:t}}))},getLoop:()=>this.loop,restart:()=>{this.seek(0),this.play()},onPaused:()=>{this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.dispatchEvent(new Event("ended"))},onEnded:()=>this.loop}),this.probe=new j(this.iframe,{onReady:t=>this._onProbeReady(t),onError:t=>this.dispatchEvent(new CustomEvent("error",{detail:{message:t}}))}),this.addEventListener("click",t=>{Me(t)||(this._paused?this.play():this.pause())}),this.resizeObserver=new ResizeObserver(()=>this._rescale()),this._onMessage=this._onMessage.bind(this),this._onIframeLoad=this._onIframeLoad.bind(this)}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.posterEl=re(this.shadow,this.getAttribute("poster"),this.posterEl)),this.hasAttribute("audio-src")&&this._media.setupFromUrl(this.getAttribute("audio-src")),this.hasAttribute("srcdoc")&&(this.iframe.srcdoc=X(this,this.getAttribute("srcdoc"))),this.hasAttribute("src")&&(this.iframe.src=Y(this,this.getAttribute("src"))),!this.hasAttribute("audio-locked")&&this._isLockedHostEnvironment()&&this._applyAudioLock(!0)}disconnectedCallback(){this._sendControl("pause"),this._stopIframeMedia(),this.resizeObserver.disconnect(),window.removeEventListener("message",this._onMessage),this.iframe.removeEventListener("load",this._onIframeLoad),this.probe.stop(),this._directTimelineClock.stop(),this._stopParentTickClock(),this._directTimelineAdapter=null,this.shaderLoader.destroy(),this._media.destroy(),this.controlsApi?.destroy(),this.controlsApi=null,this._paused=!0,this._ready=!1}attributeChangedCallback(e,t,r){switch(e){case"src":r&&(this._ready=!1,this.iframe.src=Y(this,r));break;case"srcdoc":this._ready=!1,r!==null?this.iframe.srcdoc=X(this,r):this.iframe.removeAttribute("srcdoc");break;case"width":this._compositionWidth=D(r)??1920,this._rescale();break;case"height":this._compositionHeight=D(r)??1080,this._rescale();break;case"controls":r!==null?this._setupControls():(this.controlsApi?.destroy(),this.controlsApi=null);break;case"poster":this.posterEl=re(this.shadow,r,this.posterEl);break;case"playback-rate":{let n=oe(parseFloat(r||"1"));this._media.updatePlaybackRate(n),this._sendControl("set-playback-rate",{playbackRate:n}),this._directTimelineAdapter?.timeScale?.(n),this.controlsApi?.updateSpeed(n),this.dispatchEvent(new Event("ratechange"));break}case"muted":this._handleMutedChange(r);break;case"audio-locked":this._applyAudioLock(r!==null);break;case"volume":{let n=Math.max(0,Math.min(1,parseFloat(r||"1")));this._volume=n,this._media.updateVolume(n),this._sendControl("set-volume",{volume:n}),this.controlsApi?.updateVolume(n),this.dispatchEvent(new Event("volumechange"));break}case"audio-src":r?this._media.setupFromUrl(r):this._media.teardownUrlAudio();break;case w:case M:this._reloadShaderOptions();break}}get iframeElement(){return this.iframe}get scenes(){return this._scenes}play(){this.posterEl?.remove(),this.posterEl=null,this._duration>0&&this._currentTime>=this._duration&&this.seek(0),this._paused=!1;let e=this._tryDirectTimelinePlay();e||(this._sendControl("play"),this._ready&&!this._directTimelineAdapter&&this._startParentTickClock()),this._media.audioOwner==="parent"&&this._media.playAll(),this.controlsApi?.updatePlaying(!0),this.dispatchEvent(new Event("play")),e&&this._directTimelineAdapter&&this._directTimelineClock.start(this._directTimelineAdapter,()=>this._currentTime,()=>this._duration,()=>this._paused)}pause(){this._tryDirectTimelinePause()||this._sendControl("pause"),this._directTimelineClock.stop(),this._stopParentTickClock(),this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.dispatchEvent(new Event("pause"))}stopMedia(){this._sendControl("stop-media"),this._stopIframeMedia(),this._media.stopAdoptedMedia()}seek(e){!this._trySyncSeek(e)&&!this._tryDirectTimelineSeek(e)&&this._sendControl("seek",{timeSeconds:e,frame:Math.round(e*this._runtimeFps)}),this._directTimelineClock.stop(),this._stopParentTickClock(),this._currentTime=e,this._media.audioOwner==="parent"&&(this._scrubbing?this._media.scrubAll(e):(this._media.pauseAll(),this._media.seekAll(e))),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.controlsApi?.updateTime(this._currentTime,this._duration)}setColorGrading(e,t){this._sendControl("set-color-grading",{target:e,grading:t})}clearColorGrading(e){this._sendControl("set-color-grading",{target:e,grading:null})}setColorGradingCompare(e,t){this._sendControl("set-color-grading-compare",{target:e,compare:t})}clearColorGradingCompare(e){this._sendControl("set-color-grading-compare",{target:e,compare:{enabled:!1}})}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 oe(parseFloat(this.getAttribute("playback-rate")||"1"))}set playbackRate(e){this.setAttribute("playback-rate",String(oe(e)))}get shaderCaptureScale(){return $e(this)}set shaderCaptureScale(e){this.setAttribute(w,String(e))}get shaderLoading(){return P(this)}set shaderLoading(e){e==="composition"?this.removeAttribute(M):this.setAttribute(M,e)}get muted(){return this.hasAttribute("muted")}set muted(e){e?this.setAttribute("muted",""):this.removeAttribute("muted")}get audioLocked(){return this.hasAttribute("audio-locked")}set audioLocked(e){e?this.setAttribute("audio-locked",""):this.removeAttribute("audio-locked")}_isLockedHostEnvironment(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"";return/\bClaude\/\d/.test(e)&&/\bElectron\b/.test(e)}_isAudioLocked(){return this.hasAttribute("audio-locked")||this._isLockedHostEnvironment()}_isSlideshowPlayer(){return this.closest("hyperframes-slideshow")!==null}_handleMutedChange(e){if(e===null&&this._isAudioLocked()){this.setAttribute("muted","");return}this._media.updateMuted(e!==null),this._setIframeMediaMuted(e!==null),this._sendControl("set-muted",{muted:e!==null}),this.controlsApi?.updateMuted(e!==null),this.dispatchEvent(new Event("volumechange"))}_applyAudioLock(e){e&&(this.muted=!0),this.controlsApi?.setVolumeControlsHidden(e)}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={}){try{this.iframe.contentWindow?.postMessage({...t,source:"hf-parent",type:"control",action:e,...Ue(this._runtimeFps)},"*")}catch{}}_getSameOriginIframeDocument(){try{return this.iframe.contentDocument}catch{return null}}_setIframeMediaMuted(e){let t=this._getSameOriginIframeDocument();if(t)for(let r of t.querySelectorAll("video, audio"))_(r)&&(r.muted=e||r.defaultMuted)}_stopIframeMedia(){let e=this._getSameOriginIframeDocument();if(e)for(let t of e.querySelectorAll("video, audio"))_(t)&&t.pause()}_replayBridgeState(){this._sendControl("set-muted",{muted:this.muted}),this._sendControl("set-volume",{volume:this._volume}),this._sendControl("set-playback-rate",{playbackRate:this.playbackRate}),this._sendControl("set-native-media-sync-disabled",{disabled:this._isSlideshowPlayer()}),this._sendControl("set-web-audio-media-disabled",{disabled:this._isSlideshowPlayer()})}_reloadShaderOptions(){if(P(this)!=="player"&&this.shaderLoader.reset(),this.hasAttribute("srcdoc")){this.iframe.srcdoc=X(this,this.getAttribute("srcdoc")||"");return}this.hasAttribute("src")&&(this.iframe.src=Y(this,this.getAttribute("src")||""))}_trySyncSeek(e){try{let r=this.iframe.contentWindow?.__player;return typeof r?.seek!="function"?!1:(r.seek.call(r,e),!0)}catch{return!1}}_withDirectTimeline(e){let t=this._directTimelineAdapter||this.probe.resolveDirectTimelineAdapter();if(!t)return!1;try{return e(t),this._directTimelineAdapter=t,!0}catch{return!1}}_tryDirectTimelineSeek(e){return this._withDirectTimeline(t=>{t.seek(e,!1),t.pause()})}_tryDirectTimelinePlay(){return this._withDirectTimeline(e=>{e.play()})}_tryDirectTimelinePause(){return this._withDirectTimeline(e=>{e.pause()})}_startParentTickClock(){this._stopParentTickClock();let e=()=>{if(this._paused){this._parentTickRaf=null;return}this._sendControl("tick"),this._parentTickRaf=requestAnimationFrame(e)};this._parentTickRaf=requestAnimationFrame(e)}_stopParentTickClock(){this._parentTickRaf!==null&&(cancelAnimationFrame(this._parentTickRaf),this._parentTickRaf=null)}_onMessage(e){ze(e,this.iframe.contentWindow,{getPlaybackState:()=>({currentTime:this._currentTime,duration:this._duration,paused:this._paused,lastUpdateMs:this._lastUpdateMs}),setPlaybackState:({currentTime:t,duration:r,paused:n,lastUpdateMs:o})=>{this._currentTime=t,this._duration=r,this._paused=n,this._lastUpdateMs=o},getShaderLoadingMode:()=>P(this),shaderLoader:this.shaderLoader,setCompositionSize:(t,r)=>{this._compositionWidth=t,this._compositionHeight=r,this._rescale()},sendControl:(t,r)=>this._sendControl(t,r),getIframeDoc:()=>this.iframe.contentDocument,onRuntimeReady:()=>this._replayBridgeState(),onRuntimeTimelineReady:t=>this._onRuntimeTimelineReady(t),setRuntimeFps:t=>{this._runtimeFps=t},shouldPromoteMediaAutoplayFallback:()=>!this._isSlideshowPlayer(),setScenes:t=>{this._scenes=t,this.dispatchEvent(new CustomEvent("scenes",{detail:{scenes:t}}))},updateControlsTime:(t,r)=>this.controlsApi?.updateTime(t,r),updateControlsPlaying:t=>this.controlsApi?.updatePlaying(t),dispatchEvent:t=>this.dispatchEvent(t),seek:t=>this.seek(t),play:()=>this.play(),getLoop:()=>this.loop,media:this._media})}_onRuntimeTimelineReady(e){if(this._ready)return;this.probe.stop(),this._duration=e,this._directTimelineAdapter=null,this._ready=!0,this.controlsApi?.updateTime(this._currentTime,e),this.dispatchEvent(new CustomEvent("ready",{detail:{duration:e}})),this._rescale();let t=this._getSameOriginIframeDocument();t&&this._media.setupFromIframe(t),this._replayBridgeState(),this._setIframeMediaMuted(this.muted),this.hasAttribute("autoplay")&&this.play()}_onProbeReady({duration:e,adapter:t,compositionSize:r}){this._duration=e,this._directTimelineAdapter=t.kind==="direct-timeline"?t.timeline:null,this._ready=!0,this.controlsApi?.updateTime(0,e),this.dispatchEvent(new CustomEvent("ready",{detail:{duration:e}})),r&&(this._compositionWidth=r.width,this._compositionHeight=r.height,this._rescale());try{let n=this.iframe.contentDocument;n&&this._media.setupFromIframe(n)}catch{}this._setIframeMediaMuted(this.muted),this.hasAttribute("autoplay")&&this.play()}_rescale(){!Re(this,this.iframe,this._compositionWidth,this._compositionHeight)&&this._ready&&!this._rescaleWarned&&(this._rescaleWarned=!0,console.warn("[hyperframes-player] rescale no-op after ready \u2014 zero-size player element",{src:this.getAttribute("src"),offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight,compositionWidth:this._compositionWidth,compositionHeight:this._compositionHeight}))}_onIframeLoad(){this._ready=!1,this._directTimelineAdapter=null,this._directTimelineClock.stop(),this._stopParentTickClock(),this.shaderLoader.reset(),this._media.resetForIframeLoad(),this.probe.start()}_setupControls(){this.controlsApi||(this.controlsApi=xe(this.shadow,this.muted,this._volume,this.getAttribute("speed-presets"),{onPlay:()=>this.play(),onPause:()=>this.pause(),onSeek:e=>this.seek(e*this._duration),onScrubStart:()=>{this._scrubbing=!0},onScrubEnd:()=>{this._scrubbing=!1,this.seek(this._currentTime)},onSpeedChange:e=>{this.playbackRate=e},onMuteToggle:()=>{this.muted=!this.muted},onVolumeChange:e=>{this.volume=e}},this._isAudioLocked()))}get _audioOwner(){return this._media.audioOwner}get _parentMedia(){return this._media.entries}_mirrorParentMediaTime(e,t){this._media.mirrorTime(e,t)}_promoteToParentProxy(){let e=null;try{e=this.iframe.contentDocument}catch{}this._media.promoteToParentProxy(e,(t,r)=>this._mirrorParentMediaTime(t,r)),this._sendControl("set-media-output-muted",{muted:!0})}_observeDynamicMedia(e){this._media.setupFromIframe(e)}};customElements.get("hyperframes-player")||customElements.define("hyperframes-player",Q);return Qe(Lt);})();
460
460
  //# sourceMappingURL=hyperframes-player.global.js.map
@@ -22,16 +22,14 @@ Apply the first matching row; do not evaluate lower state rows:
22
22
 
23
23
  | State | Action |
24
24
  | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
- | Explicit port of existing Remotion source to HyperFrames | Read the `/remotion-to-hyperframes` section of `references/workflow-catalog.md`, then route directly to that workflow. Skip the intent layer. |
25
+ | Explicit port of existing Remotion source to HyperFrames | Read `references/routes/remotion-to-hyperframes.md`, then route directly to that workflow. Skip the intent layer. |
26
26
  | Specific operation on an existing HyperFrames project: inspect, diagnose, validate, preview, render, publish, or batch-render | Perform only that operation. Skip intent and workflow routing; load `/hyperframes-cli` and any required domain skills. |
27
27
  | Specific edit to an existing project | Make the edit. Do not run the intent layer. |
28
28
  | `BRIEF.md` exists | Read `workflow` and `flow`. Execute that workflow; `flow: companion` always executes in `/general-video`. Ask no brief questions. |
29
29
  | No brief, but `hyperframes.json` or `STORYBOARD.md` exists | Resume from project files and recorded preferences. Infer the owning workflow from existing artifacts. If it cannot be determined uniquely, ask one routing-only question; do not run the intent interview. |
30
- | Fresh creation | Run the intent layer 4), then route once using the rules below. |
30
+ | Fresh creation | Run the intent layer `references/intent-interview.md` then route once using § 2's table. |
31
31
 
32
- Continue with source adapters in § 2. A direct or resumed workflow route skips §§ 3–4 and proceeds to workflow installation in § 5. A specific operation or edit skips §§ 3–5 and loads only the domain skills it needs from § 6.
33
-
34
- If a fresh request does not identify the subject or input, ask what the video is about before routing. Check preferences and recipes before asking anything (§ 4, step 1).
32
+ If a fresh request does not identify the subject or input, ask what the video is about before routing. Check preferences and recipes before asking anything (`references/intent-interview.md`, step 1). A `figma.com` input or a named recipe changes intake, not routing the interview's "Adapt orthogonal inputs" section handles both.
35
33
 
36
34
  ### Keep the project's CLI current
37
35
 
@@ -43,20 +41,7 @@ npx hyperframes@latest upgrade --project . --check
43
41
 
44
42
  The probe is read-only and reports the pin against the latest release; keep the explicit `.` — on older CLI releases a bare `--project` followed by another flag consumes that flag as its directory value. When it reports the project behind — or any CLI output already shows it (the stderr notice `This project pins hyperframes@… (latest …)`, or `_meta.updateAvailable: true` in a `--json` result from a pinned script) — apply with `npx hyperframes@latest upgrade --project .`, then verify with `npx hyperframes check`. A passing check confirms the project's compositions still validate on the new version — not that rendered output is frame-identical to the old pin — so a successful bump is never silent: name the old and new version in the run's summary. A project with no composition yet needs no verification. If the check fails, revert the `package.json` change, continue on the pinned version, and report which version the project stays on and why. Act on the signal rather than relaying it to the user; never leave a bumped pin unverified.
45
43
 
46
- ## 2. Adapt orthogonal inputs before routing
47
-
48
- A Figma source changes **how assets and design enter the project**, not which workflow owns the deliverable.
49
-
50
- If any input is a `figma.com` URL:
51
-
52
- 1. For fresh creation, begin the intent layer (§ 4) and complete its memory and recipe reads.
53
- 2. During input triage, run `/figma` to extract assets, brand tokens, components, and storyboard frames when present. For an existing-project edit, run `/figma` without reopening intent.
54
- 3. Route the requested deliverable using the output from `/figma`, then continue only the selected route's unanswered intent questions.
55
- 4. Do not drive Figma through raw MCP tools. That bypasses SVG sanitization, `.media/manifest.jsonl` provenance, and brand-token `var()` binding.
56
-
57
- A GitHub PR URL is not a website source. A named or adopted recipe already carries its workflow; confirm adoption through the intent layer, then route to that workflow.
58
-
59
- ## 3. Route fresh creation
44
+ ## 2. Route fresh creation
60
45
 
61
46
  Use the first matching row. Match the requested **deliverable**, not a word or file type mentioned in passing.
62
47
 
@@ -73,71 +58,22 @@ Use the first matching row. Match the requested **deliverable**, not a word or f
73
58
  | 9 | Explain a topic, article, or notes with invented visuals and no product or site capture | `/faceless-explainer` |
74
59
  | 10 | Any other custom video or composition | `/general-video` |
75
60
 
76
- Before finalizing the route, read the matching section of `references/workflow-catalog.md`. It is the canonical input/output/trigger contract available before lazy-installed workflow skills are present. If the candidate does not satisfy that entry, continue routing instead of forcing the match.
61
+ Before finalizing the route, read `references/routes/<workflow>.md` one small file per route: the canonical input/output/trigger contract (available before lazy-installed workflow skills are present) plus that route's interview entry. If the candidate does not satisfy its contract, continue routing instead of forcing the match. Read only the matched route's file.
77
62
 
78
63
  ### Resolve common ambiguities
79
64
 
80
65
  - A short animated title, logo sting, stat hit, chart hit, map hit, or standalone lower-third is `/motion-graphics` when it is unnarrated and motion is the message. A static title card, narrated sequence, longer montage, or custom loop is `/general-video`.
81
- - An explicitly short motion graphic may use a URL, tweet, article, or screenshot as source material. A generic make a video from this site request is `/product-launch-video`.
66
+ - An explicitly short motion graphic may use a URL, tweet, article, or screenshot as source material. A generic "make a video from this site" request is `/product-launch-video`.
82
67
  - Existing footage with captions routes to `/embedded-captions`; footage with designed information cards routes to `/talking-head-recut`. Retiming, reordering, recoloring, reframing, or remixing footage is a custom edit and falls through to `/general-video`.
83
68
  - A music file selects `/music-to-video` only when its beat grid drives the piece. Music used as a bed does not override the subject-matched route.
84
- - I want a storyboard changes the review process, not the workflow. With no other routing signal, use `/general-video`. A confirmed sketched board may itself be the requested deliverable; the review loop defines that stop point.
69
+ - "I want a storyboard" changes the review process, not the workflow. With no other routing signal, use `/general-video`. A confirmed sketched board may itself be the requested deliverable; the review loop defines that stop point.
85
70
  - Specialized narrative workflows support up to about 3 minutes and are strongest around 30–90s. Route a clearly longer piece to `/general-video`. Length never overrides an explicit port, deck, caption, overlay, or music-driven deliverable.
86
71
 
87
- ## 4. The intent layer — one conversation, before any workflow runs
88
-
89
- Fresh creation only — § 1's state table already decides whether this section runs at all (edits, project operations, briefed and resumable projects, and explicit Remotion ports never enter it). One conversation at the front door turns "make me a video" into a confirmed brief — the route, the must-have answers, the run's shape, and everything else in the user's head — handed to whichever workflow executes and made durable as `BRIEF.md` (shape: `../hyperframes-core/references/brief-format.md`). Workflows own execution; this layer owns understanding. Every workflow's opening rule points back here, so the questions are asked once no matter which door the user came through.
90
-
91
- These reads are mandatory when their condition matches; do not replace them with recollection, and read only the matching section when a reference is organized by workflow:
92
-
93
- | Condition | Read before acting |
94
- | ----------------------------------------------------------- | ---------------------------------------------------------- |
95
- | A route is a candidate, before confirming it | Its section in `references/workflow-catalog.md` |
96
- | The route is known, before asking route-specific questions | Its section in `references/route-briefs.md` |
97
- | Triage judged the request unformed, before any concept work | `references/pitch-round.md` |
98
- | Offering optional capabilities or collecting supplied media | The route-filtered rows in `references/capability-menu.md` |
99
- | Deriving `flow`, `storyboard`, mode, or canonical fields | `../hyperframes-core/references/brief-contract.md` |
100
-
101
- **1 — Memory before questions.** Two reads, both mandatory, before anything is asked:
102
-
103
- - **Remembered defaults.** Let `<MEDIA_DIR>` be the installed `/media-use` skill directory. For an existing project, `<MEMORY_ROOT>` is its root. Before scaffolding, use a deliberately nonexistent probe path with no `.media`, such as `/tmp/hyperframes-intent-memory-<run-id>`; never use the current workspace. Run `node <MEDIA_DIR>/scripts/prefs.mjs get --hyperframes <MEMORY_ROOT> --json`. Make each remembered value the recommended option and name its source. The pre-project probe sees only the personal tier; do not claim project provenance.
104
- - **Recipes.** Run `node <MEDIA_DIR>/scripts/recipe.mjs list --hyperframes <MEMORY_ROOT> --json`. If the user names a recipe, says “like last time,” or a recipe matches the probable route, ask whether to adopt it before other brief questions — and make the offer earn the yes: say why it matches and what adopting saves (“this matches your launch-promo recipe — adopting fills destination, aspect, language, and the design spec; you'd confirm the message and the two run-shape questions”). When several match, list them and include “none.” An adopted recipe locks the fields it contains; ask only its missing fields and the run-shape questions. It does not remove review or render approval gates.
105
-
106
- **2 — Triage the input.** What is the video about — a website (sold or shown), a PR, a topic, a music track, existing footage? And is the request **formed** — the message, the material, and the occasion readable from what the user gave — or **unformed**, a subject with no take on it? Source material doesn't settle this by itself: a site, document, or PR carries its own thesis, but five tellings of that thesis are five different videos — a request whose only shape comes from its source ("make a video about this URL") is formed about the facts and unformed about the telling, and enters the round to pitch the telling. A formed request runs the layer exactly as it always has; nothing below is added for it. An unformed one goes through the pitch round after routing (step 4) and earns one question here, before anything is generated: what is the user already picturing? Their answer seeds the round (`references/pitch-round.md`). A user who says they don't know video at all gets that reference's decision map instead of a question sequence. For a genuinely exploratory request ("we need a video but I'm not sure what kind"), don't interrogate — establish the subject and what exists to show, one question at a time, then close by **recommending** a route plus how the run will review: a text storyboard first, on a live board, with optional wireframe sketches before the full build (`../hyperframes-core/references/review-loop.md`). The user hears the process before any workflow starts.
107
-
108
- **3 — Pick the route** (the route table and ambiguity rules in § 3), then open that route's entry in `references/route-briefs.md`. It lists the must-have questions to ask now, the **deferred asks** to announce, whether the two run-shape questions apply, and which fields the pitch round may answer.
109
-
110
- **4 — The pitch round** — unformed requests only; formed requests and recipe adoptions go straight to the must-haves. Sample five concepts along five genuinely different paths, at least two from the distribution's tail, and present them all before recommending one — pick, mix, and redirect are all answers. Each pitch names the capability or two it rides, in the plain language of `references/capability-menu.md` — the toolbox experienced as concepts, not listed as a menu. On an autonomous run the same gate runs internally, and the heads-up names the direction chosen and the typical one left behind. The procedure — the sampling gate, the presentation discipline, and the decision map for users new to video — is `references/pitch-round.md`. The chosen concept answers the route's pitch-eligible fields and lands in `BRIEF.md` under `## Intent`; the capabilities it named are confirmed with it, under `## Customizations`.
111
-
112
- **5 — The route's must-haves.** One question per field, recommended option first with its receipt (rules: `../hyperframes-core/references/brief-contract.md` § 3). Skip a question only when the request already answered it — inference is not an answer, but a chosen pitch is: fields the pitch round settled are locked with the pitch as their receipt. Then announce the route's deferred asks in one line ("after I probe the clip, I'll offer 2–3 caption identities") so the user hears the run's full shape before it starts.
113
-
114
- **6 — The two run-shape questions** — where the route's entry applies them, asked after the must-haves, each on its own:
115
-
116
- - **(a) Storyboard?** Review the plan, wireframe sketches, and the finished piece pass by pass on a live board (`../hyperframes-core/references/review-loop.md`) — recommended for anything beyond a couple of scenes — or skip the board and get one finished video from the confirmed brief.
117
- - **(b) Automation or companion?** **Automation** — the matched workflow's pipeline executes the brief end to end. **Companion** — build it together in `/general-video` with every HyperFrames capability on the table; the route's answers still describe the video, general-video executes them.
118
-
119
- These two are **orthogonal — never merge them into one menu.** All four `flow` × `storyboard` combinations are valid user choices (a companion run reviews on the live board too when `storyboard: yes`); a flattened three-option list ("storyboard review / one shot / companion") silently makes companion-with-storyboard unselectable. When a diagram or source material summarizes the outcomes as three branches, that is the derived behavior (`brief-contract.md` § 1), not the question shape. In a form-style question UI, keep (a) and (b) as two separate selects.
120
-
121
- Signals replace questions, never add them: an ongoing "just build it" / "surprise me" / "don't ask" locks `flow: automation, storyboard: no`, and every unanswered field becomes a decision with a receipt in the heads-up. A storyboard request, however phrased, locks `storyboard: yes`. Remembered `flow` / `storyboard` values reorder the recommendations — they never make either question disappear. The run's collaborative/autonomous execution mode derives from these two answers — the old first question is never asked; the canonical mapping is `../hyperframes-core/references/brief-contract.md` § 1.
122
-
123
- **7 — Nice-to-have: recommend, then show.** Skip this step when the selected route brief says to skip the front-door capability offer. Otherwise, once the must-haves are locked, send one offer, not an interrogation — recommendations first, catalog on request. Capabilities the chosen pitch already named are settled with the concept — this step recommends from what the pitch didn't cover, and after a pitch round it is often just the two open asks and the design ask:
124
-
125
- - **One or two rows** of `references/capability-menu.md` that this brief specifically calls for, each traced to something in the confirmed concept — a key number wants the count-up treatment, product shots want staging and a grade, a music bed means cuts on its grid. A suggestion that would fit any video fails that test; drop it. At most one may be a labeled **challenger**: higher ceiling, named cost (“the standard cut carries it; shader transitions would lift the close, at render-time cost”).
126
- - **Material answered on arrival.** When the user hands over a logo, a clip, or data, answer with its concrete use (“the logo could close the video as a sting — want that?”) rather than silently filing it.
127
- - **The two open asks stay:** anything here you want, and is there any material of your own (images, clips, logos, data) the video should carry?
128
- - **The design spec keeps its own three-state ask** — use an existing spec, pick a shipped preset by eye, or leave the decision to the workflow (`capability-menu.md` § The design ask).
129
-
130
- The full route-filtered slice appears only when the user asks what else is possible. An accepted recommendation is a confirmed answer: when it lands on a preference-backed field (a preset, a voice, a caption identity), it records like any other confirmation, and `/media-use`'s promotion rules make it the next run's recommended default. Capture answers verbatim in `BRIEF.md` under `## Assets`, `## Customizations`, or `## Notes`. One round; silence or “no” moves on.
131
-
132
- **8 — Hand off.** Three disciplines close the conversation (invariants: `../hyperframes-core/references/brief-contract.md` § 3):
133
-
134
- - **One integration check.** Read the combined answers for a consequence no single answer showed — vertical at 90 seconds with a chart-dense concept means charts a phone can't read — and surface it with a proposed adjustment now, not at the sketch pass.
135
- - **Stated and inferred, apart.** Present the locked brief as one summary — deferred asks and the run's shape included — with what the user answered and what was inferred or defaulted as two visibly separate groups, receipts on both. The inferred group is where corrections live; an autonomous heads-up is mostly that group.
136
- - **Revision is not confirmation.** When the user corrects the summary, fold the change in and present it again; never execute an edited-but-unconfirmed brief.
72
+ ## 3. Route once, then leave
137
73
 
138
- Then enter the workflow (`flow: companion` `/general-video`; otherwise the matched route), installing it first per § 5. The workflow's Setup writes `BRIEF.md` from this summary as its **first action after `hyperframes init`** (never before — `init` refuses a non-empty directory), using canonical frontmatter values and preserving the user's important wording in the body the chosen pitch, when there is one, under `## Intent`. It then records the preference-backed fields (`../hyperframes-core/references/brief-format.md` names the subset), and asks no brief question again.
74
+ For fresh creation the intent layer (`references/intent-interview.md`) runs the full conversation memory, triage, pitch round, must-haves, run-shape, hand-off and **ends by writing `BRIEF.md`. The brief is the only routing artifact the workflow reads**; nothing later re-opens this skill or the interview. Answer every later "what did the route require?" from `BRIEF.md`.
139
75
 
140
- ## 5. Install and enter the workflow
76
+ ## 4. Install and enter the workflow
141
77
 
142
78
  Before reading the selected workflow, install or refresh it and the core domain skills:
143
79
 
@@ -147,7 +83,7 @@ npx hyperframes skills update <workflow-name>
147
83
 
148
84
  Use the bare name without `/`. If the command fails, surface the error; do not reconstruct the workflow from memory. Everything else about installation — the core-vs-lazy split, what `init` refreshes, diagnosis, CI opt-out, and the no-CLI fallback — lives in `references/skill-lifecycle.md`.
149
85
 
150
- ## 6. Load domain skills on demand
86
+ ## 5. Load domain skills on demand
151
87
 
152
88
  | Need | Skill |
153
89
  | ------------------------------------------------------------------------------------------------------------------- | ------------------------ |
@@ -1,6 +1,6 @@
1
1
  # Capability menu — what HyperFrames can bring to a video
2
2
 
3
- One list, three readers. The **pitch round** (`pitch-round.md`) speaks it before anyone reads it as a menu: each pitch names the capability or two its concept rides, phrased from the middle column — the rows experienced inside concepts, which is how most users first learn what they're allowed to want. The **intent layer** (`/hyperframes` § 4, step 7) recommends from it — one or two rows the confirmed concept specifically calls for and the chosen pitch didn't already name, with the route-filtered slice shown when the user asks what else is possible. **`/general-video` in companion mode** uses the same list as its execution map — as its **trigger list**: each row's plain-language line is also the moment to offer it, when the conversation touches what the row does — and as each pass's **upgrade channel**: a plan, sketch, or build checkpoint may carry one or two traced offers pointed at material the user is looking at.
3
+ One list, three readers. The **pitch round** (`pitch-round.md`) speaks it before anyone reads it as a menu: each pitch names the capability or two its concept rides, phrased from the middle column — the rows experienced inside concepts, which is how most users first learn what they're allowed to want. The **intent layer** (`/hyperframes` `references/intent-interview.md`, step 7) recommends from it — one or two rows the confirmed concept specifically calls for and the chosen pitch didn't already name, with the route-filtered slice shown when the user asks what else is possible. **`/general-video` in companion mode** uses the same list as its execution map — as its **trigger list**: each row's plain-language line is also the moment to offer it, when the conversation touches what the row does — and as each pass's **upgrade channel**: a plan, sketch, or build checkpoint may carry one or two traced offers pointed at material the user is looking at.
4
4
 
5
5
  **Borrowing rule.** Capabilities marked with a home workflow live in that workflow's skill directory, and workflow skills install lazily. Before reaching across, run `npx hyperframes skills update <that-workflow>` with the bare name. Resolve the installed skill directory, invoke its script by absolute path, and pass the project root explicitly when the script accepts one. Keep the working directory at the project root. Never assume a sibling-relative path such as `../media-use` or `../music-to-video`; the project may live anywhere.
6
6
 
@@ -0,0 +1,71 @@
1
+ # The intent layer — one conversation, before any workflow runs
2
+
3
+ Fresh creation only — the SKILL.md state table already decides whether this layer runs at all (edits, project operations, briefed and resumable projects, and explicit Remotion ports never enter it). One conversation at the front door turns "make me a video" into a confirmed brief — the route, the must-have answers, the run's shape, and everything else in the user's head — handed to whichever workflow executes and made durable as `BRIEF.md`. Workflows own execution; this layer owns understanding. Every workflow's opening rule points back here, so the questions are asked once no matter which door the user came through.
4
+
5
+ These reads are mandatory when their condition matches; do not replace them with recollection:
6
+
7
+ | Condition | Read before acting |
8
+ | ----------------------------------------------------------- | -------------------------------------------------------------------- |
9
+ | The route is picked, before confirming or interviewing | `routes/<workflow>.md` — the whole file (contract + interview, ~1KB) |
10
+ | Triage judged the request unformed, before any concept work | `pitch-round.md` |
11
+ | Offering optional capabilities or collecting supplied media | The route-filtered rows in `capability-menu.md` |
12
+ | Question rules or field semantics beyond the schema below | `../../hyperframes-core/references/brief-contract.md` |
13
+
14
+ ## Adapt orthogonal inputs first
15
+
16
+ A Figma source changes **how assets and design enter the project**, not which workflow owns the deliverable. If any input is a `figma.com` URL: complete this layer's memory and recipe reads; during input triage run `/figma` to extract assets, brand tokens, components, and storyboard frames when present; route the requested deliverable using the output from `/figma`, then continue only the selected route's unanswered questions. Do not drive Figma through raw MCP tools — that bypasses SVG sanitization, `.media/manifest.jsonl` provenance, and brand-token `var()` binding.
17
+
18
+ A GitHub PR URL is not a website source. A named or adopted recipe already carries its workflow; confirm adoption below, then route to that workflow.
19
+
20
+ ## The eight steps
21
+
22
+ **1 — Memory before questions.** Two reads, both mandatory, before anything is asked:
23
+
24
+ - **Remembered defaults.** Let `<MEDIA_DIR>` be the installed `/media-use` skill directory. For an existing project, `<MEMORY_ROOT>` is its root. Before scaffolding, use a deliberately nonexistent probe path with no `.media`, such as `/tmp/hyperframes-intent-memory-<run-id>`; never use the current workspace. Run `node <MEDIA_DIR>/scripts/prefs.mjs get --hyperframes <MEMORY_ROOT> --json`. Make each remembered value the recommended option and name its source. The pre-project probe sees only the personal tier; do not claim project provenance.
25
+ - **Recipes.** Run `node <MEDIA_DIR>/scripts/recipe.mjs list --hyperframes <MEMORY_ROOT> --json`. If the user names a recipe, says "like last time," or a recipe matches the probable route, ask whether to adopt it before other brief questions — and make the offer earn the yes: say why it matches and what adopting saves ("this matches your launch-promo recipe — adopting fills destination, aspect, language, and the design spec; you'd confirm the message and the two run-shape questions"). When several match, list them and include "none." An adopted recipe locks the fields it contains; ask only its missing fields and the run-shape questions. It does not remove review or render approval gates.
26
+
27
+ **2 — Triage the input.** What is the video about — a website (sold or shown), a PR, a topic, a music track, existing footage? And is the request **formed** — the message, the material, and the occasion readable from what the user gave — or **unformed**, a subject with no take on it? Source material doesn't settle this by itself: a site, document, or PR carries its own thesis, but five tellings of that thesis are five different videos — a request whose only shape comes from its source ("make a video about this URL") is formed about the facts and unformed about the telling, and enters the round to pitch the telling. A formed request runs the layer exactly as it always has; nothing below is added for it. An unformed one goes through the pitch round after routing (step 4) and earns one question here, before anything is generated: what is the user already picturing? Their answer seeds the round (`pitch-round.md`). A user who says they don't know video at all gets that reference's decision map instead of a question sequence. For a genuinely exploratory request ("we need a video but I'm not sure what kind"), don't interrogate — establish the subject and what exists to show, one question at a time, then close by **recommending** a route plus how the run will review: a text storyboard first, on a live board, with optional wireframe sketches before the full build (`../../hyperframes-core/references/review-loop.md`). The user hears the process before any workflow starts.
28
+
29
+ **3 — Pick the route** (the route table and ambiguity rules in the SKILL.md), then read `routes/<workflow>.md`. Its Interview section lists the must-have questions to ask now, the **deferred asks** to announce, whether the two run-shape questions apply, and which fields the pitch round may answer.
30
+
31
+ **4 — The pitch round** — unformed requests only; formed requests and recipe adoptions go straight to the must-haves. Sample five concepts along five genuinely different paths, at least two from the distribution's tail, and present them all before recommending one — pick, mix, and redirect are all answers. Each pitch names the capability or two it rides, in the plain language of `capability-menu.md` — the toolbox experienced as concepts, not listed as a menu. On an autonomous run the same gate runs internally, and the heads-up names the direction chosen and the typical one left behind. The procedure — the sampling gate, the presentation discipline, and the decision map for users new to video — is `pitch-round.md`. The chosen concept answers the route's pitch-eligible fields and lands in `BRIEF.md` under `## Intent`; the capabilities it named are confirmed with it, under `## Customizations`.
32
+
33
+ **5 — The route's must-haves.** One question per field, recommended option first with its receipt (rules: `../../hyperframes-core/references/brief-contract.md` § 3). Skip a question only when the request already answered it — inference is not an answer, but a chosen pitch is: fields the pitch round settled are locked with the pitch as their receipt. Then announce the route's deferred asks in one line ("after I probe the clip, I'll offer 2–3 caption identities") so the user hears the run's full shape before it starts.
34
+
35
+ **6 — The two run-shape questions** — where the route's entry applies them, asked after the must-haves, each on its own:
36
+
37
+ - **(a) Storyboard?** Review the plan, wireframe sketches, and the finished piece pass by pass on a live board (`../../hyperframes-core/references/review-loop.md`) — recommended for anything beyond a couple of scenes — or skip the board and get one finished video from the confirmed brief.
38
+ - **(b) Automation or companion?** **Automation** — the matched workflow's pipeline executes the brief end to end. **Companion** — build it together in `/general-video` with every HyperFrames capability on the table; the route's answers still describe the video, general-video executes them.
39
+
40
+ These two are **orthogonal — never merge them into one menu.** All four `flow` × `storyboard` combinations are valid user choices (a companion run reviews on the live board too when `storyboard: yes`); a flattened three-option list ("storyboard review / one shot / companion") silently makes companion-with-storyboard unselectable. When a diagram or source material summarizes the outcomes as three branches, that is the derived behavior (`brief-contract.md` § 1), not the question shape. In a form-style question UI, keep (a) and (b) as two separate selects.
41
+
42
+ Signals replace questions, never add them: an ongoing "just build it" / "surprise me" / "don't ask" locks `flow: automation, storyboard: no`, and every unanswered field becomes a decision with a receipt in the heads-up. A storyboard request, however phrased, locks `storyboard: yes`. Remembered `flow` / `storyboard` values reorder the recommendations — they never make either question disappear. The run's collaborative/autonomous execution mode derives from these two answers — the old first question is never asked; the canonical mapping is `../../hyperframes-core/references/brief-contract.md` § 1.
43
+
44
+ **7 — Nice-to-have: recommend, then show.** Skip this step when the selected route file says to skip the front-door capability offer. Otherwise, once the must-haves are locked, send one offer, not an interrogation — recommendations first, catalog on request. Capabilities the chosen pitch already named are settled with the concept — this step recommends from what the pitch didn't cover, and after a pitch round it is often just the two open asks and the design ask:
45
+
46
+ - **One or two rows** of `capability-menu.md` that this brief specifically calls for, each traced to something in the confirmed concept — a key number wants the count-up treatment, product shots want staging and a grade, a music bed means cuts on its grid. A suggestion that would fit any video fails that test; drop it. At most one may be a labeled **challenger**: higher ceiling, named cost ("the standard cut carries it; shader transitions would lift the close, at render-time cost").
47
+ - **Material answered on arrival.** When the user hands over a logo, a clip, or data, answer with its concrete use ("the logo could close the video as a sting — want that?") rather than silently filing it.
48
+ - **The two open asks stay:** anything here you want, and is there any material of your own (images, clips, logos, data) the video should carry?
49
+ - **The design spec keeps its own three-state ask** — use an existing spec, pick a shipped preset by eye, or leave the decision to the workflow (`capability-menu.md` § The design ask).
50
+
51
+ The full route-filtered slice appears only when the user asks what else is possible. An accepted recommendation is a confirmed answer: when it lands on a preference-backed field (a preset, a voice, a caption identity), it records like any other confirmation, and `/media-use`'s promotion rules make it the next run's recommended default. Capture answers verbatim in `BRIEF.md` under `## Assets`, `## Customizations`, or `## Notes`. One round; silence or "no" moves on.
52
+
53
+ **8 — Hand off.** Three disciplines close the conversation (invariants: `../../hyperframes-core/references/brief-contract.md` § 3):
54
+
55
+ - **One integration check.** Read the combined answers for a consequence no single answer showed — vertical at 90 seconds with a chart-dense concept means charts a phone can't read — and surface it with a proposed adjustment now, not at the sketch pass.
56
+ - **Stated and inferred, apart.** Present the locked brief as one summary — deferred asks and the run's shape included — with what the user answered and what was inferred or defaulted as two visibly separate groups, receipts on both. The inferred group is where corrections live; an autonomous heads-up is mostly that group.
57
+ - **Revision is not confirmation.** When the user corrects the summary, fold the change in and present it again; never execute an edited-but-unconfirmed brief.
58
+
59
+ Then enter the workflow (`flow: companion` → `/general-video`; otherwise the matched route), installing it first per the SKILL.md's install step. The workflow's Setup writes `BRIEF.md` from this summary as its **first action after `hyperframes init`** (never before — `init` refuses a non-empty directory), using the canonical frontmatter below and preserving the user's important wording in the body — the chosen pitch, when there is one, under `## Intent`. It then records the preference-backed fields (`../../hyperframes-core/references/brief-format.md` names the subset), and asks no brief question again.
60
+
61
+ ## BRIEF.md frontmatter — the carry-away artifact
62
+
63
+ The interview's deliverable. Every later "what did the route require?" re-reads this ~1KB file, never this document. One key per confirmed field, canonical normalized values (full shape and body sections: `../../hyperframes-core/references/brief-format.md`):
64
+
65
+ | Key | Meaning | Example |
66
+ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------- |
67
+ | `workflow` | the executing workflow (companion runs record `general-video`) | `faceless-explainer` |
68
+ | `flow` | `automation` — the matched workflow's pipeline · `companion` — co-creation in `/general-video` | `automation` |
69
+ | `storyboard` | `yes` — plan, sketches, and build reviewed on the live board · `no` — one shot from the confirmed brief | `yes` |
70
+ | `message` | the ONE thing the video must communicate | `"Ship it in an afternoon"` |
71
+ | `destination` / `aspect` / `language` / `audience` / `length` / `angle` … | the registry fields this route confirmed | — |
@@ -4,7 +4,7 @@ Everything else in the intent layer converges: recommended options, receipts, on
4
4
 
5
5
  ## When it runs
6
6
 
7
- Triage (`/hyperframes` § 4, step 2) marks the request formed or unformed; only unformed requests enter the round, and only on routes whose `route-briefs.md` entry names pitch-eligible fields. A recipe adoption skips the round — the bundle already carries an approved concept. An autonomous signal never skips it; it moves the round inside (§ The gate, alone).
7
+ Triage (`/hyperframes` `references/intent-interview.md`, step 2) marks the request formed or unformed; only unformed requests enter the round, and only on routes whose `routes/<workflow>.md` entry names pitch-eligible fields. A recipe adoption skips the round — the bundle already carries an approved concept. An autonomous signal never skips it; it moves the round inside (§ The gate, alone).
8
8
 
9
9
  Before generating anything, ask what the user is already picturing. An existing idea seeds the round as a pitch of its own and is never displaced by generated ones; a fully formed picture ends the round before it starts — that picture is the concept, and the layer returns to its questions.
10
10