"use strict";(()=>{function le(e){try{window.parent.postMessage(e,"*")}catch{}}function ht(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&&rn(i,l)}};return window.addEventListener("message",t),t}function rn(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
      .__hf-flash {
        outline: 2px solid rgba(59, 130, 246, 0.6) !important;
        outline-offset: 2px !important;
        animation: __hf-flash-pulse ${t}ms ease-out forwards !important;
      }
      @keyframes __hf-flash-pulse {
        0% { outline-color: rgba(59, 130, 246, 0.8); }
        100% { outline-color: transparent; }
      }
    `,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 Ve=null;function gt(e){Ve=e}function Ce(e,t){if(Ve)try{Ve({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch{}}function yt(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 bt(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 At(){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(St(s))s.goToAndStop(t*1e3,!1);else if(Lt(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{(St(t)||Lt(t))&&t.pause()}catch{}},revert:()=>{}}}function St(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Lt(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function kt(){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 Et(){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,w=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(w)?w: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}}var He=new WeakSet;function Tt(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&&!He.has(n)?n.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA?n.play().catch(()=>{}):(He.add(n),n.preload!=="auto"&&(n.preload="auto"),n.addEventListener("canplay",()=>{He.delete(n),n.paused&&n.play().catch(()=>{})},{once:!0}),n.addEventListener("error",()=>He.delete(n),{once:!0}),n.load()):!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 x=y.tagName.toLowerCase(),k=y.parentElement;if(!k)return x;let C=k.querySelectorAll(`:scope > ${x}`);if(C.length===1)return x;for(let W=0;W<C.length;W+=1)if(C[W]===y)return`${x}:nth-of-type(${W+1})`;return x}function g(y){let A=y.tagName.toLowerCase(),N=(y.textContent??"").trim().replace(/\s+/g," "),R=(F,x)=>F.length>x?`${F.slice(0,x-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 x={},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(!x[Y]&&(x[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 x=y.attributes[F];x.name.startsWith("data-")&&(N[x.name]=x.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 w(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=w(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(`
`),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 q(){window.__HF_PICKER_API={enable:ee,disable:z,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(y,A,N)=>Number.isFinite(y)&&Number.isFinite(A)?w(y,A,N):[],pickAtPoint:(y,A,N)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return null;let R=w(y,A,8);if(!R.length)return null;let F=Math.max(0,Math.min(R.length-1,Number(N??0))),x=R[F]??null;return x?(c(x),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:x}),z(),x):null},pickManyAtPoint:(y,A,N)=>{if(!Number.isFinite(y)||!Number.isFinite(A))return[];let R=w(y,A,8);if(!R.length)return[];let F=[],x=Array.isArray(N)?N:[0];for(let k of x){let C=Math.max(0,Math.min(R.length-1,Math.floor(Number(k)))),W=R[C];if(!W)continue;F.some(U=>U.selector===W.selector&&U.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:q}}function Mt(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 Nt(e,t,n){let s=Mt(t,n);return e.pause(),typeof e.totalTime=="function"?e.totalTime(s,!1):e.seek(s,!1),s}function vt(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=Nt(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=Nt(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 Rt(){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 sn(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 Te(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),w=m-b;Number.isFinite(w)&&w>0&&(u=w)}}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 w=Number(b.duration());Number.isFinite(w)&&w>0&&(u=w)}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=sn(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),w=l(m);if(w==null||w<=0){let _=Math.max(0,b+g.offset);return n.set(c,_),_}let M=Math.max(0,b+w+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 Ct={composition:0,video:1,image:2,element:3,audio:4};function an(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)=>(Ct[r]??99)-(Ct[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 ln(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 Pt(e){let n=window.__timelines??{},s=Te({timelineRegistry:n}),o=S=>{if(!S)return null;let h=n[S]??null;if(!h||typeof h.duration!="function")return null;try{let T=Number(h.duration());return Number.isFinite(T)&&T>0?T:null}catch{return null}},i=S=>{let h=ue(S.getAttribute("data-duration"));if(h!=null&&h>0)return h;let T=ue(S.getAttribute("data-playback-start"))??ue(S.getAttribute("data-media-start"))??0;return Number.isFinite(S.duration)&&S.duration>T?Math.max(0,S.duration-T):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 T of S){let P=s.resolveStartForElement(T,0);if(!Number.isFinite(P))continue;let G=i(T);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 T=[],P=null,G=null,I=null,D=S.parentElement;for(;D;){let B=D.getAttribute("data-composition-id");B&&(T.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:T.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,w=o(u),M=ue(r?.getAttribute("data-duration")),_=typeof w=="number"&&Number.isFinite(w)&&w>0?w: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,q=V??(z?ee:_??ee),y=q!=null?Math.min(q,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]")),x=[],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 T=c(h,r),P=s.resolveStartForElement(h,T.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=T.inheritedDuration;if(ae!=null&&ae>0){let fe=(T.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";x.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:T.compositionAncestors,parentCompositionId:T.parentCompositionId,nodePath:null,compositionSrc:Fe(h.getAttribute("data-composition-src")),assetUrl:ln(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(x.map(S=>S.id)),U=r?.getAttribute("data-composition-id")??null,K=U?n[U]??null:null;if(K&&r){let S=K;if(typeof S.getChildren=="function")try{let h=S.getChildren(!0,!0,!1)??[],T=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"||T.set(D,{id:D.id,start:1/0,end:-1/0})}let P=I=>{let D=I;for(;D;){if(T.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=T.get(ve);fe&&(fe.start=Math.min(fe.start,D),fe.end=Math.max(fe.end,me))}}let G=x.length>0?Math.max(...x.map(I=>I.track))+1:0;for(let[I,D]of T){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),x.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:U?[U]:[],parentCompositionId:U,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=x.length>0?Math.max(...x.map(h=>h.track))+1:0;for(let h of r.children){let T=h;if(!T.id||Y.has(T.id))continue;let P=T.tagName.toLowerCase();if(P==="script"||P==="style"||P==="link"||P==="meta"||window.getComputedStyle(T).display==="none")continue;let I=R(0,y);I<=0||(W=Math.max(W,I),x.push({id:T.id,label:T.getAttribute("data-timeline-label")??T.getAttribute("data-label")??T.getAttribute("aria-label")??T.id,start:0,duration:I,track:Number.parseInt(T.getAttribute("data-track-index")??T.getAttribute("data-track")??"",10)||S,kind:"element",tagName:P,compositionId:T.getAttribute("data-composition-id"),compositionAncestors:U?[U]:[],parentCompositionId:U,nodePath:null,compositionSrc:null,assetUrl:null,timelineRole:T.getAttribute("data-timeline-role"),timelineLabel:T.getAttribute("data-timeline-label"),timelineGroup:T.getAttribute("data-timeline-group"),timelinePriority:ue(T.getAttribute("data-timeline-priority"))}),Y.add(T.id))}}an(x);for(let S of F){if(S===r)continue;let h=S.getAttribute("data-composition-id");if(!h||!d(h))continue;let T=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(T,I);D<=0||k.push({id:h,label:S.getAttribute("data-label")??h,start:T,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:x,scenes:k,compositionWidth:ue(r?.getAttribute("data-width"))??1920,compositionHeight:ue(r?.getAttribute("data-height"))??1080}}var un=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,cn=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 Ke(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function Ft(e,t){let n=e.trim();if(!n)return e;try{return un.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 Je(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=Ft(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=Ft(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 cn(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 It(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`);Ke(n),await Je({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 Dt(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}Ke(n);try{let i=n.getAttribute("data-composition-id"),l=i!=null?document.querySelector(`template#${CSS.escape(i)}-template`):null;if(l){await Je({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")),w=g?void 0:Array.from(u.head.querySelectorAll("script"));await Je({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:w,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"}}),Ke(n)}}))}function Ze(){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 _t(){let e=Rt(),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,f,p)=>{let E=p??`${a}:${JSON.stringify(f)}`;i.has(E)||(i.add(E),le({source:"hf-preview",type:"diagnostic",code:a,details:f}))},r=a=>{let f={scale:1,focusX:960,focusY:540},p=[],E=[],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:()=>f,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>p,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:()=>E,getRenderState:()=>({...L,time:a.getTime(),duration:a.getDuration(),isPlaying:a.isPlaying()})}},u=1/60,g=.75,m=.75,b=.35,w=900,M=3,_=2,V=.05,ee=100,z=240,q=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 f=a.toLowerCase();return f.includes("cannot read properties of null")||f.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:f.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:f.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 f=Number.parseFloat(a);return!Number.isFinite(f)||f<=0?null:`${f}px`},N=()=>{let a=document.querySelector('[data-composition-id][data-root="true"]');if(a instanceof HTMLElement)return a;let f=Array.from(document.querySelectorAll("[data-composition-id]"));return f.length===0?null:f.find(p=>!p.parentElement?.closest("[data-composition-id]"))??f[0]??null},R=()=>{let a=N();if(!a)return;let f=A(a.getAttribute("data-width")),p=A(a.getAttribute("data-height"));f&&(a.style.width=f),p&&(a.style.height=p),f&&a.style.setProperty("--comp-width",f),p&&a.style.setProperty("--comp-height",p)},F=()=>{let a=N(),f=Array.from(document.querySelectorAll("[data-composition-id]")).filter(p=>p.hasAttribute("data-duration")||p.hasAttribute("data-end"));for(let p of f)a&&p===a||(p.removeAttribute("data-duration"),p.removeAttribute("data-end"))},x=()=>{let a=N();if(!a)return;a.style.position||(a.style.position="relative"),a.style.overflow="hidden";let f=A(a.getAttribute("data-width")),p=A(a.getAttribute("data-height"));f&&(a.style.width=f),p&&(a.style.height=p);let E=Array.from(a.children);for(let L of E){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,f=0)=>Te({timelineRegistry:window.__timelines??{}}).resolveStartForElement(a,f),C=a=>Te({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 f of a){let p=f.getAttribute("data-composition-id");if(p&&f.children.length===0&&document.querySelector(`template#${CSS.escape(p)}-template`)){Y=!0;break}}}let U=!W&&!Y,K=a=>{if(!a||typeof a.duration!="function")return null;try{let f=Number(a.duration());return Number.isFinite(f)?Math.max(0,f):null}catch{return null}},H=a=>typeof a=="number"&&Number.isFinite(a)&&a>u,de=a=>{let f=Number(a.getAttribute("data-duration"));if(Number.isFinite(f)&&f>0)return f;let p=Number(a.getAttribute("data-playback-start")??a.getAttribute("data-media-start")??"0"),E=Number.isFinite(p)?Math.max(0,p):0;return Number.isFinite(a.duration)&&a.duration>E?Math.max(0,a.duration-E):null},v=()=>{let a=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(a.length===0)return null;let f=0;for(let p of a){let E=k(p,0);if(!Number.isFinite(E))continue;let L=de(p);L==null||L<=u||(f=Math.max(f,Math.max(0,E)+L))}return f>u?f: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,T=(a,f=0)=>{let p=K(a),E=S(),L=Number.isFinite(f)&&f>u?f:0,Z=0;H(p)?Z=Math.max(p,L):H(E)?Z=Math.max(E,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??{},f=Te({timelineRegistry:a}),p=S(),E=h(p),L=$=>{let O=document.querySelector(`[data-composition-id="${CSS.escape($)}"]`);return O?f.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 xe=K(ie);J.push({compositionId:Q,timeline:ie,durationSeconds:xe??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(on=>on.compositionId),Q=Z(ne),ie=K(Q);if(Q&&H(ie))return{timeline:Q,selectedTimelineIds:j,selectedDurationSeconds:ie,mediaDurationFloorSeconds:p,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:E,selectedDurationSeconds:ie,mediaDurationFloorSeconds:p,selectedTimelineIds:j,autoNestedChildren:$}}};let xe=re(p??0,se),Le=K(xe);if(xe&&H(Le))return{timeline:xe,selectedTimelineIds:[X],selectedDurationSeconds:Le,mediaDurationFloorSeconds:p,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:p,selectedDurationSeconds:Le,selectedTimelineIds:[X],autoNestedChildren:$}}}}if(!H(O)&&ne.length===0){let j=re(p??0,se),Q=K(j);if(j&&H(Q))return{timeline:j,selectedTimelineIds:[X],selectedDurationSeconds:Q,mediaDurationFloorSeconds:p,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:X,rootDurationSeconds:O,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:p,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:p,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:p,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:p,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:X,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:E,selectedDurationSeconds:J,mediaDurationFloorSeconds:p,selectedTimelineIds:$}}}}return{timeline:null}},G=()=>{let a=e.capturedTimeline;if(!a||typeof a.time!="function")return;let f=Number(a.time());Number.isFinite(f)&&(e.currentTime=Math.max(0,f))},I=!1,D=()=>{if(!U)return!1;let a=e.capturedTimeline,f=K(a),p=H(f);if(a&&p&&I)return!1;let E=P();return E.timeline?a&&a===E.timeline?(typeof a.timeScale=="function"&&a.timeScale(e.playbackRate),!1):(e.capturedTimeline=E.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),E.diagnostics&&le({source:"hf-preview",type:"diagnostic",code:E.diagnostics.code,details:E.diagnostics.details}),le({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:E.selectedTimelineIds??[],selectedDurationSeconds:E.selectedDurationSeconds??null,mediaDurationFloorSeconds:E.mediaDurationFloorSeconds??null}}),!0):!1},B=()=>{let a=N();if(!(a instanceof HTMLElement))return;let f=a.getBoundingClientRect(),p=Number(a.getAttribute("data-width")),E=Number(a.getAttribute("data-height")),L=window.getComputedStyle(a),Z=Number.isFinite(p)&&p>0&&Number.isFinite(E)&&E>0,re=f.width<=0||f.height<=0||a.clientWidth<=0||a.clientHeight<=0;!Z||!re||c("root_stage_layout_zero",{compositionId:a.getAttribute("data-composition-id")??null,declaredWidth:p,declaredHeight:E,rectWidth:Math.round(f.width),rectHeight:Math.round(f.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 f=q(a.error??a.message).slice(0,z);if(!f)return;let p=y(f);le({source:"hf-preview",type:"diagnostic",code:p.code,details:{category:p.category,message:f,filename:a.filename||null,line:Number.isFinite(a.lineno)?a.lineno:null,column:Number.isFinite(a.colno)?a.colno:null}})},s=a=>{let f=q(a.reason).slice(0,z);if(!f)return;let p=y(f);le({source:"hf-preview",type:"diagnostic",code:`${p.code}_unhandled_rejection`,details:{category:`${p.category}-unhandled-rejection`,message:f}})},window.addEventListener("error",n),window.addEventListener("unhandledrejection",s)},ve=()=>{let a=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let p of a){let E=()=>{if(!(p instanceof Element))return;let L=p.tagName.toLowerCase(),Z=p.getAttribute("src")??p.getAttribute("href")??p.getAttribute("poster")??null,re=L==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";c(re,{tagName:L,assetUrl:Z,currentSrc:(p instanceof HTMLImageElement||p instanceof HTMLMediaElement)&&p.currentSrc||null,readyState:p instanceof HTMLMediaElement?p.readyState:null,networkState:p instanceof HTMLMediaElement?p.networkState:null},`${re}:${L}:${Z??"unknown"}`)};p.addEventListener("error",E),d(()=>{p.removeEventListener("error",E)})}let f=document.fonts;f&&f.ready.then(()=>{if(e.tornDown)return;let p=Array.from(f).filter(E=>E.status==="error").map(E=>E.family).filter(E=>!!E).slice(0,10);p.length!==0&&c("runtime_font_load_issue",{failedFamilies:p,totalFaces:Array.from(f).length},`runtime-font-load-issue:${p.join("|")}`)}).catch(()=>{})},fe=(a,f)=>{if(!a.timeline)return!1;let p=e.capturedTimeline;if(p&&p===a.timeline)return!1;let E=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(E,!1),L&&e.capturedTimeline.play()}catch{}return le({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:f,previousTime:E,selectedTimelineIds:a.selectedTimelineIds??[],selectedDurationSeconds:a.selectedDurationSeconds??null,mediaDurationFloorSeconds:a.mediaDurationFloorSeconds??null}}),!0},be=null,ct=!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(ct)return;let p=K(e.capturedTimeline),E=a.selectedDurationSeconds??K(a.timeline);H(E)&&(!H(p)||E>=p+V)&&fe(a,"manual")&&(ct=!0,le({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:p??null,selectedDurationSeconds:E??null,selectedTimelineIds:a.selectedTimelineIds??[],mediaDurationFloorSeconds:a.mediaDurationFloorSeconds??null}}),ke(),he(!0))},ee))},en=()=>{for(let a of De)a.removeEventListener("loadedmetadata",_e),a.removeEventListener("durationchange",_e);De.clear()},ze=()=>{if(e.tornDown)return;let a=Array.from(document.querySelectorAll("video, audio"));for(let f of a)De.has(f)||(De.add(f),f.addEventListener("loadedmetadata",_e),f.addEventListener("durationchange",_e),f.preload!=="auto"&&(f.preload="auto"),f.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&f.load())},dt=()=>{let a=xt({resolveStartSeconds:E=>k(E,0)});Tt({clips:a.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate});let f=document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null,p=Array.from(document.querySelectorAll("[data-start]"));for(let E of p){if(!(E instanceof HTMLElement))continue;let L=E.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta")continue;if(!E.getAttribute("data-composition-id")){let ce=E.closest("[data-composition-id]")?.getAttribute("data-composition-id")??null;if(ce&&ce!==f)continue}let re=k(E,0),Se=C(E),te=Se!=null&&Se>0?re+Se:Number.POSITIVE_INFINITY,X=te,se=E.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 $e=e.currentTime>=re&&(Number.isFinite(X)?e.currentTime<X:!0);E.style.visibility=$e?"visible":"hidden"}},he=a=>{G();let f=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),p=Date.now();(a||f!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||p-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=f,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=p,le({source:"hf-preview",type:"state",frame:f,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},ke=()=>{F(),R(),x();let a=N();if(a){let p=A(a.getAttribute("data-width")),E=A(a.getAttribute("data-height")),L=p?parseInt(p,10):0,Z=E?parseInt(E,10):0;L>0&&Z>0&&le({source:"hf-preview",type:"stage-size",width:L,height:Z})}D();let f=Pt({canonicalFps:e.canonicalFps,maxTimelineDurationSeconds:e.maxTimelineDurationSeconds});window.__clipManifest=f,le(f),me()},Re=(a,f=0)=>{for(let p of e.deterministicAdapters){try{a==="discover"&&p.discover(),a==="pause"&&p.pause(),a==="play"&&p.play&&p.play()}catch{}if(a==="discover")try{p.seek({time:f})}catch{}}};if(U)Ze();else{let a={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,parseDimensionPx:A,onDiagnostic:({code:f,details:p})=>{le({source:"hf-preview",type:"diagnostic",code:f,details:p})}};Dt(a).then(()=>It(a)).finally(()=>{U=!0,Re("discover",e.currentTime),ze(),ve(),Ze(),ke(),he(!0)})}let We=wt({postMessage:a=>le(a)});We.installPickerApi();let mt=a=>{let f=Number(a);!Number.isFinite(f)||f<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,f)),e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let p=document.querySelectorAll("video, audio");for(let E of p)if(E instanceof HTMLMediaElement)try{E.playbackRate=e.playbackRate}catch{}},oe=vt({getTimeline:()=>e.capturedTimeline,setTimeline:a=>{e.capturedTimeline=a},getIsPlaying:()=>e.isPlaying,setIsPlaying:a=>{e.isPlaying=a},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:mt,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(a,f)=>{e.currentTime=Math.max(0,Number(a)||0),e.isPlaying=f,dt()},onStatePost:he,onDeterministicSeek:a=>{for(let f of e.deterministicAdapters)try{f.seek({time:Number(a)||0})}catch{}},onDeterministicPause:()=>Re("pause"),onDeterministicPlay:()=>Re("play"),onRenderFrameSeek:()=>{},onShowNativeVideos:()=>{},getSafeDuration:()=>T(e.capturedTimeline,0)});window.__player=r(oe),window.__playerReady=!0,window.__renderReady=!0,gt(le),Ce("composition_loaded",{duration:oe.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.controlBridgeHandler=ht({onPlay:()=>{oe.play(),Ce("composition_played",{time:oe.getTime()})},onPause:()=>{oe.pause(),Ce("composition_paused",{time:oe.getTime()})},onSeek:(a,f)=>{let p=Math.max(0,a)/e.canonicalFps;oe.seek(p),Ce("composition_seeked",{time:p})},onSetMuted:a=>{e.bridgeMuted=a;let f=document.querySelectorAll("video, audio");for(let p of f)p instanceof HTMLMediaElement&&(p.muted=a)},onSetPlaybackRate:a=>mt(a),onEnablePickMode:()=>We.enablePickMode(),onDisablePickMode:()=>We.disablePickMode()}),D(),e.capturedTimeline&&(oe._timeline=e.capturedTimeline),U&&setTimeout(()=>{let a=e.capturedTimeline;D()&&e.capturedTimeline!==a&&(oe._timeline=e.capturedTimeline),Re("discover",e.currentTime),ke(),he(!0)},0),e.deterministicAdapters=[yt({resolveStartSeconds:a=>k(a,0)}),Et(),At(),kt(),bt({getTimeline:()=>e.capturedTimeline})],ae(),Re("discover"),ze(),e.timelinePollIntervalId&&clearInterval(e.timelinePollIntervalId);let Ge=0,Be=null,ft=0,Ue=!1,Ee=0,pt=()=>{ft=Date.now(),Ue=!1,Ee=0};e.timelinePollIntervalId=setInterval(()=>{Ge+=1;let f=e.isPlaying&&e.capturedTimeline!=null&&Math.max(0,e.currentTime||0)<_?!1:D();if(e.capturedTimeline&&!oe._timeline&&(oe._timeline=e.capturedTimeline),(f||Ge%20===0)&&ke(),Ge%10===0&&ze(),G(),e.isPlaying&&e.capturedTimeline){let p=Math.max(0,e.currentTime||0),E=Be,L=T(e.capturedTimeline,0);if(L>0&&p>=L){oe.pause(),oe.seek(L),Be=L,Ee=0,he(!0);return}if(E!=null&&E>=m&&p<=b?Ee+=1:Ee=0,!Ue&&Ee>=M&&Date.now()-ft>w){let re=P();fe(re,"loop_guard")&&(Ue=!0,Ee=0)}Be=Math.max(0,e.currentTime||0)}else Be=Math.max(0,e.currentTime||0);e.isPlaying&&dt(),he(!1)},50),ke(),he(!0);let tn=oe.seek;oe.seek=a=>{pt(),tn(a)};let nn=oe.renderSeek;oe.renderSeek=a=>{pt(),nn(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),en(),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 dn=["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"],mn=["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 fn(e){return e<=255?dn[e]:1424<=e&&e<=1524?"R":1536<=e&&e<=1791?mn[e&255]:1792<=e&&e<=2220?"AL":"L"}function pn(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=fn(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 Wt(e,t){let n=pn(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 hn=/[ \t\n\r\f]+/g,gn=/[\t\n\r\f]| {2,}|^ | $/;function yn(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function bn(e){if(!gn.test(e))return e;let t=e.replace(hn," ");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 Sn(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
`).replace(/[\r\f]/g,`
`):e.replace(/\r\n/g,`
`)}var Qe=null,Ln;function An(){return Qe===null&&(Qe=new Intl.Segmenter(Ln,{granularity:"word"})),Qe}var kn=/\p{Script=Arabic}/u,Oe=/\p{M}/u,Ht=/\p{Nd}/u;function Ye(e){return kn.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 tt=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"]),nt=new Set(["'","\u2019"]),we=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),En=new Set([":",".","\u060C","\u061B"]),xn=new Set(["\u104F"]),Tn=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function wn(e){if(it(e))return!0;let t=!1;for(let n of e){if(we.has(n)){t=!0;continue}if(!(t&&Oe.test(n)))return!1}return t}function Mn(e){for(let t of e)if(!tt.has(t)&&!we.has(t))return!1;return e.length>0}function Nn(e){if(it(e))return!0;for(let t of e)if(!Ie.has(t)&&!nt.has(t)&&!Oe.test(t))return!1;return e.length>0}function it(e){let t=!1;for(let n of e)if(!(n==="\\"||Oe.test(n))){if(Ie.has(n)||we.has(n)||nt.has(n)){t=!0;continue}return!1}return t}function vn(e){let t=Array.from(e),n=t.length;for(;n>0;){let s=t[n-1];if(Oe.test(s)){n--;continue}if(Ie.has(s)||nt.has(s)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function Rn(e,t){if(e.length===0)return!1;for(let n of e)if(n!==t)return!1;return!0}function Cn(e){return!Ye(e)||e.length===0?!1:En.has(e[e.length-1])}function Pn(e){return e.length===0?!1:xn.has(e[e.length-1])}function Fn(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 ot(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Tn.has(n))return!0;if(!we.has(n))return!1}return!1}function In(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e==="	")return"tab";if(t.preserveHardBreaks&&e===`
`)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 Dn(e,t,n,s){let o=[],i=null,l="",d=n,c=!1,r=0;for(let u of e){let g=In(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 Xe(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var _n=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Wn(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:_n.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Bn(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Hn(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"||!Wn(e,l))continue;let d=l+1;for(;d<e.len&&!Xe(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 On(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]),!Bn(l))continue;let d=i+1;if(d>=e.len||Xe(e.kinds[d]))continue;let c="",r=e.starts[d],u=d;for(;u<e.len&&!Xe(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 jn=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Bt=/^[A-Za-z0-9_]+[,:;]*$/,zn=/[,:;]+$/;function Ot(e){for(let t of e)if(Ht.test(t))return!0;return!1}function et(e){if(e.length===0)return!1;for(let t of e)if(!(Ht.test(t)||jn.has(t)))return!1;return!0}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];if(d==="text"&&et(l)&&Ot(l)){let c=l,r=i+1;for(;r<e.len&&e.kinds[r]==="text"&&et(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 Un(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&&Bt.test(l)){let r=l,u=i+1;for(;zn.test(r)&&u<e.len&&e.kinds[u]==="text"&&e.isWordLike[u]&&Bt.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||!Ot(u)||!et(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 $n(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 Vn(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=vn(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 Kn(e,t,n){let s=An(),o=0,i=[],l=[],d=[],c=[];for(let m of s.segment(e))for(let b of Dn(m.segment,m.isWordLike??!1,m.index,n)){let w=b.kind==="text";t.carryCJKAfterClosingQuote&&w&&o>0&&d[o-1]==="text"&&pe(b.text)&&pe(i[o-1])&&ot(i[o-1])||w&&o>0&&d[o-1]==="text"&&Mn(b.text)&&pe(i[o-1])||w&&o>0&&d[o-1]==="text"&&Pn(i[o-1])?(i[o-1]+=b.text,l[o-1]=l[o-1]||b.isWordLike):w&&o>0&&d[o-1]==="text"&&b.isWordLike&&Ye(b.text)&&Cn(i[o-1])?(i[o-1]+=b.text,l[o-1]=!0):w&&!b.isWordLike&&o>0&&d[o-1]==="text"&&b.text.length===1&&b.text!=="-"&&b.text!=="\u2014"&&Rn(i[o-1],b.text)||w&&!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]&&it(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]&&Nn(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=$n({len:r,texts:i,isWordLike:l,kinds:d,starts:c}),g=Vn(Un(qn(Gn(On(Hn(u))))));for(let m=0;m<g.len-1;m++){let b=Fn(g.texts[m]);b!==null&&(g.kinds[m]!=="space"&&g.kinds[m]!=="preserved-space"||g.kinds[m+1]!=="text"||!Ye(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 Jn(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 jt(e,t,n="normal"){let s=yn(n),o=s.mode==="pre-wrap"?Sn(e):bn(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let i=Kn(o,t,s);return{normalized:o,chunks:Jn(i,s),...i}}var Me=null,zt=new Map,Ne=null,Zn=/\p{Emoji_Presentation}/u,Qn=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,rt=null,Gt=new Map;function st(){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 Yn(e){let t=zt.get(e);return t||(t=new Map,zt.set(e,t)),t}function ge(e,t){let n=t.get(e);return n===void 0&&(n={width:st().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 Xn(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function at(){return rt===null&&(rt=new Intl.Segmenter(void 0,{granularity:"grapheme"})),rt}function ei(e){return Zn.test(e)||e.includes("\uFE0F")}function Ut(e){return Qn.test(e)}function ti(e,t){let n=Gt.get(e);if(n!==void 0)return n;let s=st();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 Gt.set(e,n),n}function ni(e){let t=0,n=at();for(let s of n.segment(e))ei(s.segment)&&t++;return t}function ii(e,t){return t.emojiCount===void 0&&(t.emojiCount=ni(e)),t.emojiCount}function ye(e,t,n){return n===0?t.width:t.width-ii(e,t)*n}function qt(e,t,n,s){if(t.graphemeWidths!==void 0)return t.graphemeWidths;let o=[],i=at();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 $t(e,t,n,s){if(t.graphemePrefixWidths!==void 0)return t.graphemePrefixWidths;let o=[],i=at(),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 Vt(e,t){let n=st();n.font=e;let s=Yn(e),o=Xn(e),i=t?ti(e,o):0;return{cache:s,fontSize:o,emojiCorrection:i}}function je(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function oi(e){return e==="space"}function ri(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function lt(e,t,n,s){return!s||t===null?e[n]:t[n]-(n>0?t[n-1]:0)}function si(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 Kt(e,t){return e.simpleLineWalkFastPath?ai(e,t):Jt(e,t)}function ai(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 w=o[m],M=i[m]??null;r=0;for(let _=0;_<w.length;_++){let V=lt(w,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],w=s[m];if(!u){g(m);continue}let M=r+b;if(M>t+d){if(oi(w))continue;r=0,u=!1,g(m);continue}r=M}return u?c:c+1}function li(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,w=0,M=0,_=-1,V=0;function ee(){_=-1,V=0}function z(k=w,C=M,W=u){r++,n?.({startSegmentIndex:m,startGraphemeIndex:b,endSegmentIndex:k,endGraphemeIndex:C,width:W}),u=0,g=!1,ee()}function q(k,C){g=!0,m=k,b=0,w=k+1,M=0,u=C}function y(k,C,W){g=!0,m=k,b=C,w=k,M=C+1,u=W}function A(k,C){if(!g){q(k,C);return}u+=C,w=k+1,M=0}function N(k,C){je(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 U=C;U<W.length;U++){let K=lt(W,Y,U,d.preferPrefixWidthsForBreakableRuns);if(!g){y(k,U,K);continue}u+K>t+c?(z(),y(k,U,K)):(u+=K,w=k,M=U+1)}g&&w===k&&M===W.length&&(w=k+1,M=0)}let x=0;for(;x<s.length;){let k=s[x],C=o[x];if(!g){k>t&&i[x]!==null?R(x):q(x,k),N(x,k),x++;continue}if(u+k>t+c){if(je(C)){A(x,k),z(x+1,0,u-k),x++;continue}if(_>=0){z(_,0,V);continue}if(k>t&&i[x]!==null){z(),R(x),x++;continue}z();continue}A(x,k),N(x,k),x++}return g&&z(),r}function Jt(e,t,n){if(e.simpleLineWalkFastPath)return li(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,w=0,M=0,_=!1,V=0,ee=0,z=0,q=0,y=-1,A=0,N=0,R=null;function F(){y=-1,A=0,N=0,R=null}function x(v=z,S=q,h=M){w++,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,q=0,M=S}function C(v,S,h){_=!0,V=v,ee=S,z=v,q=S+1,M=h}function W(v,S){if(!_){k(v,S);return}M+=S,z=v+1,q=0}function Y(v,S){if(!je(l[v]))return;let h=l[v]==="tab"?0:o[v],T=l[v]==="tab"?S:i[v];y=v+1,A=M-S+h,N=M-S+T,R=l[v]}function U(v){K(v,0)}function K(v,S){let h=d[v],T=c[v]??null;for(let P=S;P<h.length;P++){let G=lt(h,T,P,m.preferPrefixWidthsForBreakableRuns);if(!_){C(v,P,G);continue}M+G>t+b?(x(),C(v,P,G)):(M+=G,z=v,q=P+1)}_&&z===v&&q===h.length&&(z=v+1,q=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,T=h!==S,{fitCount:P,fittedWidth:G}=si(h,M,t,b,r,T);return P===0?!1:(M=G,z=v,q=P,F(),P===S.length?(z=v+1,q=0,!0):(x(v,P,G+r),K(v,P),!0))}function de(v){w++,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,q=0,F();let h=S.startSegmentIndex;for(;h<S.endSegmentIndex;){let T=l[h],P=T==="tab"?ri(M,u):s[h];if(T==="soft-hyphen"){_&&(z=h+1,q=0,y=h+1,A=M+r,N=M+r,R=T),h++;continue}if(!_){P>t&&d[h]!==null?U(h):k(h,P),Y(h,P),h++;continue}if(M+P>t+b){let I=M+(T==="tab"?0:o[h]),D=M+(T==="tab"?P:i[h]);if(R==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&A<=t+b){x(y,0,N);continue}if(R==="soft-hyphen"&&H(h)){h++;continue}if(je(T)&&I<=t+b){W(h,P),x(h+1,0,D),h++;continue}if(y>=0&&A<=t+b){x(y,0,N);continue}if(P>t&&d[h]!==null){x(),U(h),h++;continue}x();continue}W(h,P),Y(h,P),h++}if(_){let T=y===S.consumedEndSegmentIndex?N:M;x(S.consumedEndSegmentIndex,0,T)}}return w}var ut=null;function ui(){return ut===null&&(ut=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ut}function ci(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 di(e,t,n){let s=ui(),o=Ae(),{cache:i,emojiCorrection:l}=Vt(t,Ut(e.normalized)),d=ye("-",ge("-",i),l),r=ye(" ",ge(" ",i),l)*8;if(e.len===0)return ci(n);let u=[],g=[],m=[],b=[],w=e.chunks.length<=1,M=n?[]:null,_=[],V=[],ee=n?[]:null,z=Array.from({length:e.len}),q=Array.from({length:e.len});function y(R,F,x,k,C,W,Y,U){C!=="text"&&C!=="space"&&C!=="zero-width-break"&&(w=!1),u.push(F),g.push(x),m.push(k),b.push(C),M?.push(W),_.push(Y),V.push(U),ee!==null&&ee.push(R)}for(let R=0;R<e.len;R++){z[R]=u.length;let F=e.texts[R],x=e.isWordLike[R],k=e.kinds[R],C=e.starts[R];if(k==="soft-hyphen"){y(F,0,d,d,k,C,null,null),q[R]=u.length;continue}if(k==="hard-break"){y(F,0,0,0,k,C,null,null),q[R]=u.length;continue}if(k==="tab"){y(F,0,0,0,k,C,null,null),q[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)||tt.has(S)||we.has(S)||o.carryCJKAfterClosingQuote&&pe(S)&&ot(H)){H+=S;continue}let h=ge(H,i),T=ye(H,h,l);y(H,T,T,T,"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)}q[R]=u.length;continue}let Y=ye(F,W,l),U=k==="space"||k==="preserved-space"||k==="zero-width-break"?0:Y,K=k==="space"||k==="zero-width-break"?0:Y;if(x&&F.length>1){let H=qt(F,W,i,l),de=o.preferPrefixWidthsForBreakableRuns?$t(F,W,i,l):null;y(F,Y,U,K,k,C,H,de)}else y(F,Y,U,K,k,C,null,null);q[R]=u.length}let A=mi(e.chunks,z,q),N=M===null?null:Wt(e.normalized,M);return ee!==null?{widths:u,lineEndFitAdvances:g,lineEndPaintAdvances:m,kinds:b,simpleLineWalkFastPath:w,segLevels:N,breakableWidths:_,breakablePrefixWidths:V,discretionaryHyphenWidth:d,tabStopAdvance:r,chunks:A,segments:ee}:{widths:u,lineEndFitAdvances:g,lineEndPaintAdvances:m,kinds:b,simpleLineWalkFastPath:w,segLevels:N,breakableWidths:_,breakablePrefixWidths:V,discretionaryHyphenWidth:d,tabStopAdvance:r,chunks:A}}function mi(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 fi(e,t,n,s){let o=jt(e,Ae(),s?.whiteSpace);return di(o,t,n)}function Zt(e,t,n){return fi(e,t,!1,n)}function Qt(e,t,n){let s=Kt(e,t);return{lineCount:s,height:s*n}}var pi={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Yt(e,t){let n={...pi,...t},s=1.2;for(let o=n.baseFontSize;o>=n.minFontSize;o-=n.step){let i=`${n.fontWeight} ${o}px ${n.fontFamily}`,l=Zt(e,i),{lineCount:d}=Qt(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:Yt};function Xt(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,_t())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Xt,{once:!0}):Xt();})();

