@hyperframes/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +125 -0
  2. package/dist/adapters/gsap.d.ts +14 -0
  3. package/dist/adapters/gsap.d.ts.map +1 -0
  4. package/dist/adapters/gsap.js +25 -0
  5. package/dist/adapters/gsap.js.map +1 -0
  6. package/dist/adapters/index.d.ts +4 -0
  7. package/dist/adapters/index.d.ts.map +1 -0
  8. package/dist/adapters/index.js +2 -0
  9. package/dist/adapters/index.js.map +1 -0
  10. package/dist/adapters/types.d.ts +15 -0
  11. package/dist/adapters/types.d.ts.map +1 -0
  12. package/dist/adapters/types.js +2 -0
  13. package/dist/adapters/types.js.map +1 -0
  14. package/dist/compiler/htmlBundler.d.ts +16 -0
  15. package/dist/compiler/htmlBundler.d.ts.map +1 -0
  16. package/dist/compiler/htmlBundler.js +448 -0
  17. package/dist/compiler/htmlBundler.js.map +1 -0
  18. package/dist/compiler/htmlCompiler.d.ts +18 -0
  19. package/dist/compiler/htmlCompiler.d.ts.map +1 -0
  20. package/dist/compiler/htmlCompiler.js +65 -0
  21. package/dist/compiler/htmlCompiler.js.map +1 -0
  22. package/dist/compiler/index.d.ts +5 -0
  23. package/dist/compiler/index.d.ts.map +1 -0
  24. package/dist/compiler/index.js +9 -0
  25. package/dist/compiler/index.js.map +1 -0
  26. package/dist/compiler/staticGuard.d.ts +8 -0
  27. package/dist/compiler/staticGuard.d.ts.map +1 -0
  28. package/dist/compiler/staticGuard.js +26 -0
  29. package/dist/compiler/staticGuard.js.map +1 -0
  30. package/dist/compiler/timingCompiler.d.ts +72 -0
  31. package/dist/compiler/timingCompiler.d.ts.map +1 -0
  32. package/dist/compiler/timingCompiler.js +191 -0
  33. package/dist/compiler/timingCompiler.js.map +1 -0
  34. package/dist/core.types.d.ts +314 -0
  35. package/dist/core.types.d.ts.map +1 -0
  36. package/dist/core.types.js +52 -0
  37. package/dist/core.types.js.map +1 -0
  38. package/dist/generators/hyperframes.d.ts +21 -0
  39. package/dist/generators/hyperframes.d.ts.map +1 -0
  40. package/dist/generators/hyperframes.js +572 -0
  41. package/dist/generators/hyperframes.js.map +1 -0
  42. package/dist/hyperframe.manifest.json +22 -0
  43. package/dist/hyperframe.runtime.iife.js +13 -0
  44. package/dist/hyperframe.runtime.mjs +13 -0
  45. package/dist/index.d.ts +23 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +16 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/inline-scripts/hyperframe.d.ts +13 -0
  50. package/dist/inline-scripts/hyperframe.d.ts.map +1 -0
  51. package/dist/inline-scripts/hyperframe.js +15 -0
  52. package/dist/inline-scripts/hyperframe.js.map +1 -0
  53. package/dist/inline-scripts/hyperframesRuntime.engine.d.ts +7 -0
  54. package/dist/inline-scripts/hyperframesRuntime.engine.d.ts.map +1 -0
  55. package/dist/inline-scripts/hyperframesRuntime.engine.js +31 -0
  56. package/dist/inline-scripts/hyperframesRuntime.engine.js.map +1 -0
  57. package/dist/inline-scripts/parityContract.d.ts +5 -0
  58. package/dist/inline-scripts/parityContract.d.ts.map +1 -0
  59. package/dist/inline-scripts/parityContract.js +43 -0
  60. package/dist/inline-scripts/parityContract.js.map +1 -0
  61. package/dist/inline-scripts/pickerApi.d.ts +32 -0
  62. package/dist/inline-scripts/pickerApi.d.ts.map +1 -0
  63. package/dist/inline-scripts/pickerApi.js +2 -0
  64. package/dist/inline-scripts/pickerApi.js.map +1 -0
  65. package/dist/inline-scripts/runtimeContract.d.ts +14 -0
  66. package/dist/inline-scripts/runtimeContract.d.ts.map +1 -0
  67. package/dist/inline-scripts/runtimeContract.js +21 -0
  68. package/dist/inline-scripts/runtimeContract.js.map +1 -0
  69. package/dist/lint/hyperframeLinter.d.ts +3 -0
  70. package/dist/lint/hyperframeLinter.d.ts.map +1 -0
  71. package/dist/lint/hyperframeLinter.js +621 -0
  72. package/dist/lint/hyperframeLinter.js.map +1 -0
  73. package/dist/lint/index.d.ts +3 -0
  74. package/dist/lint/index.d.ts.map +1 -0
  75. package/dist/lint/index.js +2 -0
  76. package/dist/lint/index.js.map +1 -0
  77. package/dist/lint/types.d.ts +21 -0
  78. package/dist/lint/types.d.ts.map +1 -0
  79. package/dist/lint/types.js +2 -0
  80. package/dist/lint/types.js.map +1 -0
  81. package/dist/parsers/gsapParser.d.ts +50 -0
  82. package/dist/parsers/gsapParser.d.ts.map +1 -0
  83. package/dist/parsers/gsapParser.js +411 -0
  84. package/dist/parsers/gsapParser.js.map +1 -0
  85. package/dist/parsers/htmlParser.d.ts +29 -0
  86. package/dist/parsers/htmlParser.d.ts.map +1 -0
  87. package/dist/parsers/htmlParser.js +726 -0
  88. package/dist/parsers/htmlParser.js.map +1 -0
  89. package/dist/templates/base.d.ts +4 -0
  90. package/dist/templates/base.d.ts.map +1 -0
  91. package/dist/templates/base.js +20 -0
  92. package/dist/templates/base.js.map +1 -0
  93. package/dist/templates/constants.d.ts +7 -0
  94. package/dist/templates/constants.d.ts.map +1 -0
  95. package/dist/templates/constants.js +8 -0
  96. package/dist/templates/constants.js.map +1 -0
  97. package/docs/common-mistakes.md +73 -0
  98. package/docs/core.md +532 -0
  99. package/docs/core_notes.md +61 -0
  100. package/docs/quickstart-template.html +180 -0
  101. package/docs/versions/changelog.md +5 -0
  102. package/docs/versions/v0.1/core.md +326 -0
  103. package/package.json +83 -0
@@ -0,0 +1,13 @@
1
+ "use strict";(()=>{function X(e){try{window.parent.postMessage(e,"*")}catch{}}function Ue(e){let n=i=>{let a=i.data;if(!a||a.source!=="hf-parent"||a.type!=="control")return;let d=a.action;if(d==="play"){e.onPlay();return}if(d==="pause"){e.onPause();return}if(d==="seek"){e.onSeek(Number(a.frame??0),a.seekMode??"commit");return}if(d==="set-muted"){e.onSetMuted(!!a.muted);return}if(d==="set-playback-rate"){e.onSetPlaybackRate(Number(a.playbackRate??1));return}if(d==="enable-pick-mode"){e.onEnablePickMode();return}if(d==="disable-pick-mode"){e.onDisablePickMode();return}if(d==="flash-elements"){let g=a.selectors,S=a.duration||800;g&&dt(g,S)}};return window.addEventListener("message",n),n}function dt(e,n){if(!document.getElementById("__hf-flash-styles")){let i=document.createElement("style");i.id="__hf-flash-styles",i.textContent=`
2
+ .__hf-flash {
3
+ outline: 2px solid rgba(59, 130, 246, 0.6) !important;
4
+ outline-offset: 2px !important;
5
+ animation: __hf-flash-pulse ${n}ms ease-out forwards !important;
6
+ }
7
+ @keyframes __hf-flash-pulse {
8
+ 0% { outline-color: rgba(59, 130, 246, 0.8); }
9
+ 100% { outline-color: transparent; }
10
+ }
11
+ `,document.head.appendChild(i)}for(let i of e)try{document.querySelectorAll(i).forEach(d=>{d.classList.add("__hf-flash"),setTimeout(()=>d.classList.remove("__hf-flash"),n)})}catch{}}var De=null;function qe(e){De=e}function be(e,n){if(De)try{De({source:"hf-preview",type:"analytics",event:e,properties:n??{}})}catch{}}function Ve(e){let n=[];return{name:"css",discover:()=>{n=[];let i=document.querySelectorAll("*");for(let a of i){if(!(a instanceof HTMLElement))continue;let d=window.getComputedStyle(a);!d.animationName||d.animationName==="none"||n.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:i=>{let a=Number(i.time)||0;for(let d of n){if(!d.el.isConnected)continue;let g=e?.resolveStartSeconds?e.resolveStartSeconds(d.el):Number.parseFloat(d.el.getAttribute("data-start")??"0")||0,S=Math.max(0,a-g);d.el.style.animationPlayState="paused",d.el.style.animationDelay=`-${S.toFixed(3)}s`}},pause:()=>{for(let i of n)i.el.isConnected&&(i.el.style.animationPlayState=i.basePlayState||"paused",i.baseDelay&&(i.el.style.animationDelay=i.baseDelay))},revert:()=>{n=[]}}}function $e(e){return{name:"gsap",discover:()=>{},seek:n=>{let i=e.getTimeline();if(!i)return;i.pause();let a=Math.max(0,Number(n.time)||0);typeof i.totalTime=="function"?i.totalTime(a,!1):i.seek(a,!1)},pause:()=>{let n=e.getTimeline();n&&n.pause()}}}function ze(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let n=e.getRegisteredAnimations();if(Array.isArray(n)&&n.length>0){let i=window.__hfLottie??[],a=new Set(i);for(let d of n)a.has(d)||i.push(d);window.__hfLottie=i}}}catch{}},seek:e=>{let n=Math.max(0,Number(e.time)||0),i=window.__hfLottie;if(!(!i||i.length===0))for(let a of i)try{if(Ce(a))a.goToAndStop(n*1e3,!1);else if(Ie(a)){if(typeof a.setCurrentRawFrameValue=="function"){let d=a.totalFrames??0,g=a.frameRate??30,S=n*g;d>0&&a.setCurrentRawFrameValue(Math.min(S,d-1))}else if(typeof a.seek=="function"){let d=a.duration??1,g=Math.min(100,n/d*100);a.seek(g)}}}catch{}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let n of e)try{(Ce(n)||Ie(n))&&n.pause()}catch{}},play:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let n of e)try{(Ce(n)||Ie(n))&&n.play()}catch{}},revert:()=>{}}}function Ce(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Ie(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function Ge(){let e=null,n=0;return{name:"three",discover:()=>{},seek:i=>{e=Math.max(0,Number(i.time)||0),n=e,window.__hfThreeTime=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch{}},pause:()=>{e==null&&(e=Math.max(0,n))},play:()=>{e=null},revert:()=>{e=null,n=0}}}function Ke(){return{name:"waapi",discover:()=>{},seek:e=>{if(!document.getAnimations)return;let n=Math.max(0,(Number(e.time)||0)*1e3);for(let i of document.getAnimations())try{i.pause(),i.currentTime=n}catch{}},pause:()=>{if(document.getAnimations)for(let e of document.getAnimations())try{e.pause()}catch{}}}}function Ze(e){let n=Array.from(document.querySelectorAll("video[data-start], audio[data-start]")),i=[],a=[],d=0;for(let g of n){let S=e?.resolveStartSeconds?e.resolveStartSeconds(g):Number.parseFloat(g.dataset.start??"0");if(!Number.isFinite(S))continue;let y=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,l=Number.parseFloat(g.dataset.duration??"");(!Number.isFinite(l)||l<=0)&&Number.isFinite(g.duration)&&g.duration>0&&(l=Math.max(0,g.duration-y));let b=Number.isFinite(l)&&l>0?S+l:Number.POSITIVE_INFINITY,p=Number.parseFloat(g.dataset.volume??""),R={el:g,start:S,mediaStart:y,duration:Number.isFinite(l)&&l>0?l:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(p)?p:null};i.push(R),g.tagName==="VIDEO"&&a.push(R),Number.isFinite(b)&&(d=Math.max(d,b))}return{timedMediaEls:n,mediaClips:i,videoClips:a,maxMediaEnd:d}}function Ye(e){for(let n of e.clips){let{el:i}=n;if(!i.isConnected)continue;let a=e.timeSeconds-n.start+n.mediaStart;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&a>=0){n.volume!=null&&(i.volume=n.volume);try{i.playbackRate=e.playbackRate}catch{}if(Math.abs((i.currentTime||0)-a)>.3)try{i.currentTime=a}catch{}e.playing&&i.paused?i.play().catch(()=>{}):!e.playing&&!i.paused&&i.pause();continue}i.paused||i.pause()}}function Je(e){let n=!1,i=null,a=null,d=null,g=null;function S(u,f){try{window.dispatchEvent(new CustomEvent(u,{detail:f}))}catch{}}function y(u){d=u,S("hyperframe:picker:hovered",{elementInfo:d,isPickMode:n,timestamp:Date.now()})}function l(u){g=u,S("hyperframe:picker:selected",{elementInfo:g,isPickMode:n,timestamp:Date.now()})}function b(u){if(!u||u===document.body||u===document.documentElement)return!1;let f=u.tagName.toLowerCase();return!(f==="script"||f==="style"||f==="link"||f==="meta"||u.classList.contains("__hf-pick-highlight"))}function p(u){let f=u;if(f.id)return`#${f.id}`;let h=u.getAttribute("data-composition-id");if(h)return`[data-composition-id="${h}"]`;let C=u.getAttribute("data-composition-src");if(C)return`[data-composition-src="${C}"]`;let v=u.getAttribute("data-track-index");if(v)return`[data-track-index="${v}"]`;let k=u.tagName.toLowerCase(),z=u.parentElement;if(!z)return k;let W=z.querySelectorAll(`:scope > ${k}`);if(W.length===1)return k;for(let I=0;I<W.length;I+=1)if(W[I]===u)return`${k}:nth-of-type(${I+1})`;return k}function R(u){let f=u.tagName.toLowerCase(),h=(u.textContent??"").trim().replace(/\s+/g," "),C=(v,k)=>v.length>k?`${v.slice(0,k-1)}\u2026`:v;return f==="h1"||f==="h2"||f==="h3"?"Heading":f==="p"||f==="span"||f==="div"?h.length>0?C(h,56):"Text":f==="img"?"Image":f==="video"?"Video":f==="audio"?"Audio":f==="svg"?"Shape":u.getAttribute("data-composition-src")?"Composition":f==="section"?"Section":`${f.charAt(0).toUpperCase()}${f.slice(1)}`}function P(u,f,h){let C=typeof h=="number"&&h>0?h:8,v=[];if(document.elementsFromPoint)v=document.elementsFromPoint(u,f);else if(document.elementFromPoint){let W=document.elementFromPoint(u,f);v=W?[W]:[]}let k={},z=[];for(let W=0;W<v.length;W+=1){let I=v[W];if(!b(I))continue;let G=`${I.tagName}::${I.id||""}::${W}`;if(!k[G]&&(k[G]=!0,z.push(I),z.length>=C))break}return z}function H(u){let f=u.getBoundingClientRect(),h={};for(let v=0;v<u.attributes.length;v+=1){let k=u.attributes[v];k.name.startsWith("data-")&&(h[k.name]=k.value)}return{id:u.id||null,tagName:u.tagName.toLowerCase(),selector:p(u),label:R(u),boundingBox:{x:f.left,y:f.top,width:f.width,height:f.height},textContent:u.textContent?u.textContent.trim().slice(0,200):null,src:u.getAttribute("src")||u.getAttribute("data-composition-src")||null,dataAttributes:h}}function D(u,f,h){return P(u,f,h).map(H)}function Q(u){if(!n)return;let h=P(u.clientX,u.clientY,1)[0]??(u.target instanceof Element?u.target:null);if(!b(h)||i===h)return;i&&i.classList.remove("__hf-pick-highlight"),i=h,h.classList.add("__hf-pick-highlight");let C=H(h);y(C),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:C})}function Z(u){if(!n)return;u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation();let f=D(u.clientX,u.clientY,8);f.length!==0&&(y(f[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:f,selectedIndex:0,point:{x:u.clientX,y:u.clientY}}))}function ae(u){u.key==="Escape"&&(ie(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function oe(){n||(n=!0,a=document.createElement("style"),a.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
12
+ `),document.head.appendChild(a),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",Q,!0),document.addEventListener("click",Z,!0),document.addEventListener("keydown",ae,!0),S("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function ie(){n&&(n=!1,i&&(i.classList.remove("__hf-pick-highlight"),i=null),a&&(a.remove(),a=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",Q,!0),document.removeEventListener("click",Z,!0),document.removeEventListener("keydown",ae,!0),S("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function se(){window.__HF_PICKER_API={enable:oe,disable:ie,isActive:()=>n,getHovered:()=>d,getSelected:()=>g,getCandidatesAtPoint:(u,f,h)=>Number.isFinite(u)&&Number.isFinite(f)?D(u,f,h):[],pickAtPoint:(u,f,h)=>{if(!Number.isFinite(u)||!Number.isFinite(f))return null;let C=D(u,f,8);if(!C.length)return null;let v=Math.max(0,Math.min(C.length-1,Number(h??0))),k=C[v]??null;return k?(l(k),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:k}),ie(),k):null},pickManyAtPoint:(u,f,h)=>{if(!Number.isFinite(u)||!Number.isFinite(f))return[];let C=D(u,f,8);if(!C.length)return[];let v=[],k=Array.isArray(h)?h:[0];for(let z of k){let W=Math.max(0,Math.min(C.length-1,Math.floor(Number(z)))),I=C[W];if(!I)continue;v.some(U=>U.selector===I.selector&&U.tagName===I.tagName)||v.push(I)}return v.length?(l(v[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:v}),ie(),v):[]}},S("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:oe,disablePickMode:ie,installPickerApi:se}}function Xe(e,n){let i=Number.isFinite(n)&&n>0?n:30,a=Number.isFinite(e)&&e>0?e:0;return Math.floor(a*i+1e-9)/i}function Qe(e,n,i){let a=Xe(n,i);return e.pause(),typeof e.totalTime=="function"?e.totalTime(a,!1):e.seek(a,!1),a}function et(e){return{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let i=Math.max(0,Number(e.getSafeDuration?.()??n.duration()??0)||0);i>0&&Math.max(0,Number(n.time())||0)>=i&&(n.pause(),n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),n.play(),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(n.time())||0);e.onDeterministicSeek(i),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(i,!1),e.onRenderFrameSeek(i),e.onStatePost(!0)},seek:n=>{let i=e.getTimeline();if(!i)return;let a=Math.max(0,Number(n)||0),d=Qe(i,a,e.getCanonicalFps());e.onDeterministicSeek(d),e.setIsPlaying(!1),e.onSyncMedia(d,!1),e.onRenderFrameSeek(d),e.onStatePost(!0)},renderSeek:n=>{let i=e.getTimeline();if(!i)return;let a=Qe(i,n,e.getCanonicalFps());e.onDeterministicSeek(a),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Number(e.getTimeline()?.time()??0),getDuration:()=>Number(e.getTimeline()?.duration()??0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function tt(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,timelinePollIntervalId:null,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,maxTimelineDurationSeconds:1800,nativeVisualWatchdogTick:0}}function he(e){let n=Number(e);return Number.isFinite(n)?n:null}function mt(e){let n=(e??"").trim();if(!n)return null;let i=he(n);if(i!=null)return{kind:"absolute",value:i};let a=n.match(/^([A-Za-z0-9_.:-]+)(?:\s*([+-])\s*([0-9]*\.?[0-9]+))?$/);if(!a)return null;let d=(a[1]??"").trim();if(!d)return null;let g=a[2]??"+",S=a[3]??"0",y=Number.parseFloat(S),l=Number.isFinite(y)?Math.max(0,y):0,b=g==="-"?-l:l;return{kind:"reference",refId:d,offset:b}}function pe(e){let n=e.timelineRegistry??{},i=new WeakMap,a=new WeakMap,d=new Set,g=l=>{let b=document.getElementById(l);return b||(document.querySelector(`[data-composition-id="${CSS.escape(l)}"]`)??null)},S=l=>{let b=a.get(l);if(b!==void 0)return b;let p=null,R=he(l.getAttribute("data-duration"));if(R!=null&&R>0&&(p=R),p==null||p<=0){let P=he(l.getAttribute("data-end"));if(P!=null){let H=y(l,0),D=P-H;Number.isFinite(D)&&D>0&&(p=D)}}if((p==null||p<=0)&&l instanceof HTMLMediaElement){let P=he(l.getAttribute("data-playback-start"))??he(l.getAttribute("data-media-start"))??0;Number.isFinite(l.duration)&&l.duration>P&&(p=l.duration-P)}if(p==null||p<=0){let P=l.getAttribute("data-composition-id");if(P){let H=n[P]??null;if(H&&typeof H.duration=="function")try{let D=Number(H.duration());Number.isFinite(D)&&D>0&&(p=D)}catch{}}}return p!=null&&Number.isFinite(p)&&p>0?(a.set(l,p),p):(a.set(l,null),null)},y=(l,b)=>{let p=i.get(l);if(p!==void 0)return p??b;if(d.has(l))return b;d.add(l);try{let R=mt(l.getAttribute("data-start"));if(!R)return i.set(l,b),b;if(R.kind==="absolute"){let Z=Math.max(0,R.value);return i.set(l,Z),Z}let P=g(R.refId);if(!P)return i.set(l,b),b;let H=y(P,0),D=S(P);if(D==null||D<=0){let Z=Math.max(0,H+R.offset);return i.set(l,Z),Z}let Q=Math.max(0,H+D+R.offset);return i.set(l,Q),Q}finally{d.delete(l)}};return{resolveStartForElement:(l,b=0)=>y(l,Math.max(0,b)),resolveDurationForElement:l=>S(l)}}function ne(e){let n=Number(e);return Number.isFinite(n)?n:null}function Se(e){let n=String(e??"").trim();if(!n)return null;let i=n.toLowerCase();if(i.startsWith("data:")||i.startsWith("javascript:"))return null;try{return new URL(n,document.baseURI).toString()}catch{return n}}function ft(e){let n=e.getAttribute("src")??e.getAttribute("data-src");if(n)return Se(n);let i=e.getAttribute("data-composition-src");if(i)return Se(i);let a=e.querySelector("img[src], video[src], audio[src], source[src]");return a?Se(a.getAttribute("src")):null}function nt(e){let i=window.__timelines??{},a=pe({timelineRegistry:i}),d=T=>{if(!T)return null;let m=i[T]??null;if(!m||typeof m.duration!="function")return null;try{let x=Number(m.duration());return Number.isFinite(x)&&x>0?x:null}catch{return null}},g=T=>{let m=ne(T.getAttribute("data-duration"));if(m!=null&&m>0)return m;let x=ne(T.getAttribute("data-playback-start"))??ne(T.getAttribute("data-media-start"))??0;return Number.isFinite(T.duration)&&T.duration>x?Math.max(0,T.duration-x):null},S=()=>{let T=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(T.length===0)return null;let m=0;for(let x of T){let O=a.resolveStartForElement(x,0);if(!Number.isFinite(O))continue;let F=g(x);F==null||F<=0||(m=Math.max(m,Math.max(0,O)+F))}return m>0?m:null},y=T=>{let m=T.trim().toLowerCase();return!(!m||m==="main"||m.includes("caption")||m.includes("ambient"))},l=(T,m)=>{let x=[],O=null,F=null,_=null,K=T.parentElement;for(;K;){let Y=K.getAttribute("data-composition-id");Y&&(x.push(Y),!_&&K!==m&&(_=Y),O==null&&(O=a.resolveStartForElement(K,0)),F==null&&(F=ne(K.getAttribute("data-duration"))??null)),K=K.parentElement}return{parentCompositionId:_,compositionAncestors:x.reverse(),inheritedStart:O,inheritedDuration:F}},b=document.querySelector("[data-composition-id]"),p=b?.getAttribute("data-composition-id")??null,R=b?a.resolveStartForElement(b,0):0,P=S(),H=P!=null?Math.max(0,P-Math.max(0,R)):null,D=d(p),Q=ne(b?.getAttribute("data-duration")),Z=typeof D=="number"&&Number.isFinite(D)&&D>0?D:null,ae=typeof Q=="number"&&Number.isFinite(Q)&&Q>0?Q:null,oe=typeof H=="number"&&Number.isFinite(H)&&H>0?H:null,ie=Z!=null&&oe!=null&&Z>oe+1,se=ae??(ie?oe:Z??oe),u=se!=null?Math.min(se,e.maxTimelineDurationSeconds):null,h=(u!=null?R+u:null)??(typeof P=="number"&&Number.isFinite(P)&&P>0?P:null),C=(T,m)=>!Number.isFinite(m)||m<=0?0:h==null||!Number.isFinite(h)?m:!Number.isFinite(T)||T>=h?0:Math.max(0,Math.min(m,h-T)),v=Array.from(document.querySelectorAll("[data-composition-id]")),k=[],z=[],W=Array.from(document.querySelectorAll("*")),I=0;for(let T=0;T<W.length;T+=1){let m=W[T];if(m===b||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(m.tagName))continue;let x=l(m,b),O=a.resolveStartForElement(m,x.inheritedStart??0),F=m.getAttribute("data-composition-id"),_=ne(m.getAttribute("data-duration"));if((_==null||_<=0)&&F&&F!==p&&(_=d(F)),(_==null||_<=0)&&m instanceof HTMLMediaElement){let le=ne(m.getAttribute("data-playback-start"))??ne(m.getAttribute("data-media-start"))??0;Number.isFinite(m.duration)&&m.duration>0&&(_=Math.max(0,m.duration-le))}if(_==null||_<=0){let le=x.inheritedDuration;if(le!=null&&le>0){let Ae=(x.inheritedStart??0)+le;_=Math.max(0,Ae-O)}}if(_==null||_<=0||(_=C(O,_),_<=0))continue;let K=O+_;I=Math.max(I,K);let Y=m.tagName.toLowerCase(),Te=F&&F!==p?"composition":Y==="video"?"video":Y==="audio"?"audio":Y==="img"?"image":"element";k.push({id:m.id||`__node__index_${T}`,label:m.getAttribute("data-timeline-label")??m.getAttribute("data-label")??m.getAttribute("aria-label")??m.id??m.className?.split(" ")[0]??Te,start:O,duration:_,track:Number.parseInt(m.getAttribute("data-track-index")??m.getAttribute("data-track")??String(T),10)||0,kind:Te,tagName:Y,compositionId:m.getAttribute("data-composition-id"),compositionAncestors:x.compositionAncestors,parentCompositionId:x.parentCompositionId,nodePath:null,compositionSrc:Se(m.getAttribute("data-composition-src")),assetUrl:ft(m),timelineRole:m.getAttribute("data-timeline-role"),timelineLabel:m.getAttribute("data-timeline-label"),timelineGroup:m.getAttribute("data-timeline-group"),timelinePriority:ne(m.getAttribute("data-timeline-priority"))})}for(let T of v){if(T===b)continue;let m=T.getAttribute("data-composition-id");if(!m||!y(m))continue;let x=a.resolveStartForElement(T,0),O=ne(T.getAttribute("data-duration")),F=d(m),_=O&&O>0?O:F;if(_==null||_<=0)continue;let K=C(x,_);K<=0||z.push({id:m,label:T.getAttribute("data-label")??m,start:x,duration:K,thumbnailUrl:Se(T.getAttribute("data-thumbnail-url")),avatarName:null})}let G=Math.max(1,Math.min(I||1,e.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:ie&&ae==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(G*Math.max(1,e.canonicalFps))),clips:k,scenes:z,compositionWidth:ne(b?.getAttribute("data-width"))??1920,compositionHeight:ne(b?.getAttribute("data-height"))??1080}}var pt=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,gt=e=>new Promise(n=>{let i=!1,a=Date.now(),d=null,g=S=>{i||(i=!0,d!=null&&window.clearTimeout(d),n({status:S,elapsedMs:Math.max(0,Date.now()-a)}))};e.addEventListener("load",()=>g("load"),{once:!0}),e.addEventListener("error",()=>g("error"),{once:!0}),d=window.setTimeout(()=>g("timeout"),8e3)});function it(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function yt(e,n){let i=e.trim();if(!i)return e;try{return pt.test(i)?new URL(i,document.baseURI).toString():n?new URL(i,n).toString():new URL(i,document.baseURI).toString()}catch{return e}}async function ot(e){let n=null;e.hostCompositionId&&(n=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(l=>l.getAttribute("data-composition-id")===e.hostCompositionId)??null);let i=n??e.sourceNode,a=Array.from(i.querySelectorAll("style"));for(let y of a){let l=y.cloneNode(!0);l instanceof HTMLStyleElement&&(document.head.appendChild(l),e.injectedStyles.push(l))}let d=Array.from(i.querySelectorAll("script")),g=[];for(let y of d){let l=y.getAttribute("type")?.trim()??"",b=y.getAttribute("src")?.trim()??"";if(b){let p=yt(b,e.compositionUrl);g.push({kind:"external",src:p,type:l})}else{let p=y.textContent?.trim()??"";p&&g.push({kind:"inline",content:p,type:l})}y.parentNode?.removeChild(y)}let S=Array.from(i.querySelectorAll("style"));for(let y of S)y.parentNode?.removeChild(y);if(n){let y=document.importNode(n,!0),l=n.getAttribute("data-width"),b=n.getAttribute("data-height"),p=e.parseDimensionPx(l),R=e.parseDimensionPx(b);y.style.position="relative",y.style.width=p||"100%",y.style.height=R||"100%",p&&y.style.setProperty("--comp-width",p),R&&y.style.setProperty("--comp-height",R),l&&e.host.setAttribute("data-width",l),b&&e.host.setAttribute("data-height",b),p&&e.host instanceof HTMLElement&&(e.host.style.width=p),R&&e.host instanceof HTMLElement&&(e.host.style.height=R),e.host.appendChild(y)}else e.hasTemplate?e.host.appendChild(document.importNode(i,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;for(let y of g){let l=document.createElement("script");if(y.type&&(l.type=y.type),l.async=!1,y.kind==="external"?l.src=y.src:y.type.toLowerCase()==="module"?l.textContent=y.content:l.textContent=`(function(){${y.content}})();`,document.body.appendChild(l),e.injectedScripts.push(l),y.kind==="external"){let b=await gt(l);b.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.hostCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:y.src,loadStatus:b.status,elapsedMs:b.elapsedMs}})}}}async function rt(e){let n=Array.from(document.querySelectorAll("[data-composition-src]"));n.length!==0&&await Promise.all(n.map(async i=>{let a=i.getAttribute("data-composition-src");if(!a)return;let d=null;try{d=new URL(a,document.baseURI)}catch{d=null}it(i);try{let g=i.getAttribute("data-composition-id"),S=g!=null?document.querySelector(`template#${CSS.escape(g)}-template`):null;if(S){await ot({host:i,hostCompositionId:g,hostCompositionSrc:a,sourceNode:S.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let y=await fetch(a);if(!y.ok)throw new Error(`HTTP ${y.status}`);let l=await y.text(),p=new DOMParser().parseFromString(l,"text/html"),R=(g?p.querySelector(`template#${CSS.escape(g)}-template`):null)??p.querySelector("template"),P=R?R.content:p.body;await ot({host:i,hostCompositionId:g,hostCompositionSrc:a,sourceNode:P,hasTemplate:!!R,fallbackBodyInnerHtml:p.body.innerHTML,compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}catch(g){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:i.getAttribute("data-composition-id"),hostCompositionSrc:a,errorMessage:g instanceof Error?g.message:"unknown_error"}}),it(i)}}))}function at(){let e=tt(),n=window,i=null,a=null,d=[],g=new Set,S=null;if(typeof n.__hfRuntimeTeardown=="function")try{n.__hfRuntimeTeardown()}catch{}window.__timelines=window.__timelines||{};let y=t=>{d.push(t)},l=(t,o,r)=>{let c=r??`${t}:${JSON.stringify(o)}`;g.has(c)||(g.add(c),X({source:"hf-preview",type:"diagnostic",code:t,details:o}))},b=t=>{let o={scale:1,focusX:960,focusY:540},r=[],c=[],s={time:t.getTime(),duration:t.getDuration(),isPlaying:t.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:t.play,pause:t.pause,seek:t.seek,getTime:t.getTime,getDuration:t.getDuration,isPlaying:t.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>o,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>r,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:t.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>c,getRenderState:()=>({...s,time:t.getTime(),duration:t.getDuration(),isPlaying:t.isPlaying()})}},p=1/60,R=.75,P=.75,H=.35,D=900,Q=3,Z=2,ae=.05,oe=100,ie=240,se=t=>{if(t instanceof Error)return t.message||String(t);if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t??"")}},u=t=>{let o=t.toLowerCase();return o.includes("cannot read properties of null")||o.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:o.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:o.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},f=t=>{if(t==null||t.trim()==="")return null;let o=Number.parseFloat(t);return!Number.isFinite(o)||o<=0?null:`${o}px`},h=()=>{let t=document.getElementById("main-comp");if(t instanceof HTMLElement&&t.hasAttribute("data-composition-id"))return t;let o=document.querySelector('[data-composition-id][data-root="true"]');if(o instanceof HTMLElement)return o;let r=Array.from(document.querySelectorAll("[data-composition-id]"));return r.length===0?null:r.find(c=>!c.parentElement?.closest("[data-composition-id]"))??r[0]},C=()=>{let t=h();if(!t)return;let o=f(t.getAttribute("data-width")),r=f(t.getAttribute("data-height"));o&&(t.style.width=o),r&&(t.style.height=r),o&&t.style.setProperty("--comp-width",o),r&&t.style.setProperty("--comp-height",r)},v=()=>{let t=h(),o=Array.from(document.querySelectorAll("[data-composition-id][data-duration]"));for(let r of o)t&&r===t||r.removeAttribute("data-duration")},k=()=>{let t=h();if(!t)return;t.style.position||(t.style.position="relative"),t.style.overflow="hidden";let o=f(t.getAttribute("data-width")),r=f(t.getAttribute("data-height"));o&&(t.style.width=o),r&&(t.style.height=r);let c=Array.from(t.children);for(let s of c){let L=s.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta"||!s.hasAttribute("data-start"))continue;let V=(s.style.top==="0px"||s.style.top==="0")&&(s.style.left==="0px"||s.style.left==="0")&&s.style.width==="100%"&&s.style.height==="100%",ue=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(s.style.transform);if(V&&ue&&!s.hasAttribute("data-width")&&!s.hasAttribute("data-height")){let te=s.style.top,A=s.style.left,E=s.style.width,M=s.style.height;s.style.top="",s.style.left="",s.style.width="",s.style.height="";let w=window.getComputedStyle(s);w.top!=="auto"||w.bottom!=="auto"||w.left!=="auto"||w.right!=="auto"||w.width!=="0px"||w.height!=="0px"||(s.style.top=te,s.style.left=A,s.style.width=E,s.style.height=M)}let j=window.getComputedStyle(s),N=j.position;if(N!=="absolute"&&N!=="fixed"&&(s.style.position="absolute"),!!s.style.top||!!s.style.bottom||j.top!=="auto"||j.bottom!=="auto"||(s.style.top="0"),!!s.style.left||!!s.style.right||j.left!=="auto"||j.right!=="auto"||(s.style.left="0"),L!=="audio"){let te=f(s.getAttribute("data-width")),A=f(s.getAttribute("data-height")),E=j.width!=="0px"&&j.width!=="auto",M=j.height!=="0px"&&j.height!=="auto";te?!s.style.width&&!E&&(s.style.width=te):!s.style.width&&j.width==="0px"&&(s.style.width="100%"),A?!s.style.height&&!M&&(s.style.height=A):!s.style.height&&j.height==="0px"&&(s.style.height="100%")}}},z=(t,o=0)=>pe({timelineRegistry:window.__timelines??{}}).resolveStartForElement(t,o),W=t=>pe({timelineRegistry:window.__timelines??{}}).resolveDurationForElement(t),I=!document.querySelector("[data-composition-src]"),G=t=>{if(!t||typeof t.duration!="function")return null;try{let o=Number(t.duration());return Number.isFinite(o)?Math.max(0,o):null}catch{return null}},U=t=>typeof t=="number"&&Number.isFinite(t)&&t>p,xe=t=>{let o=Number(t.getAttribute("data-duration"));if(Number.isFinite(o)&&o>0)return o;let r=Number(t.getAttribute("data-playback-start")??t.getAttribute("data-media-start")??"0"),c=Number.isFinite(r)?Math.max(0,r):0;return Number.isFinite(t.duration)&&t.duration>c?Math.max(0,t.duration-c):null},T=()=>{let t=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(t.length===0)return null;let o=0;for(let r of t){let c=z(r,0);if(!Number.isFinite(c))continue;let s=xe(r);s==null||s<=p||(o=Math.max(o,Math.max(0,c)+s))}return o>p?o:null},m=()=>{let t=T();return typeof t!="number"||!Number.isFinite(t)||t<=p?null:t},x=t=>U(t)?Math.max(p,t*R):p,O=(t,o=0)=>{let r=G(t),c=m(),s=Number.isFinite(o)&&o>p?o:0,L=0;U(r)?L=Math.max(r,s):U(c)?L=Math.max(c,s):L=s;let V=Math.max(1,Number(e.maxTimelineDurationSeconds)||1800);return L>0?Math.max(0,Math.min(L,V)):0},F=()=>{let t=window.__timelines??{},o=pe({timelineRegistry:t}),r=m(),c=x(r),s=A=>{let E=document.querySelector(`[data-composition-id="${CSS.escape(A)}"]`);return E?o.resolveStartForElement(E,0):0},L=A=>{let E=window.gsap;if(!E||typeof E.timeline!="function")return null;let M=E.timeline({paused:!0});for(let w of A)M.add(w.timeline,s(w.compositionId));return M},V=(A,E)=>{if(!U(A))return null;let M=window.gsap;if(!M||typeof M.timeline!="function")return null;let w=M.timeline({paused:!0});if(E)try{w.add(E,0)}catch{}let $=w;if(typeof $.to=="function")try{$.to({},{duration:A})}catch{}return w},ue=(A,E)=>{let M=A;if(typeof M.getChildren!="function")return[];try{let w=M.getChildren(!0,!0,!0)??[];if(!Array.isArray(w))return[];let $=[];for(let J of E)if(!w.some(ye=>ye===J.timeline))try{let ye=s(J.compositionId);A.add(J.timeline,ye),$.push(J.compositionId)}catch{}return $}catch{return[]}},j=h(),N=j?.getAttribute("data-composition-id")??null;if(!N)return{timeline:null};let ee=t[N]??null,B=(()=>{if(!j)return[];let A=new Set,E=Array.from(j.querySelectorAll("[data-composition-id]")),M=[];for(let w of E){let $=w.getAttribute("data-composition-id");if(!$||$===N||A.has($))continue;A.add($);let J=t[$]??null;if(!J||typeof J.play!="function"||typeof J.pause!="function")continue;let fe=G(J);M.push({compositionId:$,timeline:J,durationSeconds:fe??0})}return M})(),te=A=>{for(let E of A){let M=E.timeline;if(typeof M.paused=="function")try{M.paused(!1)}catch{}}};if(B.length>0&&te(B),ee){let A=B.length>0?ue(ee,B):[];if((B.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+N+"'])"))&&(K=!0),A.length>0)try{let M=ee.time();ee.seek(M,!1)}catch{}let E=G(ee);if(!U(E)&&B.length>0){let M=B.map(ye=>ye.compositionId),w=L(B),$=G(w);if(w&&U($))return{timeline:w,selectedTimelineIds:M,selectedDurationSeconds:$,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:N,rootDurationSeconds:E,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:c,selectedDurationSeconds:$,mediaDurationFloorSeconds:r,selectedTimelineIds:M,autoNestedChildren:A}}};let J=V(r??0,ee),fe=G(J);if(J&&U(fe))return{timeline:J,selectedTimelineIds:[N],selectedDurationSeconds:fe,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:N,rootDurationSeconds:E,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:r,selectedDurationSeconds:fe,selectedTimelineIds:[N],autoNestedChildren:A}}}}if(!U(E)&&B.length===0){let M=V(r??0,ee),w=G(M);if(M&&U(w))return{timeline:M,selectedTimelineIds:[N],selectedDurationSeconds:w,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:N,rootDurationSeconds:E,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:r,selectedDurationSeconds:w,selectedTimelineIds:[N]}}}}return{timeline:ee,selectedTimelineIds:[N],selectedDurationSeconds:E,mediaDurationFloorSeconds:r,diagnostics:A.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:N,selectedDurationSeconds:E,autoNestedChildren:A}}:void 0}}if(B.length>0){let A=B.map(w=>w.compositionId),E=L(B),M=G(E);if(E)return{timeline:E,selectedTimelineIds:A,selectedDurationSeconds:M,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:N,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:c,selectedDurationSeconds:M,mediaDurationFloorSeconds:r,selectedTimelineIds:A}}}}return{timeline:null}},_=()=>{let t=e.capturedTimeline;if(!t||typeof t.time!="function")return;let o=Number(t.time());Number.isFinite(o)&&(e.currentTime=Math.max(0,o))},K=!1,Y=()=>{if(!I)return!1;let t=e.capturedTimeline,o=G(t),r=U(o);if(t&&r&&K)return!1;let c=F();return c.timeline?t&&t===c.timeline?(typeof t.timeScale=="function"&&t.timeScale(e.playbackRate),!1):(e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),c.diagnostics&&X({source:"hf-preview",type:"diagnostic",code:c.diagnostics.code,details:c.diagnostics.details}),X({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0):!1},Te=()=>{let t=h();if(!(t instanceof HTMLElement))return;let o=t.getBoundingClientRect(),r=Number(t.getAttribute("data-width")),c=Number(t.getAttribute("data-height")),s=window.getComputedStyle(t),L=Number.isFinite(r)&&r>0&&Number.isFinite(c)&&c>0,V=o.width<=0||o.height<=0||t.clientWidth<=0||t.clientHeight<=0;!L||!V||l("root_stage_layout_zero",{compositionId:t.getAttribute("data-composition-id")??null,declaredWidth:r,declaredHeight:c,rectWidth:Math.round(o.width),rectHeight:Math.round(o.height),clientWidth:t.clientWidth,clientHeight:t.clientHeight,display:s.display,visibility:s.visibility,overflow:s.overflow},`root-stage-layout-zero:${t.getAttribute("data-composition-id")??"unknown"}`)},le=()=>{e.tornDown||(S!=null&&window.cancelAnimationFrame(S),S=window.requestAnimationFrame(()=>{S=null,Te()}))},Ne=()=>{i=t=>{let o=se(t.error??t.message).slice(0,ie);if(!o)return;let r=u(o);X({source:"hf-preview",type:"diagnostic",code:r.code,details:{category:r.category,message:o,filename:t.filename||null,line:Number.isFinite(t.lineno)?t.lineno:null,column:Number.isFinite(t.colno)?t.colno:null}})},a=t=>{let o=se(t.reason).slice(0,ie);if(!o)return;let r=u(o);X({source:"hf-preview",type:"diagnostic",code:`${r.code}_unhandled_rejection`,details:{category:`${r.category}-unhandled-rejection`,message:o}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",a)},Ae=()=>{let t=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let r of t){let c=()=>{if(!(r instanceof Element))return;let s=r.tagName.toLowerCase(),L=r.getAttribute("src")??r.getAttribute("href")??r.getAttribute("poster")??null,V=s==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";l(V,{tagName:s,assetUrl:L,currentSrc:(r instanceof HTMLImageElement||r instanceof HTMLMediaElement)&&r.currentSrc||null,readyState:r instanceof HTMLMediaElement?r.readyState:null,networkState:r instanceof HTMLMediaElement?r.networkState:null},`${V}:${s}:${L??"unknown"}`)};r.addEventListener("error",c),y(()=>{r.removeEventListener("error",c)})}let o=document.fonts;o&&o.ready.then(()=>{if(e.tornDown)return;let r=Array.from(o).filter(c=>c.status==="error").map(c=>c.family).filter(c=>!!c).slice(0,10);r.length!==0&&l("runtime_font_load_issue",{failedFamilies:r,totalFaces:Array.from(o).length},`runtime-font-load-issue:${r.join("|")}`)}).catch(()=>{})},Fe=(t,o)=>{if(!t.timeline)return!1;let r=e.capturedTimeline;if(r&&r===t.timeline)return!1;let c=Math.max(0,e.currentTime||0),s=e.isPlaying;e.capturedTimeline=t.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{e.capturedTimeline.pause(),e.capturedTimeline.seek(c,!1),s&&e.capturedTimeline.play()}catch{}return X({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:o,previousTime:c,selectedTimelineIds:t.selectedTimelineIds??[],selectedDurationSeconds:t.selectedDurationSeconds??null,mediaDurationFloorSeconds:t.mediaDurationFloorSeconds??null}}),!0},ce=null,He=!1,Ee=new Set,Me=()=>{e.tornDown||(ce!=null&&window.clearTimeout(ce),ce=window.setTimeout(()=>{if(e.tornDown)return;ce=null;let t=F();if(!t.timeline||!U(t.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Y()&&(de(),re(!0));return}if(He)return;let r=G(e.capturedTimeline),c=t.selectedDurationSeconds??G(t.timeline);U(c)&&(!U(r)||c>=r+ae)&&Fe(t,"manual")&&(He=!0,X({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:r??null,selectedDurationSeconds:c??null,selectedTimelineIds:t.selectedTimelineIds??[],mediaDurationFloorSeconds:t.mediaDurationFloorSeconds??null}}),de(),re(!0))},oe))},lt=()=>{for(let t of Ee)t.removeEventListener("loadedmetadata",Me),t.removeEventListener("durationchange",Me);Ee.clear()},we=()=>{if(e.tornDown)return;let t=Array.from(document.querySelectorAll("video, audio"));for(let o of t)Ee.has(o)||(Ee.add(o),o.addEventListener("loadedmetadata",Me),o.addEventListener("durationchange",Me))},We=()=>{let t=Ze({resolveStartSeconds:c=>z(c,0)});Ye({clips:t.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate});let o=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,r=Array.from(document.querySelectorAll("[data-start]"));for(let c of r){if(!(c instanceof HTMLElement))continue;let s=c.tagName.toLowerCase();if(s==="script"||s==="style"||s==="link"||s==="meta")continue;if(!c.getAttribute("data-composition-id")){let te=c.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(te&&te!==o)continue}let V=z(c,0),ue=W(c),j=ue!=null&&ue>0?V+ue:Number.POSITIVE_INFINITY,N=j,ee=c.getAttribute("data-composition-id");if(ee&&!Number.isFinite(j)){let B=(window.__timelines??{})[ee];if(B&&typeof B.duration=="function"){let te=B.duration();te>0&&(N=V+te)}}let Le=e.currentTime>=V&&(Number.isFinite(N)?e.currentTime<N:!0);c.style.visibility=Le?"visible":"hidden"}},re=t=>{_();let o=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),r=Date.now();(t||o!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||r-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=o,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=r,X({source:"hf-preview",type:"state",frame:o,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},de=()=>{v(),C(),k();let t=h();if(t){let r=f(t.getAttribute("data-width")),c=f(t.getAttribute("data-height")),s=r?parseInt(r,10):0,L=c?parseInt(c,10):0;s>0&&L>0&&X({source:"hf-preview",type:"stage-size",width:s,height:L})}Y();let o=nt({canonicalFps:e.canonicalFps,maxTimelineDurationSeconds:e.maxTimelineDurationSeconds});window.__clipManifest=o,X(o),le()},ge=(t,o=0)=>{for(let r of e.deterministicAdapters){try{t==="discover"&&r.discover(),t==="pause"&&r.pause(),t==="play"&&r.play&&r.play()}catch{}if(t==="discover")try{r.seek({time:o})}catch{}}};I||rt({injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,parseDimensionPx:f,onDiagnostic:({code:t,details:o})=>{X({source:"hf-preview",type:"diagnostic",code:t,details:o})}}).finally(()=>{I=!0,ge("discover",e.currentTime),we(),Ae(),de(),re(!0)});let Re=Je({postMessage:t=>X(t)});Re.installPickerApi();let Oe=t=>{let o=Number(t);!Number.isFinite(o)||o<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,o)),e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let r=document.querySelectorAll("video, audio");for(let c of r)if(c instanceof HTMLMediaElement)try{c.playbackRate=e.playbackRate}catch{}},q=et({getTimeline:()=>e.capturedTimeline,setTimeline:t=>{e.capturedTimeline=t},getIsPlaying:()=>e.isPlaying,setIsPlaying:t=>{e.isPlaying=t},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:Oe,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(t,o)=>{e.currentTime=Math.max(0,Number(t)||0),e.isPlaying=o,We()},onStatePost:re,onDeterministicSeek:t=>{for(let o of e.deterministicAdapters)try{o.seek({time:Number(t)||0})}catch{}},onDeterministicPause:()=>ge("pause"),onDeterministicPlay:()=>ge("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>O(e.capturedTimeline,0)});window.__player=b(q),window.__playerReady=!0,window.__renderReady=!0,qe(X),be("composition_loaded",{duration:q.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=Ue({onPlay:()=>{q.play(),be("composition_played",{time:q.getTime()})},onPause:()=>{q.pause(),be("composition_paused",{time:q.getTime()})},onSeek:(t,o)=>{let r=Math.max(0,t)/e.canonicalFps;q.seek(r),be("composition_seeked",{time:r})},onSetMuted:t=>{e.bridgeMuted=t;let o=document.querySelectorAll("video, audio");for(let r of o)r instanceof HTMLMediaElement&&(r.muted=t)},onSetPlaybackRate:t=>Oe(t),onEnablePickMode:()=>Re.enablePickMode(),onDisablePickMode:()=>Re.disablePickMode()}),Y(),e.capturedTimeline&&(q._timeline=e.capturedTimeline),I&&setTimeout(()=>{let t=e.capturedTimeline;Y()&&e.capturedTimeline!==t&&(q._timeline=e.capturedTimeline),ge("discover",e.currentTime),de(),re(!0)},0),e.deterministicAdapters=[Ve({resolveStartSeconds:t=>z(t,0)}),Ke(),$e({getTimeline:()=>e.capturedTimeline}),Ge(),ze()],Ne(),ge("discover"),we(),e.timelinePollIntervalId&&clearInterval(e.timelinePollIntervalId);let ke=0,ve=null,je=0,_e=!1,me=0,Be=()=>{je=Date.now(),_e=!1,me=0};e.timelinePollIntervalId=setInterval(()=>{ke+=1;let o=e.isPlaying&&e.capturedTimeline!=null&&Math.max(0,e.currentTime||0)<Z?!1:Y();if(e.capturedTimeline&&!q._timeline&&(q._timeline=e.capturedTimeline),(o||ke%20===0)&&de(),ke%10===0&&we(),_(),e.isPlaying&&e.capturedTimeline){let r=Math.max(0,e.currentTime||0),c=ve,s=O(e.capturedTimeline,0);if(s>0&&r>=s){q.pause(),q.seek(s),ve=s,me=0,re(!0);return}if(c!=null&&c>=P&&r<=H?me+=1:me=0,!_e&&me>=Q&&Date.now()-je>D){let V=F();Fe(V,"loop_guard")&&(_e=!0,me=0)}ve=Math.max(0,e.currentTime||0)}else ve=Math.max(0,e.currentTime||0);e.isPlaying&&We(),re(!1)},50),de(),re(!0);let ct=q.seek;q.seek=t=>{Be(),ct(t)};let ut=q.renderSeek;q.renderSeek=t=>{Be(),ut(t)};let Pe=()=>{if(!e.tornDown){e.tornDown=!0,e.timelinePollIntervalId&&(clearInterval(e.timelinePollIntervalId),e.timelinePollIntervalId=null),ce!=null&&(window.clearTimeout(ce),ce=null),S!=null&&(window.cancelAnimationFrame(S),S=null),lt(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),a&&(window.removeEventListener("unhandledrejection",a),a=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Re.disablePickMode();for(let t of e.deterministicAdapters)if(!(!t||typeof t.revert!="function"))try{t.revert()}catch{}e.deterministicAdapters=[];for(let t of d.splice(0))try{t()}catch{}for(let t of e.injectedCompStyles)try{t.remove()}catch{}e.injectedCompStyles=[];for(let t of e.injectedCompScripts)try{t.remove()}catch{}e.injectedCompScripts=[],e.capturedTimeline=null,n.__hfRuntimeTeardown===Pe&&(n.__hfRuntimeTeardown=null)}};n.__hfRuntimeTeardown=Pe,e.beforeUnloadHandler=Pe,window.addEventListener("beforeunload",e.beforeUnloadHandler)}window.__timelines=window.__timelines||{};function st(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,at())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",st,{once:!0}):st();})();
13
+
@@ -0,0 +1,13 @@
1
+ function X(e){try{window.parent.postMessage(e,"*")}catch{}}function Ue(e){let n=i=>{let a=i.data;if(!a||a.source!=="hf-parent"||a.type!=="control")return;let d=a.action;if(d==="play"){e.onPlay();return}if(d==="pause"){e.onPause();return}if(d==="seek"){e.onSeek(Number(a.frame??0),a.seekMode??"commit");return}if(d==="set-muted"){e.onSetMuted(!!a.muted);return}if(d==="set-playback-rate"){e.onSetPlaybackRate(Number(a.playbackRate??1));return}if(d==="enable-pick-mode"){e.onEnablePickMode();return}if(d==="disable-pick-mode"){e.onDisablePickMode();return}if(d==="flash-elements"){let g=a.selectors,S=a.duration||800;g&&dt(g,S)}};return window.addEventListener("message",n),n}function dt(e,n){if(!document.getElementById("__hf-flash-styles")){let i=document.createElement("style");i.id="__hf-flash-styles",i.textContent=`
2
+ .__hf-flash {
3
+ outline: 2px solid rgba(59, 130, 246, 0.6) !important;
4
+ outline-offset: 2px !important;
5
+ animation: __hf-flash-pulse ${n}ms ease-out forwards !important;
6
+ }
7
+ @keyframes __hf-flash-pulse {
8
+ 0% { outline-color: rgba(59, 130, 246, 0.8); }
9
+ 100% { outline-color: transparent; }
10
+ }
11
+ `,document.head.appendChild(i)}for(let i of e)try{document.querySelectorAll(i).forEach(d=>{d.classList.add("__hf-flash"),setTimeout(()=>d.classList.remove("__hf-flash"),n)})}catch{}}var De=null;function qe(e){De=e}function be(e,n){if(De)try{De({source:"hf-preview",type:"analytics",event:e,properties:n??{}})}catch{}}function Ve(e){let n=[];return{name:"css",discover:()=>{n=[];let i=document.querySelectorAll("*");for(let a of i){if(!(a instanceof HTMLElement))continue;let d=window.getComputedStyle(a);!d.animationName||d.animationName==="none"||n.push({el:a,baseDelay:a.style.animationDelay||"",basePlayState:a.style.animationPlayState||""})}},seek:i=>{let a=Number(i.time)||0;for(let d of n){if(!d.el.isConnected)continue;let g=e?.resolveStartSeconds?e.resolveStartSeconds(d.el):Number.parseFloat(d.el.getAttribute("data-start")??"0")||0,S=Math.max(0,a-g);d.el.style.animationPlayState="paused",d.el.style.animationDelay=`-${S.toFixed(3)}s`}},pause:()=>{for(let i of n)i.el.isConnected&&(i.el.style.animationPlayState=i.basePlayState||"paused",i.baseDelay&&(i.el.style.animationDelay=i.baseDelay))},revert:()=>{n=[]}}}function $e(e){return{name:"gsap",discover:()=>{},seek:n=>{let i=e.getTimeline();if(!i)return;i.pause();let a=Math.max(0,Number(n.time)||0);typeof i.totalTime=="function"?i.totalTime(a,!1):i.seek(a,!1)},pause:()=>{let n=e.getTimeline();n&&n.pause()}}}function ze(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let n=e.getRegisteredAnimations();if(Array.isArray(n)&&n.length>0){let i=window.__hfLottie??[],a=new Set(i);for(let d of n)a.has(d)||i.push(d);window.__hfLottie=i}}}catch{}},seek:e=>{let n=Math.max(0,Number(e.time)||0),i=window.__hfLottie;if(!(!i||i.length===0))for(let a of i)try{if(Ce(a))a.goToAndStop(n*1e3,!1);else if(Ie(a)){if(typeof a.setCurrentRawFrameValue=="function"){let d=a.totalFrames??0,g=a.frameRate??30,S=n*g;d>0&&a.setCurrentRawFrameValue(Math.min(S,d-1))}else if(typeof a.seek=="function"){let d=a.duration??1,g=Math.min(100,n/d*100);a.seek(g)}}}catch{}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let n of e)try{(Ce(n)||Ie(n))&&n.pause()}catch{}},play:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let n of e)try{(Ce(n)||Ie(n))&&n.play()}catch{}},revert:()=>{}}}function Ce(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Ie(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function Ge(){let e=null,n=0;return{name:"three",discover:()=>{},seek:i=>{e=Math.max(0,Number(i.time)||0),n=e,window.__hfThreeTime=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch{}},pause:()=>{e==null&&(e=Math.max(0,n))},play:()=>{e=null},revert:()=>{e=null,n=0}}}function Ke(){return{name:"waapi",discover:()=>{},seek:e=>{if(!document.getAnimations)return;let n=Math.max(0,(Number(e.time)||0)*1e3);for(let i of document.getAnimations())try{i.pause(),i.currentTime=n}catch{}},pause:()=>{if(document.getAnimations)for(let e of document.getAnimations())try{e.pause()}catch{}}}}function Ze(e){let n=Array.from(document.querySelectorAll("video[data-start], audio[data-start]")),i=[],a=[],d=0;for(let g of n){let S=e?.resolveStartSeconds?e.resolveStartSeconds(g):Number.parseFloat(g.dataset.start??"0");if(!Number.isFinite(S))continue;let y=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0,l=Number.parseFloat(g.dataset.duration??"");(!Number.isFinite(l)||l<=0)&&Number.isFinite(g.duration)&&g.duration>0&&(l=Math.max(0,g.duration-y));let b=Number.isFinite(l)&&l>0?S+l:Number.POSITIVE_INFINITY,p=Number.parseFloat(g.dataset.volume??""),R={el:g,start:S,mediaStart:y,duration:Number.isFinite(l)&&l>0?l:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(p)?p:null};i.push(R),g.tagName==="VIDEO"&&a.push(R),Number.isFinite(b)&&(d=Math.max(d,b))}return{timedMediaEls:n,mediaClips:i,videoClips:a,maxMediaEnd:d}}function Ye(e){for(let n of e.clips){let{el:i}=n;if(!i.isConnected)continue;let a=e.timeSeconds-n.start+n.mediaStart;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&a>=0){n.volume!=null&&(i.volume=n.volume);try{i.playbackRate=e.playbackRate}catch{}if(Math.abs((i.currentTime||0)-a)>.3)try{i.currentTime=a}catch{}e.playing&&i.paused?i.play().catch(()=>{}):!e.playing&&!i.paused&&i.pause();continue}i.paused||i.pause()}}function Je(e){let n=!1,i=null,a=null,d=null,g=null;function S(u,f){try{window.dispatchEvent(new CustomEvent(u,{detail:f}))}catch{}}function y(u){d=u,S("hyperframe:picker:hovered",{elementInfo:d,isPickMode:n,timestamp:Date.now()})}function l(u){g=u,S("hyperframe:picker:selected",{elementInfo:g,isPickMode:n,timestamp:Date.now()})}function b(u){if(!u||u===document.body||u===document.documentElement)return!1;let f=u.tagName.toLowerCase();return!(f==="script"||f==="style"||f==="link"||f==="meta"||u.classList.contains("__hf-pick-highlight"))}function p(u){let f=u;if(f.id)return`#${f.id}`;let h=u.getAttribute("data-composition-id");if(h)return`[data-composition-id="${h}"]`;let C=u.getAttribute("data-composition-src");if(C)return`[data-composition-src="${C}"]`;let v=u.getAttribute("data-track-index");if(v)return`[data-track-index="${v}"]`;let k=u.tagName.toLowerCase(),z=u.parentElement;if(!z)return k;let W=z.querySelectorAll(`:scope > ${k}`);if(W.length===1)return k;for(let I=0;I<W.length;I+=1)if(W[I]===u)return`${k}:nth-of-type(${I+1})`;return k}function R(u){let f=u.tagName.toLowerCase(),h=(u.textContent??"").trim().replace(/\s+/g," "),C=(v,k)=>v.length>k?`${v.slice(0,k-1)}\u2026`:v;return f==="h1"||f==="h2"||f==="h3"?"Heading":f==="p"||f==="span"||f==="div"?h.length>0?C(h,56):"Text":f==="img"?"Image":f==="video"?"Video":f==="audio"?"Audio":f==="svg"?"Shape":u.getAttribute("data-composition-src")?"Composition":f==="section"?"Section":`${f.charAt(0).toUpperCase()}${f.slice(1)}`}function P(u,f,h){let C=typeof h=="number"&&h>0?h:8,v=[];if(document.elementsFromPoint)v=document.elementsFromPoint(u,f);else if(document.elementFromPoint){let W=document.elementFromPoint(u,f);v=W?[W]:[]}let k={},z=[];for(let W=0;W<v.length;W+=1){let I=v[W];if(!b(I))continue;let G=`${I.tagName}::${I.id||""}::${W}`;if(!k[G]&&(k[G]=!0,z.push(I),z.length>=C))break}return z}function H(u){let f=u.getBoundingClientRect(),h={};for(let v=0;v<u.attributes.length;v+=1){let k=u.attributes[v];k.name.startsWith("data-")&&(h[k.name]=k.value)}return{id:u.id||null,tagName:u.tagName.toLowerCase(),selector:p(u),label:R(u),boundingBox:{x:f.left,y:f.top,width:f.width,height:f.height},textContent:u.textContent?u.textContent.trim().slice(0,200):null,src:u.getAttribute("src")||u.getAttribute("data-composition-src")||null,dataAttributes:h}}function D(u,f,h){return P(u,f,h).map(H)}function Q(u){if(!n)return;let h=P(u.clientX,u.clientY,1)[0]??(u.target instanceof Element?u.target:null);if(!b(h)||i===h)return;i&&i.classList.remove("__hf-pick-highlight"),i=h,h.classList.add("__hf-pick-highlight");let C=H(h);y(C),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:C})}function Z(u){if(!n)return;u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation();let f=D(u.clientX,u.clientY,8);f.length!==0&&(y(f[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:f,selectedIndex:0,point:{x:u.clientX,y:u.clientY}}))}function ae(u){u.key==="Escape"&&(ie(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function oe(){n||(n=!0,a=document.createElement("style"),a.textContent=[".__hf-pick-highlight { outline: 2px solid #4f8cf7 !important; outline-offset: 2px; cursor: crosshair !important; }",".__hf-pick-active * { cursor: crosshair !important; }"].join(`
12
+ `),document.head.appendChild(a),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",Q,!0),document.addEventListener("click",Z,!0),document.addEventListener("keydown",ae,!0),S("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function ie(){n&&(n=!1,i&&(i.classList.remove("__hf-pick-highlight"),i=null),a&&(a.remove(),a=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",Q,!0),document.removeEventListener("click",Z,!0),document.removeEventListener("keydown",ae,!0),S("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function se(){window.__HF_PICKER_API={enable:oe,disable:ie,isActive:()=>n,getHovered:()=>d,getSelected:()=>g,getCandidatesAtPoint:(u,f,h)=>Number.isFinite(u)&&Number.isFinite(f)?D(u,f,h):[],pickAtPoint:(u,f,h)=>{if(!Number.isFinite(u)||!Number.isFinite(f))return null;let C=D(u,f,8);if(!C.length)return null;let v=Math.max(0,Math.min(C.length-1,Number(h??0))),k=C[v]??null;return k?(l(k),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:k}),ie(),k):null},pickManyAtPoint:(u,f,h)=>{if(!Number.isFinite(u)||!Number.isFinite(f))return[];let C=D(u,f,8);if(!C.length)return[];let v=[],k=Array.isArray(h)?h:[0];for(let z of k){let W=Math.max(0,Math.min(C.length-1,Math.floor(Number(z)))),I=C[W];if(!I)continue;v.some(U=>U.selector===I.selector&&U.tagName===I.tagName)||v.push(I)}return v.length?(l(v[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:v}),ie(),v):[]}},S("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:oe,disablePickMode:ie,installPickerApi:se}}function Xe(e,n){let i=Number.isFinite(n)&&n>0?n:30,a=Number.isFinite(e)&&e>0?e:0;return Math.floor(a*i+1e-9)/i}function Qe(e,n,i){let a=Xe(n,i);return e.pause(),typeof e.totalTime=="function"?e.totalTime(a,!1):e.seek(a,!1),a}function et(e){return{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let i=Math.max(0,Number(e.getSafeDuration?.()??n.duration()??0)||0);i>0&&Math.max(0,Number(n.time())||0)>=i&&(n.pause(),n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),n.play(),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;n.pause();let i=Math.max(0,Number(n.time())||0);e.onDeterministicSeek(i),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(i,!1),e.onRenderFrameSeek(i),e.onStatePost(!0)},seek:n=>{let i=e.getTimeline();if(!i)return;let a=Math.max(0,Number(n)||0),d=Qe(i,a,e.getCanonicalFps());e.onDeterministicSeek(d),e.setIsPlaying(!1),e.onSyncMedia(d,!1),e.onRenderFrameSeek(d),e.onStatePost(!0)},renderSeek:n=>{let i=e.getTimeline();if(!i)return;let a=Qe(i,n,e.getCanonicalFps());e.onDeterministicSeek(a),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Number(e.getTimeline()?.time()??0),getDuration:()=>Number(e.getTimeline()?.duration()??0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function tt(){return{capturedTimeline:null,isPlaying:!1,rafId:null,currentTime:0,deterministicAdapters:[],parityModeEnabled:!0,canonicalFps:30,bridgeMuted:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,timelinePollIntervalId:null,controlBridgeHandler:null,clampDurationLoggedRaw:null,beforeUnloadHandler:null,domReadyHandler:null,injectedCompStyles:[],injectedCompScripts:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,maxTimelineDurationSeconds:1800,nativeVisualWatchdogTick:0}}function he(e){let n=Number(e);return Number.isFinite(n)?n:null}function mt(e){let n=(e??"").trim();if(!n)return null;let i=he(n);if(i!=null)return{kind:"absolute",value:i};let a=n.match(/^([A-Za-z0-9_.:-]+)(?:\s*([+-])\s*([0-9]*\.?[0-9]+))?$/);if(!a)return null;let d=(a[1]??"").trim();if(!d)return null;let g=a[2]??"+",S=a[3]??"0",y=Number.parseFloat(S),l=Number.isFinite(y)?Math.max(0,y):0,b=g==="-"?-l:l;return{kind:"reference",refId:d,offset:b}}function pe(e){let n=e.timelineRegistry??{},i=new WeakMap,a=new WeakMap,d=new Set,g=l=>{let b=document.getElementById(l);return b||(document.querySelector(`[data-composition-id="${CSS.escape(l)}"]`)??null)},S=l=>{let b=a.get(l);if(b!==void 0)return b;let p=null,R=he(l.getAttribute("data-duration"));if(R!=null&&R>0&&(p=R),p==null||p<=0){let P=he(l.getAttribute("data-end"));if(P!=null){let H=y(l,0),D=P-H;Number.isFinite(D)&&D>0&&(p=D)}}if((p==null||p<=0)&&l instanceof HTMLMediaElement){let P=he(l.getAttribute("data-playback-start"))??he(l.getAttribute("data-media-start"))??0;Number.isFinite(l.duration)&&l.duration>P&&(p=l.duration-P)}if(p==null||p<=0){let P=l.getAttribute("data-composition-id");if(P){let H=n[P]??null;if(H&&typeof H.duration=="function")try{let D=Number(H.duration());Number.isFinite(D)&&D>0&&(p=D)}catch{}}}return p!=null&&Number.isFinite(p)&&p>0?(a.set(l,p),p):(a.set(l,null),null)},y=(l,b)=>{let p=i.get(l);if(p!==void 0)return p??b;if(d.has(l))return b;d.add(l);try{let R=mt(l.getAttribute("data-start"));if(!R)return i.set(l,b),b;if(R.kind==="absolute"){let Z=Math.max(0,R.value);return i.set(l,Z),Z}let P=g(R.refId);if(!P)return i.set(l,b),b;let H=y(P,0),D=S(P);if(D==null||D<=0){let Z=Math.max(0,H+R.offset);return i.set(l,Z),Z}let Q=Math.max(0,H+D+R.offset);return i.set(l,Q),Q}finally{d.delete(l)}};return{resolveStartForElement:(l,b=0)=>y(l,Math.max(0,b)),resolveDurationForElement:l=>S(l)}}function ne(e){let n=Number(e);return Number.isFinite(n)?n:null}function Se(e){let n=String(e??"").trim();if(!n)return null;let i=n.toLowerCase();if(i.startsWith("data:")||i.startsWith("javascript:"))return null;try{return new URL(n,document.baseURI).toString()}catch{return n}}function ft(e){let n=e.getAttribute("src")??e.getAttribute("data-src");if(n)return Se(n);let i=e.getAttribute("data-composition-src");if(i)return Se(i);let a=e.querySelector("img[src], video[src], audio[src], source[src]");return a?Se(a.getAttribute("src")):null}function nt(e){let i=window.__timelines??{},a=pe({timelineRegistry:i}),d=T=>{if(!T)return null;let m=i[T]??null;if(!m||typeof m.duration!="function")return null;try{let x=Number(m.duration());return Number.isFinite(x)&&x>0?x:null}catch{return null}},g=T=>{let m=ne(T.getAttribute("data-duration"));if(m!=null&&m>0)return m;let x=ne(T.getAttribute("data-playback-start"))??ne(T.getAttribute("data-media-start"))??0;return Number.isFinite(T.duration)&&T.duration>x?Math.max(0,T.duration-x):null},S=()=>{let T=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(T.length===0)return null;let m=0;for(let x of T){let O=a.resolveStartForElement(x,0);if(!Number.isFinite(O))continue;let F=g(x);F==null||F<=0||(m=Math.max(m,Math.max(0,O)+F))}return m>0?m:null},y=T=>{let m=T.trim().toLowerCase();return!(!m||m==="main"||m.includes("caption")||m.includes("ambient"))},l=(T,m)=>{let x=[],O=null,F=null,_=null,K=T.parentElement;for(;K;){let Y=K.getAttribute("data-composition-id");Y&&(x.push(Y),!_&&K!==m&&(_=Y),O==null&&(O=a.resolveStartForElement(K,0)),F==null&&(F=ne(K.getAttribute("data-duration"))??null)),K=K.parentElement}return{parentCompositionId:_,compositionAncestors:x.reverse(),inheritedStart:O,inheritedDuration:F}},b=document.querySelector("[data-composition-id]"),p=b?.getAttribute("data-composition-id")??null,R=b?a.resolveStartForElement(b,0):0,P=S(),H=P!=null?Math.max(0,P-Math.max(0,R)):null,D=d(p),Q=ne(b?.getAttribute("data-duration")),Z=typeof D=="number"&&Number.isFinite(D)&&D>0?D:null,ae=typeof Q=="number"&&Number.isFinite(Q)&&Q>0?Q:null,oe=typeof H=="number"&&Number.isFinite(H)&&H>0?H:null,ie=Z!=null&&oe!=null&&Z>oe+1,se=ae??(ie?oe:Z??oe),u=se!=null?Math.min(se,e.maxTimelineDurationSeconds):null,h=(u!=null?R+u:null)??(typeof P=="number"&&Number.isFinite(P)&&P>0?P:null),C=(T,m)=>!Number.isFinite(m)||m<=0?0:h==null||!Number.isFinite(h)?m:!Number.isFinite(T)||T>=h?0:Math.max(0,Math.min(m,h-T)),v=Array.from(document.querySelectorAll("[data-composition-id]")),k=[],z=[],W=Array.from(document.querySelectorAll("*")),I=0;for(let T=0;T<W.length;T+=1){let m=W[T];if(m===b||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(m.tagName))continue;let x=l(m,b),O=a.resolveStartForElement(m,x.inheritedStart??0),F=m.getAttribute("data-composition-id"),_=ne(m.getAttribute("data-duration"));if((_==null||_<=0)&&F&&F!==p&&(_=d(F)),(_==null||_<=0)&&m instanceof HTMLMediaElement){let le=ne(m.getAttribute("data-playback-start"))??ne(m.getAttribute("data-media-start"))??0;Number.isFinite(m.duration)&&m.duration>0&&(_=Math.max(0,m.duration-le))}if(_==null||_<=0){let le=x.inheritedDuration;if(le!=null&&le>0){let Ae=(x.inheritedStart??0)+le;_=Math.max(0,Ae-O)}}if(_==null||_<=0||(_=C(O,_),_<=0))continue;let K=O+_;I=Math.max(I,K);let Y=m.tagName.toLowerCase(),Te=F&&F!==p?"composition":Y==="video"?"video":Y==="audio"?"audio":Y==="img"?"image":"element";k.push({id:m.id||`__node__index_${T}`,label:m.getAttribute("data-timeline-label")??m.getAttribute("data-label")??m.getAttribute("aria-label")??m.id??m.className?.split(" ")[0]??Te,start:O,duration:_,track:Number.parseInt(m.getAttribute("data-track-index")??m.getAttribute("data-track")??String(T),10)||0,kind:Te,tagName:Y,compositionId:m.getAttribute("data-composition-id"),compositionAncestors:x.compositionAncestors,parentCompositionId:x.parentCompositionId,nodePath:null,compositionSrc:Se(m.getAttribute("data-composition-src")),assetUrl:ft(m),timelineRole:m.getAttribute("data-timeline-role"),timelineLabel:m.getAttribute("data-timeline-label"),timelineGroup:m.getAttribute("data-timeline-group"),timelinePriority:ne(m.getAttribute("data-timeline-priority"))})}for(let T of v){if(T===b)continue;let m=T.getAttribute("data-composition-id");if(!m||!y(m))continue;let x=a.resolveStartForElement(T,0),O=ne(T.getAttribute("data-duration")),F=d(m),_=O&&O>0?O:F;if(_==null||_<=0)continue;let K=C(x,_);K<=0||z.push({id:m,label:T.getAttribute("data-label")??m,start:x,duration:K,thumbnailUrl:Se(T.getAttribute("data-thumbnail-url")),avatarName:null})}let G=Math.max(1,Math.min(I||1,e.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:ie&&ae==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(G*Math.max(1,e.canonicalFps))),clips:k,scenes:z,compositionWidth:ne(b?.getAttribute("data-width"))??1920,compositionHeight:ne(b?.getAttribute("data-height"))??1080}}var pt=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,gt=e=>new Promise(n=>{let i=!1,a=Date.now(),d=null,g=S=>{i||(i=!0,d!=null&&window.clearTimeout(d),n({status:S,elapsedMs:Math.max(0,Date.now()-a)}))};e.addEventListener("load",()=>g("load"),{once:!0}),e.addEventListener("error",()=>g("error"),{once:!0}),d=window.setTimeout(()=>g("timeout"),8e3)});function it(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function yt(e,n){let i=e.trim();if(!i)return e;try{return pt.test(i)?new URL(i,document.baseURI).toString():n?new URL(i,n).toString():new URL(i,document.baseURI).toString()}catch{return e}}async function ot(e){let n=null;e.hostCompositionId&&(n=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(l=>l.getAttribute("data-composition-id")===e.hostCompositionId)??null);let i=n??e.sourceNode,a=Array.from(i.querySelectorAll("style"));for(let y of a){let l=y.cloneNode(!0);l instanceof HTMLStyleElement&&(document.head.appendChild(l),e.injectedStyles.push(l))}let d=Array.from(i.querySelectorAll("script")),g=[];for(let y of d){let l=y.getAttribute("type")?.trim()??"",b=y.getAttribute("src")?.trim()??"";if(b){let p=yt(b,e.compositionUrl);g.push({kind:"external",src:p,type:l})}else{let p=y.textContent?.trim()??"";p&&g.push({kind:"inline",content:p,type:l})}y.parentNode?.removeChild(y)}let S=Array.from(i.querySelectorAll("style"));for(let y of S)y.parentNode?.removeChild(y);if(n){let y=document.importNode(n,!0),l=n.getAttribute("data-width"),b=n.getAttribute("data-height"),p=e.parseDimensionPx(l),R=e.parseDimensionPx(b);y.style.position="relative",y.style.width=p||"100%",y.style.height=R||"100%",p&&y.style.setProperty("--comp-width",p),R&&y.style.setProperty("--comp-height",R),l&&e.host.setAttribute("data-width",l),b&&e.host.setAttribute("data-height",b),p&&e.host instanceof HTMLElement&&(e.host.style.width=p),R&&e.host instanceof HTMLElement&&(e.host.style.height=R),e.host.appendChild(y)}else e.hasTemplate?e.host.appendChild(document.importNode(i,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;for(let y of g){let l=document.createElement("script");if(y.type&&(l.type=y.type),l.async=!1,y.kind==="external"?l.src=y.src:y.type.toLowerCase()==="module"?l.textContent=y.content:l.textContent=`(function(){${y.content}})();`,document.body.appendChild(l),e.injectedScripts.push(l),y.kind==="external"){let b=await gt(l);b.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.hostCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:y.src,loadStatus:b.status,elapsedMs:b.elapsedMs}})}}}async function rt(e){let n=Array.from(document.querySelectorAll("[data-composition-src]"));n.length!==0&&await Promise.all(n.map(async i=>{let a=i.getAttribute("data-composition-src");if(!a)return;let d=null;try{d=new URL(a,document.baseURI)}catch{d=null}it(i);try{let g=i.getAttribute("data-composition-id"),S=g!=null?document.querySelector(`template#${CSS.escape(g)}-template`):null;if(S){await ot({host:i,hostCompositionId:g,hostCompositionSrc:a,sourceNode:S.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let y=await fetch(a);if(!y.ok)throw new Error(`HTTP ${y.status}`);let l=await y.text(),p=new DOMParser().parseFromString(l,"text/html"),R=(g?p.querySelector(`template#${CSS.escape(g)}-template`):null)??p.querySelector("template"),P=R?R.content:p.body;await ot({host:i,hostCompositionId:g,hostCompositionSrc:a,sourceNode:P,hasTemplate:!!R,fallbackBodyInnerHtml:p.body.innerHTML,compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}catch(g){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:i.getAttribute("data-composition-id"),hostCompositionSrc:a,errorMessage:g instanceof Error?g.message:"unknown_error"}}),it(i)}}))}function at(){let e=tt(),n=window,i=null,a=null,d=[],g=new Set,S=null;if(typeof n.__hfRuntimeTeardown=="function")try{n.__hfRuntimeTeardown()}catch{}window.__timelines=window.__timelines||{};let y=t=>{d.push(t)},l=(t,o,r)=>{let c=r??`${t}:${JSON.stringify(o)}`;g.has(c)||(g.add(c),X({source:"hf-preview",type:"diagnostic",code:t,details:o}))},b=t=>{let o={scale:1,focusX:960,focusY:540},r=[],c=[],s={time:t.getTime(),duration:t.getDuration(),isPlaying:t.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:t.play,pause:t.pause,seek:t.seek,getTime:t.getTime,getDuration:t.getDuration,isPlaying:t.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>o,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>r,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:t.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>c,getRenderState:()=>({...s,time:t.getTime(),duration:t.getDuration(),isPlaying:t.isPlaying()})}},p=1/60,R=.75,P=.75,H=.35,D=900,Q=3,Z=2,ae=.05,oe=100,ie=240,se=t=>{if(t instanceof Error)return t.message||String(t);if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t??"")}},u=t=>{let o=t.toLowerCase();return o.includes("cannot read properties of null")||o.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:o.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:o.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},f=t=>{if(t==null||t.trim()==="")return null;let o=Number.parseFloat(t);return!Number.isFinite(o)||o<=0?null:`${o}px`},h=()=>{let t=document.getElementById("main-comp");if(t instanceof HTMLElement&&t.hasAttribute("data-composition-id"))return t;let o=document.querySelector('[data-composition-id][data-root="true"]');if(o instanceof HTMLElement)return o;let r=Array.from(document.querySelectorAll("[data-composition-id]"));return r.length===0?null:r.find(c=>!c.parentElement?.closest("[data-composition-id]"))??r[0]},C=()=>{let t=h();if(!t)return;let o=f(t.getAttribute("data-width")),r=f(t.getAttribute("data-height"));o&&(t.style.width=o),r&&(t.style.height=r),o&&t.style.setProperty("--comp-width",o),r&&t.style.setProperty("--comp-height",r)},v=()=>{let t=h(),o=Array.from(document.querySelectorAll("[data-composition-id][data-duration]"));for(let r of o)t&&r===t||r.removeAttribute("data-duration")},k=()=>{let t=h();if(!t)return;t.style.position||(t.style.position="relative"),t.style.overflow="hidden";let o=f(t.getAttribute("data-width")),r=f(t.getAttribute("data-height"));o&&(t.style.width=o),r&&(t.style.height=r);let c=Array.from(t.children);for(let s of c){let L=s.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta"||!s.hasAttribute("data-start"))continue;let V=(s.style.top==="0px"||s.style.top==="0")&&(s.style.left==="0px"||s.style.left==="0")&&s.style.width==="100%"&&s.style.height==="100%",ue=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(s.style.transform);if(V&&ue&&!s.hasAttribute("data-width")&&!s.hasAttribute("data-height")){let te=s.style.top,A=s.style.left,E=s.style.width,M=s.style.height;s.style.top="",s.style.left="",s.style.width="",s.style.height="";let w=window.getComputedStyle(s);w.top!=="auto"||w.bottom!=="auto"||w.left!=="auto"||w.right!=="auto"||w.width!=="0px"||w.height!=="0px"||(s.style.top=te,s.style.left=A,s.style.width=E,s.style.height=M)}let j=window.getComputedStyle(s),N=j.position;if(N!=="absolute"&&N!=="fixed"&&(s.style.position="absolute"),!!s.style.top||!!s.style.bottom||j.top!=="auto"||j.bottom!=="auto"||(s.style.top="0"),!!s.style.left||!!s.style.right||j.left!=="auto"||j.right!=="auto"||(s.style.left="0"),L!=="audio"){let te=f(s.getAttribute("data-width")),A=f(s.getAttribute("data-height")),E=j.width!=="0px"&&j.width!=="auto",M=j.height!=="0px"&&j.height!=="auto";te?!s.style.width&&!E&&(s.style.width=te):!s.style.width&&j.width==="0px"&&(s.style.width="100%"),A?!s.style.height&&!M&&(s.style.height=A):!s.style.height&&j.height==="0px"&&(s.style.height="100%")}}},z=(t,o=0)=>pe({timelineRegistry:window.__timelines??{}}).resolveStartForElement(t,o),W=t=>pe({timelineRegistry:window.__timelines??{}}).resolveDurationForElement(t),I=!document.querySelector("[data-composition-src]"),G=t=>{if(!t||typeof t.duration!="function")return null;try{let o=Number(t.duration());return Number.isFinite(o)?Math.max(0,o):null}catch{return null}},U=t=>typeof t=="number"&&Number.isFinite(t)&&t>p,xe=t=>{let o=Number(t.getAttribute("data-duration"));if(Number.isFinite(o)&&o>0)return o;let r=Number(t.getAttribute("data-playback-start")??t.getAttribute("data-media-start")??"0"),c=Number.isFinite(r)?Math.max(0,r):0;return Number.isFinite(t.duration)&&t.duration>c?Math.max(0,t.duration-c):null},T=()=>{let t=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(t.length===0)return null;let o=0;for(let r of t){let c=z(r,0);if(!Number.isFinite(c))continue;let s=xe(r);s==null||s<=p||(o=Math.max(o,Math.max(0,c)+s))}return o>p?o:null},m=()=>{let t=T();return typeof t!="number"||!Number.isFinite(t)||t<=p?null:t},x=t=>U(t)?Math.max(p,t*R):p,O=(t,o=0)=>{let r=G(t),c=m(),s=Number.isFinite(o)&&o>p?o:0,L=0;U(r)?L=Math.max(r,s):U(c)?L=Math.max(c,s):L=s;let V=Math.max(1,Number(e.maxTimelineDurationSeconds)||1800);return L>0?Math.max(0,Math.min(L,V)):0},F=()=>{let t=window.__timelines??{},o=pe({timelineRegistry:t}),r=m(),c=x(r),s=A=>{let E=document.querySelector(`[data-composition-id="${CSS.escape(A)}"]`);return E?o.resolveStartForElement(E,0):0},L=A=>{let E=window.gsap;if(!E||typeof E.timeline!="function")return null;let M=E.timeline({paused:!0});for(let w of A)M.add(w.timeline,s(w.compositionId));return M},V=(A,E)=>{if(!U(A))return null;let M=window.gsap;if(!M||typeof M.timeline!="function")return null;let w=M.timeline({paused:!0});if(E)try{w.add(E,0)}catch{}let $=w;if(typeof $.to=="function")try{$.to({},{duration:A})}catch{}return w},ue=(A,E)=>{let M=A;if(typeof M.getChildren!="function")return[];try{let w=M.getChildren(!0,!0,!0)??[];if(!Array.isArray(w))return[];let $=[];for(let J of E)if(!w.some(ye=>ye===J.timeline))try{let ye=s(J.compositionId);A.add(J.timeline,ye),$.push(J.compositionId)}catch{}return $}catch{return[]}},j=h(),N=j?.getAttribute("data-composition-id")??null;if(!N)return{timeline:null};let ee=t[N]??null,B=(()=>{if(!j)return[];let A=new Set,E=Array.from(j.querySelectorAll("[data-composition-id]")),M=[];for(let w of E){let $=w.getAttribute("data-composition-id");if(!$||$===N||A.has($))continue;A.add($);let J=t[$]??null;if(!J||typeof J.play!="function"||typeof J.pause!="function")continue;let fe=G(J);M.push({compositionId:$,timeline:J,durationSeconds:fe??0})}return M})(),te=A=>{for(let E of A){let M=E.timeline;if(typeof M.paused=="function")try{M.paused(!1)}catch{}}};if(B.length>0&&te(B),ee){let A=B.length>0?ue(ee,B):[];if((B.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+N+"'])"))&&(K=!0),A.length>0)try{let M=ee.time();ee.seek(M,!1)}catch{}let E=G(ee);if(!U(E)&&B.length>0){let M=B.map(ye=>ye.compositionId),w=L(B),$=G(w);if(w&&U($))return{timeline:w,selectedTimelineIds:M,selectedDurationSeconds:$,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:N,rootDurationSeconds:E,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:c,selectedDurationSeconds:$,mediaDurationFloorSeconds:r,selectedTimelineIds:M,autoNestedChildren:A}}};let J=V(r??0,ee),fe=G(J);if(J&&U(fe))return{timeline:J,selectedTimelineIds:[N],selectedDurationSeconds:fe,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:N,rootDurationSeconds:E,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:r,selectedDurationSeconds:fe,selectedTimelineIds:[N],autoNestedChildren:A}}}}if(!U(E)&&B.length===0){let M=V(r??0,ee),w=G(M);if(M&&U(w))return{timeline:M,selectedTimelineIds:[N],selectedDurationSeconds:w,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:N,rootDurationSeconds:E,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:r,selectedDurationSeconds:w,selectedTimelineIds:[N]}}}}return{timeline:ee,selectedTimelineIds:[N],selectedDurationSeconds:E,mediaDurationFloorSeconds:r,diagnostics:A.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:N,selectedDurationSeconds:E,autoNestedChildren:A}}:void 0}}if(B.length>0){let A=B.map(w=>w.compositionId),E=L(B),M=G(E);if(E)return{timeline:E,selectedTimelineIds:A,selectedDurationSeconds:M,mediaDurationFloorSeconds:r,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:N,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:c,selectedDurationSeconds:M,mediaDurationFloorSeconds:r,selectedTimelineIds:A}}}}return{timeline:null}},_=()=>{let t=e.capturedTimeline;if(!t||typeof t.time!="function")return;let o=Number(t.time());Number.isFinite(o)&&(e.currentTime=Math.max(0,o))},K=!1,Y=()=>{if(!I)return!1;let t=e.capturedTimeline,o=G(t),r=U(o);if(t&&r&&K)return!1;let c=F();return c.timeline?t&&t===c.timeline?(typeof t.timeScale=="function"&&t.timeScale(e.playbackRate),!1):(e.capturedTimeline=c.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),c.diagnostics&&X({source:"hf-preview",type:"diagnostic",code:c.diagnostics.code,details:c.diagnostics.details}),X({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:c.selectedTimelineIds??[],selectedDurationSeconds:c.selectedDurationSeconds??null,mediaDurationFloorSeconds:c.mediaDurationFloorSeconds??null}}),!0):!1},Te=()=>{let t=h();if(!(t instanceof HTMLElement))return;let o=t.getBoundingClientRect(),r=Number(t.getAttribute("data-width")),c=Number(t.getAttribute("data-height")),s=window.getComputedStyle(t),L=Number.isFinite(r)&&r>0&&Number.isFinite(c)&&c>0,V=o.width<=0||o.height<=0||t.clientWidth<=0||t.clientHeight<=0;!L||!V||l("root_stage_layout_zero",{compositionId:t.getAttribute("data-composition-id")??null,declaredWidth:r,declaredHeight:c,rectWidth:Math.round(o.width),rectHeight:Math.round(o.height),clientWidth:t.clientWidth,clientHeight:t.clientHeight,display:s.display,visibility:s.visibility,overflow:s.overflow},`root-stage-layout-zero:${t.getAttribute("data-composition-id")??"unknown"}`)},le=()=>{e.tornDown||(S!=null&&window.cancelAnimationFrame(S),S=window.requestAnimationFrame(()=>{S=null,Te()}))},Ne=()=>{i=t=>{let o=se(t.error??t.message).slice(0,ie);if(!o)return;let r=u(o);X({source:"hf-preview",type:"diagnostic",code:r.code,details:{category:r.category,message:o,filename:t.filename||null,line:Number.isFinite(t.lineno)?t.lineno:null,column:Number.isFinite(t.colno)?t.colno:null}})},a=t=>{let o=se(t.reason).slice(0,ie);if(!o)return;let r=u(o);X({source:"hf-preview",type:"diagnostic",code:`${r.code}_unhandled_rejection`,details:{category:`${r.category}-unhandled-rejection`,message:o}})},window.addEventListener("error",i),window.addEventListener("unhandledrejection",a)},Ae=()=>{let t=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let r of t){let c=()=>{if(!(r instanceof Element))return;let s=r.tagName.toLowerCase(),L=r.getAttribute("src")??r.getAttribute("href")??r.getAttribute("poster")??null,V=s==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";l(V,{tagName:s,assetUrl:L,currentSrc:(r instanceof HTMLImageElement||r instanceof HTMLMediaElement)&&r.currentSrc||null,readyState:r instanceof HTMLMediaElement?r.readyState:null,networkState:r instanceof HTMLMediaElement?r.networkState:null},`${V}:${s}:${L??"unknown"}`)};r.addEventListener("error",c),y(()=>{r.removeEventListener("error",c)})}let o=document.fonts;o&&o.ready.then(()=>{if(e.tornDown)return;let r=Array.from(o).filter(c=>c.status==="error").map(c=>c.family).filter(c=>!!c).slice(0,10);r.length!==0&&l("runtime_font_load_issue",{failedFamilies:r,totalFaces:Array.from(o).length},`runtime-font-load-issue:${r.join("|")}`)}).catch(()=>{})},Fe=(t,o)=>{if(!t.timeline)return!1;let r=e.capturedTimeline;if(r&&r===t.timeline)return!1;let c=Math.max(0,e.currentTime||0),s=e.isPlaying;e.capturedTimeline=t.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{e.capturedTimeline.pause(),e.capturedTimeline.seek(c,!1),s&&e.capturedTimeline.play()}catch{}return X({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:o,previousTime:c,selectedTimelineIds:t.selectedTimelineIds??[],selectedDurationSeconds:t.selectedDurationSeconds??null,mediaDurationFloorSeconds:t.mediaDurationFloorSeconds??null}}),!0},ce=null,He=!1,Ee=new Set,Me=()=>{e.tornDown||(ce!=null&&window.clearTimeout(ce),ce=window.setTimeout(()=>{if(e.tornDown)return;ce=null;let t=F();if(!t.timeline||!U(t.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Y()&&(de(),re(!0));return}if(He)return;let r=G(e.capturedTimeline),c=t.selectedDurationSeconds??G(t.timeline);U(c)&&(!U(r)||c>=r+ae)&&Fe(t,"manual")&&(He=!0,X({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:r??null,selectedDurationSeconds:c??null,selectedTimelineIds:t.selectedTimelineIds??[],mediaDurationFloorSeconds:t.mediaDurationFloorSeconds??null}}),de(),re(!0))},oe))},lt=()=>{for(let t of Ee)t.removeEventListener("loadedmetadata",Me),t.removeEventListener("durationchange",Me);Ee.clear()},we=()=>{if(e.tornDown)return;let t=Array.from(document.querySelectorAll("video, audio"));for(let o of t)Ee.has(o)||(Ee.add(o),o.addEventListener("loadedmetadata",Me),o.addEventListener("durationchange",Me))},We=()=>{let t=Ze({resolveStartSeconds:c=>z(c,0)});Ye({clips:t.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate});let o=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,r=Array.from(document.querySelectorAll("[data-start]"));for(let c of r){if(!(c instanceof HTMLElement))continue;let s=c.tagName.toLowerCase();if(s==="script"||s==="style"||s==="link"||s==="meta")continue;if(!c.getAttribute("data-composition-id")){let te=c.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(te&&te!==o)continue}let V=z(c,0),ue=W(c),j=ue!=null&&ue>0?V+ue:Number.POSITIVE_INFINITY,N=j,ee=c.getAttribute("data-composition-id");if(ee&&!Number.isFinite(j)){let B=(window.__timelines??{})[ee];if(B&&typeof B.duration=="function"){let te=B.duration();te>0&&(N=V+te)}}let Le=e.currentTime>=V&&(Number.isFinite(N)?e.currentTime<N:!0);c.style.visibility=Le?"visible":"hidden"}},re=t=>{_();let o=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),r=Date.now();(t||o!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||r-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=o,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=r,X({source:"hf-preview",type:"state",frame:o,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},de=()=>{v(),C(),k();let t=h();if(t){let r=f(t.getAttribute("data-width")),c=f(t.getAttribute("data-height")),s=r?parseInt(r,10):0,L=c?parseInt(c,10):0;s>0&&L>0&&X({source:"hf-preview",type:"stage-size",width:s,height:L})}Y();let o=nt({canonicalFps:e.canonicalFps,maxTimelineDurationSeconds:e.maxTimelineDurationSeconds});window.__clipManifest=o,X(o),le()},ge=(t,o=0)=>{for(let r of e.deterministicAdapters){try{t==="discover"&&r.discover(),t==="pause"&&r.pause(),t==="play"&&r.play&&r.play()}catch{}if(t==="discover")try{r.seek({time:o})}catch{}}};I||rt({injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,parseDimensionPx:f,onDiagnostic:({code:t,details:o})=>{X({source:"hf-preview",type:"diagnostic",code:t,details:o})}}).finally(()=>{I=!0,ge("discover",e.currentTime),we(),Ae(),de(),re(!0)});let Re=Je({postMessage:t=>X(t)});Re.installPickerApi();let Oe=t=>{let o=Number(t);!Number.isFinite(o)||o<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,o)),e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let r=document.querySelectorAll("video, audio");for(let c of r)if(c instanceof HTMLMediaElement)try{c.playbackRate=e.playbackRate}catch{}},q=et({getTimeline:()=>e.capturedTimeline,setTimeline:t=>{e.capturedTimeline=t},getIsPlaying:()=>e.isPlaying,setIsPlaying:t=>{e.isPlaying=t},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:Oe,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(t,o)=>{e.currentTime=Math.max(0,Number(t)||0),e.isPlaying=o,We()},onStatePost:re,onDeterministicSeek:t=>{for(let o of e.deterministicAdapters)try{o.seek({time:Number(t)||0})}catch{}},onDeterministicPause:()=>ge("pause"),onDeterministicPlay:()=>ge("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>O(e.capturedTimeline,0)});window.__player=b(q),window.__playerReady=!0,window.__renderReady=!0,qe(X),be("composition_loaded",{duration:q.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=Ue({onPlay:()=>{q.play(),be("composition_played",{time:q.getTime()})},onPause:()=>{q.pause(),be("composition_paused",{time:q.getTime()})},onSeek:(t,o)=>{let r=Math.max(0,t)/e.canonicalFps;q.seek(r),be("composition_seeked",{time:r})},onSetMuted:t=>{e.bridgeMuted=t;let o=document.querySelectorAll("video, audio");for(let r of o)r instanceof HTMLMediaElement&&(r.muted=t)},onSetPlaybackRate:t=>Oe(t),onEnablePickMode:()=>Re.enablePickMode(),onDisablePickMode:()=>Re.disablePickMode()}),Y(),e.capturedTimeline&&(q._timeline=e.capturedTimeline),I&&setTimeout(()=>{let t=e.capturedTimeline;Y()&&e.capturedTimeline!==t&&(q._timeline=e.capturedTimeline),ge("discover",e.currentTime),de(),re(!0)},0),e.deterministicAdapters=[Ve({resolveStartSeconds:t=>z(t,0)}),Ke(),$e({getTimeline:()=>e.capturedTimeline}),Ge(),ze()],Ne(),ge("discover"),we(),e.timelinePollIntervalId&&clearInterval(e.timelinePollIntervalId);let ke=0,ve=null,je=0,_e=!1,me=0,Be=()=>{je=Date.now(),_e=!1,me=0};e.timelinePollIntervalId=setInterval(()=>{ke+=1;let o=e.isPlaying&&e.capturedTimeline!=null&&Math.max(0,e.currentTime||0)<Z?!1:Y();if(e.capturedTimeline&&!q._timeline&&(q._timeline=e.capturedTimeline),(o||ke%20===0)&&de(),ke%10===0&&we(),_(),e.isPlaying&&e.capturedTimeline){let r=Math.max(0,e.currentTime||0),c=ve,s=O(e.capturedTimeline,0);if(s>0&&r>=s){q.pause(),q.seek(s),ve=s,me=0,re(!0);return}if(c!=null&&c>=P&&r<=H?me+=1:me=0,!_e&&me>=Q&&Date.now()-je>D){let V=F();Fe(V,"loop_guard")&&(_e=!0,me=0)}ve=Math.max(0,e.currentTime||0)}else ve=Math.max(0,e.currentTime||0);e.isPlaying&&We(),re(!1)},50),de(),re(!0);let ct=q.seek;q.seek=t=>{Be(),ct(t)};let ut=q.renderSeek;q.renderSeek=t=>{Be(),ut(t)};let Pe=()=>{if(!e.tornDown){e.tornDown=!0,e.timelinePollIntervalId&&(clearInterval(e.timelinePollIntervalId),e.timelinePollIntervalId=null),ce!=null&&(window.clearTimeout(ce),ce=null),S!=null&&(window.cancelAnimationFrame(S),S=null),lt(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),i&&(window.removeEventListener("error",i),i=null),a&&(window.removeEventListener("unhandledrejection",a),a=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Re.disablePickMode();for(let t of e.deterministicAdapters)if(!(!t||typeof t.revert!="function"))try{t.revert()}catch{}e.deterministicAdapters=[];for(let t of d.splice(0))try{t()}catch{}for(let t of e.injectedCompStyles)try{t.remove()}catch{}e.injectedCompStyles=[];for(let t of e.injectedCompScripts)try{t.remove()}catch{}e.injectedCompScripts=[],e.capturedTimeline=null,n.__hfRuntimeTeardown===Pe&&(n.__hfRuntimeTeardown=null)}};n.__hfRuntimeTeardown=Pe,e.beforeUnloadHandler=Pe,window.addEventListener("beforeunload",e.beforeUnloadHandler)}window.__timelines=window.__timelines||{};function st(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,at())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",st,{once:!0}):st();
13
+
@@ -0,0 +1,23 @@
1
+ export type { ExecutionMode, Orientation, Asset, TimelineElement, TimelineElementBase, TimelineMediaElement, TimelineTextElement, TimelineCompositionElement, TimelineElementType, MediaElementType, CanvasResolution, MediaFile, CompositionAPI, PlayerAPI, AddElementData, ValidationResult, CompositionAsset, Keyframe, KeyframeProperties, ElementKeyframes, StageZoom, StageZoomKeyframe, CompositionVariableType, CompositionVariableBase, StringVariable, NumberVariable, ColorVariable, BooleanVariable, EnumVariable, CompositionVariable, CompositionSpec, WaveformData, } from "./core.types";
2
+ export { CANVAS_DIMENSIONS, TIMELINE_COLORS, DEFAULT_DURATIONS, isTextElement, isMediaElement, isCompositionElement, getDefaultStageZoom, isStringVariable, isNumberVariable, isColorVariable, isBooleanVariable, isEnumVariable, } from "./core.types";
3
+ export { generateBaseHtml, getStageStyles } from "./templates/base";
4
+ export { GSAP_CDN, BASE_STYLES, ELEMENT_BASE_STYLES, MEDIA_STYLES, TEXT_STYLES, ZOOM_CONTAINER_STYLES, } from "./templates/constants";
5
+ export type { GsapAnimation, GsapMethod, ParsedGsap } from "./parsers/gsapParser";
6
+ export { parseGsapScript, serializeGsapAnimations, updateAnimationInScript, addAnimationToScript, removeAnimationFromScript, getAnimationsForElement, validateCompositionGsap, keyframesToGsapAnimations, gsapAnimationsToKeyframes, SUPPORTED_PROPS, SUPPORTED_EASES, } from "./parsers/gsapParser";
7
+ export type { ParsedHtml, CompositionMetadata } from "./parsers/htmlParser";
8
+ export { parseHtml, updateElementInHtml, addElementToHtml, removeElementFromHtml, validateCompositionHtml, extractCompositionMetadata, } from "./parsers/htmlParser";
9
+ export type { SerializeOptions } from "./generators/hyperframes";
10
+ export { generateHyperframesHtml, generateGsapTimelineScript, generateHyperframesStyles, } from "./generators/hyperframes";
11
+ export type { UnresolvedElement, ResolvedDuration, ResolvedMediaElement, CompilationResult } from "./compiler/timingCompiler";
12
+ export { compileTimingAttrs, injectDurations, extractResolvedMedia, clampDurations } from "./compiler/timingCompiler";
13
+ export type { HyperframeLintSeverity, HyperframeLintFinding, HyperframeLintResult, HyperframeLinterOptions, } from "./lint/types";
14
+ export { lintHyperframeHtml } from "./lint/hyperframeLinter";
15
+ export { HYPERFRAME_RUNTIME_ARTIFACTS, HYPERFRAME_RUNTIME_CONTRACT, loadHyperframeRuntimeSource, type HyperframeRuntimeContract, } from "./inline-scripts/hyperframe";
16
+ export { HYPERFRAME_RUNTIME_GLOBALS, HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_CONTROL_ACTIONS, type HyperframeControlAction, } from "./inline-scripts/runtimeContract";
17
+ export { buildHyperframesRuntimeScript, type HyperframesRuntimeBuildOptions, } from "./inline-scripts/hyperframesRuntime.engine";
18
+ export { MEDIA_VISUAL_STYLE_PROPERTIES, copyMediaVisualStyles, quantizeTimeToFrame, type MediaVisualStyleProperty, } from "./inline-scripts/parityContract";
19
+ export type { HyperframePickerApi, HyperframePickerBoundingBox, HyperframePickerElementInfo, } from "./inline-scripts/pickerApi";
20
+ export type { FrameAdapter, FrameAdapterContext } from "./adapters/types";
21
+ export type { GSAPTimelineLike, CreateGSAPFrameAdapterOptions } from "./adapters/gsap";
22
+ export { createGSAPFrameAdapter } from "./adapters/gsap";
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,aAAa,EACb,WAAW,EACX,KAAK,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElF,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,eAAe,EACf,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAGlC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9H,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGtH,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,KAAK,uBAAuB,GAC7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,GACpC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,YAAY,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ export { CANVAS_DIMENSIONS, TIMELINE_COLORS, DEFAULT_DURATIONS, isTextElement, isMediaElement, isCompositionElement, getDefaultStageZoom, isStringVariable, isNumberVariable, isColorVariable, isBooleanVariable, isEnumVariable, } from "./core.types";
2
+ // Templates
3
+ export { generateBaseHtml, getStageStyles } from "./templates/base";
4
+ export { GSAP_CDN, BASE_STYLES, ELEMENT_BASE_STYLES, MEDIA_STYLES, TEXT_STYLES, ZOOM_CONTAINER_STYLES, } from "./templates/constants";
5
+ export { parseGsapScript, serializeGsapAnimations, updateAnimationInScript, addAnimationToScript, removeAnimationFromScript, getAnimationsForElement, validateCompositionGsap, keyframesToGsapAnimations, gsapAnimationsToKeyframes, SUPPORTED_PROPS, SUPPORTED_EASES, } from "./parsers/gsapParser";
6
+ export { parseHtml, updateElementInHtml, addElementToHtml, removeElementFromHtml, validateCompositionHtml, extractCompositionMetadata, } from "./parsers/htmlParser";
7
+ export { generateHyperframesHtml, generateGsapTimelineScript, generateHyperframesStyles, } from "./generators/hyperframes";
8
+ export { compileTimingAttrs, injectDurations, extractResolvedMedia, clampDurations } from "./compiler/timingCompiler";
9
+ export { lintHyperframeHtml } from "./lint/hyperframeLinter";
10
+ // Inline scripts
11
+ export { HYPERFRAME_RUNTIME_ARTIFACTS, HYPERFRAME_RUNTIME_CONTRACT, loadHyperframeRuntimeSource, } from "./inline-scripts/hyperframe";
12
+ export { HYPERFRAME_RUNTIME_GLOBALS, HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_CONTROL_ACTIONS, } from "./inline-scripts/runtimeContract";
13
+ export { buildHyperframesRuntimeScript, } from "./inline-scripts/hyperframesRuntime.engine";
14
+ export { MEDIA_VISUAL_STYLE_PROPERTIES, copyMediaVisualStyles, quantizeTimeToFrame, } from "./inline-scripts/parityContract";
15
+ export { createGSAPFrameAdapter } from "./adapters/gsap";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoCA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY;AACZ,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,eAAe,EACf,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAKlC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAStH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,iBAAiB;AACjB,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,2BAA2B,GAE5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,GAE3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,6BAA6B,GAE9B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,iCAAiC,CAAC;AAUzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_RUNTIME_GLOBALS } from "./runtimeContract";
2
+ export declare const HYPERFRAME_RUNTIME_ARTIFACTS: {
3
+ readonly iife: "hyperframe.runtime.iife.js";
4
+ readonly esm: "hyperframe.runtime.mjs";
5
+ readonly manifest: "hyperframe.manifest.json";
6
+ };
7
+ export type HyperframeRuntimeContract = {
8
+ globals: typeof HYPERFRAME_RUNTIME_GLOBALS;
9
+ messageSources: typeof HYPERFRAME_BRIDGE_SOURCES;
10
+ };
11
+ export declare const HYPERFRAME_RUNTIME_CONTRACT: HyperframeRuntimeContract;
12
+ export declare function loadHyperframeRuntimeSource(): string;
13
+ //# sourceMappingURL=hyperframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperframe.d.ts","sourceRoot":"","sources":["../../src/inline-scripts/hyperframe.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE1F,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,OAAO,0BAA0B,CAAC;IAC3C,cAAc,EAAE,OAAO,yBAAyB,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,yBAGzC,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD"}
@@ -0,0 +1,15 @@
1
+ import { buildHyperframesRuntimeScript } from "./hyperframesRuntime.engine";
2
+ import { HYPERFRAME_BRIDGE_SOURCES, HYPERFRAME_RUNTIME_GLOBALS } from "./runtimeContract";
3
+ export const HYPERFRAME_RUNTIME_ARTIFACTS = {
4
+ iife: "hyperframe.runtime.iife.js",
5
+ esm: "hyperframe.runtime.mjs",
6
+ manifest: "hyperframe.manifest.json",
7
+ };
8
+ export const HYPERFRAME_RUNTIME_CONTRACT = {
9
+ globals: HYPERFRAME_RUNTIME_GLOBALS,
10
+ messageSources: HYPERFRAME_BRIDGE_SOURCES,
11
+ };
12
+ export function loadHyperframeRuntimeSource() {
13
+ return buildHyperframesRuntimeScript();
14
+ }
15
+ //# sourceMappingURL=hyperframe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperframe.js","sourceRoot":"","sources":["../../src/inline-scripts/hyperframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE1F,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,4BAA4B;IAClC,GAAG,EAAE,wBAAwB;IAC7B,QAAQ,EAAE,0BAA0B;CAC5B,CAAC;AAOX,MAAM,CAAC,MAAM,2BAA2B,GAA8B;IACpE,OAAO,EAAE,0BAA0B;IACnC,cAAc,EAAE,yBAAyB;CAC1C,CAAC;AAEF,MAAM,UAAU,2BAA2B;IACzC,OAAO,6BAA6B,EAAE,CAAC;AACzC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type HyperframesRuntimeBuildOptions = {
2
+ sourceUrl?: string;
3
+ defaultParityMode?: boolean;
4
+ minify?: boolean;
5
+ };
6
+ export declare function buildHyperframesRuntimeScript(options?: HyperframesRuntimeBuildOptions): string;
7
+ //# sourceMappingURL=hyperframesRuntime.engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperframesRuntime.engine.d.ts","sourceRoot":"","sources":["../../src/inline-scripts/hyperframesRuntime.engine.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAQF,wBAAgB,6BAA6B,CAAC,OAAO,GAAE,8BAAmC,GAAG,MAAM,CAoBlG"}
@@ -0,0 +1,31 @@
1
+ import { buildSync } from "esbuild";
2
+ import { dirname, resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ function applyDefaultParityMode(script, enabled) {
5
+ const parityFlagPattern = /var\s+_parityModeEnabled\s*=\s*(?:true|false)\s*;/;
6
+ if (!parityFlagPattern.test(script))
7
+ return script;
8
+ return script.replace(parityFlagPattern, `var _parityModeEnabled = ${enabled ? "true" : "false"};`);
9
+ }
10
+ export function buildHyperframesRuntimeScript(options = {}) {
11
+ const entryPath = resolve(dirname(fileURLToPath(import.meta.url)), "../runtime/entry.ts");
12
+ const result = buildSync({
13
+ entryPoints: [entryPath],
14
+ bundle: true,
15
+ write: false,
16
+ platform: "browser",
17
+ format: "iife",
18
+ target: ["es2020"],
19
+ minify: options.minify ?? true,
20
+ legalComments: "none",
21
+ });
22
+ let script = result.outputFiles[0]?.text ?? "";
23
+ if (typeof options.defaultParityMode === "boolean") {
24
+ script = applyDefaultParityMode(script, options.defaultParityMode);
25
+ }
26
+ if (options.sourceUrl && options.sourceUrl.trim()) {
27
+ script = `${script}\n//# sourceURL=${options.sourceUrl.trim()}`;
28
+ }
29
+ return script;
30
+ }
31
+ //# sourceMappingURL=hyperframesRuntime.engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperframesRuntime.engine.js","sourceRoot":"","sources":["../../src/inline-scripts/hyperframesRuntime.engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQzC,SAAS,sBAAsB,CAAC,MAAc,EAAE,OAAgB;IAC9D,MAAM,iBAAiB,GAAG,mDAAmD,CAAC;IAC9E,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACnD,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,4BAA4B,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;AACtG,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,UAA0C,EAAE;IACxF,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;IAC1F,MAAM,MAAM,GAAG,SAAS,CAAC;QACvB,WAAW,EAAE,CAAC,SAAS,CAAC;QACxB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI;QAC9B,aAAa,EAAE,MAAM;KACtB,CAAC,CAAC;IACH,IAAI,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;IAC/C,IAAI,OAAO,OAAO,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QACnD,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;QAClD,MAAM,GAAG,GAAG,MAAM,mBAAmB,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;IAClE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const MEDIA_VISUAL_STYLE_PROPERTIES: readonly ["width", "height", "top", "left", "right", "bottom", "inset", "object-fit", "object-position", "z-index", "opacity", "visibility", "filter", "mix-blend-mode", "backdrop-filter", "border-radius", "overflow", "clip-path", "mask", "mask-image", "mask-size", "mask-position", "mask-repeat", "transform", "transform-origin", "box-sizing"];
2
+ export type MediaVisualStyleProperty = (typeof MEDIA_VISUAL_STYLE_PROPERTIES)[number];
3
+ export declare function quantizeTimeToFrame(timeSeconds: number, fps: number): number;
4
+ export declare function copyMediaVisualStyles(targetStyle: CSSStyleDeclaration, sourceStyle: CSSStyleDeclaration, properties?: readonly string[]): void;
5
+ //# sourceMappingURL=parityContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parityContract.d.ts","sourceRoot":"","sources":["../../src/inline-scripts/parityContract.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,yVA2BhC,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtF,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAK5E;AAED,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,mBAAmB,EAChC,WAAW,EAAE,mBAAmB,EAChC,UAAU,GAAE,SAAS,MAAM,EAAkC,GAC5D,IAAI,CAON"}
@@ -0,0 +1,43 @@
1
+ export const MEDIA_VISUAL_STYLE_PROPERTIES = [
2
+ "width",
3
+ "height",
4
+ "top",
5
+ "left",
6
+ "right",
7
+ "bottom",
8
+ "inset",
9
+ "object-fit",
10
+ "object-position",
11
+ "z-index",
12
+ "opacity",
13
+ "visibility",
14
+ "filter",
15
+ "mix-blend-mode",
16
+ "backdrop-filter",
17
+ "border-radius",
18
+ "overflow",
19
+ "clip-path",
20
+ "mask",
21
+ "mask-image",
22
+ "mask-size",
23
+ "mask-position",
24
+ "mask-repeat",
25
+ "transform",
26
+ "transform-origin",
27
+ "box-sizing",
28
+ ];
29
+ export function quantizeTimeToFrame(timeSeconds, fps) {
30
+ const safeFps = Number.isFinite(fps) && fps > 0 ? fps : 30;
31
+ const safeTime = Number.isFinite(timeSeconds) && timeSeconds > 0 ? timeSeconds : 0;
32
+ const frameIndex = Math.floor(safeTime * safeFps + 1e-9);
33
+ return frameIndex / safeFps;
34
+ }
35
+ export function copyMediaVisualStyles(targetStyle, sourceStyle, properties = MEDIA_VISUAL_STYLE_PROPERTIES) {
36
+ for (const property of properties) {
37
+ const value = sourceStyle.getPropertyValue(property);
38
+ if (value) {
39
+ targetStyle.setProperty(property, value);
40
+ }
41
+ }
42
+ }
43
+ //# sourceMappingURL=parityContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parityContract.js","sourceRoot":"","sources":["../../src/inline-scripts/parityContract.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,iBAAiB;IACjB,SAAS;IACT,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,UAAU;IACV,WAAW;IACX,MAAM;IACN,YAAY;IACZ,WAAW;IACX,eAAe;IACf,aAAa;IACb,WAAW;IACX,kBAAkB;IAClB,YAAY;CACJ,CAAC;AAIX,MAAM,UAAU,mBAAmB,CAAC,WAAmB,EAAE,GAAW;IAClE,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;IACzD,OAAO,UAAU,GAAG,OAAO,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,WAAgC,EAChC,WAAgC,EAChC,aAAgC,6BAA6B;IAE7D,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,WAAW,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,KAAK,EAAE,CAAC;YACV,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ export type HyperframePickerBoundingBox = {
2
+ x: number;
3
+ y: number;
4
+ width: number;
5
+ height: number;
6
+ };
7
+ export type HyperframePickerElementInfo = {
8
+ id: string | null;
9
+ tagName: string;
10
+ selector: string;
11
+ label: string;
12
+ boundingBox: HyperframePickerBoundingBox;
13
+ textContent: string | null;
14
+ src: string | null;
15
+ dataAttributes: Record<string, string>;
16
+ };
17
+ export type HyperframePickerApi = {
18
+ enable: () => void;
19
+ disable: () => void;
20
+ isActive: () => boolean;
21
+ getHovered: () => HyperframePickerElementInfo | null;
22
+ getSelected: () => HyperframePickerElementInfo | null;
23
+ getCandidatesAtPoint: (clientX: number, clientY: number, limit?: number) => HyperframePickerElementInfo[];
24
+ pickAtPoint: (clientX: number, clientY: number, index?: number) => HyperframePickerElementInfo | null;
25
+ pickManyAtPoint: (clientX: number, clientY: number, indexes?: number[]) => HyperframePickerElementInfo[];
26
+ };
27
+ declare global {
28
+ interface Window {
29
+ __HF_PICKER_API?: HyperframePickerApi;
30
+ }
31
+ }
32
+ //# sourceMappingURL=pickerApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickerApi.d.ts","sourceRoot":"","sources":["../../src/inline-scripts/pickerApi.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,2BAA2B,GAAG;IACxC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,2BAA2B,CAAC;IACzC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,2BAA2B,GAAG,IAAI,CAAC;IACrD,WAAW,EAAE,MAAM,2BAA2B,GAAG,IAAI,CAAC;IACtD,oBAAoB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,2BAA2B,EAAE,CAAC;IAC1G,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,2BAA2B,GAAG,IAAI,CAAC;IACtG,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,2BAA2B,EAAE,CAAC;CAC1G,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,eAAe,CAAC,EAAE,mBAAmB,CAAC;KACvC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pickerApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickerApi.js","sourceRoot":"","sources":["../../src/inline-scripts/pickerApi.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ export declare const HYPERFRAME_RUNTIME_GLOBALS: {
2
+ readonly player: "__player";
3
+ readonly playerReady: "__playerReady";
4
+ readonly renderReady: "__renderReady";
5
+ readonly timelines: "__timelines";
6
+ readonly clipManifest: "__clipManifest";
7
+ };
8
+ export declare const HYPERFRAME_BRIDGE_SOURCES: {
9
+ readonly parent: "hf-parent";
10
+ readonly preview: "hf-preview";
11
+ };
12
+ export declare const HYPERFRAME_CONTROL_ACTIONS: readonly ["play", "pause", "seek", "set-muted", "set-playback-rate", "enable-pick-mode", "disable-pick-mode"];
13
+ export type HyperframeControlAction = (typeof HYPERFRAME_CONTROL_ACTIONS)[number];
14
+ //# sourceMappingURL=runtimeContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeContract.d.ts","sourceRoot":"","sources":["../../src/inline-scripts/runtimeContract.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B;;;;;;CAM7B,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;CAG5B,CAAC;AAEX,eAAO,MAAM,0BAA0B,+GAQ7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export const HYPERFRAME_RUNTIME_GLOBALS = {
2
+ player: "__player",
3
+ playerReady: "__playerReady",
4
+ renderReady: "__renderReady",
5
+ timelines: "__timelines",
6
+ clipManifest: "__clipManifest",
7
+ };
8
+ export const HYPERFRAME_BRIDGE_SOURCES = {
9
+ parent: "hf-parent",
10
+ preview: "hf-preview",
11
+ };
12
+ export const HYPERFRAME_CONTROL_ACTIONS = [
13
+ "play",
14
+ "pause",
15
+ "seek",
16
+ "set-muted",
17
+ "set-playback-rate",
18
+ "enable-pick-mode",
19
+ "disable-pick-mode",
20
+ ];
21
+ //# sourceMappingURL=runtimeContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeContract.js","sourceRoot":"","sources":["../../src/inline-scripts/runtimeContract.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM,EAAE,UAAU;IAClB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,eAAe;IAC5B,SAAS,EAAE,aAAa;IACxB,YAAY,EAAE,gBAAgB;CACtB,CAAC;AAEX,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;CACb,CAAC;AAEX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,OAAO;IACP,MAAM;IACN,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,mBAAmB;CACX,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { HyperframeLinterOptions, HyperframeLintResult } from "./types";
2
+ export declare function lintHyperframeHtml(html: string, options?: HyperframeLinterOptions): HyperframeLintResult;
3
+ //# sourceMappingURL=hyperframeLinter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperframeLinter.d.ts","sourceRoot":"","sources":["../../src/lint/hyperframeLinter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyB,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAqCpG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,GAAG,oBAAoB,CAgW5G"}