@hyperframes/core 0.8.141 → 0.8.142
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.
- package/dist/colorGrading.d.ts.map +1 -1
- package/dist/colorGrading.js +9 -1
- package/dist/colorGrading.js.map +1 -1
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/generated/runtime-inline.js.map +1 -1
- package/dist/hyperframe.runtime.iife.js +2 -2
- package/dist/runtime/timeline.d.ts.map +1 -1
- package/dist/runtime/timeline.js +15 -2
- package/dist/runtime/timeline.js.map +1 -1
- package/dist/timelineAssetId.d.ts +3 -0
- package/dist/timelineAssetId.d.ts.map +1 -0
- package/dist/timelineAssetId.js +108 -0
- package/dist/timelineAssetId.js.map +1 -0
- package/package.json +9 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-inline.js","sourceRoot":"","sources":["../../src/generated/runtime-inline.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,YAAY,GAAW,
|
|
1
|
+
{"version":3,"file":"runtime-inline.js","sourceRoot":"","sources":["../../src/generated/runtime-inline.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,YAAY,GAAW,gu9fAAgu9f,CAAC;AAE9v9f;;;;GAIG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -39,7 +39,7 @@ https://www.w3ctech.com/topic/2226`));let s=n(...a);return s.postcssPlugin=t,s.p
|
|
|
39
39
|
100% { outline-color: transparent; }
|
|
40
40
|
}
|
|
41
41
|
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){H("bridge.flashElements.querySelector",r)}}var _o=e=>4*Number.EPSILON*Math.max(1,Math.abs(e));function Wr(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?e===t:Math.abs(e-t)<=_o(Math.max(Math.abs(e),Math.abs(t)))}var Ff=(e,t)=>e>=t||Wr(e,t),jt=(e,t,n)=>Ff(e,t)&&e<n&&!Wr(e,n),yv=1e-6,Vn=(e,t,n,r)=>jt(e,t,n)||Ff(e,t)&&r>0&&n>=r-yv;var Os=null;function If(e){Os=e}function Qe(e,t){if(Os)try{Os({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){H("runtime.analytics.site1",n)}}function Sv(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function $n(e){return`--${Sv(e)}`}function Df(e){let t=new Map;for(let n of e){let r=$n(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function Of(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,Vr(i));let n=Ro(),r={...t,...n};for(let i of e)Gs(i,r);return r}var Pf=new Set;function Hf(e){let t=e?.getAttribute("data-composition-variables");if(!t)return[];let n;try{n=JSON.parse(t)}catch{return[]}return Array.isArray(n)?n.filter(r=>!!r&&typeof r=="object"):[]}function vv(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function Ev(e){return Array.isArray(e.options)?e.options.map(t=>t&&typeof t=="object"?t.value:t).filter(t=>typeof t=="string"||typeof t=="number"):[]}function Av(e,t){if(typeof e.id!="string")return null;let n=t[e.id];if(n==null||"default"in e&&String(n)===String(e.default))return null;let r=Ev(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function Gs(e,t,n){if(!e)return;let r=Hf(e);if(r.length===0)return;let i=vv(e,n);for(let o of r){let a=Av(o,t);if(!a)continue;let s=`${i}|${a.id}|${String(a.value)}`;if(Pf.has(s))continue;Pf.add(s);let l="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${l} instead.`)}}function Vr(e){let t={};for(let n of Hf(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Hs="data-hf-css-vars";function Co(e){return"style"in e&&typeof e.style?.setProperty=="function"}function Bs(e,t){if(!Co(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=$n(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Hs,n.join(" "))}function Gf(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=$n(i);((Co(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function Bf(e){if(!Co(e))return;let t=e.getAttribute(Hs);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Hs)}}function Uf(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=Ro(),r=[];for(let i of t)r.push(...wv(i,n,e.defaultView));for(let i of Df(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${$n(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function wv(e,t,n){if(!Co(e))return[];let r=Vr(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let s=$n(o);(e.style.getPropertyValue(s)||(n?n.getComputedStyle(e).getPropertyValue(s):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return Bs(e,i),Object.keys(r)}function Wf(e){let t=e.getAttribute("data-variable-values");if(!t)return{};let n;try{n=JSON.parse(t)}catch{return{}}return!n||typeof n!="object"||Array.isArray(n)?{}:n}function Ro(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function Vf(e){let t=[],n=(m,g=()=>m.getAnimations())=>{if(typeof m.getAnimations!="function")return[];try{return g()}catch{return[]}},r=m=>{let g=new Map;if(t.length===0)return g;let h=typeof CSSAnimation<"u";for(let b of n(document,m)){if(h&&!(b instanceof CSSAnimation))continue;let x=b.effect;if(!x?.target||x.pseudoElement)continue;let v=g.get(x.target);v?v.push(b):g.set(x.target,[b])}return g},i=(m=[],g=[])=>[...g,...m.filter(h=>!g.includes(h)&&h.playState!=="idle")],o=m=>{let g=m.closest("[data-start]")??m;return e?.resolveStartSeconds?e.resolveStartSeconds(g):Number.parseFloat(g.getAttribute("data-start")??"0")||0},a=m=>{let g=A=>(A||"").split(",").map(E=>Number.parseFloat(E)/(E.trim().endsWith("ms")?1e3:1)),h=g(m.animationDuration),b=g(m.animationDelay),x=m.animationName.split(","),v=0;return x.forEach((A,E)=>{if(A.trim()==="none")return;let k=b[E%b.length]+h[E%h.length];k>v&&(v=k)}),{cycleSeconds:v,delays:x.map((A,E)=>b[E%b.length]||0)}},s=(m,g)=>{let h=null;try{h=m.effect?.getComputedTiming?.()??null}catch(x){H("runtime.adapters.css.site5",x)}if(!h)return{};let b=Number(h.endTime);return Number.isFinite(b)?{endSeconds:g+b/1e3}:{unbounded:!0}},l=(m,g)=>{for(let h of m){try{h.currentTime=g}catch(b){H("runtime.adapters.css.site1",b)}try{h.pause()}catch(b){H("runtime.adapters.css.site2",b)}}},u=m=>{for(let g of m)try{g.play()}catch(h){H("runtime.adapters.css.site3",h)}},f=m=>{for(let g of m)try{g.pause()}catch(h){H("runtime.adapters.css.site4",h)}},d=m=>{m.baseDelay?m.el.style.animationDelay=m.baseDelay:m.el.style.removeProperty("animation-delay"),m.basePlayState?m.el.style.animationPlayState=m.basePlayState:m.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{for(let h of t)d(h);let m=new Map(t.map(h=>[h.el,h.handles]));t=[];let g=document.querySelectorAll("*");for(let h of g){if(!xe(h))continue;let b=window.getComputedStyle(h);!b.animationName||b.animationName==="none"||t.push({el:h,baseDelay:h.style.animationDelay||"",basePlayState:h.style.animationPlayState||"",...a(b),handles:m.get(h)})}},getAnimationCycleEndSeconds:()=>{let m=0;for(let g of t)!g.el.isConnected||g.cycleSeconds<=0||(m=Math.max(m,o(g.el)+g.cycleSeconds));return m>0?m:null},getInferredDurationSeconds:()=>{let m=0;for(let g of t){if(!g.el.isConnected)continue;let h=o(g.el);for(let b of n(g.el)){let x=s(b,h);x.endSeconds!=null&&(m=Math.max(m,x.endSeconds))}}return m>0?m:null},seek:m=>{let g=Number(m.time)||0,h=r(m.pageAnimations);for(let b of t)b.handles=i(b.handles,h.get(b.el));for(let b of t){if(!b.el.isConnected)continue;let x=o(b.el),v=Math.max(0,g-x)*1e3;if(b.handles?.length){b.el.style.animationDelay!==b.baseDelay&&d(b),l(b.handles,v);continue}b.el.style.animationPlayState="paused",b.el.style.animationDelay=b.delays.map(A=>`${Number((A-v/1e3).toFixed(3))}s`).join(", ")}},pause:m=>{let g=r(m?.pageAnimations);for(let h of t){if(!h.el.isConnected)continue;let b=g.get(h.el);b&&(f(b),d(h))}},play:()=>{let m=r();for(let g of t)g.el.isConnected&&(d(g),u(m.get(g.el)??[]))},revert:()=>{t=[]}}}function Ws(e,t){e.totalDuration?.();let n=e.getChildren?.(!1,!0,!0)??[],r=Cv(e).map(s=>[s,s.ratio,s._zTime,s._act]),i=$f(n,t).map(s=>[s,s._ts]),o=new Set;for(let[s]of i)for(let l=s.parent;l&&!o.has(l);l=l.parent)o.add(l);let a=[...o].map(s=>[s,s._dur,s._tDur,s._end,s._dirty]);for(let[s]of i)s._ts=0;try{e.totalTime(t>=.001?t-.001:t+.001,!0),zf(n,t),e.totalTime(t,!0)}finally{for(let[s,l]of i)s._ts=l;for(let[s,l,u,f,d]of a)Object.assign(s,{_dur:l,_tDur:u,_end:f,_dirty:d})}for(let[s,l,u,f]of r)s.ratio=l,s._zTime=u,s._act=f}var _v=1e-6;function $f(e,t,n=[]){for(let r of e)r.startTime()>t+_v?n.push(r):r.getChildren&&r.endTime()>=t&&$f(r.getChildren(!1,!0,!0),r.time(),n);return n}function Cv(e){return(e.getChildren?.(!0,!0,!0)??[]).filter(t=>{let n=t;return typeof n.getChildren=="function"||n.totalDuration?.()===0})}var Us=2e-8,Rv=e=>{let t=e;return typeof t?.render=="function"&&typeof t.startTime=="function"&&typeof t.paused=="function"&&typeof t.timeScale=="function"&&t.timeScale()>0&&!t.paused()};function Tv(e){return e.vars?.keyframes&&(e.render(Us,!0),e.render(-Us,!0)),e._startAt&&e._startAt.render(Us,!0,!0),!!(e.vars?.keyframes||e._startAt)}function zf(e,t){for(let n of e.filter(Rv)){let r=(t-n.startTime())*n.timeScale();if(Math.abs(r)<1e-9&&Tv(n))continue;let i=n.getChildren?n:n.timeline;i?.getChildren&&r>0&&r<=n.totalDuration()&&zf(i.getChildren(!1,!0,!0),r)}}function qf(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),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r,i),Ws({totalTime:n.totalTime.bind(n),totalDuration:n.totalDuration?.bind(n),getChildren:n.getChildren?.bind(n)},r)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function jf(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){H("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){H("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){H("runtime.adapters.animejs.site3",n)}},play:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.play=="function"&&t.play()}catch(n){H("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Qf(e){let t=r=>{let i=Xf(r),o=i&&typeof i.closest=="function"?i.closest("[data-composition-id]"):null;return o&&e?.resolveStartSeconds?e.resolveStartSeconds(o):0},n=(r,i)=>Math.max(0,i-t(r));return{name:"lottie",discover:()=>{try{let r=window.lottie;if(r&&typeof r.getRegisteredAnimations=="function"){let i=r.getRegisteredAnimations();if(Array.isArray(i)&&i.length>0){let o=window.__hfLottie??[],a=new Set(o);for(let s of i)a.has(s)||o.push(s);window.__hfLottie=o}}}catch(r){H("runtime.adapters.lottie.site1",r)}},seek:r=>{let i=Math.max(0,Number(r.time)||0),o=window.__hfLottie;if(!(!o||o.length===0))for(let a of o)try{let s=n(a,i),l=a.loop===!0;if(To(a)){let u=s*a.frameRate;a.totalFrames>0&&l?a.goToAndStop(Yf(u,a.totalFrames),!0):a.totalFrames>0&&u>=a.totalFrames?a.goToAndStop(a.totalFrames-1,!0):a.goToAndStop(s*1e3,!1)}else if(Vs(a)){if(typeof a.setCurrentRawFrameValue=="function"){let u=a.totalFrames??0,f=a.frameRate??30,d=l&&u>0?Yf(s*f,u):s*f;u>0&&a.setCurrentRawFrameValue(Math.min(d,u-1))}else if(typeof a.seek=="function"){let u=a.duration??0;if(Number.isFinite(u)&&u>0){let f=Math.min(100,(l?s%u:s)/u*100);a.seek(f)}}}}catch(s){H("runtime.adapters.lottie.site2",s)}},pause:()=>{let r=window.__hfLottie;if(!(!r||r.length===0))for(let i of r)try{(To(i)||Vs(i))&&i.pause()}catch(o){H("runtime.adapters.lottie.site3",o)}},revert:()=>{},getInferredDurationSeconds:()=>Kf((r,i)=>i),getAnimationCycleEndSeconds:()=>Kf((r,i)=>Xf(r)?.isConnected===!1?null:t(r)+i)}}function Kf(e){let t=window.__hfLottie;if(!t||t.length===0)return null;let n=0,r=!1;for(let i of t){let o=null;try{let a=kv(i);o=a==null?null:e(i,a)}catch(a){H("runtime.adapters.lottie.site4",a)}o!=null&&(r=!0,n=Math.max(n,o))}return r?n:null}function Xf(e){return To(e)?e.wrapper:e.canvas}function Yf(e,t){let n=e%t;return t-n<1e-6?0:n}function Jf(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function kv(e){return To(e)?Jf(e.totalFrames,e.frameRate):Vs(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Jf(e.totalFrames,e.frameRate):null}function To(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Vs(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var $s=-1,ko=new Set,zn,zs=0;function Zf(e){let t=[],n=!0,r={time:e,waitUntil:i=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(i)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(i){H("runtime.adapters.seek-dispatch.site1",i)}finally{n=!1}t.length!==0&&Ze(Promise.all(t))}function Ze(e){let t=e.then(()=>({status:"fulfilled"})).catch(n=>({status:"rejected",reason:n}));ko.add(t),t.then(n=>{ko.delete(t)&&n.status==="rejected"&&zn===void 0&&(zn={reason:n.reason})})}function Mo(e){e!==$s&&($s=e,Zf(e))}function No(e){$s=e,Zf(e)}function em(){return zs>0}async function qs(){zs+=1;let e=zn;try{for(await Promise.resolve();ko.size>0;){let r=(await Promise.all([...ko])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=zn;if(e===void 0&&(e=t),zn===t&&(zn=void 0),e)throw e.reason}finally{zs-=1}}function tm(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let f=window.THREE?.DefaultLoadingManager;return!f||typeof f!="object"||typeof f.itemsLoaded!="number"||typeof f.itemsTotal!="number"?null:f},s=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(f=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,f()}}}))},l=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(f,d,m){try{r?.call(this,f,d,m)}finally{s(u)}})};return{name:"three",discover:()=>{let u=a();u&&(l(u),s(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,Mo(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||s(u),o)}}}function yt(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function nm(){return yt({name:"mapbox",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMapbox;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function rm(){return yt({name:"leaflet",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfLeaflet;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>e.whenReady(t))})}function im(){return yt({name:"google-maps",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfGoogleMaps;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{let n=e.addListener("tilesloaded",()=>{n.remove(),t()})})})}function om(){return yt({name:"maplibre",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfMaplibre;return Array.isArray(e)?e:[]},waitFor:e=>new Promise(t=>{if(e.loaded()){t();return}e.on("load",t)})})}function am(){return yt({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var Mv=250;function sm(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(em()||(window.__hfTypegpuTime=e,No(e)))},Mv))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Mo(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var Nv=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function js(e){return Number.isFinite(e)&&e>0?e:30}function Ks(e){return Number.isFinite(e)&&e>0?e:0}function Xs(e,t){let n=js(t);return Math.floor(Ks(e)*n+1e-9)/n}function um(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return Xs(e,t);let i=js(t)*r;return Math.round(Ks(e)*i)/i}function lm(e,t){let n=js(t),r=Ks(e),i=r*n,o=Math.round(i);return Math.abs(i-o)<=.001?o/n:r}function Lo(e,t,n){return{start:lm(e,n),end:Number.isFinite(t)?lm(t,n):t}}function cm(e,t,n=Nv){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}var qn=new Map,dm=()=>qn.size>0;function fm(e){if(qn.has(e.element))throw new Error("This element already has a frame source");let t=e.sourceRange;if(t&&(!Number.isFinite(t.start)||t.start<0||!Number.isFinite(t.duration)||t.duration<=0||!Number.isFinite(t.fps)||t.fps<=0))throw new Error("Frame source ranges require a nonnegative start, positive duration and FPS");let n=new AbortController,r=new Promise(u=>{n.signal.addEventListener("abort",()=>u(),{once:!0})}),i=Promise.race([Promise.resolve(e.ready),r]);i.catch(()=>{});let o=null,a=null,s=async()=>{let u;try{for(await i;!n.signal.aborted&&o!==null;){let f=o;o=null;try{await Promise.race([e.render(f,n.signal),r])}catch(d){u??(u={reason:d})}}if(u)throw u.reason}finally{o=null,a=null}},l={element:e.element,ready:i,seek(u){return o=t?t.start+Math.min(Math.max(0,u),Math.max(0,t.duration-1/t.fps)):u,a??(a=s()),a},dispose(){n.signal.aborted||(n.abort(),o=null,qn.delete(e.element),e.dispose?.())}};return qn.set(e.element,l),l.dispose}function mm(e){let t=new Set,n=[],r=null,i=()=>{for(let s of t)qn.get(s.element)!==s&&t.delete(s);let a=[];for(let[s,l]of qn){if(!s.isConnected){l.dispose();continue}t.has(l)||(t.add(l),Ze(l.ready)),a.push([s,l])}return a},o=new MutationObserver(()=>{i()});return o.observe(document,{childList:!0,subtree:!0}),{name:"frame-source",discover:()=>{i()},pause:()=>{},seek:({time:a})=>{for(let[s,l]of i()){let u=e.start(s),f=e.duration(s),d=u+(f??1/0),m=e.exportRenderSeek()?Lo(u,d,e.canonicalFps()):{start:u,end:d};if(!Vn(a,m.start,m.end,e.compositionDuration()))continue;let g=Math.max(0,a-u),h=Gn(s)+On(bt(s),g);Ze(l.seek(h))}},getReadyPromise:()=>{let a=i().map(([,s])=>s);return a.length===0?null:((a.length!==n.length||a.some((s,l)=>s!==n[l]))&&(n=a,r=Promise.all(a.map(s=>s.ready))),r)},revert:()=>{o.disconnect();for(let a of t)a.dispose();t.clear()}}}var pm=':not([muted]):is(:not([data-has-audio]),[data-has-audio="true"])',aL=`audio[data-start], video[data-start]${pm}`;function Fo(e){if(e.tagName.toLowerCase()!=="video"||e.hasAttribute("muted"))return!1;let t=e.getAttribute("data-has-audio");return t===null||t==="true"}function hm(e){return(e.volume??1)>1||!!(e.fxChain||e.automation||e.audioGroup)}var $r="data-hf-render-id",gm="data-hf-group-render-id";function Lv(e){return e.getAttribute($r)||e.id||null}var Fv="__render_frame_",Iv="__";function Dv(e){return`${Fv}${e}${Iv}`}function Pv(e){let t=Lv(e);return t?Dv(t):null}function Ft(e){let t=Pv(e),n=t?document.getElementById(t):null;if(!n)return null;let r=e.nextElementSibling;for(;r&&r.id!==t;)r=r.nextElementSibling;return r??(r=n),Ie(r)?r:null}function bm(e){let t=e.nextElementSibling;if(Ie(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=Ft(e);return n&&n.complete&&n.naturalWidth>0?n:null}function xm(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(ye(n?.source)){let o=bm(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function ym(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...s){let l=s.length-1,u=s[l];if(ye(u)){let f=bm(u);f&&(s[l]=f)}return o.apply(this,s)};a.__hfVideoPatched=!0,r[i]=a}}}function Sm(){let e=!1,t=0,n=!1,r,i,o,a=new Set,s=new WeakMap,l=(x=()=>document.getAnimations())=>{if(!document.getAnimations)return[];try{return x()}catch{return[]}},u=x=>{let v=Number(x.currentTime);return Number.isFinite(v)&&v>0?v:0},f=(x,v)=>v<=0?x:x>=v?Math.max(0,x-v):x,d=(x,v)=>{let A=s.get(x);if(A)return A;let E={compositionTimeMs:v,animationTimeMs:e?f(u(x),v):u(x)};return s.set(x,E),E},m=(x,v)=>{if(!a.has(x)){a.add(x);let A=()=>{a.delete(x)};try{x.addEventListener("finish",A,{once:!0}),x.addEventListener("cancel",A,{once:!0})}catch(E){H("runtime.adapters.waapi.site4",E)}}d(x,v)},g=(x,v)=>{for(let A of x)m(A,v)},h=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let v=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:v,configurable:!0});let A=function(...E){let k=v.apply(this,E);return m(k,t),k};x.animate=A,r=x,i=v,o=A,n=!0}catch{}},b=x=>{let v=null;try{v=x.effect?.getComputedTiming?.()??null}catch(k){H("runtime.adapters.waapi.site4",k)}if(!v)return{};let A=Number(v.endTime);return Number.isFinite(A)?{endSeconds:(s.get(x)?.compositionTimeMs??0)/1e3+A/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,h(),g(l(),t)},seek:x=>{let v=Math.max(0,(Number(x.time)||0)*1e3);t=v,(!e||a.size>0)&&g(l(x.pageAnimations),e?v:0);for(let A of a){let E=e?d(A,v):d(A,0),k=E.animationTimeMs+Math.max(0,v-E.compositionTimeMs);try{A.currentTime=k}catch(O){H("runtime.adapters.waapi.site1",O)}try{A.pause()}catch(O){H("runtime.adapters.waapi.site2",O)}}},pause:x=>{e||g(l(x?.pageAnimations),t);for(let v of a)try{v.pause()}catch(A){H("runtime.adapters.waapi.site3",A)}},revert:()=>{if(a.clear(),s=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(x){H("runtime.adapters.waapi.site5",x)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let v of l()){let A=b(v);A.endSeconds!=null&&(x=Math.max(x,A.endSeconds))}return x>0?x:null}}}var jn="data-hf-authored-duration",Kn="data-hf-authored-end";function zr(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null}function Xn(e){let t=zr(e.start);if(t==null)return null;let n=Math.max(0,t),r=zr(e.duration),i=zr(e.authoredDuration),o=r!=null&&r>0?r:i!=null&&i>0?i:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=zr(e.end),s=zr(e.authoredEnd),l=a!=null&&a>n?a:s!=null&&s>n?s:null;return{start:n,duration:l==null?null:l-n,end:l}}var Io="data-hf-media-start-basis";function vm(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function Ov(e){return vm(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function Em(e){return wm(e)?Ov({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis}):e.ordinaryStart()}function Am(e){return wm(e)&&vm(e.basis)==="global"}function wm(e){return!e.hasAutoStart&&e.authoredStart!=null&&e.hostStart>0}function je(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,s=h=>{let b=r.getElementById(h);return b||(r.querySelector(`[data-composition-id="${CSS.escape(h)}"]`)??null)},l=h=>{let b=o.get(h);if(b!==void 0)return b;let x=null,v=Xn({start:0,duration:h.getAttribute("data-duration"),authoredDuration:n?h.getAttribute("data-hf-authored-duration"):null});if(v?.duration!=null&&v.duration>0&&(x=v.duration),x==null||x<=0){let A=f(h,0),E=Xn({start:A,end:h.getAttribute("data-end"),authoredEnd:n?h.getAttribute("data-hf-authored-end"):null});E?.duration!=null&&E.duration>0&&(x=E.duration)}if((x==null||x<=0)&&pe(h)&&(x=xt(h,h.duration)),(x==null||x<=0)&&(x=Un(h)),x==null||x<=0){let A=h.getAttribute("data-composition-id");if(A){let E=t[A]??null;if(E&&typeof E.duration=="function")try{let k=Number(E.duration());Number.isFinite(k)&&k>0&&(x=k)}catch(k){H("runtime.startResolver.site1",k)}}}return x!=null&&Number.isFinite(x)&&x>0?(o.set(h,x),x):(o.set(h,null),null)},u=(h,b)=>{if(h.hasAttribute("data-composition-id")){let v=h.parentElement?.closest("[data-composition-id]");return v?f(v,b):0}let x=h.closest("[data-composition-id]");return x?f(x,b):0},f=(h,b)=>{let x=i.get(h);if(x!==void 0)return x??b;if(a.has(h))return b;a.add(h);try{let v=vs(h.getAttribute("data-start"));if(!v){if(h.hasAttribute("data-composition-id")){let F=h.parentElement;if(F&&(F.hasAttribute("data-composition-src")||F.hasAttribute("data-composition-id")||F.hasAttribute("data-composition-file"))){let D=f(F,b);return i.set(h,D),D}}return i.set(h,b),b}if(v.kind==="absolute"){let F=Math.max(0,v.value),D=Math.max(0,u(h,b)+F);return i.set(h,D),D}let A=s(v.refId);if(!A)return i.set(h,b),b;let E=f(A,0),k=l(A);if(k==null||k<=0){let F=Math.max(0,E+v.offset);return i.set(h,F),F}let O=Math.max(0,E+k+v.offset);return i.set(h,O),O}finally{a.delete(h)}},d=h=>{let b=h.closest("[data-composition-id]");return{authoredStart:Ce(h.getAttribute("data-start")),hostStart:b?f(b,0):0,hasAutoStart:h.hasAttribute("data-hf-auto-start"),basis:h.getAttribute(Io)}};return{resolveStartForElement:(h,b=0)=>f(h,Math.max(0,b)),resolveDurationForElement:h=>l(h),resolveMediaStartForElement:h=>{let b=d(h);return Em({...b,ordinaryStart:()=>f(h,b.hostStart)})},resolveHostStartForElement:h=>u(h,0),isRootGlobalMediaStartForElement:h=>pe(h)&&Am(d(h))}}function Hv(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Je(o.volume)})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Je(n)}),i}function _m(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function Gv(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function Bv(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Uv(e,t){let n=je({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ce(e.dataset.end)??void 0,i=Ce(e.dataset.duration)??void 0,o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=Bv(e.dataset.volume)??1;return{start:n,end:o,staticVolume:Je(a)}}function Wv(e,t,n,r,{start:i,end:o,staticVolume:a}){let s=1/Math.min(60,Math.max(1,r)),l=Math.max(0,i),u=Math.min(n,o),f=af(e,()=>{e.volume=a;let m=[],g;for(let h=l;h<=u+1e-6;h=Math.min(u,h+s)){t(h);let b=Number(e.volume);if(Number.isFinite(b)){let x={time:Number(h.toFixed(6)),volume:Number(Je(b).toFixed(6))};Gv(m,g,x,h===u),g=x}if(h===u)break}return m});return f.some(m=>Math.abs(m.volume-a)>1e-4)?f:null}function Do(e,t,n=0){return n>3||e===null||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>Do(r,t,n+1)):Object.getPrototypeOf(e)!==Object.prototype?!1:Object.entries(e).some(([r,i])=>t(r)||Do(i,t,n+1))}var Vv=e=>typeof e?.nodeType=="number";function $v(e,t){for(let n=Object(e);n;n=Object.getPrototypeOf(n)){let r=Object.getOwnPropertyDescriptor(n,t);if(r)return typeof r.set=="function"}return!1}function zv(e,t){if(typeof e.getChildren!="function")return!0;try{return e.getChildren(!0,!0,!1).some(n=>(n.targets?.()??[]).some(i=>Vv(i)?i===t&&Do(n.vars,o=>o==="volume"):Do(n.vars,o=>$v(i,o))))}catch{return!0}}function Cm(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!pe(e)||n<=0||!zv(t,e))return;let o=u=>{try{typeof t.totalTime=="function"?t.totalTime(u,!0):typeof t.seek=="function"&&t.seek(u,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,s=Uv(e,n),l=Wv(e,o,n,60,s);if(Number.isFinite(a)&&o(a),l){let u=Hv(l,s.start,s.staticVolume);u.length>0&&r.set(e,u)}}var km="data-fade-in",Mm="data-fade-out",LL=km.slice(5),FL=Mm.slice(5),Nm=Object.freeze({fadeIn:0,fadeOut:0});function Ys(e){return Number.isFinite(e)&&e>0?e:0}function Rm(e){return e==null||e===""?0:Ys(Number.parseFloat(e))}function Lm(e){return{fadeIn:Rm(e.getAttribute(km)),fadeOut:Rm(e.getAttribute(Mm))}}function qv(e,t){let n=Ys(e.fadeIn),r=Ys(e.fadeOut);if(!Number.isFinite(t)||t<=0)return{fadeIn:n,fadeOut:r};let i=n+r;if(i<=t)return{fadeIn:n,fadeOut:r};let o=t/i;return{fadeIn:n*o,fadeOut:r*o}}function Fm(e,t,n){if(!Number.isFinite(e))return 1;let{fadeIn:r,fadeOut:i}=qv(n,t),o=1;return r>0&&(o*=Tm(e/r)),i>0&&Number.isFinite(t)&&(o*=Tm((t-e)/i)),o}function Tm(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var Yn="hf-audio-group",Po="data-audio-group";function Js(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function Qs(e,t){let n=Array.from(e?.querySelectorAll?.(`${Yn}[${$r}]`)??[]).find(i=>i.getAttribute($r)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===Yn?r:null}function Oo(e,t){let n=t?.getAttribute?.(gm)??t?.getAttribute?.(Po);return n?Qs(e,n)?.hasAttribute("data-hidden")??!1:!1}function Ho(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!jv(e)?null:e.getAttribute(Po)||null}function jv(e){return e.tagName.toLowerCase()==="audio"?!0:typeof e.hasAttribute=="function"&&Fo(e)}function Im(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${Yn}{display:none!important}`,e.head.appendChild(n)}function St(e){return Gn(e)}var Dm=["seeked","loadeddata","error","emptied","abort"],il=5e3,Go=new WeakMap;function Pm(e){let t=e.readyState<e.HAVE_CURRENT_DATA&&e.networkState===e.NETWORK_LOADING&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG;e.tagName!=="VIDEO"||!(e.seeking||t)||Ft(e)||(Go.get(e)?.(),Ze(new Promise(n=>{let r=o=>{if(!(o?.type==="loadeddata"&&e.seeking)){clearTimeout(i);for(let a of Dm)e.removeEventListener(a,r,!0);Go.get(e)===r&&Go.delete(e),n()}},i=setTimeout(r,il);for(let o of Dm)e.addEventListener(o,r,!0);Go.set(e,r)})))}function Om(e){let t=e.isVideo?e.explicitDuration??e.sourceDuration:e.sourceDuration,n=(e.isVideo?[t,e.hostRemaining]:[t,e.hostRemaining,e.explicitDuration]).filter(r=>r!=null&&Number.isFinite(r)&&r>=0);return n.length>0?Math.min(...n):null}function Hm(e){let t=e?.elements??Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let s=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(s))continue;let l=St(a),u=Ve(a),f=bt(a),d=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,g=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(g)||g<0)&&m!=null&&(g=Math.max(0,yn(f,m-l)));let h=Number.isFinite(g)&&g>=0,b=h?s+g:Number.POSITIVE_INFINITY,x=Number.parseFloat(a.dataset.volume??""),v={el:a,start:s,mediaStart:l,duration:h?g:Number.POSITIVE_INFINITY,end:b,volume:Number.isFinite(x)?x:null,playbackRate:u,rate:f,loop:d,sourceDuration:m,fades:Lm(a)};r.push(v),a.tagName==="VIDEO"&&i.push(v),Number.isFinite(b)&&(o=Math.max(o,b))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var tl=new WeakMap,Bo=new WeakMap,qr=new WeakMap,nl=new WeakSet,Jn=new WeakSet,Zs=new WeakSet;function Kv(e){if(Jn.has(e))return;Jn.add(e);let t=()=>Jn.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Xv=3;function ol(e){return e.error!=null||e.networkState===Xv}var rl=new WeakMap;function el(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function al(e){tl.delete(e),Bo.delete(e),qr.delete(e),nl.delete(e),rl.delete(e),jr.delete(e)}var sl=.5,Kt=.04,Yv=.03,Jv=.01,jr=new WeakMap;function Qv(e,t,n){let r=Math.sign(t),i=jr.get(e);if(Math.abs(t)>Kt)jr.set(e,r);else if(i!==r||Math.abs(t)<=Jv)return jr.delete(e),n;return n*(1+r*Yv)}function Gm(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=n.rate??n.playbackRate,o=r.tagName==="VIDEO"&&!n.loop,a=jt(e.timeSeconds,n.start,n.end),s=n.start-e.timeSeconds,l=r.tagName==="AUDIO"&&!a&&s>0&&s*Math.max(1,Ls(i,0))<=Math.max(e.cueAheadSeconds??0,Zs.has(r)?Kt:0);l?Zs.add(r):Zs.delete(r);let u=o&&!a&&(e.timeSeconds>=n.end||Wr(e.timeSeconds,n.end))&&Vn(e.timeSeconds,n.start,n.end,e.getCompositionDuration()),f=On(i,Math.max(0,Math.min(e.timeSeconds,n.end)-n.start))+n.mediaStart,d=u||o&&n.sourceDuration!=null&&f>=n.sourceDuration&&a;d&&n.sourceDuration!=null&&(f=Math.min(f,n.sourceDuration));let m=Bo.get(r),g=r.tagName==="AUDIO"&&(m===void 0||f<m-.04),h=!n.loop&&n.sourceDuration!=null&&f>=n.mediaStart&&f<n.sourceDuration&&(o||g);if((a||u||l)&&f>=0&&(!r.ended||n.loop||d||h)){if(Bo.set(r,f),n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let Q=n.sourceDuration-n.mediaStart;Q>0&&f>=n.sourceDuration&&(f=n.mediaStart+(f-n.mediaStart)%Q)}let v=el(e.userVolume??1),A=Je(n.volume??1),E=rl.get(r),k=el(r.volume),O,F=mf(r,e.timeSeconds-n.start);if(F!==null)O=Je(F);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let Q=e.timeSeconds-n.start;O=Je(_m(n.volumeKeyframes,Q))}else e.isWebAudioRouted?.(r)?O=A:E===void 0?O=A>1?A:k:Math.abs(k-E)>1e-4?O=k:O=A;let D=n.fades??Nm;(D.fadeIn>0||D.fadeOut>0)&&(O*=Fm(e.timeSeconds-n.start,n.duration,D));let M=r.closest("[data-hidden]")!==null||Oo(r.ownerDocument,r)?0:el(O*v);r.volume=M,rl.set(r,M),e.onElementVolume?.(r,M,O),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");let T=Ls(i,e.timeSeconds-n.start)*e.playbackRate,B=2,W=r.currentTime||0,ne=Math.abs(W-f),N=f-W,_=tl.get(r);tl.set(r,N);let G=_===void 0,X=!G&&Math.abs(N-_)>.5,U=ne>3,j=r.tagName==="AUDIO"&&G&&W-f>Kt,V=d&&ne>.001||r.ended&&h&&ne>.001||j||ne>sl&&(G||X||U),J=r.tagName==="VIDEO"&&!r.paused&&e.playing,Y=_!==void 0&&Math.abs(N-_)<.004,P=!1;if(!J&&!V&&!G&&Y&&ne>Kt){let Q=(qr.get(r)??0)+1;qr.set(r,Q),Q>=B&&(P=!0,qr.set(r,0))}else ne<=Kt&&qr.set(r,0);let K=!J&&e.forceSync&&ne>.02;try{(!J||V)&&jr.delete(r);let Q=J&&!V?Qv(r,N,T):T;Math.abs(r.playbackRate-Q)>1e-6&&(r.playbackRate=Q)}catch(Q){H("runtime.media.site1",Q)}if(V||P||K){if(!(r.tagName==="VIDEO"&&!!Ft(r))){try{r.currentTime=f}catch(le){H("runtime.media.site2",le)}if(Math.abs(r.currentTime-f)>.5&&!nl.has(r)){nl.add(r),r.load();try{r.currentTime=f}catch(le){H("runtime.media.site3",le)}}Pm(r)}Jn.delete(r)}else e.playing||Pm(r);d?r.paused||r.pause():e.playing&&r.paused&&!Jn.has(r)&&!ol(r)?(Kv(r),r.play().catch(Q=>{Jn.delete(r),(Q&&typeof Q=="object"&&"name"in Q?String(Q.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}let x=jt(e.timeSeconds,n.start,n.end);al(r),x&&Bo.set(r,f),r.paused||r.pause()}}var Xt=new WeakMap;function Kr(e){return Xt.has(e)?Xt.get(e)??null:e.getAttribute("src")}async function ll(e,t){let n=0;for(;t();){let r=await fetch(e,{headers:{Range:"bytes=0-0"},cache:"no-store"}).catch(()=>null);r?.body?.cancel().catch(()=>{});let i=r?.status===202||r?.status===503;if(!i&&r?.ok)return!0;if(!i&&++n>3)return!1;let o=Math.min(Number(r?.headers.get("Retry-After"))||2,30);await new Promise(a=>setTimeout(a,o*1e3))}return!1}var Um="hf-proxy-box",Zv=[256,362,512,724,1024,1448,2048,2896,4096,5792,8192];function Bm(e){return e>0?Zv.find(t=>t>=e)??null:null}function Wm(e,t){let n=Bm(e),r=Bm(t);return n&&r?{width:n,height:r}:null}function Vm(e){return`${e.width}x${e.height}`}var eE="hf-proxy",$m="runtime_media_proxy_fallback",zm="runtime_media_proxy_unavailable",qm=new WeakSet,Xr=new WeakMap;function Uo(e){return e.currentSrc||e.src}var Qn=window.parent===window?1:null,jm=()=>{},tE=new Promise(e=>jm=e),nE=1e3,Jr=new Map,Yr=new WeakMap;function rE(){return Qn!==null?Promise.resolve(Qn):Promise.race([tE.then(()=>Qn),new Promise(e=>setTimeout(()=>e(null),nE))])}function Km(e,t){if(getComputedStyle(e).objectFit==="none")return null;let n=e.getBoundingClientRect(),r=document.documentElement,i=t*(window.devicePixelRatio||1);return Wm(Math.max(n.width,r.clientWidth)*i,Math.max(n.height,r.clientHeight)*i)}function Xm(e){if(!(!(e>0)||!Number.isFinite(e))){Qn=e,jm();for(let t of Jr.keys())Ym(t,e)}}function Ym(e,t){let n=Jr.get(e);if(!n)return;if(!e.isConnected||e.getAttribute("src")!==n.href){Jr.delete(e);return}let r=Km(e,t);if(r&&r.width<=n.box.width&&r.height<=n.box.height)return;let i=r&&{width:Math.max(r.width,n.box.width),height:Math.max(r.height,n.box.height)},o=Qm(n.originalSrc,n.variant,i);if(Yr.get(e)===o)return;Yr.set(e,o);let a=()=>Yr.get(e)===o&&e.isConnected&&e.getAttribute("src")===n.href;ll(o,a).then(s=>{s&&a()&&Jm(e,o,n.originalSrc,n.variant,i),Yr.get(e)===o&&Yr.delete(e)})}function Jm(e,t,n,r,i){i?Jr.set(e,{originalSrc:n,variant:r,href:t,box:i}):Jr.delete(e),al(e),e.src=t,e.load()}function ul(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:ye(e)&&!!Ft(e)}function cl(e){let t=Uo(e);if(!t)return null;let n;try{n=new URL(t,document.baseURI)}catch{return null}if(n.origin!==window.location.origin)return null;try{return decodeURIComponent(n.pathname)}catch{return n.pathname}}function iE(e,t){let n=null;for(let r of Object.keys(t))e.endsWith(r)&&(n===null||r.length>n.length)&&(n=r);return n?t[n]??null:null}function oE(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,s]of Object.entries(t)){let l=a.normalize("NFC").toLowerCase();n.endsWith(l)&&(l.length>r?(r=l.length,i=s,o=!1):l.length===r&&(o=!0))}return o?null:i}function dl(e,t){return t[e]??iE(e,t)??oE(e,t)}function Qm(e,t,n){let r=new URL(e,document.baseURI);return r.searchParams.set(eE,t),n&&r.searchParams.set(Um,Vm(n)),r.href}var aE={cross_origin:"video reports zero decodable width but its source is cross-origin; no local proxy can be served for it",proxy_playback_failed:"the authoring proxy itself failed to decode; render output is unaffected",browser_safe_codec:"the file errored but its codec is browser-decodable; a proxy cannot help (the file itself is likely corrupt)",invalid_source_url:"the media source URL is malformed and cannot be proxied"};function Yt(e,t,n){if(qm.has(e))return;qm.add(e);let r=aE[t];Ee({source:"hf-preview",type:"diagnostic",code:zm,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${zm}: "${n}" (${t}): ${r}`)}function fl(e,t=null,n="reactive"){if(Xt.has(e)||Xr.has(e)&&Xr.get(e)===e.getAttribute("src"))return;let r=Uo(e),i=t?t.hasAlpha?"vp8":"h264":"auto";try{new URL(r,document.baseURI)}catch(f){H("runtime.mediaProxy.swap",f),Yt(e,"invalid_source_url",r);return}let o=e.getAttribute("src");Xr.set(e,o);let a=()=>e.isConnected&&e.getAttribute("src")===o,s=rE().then(async f=>{let d=f===null?null:Km(e,f),m=Qm(r,i,d),g=await ll(m,a);if(!a()){Xr.get(e)===o&&Xr.delete(e);return}if(!g){Yt(e,"proxy_playback_failed",r);return}return Xt.set(e,o),Jm(e,m,r,i,d),Qn!==null&&Ym(e,Qn),new Promise(h=>{e.addEventListener("loadeddata",h,{once:!0}),e.addEventListener("error",h,{once:!0})})});Ze(Promise.race([s,new Promise(f=>setTimeout(f,il))]));let l=t?.codecName??null;Ee({source:"hf-preview",type:"diagnostic",code:$m,details:{asset:r,codecName:l,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${$m}: "${r}" uses a codec (${l??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Zm(e){if(ul(e)||!ye(e)||Xt.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=cl(e);if(n===null)return;let r=dl(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||fl(e,r,"proactive")}function ep(e){if(ul(e)||!ye(e)||e.videoWidth!==0)return;let t=Uo(e);if(Xt.has(e)){Yt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=cl(e);if(r===null){Yt(e,"cross_origin",t);return}let i=dl(r,n);if(i&&!i.browserHostile){Yt(e,"browser_safe_codec",t);return}fl(e,i,"reactive")}function tp(e){if(ul(e)||!ye(e))return;let t=Uo(e);if(Xt.has(e)){Yt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=cl(e);if(r===null){Yt(e,"cross_origin",t);return}let i=dl(r,n);if(i&&!i.browserHostile){Yt(e,"browser_safe_codec",t);return}fl(e,i,"tertiary")}var Me=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);de(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},sE=[0,0,0],lE=[1,1,1],Wo=64;function uE(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'&&(t=!t),r==="#"&&!t)return e.slice(0,n)}return e}function Jt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new Me(`Invalid number "${e}"`,t);return n}function np(e,t,n){if(e.length!==3)throw new Me(`${t} expects three numbers`,n);return[Jt(e[0],n),Jt(e[1],n),Jt(e[2],n)]}function rp(e,t,n){if(!e)throw new Me(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new Me(`${t} must be an integer greater than 1`,n);return r}function cE(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new Me("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function dE(e){let t=/^TITLE\s+"([^"]*)"\s*$/i.exec(e);if(t)return t[1]??null;let n=/^TITLE\s+(.+)\s*$/i.exec(e);return n&&(n[1]??"").trim()||null}function fE(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function ip(e,t={}){let n=t.maxSize??Wo,r=null,i=sE,o=lE,a=null,s=null,l=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let d=0;d<u.length;d++){let m=d+1,g=uE(u[d]??"").trim();if(!g)continue;let h=g.split(/\s+/),b=(h[0]??"").toUpperCase(),x=h.slice(1);if(b==="TITLE"){r=dE(g);continue}if(b==="DOMAIN_MIN"){i=np(x,b,m);continue}if(b==="DOMAIN_MAX"){o=np(x,b,m);continue}if(b==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new Me(`${b} expects two numbers`,m);let v=Jt(x[0],m),A=Jt(x[1],m);if(A<=v)throw new Me("LUT_3D_INPUT_RANGE max must exceed min",m);i=[v,v,v],o=[A,A,A];continue}if(b==="LUT_1D_SIZE"){a=rp(x[0],b,m);continue}if(b==="LUT_3D_SIZE"){if(s=rp(x[0],b,m),s>n)throw new Me(`LUT_3D_SIZE ${s} exceeds max ${n}`,m);continue}if(!fE(b)){if(b.startsWith("LUT_"))throw new Me(`Unsupported cube keyword ${b}`,m);continue}if(!s)throw a?new Me("1D cube LUTs are not supported yet",m):new Me("LUT data appears before LUT_3D_SIZE",m);if(h.length!==3)throw new Me("LUT data rows must contain three numbers",m);l.push(Jt(h[0],m),Jt(h[1],m),Jt(h[2],m))}if(a&&s)throw new Me("Mixed 1D and 3D cube LUTs are not supported yet");if(!s)throw a?new Me("1D cube LUTs are not supported yet"):new Me("Missing LUT_3D_SIZE");cE(i,o);let f=s*s*s;if(l.length!==f*3)throw new Me(`Expected ${f} LUT rows for size ${s}, found ${l.length/3}`);return{title:r,size:s,domainMin:i,domainMax:o,data:new Float32Array(l)}}function mE(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function Qr(e){return Math.round(mE(e)*255)}function ml(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let s=0;s<t;s++){let l=((o*t+a)*t+s)*3,u=(a*n+o*t+s)*4;i[u]=Qr(e.data[l]??0),i[u+1]=Qr(e.data[l+1]??0),i[u+2]=Qr(e.data[l+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var op="rec709";var Ae={hueDegrees:{min:0,max:360,inclusiveMax:!1},unit:{min:0,max:1},signedUnit:{min:-1,max:1},secondaryHueRange:{min:0,max:180},secondaryHueSoftness:{min:0,max:180},secondaryHueCombinedMax:180,secondarySoftRangeSoftness:{min:0,max:.5},secondaryHueShift:{min:-180,max:180},effects:{asciiStyle:{min:0,max:7},bloom:{min:0,max:3},bloomRadius:{min:1,max:100},monoScreenShape:{min:0,max:4}}};var ap=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],sp=["shadows","midtones","highlights"],lp=["master","red","green","blue"],up=["hueVsHue","hueVsSaturation","hueVsLuma"];var cp=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],dp=["blur","pixelate","chromaBleed","tapeDamage","tapeTracking","tapeNoise","tapeSpeed","filmArtifacts","halftone","halftoneSize","twoInkPrint","twoInkPrintSize","ascii","asciiSize","asciiInvert","asciiStyle","asciiColor","asciiRotation","dither","ditherSize","bloom","bloomRadius","monoScreen","monoScreenSize","monoScreenAngle","monoScreenSpread","monoScreenShape","monoScreenInvert","scanlines","scanlineCount","scanlineSoftness","chromaticAberration","chromaticAngle","crtCurvature","digitalGlitch","digitalGlitchColorSplit","digitalGlitchLineTear","digitalGlitchPixelate","digitalGlitchBlockAmount","digitalGlitchBlockDisplacement","digitalGlitchBlockOpacity","digitalGlitchSpeed","engraving","engravingSpacing","engravingMinThickness","engravingMaxThickness","engravingAngle","engravingContrast","engravingSharpness","engravingWave","engravingWaveFrequency","crosshatch","crosshatchSpacing","crosshatchThickness","crosshatchAngle","crosshatchContrast","crosshatchEdges","crosshatchLineWeight","crosshatchWave","crosshatchWaveFrequency","kuwahara","kuwaharaRadius","kuwaharaSharpness","kuwaharaSaturation"];var hF=Ae.unit,gF=Ae.signedUnit,bF=Ae.effects;var vt=1024,Zr=16;function fp(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Ne(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function pE(e){let t=[],n=[],r=Ne(e,0);for(let a of e.slice(1)){let s=a[0]-r[0];t.push(s),n.push((a[1]-r[1])/s),r=a}let i=Ne(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=fp(Ne(t,0),Ne(t,1),i,Ne(n,1)),o[o.length-1]=fp(Ne(t,t.length-1),Ne(t,t.length-2),Ne(n,n.length-1),Ne(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let s=Ne(n,a-1),l=Ne(n,a);if(s===0||l===0||Math.sign(s)!==Math.sign(l)){o[a]=0;continue}let u=Ne(t,a-1),f=Ne(t,a),d=2*f+u,m=f+2*u;o[a]=(d+m)/(d/s+m/l)}return o}function mp(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function hE(e,t,n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>=n)throw new RangeError("Curve output bounds must be finite and increasing");if(e.some(([,r])=>r<t||r>n))throw new RangeError(`Curve outputs must be between ${t} and ${n}`)}function gE(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),s=a*a,l=s*a;return(2*l-3*s+1)*t[1]+(l-2*s+a)*o*r+(-2*l+3*s)*n[1]+(l-s)*o*i}function pp(e,t,n,r,i){hE(e,r,i);let o=pE(e),a=new Float32Array(t),s=0;for(let l=0;l<t;l+=1){let u=n(l);for(;s<e.length-2&&u>Ne(e,s+1)[0];)s+=1;let f=Ne(e,s),d=Ne(e,s+1),m=gE(u,f,d,Ne(o,s),Ne(o,s+1));a[l]=Math.min(i,Math.max(r,m))}return a}function Zn(e,t=vt){if(mp(e,t),e.length>Zr)throw new RangeError(`A color curve supports at most ${Zr} points`);if(e.some(([n])=>n<0||n>1))throw new RangeError("Color curve inputs must be between 0 and 1");if(e[0]?.[0]!==0||e[e.length-1]?.[0]!==1)throw new RangeError("Color curves must include input endpoints 0 and 1");return pp(e,t,n=>n/(t-1),0,1)}function hl(e,t,n,r=vt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Zr)throw new RangeError(`A hue curve supports at most ${Zr} points`);let i=[...e].sort((l,u)=>l[0]-u[0]);for(let l=0;l<i.length;l+=1){let u=i[l];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(l>0&&u[0]===i[l-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([l,u])=>[l-360,u]),a=i.slice(0,2).map(([l,u])=>[l+360,u]),s=[...o,...i,...a];return mp(s,r),pp(s,r,l=>l/r*360,t,n)}var ei="data-color-grading",Sn="data-hf-color-grading-source-hidden",vn="data-hf-authored-opacity",yp="__hf_color_grading_",xE=op,xl={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},yl={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Sl={blur:0,pixelate:0,chromaBleed:0,tapeDamage:0,tapeTracking:0,tapeNoise:1,tapeSpeed:.5,filmArtifacts:0,halftone:0,halftoneSize:0,twoInkPrint:0,twoInkPrintSize:0,ascii:0,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0,dither:0,ditherSize:0,bloom:0,bloomRadius:8,monoScreen:0,monoScreenSize:0,monoScreenAngle:0,monoScreenSpread:0,monoScreenShape:0,monoScreenInvert:0,scanlines:0,scanlineCount:0,scanlineSoftness:0,chromaticAberration:0,chromaticAngle:0,crtCurvature:0,digitalGlitch:0,digitalGlitchColorSplit:0,digitalGlitchLineTear:0,digitalGlitchPixelate:0,digitalGlitchBlockAmount:0,digitalGlitchBlockDisplacement:0,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:0,engraving:0,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9,crosshatch:0,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9,kuwahara:0,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5};var zo=ap,Sp=sp,vp=lp,Ep=up,El=cp,Al=dp,hp={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},gp={vignette:.18};function Le(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...xl,...n},details:{...yl,...r},effects:{...Sl,...i}}}var wl=[Le("neutral","Neutral"),Le("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Le("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Le("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Le("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Le("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Le("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Le("vintage-wash","Vintage Wash",hp,gp),Le("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Le("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Le("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Le("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Le("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Le("creator-camcorder","Creator Camcorder",{contrast:.08,highlights:-.05,shadows:.02,whites:.03,blacks:-.04,temperature:-.03,tint:-.015,vibrance:-.03,saturation:-.06},{vignette:.06,grain:.08,grainSize:.18,grainRoughness:.58},{chromaBleed:.55},.72),Le("vhs-playback","VHS Playback",{contrast:-.04,saturation:-.08},{grain:.16,grainSize:.12,grainRoughness:.72},{tapeDamage:.82,tapeTracking:.85,tapeNoise:.3,tapeSpeed:.5,chromaBleed:.5,chromaticAberration:.18,scanlines:.35,scanlineCount:.17,scanlineSoftness:1,digitalGlitch:.32,digitalGlitchLineTear:.08,digitalGlitchSpeed:.5}),Le("home-movie-8mm","8mm Home Movie",hp,{...gp,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Le("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Le("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],yE=new Map(wl.map(e=>[e.id,e])),SE=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,vE={exposure:{min:-2,max:2},contrast:{min:-1,max:1},highlights:{min:-1,max:1},shadows:{min:-1,max:1},whites:{min:-1,max:1},blacks:{min:-1,max:1},temperature:{min:-1,max:1},tint:{min:-1,max:1},vibrance:{min:-1,max:1},saturation:{min:-1,max:1}},er={hue:0,amount:0,level:0},bp={amount:Ae.unit,level:Ae.signedUnit},Qt=[[0,0],[1,1]],tr=[],EE={hueVsHue:Ae.secondaryHueShift,hueVsSaturation:Ae.signedUnit,hueVsLuma:Ae.signedUnit},gl={center:0,range:180,softness:0},bl={min:0,max:1,softness:.05},AE={vignette:Ae.unit,vignetteMidpoint:Ae.unit,vignetteRoundness:Ae.signedUnit,vignetteFeather:Ae.unit,grain:Ae.unit,grainSize:Ae.unit,grainRoughness:Ae.unit},vl=Ae.unit,wE=Ae.effects,Ap=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var _E=wl.filter(e=>Ap.some(t=>e.effects[t]>1e-4)),_F=wl.filter(e=>!_E.includes(e)),CF={blur:{blur:.45},pixelate:{pixelate:.55},bloom:{bloom:.55,bloomRadius:8},chromaBleed:{chromaBleed:.55},tapeDamage:{tapeDamage:.65,tapeTracking:.55,tapeNoise:.25,tapeSpeed:.5},filmArtifacts:{filmArtifacts:.55},scanlines:{scanlines:.35,scanlineCount:.17,scanlineSoftness:1},chromaticAberration:{chromaticAberration:.15,chromaticAngle:0},crtCurvature:{crtCurvature:.2},digitalGlitch:{digitalGlitch:.55,digitalGlitchColorSplit:.25,digitalGlitchLineTear:.25,digitalGlitchPixelate:.15,digitalGlitchBlockAmount:.5,digitalGlitchBlockDisplacement:.25,digitalGlitchBlockOpacity:0,digitalGlitchSpeed:.5},halftone:{halftone:.94,halftoneSize:.36},twoInkPrint:{twoInkPrint:1,twoInkPrintSize:.42},ascii:{ascii:1,asciiSize:5/76,asciiInvert:0,asciiStyle:0,asciiColor:1,asciiRotation:0},dither:{dither:1,ditherSize:.5},monoScreen:{monoScreen:1,monoScreenSize:.35,monoScreenAngle:.25,monoScreenSpread:.3,monoScreenShape:0,monoScreenInvert:0},engraving:{engraving:1,engravingSpacing:7/17,engravingMinThickness:.2,engravingMaxThickness:3.2/7,engravingAngle:.25,engravingContrast:7/15,engravingSharpness:.59,engravingWave:.2,engravingWaveFrequency:2/9},crosshatch:{crosshatch:1,crosshatchSpacing:7/25,crosshatchThickness:.25,crosshatchAngle:.25,crosshatchContrast:1/3,crosshatchEdges:.5,crosshatchLineWeight:0,crosshatchWave:.33,crosshatchWaveFrequency:2/9},kuwahara:{kuwahara:1,kuwaharaRadius:1/7,kuwaharaSharpness:5/16,kuwaharaSaturation:.5}},wp=[{path:"intensity",name:"--hf-color-grading-intensity",min:0,max:1},{path:"lut.intensity",name:"--hf-color-grading-lut-intensity",min:0,max:1},{path:"adjust.exposure",name:"--hf-color-grading-exposure",min:-2,max:2},{path:"effects.blur",name:"--hf-color-grading-blur",min:0,max:1},{path:"effects.bloom",name:"--hf-color-grading-bloom",min:0,max:3},{path:"effects.kuwahara",name:"--hf-color-grading-kuwahara",min:0,max:1},{path:"effects.pixelate",name:"--hf-color-grading-pixelate",min:0,max:1},{path:"effects.ascii",name:"--hf-color-grading-ascii",min:0,max:1},{path:"effects.dither",name:"--hf-color-grading-dither",min:0,max:1}];var CE=/^#[0-9a-f]{6}$/i;function RE(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&CE.test(t))?null:e.map(t=>t.toLowerCase())}function De(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function $o(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function _p(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Ge(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?$o(n,t.min,t.max):0}function _l(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function TE(e){let t=De(e)?e:{};return Sp.reduce((n,r)=>{let i=De(t[r])?t[r]:{};return n[r]={hue:_l(i.hue,er.hue),amount:Ge(i.amount??er.amount,bp.amount),level:Ge(i.level??er.level,bp.level)},n},{shadows:{...er},midtones:{...er},highlights:{...er}})}function kE(e){if(!Array.isArray(e)||e.length!==2)return null;let t=Number(e[0]),n=Number(e[1]);return Number.isFinite(t)&&Number.isFinite(n)?[$o(t,0,1),$o(n,0,1)]:null}function Cp(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function ME(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function NE(e){if(!Array.isArray(e)||e.length<2)return Qt;let t=[];for(let n of e){let r=kE(n);if(!r)return Qt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),Cp(t)||(ME(t),t.length>16)?Qt:t}function LE(e){let t=De(e)?e:{};return vp.reduce((n,r)=>(n[r]=NE(t[r]),n),{master:Qt,red:Qt,green:Qt,blue:Qt})}function FE(e,t){if(!Array.isArray(e)||e.length!==2)return null;let n=Number(e[0]),r=Number(e[1]);return Number.isFinite(n)&&Number.isFinite(r)?[_l(n),$o(r,t.min,t.max)]:null}function IE(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return tr;let n=[];for(let r of e){let i=FE(r,t);if(!i)return tr;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),Cp(n)?tr:n}function DE(e){let t=De(e)?e:{};return Ep.reduce((n,r)=>(n[r]=IE(t[r],EE[r]),n),{hueVsHue:tr,hueVsSaturation:tr,hueVsLuma:tr})}function xp(e){let t=De(e)?e:{},n=Ge(t.min??bl.min,vl),r=Ge(t.max??bl.max,vl);return{min:Math.min(n,r),max:Math.max(n,r),softness:Ge(t.softness??bl.softness,Ae.secondarySoftRangeSoftness)}}function PE(e){let t=De(e)?e:{},n=Ge(t.range??gl.range,Ae.secondaryHueRange);return{center:_l(t.center,gl.center),range:n,softness:Ge(t.softness??gl.softness,{min:Ae.secondaryHueSoftness.min,max:Ae.secondaryHueCombinedMax-n})}}function OE(e){return{hueShift:Ge(e.hueShift??0,Ae.secondaryHueShift),saturation:Ge(e.saturation??0,Ae.signedUnit),luma:Ge(e.luma??0,Ae.signedUnit),temperature:Ge(e.temperature??0,Ae.signedUnit),tint:Ge(e.tint??0,Ae.signedUnit)}}function HE(e){return!De(e)||!De(e.key)||!De(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:PE(e.key.hue),saturation:xp(e.key.saturation),luma:xp(e.key.luma)},correction:OE(e.correction)}}function GE(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=HE(n);r&&t.push(r)}return t}function BE(e){if(e==null)return null;let t=String(e).trim();return t||null}function UE(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!De(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:_p(e.intensity,1)}}function WE(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return De(n)?n:null}catch{return null}return{preset:t}}return De(e)?e:null}function VE(e,t){let n=e.trim().match(SE);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Vo(e,t){if(typeof e=="string"){let r=VE(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Vo(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Vo(r,t));if(!De(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Vo(i,t);return n}function $E(e){return e?yE.get(e)??null:null}function qo(e){let t=WE(e);if(!t||t.enabled===!1)return null;let n=BE(t.preset),r=$E(n),i=r?.adjust??xl,o=r?.details??yl,a=r?.effects??Sl,s=De(t.adjust)?t.adjust:{},l=De(t.details)?t.details:{},u=De(t.effects)?t.effects:{},f=zo.reduce((g,h)=>(g[h]=Ge(s[h]??i[h],vE[h]),g),{...xl}),d=El.reduce((g,h)=>(g[h]=Ge(l[h]??o[h],AE[h]),g),{...yl}),m=Al.reduce((g,h)=>(g[h]=Ge(u[h]??a[h],wE[h]??vl),g),{...Sl});return{enabled:!0,preset:n,intensity:_p(t.intensity,r?.intensity??1),adjust:f,wheels:TE(t.wheels),curves:LE(t.curves),hueCurves:DE(t.hueCurves),secondaries:GE(t.secondaries),details:d,effects:m,palette:RE(t.palette),lut:UE(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():xE}}function Rp(e,t){return qo(Vo(e,t))}function zE(e){return Sp.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Cl(e){return vp.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Rl(e){return Ep.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Tl(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function Tp(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Ap.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:zo.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?zE(e.wheels):!1)||(e.curves?Cl(e.curves):!1)||(e.hueCurves?Rl(e.hueCurves):!1)||(e.secondaries?Tl(e.secondaries):!1):!1}var jo=/^(|transparent|rgba\(.*,\s*0\)|.*\/\s*0%?\s*\))$/,qE=new Set(["IMG","VIDEO","IFRAME","EMBED","OBJECT","CANVAS"]),kp="http://www.w3.org/2000/svg",jE=new Set(["svg","g","foreignObject"]),KE=["Top","Right","Bottom","Left"],XE={left:-1/0,right:1/0,top:-1/0,bottom:1/0},Mp=e=>!!e.backgroundImage&&e.backgroundImage!=="none"||!jo.test(e.backgroundColor),YE=e=>{let t=e.getPropertyValue("-webkit-text-fill-color")||e.color,n=Number.parseFloat(e.getPropertyValue("-webkit-text-stroke-width"))||0,r=e.getPropertyValue("-webkit-text-stroke-color")||e.color;return!jo.test(t)||n>0&&!jo.test(r)},Np=e=>KE.map(t=>e[`border${t}Style`]!=="none"&&!jo.test(e[`border${t}Color`])&&Number.parseFloat(e[`border${t}Width`])||0),Ko=e=>e.bottom-e.top,kl=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,Lp=(e,t)=>({left:Math.min(e.left,t.left),right:Math.max(e.right,t.right),top:Math.min(e.top,t.top),bottom:Math.max(e.bottom,t.bottom)}),JE=(e,t)=>t.display==="none"||t.position==="absolute"||t.position==="fixed"||Number.parseFloat(t.opacity)<=.01&&!e.hasAttribute(Sn);function QE(e,t,n){if(e.width<=0&&e.height<=0)return!1;let r=3*(Number.parseFloat(t.fontSize)||16),i=Math.max(r,Math.min(2*e.height,20*r/3));return n<e.top-i||n>e.bottom+i}function ZE(e,t,n,r){let[i,o,a,s]=Np(t);if(!(i||o||a||s))return!1;let l=e.getBoundingClientRect(),{offsetWidth:u,offsetHeight:f}=e,d=u>0?l.width/u:1,m=f>0?l.height/f:1,g={left:l.left+s*d,right:l.right-o*d,top:l.top+i*m,bottom:l.bottom-a*m};return!kl(g,n,r)}function eA(e){let t=[];for(let n of[...e].sort((r,i)=>r.left-i.left)){let r=t.findIndex(i=>n.top<i.bottom&&n.bottom>i.top&&n.left-i.right<=2*Math.max(Ko(i),Ko(n)));r<0?t.push(n):t[r]=Lp(t[r],n)}return t}function tA(e){let t=[...e].sort((n,r)=>n.top-r.top);return t.flatMap((n,r)=>t.slice(r+1).flatMap(i=>{let o=i.left<n.right&&i.right>n.left,a=i.top-n.bottom<=2*Math.min(Ko(n),Ko(i));return o&&a&&i.top>n.bottom?[Lp(n,i)]:[]}))}function Fp(e,t,n){let r=e.defaultView,i=typeof e.createRange().getClientRects=="function",o=e.createRange(),a=new Map,s=new Map,l=new Map,u=x=>{let v=s.get(x);if(v===void 0){let A=r.getComputedStyle(x);v=JE(x,A)||i&&QE(x.getBoundingClientRect(),A,n),s.set(x,v)}return v},f=x=>{let v=l.get(x);if(v===void 0){let A=x.parentElement,E=A&&x.nodeValue?.trim()?r.getComputedStyle(A):null;v=!!E&&E.visibility!=="hidden"&&YE(E),l.set(x,v)}return v},d=x=>{if(!i)return[XE];let v=[];o.selectNodeContents(x);for(let A of o.getClientRects()){let E=A.bottom-A.top;A.width>0&&E>0&&n>=A.top-2*E&&n<=A.bottom+2*E&&v.push(A)}return v},m=x=>{let v=a.get(x);if(v)return v;v=[];for(let A of x.childNodes)A.nodeType===3?f(A)&&v.push(...d(A)):A.nodeType===1&&A.hasChildNodes()&&!u(A)&&v.push(...m(A));return a.set(x,v),v};function g(x){let v=eA(m(x));return v.some(A=>kl(A,t,n))||tA(v).some(A=>kl(A,t,n))}function h(x,v){let A=r.getComputedStyle(x,v);return!A.content||A.content==="none"||A.content==="normal"||A.display==="none"?!1:A.content!=='""'||Mp(A)||Np(A).some(E=>E>0)}let b=(x,v)=>/inset/.test(v.boxShadow)||ZE(x,v,t,n)||h(x,"::before")||h(x,"::after");return x=>{if(qE.has(x.tagName)||!(x.namespaceURI!==kp||jE.has(x.localName))||!r)return!0;let A=r.getComputedStyle(x);return Mp(A)||b(x,A)||x.namespaceURI!==kp&&g(x)}}var nA=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),rA=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),Ip="[data-hf-inner-root],[data-composition-id]:not([data-composition-id] *)",Dp=`${Ip}{pointer-events:auto!important}`,iA=`@layer hf-picker{${Dp}}`;function Pp(e){let t=!1,n=null,r=null,i=null,o=null,a,s=new Set;function l(N,_){try{window.dispatchEvent(new CustomEvent(N,{detail:_}))}catch(G){H("runtime.picker.site1",G)}}function u(N){i=N,l("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function f(N){o=N,l("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function d(N){if(s=new Set(Array.from(document.querySelectorAll(Ip)).filter(X=>getComputedStyle(X).pointerEvents==="none")),s.size===0)return N();let _=m(),G=_?g(_):h();try{return N()}finally{G(),s=new Set}}function m(){if(a!==void 0)return a;if(a=null,!Array.isArray(document.adoptedStyleSheets)||typeof CSSStyleSheet>"u")return null;try{let N=new CSSStyleSheet;N.replaceSync(iA),a=N}catch(N){H("runtime.picker.site2",N)}return a}function g(N){return document.adoptedStyleSheets=[...document.adoptedStyleSheets,N],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(_=>_!==N)}}function h(){let N=document.createElement("style");return N.textContent=Dp,(document.head??document.documentElement).appendChild(N),()=>N.remove()}function b(N){let _=N.ownerDocument.defaultView;if(!_)return!1;let G=N;if(_.getComputedStyle(N).visibility==="hidden")return!0;for(;G&&G!==document.body&&G!==document.documentElement;){let X=_.getComputedStyle(G);if(X.display==="none"||X.pointerEvents==="none")return!0;let U=Number.parseFloat(X.opacity);if(Number.isFinite(U)&&U<=.01&&!G.hasAttribute(Sn))return!0;G=G.parentElement}return!1}function x(N){if(!N||N===document.body||N===document.documentElement)return!1;let _=N.tagName.toLowerCase();return!(_==="script"||_==="style"||_==="link"||_==="meta"||s.has(N)||N.closest(nA)||b(N))}function v(N){return!!N?.closest(rA)}function A(N){let _=N.parentElement?.getAttribute("data-composition-id");return!N.hasAttribute("data-hf-inner-root")||!_?null:`[data-composition-id="${CSS.escape(_)}"] > [data-hf-inner-root]`}function E(N){let _=A(N);if(_)return _;let G=N;if(G.id)return`#${CSS.escape(G.id)}`;let X=N.getAttribute("data-composition-id");if(X)return`[data-composition-id="${CSS.escape(X)}"]`;let U=N.getAttribute("data-composition-src");if(U)return`[data-composition-src="${CSS.escape(U)}"]`;let j=N.getAttribute("data-track-index");if(j)return`[data-track-index="${CSS.escape(j)}"]`;let V=N.tagName.toLowerCase(),J=N.parentElement;if(!J)return V;let Y=J.querySelectorAll(`:scope > ${V}`);if(Y.length===1)return V;for(let P=0;P<Y.length;P+=1)if(Y[P]===N)return`${V}:nth-of-type(${P+1})`;return V}function k(N){let _=N.tagName.toLowerCase(),G=(N.textContent??"").trim().replace(/\s+/g," "),X=(j,V)=>{let J=Array.from(j);return J.length>V?`${J.slice(0,V-1).join("")}\u2026`:j},U=/^h[1-6]$/.test(_);return U||_==="p"||_==="span"||_==="div"?G.length>0?X(G,56):U?"Heading":"Text":_==="img"?"Image":_==="video"?"Video":_==="audio"?"Audio":_==="svg"?"Shape":N.getAttribute("data-composition-src")?"Composition":_==="section"?"Section":`${_.charAt(0).toUpperCase()}${_.slice(1)}`}function O(N,_,G){let X=typeof G=="number"&&G>0?G:8,U=[];if(document.elementsFromPoint)U=document.elementsFromPoint(N,_);else if(document.elementFromPoint){let P=document.elementFromPoint(N,_);U=P?[P]:[]}if(v(U[0]??null))return[];let j={},V=[],J=[],Y=Fp(document,N,_);for(let[P,K]of U.entries()){if(!x(K))continue;let Q=`${K.tagName}::${K.id||""}::${P}`;if(!j[Q]&&(j[Q]=!0,V.push(K),(J.some(le=>K.contains(le))||Y(K))&&(J.push(K),J.length>=X)))break}return J.length>0?J:V.slice(0,X)}function F(N){let _=N.getBoundingClientRect(),G={};for(let U of Array.from(N.attributes))U.name.startsWith("data-")&&(G[U.name]=U.value);return{id:N.id||null,tagName:N.tagName.toLowerCase(),selector:E(N),label:k(N),boundingBox:{x:_.left,y:_.top,width:_.width,height:_.height},textContent:N.textContent?N.textContent.trim().slice(0,200):null,src:N.getAttribute("src")||N.getAttribute("data-composition-src")||null,dataAttributes:G}}function D(N,_,G){return d(()=>O(N,_,G)).map(F)}function R(N){if(!t)return;let _=d(()=>{let X=O(N.clientX,N.clientY,1)[0]??(ke(N.target)?N.target:null);return x(X)?X:null});if(!_||n===_)return;n&&n.classList.remove("__hf-pick-highlight"),n=_,_.classList.add("__hf-pick-highlight");let G=F(_);u(G),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:G})}function M(N){if(!t)return;N.preventDefault(),N.stopPropagation(),N.stopImmediatePropagation();let _=D(N.clientX,N.clientY,8);_.length!==0&&(u(_[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:_,selectedIndex:0,point:{x:N.clientX,y:N.clientY}}))}function T(N){N.key==="Escape"&&(W(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function B(){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(`
|
|
42
|
-
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",R,!0),document.addEventListener("click",M,!0),document.addEventListener("keydown",T,!0),l("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function W(){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",R,!0),document.removeEventListener("click",M,!0),document.removeEventListener("keydown",T,!0),l("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function ne(){window.__HF_PICKER_API={enable:B,disable:W,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(N,_,G)=>Number.isFinite(N)&&Number.isFinite(_)?D(N,_,G):[],pickAtPoint:(N,_,G)=>{if(!Number.isFinite(N)||!Number.isFinite(_))return null;let X=D(N,_,8);if(!X.length)return null;let U=Math.max(0,Math.min(X.length-1,Number(G??0))),j=X[U]??null;return j?(f(j),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:j}),W(),j):null},describe:N=>ke(N)?F(N):null,pickManyAtPoint:(N,_,G)=>{if(!Number.isFinite(N)||!Number.isFinite(_))return[];let X=D(N,_,8);if(!X.length)return[];let U=[],j=Array.isArray(G)?G:[0];for(let V of j){let J=Math.max(0,Math.min(X.length-1,Math.floor(Number(V)))),Y=X[J];if(!Y)continue;U.some(K=>K.selector===Y.selector&&K.tagName===Y.tagName)||U.push(Y)}return U.length?(f(U[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:U}),W(),U):[]}},l("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:B,disablePickMode:W,installPickerApi:ne}}function ti(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&H("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function ut(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&H("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function ni(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){H("runtime.player.site1",i)}}}function Xo(e,t,n){return n?.exact===!0?Number.isFinite(e)&&e>0?e:0:um(e,t,n?.subFrameDivisions)}function Op(e,t,n,r){let i=Xo(t,n,r),o=r?.suppressEvents===!0;return ut(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function oA(e,t,n,r,i){let o=[];ni(e,t,a=>{ut(a,"play"),o.push(a)});try{return Op(t,n,r,i)}finally{for(let a of o)try{ut(a,"pause")}catch(s){H("runtime.player.site2",s)}}}function aA(e,t){ni(e,t,n=>{ut(n,"play")})}function Hp(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??ti(n,"duration",0))||0);r>0&&Math.max(0,ti(n,"time",0))>=r&&(ut(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),ut(n,"play"),ni(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),ut(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;ut(n,"pause"),ni(e.getTimelineRegistry?.(),n,i=>{ut(i,"pause")});let r=Math.max(0,ti(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),s=oA(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(s),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),ut(i,"play"),ni(e.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(e.getPlaybackRate()),ut(l,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(s,!0)):(e.setIsPlaying(!1),e.onSyncMedia(s,!1)),e.onRenderFrameSeek(s),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(aA(e.getTimelineRegistry?.(),i),Op(i,n,o,r)):Xo(Math.max(0,Number(n)||0),o,r);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>ti(e.getTimeline(),"time",0),getDuration:()=>ti(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Ml(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}function En(e){if(e==null||e.trim()==="")return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function nr(e){if(e==null||e.trim()==="")return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function Et(e=document){let t=e.querySelector('[data-composition-id][data-root="true"]');return xe(t)?t:e.querySelector("[data-composition-id]")}var sA=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Nl(e){return e.id||e.getAttribute("data-hf-id")||null}function lA(e){return Ce(e)}function uA(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function cA(e){return pe(e)?Number.isFinite(e.duration)?xt(e,e.duration):null:Un(e)}function dA(e,t,n,r){let i=lA(e.getAttribute("data-duration"));return i!=null&&i>0?i:uA(e,t)??cA(e)??Math.max(0,n-r)}function fA(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function Gp(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=Et(),a=0;for(let s of document.querySelectorAll("[data-start]")){if(s===o||sA.has(s.tagName))continue;let l=t.resolveStartForElement(s,0);if(dA(s,n,r,l)<=0)continue;let u={id:Nl(s)??`__clip-${a++}`,element:s,parentId:null,children:[]};i.set(s,u)}return fA(i),{roots:Array.from(i.values()).filter(s=>s.parentId===null)}}var Ll="css:root",Bp=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],mA=new Set([...Bp,"contain","isolation","mask-border","mix-blend-mode","opacity"]),pA=new Set(["absolute","relative"]),hA=new Set(["flex","inline-flex","grid","inline-grid"]),gA=new Set(["layout","paint","strict","content"]),bA=new Set(["size","inline-size"]);function xA(e){return e.position==="fixed"||e.position==="sticky"}function yA(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(pA.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&hA.has(n)}function SA(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:Bp.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function vA(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>gA.has(n))?!0:bA.has(e.getPropertyValue("container-type"))}function EA(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>mA.has(t))}function AA(e,t){return xA(t)||yA(e,t)||SA(t)||vA(t)?!0:EA(t)}function wA(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function Yo(e){let t=e.ownerDocument.defaultView;if(!t)return Ll;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(AA(n,t.getComputedStyle(n)))return wA(n)}catch{return Ll}n=n.parentElement}return Ll}function Fl(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Jo=7200;function Qo(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return!1;let i=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),o=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let u=t.timelineRegistry[a],f=u&&typeof u.duration=="function"?Number(u.duration()):null;!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(jn)||e.hasAttribute(Kn))&&(o==null||o<=0)&&f!=null&&Number.isFinite(f)&&f>0&&(o=f)}let s=o!=null&&o>0?i+o:Number.POSITIVE_INFINITY,l=t.exportRenderSeek?Lo(i,s,t.canonicalFps):{start:i,end:s};return Vn(t.currentTime,l.start,l.end,t.compositionDuration)}function ii(e){return Ce(e)}function Il(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(jn),r=Xn({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(ii).some(o=>o!=null&&o<=0)?0:null)}function Up(e){return Xn({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(Kn)})?.end??null}function Dl(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function Pl(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function rr(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function oi(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 Wp(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return oi(t);let n=e.getAttribute("data-composition-src");if(n)return oi(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?oi(r.getAttribute("src")):null}function CA(e){let t=e.className;return typeof t!="string"?null:t.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function RA(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function TA(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ri(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Vp(e){return e.getAttribute("data-hf-original-composition-id")??e.getAttribute("data-composition-id")}function kA(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=Vp(e);if(i)return ri(i);let o=e.id;if(o)return ri(o);let a=CA(e);if(a)return ri(a);let s=RA(Wp(e));if(s)return ri(s);let l=TA(e);return l||`${ri(t)} ${n+1}`}function Ol(e){let n=window.__timelines??{},r=je({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=Y=>{if(!Y)return null;let P=n[Y]??null;if(!P||typeof P.duration!="function")return null;try{let K=Number(P.duration());return Number.isFinite(K)&&K>0?K:null}catch{return null}},o=()=>{let Y=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(Y.length===0)return null;let P=0;for(let K of Y){let Q=r.resolveMediaStartForElement(K);if(!Number.isFinite(Q))continue;let le=Bn(K);le==null||le<=0||(P=Math.max(P,Math.max(0,Q)+le))}return P>0?P:null},a=(Y,P)=>{let K=[],Q=null,le=null,Z=null,z=Y.parentElement;for(;z;){let se=z.getAttribute("data-composition-id");se&&(K.push(se),!Z&&z!==P&&(Z=se),Q==null&&(Q=r.resolveStartForElement(z,0)),le==null&&(le=ii(z.getAttribute("data-duration"))??i(se)??null)),z=z.parentElement}return{parentCompositionId:Z,compositionAncestors:K.reverse(),inheritedStart:Q,inheritedDuration:le}},s=Et(),l=Array.from(document.querySelectorAll("[data-composition-id]")),u=s?.getAttribute("data-composition-id")??null,f=s?r.resolveStartForElement(s,0):0,d=o(),m=d!=null?Math.max(0,d-Math.max(0,f)):null,g=i(u),h=Il(s??document.body),b=Pl(...l.filter(Y=>Y!==s).map(Y=>{let P=r.resolveStartForElement(Y,0),K=r.resolveDurationForElement(Y)??i(Y.getAttribute("data-composition-id"))??null;return!Number.isFinite(P)||K==null||K<=0?null:Math.max(0,P)+K})),x=b!=null?Math.max(0,b-Math.max(0,f)):null,v=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,A=typeof h=="number"&&Number.isFinite(h)&&h>0?h:null,E=typeof m=="number"&&Number.isFinite(m)&&m>0?m:null,k=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,O=Pl(E,k),F=v!=null&&O!=null&&v>=Jo,R=A??(F?O:Pl(v,E,k))??null,T=(R!=null?f+R:null)??(typeof d=="number"&&Number.isFinite(d)&&d>0?d:null),B=(Y,P)=>!Number.isFinite(P)||P<=0?0:T==null||!Number.isFinite(T)?P:!Number.isFinite(Y)||Y>=T?0:Math.max(0,Math.min(P,T-Y)),W=[],ne=[],N=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),_=0;for(let[Y,P]of N.entries()){if(P===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(P.tagName))continue;let K=a(P,s),Q=P.tagName.toLowerCase(),le=Q==="video"||Q==="audio"?r.resolveMediaStartForElement(P):r.resolveStartForElement(P,K.inheritedStart??0),Z=P.getAttribute("data-composition-id"),z=Il(P);if(z==null&&Z&&Z!==u&&(z=i(Z)),z==null&&pe(P)&&Number.isFinite(P.duration)&&(z=xt(P,P.duration)),z==null&&(z=Un(P,le)),z==null){let Ke=K.inheritedDuration;if(Ke!=null&&Ke>0){let it=(K.inheritedStart??0)+Ke;z=Math.max(0,it-le)}}if(z==null||z<=0||(z=B(le,z),z<=0))continue;let se=le+z;_=Math.max(_,se);let pt=Z&&Z!==u?"composition":Q==="video"?"video":Q==="audio"?"audio":Q==="img"?"image":"element";W.push({id:Nl(P)??Z??null,label:kA(P,pt,W.length),start:le,duration:z,track:rr(P,Y),zIndex:Dl(P),stackingContextId:Yo(P),kind:pt,tagName:Q,compositionId:P.getAttribute("data-composition-id"),compositionAncestors:K.compositionAncestors,parentCompositionId:K.parentCompositionId,nodePath:null,compositionSrc:oi(P.getAttribute("data-composition-src")),playbackStart:St(P),playbackRate:Ve(P),assetUrl:Wp(P),timelineRole:P.getAttribute("data-timeline-role"),timelineLabel:P.getAttribute("data-timeline-label"),timelineGroup:P.getAttribute("data-timeline-group"),timelinePriority:ii(P.getAttribute("data-timeline-priority"))})}let G=new Set(W.map(Y=>Y.id)),X=s?.getAttribute("data-composition-id")??null,U=X?n[X]??null:null;if(U&&s){let Y=U;if(typeof Y.getChildren=="function")try{let P=Y.getChildren(!0,!0,!1)??[],K=new Map;for(let Z of s.children){let z=Z;if(!z.id)continue;let se=z.tagName.toLowerCase();se==="script"||se==="style"||se==="link"||K.set(z,{id:z.id,start:1/0,end:-1/0})}let Q=Z=>{let z=Z;for(;z;){if(K.has(z))return z;if(z===s)return null;z=z.parentElement}return null};for(let Z of P){if(typeof Z.targets!="function"||typeof Z.startTime!="function"||typeof Z.duration!="function")continue;let z=Z.startTime(),se=Z.parent;for(;se&&se!==U&&typeof se.startTime=="function";)z+=se.startTime(),se=se.parent;let pt=z+Z.duration();if(!(!Number.isFinite(z)||!Number.isFinite(pt)))for(let Ke of Z.targets()){if(!ke(Ke))continue;let kn=Q(Ke);if(!kn)continue;let it=K.get(kn);it&&(it.start=Math.min(it.start,z),it.end=Math.max(it.end,pt))}}let le=W.length>0?Math.max(...W.map(Z=>Z.track))+1:0;for(let[Z,z]of K){if(z.start===1/0||z.end===-1/0)continue;let se=Z;if(G.has(se.id))continue;let pt=Math.max(0,z.end-z.start);if(pt<=0)continue;let Ke=B(z.start,pt);Ke<=0||(_=Math.max(_,z.start+Ke),W.push({id:se.id,label:se.getAttribute("data-timeline-label")??se.getAttribute("data-label")??se.getAttribute("aria-label")??se.id,start:z.start,duration:Ke,track:rr(se,le),zIndex:Dl(se),stackingContextId:Yo(se),kind:"element",tagName:se.tagName.toLowerCase(),compositionId:se.getAttribute("data-composition-id"),compositionAncestors:X?[X]:[],parentCompositionId:X,nodePath:null,compositionSrc:null,playbackStart:St(se),playbackRate:Ve(se),assetUrl:null,timelineRole:se.getAttribute("data-timeline-role"),timelineLabel:se.getAttribute("data-timeline-label"),timelineGroup:se.getAttribute("data-timeline-group"),timelinePriority:ii(se.getAttribute("data-timeline-priority"))}),G.add(se.id))}}catch(P){H("runtime.timeline.site1",P)}}if(s&&R!=null&&R>0){let Y=W.length>0?Math.max(...W.map(P=>P.track))+1:0;for(let P of s.children){let K=P;if(!K.id||G.has(K.id))continue;let Q=K.getAttribute("data-timeline-role");if(Q!=="overlay"&&Q!=="persistent-overlay")continue;let le=K.tagName.toLowerCase();if(le==="script"||le==="style"||le==="link"||le==="meta"||window.getComputedStyle(K).display==="none")continue;let z=B(0,R);z<=0||(_=Math.max(_,z),W.push({id:K.id,label:K.getAttribute("data-timeline-label")??K.getAttribute("data-label")??K.getAttribute("aria-label")??K.id,start:0,duration:z,track:rr(K,Y),zIndex:Dl(K),stackingContextId:Yo(K),kind:"element",tagName:le,compositionId:K.getAttribute("data-composition-id"),compositionAncestors:X?[X]:[],parentCompositionId:X,nodePath:null,compositionSrc:null,playbackStart:St(K),playbackRate:Ve(K),assetUrl:null,timelineRole:Q,timelineLabel:K.getAttribute("data-timeline-label"),timelineGroup:K.getAttribute("data-timeline-group"),timelinePriority:ii(K.getAttribute("data-timeline-priority"))}),G.add(K.id))}}for(let Y of l){if(Y===s)continue;let P=Y.getAttribute("data-composition-id");if(!P||!Fl(P))continue;let K=r.resolveStartForElement(Y,0),Q=Il(Y);if((Q==null||Q<=0)&&Up(Y)!=null){let se=Up(Y);Q=Math.max(0,se-K)}let le=i(P),Z=Q&&Q>0?Q:le;if(Z==null||Z<=0)continue;let z=B(K,Z);z<=0||ne.push({id:P,label:Y.getAttribute("data-label")??Vp(Y)??P,start:K,duration:z,thumbnailUrl:oi(Y.getAttribute("data-thumbnail-url")),avatarName:null})}let j=Math.max(_||0,R??0),V=j>0?j:1,J=Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{...fo(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:V,durationInFrames:J,clips:W,scenes:ne,compositionWidth:nr(s?.getAttribute("data-width"))??1920,compositionHeight:nr(s?.getAttribute("data-height"))??1080}}var $p=e=>e!==null&&Number.isFinite(e)&&e>0;function ir(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if($p(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter($p);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:t}:{seconds:null,source:"unresolved",pendingClips:t,reason:t>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}var It=1/60,Zo=e=>e!==null&&e>It?e:null;function zp(e){return{width:nr(e.getAttribute("data-width")),height:nr(e.getAttribute("data-height"))}}function qp(e,t){let n=[];for(let r of e.querySelectorAll("video[data-start], audio[data-start]")){let i=t.mediaStart(r);if(!Number.isFinite(i))continue;let o=t.mediaDuration(r);o==null||o<=It||n.push(Math.max(0,i)+o)}return Zo(ir({authoredDurationSeconds:null,clipEndsSeconds:n}).seconds)}function jp(e,t){let n=[];for(let i of e.querySelectorAll("[data-composition-id][data-start]")){if(i.parentElement?.closest("[data-composition-id]")!==e)continue;let o=t.resolveStartForElement(i,0),a=t.resolveDurationForElement(i);!Number.isFinite(o)||a==null||a<=0||n.push(Math.max(0,o)+a)}let r=Ce(e.getAttribute("data-duration"));return Zo(ir({authoredDurationSeconds:null,clipEndsSeconds:[r,...n]}).seconds)}var MA=e=>e.hasAttribute("data-composition-id")||e.hasAttribute("data-composition-src");function Kp(e,t,{unregisteredLottie:n}){let r=[];for(let o of e.querySelectorAll("[data-start]")){let a=t.resolveStartForElement(o,0);if(!Number.isFinite(a))continue;let s=t.resolveDurationForElement(o);s!=null?r.push(Math.max(0,a)+s):(pe(o)||MA(o))&&r.push(null)}(n||e.querySelector("[data-lottie-src]"))&&r.push(null);let i=ir({authoredDurationSeconds:null,clipEndsSeconds:r});return i.pendingClips>0?{...i,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:i}function Xp(e){if(e.declared!==null&&Number.isFinite(e.declared)&&e.declared>0)return e.declared;let t=Zo(e.timeline()),n=Math.max(0,...e.floors().map(o=>o??0)),r=Number.isFinite(e.fallback)&&e.fallback>It?e.fallback:0,i;return t!==null?i=Math.max(t,n,r):Zo(n)!==null?i=Math.max(n,r):r>0?i=r:i=e.derived(),i>0?i:0}var Hl="data-composition-id",NA="data-composition-src",LA=`[${Hl}]`,_I=`[${NA}]`,Gl="style",Bl="script",Ul='link[rel="stylesheet"], link[rel="preconnect"]',Yp=`${Gl}, ${Bl}, ${Ul}`;function An(e){return e?Array.from(e):[]}function Jp(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=An(t.querySelectorAll(LA)),s=o?a.find(f=>f.getAttribute(Hl)===o)??null:a[0]??null,l=(s??a[0])?.getAttribute(Hl)?.trim()||"",u=i?null:n??null;return{innerRoot:s,authoredCompositionId:o||l||null,scriptCompositionId:l||o||null,authoredRootId:s?.getAttribute("id")?.trim()||null,styleSources:[...An(u?.querySelectorAll(Gl)),...An(t.querySelectorAll(Gl))],scriptSources:[...An(u?.querySelectorAll(Bl)),...An(t.querySelectorAll(Bl))],linkSources:[...An(n?.querySelectorAll(Ul)),...An(t.querySelectorAll(Ul))],variableDefaultCarriers:[r,s].filter(f=>f!=null)}}var FA='"use strict";(()=>{function I(e){return e?/[\\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function _(e){return e===" "||e===" "||e===`\n`||e==="\\r"||e==="\\f"}var j=/^[0-9a-fA-F]{1,6}/;function G(e){let n=e>=55296&&e<=57343;return e===0||e>1114111||n?65533:e}function $(e,n){return e[n]==="\\r"&&e[n+1]===`\n`?n+2:_(e[n])?n+1:n}function R(e,n){let t=e[n+1];if(t===void 0||/[\\n\\r\\f]/.test(t))return null;let i=j.exec(e.slice(n+1,n+7));if(!i)return{value:t,end:n+2};let o=G(Number.parseInt(i[0],16));return{value:String.fromCodePoint(o),end:$(e,n+1+i[0].length)}}function H(e,n){let t=o=>I(o)&&!/[0-9-]/.test(o),i=o=>e[o]==="\\\\"&&R(e,o)!==null;return e[n]==="-"?e[n+1]==="-"||t(e[n+1])||i(n+1):t(e[n])||i(n)}function y(e,n){let t=n;for(;e.startsWith("/*",t);){let i=e.indexOf("*/",t+2);t=i<0?e.length:i+2}return t}function A(e,n){let t=y(e,n);for(;_(e[t]);)t=y(e,t+1);return t}function h(e,n){if(!H(e,n))return null;let t=n,i="";for(;t<e.length;){let o=e[t];if(o==="\\\\"){let a=R(e,t);if(!a)break;i+=a.value,t=a.end;continue}if(!I(o))break;i+=o,t+=1}return t===n?null:{value:i,end:t}}var C=45;function T(e){return e>=48&&e<=57}function z(e){return e>=128||e===C||e===95||T(e)||e>=65&&e<=90||e>=97&&e<=122}function J(e,n){let t=e.charCodeAt(n);return t>=1&&t<=31||t===127?!0:T(t)?n===0||n===1&&e.charCodeAt(0)===C:!1}function k(e){let n="";for(let t=0;t<e.length;t+=1){let i=e.charCodeAt(t),o=e[t];i===0?n+="\\uFFFD":J(e,t)?n+=`\\\\${i.toString(16)} `:t===0&&e.length===1&&i===C?n+=`\\\\${o}`:z(i)?n+=o:n+=`\\\\${o}`}return n}var W=/\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:[0-9a-fA-F]{1,6}(?:\\r\\n|[ \\t\\r\\n\\f])?|[\\s\\S])|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|\\[(?:\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\[\\s\\S]|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|[^\\]"\'\\\\/]|\\/(?!\\*))*\\]/g;function Q(e){let n=new Array(e.length).fill(!0);for(let t of e.matchAll(W)){let i=t.index;n.fill(!1,i,i+t[0].length)}return n}function q(e,n,t){if(n.length===0||!e.includes("#"))return e;let i=new Set(n),o=Q(e),a="",u=0;for(;u<e.length;){let d=o[u]&&e[u]==="#"?h(e,u+1):null;d&&i.has(d.value)?(a+=t(d.value),u=d.end):(a+=e[u],u+=1)}return a}function X(e){let n="";for(let t=0;t<e.length;t+=1){if(e[t]==="\\\\"){let i=e[t+1];if(i!==void 0&&/[\\n\\r\\f]/.test(i)){t=$(e,t+1)-1;continue}let o=R(e,t);if(o){n+=o.value,t=o.end-1;continue}}n+=e[t]}return n}function N(e){return Array.from(e,n=>{let t=n.charCodeAt(0);return t===0?"\\uFFFD":t<32||t===127?`\\\\${t.toString(16)} `:n===\'"\'||n==="\\\\"?`\\\\${n}`:n}).join("")}function Y(e,n){return e?{kind:"any"}:n===void 0?{kind:"none"}:{kind:"named",prefix:n}}function Z(e,n){return e[n]==="|"&&e[n+1]!=="="}function B(e,n){let t=e[n]==="*",i=t?{value:"*",end:n+1}:h(e,n),o=y(e,i?.end??n);if(!Z(e,o))return t?null:i?{token:i,namespace:{kind:"none"}}:null;let a=h(e,y(e,o+1));return a?{token:a,namespace:Y(t,i?.value)}:null}function K(e){if(e[0]!=="[")return null;let n=A(e,1),t=B(e,n);if(!t)return null;let{token:i,namespace:o}=t;return{name:i.value,rawName:e.slice(n,i.end),namespace:o,end:i.end}}function ee(e,n){let t=/^(?:"((?:\\\\[\\s\\S]|[^"\\\\])*)"|\'((?:\\\\[\\s\\S]|[^\'\\\\])*)\')/.exec(e.slice(n));return t?{value:X(t[1]??t[2]),end:n+t[0].length}:h(e,n)}function ne(e,n){let t=A(e,n),i=h(e,t);if(i){if(!/^[is]$/i.test(i.value))return null;t=A(e,i.end)}return e[t]!=="]"||t!==e.length-1?null:{flag:i?.value}}function F(e){let n=K(e);if(!n)return null;let t=A(e,n.end),o=["=","~=","|=","^=","$=","*="].find(d=>e.startsWith(d,t));if(!o)return null;let a=ee(e,A(e,t+o.length));if(!a)return null;let u=ne(e,a.end);return u?{name:n.name,rawName:n.rawName,namespace:n.namespace,operator:o,value:a.value,flag:u.flag}:null}function E(e,n){return e.replace(W,t=>t.startsWith("[")?n(t):t)}var re="data-hf-svg-reference-aliases";function O(e,n,t,i){let o={"=":(s,r)=>s===r,"~=":(s,r)=>s.split(/[ \\t\\r\\n\\f]+/).includes(r),"|=":(s,r)=>s===r||s.startsWith(r+"-"),"^=":(s,r)=>s.startsWith(r),"$=":(s,r)=>s.endsWith(r),"*=":(s,r)=>s.includes(r)},a=(s,r,l)=>!r&&l!=="="&&l!=="|="?!1:o[l](s,r),u=s=>s.replace(/[A-Z]/g,r=>r.toLowerCase()),d=s=>{let r=F(s);if(!r)return s;let{name:l,rawName:g,namespace:m,operator:b,value:D,flag:w}=r;if(m.kind==="named"!=(i!==void 0))return s;let x=w?.toLowerCase()==="i"?u:S=>S,L=u(l),P=t.filter(S=>{let V=m.kind==="none"?S.name:S.localName,U=m.kind==="named"?i.get(m.prefix):null;return(m.kind==="any"||S.namespaceURI===U)&&u(V)===L}),v=new Set([s]);for(let S of P)a(x(S.before),x(D),b)&&v.add(`[${g}="${N(S.after)}"${w?` ${w}`:""}]`);return v.size===1?s:`:is(${[...v].join(", ")})`};if(i)return E(e,d);let p=new Map(n.map(({id:s,replacement:r})=>[s,r])),f=new Map;for(let s of t){if(s.name!=="id"||s.before===s.after||p.has(s.before))continue;let r=f.get(s.before);r||(r=new Set([`#${k(s.before)}`]),f.set(s.before,r)),r.add(`#${k(s.after)}`)}for(let[s,r]of f)p.set(s,`:is(${[...r].join(", ")})`);let c=q(e,[...p.keys()],s=>p.get(s));return E(c,d)}function se(e,n,t=!0){let i=[],a=(t?[...e.querySelectorAll(`[${n}]`)]:[]).map(d=>d.getAttribute(n)),u=e.getAttribute?.(n);u&&a.unshift(u);for(let d of a){let p;try{p=JSON.parse(d)}catch{continue}if(!Array.isArray(p))continue;let f=p;for(let c of f){if(!ie(c))continue;let{name:s,localName:r,namespaceURI:l,before:g,after:m}=c;i.push({name:s,localName:r,namespaceURI:l,before:g,after:m})}}return i}function ie(e){if(!e||typeof e!="object")return!1;let{name:n,localName:t,namespaceURI:i,before:o,after:a}=e;return typeof n=="string"&&typeof t=="string"&&(i===null||typeof i=="string")&&typeof o=="string"&&typeof a=="string"}function oe(e){let n=[],t=[],i=!1,o,a=new WeakMap,u=(f,c)=>{for(let s of f){if("selectorText"in s){let r=s,l=a.get(r),g=r.selectorText,m=l?.applied===g?l.authored:g,b=O(m,[],t,c);b!==g&&(r.selectorText=b),b===m?a.delete(r):a.set(r,{authored:m,applied:r.selectorText})}"cssRules"in s&&u(s.cssRules,c)}},d=()=>{if(t.length)for(let f of e.document.styleSheets){let c;try{c=f.cssRules}catch{continue}let s=new Map;for(let r of c){if(!("namespaceURI"in r))continue;let{prefix:l,namespaceURI:g}=r;l&&s.set(l,g||null)}s.size&&u(c,s)}},p={rewrite:(f,c=[])=>{if(typeof f!="string"||!f.includes("#")&&!f.includes("["))return f;let s=O(f,c.length?[...c,...n]:n,t);if(s!==f){if(!o){let r=e.document.createElement("div");o=r.matches.bind(r)}o(f)}return s},refresh(){t=se(e.document,re).filter(r=>r.before!==r.after);let f=new Set(t.filter(r=>r.name==="id").map(r=>r.before)),c=new Set;n=[];for(let r of e.document.querySelectorAll("[data-hf-authored-id][id]")){let l=r.getAttribute("data-hf-authored-id");if(!l||l===r.id||c.has(l)||f.has(l))continue;c.add(l);let g=N(l);n.push({id:l,replacement:`:is(#${k(l)}, [data-hf-authored-id="${g}"])`})}if(d(),i||!n.length&&!t.length)return;let s=e.Element.prototype;s.querySelector=new Proxy(s.querySelector,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),s.querySelectorAll=new Proxy(s.querySelectorAll,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),i=!0}};e.__hfSvgSelectorAliases=p,p.refresh()}function M(){let e=window;e.__hfSvgSelectorAliases||oe(e)}M();})();\n';function Qp(){return FA}var _e=yS(Rg(),1),ga=_e.default,hD=_e.default.stringify,gD=_e.default.fromJSON,bD=_e.default.plugin,xD=_e.default.parse,yD=_e.default.list,SD=_e.default.document,vD=_e.default.comment,ED=_e.default.atRule,AD=_e.default.rule,wD=_e.default.decl,_D=_e.default.root,CD=_e.default.CssSyntaxError,RD=_e.default.Declaration,TD=_e.default.Container,kD=_e.default.Processor,MD=_e.default.Document,ND=_e.default.Comment,LD=_e.default.Warning,FD=_e.default.AtRule,ID=_e.default.Result,DD=_e.default.Input,PD=_e.default.Rule,OD=_e.default.Root,HD=_e.default.Node;var fu="data-hf-scene",wi="hf-scene-parts",mu="data-hf-scene-no-swap";var pu="data-hf-authored-id",Tg="data-hf-inner-root";function hu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gu(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function f_(e){let t=e.trim();return t?Array.from(new Set([t,kt(t)])).filter(Boolean):[]}function m_(e,t,n){let r=f_(t);return uo(e,r,()=>n)}function p_(e,t){let n=t?.trim();return n?m_(e,n,`[${pu}="${gu(n)}"]`):e}function kg(e){return`${e}:not(:has([${Tg}])), ${e} > [${Tg}]`}function h_(e,t,n,r,i,o){let a=p_(e,r),s=g_(a,t,n),l=s.trim();if(!l||l==="*")return e;if(/^(html|body|:root)$/i.test(l))return o?kg(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${hu(n)}\\1\\s*\\]`,"g");if(u.test(l))return l.replace(u,"").trim()===""?kg(t):s.replace(u,t);let f=s.match(/^\s*/)?.[0]??"",d=s.match(/\s*$/)?.[0]??"";if(i){let m=r?`[${pu}="${gu(r)}"]`:null;if(m&&l.startsWith(m)){let g=l.slice(m.length);return`${f}${t}${m}${g}${d}`}}return`${f}${t} ${l}${d}`}function g_(e,t,n){let r=hu(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var b_=new Set(["keyframes","-webkit-keyframes","font-face"]);function x_(e){return e?.type==="atrule"}function y_(e){let t=e.parent;for(;t;){if(x_(t)&&b_.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function S_(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function Mg(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${gu(o)}"]`,s;try{s=ga.parse(e)}catch{return""}return s.walkRules(l=>{y_(l)||S_(l)||(l.selectors=l.selectors.map(u=>h_(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),s.toResult({map:!1}).css}function et(e){return JSON.stringify(e).replace(/</g,"\\u003c")}var Ng=`!__hfBaseHyperframes
|
|
42
|
+
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",R,!0),document.addEventListener("click",M,!0),document.addEventListener("keydown",T,!0),l("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function W(){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",R,!0),document.removeEventListener("click",M,!0),document.removeEventListener("keydown",T,!0),l("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function ne(){window.__HF_PICKER_API={enable:B,disable:W,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(N,_,G)=>Number.isFinite(N)&&Number.isFinite(_)?D(N,_,G):[],pickAtPoint:(N,_,G)=>{if(!Number.isFinite(N)||!Number.isFinite(_))return null;let X=D(N,_,8);if(!X.length)return null;let U=Math.max(0,Math.min(X.length-1,Number(G??0))),j=X[U]??null;return j?(f(j),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:j}),W(),j):null},describe:N=>ke(N)?F(N):null,pickManyAtPoint:(N,_,G)=>{if(!Number.isFinite(N)||!Number.isFinite(_))return[];let X=D(N,_,8);if(!X.length)return[];let U=[],j=Array.isArray(G)?G:[0];for(let V of j){let J=Math.max(0,Math.min(X.length-1,Math.floor(Number(V)))),Y=X[J];if(!Y)continue;U.some(K=>K.selector===Y.selector&&K.tagName===Y.tagName)||U.push(Y)}return U.length?(f(U[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:U}),W(),U):[]}},l("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:B,disablePickMode:W,installPickerApi:ne}}function ti(e,t,n){let r=e?.[t];return typeof r=="function"?Number(r.call(e))||n:typeof r=="number"&&Number.isFinite(r)?r:(r!=null&&H("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function ut(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&H("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function ni(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){H("runtime.player.site1",i)}}}function Xo(e,t,n){return n?.exact===!0?Number.isFinite(e)&&e>0?e:0:um(e,t,n?.subFrameDivisions)}function Op(e,t,n,r){let i=Xo(t,n,r),o=r?.suppressEvents===!0;return ut(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function oA(e,t,n,r,i){let o=[];ni(e,t,a=>{ut(a,"play"),o.push(a)});try{return Op(t,n,r,i)}finally{for(let a of o)try{ut(a,"pause")}catch(s){H("runtime.player.site2",s)}}}function aA(e,t){ni(e,t,n=>{ut(n,"play")})}function Hp(e){let t=e.transport;return t?{_timeline:null,play:()=>t.play(),pause:()=>t.pause(),seek:(n,r)=>t.seek(n,r),renderSeek:(n,r)=>t.renderSeek(n,r),getTime:()=>t.getTime(),getDuration:()=>t.getDuration(),isPlaying:()=>t.isPlaying(),setPlaybackRate:n=>t.setPlaybackRate(n),getPlaybackRate:()=>t.getPlaybackRate()}:{_timeline:null,play:()=>{let n=e.getTimeline();if(!n||e.getIsPlaying())return;let r=Math.max(0,Number(e.getSafeDuration?.()??ti(n,"duration",0))||0);r>0&&Math.max(0,ti(n,"time",0))>=r&&(ut(n,"pause"),typeof n.seek=="function"&&n.seek(0,!1),e.onDeterministicSeek(0),e.setIsPlaying(!1),e.onSyncMedia(0,!1),e.onRenderFrameSeek(0)),typeof n.timeScale=="function"&&n.timeScale(e.getPlaybackRate()),ut(n,"play"),ni(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),ut(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;ut(n,"pause"),ni(e.getTimelineRegistry?.(),n,i=>{ut(i,"pause")});let r=Math.max(0,ti(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),s=oA(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(s),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),ut(i,"play"),ni(e.getTimelineRegistry?.(),i,l=>{typeof l.timeScale=="function"&&l.timeScale(e.getPlaybackRate()),ut(l,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(s,!0)):(e.setIsPlaying(!1),e.onSyncMedia(s,!1)),e.onRenderFrameSeek(s),e.onStatePost(!0)},renderSeek:(n,r)=>{let i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(aA(e.getTimelineRegistry?.(),i),Op(i,n,o,r)):Xo(Math.max(0,Number(n)||0),o,r);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>ti(e.getTimeline(),"time",0),getDuration:()=>ti(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Ml(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}function En(e){if(e==null||e.trim()==="")return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function nr(e){if(e==null||e.trim()==="")return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function Et(e=document){let t=e.querySelector('[data-composition-id][data-root="true"]');return xe(t)?t:e.querySelector("[data-composition-id]")}var sA=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Nl(e){return e.id||e.getAttribute("data-hf-id")||null}function lA(e){return Ce(e)}function uA(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function cA(e){return pe(e)?Number.isFinite(e.duration)?xt(e,e.duration):null:Un(e)}function dA(e,t,n,r){let i=lA(e.getAttribute("data-duration"));return i!=null&&i>0?i:uA(e,t)??cA(e)??Math.max(0,n-r)}function fA(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function Gp(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=Et(),a=0;for(let s of document.querySelectorAll("[data-start]")){if(s===o||sA.has(s.tagName))continue;let l=t.resolveStartForElement(s,0);if(dA(s,n,r,l)<=0)continue;let u={id:Nl(s)??`__clip-${a++}`,element:s,parentId:null,children:[]};i.set(s,u)}return fA(i),{roots:Array.from(i.values()).filter(s=>s.parentId===null)}}var Ll="css:root",Bp=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],mA=new Set([...Bp,"contain","isolation","mask-border","mix-blend-mode","opacity"]),pA=new Set(["absolute","relative"]),hA=new Set(["flex","inline-flex","grid","inline-grid"]),gA=new Set(["layout","paint","strict","content"]),bA=new Set(["size","inline-size"]);function xA(e){return e.position==="fixed"||e.position==="sticky"}function yA(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(pA.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&hA.has(n)}function SA(e){let t=Number.parseFloat(e.opacity);if(Number.isFinite(t)&&t<1||e.getPropertyValue("isolation")==="isolate")return!0;let n=e.getPropertyValue("mix-blend-mode");return n&&n!=="normal"?!0:Bp.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function vA(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>gA.has(n))?!0:bA.has(e.getPropertyValue("container-type"))}function EA(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>mA.has(t))}function AA(e,t){return xA(t)||yA(e,t)||SA(t)||vA(t)?!0:EA(t)}function wA(e){let t=[],n=e;for(;n?.parentElement;)t.push(Array.prototype.indexOf.call(n.parentElement.children,n)),n=n.parentElement;return`css:${t.reverse().join(".")}`}function Yo(e){let t=e.ownerDocument.defaultView;if(!t)return Ll;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(AA(n,t.getComputedStyle(n)))return wA(n)}catch{return Ll}n=n.parentElement}return Ll}function Fl(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Jo=7200;function Qo(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return!1;let i=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),o=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let u=t.timelineRegistry[a],f=u&&typeof u.duration=="function"?Number(u.duration()):null;!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(jn)||e.hasAttribute(Kn))&&(o==null||o<=0)&&f!=null&&Number.isFinite(f)&&f>0&&(o=f)}let s=o!=null&&o>0?i+o:Number.POSITIVE_INFINITY,l=t.exportRenderSeek?Lo(i,s,t.canonicalFps):{start:i,end:s};return Vn(t.currentTime,l.start,l.end,t.compositionDuration)}function ii(e){return Ce(e)}function Il(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(jn),r=Xn({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(ii).some(o=>o!=null&&o<=0)?0:null)}function Up(e){return Xn({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(Kn)})?.end??null}function Dl(e){try{let t=e.style?.zIndex;if(t&&t!=="auto"){let n=parseInt(t,10);if(Number.isFinite(n))return n}return 0}catch{return 0}}function Pl(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function rr(e,t){let n=e.getAttribute("data-track-index")??e.getAttribute("data-track");if(n==null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)?r:t}function oi(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 Wp(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return oi(t);let n=e.getAttribute("data-composition-src");if(n)return oi(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?oi(r.getAttribute("src")):null}function CA(e){let t=e.className;return typeof t!="string"?null:t.split(/\s+/).map(n=>n.trim()).find(n=>n&&n!=="clip"&&!n.startsWith("__hf-"))??null}function RA(e){if(!e)return null;let t;try{t=new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)}catch{t=e.replace(/[?#].*$/,"").split(/[\\/]/).filter(Boolean).at(-1)}if(!t)return null;try{return decodeURIComponent(t)}catch{return t}}function TA(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function ri(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Vp(e){return e.getAttribute("data-hf-original-composition-id")??e.getAttribute("data-composition-id")}function kA(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=Vp(e);if(i)return ri(i);let o=e.id;if(o)return ri(o);let a=CA(e);if(a)return ri(a);let s=RA(Wp(e));if(s)return ri(s);let l=TA(e);return l||`${ri(t)} ${n+1}`}function Ol(e){let n=window.__timelines??{},r=je({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=Y=>{if(!Y)return null;let P=n[Y]??null;if(!P||typeof P.duration!="function")return null;try{let K=Number(P.duration());return Number.isFinite(K)&&K>0?K:null}catch{return null}},o=()=>{let Y=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(Y.length===0)return null;let P=0;for(let K of Y){let Q=r.resolveMediaStartForElement(K);if(!Number.isFinite(Q))continue;let le=Bn(K);le==null||le<=0||(P=Math.max(P,Math.max(0,Q)+le))}return P>0?P:null},a=(Y,P)=>{let K=[],Q=null,le=null,Z=null,z=Y.parentElement;for(;z;){let se=z.getAttribute("data-composition-id");se&&(K.push(se),!Z&&z!==P&&(Z=se),Q==null&&(Q=r.resolveStartForElement(z,0)),le==null&&(le=ii(z.getAttribute("data-duration"))??i(se)??null)),z=z.parentElement}return{parentCompositionId:Z,compositionAncestors:K.reverse(),inheritedStart:Q,inheritedDuration:le}},s=Et(),l=Array.from(document.querySelectorAll("[data-composition-id]")),u=s?.getAttribute("data-composition-id")??null,f=s?r.resolveStartForElement(s,0):0,d=o(),m=d!=null?Math.max(0,d-Math.max(0,f)):null,g=i(u),h=Il(s??document.body),b=Pl(...l.filter(Y=>Y!==s).map(Y=>{let P=r.resolveStartForElement(Y,0),K=r.resolveDurationForElement(Y)??i(Y.getAttribute("data-composition-id"))??null;return!Number.isFinite(P)||K==null||K<=0?null:Math.max(0,P)+K})),x=b!=null?Math.max(0,b-Math.max(0,f)):null,v=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,A=typeof h=="number"&&Number.isFinite(h)&&h>0?h:null,E=typeof m=="number"&&Number.isFinite(m)&&m>0?m:null,k=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,O=Pl(E,k),F=v!=null&&O!=null&&v>=Jo,R=A??(F?O:Pl(v,E,k))??null,T=(R!=null?f+R:null)??(typeof d=="number"&&Number.isFinite(d)&&d>0?d:null),B=(Y,P)=>!Number.isFinite(P)||P<=0?0:T==null||!Number.isFinite(T)?P:!Number.isFinite(Y)||Y>=T?0:Math.max(0,Math.min(P,T-Y)),W=[],ne=[],N=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),_=0;for(let[Y,P]of N.entries()){if(P===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(P.tagName))continue;let K=a(P,s),Q=P.tagName.toLowerCase(),le=Q==="video"||Q==="audio"?r.resolveMediaStartForElement(P):r.resolveStartForElement(P,K.inheritedStart??0),Z=P.getAttribute("data-composition-id"),z=Il(P);if(z==null&&Z&&Z!==u&&(z=i(Z)),z==null&&pe(P)&&Number.isFinite(P.duration)&&(z=xt(P,P.duration)),z==null&&(z=Un(P,le)),z==null){let Ke=K.inheritedDuration;if(Ke!=null&&Ke>0){let it=(K.inheritedStart??0)+Ke;z=Math.max(0,it-le)}}if(z==null||z<=0||(z=B(le,z),z<=0))continue;let se=le+z;_=Math.max(_,se);let pt=Z&&Z!==u?"composition":Q==="video"?"video":Q==="audio"?"audio":Q==="img"?"image":"element";W.push({id:Nl(P)??Z??null,label:kA(P,pt,W.length),start:le,duration:z,track:rr(P,Y),zIndex:Dl(P),stackingContextId:Yo(P),kind:pt,tagName:Q,compositionId:P.getAttribute("data-composition-id"),compositionAncestors:K.compositionAncestors,parentCompositionId:K.parentCompositionId,nodePath:null,compositionSrc:oi(P.getAttribute("data-composition-src")),playbackStart:St(P),playbackRate:Ve(P),assetUrl:Wp(P),timelineRole:P.getAttribute("data-timeline-role"),timelineLabel:P.getAttribute("data-timeline-label"),timelineGroup:P.getAttribute("data-timeline-group"),timelinePriority:ii(P.getAttribute("data-timeline-priority"))})}let G=new Set(W.map(Y=>Y.id)),X=s?.getAttribute("data-composition-id")??null,U=X?n[X]??null:null;if(U&&s){let Y=U;if(typeof Y.getChildren=="function")try{let P=Y.getChildren(!0,!0,!1)??[],K=new Map;for(let Z of s.children){let z=Z;if(!z.id)continue;let se=z.tagName.toLowerCase();se==="script"||se==="style"||se==="link"||K.set(z,{id:z.id,start:1/0,end:-1/0})}let Q=Z=>{let z=Z;for(;z;){if(K.has(z))return z;if(z===s)return null;z=z.parentElement}return null};for(let Z of P){if(typeof Z.targets!="function"||typeof Z.startTime!="function"||typeof Z.duration!="function")continue;let z=Z.startTime(),se=Z.parent;for(;se&&se!==U&&typeof se.startTime=="function";)z+=se.startTime(),se=se.parent;let pt=z+Z.duration();if(!(!Number.isFinite(z)||!Number.isFinite(pt)))for(let Ke of Z.targets()){if(!ke(Ke))continue;let kn=Q(Ke);if(!kn)continue;let it=K.get(kn);it&&(it.start=Math.min(it.start,z),it.end=Math.max(it.end,pt))}}let le=W.length>0?Math.max(...W.map(Z=>Z.track))+1:0;for(let[Z,z]of K){if(z.start===1/0||z.end===-1/0)continue;let se=Z;if(G.has(se.id))continue;let pt=Math.max(0,z.end-z.start);if(pt<=0)continue;let Ke=B(z.start,pt);Ke<=0||(_=Math.max(_,z.start+Ke),W.push({id:se.id,label:se.getAttribute("data-timeline-label")??se.getAttribute("data-label")??se.getAttribute("aria-label")??se.id,start:z.start,duration:Ke,track:rr(se,le),zIndex:Dl(se),stackingContextId:Yo(se),kind:"element",tagName:se.tagName.toLowerCase(),compositionId:se.getAttribute("data-composition-id"),compositionAncestors:X?[X]:[],parentCompositionId:X,nodePath:null,compositionSrc:null,playbackStart:St(se),playbackRate:Ve(se),assetUrl:null,timelineRole:se.getAttribute("data-timeline-role"),timelineLabel:se.getAttribute("data-timeline-label"),timelineGroup:se.getAttribute("data-timeline-group"),timelinePriority:ii(se.getAttribute("data-timeline-priority"))}),G.add(se.id))}}catch(P){H("runtime.timeline.site1",P)}}if(s&&R!=null&&R>0){let Y=W.length>0?Math.max(...W.map(P=>P.track))+1:0;for(let P of s.children){let K=P;if(!K.id||G.has(K.id))continue;let Q=K.getAttribute("data-timeline-role");if(Q!=="overlay"&&Q!=="persistent-overlay")continue;let le=K.tagName.toLowerCase();if(le==="script"||le==="style"||le==="link"||le==="meta"||window.getComputedStyle(K).display==="none")continue;let z=B(0,R);z<=0||(_=Math.max(_,z),W.push({id:K.id,label:K.getAttribute("data-timeline-label")??K.getAttribute("data-label")??K.getAttribute("aria-label")??K.id,start:0,duration:z,track:rr(K,Y),zIndex:Dl(K),stackingContextId:Yo(K),kind:"element",tagName:le,compositionId:K.getAttribute("data-composition-id"),compositionAncestors:X?[X]:[],parentCompositionId:X,nodePath:null,compositionSrc:null,playbackStart:St(K),playbackRate:Ve(K),assetUrl:null,timelineRole:Q,timelineLabel:K.getAttribute("data-timeline-label"),timelineGroup:K.getAttribute("data-timeline-group"),timelinePriority:ii(K.getAttribute("data-timeline-priority"))}),G.add(K.id))}}for(let Y of l){if(Y===s)continue;let P=Y.getAttribute("data-composition-id");if(!P||!Fl(P))continue;let K=r.resolveStartForElement(Y,0),Q=Il(Y);if((Q==null||Q<=0)&&Up(Y)!=null){let se=Up(Y);Q=Math.max(0,se-K)}let le=i(P),Z=Q&&Q>0?Q:le;if(Z==null||Z<=0)continue;let z=B(K,Z);z<=0||ne.push({id:P,label:Y.getAttribute("data-label")??Vp(Y)??P,start:K,duration:z,thumbnailUrl:oi(Y.getAttribute("data-thumbnail-url")),avatarName:null})}let j=Math.max(_||0,R??0),V=j>0?j:1,J=Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{...fo(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:V,durationInFrames:J,clips:W,scenes:ne,compositionWidth:nr(s?.getAttribute("data-width"))??1920,compositionHeight:nr(s?.getAttribute("data-height"))??1080}}var $p=e=>e!==null&&Number.isFinite(e)&&e>0;function ir(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if($p(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter($p);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:t}:{seconds:null,source:"unresolved",pendingClips:t,reason:t>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}var It=1/60,Zo=e=>e!==null&&e>It?e:null;function zp(e){return{width:nr(e.getAttribute("data-width")),height:nr(e.getAttribute("data-height"))}}function qp(e,t){let n=[];for(let r of e.querySelectorAll("video[data-start], audio[data-start]")){let i=t.mediaStart(r);if(!Number.isFinite(i))continue;let o=t.mediaDuration(r);o==null||o<=It||n.push(Math.max(0,i)+o)}return Zo(ir({authoredDurationSeconds:null,clipEndsSeconds:n}).seconds)}function jp(e,t){let n=[];for(let i of e.querySelectorAll("[data-composition-id][data-start]")){if(i.parentElement?.closest("[data-composition-id]")!==e)continue;let o=t.resolveStartForElement(i,0),a=t.resolveDurationForElement(i);!Number.isFinite(o)||a==null||a<=0||n.push(Math.max(0,o)+a)}let r=Ce(e.getAttribute("data-duration"));return Zo(ir({authoredDurationSeconds:null,clipEndsSeconds:[r,...n]}).seconds)}var MA=e=>e.hasAttribute("data-composition-id")||e.hasAttribute("data-composition-src");function Kp(e,t,{unregisteredLottie:n}){let r=[];for(let o of e.querySelectorAll("[data-start]")){let a=t.resolveStartForElement(o,0);if(!Number.isFinite(a))continue;let s=t.resolveDurationForElement(o);s!=null?r.push(Math.max(0,a)+s):(pe(o)||MA(o))&&r.push(null)}(n||e.querySelector("[data-lottie-src]"))&&r.push(null);let i=ir({authoredDurationSeconds:null,clipEndsSeconds:r});return i.pendingClips>0?{...i,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:i}function Xp(e){if(e.declared!==null&&Number.isFinite(e.declared)&&e.declared>0)return e.declared;let t=Zo(e.timeline()),n=Math.max(0,...e.floors().map(o=>o??0)),r=Number.isFinite(e.fallback)&&e.fallback>It?e.fallback:0,i;return t!==null?i=Math.max(t,n,r):Zo(n)!==null?i=Math.max(n,r):r>0?i=r:i=e.derived(),i>0?i:0}var Hl="data-composition-id",NA="data-composition-src",LA=`[${Hl}]`,_I=`[${NA}]`,Gl="style",Bl="script",Ul='link[rel="stylesheet"], link[rel="preconnect"]',Yp=`${Gl}, ${Bl}, ${Ul}`;function An(e){return e?Array.from(e):[]}function Jp(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=An(t.querySelectorAll(LA)),s=o?a.find(f=>f.getAttribute(Hl)===o)??null:a[0]??null,l=(s??a[0])?.getAttribute(Hl)?.trim()||"",u=i?null:n??null;return{innerRoot:s,authoredCompositionId:o||l||null,scriptCompositionId:l||o||null,authoredRootId:s?.getAttribute("id")?.trim()||null,styleSources:[...An(u?.querySelectorAll(Gl)),...An(t.querySelectorAll(Gl))],scriptSources:[...An(u?.querySelectorAll(Bl)),...An(t.querySelectorAll(Bl))],linkSources:[...An(n?.querySelectorAll(Ul)),...An(t.querySelectorAll(Ul))],variableDefaultCarriers:[r,s].filter(f=>f!=null)}}var FA='"use strict";(()=>{function I(e){return e?/[\\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function _(e){return e===" "||e===" "||e===`\n`||e==="\\r"||e==="\\f"}var j=/^[0-9a-fA-F]{1,6}/;function G(e){let n=e>=55296&&e<=57343;return e===0||e>1114111||n?65533:e}function $(e,n){return e[n]==="\\r"&&e[n+1]===`\n`?n+2:_(e[n])?n+1:n}function R(e,n){let t=e[n+1];if(t===void 0||/[\\n\\r\\f]/.test(t))return null;let i=j.exec(e.slice(n+1,n+7));if(!i)return{value:t,end:n+2};let o=G(Number.parseInt(i[0],16));return{value:String.fromCodePoint(o),end:$(e,n+1+i[0].length)}}function H(e,n){let t=o=>I(o)&&!/[0-9-]/.test(o),i=o=>e[o]==="\\\\"&&R(e,o)!==null;return e[n]==="-"?e[n+1]==="-"||t(e[n+1])||i(n+1):t(e[n])||i(n)}function y(e,n){let t=n;for(;e.startsWith("/*",t);){let i=e.indexOf("*/",t+2);t=i<0?e.length:i+2}return t}function A(e,n){let t=y(e,n);for(;_(e[t]);)t=y(e,t+1);return t}function h(e,n){if(!H(e,n))return null;let t=n,i="";for(;t<e.length;){let o=e[t];if(o==="\\\\"){let a=R(e,t);if(!a)break;i+=a.value,t=a.end;continue}if(!I(o))break;i+=o,t+=1}return t===n?null:{value:i,end:t}}var C=45;function T(e){return e>=48&&e<=57}function z(e){return e>=128||e===C||e===95||T(e)||e>=65&&e<=90||e>=97&&e<=122}function J(e,n){let t=e.charCodeAt(n);return t>=1&&t<=31||t===127?!0:T(t)?n===0||n===1&&e.charCodeAt(0)===C:!1}function k(e){let n="";for(let t=0;t<e.length;t+=1){let i=e.charCodeAt(t),o=e[t];i===0?n+="\\uFFFD":J(e,t)?n+=`\\\\${i.toString(16)} `:t===0&&e.length===1&&i===C?n+=`\\\\${o}`:z(i)?n+=o:n+=`\\\\${o}`}return n}var W=/\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:[0-9a-fA-F]{1,6}(?:\\r\\n|[ \\t\\r\\n\\f])?|[\\s\\S])|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|\\[(?:\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\[\\s\\S]|"(?:[^"\\\\]|\\\\[\\s\\S])*"|\'(?:[^\'\\\\]|\\\\[\\s\\S])*\'|[^\\]"\'\\\\/]|\\/(?!\\*))*\\]/g;function Q(e){let n=new Array(e.length).fill(!0);for(let t of e.matchAll(W)){let i=t.index;n.fill(!1,i,i+t[0].length)}return n}function q(e,n,t){if(n.length===0||!e.includes("#"))return e;let i=new Set(n),o=Q(e),a="",u=0;for(;u<e.length;){let d=o[u]&&e[u]==="#"?h(e,u+1):null;d&&i.has(d.value)?(a+=t(d.value),u=d.end):(a+=e[u],u+=1)}return a}function X(e){let n="";for(let t=0;t<e.length;t+=1){if(e[t]==="\\\\"){let i=e[t+1];if(i!==void 0&&/[\\n\\r\\f]/.test(i)){t=$(e,t+1)-1;continue}let o=R(e,t);if(o){n+=o.value,t=o.end-1;continue}}n+=e[t]}return n}function N(e){return Array.from(e,n=>{let t=n.charCodeAt(0);return t===0?"\\uFFFD":t<32||t===127?`\\\\${t.toString(16)} `:n===\'"\'||n==="\\\\"?`\\\\${n}`:n}).join("")}function Y(e,n){return e?{kind:"any"}:n===void 0?{kind:"none"}:{kind:"named",prefix:n}}function Z(e,n){return e[n]==="|"&&e[n+1]!=="="}function B(e,n){let t=e[n]==="*",i=t?{value:"*",end:n+1}:h(e,n),o=y(e,i?.end??n);if(!Z(e,o))return t?null:i?{token:i,namespace:{kind:"none"}}:null;let a=h(e,y(e,o+1));return a?{token:a,namespace:Y(t,i?.value)}:null}function K(e){if(e[0]!=="[")return null;let n=A(e,1),t=B(e,n);if(!t)return null;let{token:i,namespace:o}=t;return{name:i.value,rawName:e.slice(n,i.end),namespace:o,end:i.end}}function ee(e,n){let t=/^(?:"((?:\\\\[\\s\\S]|[^"\\\\])*)"|\'((?:\\\\[\\s\\S]|[^\'\\\\])*)\')/.exec(e.slice(n));return t?{value:X(t[1]??t[2]),end:n+t[0].length}:h(e,n)}function ne(e,n){let t=A(e,n),i=h(e,t);if(i){if(!/^[is]$/i.test(i.value))return null;t=A(e,i.end)}return e[t]!=="]"||t!==e.length-1?null:{flag:i?.value}}function F(e){let n=K(e);if(!n)return null;let t=A(e,n.end),o=["=","~=","|=","^=","$=","*="].find(d=>e.startsWith(d,t));if(!o)return null;let a=ee(e,A(e,t+o.length));if(!a)return null;let u=ne(e,a.end);return u?{name:n.name,rawName:n.rawName,namespace:n.namespace,operator:o,value:a.value,flag:u.flag}:null}function E(e,n){return e.replace(W,t=>t.startsWith("[")?n(t):t)}var re="data-hf-svg-reference-aliases";function O(e,n,t,i){let o={"=":(s,r)=>s===r,"~=":(s,r)=>s.split(/[ \\t\\r\\n\\f]+/).includes(r),"|=":(s,r)=>s===r||s.startsWith(r+"-"),"^=":(s,r)=>s.startsWith(r),"$=":(s,r)=>s.endsWith(r),"*=":(s,r)=>s.includes(r)},a=(s,r,l)=>!r&&l!=="="&&l!=="|="?!1:o[l](s,r),u=s=>s.replace(/[A-Z]/g,r=>r.toLowerCase()),d=s=>{let r=F(s);if(!r)return s;let{name:l,rawName:g,namespace:m,operator:b,value:D,flag:w}=r;if(m.kind==="named"!=(i!==void 0))return s;let x=w?.toLowerCase()==="i"?u:S=>S,L=u(l),P=t.filter(S=>{let V=m.kind==="none"?S.name:S.localName,U=m.kind==="named"?i.get(m.prefix):null;return(m.kind==="any"||S.namespaceURI===U)&&u(V)===L}),v=new Set([s]);for(let S of P)a(x(S.before),x(D),b)&&v.add(`[${g}="${N(S.after)}"${w?` ${w}`:""}]`);return v.size===1?s:`:is(${[...v].join(", ")})`};if(i)return E(e,d);let p=new Map(n.map(({id:s,replacement:r})=>[s,r])),f=new Map;for(let s of t){if(s.name!=="id"||s.before===s.after||p.has(s.before))continue;let r=f.get(s.before);r||(r=new Set([`#${k(s.before)}`]),f.set(s.before,r)),r.add(`#${k(s.after)}`)}for(let[s,r]of f)p.set(s,`:is(${[...r].join(", ")})`);let c=q(e,[...p.keys()],s=>p.get(s));return E(c,d)}function se(e,n,t=!0){let i=[],a=(t?[...e.querySelectorAll(`[${n}]`)]:[]).map(d=>d.getAttribute(n)),u=e.getAttribute?.(n);u&&a.unshift(u);for(let d of a){let p;try{p=JSON.parse(d)}catch{continue}if(!Array.isArray(p))continue;let f=p;for(let c of f){if(!ie(c))continue;let{name:s,localName:r,namespaceURI:l,before:g,after:m}=c;i.push({name:s,localName:r,namespaceURI:l,before:g,after:m})}}return i}function ie(e){if(!e||typeof e!="object")return!1;let{name:n,localName:t,namespaceURI:i,before:o,after:a}=e;return typeof n=="string"&&typeof t=="string"&&(i===null||typeof i=="string")&&typeof o=="string"&&typeof a=="string"}function oe(e){let n=[],t=[],i=!1,o,a=new WeakMap,u=(f,c)=>{for(let s of f){if("selectorText"in s){let r=s,l=a.get(r),g=r.selectorText,m=l?.applied===g?l.authored:g,b=O(m,[],t,c);b!==g&&(r.selectorText=b),b===m?a.delete(r):a.set(r,{authored:m,applied:r.selectorText})}"cssRules"in s&&u(s.cssRules,c)}},d=()=>{if(t.length)for(let f of e.document.styleSheets){let c;try{c=f.cssRules}catch{continue}let s=new Map;for(let r of c){if(!("namespaceURI"in r))continue;let{prefix:l,namespaceURI:g}=r;l&&s.set(l,g||null)}s.size&&u(c,s)}},p={rewrite:(f,c=[])=>{if(typeof f!="string"||!f.includes("#")&&!f.includes("["))return f;let s=O(f,c.length?[...c,...n]:n,t);if(s!==f){if(!o){let r=e.document.createElement("div");o=r.matches.bind(r)}o(f)}return s},refresh(){t=se(e.document,re).filter(r=>r.before!==r.after);let f=new Set(t.filter(r=>r.name==="id").map(r=>r.before)),c=new Set;n=[];for(let r of e.document.querySelectorAll("[data-hf-authored-id][id]")){let l=r.getAttribute("data-hf-authored-id");if(!l||l===r.id||c.has(l)||f.has(l))continue;c.add(l);let g=N(l);n.push({id:l,replacement:`:is(#${k(l)}, [data-hf-authored-id="${g}"])`})}if(d(),i||!n.length&&!t.length)return;let s=e.Element.prototype;s.querySelector=new Proxy(s.querySelector,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),s.querySelectorAll=new Proxy(s.querySelectorAll,{apply(r,l,g){return Reflect.apply(r,l,[p.rewrite(g[0])])}}),i=!0}};e.__hfSvgSelectorAliases=p,p.refresh()}function M(){let e=window;e.__hfSvgSelectorAliases||oe(e)}M();})();\n';function Qp(){return FA}var _e=yS(Rg(),1),ga=_e.default,hD=_e.default.stringify,gD=_e.default.fromJSON,bD=_e.default.plugin,xD=_e.default.parse,yD=_e.default.list,SD=_e.default.document,vD=_e.default.comment,ED=_e.default.atRule,AD=_e.default.rule,wD=_e.default.decl,_D=_e.default.root,CD=_e.default.CssSyntaxError,RD=_e.default.Declaration,TD=_e.default.Container,kD=_e.default.Processor,MD=_e.default.Document,ND=_e.default.Comment,LD=_e.default.Warning,FD=_e.default.AtRule,ID=_e.default.Result,DD=_e.default.Input,PD=_e.default.Rule,OD=_e.default.Root,HD=_e.default.Node;var fu="data-hf-scene",wi="hf-scene-parts",mu="data-hf-scene-no-swap";var pu="data-hf-authored-id",Tg="data-hf-inner-root";function hu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gu(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function f_(e){let t=e.trim();return t?Array.from(new Set([t,kt(t)])).filter(Boolean):[]}function m_(e,t,n){let r=f_(t);return uo(e,r,()=>n)}function p_(e,t){let n=t?.trim();return n?m_(e,n,`[${pu}="${gu(n)}"]`):e}function kg(e){return`${e}:not(:has([${Tg}])), ${e} > [${Tg}]`}function h_(e,t,n,r,i,o){let a=p_(e,r),s=g_(a,t,n),l=s.trim();if(!l||l==="*")return e;if(/^(html|body|:root)$/i.test(l))return o?kg(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*[\\^\\*\\$]?=\\s*(["'])${hu(n)}\\1\\s*\\]`,"g");if(u.test(l))return l.replace(u,"").trim()===""?kg(t):s.replace(u,t);let f=s.match(/^\s*/)?.[0]??"",d=s.match(/\s*$/)?.[0]??"";if(i){let m=r?`[${pu}="${gu(r)}"]`:null;if(m&&l.startsWith(m)){let g=l.slice(m.length);return`${f}${t}${m}${g}${d}`}}return`${f}${t} ${l}${d}`}function g_(e,t,n){let r=hu(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var b_=new Set(["keyframes","-webkit-keyframes","font-face"]);function x_(e){return e?.type==="atrule"}function y_(e){let t=e.parent;for(;t;){if(x_(t)&&b_.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function S_(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function Mg(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${gu(o)}"]`,s;try{s=ga.parse(e)}catch{return""}return s.walkRules(l=>{y_(l)||S_(l)||(l.selectors=l.selectors.map(u=>h_(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),s.toResult({map:!1}).css}function et(e){return JSON.stringify(e).replace(/</g,"\\u003c")}var Ng=`!__hfBaseHyperframes
|
|
43
43
|
? __hfBaseHyperframes
|
|
44
44
|
: Object.assign({}, __hfBaseHyperframes, {
|
|
45
45
|
assetUrl: function(path) {
|
|
@@ -352,7 +352,7 @@ ${e.replace(/<\/(script)/gi,"<\\/$1")}
|
|
|
352
352
|
`),G1=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform vec2 u_resolution;","uniform vec2 u_direction;","uniform float u_radius;","uniform float u_bloomPass;","uniform float u_threshold;","vec4 readSource(vec2 uv){"," vec4 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0)));"," if (u_bloomPass > 0.5) {"," float luminance = dot(color.rgb, vec3(0.299, 0.587, 0.114));"," if (u_threshold >= 0.0 && luminance <= u_threshold) color.rgb = vec3(0.0);"," return vec4(color.rgb, 1.0);"," }"," color.rgb *= color.a;"," return color;","}","void main(){"," if (u_bloomPass > 0.5) {"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) * 0.5;"," vec4 bloom = readSource(v_uv) * 0.227027;"," bloom += readSource(v_uv + stepUv) * 0.1945946;"," bloom += readSource(v_uv - stepUv) * 0.1945946;"," bloom += readSource(v_uv + stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv - stepUv * 2.0) * 0.1216216;"," bloom += readSource(v_uv + stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv - stepUv * 3.0) * 0.054054;"," bloom += readSource(v_uv + stepUv * 4.0) * 0.016216;"," bloom += readSource(v_uv - stepUv * 4.0) * 0.016216;"," gl_FragColor = bloom;"," return;"," }"," vec2 stepUv = u_direction * max(u_radius, 0.0) / max(u_resolution, vec2(1.0)) / 12.0;"," vec4 color = readSource(v_uv) * 0.08077993;"," color += readSource(v_uv + stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv - stepUv * 1.0) * 0.07918038;"," color += readSource(v_uv + stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv - stepUv * 2.0) * 0.07456928;"," color += readSource(v_uv + stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv - stepUv * 3.0) * 0.06747307;"," color += readSource(v_uv + stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv - stepUv * 4.0) * 0.05865827;"," color += readSource(v_uv + stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv - stepUv * 5.0) * 0.04899551;"," color += readSource(v_uv + stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv - stepUv * 6.0) * 0.03931982;"," color += readSource(v_uv + stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv - stepUv * 7.0) * 0.03031761;"," color += readSource(v_uv + stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv - stepUv * 8.0) * 0.02245983;"," color += readSource(v_uv + stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv - stepUv * 9.0) * 0.01598624;"," color += readSource(v_uv + stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv - stepUv * 10.0) * 0.01093238;"," color += readSource(v_uv + stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv - stepUv * 11.0) * 0.00718308;"," color += readSource(v_uv + stepUv * 12.0) * 0.00453456;"," color += readSource(v_uv - stepUv * 12.0) * 0.00453456;"," if (color.a > 0.0001) color.rgb /= color.a;"," gl_FragColor = color;","}"].join(`
|
|
353
353
|
`),B1=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_source;","uniform sampler2D u_blurSource;","uniform vec2 u_texel;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_blur;","uniform float u_kuwaharaRadius;","vec3 readPrepared(vec2 displayUv){"," vec2 uv = (displayUv - u_uvOffset) / u_uvScale;"," vec3 color = texture2D(u_source, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," if (u_blurReady > 0.5 && u_blur > 0.0) {"," vec3 blurred = texture2D(u_blurSource, clamp(uv, vec2(0.0), vec2(1.0))).rgb;"," color = mix(color, blurred, clamp(u_blur, 0.0, 1.0));"," }"," return color;","}","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec3 sum = vec3(0.0);"," float sumSquares = 0.0;"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec3 color = readPrepared(v_uv + vec2(float(offset), 0.0) * u_texel);"," sum += color;"," sumSquares += dot(color, color) / 3.0;"," count += 1.0;"," }"," gl_FragColor = vec4(sum / count, sumSquares / count);","}"].join(`
|
|
354
354
|
`),U1=["#ifdef GL_FRAGMENT_PRECISION_HIGH","precision highp float;","#else","precision mediump float;","#endif","varying vec2 v_uv;","uniform sampler2D u_kuwaharaMoments;","uniform vec2 u_texel;","uniform float u_kuwaharaRadius;","uniform float u_kuwaharaSharpness;","uniform float u_kuwaharaSaturation;","void main(){"," float radius = floor(mix(2.0, 16.0, clamp(u_kuwaharaRadius, 0.0, 1.0)) + 0.5);"," vec2 origins[4];"," origins[0] = vec2(-radius, -radius);"," origins[1] = vec2(0.0, -radius);"," origins[2] = vec2(-radius, 0.0);"," origins[3] = vec2(0.0, 0.0);"," vec3 means[4];"," float variances[4];"," float minVariance = 1.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," vec4 moment = vec4(0.0);"," float count = 0.0;"," for (int offset = 0; offset <= 16; offset++) {"," if (float(offset) > radius) continue;"," vec2 sampleOffset = origins[quadrant] + vec2(0.0, float(offset));"," moment += texture2D(u_kuwaharaMoments, clamp(v_uv + sampleOffset * u_texel, vec2(0.0), vec2(1.0)));"," count += 1.0;"," }"," moment /= count;"," vec3 mean = moment.rgb;"," float meanSquare = moment.a * 3.0;"," float variance = max(meanSquare - dot(mean, mean), 0.0);"," means[quadrant] = mean;"," variances[quadrant] = variance;"," minVariance = min(minVariance, variance);"," }"," float exponent = 1.0 + clamp(u_kuwaharaSharpness, 0.0, 1.0) * 8.0;"," vec3 result = vec3(0.0);"," float totalWeight = 0.0;"," for (int quadrant = 0; quadrant < 4; quadrant++) {"," float weight = pow((minVariance + 0.0001) / (variances[quadrant] + 0.0001), exponent);"," result += means[quadrant] * weight;"," totalWeight += weight;"," }"," result /= max(totalWeight, 0.0001);"," float luma = dot(result, vec3(0.2126, 0.7152, 0.0722));"," float saturation = clamp(u_kuwaharaSaturation, 0.0, 1.0) * 2.0;"," gl_FragColor = vec4(clamp(mix(vec3(luma), result, saturation), 0.0, 1.0), 1.0);","}"].join(`
|
|
355
|
-
`);function nn(e){return ye(e)||Ie(e)}function E0(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function A0(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(H("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Ma(e,t=H1){let n=A0(e,O1,e.VERTEX_SHADER),r=A0(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(H("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function Ca(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function W1(e,t){let n=Ma(e,G1);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function V1(e,t){let n=Ma(e,B1);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function $1(e,t){let n=Ma(e,U1);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function ki(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Ca(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function Ta(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Hu(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function w0(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Wu(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Ma(t),r=Ca(t),i=Ca(t,t.NEAREST),o=Ca(t,t.NEAREST);if(!n||!r||!i||!o)return w0(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Hu(t,n,zo),detailUniforms:Hu(t,n,El),effectUniforms:Hu(t,n,Al),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(w0(t,n,[r,i,o]),null)}function z1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function q1(e){if(!z1(e))return{...fr};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,fr.position,0,1),softness:t(e.softness,fr.softness,0,.25),lineWidth:t(e.lineWidth,fr.lineWidth,0,12)}}function L0(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function Na(e){return e instanceof Error?e.message:"LUT failed to load"}function j1(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function F0(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return j1(t)}function Vu(e){let t=L0(e);if("error"in t)return{state:"error",message:t.error};let n=Pt.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>ip(o,{maxSize:Wo})),i={state:"pending",promise:r};for(;Pt.size>=M1;){let o=Pt.keys().next().value;if(!o)break;Pt.delete(o)}return Pt.set(t.href,i),r.then(o=>{Pt.get(t.href)===i&&Pt.set(t.href,{state:"ready",lut:o})},o=>{Pt.get(t.href)===i&&Pt.set(t.href,{state:"error",message:Na(o)})}),i}function _0(e,t,n){if(e.lut?.src===t)return e.lut;let r=ml(n),{gl:i,program:o}=e;try{return I0(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Na(a),e.lutLoadingSrc=null,H("runtime.colorGrading.uploadLut",a),null}}async function K1(e){let t=Vu(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function I0(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function X1(e,t,n){let r=ml(n),{gl:i,program:o}=e;return I0(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Ct(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function $u(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Ct(e.gl,t.scratch),Ct(e.gl,t.blur),t.bloom&&Ct(e.gl,t.bloom),e.effectTargets=null)}function zu(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Ct(e.gl,t.moments),Ct(e.gl,t.output),e.kuwaharaTargets=null)}function Ra(e,t=!1){$u(e),zu(e),Y1(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function Y1(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function J1(e){let t=Wu(e.canvas);return t?(Ra(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Uu(e){if(!e.sourceHidden)return;e.element.removeAttribute(Sn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Q1(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=W1(t,e.program.quad),r=ki(t),i=ki(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Ct(t,r),i&&Ct(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Z1(e,t){return t.bloom||(t.bloom=ki(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function C0(e){let t=e.effectTargets;t?.bloom&&(Ct(e.gl,t.bloom),t.bloom=null)}function eC(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=V1(t,e.program.quad),o=$1(t,e.program.quad),a=ki(t,n.HALF_FLOAT_OES,t.NEAREST),s=ki(t);return!i||!o||!a||!s?(tC(t,i,o,a,s),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:s},e.kuwaharaTargets)}function tC(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Ct(e,r),i&&Ct(e,i)}function D0(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return Ta(e,t,o,a),Ta(e,n,o,a),{width:o,height:a}}function ka(e,t,n,r,i,o,a,s=!1,l=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,s?1:0),e.uniform1f(t.threshold,l),Mi(e,t)}function nC(e,t,n,r,i,o,a){let s=D0(e,t.scratch,r,i/2,o/2),l=a/2;ka(e,t.blurProgram,n,t.scratch,s,{x:1,y:0},l,!0,.5),ka(e,t.blurProgram,t.scratch.texture,r,s,{x:0,y:1},l,!0)}function rC(e,t,n,r,i,o,a){let s=n;for(let l=0;l<Math.max(1,Math.floor(a));l++)ka(e,t.blurProgram,s,t.scratch,i,{x:1,y:0},o),ka(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),s=r.texture}function Mi(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function iC(e,t,n,r,i,o,a,s){Ta(e,t.moments,i.width,i.height),Ta(e,t.output,i.width,i.height);let l=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(l.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(l.source,0),e.uniform1i(l.blurSource,1),e.uniform2f(l.texel,1/i.width,1/i.height),e.uniform2f(l.uvScale,o.scaleX,o.scaleY),e.uniform2f(l.uvOffset,o.offsetX,o.offsetY),e.uniform1f(l.blurReady,a?1:0),e.uniform1f(l.blur,s.blur),e.uniform1f(l.radius,s.kuwaharaRadius),Mi(e,l);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,s.kuwaharaRadius),e.uniform1f(u.sharpness,s.kuwaharaSharpness),e.uniform1f(u.saturation,s.kuwaharaSaturation),Mi(e,u)}function oC(e,t,n,r){if(n<=0)return!1;let i=D0(e.gl,t.scratch,t.blur,r.width,r.height);return rC(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function aC(e,t,n,r,i,o){if(n<=0)return C0(e),null;o||C0(e);let a=o?Z1(e,t):t.blur;return a?(nC(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function sC(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&$u(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=Q1(e);if(!s)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=oC(e,s,o,n),u=aC(e,s,a,t.effects.bloomRadius,n,l);return{blurReady:l,bloomReady:u!==null,blurTexture:s.blur.texture,bloomTexture:u??i.texture}}function lC(e,t,n,r,i,o,a){let s=t.effects.kuwahara;if(s<=0&&!o)return e.kuwaharaTargets&&a&&zu(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let l=eC(e);return!l||s<=0?{kuwaharaReady:!1,kuwaharaTexture:l?.output.texture??e.program.texture}:(iC(e.gl,l,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:l.output.texture})}function P0(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=sC(e,t,n,o),s=lC(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...s}}function uC(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=L0(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Vu(t);return i.state==="ready"?_0(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(_0(e,r.href,o),tt(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Na(o),e.lutLoadingSrc=null,tt(e))})),null)}function Ri(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&nn(n))return n;try{let r=document.querySelector(t);return r&&nn(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&nn(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&nn(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&nn(r)?r:null}catch{return null}}function O0(e){return ye(e)?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:Ie(e)&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function H0(e){return ye(e)?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:Ie(e)?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function G0(e){let t=Ft(e);return t&&H0(t)?t:null}function R0(e){if(!ye(e))return!1;let t=G0(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function cC(e){return Ie(e)&&e.classList.contains("__render_frame__")}function dC(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function B0(e){if(ye(e)){let t=G0(e);if(t)return t}return H0(e)?e:null}function T0(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function fC(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=T0(o,"x"),s=T0(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(s!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=s;continue}}return{x:n,y:r}}function U0(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",s=e,l=t;if(a==="contain"||a==="cover"||a==="scale-down"){let m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);s=n*m,l=r*m,a==="scale-down"&&s>n&&l>r&&(s=n,l=r)}else a==="none"&&(s=n,l=r);let u=fC(o||"center"),f=(e-s)*u.x/e,d=(t-l)*u.y/t;return{scaleX:s/e,scaleY:l/t,offsetX:f,offsetY:d}}function mC(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function k0(e,t){return Math.max(0,Math.round(e>0?e:t))}function pC(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&mC(e,i);let o=window.getComputedStyle(t);cm(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),s=k0(n.offsetWidth,a.width),l=k0(n.offsetHeight,a.height);if(s<=0||l<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),f=Math.round(s*u),d=Math.round(l*u);return r.width!==f&&(r.width=f),r.height!==d&&(r.height=d),{width:f,height:d}}function dr(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function Rn(e,t,n,r){e.set(r,(t*vt+n)*4)}function rn(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Gu(e,t,n){return e.length>=3?hl(e,t,n):new Float32Array(vt)}function Cn(e,t){return e[t]??0}function hC(e,t,n){let r=Zn(t.red),i=Zn(t.green),o=Zn(t.blue),a=Zn(t.master),s=Gu(n.hueVsHue,-180,180),l=Gu(n.hueVsSaturation,-1,1),u=Gu(n.hueVsLuma,-1,1);for(let f=0;f<vt;f+=1)Rn(e,0,f,[Cn(r,f),Cn(i,f),Cn(o,f),Cn(a,f)]),Rn(e,1,f,[rn(Cn(s,f),180),rn(Cn(l,f),1),rn(Cn(u,f),1),1])}function gC(e,t,n){let r=n*I1;Rn(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Rn(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Rn(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Rn(e,2,r+3,[rn(t.correction.hueShift,180),rn(t.correction.saturation,1),rn(t.correction.luma,1),rn(t.correction.temperature,1)]),Rn(e,2,r+4,[rn(t.correction.tint,1),.5,.5,1])}function bC(e,t,n){let r=new Float32Array(vt*Li*4);hC(r,e,t);let i=0;for(let o of n)o.enabled&&(gC(r,o,i),i+=1);return r}var M0=new WeakMap;function xC(e,t,n){let r=M0.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return M0.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function yC(e,t,n,r){let{curves:i,hueCurves:o}=n,a=xC(i,o,r);if(t.advancedSignature===a)return;let s=Uint8Array.from(bC(i,o,r),Qr);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,vt,Li,0,e.RGBA,e.UNSIGNED_BYTE,s),t.advancedSignature=a}function Bu(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function W0(e,t,n,r,i,o,a,s,l,u,f,d){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,l.width,l.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:m,hueCurves:g,secondaries:h}=n,b=Cl(m),x=Rl(g),v=Tl(h)?h.reduce((k,O)=>k+Number(O.enabled),0):0;(b||x||v>0)&&yC(e,t,n,h),Bu(e,t.shadowWheel,n.wheels.shadows),Bu(e,t.midtoneWheel,n.wheels.midtones),Bu(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,b?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,v);for(let[k,O]of t.adjustUniforms)e.uniform1f(O,n.adjust[k]);for(let[k,O]of t.detailUniforms)e.uniform1f(O,n.details[k]);e.uniform1f(t.grainSeed,f),e.uniform1f(t.effectTime,d);for(let[k,O]of t.effectUniforms)e.uniform1f(O,n.effects[k]);let A=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?L1:Pu),E=A[A.length-1]??Pu[1];e.uniform1f(t.paletteSize,A.length),dr(e,t.palette0,A[0]??Pu[0]),dr(e,t.palette1,A[1]??E),dr(e,t.palette2,A[2]??E),dr(e,t.palette3,A[3]??E),dr(e,t.palette4,A[4]??E),dr(e,t.palette5,A[5]??E),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,s.enabled?1:0),e.uniform1f(t.comparePosition,s.position),e.uniform1f(t.compareSoftness,s.softness),e.uniform1f(t.compareLineWidth,s.lineWidth)}function SC(e){if(!e.sourceHidden){let t=e.element.getAttribute(vn);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Sn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function Ot(e){let t=wp.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var V0=Ot("intensity"),$0=Ot("lut.intensity"),z0=Ot("adjust.exposure"),q0=Ot("effects.kuwahara"),j0=[["blur",Ot("effects.blur")],["bloom",Ot("effects.bloom")],["kuwahara",q0],["pixelate",Ot("effects.pixelate")],["ascii",Ot("effects.ascii")],["dither",Ot("effects.dither")]],K0=[V0,$0,z0,...j0.map(([,e])=>e)];function Tn(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Ti(e,t){return t!==null&&(Tp(t)||K0.some(n=>Tn(e,n)!==null))}function vC(e,t){let n=null;for(let[r,i]of j0){let o=Tn(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function EC(e){let{element:t,grading:n}=e,r=Tn(t,V0),i=Tn(t,$0),o=Tn(t,z0),a=vC(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let l={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(l.intensity=r),n.lut&&i!==null&&(l.lut={...n.lut,intensity:i}),l}function X0(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Y0(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function tt(e){if(e.destroyed||e.contextLost)return!1;let t=B0(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=O0(t);if(!n)return!1;let r=xe(t)?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",s=e.element.style.getPropertyValue("visibility"),l=cC(t);l&&dC(e,t),a&&!l&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(l?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!l&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(l||s!=="hidden")&&u.visibility!=="hidden";let f=pC(e,r);if(!f)return!1;let d=window.getComputedStyle(r),m=U0(f.width,f.height,n.width,n.height,d.objectFit,d.objectPosition),{gl:g,program:h}=e;try{let b=EC(e),x=uC(e);X0(g,h.texture,t);let v=Tn(e.element,q0)!==null,A=P0(e,b,f,m,{preserveKuwahara:v});g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,f.width,f.height),g.useProgram(h.program),Y0(g,h,A);let E=window.__player?.getTime?.(),k=typeof E=="number"&&Number.isFinite(E)?Math.max(0,E):ye(e.element)?Math.max(0,e.element.currentTime):0,O=e.grainSeed+Math.floor(k*60);return W0(g,h,b,x,A.blurReady,A.bloomReady,A.kuwaharaReady,e.compare,f,m,O,k),Mi(g,h),SC(e),e.hasDrawn=!0,e.drawError=null,!0}catch(b){return e.drawError=b instanceof Error?b.message:"Shader draw failed",H("runtime.colorGrading.drawEntry",b),!1}}function AC(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),s=i>0&&o>0?i/o:t.width/t.height;return s>=1?{width:a,height:Math.max(1,Math.round(a/s))}:{width:Math.max(1,Math.round(a*s)),height:a}}function wC(){let e=document.createElement("canvas"),t=Wu(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function _C(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):ye(e)?Math.max(0,e.currentTime):0}function CC(e,t,n,r){let i=B0(t);if(!i)return null;let o=O0(i);if(!o)return null;let a=AC(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let s=xe(i)?i:t,l=window.getComputedStyle(s),u=U0(a.width,a.height,o.width,o.height,l.objectFit,l.objectPosition);return X0(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:_C(t,r),grainSeed:F0(t)+(ye(t)?Math.floor(t.currentTime*60):0)}}async function RC(e,t,n,r,i=!1){let o=CC(e,t,r,i);if(!o)return null;let{dimensions:a,uv:s,grainSeed:l,effectTime:u}=o,f=[];for(let d of n.slice(0,32)){let m=qo(d.grading);if(!m){f.push({id:d.id,dataUrl:null,error:"Invalid grading"});continue}let g=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=X1(e,m.lut.src,await K1(m.lut.src))),g=e.lut),f.push({id:d.id,dataUrl:TC(e,m,g,a,s,l,u)})}catch(h){f.push({id:d.id,dataUrl:null,error:Na(h)})}}return{...a,images:f}}function TC(e,t,n,r,i,o,a){let{canvas:s,gl:l,program:u}=e,f=P0(e,t,r,i,{releaseIdleTargets:!1});return l.bindFramebuffer(l.FRAMEBUFFER,null),l.viewport(0,0,r.width,r.height),l.useProgram(u.program),Y0(l,u,f),n||(e.lut=null),W0(l,u,t,n,f.blurReady,f.bloomReady,f.kuwaharaReady,fr,r,i,o,a),Mi(l,u),s.toDataURL("image/png")}function _t(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function kC(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&ye(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Ni(e){if(e.destroyed||!ye(e.element)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,tt(e),!e.destroyed&&!t.paused&&!t.ended&&Ni(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,tt(e),!e.destroyed&&!t.paused&&!t.ended&&Ni(e)})}function MC(e){let t=()=>{tt(e)};if(_t(e,e.element,"load",t),_t(e,e.element,"loadedmetadata",t),_t(e,e.element,"loadeddata",t),_t(e,e.element,"seeked",t),_t(e,e.element,"timeupdate",t),_t(e,window,"resize",t),ye(e.element)&&(_t(e,e.element,"play",()=>Ni(e)),_t(e,e.element,"pause",t)),_t(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Uu(e)}),_t(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!J1(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Uu(e);return}e.drawError=null,tt(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),tt(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function NC(e){if(e.destroyed)return null;e.destroyed=!0,kC(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),$u(e),zu(e),Uu(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function J0(e,t){return e.removeAttribute("style"),t.id?e.id=`${yp}${t.id}`:e.removeAttribute("id"),e.className=k1,e.setAttribute(T1,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function LC(e){return J0(document.createElement("canvas"),e)}function Q0(e){let t=new WeakMap,n=new Set,r=[],i=null,o=null,a=Promise.resolve(),s=!1,l=(R,M,T)=>{let B=t.get(R);if(B)return B.grading=M,B.source=T,tt(B),ye(R)&&!R.paused&&Ni(B),!0;let W=r.pop();if(W)J0(W.canvas,R);else{let N=LC(R),_=Wu(N);if(!_)return N.remove(),!1;W={canvas:N,gl:_.gl,program:_.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let ne={element:R,...W,grading:M,compare:{...fr},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:T,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(R).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(R).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:F0(R),destroyed:!1};return t.set(R,ne),n.add(R),MC(ne),tt(ne),ye(R)&&!R.paused&&Ni(ne),!0},u=(R,M)=>{if(s)return!1;let T=Ri(R);if(!T)return!1;let B=t.get(T);if(!B){let W=_a(T);if(!Ti(T,W)||!l(T,W,"attribute"))return!1;B=t.get(T)}return B?(B.compare=q1(M),tt(B),!0):!1},f=R=>{let M=t.get(R);if(!M)return;let T=NC(M);T&&(M.contextLost||r.length>=N1?Ra(T,!0):r.push(T)),t.delete(R),n.delete(R)},d=()=>{if(s)return 0;let R=new Set;document.querySelectorAll(`video[${ei}], img[${ei}]`).forEach(T=>{if(!nn(T))return;R.add(T);let B=_a(T);Ti(T,B)&&(E0(T)||R0(T))?l(T,B,"attribute"):f(T)});for(let T of n){let B=t.get(T);B&&(!T.isConnected||B.source==="attribute"&&!R.has(T))&&f(T)}return n.size},m=()=>{if(s)return 0;let R=0;for(let M of n){let T=t.get(M);T&&tt(T)&&(R+=1)}return R},g=async()=>{let R=new Set;for(let M of n){let T=t.get(M)?.grading.lut;if(!T?.src.trim()||(T.intensity??1)<=0)continue;let B=Vu(T.src);B.state==="pending"&&R.add(B.promise)}return R.size>0&&await Promise.allSettled(R),m(),R.size},h=()=>{if(s)return 0;let R=0;for(let M of n){let T=t.get(M);!T||!K0.some(W=>Tn(M,W)!==null)||ye(M)&&!M.paused&&!M.ended||tt(T)&&(R+=1)}return R},b=(R,M)=>{if(s)return!1;let T=Ri(R);if(!T)return!1;let B=qo(M);return Ti(T,B)?l(T,B,"live"):(f(T),!0)},x=(R,M)=>{if(!nn(R))return!1;let T=t.get(R);if(!T){if(!M)return!1;let B=_a(R);return Ti(R,B)&&l(R,B,"attribute")}return T.sourceVisibleForCanvas=M,!M&&T.source==="attribute"&&f(R),!0},v=R=>nn(R)&&t.has(R),A=R=>{let M=Ri(R);if(!M)return{state:"missing",message:"Media not found"};let T=t.get(M);if(T)return T.effectError?{state:"unavailable",message:T.effectError}:T.drawError?{state:"unavailable",message:T.drawError}:T.lutError?{state:"unavailable",message:`LUT error: ${T.lutError}`}:T.grading.lut&&T.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:T.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:T.lut?"Shader + LUT active":"Shader active"};let B=_a(M);return Ti(M,B)?!E0(M)&&!R0(M)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},E=async(R,M,T)=>{let B=async()=>{if(s||M.length===0)return null;let ne=Ri(R);return!ne||(o??(o=wC()),!o)?null:RC(o,ne,M,T?.maxDimension,T?.useMediaTime)},W=a.then(B,B);return a=W.then(()=>{},()=>{}),W},k=R=>{let M=Ri(R);if(!ye(M))return null;if(!M.paused)return()=>{};let T=M.currentTime,B=M.loop,W=M.muted;return M.loop=!0,M.muted=!0,(M.ended||Number.isFinite(M.duration)&&T>=M.duration)&&(M.currentTime=0),e?.lease(M),M.play().catch(()=>{}),()=>{e?.release(M),M.pause(),M.loop=B,M.muted=W,M.currentTime=T}},O=()=>{if(!s){s=!0,i?.disconnect(),i=null;for(let R of n)f(R);for(let R of r)Ra(R,!0);r.length=0,o&&(Ra(o,!0),o=null)}};document.body&&(i=new MutationObserver(()=>d()),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ei]}));let F={refresh:d,redraw:m,redrawAnimated:h,waitForActiveLuts:g,setGrading:b,setCompare:u,setSourceVisibility:x,isGraded:v,getStatus:A,renderPreviews:E,startPreviewPlayback:k,destroy:O},D=window;return D.__hf=D.__hf||{},D.__hf.colorGrading=F,d(),F}var FC={mulX:374761393,mulY:668265263,mulMix:1274126177,offset:2654435769,shift1:13,shift2:16,divisor:4294967296},{mulX:IC,mulY:DC,mulMix:Z0,offset:PC,shift1:OC,shift2:HC,divisor:GC}=FC,BC=20,eb=`#version 300 es
|
|
355
|
+
`);function nn(e){return ye(e)||Ie(e)}function E0(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function A0(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(H("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Ma(e,t=H1){let n=A0(e,O1,e.VERTEX_SHADER),r=A0(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(H("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function Ca(e,t=e.LINEAR,n=e.UNSIGNED_BYTE){let r=e.createTexture();return r?(e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,n,null),r):null}function W1(e,t){let n=Ma(e,G1);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),resolution:e.getUniformLocation(n,"u_resolution"),direction:e.getUniformLocation(n,"u_direction"),radius:e.getUniformLocation(n,"u_radius"),bloomPass:e.getUniformLocation(n,"u_bloomPass"),threshold:e.getUniformLocation(n,"u_threshold")}:null}function V1(e,t){let n=Ma(e,B1);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),texel:e.getUniformLocation(n,"u_texel"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),blur:e.getUniformLocation(n,"u_blur"),radius:e.getUniformLocation(n,"u_kuwaharaRadius")}:null}function $1(e,t){let n=Ma(e,U1);return n?{program:n,quad:t,position:e.getAttribLocation(n,"a_pos"),moments:e.getUniformLocation(n,"u_kuwaharaMoments"),texel:e.getUniformLocation(n,"u_texel"),radius:e.getUniformLocation(n,"u_kuwaharaRadius"),sharpness:e.getUniformLocation(n,"u_kuwaharaSharpness"),saturation:e.getUniformLocation(n,"u_kuwaharaSaturation")}:null}function ki(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Ca(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function Ta(e,t,n,r){t.width===n&&t.height===r||(t.width=n,t.height=r,e.bindTexture(e.TEXTURE_2D,t.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,r,0,e.RGBA,t.type,null))}function Hu(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function w0(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Wu(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Ma(t),r=Ca(t),i=Ca(t,t.NEAREST),o=Ca(t,t.NEAREST);if(!n||!r||!i||!o)return w0(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Hu(t,n,zo),detailUniforms:Hu(t,n,El),effectUniforms:Hu(t,n,Al),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(w0(t,n,[r,i,o]),null)}function z1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function q1(e){if(!z1(e))return{...fr};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,fr.position,0,1),softness:t(e.softness,fr.softness,0,.25),lineWidth:t(e.lineWidth,fr.lineWidth,0,12)}}function L0(e){try{let t=new URL(e,document.baseURI);return t.protocol==="data:"?{href:t.href}:t.protocol!=="http:"&&t.protocol!=="https:"?{error:"LUT must be project-local or a data URL"}:t.origin!==window.location.origin?{error:"Remote LUT URLs are not supported"}:{href:t.href}}catch{return{error:"Invalid LUT URL"}}}function Na(e){return e instanceof Error?e.message:"LUT failed to load"}function j1(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0)%1e4}function F0(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return j1(t)}function Vu(e){let t=L0(e);if("error"in t)return{state:"error",message:t.error};let n=Pt.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>ip(o,{maxSize:Wo})),i={state:"pending",promise:r};for(;Pt.size>=M1;){let o=Pt.keys().next().value;if(!o)break;Pt.delete(o)}return Pt.set(t.href,i),r.then(o=>{Pt.get(t.href)===i&&Pt.set(t.href,{state:"ready",lut:o})},o=>{Pt.get(t.href)===i&&Pt.set(t.href,{state:"error",message:Na(o)})}),i}function _0(e,t,n){if(e.lut?.src===t)return e.lut;let r=ml(n),{gl:i,program:o}=e;try{return I0(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Na(a),e.lutLoadingSrc=null,H("runtime.colorGrading.uploadLut",a),null}}async function K1(e){let t=Vu(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function I0(e,t,n){e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.width,n.height,0,e.RGBA,e.UNSIGNED_BYTE,n.data)}function X1(e,t,n){let r=ml(n),{gl:i,program:o}=e;return I0(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Ct(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function $u(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Ct(e.gl,t.scratch),Ct(e.gl,t.blur),t.bloom&&Ct(e.gl,t.bloom),e.effectTargets=null)}function zu(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Ct(e.gl,t.moments),Ct(e.gl,t.output),e.kuwaharaTargets=null)}function Ra(e,t=!1){$u(e),zu(e),Y1(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function Y1(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function J1(e){let t=Wu(e.canvas);return t?(Ra(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Uu(e){if(!e.sourceHidden)return;e.element.removeAttribute(Sn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Q1(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=W1(t,e.program.quad),r=ki(t),i=ki(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Ct(t,r),i&&Ct(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Z1(e,t){return t.bloom||(t.bloom=ki(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function C0(e){let t=e.effectTargets;t?.bloom&&(Ct(e.gl,t.bloom),t.bloom=null)}function eC(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=V1(t,e.program.quad),o=$1(t,e.program.quad),a=ki(t,n.HALF_FLOAT_OES,t.NEAREST),s=ki(t);return!i||!o||!a||!s?(tC(t,i,o,a,s),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:s},e.kuwaharaTargets)}function tC(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Ct(e,r),i&&Ct(e,i)}function D0(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return Ta(e,t,o,a),Ta(e,n,o,a),{width:o,height:a}}function ka(e,t,n,r,i,o,a,s=!1,l=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,s?1:0),e.uniform1f(t.threshold,l),Mi(e,t)}function nC(e,t,n,r,i,o,a){let s=D0(e,t.scratch,r,i/2,o/2),l=a/2;ka(e,t.blurProgram,n,t.scratch,s,{x:1,y:0},l,!0,.5),ka(e,t.blurProgram,t.scratch.texture,r,s,{x:0,y:1},l,!0)}function rC(e,t,n,r,i,o,a){let s=n;for(let l=0;l<Math.max(1,Math.floor(a));l++)ka(e,t.blurProgram,s,t.scratch,i,{x:1,y:0},o),ka(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),s=r.texture}function Mi(e,t){e.bindBuffer(e.ARRAY_BUFFER,t.quad),e.enableVertexAttribArray(t.position),e.vertexAttribPointer(t.position,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLE_STRIP,0,4)}function iC(e,t,n,r,i,o,a,s){Ta(e,t.moments,i.width,i.height),Ta(e,t.output,i.width,i.height);let l=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(l.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(l.source,0),e.uniform1i(l.blurSource,1),e.uniform2f(l.texel,1/i.width,1/i.height),e.uniform2f(l.uvScale,o.scaleX,o.scaleY),e.uniform2f(l.uvOffset,o.offsetX,o.offsetY),e.uniform1f(l.blurReady,a?1:0),e.uniform1f(l.blur,s.blur),e.uniform1f(l.radius,s.kuwaharaRadius),Mi(e,l);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,s.kuwaharaRadius),e.uniform1f(u.sharpness,s.kuwaharaSharpness),e.uniform1f(u.saturation,s.kuwaharaSaturation),Mi(e,u)}function oC(e,t,n,r){if(n<=0)return!1;let i=D0(e.gl,t.scratch,t.blur,r.width,r.height);return rC(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function aC(e,t,n,r,i,o){if(n<=0)return C0(e),null;o||C0(e);let a=o?Z1(e,t):t.blur;return a?(nC(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function sC(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&$u(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=Q1(e);if(!s)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=oC(e,s,o,n),u=aC(e,s,a,t.effects.bloomRadius,n,l);return{blurReady:l,bloomReady:u!==null,blurTexture:s.blur.texture,bloomTexture:u??i.texture}}function lC(e,t,n,r,i,o,a){let s=t.effects.kuwahara;if(s<=0&&!o)return e.kuwaharaTargets&&a&&zu(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let l=eC(e);return!l||s<=0?{kuwaharaReady:!1,kuwaharaTexture:l?.output.texture??e.program.texture}:(iC(e.gl,l,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:l.output.texture})}function P0(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=sC(e,t,n,o),s=lC(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...s}}function uC(e){let t=e.grading.lut?.src.trim()??"",n=e.grading.lut?.intensity??1;if(!t||n<=0)return e.lut=null,e.lutLoadingSrc=null,e.lutError=null,null;let r=L0(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Vu(t);return i.state==="ready"?_0(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(_0(e,r.href,o),tt(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Na(o),e.lutLoadingSrc=null,tt(e))})),null)}function Ri(e){if(!e)return null;if(typeof e=="string"){let t=e.trim();if(!t)return null;let n=document.getElementById(t.replace(/^#/,""));if(n&&nn(n))return n;try{let r=document.querySelector(t);return r&&nn(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&nn(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&nn(t))return t}if(!e.selector)return null;try{let t=Array.from(document.querySelectorAll(e.selector)),n=Math.max(0,Math.floor(Number(e.selectorIndex??0)||0)),r=t[n]??null;return r&&nn(r)?r:null}catch{return null}}function O0(e){return ye(e)?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:Ie(e)&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function H0(e){return ye(e)?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:Ie(e)?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function G0(e){let t=Ft(e);return t&&H0(t)?t:null}function R0(e){if(!ye(e))return!1;let t=G0(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function cC(e){return Ie(e)&&e.classList.contains("__render_frame__")}function dC(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function B0(e){if(ye(e)){let t=G0(e);if(t)return t}return H0(e)?e:null}function T0(e,t){let n=e.toLowerCase();if(n==="center")return .5;if(t==="x"){if(n==="left")return 0;if(n==="right")return 1}else{if(n==="top")return 0;if(n==="bottom")return 1}if(n.endsWith("%")){let r=Number.parseFloat(n);return Number.isFinite(r)?r/100:null}return null}function fC(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=T0(o,"x"),s=T0(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(s!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=s;continue}}return{x:n,y:r}}function U0(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",s=e,l=t;if(a==="contain"||a==="cover"||a==="scale-down"){let m=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);s=n*m,l=r*m,a==="scale-down"&&s>n&&l>r&&(s=n,l=r)}else a==="none"&&(s=n,l=r);let u=fC(o||"center"),f=(e-s)*u.x/e,d=(t-l)*u.y/t;return{scaleX:s/e,scaleY:l/t,offsetX:f,offsetY:d}}function mC(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function k0(e,t){return Math.max(0,Math.round(e>0?e:t))}function pC(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&mC(e,i);let o=window.getComputedStyle(t);cm(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),s=k0(n.offsetWidth,a.width),l=k0(n.offsetHeight,a.height);if(s<=0||l<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),f=Math.round(s*u),d=Math.round(l*u);return r.width!==f&&(r.width=f),r.height!==d&&(r.height=d),{width:f,height:d}}function dr(e,t,n){e.uniform3f(t,Number.parseInt(n.slice(1,3),16)/255,Number.parseInt(n.slice(3,5),16)/255,Number.parseInt(n.slice(5,7),16)/255)}function Rn(e,t,n,r){e.set(r,(t*vt+n)*4)}function rn(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Gu(e,t,n){return e.length>=3?hl(e,t,n):new Float32Array(vt)}function Cn(e,t){return e[t]??0}function hC(e,t,n){let r=Zn(t.red),i=Zn(t.green),o=Zn(t.blue),a=Zn(t.master),s=Gu(n.hueVsHue,-180,180),l=Gu(n.hueVsSaturation,-1,1),u=Gu(n.hueVsLuma,-1,1);for(let f=0;f<vt;f+=1)Rn(e,0,f,[Cn(r,f),Cn(i,f),Cn(o,f),Cn(a,f)]),Rn(e,1,f,[rn(Cn(s,f),180),rn(Cn(l,f),1),rn(Cn(u,f),1),1])}function gC(e,t,n){let r=n*I1;Rn(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Rn(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Rn(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Rn(e,2,r+3,[rn(t.correction.hueShift,180),rn(t.correction.saturation,1),rn(t.correction.luma,1),rn(t.correction.temperature,1)]),Rn(e,2,r+4,[rn(t.correction.tint,1),.5,.5,1])}function bC(e,t,n){let r=new Float32Array(vt*Li*4);hC(r,e,t);let i=0;for(let o of n)o.enabled&&(gC(r,o,i),i+=1);return r}var M0=new WeakMap;function xC(e,t,n){let r=M0.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return M0.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function yC(e,t,n,r){let{curves:i,hueCurves:o}=n,a=xC(i,o,r);if(t.advancedSignature===a)return;let s=Uint8Array.from(bC(i,o,r),Qr);e.activeTexture(e.TEXTURE5),e.bindTexture(e.TEXTURE_2D,t.advancedTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,vt,Li,0,e.RGBA,e.UNSIGNED_BYTE,s),t.advancedSignature=a}function Bu(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function W0(e,t,n,r,i,o,a,s,l,u,f,d){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,l.width,l.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:m,hueCurves:g,secondaries:h}=n,b=Cl(m),x=Rl(g),v=Tl(h)?h.reduce((k,O)=>k+Number(O.enabled),0):0;(b||x||v>0)&&yC(e,t,n,h),Bu(e,t.shadowWheel,n.wheels.shadows),Bu(e,t.midtoneWheel,n.wheels.midtones),Bu(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,b?1:0),e.uniform1f(t.hueCurvesEnabled,x?1:0),e.uniform1f(t.secondaryCount,v);for(let[k,O]of t.adjustUniforms)e.uniform1f(O,n.adjust[k]);for(let[k,O]of t.detailUniforms)e.uniform1f(O,n.details[k]);e.uniform1f(t.grainSeed,f),e.uniform1f(t.effectTime,d);for(let[k,O]of t.effectUniforms)e.uniform1f(O,n.effects[k]);let A=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?L1:Pu),E=A[A.length-1]??Pu[1];e.uniform1f(t.paletteSize,A.length),dr(e,t.palette0,A[0]??Pu[0]),dr(e,t.palette1,A[1]??E),dr(e,t.palette2,A[2]??E),dr(e,t.palette3,A[3]??E),dr(e,t.palette4,A[4]??E),dr(e,t.palette5,A[5]??E),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,s.enabled?1:0),e.uniform1f(t.comparePosition,s.position),e.uniform1f(t.compareSoftness,s.softness),e.uniform1f(t.compareLineWidth,s.lineWidth)}function SC(e){if(!e.sourceHidden){let t=e.element.getAttribute(vn);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Sn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function Ot(e){let t=wp.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var V0=Ot("intensity"),$0=Ot("lut.intensity"),z0=Ot("adjust.exposure"),q0=Ot("effects.kuwahara"),j0=[["blur",Ot("effects.blur")],["bloom",Ot("effects.bloom")],["kuwahara",q0],["pixelate",Ot("effects.pixelate")],["ascii",Ot("effects.ascii")],["dither",Ot("effects.dither")]],K0=[V0,$0,z0,...j0.map(([,e])=>e)];function Tn(e,t){let n=getComputedStyle(e).getPropertyValue(t.name).trim();if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Ti(e,t){return t!==null&&(Tp(t)||K0.some(n=>Tn(e,n)!==null))}function vC(e,t){let n=null;for(let[r,i]of j0){let o=Tn(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function EC(e){let{element:t,grading:n}=e,r=Tn(t,V0),i=Tn(t,$0),o=Tn(t,z0),a=vC(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let l={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(l.intensity=r),n.lut&&i!==null&&(l.lut={...n.lut,intensity:i}),l}function X0(e,t,n){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n)}function Y0(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function tt(e){if(e.destroyed||e.contextLost)return!1;let t=B0(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=O0(t);if(!n)return!1;let r=xe(t)?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",s=e.element.style.getPropertyValue("visibility"),l=cC(t);l&&dC(e,t),a&&!l&&(e.sourceInlineOpacity!==null?e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||""):e.element.style.removeProperty("opacity"));let u=window.getComputedStyle(l?t:e.element);e.sourceOpacityForCanvas=u.opacity||"1",a&&!l&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(l||s!=="hidden")&&u.visibility!=="hidden";let f=pC(e,r);if(!f)return!1;let d=window.getComputedStyle(r),m=U0(f.width,f.height,n.width,n.height,d.objectFit,d.objectPosition),{gl:g,program:h}=e;try{let b=EC(e),x=uC(e);X0(g,h.texture,t);let v=Tn(e.element,q0)!==null,A=P0(e,b,f,m,{preserveKuwahara:v});g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,f.width,f.height),g.useProgram(h.program),Y0(g,h,A);let E=window.__player?.getTime?.(),k=typeof E=="number"&&Number.isFinite(E)?Math.max(0,E):ye(e.element)?Math.max(0,e.element.currentTime):0,O=e.grainSeed+Math.floor(k*60);return W0(g,h,b,x,A.blurReady,A.bloomReady,A.kuwaharaReady,e.compare,f,m,O,k),Mi(g,h),SC(e),e.hasDrawn=!0,e.drawError=null,!0}catch(b){return e.drawError=b instanceof Error?b.message:"Shader draw failed",H("runtime.colorGrading.drawEntry",b),!1}}function AC(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),s=i>0&&o>0?i/o:t.width/t.height;return s>=1?{width:a,height:Math.max(1,Math.round(a/s))}:{width:Math.max(1,Math.round(a*s)),height:a}}function wC(){let e=document.createElement("canvas"),t=Wu(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function _C(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):ye(e)?Math.max(0,e.currentTime):0}function CC(e,t,n,r){let i=B0(t);if(!i)return null;let o=O0(i);if(!o)return null;let a=AC(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let s=xe(i)?i:t,l=window.getComputedStyle(s),u=U0(a.width,a.height,o.width,o.height,l.objectFit,l.objectPosition);return X0(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:_C(t,r),grainSeed:F0(t)+(ye(t)?Math.floor(t.currentTime*60):0)}}async function RC(e,t,n,r,i=!1){let o=CC(e,t,r,i);if(!o)return null;let{dimensions:a,uv:s,grainSeed:l,effectTime:u}=o,f=[];for(let d of n.slice(0,32)){let m=qo(d.grading);if(!m){f.push({id:d.id,dataUrl:null,error:"Invalid grading"});continue}let g=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=X1(e,m.lut.src,await K1(m.lut.src))),g=e.lut),f.push({id:d.id,dataUrl:TC(e,m,g,a,s,l,u)})}catch(h){f.push({id:d.id,dataUrl:null,error:Na(h)})}}return{...a,images:f}}function TC(e,t,n,r,i,o,a){let{canvas:s,gl:l,program:u}=e,f=P0(e,t,r,i,{releaseIdleTargets:!1});return l.bindFramebuffer(l.FRAMEBUFFER,null),l.viewport(0,0,r.width,r.height),l.useProgram(u.program),Y0(l,u,f),n||(e.lut=null),W0(l,u,t,n,f.blurReady,f.bloomReady,f.kuwaharaReady,fr,r,i,o,a),Mi(l,u),s.toDataURL("image/png")}function _t(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function kC(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&ye(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Ni(e){if(e.destroyed||!ye(e.element)||e.videoFrameHandle!==null||e.animationFrame!==null)return;let t=e.element,n=t;if(typeof n.requestVideoFrameCallback=="function"){e.videoFrameHandle=n.requestVideoFrameCallback(()=>{e.videoFrameHandle=null,tt(e),!e.destroyed&&!t.paused&&!t.ended&&Ni(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,tt(e),!e.destroyed&&!t.paused&&!t.ended&&Ni(e)})}function MC(e){let t=()=>{tt(e)};if(_t(e,e.element,"load",t),_t(e,e.element,"loadedmetadata",t),_t(e,e.element,"loadeddata",t),_t(e,e.element,"seeked",t),_t(e,e.element,"timeupdate",t),_t(e,window,"resize",t),ye(e.element)&&(_t(e,e.element,"play",()=>Ni(e)),_t(e,e.element,"pause",t)),_t(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Uu(e)}),_t(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!J1(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Uu(e);return}e.drawError=null,tt(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),tt(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function NC(e){if(e.destroyed)return null;e.destroyed=!0,kC(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),$u(e),zu(e),Uu(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function J0(e,t){return e.removeAttribute("style"),t.id?e.id=`${yp}${t.id}`:e.removeAttribute("id"),e.className=k1,e.setAttribute(T1,"true"),e.setAttribute("data-hyperframes-ignore",""),e.setAttribute("data-hyperframes-picker-ignore",""),e.setAttribute("data-hf-ignore",""),e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none",e.style.display="none",t.parentNode?.insertBefore(e,t.nextSibling),e}function LC(e){return J0(document.createElement("canvas"),e)}function Q0(e){let t=new WeakMap,n=new Set,r=[],i=null,o=null,a=Promise.resolve(),s=!1,l=(R,M,T)=>{let B=t.get(R);if(B)return B.grading=M,B.source=T,tt(B),ye(R)&&!R.paused&&Ni(B),!0;let W=r.pop();if(W)J0(W.canvas,R);else{let N=LC(R),_=Wu(N);if(!_)return N.remove(),!1;W={canvas:N,gl:_.gl,program:_.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let ne={element:R,...W,grading:M,compare:{...fr},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:T,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(R).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(R).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:F0(R),destroyed:!1};return t.set(R,ne),n.add(R),MC(ne),tt(ne),ye(R)&&!R.paused&&Ni(ne),!0},u=(R,M)=>{if(s)return!1;let T=Ri(R);if(!T)return!1;let B=t.get(T);if(!B){let W=_a(T);if(!Ti(T,W)||!l(T,W,"attribute"))return!1;B=t.get(T)}return B?(B.compare=q1(M),tt(B),!0):!1},f=R=>{let M=t.get(R);if(!M)return;let T=NC(M);T&&(M.contextLost||r.length>=N1?Ra(T,!0):r.push(T)),t.delete(R),n.delete(R)},d=()=>{if(s)return 0;let R=new Set;document.querySelectorAll(`video[${ei}], img[${ei}]`).forEach(T=>{if(!nn(T))return;R.add(T);let B=_a(T);Ti(T,B)&&(E0(T)||R0(T))?l(T,B,"attribute"):f(T)});for(let T of n){let B=t.get(T);B&&(!T.isConnected||B.source==="attribute"&&!R.has(T))&&f(T)}return n.size},m=()=>{if(s)return 0;let R=0;for(let M of n){let T=t.get(M);T&&tt(T)&&(R+=1)}return R},g=async()=>{let R=new Set;for(let M of n){let T=t.get(M)?.grading.lut;if(!T?.src.trim()||(T.intensity??1)<=0)continue;let B=Vu(T.src);B.state==="pending"&&R.add(B.promise)}return R.size>0&&await Promise.allSettled(R),m(),R.size},h=()=>{if(s)return 0;let R=0;for(let M of n){let T=t.get(M);!T||!K0.some(W=>Tn(M,W)!==null)||ye(M)&&!M.paused&&!M.ended||tt(T)&&(R+=1)}return R},b=(R,M)=>{if(s)return!1;let T=Ri(R);if(!T)return!1;let B=qo(M);return Ti(T,B)?l(T,B,"live"):(f(T),!0)},x=(R,M)=>{if(!nn(R))return!1;let T=t.get(R);if(!T){if(!M)return!1;let B=_a(R);return Ti(R,B)&&l(R,B,"attribute")}return T.sourceVisibleForCanvas=M,!M&&T.source==="attribute"&&f(R),!0},v=R=>nn(R)&&t.has(R),A=R=>{let M=Ri(R);if(!M)return{state:"missing",message:"Media not found"};let T=t.get(M);if(T)return T.effectError?{state:"unavailable",message:T.effectError}:T.drawError?{state:"unavailable",message:T.drawError}:T.lutError?{state:"unavailable",message:`LUT error: ${T.lutError}`}:T.grading.lut&&T.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:T.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:T.lut?"Shader + LUT active":"Shader active"};let B=_a(M);return Ti(M,B)?!E0(M)&&!R0(M)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},E=async(R,M,T)=>{let B=async()=>{if(s||M.length===0)return null;let ne=Ri(R);return!ne||(o??(o=wC()),!o)?null:RC(o,ne,M,T?.maxDimension,T?.useMediaTime)},W=a.then(B,B);return a=W.then(()=>{},()=>{}),W},k=R=>{let M=Ri(R);if(!ye(M))return null;if(!M.paused)return()=>{};let T=M.currentTime,B=M.loop,W=M.muted;return M.loop=!0,M.muted=!0,(M.ended||Number.isFinite(M.duration)&&T>=M.duration)&&(M.currentTime=0),e?.lease(M),M.play().catch(()=>{}),()=>{e?.release(M),M.pause(),M.loop=B,M.muted=W,M.currentTime=T}},O=()=>{if(!s){s=!0,i?.disconnect(),i=null;for(let R of n)f(R);for(let R of r)Ra(R,!0);r.length=0,o&&(Ra(o,!0),o=null)}};document.body&&(i=new MutationObserver(()=>d()),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ei]}));let F={refresh:d,redraw:m,redrawAnimated:h,waitForActiveLuts:g,setGrading:b,setCompare:u,setSourceVisibility:x,isGraded:v,getStatus:A,renderPreviews:E,startPreviewPlayback:k,destroy:O},D=window;return D.__hf=D.__hf||{},D.__hf.colorGrading=F,d(),F}var FC={mulX:374761393,mulY:668265263,mulMix:1274126177,offset:2654435769,shift1:13,shift2:16,divisor:4294967296},{mulX:IC,mulY:DC,mulMix:Z0,offset:PC,shift1:OC,shift2:HC,divisor:GC}=FC,BC=20,eb=`#version 300 es
|
|
356
356
|
precision highp float;
|
|
357
357
|
precision highp int;
|
|
358
358
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/runtime/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAiBjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAQjE;;8EAE8E;AAC9E,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAClE,QAAQ,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;CAC7D,GACA,OAAO,CA6CT;AAkDD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKxE;
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/runtime/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAiBjB,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AAQjE;;8EAE8E;AAC9E,eAAO,MAAM,8BAA8B,OAAO,CAAC;AAEnD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAClE,QAAQ,EAAE,UAAU,CAAC,OAAO,8BAA8B,CAAC,CAAC;CAC7D,GACA,OAAO,CA6CT;AAkDD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKxE;AAwGD,wBAAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,sBAAsB,CAwdzB"}
|