@hyperframes/producer 0.2.3-alpha.1 → 0.2.3-alpha.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "ed061c34b89e257b060b3c9f5fc8c9e83c5018f59a36214604b7ba2c37ef114b",
4
+ "sha256": "a1824c85f214b4cb3f29f6b3ba0c99e5ab5b05d6bbffaf91670a5394dbe67233",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{function le(e){try{window.parent.postMessage(e,"*")}catch{}}function pt(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control")return;let o=r.action;if(o==="play"){e.onPlay();return}if(o==="pause"){e.onPause();return}if(o==="seek"){e.onSeek(Number(r.frame??0),r.seekMode??"commit");return}if(o==="set-muted"){e.onSetMuted(!!r.muted);return}if(o==="set-playback-rate"){e.onSetPlaybackRate(Number(r.playbackRate??1));return}if(o==="enable-pick-mode"){e.onEnablePickMode();return}if(o==="disable-pick-mode"){e.onDisablePickMode();return}if(o==="flash-elements"){let i=r.selectors,l=r.duration||800;i&&nn(i,l)}};return window.addEventListener("message",t),t}function nn(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
1
+ "use strict";(()=>{function le(e){try{window.parent.postMessage(e,"*")}catch{}}function pt(e){let t=n=>{let s=n.data;if(!s||s.source!=="hf-parent"||s.type!=="control")return;let o=s.action;if(o==="play"){e.onPlay();return}if(o==="pause"){e.onPause();return}if(o==="seek"){e.onSeek(Number(s.frame??0),s.seekMode??"commit");return}if(o==="set-muted"){e.onSetMuted(!!s.muted);return}if(o==="set-playback-rate"){e.onSetPlaybackRate(Number(s.playbackRate??1));return}if(o==="enable-pick-mode"){e.onEnablePickMode();return}if(o==="disable-pick-mode"){e.onDisablePickMode();return}if(o==="flash-elements"){let i=s.selectors,l=s.duration||800;i&&on(i,l)}};return window.addEventListener("message",t),t}function on(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
2
2
  .__hf-flash {
3
3
  outline: 2px solid rgba(59, 130, 246, 0.6) !important;
4
4
  outline-offset: 2px !important;
@@ -8,10 +8,10 @@
8
8
  0% { outline-color: rgba(59, 130, 246, 0.8); }
9
9
  100% { outline-color: transparent; }
10
10
  }
11
- `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(o=>{o.classList.add("__hf-flash"),setTimeout(()=>o.classList.remove("__hf-flash"),t)})}catch{}}var qe=null;function ht(e){qe=e}function Ce(e,t){if(qe)try{qe({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch{}}function gt(e){let t=[];return{name:"css",discover:()=>{t=[];let n=document.querySelectorAll("*");for(let r of n){if(!(r instanceof HTMLElement))continue;let o=window.getComputedStyle(r);!o.animationName||o.animationName==="none"||t.push({el:r,baseDelay:r.style.animationDelay||"",basePlayState:r.style.animationPlayState||""})}},seek:n=>{let r=Number(n.time)||0;for(let o of t){if(!o.el.isConnected)continue;let i=e?.resolveStartSeconds?e.resolveStartSeconds(o.el):Number.parseFloat(o.el.getAttribute("data-start")??"0")||0,l=Math.max(0,r-i);o.el.style.animationPlayState="paused",o.el.style.animationDelay=`-${l.toFixed(3)}s`}},pause:()=>{for(let n of t)n.el.isConnected&&(n.el.style.animationPlayState=n.basePlayState||"paused",n.baseDelay&&(n.el.style.animationDelay=n.baseDelay))},revert:()=>{t=[]}}}function yt(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0);typeof n.totalTime=="function"?n.totalTime(r,!1):n.seek(r,!1)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Lt(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let o of t)r.has(o)||n.push(o);window.__hfLottie=n}}}catch{}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(bt(r))r.goToAndStop(t*1e3,!1);else if(St(r)){if(typeof r.setCurrentRawFrameValue=="function"){let o=r.totalFrames??0,i=r.frameRate??30,l=t*i;o>0&&r.setCurrentRawFrameValue(Math.min(l,o-1))}else if(typeof r.seek=="function"){let o=r.duration??1,i=Math.min(100,t/o*100);r.seek(i)}}}catch{}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(bt(t)||St(t))&&t.pause()}catch{}},revert:()=>{}}}function bt(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function St(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function At(){let e=null,t=0;return{name:"three",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfThreeTime=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch{}},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function kt(){return{name:"waapi",discover:()=>{},seek:e=>{if(!document.getAnimations)return;let t=Math.max(0,(Number(e.time)||0)*1e3);for(let n of document.getAnimations())try{n.pause(),n.currentTime=t}catch{}},pause:()=>{if(document.getAnimations)for(let e of document.getAnimations())try{e.pause()}catch{}}}}function xt(e){let t=Array.from(document.querySelectorAll("video[data-start], audio[data-start]")),n=[],r=[],o=0;for(let i of t){let l=e?.resolveStartSeconds?e.resolveStartSeconds(i):Number.parseFloat(i.dataset.start??"0");if(!Number.isFinite(l))continue;let c=Number.parseFloat(i.dataset.playbackStart??i.dataset.mediaStart??"0")||0,d=i.defaultPlaybackRate,a=Number.isFinite(d)&&d>0?Math.max(.1,Math.min(5,d)):1,u=i.loop,b=Number.isFinite(i.duration)&&i.duration>0?i.duration:null,m=Number.parseFloat(i.dataset.duration??"");(!Number.isFinite(m)||m<=0)&&b!=null&&(m=Math.max(0,(b-c)/a));let y=Number.isFinite(m)&&m>0?l+m:Number.POSITIVE_INFINITY,M=Number.parseFloat(i.dataset.volume??""),T={el:i,start:l,mediaStart:c,duration:Number.isFinite(m)&&m>0?m:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(M)?M:null,playbackRate:a,loop:u,sourceDuration:b};n.push(T),i.tagName==="VIDEO"&&r.push(T),Number.isFinite(y)&&(o=Math.max(o,y))}return{timedMediaEls:t,mediaClips:n,videoClips:r,maxMediaEnd:o}}function Et(e){for(let t of e.clips){let{el:n}=t;if(!n.isConnected)continue;let r=(e.timeSeconds-t.start)*t.playbackRate+t.mediaStart;if(e.timeSeconds>=t.start&&e.timeSeconds<t.end&&r>=0){if(t.loop&&t.sourceDuration!=null&&t.sourceDuration>0){let i=t.sourceDuration-t.mediaStart;i>0&&r>=t.sourceDuration&&(r=t.mediaStart+(r-t.mediaStart)%i)}t.volume!=null&&(n.volume=t.volume);try{n.playbackRate=t.playbackRate*e.playbackRate}catch{}if(Math.abs((n.currentTime||0)-r)>.3)try{n.currentTime=r}catch{}e.playing&&n.paused?n.play().catch(()=>{}):!e.playing&&!n.paused&&n.pause();continue}n.paused||n.pause()}}function wt(e){let t=!1,n=null,r=null,o=null,i=null;function l(g,A){try{window.dispatchEvent(new CustomEvent(g,{detail:A}))}catch{}}function c(g){o=g,l("hyperframe:picker:hovered",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function d(g){i=g,l("hyperframe:picker:selected",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function a(g){if(!g||g===document.body||g===document.documentElement)return!1;let A=g.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||g.classList.contains("__hf-pick-highlight"))}function u(g){let A=g;if(A.id)return`#${A.id}`;let N=g.getAttribute("data-composition-id");if(N)return`[data-composition-id="${N}"]`;let R=g.getAttribute("data-composition-src");if(R)return`[data-composition-src="${R}"]`;let F=g.getAttribute("data-track-index");if(F)return`[data-track-index="${F}"]`;let E=g.tagName.toLowerCase(),k=g.parentElement;if(!k)return E;let C=k.querySelectorAll(`:scope > ${E}`);if(C.length===1)return E;for(let W=0;W<C.length;W+=1)if(C[W]===g)return`${E}:nth-of-type(${W+1})`;return E}function b(g){let A=g.tagName.toLowerCase(),N=(g.textContent??"").trim().replace(/\s+/g," "),R=(F,E)=>F.length>E?`${F.slice(0,E-1)}\u2026`:F;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?N.length>0?R(N,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":g.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function m(g,A,N){let R=typeof N=="number"&&N>0?N:8,F=[];if(document.elementsFromPoint)F=document.elementsFromPoint(g,A);else if(document.elementFromPoint){let C=document.elementFromPoint(g,A);F=C?[C]:[]}let E={},k=[];for(let C=0;C<F.length;C+=1){let W=F[C];if(!a(W))continue;let Y=`${W.tagName}::${W.id||""}::${C}`;if(!E[Y]&&(E[Y]=!0,k.push(W),k.length>=R))break}return k}function y(g){let A=g.getBoundingClientRect(),N={};for(let F=0;F<g.attributes.length;F+=1){let E=g.attributes[F];E.name.startsWith("data-")&&(N[E.name]=E.value)}return{id:g.id||null,tagName:g.tagName.toLowerCase(),selector:u(g),label:b(g),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:g.textContent?g.textContent.trim().slice(0,200):null,src:g.getAttribute("src")||g.getAttribute("data-composition-src")||null,dataAttributes:N}}function M(g,A,N){return m(g,A,N).map(y)}function T(g){if(!t)return;let N=m(g.clientX,g.clientY,1)[0]??(g.target instanceof Element?g.target:null);if(!a(N)||n===N)return;n&&n.classList.remove("__hf-pick-highlight"),n=N,N.classList.add("__hf-pick-highlight");let R=y(N);c(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function _(g){if(!t)return;g.preventDefault(),g.stopPropagation(),g.stopImmediatePropagation();let A=M(g.clientX,g.clientY,8);A.length!==0&&(c(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:g.clientX,y:g.clientY}}))}function V(g){g.key==="Escape"&&(z(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function ee(){t||(t=!0,r=document.createElement("style"),r.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(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",T,!0),document.addEventListener("click",_,!0),document.addEventListener("keydown",V,!0),l("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function z(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),r&&(r.remove(),r=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",T,!0),document.removeEventListener("click",_,!0),document.removeEventListener("keydown",V,!0),l("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function U(){window.__HF_PICKER_API={enable:ee,disable:z,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(g,A,N)=>Number.isFinite(g)&&Number.isFinite(A)?M(g,A,N):[],pickAtPoint:(g,A,N)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return null;let R=M(g,A,8);if(!R.length)return null;let F=Math.max(0,Math.min(R.length-1,Number(N??0))),E=R[F]??null;return E?(d(E),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:E}),z(),E):null},pickManyAtPoint:(g,A,N)=>{if(!Number.isFinite(g)||!Number.isFinite(A))return[];let R=M(g,A,8);if(!R.length)return[];let F=[],E=Array.isArray(N)?N:[0];for(let k of E){let C=Math.max(0,Math.min(R.length-1,Math.floor(Number(k)))),W=R[C];if(!W)continue;F.some($=>$.selector===W.selector&&$.tagName===W.tagName)||F.push(W)}return F.length?(d(F[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:F}),z(),F):[]}},l("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:ee,disablePickMode:z,installPickerApi:U}}function Tt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function Mt(e,t,n){let r=Tt(t,n);return e.pause(),typeof e.totalTime=="function"?e.totalTime(r,!1):e.seek(r,!1),r}function Nt(e){return{_timeline:null,play:()=>{let t=e.getTimeline();if(!t||e.getIsPlaying())return;let n=Math.max(0,Number(e.getSafeDuration?.()??t.duration()??0)||0);n>0&&Math.max(0,Number(t.time())||0)>=n&&(t.pause(),t.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof t.timeScale=="function"&&t.timeScale(e.getPlaybackRate()),t.play(),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let t=e.getTimeline();if(!t)return;t.pause();let n=Math.max(0,Number(t.time())||0);e.onDeterministicSeek(n),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(n,!1),e.onRenderFrameSeek(n),e.onStatePost(!0)},seek:t=>{let n=e.getTimeline();if(!n)return;let r=Math.max(0,Number(t)||0),o=Mt(n,r,e.getCanonicalFps());e.onDeterministicSeek(o),e.setIsPlaying(!1),e.onSyncMedia(o,!1),e.onRenderFrameSeek(o),e.onStatePost(!0)},renderSeek:t=>{let n=e.getTimeline();if(!n)return;let r=Mt(n,t,e.getCanonicalFps());e.onDeterministicSeek(r),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},getTime:()=>Number(e.getTimeline()?.time()??0),getDuration:()=>Number(e.getTimeline()?.duration()??0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:t=>e.setPlaybackRate(t),getPlaybackRate:()=>e.getPlaybackRate()}}function vt(){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 Pe(e){let t=Number(e);return Number.isFinite(t)?t:null}function on(e){let t=(e??"").trim();if(!t)return null;let n=Pe(t);if(n!=null)return{kind:"absolute",value:n};let r=t.match(/^([A-Za-z0-9_.:-]+)(?:\s*([+-])\s*([0-9]*\.?[0-9]+))?$/);if(!r)return null;let o=(r[1]??"").trim();if(!o)return null;let i=r[2]??"+",l=r[3]??"0",c=Number.parseFloat(l),d=Number.isFinite(c)?Math.max(0,c):0,a=i==="-"?-d:d;return{kind:"reference",refId:o,offset:a}}function we(e){let t=e.timelineRegistry??{},n=new WeakMap,r=new WeakMap,o=new Set,i=d=>{let a=document.getElementById(d);return a||(document.querySelector(`[data-composition-id="${CSS.escape(d)}"]`)??null)},l=d=>{let a=r.get(d);if(a!==void 0)return a;let u=null,b=Pe(d.getAttribute("data-duration"));if(b!=null&&b>0&&(u=b),u==null||u<=0){let m=Pe(d.getAttribute("data-end"));if(m!=null){let y=c(d,0),M=m-y;Number.isFinite(M)&&M>0&&(u=M)}}if((u==null||u<=0)&&d instanceof HTMLMediaElement){let m=Pe(d.getAttribute("data-playback-start"))??Pe(d.getAttribute("data-media-start"))??0;Number.isFinite(d.duration)&&d.duration>m&&(u=d.duration-m)}if(u==null||u<=0){let m=d.getAttribute("data-composition-id");if(m){let y=t[m]??null;if(y&&typeof y.duration=="function")try{let M=Number(y.duration());Number.isFinite(M)&&M>0&&(u=M)}catch{}}}return u!=null&&Number.isFinite(u)&&u>0?(r.set(d,u),u):(r.set(d,null),null)},c=(d,a)=>{let u=n.get(d);if(u!==void 0)return u??a;if(o.has(d))return a;o.add(d);try{let b=on(d.getAttribute("data-start"));if(!b){if(d.hasAttribute("data-composition-id")){let _=d.parentElement;if(_&&(_.hasAttribute("data-composition-src")||_.hasAttribute("data-composition-id"))){let V=c(_,a);return n.set(d,V),V}}return n.set(d,a),a}if(b.kind==="absolute"){let _=Math.max(0,b.value);return n.set(d,_),_}let m=i(b.refId);if(!m)return n.set(d,a),a;let y=c(m,0),M=l(m);if(M==null||M<=0){let _=Math.max(0,y+b.offset);return n.set(d,_),_}let T=Math.max(0,y+M+b.offset);return n.set(d,T),T}finally{o.delete(d)}};return{resolveStartForElement:(d,a=0)=>c(d,Math.max(0,a)),resolveDurationForElement:d=>l(d)}}function ue(e){let t=Number(e);return Number.isFinite(t)?t:null}var Rt={composition:0,video:1,image:2,element:3,audio:4};function rn(e){if(e.length===0)return;let t=new Map;for(let l of e){let c=t.get(l.track)??new Set;c.add(l.kind),t.set(l.track,c)}if(!Array.from(t.values()).some(l=>l.size>1))return;let r=0,o=new Map,i=[...t.keys()].sort((l,c)=>l-c);for(let l of i){let c=t.get(l);if(c.size===1)o.set(`${l}:${[...c][0]}`,r++);else{let d=[...c].sort((a,u)=>(Rt[a]??99)-(Rt[u]??99));for(let a of d)o.set(`${l}:${a}`,r++)}}for(let l of e){let c=`${l.track}:${l.kind}`,d=o.get(c);d!=null&&(l.track=d)}}function Fe(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function sn(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Fe(t);let n=e.getAttribute("data-composition-src");if(n)return Fe(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?Fe(r.getAttribute("src")):null}function Ct(e){let n=window.__timelines??{},r=we({timelineRegistry:n}),o=S=>{if(!S)return null;let h=n[S]??null;if(!h||typeof h.duration!="function")return null;try{let w=Number(h.duration());return Number.isFinite(w)&&w>0?w:null}catch{return null}},i=S=>{let h=ue(S.getAttribute("data-duration"));if(h!=null&&h>0)return h;let w=ue(S.getAttribute("data-playback-start"))??ue(S.getAttribute("data-media-start"))??0;return Number.isFinite(S.duration)&&S.duration>w?Math.max(0,S.duration-w):null},l=()=>{let S=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(S.length===0)return null;let h=0;for(let w of S){let P=r.resolveStartForElement(w,0);if(!Number.isFinite(P))continue;let G=i(w);G==null||G<=0||(h=Math.max(h,Math.max(0,P)+G))}return h>0?h:null},c=S=>{let h=S.trim().toLowerCase();return!(!h||h==="main"||h.includes("caption")||h.includes("ambient"))},d=(S,h)=>{let w=[],P=null,G=null,I=null,D=S.parentElement;for(;D;){let B=D.getAttribute("data-composition-id");B&&(w.push(B),!I&&D!==h&&(I=B),P==null&&(P=r.resolveStartForElement(D,0)),G==null&&(G=ue(D.getAttribute("data-duration"))??o(B)??null)),D=D.parentElement}return{parentCompositionId:I,compositionAncestors:w.reverse(),inheritedStart:P,inheritedDuration:G}},a=document.querySelector("[data-composition-id]"),u=a?.getAttribute("data-composition-id")??null,b=a?r.resolveStartForElement(a,0):0,m=l(),y=m!=null?Math.max(0,m-Math.max(0,b)):null,M=o(u),T=ue(a?.getAttribute("data-duration")),_=typeof M=="number"&&Number.isFinite(M)&&M>0?M:null,V=typeof T=="number"&&Number.isFinite(T)&&T>0?T:null,ee=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,z=_!=null&&ee!=null&&_>ee+1,U=V??(z?ee:_??ee),g=U!=null?Math.min(U,e.maxTimelineDurationSeconds):null,N=(g!=null?b+g:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),R=(S,h)=>!Number.isFinite(h)||h<=0?0:N==null||!Number.isFinite(N)?h:!Number.isFinite(S)||S>=N?0:Math.max(0,Math.min(h,N-S)),F=Array.from(document.querySelectorAll("[data-composition-id]")),E=[],k=[],C=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),W=0;for(let S=0;S<C.length;S+=1){let h=C[S];if(h===a||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(h.tagName))continue;let w=d(h,a),P=r.resolveStartForElement(h,w.inheritedStart??0),G=h.getAttribute("data-composition-id"),I=ue(h.getAttribute("data-duration"));if((I==null||I<=0)&&G&&G!==u&&(I=o(G)),(I==null||I<=0)&&h instanceof HTMLMediaElement){let ae=ue(h.getAttribute("data-playback-start"))??ue(h.getAttribute("data-media-start"))??0;Number.isFinite(h.duration)&&h.duration>0&&(I=Math.max(0,h.duration-ae))}if(I==null||I<=0){let ae=w.inheritedDuration;if(ae!=null&&ae>0){let fe=(w.inheritedStart??0)+ae;I=Math.max(0,fe-P)}}if(I==null||I<=0||(I=R(P,I),I<=0))continue;let D=P+I;W=Math.max(W,D);let B=h.tagName.toLowerCase(),me=G&&G!==u?"composition":B==="video"?"video":B==="audio"?"audio":B==="img"?"image":"element";E.push({id:h.id||G||`__node__index_${S}`,label:h.getAttribute("data-timeline-label")??h.getAttribute("data-label")??h.getAttribute("aria-label")??G??h.id??h.className?.split(" ")[0]??me,start:P,duration:I,track:Number.parseInt(h.getAttribute("data-track-index")??h.getAttribute("data-track")??String(S),10)||0,kind:me,tagName:B,compositionId:h.getAttribute("data-composition-id"),compositionAncestors:w.compositionAncestors,parentCompositionId:w.parentCompositionId,nodePath:null,compositionSrc:Fe(h.getAttribute("data-composition-src")),assetUrl:sn(h),timelineRole:h.getAttribute("data-timeline-role"),timelineLabel:h.getAttribute("data-timeline-label"),timelineGroup:h.getAttribute("data-timeline-group"),timelinePriority:ue(h.getAttribute("data-timeline-priority"))})}let Y=new Set(E.map(S=>S.id)),$=a?.getAttribute("data-composition-id")??null,K=$?n[$]??null:null;if(K&&a){let S=K;if(typeof S.getChildren=="function")try{let h=S.getChildren(!0,!0,!1)??[],w=new Map;for(let I of a.children){let D=I;if(!D.id)continue;let B=D.tagName.toLowerCase();B==="script"||B==="style"||B==="link"||w.set(D,{id:D.id,start:1/0,end:-1/0})}let P=I=>{let D=I;for(;D;){if(w.has(D))return D;if(D===a)return null;D=D.parentElement}return null};for(let I of h){if(typeof I.targets!="function"||typeof I.startTime!="function"||typeof I.duration!="function")continue;let D=I.startTime(),B=I.parent;for(;B&&typeof B.startTime=="function";)D+=B.startTime(),B=B.parent;let me=D+I.duration();if(!(!Number.isFinite(D)||!Number.isFinite(me)))for(let ae of I.targets()){if(!(ae instanceof Element))continue;let ve=P(ae);if(!ve)continue;let fe=w.get(ve);fe&&(fe.start=Math.min(fe.start,D),fe.end=Math.max(fe.end,me))}}let G=E.length>0?Math.max(...E.map(I=>I.track))+1:0;for(let[I,D]of w){if(D.start===1/0||D.end===-1/0)continue;let B=I;if(Y.has(B.id))continue;let me=Math.max(0,D.end-D.start);if(me<=0)continue;let ae=R(D.start,me);ae<=0||(W=Math.max(W,D.start+ae),E.push({id:B.id,label:B.getAttribute("data-timeline-label")??B.getAttribute("data-label")??B.getAttribute("aria-label")??B.id,start:D.start,duration:ae,track:Number.parseInt(B.getAttribute("data-track-index")??B.getAttribute("data-track")??"",10)||G,kind:"element",tagName:B.tagName.toLowerCase(),compositionId:B.getAttribute("data-composition-id"),compositionAncestors:$?[$]:[],parentCompositionId:$,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:B.getAttribute("data-timeline-role"),timelineLabel:B.getAttribute("data-timeline-label"),timelineGroup:B.getAttribute("data-timeline-group"),timelinePriority:ue(B.getAttribute("data-timeline-priority"))}),Y.add(B.id))}}catch{}}if(a&&g!=null&&g>0){let S=E.length>0?Math.max(...E.map(h=>h.track))+1:0;for(let h of a.children){let w=h;if(!w.id||Y.has(w.id))continue;let P=w.tagName.toLowerCase();if(P==="script"||P==="style"||P==="link"||P==="meta"||window.getComputedStyle(w).display==="none")continue;let I=R(0,g);I<=0||(W=Math.max(W,I),E.push({id:w.id,label:w.getAttribute("data-timeline-label")??w.getAttribute("data-label")??w.getAttribute("aria-label")??w.id,start:0,duration:I,track:Number.parseInt(w.getAttribute("data-track-index")??w.getAttribute("data-track")??"",10)||S,kind:"element",tagName:P,compositionId:w.getAttribute("data-composition-id"),compositionAncestors:$?[$]:[],parentCompositionId:$,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:w.getAttribute("data-timeline-role"),timelineLabel:w.getAttribute("data-timeline-label"),timelineGroup:w.getAttribute("data-timeline-group"),timelinePriority:ue(w.getAttribute("data-timeline-priority"))}),Y.add(w.id))}}rn(E);for(let S of F){if(S===a)continue;let h=S.getAttribute("data-composition-id");if(!h||!c(h))continue;let w=r.resolveStartForElement(S,0),P=ue(S.getAttribute("data-duration")),G=o(h),I=P&&P>0?P:G;if(I==null||I<=0)continue;let D=R(w,I);D<=0||k.push({id:h,label:S.getAttribute("data-label")??h,start:w,duration:D,thumbnailUrl:Fe(S.getAttribute("data-thumbnail-url")),avatarName:null})}let H=Math.max(1,Math.min(W||1,e.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:z&&V==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(H*Math.max(1,e.canonicalFps))),clips:E,scenes:k,compositionWidth:ue(a?.getAttribute("data-width"))??1920,compositionHeight:ue(a?.getAttribute("data-height"))??1080}}var an=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,ln=e=>new Promise(t=>{let n=!1,r=Date.now(),o=null,i=l=>{n||(n=!0,o!=null&&window.clearTimeout(o),t({status:l,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>i("load"),{once:!0}),e.addEventListener("error",()=>i("error"),{once:!0}),o=window.setTimeout(()=>i("timeout"),8e3)});function Ve(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function un(e,t){let n=e.trim();if(!n)return e;try{return an.test(n)?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}async function Ke(e){let t=null;e.hostCompositionId&&(t=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(d=>d.getAttribute("data-composition-id")===e.hostCompositionId)??null);let n=t??e.sourceNode,r=Array.from(n.querySelectorAll("style"));for(let c of r){let d=c.cloneNode(!0);d instanceof HTMLStyleElement&&(document.head.appendChild(d),e.injectedStyles.push(d))}let o=Array.from(n.querySelectorAll("script")),i=[];for(let c of o){let d=c.getAttribute("type")?.trim()??"",a=c.getAttribute("src")?.trim()??"";if(a){let u=un(a,e.compositionUrl);i.push({kind:"external",src:u,type:d})}else{let u=c.textContent?.trim()??"";u&&i.push({kind:"inline",content:u,type:d})}c.parentNode?.removeChild(c)}let l=Array.from(n.querySelectorAll("style"));for(let c of l)c.parentNode?.removeChild(c);if(t){let c=document.importNode(t,!0),d=t.getAttribute("data-width"),a=t.getAttribute("data-height"),u=e.parseDimensionPx(d),b=e.parseDimensionPx(a);c.style.position="relative",c.style.width=u||"100%",c.style.height=b||"100%",u&&c.style.setProperty("--comp-width",u),b&&c.style.setProperty("--comp-height",b),d&&e.host.setAttribute("data-width",d),a&&e.host.setAttribute("data-height",a),u&&e.host instanceof HTMLElement&&(e.host.style.width=u),b&&e.host instanceof HTMLElement&&(e.host.style.height=b),e.host.appendChild(c)}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;for(let c of i){let d=document.createElement("script");if(c.type&&(d.type=c.type),d.async=!1,c.kind==="external"?d.src=c.src:c.type.toLowerCase()==="module"?d.textContent=c.content:d.textContent=`(function(){${c.content}})();`,document.body.appendChild(d),e.injectedScripts.push(d),c.kind==="external"){let a=await ln(d);a.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.hostCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:c.src,loadStatus:a.status,elapsedMs:a.elapsedMs}})}}}async function Pt(e){let t=Array.from(document.querySelectorAll("[data-composition-id]:not([data-composition-src])")).filter(n=>{if(n.children.length>0)return!1;let r=n.getAttribute("data-composition-id");return r?!!document.querySelector(`template#${CSS.escape(r)}-template`):!1});if(t.length!==0)for(let n of t){let r=n.getAttribute("data-composition-id"),o=document.querySelector(`template#${CSS.escape(r)}-template`);Ve(n),await Ke({host:n,hostCompositionId:r,hostCompositionSrc:`template#${r}-template`,sourceNode:o.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function Ft(e){let t=Array.from(document.querySelectorAll("[data-composition-src]"));t.length!==0&&await Promise.all(t.map(async n=>{let r=n.getAttribute("data-composition-src");if(!r)return;let o=null;try{o=new URL(r,document.baseURI)}catch{o=null}Ve(n);try{let i=n.getAttribute("data-composition-id"),l=i!=null?document.querySelector(`template#${CSS.escape(i)}-template`):null;if(l){await Ke({host:n,hostCompositionId:i,hostCompositionSrc:r,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:o,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let c=await fetch(r);if(!c.ok)throw new Error(`HTTP ${c.status}`);let d=await c.text(),u=new DOMParser().parseFromString(d,"text/html"),b=(i?u.querySelector(`template#${CSS.escape(i)}-template`):null)??u.querySelector("template"),m=b?b.content:u.body;await Ke({host:n,hostCompositionId:i,hostCompositionSrc:r,sourceNode:m,hasTemplate:!!b,fallbackBodyInnerHtml:u.body.innerHTML,compositionUrl:o,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}catch(i){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:n.getAttribute("data-composition-id"),hostCompositionSrc:r,errorMessage:i instanceof Error?i.message:"unknown_error"}}),Ve(n)}}))}function Je(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=[],r=document.querySelectorAll(".caption-group");for(let o of r){let i=o.querySelectorAll(":scope > span");for(let l of i)n.push(l)}for(let o of t){let i=null;if(o.wordId&&(i=document.getElementById(o.wordId)),!i&&o.wordIndex!==void 0&&(i=n[o.wordIndex]??null),!i||!(i instanceof HTMLElement))continue;let l={},c={};if(o.x!==void 0&&(l.x=o.x),o.y!==void 0&&(l.y=o.y),o.scale!==void 0&&(l.scale=o.scale),o.rotation!==void 0&&(l.rotation=o.rotation),o.opacity!==void 0&&(c.opacity=o.opacity),o.fontSize!==void 0&&(c.fontSize=`${o.fontSize}px`),o.fontWeight!==void 0&&(c.fontWeight=o.fontWeight),o.fontFamily!==void 0&&(c.fontFamily=o.fontFamily),o.activeColor||o.dimColor){let a=e.getTweensOf(i).filter(b=>b.vars.color!==void 0).sort((b,m)=>b.startTime()-m.startTime()),u=a.length>0?String(a[0].vars.color):"";for(let b of a)String(b.vars.color)===u?o.dimColor&&(b.vars.color=o.dimColor):o.activeColor&&(b.vars.color=o.activeColor);o.dimColor&&e.set(i,{color:o.dimColor})}if(Object.keys(c).length>0&&e.set(i,c),Object.keys(l).length>0){let d=document.createElement("span");d.style.display="inline-block",d.dataset.captionWrapper="true",i.parentNode?.insertBefore(d,i),d.appendChild(i),e.set(d,l)}}}).catch(()=>{})}function It(){let e=vt(),t=window,n=null,r=null,o=[],i=new Set,l=null;if(typeof t.__hfRuntimeTeardown=="function")try{t.__hfRuntimeTeardown()}catch{}document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden"),window.__timelines=window.__timelines||{};let c=s=>{o.push(s)},d=(s,p,f)=>{let x=f??`${s}:${JSON.stringify(p)}`;i.has(x)||(i.add(x),le({source:"hf-preview",type:"diagnostic",code:s,details:p}))},a=s=>{let p={scale:1,focusX:960,focusY:540},f=[],x=[],L={time:s.getTime(),duration:s.getDuration(),isPlaying:s.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:s.play,pause:s.pause,seek:s.seek,getTime:s.getTime,getDuration:s.getDuration,isPlaying:s.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>f,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:s.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>x,getRenderState:()=>({...L,time:s.getTime(),duration:s.getDuration(),isPlaying:s.isPlaying()})}},u=1/60,b=.75,m=.75,y=.35,M=900,T=3,_=2,V=.05,ee=100,z=240,U=s=>{if(s instanceof Error)return s.message||String(s);if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return String(s??"")}},g=s=>{let p=s.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},A=s=>{if(s==null||s.trim()==="")return null;let p=Number.parseFloat(s);return!Number.isFinite(p)||p<=0?null:`${p}px`},N=()=>{let s=document.querySelector('[data-composition-id][data-root="true"]');if(s instanceof HTMLElement)return s;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.length===0?null:p.find(f=>!f.parentElement?.closest("[data-composition-id]"))??p[0]??null},R=()=>{let s=N();if(!s)return;let p=A(s.getAttribute("data-width")),f=A(s.getAttribute("data-height"));p&&(s.style.width=p),f&&(s.style.height=f),p&&s.style.setProperty("--comp-width",p),f&&s.style.setProperty("--comp-height",f)},F=()=>{let s=N(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(f=>f.hasAttribute("data-duration")||f.hasAttribute("data-end"));for(let f of p)s&&f===s||(f.removeAttribute("data-duration"),f.removeAttribute("data-end"))},E=()=>{let s=N();if(!s)return;s.style.position||(s.style.position="relative"),s.style.overflow="hidden";let p=A(s.getAttribute("data-width")),f=A(s.getAttribute("data-height"));p&&(s.style.width=p),f&&(s.style.height=f);let x=Array.from(s.children);for(let L of x){let Z=L.tagName.toLowerCase();if(Z==="script"||Z==="style"||Z==="link"||Z==="meta"||!L.hasAttribute("data-start"))continue;let re=(L.style.top==="0px"||L.style.top==="0")&&(L.style.left==="0px"||L.style.left==="0")&&L.style.width==="100%"&&L.style.height==="100%",Se=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(L.style.transform);if(re&&Se&&!L.hasAttribute("data-width")&&!L.hasAttribute("data-height")){let ce=L.style.top,q=L.style.left,O=L.style.width,J=L.style.height;L.style.top="",L.style.left="",L.style.width="",L.style.height="";let j=window.getComputedStyle(L);j.top!=="auto"||j.bottom!=="auto"||j.left!=="auto"||j.right!=="auto"||j.width!=="0px"||j.height!=="0px"||(L.style.top=ce,L.style.left=q,L.style.width=O,L.style.height=J)}let te=window.getComputedStyle(L),X=te.position;if(X!=="absolute"&&X!=="fixed"&&(L.style.position="absolute"),!!L.style.top||!!L.style.bottom||te.top!=="auto"||te.bottom!=="auto"||(L.style.top="0"),!!L.style.left||!!L.style.right||te.left!=="auto"||te.right!=="auto"||(L.style.left="0"),Z!=="audio"){let ce=A(L.getAttribute("data-width")),q=A(L.getAttribute("data-height")),O=te.width!=="0px"&&te.width!=="auto",J=te.height!=="0px"&&te.height!=="auto";ce?!L.style.width&&!O&&(L.style.width=ce):!L.style.width&&te.width==="0px"&&(L.style.width="100%"),q?!L.style.height&&!J&&(L.style.height=q):!L.style.height&&te.height==="0px"&&(L.style.height="100%")}}},k=(s,p=0)=>we({timelineRegistry:window.__timelines??{}}).resolveStartForElement(s,p),C=s=>we({timelineRegistry:window.__timelines??{}}).resolveDurationForElement(s),W=!!document.querySelector("[data-composition-src]"),Y=!1;{let s=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of s){let f=p.getAttribute("data-composition-id");if(f&&p.children.length===0&&document.querySelector(`template#${CSS.escape(f)}-template`)){Y=!0;break}}}let $=!W&&!Y,K=s=>{if(!s||typeof s.duration!="function")return null;try{let p=Number(s.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},H=s=>typeof s=="number"&&Number.isFinite(s)&&s>u,de=s=>{let p=Number(s.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let f=Number(s.getAttribute("data-playback-start")??s.getAttribute("data-media-start")??"0"),x=Number.isFinite(f)?Math.max(0,f):0;return Number.isFinite(s.duration)&&s.duration>x?Math.max(0,s.duration-x):null},v=()=>{let s=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(s.length===0)return null;let p=0;for(let f of s){let x=k(f,0);if(!Number.isFinite(x))continue;let L=de(f);L==null||L<=u||(p=Math.max(p,Math.max(0,x)+L))}return p>u?p:null},S=()=>{let s=v();return typeof s!="number"||!Number.isFinite(s)||s<=u?null:s},h=s=>H(s)?Math.max(u,s*b):u,w=(s,p=0)=>{let f=K(s),x=S(),L=Number.isFinite(p)&&p>u?p:0,Z=0;H(f)?Z=Math.max(f,L):H(x)?Z=Math.max(x,L):Z=L;let re=Math.max(1,Number(e.maxTimelineDurationSeconds)||1800);return Z>0?Math.max(0,Math.min(Z,re)):0},P=()=>{let s=window.__timelines??{},p=we({timelineRegistry:s}),f=S(),x=h(f),L=q=>{let O=document.querySelector(`[data-composition-id="${CSS.escape(q)}"]`);return O?p.resolveStartForElement(O,0):0},Z=q=>{let O=window.gsap;if(!O||typeof O.timeline!="function")return null;let J=O.timeline({paused:!0});for(let j of q)J.add(j.timeline,L(j.compositionId));return J},re=(q,O)=>{if(!H(q))return null;let J=window.gsap;if(!J||typeof J.timeline!="function")return null;let j=J.timeline({paused:!0});if(O)try{j.add(O,0)}catch{}let Q=j;if(typeof Q.to=="function")try{Q.to({},{duration:q})}catch{}return j},Se=(q,O)=>{let J=q;if(typeof J.getChildren!="function")return[];try{let j=J.getChildren(!0,!0,!0)??[];if(!Array.isArray(j))return[];let Q=[];for(let ie of O)if(!j.some(Le=>Le===ie.timeline))try{let Le=L(ie.compositionId);q.add(ie.timeline,Le),Q.push(ie.compositionId)}catch{}return Q}catch{return[]}},te=N(),X=te?.getAttribute("data-composition-id")??null;if(!X)return{timeline:null};let se=s[X]??null,ne=(()=>{if(!te)return[];let q=new Set,O=Array.from(te.querySelectorAll("[data-composition-id]")),J=[];for(let j of O){let Q=j.getAttribute("data-composition-id");if(!Q||Q===X||q.has(Q))continue;q.add(Q);let ie=s[Q]??null;if(!ie||typeof ie.play!="function"||typeof ie.pause!="function")continue;let Ee=K(ie);J.push({compositionId:Q,timeline:ie,durationSeconds:Ee??0})}return J})(),ce=q=>{for(let O of q){let J=O.timeline;if(typeof J.paused=="function")try{J.paused(!1)}catch{}}};if(ne.length>0&&ce(ne),se){let q=ne.length>0?Se(se,ne):[];if((ne.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+X+"'])"))&&(I=!0),q.length>0)try{let j=se.time();se.seek(j,!1)}catch{}let O=K(se);if(!H(O)&&ne.length>0){let j=ne.map(tn=>tn.compositionId),Q=Z(ne),ie=K(Q);if(Q&&H(ie))return{timeline:Q,selectedTimelineIds:j,selectedDurationSeconds:ie,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:x,selectedDurationSeconds:ie,mediaDurationFloorSeconds:f,selectedTimelineIds:j,autoNestedChildren:q}}};let Ee=re(f??0,se),Le=K(Ee);if(Ee&&H(Le))return{timeline:Ee,selectedTimelineIds:[X],selectedDurationSeconds:Le,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:f,selectedDurationSeconds:Le,selectedTimelineIds:[X],autoNestedChildren:q}}}}if(!H(O)&&ne.length===0){let j=re(f??0,se),Q=K(j);if(j&&H(Q))return{timeline:j,selectedTimelineIds:[X],selectedDurationSeconds:Q,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:f,selectedDurationSeconds:Q,selectedTimelineIds:[X]}}}}let J=te?.getAttribute("data-duration");if(J){let j=parseFloat(J);if(H(j)&&H(O)&&j>=O+.5){let Q=se;if(typeof Q.to=="function")try{Q.to({},{duration:0},j)}catch{}let ie=K(se);if(H(ie))return{timeline:se,selectedTimelineIds:[X],selectedDurationSeconds:ie,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:X,rootDurationSeconds:O,rootDeclaredDur:j,newDur:ie}}}}}return{timeline:se,selectedTimelineIds:[X],selectedDurationSeconds:O,mediaDurationFloorSeconds:f,diagnostics:q.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:X,selectedDurationSeconds:O,autoNestedChildren:q}}:void 0}}if(ne.length>0){let q=ne.map(j=>j.compositionId),O=Z(ne),J=K(O);if(O)return{timeline:O,selectedTimelineIds:q,selectedDurationSeconds:J,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:X,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:x,selectedDurationSeconds:J,mediaDurationFloorSeconds:f,selectedTimelineIds:q}}}}return{timeline:null}},G=()=>{let s=e.capturedTimeline;if(!s||typeof s.time!="function")return;let p=Number(s.time());Number.isFinite(p)&&(e.currentTime=Math.max(0,p))},I=!1,D=()=>{if(!$)return!1;let s=e.capturedTimeline,p=K(s),f=H(p);if(s&&f&&I)return!1;let x=P();return x.timeline?s&&s===x.timeline?(typeof s.timeScale=="function"&&s.timeScale(e.playbackRate),!1):(e.capturedTimeline=x.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),x.diagnostics&&le({source:"hf-preview",type:"diagnostic",code:x.diagnostics.code,details:x.diagnostics.details}),le({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:x.selectedTimelineIds??[],selectedDurationSeconds:x.selectedDurationSeconds??null,mediaDurationFloorSeconds:x.mediaDurationFloorSeconds??null}}),!0):!1},B=()=>{let s=N();if(!(s instanceof HTMLElement))return;let p=s.getBoundingClientRect(),f=Number(s.getAttribute("data-width")),x=Number(s.getAttribute("data-height")),L=window.getComputedStyle(s),Z=Number.isFinite(f)&&f>0&&Number.isFinite(x)&&x>0,re=p.width<=0||p.height<=0||s.clientWidth<=0||s.clientHeight<=0;!Z||!re||d("root_stage_layout_zero",{compositionId:s.getAttribute("data-composition-id")??null,declaredWidth:f,declaredHeight:x,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:s.clientWidth,clientHeight:s.clientHeight,display:L.display,visibility:L.visibility,overflow:L.overflow},`root-stage-layout-zero:${s.getAttribute("data-composition-id")??"unknown"}`)},me=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,B()}))},ae=()=>{n=s=>{let p=U(s.error??s.message).slice(0,z);if(!p)return;let f=g(p);le({source:"hf-preview",type:"diagnostic",code:f.code,details:{category:f.category,message:p,filename:s.filename||null,line:Number.isFinite(s.lineno)?s.lineno:null,column:Number.isFinite(s.colno)?s.colno:null}})},r=s=>{let p=U(s.reason).slice(0,z);if(!p)return;let f=g(p);le({source:"hf-preview",type:"diagnostic",code:`${f.code}_unhandled_rejection`,details:{category:`${f.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",n),window.addEventListener("unhandledrejection",r)},ve=()=>{let s=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let f of s){let x=()=>{if(!(f instanceof Element))return;let L=f.tagName.toLowerCase(),Z=f.getAttribute("src")??f.getAttribute("href")??f.getAttribute("poster")??null,re=L==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";d(re,{tagName:L,assetUrl:Z,currentSrc:(f instanceof HTMLImageElement||f instanceof HTMLMediaElement)&&f.currentSrc||null,readyState:f instanceof HTMLMediaElement?f.readyState:null,networkState:f instanceof HTMLMediaElement?f.networkState:null},`${re}:${L}:${Z??"unknown"}`)};f.addEventListener("error",x),c(()=>{f.removeEventListener("error",x)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let f=Array.from(p).filter(x=>x.status==="error").map(x=>x.family).filter(x=>!!x).slice(0,10);f.length!==0&&d("runtime_font_load_issue",{failedFamilies:f,totalFaces:Array.from(p).length},`runtime-font-load-issue:${f.join("|")}`)}).catch(()=>{})},fe=(s,p)=>{if(!s.timeline)return!1;let f=e.capturedTimeline;if(f&&f===s.timeline)return!1;let x=Math.max(0,e.currentTime||0),L=e.isPlaying;e.capturedTimeline=s.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{e.capturedTimeline.pause(),e.capturedTimeline.seek(x,!1),L&&e.capturedTimeline.play()}catch{}return le({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:x,selectedTimelineIds:s.selectedTimelineIds??[],selectedDurationSeconds:s.selectedDurationSeconds??null,mediaDurationFloorSeconds:s.mediaDurationFloorSeconds??null}}),!0},be=null,ut=!1,De=new Set,_e=()=>{e.tornDown||(be!=null&&window.clearTimeout(be),be=window.setTimeout(()=>{if(e.tornDown)return;be=null;let s=P();if(!s.timeline||!H(s.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){D()&&(ke(),he(!0));return}if(ut)return;let f=K(e.capturedTimeline),x=s.selectedDurationSeconds??K(s.timeline);H(x)&&(!H(f)||x>=f+V)&&fe(s,"manual")&&(ut=!0,le({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:f??null,selectedDurationSeconds:x??null,selectedTimelineIds:s.selectedTimelineIds??[],mediaDurationFloorSeconds:s.mediaDurationFloorSeconds??null}}),ke(),he(!0))},ee))},Yt=()=>{for(let s of De)s.removeEventListener("loadedmetadata",_e),s.removeEventListener("durationchange",_e);De.clear()},je=()=>{if(e.tornDown)return;let s=Array.from(document.querySelectorAll("video, audio"));for(let p of s)De.has(p)||(De.add(p),p.addEventListener("loadedmetadata",_e),p.addEventListener("durationchange",_e))},ct=()=>{let s=xt({resolveStartSeconds:x=>k(x,0)});Et({clips:s.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate});let p=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,f=Array.from(document.querySelectorAll("[data-start]"));for(let x of f){if(!(x instanceof HTMLElement))continue;let L=x.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta")continue;if(!x.getAttribute("data-composition-id")){let ce=x.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(ce&&ce!==p)continue}let re=k(x,0),Se=C(x),te=Se!=null&&Se>0?re+Se:Number.POSITIVE_INFINITY,X=te,se=x.getAttribute("data-composition-id");if(se&&!Number.isFinite(te)){let ne=(window.__timelines??{})[se];if(ne&&typeof ne.duration=="function"){let ce=ne.duration();ce>0&&(X=re+ce)}}let Ue=e.currentTime>=re&&(Number.isFinite(X)?e.currentTime<X:!0);x.style.visibility=Ue?"visible":"hidden"}},he=s=>{G();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),f=Date.now();(s||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||f-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=f,le({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},ke=()=>{F(),R(),E();let s=N();if(s){let f=A(s.getAttribute("data-width")),x=A(s.getAttribute("data-height")),L=f?parseInt(f,10):0,Z=x?parseInt(x,10):0;L>0&&Z>0&&le({source:"hf-preview",type:"stage-size",width:L,height:Z})}D();let p=Ct({canonicalFps:e.canonicalFps,maxTimelineDurationSeconds:e.maxTimelineDurationSeconds});window.__clipManifest=p,le(p),me()},Re=(s,p=0)=>{for(let f of e.deterministicAdapters){try{s==="discover"&&f.discover(),s==="pause"&&f.pause(),s==="play"&&f.play&&f.play()}catch{}if(s==="discover")try{f.seek({time:p})}catch{}}};if($)Je();else{let s={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,parseDimensionPx:A,onDiagnostic:({code:p,details:f})=>{le({source:"hf-preview",type:"diagnostic",code:p,details:f})}};Ft(s).then(()=>Pt(s)).finally(()=>{$=!0,Re("discover",e.currentTime),je(),ve(),Je(),ke(),he(!0)})}let We=wt({postMessage:s=>le(s)});We.installPickerApi();let dt=s=>{let p=Number(s);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let f=document.querySelectorAll("video, audio");for(let x of f)if(x instanceof HTMLMediaElement)try{x.playbackRate=e.playbackRate}catch{}},oe=Nt({getTimeline:()=>e.capturedTimeline,setTimeline:s=>{e.capturedTimeline=s},getIsPlaying:()=>e.isPlaying,setIsPlaying:s=>{e.isPlaying=s},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:dt,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(s,p)=>{e.currentTime=Math.max(0,Number(s)||0),e.isPlaying=p,ct()},onStatePost:he,onDeterministicSeek:s=>{for(let p of e.deterministicAdapters)try{p.seek({time:Number(s)||0})}catch{}},onDeterministicPause:()=>Re("pause"),onDeterministicPlay:()=>Re("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>w(e.capturedTimeline,0)});window.__player=a(oe),window.__playerReady=!0,window.__renderReady=!0,ht(le),Ce("composition_loaded",{duration:oe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=pt({onPlay:()=>{oe.play(),Ce("composition_played",{time:oe.getTime()})},onPause:()=>{oe.pause(),Ce("composition_paused",{time:oe.getTime()})},onSeek:(s,p)=>{let f=Math.max(0,s)/e.canonicalFps;oe.seek(f),Ce("composition_seeked",{time:f})},onSetMuted:s=>{e.bridgeMuted=s;let p=document.querySelectorAll("video, audio");for(let f of p)f instanceof HTMLMediaElement&&(f.muted=s)},onSetPlaybackRate:s=>dt(s),onEnablePickMode:()=>We.enablePickMode(),onDisablePickMode:()=>We.disablePickMode()}),D(),e.capturedTimeline&&(oe._timeline=e.capturedTimeline),$&&setTimeout(()=>{let s=e.capturedTimeline;D()&&e.capturedTimeline!==s&&(oe._timeline=e.capturedTimeline),Re("discover",e.currentTime),ke(),he(!0)},0),e.deterministicAdapters=[gt({resolveStartSeconds:s=>k(s,0)}),kt(),Lt(),At(),yt({getTimeline:()=>e.capturedTimeline})],ae(),Re("discover"),je(),e.timelinePollIntervalId&&clearInterval(e.timelinePollIntervalId);let ze=0,Be=null,mt=0,Ge=!1,xe=0,ft=()=>{mt=Date.now(),Ge=!1,xe=0};e.timelinePollIntervalId=setInterval(()=>{ze+=1;let p=e.isPlaying&&e.capturedTimeline!=null&&Math.max(0,e.currentTime||0)<_?!1:D();if(e.capturedTimeline&&!oe._timeline&&(oe._timeline=e.capturedTimeline),(p||ze%20===0)&&ke(),ze%10===0&&je(),G(),e.isPlaying&&e.capturedTimeline){let f=Math.max(0,e.currentTime||0),x=Be,L=w(e.capturedTimeline,0);if(L>0&&f>=L){oe.pause(),oe.seek(L),Be=L,xe=0,he(!0);return}if(x!=null&&x>=m&&f<=y?xe+=1:xe=0,!Ge&&xe>=T&&Date.now()-mt>M){let re=P();fe(re,"loop_guard")&&(Ge=!0,xe=0)}Be=Math.max(0,e.currentTime||0)}else Be=Math.max(0,e.currentTime||0);e.isPlaying&&ct(),he(!1)},50),ke(),he(!0);let Xt=oe.seek;oe.seek=s=>{ft(),Xt(s)};let en=oe.renderSeek;oe.renderSeek=s=>{ft(),en(s)};let $e=()=>{if(!e.tornDown){e.tornDown=!0,e.timelinePollIntervalId&&(clearInterval(e.timelinePollIntervalId),e.timelinePollIntervalId=null),be!=null&&(window.clearTimeout(be),be=null),l!=null&&(window.cancelAnimationFrame(l),l=null),Yt(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),n&&(window.removeEventListener("error",n),n=null),r&&(window.removeEventListener("unhandledrejection",r),r=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),We.disablePickMode();for(let s of e.deterministicAdapters)if(!(!s||typeof s.revert!="function"))try{s.revert()}catch{}e.deterministicAdapters=[];for(let s of o.splice(0))try{s()}catch{}for(let s of e.injectedCompStyles)try{s.remove()}catch{}e.injectedCompStyles=[];for(let s of e.injectedCompScripts)try{s.remove()}catch{}e.injectedCompScripts=[],e.capturedTimeline=null,t.__hfRuntimeTeardown===$e&&(t.__hfRuntimeTeardown=null)}};t.__hfRuntimeTeardown=$e,e.beforeUnloadHandler=$e,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var cn=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","ON","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],dn=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"];function mn(e){return e<=255?cn[e]:1424<=e&&e<=1524?"R":1536<=e&&e<=1791?dn[e&255]:1792<=e&&e<=2220?"AL":"L"}function fn(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=0;for(let a=0;a<t;a++){let u=mn(e.charCodeAt(a));(u==="R"||u==="AL"||u==="AN")&&r++,n[a]=u}if(r===0)return null;let o=t/r<.3?0:1,i=new Int8Array(t);for(let a=0;a<t;a++)i[a]=o;let l=o&1?"R":"L",c=l,d=c;for(let a=0;a<t;a++)n[a]==="NSM"?n[a]=d:d=n[a];d=c;for(let a=0;a<t;a++){let u=n[a];u==="EN"?n[a]=d==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(d=u)}for(let a=0;a<t;a++)n[a]==="AL"&&(n[a]="R");for(let a=1;a<t-1;a++)n[a]==="ES"&&n[a-1]==="EN"&&n[a+1]==="EN"&&(n[a]="EN"),n[a]==="CS"&&(n[a-1]==="EN"||n[a-1]==="AN")&&n[a+1]===n[a-1]&&(n[a]=n[a-1]);for(let a=0;a<t;a++){if(n[a]!=="EN")continue;let u;for(u=a-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=a+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let a=0;a<t;a++){let u=n[a];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[a]="ON")}d=c;for(let a=0;a<t;a++){let u=n[a];u==="EN"?n[a]=d==="L"?"L":"EN":(u==="R"||u==="L")&&(d=u)}for(let a=0;a<t;a++){if(n[a]!=="ON")continue;let u=a+1;for(;u<t&&n[u]==="ON";)u++;let b=a>0?n[a-1]:c,m=u<t?n[u]:c,y=b!=="L"?"R":"L";if(y===(m!=="L"?"R":"L"))for(let T=a;T<u;T++)n[T]=y;a=u-1}for(let a=0;a<t;a++)n[a]==="ON"&&(n[a]=l);for(let a=0;a<t;a++){let u=n[a];(i[a]&1)===0?u==="R"?i[a]++:(u==="AN"||u==="EN")&&(i[a]+=2):(u==="L"||u==="AN"||u==="EN")&&i[a]++}return i}function Dt(e,t){let n=fn(e);if(n===null)return null;let r=new Int8Array(t.length);for(let o=0;o<t.length;o++)r[o]=n[t[o]];return r}var pn=/[ \t\n\r\f]+/g,hn=/[\t\n\r\f]| {2,}|^ | $/;function gn(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function yn(e){if(!hn.test(e))return e;let t=e.replace(pn," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function bn(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
11
+ `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(o=>{o.classList.add("__hf-flash"),setTimeout(()=>o.classList.remove("__hf-flash"),t)})}catch{}}var $e=null;function ht(e){$e=e}function Ce(e,t){if($e)try{$e({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch{}}function gt(e){let t=[];return{name:"css",discover:()=>{t=[];let n=document.querySelectorAll("*");for(let s of n){if(!(s instanceof HTMLElement))continue;let o=window.getComputedStyle(s);!o.animationName||o.animationName==="none"||t.push({el:s,baseDelay:s.style.animationDelay||"",basePlayState:s.style.animationPlayState||""})}},seek:n=>{let s=Number(n.time)||0;for(let o of t){if(!o.el.isConnected)continue;let i=e?.resolveStartSeconds?e.resolveStartSeconds(o.el):Number.parseFloat(o.el.getAttribute("data-start")??"0")||0,l=Math.max(0,s-i);o.el.style.animationPlayState="paused",o.el.style.animationDelay=`-${l.toFixed(3)}s`}},pause:()=>{for(let n of t)n.el.isConnected&&(n.el.style.animationPlayState=n.basePlayState||"paused",n.baseDelay&&(n.el.style.animationDelay=n.baseDelay))},revert:()=>{t=[]}}}function yt(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let s=Math.max(0,Number(t.time)||0);typeof n.totalTime=="function"?n.totalTime(s,!1):n.seek(s,!1)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Lt(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],s=new Set(n);for(let o of t)s.has(o)||n.push(o);window.__hfLottie=n}}}catch{}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let s of n)try{if(bt(s))s.goToAndStop(t*1e3,!1);else if(St(s)){if(typeof s.setCurrentRawFrameValue=="function"){let o=s.totalFrames??0,i=s.frameRate??30,l=t*i;o>0&&s.setCurrentRawFrameValue(Math.min(l,o-1))}else if(typeof s.seek=="function"){let o=s.duration??1,i=Math.min(100,t/o*100);s.seek(i)}}}catch{}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(bt(t)||St(t))&&t.pause()}catch{}},revert:()=>{}}}function bt(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function St(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function At(){let e=null,t=0;return{name:"three",discover:()=>{},seek:n=>{e=Math.max(0,Number(n.time)||0),t=e,window.__hfThreeTime=e;try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:{time:e}}))}catch{}},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0}}}function kt(){return{name:"waapi",discover:()=>{},seek:e=>{if(!document.getAnimations)return;let t=Math.max(0,(Number(e.time)||0)*1e3);for(let n of document.getAnimations())try{n.pause(),n.currentTime=t}catch{}},pause:()=>{if(document.getAnimations)for(let e of document.getAnimations())try{e.pause()}catch{}}}}function xt(e){let t=Array.from(document.querySelectorAll("video[data-start], audio[data-start]")),n=[],s=[],o=0;for(let i of t){let l=e?.resolveStartSeconds?e.resolveStartSeconds(i):Number.parseFloat(i.dataset.start??"0");if(!Number.isFinite(l))continue;let d=Number.parseFloat(i.dataset.playbackStart??i.dataset.mediaStart??"0")||0,c=i.defaultPlaybackRate,r=Number.isFinite(c)&&c>0?Math.max(.1,Math.min(5,c)):1,u=i.loop,g=Number.isFinite(i.duration)&&i.duration>0?i.duration:null,m=Number.parseFloat(i.dataset.duration??"");(!Number.isFinite(m)||m<=0)&&g!=null&&(m=Math.max(0,(g-d)/r));let b=Number.isFinite(m)&&m>0?l+m:Number.POSITIVE_INFINITY,T=Number.parseFloat(i.dataset.volume??""),M={el:i,start:l,mediaStart:d,duration:Number.isFinite(m)&&m>0?m:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(T)?T:null,playbackRate:r,loop:u,sourceDuration:g};n.push(M),i.tagName==="VIDEO"&&s.push(M),Number.isFinite(b)&&(o=Math.max(o,b))}return{timedMediaEls:t,mediaClips:n,videoClips:s,maxMediaEnd:o}}function Et(e){for(let t of e.clips){let{el:n}=t;if(!n.isConnected)continue;let s=(e.timeSeconds-t.start)*t.playbackRate+t.mediaStart;if(e.timeSeconds>=t.start&&e.timeSeconds<t.end&&s>=0){if(t.loop&&t.sourceDuration!=null&&t.sourceDuration>0){let i=t.sourceDuration-t.mediaStart;i>0&&s>=t.sourceDuration&&(s=t.mediaStart+(s-t.mediaStart)%i)}t.volume!=null&&(n.volume=t.volume);try{n.playbackRate=t.playbackRate*e.playbackRate}catch{}if(Math.abs((n.currentTime||0)-s)>.3)try{n.currentTime=s}catch{}e.playing&&n.paused?n.play().catch(()=>{}):!e.playing&&!n.paused&&n.pause();continue}n.paused||n.pause()}}function wt(e){let t=!1,n=null,s=null,o=null,i=null;function l(y,A){try{window.dispatchEvent(new CustomEvent(y,{detail:A}))}catch{}}function d(y){o=y,l("hyperframe:picker:hovered",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function c(y){i=y,l("hyperframe:picker:selected",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function r(y){if(!y||y===document.body||y===document.documentElement)return!1;let A=y.tagName.toLowerCase();return!(A==="script"||A==="style"||A==="link"||A==="meta"||y.classList.contains("__hf-pick-highlight"))}function u(y){let A=y;if(A.id)return`#${A.id}`;let N=y.getAttribute("data-composition-id");if(N)return`[data-composition-id="${N}"]`;let R=y.getAttribute("data-composition-src");if(R)return`[data-composition-src="${R}"]`;let F=y.getAttribute("data-track-index");if(F)return`[data-track-index="${F}"]`;let E=y.tagName.toLowerCase(),k=y.parentElement;if(!k)return E;let C=k.querySelectorAll(`:scope > ${E}`);if(C.length===1)return E;for(let W=0;W<C.length;W+=1)if(C[W]===y)return`${E}:nth-of-type(${W+1})`;return E}function g(y){let A=y.tagName.toLowerCase(),N=(y.textContent??"").trim().replace(/\s+/g," "),R=(F,E)=>F.length>E?`${F.slice(0,E-1)}\u2026`:F;return A==="h1"||A==="h2"||A==="h3"?"Heading":A==="p"||A==="span"||A==="div"?N.length>0?R(N,56):"Text":A==="img"?"Image":A==="video"?"Video":A==="audio"?"Audio":A==="svg"?"Shape":y.getAttribute("data-composition-src")?"Composition":A==="section"?"Section":`${A.charAt(0).toUpperCase()}${A.slice(1)}`}function m(y,A,N){let R=typeof N=="number"&&N>0?N:8,F=[];if(document.elementsFromPoint)F=document.elementsFromPoint(y,A);else if(document.elementFromPoint){let C=document.elementFromPoint(y,A);F=C?[C]:[]}let E={},k=[];for(let C=0;C<F.length;C+=1){let W=F[C];if(!r(W))continue;let Y=`${W.tagName}::${W.id||""}::${C}`;if(!E[Y]&&(E[Y]=!0,k.push(W),k.length>=R))break}return k}function b(y){let A=y.getBoundingClientRect(),N={};for(let F=0;F<y.attributes.length;F+=1){let E=y.attributes[F];E.name.startsWith("data-")&&(N[E.name]=E.value)}return{id:y.id||null,tagName:y.tagName.toLowerCase(),selector:u(y),label:g(y),boundingBox:{x:A.left,y:A.top,width:A.width,height:A.height},textContent:y.textContent?y.textContent.trim().slice(0,200):null,src:y.getAttribute("src")||y.getAttribute("data-composition-src")||null,dataAttributes:N}}function T(y,A,N){return m(y,A,N).map(b)}function M(y){if(!t)return;let N=m(y.clientX,y.clientY,1)[0]??(y.target instanceof Element?y.target:null);if(!r(N)||n===N)return;n&&n.classList.remove("__hf-pick-highlight"),n=N,N.classList.add("__hf-pick-highlight");let R=b(N);d(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function _(y){if(!t)return;y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation();let A=T(y.clientX,y.clientY,8);A.length!==0&&(d(A[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:A,selectedIndex:0,point:{x:y.clientX,y:y.clientY}}))}function V(y){y.key==="Escape"&&(z(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function ee(){t||(t=!0,s=document.createElement("style"),s.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(s),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",M,!0),document.addEventListener("click",_,!0),document.addEventListener("keydown",V,!0),l("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function z(){t&&(t=!1,n&&(n.classList.remove("__hf-pick-highlight"),n=null),s&&(s.remove(),s=null),document.body.classList.remove("__hf-pick-active"),document.removeEventListener("mousemove",M,!0),document.removeEventListener("click",_,!0),document.removeEventListener("keydown",V,!0),l("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function U(){window.__HF_PICKER_API={enable:ee,disable:z,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(y,A,N)=>Number.isFinite(y)&&Number.isFinite(A)?T(y,A,N):[],pickAtPoint:(y,A,N)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return null;let R=T(y,A,8);if(!R.length)return null;let F=Math.max(0,Math.min(R.length-1,Number(N??0))),E=R[F]??null;return E?(c(E),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:E}),z(),E):null},pickManyAtPoint:(y,A,N)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return[];let R=T(y,A,8);if(!R.length)return[];let F=[],E=Array.isArray(N)?N:[0];for(let k of E){let C=Math.max(0,Math.min(R.length-1,Math.floor(Number(k)))),W=R[C];if(!W)continue;F.some(q=>q.selector===W.selector&&q.tagName===W.tagName)||F.push(W)}return F.length?(c(F[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:F}),z(),F):[]}},l("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:ee,disablePickMode:z,installPickerApi:U}}function Tt(e,t){let n=Number.isFinite(t)&&t>0?t:30,s=Number.isFinite(e)&&e>0?e:0;return Math.floor(s*n+1e-9)/n}function Mt(e,t,n){let s=Tt(t,n);return e.pause(),typeof e.totalTime=="function"?e.totalTime(s,!1):e.seek(s,!1),s}function Nt(e){return{_timeline:null,play:()=>{let t=e.getTimeline();if(!t||e.getIsPlaying())return;let n=Math.max(0,Number(e.getSafeDuration?.()??t.duration()??0)||0);n>0&&Math.max(0,Number(t.time())||0)>=n&&(t.pause(),t.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof t.timeScale=="function"&&t.timeScale(e.getPlaybackRate()),t.play(),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let t=e.getTimeline();if(!t)return;t.pause();let n=Math.max(0,Number(t.time())||0);e.onDeterministicSeek(n),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(n,!1),e.onRenderFrameSeek(n),e.onStatePost(!0)},seek:t=>{let n=e.getTimeline();if(!n)return;let s=Math.max(0,Number(t)||0),o=Mt(n,s,e.getCanonicalFps());e.onDeterministicSeek(o),e.setIsPlaying(!1),e.onSyncMedia(o,!1),e.onRenderFrameSeek(o),e.onStatePost(!0)},renderSeek:t=>{let n=e.getTimeline();if(!n)return;let s=Mt(n,t,e.getCanonicalFps());e.onDeterministicSeek(s),e.setIsPlaying(!1),e.onSyncMedia(s,!1),e.onRenderFrameSeek(s),e.onStatePost(!0)},getTime:()=>Number(e.getTimeline()?.time()??0),getDuration:()=>Number(e.getTimeline()?.duration()??0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:t=>e.setPlaybackRate(t),getPlaybackRate:()=>e.getPlaybackRate()}}function vt(){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 Pe(e){let t=Number(e);return Number.isFinite(t)?t:null}function rn(e){let t=(e??"").trim();if(!t)return null;let n=Pe(t);if(n!=null)return{kind:"absolute",value:n};let s=t.match(/^([A-Za-z0-9_.:-]+)(?:\s*([+-])\s*([0-9]*\.?[0-9]+))?$/);if(!s)return null;let o=(s[1]??"").trim();if(!o)return null;let i=s[2]??"+",l=s[3]??"0",d=Number.parseFloat(l),c=Number.isFinite(d)?Math.max(0,d):0,r=i==="-"?-c:c;return{kind:"reference",refId:o,offset:r}}function we(e){let t=e.timelineRegistry??{},n=new WeakMap,s=new WeakMap,o=new Set,i=c=>{let r=document.getElementById(c);return r||(document.querySelector(`[data-composition-id="${CSS.escape(c)}"]`)??null)},l=c=>{let r=s.get(c);if(r!==void 0)return r;let u=null,g=Pe(c.getAttribute("data-duration"));if(g!=null&&g>0&&(u=g),u==null||u<=0){let m=Pe(c.getAttribute("data-end"));if(m!=null){let b=d(c,0),T=m-b;Number.isFinite(T)&&T>0&&(u=T)}}if((u==null||u<=0)&&c instanceof HTMLMediaElement){let m=Pe(c.getAttribute("data-playback-start"))??Pe(c.getAttribute("data-media-start"))??0;Number.isFinite(c.duration)&&c.duration>m&&(u=c.duration-m)}if(u==null||u<=0){let m=c.getAttribute("data-composition-id");if(m){let b=t[m]??null;if(b&&typeof b.duration=="function")try{let T=Number(b.duration());Number.isFinite(T)&&T>0&&(u=T)}catch{}}}return u!=null&&Number.isFinite(u)&&u>0?(s.set(c,u),u):(s.set(c,null),null)},d=(c,r)=>{let u=n.get(c);if(u!==void 0)return u??r;if(o.has(c))return r;o.add(c);try{let g=rn(c.getAttribute("data-start"));if(!g){if(c.hasAttribute("data-composition-id")){let _=c.parentElement;if(_&&(_.hasAttribute("data-composition-src")||_.hasAttribute("data-composition-id"))){let V=d(_,r);return n.set(c,V),V}}return n.set(c,r),r}if(g.kind==="absolute"){let _=Math.max(0,g.value);return n.set(c,_),_}let m=i(g.refId);if(!m)return n.set(c,r),r;let b=d(m,0),T=l(m);if(T==null||T<=0){let _=Math.max(0,b+g.offset);return n.set(c,_),_}let M=Math.max(0,b+T+g.offset);return n.set(c,M),M}finally{o.delete(c)}};return{resolveStartForElement:(c,r=0)=>d(c,Math.max(0,r)),resolveDurationForElement:c=>l(c)}}function ue(e){let t=Number(e);return Number.isFinite(t)?t:null}var Rt={composition:0,video:1,image:2,element:3,audio:4};function sn(e){if(e.length===0)return;let t=new Map;for(let l of e){let d=t.get(l.track)??new Set;d.add(l.kind),t.set(l.track,d)}if(!Array.from(t.values()).some(l=>l.size>1))return;let s=0,o=new Map,i=[...t.keys()].sort((l,d)=>l-d);for(let l of i){let d=t.get(l);if(d.size===1)o.set(`${l}:${[...d][0]}`,s++);else{let c=[...d].sort((r,u)=>(Rt[r]??99)-(Rt[u]??99));for(let r of c)o.set(`${l}:${r}`,s++)}}for(let l of e){let d=`${l.track}:${l.kind}`,c=o.get(d);c!=null&&(l.track=c)}}function Fe(e){let t=String(e??"").trim();if(!t)return null;let n=t.toLowerCase();if(n.startsWith("data:")||n.startsWith("javascript:"))return null;try{return new URL(t,document.baseURI).toString()}catch{return t}}function an(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Fe(t);let n=e.getAttribute("data-composition-src");if(n)return Fe(n);let s=e.querySelector("img[src], video[src], audio[src], source[src]");return s?Fe(s.getAttribute("src")):null}function Ct(e){let n=window.__timelines??{},s=we({timelineRegistry:n}),o=S=>{if(!S)return null;let h=n[S]??null;if(!h||typeof h.duration!="function")return null;try{let w=Number(h.duration());return Number.isFinite(w)&&w>0?w:null}catch{return null}},i=S=>{let h=ue(S.getAttribute("data-duration"));if(h!=null&&h>0)return h;let w=ue(S.getAttribute("data-playback-start"))??ue(S.getAttribute("data-media-start"))??0;return Number.isFinite(S.duration)&&S.duration>w?Math.max(0,S.duration-w):null},l=()=>{let S=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(S.length===0)return null;let h=0;for(let w of S){let P=s.resolveStartForElement(w,0);if(!Number.isFinite(P))continue;let G=i(w);G==null||G<=0||(h=Math.max(h,Math.max(0,P)+G))}return h>0?h:null},d=S=>{let h=S.trim().toLowerCase();return!(!h||h==="main"||h.includes("caption")||h.includes("ambient"))},c=(S,h)=>{let w=[],P=null,G=null,I=null,D=S.parentElement;for(;D;){let B=D.getAttribute("data-composition-id");B&&(w.push(B),!I&&D!==h&&(I=B),P==null&&(P=s.resolveStartForElement(D,0)),G==null&&(G=ue(D.getAttribute("data-duration"))??o(B)??null)),D=D.parentElement}return{parentCompositionId:I,compositionAncestors:w.reverse(),inheritedStart:P,inheritedDuration:G}},r=document.querySelector("[data-composition-id]"),u=r?.getAttribute("data-composition-id")??null,g=r?s.resolveStartForElement(r,0):0,m=l(),b=m!=null?Math.max(0,m-Math.max(0,g)):null,T=o(u),M=ue(r?.getAttribute("data-duration")),_=typeof T=="number"&&Number.isFinite(T)&&T>0?T:null,V=typeof M=="number"&&Number.isFinite(M)&&M>0?M:null,ee=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,z=_!=null&&ee!=null&&_>ee+1,U=V??(z?ee:_??ee),y=U!=null?Math.min(U,e.maxTimelineDurationSeconds):null,N=(y!=null?g+y:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),R=(S,h)=>!Number.isFinite(h)||h<=0?0:N==null||!Number.isFinite(N)?h:!Number.isFinite(S)||S>=N?0:Math.max(0,Math.min(h,N-S)),F=Array.from(document.querySelectorAll("[data-composition-id]")),E=[],k=[],C=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),W=0;for(let S=0;S<C.length;S+=1){let h=C[S];if(h===r||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(h.tagName))continue;let w=c(h,r),P=s.resolveStartForElement(h,w.inheritedStart??0),G=h.getAttribute("data-composition-id"),I=ue(h.getAttribute("data-duration"));if((I==null||I<=0)&&G&&G!==u&&(I=o(G)),(I==null||I<=0)&&h instanceof HTMLMediaElement){let ae=ue(h.getAttribute("data-playback-start"))??ue(h.getAttribute("data-media-start"))??0;Number.isFinite(h.duration)&&h.duration>0&&(I=Math.max(0,h.duration-ae))}if(I==null||I<=0){let ae=w.inheritedDuration;if(ae!=null&&ae>0){let fe=(w.inheritedStart??0)+ae;I=Math.max(0,fe-P)}}if(I==null||I<=0||(I=R(P,I),I<=0))continue;let D=P+I;W=Math.max(W,D);let B=h.tagName.toLowerCase(),me=G&&G!==u?"composition":B==="video"?"video":B==="audio"?"audio":B==="img"?"image":"element";E.push({id:h.id||G||`__node__index_${S}`,label:h.getAttribute("data-timeline-label")??h.getAttribute("data-label")??h.getAttribute("aria-label")??G??h.id??h.className?.split(" ")[0]??me,start:P,duration:I,track:Number.parseInt(h.getAttribute("data-track-index")??h.getAttribute("data-track")??String(S),10)||0,kind:me,tagName:B,compositionId:h.getAttribute("data-composition-id"),compositionAncestors:w.compositionAncestors,parentCompositionId:w.parentCompositionId,nodePath:null,compositionSrc:Fe(h.getAttribute("data-composition-src")),assetUrl:an(h),timelineRole:h.getAttribute("data-timeline-role"),timelineLabel:h.getAttribute("data-timeline-label"),timelineGroup:h.getAttribute("data-timeline-group"),timelinePriority:ue(h.getAttribute("data-timeline-priority"))})}let Y=new Set(E.map(S=>S.id)),q=r?.getAttribute("data-composition-id")??null,K=q?n[q]??null:null;if(K&&r){let S=K;if(typeof S.getChildren=="function")try{let h=S.getChildren(!0,!0,!1)??[],w=new Map;for(let I of r.children){let D=I;if(!D.id)continue;let B=D.tagName.toLowerCase();B==="script"||B==="style"||B==="link"||w.set(D,{id:D.id,start:1/0,end:-1/0})}let P=I=>{let D=I;for(;D;){if(w.has(D))return D;if(D===r)return null;D=D.parentElement}return null};for(let I of h){if(typeof I.targets!="function"||typeof I.startTime!="function"||typeof I.duration!="function")continue;let D=I.startTime(),B=I.parent;for(;B&&typeof B.startTime=="function";)D+=B.startTime(),B=B.parent;let me=D+I.duration();if(!(!Number.isFinite(D)||!Number.isFinite(me)))for(let ae of I.targets()){if(!(ae instanceof Element))continue;let ve=P(ae);if(!ve)continue;let fe=w.get(ve);fe&&(fe.start=Math.min(fe.start,D),fe.end=Math.max(fe.end,me))}}let G=E.length>0?Math.max(...E.map(I=>I.track))+1:0;for(let[I,D]of w){if(D.start===1/0||D.end===-1/0)continue;let B=I;if(Y.has(B.id))continue;let me=Math.max(0,D.end-D.start);if(me<=0)continue;let ae=R(D.start,me);ae<=0||(W=Math.max(W,D.start+ae),E.push({id:B.id,label:B.getAttribute("data-timeline-label")??B.getAttribute("data-label")??B.getAttribute("aria-label")??B.id,start:D.start,duration:ae,track:Number.parseInt(B.getAttribute("data-track-index")??B.getAttribute("data-track")??"",10)||G,kind:"element",tagName:B.tagName.toLowerCase(),compositionId:B.getAttribute("data-composition-id"),compositionAncestors:q?[q]:[],parentCompositionId:q,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:B.getAttribute("data-timeline-role"),timelineLabel:B.getAttribute("data-timeline-label"),timelineGroup:B.getAttribute("data-timeline-group"),timelinePriority:ue(B.getAttribute("data-timeline-priority"))}),Y.add(B.id))}}catch{}}if(r&&y!=null&&y>0){let S=E.length>0?Math.max(...E.map(h=>h.track))+1:0;for(let h of r.children){let w=h;if(!w.id||Y.has(w.id))continue;let P=w.tagName.toLowerCase();if(P==="script"||P==="style"||P==="link"||P==="meta"||window.getComputedStyle(w).display==="none")continue;let I=R(0,y);I<=0||(W=Math.max(W,I),E.push({id:w.id,label:w.getAttribute("data-timeline-label")??w.getAttribute("data-label")??w.getAttribute("aria-label")??w.id,start:0,duration:I,track:Number.parseInt(w.getAttribute("data-track-index")??w.getAttribute("data-track")??"",10)||S,kind:"element",tagName:P,compositionId:w.getAttribute("data-composition-id"),compositionAncestors:q?[q]:[],parentCompositionId:q,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:w.getAttribute("data-timeline-role"),timelineLabel:w.getAttribute("data-timeline-label"),timelineGroup:w.getAttribute("data-timeline-group"),timelinePriority:ue(w.getAttribute("data-timeline-priority"))}),Y.add(w.id))}}sn(E);for(let S of F){if(S===r)continue;let h=S.getAttribute("data-composition-id");if(!h||!d(h))continue;let w=s.resolveStartForElement(S,0),P=ue(S.getAttribute("data-duration")),G=o(h),I=P&&P>0?P:G;if(I==null||I<=0)continue;let D=R(w,I);D<=0||k.push({id:h,label:S.getAttribute("data-label")??h,start:w,duration:D,thumbnailUrl:Fe(S.getAttribute("data-thumbnail-url")),avatarName:null})}let H=Math.max(1,Math.min(W||1,e.maxTimelineDurationSeconds));return{source:"hf-preview",type:"timeline",durationInFrames:z&&V==null?Number.POSITIVE_INFINITY:Math.max(1,Math.round(H*Math.max(1,e.canonicalFps))),clips:E,scenes:k,compositionWidth:ue(r?.getAttribute("data-width"))??1920,compositionHeight:ue(r?.getAttribute("data-height"))??1080}}var ln=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,un=e=>new Promise(t=>{let n=!1,s=Date.now(),o=null,i=l=>{n||(n=!0,o!=null&&window.clearTimeout(o),t({status:l,elapsedMs:Math.max(0,Date.now()-s)}))};e.addEventListener("load",()=>i("load"),{once:!0}),e.addEventListener("error",()=>i("error"),{once:!0}),o=window.setTimeout(()=>i("timeout"),8e3)});function Ve(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Pt(e,t){let n=e.trim();if(!n)return e;try{return ln.test(n)?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}async function Ke(e){let t=null;e.hostCompositionId&&(t=Array.from(e.sourceNode.querySelectorAll("[data-composition-id]")).find(r=>r.getAttribute("data-composition-id")===e.hostCompositionId)??null);let n=t??e.sourceNode;if(e.headStyles)for(let c of e.headStyles){let r=c.cloneNode(!0);r instanceof HTMLStyleElement&&(document.head.appendChild(r),e.injectedStyles.push(r))}let s=Array.from(n.querySelectorAll("style"));for(let c of s){let r=c.cloneNode(!0);r instanceof HTMLStyleElement&&(document.head.appendChild(r),e.injectedStyles.push(r))}let o=[];if(e.headScripts)for(let c of e.headScripts){let r=c.getAttribute("type")?.trim()??"",u=c.getAttribute("src")?.trim()??"";if(u){let g=Pt(u,e.compositionUrl);o.push({kind:"external",src:g,type:r})}else{let g=c.textContent?.trim()??"";g&&o.push({kind:"inline",content:g,type:r})}}let i=Array.from(n.querySelectorAll("script")),l=[...o];for(let c of i){let r=c.getAttribute("type")?.trim()??"",u=c.getAttribute("src")?.trim()??"";if(u){let g=Pt(u,e.compositionUrl);l.push({kind:"external",src:g,type:r})}else{let g=c.textContent?.trim()??"";g&&l.push({kind:"inline",content:g,type:r})}c.parentNode?.removeChild(c)}let d=Array.from(n.querySelectorAll("style"));for(let c of d)c.parentNode?.removeChild(c);if(t){let c=document.importNode(t,!0),r=t.getAttribute("data-width"),u=t.getAttribute("data-height"),g=e.parseDimensionPx(r),m=e.parseDimensionPx(u);c.style.position="relative",c.style.width=g||"100%",c.style.height=m||"100%",g&&c.style.setProperty("--comp-width",g),m&&c.style.setProperty("--comp-height",m),r&&e.host.setAttribute("data-width",r),u&&e.host.setAttribute("data-height",u),g&&e.host instanceof HTMLElement&&(e.host.style.width=g),m&&e.host instanceof HTMLElement&&(e.host.style.height=m),e.host.appendChild(c)}else e.hasTemplate?e.host.appendChild(document.importNode(n,!0)):e.host.innerHTML=e.fallbackBodyInnerHtml;for(let c of l){let r=document.createElement("script");if(c.type&&(r.type=c.type),r.async=!1,c.kind==="external"?r.src=c.src:c.type.toLowerCase()==="module"?r.textContent=c.content:r.textContent=`(function(){${c.content}})();`,document.body.appendChild(r),e.injectedScripts.push(r),c.kind==="external"){let u=await un(r);u.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.hostCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:c.src,loadStatus:u.status,elapsedMs:u.elapsedMs}})}}}async function Ft(e){let t=Array.from(document.querySelectorAll("[data-composition-id]:not([data-composition-src])")).filter(n=>{if(n.children.length>0)return!1;let s=n.getAttribute("data-composition-id");return s?!!document.querySelector(`template#${CSS.escape(s)}-template`):!1});if(t.length!==0)for(let n of t){let s=n.getAttribute("data-composition-id"),o=document.querySelector(`template#${CSS.escape(s)}-template`);Ve(n),await Ke({host:n,hostCompositionId:s,hostCompositionSrc:`template#${s}-template`,sourceNode:o.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function It(e){let t=Array.from(document.querySelectorAll("[data-composition-src]"));t.length!==0&&await Promise.all(t.map(async n=>{let s=n.getAttribute("data-composition-src");if(!s)return;let o=null;try{o=new URL(s,document.baseURI)}catch{o=null}Ve(n);try{let i=n.getAttribute("data-composition-id"),l=i!=null?document.querySelector(`template#${CSS.escape(i)}-template`):null;if(l){await Ke({host:n,hostCompositionId:i,hostCompositionSrc:s,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:o,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let d=await fetch(s);if(!d.ok)throw new Error(`HTTP ${d.status}`);let c=await d.text(),u=new DOMParser().parseFromString(c,"text/html"),g=(i?u.querySelector(`template#${CSS.escape(i)}-template`):null)??u.querySelector("template"),m=g?g.content:u.body,b=g?void 0:Array.from(u.head.querySelectorAll("style")),T=g?void 0:Array.from(u.head.querySelectorAll("script"));await Ke({host:n,hostCompositionId:i,hostCompositionSrc:s,sourceNode:m,hasTemplate:!!g,fallbackBodyInnerHtml:u.body.innerHTML,compositionUrl:o,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,parseDimensionPx:e.parseDimensionPx,headStyles:b,headScripts:T,onDiagnostic:e.onDiagnostic})}catch(i){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:n.getAttribute("data-composition-id"),hostCompositionSrc:s,errorMessage:i instanceof Error?i.message:"unknown_error"}}),Ve(n)}}))}function Je(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=[],s=document.querySelectorAll(".caption-group");for(let o of s){let i=o.querySelectorAll(":scope > span");for(let l of i)n.push(l)}for(let o of t){let i=null;if(o.wordId&&(i=document.getElementById(o.wordId)),!i&&o.wordIndex!==void 0&&(i=n[o.wordIndex]??null),!i||!(i instanceof HTMLElement))continue;let l={},d={};if(o.x!==void 0&&(l.x=o.x),o.y!==void 0&&(l.y=o.y),o.scale!==void 0&&(l.scale=o.scale),o.rotation!==void 0&&(l.rotation=o.rotation),o.opacity!==void 0&&(d.opacity=o.opacity),o.fontSize!==void 0&&(d.fontSize=`${o.fontSize}px`),o.fontWeight!==void 0&&(d.fontWeight=o.fontWeight),o.fontFamily!==void 0&&(d.fontFamily=o.fontFamily),o.activeColor||o.dimColor){let r=e.getTweensOf(i).filter(g=>g.vars.color!==void 0).sort((g,m)=>g.startTime()-m.startTime()),u=r.length>0?String(r[0].vars.color):"";for(let g of r)String(g.vars.color)===u?o.dimColor&&(g.vars.color=o.dimColor):o.activeColor&&(g.vars.color=o.activeColor);o.dimColor&&e.set(i,{color:o.dimColor})}if(Object.keys(d).length>0&&e.set(i,d),Object.keys(l).length>0){let c=document.createElement("span");c.style.display="inline-block",c.dataset.captionWrapper="true",i.parentNode?.insertBefore(c,i),c.appendChild(i),e.set(c,l)}}}).catch(()=>{})}function Dt(){let e=vt(),t=window,n=null,s=null,o=[],i=new Set,l=null;if(typeof t.__hfRuntimeTeardown=="function")try{t.__hfRuntimeTeardown()}catch{}document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden"),window.__timelines=window.__timelines||{};let d=a=>{o.push(a)},c=(a,p,f)=>{let x=f??`${a}:${JSON.stringify(p)}`;i.has(x)||(i.add(x),le({source:"hf-preview",type:"diagnostic",code:a,details:p}))},r=a=>{let p={scale:1,focusX:960,focusY:540},f=[],x=[],L={time:a.getTime(),duration:a.getDuration(),isPlaying:a.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:a.play,pause:a.pause,seek:a.seek,getTime:a.getTime,getDuration:a.getDuration,isPlaying:a.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>f,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:a.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>x,getRenderState:()=>({...L,time:a.getTime(),duration:a.getDuration(),isPlaying:a.isPlaying()})}},u=1/60,g=.75,m=.75,b=.35,T=900,M=3,_=2,V=.05,ee=100,z=240,U=a=>{if(a instanceof Error)return a.message||String(a);if(typeof a=="string")return a;try{return JSON.stringify(a)}catch{return String(a??"")}},y=a=>{let p=a.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},A=a=>{if(a==null||a.trim()==="")return null;let p=Number.parseFloat(a);return!Number.isFinite(p)||p<=0?null:`${p}px`},N=()=>{let a=document.querySelector('[data-composition-id][data-root="true"]');if(a instanceof HTMLElement)return a;let p=Array.from(document.querySelectorAll("[data-composition-id]"));return p.length===0?null:p.find(f=>!f.parentElement?.closest("[data-composition-id]"))??p[0]??null},R=()=>{let a=N();if(!a)return;let p=A(a.getAttribute("data-width")),f=A(a.getAttribute("data-height"));p&&(a.style.width=p),f&&(a.style.height=f),p&&a.style.setProperty("--comp-width",p),f&&a.style.setProperty("--comp-height",f)},F=()=>{let a=N(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(f=>f.hasAttribute("data-duration")||f.hasAttribute("data-end"));for(let f of p)a&&f===a||(f.removeAttribute("data-duration"),f.removeAttribute("data-end"))},E=()=>{let a=N();if(!a)return;a.style.position||(a.style.position="relative"),a.style.overflow="hidden";let p=A(a.getAttribute("data-width")),f=A(a.getAttribute("data-height"));p&&(a.style.width=p),f&&(a.style.height=f);let x=Array.from(a.children);for(let L of x){let Z=L.tagName.toLowerCase();if(Z==="script"||Z==="style"||Z==="link"||Z==="meta"||!L.hasAttribute("data-start"))continue;let re=(L.style.top==="0px"||L.style.top==="0")&&(L.style.left==="0px"||L.style.left==="0")&&L.style.width==="100%"&&L.style.height==="100%",Se=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(L.style.transform);if(re&&Se&&!L.hasAttribute("data-width")&&!L.hasAttribute("data-height")){let ce=L.style.top,$=L.style.left,O=L.style.width,J=L.style.height;L.style.top="",L.style.left="",L.style.width="",L.style.height="";let j=window.getComputedStyle(L);j.top!=="auto"||j.bottom!=="auto"||j.left!=="auto"||j.right!=="auto"||j.width!=="0px"||j.height!=="0px"||(L.style.top=ce,L.style.left=$,L.style.width=O,L.style.height=J)}let te=window.getComputedStyle(L),X=te.position;if(X!=="absolute"&&X!=="fixed"&&(L.style.position="absolute"),!!L.style.top||!!L.style.bottom||te.top!=="auto"||te.bottom!=="auto"||(L.style.top="0"),!!L.style.left||!!L.style.right||te.left!=="auto"||te.right!=="auto"||(L.style.left="0"),Z!=="audio"){let ce=A(L.getAttribute("data-width")),$=A(L.getAttribute("data-height")),O=te.width!=="0px"&&te.width!=="auto",J=te.height!=="0px"&&te.height!=="auto";ce?!L.style.width&&!O&&(L.style.width=ce):!L.style.width&&te.width==="0px"&&(L.style.width="100%"),$?!L.style.height&&!J&&(L.style.height=$):!L.style.height&&te.height==="0px"&&(L.style.height="100%")}}},k=(a,p=0)=>we({timelineRegistry:window.__timelines??{}}).resolveStartForElement(a,p),C=a=>we({timelineRegistry:window.__timelines??{}}).resolveDurationForElement(a),W=!!document.querySelector("[data-composition-src]"),Y=!1;{let a=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of a){let f=p.getAttribute("data-composition-id");if(f&&p.children.length===0&&document.querySelector(`template#${CSS.escape(f)}-template`)){Y=!0;break}}}let q=!W&&!Y,K=a=>{if(!a||typeof a.duration!="function")return null;try{let p=Number(a.duration());return Number.isFinite(p)?Math.max(0,p):null}catch{return null}},H=a=>typeof a=="number"&&Number.isFinite(a)&&a>u,de=a=>{let p=Number(a.getAttribute("data-duration"));if(Number.isFinite(p)&&p>0)return p;let f=Number(a.getAttribute("data-playback-start")??a.getAttribute("data-media-start")??"0"),x=Number.isFinite(f)?Math.max(0,f):0;return Number.isFinite(a.duration)&&a.duration>x?Math.max(0,a.duration-x):null},v=()=>{let a=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(a.length===0)return null;let p=0;for(let f of a){let x=k(f,0);if(!Number.isFinite(x))continue;let L=de(f);L==null||L<=u||(p=Math.max(p,Math.max(0,x)+L))}return p>u?p:null},S=()=>{let a=v();return typeof a!="number"||!Number.isFinite(a)||a<=u?null:a},h=a=>H(a)?Math.max(u,a*g):u,w=(a,p=0)=>{let f=K(a),x=S(),L=Number.isFinite(p)&&p>u?p:0,Z=0;H(f)?Z=Math.max(f,L):H(x)?Z=Math.max(x,L):Z=L;let re=Math.max(1,Number(e.maxTimelineDurationSeconds)||1800);return Z>0?Math.max(0,Math.min(Z,re)):0},P=()=>{let a=window.__timelines??{},p=we({timelineRegistry:a}),f=S(),x=h(f),L=$=>{let O=document.querySelector(`[data-composition-id="${CSS.escape($)}"]`);return O?p.resolveStartForElement(O,0):0},Z=$=>{let O=window.gsap;if(!O||typeof O.timeline!="function")return null;let J=O.timeline({paused:!0});for(let j of $)J.add(j.timeline,L(j.compositionId));return J},re=($,O)=>{if(!H($))return null;let J=window.gsap;if(!J||typeof J.timeline!="function")return null;let j=J.timeline({paused:!0});if(O)try{j.add(O,0)}catch{}let Q=j;if(typeof Q.to=="function")try{Q.to({},{duration:$})}catch{}return j},Se=($,O)=>{let J=$;if(typeof J.getChildren!="function")return[];try{let j=J.getChildren(!0,!0,!0)??[];if(!Array.isArray(j))return[];let Q=[];for(let ie of O)if(!j.some(Le=>Le===ie.timeline))try{let Le=L(ie.compositionId);$.add(ie.timeline,Le),Q.push(ie.compositionId)}catch{}return Q}catch{return[]}},te=N(),X=te?.getAttribute("data-composition-id")??null;if(!X)return{timeline:null};let se=a[X]??null,ne=(()=>{if(!te)return[];let $=new Set,O=Array.from(te.querySelectorAll("[data-composition-id]")),J=[];for(let j of O){let Q=j.getAttribute("data-composition-id");if(!Q||Q===X||$.has(Q))continue;$.add(Q);let ie=a[Q]??null;if(!ie||typeof ie.play!="function"||typeof ie.pause!="function")continue;let Ee=K(ie);J.push({compositionId:Q,timeline:ie,durationSeconds:Ee??0})}return J})(),ce=$=>{for(let O of $){let J=O.timeline;if(typeof J.paused=="function")try{J.paused(!1)}catch{}}};if(ne.length>0&&ce(ne),se){let $=ne.length>0?Se(se,ne):[];if((ne.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+X+"'])"))&&(I=!0),$.length>0)try{let j=se.time();se.seek(j,!1)}catch{}let O=K(se);if(!H(O)&&ne.length>0){let j=ne.map(nn=>nn.compositionId),Q=Z(ne),ie=K(Q);if(Q&&H(ie))return{timeline:Q,selectedTimelineIds:j,selectedDurationSeconds:ie,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:x,selectedDurationSeconds:ie,mediaDurationFloorSeconds:f,selectedTimelineIds:j,autoNestedChildren:$}}};let Ee=re(f??0,se),Le=K(Ee);if(Ee&&H(Le))return{timeline:Ee,selectedTimelineIds:[X],selectedDurationSeconds:Le,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:f,selectedDurationSeconds:Le,selectedTimelineIds:[X],autoNestedChildren:$}}}}if(!H(O)&&ne.length===0){let j=re(f??0,se),Q=K(j);if(j&&H(Q))return{timeline:j,selectedTimelineIds:[X],selectedDurationSeconds:Q,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:f,selectedDurationSeconds:Q,selectedTimelineIds:[X]}}}}let J=te?.getAttribute("data-duration");if(J){let j=parseFloat(J);if(H(j)&&H(O)&&j>=O+.5){let Q=se;if(typeof Q.to=="function")try{Q.to({},{duration:0},j)}catch{}let ie=K(se);if(H(ie))return{timeline:se,selectedTimelineIds:[X],selectedDurationSeconds:ie,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:X,rootDurationSeconds:O,rootDeclaredDur:j,newDur:ie}}}}}return{timeline:se,selectedTimelineIds:[X],selectedDurationSeconds:O,mediaDurationFloorSeconds:f,diagnostics:$.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:X,selectedDurationSeconds:O,autoNestedChildren:$}}:void 0}}if(ne.length>0){let $=ne.map(j=>j.compositionId),O=Z(ne),J=K(O);if(O)return{timeline:O,selectedTimelineIds:$,selectedDurationSeconds:J,mediaDurationFloorSeconds:f,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:X,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:x,selectedDurationSeconds:J,mediaDurationFloorSeconds:f,selectedTimelineIds:$}}}}return{timeline:null}},G=()=>{let a=e.capturedTimeline;if(!a||typeof a.time!="function")return;let p=Number(a.time());Number.isFinite(p)&&(e.currentTime=Math.max(0,p))},I=!1,D=()=>{if(!q)return!1;let a=e.capturedTimeline,p=K(a),f=H(p);if(a&&f&&I)return!1;let x=P();return x.timeline?a&&a===x.timeline?(typeof a.timeScale=="function"&&a.timeScale(e.playbackRate),!1):(e.capturedTimeline=x.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),x.diagnostics&&le({source:"hf-preview",type:"diagnostic",code:x.diagnostics.code,details:x.diagnostics.details}),le({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:x.selectedTimelineIds??[],selectedDurationSeconds:x.selectedDurationSeconds??null,mediaDurationFloorSeconds:x.mediaDurationFloorSeconds??null}}),!0):!1},B=()=>{let a=N();if(!(a instanceof HTMLElement))return;let p=a.getBoundingClientRect(),f=Number(a.getAttribute("data-width")),x=Number(a.getAttribute("data-height")),L=window.getComputedStyle(a),Z=Number.isFinite(f)&&f>0&&Number.isFinite(x)&&x>0,re=p.width<=0||p.height<=0||a.clientWidth<=0||a.clientHeight<=0;!Z||!re||c("root_stage_layout_zero",{compositionId:a.getAttribute("data-composition-id")??null,declaredWidth:f,declaredHeight:x,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:a.clientWidth,clientHeight:a.clientHeight,display:L.display,visibility:L.visibility,overflow:L.overflow},`root-stage-layout-zero:${a.getAttribute("data-composition-id")??"unknown"}`)},me=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,B()}))},ae=()=>{n=a=>{let p=U(a.error??a.message).slice(0,z);if(!p)return;let f=y(p);le({source:"hf-preview",type:"diagnostic",code:f.code,details:{category:f.category,message:p,filename:a.filename||null,line:Number.isFinite(a.lineno)?a.lineno:null,column:Number.isFinite(a.colno)?a.colno:null}})},s=a=>{let p=U(a.reason).slice(0,z);if(!p)return;let f=y(p);le({source:"hf-preview",type:"diagnostic",code:`${f.code}_unhandled_rejection`,details:{category:`${f.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",n),window.addEventListener("unhandledrejection",s)},ve=()=>{let a=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let f of a){let x=()=>{if(!(f instanceof Element))return;let L=f.tagName.toLowerCase(),Z=f.getAttribute("src")??f.getAttribute("href")??f.getAttribute("poster")??null,re=L==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";c(re,{tagName:L,assetUrl:Z,currentSrc:(f instanceof HTMLImageElement||f instanceof HTMLMediaElement)&&f.currentSrc||null,readyState:f instanceof HTMLMediaElement?f.readyState:null,networkState:f instanceof HTMLMediaElement?f.networkState:null},`${re}:${L}:${Z??"unknown"}`)};f.addEventListener("error",x),d(()=>{f.removeEventListener("error",x)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let f=Array.from(p).filter(x=>x.status==="error").map(x=>x.family).filter(x=>!!x).slice(0,10);f.length!==0&&c("runtime_font_load_issue",{failedFamilies:f,totalFaces:Array.from(p).length},`runtime-font-load-issue:${f.join("|")}`)}).catch(()=>{})},fe=(a,p)=>{if(!a.timeline)return!1;let f=e.capturedTimeline;if(f&&f===a.timeline)return!1;let x=Math.max(0,e.currentTime||0),L=e.isPlaying;e.capturedTimeline=a.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{e.capturedTimeline.pause(),e.capturedTimeline.seek(x,!1),L&&e.capturedTimeline.play()}catch{}return le({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:x,selectedTimelineIds:a.selectedTimelineIds??[],selectedDurationSeconds:a.selectedDurationSeconds??null,mediaDurationFloorSeconds:a.mediaDurationFloorSeconds??null}}),!0},be=null,ut=!1,De=new Set,_e=()=>{e.tornDown||(be!=null&&window.clearTimeout(be),be=window.setTimeout(()=>{if(e.tornDown)return;be=null;let a=P();if(!a.timeline||!H(a.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){D()&&(ke(),he(!0));return}if(ut)return;let f=K(e.capturedTimeline),x=a.selectedDurationSeconds??K(a.timeline);H(x)&&(!H(f)||x>=f+V)&&fe(a,"manual")&&(ut=!0,le({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:f??null,selectedDurationSeconds:x??null,selectedTimelineIds:a.selectedTimelineIds??[],mediaDurationFloorSeconds:a.mediaDurationFloorSeconds??null}}),ke(),he(!0))},ee))},Xt=()=>{for(let a of De)a.removeEventListener("loadedmetadata",_e),a.removeEventListener("durationchange",_e);De.clear()},je=()=>{if(e.tornDown)return;let a=Array.from(document.querySelectorAll("video, audio"));for(let p of a)De.has(p)||(De.add(p),p.addEventListener("loadedmetadata",_e),p.addEventListener("durationchange",_e))},ct=()=>{let a=xt({resolveStartSeconds:x=>k(x,0)});Et({clips:a.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate});let p=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,f=Array.from(document.querySelectorAll("[data-start]"));for(let x of f){if(!(x instanceof HTMLElement))continue;let L=x.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta")continue;if(!x.getAttribute("data-composition-id")){let ce=x.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(ce&&ce!==p)continue}let re=k(x,0),Se=C(x),te=Se!=null&&Se>0?re+Se:Number.POSITIVE_INFINITY,X=te,se=x.getAttribute("data-composition-id");if(se&&!Number.isFinite(te)){let ne=(window.__timelines??{})[se];if(ne&&typeof ne.duration=="function"){let ce=ne.duration();ce>0&&(X=re+ce)}}let Ue=e.currentTime>=re&&(Number.isFinite(X)?e.currentTime<X:!0);x.style.visibility=Ue?"visible":"hidden"}},he=a=>{G();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),f=Date.now();(a||p!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||f-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=f,le({source:"hf-preview",type:"state",frame:p,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},ke=()=>{F(),R(),E();let a=N();if(a){let f=A(a.getAttribute("data-width")),x=A(a.getAttribute("data-height")),L=f?parseInt(f,10):0,Z=x?parseInt(x,10):0;L>0&&Z>0&&le({source:"hf-preview",type:"stage-size",width:L,height:Z})}D();let p=Ct({canonicalFps:e.canonicalFps,maxTimelineDurationSeconds:e.maxTimelineDurationSeconds});window.__clipManifest=p,le(p),me()},Re=(a,p=0)=>{for(let f of e.deterministicAdapters){try{a==="discover"&&f.discover(),a==="pause"&&f.pause(),a==="play"&&f.play&&f.play()}catch{}if(a==="discover")try{f.seek({time:p})}catch{}}};if(q)Je();else{let a={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,parseDimensionPx:A,onDiagnostic:({code:p,details:f})=>{le({source:"hf-preview",type:"diagnostic",code:p,details:f})}};It(a).then(()=>Ft(a)).finally(()=>{q=!0,Re("discover",e.currentTime),je(),ve(),Je(),ke(),he(!0)})}let We=wt({postMessage:a=>le(a)});We.installPickerApi();let dt=a=>{let p=Number(a);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let f=document.querySelectorAll("video, audio");for(let x of f)if(x instanceof HTMLMediaElement)try{x.playbackRate=e.playbackRate}catch{}},oe=Nt({getTimeline:()=>e.capturedTimeline,setTimeline:a=>{e.capturedTimeline=a},getIsPlaying:()=>e.isPlaying,setIsPlaying:a=>{e.isPlaying=a},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:dt,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(a,p)=>{e.currentTime=Math.max(0,Number(a)||0),e.isPlaying=p,ct()},onStatePost:he,onDeterministicSeek:a=>{for(let p of e.deterministicAdapters)try{p.seek({time:Number(a)||0})}catch{}},onDeterministicPause:()=>Re("pause"),onDeterministicPlay:()=>Re("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>w(e.capturedTimeline,0)});window.__player=r(oe),window.__playerReady=!0,window.__renderReady=!0,ht(le),Ce("composition_loaded",{duration:oe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=pt({onPlay:()=>{oe.play(),Ce("composition_played",{time:oe.getTime()})},onPause:()=>{oe.pause(),Ce("composition_paused",{time:oe.getTime()})},onSeek:(a,p)=>{let f=Math.max(0,a)/e.canonicalFps;oe.seek(f),Ce("composition_seeked",{time:f})},onSetMuted:a=>{e.bridgeMuted=a;let p=document.querySelectorAll("video, audio");for(let f of p)f instanceof HTMLMediaElement&&(f.muted=a)},onSetPlaybackRate:a=>dt(a),onEnablePickMode:()=>We.enablePickMode(),onDisablePickMode:()=>We.disablePickMode()}),D(),e.capturedTimeline&&(oe._timeline=e.capturedTimeline),q&&setTimeout(()=>{let a=e.capturedTimeline;D()&&e.capturedTimeline!==a&&(oe._timeline=e.capturedTimeline),Re("discover",e.currentTime),ke(),he(!0)},0),e.deterministicAdapters=[gt({resolveStartSeconds:a=>k(a,0)}),kt(),Lt(),At(),yt({getTimeline:()=>e.capturedTimeline})],ae(),Re("discover"),je(),e.timelinePollIntervalId&&clearInterval(e.timelinePollIntervalId);let ze=0,Be=null,mt=0,Ge=!1,xe=0,ft=()=>{mt=Date.now(),Ge=!1,xe=0};e.timelinePollIntervalId=setInterval(()=>{ze+=1;let p=e.isPlaying&&e.capturedTimeline!=null&&Math.max(0,e.currentTime||0)<_?!1:D();if(e.capturedTimeline&&!oe._timeline&&(oe._timeline=e.capturedTimeline),(p||ze%20===0)&&ke(),ze%10===0&&je(),G(),e.isPlaying&&e.capturedTimeline){let f=Math.max(0,e.currentTime||0),x=Be,L=w(e.capturedTimeline,0);if(L>0&&f>=L){oe.pause(),oe.seek(L),Be=L,xe=0,he(!0);return}if(x!=null&&x>=m&&f<=b?xe+=1:xe=0,!Ge&&xe>=M&&Date.now()-mt>T){let re=P();fe(re,"loop_guard")&&(Ge=!0,xe=0)}Be=Math.max(0,e.currentTime||0)}else Be=Math.max(0,e.currentTime||0);e.isPlaying&&ct(),he(!1)},50),ke(),he(!0);let en=oe.seek;oe.seek=a=>{ft(),en(a)};let tn=oe.renderSeek;oe.renderSeek=a=>{ft(),tn(a)};let qe=()=>{if(!e.tornDown){e.tornDown=!0,e.timelinePollIntervalId&&(clearInterval(e.timelinePollIntervalId),e.timelinePollIntervalId=null),be!=null&&(window.clearTimeout(be),be=null),l!=null&&(window.cancelAnimationFrame(l),l=null),Xt(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),n&&(window.removeEventListener("error",n),n=null),s&&(window.removeEventListener("unhandledrejection",s),s=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),We.disablePickMode();for(let a of e.deterministicAdapters)if(!(!a||typeof a.revert!="function"))try{a.revert()}catch{}e.deterministicAdapters=[];for(let a of o.splice(0))try{a()}catch{}for(let a of e.injectedCompStyles)try{a.remove()}catch{}e.injectedCompStyles=[];for(let a of e.injectedCompScripts)try{a.remove()}catch{}e.injectedCompScripts=[],e.capturedTimeline=null,t.__hfRuntimeTeardown===qe&&(t.__hfRuntimeTeardown=null)}};t.__hfRuntimeTeardown=qe,e.beforeUnloadHandler=qe,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var cn=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","ON","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],dn=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"];function mn(e){return e<=255?cn[e]:1424<=e&&e<=1524?"R":1536<=e&&e<=1791?dn[e&255]:1792<=e&&e<=2220?"AL":"L"}function fn(e){let t=e.length;if(t===0)return null;let n=new Array(t),s=0;for(let r=0;r<t;r++){let u=mn(e.charCodeAt(r));(u==="R"||u==="AL"||u==="AN")&&s++,n[r]=u}if(s===0)return null;let o=t/s<.3?0:1,i=new Int8Array(t);for(let r=0;r<t;r++)i[r]=o;let l=o&1?"R":"L",d=l,c=d;for(let r=0;r<t;r++)n[r]==="NSM"?n[r]=c:c=n[r];c=d;for(let r=0;r<t;r++){let u=n[r];u==="EN"?n[r]=c==="AL"?"AN":"EN":(u==="R"||u==="L"||u==="AL")&&(c=u)}for(let r=0;r<t;r++)n[r]==="AL"&&(n[r]="R");for(let r=1;r<t-1;r++)n[r]==="ES"&&n[r-1]==="EN"&&n[r+1]==="EN"&&(n[r]="EN"),n[r]==="CS"&&(n[r-1]==="EN"||n[r-1]==="AN")&&n[r+1]===n[r-1]&&(n[r]=n[r-1]);for(let r=0;r<t;r++){if(n[r]!=="EN")continue;let u;for(u=r-1;u>=0&&n[u]==="ET";u--)n[u]="EN";for(u=r+1;u<t&&n[u]==="ET";u++)n[u]="EN"}for(let r=0;r<t;r++){let u=n[r];(u==="WS"||u==="ES"||u==="ET"||u==="CS")&&(n[r]="ON")}c=d;for(let r=0;r<t;r++){let u=n[r];u==="EN"?n[r]=c==="L"?"L":"EN":(u==="R"||u==="L")&&(c=u)}for(let r=0;r<t;r++){if(n[r]!=="ON")continue;let u=r+1;for(;u<t&&n[u]==="ON";)u++;let g=r>0?n[r-1]:d,m=u<t?n[u]:d,b=g!=="L"?"R":"L";if(b===(m!=="L"?"R":"L"))for(let M=r;M<u;M++)n[M]=b;r=u-1}for(let r=0;r<t;r++)n[r]==="ON"&&(n[r]=l);for(let r=0;r<t;r++){let u=n[r];(i[r]&1)===0?u==="R"?i[r]++:(u==="AN"||u==="EN")&&(i[r]+=2):(u==="L"||u==="AN"||u==="EN")&&i[r]++}return i}function _t(e,t){let n=fn(e);if(n===null)return null;let s=new Int8Array(t.length);for(let o=0;o<t.length;o++)s[o]=n[t[o]];return s}var pn=/[ \t\n\r\f]+/g,hn=/[\t\n\r\f]| {2,}|^ | $/;function gn(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function yn(e){if(!hn.test(e))return e;let t=e.replace(pn," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function bn(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
13
13
  `).replace(/[\r\f]/g,`
14
14
  `):e.replace(/\r\n/g,`
15
- `)}var Ze=null,Sn;function Ln(){return Ze===null&&(Ze=new Intl.Segmenter(Sn,{granularity:"word"})),Ze}var An=/\p{Script=Arabic}/u,He=/\p{M}/u,Wt=/\p{Nd}/u;function Qe(e){return An.test(e)}function pe(e){for(let t of e){let n=t.codePointAt(0);if(n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=196608&&n<=201551||n>=63744&&n<=64255||n>=194560&&n<=195103||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519)return!0}return!1}var et=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011","\u3017","\u3019","\u301B","\u30FC","\u3005","\u303B","\u309D","\u309E","\u30FD","\u30FE"]),Ie=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),tt=new Set(["'","\u2019"]),Te=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),kn=new Set([":",".","\u060C","\u061B"]),xn=new Set(["\u104F"]),En=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function wn(e){if(nt(e))return!0;let t=!1;for(let n of e){if(Te.has(n)){t=!0;continue}if(!(t&&He.test(n)))return!1}return t}function Tn(e){for(let t of e)if(!et.has(t)&&!Te.has(t))return!1;return e.length>0}function Mn(e){if(nt(e))return!0;for(let t of e)if(!Ie.has(t)&&!tt.has(t)&&!He.test(t))return!1;return e.length>0}function nt(e){let t=!1;for(let n of e)if(!(n==="\\"||He.test(n))){if(Ie.has(n)||Te.has(n)||tt.has(n)){t=!0;continue}return!1}return t}function Nn(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(He.test(r)){n--;continue}if(Ie.has(r)||tt.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function vn(e,t){if(e.length===0)return!1;for(let n of e)if(n!==t)return!1;return!0}function Rn(e){return!Qe(e)||e.length===0?!1:kn.has(e[e.length-1])}function Cn(e){return e.length===0?!1:xn.has(e[e.length-1])}function Pn(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function it(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(En.has(n))return!0;if(!Te.has(n))return!1}return!1}function Fn(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
16
- `)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}function In(e,t,n,r){let o=[],i=null,l="",c=n,d=!1,a=0;for(let u of e){let b=Fn(u,r),m=b==="text"&&t;if(i!==null&&b===i&&m===d){l+=u,a+=u.length;continue}i!==null&&o.push({text:l,isWordLike:d,kind:i,start:c}),i=b,l=u,c=n+a,d=m,a+=u.length}return i!==null&&o.push({text:l,isWordLike:d,kind:i,start:c}),o}function Ye(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Dn=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function _n(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Dn.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Wn(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Bn(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),o=e.starts.slice();for(let l=0;l<e.len;l++){if(r[l]!=="text"||!_n(e,l))continue;let c=l+1;for(;c<e.len&&!Ye(r[c]);){t[l]+=t[c],n[l]=!0;let d=t[c].includes("?");if(r[c]="text",t[c]="",c++,d)break}}let i=0;for(let l=0;l<t.length;l++){let c=t[l];c.length!==0&&(i!==l&&(t[i]=c,n[i]=n[l],r[i]=r[l],o[i]=o[l]),i++)}return t.length=i,n.length=i,r.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:r,starts:o}}function Hn(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i];if(t.push(l),n.push(e.isWordLike[i]),r.push(e.kinds[i]),o.push(e.starts[i]),!Wn(l))continue;let c=i+1;if(c>=e.len||Ye(e.kinds[c]))continue;let d="",a=e.starts[c],u=c;for(;u<e.len&&!Ye(e.kinds[u]);)d+=e.texts[u],u++;d.length>0&&(t.push(d),n.push(!0),r.push("text"),o.push(a),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}var On=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),_t=/^[A-Za-z0-9_]+[,:;]*$/,jn=/[,:;]+$/;function Bt(e){for(let t of e)if(Wt.test(t))return!0;return!1}function Xe(e){if(e.length===0)return!1;for(let t of e)if(!(Wt.test(t)||On.has(t)))return!1;return!0}function zn(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i],c=e.kinds[i];if(c==="text"&&Xe(l)&&Bt(l)){let d=l,a=i+1;for(;a<e.len&&e.kinds[a]==="text"&&Xe(e.texts[a]);)d+=e.texts[a],a++;t.push(d),n.push(!0),r.push("text"),o.push(e.starts[i]),i=a-1;continue}t.push(l),n.push(e.isWordLike[i]),r.push(c),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function Gn(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i],c=e.kinds[i],d=e.isWordLike[i];if(c==="text"&&d&&_t.test(l)){let a=l,u=i+1;for(;jn.test(a)&&u<e.len&&e.kinds[u]==="text"&&e.isWordLike[u]&&_t.test(e.texts[u]);)a+=e.texts[u],u++;t.push(a),n.push(!0),r.push("text"),o.push(e.starts[i]),i=u-1;continue}t.push(l),n.push(d),r.push(c),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function $n(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i];if(e.kinds[i]==="text"&&l.includes("-")){let c=l.split("-"),d=c.length>1;for(let a=0;a<c.length;a++){let u=c[a];if(!d)break;(u.length===0||!Bt(u)||!Xe(u))&&(d=!1)}if(d){let a=0;for(let u=0;u<c.length;u++){let b=c[u],m=u<c.length-1?`${b}-`:b;t.push(m),n.push(!0),r.push("text"),o.push(e.starts[i]+a),a+=m.length}continue}}t.push(l),n.push(e.isWordLike[i]),r.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function Un(e){let t=[],n=[],r=[],o=[],i=0;for(;i<e.len;){let l=e.texts[i],c=e.isWordLike[i],d=e.kinds[i],a=e.starts[i];if(d==="glue"){let u=l,b=a;for(i++;i<e.len&&e.kinds[i]==="glue";)u+=e.texts[i],i++;if(i<e.len&&e.kinds[i]==="text")l=u+e.texts[i],c=e.isWordLike[i],d="text",a=b,i++;else{t.push(u),n.push(!1),r.push("glue"),o.push(b);continue}}else i++;if(d==="text")for(;i<e.len&&e.kinds[i]==="glue";){let u="";for(;i<e.len&&e.kinds[i]==="glue";)u+=e.texts[i],i++;if(i<e.len&&e.kinds[i]==="text"){l+=u+e.texts[i],c=c||e.isWordLike[i],i++;continue}l+=u}t.push(l),n.push(c),r.push(d),o.push(a)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function qn(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(r[i]!=="text"||r[i+1]!=="text"||!pe(t[i])||!pe(t[i+1]))continue;let l=Nn(t[i]);l!==null&&(t[i]=l.head,t[i+1]=l.tail+t[i+1],o[i+1]=o[i]+l.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function Vn(e,t,n){let r=Ln(),o=0,i=[],l=[],c=[],d=[];for(let m of r.segment(e))for(let y of In(m.segment,m.isWordLike??!1,m.index,n)){let M=y.kind==="text";t.carryCJKAfterClosingQuote&&M&&o>0&&c[o-1]==="text"&&pe(y.text)&&pe(i[o-1])&&it(i[o-1])||M&&o>0&&c[o-1]==="text"&&Tn(y.text)&&pe(i[o-1])||M&&o>0&&c[o-1]==="text"&&Cn(i[o-1])?(i[o-1]+=y.text,l[o-1]=l[o-1]||y.isWordLike):M&&o>0&&c[o-1]==="text"&&y.isWordLike&&Qe(y.text)&&Rn(i[o-1])?(i[o-1]+=y.text,l[o-1]=!0):M&&!y.isWordLike&&o>0&&c[o-1]==="text"&&y.text.length===1&&y.text!=="-"&&y.text!=="\u2014"&&vn(i[o-1],y.text)||M&&!y.isWordLike&&o>0&&c[o-1]==="text"&&(wn(y.text)||y.text==="-"&&l[o-1])?i[o-1]+=y.text:(i[o]=y.text,l[o]=y.isWordLike,c[o]=y.kind,d[o]=y.start,o++)}for(let m=1;m<o;m++)c[m]==="text"&&!l[m]&&nt(i[m])&&c[m-1]==="text"&&(i[m-1]+=i[m],l[m-1]=l[m-1]||l[m],i[m]="");for(let m=o-2;m>=0;m--)if(c[m]==="text"&&!l[m]&&Mn(i[m])){let y=m+1;for(;y<o&&i[y]==="";)y++;y<o&&c[y]==="text"&&(i[y]=i[m]+i[y],d[y]=d[m],i[m]="")}let a=0;for(let m=0;m<o;m++){let y=i[m];y.length!==0&&(a!==m&&(i[a]=y,l[a]=l[m],c[a]=c[m],d[a]=d[m]),a++)}i.length=a,l.length=a,c.length=a,d.length=a;let u=Un({len:a,texts:i,isWordLike:l,kinds:c,starts:d}),b=qn(Gn($n(zn(Hn(Bn(u))))));for(let m=0;m<b.len-1;m++){let y=Pn(b.texts[m]);y!==null&&(b.kinds[m]!=="space"&&b.kinds[m]!=="preserved-space"||b.kinds[m+1]!=="text"||!Qe(b.texts[m+1])||(b.texts[m]=y.space,b.isWordLike[m]=!1,b.kinds[m]=b.kinds[m]==="preserved-space"?"preserved-space":"space",b.texts[m+1]=y.marks+b.texts[m+1],b.starts[m+1]=b.starts[m]+y.space.length))}return b}function Kn(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),r=o+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Ht(e,t,n="normal"){let r=gn(n),o=r.mode==="pre-wrap"?bn(e):yn(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let i=Vn(o,t,r);return{normalized:o,chunks:Kn(i,r),...i}}var Me=null,Ot=new Map,Ne=null,Jn=/\p{Emoji_Presentation}/u,Zn=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,ot=null,jt=new Map;function rt(){if(Me!==null)return Me;if(typeof OffscreenCanvas<"u")return Me=new OffscreenCanvas(1,1).getContext("2d"),Me;if(typeof document<"u")return Me=document.createElement("canvas").getContext("2d"),Me;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Qn(e){let t=Ot.get(e);return t||(t=new Map,Ot.set(e,t)),t}function ge(e,t){let n=t.get(e);return n===void 0&&(n={width:rt().measureText(e).width,containsCJK:pe(e)},t.set(e,n)),n}function Ae(){if(Ne!==null)return Ne;if(typeof navigator>"u")return Ne={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ne;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ne={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Ne}function Yn(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function st(){return ot===null&&(ot=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ot}function Xn(e){return Jn.test(e)||e.includes("\uFE0F")}function zt(e){return Zn.test(e)}function ei(e,t){let n=jt.get(e);if(n!==void 0)return n;let r=rt();r.font=e;let o=r.measureText("\u{1F600}").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){let i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="\u{1F600}",document.body.appendChild(i);let l=i.getBoundingClientRect().width;document.body.removeChild(i),o-l>.5&&(n=o-l)}return jt.set(e,n),n}function ti(e){let t=0,n=st();for(let r of n.segment(e))Xn(r.segment)&&t++;return t}function ni(e,t){return t.emojiCount===void 0&&(t.emojiCount=ti(e)),t.emojiCount}function ye(e,t,n){return n===0?t.width:t.width-ni(e,t)*n}function Gt(e,t,n,r){if(t.graphemeWidths!==void 0)return t.graphemeWidths;let o=[],i=st();for(let l of i.segment(e)){let c=ge(l.segment,n);o.push(ye(l.segment,c,r))}return t.graphemeWidths=o.length>1?o:null,t.graphemeWidths}function $t(e,t,n,r){if(t.graphemePrefixWidths!==void 0)return t.graphemePrefixWidths;let o=[],i=st(),l="";for(let c of i.segment(e)){l+=c.segment;let d=ge(l,n);o.push(ye(l,d,r))}return t.graphemePrefixWidths=o.length>1?o:null,t.graphemePrefixWidths}function Ut(e,t){let n=rt();n.font=e;let r=Qn(e),o=Yn(e),i=t?ei(e,o):0;return{cache:r,fontSize:o,emojiCorrection:i}}function Oe(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function ii(e){return e==="space"}function oi(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function at(e,t,n,r){return!r||t===null?e[n]:t[n]-(n>0?t[n-1]:0)}function ri(e,t,n,r,o,i){let l=0,c=t;for(;l<e.length;){let d=i?t+e[l]:c+e[l];if((l+1<e.length?d+o:d)>n+r)break;c=d,l++}return{fitCount:l,fittedWidth:c}}function qt(e,t){return e.simpleLineWalkFastPath?si(e,t):Vt(e,t)}function si(e,t){let{widths:n,kinds:r,breakableWidths:o,breakablePrefixWidths:i}=e;if(n.length===0)return 0;let l=Ae(),c=l.lineFitEpsilon,d=0,a=0,u=!1;function b(m){let y=n[m];if(y>t&&o[m]!==null){let M=o[m],T=i[m]??null;a=0;for(let _=0;_<M.length;_++){let V=at(M,T,_,l.preferPrefixWidthsForBreakableRuns);a>0&&a+V>t+c?(d++,a=V):(a===0&&d++,a+=V)}}else a=y,d++;u=!0}for(let m=0;m<n.length;m++){let y=n[m],M=r[m];if(!u){b(m);continue}let T=a+y;if(T>t+c){if(ii(M))continue;a=0,u=!1,b(m);continue}a=T}return u?d:d+1}function ai(e,t,n){let{widths:r,kinds:o,breakableWidths:i,breakablePrefixWidths:l}=e;if(r.length===0)return 0;let c=Ae(),d=c.lineFitEpsilon,a=0,u=0,b=!1,m=0,y=0,M=0,T=0,_=-1,V=0;function ee(){_=-1,V=0}function z(k=M,C=T,W=u){a++,n?.({startSegmentIndex:m,startGraphemeIndex:y,endSegmentIndex:k,endGraphemeIndex:C,width:W}),u=0,b=!1,ee()}function U(k,C){b=!0,m=k,y=0,M=k+1,T=0,u=C}function g(k,C,W){b=!0,m=k,y=C,M=k,T=C+1,u=W}function A(k,C){if(!b){U(k,C);return}u+=C,M=k+1,T=0}function N(k,C){Oe(o[k])&&(_=k+1,V=u-C)}function R(k){F(k,0)}function F(k,C){let W=i[k],Y=l[k]??null;for(let $=C;$<W.length;$++){let K=at(W,Y,$,c.preferPrefixWidthsForBreakableRuns);if(!b){g(k,$,K);continue}u+K>t+d?(z(),g(k,$,K)):(u+=K,M=k,T=$+1)}b&&M===k&&T===W.length&&(M=k+1,T=0)}let E=0;for(;E<r.length;){let k=r[E],C=o[E];if(!b){k>t&&i[E]!==null?R(E):U(E,k),N(E,k),E++;continue}if(u+k>t+d){if(Oe(C)){A(E,k),z(E+1,0,u-k),E++;continue}if(_>=0){z(_,0,V);continue}if(k>t&&i[E]!==null){z(),R(E),E++;continue}z();continue}A(E,k),N(E,k),E++}return b&&z(),a}function Vt(e,t,n){if(e.simpleLineWalkFastPath)return ai(e,t,n);let{widths:r,lineEndFitAdvances:o,lineEndPaintAdvances:i,kinds:l,breakableWidths:c,breakablePrefixWidths:d,discretionaryHyphenWidth:a,tabStopAdvance:u,chunks:b}=e;if(r.length===0||b.length===0)return 0;let m=Ae(),y=m.lineFitEpsilon,M=0,T=0,_=!1,V=0,ee=0,z=0,U=0,g=-1,A=0,N=0,R=null;function F(){g=-1,A=0,N=0,R=null}function E(v=z,S=U,h=T){M++,n?.({startSegmentIndex:V,startGraphemeIndex:ee,endSegmentIndex:v,endGraphemeIndex:S,width:h}),T=0,_=!1,F()}function k(v,S){_=!0,V=v,ee=0,z=v+1,U=0,T=S}function C(v,S,h){_=!0,V=v,ee=S,z=v,U=S+1,T=h}function W(v,S){if(!_){k(v,S);return}T+=S,z=v+1,U=0}function Y(v,S){if(!Oe(l[v]))return;let h=l[v]==="tab"?0:o[v],w=l[v]==="tab"?S:i[v];g=v+1,A=T-S+h,N=T-S+w,R=l[v]}function $(v){K(v,0)}function K(v,S){let h=c[v],w=d[v]??null;for(let P=S;P<h.length;P++){let G=at(h,w,P,m.preferPrefixWidthsForBreakableRuns);if(!_){C(v,P,G);continue}T+G>t+y?(E(),C(v,P,G)):(T+=G,z=v,U=P+1)}_&&z===v&&U===h.length&&(z=v+1,U=0)}function H(v){if(R!=="soft-hyphen")return!1;let S=c[v];if(S===null)return!1;let h=m.preferPrefixWidthsForBreakableRuns?d[v]??S:S,w=h!==S,{fitCount:P,fittedWidth:G}=ri(h,T,t,y,a,w);return P===0?!1:(T=G,z=v,U=P,F(),P===S.length?(z=v+1,U=0,!0):(E(v,P,G+a),K(v,P),!0))}function de(v){M++,n?.({startSegmentIndex:v.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:v.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),F()}for(let v=0;v<b.length;v++){let S=b[v];if(S.startSegmentIndex===S.endSegmentIndex){de(S);continue}_=!1,T=0,V=S.startSegmentIndex,ee=0,z=S.startSegmentIndex,U=0,F();let h=S.startSegmentIndex;for(;h<S.endSegmentIndex;){let w=l[h],P=w==="tab"?oi(T,u):r[h];if(w==="soft-hyphen"){_&&(z=h+1,U=0,g=h+1,A=T+a,N=T+a,R=w),h++;continue}if(!_){P>t&&c[h]!==null?$(h):k(h,P),Y(h,P),h++;continue}if(T+P>t+y){let I=T+(w==="tab"?0:o[h]),D=T+(w==="tab"?P:i[h]);if(R==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&A<=t+y){E(g,0,N);continue}if(R==="soft-hyphen"&&H(h)){h++;continue}if(Oe(w)&&I<=t+y){W(h,P),E(h+1,0,D),h++;continue}if(g>=0&&A<=t+y){E(g,0,N);continue}if(P>t&&c[h]!==null){E(),$(h),h++;continue}E();continue}W(h,P),Y(h,P),h++}if(_){let w=g===S.consumedEndSegmentIndex?N:T;E(S.consumedEndSegmentIndex,0,w)}}return M}var lt=null;function li(){return lt===null&&(lt=new Intl.Segmenter(void 0,{granularity:"grapheme"})),lt}function ui(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function ci(e,t,n){let r=li(),o=Ae(),{cache:i,emojiCorrection:l}=Ut(t,zt(e.normalized)),c=ye("-",ge("-",i),l),a=ye(" ",ge(" ",i),l)*8;if(e.len===0)return ui(n);let u=[],b=[],m=[],y=[],M=e.chunks.length<=1,T=n?[]:null,_=[],V=[],ee=n?[]:null,z=Array.from({length:e.len}),U=Array.from({length:e.len});function g(R,F,E,k,C,W,Y,$){C!=="text"&&C!=="space"&&C!=="zero-width-break"&&(M=!1),u.push(F),b.push(E),m.push(k),y.push(C),T?.push(W),_.push(Y),V.push($),ee!==null&&ee.push(R)}for(let R=0;R<e.len;R++){z[R]=u.length;let F=e.texts[R],E=e.isWordLike[R],k=e.kinds[R],C=e.starts[R];if(k==="soft-hyphen"){g(F,0,c,c,k,C,null,null),U[R]=u.length;continue}if(k==="hard-break"){g(F,0,0,0,k,C,null,null),U[R]=u.length;continue}if(k==="tab"){g(F,0,0,0,k,C,null,null),U[R]=u.length;continue}let W=ge(F,i);if(k==="text"&&W.containsCJK){let H="",de=0;for(let v of r.segment(F)){let S=v.segment;if(H.length===0){H=S,de=v.index;continue}if(Ie.has(H)||et.has(S)||Te.has(S)||o.carryCJKAfterClosingQuote&&pe(S)&&it(H)){H+=S;continue}let h=ge(H,i),w=ye(H,h,l);g(H,w,w,w,"text",C+de,null,null),H=S,de=v.index}if(H.length>0){let v=ge(H,i),S=ye(H,v,l);g(H,S,S,S,"text",C+de,null,null)}U[R]=u.length;continue}let Y=ye(F,W,l),$=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:Y,K=k==="space"||k==="zero-width-break"?0:Y;if(E&&F.length>1){let H=Gt(F,W,i,l),de=o.preferPrefixWidthsForBreakableRuns?$t(F,W,i,l):null;g(F,Y,$,K,k,C,H,de)}else g(F,Y,$,K,k,C,null,null);U[R]=u.length}let A=di(e.chunks,z,U),N=T===null?null:Dt(e.normalized,T);return ee!==null?{widths:u,lineEndFitAdvances:b,lineEndPaintAdvances:m,kinds:y,simpleLineWalkFastPath:M,segLevels:N,breakableWidths:_,breakablePrefixWidths:V,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:A,segments:ee}:{widths:u,lineEndFitAdvances:b,lineEndPaintAdvances:m,kinds:y,simpleLineWalkFastPath:M,segLevels:N,breakableWidths:_,breakablePrefixWidths:V,discretionaryHyphenWidth:c,tabStopAdvance:a,chunks:A}}function di(e,t,n){let r=[];for(let o=0;o<e.length;o++){let i=e[o],l=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n[n.length-1]??0,c=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n[n.length-1]??0,d=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n[n.length-1]??0;r.push({startSegmentIndex:l,endSegmentIndex:c,consumedEndSegmentIndex:d})}return r}function mi(e,t,n,r){let o=Ht(e,Ae(),r?.whiteSpace);return ci(o,t,n)}function Kt(e,t,n){return mi(e,t,!1,n)}function Jt(e,t,n){let r=qt(e,t);return{lineCount:r,height:r*n}}var fi={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Zt(e,t){let n={...fi,...t},r=1.2;for(let o=n.baseFontSize;o>=n.minFontSize;o-=n.step){let i=`${n.fontWeight} ${o}px ${n.fontFamily}`,l=Kt(e,i),{lineCount:c}=Jt(l,n.maxWidth,o*r);if(c<=1)return{fontSize:o,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:Zt};function Qt(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,It())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Qt,{once:!0}):Qt();})();
15
+ `)}var Ze=null,Sn;function Ln(){return Ze===null&&(Ze=new Intl.Segmenter(Sn,{granularity:"word"})),Ze}var An=/\p{Script=Arabic}/u,He=/\p{M}/u,Bt=/\p{Nd}/u;function Qe(e){return An.test(e)}function pe(e){for(let t of e){let n=t.codePointAt(0);if(n>=19968&&n<=40959||n>=13312&&n<=19903||n>=131072&&n<=173791||n>=173824&&n<=177983||n>=177984&&n<=178207||n>=178208&&n<=183983||n>=183984&&n<=191471||n>=196608&&n<=201551||n>=63744&&n<=64255||n>=194560&&n<=195103||n>=12288&&n<=12351||n>=12352&&n<=12447||n>=12448&&n<=12543||n>=44032&&n<=55215||n>=65280&&n<=65519)return!0}return!1}var et=new Set(["\uFF0C","\uFF0E","\uFF01","\uFF1A","\uFF1B","\uFF1F","\u3001","\u3002","\u30FB","\uFF09","\u3015","\u3009","\u300B","\u300D","\u300F","\u3011","\u3017","\u3019","\u301B","\u30FC","\u3005","\u303B","\u309D","\u309E","\u30FD","\u30FE"]),Ie=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),tt=new Set(["'","\u2019"]),Te=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),kn=new Set([":",".","\u060C","\u061B"]),xn=new Set(["\u104F"]),En=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function wn(e){if(nt(e))return!0;let t=!1;for(let n of e){if(Te.has(n)){t=!0;continue}if(!(t&&He.test(n)))return!1}return t}function Tn(e){for(let t of e)if(!et.has(t)&&!Te.has(t))return!1;return e.length>0}function Mn(e){if(nt(e))return!0;for(let t of e)if(!Ie.has(t)&&!tt.has(t)&&!He.test(t))return!1;return e.length>0}function nt(e){let t=!1;for(let n of e)if(!(n==="\\"||He.test(n))){if(Ie.has(n)||Te.has(n)||tt.has(n)){t=!0;continue}return!1}return t}function Nn(e){let t=Array.from(e),n=t.length;for(;n>0;){let s=t[n-1];if(He.test(s)){n--;continue}if(Ie.has(s)||tt.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function vn(e,t){if(e.length===0)return!1;for(let n of e)if(n!==t)return!1;return!0}function Rn(e){return!Qe(e)||e.length===0?!1:kn.has(e[e.length-1])}function Cn(e){return e.length===0?!1:xn.has(e[e.length-1])}function Pn(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function it(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(En.has(n))return!0;if(!Te.has(n))return!1}return!1}function Fn(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
16
+ `)return"hard-break"}return e===" "?"space":e==="\xA0"||e==="\u202F"||e==="\u2060"||e==="\uFEFF"?"glue":e==="\u200B"?"zero-width-break":e==="\xAD"?"soft-hyphen":"text"}function In(e,t,n,s){let o=[],i=null,l="",d=n,c=!1,r=0;for(let u of e){let g=Fn(u,s),m=g==="text"&&t;if(i!==null&&g===i&&m===c){l+=u,r+=u.length;continue}i!==null&&o.push({text:l,isWordLike:c,kind:i,start:d}),i=g,l=u,d=n+r,c=m,r+=u.length}return i!==null&&o.push({text:l,isWordLike:c,kind:i,start:d}),o}function Ye(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Dn=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function _n(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Dn.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Wn(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Bn(e){let t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let l=0;l<e.len;l++){if(s[l]!=="text"||!_n(e,l))continue;let d=l+1;for(;d<e.len&&!Ye(s[d]);){t[l]+=t[d],n[l]=!0;let c=t[d].includes("?");if(s[d]="text",t[d]="",d++,c)break}}let i=0;for(let l=0;l<t.length;l++){let d=t[l];d.length!==0&&(i!==l&&(t[i]=d,n[i]=n[l],s[i]=s[l],o[i]=o[l]),i++)}return t.length=i,n.length=i,s.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:s,starts:o}}function Hn(e){let t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i];if(t.push(l),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i]),!Wn(l))continue;let d=i+1;if(d>=e.len||Ye(e.kinds[d]))continue;let c="",r=e.starts[d],u=d;for(;u<e.len&&!Ye(e.kinds[u]);)c+=e.texts[u],u++;c.length>0&&(t.push(c),n.push(!0),s.push("text"),o.push(r),i=u-1)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}var On=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Wt=/^[A-Za-z0-9_]+[,:;]*$/,jn=/[,:;]+$/;function Ht(e){for(let t of e)if(Bt.test(t))return!0;return!1}function Xe(e){if(e.length===0)return!1;for(let t of e)if(!(Bt.test(t)||On.has(t)))return!1;return!0}function zn(e){let t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i],d=e.kinds[i];if(d==="text"&&Xe(l)&&Ht(l)){let c=l,r=i+1;for(;r<e.len&&e.kinds[r]==="text"&&Xe(e.texts[r]);)c+=e.texts[r],r++;t.push(c),n.push(!0),s.push("text"),o.push(e.starts[i]),i=r-1;continue}t.push(l),n.push(e.isWordLike[i]),s.push(d),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Gn(e){let t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i],d=e.kinds[i],c=e.isWordLike[i];if(d==="text"&&c&&Wt.test(l)){let r=l,u=i+1;for(;jn.test(r)&&u<e.len&&e.kinds[u]==="text"&&e.isWordLike[u]&&Wt.test(e.texts[u]);)r+=e.texts[u],u++;t.push(r),n.push(!0),s.push("text"),o.push(e.starts[i]),i=u-1;continue}t.push(l),n.push(c),s.push(d),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function qn(e){let t=[],n=[],s=[],o=[];for(let i=0;i<e.len;i++){let l=e.texts[i];if(e.kinds[i]==="text"&&l.includes("-")){let d=l.split("-"),c=d.length>1;for(let r=0;r<d.length;r++){let u=d[r];if(!c)break;(u.length===0||!Ht(u)||!Xe(u))&&(c=!1)}if(c){let r=0;for(let u=0;u<d.length;u++){let g=d[u],m=u<d.length-1?`${g}-`:g;t.push(m),n.push(!0),s.push("text"),o.push(e.starts[i]+r),r+=m.length}continue}}t.push(l),n.push(e.isWordLike[i]),s.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Un(e){let t=[],n=[],s=[],o=[],i=0;for(;i<e.len;){let l=e.texts[i],d=e.isWordLike[i],c=e.kinds[i],r=e.starts[i];if(c==="glue"){let u=l,g=r;for(i++;i<e.len&&e.kinds[i]==="glue";)u+=e.texts[i],i++;if(i<e.len&&e.kinds[i]==="text")l=u+e.texts[i],d=e.isWordLike[i],c="text",r=g,i++;else{t.push(u),n.push(!1),s.push("glue"),o.push(g);continue}}else i++;if(c==="text")for(;i<e.len&&e.kinds[i]==="glue";){let u="";for(;i<e.len&&e.kinds[i]==="glue";)u+=e.texts[i],i++;if(i<e.len&&e.kinds[i]==="text"){l+=u+e.texts[i],d=d||e.isWordLike[i],i++;continue}l+=u}t.push(l),n.push(d),s.push(c),o.push(r)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function $n(e){let t=e.texts.slice(),n=e.isWordLike.slice(),s=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(s[i]!=="text"||s[i+1]!=="text"||!pe(t[i])||!pe(t[i+1]))continue;let l=Nn(t[i]);l!==null&&(t[i]=l.head,t[i+1]=l.tail+t[i+1],o[i+1]=o[i]+l.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:s,starts:o}}function Vn(e,t,n){let s=Ln(),o=0,i=[],l=[],d=[],c=[];for(let m of s.segment(e))for(let b of In(m.segment,m.isWordLike??!1,m.index,n)){let T=b.kind==="text";t.carryCJKAfterClosingQuote&&T&&o>0&&d[o-1]==="text"&&pe(b.text)&&pe(i[o-1])&&it(i[o-1])||T&&o>0&&d[o-1]==="text"&&Tn(b.text)&&pe(i[o-1])||T&&o>0&&d[o-1]==="text"&&Cn(i[o-1])?(i[o-1]+=b.text,l[o-1]=l[o-1]||b.isWordLike):T&&o>0&&d[o-1]==="text"&&b.isWordLike&&Qe(b.text)&&Rn(i[o-1])?(i[o-1]+=b.text,l[o-1]=!0):T&&!b.isWordLike&&o>0&&d[o-1]==="text"&&b.text.length===1&&b.text!=="-"&&b.text!=="\u2014"&&vn(i[o-1],b.text)||T&&!b.isWordLike&&o>0&&d[o-1]==="text"&&(wn(b.text)||b.text==="-"&&l[o-1])?i[o-1]+=b.text:(i[o]=b.text,l[o]=b.isWordLike,d[o]=b.kind,c[o]=b.start,o++)}for(let m=1;m<o;m++)d[m]==="text"&&!l[m]&&nt(i[m])&&d[m-1]==="text"&&(i[m-1]+=i[m],l[m-1]=l[m-1]||l[m],i[m]="");for(let m=o-2;m>=0;m--)if(d[m]==="text"&&!l[m]&&Mn(i[m])){let b=m+1;for(;b<o&&i[b]==="";)b++;b<o&&d[b]==="text"&&(i[b]=i[m]+i[b],c[b]=c[m],i[m]="")}let r=0;for(let m=0;m<o;m++){let b=i[m];b.length!==0&&(r!==m&&(i[r]=b,l[r]=l[m],d[r]=d[m],c[r]=c[m]),r++)}i.length=r,l.length=r,d.length=r,c.length=r;let u=Un({len:r,texts:i,isWordLike:l,kinds:d,starts:c}),g=$n(Gn(qn(zn(Hn(Bn(u))))));for(let m=0;m<g.len-1;m++){let b=Pn(g.texts[m]);b!==null&&(g.kinds[m]!=="space"&&g.kinds[m]!=="preserved-space"||g.kinds[m+1]!=="text"||!Qe(g.texts[m+1])||(g.texts[m]=b.space,g.isWordLike[m]=!1,g.kinds[m]=g.kinds[m]==="preserved-space"?"preserved-space":"space",g.texts[m+1]=b.marks+g.texts[m+1],g.starts[m+1]=g.starts[m]+b.space.length))}return g}function Kn(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],s=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:s,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),s=o+1);return s<e.len&&n.push({startSegmentIndex:s,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Ot(e,t,n="normal"){let s=gn(n),o=s.mode==="pre-wrap"?bn(e):yn(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let i=Vn(o,t,s);return{normalized:o,chunks:Kn(i,s),...i}}var Me=null,jt=new Map,Ne=null,Jn=/\p{Emoji_Presentation}/u,Zn=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,ot=null,zt=new Map;function rt(){if(Me!==null)return Me;if(typeof OffscreenCanvas<"u")return Me=new OffscreenCanvas(1,1).getContext("2d"),Me;if(typeof document<"u")return Me=document.createElement("canvas").getContext("2d"),Me;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Qn(e){let t=jt.get(e);return t||(t=new Map,jt.set(e,t)),t}function ge(e,t){let n=t.get(e);return n===void 0&&(n={width:rt().measureText(e).width,containsCJK:pe(e)},t.set(e,n)),n}function Ae(){if(Ne!==null)return Ne;if(typeof navigator>"u")return Ne={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ne;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),s=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ne={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:s,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Ne}function Yn(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function st(){return ot===null&&(ot=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ot}function Xn(e){return Jn.test(e)||e.includes("\uFE0F")}function Gt(e){return Zn.test(e)}function ei(e,t){let n=zt.get(e);if(n!==void 0)return n;let s=rt();s.font=e;let o=s.measureText("\u{1F600}").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){let i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="\u{1F600}",document.body.appendChild(i);let l=i.getBoundingClientRect().width;document.body.removeChild(i),o-l>.5&&(n=o-l)}return zt.set(e,n),n}function ti(e){let t=0,n=st();for(let s of n.segment(e))Xn(s.segment)&&t++;return t}function ni(e,t){return t.emojiCount===void 0&&(t.emojiCount=ti(e)),t.emojiCount}function ye(e,t,n){return n===0?t.width:t.width-ni(e,t)*n}function qt(e,t,n,s){if(t.graphemeWidths!==void 0)return t.graphemeWidths;let o=[],i=st();for(let l of i.segment(e)){let d=ge(l.segment,n);o.push(ye(l.segment,d,s))}return t.graphemeWidths=o.length>1?o:null,t.graphemeWidths}function Ut(e,t,n,s){if(t.graphemePrefixWidths!==void 0)return t.graphemePrefixWidths;let o=[],i=st(),l="";for(let d of i.segment(e)){l+=d.segment;let c=ge(l,n);o.push(ye(l,c,s))}return t.graphemePrefixWidths=o.length>1?o:null,t.graphemePrefixWidths}function $t(e,t){let n=rt();n.font=e;let s=Qn(e),o=Yn(e),i=t?ei(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function Oe(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function ii(e){return e==="space"}function oi(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function at(e,t,n,s){return!s||t===null?e[n]:t[n]-(n>0?t[n-1]:0)}function ri(e,t,n,s,o,i){let l=0,d=t;for(;l<e.length;){let c=i?t+e[l]:d+e[l];if((l+1<e.length?c+o:c)>n+s)break;d=c,l++}return{fitCount:l,fittedWidth:d}}function Vt(e,t){return e.simpleLineWalkFastPath?si(e,t):Kt(e,t)}function si(e,t){let{widths:n,kinds:s,breakableWidths:o,breakablePrefixWidths:i}=e;if(n.length===0)return 0;let l=Ae(),d=l.lineFitEpsilon,c=0,r=0,u=!1;function g(m){let b=n[m];if(b>t&&o[m]!==null){let T=o[m],M=i[m]??null;r=0;for(let _=0;_<T.length;_++){let V=at(T,M,_,l.preferPrefixWidthsForBreakableRuns);r>0&&r+V>t+d?(c++,r=V):(r===0&&c++,r+=V)}}else r=b,c++;u=!0}for(let m=0;m<n.length;m++){let b=n[m],T=s[m];if(!u){g(m);continue}let M=r+b;if(M>t+d){if(ii(T))continue;r=0,u=!1,g(m);continue}r=M}return u?c:c+1}function ai(e,t,n){let{widths:s,kinds:o,breakableWidths:i,breakablePrefixWidths:l}=e;if(s.length===0)return 0;let d=Ae(),c=d.lineFitEpsilon,r=0,u=0,g=!1,m=0,b=0,T=0,M=0,_=-1,V=0;function ee(){_=-1,V=0}function z(k=T,C=M,W=u){r++,n?.({startSegmentIndex:m,startGraphemeIndex:b,endSegmentIndex:k,endGraphemeIndex:C,width:W}),u=0,g=!1,ee()}function U(k,C){g=!0,m=k,b=0,T=k+1,M=0,u=C}function y(k,C,W){g=!0,m=k,b=C,T=k,M=C+1,u=W}function A(k,C){if(!g){U(k,C);return}u+=C,T=k+1,M=0}function N(k,C){Oe(o[k])&&(_=k+1,V=u-C)}function R(k){F(k,0)}function F(k,C){let W=i[k],Y=l[k]??null;for(let q=C;q<W.length;q++){let K=at(W,Y,q,d.preferPrefixWidthsForBreakableRuns);if(!g){y(k,q,K);continue}u+K>t+c?(z(),y(k,q,K)):(u+=K,T=k,M=q+1)}g&&T===k&&M===W.length&&(T=k+1,M=0)}let E=0;for(;E<s.length;){let k=s[E],C=o[E];if(!g){k>t&&i[E]!==null?R(E):U(E,k),N(E,k),E++;continue}if(u+k>t+c){if(Oe(C)){A(E,k),z(E+1,0,u-k),E++;continue}if(_>=0){z(_,0,V);continue}if(k>t&&i[E]!==null){z(),R(E),E++;continue}z();continue}A(E,k),N(E,k),E++}return g&&z(),r}function Kt(e,t,n){if(e.simpleLineWalkFastPath)return ai(e,t,n);let{widths:s,lineEndFitAdvances:o,lineEndPaintAdvances:i,kinds:l,breakableWidths:d,breakablePrefixWidths:c,discretionaryHyphenWidth:r,tabStopAdvance:u,chunks:g}=e;if(s.length===0||g.length===0)return 0;let m=Ae(),b=m.lineFitEpsilon,T=0,M=0,_=!1,V=0,ee=0,z=0,U=0,y=-1,A=0,N=0,R=null;function F(){y=-1,A=0,N=0,R=null}function E(v=z,S=U,h=M){T++,n?.({startSegmentIndex:V,startGraphemeIndex:ee,endSegmentIndex:v,endGraphemeIndex:S,width:h}),M=0,_=!1,F()}function k(v,S){_=!0,V=v,ee=0,z=v+1,U=0,M=S}function C(v,S,h){_=!0,V=v,ee=S,z=v,U=S+1,M=h}function W(v,S){if(!_){k(v,S);return}M+=S,z=v+1,U=0}function Y(v,S){if(!Oe(l[v]))return;let h=l[v]==="tab"?0:o[v],w=l[v]==="tab"?S:i[v];y=v+1,A=M-S+h,N=M-S+w,R=l[v]}function q(v){K(v,0)}function K(v,S){let h=d[v],w=c[v]??null;for(let P=S;P<h.length;P++){let G=at(h,w,P,m.preferPrefixWidthsForBreakableRuns);if(!_){C(v,P,G);continue}M+G>t+b?(E(),C(v,P,G)):(M+=G,z=v,U=P+1)}_&&z===v&&U===h.length&&(z=v+1,U=0)}function H(v){if(R!=="soft-hyphen")return!1;let S=d[v];if(S===null)return!1;let h=m.preferPrefixWidthsForBreakableRuns?c[v]??S:S,w=h!==S,{fitCount:P,fittedWidth:G}=ri(h,M,t,b,r,w);return P===0?!1:(M=G,z=v,U=P,F(),P===S.length?(z=v+1,U=0,!0):(E(v,P,G+r),K(v,P),!0))}function de(v){T++,n?.({startSegmentIndex:v.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:v.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),F()}for(let v=0;v<g.length;v++){let S=g[v];if(S.startSegmentIndex===S.endSegmentIndex){de(S);continue}_=!1,M=0,V=S.startSegmentIndex,ee=0,z=S.startSegmentIndex,U=0,F();let h=S.startSegmentIndex;for(;h<S.endSegmentIndex;){let w=l[h],P=w==="tab"?oi(M,u):s[h];if(w==="soft-hyphen"){_&&(z=h+1,U=0,y=h+1,A=M+r,N=M+r,R=w),h++;continue}if(!_){P>t&&d[h]!==null?q(h):k(h,P),Y(h,P),h++;continue}if(M+P>t+b){let I=M+(w==="tab"?0:o[h]),D=M+(w==="tab"?P:i[h]);if(R==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&A<=t+b){E(y,0,N);continue}if(R==="soft-hyphen"&&H(h)){h++;continue}if(Oe(w)&&I<=t+b){W(h,P),E(h+1,0,D),h++;continue}if(y>=0&&A<=t+b){E(y,0,N);continue}if(P>t&&d[h]!==null){E(),q(h),h++;continue}E();continue}W(h,P),Y(h,P),h++}if(_){let w=y===S.consumedEndSegmentIndex?N:M;E(S.consumedEndSegmentIndex,0,w)}}return T}var lt=null;function li(){return lt===null&&(lt=new Intl.Segmenter(void 0,{granularity:"grapheme"})),lt}function ui(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function ci(e,t,n){let s=li(),o=Ae(),{cache:i,emojiCorrection:l}=$t(t,Gt(e.normalized)),d=ye("-",ge("-",i),l),r=ye(" ",ge(" ",i),l)*8;if(e.len===0)return ui(n);let u=[],g=[],m=[],b=[],T=e.chunks.length<=1,M=n?[]:null,_=[],V=[],ee=n?[]:null,z=Array.from({length:e.len}),U=Array.from({length:e.len});function y(R,F,E,k,C,W,Y,q){C!=="text"&&C!=="space"&&C!=="zero-width-break"&&(T=!1),u.push(F),g.push(E),m.push(k),b.push(C),M?.push(W),_.push(Y),V.push(q),ee!==null&&ee.push(R)}for(let R=0;R<e.len;R++){z[R]=u.length;let F=e.texts[R],E=e.isWordLike[R],k=e.kinds[R],C=e.starts[R];if(k==="soft-hyphen"){y(F,0,d,d,k,C,null,null),U[R]=u.length;continue}if(k==="hard-break"){y(F,0,0,0,k,C,null,null),U[R]=u.length;continue}if(k==="tab"){y(F,0,0,0,k,C,null,null),U[R]=u.length;continue}let W=ge(F,i);if(k==="text"&&W.containsCJK){let H="",de=0;for(let v of s.segment(F)){let S=v.segment;if(H.length===0){H=S,de=v.index;continue}if(Ie.has(H)||et.has(S)||Te.has(S)||o.carryCJKAfterClosingQuote&&pe(S)&&it(H)){H+=S;continue}let h=ge(H,i),w=ye(H,h,l);y(H,w,w,w,"text",C+de,null,null),H=S,de=v.index}if(H.length>0){let v=ge(H,i),S=ye(H,v,l);y(H,S,S,S,"text",C+de,null,null)}U[R]=u.length;continue}let Y=ye(F,W,l),q=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:Y,K=k==="space"||k==="zero-width-break"?0:Y;if(E&&F.length>1){let H=qt(F,W,i,l),de=o.preferPrefixWidthsForBreakableRuns?Ut(F,W,i,l):null;y(F,Y,q,K,k,C,H,de)}else y(F,Y,q,K,k,C,null,null);U[R]=u.length}let A=di(e.chunks,z,U),N=M===null?null:_t(e.normalized,M);return ee!==null?{widths:u,lineEndFitAdvances:g,lineEndPaintAdvances:m,kinds:b,simpleLineWalkFastPath:T,segLevels:N,breakableWidths:_,breakablePrefixWidths:V,discretionaryHyphenWidth:d,tabStopAdvance:r,chunks:A,segments:ee}:{widths:u,lineEndFitAdvances:g,lineEndPaintAdvances:m,kinds:b,simpleLineWalkFastPath:T,segLevels:N,breakableWidths:_,breakablePrefixWidths:V,discretionaryHyphenWidth:d,tabStopAdvance:r,chunks:A}}function di(e,t,n){let s=[];for(let o=0;o<e.length;o++){let i=e[o],l=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n[n.length-1]??0,d=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n[n.length-1]??0,c=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n[n.length-1]??0;s.push({startSegmentIndex:l,endSegmentIndex:d,consumedEndSegmentIndex:c})}return s}function mi(e,t,n,s){let o=Ot(e,Ae(),s?.whiteSpace);return ci(o,t,n)}function Jt(e,t,n){return mi(e,t,!1,n)}function Zt(e,t,n){let s=Vt(e,t);return{lineCount:s,height:s*n}}var fi={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Qt(e,t){let n={...fi,...t},s=1.2;for(let o=n.baseFontSize;o>=n.minFontSize;o-=n.step){let i=`${n.fontWeight} ${o}px ${n.fontFamily}`,l=Jt(e,i),{lineCount:d}=Zt(l,n.maxWidth,o*s);if(d<=1)return{fontSize:o,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};window.__hyperframes={fitTextFontSize:Qt};function Yt(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Dt())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Yt,{once:!0}):Yt();})();
17
17