@hyperframes/inspector 0.8.231 → 0.9.1
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/service.js +1 -1
- package/package.json +3 -3
package/dist/service.js
CHANGED
|
@@ -40985,7 +40985,7 @@ import {
|
|
|
40985
40985
|
import { resolve as resolve8, join as join6, extname as extname3, sep as sep4 } from "node:path";
|
|
40986
40986
|
|
|
40987
40987
|
// ../core/src/generated/runtime-inline.ts
|
|
40988
|
-
var RUNTIME_IIFE = '"use strict";(()=>{var aR=Object.create;var Mc=Object.defineProperty;var sR=Object.getOwnPropertyDescriptor;var lR=Object.getOwnPropertyNames;var uR=Object.getPrototypeOf,cR=Object.prototype.hasOwnProperty;var dR=(e,t,n)=>t in e?Mc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var fR=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lR(t))!cR.call(e,o)&&o!==n&&Mc(e,o,{get:()=>t[o],enumerable:!(r=sR(t,o))||r.enumerable});return e};var mR=(e,t,n)=>(n=e!=null?aR(uR(e)):{},fR(t||!e||!e.__esModule?Mc(n,"default",{value:e,enumerable:!0}):n,e));var be=(e,t,n)=>dR(e,typeof t!="symbol"?t+"":t,n);var ES=_e((g$,Hf)=>{var ye=String,SS=function(){return{isColorSupported:!1,reset:ye,bold:ye,dim:ye,italic:ye,underline:ye,inverse:ye,hidden:ye,strikethrough:ye,black:ye,red:ye,green:ye,yellow:ye,blue:ye,magenta:ye,cyan:ye,white:ye,gray:ye,bgBlack:ye,bgRed:ye,bgGreen:ye,bgYellow:ye,bgBlue:ye,bgMagenta:ye,bgCyan:ye,bgWhite:ye,blackBright:ye,redBright:ye,greenBright:ye,yellowBright:ye,blueBright:ye,magentaBright:ye,cyanBright:ye,whiteBright:ye,bgBlackBright:ye,bgRedBright:ye,bgGreenBright:ye,bgYellowBright:ye,bgBlueBright:ye,bgMagentaBright:ye,bgCyanBright:ye,bgWhiteBright:ye}};Hf.exports=SS();Hf.exports.createColors=SS});var Gf=_e(()=>{});var Nl=_e((x$,wS)=>{"use strict";var vS=ES(),AS=Gf(),Yi=class e extends Error{constructor(t,n,r,o,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),o&&(this.source=o),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=vS.isColorSupported);let r=d=>d,o=d=>d,i=d=>d;if(t){let{bold:d,gray:f,red:m}=vS.createColors(!0);o=b=>d(m(b)),r=b=>f(b),AS&&(i=b=>AS(b))}let a=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),c=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,b=" "+(" "+m).slice(-c)+" | ";if(m===this.line){if(d.length>160){let y=20,x=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),v=d.slice(x,E),T=r(b.replace(/\\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\\t]/g," ");return o(">")+r(b)+i(v)+`\n `+T+o("^")}let h=r(b.replace(/\\d/g," "))+d.slice(0,this.column-1).replace(/[^\\t]/g," ");return o(">")+r(b)+i(d)+`\n `+h+o("^")}return" "+r(b)+i(d)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};wS.exports=Yi;Yi.default=Yi});var Bf=_e((S$,MS)=>{"use strict";var JL=/(<)(\\/?style\\b)/gi,QL=/(<)(!--)/g,ZL=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/;function Ht(e){return typeof e!="string"||!e.includes("<")?e:e.replace(JL,"\\\\3c $2").replace(QL,"\\\\3c $2")}var _S={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function eN(e){return e[0].toUpperCase()+e.slice(1)}function TS(e,t){let n="@"+t.name,r=t.params?e.rawValue(t,"params"):"",o=t.raws.afterName;return typeof o>"u"?o=r?" ":"":o===""&&r&&!ZL.test(r[0])&&(o=" "),n+o+r}function tN(e){if(!e.prop.startsWith("--"))return!1;let t=e.raws.before;return typeof t>"u"||!/\\S$/.test(t)}function RS(e,t,n){let r=n.nodes,o=r.length-1;for(;o>0&&r[o].type==="comment";)o-=1;let i=e.raw(n,"semicolon"),a=n.type==="document";for(let l=r.length-1;l>=0;l--){let s=r[l],c=o!==l||i;!c&&l<r.length-1&&(s.type==="atrule"&&!s.nodes||s.type==="decl"&&tN(s))&&(c=!0),t.push({document:a,node:s,semicolon:c})}}function CS(e,t,n,r){let o=e.raw(n,"between","beforeOpen");e.builder(Ht(r+o)+"{",n,"start");let i=n.nodes&&n.nodes.length,a=()=>{let l=i?e.raw(n,"after"):e.raw(n,"after","emptyBody");l&&e.builder(Ht(l)),e.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&e.builder(Ht(n.raws.ownSemicolon),n,"end")};i?(t.push(a),RS(e,t,n)):a()}var Xi=class e{constructor(t){this.builder=t}atrule(t,n){let r=TS(this,t);if(t.nodes)this.block(t,r);else{let o=(t.raws.between||"")+(n?";":"");this.builder(Ht(r+o),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let o=t.parent,i=0;for(;o&&o.type!=="root";)i+=1,o=o.parent;if(r.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<i;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(Ht(n+r)+"{",t,"start");let o;t.nodes&&t.nodes.length?(this.body(t),o=this.raw(t,"after")):o=this.raw(t,"after","emptyBody"),o&&this.builder(Ht(o)),this.builder("}",t,"end")}body(t){let n=e.prototype,r=["atrule","block","body","rule","stringify"].every(i=>this[i]===n[i]),o=[];for(RS(this,o,t);o.length>0;){let i=o.pop();if(typeof i=="function"){i();continue}let a=i.node,l=this.raw(a,"before");l&&this.builder(i.document?l:Ht(l)),r&&a.type==="rule"?CS(this,o,a,this.rawValue(a,"selector")):r&&a.type==="atrule"&&a.nodes?CS(this,o,a,TS(this,a)):this.stringify(a,i.semicolon)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(Ht("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,o=this.raw(t,"between","colon"),i=t.prop+o+this.rawValue(t,"value");t.important&&(i+=r.important||" !important"),n&&(i+=";"),this.builder(Ht(i),t)}document(t){this.body(t)}raw(t,n,r){let o;if(r||(r=n),n&&(o=t.raws[n],typeof o<"u"))return o;let i=t.parent;if(r==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return _S[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+eN(r);this[s]?o=this[s](a,t):a.walk(c=>{if(o=c.raws[n],typeof o<"u")return!1})}return typeof o>"u"&&(o=_S[r]),l[r]=o,o}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(o=>{if(typeof o.raws.before<"u")return r=o.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(o=>{if(typeof o.raws.before<"u")return r=o.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let o=r.parent;if(o&&o!==t&&o.parent&&o.parent===t&&typeof r.raws.before<"u"){let i=r.raws.before.split(`\n`);return n=i[i.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],o=t.raws[n];return o&&o.value===r?o.raw:r}root(t){if(t.source&&t.source.input.hasBOM&&this.builder("\\uFEFF",t,"start"),this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:Ht(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(Ht(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};MS.exports=Xi;Xi.default=Xi});var Ji=_e((E$,kS)=>{"use strict";var nN=Bf();function Uf(e,t){new nN(t).stringify(e)}kS.exports=Uf;Uf.default=Uf});var Qi=_e((v$,Wf)=>{"use strict";Wf.exports.isClean=Symbol("isClean");Wf.exports.my=Symbol("my")});var ta=_e((A$,LS)=>{"use strict";var rN=Nl(),oN=Bf(),iN=Ji(),{isClean:Zi,my:aN}=Qi();function sN(e,t){let n=new e.constructor,r=[[e,n,t]];for(;r.length>0;){let[o,i,a]=r.pop();for(let l in o){if(!Object.prototype.hasOwnProperty.call(o,l)||l==="proxyCache")continue;let s=o[l],c=typeof s;if(l==="parent"&&c==="object")a&&(i[l]=a);else if(l==="source")i[l]=s;else if(Array.isArray(s)){let d=[];i[l]=d;for(let f of s){let m=new f.constructor;d.push(m),r.push([f,m,i])}}else{if(c==="object"&&s!==null){let d=new s.constructor;r.push([s,d,void 0]),s=d}i[l]=s}}}return n}function Qt(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,o=0;for(let i=0;i<e.length;i++){if(r===t.line&&n===t.column){o=i;break}e[i]===`\n`?(n=1,r+=1):n+=1}return o}var ea=class e{get proxyOf(){return this}constructor(t={}){this.raws={},this[Zi]=!1,this[aN]=!0;for(let n of Object.keys(t))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"&&r.parent?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\\n\\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=sN(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:o}=this.rangeBy(n);return this.source.input.error(t,{column:o.column,line:o.line},{column:r.column,line:r.line},n)}return new rN(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[Zi]=!0}markDirty(){if(this[Zi]){this[Zi]=!1;let t=this;for(;t=t.parent;)t[Zi]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Qt(n,this.source.start)};if(t.index)r=this.positionInside(t.index);else if(t.word){let i=n.slice(Qt(n,this.source.start),Qt(n,this.source.end)).indexOf(t.word);i!==-1&&(r=this.positionInside(i))}return r}positionInside(t){let n=this.source.start.column,r=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,i=Qt(o,this.source.start),a=i+t;for(let l=i;l<a;l++)o[l]===`\n`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Qt(n,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Qt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Qt(n,this.source.start),Qt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),o=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Qt(n,t.start)}:typeof t.index=="number"&&(r=this.positionInside(t.index)),t.end?o={column:t.end.column,line:t.end.line,offset:Qt(n,t.end)}:typeof t.endIndex=="number"?o=this.positionInside(t.endIndex):typeof t.index=="number"&&(o=this.positionInside(t.index+1));return(o.line<r.line||o.line===r.line&&o.column<=r.column)&&(o={column:r.column+1,line:r.line,offset:r.offset+1}),{end:o,start:r}}raw(t,n){return new oN().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let o of t)o===this?r=!0:r?(this.parent.insertAfter(n,o),n=o):this.parent.insertBefore(n,o);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r=n==null;n=n||new Map;let o=[],i=[[this,o,0]];for(let l=0;l<i.length;l++){let[s,c,d]=i[l],f={};c[d]=f;for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m)||m==="parent"||m==="proxyCache")continue;let b=s[m];if(Array.isArray(b)){let h=[];f[m]=h;for(let y=0;y<b.length;y++){let x=b[y];typeof x=="object"&&x.toJSON?x.toJSON===e.prototype.toJSON?i.push([x,h,y]):h[y]=x.toJSON(null,n):h[y]=x}}else if(typeof b=="object"&&b.toJSON)b.toJSON===e.prototype.toJSON?i.push([b,f,m]):f[m]=b.toJSON(null,n);else if(m==="source"){if(b==null)continue;let h=n.get(b.input);h==null&&(h=n.size,n.set(b.input,h)),f[m]={end:b.end,inputId:h,start:b.start}}else f[m]=b}}let a=o[0];return r&&(a.inputs=[...n.keys()].map(l=>l.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=iN){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let o={node:this};for(let i in r)o[i]=r[i];return t.warn(n,o)}};LS.exports=ea;ea.default=ea});var ra=_e((w$,NS)=>{"use strict";var lN=ta(),na=class extends lN{constructor(t){super(t),this.type="comment"}};NS.exports=na;na.default=na});var ia=_e((_$,FS)=>{"use strict";var uN=ta(),oa=class extends uN{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};FS.exports=oa;oa.default=oa});var gn=_e((T$,US)=>{"use strict";var IS=ra(),DS=ia(),PS=ta(),{isClean:OS,my:HS}=Qi(),Vf,GS,BS,$f;function cN(e){let t=e.slice();for(;t.length>0;){let n=t.pop();if(delete n.source,n.nodes){n.nodes=n.nodes.slice();for(let r of n.nodes)t.push(r)}}return e.slice()}function dN(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[OS]=!1,n.proxyOf.nodes)for(let r of n.proxyOf.nodes)t.push(r)}}var Zt=class e extends PS{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let o of r)this.proxyOf.nodes.push(o)}return this.markDirty(),this}cleanRaws(t){let n=[this];for(;n.length>0;){let r=n.pop();if(r!==this&&r.cleanRaws!==e.prototype.cleanRaws){r.cleanRaws(t);continue}if(PS.prototype.cleanRaws.call(r,t),r.nodes)for(let o of r.nodes)n.push(o)}}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,o;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],o=t(this.proxyOf.nodes[r],r),o!==!1);)this.indexes[n]+=1;return delete this.indexes[n],o}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(o=>typeof o=="function"?(i,a)=>o(i.toProxy(),a):o)):n==="every"||n==="some"?r=>t[n]((o,...i)=>r(o.toProxy(),...i)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),o=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r+1,0,a);let i;for(let a in this.indexes)i=this.indexes[a],r<i&&(this.indexes[a]=i+o.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),o=r===0?"prepend":!1,i=this.normalize(n,this.proxyOf.nodes[r],o).reverse();r=this.index(t);for(let l of i)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+i.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=cN(GS(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new DS(t)]}else if(t.selector||t.selectors)t=[new $f(t)];else if(t.name)t=[new Vf(t)];else if(t.text)t=[new IS(t)];else throw new Error("Unknown node type in node creation");return t.map(o=>(o[HS]||e.rebuild(o),o=o.proxyOf,o.parent&&o.parent.removeChild(o),o[OS]&&dN(o),o.raws||(o.raws={}),typeof o.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(o.raws.before=n.raws.before.replace(/\\S/g,"")),o.parent=this.proxyOf,o))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let o of r)this.proxyOf.nodes.unshift(o);for(let o in this.indexes)this.indexes[o]=this.indexes[o]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(o=>{n.props&&!n.props.includes(o.prop)||n.fast&&!o.value.includes(n.fast)||(o.value=o.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let n=[{iterator:this.getIterator(),node:this.proxyOf}];for(;n.length>0;){let{iterator:r,node:o}=n[n.length-1],i=o.indexes[r];if(i>=o.proxyOf.nodes.length){delete o.indexes[r],n.pop();let s=n[n.length-1];s&&(s.node.indexes[s.iterator]+=1);continue}let a=o.proxyOf.nodes[i],l;try{l=t(a,i)}catch(s){throw a.addToError(s)}if(l===!1){for(let s of n)delete s.node.indexes[s.iterator];return!1}a.walk&&a.proxyOf.nodes?n.push({iterator:a.getIterator(),node:a}):o.indexes[r]+=1}}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,o)}):this.walk((r,o)=>{if(r.type==="atrule"&&r.name===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="atrule")return n(r,o)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,o)}):this.walk((r,o)=>{if(r.type==="decl"&&r.prop===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="decl")return n(r,o)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,o)}):this.walk((r,o)=>{if(r.type==="rule"&&r.selector===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="rule")return n(r,o)}))}};Zt.registerParse=e=>{GS=e};Zt.registerRule=e=>{$f=e};Zt.registerAtRule=e=>{Vf=e};Zt.registerRoot=e=>{BS=e};US.exports=Zt;Zt.default=Zt;Zt.rebuild=e=>{let t=[e];for(;t.length>0;){let n=t.pop();if(n.type==="atrule"?Object.setPrototypeOf(n,Vf.prototype):n.type==="rule"?Object.setPrototypeOf(n,$f.prototype):n.type==="decl"?Object.setPrototypeOf(n,DS.prototype):n.type==="comment"?Object.setPrototypeOf(n,IS.prototype):n.type==="root"&&Object.setPrototypeOf(n,BS.prototype),n[HS]=!0,n.nodes)for(let r of n.nodes)t.push(r)}}});var Fl=_e((C$,VS)=>{"use strict";var WS=gn(),_o=class extends WS{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};VS.exports=_o;_o.default=_o;WS.registerAtRule(_o)});var Pl=_e((R$,zS)=>{"use strict";var fN=gn(),$S,qS,Ir=class extends fN{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new $S(new qS,this,t).stringify()}};Ir.registerLazyResult=e=>{$S=e};Ir.registerProcessor=e=>{qS=e};zS.exports=Ir;Ir.default=Ir});var KS=_e((M$,jS)=>{var mN="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",pN=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o-- >0;)r+=e[Math.random()*e.length|0];return r},hN=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=mN[Math.random()*64|0];return t};jS.exports={nanoid:hN,customAlphabet:pN}});var Il=_e(()=>{});var Dl=_e(()=>{});var qf=_e(()=>{});var YS=_e(()=>{});var zf=_e((H$,ZS)=>{"use strict";var{existsSync:gN,readFileSync:bN,realpathSync:yN}=YS(),{dirname:Ol,isAbsolute:xN,join:SN,relative:EN,sep:vN}=Il(),{SourceMapConsumer:XS,SourceMapGenerator:JS}=Dl();function QS(e){try{return yN(e)}catch{return e}}function AN(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var aa=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,o=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Ol(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new XS(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\\/json;charset=utf-?8;base64,/,r=/^data:application\\/json;base64,/,o=/^data:application\\/json;charset=utf-?8,/,i=/^data:application\\/json,/,a=t.match(o)||t.match(i);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return AN(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),o=t.indexOf("*/",r);r>-1&&o>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,o)))}loadFile(t,n,r){if(!r&&!this.unsafeMap){if(!/\\.map$/i.test(t)||!n)return;let o=EN(QS(Ol(n)),QS(t));if(o===".."||o.startsWith(".."+vN)||xN(o))return}if(this.root=Ol(t),gN(t))return this.mapFile=t,bN(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let o=this.loadFile(r,t,!0);if(!o)throw new Error("Unable to load previous source map: "+r.toString());return o}}else{if(n instanceof XS)return JS.fromSourceMap(n).toString();if(n instanceof JS)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=SN(Ol(t),r));let o=this.loadFile(r,t,!1);if(o)try{this.json=JSON.parse(o.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return o}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};ZS.exports=aa;aa.default=aa});var sa=_e((G$,oE)=>{"use strict";var{nanoid:wN}=KS(),{isAbsolute:Yf,resolve:Xf}=Il(),{SourceMapConsumer:_N,SourceMapGenerator:TN}=Dl(),{fileURLToPath:eE,pathToFileURL:Hl}=qf(),tE=Nl(),CN=zf(),jf=Gf(),Kf=Symbol("lineToIndexCache"),RN=!!(_N&&TN),nE=!!(Xf&&Yf);function rE(e){if(e[Kf])return e[Kf];let t=e.css.split(`\n`),n=new Array(t.length),r=0;for(let o=0,i=t.length;o<i;o++)n[o]=r,r+=t[o].length+1;return e[Kf]=n,n}var To=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!nE||/^\\w+:\\/\\//.test(n.from)||Yf(n.from)?this.file=n.from:this.file=Xf(n.from)),nE&&RN){let r=new CN(this.css,n);if(r.text){this.map=r;let o=r.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}}this.file||(this.id="<input css "+wN(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,o={}){let i,a,l,s,c;if(n&&typeof n=="object"){let f=n,m=r;if(typeof f.offset=="number"){s=f.offset;let b=this.fromOffset(s);n=b.line,r=b.col}else n=f.line,r=f.column,s=this.fromLineAndColumn(n,r);if(typeof m.offset=="number"){l=m.offset;let b=this.fromOffset(l);a=b.line,i=b.col}else a=m.line,i=m.column,l=this.fromLineAndColumn(m.line,m.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let f=this.fromOffset(s);n=f.line,r=f.col}let d=this.origin(n,r,a,i);return d?c=new tE(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,o.plugin):c=new tE(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:i,line:a},this.css,this.file,o.plugin),c.input={column:r,endColumn:i,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(Hl&&(c.input.url=Hl(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,n){return rE(this)[t-1]+n-1}fromOffset(t){let n=rE(this),r=n[n.length-1],o=0;if(t>=r)o=n.length-1;else{let i=n.length-2,a;for(;o<i;)if(a=o+(i-o>>1),t<n[a])i=a-1;else if(t>=n[a+1])o=a+1;else{o=a;break}}return{col:t-n[o]+1,line:o+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:Xf(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,o){if(!this.map)return!1;let i=this.map.consumer(),a=i.originalPositionFor({column:n-1,line:t});if(!a.source)return!1;let l;if(typeof r=="number"){let f=i.originalPositionFor({column:o-1,line:r});f.source&&(l=f)}let s;Yf(a.source)?s=Hl(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||Hl(this.map.mapFile));let c={column:a.column+1,endColumn:l&&l.column+1,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(eE)c.file=eE(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=i.sourceContentFor(a.source);return d&&(c.source=d),c}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};oE.exports=To;To.default=To;jf&&jf.registerInput&&jf.registerInput(To)});var Co=_e((B$,lE)=>{"use strict";var iE=gn(),aE,sE,Jn=class extends iE{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let o=new Set;for(let a of Array.isArray(t)?t:[t])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before<"u"&&o.add(a.raws);let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let a of i)o.has(a.raws)||(a.raws.before=n.raws.before)}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new aE(new sE,this,t).stringify()}};Jn.registerLazyResult=e=>{aE=e};Jn.registerProcessor=e=>{sE=e};lE.exports=Jn;Jn.default=Jn;iE.registerRoot(Jn)});var Jf=_e((U$,uE)=>{"use strict";var la={comma(e){return la.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return la.split(e,t)},split(e,t,n){if(typeof e!="string")return[];let r=[],o="",i=!1,a=0,l=!1,s="",c=!1;for(let f of e)if(c?c=!1:f==="\\\\"?c=!0:l?f===s&&(l=!1):f===\'"\'||f==="\'"?(l=!0,s=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&t.includes(f)&&(i=!0),i){let m=o.trim();(n||m!=="")&&r.push(m),o="",i=!1}else o+=f;let d=o.trim();return(n||d!=="")&&r.push(d),r}};uE.exports=la;la.default=la});var Gl=_e((W$,dE)=>{"use strict";var cE=gn(),MN=Jf(),Ro=class extends cE{get selectors(){return MN.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};dE.exports=Ro;Ro.default=Ro;cE.registerRule(Ro)});var pE=_e((V$,mE)=>{"use strict";var kN=Fl(),LN=ra(),NN=ia(),FN=sa(),PN=zf(),IN=Co(),DN=Gl();function fE(e,t){return e.inputs?e.inputs.map(n=>{let r={...n,__proto__:FN.prototype};return r.map&&(r.map={...r.map,__proto__:PN.prototype}),r}):t}function ON(e,t,n){let r={...e};if(delete r.inputs,delete r.nodes,r.source){let{inputId:i,...a}=r.source;r.source=a,i!=null&&(r.source.input=t[i])}let o;if(r.type==="root")o=new IN(r);else if(r.type==="decl")o=new NN(r);else if(r.type==="rule")o=new DN(r);else if(r.type==="comment")o=new LN(r);else if(r.type==="atrule")o=new kN(r);else throw new Error("Unknown node type: "+e.type);if(n){o.nodes=n;for(let i of n)i.parent=o}return o}function Bl(e,t){if(Array.isArray(e))return e.map(o=>Bl(o));let n,r=[{childIndex:0,children:[],inputs:fE(e,t),json:e}];for(;r.length>0;){let o=r[r.length-1],i=o.json.nodes;if(i&&o.childIndex<i.length){let l=i[o.childIndex];o.childIndex+=1,r.push({childIndex:0,children:[],inputs:fE(l,o.inputs),json:l});continue}r.pop();let a=ON(o.json,o.inputs,i?o.children:void 0);r.length>0?r[r.length-1].children.push(a):n=a}return n}mE.exports=Bl;Bl.default=Bl});var Zf=_e(($$,SE)=>{"use strict";var{dirname:Ul,relative:gE,resolve:bE,sep:yE}=Il(),{SourceMapConsumer:xE,SourceMapGenerator:Wl}=Dl(),{pathToFileURL:hE}=qf(),HN=sa(),GN=!!(xE&&Wl),BN=!!(Ul&&bE&&gE&&yE),Qf=class{constructor(t,n,r,o){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ul(t.file),o;this.mapOpts.sourcesContent===!1?(o=new xE(t.text),o.sourcesContent&&(o.sourcesContent=null)):o=t.consumer(),this.map.applySourceMap(o,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t="/*# sourceMappingURL=",n;for(;(n=this.css.lastIndexOf(t))!==-1;){let r=this.css.indexOf("*/",n+t.length);if(r===-1)break;for(;n>0&&this.css[n-1]===`\n`;)n--;this.css=this.css.slice(0,n)+this.css.slice(r+2)}}}}generate(){if(this.clearAnnotation(),BN&&GN&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Wl.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Wl({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Wl({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,a;this.stringify(this.root,(l,s,c)=>{if(this.css+=l,s&&c!=="end"&&(o.generated.line=t,o.generated.column=n-1,s.source&&s.source.start?(o.source=this.sourcePath(s),o.original.line=s.source.start.line,o.original.column=s.source.start.column-1,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,this.map.addMapping(o))),a=l.match(/\\n/g),a?(t+=a.length,i=l.lastIndexOf(`\n`),n=l.length-i):n+=l.length,s&&c!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(o.source=this.sourcePath(s),o.original.line=s.source.end.line,o.original.column=s.source.end.column-1,o.generated.line=t,o.generated.column=n-2,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,o.generated.line=t,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\\w+:\\/\\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Ul(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ul(bE(r,this.mapOpts.annotation)));let o=gE(r,t);return this.memoizedPaths.set(t,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new HN(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let o=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(o,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(hE){let r=hE(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;yE==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};SE.exports=Qf});var AE=_e((q$,vE)=>{"use strict";var Vl=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,$l=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,UN=/.[\\r\\n"\'(/\\\\]/,EE=/[\\da-f]/i;vE.exports=function(t,n={}){let r=t.css.valueOf(),o=n.ignoreErrors,i,a,l,s,c,d,f,m,b,h,y=r.length,x=0,E=[],v=[],T=-1;function H(){return x}function U(C){throw t.error("Unclosed "+C,x)}function M(){return v.length===0&&x>=y}function L(C){if(v.length)return v.pop();if(x>=y)return;let B=C?C.ignoreUnclosed:!1;switch(i=r.charCodeAt(x),i){case 10:case 32:case 9:case 13:case 12:{s=x;do s+=1,i=r.charCodeAt(s);while(i===32||i===10||i===9||i===13||i===12);d=["space",r.slice(x,s)],x=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let O=String.fromCharCode(i);d=[O,O,x];break}case 40:{if(h=E.length?E.pop()[1]:"",b=r.charCodeAt(x+1),h==="url"&&b!==39&&b!==34&&b!==32&&b!==10&&b!==9&&b!==12&&b!==13){s=x;do{if(f=!1,s=r.indexOf(")",s+1),s===-1)if(o||B){s=x;break}else U("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["brackets",r.slice(x,s+1),x,s],x=s}else x<=T?d=["(","(",x]:(s=r.indexOf(")",x+1),a=r.slice(x,s+1),s===-1||UN.test(a)?(T=s===-1?y:s,d=["(","(",x]):(d=["brackets",a,x,s],x=s));break}case 39:case 34:{c=i===39?"\'":\'"\',s=x;do{if(f=!1,s=r.indexOf(c,s+1),s===-1)if(o||B){s=x+1;break}else U("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["string",r.slice(x,s+1),x,s],x=s;break}case 64:{Vl.lastIndex=x+1,Vl.test(r),Vl.lastIndex===0?s=r.length-1:s=Vl.lastIndex-2,d=["at-word",r.slice(x,s+1),x,s],x=s;break}case 92:{for(s=x,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(i=r.charCodeAt(s+1),l&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(s+=1,EE.test(r.charAt(s)))){for(;EE.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}d=["word",r.slice(x,s+1),x,s],x=s;break}default:{i===47&&r.charCodeAt(x+1)===42?(s=r.indexOf("*/",x+2)+1,s===0&&(o||B?s=r.length:U("comment")),d=["comment",r.slice(x,s+1),x,s],x=s):($l.lastIndex=x+1,$l.test(r),$l.lastIndex===0?s=r.length-1:s=$l.lastIndex-2,d=["word",r.slice(x,s+1),x,s],E.push(d),x=s);break}}return x++,d}function G(C){v.push(C)}return{back:G,endOfFile:M,nextToken:L,position:H}}});var CE=_e((z$,TE)=>{"use strict";var WN=Fl(),VN=ra(),$N=ia(),qN=Co(),wE=Gl(),zN=AE(),_E={empty:!0,space:!0};function jN(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function em(e,t,n){let r="";for(let o=t;o<n;o++)r+=e[o][1];return r}var tm=class{constructor(t){this.input=t,this.root=new qN,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new WN;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,o,i,a=!1,l=!1,s=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(i=s.length-1,o=s[i];o&&o[0]==="space";)o=s[--i];o&&(n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,o;for(let i=n-1;i>=0&&(o=t[i],!(o[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",o[0]==="word"?o[3]+1:o[2])}colon(t){let n=0,r,o,i;for(let[a,l]of t.entries()){if(o=l,i=o[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!r)this.doubleColon(o);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=o}return!1}comment(t){let n=new VN;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let o=r.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=o[2],n.raws.left=o[1],n.raws.right=o[3]}}createTokenizer(){this.tokenizer=zN(this.input)}decl(t,n){let r=new $N;this.init(r,t[0][2]);let o=t[t.length-1];o[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(o[3]||o[2]||jN(t)),r.source.end.offset++;let i=0;for(;t[i][0]!=="word";)i===t.length-1&&this.unknownWord([t[i]]),i++;r.raws.before+=em(t,0,i),r.source.start=this.getPosition(t[i][2]);let a=i;for(;i<t.length;){let m=t[i][0];if(m===":"||m==="space"||m==="comment")break;i++}r.prop=em(t,a,i);let l=i,s;for(;i<t.length&&(s=t[i],i++,s[0]!==":");)s[0]==="word"&&/\\w/.test(s[1])&&this.unknownWord([s]);r.raws.between=em(t,l,i),(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let c=i;for(;i<t.length;){let m=t[i][0];if(m!=="space"&&m!=="comment")break;i++}let d=t.slice(c,i);t=t.slice(i),this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(s=t[m],s[1].toLowerCase()==="!important"){r.important=!0;let b=this.stringFrom(t,m);b=this.spacesFromEnd(t)+b,b!==" !important"&&(r.raws.important=b);break}else if(s[1].toLowerCase()==="important"){let b=t.slice(0),h="";for(let y=m;y>0;y--){let x=b[y][0];if(h.trim().startsWith("!")&&x!=="space")break;h=b.pop()[1]+h}h.trim().startsWith("!")&&(r.important=!0,r.raws.important=h,t=b)}if(s[0]!=="space"&&s[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=d.map(m=>m[1]).join(""),d=[]),this.raw(r,"value",d.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new wE;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset++)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,o=!1,i=null,a=[],l=t[1].startsWith("--"),s=[],c=t;for(;c;){if(r=c[0],s.push(c),r==="("||r==="[")i||(i=c),a.push(r==="("?")":"]");else if(l&&o&&r==="{")i||(i=c),a.push("}");else if(a.length===0)if(r===";")if(o){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(o=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(i),n&&o){if(!l)for(;s.length&&(c=s[s.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,o){let i,a,l=r.length,s="",c=!0,d,f;for(let m=0;m<l;m+=1)i=r[m],a=i[0],a==="space"&&m===l-1&&!o?c=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!_E[f]&&!_E[d]?s.slice(-1)===","?c=!1:s+=i[1]:c=!1):s+=i[1];if(!c){let m=r.reduce((b,h)=>b+h[1],"");t.raws[n]={raw:m,value:s}}t[n]=s}rule(t){t.pop();let n=new wE;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let o=n;o<t.length;o++)r+=t[o][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};TE.exports=tm});var zl=_e((j$,RE)=>{"use strict";var KN=gn(),YN=sa(),XN=CE();function ql(e,t){let n=new YN(e,t),r=new XN(n);try{r.parse()}catch(o){throw o}return r.root}RE.exports=ql;ql.default=ql;KN.registerParse(ql)});var nm=_e((K$,ME)=>{"use strict";var JN=gn(),{my:QN}=Qi(),ua=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){n.node[QN]||JN.rebuild(n.node);let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};ME.exports=ua;ua.default=ua});var jl=_e((Y$,kE)=>{"use strict";var ZN=nm(),ca=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new ZN(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};kE.exports=ca;ca.default=ca});var rm=_e((X$,NE)=>{"use strict";var LE={};NE.exports=function(t){LE[t]||(LE[t]=!0,typeof globalThis.console<"u"&&globalThis.console.warn&&globalThis.console.warn(t))}});var am=_e((Q$,DE)=>{"use strict";var eF=gn(),tF=Pl(),nF=Zf(),rF=zl(),FE=jl(),oF=Co(),iF=Ji(),{isClean:Gt,my:aF}=Qi(),J$=rm(),sF={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},lF={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},uF={Once:!0,postcssPlugin:!0,prepare:!0},Mo=0;function da(e){return typeof e=="object"&&typeof e.then=="function"}function om(e){let t=!1,n=sF[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Mo,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Mo,n+"Exit"]:[n,n+"Exit"]}function PE(e){let t;return e.type==="document"?t=["Document",Mo,"DocumentExit"]:e.type==="root"?t=["Root",Mo,"RootExit"]:t=om(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function IE(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Gt]=!1,n.nodes)for(let r of n.nodes)t.push(r)}return e}var im={},Qn=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let o;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))o=IE(n);else if(n instanceof e||n instanceof FE)o=IE(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let i=rF;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{o=i(n,r)}catch(a){this.processed=!0,this.error=a}o&&!o[aF]&&eF.rebuild(o)}this.result=new FE(t,o,r),this.helpers={...im,postcss:im,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(o){globalThis.console&&globalThis.console.error&&globalThis.console.error(o)}return t}prepareVisitors(){this.listeners={};let t=(n,r,o)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,o])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!lF[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!uF[r])if(typeof n[r]=="object")for(let o in n[r])o==="*"?t(n,r,n[r][o]):t(n,r+"-"+o.toLowerCase(),n[r][o]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(da(r))try{await r}catch(o){throw this.handleError(o)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Gt];){t[Gt]=!0;let n=[PE(t)];for(;n.length>0;){let r=this.visitTick(n);if(da(r))try{await r}catch(o){let i=n[n.length-1].node;throw this.handleError(o,i)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let o=t.nodes.map(i=>r(i,this.helpers));await Promise.all(o)}else await r(t,this.helpers)}catch(o){throw this.handleError(o)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return da(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=iF;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let i=new nF(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(da(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Gt];)t[Gt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,o]of t){this.result.lastPlugin=r;let i;try{i=o(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(da(i))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:o}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(o.length>0&&n.visitorIndex<o.length){let[a,l]=o[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===o.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator;n.descending&&(n.descending=!1,r.indexes[a]+=1);let l;for(;l=r.nodes[r.indexes[a]];){if(!l[Gt]){l[Gt]=!0,n.descending=!0,t.push(PE(l));return}r.indexes[a]+=1}n.iterator=0,delete r.indexes[a]}let i=n.events;for(;n.eventIndex<i.length;){let a=i[n.eventIndex];if(n.eventIndex+=1,a===Mo){r.nodes&&r.nodes.length&&(r[Gt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Gt]=!0;let n=[{eventIndex:0,events:om(t),iterator:0,node:t}];for(;n.length>0;){let r=n[n.length-1],o=r.node;if(r.iterator!==0){let i=r.iterator;r.descending&&(r.descending=!1,o.indexes[i]+=1);let a,l=!1;for(;a=o.nodes[o.indexes[i]];){if(!a[Gt]){a[Gt]=!0,r.descending=!0,n.push({eventIndex:0,events:om(a),iterator:0,node:a}),l=!0;break}o.indexes[i]+=1}if(l)continue;r.iterator=0,delete o.indexes[i]}if(r.eventIndex<r.events.length){let i=r.events[r.eventIndex];if(r.eventIndex+=1,i===Mo)o.nodes&&o.nodes.length&&(r.iterator=o.getIterator());else{let a=this.listeners[i];a&&this.visitSync(a,o.toProxy())&&n.pop()}continue}n.pop()}}warnings(){return this.sync().warnings()}};Qn.registerPostcss=e=>{im=e};DE.exports=Qn;Qn.default=Qn;oF.registerLazyResult(Qn);tF.registerLazyResult(Qn)});var HE=_e((e6,OE)=>{"use strict";var cF=Zf(),dF=zl(),fF=jl(),mF=Ji(),Z$=rm(),fa=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=dF;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let o=mF;this.result=new fF(this._processor,void 0,this._opts),this.result.css=n;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let a=new cF(o,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};OE.exports=fa;fa.default=fa});var BE=_e((t6,GE)=>{"use strict";var pF=Pl(),hF=am(),gF=HE(),bF=Co(),Dr=class{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new gF(this,t,n):new hF(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};GE.exports=Dr;Dr.default=Dr;bF.registerProcessor(Dr);pF.registerProcessor(Dr)});var KE=_e((n6,jE)=>{"use strict";var UE=Fl(),WE=ra(),yF=gn(),xF=Nl(),VE=ia(),$E=Pl(),SF=pE(),EF=sa(),vF=am(),AF=Jf(),wF=ta(),_F=zl(),sm=BE(),TF=jl(),qE=Co(),zE=Gl(),CF=Ji(),RF=nm();function Le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new sm(e)}Le.plugin=function(t,n){let r=!1;function o(...a){globalThis.console&&globalThis.console.warn&&!r&&(r=!0,globalThis.console.warn(t+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh")&&globalThis.console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new sm().version,l}let i;return Object.defineProperty(o,"postcss",{get(){return i||(i=o()),i}}),o.process=function(a,l,s){return Le([o(s)]).process(a,l)},o};Le.stringify=CF;Le.parse=_F;Le.fromJSON=SF;Le.list=AF;Le.comment=e=>new WE(e);Le.atRule=e=>new UE(e);Le.decl=e=>new VE(e);Le.rule=e=>new zE(e);Le.root=e=>new qE(e);Le.document=e=>new $E(e);Le.CssSyntaxError=xF;Le.Declaration=VE;Le.Container=yF;Le.Processor=sm;Le.Document=$E;Le.Comment=WE;Le.Warning=RF;Le.AtRule=UE;Le.Result=TF;Le.Input=EF;Le.Rule=zE;Le.Root=qE;Le.Node=wF;vF.registerPostcss(Le);jE.exports=Le;Le.default=Le});function kg(e){return e?/[\\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function Lg(e){return e===" "||e===" "||e===`\n`||e==="\\r"||e==="\\f"}var pR=/^[0-9a-fA-F]{1,6}/;function hR(e){let t=e>=55296&&e<=57343;return e===0||e>1114111||t?65533:e}function Ng(e,t){return e[t]==="\\r"&&e[t+1]===`\n`?t+2:Lg(e[t])?t+1:t}function kc(e,t){let n=e[t+1];if(n===void 0||/[\\n\\r\\f]/.test(n))return null;let r=pR.exec(e.slice(t+1,t+7));if(!r)return{value:n,end:t+2};let o=hR(Number.parseInt(r[0],16));return{value:String.fromCodePoint(o),end:Ng(e,t+1+r[0].length)}}function gR(e,t){let n=o=>kg(o)&&!/[0-9-]/.test(o),r=o=>e[o]==="\\\\"&&kc(e,o)!==null;return e[t]==="-"?e[t+1]==="-"||n(e[t+1])||r(t+1):n(e[t])||r(t)}function ms(e,t){let n=t;for(;e.startsWith("/*",n);){let r=e.indexOf("*/",n+2);n=r<0?e.length:r+2}return n}function ai(e,t){let n=ms(e,t);for(;Lg(e[n]);)n=ms(e,n+1);return n}function si(e,t){if(!gR(e,t))return null;let n=t,r="";for(;n<e.length;){let o=e[n];if(o==="\\\\"){let i=kc(e,n);if(!i)break;r+=i.value,n=i.end;continue}if(!kg(o))break;r+=o,n+=1}return n===t?null:{value:r,end:n}}var Lc=45;function Fg(e){return e>=48&&e<=57}function bR(e){return e>=128||e===Lc||e===95||Fg(e)||e>=65&&e<=90||e>=97&&e<=122}function yR(e,t){let n=e.charCodeAt(t);return n>=1&&n<=31||n===127?!0:Fg(n)?t===0||t===1&&e.charCodeAt(0)===Lc:!1}function an(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n),o=e[n];r===0?t+="\\uFFFD":yR(e,n)?t+=`\\\\${r.toString(16)} `:n===0&&e.length===1&&r===Lc?t+=`\\\\${o}`:bR(r)?t+=o:t+=`\\\\${o}`}return t}var Pg=/\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:[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 xR(e){let t=new Array(e.length).fill(!0);for(let n of e.matchAll(Pg)){let r=n.index;t.fill(!1,r,r+n[0].length)}return t}function ps(e,t,n){if(t.length===0||!e.includes("#"))return e;let r=new Set(t),o=xR(e),i="",a=0;for(;a<e.length;){let l=o[a]&&e[a]==="#"?si(e,a+1):null;l&&r.has(l.value)?(i+=n(l.value),a=l.end):(i+=e[a],a+=1)}return i}function SR(e){let t="";for(let n=0;n<e.length;n+=1){if(e[n]==="\\\\"){let r=e[n+1];if(r!==void 0&&/[\\n\\r\\f]/.test(r)){n=Ng(e,n+1)-1;continue}let o=kc(e,n);if(o){t+=o.value,n=o.end-1;continue}}t+=e[n]}return t}function Nc(e){return Array.from(e,t=>{let n=t.charCodeAt(0);return n===0?"\\uFFFD":n<32||n===127?`\\\\${n.toString(16)} `:t===\'"\'||t==="\\\\"?`\\\\${t}`:t}).join("")}function ER(e,t){return e?{kind:"any"}:t===void 0?{kind:"none"}:{kind:"named",prefix:t}}function vR(e,t){return e[t]==="|"&&e[t+1]!=="="}function AR(e,t){let n=e[t]==="*",r=n?{value:"*",end:t+1}:si(e,t),o=ms(e,r?.end??t);if(!vR(e,o))return n?null:r?{token:r,namespace:{kind:"none"}}:null;let i=si(e,ms(e,o+1));return i?{token:i,namespace:ER(n,r?.value)}:null}function wR(e){if(e[0]!=="[")return null;let t=ai(e,1),n=AR(e,t);if(!n)return null;let{token:r,namespace:o}=n;return{name:r.value,rawName:e.slice(t,r.end),namespace:o,end:r.end}}function _R(e,t){let n=/^(?:"((?:\\\\[\\s\\S]|[^"\\\\])*)"|\'((?:\\\\[\\s\\S]|[^\'\\\\])*)\')/.exec(e.slice(t));return n?{value:SR(n[1]??n[2]),end:t+n[0].length}:si(e,t)}function TR(e,t){let n=ai(e,t),r=si(e,n);if(r){if(!/^[is]$/i.test(r.value))return null;n=ai(e,r.end)}return e[n]!=="]"||n!==e.length-1?null:{flag:r?.value}}function Ig(e){let t=wR(e);if(!t)return null;let n=ai(e,t.end),o=["=","~=","|=","^=","$=","*="].find(l=>e.startsWith(l,n));if(!o)return null;let i=_R(e,ai(e,n+o.length));if(!i)return null;let a=TR(e,i.end);return a?{name:t.name,rawName:t.rawName,namespace:t.namespace,operator:o,value:i.value,flag:a.flag}:null}function Fc(e,t){return e.replace(Pg,n=>n.startsWith("[")?t(n):n)}var Nt="data-hf-svg-reference-aliases";function hs(e,t,n,r){let o={"=":(f,m)=>f===m,"~=":(f,m)=>f.split(/[ \\t\\r\\n\\f]+/).includes(m),"|=":(f,m)=>f===m||f.startsWith(m+"-"),"^=":(f,m)=>f.startsWith(m),"$=":(f,m)=>f.endsWith(m),"*=":(f,m)=>f.includes(m)},i=(f,m,b)=>!m&&b!=="="&&b!=="|="?!1:o[b](f,m),a=f=>f.replace(/[A-Z]/g,m=>m.toLowerCase()),l=f=>{let m=Ig(f);if(!m)return f;let{name:b,rawName:h,namespace:y,operator:x,value:E,flag:v}=m;if(y.kind==="named"!=(r!==void 0))return f;let T=v?.toLowerCase()==="i"?a:L=>L,H=a(b),U=n.filter(L=>{let G=y.kind==="none"?L.name:L.localName,C=y.kind==="named"?r.get(y.prefix):null;return(y.kind==="any"||L.namespaceURI===C)&&a(G)===H}),M=new Set([f]);for(let L of U)i(T(L.before),T(E),x)&&M.add(`[${h}="${Nc(L.after)}"${v?` ${v}`:""}]`);return M.size===1?f:`:is(${[...M].join(", ")})`};if(r)return Fc(e,l);let s=new Map(t.map(({id:f,replacement:m})=>[f,m])),c=new Map;for(let f of n){if(f.name!=="id"||f.before===f.after||s.has(f.before))continue;let m=c.get(f.before);m||(m=new Set([`#${an(f.before)}`]),c.set(f.before,m)),m.add(`#${an(f.after)}`)}for(let[f,m]of c)s.set(f,`:is(${[...m].join(", ")})`);let d=ps(e,[...s.keys()],f=>s.get(f));return Fc(d,l)}function br(e,t,n=!0){let r=[],i=(n?[...e.querySelectorAll(`[${t}]`)]:[]).map(l=>l.getAttribute(t)),a=e.getAttribute?.(t);a&&i.unshift(a);for(let l of i){let s;try{s=JSON.parse(l)}catch{continue}if(!Array.isArray(s))continue;let c=s;for(let d of c){if(!RR(d))continue;let{name:f,localName:m,namespaceURI:b,before:h,after:y}=d;r.push({name:f,localName:m,namespaceURI:b,before:h,after:y})}}return r}function RR(e){if(!e||typeof e!="object")return!1;let{name:t,localName:n,namespaceURI:r,before:o,after:i}=e;return typeof t=="string"&&typeof n=="string"&&(r===null||typeof r=="string")&&typeof o=="string"&&typeof i=="string"}function MR(e){let t=[],n=[],r=!1,o,i=new WeakMap,a=(c,d)=>{for(let f of c){if("selectorText"in f){let m=f,b=i.get(m),h=m.selectorText,y=b?.applied===h?b.authored:h,x=hs(y,[],n,d);x!==h&&(m.selectorText=x),x===y?i.delete(m):i.set(m,{authored:y,applied:m.selectorText})}"cssRules"in f&&a(f.cssRules,d)}},l=()=>{if(n.length)for(let c of e.document.styleSheets){let d;try{d=c.cssRules}catch{continue}let f=new Map;for(let m of d){if(!("namespaceURI"in m))continue;let{prefix:b,namespaceURI:h}=m;b&&f.set(b,h||null)}f.size&&a(d,f)}},s={rewrite:(c,d=[])=>{if(typeof c!="string"||!c.includes("#")&&!c.includes("["))return c;let f=hs(c,d.length?[...d,...t]:t,n);if(f!==c){if(!o){let m=e.document.createElement("div");o=m.matches.bind(m)}o(c)}return f},refresh(){n=br(e.document,Nt).filter(m=>m.before!==m.after);let c=new Set(n.filter(m=>m.name==="id").map(m=>m.before)),d=new Set;t=[];for(let m of e.document.querySelectorAll("[data-hf-authored-id][id]")){let b=m.getAttribute("data-hf-authored-id");if(!b||b===m.id||d.has(b)||c.has(b))continue;d.add(b);let h=Nc(b);t.push({id:b,replacement:`:is(#${an(b)}, [data-hf-authored-id="${h}"])`})}if(l(),r||!t.length&&!n.length)return;let f=e.Element.prototype;f.querySelector=new Proxy(f.querySelector,{apply(m,b,h){return Reflect.apply(m,b,[s.rewrite(h[0])])}}),f.querySelectorAll=new Proxy(f.querySelectorAll,{apply(m,b,h){return Reflect.apply(m,b,[s.rewrite(h[0])])}}),r=!0}};e.__hfSvgSelectorAliases=s,s.refresh()}function yr(){let e=window;e.__hfSvgSelectorAliases?e.__hfSvgSelectorAliases.refresh():MR(e)}function gs(){return globalThis}function li(e){let t="unknown error";try{e instanceof Error?(t=`${e.name}: ${e.message}`,t+=LR(e,t)):t=String(e)}catch(n){$("runtime.startupError",n)}t=t.replace(/\\s+/g," ").trim(),window.__hfStartupError=`HyperFrames runtime failed: ${t}. Check the composition\'s scripts and window.__timelines entries; if they look right, report this as a HyperFrames bug.`}var Dg="[hyperframes] scene timeline callback threw:";function $(e,t){if(typeof window>"u")return;let n=gs(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(o){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&globalThis.console.debug(`[hyperframes] ${e} swallowed:`,t)}function kR(e){let t=/(?:\\(|@|\\bat )(\\S+?):\\d+(?::\\d+)?\\)?$/.exec(e)?.[1];return!t||t.startsWith("hyperframes://")?!1:t.startsWith("hyperframes-composition://")||/\\.html?(?:[?#]|$)/i.test(t)||typeof document<"u"&&t===document.URL}function LR(e,t){try{let n=e.stack;if(typeof n!="string")return"";let i=(n===t||n.startsWith(`${t}\n`)||n.startsWith(`${t}\\r`)?n.slice(t.length):n).split(/[\\r\\n]+/).map(s=>s.trim().replace(/\\s+/g," ")).filter(s=>/^at\\s+\\S/.test(s)||/^[^@]*@.+:\\d+(?::\\d+)?$/.test(s)),a=i.slice(0,3),l=i.find(kR);return l&&!a.includes(l)&&a.push(l),a.length?` [thrown at: ${a.join(" <- ")}]`:""}catch(n){return $("runtime.startupError.stack",n),""}}var bs="hyperframes-studio-preview",Og="capture",xr="data-hf-upcoming",ys="data-hf-preview-lazy";var Sr="data-hf-preview-raster",zt="data-hf-autostamped",We="data-hf-clip-hidden",Ft="data-hf-far-scene",Ln="data-hf-parked-scene",xs=[xr,Ft,Ln,ys,Sr,zt];var Hg="http://www.w3.org/1999/xhtml";function Ge(e){return e!=null&&e.nodeType===1}function Te(e){return Ge(e)&&e.namespaceURI===Hg}function Er(e,t){return Te(e)&&e.localName===t}function Re(e){return Er(e,"video")}function vr(e){return Er(e,"audio")}function Gg(e){return Er(e,"source")}function Ce(e){return Re(e)||vr(e)}function et(e){return Er(e,"img")}function sn(e){return Er(e,"canvas")}function Bg(e){return Er(e,"style")}function Ug(e){return Er(e,"link")}function Ar(e){return Ge(e)&&(e.namespaceURI===Hg||e.namespaceURI==="http://www.w3.org/2000/svg")}function Wg(e,t=""){return e.style.setProperty("visibility","visible",t),e.hasAttribute(We)?(e.removeAttribute(We),function(){e.setAttribute(We,"")}):()=>{}}function Vg(){let e=window;return(e.HyperShader!==void 0||e.__hf?.transitions!==void 0)&&e.__hfClipRevealAware!==!0}var jg="data-hf-first-pass-hide",$g="[data-start]:not(video, audio, img) { visibility: hidden !important; }",NR=\'img[loading="lazy"] { display: none !important; }\',Dc="data-hf-skip-hidden-images";var Kg=`[data-start]:not(video, audio, img, [${xr}], [${zt}])`,Ss=`${Kg}[${We}]`,Yg=`meta[name="${bs}"]`,Ic="data-hf-hidden-clip-contents",qg=`[${We}][${We}]`,zg=`[${We}][style*="visibility: hidden"]`,Xg=e=>`${Kg}${e} img { display: none !important; }`,Jg=e=>{let t=[e,`${e} *`].flatMap(n=>[n,`${n}::before`,`${n}::after`]).join(", ");return`${e} * { visibility: hidden !important; } ${t} { filter: none !important; }`};function Qg(e=()=>!0){return Oc(Array.from(document.querySelectorAll(`[${We}]`)).filter(e))}function Oc(e){let t=e.map(n=>Wg(n));return()=>{for(let n of e)n.style.getPropertyValue("visibility")!=="hidden"&&n.style.setProperty("visibility","hidden","important");for(let n of t)n()}}function Pc(e,t,n){let r=document.createElement("style");r.setAttribute(t,""),r.textContent=n,e.appendChild(r)}function Es(){return document.querySelector(Yg)!==null}function Hc(){return document.querySelector(`style[${Dc}]`)!==null}function Zg(){if(typeof document>"u")return;let e=document.head??document.documentElement;if(!e)return;let t=document.querySelector(Yg),n=t!==null,r=t?.getAttribute("content")===Og;n&&!r&&!Hc()&&Pc(e,Dc,Xg(qg)),document.querySelector(`style[${Ic}]`)||Pc(e,Ic,Jg(qg));let o=window;if(o.__hfFirstPassHidden||o.__hyperframeRuntimeBootstrapped)return;let i=n?`${$g} ${NR}`:$g;Pc(e,jg,i),o.__hfFirstPassHidden=!0}function e0(){let e=window;if(!e.__hfFirstPassHidden)return!1;e.__hfFirstPassHidden=!1;for(let t of document.querySelectorAll(`style[${jg}]`))t.remove();return!0}function t0(){if(!Vg())return;let e=document.querySelector(`style[${Dc}]`);e&&(e.textContent=Xg(zg));let t=document.querySelector(`style[${Ic}]`);t&&(t.textContent=Jg(zg))}var FR=new Set(["transform","translate","rotate","scale"]),vs=`[${Sr}]`,PR=`${vs} { will-change: auto !important; }`,n0=new Set([...xs,We]),wr=null,_r=null,As=null,Gc=null,_t=new Set,r0=new WeakMap;function IR(e){return e.willChange.split(",").every(t=>FR.has(t.trim()))}function Bc(e,t,n=!0){for(let r of n?[null,"::before","::after"]:["::before","::after"]){let o=getComputedStyle(e,r);if(!(r&&o.content==="none")&&(o.position==="fixed"||!t&&(o.zIndex!=="auto"||o.mixBlendMode!=="normal")))return!0}return!1}function DR(e,t){if(t.position==="static")return!1;let n=t.zIndex!=="auto";if(Bc(e,n,!1))return!1;for(let r of e.querySelectorAll("*"))if(Bc(r,n))return!1;return!0}function o0(e,t){return`${t.zIndex}|${e.style?.willChange??""}`}function Wc(e,t){if(e===wr)return!1;let n=_t.has(e);n&&t&&ui(e,!1);let r=getComputedStyle(e),i=(n&&!t||IR(r))&&DR(e,r);return i&&r0.set(e,o0(e,r)),i}function ui(e,t){e.toggleAttribute(Sr,t),t?_t.add(e):_t.delete(e)}function OR(e){e.hasAttribute(Sr)&&_t.add(e)}function i0(e,t){t!==_t.has(e)&&ui(e,t)}function HR(e,t){i0(e,Wc(e,t))}function a0(e){let t=e.parentElement?.closest(vs);for(;t;)Bc(e,getComputedStyle(t).zIndex!=="auto")&&ui(t,!1),t=t.parentElement?.closest(vs)}function GR(){let e=[],t=(n,r)=>{for(let o of n){let i=o.type===CSSRule.STYLE_RULE;i&&o.style.getPropertyValue("will-change")&&e.push(r?"*":o.selectorText);let a=o.styleSheet;a&&t(a.cssRules,r),"cssRules"in o&&t(o.cssRules,r||i)}};try{for(let n of[...document.styleSheets,...document.adoptedStyleSheets??[]])n!==wr?.sheet&&t(n.cssRules,!1);document.createDocumentFragment().querySelector(e.join(",")||"*")}catch{return"*"}return e.join(",")}function s0(){return As??(As=GR())}function l0(e){if(_t.has(e)||e.style?.getPropertyValue("will-change"))return!0;let t=s0();return t!==""&&e.matches(t)}function u0(e,t){let n=[];for(let r of[e,...e.querySelectorAll("*")]){if(t.checked.has(r))continue;t.checked.add(r),OR(r);let o=r===e||t.changed.has(r);n.push([r,l0(r)&&Wc(r,o)])}for(let[r,o]of n)i0(r,o);if(_t.size)for(let[r]of n)a0(r)}function BR(e){if(_t.has(e)){let t=getComputedStyle(e);(t.position==="static"||o0(e,t)!==r0.get(e))&&HR(e,!0)}a0(e)}function c0(){for(let e of document.querySelectorAll(vs))ui(e,!1);_t.clear()}function Uc(){c0(),As=null;let e=[...document.querySelectorAll("*")].filter(t=>l0(t)&&Wc(t,!0));for(let t of e)ui(t,!0);Vc()}function UR(e,t){!Ge(e.target)||n0.has(e.attributeName??"")||(e.attributeName==="style"?BR(e.target):u0(e.target,t))}function WR(e){return[...e.addedNodes].filter(t=>Ge(t)&&(t.localName==="style"||t.localName==="link"))}function VR(e){let t=new Set;for(let n of e){let r=n.attributeName;r===null||r==="style"||n0.has(r)||Ge(n.target)&&t.add(n.target)}return t}function Vc(){let e=_t.size>0||s0()!=="";!_r||e===Gc||(Gc=e,_r.observe(document.documentElement,{subtree:!0,childList:!0,attributes:e}))}function $R(e){if(e.some(t=>t.removedNodes.length))for(let t of _t)t.isConnected||_t.delete(t)}function qR(e){let t=e.flatMap(WR);for(let r of t)r.addEventListener("load",()=>_r&&Uc(),{once:!0});if(t.length)return Uc();$R(e);let n={changed:VR(e),checked:new Set};for(let r of e)if(r.type==="attributes")UR(r,n);else for(let o of r.addedNodes)Ge(o)&&u0(o,n);Vc()}function zR(){_r?.disconnect(),_r=null,wr?.remove(),wr=null,As=null,Gc=null,c0()}function d0(e){if(!(!(e>0)||!Number.isFinite(e))){if(e>=1)return zR();_r||(wr=document.createElement("style"),wr.textContent=PR,(document.head??document.documentElement).append(wr),Uc(),_r=new MutationObserver(qR),Vc())}}var gt="data-hf-scene",Nn="hf-scene-parts",$c="data-hf-scene-fonts",qc=e=>e.match(/@font-face\\s*\\{[^}]*\\}/gi)??[],Fn="data-hf-scene-no-swap";var jR=`[${gt}]:not(style, script)`,KR=new Set(["absolute","fixed"]);function YR(e,t){let n=e.flatMap((a,l)=>a.start<=t&&t<=a.end?[l]:[]),r=e.filter(a=>a.start<=t).length-1,o=n.length>0?n[0]:r,i=n.length>0?n[n.length-1]:r;return e.map((a,l)=>l>=o-1&&l<=i+1)}function XR(e,t){let n=YR(e.map(r=>r.span),t);return new Set(e.filter((r,o)=>!n[o]).map(r=>r.host))}var f0=(e,t)=>({size:t,outOfFlow:KR.has(getComputedStyle(e).position)});function JR(){let e=new WeakMap,t=typeof ResizeObserver=="function"?new ResizeObserver(r=>{for(let{target:o,borderBoxSize:i}of r){let a=i?.[0];a&&e.set(o,f0(o,`${Math.round(a.inlineSize)}px ${Math.round(a.blockSize)}px`))}}):null,n=[];return{watch(r){for(let o of n)o.isConnected||t?.unobserve(o);for(let o of r)t?.observe(o);n=r},of:r=>e.get(r)??f0(r,`${r.offsetWidth}px ${r.offsetHeight}px`)}}function m0(e){let t=null,n=null,r=new Map,o=JR(),i=s=>s.map(c=>({host:c,span:e(c)})).filter(c=>Number.isFinite(c.span?.start)).sort((c,d)=>c.span.start-d.span.start),a=s=>{let c=!1;for(let d of s){if(d.hasAttribute(Ft))continue;let{size:f,outOfFlow:m}=o.of(d);if(!m){s.delete(d);continue}let b=d.getAttribute(gt);c||(c=r.get(b)!==f),r.set(b,f)}return c},l=()=>{n??(n=document.createElement("style")),n.textContent=[`[${Ft}] { content-visibility: hidden; }`,...Array.from(r,([s,c])=>`[${gt}="${CSS.escape(s)}"][${Ft}] { contain-intrinsic-size: ${c}; }`)].join(`\n`),n.isConnected||document.head.appendChild(n)};return s=>{if((!t||t.some(d=>!d.isConnected))&&o.watch(t=Array.from(document.querySelectorAll(jR))),t.length===0)return;let c=XR(i(t),s);(a(c)||!n?.isConnected)&&l();for(let d of t)c.has(d)!==d.hasAttribute(Ft)&&d.toggleAttribute(Ft)}}var Pn="data-hf-authored-duration",In="data-hf-authored-end";function ci(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 to(e){let t=ci(e.start);if(t==null)return null;let n=Math.max(0,t),r=ci(e.duration),o=ci(e.authoredDuration),i=r!=null&&r>0?r:o!=null&&o>0?o:null;if(i!=null)return{start:n,duration:i,end:n+i};let a=ci(e.end),l=ci(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var no=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),_3=Object.freeze([no.start,no.duration,no.trackIndex]),T3=Object.freeze([no.derivedEnd]),C3=Object.freeze([no.derivedEnd,no.legacyTrack]);function Dn(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var h0=/^[A-Za-z0-9_.:-]+$/;function g0(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function p0(e,t){let n=t;for(;n>=0&&g0(e,n);)n--;return n}function QR(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function ZR(e){let t=e.length-1;if(!g0(e,t))return null;let n=p0(e,t);return e[n]==="."&&(n=p0(e,n-1)),n+1}function e1(e){let t=ZR(e);if(t==null)return null;let n=QR(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let o=e.slice(0,n).trim();if(!h0.test(o))return null;let i=Number(e.slice(t));return Number.isFinite(i)?{refId:o,operator:r,magnitude:i}:null}function ws(e){let t=(e??"").trim();if(!t)return null;let n=Dn(t);if(n!=null)return{kind:"absolute",value:n};if(h0.test(t))return{kind:"reference",refId:t,offset:0};let r=e1(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var b0=e=>{let t=Dn(e);return t!==null&&t>=0?t:null};function _s(e){return b0(e("data-playback-start"))??b0(e("data-media-start"))??0}var di=.1,fi=10;function zc(e){return Number.isFinite(e)&&e>0?Math.max(di,Math.min(fi,e)):1}function y0(e,t=1){let n=Number.parseFloat(e("data-playback-rate")??"");return zc(Number.isFinite(n)&&n>0?n:t)}function jc(e){let t=Dn(e("data-duration"));return t!==null&&t>0?t:null}function x0(e,t){let n=jc(e);if(n!==null)return n;let r=Dn(e("data-end"));return r!==null?r-t:null}var t1=3;function Kc(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/zc(n):null}function Yc(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:o,playbackRate:i}=e;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(t==="img")return{seconds:t1,source:"default"};if(r===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=Kc(r,o,i);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var Hn="data-fx-chain",N3=Hn.slice(5),S0=1,mi=(e="frequency",t="Frequency",n=1e3,r=20,o=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:o,step:1,default:n,scale:"log",automatable:!0}),Xc=(e=.707,t="Bandwidth: higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),Ts=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),E0={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},A0=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Ts(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[mi("frequency","Frequency",1e3),Ts(-40,40,0),Xc(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[mi("frequency","Frequency",200,20,2e3),Ts(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[mi("frequency","Frequency",4e3,500,2e4),Ts(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies: the usual fix for rumble on a voice.",params:[mi("frequency","Cutoff",300,20,2e4),Xc(.707),E0],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies, which darkens or muffles a track.",params:[mi("frequency","Cutoff",8e3,100,2e4),Xc(.707),E0],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Peak limiter that follows the signal\'s level. It has no lookahead, so a fast peak or an inter-sample peak can pass the ceiling; use the true-peak limiter for a delivery limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"truepeak",label:"True-peak limiter",group:"dynamics",description:"Lookahead limiter that holds a 4x estimate of the inter-sample peak at a dBTP ceiling; full-band noise can land up to about 1.7 dB above it. Adds lookahead plus about 0.3 ms of latency.",params:[{kind:"number",key:"ceiling",label:"Ceiling",unit:"dBTP",min:-24,max:0,step:.1,default:-1,hint:"Target true peak, measured on a 4x oversampled signal. Dense full-band sound can end up to about 1.7 dB above it."},{kind:"number",key:"lookahead",label:"Lookahead",unit:"ms",min:.5,max:10,step:.1,default:3,hint:"How far ahead the gain starts falling. Longer is smoother and adds the same latency."},{kind:"number",key:"release",label:"Release",unit:"ms",min:10,max:2e3,step:1,default:80,scale:"log"}],web:"worklet-truepeak"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times, a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],Jc=new Map(A0.map(e=>[e.id,e]));function pi(e){return Jc.get(e)}var F3=A0.map(e=>e.id);function hi(e,t){let n=Jc.get(e);if(!n)return{};let r={};for(let o of n.params){let i=t?.[o.key];if(o.kind==="enum"){let l=o.options.some(s=>s.value===i);r[o.key]=l?i:o.default;continue}let a=typeof i=="number"?i:typeof i=="string"&&i.trim()!==""?Number(i):Number.NaN;r[o.key]=Number.isFinite(a)?Math.min(o.max,Math.max(o.min,a)):o.default}return r}var On=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function w0(e){let t;try{t=JSON.parse(e)}catch(o){throw new On(`Chain file is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new On("Chain file must be a JSON object.");let n=t;if(n.version!==S0)throw new On(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new On("Chain file is missing a `nodes` array.");let r=n.nodes.map(n1);return{version:S0,nodes:r}}function gi(e){return e.nodes.filter(t=>t.enabled!==!1)}function n1(e,t){if(typeof e!="object"||e===null)throw new On(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Jc.has(n.type))throw new On(`Node ${t} has unknown effect type: ${String(n.type)}`);return o1({type:n.type,id:Cs(n.id),fromCarve:v0(n.fromCarve),fromPreset:Cs(n.fromPreset),label:Cs(n.label),fromEq:Cs(n.fromEq),fromLeveller:v0(n.fromLeveller),presetAmount:r1(n.presetAmount),enabled:n.enabled!==!1,params:hi(n.type,n.params??void 0)})}function Cs(e){return typeof e=="string"&&e?e:void 0}function v0(e){return e===!0?!0:void 0}function r1(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function o1(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function i1(e){return 10**(e/20)}var Tr=i1(12);function Ve(e){return Number.isFinite(e)?Math.max(0,Math.min(Tr,e)):1}function Ms(e,t){return Ve(e*t)}function _0(e,t){return t?1:Ve(e)}function Rs(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function T0(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,o=n?.set;if(!r||!o)return t();let i=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>i,set:a=>{i=Number(a),o.call(e,Rs(i))}});try{return t()}finally{delete e.volume,o.call(e,Rs(i))}}var un="data-automation",U3=un.slice(5),Ls=1,a1=512,ln=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},ro="volume",Ns="rate";function yi(e){if(e===ro)return{kind:"volume"};if(e===Ns)return{kind:"rate"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===s1){let o=t[2];return o?{kind:"preset",presetId:o}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var s1="preset";var l1={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},Fs={min:0,max:Tr,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function u1(e){return Math.min(4096,Math.max(2,Math.ceil(e*30)))}function Qc(e){return!!e.curve||e.viaX!==void 0&&e.viaY!==void 0}function ks(e,t,n=!1){let r=Ve(t),o=Ms(r,e);return n&&r>0?o/r:o}function C0(e,t,n=!1){let r=[],o=e.points,i=Ve(t);for(let a=0;a<o.length;a+=1){let l=o[a],s=o[a+1];if(!(s!==void 0&&(i*l.v-Tr)*(i*s.v-Tr)<0)){r.push({...l,v:ks(l.v,t,n)});continue}if(r.push({t:l.t,v:ks(l.v,t,n)}),Qc(l)){let d=u1(s.t-l.t);for(let f=1;f<d;f+=1){let m=l.t+(s.t-l.t)*f/d;r.push({t:m,v:ks(jt(e,m),t,n)})}}else{let d=l.t+(Tr/i-l.v)/(s.v-l.v)*(s.t-l.t);r.push({t:d,v:ks(Tr/i,i,n)})}}return r}var R0={min:di,max:fi,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function Zc(e,t){let n=yi(e);if(!n)return null;if(n.kind==="volume")return Fs;if(n.kind==="rate")return R0;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...l1,label:`${n.presetId} \\xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let o=pi(r.type),i=o?.params.find(a=>a.key===n.param);return!i||i.kind!=="number"?null:{min:i.min,max:i.max,step:i.step,unit:i.unit,label:`${o?.label??r.type} \\xB7 ${i.label}`,scale:i.scale==="log"&&i.min>0?"log":"linear",default:i.default}}function bi(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function c1(e){let t=bi(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function M0(e,t){let n=bi(e),r=bi(t);if(n===null||r===null)return null;let o=l=>Math.min(.999,Math.max(.001,l)),i=o(n),a=o(r);return Math.abs(i-a)<1e-6?null:{x:i,y:a}}function d1(e){let t=c1(e?.curve),n=M0(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function f1(e,t){let n=bi(e?.t),r=bi(e?.v);if(n===null||r===null)return null;let o=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:o,...d1(e)}}function k0(e,t){let n=e.map(o=>f1(o,t)).filter(o=>o!==null).sort((o,i)=>o.t-i.t),r=[];for(let o of n)r.length>0&&r[r.length-1].t===o.t?r[r.length-1]=o:r.push(o);return r.slice(0,a1)}function m1(e){let t=[];for(let n of e.lanes){if(!yi(n.target))continue;let r=n.target===ro?Fs:n.target===Ns?R0:null,o=k0(n.points??[],r);o.length>0&&t.push({target:n.target,points:o})}return{version:Ls,lanes:t}}function L0(e,t){let n=[];for(let r of e.lanes){let o=Zc(r.target,t);if(!o)continue;let i=k0(r.points,o);i.length>0&&n.push({target:r.target,points:i})}return{version:Ls,lanes:n}}function Ps(e){let t;try{t=JSON.parse(e)}catch(o){throw new ln(`Automation is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new ln("Automation must be a JSON object.");let n=t;if(n.version!==Ls)throw new ln(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new ln("Automation is missing a `lanes` array.");let r=n.lanes.map((o,i)=>{if(typeof o!="object"||o===null)throw new ln(`Lane ${i} is not an object.`);let a=o;if(typeof a.target!="string"||!yi(a.target))throw new ln(`Lane ${i} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new ln(`Lane ${i} is missing a \\`points\\` array.`);return{target:a.target,points:a.points}});return m1({version:Ls,lanes:r})}function p1(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function h1(e,t){let n=e-.5,r=t-.5,o=.999,i=1e6,a=n>0?n/(o-e):n<0?-n/(e-(1-o)):0,l=r>0?r/(o-t):r<0?-r/(t-(1-o)):0,s=Math.min(i,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function g1(e,t,n){let{cx:r,cy:o,w:i}=h1(t,n),a=2-2*i,l=e*a-1+2*i*r,s=-e*a-2*i*r,c=b1(l,s,e),d=1-c,f=d*d+2*i*c*d+c*c;return f>0?(2*i*o*c*d+c*c)/f:e}function b1(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),o=(-t+r)/(2*e),i=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(o)?Math.min(1,Math.max(0,o)):a(i)?Math.min(1,Math.max(0,i)):n}function y1(e,t){let n=M0(t.viaX,t.viaY);return n?g1(Math.min(1,Math.max(0,e)),n.x,n.y):p1(e,t.curve)}function x1(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function jt(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let o=r[0];if(t<=o.t)return o.v;let i=r[r.length-1];if(t>=i.t)return i.v;let a=0,l=r.length-1;for(;l-a>1;){let f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],c=r[l],d=c.t-s.t;return d<=0?c.v:x1(s.v,c.v,y1((t-s.t)/d,s),n)}function N0(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function F0(e,t,n,r,o="linear"){let i=Math.max(2,Math.floor(r)),a=new Float32Array(i),l=n-t;for(let s=0;s<i;s+=1)a[s]=jt(e,t+l*s/(i-1),o);return a}var Is=new Map,S1=64;function ed(e,t=ro){let n=`${t}\\0${e}`,r=Is.get(n);if(r!==void 0)return r;let o=null;try{o=Ps(e).lanes.find(i=>i.target===t)??null}catch{o=null}return Is.size>S1&&Is.clear(),Is.set(n,o),o}function P0(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(un):null)??"";if(!n)return null;let r=ed(n);return!r||r.points.length===0?null:jt(r,t)}var I0=48,D0=new WeakMap;function E1(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,o=[0],i=[0],a=s=>{let c=o[o.length-1];if(s<=c)return;let d=jt(e,c,"log");o.push(s),i.push(i[i.length-1]+(d+jt(e,s,"log"))/2*(s-c))},l=Math.max(0,t[0].t);a(l);for(let s=1;s<t.length;s+=1){let c=t[s-1].t,d=t[s].t;if(!(d<=0))for(let f=1;f<=I0;f+=1)a(Math.max(c,0)+(d-c)*f/I0)}return{ts:Float64Array.from(o),ss:Float64Array.from(i),firstRate:n,lastRate:r}}function O0(e){let t=D0.get(e);return t||(t=E1(e),D0.set(e,t)),t}function td(e){return typeof e!="number"&&e.points.length>0}function xi(e,t){return typeof e=="number"?e:td(e)?jt(e,t,"log"):1}function H0(e,t,n){let r=0,o=e.length-1;for(;o-r>1;){let i=r+o>>1;e[i]<=n?r=i:o=i}return t[r]+(t[o]-t[r])*(n-e[r])/(e[o]-e[r])}function Gn(e,t){if(typeof e=="number")return t*e;if(!td(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=O0(e),a=n.length-1;return t<=0?t*o:t>=n[a]?r[a]+(t-n[a])*i:H0(n,r,t)}function cn(e,t){if(typeof e=="number")return t/e;if(!td(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=O0(e),a=n.length-1;return t<=0?t/o:t>=r[a]?n[a]+(t-r[a])/i:H0(r,n,t)}function v1(e){return e?ed(e,Ns):null}function G0(e,t){return v1(e)??t}var K3=[{id:"montage",label:"Montage",points:[[0,.9],[.15,.3],[.5,2.5],[.85,.3],[1,.9]]},{id:"hero",label:"Hero",points:[[0,1],[.25,1.6],[.5,.25],[.75,1.6],[1,1]]},{id:"bullet",label:"Bullet",points:[[0,3],[.4,3],[.5,.15],[.6,3],[1,3]]},{id:"jump-cut",label:"Jump cut",points:[[0,.5],[.24,.5],[.26,3],[.5,3],[.52,.5],[.74,.5],[.76,3],[1,3]]},{id:"flash-in",label:"Flash in",points:[[0,.3],[.6,.6],[1,5]]},{id:"flash-out",label:"Flash out",points:[[0,5],[.4,.6],[1,.3]]},{id:"ramp-in",label:"Ramp in",points:[[0,.5],[1,1]]},{id:"ramp-out",label:"Ramp out",points:[[0,1],[1,.5]]},{id:"slowmo-middle",label:"Slow-mo middle",points:[[0,1],[1/3,.35],[2/3,.35],[1,1]]}];function Ue(e){return Dn(e)}function lt(e){return y0(t=>e.getAttribute(t),Ce(e)?e.defaultPlaybackRate:1)}function St(e){return G0(e.getAttribute("data-automation"),lt(e))}function Tt(e){return _s(t=>e.getAttribute(t))}function Kt(e,t){return A1(t,Tt(e),St(e))}function oo(e){let t=Yc({tag:"video",authoredDurationSeconds:jc(n=>e.getAttribute(n)),sourceDurationSeconds:Number.isFinite(e.duration)?e.duration:null,mediaStartSeconds:Tt(e),playbackRate:lt(e)});return t.source==="media"?Kt(e,e.duration):t.seconds}function io(e,t=0){return!et(e)||!e.hasAttribute("data-start")&&!e.hasAttribute("data-track-index")?null:Yc({tag:"img",authoredDurationSeconds:x0(n=>e.getAttribute(n),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function A1(e,t,n){return typeof n=="number"?Kc(e,t,n):Number.isFinite(e)?cn(n,Math.max(0,e-t)):null}var w1=e=>e.paused?.()===!0?(e.startTime?.()??0)+(e.totalDuration?.()??0)/Math.abs(e.timeScale?.()||1):0;function dn(e){try{if(typeof e?.duration!="function")return null;let t=e.getChildren?.(!1,!1,!0),n=Array.isArray(t)?t:[],r=Math.max(Number(e.duration()),...n.map(w1));return Number.isFinite(r)?r:null}catch(t){return $("runtime.timelineDuration",t),null}}function Cr(e){if(e==null||e.trim()==="")return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function ao(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 Te(t)?t:e.querySelector("[data-composition-id]")}var _1=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function nd(e){return e.id||e.getAttribute("data-hf-id")||null}function T1(e){return Ue(e)}function C1(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=dn(t[n]);return r!=null&&r>0?r:null}function R1(e){return Ce(e)?Number.isFinite(e.duration)?Kt(e,e.duration):null:io(e)}function M1(e,t,n,r){let o=T1(e.getAttribute("data-duration"));return o!=null&&o>0?o:C1(e,t)??R1(e)??Math.max(0,n-r)}function k1(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let o=e.get(r);if(o){n.parentId=o.id,o.children.push(n);break}r=r.parentElement}}}function B0(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,o=new Map,i=Et(),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===i||_1.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(M1(l,n,r,s)<=0)continue;let c={id:nd(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};o.set(l,c)}return k1(o),{roots:Array.from(o.values()).filter(l=>l.parentId===null)}}var rd="css:root",U0=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],L1=new Set([...U0,"contain","isolation","mask-border","mix-blend-mode","opacity"]),N1=new Set(["absolute","relative"]),F1=new Set(["flex","inline-flex","grid","inline-grid"]),P1=new Set(["layout","paint","strict","content"]),I1=new Set(["size","inline-size"]);function D1(e){return e.position==="fixed"||e.position==="sticky"}function O1(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(N1.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&F1.has(n)}function H1(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:U0.some(r=>{let o=e.getPropertyValue(r);return o!==""&&o!=="none"})}function G1(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>P1.has(n))?!0:I1.has(e.getPropertyValue("container-type"))}function B1(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>L1.has(t))}function U1(e,t){return e.hasAttribute(Sr)||D1(t)||O1(e,t)||H1(t)||G1(t)?!0:B1(t)}function W1(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 Ds(e,t){let n=t?.get(e.parentElement);if(n!==void 0)return n;let r=V1(e);return t?.set(e.parentElement,r),r}function V1(e){let t=e.ownerDocument.defaultView;if(!t)return rd;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(U1(n,t.getComputedStyle(n)))return W1(n)}catch{return rd}n=n.parentElement}return rd}var Os="data-hf-media-start-basis";function W0(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function $1(e){return W0(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function V0(e){return q0(e)?$1({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis}):e.ordinaryStart()}function $0(e){return q0(e)&&W0(e.basis)==="global"}function q0(e){return!e.hasAutoStart&&e.authoredStart!=null&&e.hostStart!==0}function od(e){return _s(t=>e.getAttribute(t))}function z0(e,t){return e-od(t)}function Rr(e,t){return t.reduce((n,r)=>{let o=Math.max(n.start,r.start);return{start:o,end:Math.max(o,Math.min(n.end,r.end))}},e)}function ut(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,o=new WeakMap,i=new WeakMap,a=new Set,l=C=>(C.hasAttribute("data-composition-id")?C.parentElement:C)?.closest("[data-composition-id]")??null,s=(C,B)=>{let O=l(B);if(O){for(let Z of O.querySelectorAll(`[id="${C}"]`))if(l(Z)===O)return Z}let Y=r.getElementById(C);return Y||(Array.from(r.querySelectorAll("[data-composition-id]")).find(Z=>Z.getAttribute("data-composition-id")===C)??null)},c=(C,B)=>n?C.getAttribute(B):null,d=C=>to({start:0,duration:C.getAttribute("data-duration"),authoredDuration:c(C,"data-hf-authored-duration")})?.duration??to({start:H(C,0),end:C.getAttribute("data-end"),authoredEnd:c(C,"data-hf-authored-end")})?.duration??null,f=C=>C!=null&&Number.isFinite(C)&&C>0?C:null,m=C=>{let B=C.getAttribute("data-composition-id");return B?f(dn(t[B])):null},b=C=>{let B=i.get(C);if(B!==void 0)return B;let O=d(C)??f(Ce(C)?Kt(C,C.duration):null)??f(io(C))??m(C);return i.set(C,O),O},h="[data-composition-src], [data-composition-id], [data-composition-file]",y=C=>C.matches(h),x=C=>!C.hasAttribute("data-composition-id")||ws(C.getAttribute("data-start"))?null:C.parentElement?.closest(`[data-start], ${h}`)??null,E=(C,B)=>z0(H(C,B),x(C)??C),v=(C,B)=>{let O=C.hasAttribute("data-composition-id")?C.parentElement?.closest("[data-composition-id]"):C.closest("[data-composition-id]");return O?E(O,B):0},T=(C,B)=>{let O=ws(C.getAttribute("data-start"));if(!O){let V=x(C);return V?H(V,B):B}if(O.kind==="absolute")return v(C,B)+Math.max(0,O.value);let Y=s(O.refId,C);if(!Y)return B;let Z=H(Y,0),J=b(Y)??0,D=Math.min(0,v(C,0));return Math.max(D,Z+J+O.offset)},H=(C,B)=>{let O=o.get(C);if(O!==void 0)return O??B;if(a.has(C))return B;a.add(C);try{let Y=T(C,B);return o.set(C,Y),Y}finally{a.delete(C)}},U=C=>{let B=C.closest("[data-composition-id]");return{authoredStart:Ue(C.getAttribute("data-start")),hostStart:B?E(B,0):0,hasAutoStart:C.hasAttribute("data-hf-auto-start"),basis:C.getAttribute(Os)}};return{resolveStartForElement:(C,B=0)=>H(C,Math.max(0,B)),resolveDurationForElement:C=>b(C),resolveMediaStartForElement:C=>{let B=U(C);return V0({...B,ordinaryStart:()=>H(C,B.hostStart)})},resolveHostStartForElement:C=>v(C,0),resolveHostSlotsForElement:C=>{let B=[];for(let O=C.parentElement;O;O=O.parentElement){if(!y(O)||x(O)||od(O)<=0)continue;let Y=H(O,0),Z=d(O);B.push({start:Y,end:Z?Y+Z:1/0})}return B},isRootGlobalMediaStartForElement:C=>Ce(C)&&$0(U(C))}}var Si=e=>4*Number.EPSILON*Math.max(1,Math.abs(e));function so(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?e===t:Math.abs(e-t)<=Si(Math.max(Math.abs(e),Math.abs(t)))}var j0=(e,t)=>e>=t||so(e,t),fn=(e,t,n)=>j0(e,t)&&e<n&&!so(e,n),q1=1e-6,lo=(e,t,n,r)=>fn(e,t,n)||j0(e,t)&&r>0&&n>=r-q1;var z1=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-width","border-style","border-color","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function id(e){return Number.isFinite(e)&&e>0?e:30}function ad(e){return Number.isFinite(e)&&e>0?e:0}function sd(e,t){let n=id(t);return Math.floor(ad(e)*n+1e-9)/n}function Y0(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return sd(e,t);let o=id(t)*r;return Math.round(ad(e)*o)/o}function K0(e,t){let n=id(t),r=ad(e),o=r*n,i=Math.round(o);return Math.abs(o-i)<=.001?i/n:r}function Hs(e,t,n){return{start:K0(e,n),end:Number.isFinite(t)?K0(t,n):t}}function X0(e,t,n=z1){for(let r of n){let o=t.getPropertyValue(r);o&&e.setProperty(r,o)}}function ld(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Ei="hf-runtime-filler",ud="runtime_media_load_failed",j1=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data","play-range"];function K1(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let o=n%r;n=r,r=o}return n||1}function Y1(e){let t=Number.isFinite(e)&&e>0?e:30,n=Math.abs(t*1001-Math.round(t*1001))<1e-6,r=Number.isInteger(t)?1:n?1001:1e6,o=Math.round(t*r),i=K1(o,r);return{numerator:o/i,denominator:r/i}}function J0(e,t,n){return Math.max(e,(Math.ceil(t*n-1e-6)-1)/n)}function cd(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Gs(e){return{protocolVersion:1,capabilities:j1,fps:Y1(e)}}function X1(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Q0(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=cd(n.fps);return r===null||!X1(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var Z0=e=>e!==null&&Number.isFinite(e)&&e>0;function vi(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if(Z0(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter(Z0);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"}}function dd(){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}}var uo=7200,mn=1/60,Ai=e=>e!==null&&e>mn?e:null;function eb(e){return{width:ao(e.getAttribute("data-width")),height:ao(e.getAttribute("data-height"))}}function tb(e,t){let n=null;for(let r of e.querySelectorAll("video[data-start], audio[data-start]")){let o=t.mediaStart(r);if(!Number.isFinite(o))continue;let i=t.mediaDuration(r);if(i==null||i<=mn)continue;let a=Math.max(0,o)+i;(!n||a>n.seconds)&&(n={seconds:a,element:r})}return n&&Ai(n.seconds)!==null?n:null}function nb(e,t){let n=[];for(let o of e.querySelectorAll("[data-composition-id][data-start]")){if(o.parentElement?.closest("[data-composition-id]")!==e)continue;let i=t.resolveStartForElement(o,0),a=t.resolveDurationForElement(o);!Number.isFinite(i)||a==null||a<=0||n.push(Math.max(0,i)+a)}let r=Ue(e.getAttribute("data-duration"));return Ai(vi({authoredDurationSeconds:null,clipEndsSeconds:[r,...n]}).seconds)}var J1=e=>e.hasAttribute("data-composition-id")||e.hasAttribute("data-composition-src");function rb(e,t,{unregisteredLottie:n}){let r=[];for(let i of e.querySelectorAll("[data-start]")){let a=t.resolveStartForElement(i,0);if(!Number.isFinite(a))continue;let l=t.resolveDurationForElement(i);l!=null?r.push(Math.max(0,a)+l):(Ce(i)||J1(i))&&r.push(null)}(n||e.querySelector("[data-lottie-src]"))&&r.push(null);let o=vi({authoredDurationSeconds:null,clipEndsSeconds:r});return o.pendingClips>0?{...o,seconds:null,source:"unresolved",reason:"a clip\'s length is pending"}:o}function ob(e){if(e.declared!==null&&Number.isFinite(e.declared)&&e.declared>0)return{seconds:e.declared,from:"declared",floorIndex:null};let t=Ai(e.timeline()),n=e.floors().map(f=>f??0),r=Math.max(0,...n),o=Number.isFinite(e.fallback)&&e.fallback>mn?e.fallback:0,i=Math.max(r,o),l=t!==null&&t>=uo&&Ai(i)!==null?null:t,s=r>=o,c=f=>({seconds:f,from:s?"floor":"fallback",floorIndex:s?n.indexOf(r):null});if(l!==null)return l>=i?{seconds:l,from:"timeline",floorIndex:null}:c(i);if(Ai(r)!==null)return c(i);if(o>0)return{seconds:o,from:"fallback",floorIndex:null};let d=e.derived();return{seconds:d>0?d:0,from:"derived",floorIndex:null}}function Bs(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return null;let o=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),i=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let s=t.timelineRegistry[a],c=dn(s);!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(Pn)||e.hasAttribute(In))&&(i==null||i<=0)&&c!=null&&c>0&&(i=c)}let l=a!==null&&e===Et(e.ownerDocument);return{start:o,end:!l&&i!=null&&i>0?o+i:Number.POSITIVE_INFINITY}}function Us(e,t){let n=Bs(e,t);if(!n)return!1;let r=t.exportRenderSeek?Hs(n.start,n.end,t.canonicalFps):n;return lo(t.currentTime,r.start,r.end,t.compositionDuration)}function _i(e){return Ue(e)}function Ti(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(Pn),r=to({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(_i).some(i=>i!=null&&i<=0)?0:null)}function ib(e){return to({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(In)})?.end??null}function fd(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 md(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function co(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 Ci(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 ab(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Ci(t);let n=e.getAttribute("data-composition-src");if(n)return Ci(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?Ci(r.getAttribute("src")):null}function Z1(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 eM(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 tM(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function wi(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function sb(e){return e.getAttribute("data-hf-original-composition-id")??e.getAttribute("data-composition-id")}function nM(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 o=sb(e);if(o)return wi(o);let i=e.id;if(i)return wi(i);let a=Z1(e);if(a)return wi(a);let l=eM(ab(e));if(l)return wi(l);let s=tM(e);return s||`${wi(t)} ${n+1}`}function pd(e){let t=new Map,r=window.__timelines??{},o=ut({timelineRegistry:r,includeAuthoredTimingAttrs:!0}),i=z=>{if(!z)return null;let ee=dn(r[z]);return ee!=null&&ee>0?ee:null},a=()=>{let z=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(z.length===0)return null;let ee=0;for(let Q of z){let fe=o.resolveMediaStartForElement(Q);if(!Number.isFinite(fe))continue;let ce=oo(Q);ce==null||ce<=0||(ee=Math.max(ee,Math.max(0,fe)+ce))}return ee>0?ee:null},l=(z,ee)=>{let Q=[],fe=null,ce=null,xe=null,re=z.parentElement;for(;re;){let ie=re.getAttribute("data-composition-id");ie&&(Q.push(ie),!xe&&re!==ee&&(xe=ie),fe==null&&(fe=o.resolveStartForElement(re,0)),ce==null&&(ce=_i(re.getAttribute("data-duration"))??i(ie)??null)),re=re.parentElement}return{parentCompositionId:xe,compositionAncestors:Q.reverse(),inheritedStart:fe,inheritedDuration:ce}},s=Et(),c=Array.from(document.querySelectorAll("[data-composition-id]")),d=s?.getAttribute("data-composition-id")??null,f=s?o.resolveStartForElement(s,0):0,m=a(),b=m!=null?Math.max(0,m-Math.max(0,f)):null,h=i(d),y=Ti(s??document.body),x=md(...c.filter(z=>z!==s).map(z=>{let ee=o.resolveStartForElement(z,0),Q=o.resolveDurationForElement(z)??i(z.getAttribute("data-composition-id"))??null;return!Number.isFinite(ee)||Q==null||Q<=0?null:Math.max(0,ee)+Q})),E=x!=null?Math.max(0,x-Math.max(0,f)):null,v=typeof h=="number"&&Number.isFinite(h)&&h>0?h:null,T=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,H=typeof b=="number"&&Number.isFinite(b)&&b>0?b:null,U=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,M=md(H,U),L=v!=null&&M!=null&&v>=uo,C=T??(L?M:md(v,H,U))??null,O=(C!=null?f+C:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),Y=(z,ee)=>!Number.isFinite(ee)||ee<=0?0:O==null||!Number.isFinite(O)?ee:!Number.isFinite(z)||z>=O?0:Math.max(0,Math.min(ee,O-z)),Z=[],J=[],D="[data-start], [data-track-index], [data-composition-id], video, audio, img",V=Array.from(document.querySelectorAll(D)),R=0,k=(z,ee)=>{if(z===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(z.tagName))return null;let Q=l(z,s),fe=z.tagName.toLowerCase(),ce=fe==="video"||fe==="audio"?o.resolveMediaStartForElement(z):o.resolveStartForElement(z,Q.inheritedStart??0),xe=z.getAttribute("data-composition-id"),re=!!xe&&xe!==d,ie=Ti(z);if(ie==null&&re&&(ie=i(xe)),ie==null&&Ce(z)&&Number.isFinite(z.duration)&&(ie=Kt(z,z.duration)),ie==null&&(ie=io(z,ce)),ie==null){let Ee=Q.inheritedDuration;if(Ee!=null&&Ee>0){let Pe=(Q.inheritedStart??0)+Ee;ie=Math.max(0,Pe-ce)}}if(ie==null||ie<=0||(ie=Y(ce,ie),ie<=0))return null;let ot=o.resolveHostSlotsForElement(z);if(ot.length>0){let Ee=Rr({start:ce,end:ce+ie},ot),Me=re;if(Ee.end<=Ee.start&&!Me)return null;ce=Ee.start,ie=Ee.end-Ee.start}let Be=xe&&xe!==d?"composition":fe==="video"?"video":fe==="audio"?"audio":fe==="img"?"image":"element";return{id:nd(z)??xe??null,label:nM(z,Be,Z.length),start:ce,duration:ie,track:co(z,ee),zIndex:fd(z),stackingContextId:Ds(z,t),kind:Be,tagName:fe,compositionId:z.getAttribute("data-composition-id"),compositionAncestors:Q.compositionAncestors,parentCompositionId:Q.parentCompositionId,nodePath:null,compositionSrc:Ci(z.getAttribute("data-composition-src")),playbackStart:Tt(z),playbackRate:lt(z),assetUrl:ab(z),timelineRole:z.getAttribute("data-timeline-role"),timelineLabel:z.getAttribute("data-timeline-label"),timelineGroup:z.getAttribute("data-timeline-group"),timelinePriority:_i(z.getAttribute("data-timeline-priority"))}},F=z=>{Z.push(z),R=Math.max(R,z.start+z.duration)};for(let[z,ee]of V.entries()){let Q=k(ee,z);Q&&F(Q)}for(let z of e.parked??[]){let ee=e.parkedClips?.get(z.name);if(!ee){let Q=V.length;ee=Array.from(z.host().querySelectorAll(D)).flatMap((fe,ce)=>k(fe,Q+ce)??[]),e.parkedClips?.set(z.name,ee)}for(let Q of ee)F(Q)}let _=new Set(Z.map(z=>z.id)),N=s?.getAttribute("data-composition-id")??null,j=N?r[N]??null:null;if(j&&s){let z=j;if(typeof z.getChildren=="function")try{let ee=z.getChildren(!0,!0,!1)??[],Q=new Map;for(let xe of s.children){let re=xe;if(!re.id)continue;let ie=re.tagName.toLowerCase();ie==="script"||ie==="style"||ie==="link"||Q.set(re,{id:re.id,start:1/0,end:-1/0})}let fe=xe=>{let re=xe;for(;re;){if(Q.has(re))return re;if(re===s)return null;re=re.parentElement}return null};for(let xe of ee){if(typeof xe.targets!="function"||typeof xe.startTime!="function"||typeof xe.duration!="function")continue;let re=xe.startTime(),ie=xe.parent;for(;ie&&ie!==j&&typeof ie.startTime=="function";)re+=ie.startTime(),ie=ie.parent;let ot=re+xe.duration();if(!(!Number.isFinite(re)||!Number.isFinite(ot)))for(let Be of xe.targets()){if(!Ge(Be))continue;let Ee=fe(Be);if(!Ee)continue;let Me=Q.get(Ee);Me&&(Me.start=Math.min(Me.start,re),Me.end=Math.max(Me.end,ot))}}let ce=Z.length>0?Math.max(...Z.map(xe=>xe.track))+1:0;for(let[xe,re]of Q){if(re.start===1/0||re.end===-1/0)continue;let ie=xe;if(_.has(ie.id))continue;let ot=Math.max(0,re.end-re.start);if(ot<=0)continue;let Be=Y(re.start,ot);Be<=0||(R=Math.max(R,re.start+Be),Z.push({id:ie.id,label:ie.getAttribute("data-timeline-label")??ie.getAttribute("data-label")??ie.getAttribute("aria-label")??ie.id,start:re.start,duration:Be,track:co(ie,ce),zIndex:fd(ie),stackingContextId:Ds(ie,t),kind:"element",tagName:ie.tagName.toLowerCase(),compositionId:ie.getAttribute("data-composition-id"),compositionAncestors:N?[N]:[],parentCompositionId:N,nodePath:null,compositionSrc:null,playbackStart:Tt(ie),playbackRate:lt(ie),assetUrl:null,timelineRole:ie.getAttribute("data-timeline-role"),timelineLabel:ie.getAttribute("data-timeline-label"),timelineGroup:ie.getAttribute("data-timeline-group"),timelinePriority:_i(ie.getAttribute("data-timeline-priority"))}),_.add(ie.id))}}catch(ee){$("runtime.timeline.site1",ee)}}if(s&&C!=null&&C>0){let z=Z.length>0?Math.max(...Z.map(ee=>ee.track))+1:0;for(let ee of s.children){let Q=ee;if(!Q.id||_.has(Q.id))continue;let fe=Q.getAttribute("data-timeline-role");if(fe!=="overlay"&&fe!=="persistent-overlay")continue;let ce=Q.tagName.toLowerCase();if(ce==="script"||ce==="style"||ce==="link"||ce==="meta"||window.getComputedStyle(Q).display==="none")continue;let re=Y(0,C);re<=0||(R=Math.max(R,re),Z.push({id:Q.id,label:Q.getAttribute("data-timeline-label")??Q.getAttribute("data-label")??Q.getAttribute("aria-label")??Q.id,start:0,duration:re,track:co(Q,z),zIndex:fd(Q),stackingContextId:Ds(Q,t),kind:"element",tagName:ce,compositionId:Q.getAttribute("data-composition-id"),compositionAncestors:N?[N]:[],parentCompositionId:N,nodePath:null,compositionSrc:null,playbackStart:Tt(Q),playbackRate:lt(Q),assetUrl:null,timelineRole:fe,timelineLabel:Q.getAttribute("data-timeline-label"),timelineGroup:Q.getAttribute("data-timeline-group"),timelinePriority:_i(Q.getAttribute("data-timeline-priority"))}),_.add(Q.id))}}for(let z of c){if(z===s)continue;let ee=z.getAttribute("data-composition-id");if(!ee||!ld(ee))continue;let Q=o.resolveStartForElement(z,0),fe=Ti(z);if((fe==null||fe<=0)&&ib(z)!=null){let ie=ib(z);fe=Math.max(0,ie-Q)}let ce=i(ee),xe=fe&&fe>0?fe:ce;if(xe==null||xe<=0)continue;let re=Y(Q,xe);re<=0||J.push({id:ee,label:z.getAttribute("data-label")??sb(z)??ee,start:Q,duration:re,thumbnailUrl:Ci(z.getAttribute("data-thumbnail-url")),avatarName:null})}let ae=Math.max(R||0,C??0),de=ae>0?ae:1,ve=Math.max(1,Math.ceil(de*Math.max(1,e.canonicalFps)));return{...Gs(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:de,durationInFrames:ve,clips:Z,scenes:J,compositionWidth:ao(s?.getAttribute("data-width"))??1920,compositionHeight:ao(s?.getAttribute("data-height"))??1080}}var Bn=new Map,hd=(e,t="")=>`${t}[${gt}="${CSS.escape(e)}"]`,ub=e=>Ti(e)??0,gd=e=>Array.from(e.querySelectorAll("video, audio, [data-composition-id]")).every(t=>ub(t)>0),rM=e=>{let t=e.parentElement;return!e.hasAttribute(Fn)&&!e.hasAttribute("data-hf-original-composition-id")&&(Un(e)||gd(e))&&t?.hasAttribute("data-composition-id")===!0&&t.closest(`[${gt}]`)===null};function bd(e){let t=Number(e.getAttribute("data-start")?.trim()||Number.NaN),n=ub(e);return Number.isFinite(t)&&n>0?{start:t,end:t+n}:null}function cb(){return document.querySelector(`meta[name="${Nn}"]`)?Array.from(document.querySelectorAll(`[${gt}]:not(style, script)`)).flatMap(e=>{let t=rM(e)?bd(e):null;return t?[{name:e.getAttribute(gt),host:e,...t}]:[]}).sort((e,t)=>e.start-t.start):[]}var Ws=()=>cb().filter(({name:e})=>Bn.has(e)).map(({name:e,start:t,end:n})=>({name:e,start:t,end:n})),oM=10;function Vs(e,t,n){let r=e.find(i=>i.start>t),o=i=>i.start<=t?t<=i.end:n?i.start<=t+oM:i===r;return new Set(e.filter(o).map(i=>i.name))}var fo=e=>document.querySelector(`${hd(e)}:not(style, script)`),Un=e=>e.hasAttribute(Ln);function yd(e){let t=fo(e);if(!t||Un(t))return t;for(let r of document.querySelectorAll(hd(e,"script")))r.remove();let n=t.cloneNode(!1);return n.setAttribute(Ln,""),t.replaceWith(n),n}function db(e){let t=fo(e),n=Bn.get(e);if(!t||!Un(t)||!n)return null;let r=document.createElement("template");r.innerHTML=n.html;let o=document.importNode(r.content.firstElementChild,!0);for(let{name:i,value:a}of Array.from(t.attributes))i!==Ln&&o.setAttribute(i,a);return t.replaceWith(o),{host:o,placeholder:t,scripts:n.scripts.map(i=>i.cloneNode(!0))}}function fb(e=0){Bn.clear(),$s.clear();let t=cb(),n=Vs(t,e,!1);for(let{name:r,host:o}of t){let i=Array.from(document.querySelectorAll(hd(r,"script")));Bn.set(r,{html:o.outerHTML,scripts:i.map(a=>a.cloneNode(!0))}),n.has(r)||yd(r)}}var lb={"data-duration":Pn,"data-end":In};function iM(e,t,n){let r=new Set([...t.getAttributeNames(),...n.getAttributeNames()].filter(o=>t.getAttribute(o)!==n.getAttribute(o)));for(let o of r){let i=n.getAttribute(o);i===null?e.removeAttribute(o):e.setAttribute(o,i),o in lb&&e.removeAttribute(lb[o])}}function xd(e,t,n){let r=Bn.get(e);if(!r)return;$s.delete(e);let o=fo(e);if(o&&Un(o)){let i=document.createElement("template");i.innerHTML=r.html,iM(o,i.content.firstElementChild,t)}Bn.set(e,{html:t.outerHTML,scripts:n.map(i=>i.cloneNode(!0))})}var $s=new Map,mb=e=>{let t=Un(e)?e.getAttribute(gt):null;return t!==null&&Bn.has(t)&&e.parentElement?t:null};function Sd(e){let t=mb(e);if(t===null)return null;let n=e.parentElement.cloneNode(!1),r=document.createElement("template");return r.innerHTML=Bn.get(t).html,n.append(r.content),n.firstElementChild}var pb=()=>Array.from(document.querySelectorAll(`[${Ln}]`)).flatMap(e=>{let t=mb(e);return t===null?[]:[{name:t,host:()=>Sd(e)}]});var aM=e=>(e.timeScale?.()??1)===1&&(e.repeat?.()??0)===0,hb=(e,t)=>t+(e.startTime?.()??0),sM=(e,t)=>t+(e.totalDuration?.()??1/0),lM=e=>e.targets?.()??[];function uM(e,t){for(let n=Ge(e)?e:null;n;n=n.parentElement)n.hasAttribute(We)&&t.add(n)}function gb(e,t,n){let r=new Set,o=(c,d)=>d>t&&c<=n,i=c=>c.getChildren?.(!1,!1,!0)??[],a=(c,d)=>c.getChildren?.(!1,!0,!1,t-d)??[],l=(c,d)=>{let f=hb(c,d);if(f>t&&f<=n)for(let m of lM(c))uM(m,r)},s=(c,d)=>{let f=i(c).every(m=>{let b=hb(m,d);return aM(m)&&(!o(b,sM(m,b))||s(m,b))});if(f)for(let m of a(c,d))l(m,d);return f};return s(e,0)?r:null}var bb=\':not([muted]):is(:not([data-has-audio]),[data-has-audio="true"])\',_W=`audio[data-start], video[data-start]${bb}`;function qs(e){if(e.tagName.toLowerCase()!=="video"||e.hasAttribute("muted"))return!1;let t=e.getAttribute("data-has-audio");return t===null||t==="true"}function yb(e){return(e.volume??1)>1||!!(e.fxChain||e.automation||e.audioGroup||e.masterChain)}var Ri="data-hf-render-id",xb="data-hf-group-render-id";function Ed(e){return e.getAttribute(Ri)||e.id||null}var cM="__render_frame_",dM="__";function fM(e){return`${cM}${e}${dM}`}function mM(e){let t=Ed(e);return t?fM(t):null}function Pt(e){let t=mM(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),et(r)?r:null}function Ct(e){return e+1e-5}function Sb(){let{userAgent:e,maxTouchPoints:t}=navigator;return/iP(hone|ad|od)/.test(e)||/Macintosh/.test(e)&&t>1}function zs(){let{userAgent:e}=navigator;return/AppleWebKit/.test(e)&&!/Chrom(e|ium)\\/|Edg\\/|Android/.test(e)}var Eb=.1;function js(e){let t=window.__HF_RENDER_FRAME_VIDEO_IDS;return e.tagName==="VIDEO"&&t?.includes(Ed(e)??"")===!0}function Ks(e){if(js(e))return;e.preload!=="auto"&&(e.preload="auto");let t=e.tagName==="VIDEO"&&e.networkState===2;e.readyState<3&&!t&&e.load()}var vd=new WeakMap;function vb(e){vd.get(e)?.()}function Ab(e,t){if(vb(e),e.tagName!=="VIDEO"||js(e))return;let n=()=>{if(!e.isConnected||!e.paused||e.seeking||!t())return;let i=Tt(e);if(!(Math.abs(e.currentTime-i)<=.02))try{e.currentTime=Ct(i)}catch(a){$("runtime.preload.playbackStart",a)}};if(e.readyState>0){n();return}let r=()=>{e.removeEventListener("loadedmetadata",o),e.removeEventListener("error",r),e.removeEventListener("abort",r),vd.delete(e)},o=()=>{r(),n()};vd.set(e,r),e.addEventListener("loadedmetadata",o),e.addEventListener("error",r),e.addEventListener("abort",r)}function Ad(e){vb(e);for(let t of e.querySelectorAll("source"))t.remove();e.removeAttribute("src"),e.load()}function pM(e){let{buffered:t,duration:n}=e;return Number.isFinite(n)&&n>0&&t.length===1&&t.start(0)<=Eb&&t.end(0)>=n-Eb}function wb(e,t=!1){if(e.querySelector("source")||!t&&pM(e))return;let n=e.getAttribute("src");Ad(e),n!==null&&e.setAttribute("src",n)}function Ys(e){return Ue(e.getAttribute("data-duration"))!=null}function _b(){let e=window;if(e.__hfMediaDeferral?.disconnect(),e.__hfMediaDeferral=void 0,!Es())return;let t=(n,r)=>{Ue(n.getAttribute("data-start"))!=null&&Ys(n)&&r(n)>0&&(n.preload="none")};e.__hfMediaDeferral=new MutationObserver(n=>{let r=ut({}).resolveMediaStartForElement;for(let o of n)for(let i of o.addedNodes){if(i.nodeType!==1)continue;let a=i;a.matches("video, audio")&&t(a,r);for(let l of a.querySelectorAll("video, audio"))t(l,r)}}),e.__hfMediaDeferral.observe(document.documentElement,{childList:!0,subtree:!0})}var Tb=30;function Cb(e){Tb=Number.isFinite(e)&&e>0?e:30}function we(e){try{window.parent.postMessage({...e,...Gs(Tb)},"*")}catch(t){$("bridge.postMessage",t)}}var hM=new Map(Object.entries({play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(gM(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-idle-heartbeat":(e,t)=>t.onSetIdleHeartbeat(!!e.slow),"set-display-scale":(e,t)=>t.onSetDisplayScale?.(Number(e.scale)),"set-preview-quality":(e,t)=>t.onSetPreviewQuality?.(Number(e.level)),"retry-preview-copies":(e,t)=>t.onRetryPreviewCopies?.(),"request-preview-facts":(e,t)=>t.onRequestPreviewFacts?.(),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-play-range":(e,t)=>t.onSetPlayRange(Number(e.startSeconds??0),e.endSeconds==null?null:Number(e.endSeconds)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>yM(e),"set-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onSetRuntimeData?.(e.channel,e.payload,e.requestId)},"clear-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onClearRuntimeData?.(e.channel,e.requestId)}}));function gM(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let o=cd(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/o}function bM(e){let t=Q0(e);return t.status!=="unsupported"?!1:(we({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function yM(e){let t=e.selectors,n=e.duration||800;t&&xM(t,n)}function Rb(e){let t=n=>{if(n.source!==window.parent&&n.source!==window)return;let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||bM(r))return;let o=r.action;if(typeof o!="string")return;let i=hM.get(o);i&&i(r,e)};return window.addEventListener("message",t),we({source:"hf-preview",type:"ready"}),t}function xM(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(o=>{o.classList.add("__hf-flash"),setTimeout(()=>o.classList.remove("__hf-flash"),t)})}catch(r){$("bridge.flashElements.querySelector",r)}}var Mi={windowSeconds:3,choppyShare:.25,warmupSeconds:1,reportEveryMs:1e3},SM=.5,It=[],Xs=null,wd=0,Mb="",_d=!1,Td=0,Lb="monotonic";function Nb(e){we({source:"hf-preview",type:"preview-health",health:e})}function ki(){It=[],Xs=null,_d&&Nb(null),_d=!1,Td=0}var kb=null;function Fb(e){e!==kb&&(kb=e,ki())}function Js(){ki()}function EM(e,t,n){let r=Mi.windowSeconds*1e3;for(;It[0]&&It[0].atMs<e-r;)It.shift();let o=It[0];if(!o)return;let i=e-(o.atMs-o.gapMs);if(i<r||e-Td<Mi.reportEveryMs)return;let a=It.filter(h=>h.drawn).length,l=i/1e3*t*n,s=l>0?1-Math.min(a,l)/l:0,c=It.reduce((h,y)=>h+(y.waiting?y.gapMs:0),0),d=It.reduce((h,y)=>h+(y.frozen?y.gapMs:0),0),f=Math.max(s,c/i),m=It.map(h=>h.gapMs).sort((h,y)=>h-y),b=h=>Math.round(m[Math.ceil(h*m.length)-1]??0);_d=!0,Td=e,Nb({droppedShare:Math.round(f*1e3)/1e3,seconds:Math.round(i/100)/10,choppy:f>=Mi.choppyShare,fps:Math.round(a/(i/1e3)*10)/10,worstFrameMs:Math.round(Math.max(...It.map(h=>h.gapMs))),skippedShare:Math.round(s*1e3)/1e3,waitingShare:Math.round(c/i*1e3)/1e3,frozenShare:Math.round(d/i*1e3)/1e3,gapP50Ms:b(.5),gapP95Ms:b(.95),clockSource:Lb,mode:"play"})}function Pb(e){let{nowMs:t,filmTime:n,fps:r,rate:o}=e,i=`${r}|${o}|${e.layoutKey}`;if(!e.playing||e.hidden){ki();return}i!==Mb&&(Mb=i,ki());let a=Math.floor(n*r+1e-6),l=Xs;if(Xs={ms:t,film:n,frame:a},!l){wd=t+Mi.warmupSeconds*1e3;return}let s=t-l.ms,c=l.film+s/1e3*o;if(n<l.film||n>c+SM){ki(),Xs={ms:t,film:n,frame:a},wd=t+Mi.warmupSeconds*1e3;return}t<wd||(Lb=e.clock,It.push({atMs:t,gapMs:s,drawn:a!==l.frame,waiting:e.waiting,frozen:e.frozen===!0}),EM(t,r,o))}function vM(e,t,n){let r=e.filter(i=>Number.isFinite(i.time)&&Number.isFinite(i.volume)).map(i=>({time:Math.max(0,i.time-t),volume:Ve(i.volume)})).sort((i,a)=>i.time-a.time),o=[];for(let i of r){let a=o.at(-1);a&&Math.abs(a.time-i.time)<1e-9?a.volume=i.volume:o.push(i)}return o.length===0||o[0].time>0&&o.unshift({time:0,volume:Ve(n)}),o}function Ib(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],o=e[n+1]??r,i=o.time-r.time,a=i<=0?0:Math.min(1,Math.max(0,(t-r.time)/i));return r.volume+(o.volume-r.volume)*a}function AM(e,t,n,r){let o=e.at(-1);!o||Math.abs(o.volume-n.volume)>1e-4?(o&&t&&t.time>o.time&&e.push(t),e.push(n)):r&&n.time>o.time&&e.push(n)}function wM(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function _M(e,t){let n=ut({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ue(e.dataset.end)??void 0,o=Ue(e.dataset.duration)??void 0,i=t;o!==void 0&&o>0?i=n+o:r!==void 0&&r>n&&(i=r);let a=wM(e.dataset.volume)??1;return{start:n,end:i,staticVolume:Ve(a)}}function TM(e,t,n,r,{start:o,end:i,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,o),c=Math.min(n,i),d=T0(e,()=>{e.volume=a;let m=[],b;for(let h=s;h<=c+1e-6;h=Math.min(c,h+l)){t(h);let y=Number(e.volume);if(Number.isFinite(y)){let x={time:Number(h.toFixed(6)),volume:Number(Ve(y).toFixed(6))};AM(m,b,x,h===c),b=x}if(h===c)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function Qs(e,t,n=0){return n>3||e===null||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>Qs(r,t,n+1)):Object.getPrototypeOf(e)!==Object.prototype?!1:Object.entries(e).some(([r,o])=>t(r)||Qs(o,t,n+1))}var CM=e=>typeof e?.nodeType=="number";function RM(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 Cd(e){let t={elements:new Set,anySetter:!1,unknown:!0};if(typeof e.getChildren!="function")return t;try{let n={elements:new Set,anySetter:!1,unknown:!1};for(let r of e.getChildren(!0,!0,!1)){let o=r.targets?.()??[];for(let i of o)CM(i)?Qs(r.vars,a=>a==="volume")&&n.elements.add(i):!n.anySetter&&Qs(r.vars,a=>RM(i,a))&&(n.anySetter=!0)}return n}catch{return t}}var MM=(e,t)=>e.unknown||e.anySetter||e.elements.has(t);function Db(e,t,n,r,o={}){if(o.allowLiveTimelineSeek===!1||!t||!Ce(e)||n<=0||!MM(o.movers?.()??Cd(t),e))return;let i=c=>{try{typeof t.totalTime=="function"?t.totalTime(c,!0):typeof t.seek=="function"&&t.seek(c,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=_M(e,n),s=TM(e,i,n,60,l);if(Number.isFinite(a)&&i(a),s){let c=vM(s,l.start,l.staticVolume);c.length>0&&r.set(e,c)}}var Gb="data-fade-in",Bb="data-fade-out",XW=Gb.slice(5),JW=Bb.slice(5),Ub=Object.freeze({fadeIn:0,fadeOut:0});function Rd(e){return Number.isFinite(e)&&e>0?e:0}function Ob(e){return e==null||e===""?0:Rd(Number.parseFloat(e))}function Zs(e){return{fadeIn:Ob(e.getAttribute(Gb)),fadeOut:Ob(e.getAttribute(Bb))}}function Md(e,t){let n=Rd(e.fadeIn),r=Rd(e.fadeOut);if(!Number.isFinite(t)||t<=0)return{fadeIn:n,fadeOut:r};let o=n+r;if(o<=t)return{fadeIn:n,fadeOut:r};let i=t/o;return{fadeIn:n*i,fadeOut:r*i}}function el(e,t,n){if(!Number.isFinite(e))return 1;let{fadeIn:r,fadeOut:o}=Md(n,t),i=1;return r>0&&(i*=Hb(e/r)),o>0&&Number.isFinite(t)&&(i*=Hb((t-e)/o)),i}function Hb(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var pn="hf-audio-group",tl="data-audio-group";function Li(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function kd(e,t){let n=Array.from(e?.querySelectorAll?.(`${pn}[${Ri}]`)??[]).find(o=>o.getAttribute(Ri)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===pn?r:null}function nl(e,t){let n=t?.getAttribute?.(xb)??t?.getAttribute?.(tl);return n?kd(e,n)?.hasAttribute("data-hidden")??!1:!1}function Ld(e){let t=e.querySelector("[data-composition-id]");return t&&!t.parentElement?.closest("[data-composition-id]")?t:null}function Wb(e){return Ld(e)?.getAttribute(Hn)||void 0}function rl(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!kM(e)?null:e.getAttribute(tl)||null}function kM(e){return e.tagName.toLowerCase()==="audio"?!0:typeof e.hasAttribute=="function"&&qs(e)}function Vb(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${pn}{display:contents!important}${pn}[data-hidden]{display:none!important}`,e.head.appendChild(n)}var Nd=-1,po=new Map,mo,Fd=0;function $b(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){$("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}t.length!==0&&tt(Promise.all(t),"hf-seek")}function tt(e,t){let n=e.then(()=>({status:"fulfilled"})).catch(r=>({status:"rejected",reason:r}));po.set(n,t),n.then(r=>{po.delete(n)&&r.status==="rejected"&&mo===void 0&&(mo={reason:r.reason})})}function ol(e){e!==Nd&&(Nd=e,$b(e))}function il(e){Nd=e,$b(e)}function qb(){return Fd>0}async function zb(){for(let e=[...po.keys()];e.length>0;e=[...po.keys()])await Promise.all(e)}function jb(){return po.size>0}async function LM(e,t){if(t===void 0)return Promise.all(e);let n,r=new Promise(o=>{n=setTimeout(()=>o(null),Math.max(0,t-Date.now()))});try{return await Promise.race([Promise.all(e),r])}finally{clearTimeout(n)}}async function Kb(e){let t=()=>[...po].filter(([,i])=>e?.videoFrames!==!1||i!=="video-frame"),n=e?.timeoutMs,r=n===void 0?void 0:Date.now()+n;Fd+=1;let o=mo;try{await Promise.resolve();for(let a=t();a.length>0;a=t()){let l=r===void 0||Date.now()<r?await LM(a.map(([c])=>c),r):null;if(!l){let c=[...new Set(t().map(([,d])=>d))].join(", ");throw Object.assign(new Error(`seek did not settle within ${n} ms: still waiting on ${c}`),{name:"SeekNotSettledError"})}let s=l.find(c=>c.status==="rejected");o===void 0&&s?.status==="rejected"&&(o={reason:s.reason})}let i=mo;if(o===void 0&&(o=i),mo===i&&(mo=void 0),o)throw o.reason}finally{Fd-=1}}var bt=.04,Pd=.5,NM=.03,FM=[[.3,.25],[.1,.1]],PM=.01,IM=.1,DM=.1,OM=.65,ho=new WeakMap,Ni=new WeakSet;function Id(e){Ni.add(e)}function Yb(e,t,n,r,o=e.tagName==="AUDIO"){let i=Math.abs(t);if(o&&zs())return ho.delete(e),{rate:n,seek:r&&i>OM};r&&i<=bt&&Ni.delete(e);let a=!Ni.has(e)||i>Pd;if(o&&r&&i>DM&&a)return ho.delete(e),Ni.add(e),{rate:n,seek:!0};let l=Math.sign(t),s=ho.get(e);if(i>bt)ho.set(e,l);else if(s!==l||i<=PM)return ho.delete(e),{rate:n,seek:!1};let c=FM.find(([f])=>i>f)?.[1]??NM,d=o?Math.min(c,IM):c;return{rate:n*(1+l*d),seek:!1}}function Dd(e){ho.delete(e),Ni.delete(e)}function Oi(e){return Tt(e)}var Xb=["seeked","loadeddata","error","emptied","abort"],Wd=5e3,al=new WeakMap;function Jb(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)||Pt(e)||(al.get(e)?.(),tt(new Promise(n=>{let r=i=>{if(!(i?.type==="loadeddata"&&e.seeking)){clearTimeout(o);for(let a of Xb)e.removeEventListener(a,r,!0);al.get(e)===r&&al.delete(e),n()}},o=setTimeout(r,Wd);for(let i of Xb)e.addEventListener(i,r,!0);al.set(e,r)}),"video-frame"))}function ey(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 ty(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=[],o=[],i=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=Oi(a),c=lt(a),d=St(a),f=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,b=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(b)||b<0)&&m!=null&&(b=Math.max(0,cn(d,m-s)));let y=Number.isFinite(b)&&b>=0?l+b:Number.POSITIVE_INFINITY,x=l,E=Rr({start:l,end:y},e?.resolveHostSlots?.(a)??[]);(E.start!==l||E.end!==y)&&({start:l,end:y}=E,b=y-l);let v=Number.parseFloat(a.dataset.volume??""),T={el:a,start:l,origin:x,mediaStart:s,duration:Number.isFinite(y)?b:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(v)?v:null,playbackRate:c,rate:d,loop:f,sourceDuration:m,fades:Zs(a)};r.push(T),a.tagName==="VIDEO"&&o.push(T),Number.isFinite(y)&&(i=Math.max(i,y))}return{timedMediaEls:n,mediaClips:r,videoClips:o,maxMediaEnd:i}}var Gd=new WeakMap,Pi=new WeakMap,Fi=new WeakMap,Bd=new WeakSet,kr=new WeakSet,Od=new WeakSet;function HM(e){if(kr.has(e))return;kr.add(e);let t=()=>kr.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}function ny(e){if(Sb())for(let t of e)t.defaultMuted||!t.paused||kr.has(t)||sl(t)||(t.play().catch(()=>{}),t.pause())}var GM=3;function sl(e){return e.error!=null||e.networkState===GM}var Ud=new WeakMap;function Hd(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function ll(e){Gd.delete(e),Pi.delete(e),Fi.delete(e),Bd.delete(e),Ud.delete(e),Dd(e),Mr.delete(e),oy(e),Di.delete(e)}function Vd(e){return Pi.has(e)}var $d=1.5;function Wn(e,t){let n=Math.max(0,Math.min(t,e.end)-(e.origin??e.start)),r=e.mediaStart+Gn(e.rate??e.playbackRate,n);if(e.sourceDuration==null)return r;let o=e.sourceDuration-e.mediaStart;return e.loop&&o>0&&r>=e.sourceDuration?e.mediaStart+(r-e.mediaStart)%o:!e.loop&&e.el.tagName==="VIDEO"?Math.min(r,e.sourceDuration):r}function BM(e,t,n,r){let{el:o}=e,i=e.start-t;if(!n||i<=0||i>$d*r||!o.paused||o.seeking||o.readyState<o.HAVE_METADATA||Pt(o)||"__HF_EXPORT_RENDER_SEEK_CONFIG"in window&&window.__HF_EXPORT_RENDER_SEEK_CONFIG)return;let a=Wn(e,e.start);if(!(!Number.isFinite(a)||a<0||Math.abs(o.currentTime-a)<=.001))try{o.currentTime=Ct(a)}catch(l){$("runtime.media.preseek",l)}}var Qb=1/16,ry=.1,Mr=new WeakSet,UM=.5,go=new WeakMap,qd=new WeakMap,zd=new WeakMap,WM=e=>typeof e.requestVideoFrameCallback=="function";function VM(e,t){if(go.get(e)===t)return;go.set(e,t);let n=null,r=Number.POSITIVE_INFINITY,o=0,i=(a,l)=>{if(go.get(e)!==t)return;if(e.paused){go.delete(e);return}let s=n===null?Number.NaN:l.mediaTime-n;if(s>0&&s<ry){r=Math.min(r,s),o=Math.max(o,s);let c=Math.floor((t-.001-l.mediaTime)/r);zd.set(e,{outPoint:t,at:l.mediaTime+c*r})}if(n=l.mediaTime,l.mediaTime+(o||bt)<t-.001){e.requestVideoFrameCallback(i);return}go.delete(e),qd.set(e,t),Mr.add(e),e.pause()};e.requestVideoFrameCallback(i)}function oy(e){go.delete(e),qd.delete(e),zd.delete(e)}function $M(e,t,n){if(!n)return t-bt;let r=zd.get(e);return r?.outPoint===t?r.at:t}var Ii=null,Di=new WeakMap,Zb=!1;function qM(e,t,n,r){let o=Di.get(e);if(!o||t<o.at)return;Di.delete(e);let i=((n-o.offset)/r+o.lead)*o.weight,a=Ii===null?i:(Ii+i)/2;Ii=Math.min(.1,Math.max(0,a))}function iy(e){let t=!!(e.outputMuted||e.userMuted),n=Zb?1:.5;Zb=e.playing&&e.clockAdvancing!==!1;for(let r of e.clips){let{el:o}=r;if(!o.isConnected)continue;let i=r.rate??r.playbackRate,a=r.origin??r.start,l=o.tagName==="VIDEO"&&!r.loop,s=fn(e.timeSeconds,r.start,r.end),c=r.start-e.timeSeconds,d=o.tagName==="AUDIO"?e.cueAheadSeconds??0:e.playing&&Ii!==null?Ii*e.playbackRate+(e.cueAheadSeconds??0)/2:0,f=!s&&c>0&&c*Math.max(1,xi(i,r.start-a))<=Math.max(d,Od.has(o)?bt:0);f?Od.add(o):Od.delete(o);let m=l&&!s&&(e.timeSeconds>=r.end||so(e.timeSeconds,r.end))&&lo(e.timeSeconds,r.start,r.end,e.getCompositionDuration()),b=Wn(r,e.timeSeconds),h=m||l&&r.sourceDuration!=null&&b>=r.sourceDuration&&s,y=Pi.get(o),x=o.tagName==="AUDIO"&&(y===void 0||b<y-.04),E=!r.loop&&r.sourceDuration!=null&&b>=r.mediaStart&&b<r.sourceDuration&&(l||x);if((s||m||f)&&b>=0&&(!o.ended||r.loop||h||E)){Pi.set(o,b);let H=Hd(e.userVolume??1),U=Ve(r.volume??1),M=Ud.get(o),L=Hd(o.volume),G,C=P0(o,e.timeSeconds-a),B=e.isWebAudioRouted?.(o)===!0,O=C===null&&(r.volumeKeyframes?.length??0)>0,Y=B?_0(U,O):1;if(C!==null)G=B?1:Ms(U,C);else if(r.volumeKeyframes&&r.volumeKeyframes.length>0){let Pe=e.timeSeconds-a;G=Ve(Ib(r.volumeKeyframes,Pe))}else B?G=1:M===void 0?G=U>1?U:L:Math.abs(L-M)>1e-4?G=L:G=U;let Z=G,J=r.fades??Ub;(J.fadeIn>0||J.fadeOut>0)&&(G*=el(e.timeSeconds-a,r.duration+r.start-a,J));let V=o.closest("[data-hidden]")!==null||nl(o.ownerDocument,o)?0:Hd(G*H);Math.abs(o.volume-V)>1e-6&&(o.volume=V),Ud.set(o,V),Z===G?e.onElementVolume?.(o,V,G,Y):e.onElementVolume?.(o,V,G,Y,Z),(t||e.isWebAudioOwned?.(o))&&!o.muted&&(o.muted=!0),o.preload!=="auto"&&!js(o)&&(o.preload="auto");let R=xi(i,e.timeSeconds-a)*e.playbackRate,k=e.playing&&R>=Qb,F=2,_=o.currentTime||0,N=Math.abs(_-b),j=b-_,ae=Gd.get(o);Gd.set(o,j);let de=ae===void 0,ve=!de&&Math.abs(j-ae)>.5,z=N>3,ee=o.tagName==="AUDIO"&&de&&_-b>bt,Q=h&&N>.001||o.ended&&E&&N>.001||ee||N>Pd&&(de||ve||z);if(o.tagName==="VIDEO"&&!h){let Pe=Wn(r,r.end),yt=WM(o);yt&&k&&!r.loop&&!o.paused&&Pe-_<=UM*R&&VM(o,Pe);let ur=qd.get(o)===Pe,An=!r.loop&&(j<-ry||ur||_>=$M(o,Pe,yt));!k||!An&&j>=-bt?Mr.delete(o):An&&(!o.paused||ur)&&(Mr.add(o),o.paused||o.pause())}let fe=Mr.has(o),ce=!o.paused&&k;ce&&qM(o,e.timeSeconds,j,R);let re=e.playing&&!k||ae!==void 0&&Math.abs(j-ae)<.004,ie=!1;if(!ce&&!fe&&!Q&&!de&&re&&N>bt){let Pe=(Fi.get(o)??0)+1;Fi.set(o,Pe),Pe>=F&&(ie=!0,Fi.set(o,0))}else N<=bt&&Fi.set(o,0);let ot=!ce&&!fe&&e.forceSync&&N>.02,Be=ce&&!Q?Yb(o,j,R,re):null,Ee=Be?.seek===!0,Me=Ee&&e.seekUnderDip?.(o,b)===!0;try{Be||Dd(o);let Pe=Math.max(Qb,Be?.rate??R);Math.abs(o.playbackRate-Pe)>1e-6&&(o.playbackRate=Pe)}catch(Pe){$("runtime.media.site1",Pe)}if(Q||ie||ot||Ee&&!Me){if(!(o.tagName==="VIDEO"&&!!Pt(o))){try{o.currentTime=Ct(b)}catch(yt){$("runtime.media.site2",yt)}if(Math.abs(o.currentTime-b)>.5&&!Bd.has(o)){Bd.add(o),o.load();try{o.currentTime=Ct(b)}catch(yt){$("runtime.media.site3",yt)}}Jb(o),Id(o)}kr.delete(o),Mr.delete(o),oy(o),Di.delete(o)}else k||Jb(o);h?o.paused||o.pause():k&&!Mr.has(o)&&e.clockAdvancing!==!1&&o.paused&&!kr.has(o)&&!sl(o)?(HM(o),Id(o),l&&Di.set(o,{weight:n,offset:b-(o.currentTime||0),lead:Math.max(0,r.start-e.timeSeconds)/e.playbackRate,at:Math.max(e.timeSeconds,r.start)+.25*e.playbackRate}),o.play().catch(Pe=>{kr.delete(o),(Pe&&typeof Pe=="object"&&"name"in Pe?String(Pe.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!k&&!o.paused&&o.pause();continue}let T=fn(e.timeSeconds,r.start,r.end);ll(o),T&&Pi.set(o,b),o.paused||o.pause(),BM(r,e.timeSeconds,e.playing,e.playbackRate)}}var jd={lookSeconds:1,movedShare:.1,minDueSeconds:.05},zM=2,sy=new WeakMap,ul=new WeakSet;function ay(e,t){sy.set(e,{film:t,time:e.currentTime})}function jM(e,t,n,r){let o=Wn(e,r)-Wn(e,n.film),i=t.currentTime-n.time;o>=jd.minDueSeconds&&i<o*jd.movedShare?ul.add(t):ul.delete(t)}function ly(e,t){let n=!1;for(let r of e){let o=r.el;if(!Re(o))continue;let i=sy.get(o);!i||t<i.film?(ay(o,t),ul.delete(o)):t-i.film>=jd.lookSeconds&&(jM(r,o,i,t),ay(o,t)),(o.readyState<zM||ul.has(o))&&(n=!0)}return n}var KM=1e3,Lr=new Map,Kd=!1,uy=!1,Hi,cl=!1;function YM(){for(let r of Lr.keys())r.isConnected||Lr.delete(r);let e=[...Lr.values()],t=Kd&&e.length>0;if(!t&&!uy)return!1;uy=t;let n=e.reduce((r,o)=>r+(o.state==="ready"?1:o.progress??0),0);return we({source:"hf-preview",type:"preview-copies",copies:t?{total:e.length,ready:e.filter(r=>r.state==="ready").length,failed:e.filter(r=>r.state==="failed").length,progress:n/e.length,error:e.some(r=>r.state==="failed")?"failed":null}:null}),!0}function Yd(){if(Hi!==void 0){cl=!0;return}YM()&&(Hi=setTimeout(()=>{Hi=void 0,cl&&(cl=!1,Yd())},KM))}function cy(e){Lr.clear(),Kd=e<1,clearTimeout(Hi),Hi=void 0,cl=!1,Yd()}function Vn(e,t,n=null){Kd&&(Lr.set(e,{state:t,progress:n}),Yd())}function dy(){return[...Lr].filter(([,e])=>e.state==="failed").map(([e])=>e)}function fy(){return[...Lr.values()].every(e=>e.state==="ready")}var Xd=null;function my(e){Xd=e}function Rt(e,t){if(Xd)try{Xd({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){$("runtime.analytics.site1",n)}}function XM(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 o=t.slice(n,r);return o.length>0?o:"node"}function bo(e){return`--${XM(e)}`}function py(e){let t=new Map;for(let n of e){let r=bo(n),o=t.get(r);o?o.includes(n)||o.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function Jd(e){let n=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"";return n?window.__hfVariablesByComp?.[n]:void 0}function dl(e){let t=window,n=Jd(e);if(n)return n;let r=t.__hyperframes?.getVariables?.();return r&&typeof r=="object"?r:t.__hfVariables??{}}function gy(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let o of Array.from(document.querySelectorAll("[data-composition-variables]")))Jd(o)||e.add(o);let t={};for(let o of e)Object.assign(t,Gi(o));let n=ml(),r={...t,...n};for(let o of e)Zd(o,r);return r}var hy=new Set;function by(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 JM(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function QM(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 ZM(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=QM(e);return r.length===0||r.some(o=>String(o)===String(n))?null:{id:e.id,value:n,allowed:r}}function Zd(e,t,n){if(!e)return;let r=by(e);if(r.length===0)return;let o=JM(e,n);for(let i of r){let a=ZM(i,t);if(!a)continue;let l=`${o}|${a.id}|${String(a.value)}`;if(hy.has(l))continue;hy.add(l);let s="default"in i?JSON.stringify(i.default):"the composition default";globalThis.console.warn(`[hyperframes] runtime_unknown_enum_value: ${o} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function Gi(e){let t={};for(let n of by(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Qd="data-hf-css-vars";function fl(e){return"style"in e&&typeof e.style?.setProperty=="function"}function ef(e,t){if(!fl(e))return;let n=[];for(let[r,o]of Object.entries(t))if(typeof o=="string"&&o!==""||typeof o=="number"){let i=bo(r);e.style.setProperty(i,String(o)),n.push(i)}n.length>0&&e.setAttribute(Qd,n.join(" "))}function yy(e,t,n){let r={};for(let[o,i]of Object.entries(t)){let a=bo(o);((fl(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[o]=i)}return r}function xy(e){if(!fl(e))return;let t=e.getAttribute(Qd);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Qd)}}function Sy(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let o of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(o);let n=ml(),r=[];for(let o of t)r.push(...ek(o,n,e.defaultView));for(let o of py(r))globalThis.console.warn(`composition variables ${o.join(", ")} collapse to the same CSS property ${bo(o[0]??"")}. Rename one to avoid cross-talk`)}function ek(e,t,n){if(!fl(e))return[];let r=Gi(e),o={};for(let[i,a]of Object.entries(r)){if(i in t)continue;let l=bo(i);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(o[i]=a)}for(let[i,a]of Object.entries(t))i in r&&(o[i]=a);return ef(e,o),Object.keys(r)}function Ey(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 ml(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function pl(e,t,n,r){let o=!1;try{e.pause()}catch(i){o=!0,$(r,i)}try{e.currentTime=t}catch(i){$(n,i)}if(o)try{e.pause()}catch(i){$(r,i)}}function vy(e){let t=[],n=(m,b=()=>m.getAnimations())=>{if(typeof m.getAnimations!="function")return[];try{return b()}catch{return[]}},r=m=>{let b=new Map;if(t.length===0)return b;let h=typeof CSSAnimation<"u";for(let y of n(document,m)){if(h&&!(y instanceof CSSAnimation))continue;let x=y.effect;if(!x?.target||x.pseudoElement)continue;let E=b.get(x.target);E?E.push(y):b.set(x.target,[y])}return b},o=(m=[],b=[])=>[...b,...m.filter(h=>!b.includes(h)&&h.playState!=="idle")],i=m=>{let b=m.closest("[data-start]")??m;return e?.resolveStartSeconds?e.resolveStartSeconds(b):Number.parseFloat(b.getAttribute("data-start")??"0")||0},a=m=>{let b=v=>(v||"").split(",").map(T=>Number.parseFloat(T)/(T.trim().endsWith("ms")?1e3:1)),h=b(m.animationDuration),y=b(m.animationDelay),x=m.animationName.split(","),E=0;return x.forEach((v,T)=>{if(v.trim()==="none")return;let H=y[T%y.length]+h[T%h.length];H>E&&(E=H)}),{cycleSeconds:E,delays:x.map((v,T)=>y[T%y.length]||0)}},l=(m,b)=>{let h=null;try{h=m.effect?.getComputedTiming?.()??null}catch(x){$("runtime.adapters.css.site5",x)}if(!h)return{};let y=Number(h.endTime);return Number.isFinite(y)?{endSeconds:b+y/1e3}:{unbounded:!0}},s=(m,b)=>{for(let h of m)pl(h,b,"runtime.adapters.css.site1","runtime.adapters.css.site2")},c=m=>{for(let b of m)try{b.play()}catch(h){$("runtime.adapters.css.site3",h)}},d=m=>{for(let b of m)try{b.pause()}catch(h){$("runtime.adapters.css.site4",h)}},f=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)f(h);let m=new Map(t.map(h=>[h.el,h.handles]));t=[];let b=document.querySelectorAll("*");for(let h of b){if(!Te(h))continue;let y=window.getComputedStyle(h);!y.animationName||y.animationName==="none"||t.push({el:h,baseDelay:h.style.animationDelay||"",basePlayState:h.style.animationPlayState||"",...a(y),handles:m.get(h)})}},getAnimationCycleEndSeconds:()=>{let m=0;for(let b of t)!b.el.isConnected||b.cycleSeconds<=0||(m=Math.max(m,i(b.el)+b.cycleSeconds));return m>0?m:null},getInferredDurationSeconds:()=>{let m=0;for(let b of t){if(!b.el.isConnected)continue;let h=i(b.el);for(let y of n(b.el)){let x=l(y,h);x.endSeconds!=null&&(m=Math.max(m,x.endSeconds))}}return m>0?m:null},seek:m=>{let b=Number(m.time)||0,h=r(m.pageAnimations);for(let y of t)y.handles=o(y.handles,h.get(y.el));for(let y of t){if(!y.el.isConnected)continue;let x=i(y.el),E=Math.max(0,b-x)*1e3;if(y.handles?.length){y.el.style.animationDelay!==y.baseDelay&&f(y),s(y.handles,E);continue}y.el.style.animationPlayState="paused",y.el.style.animationDelay=y.delays.map(v=>`${Number((v-E/1e3).toFixed(3))}s`).join(", ")}},pause:m=>{let b=r(m?.pageAnimations);for(let h of t){if(!h.el.isConnected)continue;let y=b.get(h.el);y&&(d(y),f(h))}},play:()=>{let m=r();for(let b of t)b.el.isConnected&&(f(b),c(m.get(b.el)??[]))},revert:()=>{t=[]}}}function Bi(e,t,n){e.totalDuration?.();let r=e.getChildren?.(!1,!0,!0)??[],o=bk(e,n,t).map(s=>[s,s.ratio,s._zTime,s._act]),i=Ry(r,t).map(s=>[s,s._ts]),a=new Set;for(let[s]of i)for(let c=s.parent;c&&!a.has(c);c=c.parent)a.add(c);let l=[...a].map(s=>[s,s._dur,s._tDur,s._end,s._dirty]);for(let[s]of i)s._ts=0;try{tk(e,r,t,n)}finally{for(let[s,c]of i)s._ts=c;for(let[s,c,d,f,m]of l)Object.assign(s,{_dur:c,_tDur:d,_end:f,_dirty:m})}for(let[s,c,d,f]of o)s.ratio=c,s._zTime=d,s._act=f}function tk(e,t,n,r){let o=n>=hl;e.totalTime(o?n-hl:n+hl,!0),Ny(t,n,o?hl:0),e.totalTime(n,!0),o||Cy(e,r??nk(t),n)}function nk(e){let t=e[0]?.parent;return t?{owner:t,version:""}:void 0}function Cy(e,t,n){if(t)for(let r of hk(e,t,n)){let{ratio:o,_zTime:i,_act:a}=r;r.render(0,!0,!0),Object.assign(r,{ratio:o,_zTime:i,_act:a})}}function rk(e){let t=e,[n]="_first"in t?t._first?[t._first]:[]:e.getChildren?.(!1,!0,!0)??[],r=n?.parent;return r!==void 0&&!r._initted}var Ay=new WeakMap,wy=new WeakMap,ok=new Set(["duration","ease","delay","repeat","repeatDelay","yoyo","yoyoEase","repeatRefresh","stagger","overwrite","immediateRender","lazy","id","paused","reversed","callbackScope","runBackwards","data","inherit","defaults"]),ik=new Set(["keyframes","startAt","transform"]),ak={scaleX:"scale",scaleY:"scale",autoAlpha:"opacity",rotate:"rotation"};function sk(e){let t=new Set;for(let n of Object.keys(e)){if(ik.has(n))return null;!n.startsWith("on")&&!ok.has(n)&&t.add(ak[n]??n)}return t}function lk([e,t],n){let r=Number(n._ts);if(!r)return null;let[o,i]=n._repeat||r<0?[0,Number(n.totalDuration?.()??1/0)]:[e,t];return[Number(n._start)+o/Math.abs(r),i/Math.abs(r)]}function uk(e,t){let n=[Number(e._start),Number(e.totalDuration?.()??0)];for(let r=e.parent;n&&r&&r!==t;r=r.parent)n=lk(n,r);return n&&{start:n[0],end:n[0]+n[1],properties:sk(e.vars??{})}}function ck(e){let t=new Map;for(let n of e.getChildren?.(!0,!0,!1)??[]){let r=n,o=uk(r,e);if(o)for(let i of r.targets?.()??[])t.set(i,[...t.get(i)??[],o])}return[...t.values()].flatMap(fk)}function dk(e,t){return!e.properties||!t.properties||[...e.properties].some(n=>t.properties.has(n))}function fk(e){let t=[];return e.sort((n,r)=>n.start-r.start),e.forEach((n,r)=>{for(let o of e.slice(r+1)){if(o.start>=n.end)break;dk(n,o)&&t.push([o.start,Math.min(n.end,o.end)])}}),t}function mk(e,t,n,r=""){let o=Ay.get(e);Ay.set(e,t);let i=o===void 0?Math.floor(t*n+1e-6):Math.ceil((t-o)*n-1e-6)-1;if(i<1)return[];let a=wy.get(e);a?.version!==r&&(a={version:r,spans:ck(e)},wy.set(e,a));let l=new Set;for(let[s,c]of a.spans){let d=Math.max(1,Math.ceil((t-c)*n-1e-6)-1),f=Math.min(i,Math.floor((t-s)*n+1e-6)+1);for(let m=d;m<=f;m++)l.add(m)}return[...l].sort((s,c)=>c-s).map(s=>t-s/n)}function Ui(e,t,n,r,o){if(typeof e.totalTime!="function")return typeof e.seek=="function"&&e.seek(t,n),!1;if(o)for(let a of mk(e,t,o,r?.version))e.totalTime(a,n);let i=Number(e.totalTime());return e.totalTime(t,n),t<i&&r&&Cy(e,r,t),i!==t||!rk(e)?!1:(Bi({totalTime:e.totalTime.bind(e),totalDuration:e.totalDuration?.bind(e),getChildren:e.getChildren?.bind(e)},t,r),!0)}var tf=1e-6;function Ry(e,t,n=[]){for(let r of e)r.startTime()>t+tf?n.push(r):r.getChildren&&r.endTime()>=t&&Ry(r.getChildren(!1,!0,!0),r.time(),n);return n}function nf(e){return(e.getChildren?.(!0,!0,!0)??[]).filter(t=>{let n=t;return typeof n.getChildren=="function"||n.totalDuration?.()===0})}var _y=new WeakMap,Ty=.05;function pk(e,t){let n=Number(e._start);for(let r=e.parent;r&&r!==t;r=r.parent){if(r._repeat||!r._ts)return null;n=Number(r._start)+n/r._ts}return Number.isFinite(n)?n:null}function My(e,t){let n={version:t.version,always:[],points:[]};for(let r of nf(e)){let o=r,i=typeof o.getChildren=="function"?null:pk(o,t.owner);i===null?n.always.push(r):n.points.push({at:i,mark:r})}return n.points.sort((r,o)=>r.at-o.at),n}function ky(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>1;e[o].at<t?n=o+1:r=o}return n}function rf(e,t){let n=_y.get(t.owner);return n?.version!==t.version&&(n=My(e,t),_y.set(t.owner,n)),n}function hk(e,t,n){let{points:r}=t.version?rf(e,t):My(e,t),o=[];for(let i=ky(r,n-tf);i<r.length&&!(r[i].at>n+tf);i++)o.push(r[i].mark);return o}function gk(e,t){let n=t?rf(e,t):null,o=(n?[...n.always,...n.points.map(i=>i.mark)]:nf(e)).map(i=>[i,i.ratio,i._zTime,i._act]);return()=>{for(let[i,a,l,s]of o)i.ratio=a,i._zTime=l,i._act=s}}function Ly({scenes:e,root:t,structureOf:n}){let r=t?[...e,t]:e,o=r.map(i=>gk(i,n(i)));return i=>{i();for(let a of r)a.totalTime&&!n(a)&&Bi({totalTime:a.totalTime.bind(a),totalDuration:a.totalDuration?.bind(a),getChildren:a.getChildren?.bind(a)},Number(a.totalTime()));for(let a of o)a()}}function bk(e,t,n){if(!t)return nf(e);let r=rf(e,t),{points:o}=r,i=[...r.always],a=n+Ty;for(let l=ky(o,n-Ty);l<o.length&&!(o[l].at>a);l++)i.push(o[l].mark);return i}var gl=2e-8,hl=.001,yk=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 xk(e){return e.vars?.keyframes&&(e.render(gl,!0),e.render(-gl,!0)),e._startAt&&e._startAt.render(gl,!0,!0),!!(e.vars?.keyframes||e._startAt)}function Ny(e,t,n){for(let r of e.filter(yk)){let o=(t-r.startTime())*r.timeScale();Math.abs(o)<1e-9&&xk(r)||o>0&&Sk(r,o,n*r.timeScale())}}function Sk(e,t,n){t<n&&e._startAt&&e._startAt.render(gl,!0,!0);let r=e.getChildren?e:e.timeline;r?.getChildren&&t<=e.totalDuration()&&Ny(r.getChildren(!1,!0,!0),t,n)}function Fy(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),o=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r,o),Bi({totalTime:n.totalTime.bind(n),totalDuration:n.totalDuration?.bind(n),getChildren:n.getChildren?.bind(n)},r)):n.seek(r,o)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Py(){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 o of t)r.has(o)||n.push(o);window.__hfAnime=n}catch(e){$("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(o){$("runtime.adapters.animejs.site2",o)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){$("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){$("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Hy(e){let t=r=>{let o=Dy(r),i=o&&typeof o.closest=="function"?o.closest("[data-composition-id]"):null;return i&&e?.resolveStartSeconds?e.resolveStartSeconds(i):0},n=(r,o)=>Math.max(0,o-t(r));return{name:"lottie",discover:()=>{try{let r=window.lottie;if(r&&typeof r.getRegisteredAnimations=="function"){let o=r.getRegisteredAnimations();if(Array.isArray(o)&&o.length>0){let i=window.__hfLottie??[],a=new Set(i);for(let l of o)a.has(l)||i.push(l);window.__hfLottie=i}}}catch(r){$("runtime.adapters.lottie.site1",r)}},seek:r=>{let o=Math.max(0,Number(r.time)||0),i=window.__hfLottie;if(!(!i||i.length===0))for(let a of i)try{let l=n(a,o),s=a.loop===!0;if(bl(a)){let c=l*a.frameRate;a.totalFrames>0&&s?a.goToAndStop(of(c,a.totalFrames),!0):a.totalFrames>0&&c>=a.totalFrames?a.goToAndStop(a.totalFrames-1,!0):a.goToAndStop(l*1e3,!1)}else if(af(a)){if(typeof a.setFrame=="function"){let c=a.totalFrames??0,d=a.duration??0;if(!Number.isFinite(c)||c<=0||!Number.isFinite(d)||d<=0)continue;let f=l*c/d;a.setFrame(Math.min(s?of(f,c):f,c-1))}else if(typeof a.setCurrentRawFrameValue=="function"){let c=a.totalFrames??0,d=a.frameRate??30,f=s&&c>0?of(l*d,c):l*d;c>0&&a.setCurrentRawFrameValue(Math.min(f,c-1))}else if(typeof a.seek=="function"){let c=a.duration??0;if(Number.isFinite(c)&&c>0){let d=Math.min(100,(s?l%c:l)/c*100);a.seek(d)}}}}catch(l){$("runtime.adapters.lottie.site2",l)}},pause:()=>{let r=window.__hfLottie;if(!(!r||r.length===0))for(let o of r)try{(bl(o)||af(o))&&o.pause()}catch(i){$("runtime.adapters.lottie.site3",i)}},revert:()=>{},getInferredDurationSeconds:()=>Iy((r,o)=>o),getAnimationCycleEndSeconds:()=>Iy((r,o)=>Dy(r)?.isConnected===!1?null:t(r)+o)}}function Iy(e){let t=window.__hfLottie;if(!t||t.length===0)return null;let n=0,r=!1;for(let o of t){let i=null;try{let a=Ek(o);i=a==null?null:e(o,a)}catch(a){$("runtime.adapters.lottie.site4",a)}i!=null&&(r=!0,n=Math.max(n,i))}return r?n:null}function Dy(e){return bl(e)?e.wrapper:e.canvas}function of(e,t){let n=e%t;return t-n<1e-6?0:n}function Oy(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Ek(e){return bl(e)?Oy(e.totalFrames,e.frameRate):af(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Oy(e.totalFrames,e.frameRate):null}function bl(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function af(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function Gy(){let e=null,t=0,n=null,r=null,o=null,i=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},l=c=>{i||c.itemsTotal<=c.itemsLoaded||(i=new Promise(d=>{c.onLoad=function(){try{o?.call(this)}finally{i=null,c.onLoad=o??null,d()}}}))},s=c=>{n!==c&&(n=c,r=c.onStart??null,o=c.onLoad??null,c.onStart=function(d,f,m){try{r?.call(this,d,f,m)}finally{l(c)}})};return{name:"three",discover:()=>{let c=a();c&&(s(c),l(c))},seek:c=>{e=Math.max(0,Number(c.time)||0),t=e,window.__hfThreeTime=e,ol(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let c=a();return!c||c.itemsTotal<=c.itemsLoaded?null:(i||l(c),i)}}}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 o=r.filter(i=>!n.has(i));return o.length===0?null:t||(t=Promise.allSettled(o.map(i=>e.waitFor(i).then(()=>{n.add(i)}))).then(()=>{t=null}),t)}}}function By(){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 Uy(){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 Wy(){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 Vy(){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 $y(){return Yt({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var vk=250;function qy(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},o=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(qb()||(window.__hfTypegpuTime=e,il(e)))},vk))};return{name:"typegpu",discover:()=>{},seek:i=>{e=Math.max(0,Number(i.time)||0),t=e,window.__hfTypegpuTime=e,ol(e)},pause:()=>{e==null&&(e=Math.max(0,t)),o()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var yo=new Map,zy=()=>yo.size>0;function jy(e){if(yo.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(c=>{n.signal.addEventListener("abort",()=>c(),{once:!0})}),o=Promise.race([Promise.resolve(e.ready),r]);o.catch(()=>{});let i=null,a=null,l=async()=>{let c;try{for(await o;!n.signal.aborted&&i!==null;){let d=i;i=null;try{await Promise.race([e.render(d,n.signal),r])}catch(f){c??(c={reason:f})}}if(c)throw c.reason}finally{i=null,a=null}},s={element:e.element,ready:o,seek(c){return i=t?t.start+Math.min(Math.max(0,c),Math.max(0,t.duration-1/t.fps)):c,a??(a=l()),a},dispose(){n.signal.aborted||(n.abort(),i=null,yo.delete(e.element),e.dispose?.())}};return yo.set(e.element,s),s.dispose}function Ky(e){let t=new Set,n=[],r=null,o=()=>{for(let l of t)yo.get(l.element)!==l&&t.delete(l);let a=[];for(let[l,s]of yo){if(!l.isConnected){s.dispose();continue}t.has(s)||(t.add(s),tt(s.ready,"frame-source")),a.push([l,s])}return a},i=new MutationObserver(()=>{o()});return i.observe(document,{childList:!0,subtree:!0}),{name:"frame-source",discover:()=>{o()},pause:()=>{},seek:({time:a})=>{for(let[l,s]of o()){let c=e.start(l),d=e.duration(l),f=c+(d??1/0),m=e.exportRenderSeek()?Hs(c,f,e.canonicalFps()):{start:c,end:f};if(!lo(a,m.start,m.end,e.compositionDuration()))continue;let b=Math.max(0,a-c),h=Tt(l)+Gn(St(l),b);tt(s.seek(h),"frame-source")}},getReadyPromise:()=>{let a=o().map(([,l])=>l);return a.length===0?null:((a.length!==n.length||a.some((l,s)=>l!==n[s]))&&(n=a,r=Promise.all(a.map(l=>l.ready))),r)},revert:()=>{i.disconnect();for(let a of t)a.dispose();t.clear()}}}function Yy(e){let t=e.nextElementSibling;if(et(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=Pt(e);return n&&n.complete&&n.naturalWidth>0?n:null}function Xy(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,o){if(Re(n?.source)){let i=Yy(n.source);if(i)return t.call(this,{...n,source:i},r,o)}return t.call(this,n,r,o)}}function Jy(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let o of t){let i=r[o];if(typeof i!="function"||i.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,c=l[s];if(Re(c)){let d=Yy(c);d&&(l[s]=d)}return i.apply(this,l)};a.__hfVideoPatched=!0,r[o]=a}}}var Ak=e=>typeof CSSAnimation<"u"&&e instanceof CSSAnimation||typeof CSSTransition<"u"&&e instanceof CSSTransition;function Qy(){let e=!1,t=0,n=!1,r,o,i,a=new Set,l=new WeakMap,s=(x=()=>document.getAnimations())=>{if(!document.getAnimations)return[];try{return x()}catch{return[]}},c=x=>{let E=Number(x.currentTime);return Number.isFinite(E)&&E>0?E:0},d=(x,E)=>E<=0?x:x>=E?Math.max(0,x-E):x,f=(x,E)=>{let v=l.get(x);if(v)return v;let T={compositionTimeMs:E,animationTimeMs:e?d(c(x),E):c(x)};return l.set(x,T),T},m=(x,E)=>{if(!a.has(x)){a.add(x);let v=()=>{a.delete(x)};try{x.addEventListener("finish",v,{once:!0}),x.addEventListener("cancel",v,{once:!0})}catch(T){$("runtime.adapters.waapi.site4",T)}}f(x,E)},b=(x,E)=>{for(let v of x)m(v,E)},h=()=>{if(n||typeof Element>"u")return;let x=Element.prototype;if(typeof x.animate!="function"||x.__hfOriginalAnimate)return;let E=x.animate;try{Object.defineProperty(x,"__hfOriginalAnimate",{value:E,configurable:!0});let v=function(...T){let H=E.apply(this,T);return m(H,t),H};x.animate=v,r=x,o=E,i=v,n=!0}catch{}},y=x=>{let E=null;try{E=x.effect?.getComputedTiming?.()??null}catch(H){$("runtime.adapters.waapi.site4",H)}if(!E)return{};let v=Number(E.endTime);return Number.isFinite(v)?{endSeconds:(l.get(x)?.compositionTimeMs??0)/1e3+v/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,h(),b(s(),t)},seek:x=>{let E=Math.max(0,(Number(x.time)||0)*1e3);t=E,(!e||a.size>0)&&b(s(x.pageAnimations),e?E:0);for(let v of a){if(v.playState==="idle"&&Ak(v)){a.delete(v);continue}let T=e?f(v,E):f(v,0),H=T.animationTimeMs+Math.max(0,E-T.compositionTimeMs);pl(v,H,"runtime.adapters.waapi.site1","runtime.adapters.waapi.site2")}},pause:x=>{e||b(s(x?.pageAnimations),t);for(let E of a)try{E.pause()}catch(v){$("runtime.adapters.waapi.site3",v)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&o&&i&&r.animate===i)try{r.animate=o,r.__hfOriginalAnimate===o&&delete r.__hfOriginalAnimate}catch(x){$("runtime.adapters.waapi.site5",x)}r=void 0,o=void 0,i=void 0,n=!1},getInferredDurationSeconds:()=>{let x=0;for(let E of s()){let v=y(E);v.endSeconds!=null&&(x=Math.max(x,v.endSeconds))}return x>0?x:null}}}var Dt=new WeakMap;function Wi(e){return Dt.has(e)?Dt.get(e)??null:e.getAttribute("src")}var $n=new WeakMap;function Zy(e){return $n.has(e)?$n.get(e)?.poster??null:e.getAttribute("poster")}var wk=2e3;function ex(e){let t=$n.get(e);return t!==void 0&&performance.now()-t.since<wk}var nx="hf-proxy-box",rx="hf-proxy-light",yl="hf-proxy-retry",ox="X-HF-Proxy-Progress",ix="X-HF-Proxy-Priority",_k=[256,304,362,430,512,608,724,862,1024,1218,1448,1722,2048,2436,2896,3444,4096,4870,5792,6888,8192];function tx(e){return e>0?_k.find(t=>t>=e)??null:null}function sf(e,t){let n=tx(e),r=tx(t);return n&&r?{width:n,height:r}:null}function ax(e){return`${e.width}x${e.height}`}var lf=[1,.5,.25,.125];function sx(e){return lf.some(t=>t===e)}var Tk=.5,Ck=4e7;function xl(e,t){return sf(e.width*t,e.height*t)??e}function Sl(e,t){return t.width*t.height<=Tk*e.width*e.height||e.bitDepth>8||e.bitrate>=Ck}var Rk=3;function Mk(e){let t=new URL(e,document.baseURI);return t.searchParams.delete(yl),t.href}function kk(e){let t={Range:"bytes=0-0"};return e&&(t[ix]="1"),t}function Lk(e,t){let n=e?.status===202?e.headers.get(ox):null;n!==null&&Number.isFinite(Number(n))&&t?.(Math.min(1,Math.max(0,Number(n))))}async function uf(e,t,n,r=()=>!1){let o=0,i=e;for(;t();){let a=kk(r()),l=await fetch(i,{headers:a,cache:"no-store"}).catch(()=>null);i=Mk(e),l?.body?.cancel().catch(()=>{});let s=l?.status===202||l?.status===503;if(Lk(l,n),!s&&l?.ok)return!0;if(!s&&++o>Rk)return!1;let c=Math.min(Number(l?.headers.get("Retry-After"))||2,30);await new Promise(d=>setTimeout(d,c*1e3))}return!1}var Nk="hf-proxy",lx="runtime_media_proxy_fallback",ux="runtime_media_proxy_unavailable",cx=new WeakSet,Xt=new WeakMap;function El(e){return e.currentSrc||e.src}var hn=1,df=new WeakSet,ff=new WeakSet,Mt=window.parent===window?1:null,fx=()=>{},Fk=new Promise(e=>fx=e),Pk=1e3,zn=new Map,Nr=new WeakMap;function Ik(){return Mt!==null?Promise.resolve(Mt):Promise.race([Fk.then(()=>Mt),new Promise(e=>setTimeout(()=>e(null),Pk))])}function mf(e,t){if(getComputedStyle(e).objectFit==="none")return null;let n=e.getBoundingClientRect(),r=document.documentElement,o=t*(window.devicePixelRatio||1);return sf(Math.max(n.width,r.clientWidth)*o,Math.max(n.height,r.clientHeight)*o)}function mx(e){if(!(!(e>0)||!Number.isFinite(e))){Mt=e,fx();for(let t of zn.keys())Al(t,e)}}function px(e){let t=window.__HF_MEDIA_CODEC_MAP__,n=xo(e);return t&&n!==null?So(n,t):null}function vl(e){let t=window.__HF_MEDIA_SOURCE_FACTS__,n=xo(e);return t&&n!==null?So(n,t):null}function Al(e,t){let n=zn.get(e);if(!n)return;if(!e.isConnected||e.getAttribute("src")!==n.href){zn.delete(e);return}let r=mf(e,t),o=hn<1,i=r&&o?xl(r,hn):r;if(!(o&&!i)){if(i&&o&&n.light&&Dk(e,i))return hx(e);Ok(n.box,i,o)||Gk(e,n,o||!i?i:Hk(i,n.box))}}function Dk(e,t){let n=vl(e);return n!==null&&!Sl(n,t)}function Ok(e,t,n){return n?t?.width===e.width&&t.height===e.height:t!==null&&t.width<=e.width&&t.height<=e.height}function Hk(e,t){return{width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)}}function Gk(e,t,n){let r=xx(t.originalSrc,t.variant,n,t.light,ff.delete(e));if(Nr.get(e)===r)return;Nr.set(e,r);let o=()=>Nr.get(e)===r&&e.isConnected&&e.getAttribute("src")===t.href;Vn(e,"making"),uf(r,o,i=>Vn(e,"making",i),()=>Vd(e)).then(i=>{o()&&Vn(e,i?"ready":"failed"),i&&o()&&yx(e,r,t.originalSrc,t.variant,n,t.light),Nr.get(e)===r&&Nr.delete(e)})}function hx(e){let t=Dt.get(e)??null;for(let n of[zn,Nr,Xt,Dt])n.delete(e);df.delete(e),ll(e),Js(),t===null?(cf.get(e)?.(),e.removeAttribute("src")):(bx(e),e.setAttribute("src",t)),e.load()}var Bk=640,gx=2,dx=["loadeddata","seeked","error"],cf=new WeakMap;function bx(e){if(!Re(e)||$n.has(e))return;let t=Uk(e);if(!t)return;$n.set(e,{poster:e.getAttribute("poster"),since:performance.now()}),e.setAttribute("poster",t);let n=()=>{for(let i of dx)e.removeEventListener(i,r);cf.delete(e);let o=$n.get(e)?.poster??null;$n.delete(e),o===null?e.removeAttribute("poster"):e.setAttribute("poster",o)},r=o=>{(o.type==="error"||e.readyState>=gx&&!e.seeking)&&n()};for(let o of dx)e.addEventListener(o,r);cf.set(e,n)}function Uk(e){if(e.readyState<gx||!e.videoWidth||!e.videoHeight)return null;let t=Math.min(1,Bk/e.videoWidth),n=document.createElement("canvas");n.width=Math.max(1,Math.round(e.videoWidth*t)),n.height=Math.max(1,Math.round(e.videoHeight*t));try{let r=n.getContext("2d");return r?(r.drawImage(e,0,0,n.width,n.height),n.toDataURL("image/jpeg",.85)):null}catch{return null}}function yx(e,t,n,r,o,i=!1){o?zn.set(e,{originalSrc:n,variant:r,href:t,box:o,light:i}):zn.delete(e),ll(e),Js(),bx(e),e.src=t,e.load()}function jn(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:Re(e)&&!!Pt(e)}function xo(e){let t=El(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 Wk(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 Vk(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,o=null,i=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,o=l,i=!1):s.length===r&&(i=!0))}return i?null:o}function So(e,t){return t[e]??Wk(e,t)??Vk(e,t)}function xx(e,t,n,r=!1,o=!1){let i=new URL(e,document.baseURI);return i.searchParams.set(Nk,t),n&&i.searchParams.set(nx,ax(n)),r&&n&&i.searchParams.set(rx,"1"),o&&i.searchParams.set(yl,"1"),i.href}var $k={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 qn(e,t,n){if(cx.has(e))return;cx.add(e);let r=$k[t];we({source:"hf-preview",type:"diagnostic",code:ux,details:{asset:n,codecName:null,reason:t,note:r}}),globalThis.console.info(`[hyperframes] ${ux}: "${n}" (${t}): ${r}`)}async function qk(e,t,n){let{originalSrc:r,originalAttr:o,variant:i,lightFacts:a,level:l,live:s}=t,c=n===null?null:mf(e,n),d=c&&l<1?xl(c,l):c;if(a&&!(d&&Sl(a,d))){Xt.get(e)===o&&Xt.delete(e);return}let f=xx(r,i,d,a!==void 0,ff.delete(e));Vn(e,"making");let m=await uf(f,s,b=>Vn(e,"making",b),()=>Vd(e));if(!s()){Xt.get(e)===o&&Xt.delete(e),a&&e.isConnected&&e.getAttribute("src")===o&&Ex(e);return}if(!m){Vn(e,"failed"),qn(e,"proxy_playback_failed",r);return}return Vn(e,"ready"),Dt.set(e,o),a&&df.add(e),yx(e,f,r,i,d,a!==void 0),Mt!==null&&Al(e,Mt),new Promise(b=>{e.addEventListener("loadeddata",b,{once:!0}),e.addEventListener("error",b,{once:!0})})}function Vi(e,t=null,n="reactive",r){if(Dt.has(e)||Xt.has(e)&&Xt.get(e)===e.getAttribute("src"))return;let o=El(e),i=t?t.hasAlpha?"vp8":"h264":"auto";try{new URL(o,document.baseURI)}catch(b){$("runtime.mediaProxy.swap",b),qn(e,"invalid_source_url",o);return}let a=e.getAttribute("src");Xt.set(e,a);let l=hn,c={originalSrc:o,originalAttr:a,variant:i,lightFacts:r,level:l,live:()=>e.isConnected&&e.getAttribute("src")===a&&(!r||hn===l)},d=Ik().then(b=>qk(e,c,b));if(r)return;tt(Promise.race([d,new Promise(b=>setTimeout(b,Wd))]),"video-frame");let f=t?.codecName??null;we({source:"hf-preview",type:"diagnostic",code:lx,details:{asset:o,codecName:f,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),globalThis.console.info(`[hyperframes] ${lx}: "${o}" uses a codec (${f??"unknown"}) this browser can\'t decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Sx(e){if(jn(e)||!Re(e)||Dt.has(e))return;let t=px(e),n=t?.representativeMime?e.canPlayType(t.representativeMime):"",r=n==="probably"||n==="maybe";t?.browserHostile&&!r?Vi(e,t,"proactive"):hn<1&&pf(e,t)}function pf(e,t){if(Dt.has(e)||Xt.has(e))return;let n=vl(e);n&&Vi(e,t,"light",n)}function Ex(e){if(!(jn(e)||!Re(e))){if(hn===1&&df.has(e))return hx(e);if(zn.has(e)&&Mt!==null)return Al(e,Mt);hn<1&&pf(e,px(e))}}function vx(e){if(!(!sx(e)||e===hn)){hn=e,cy(e),Js();for(let t of document.querySelectorAll("video"))Ex(t)}}function Ax(){if(Mt===null)return[];let e=[...document.querySelectorAll("video")].flatMap(t=>{let n=vl(t),r=n&&mf(t,Mt??1);return n&&r?[{facts:n,shown:r}]:[]});return lf.filter(t=>t<1&&e.some(({facts:n,shown:r})=>Sl(n,xl(r,t))))}function wx(){let e=new Map;for(let t of document.querySelectorAll("video")){let n=xo(t),r=window.__HF_MEDIA_CODEC_MAP__,{width:o=0,height:i=0,bitDepth:a=0,codec:l}=vl(t)??{},s=r&&n!==null?So(n,r)?.codecName:void 0,c=l??s??"unknown",d=`${c}|${o}|${i}|${a}`,f=e.get(d)??{codec:c,width:o,height:i,bitDepth:a,count:0};f.count+=1,e.set(d,f)}return[...e.values()]}function _x(){for(let e of dy()){ff.add(e),Xt.delete(e),Nr.delete(e);let t=window.__HF_MEDIA_CODEC_MAP__,n=xo(e),r=t&&n!==null?So(n,t):null;zn.has(e)&&Mt!==null?Al(e,Mt):r?.browserHostile?Vi(e,r,"reactive"):pf(e,r)}}function Tx(e){if(jn(e)||!Re(e)||e.videoWidth!==0)return;let t=El(e);if(Dt.has(e)){qn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=xo(e);if(r===null){qn(e,"cross_origin",t);return}let o=So(r,n);if(o&&!o.browserHostile){qn(e,"browser_safe_codec",t);return}Vi(e,o,"reactive")}function Cx(e){if(jn(e)||!Re(e))return;let t=El(e);if(Dt.has(e)){qn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=xo(e);if(r===null){qn(e,"cross_origin",t);return}let o=So(r,n);if(o&&!o.browserHostile){qn(e,"browser_safe_codec",t);return}Vi(e,o,"tertiary")}var qe=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);be(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},zk=[0,0,0],jk=[1,1,1],wl=65;function Kk(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 Kn(e,t){let n=Number(e);if(!Number.isFinite(n))throw new qe(`Invalid number "${e}"`,t);return n}function Rx(e,t,n){if(e.length!==3)throw new qe(`${t} expects three numbers`,n);return[Kn(e[0],n),Kn(e[1],n),Kn(e[2],n)]}function Mx(e,t,n){if(!e)throw new qe(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new qe(`${t} must be an integer greater than 1`,n);return r}function Yk(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new qe("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Xk(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 Jk(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function kx(e,t={}){let n=t.maxSize??wl,r=null,o=zk,i=jk,a=null,l=null,s=[],c=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let f=0;f<c.length;f++){let m=f+1,b=Kk(c[f]??"").trim();if(!b)continue;let h=b.split(/\\s+/),y=(h[0]??"").toUpperCase(),x=h.slice(1);if(y==="TITLE"){r=Xk(b);continue}if(y==="DOMAIN_MIN"){o=Rx(x,y,m);continue}if(y==="DOMAIN_MAX"){i=Rx(x,y,m);continue}if(y==="LUT_3D_INPUT_RANGE"){if(x.length!==2)throw new qe(`${y} expects two numbers`,m);let E=Kn(x[0],m),v=Kn(x[1],m);if(v<=E)throw new qe("LUT_3D_INPUT_RANGE max must exceed min",m);o=[E,E,E],i=[v,v,v];continue}if(y==="LUT_1D_SIZE"){a=Mx(x[0],y,m);continue}if(y==="LUT_3D_SIZE"){if(l=Mx(x[0],y,m),l>n)throw new qe(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!Jk(y)){if(y.startsWith("LUT_"))throw new qe(`Unsupported cube keyword ${y}`,m);continue}if(!l)throw a?new qe("1D cube LUTs are not supported yet",m):new qe("LUT data appears before LUT_3D_SIZE",m);if(h.length!==3)throw new qe("LUT data rows must contain three numbers",m);s.push(Kn(h[0],m),Kn(h[1],m),Kn(h[2],m))}if(a&&l)throw new qe("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new qe("1D cube LUTs are not supported yet"):new qe("Missing LUT_3D_SIZE");Yk(o,i);let d=l*l*l;if(s.length!==d*3)throw new qe(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:o,domainMax:i,data:new Float32Array(s)}}function Qk(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function $i(e){return Math.round(Qk(e)*255)}function hf(e){let t=e.size,n=t*t,r=t,o=new Uint8Array(n*r*4);for(let i=0;i<t;i++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((i*t+a)*t+l)*3,c=(a*n+i*t+l)*4;o[c]=$i(e.data[s]??0),o[c+1]=$i(e.data[s+1]??0),o[c+2]=$i(e.data[s+2]??0),o[c+3]=255}return{width:n,height:r,data:o}}function gf(e,t){if(!(t>=4)||e.size*e.size<=t)return e;let n=Math.max(2,Math.floor(Math.sqrt(t))),r=new Float32Array(n*n*n*3),o=e.size-1,i=(l,s,c,d)=>e.data[((c*e.size+s)*e.size+l)*3+d]??0,a=(l,s,c)=>l+(s-l)*c;for(let l=0;l<n;l++)for(let s=0;s<n;s++)for(let c=0;c<n;c++){let d=c/(n-1)*o,f=s/(n-1)*o,m=l/(n-1)*o,b=Math.floor(d),h=Math.floor(f),y=Math.floor(m),x=Math.min(o,b+1),E=Math.min(o,h+1),v=Math.min(o,y+1);for(let T=0;T<3;T++){let H=U=>a(a(i(b,h,U,T),i(x,h,U,T),d-b),a(i(b,E,U,T),i(x,E,U,T),d-b),f-h);r[((l*n+s)*n+c)*3+T]=a(H(y),H(v),m-y)}}return{...e,size:n,data:r}}var Lx="rec709";var Nx=["video","img","canvas"],Fx="hf-color-group",Px="data-color-group",Fe={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 Ix=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"];var Dx=["shadows","midtones","highlights"],Ox=["master","red","green","blue"],Hx=["hueVsHue","hueVsSaturation","hueVsLuma"];var Gx=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Bx=["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 W5=Fe.unit,V5=Fe.signedUnit,$5=Fe.effects;var Jt=1024,qi=16;function Ux(e,t,n,r){let o=((2*e+t)*n-e*r)/(e+t);return Math.sign(o)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(o)>3*Math.abs(n)?3*n:o}function ze(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Zk(e){let t=[],n=[],r=ze(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let o=ze(n,0);if(e.length===2)return[o,o];let i=new Array(e.length);i[0]=Ux(ze(t,0),ze(t,1),o,ze(n,1)),i[i.length-1]=Ux(ze(t,t.length-1),ze(t,t.length-2),ze(n,n.length-1),ze(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ze(n,a-1),s=ze(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){i[a]=0;continue}let c=ze(t,a-1),d=ze(t,a),f=2*d+c,m=d+2*c;i[a]=(f+m)/(f/l+m/s)}return i}function Wx(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,o]of e){if(!Number.isFinite(r)||!Number.isFinite(o))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 eL(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 tL(e,t,n,r,o){let i=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/i)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*i*r+(-2*s+3*l)*n[1]+(s-l)*i*o}function Vx(e,t,n,r,o){eL(e,r,o);let i=Zk(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let c=n(s);for(;l<e.length-2&&c>ze(e,l+1)[0];)l+=1;let d=ze(e,l),f=ze(e,l+1),m=tL(c,d,f,ze(i,l),ze(i,l+1));a[s]=Math.min(o,Math.max(r,m))}return a}function Eo(e,t=Jt){if(Wx(e,t),e.length>qi)throw new RangeError(`A color curve supports at most ${qi} 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 Vx(e,t,n=>n/(t-1),0,1)}function yf(e,t,n,r=Jt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>qi)throw new RangeError(`A hue curve supports at most ${qi} points`);let o=[...e].sort((s,c)=>s[0]-c[0]);for(let s=0;s<o.length;s+=1){let c=o[s];if(!c||c[0]<0||c[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&c[0]===o[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let i=o.slice(-2).map(([s,c])=>[s-360,c]),a=o.slice(0,2).map(([s,c])=>[s+360,c]),l=[...i,...o,...a];return Wx(l,r),Vx(l,r,s=>s/r*360,t,n)}var wo="data-color-grading",Fr="data-hf-color-grading-source-hidden",Pr="data-hf-authored-opacity",Kx="__hf_color_grading_",rL=Lx,zi=Nx,Ef={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},vf={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Af={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 Cl=Ix,Yx=Dx,Xx=Ox,Jx=Hx,_f=Gx,Tf=Bx,$x={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},qx={vignette:.18};function je(e,t,n={},r={},o={},i=1){return{id:e,label:t,intensity:i,adjust:{...Ef,...n},details:{...vf,...r},effects:{...Af,...o}}}var Cf=[je("neutral","Neutral"),je("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),je("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),je("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),je("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),je("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),je("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),je("vintage-wash","Vintage Wash",$x,qx),je("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),je("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),je("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),je("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),je("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),je("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),je("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}),je("home-movie-8mm","8mm Home Movie",$x,{...qx,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),je("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),je("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],oL=new Map(Cf.map(e=>[e.id,e])),iL=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,aL={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}},vo={hue:0,amount:0,level:0},zx={amount:Fe.unit,level:Fe.signedUnit},Yn=[[0,0],[1,1]],Ao=[],sL={hueVsHue:Fe.secondaryHueShift,hueVsSaturation:Fe.signedUnit,hueVsLuma:Fe.signedUnit},xf={center:0,range:180,softness:0},Sf={min:0,max:1,softness:.05},lL={vignette:Fe.unit,vignetteMidpoint:Fe.unit,vignetteRoundness:Fe.signedUnit,vignetteFeather:Fe.unit,grain:Fe.unit,grainSize:Fe.unit,grainRoughness:Fe.unit},wf=Fe.unit,uL=Fe.effects,Qx=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var cL=Cf.filter(e=>Qx.some(t=>e.effects[t]>1e-4)),Z5=Cf.filter(e=>!cL.includes(e)),e$={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}},Zx=[{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 dL=/^#[0-9a-f]{6}$/i;function fL(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&dL.test(t))?null:e.map(t=>t.toLowerCase())}function nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Tl(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function eS(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function ct(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Tl(n,t.min,t.max):0}function Rf(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function mL(e){let t=nt(e)?e:{};return Yx.reduce((n,r)=>{let o=nt(t[r])?t[r]:{};return n[r]={hue:Rf(o.hue,vo.hue),amount:ct(o.amount??vo.amount,zx.amount),level:ct(o.level??vo.level,zx.level)},n},{shadows:{...vo},midtones:{...vo},highlights:{...vo}})}function pL(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)?[Tl(t,0,1),Tl(n,0,1)]:null}function tS(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function hL(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function gL(e){if(!Array.isArray(e)||e.length<2)return Yn;let t=[];for(let n of e){let r=pL(n);if(!r)return Yn;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),tS(t)||(hL(t),t.length>16)?Yn:t}function bL(e){let t=nt(e)?e:{};return Xx.reduce((n,r)=>(n[r]=gL(t[r]),n),{master:Yn,red:Yn,green:Yn,blue:Yn})}function yL(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)?[Rf(n),Tl(r,t.min,t.max)]:null}function xL(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return Ao;let n=[];for(let r of e){let o=yL(r,t);if(!o)return Ao;n.push(o)}return n.sort((r,o)=>r[0]-o[0]),tS(n)?Ao:n}function SL(e){let t=nt(e)?e:{};return Jx.reduce((n,r)=>(n[r]=xL(t[r],sL[r]),n),{hueVsHue:Ao,hueVsSaturation:Ao,hueVsLuma:Ao})}function jx(e){let t=nt(e)?e:{},n=ct(t.min??Sf.min,wf),r=ct(t.max??Sf.max,wf);return{min:Math.min(n,r),max:Math.max(n,r),softness:ct(t.softness??Sf.softness,Fe.secondarySoftRangeSoftness)}}function EL(e){let t=nt(e)?e:{},n=ct(t.range??xf.range,Fe.secondaryHueRange);return{center:Rf(t.center,xf.center),range:n,softness:ct(t.softness??xf.softness,{min:Fe.secondaryHueSoftness.min,max:Fe.secondaryHueCombinedMax-n})}}function vL(e){return{hueShift:ct(e.hueShift??0,Fe.secondaryHueShift),saturation:ct(e.saturation??0,Fe.signedUnit),luma:ct(e.luma??0,Fe.signedUnit),temperature:ct(e.temperature??0,Fe.signedUnit),tint:ct(e.tint??0,Fe.signedUnit)}}function AL(e){return!nt(e)||!nt(e.key)||!nt(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:EL(e.key.hue),saturation:jx(e.key.saturation),luma:jx(e.key.luma)},correction:vL(e.correction)}}function wL(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=AL(n);r&&t.push(r)}return t}function _L(e){if(e==null)return null;let t=String(e).trim();return t||null}function TL(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!nt(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:eS(e.intensity,1)}}function CL(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return nt(n)?n:null}catch{return null}return{preset:t}}return nt(e)?e:null}function RL(e,t){let n=e.trim().match(iL);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function _l(e,t){if(typeof e=="string"){let r=RL(e,t);if(r!==e)return r;let o=e.trim();if(!o.startsWith("{"))return e;try{return _l(JSON.parse(o),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>_l(r,t));if(!nt(e))return e;let n={};for(let[r,o]of Object.entries(e))n[r]=_l(o,t);return n}function ML(e){return e?oL.get(e)??null:null}function Rl(e){let t=CL(e);if(!t||t.enabled===!1)return null;let n=_L(t.preset),r=ML(n),o=r?.adjust??Ef,i=r?.details??vf,a=r?.effects??Af,l=nt(t.adjust)?t.adjust:{},s=nt(t.details)?t.details:{},c=nt(t.effects)?t.effects:{},d=Cl.reduce((b,h)=>(b[h]=ct(l[h]??o[h],aL[h]),b),{...Ef}),f=_f.reduce((b,h)=>(b[h]=ct(s[h]??i[h],lL[h]),b),{...vf}),m=Tf.reduce((b,h)=>(b[h]=ct(c[h]??a[h],uL[h]??wf),b),{...Af});return{enabled:!0,preset:n,intensity:eS(t.intensity,r?.intensity??1),adjust:d,wheels:mL(t.wheels),curves:bL(t.curves),hueCurves:SL(t.hueCurves),secondaries:wL(t.secondaries),details:f,effects:m,palette:fL(t.palette),lut:TL(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():rL}}function nS(e,t){return Rl(_l(e,t))}function kL(e){return Yx.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Mf(e){return Xx.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function kf(e){return Jx.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Lf(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function rS(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||Qx.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Cl.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?kL(e.wheels):!1)||(e.curves?Mf(e.curves):!1)||(e.hueCurves?kf(e.hueCurves):!1)||(e.secondaries?Lf(e.secondaries):!1):!1}var Ml=/^(|transparent|rgba\\(.*,\\s*0\\)|.*\\/\\s*0%?\\s*\\))$/,LL=new Set(["IMG","VIDEO","IFRAME","EMBED","OBJECT","CANVAS"]),oS="http://www.w3.org/2000/svg",NL=new Set(["svg","g","foreignObject"]),FL=["Top","Right","Bottom","Left"],PL={left:-1/0,right:1/0,top:-1/0,bottom:1/0},iS=e=>!!e.backgroundImage&&e.backgroundImage!=="none"||!Ml.test(e.backgroundColor),IL=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!Ml.test(t)||n>0&&!Ml.test(r)},aS=e=>FL.map(t=>e[`border${t}Style`]!=="none"&&!Ml.test(e[`border${t}Color`])&&Number.parseFloat(e[`border${t}Width`])||0),kl=e=>e.bottom-e.top,Nf=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,sS=(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)}),DL=(e,t)=>t.display==="none"||t.position==="absolute"||t.position==="fixed"||Number.parseFloat(t.opacity)<=.01&&!e.hasAttribute(Fr);function OL(e,t,n){if(e.width<=0&&e.height<=0)return!1;let r=3*(Number.parseFloat(t.fontSize)||16),o=Math.max(r,Math.min(2*e.height,20*r/3));return n<e.top-o||n>e.bottom+o}function HL(e,t,n,r){let[o,i,a,l]=aS(t);if(!(o||i||a||l))return!1;let s=e.getBoundingClientRect(),{offsetWidth:c,offsetHeight:d}=e,f=c>0?s.width/c:1,m=d>0?s.height/d:1,b={left:s.left+l*f,right:s.right-i*f,top:s.top+o*m,bottom:s.bottom-a*m};return!Nf(b,n,r)}function GL(e){let t=[];for(let n of[...e].sort((r,o)=>r.left-o.left)){let r=t.findIndex(o=>n.top<o.bottom&&n.bottom>o.top&&n.left-o.right<=2*Math.max(kl(o),kl(n)));r<0?t.push(n):t[r]=sS(t[r],n)}return t}function BL(e){let t=[...e].sort((n,r)=>n.top-r.top);return t.flatMap((n,r)=>t.slice(r+1).flatMap(o=>{let i=o.left<n.right&&o.right>n.left,a=o.top-n.bottom<=2*Math.min(kl(n),kl(o));return i&&a&&o.top>n.bottom?[sS(n,o)]:[]}))}function lS(e,t,n){let r=e.defaultView,o=typeof e.createRange().getClientRects=="function",i=e.createRange(),a=new Map,l=new Map,s=new Map,c=x=>{let E=l.get(x);if(E===void 0){let v=r.getComputedStyle(x);E=DL(x,v)||o&&OL(x.getBoundingClientRect(),v,n),l.set(x,E)}return E},d=x=>{let E=s.get(x);if(E===void 0){let v=x.parentElement,T=v&&x.nodeValue?.trim()?r.getComputedStyle(v):null;E=!!T&&T.visibility!=="hidden"&&IL(T),s.set(x,E)}return E},f=x=>{if(!o)return[PL];let E=[];i.selectNodeContents(x);for(let v of i.getClientRects()){let T=v.bottom-v.top;v.width>0&&T>0&&n>=v.top-2*T&&n<=v.bottom+2*T&&E.push(v)}return E},m=x=>{let E=a.get(x);if(E)return E;E=[];for(let v of x.childNodes)v.nodeType===3?d(v)&&E.push(...f(v)):v.nodeType===1&&v.hasChildNodes()&&!c(v)&&E.push(...m(v));return a.set(x,E),E};function b(x){let E=GL(m(x));return E.some(v=>Nf(v,t,n))||BL(E).some(v=>Nf(v,t,n))}function h(x,E){let v=r.getComputedStyle(x,E);return!v.content||v.content==="none"||v.content==="normal"||v.display==="none"?!1:v.content!==\'""\'||iS(v)||aS(v).some(T=>T>0)}let y=(x,E)=>/inset/.test(E.boxShadow)||HL(x,E,t,n)||h(x,"::before")||h(x,"::after");return x=>{if(LL.has(x.tagName)||!(x.namespaceURI!==oS||NL.has(x.localName))||!r)return!0;let v=r.getComputedStyle(x);return iS(v)||y(x,v)||x.namespaceURI!==oS&&b(x)}}var UL=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),WL=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),uS="[data-hf-inner-root],[data-composition-id]:not([data-composition-id] *)",cS=`${uS}{pointer-events:auto!important}`,VL=`@layer hf-picker{${cS}}`;function dS(e){let t=!1,n=null,r=null,o=null,i=null,a,l=new Set;function s(_,N){try{window.dispatchEvent(new CustomEvent(_,{detail:N}))}catch(j){$("runtime.picker.site1",j)}}function c(_){o=_,s("hyperframe:picker:hovered",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function d(_){i=_,s("hyperframe:picker:selected",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function f(_){if(l=new Set(Array.from(document.querySelectorAll(uS)).filter(ae=>getComputedStyle(ae).pointerEvents==="none")),l.size===0)return _();let N=m(),j=N?b(N):h();try{return _()}finally{j(),l=new Set}}function m(){if(a!==void 0)return a;if(a=null,!Array.isArray(document.adoptedStyleSheets)||typeof CSSStyleSheet>"u")return null;try{let _=new CSSStyleSheet;_.replaceSync(VL),a=_}catch(_){$("runtime.picker.site2",_)}return a}function b(_){return document.adoptedStyleSheets=[...document.adoptedStyleSheets,_],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(N=>N!==_)}}function h(){let _=document.createElement("style");return _.textContent=cS,(document.head??document.documentElement).appendChild(_),()=>_.remove()}function y(_,N){let j=N.getComputedStyle(_),ae=Number.parseFloat(j.opacity||"1");if(Number.isFinite(ae)&&ae<.2&&!(_.textContent??"").trim()){let ve=j.backgroundImage;if(ve&&ve!=="none")return!0}return H(_,N)}function x(_){if(_.namespaceURI!=="http://www.w3.org/2000/svg")return!1;let N=_.tagName.toLowerCase();return N==="filter"||N==="defs"||N.startsWith("fe")}function E(_){if(_.namespaceURI!=="http://www.w3.org/2000/svg"||_.tagName.toLowerCase()!=="rect")return!1;let N=(_.getAttribute("filter")??"").trim();return N&&N!=="none"?!0:(_.ownerDocument.defaultView?.getComputedStyle(_).filter??"none").startsWith("url(")}function v(_){if((_.textContent??"").trim())return!1;if(x(_)||E(_))return!0;let N=[..._.children];return N.length>0&&N.every(j=>v(j))}function T(_,N){let j=Number.parseFloat(N.getComputedStyle(_).opacity||"1");return Number.isFinite(j)&&j<.2}function H(_,N){if(!v(_))return!1;for(let j=_;j&&j!==document.body&&j!==document.documentElement;j=j.parentElement)if(T(j,N)&&v(j))return!0;return!1}function U(_){let N=_.ownerDocument.defaultView;if(!N)return!1;let j=_;if(N.getComputedStyle(_).visibility==="hidden"||y(_,N))return!0;for(;j&&j!==document.body&&j!==document.documentElement;){let ae=N.getComputedStyle(j);if(ae.display==="none"||ae.pointerEvents==="none")return!0;let de=Number.parseFloat(ae.opacity);if(Number.isFinite(de)&&de<=.01&&!j.hasAttribute(Fr))return!0;j=j.parentElement}return!1}function M(_){if(!_||_===document.body||_===document.documentElement)return!1;let N=_.tagName.toLowerCase();return!(N==="script"||N==="style"||N==="link"||N==="meta"||l.has(_)||_.closest(UL)||U(_))}function L(_){return!!_?.closest(WL)}function G(_){let N=_.parentElement?.getAttribute("data-composition-id");return!_.hasAttribute("data-hf-inner-root")||!N?null:`[data-composition-id="${CSS.escape(N)}"] > [data-hf-inner-root]`}function C(_){let N=G(_);if(N)return N;let j=_;if(j.id)return`#${CSS.escape(j.id)}`;let ae=_.getAttribute("data-composition-id");if(ae)return`[data-composition-id="${CSS.escape(ae)}"]`;let de=_.getAttribute("data-composition-src");if(de)return`[data-composition-src="${CSS.escape(de)}"]`;let ve=_.getAttribute("data-track-index");if(ve)return`[data-track-index="${CSS.escape(ve)}"]`;let z=_.tagName.toLowerCase(),ee=_.parentElement;if(!ee)return z;let Q=ee.querySelectorAll(`:scope > ${z}`);if(Q.length===1)return z;for(let fe=0;fe<Q.length;fe+=1)if(Q[fe]===_)return`${z}:nth-of-type(${fe+1})`;return z}function B(_){let N=_.tagName.toLowerCase(),j=(_.textContent??"").trim().replace(/\\s+/g," "),ae=(ve,z)=>{let ee=Array.from(ve);return ee.length>z?`${ee.slice(0,z-1).join("")}\\u2026`:ve},de=/^h[1-6]$/.test(N);return de||N==="p"||N==="span"||N==="div"?j.length>0?ae(j,56):de?"Heading":"Text":N==="img"?"Image":N==="video"?"Video":N==="audio"?"Audio":N==="svg"?"Shape":_.getAttribute("data-composition-src")?"Composition":N==="section"?"Section":`${N.charAt(0).toUpperCase()}${N.slice(1)}`}function O(_,N,j){let ae=typeof j=="number"&&j>0?j:8,de=[];if(document.elementsFromPoint)de=document.elementsFromPoint(_,N);else if(document.elementFromPoint){let fe=document.elementFromPoint(_,N);de=fe?[fe]:[]}if(L(de[0]??null))return[];let ve={},z=[],ee=[],Q=lS(document,_,N);for(let[fe,ce]of de.entries()){if(!M(ce))continue;let xe=`${ce.tagName}::${ce.id||""}::${fe}`;if(!ve[xe]&&(ve[xe]=!0,z.push(ce),(ee.some(re=>ce.contains(re))||Q(ce))&&(ee.push(ce),ee.length>=ae)))break}return ee.length>0?ee:z.slice(0,ae)}function Y(_){let N=_.getBoundingClientRect(),j={};for(let de of Array.from(_.attributes))de.name.startsWith("data-")&&(j[de.name]=de.value);return{id:_.id||null,tagName:_.tagName.toLowerCase(),selector:C(_),label:B(_),boundingBox:{x:N.left,y:N.top,width:N.width,height:N.height},textContent:_.textContent?_.textContent.trim().slice(0,200):null,src:_.getAttribute("src")||_.getAttribute("data-composition-src")||null,dataAttributes:j}}function Z(_,N,j){return f(()=>O(_,N,j)).map(Y)}function J(_){if(!t)return;let N=f(()=>{let ae=O(_.clientX,_.clientY,1)[0]??(Ge(_.target)?_.target:null);return M(ae)?ae:null});if(!N||n===N)return;n&&n.classList.remove("__hf-pick-highlight"),n=N,N.classList.add("__hf-pick-highlight");let j=Y(N);c(j),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:j})}function D(_){if(!t)return;_.preventDefault(),_.stopPropagation(),_.stopImmediatePropagation();let N=Z(_.clientX,_.clientY,8);N.length!==0&&(c(N[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:N,selectedIndex:0,point:{x:_.clientX,y:_.clientY}}))}function V(_){_.key==="Escape"&&(k(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function R(){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(`\n`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",J,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",V,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function k(){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",J,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",V,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function F(){window.__HF_PICKER_API={enable:R,disable:k,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(_,N,j)=>Number.isFinite(_)&&Number.isFinite(N)?Z(_,N,j):[],pickAtPoint:(_,N,j)=>{if(!Number.isFinite(_)||!Number.isFinite(N))return null;let ae=Z(_,N,8);if(!ae.length)return null;let de=Math.max(0,Math.min(ae.length-1,Number(j??0))),ve=ae[de]??null;return ve?(d(ve),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:ve}),k(),ve):null},describe:_=>Ge(_)?Y(_):null,pickManyAtPoint:(_,N,j)=>{if(!Number.isFinite(_)||!Number.isFinite(N))return[];let ae=Z(_,N,8);if(!ae.length)return[];let de=[],ve=Array.isArray(j)?j:[0];for(let z of ve){let ee=Math.max(0,Math.min(ae.length-1,Math.floor(Number(z)))),Q=ae[ee];if(!Q)continue;de.some(ce=>ce.selector===Q.selector&&ce.tagName===Q.tagName)||de.push(Q)}return de.length?(d(de[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:de}),k(),de):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:R,disablePickMode:k,installPickerApi:F}}function ji(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&&$("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Ot(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&$("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Ki(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(o){$("runtime.player.site1",o)}}}function Ll(e,t,n){return n?.exact===!0?Number.isFinite(e)&&e>0?e:0:Y0(e,t,n?.subFrameDivisions)}function fS(e,t,n,r){let o=Ll(t,n,r),i=r?.suppressEvents===!0;return Ot(e,"pause"),typeof e.totalTime=="function"?e.totalTime(o,i):typeof e.seek=="function"&&e.seek(o,i),o}function $L(e,t,n,r,o){let i=[];Ki(e,t,a=>{Ot(a,"play"),i.push(a)});try{return fS(t,n,r,o)}finally{for(let a of i)try{Ot(a,"pause")}catch(l){$("runtime.player.site2",l)}}}function qL(e,t){Ki(e,t,n=>{Ot(n,"play")})}function mS(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?.()??ji(n,"duration",0))||0);r>0&&Math.max(0,ji(n,"time",0))>=r&&(Ot(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()),Ot(n,"play"),Ki(e.getTimelineRegistry?.(),n,o=>{typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Ot(o,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Ot(n,"pause"),Ki(e.getTimelineRegistry?.(),n,o=>{Ot(o,"pause")});let r=Math.max(0,ji(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 o=e.getTimeline();if(!o)return;let i=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=$L(e.getTimelineRegistry?.(),o,i,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Ot(o,"play"),Ki(e.getTimelineRegistry?.(),o,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Ot(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let o=e.getTimeline(),i=e.getCanonicalFps(),a=o?(qL(e.getTimelineRegistry?.(),o),fS(o,n,i,r)):Ll(Math.max(0,Number(n)||0),i,r);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>ji(e.getTimeline(),"time",0),getDuration:()=>ji(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}var Pf="data-composition-id",zL="data-composition-src",jL=`[${Pf}]`,m$=`[${zL}]`,If="style",pS="script",Df=\'link[rel="stylesheet"], link[rel="preconnect"]\',KL=new Set(["","application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"]),YL=e=>(e.getAttribute("type")||"").trim().toLowerCase();function hS(e){let t=YL(e);return t==="module"||t==="importmap"?!0:KL.has(t)&&e.getAttribute("nomodule")===null}function Ff(e){return Xn(e?.querySelectorAll(pS)).filter(t=>!hS(t))}function Of(e){return Xn(e?.querySelectorAll(pS)).filter(hS)}function gS(e){return[...Xn(e.querySelectorAll(`${If}, ${Df}`)),...Of(e)]}function Xn(e){return e?Array.from(e):[]}function bS(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:o,compositionId:i}=e,a=Xn(t.querySelectorAll(jL)),l=i?a.find(f=>f.getAttribute(Pf)===i)??null:a[0]??null,s=(l??a[0])?.getAttribute(Pf)?.trim()||"",c=o?null:n??null,d=l?Ff(l):[];return{innerRoot:l,authoredCompositionId:i||s||null,scriptCompositionId:s||i||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Xn(c?.querySelectorAll(If)),...Xn(t.querySelectorAll(If))],scriptSources:[...Of(c),...Of(t)],linkSources:[...Xn(n?.querySelectorAll(Df)),...Xn(t.querySelectorAll(Df))],inertScriptsOutsideRoot:[...Ff(c),...l?Ff(t).filter(f=>!d.includes(f)):[]],variableDefaultCarriers:[r,l].filter(f=>f!=null)}}function yS(e,t){let n=t[0]?.ownerDocument.querySelector("[data-composition-id]"),r=n&&!t.includes(n)?n.getAttribute("data-composition-id"):null,o=r?e.get(r):void 0;r&&o&&e.set(r,o+1)}var XL=\'"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 xS(){return XL}var Oe=mR(KE(),1),Kl=Oe.default,r6=Oe.default.stringify,o6=Oe.default.fromJSON,i6=Oe.default.plugin,a6=Oe.default.parse,s6=Oe.default.list,l6=Oe.default.document,u6=Oe.default.comment,c6=Oe.default.atRule,d6=Oe.default.rule,f6=Oe.default.decl,m6=Oe.default.root,p6=Oe.default.CssSyntaxError,h6=Oe.default.Declaration,g6=Oe.default.Container,b6=Oe.default.Processor,y6=Oe.default.Document,x6=Oe.default.Comment,S6=Oe.default.Warning,E6=Oe.default.AtRule,v6=Oe.default.Result,A6=Oe.default.Input,w6=Oe.default.Rule,_6=Oe.default.Root,T6=Oe.default.Node;var Yl="data-hf-authored-id",YE="data-hf-inner-root";function Or(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Xl(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function MF(e){let t=e.trim();return t?Array.from(new Set([t,an(t)])).filter(Boolean):[]}function kF(e,t,n){let r=MF(t);return ps(e,r,()=>n)}function JE(e,t){let n=t?.trim();return n?kF(e,n,`[${Yl}="${Xl(n)}"]`):e}function XE(e){return`${e}:not(:has([${YE}])), ${e} > [${YE}]`}function LF(e,t,n){let r=t?.trim();if(!r)return e;let o=Or(`[${Yl}="${Xl(r)}"]`),i=Or(n),a=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`;return e.replace(new RegExp(`(${o})${a}|${a}(${o})`,"g"),"$1$2")}function NF(e,t,n,r,o,i){let a=JE(e,r),l=LF(a,r,n),s=c=>FF(c,t,n,r,o,i);return l===a?s(e):`${s(a).trim()}, ${s(l).trim()}`}function FF(e,t,n,r,o,i){let a=JE(e,r),l=PF(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return i?XE(t):e;let c=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*[\\\\^\\\\*\\\\$]?=\\\\s*(["\'])${Or(n)}\\\\1\\\\s*\\\\]`,"g");if(c.test(s))return s.replace(c,"").trim()===""?XE(t):l.replace(c,t);let d=l.match(/^\\s*/)?.[0]??"",f=l.match(/\\s*$/)?.[0]??"";if(o){let m=r?`[${Yl}="${Xl(r)}"]`:null;if(m&&s.startsWith(m)){let b=s.slice(m.length);return`${d}${t}${m}${b}${f}`}}return`${d}${t} ${s}${f}`}function PF(e,t,n){let r=Or(n),o=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${r}"|\'${r}\')\\s*\\]`,i=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return e.replace(new RegExp(`${o}(?:${i})+`,"g"),t).replace(new RegExp(`(?:${i})+${o}`,"g"),t)}var IF=new Set(["keyframes","-webkit-keyframes","font-face"]);function DF(e){return e?.type==="atrule"}function OF(e){let t=e.parent;for(;t;){if(DF(t)&&IF.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function HF(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function QE(e,t,n,r,o){let i=t.trim();if(!e||!i)return e;let a=n||`[data-composition-id="${Xl(i)}"]`,l=GF(e);return l?UF(l,a,i,r,o):""}function GF(e){try{return Kl.parse(e)}catch{return null}}function BF(e,t){e.walkRules(n=>{OF(n)||HF(n)||t(n)})}function UF(e,t,n,r,o){return BF(e,i=>{i.selectors=i.selectors.map(a=>NF(a,t,n,r,o?.compoundAuthoredRoot,o?.scopeRootSelectors))}),e.toResult({map:!1}).css}var WF="hf-scope-placeholder",N6=`[data-composition-id="${WF}"]`;function vt(e){return JSON.stringify(e).replace(/</g,"\\\\u003c")}var ZE=`!__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n assetUrl: function(path) {\n var page = window.document.baseURI;\n return new URL(path, __hfCompositionSrc ? new URL(__hfCompositionSrc, page) : page).href;\n },\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n })`,VF="/*hf-authored-begin*/",$F="/*hf-authored-end*/";function ev(e,t){return`const __hyperframes = (function(__hfBaseHyperframes, __hfTimelineCompId, __hfCompositionSrc) {\n return ${ZE};\n})(window.__hyperframes, ${vt(e)}, ${vt(t?.trim()||null)});\n${lm("",e)}\n`}function lm(e,t,n="[HyperFrames] composition script error:",r,o=t,i,a){let l=vt(t),s=vt(o),c=vt(n),d=Or(t),f=vt(i?.trim()||null),m=vt(r??null),b=vt(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${d}"|\'${d}\')\\s*\\]`),h=vt(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${Or(o)}"|\'${Or(o)}\')\\s*\\]`),y=vt(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`);return`(function(){\n ${`(function(){ ${xS()} })();`}\n var __hfCompId = ${l};\n var __hfTimelineCompId = ${s};\n var __hfErrorLabel = ${c};\n var __hfAuthoredRootId = ${f};\n var __hfCompositionSrc = ${vt(a?.trim()||null)};\n var __hfAuthoredRootAttr = ${vt(Yl)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${m} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${b};\n var __hfTimelineRootSelectorPattern = ${h};\n var __hfTimingSelectorPattern = ${y};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfAuthoredRootEntries = __hfAuthoredRootSelector\n ? [{ id: __hfAuthoredRootId, replacement: __hfAuthoredRootSelector }]\n : [];\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector)\n .replace(new RegExp(__hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfTimelineCompId !== __hfCompId) {\n normalized = normalized.replace(new RegExp(__hfTimelineRootSelectorPattern, \'g\'), __hfRootSelector);\n }\n return window.__hfSvgSelectorAliases.rewrite(normalized, __hfAuthoredRootEntries);\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var runtimeValue = Reflect.get(target, __hfTimelineCompId, target);\n return runtimeValue === undefined ? Reflect.get(target, prop, target) : runtimeValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities,\n // unless another mount of the same file already owns the authored one.\n var authoredValue = Reflect.get(target, __hfCompId, target);\n var ownsAuthored =\n authoredValue === undefined ||\n authoredValue === Reflect.get(target, __hfTimelineCompId, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n if (!ownsAuthored) return runtimeSet;\n return Reflect.set(target, __hfCompId, value, target) && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n // Native window methods must stay bound to the real window. Handed\n // back unbound, "this" at call time is this Proxy and Chrome rejects\n // it with "Illegal invocation", which broke window.addEventListener,\n // setTimeout, matchMedia and getComputedStyle inside every\n // sub-composition -- including the window.addEventListener("hf-seek",\n // ...) form the Three.js and TypeGPU adapters document. The sibling\n // document and gsap proxies here already bind.\n //\n // Only bind non-constructors. Function.prototype.bind drops static\n // members, so binding a class exposed on window (window.Texts and\n // friends) would silently strip its statics. Built-in methods have\n // no .prototype; classes and constructor functions do.\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" && value.prototype === undefined\n ? value.bind(target)\n : value;\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string" && !Array.isArray(target)) return target;\n var resolved = typeof target === "string" ? __hfQueryAll(target) : target.reduce(function(resolved, item) {\n if (typeof item === "string") {\n return resolved.concat(Array.prototype.slice.call(__hfQueryAll(item)));\n }\n resolved.push(item);\n return resolved;\n }, []);\n if (!resolved.length) {\n // GSAP warns "GSAP target " + targets + " not found"; a bare empty match list prints an\n // empty name. Keep the authored selector as the text while still targeting nothing here.\n var originalTarget = String(target);\n resolved = [];\n resolved.toString = function() { return originalTarget; };\n }\n return resolved;\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = ${ZE};\n var __hfRun = function() {\n var report = window.__hfScriptState;\n if (typeof report === "function") report("start", __hfCompositionSrc || "index.html");\n try {\n (function(document, gsap, window, __hyperframes) {\n${VF}\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n${$F}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n } finally {\n if (typeof report === "function") report("finish", __hfCompositionSrc || "index.html");\n }\n };\n // What the script started on the global gsap timeline, by any route, for a scene swap to revert.\n // Only a page with a scene manifest can swap; elsewhere the first script stores null and none records.\n var __hfRecordAnimations = function(run) {\n if (window.__hfSceneAnimations === undefined) {\n window.__hfSceneAnimations = window.document.querySelector(${vt(`meta[name="${Nn}"]`)})\n ? {}\n : null;\n }\n var byComp = window.__hfSceneAnimations;\n var globalTimeline = __hfBaseGsap && __hfBaseGsap.globalTimeline;\n if (!byComp || !globalTimeline || !__hfTimelineCompId) return run();\n var before = globalTimeline.getChildren(false);\n // A set completes as it is made and would leave the timeline before the diff below.\n var autoRemove = globalTimeline.autoRemoveChildren;\n globalTimeline.autoRemoveChildren = false;\n run();\n globalTimeline.autoRemoveChildren = autoRemove;\n var recorded = (byComp[__hfTimelineCompId] = byComp[__hfTimelineCompId] || []);\n globalTimeline.getChildren(false).forEach(function(animation) {\n if (before.indexOf(animation) >= 0) return;\n recorded.push(animation);\n // Dropped as the timeline drops a finished tween (it keeps a paused one); moved back, a tween re-adds itself.\n if (autoRemove && !animation.getChildren && animation.totalProgress() === 1) globalTimeline.remove(animation);\n });\n };\n __hfFindRoot();\n __hfRecordAnimations(__hfRun);\n})();`}function Jl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function qF(e){return Jl(e)&&Object.values(e).every(Jl)}var tv=(e,t)=>e&&Object.fromEntries(Object.entries(e).map(([n,r])=>[n,typeof r=="string"?t(r):null]));function nv(e,t){let n;try{n=JSON.parse(e)}catch{return null}if(!Jl(n))return null;let{imports:r,scopes:o}=n;return r!==void 0&&!Jl(r)||o!==void 0&&!qF(o)?null:{imports:tv(r,t),scopes:o&&Object.fromEntries(Object.entries(o).map(([i,a])=>[t(i),tv(a,t)??{}]))}}var um="text/hf-after-fonts",ov=`${um}+module`,iv=`script[type="${um}"], script[type="${ov}"]`,av="__hfAfterFontsClaimed",zF="data-hf-inlined-src";var sv=`[defer][src], [defer][${zF}]`;function Ql(e){let t=e.getAttribute("type");return t===um?null:t===ov?"module":t}function jF(e){let t=e.getAttribute("type")??"",n=e.tagName.toLowerCase()==="link"?t.split(";")[0].trim():t;if(n!==""&&n.toLowerCase()!=="text/css")return;let r=(e.getAttribute("media")??"").trim().toLowerCase();return JSON.stringify([r==="all"?"":r,e.getAttribute("title")??""])}var O6=JSON.stringify(["",""]);function rv(e){return JSON.stringify([e.getAttribute("href"),(e.getAttribute("rel")??"").trim().toLowerCase(),jF(e)??e.getAttribute("type"),e.hasAttribute("disabled")])}function lv(e,t){let n=rv(t);return[...e.querySelectorAll("link[href]")].some(r=>!r.closest("noscript")&&rv(r)===n)}var rt="id",cm="data-hf-authored-id",ko=/(url\\(\\s*)(["\']?)#([^"\')\\s]+)\\2(\\s*\\))/gi;function cv(e){return e==="href"||e.endsWith(":href")}function KF(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function dm(e,t){return!e||!e.toLowerCase().includes("url(")?e:e.replace(ko,(n,r,o,i,a)=>{let l=t.get(i);return l?`${r}${o}#${l}${o}${a}`:n})}function YF(e,t,n){if(cv(e)&&t.startsWith("#")){let o=n.get(t.slice(1));return o?`#${o}`:t}ko.lastIndex=0;let r=ko.test(t);return ko.lastIndex=0,r?dm(t,n):null}function XF(e,t,n){if(e.name===Nt||e.name===rt)return{kind:"skip"};let r=t&&e.value===t.after?t.before:e.value,o=YF(e.name,r,n);return o!==null?{kind:"managed",before:r,after:o}:t?{kind:"retain",alias:t}:{kind:"skip"}}function JF(e,t,n,r){let o=e.namespaceURI===void 0&&e.name==="xlink:href"&&r;return{name:e.name,localName:o?"href":e.localName,namespaceURI:o?"http://www.w3.org/1999/xlink":e.namespaceURI??null,before:t,after:n}}function QF(e,t){let n=new Map(br(e,Nt,!1).map(i=>[i.name,i])),r=[...n.values()].filter(i=>i.name===rt),o=!!e.closest("svg");for(let i of e.attributes?Array.from(e.attributes):[]){let a=XF(i,n.get(i.name),t);if(a.kind!=="skip"){if(a.kind==="retain"){r.push(a.alias);continue}a.after!==i.value&&(i.namespaceURI?e.setAttributeNS(i.namespaceURI,i.name,a.after):e.setAttribute(i.name,a.after)),r.push(JF(i,a.before,a.after,o))}}r.length&&e.setAttribute(Nt,JSON.stringify(r))}function uv(e,t,n){let r;for(ko.lastIndex=0;r=ko.exec(e);){let o=r[3];t.has(o)&&n.add(o)}}function ZF(e,t,n){if(cv(e.name)&&e.value.startsWith("#")){let r=e.value.slice(1);t.has(r)&&n.add(r)}}function eP(e,t,n){let r=new Set;for(let o of e)for(let i of o.attributes?Array.from(o.attributes):[])!i.value||i.name===Nt||(ZF(i,n,r),i.value.toLowerCase().includes("url(")&&uv(i.value,n,r));for(let o of t)o.toLowerCase().includes("url(")&&uv(o,n,r);return r}function dv(e,t){return t.some(n=>n===e||n.contains(e))}function tP(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("*")],r=t.length?n.filter(o=>!dv(o,t)):n;return[e.root,...r]}function nP(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("svg [id], svg[id]")];return t.length?n.filter(r=>!dv(r,t)):n}function rP(e){let t=tP(e),n=new Set;if(!e.namespace)return{elements:t,renamable:n};let r=nP(e),o=new Set;for(let a of r){let l=a.getAttribute(rt);l&&o.add(l)}if(o.size===0)return{elements:t,renamable:n};let i=eP(t,e.cssTexts??[],o);for(let a of r){let l=a.getAttribute(rt);l&&i.has(l)&&n.add(a)}return{elements:t,renamable:n}}function fv(e){if(!e.closest("svg"))return null;let t=br(e,Nt,!1).find(n=>n.name===rt);return t?e.getAttribute(rt)===t.after?t.before:null:e.getAttribute(cm)}function oP(e){let t=new Map,n=new Set;for(let r of e.querySelectorAll("[id]")){let o=r.getAttribute(rt);if(!o)continue;n.add(o);let i=t.get(o);i?i.push(r):t.set(o,[r]);let a=fv(r);if(a&&a!==o){let l=t.get(a);l?l.push(r):t.set(a,[r])}}return{elementsById:t,usedIds:n}}function iP(e,t,n){let r=`${KF(e)}--${t}`,o=r;for(let i=2;n.has(o);i+=1)o=`${r}-${i}`;return n.add(o),o}function aP(e,t,n){let r=t.find(a=>!n.has(a))??t[0],i=t.filter(a=>a!==r&&a.getAttribute(rt)===e).map(a=>n.get(a));return new Set(i.filter(a=>a!==void 0))}function sP(e,t,n){let r=t.map(()=>new Map);for(let[o,i]of e.elementsById)if(!(i.length<2))for(let a of aP(o,i,n))r[a].set(o,iP(t[a].namespace,o,e.usedIds));return r}function lP(e,t,n){let r=new Map;for(let[o,i]of e.elementsById){let a=i[0],l=a.getAttribute(rt);if(l!==o){r.set(o,l);continue}let s=n.get(a),c=s===void 0?void 0:t[s].get(o);c&&r.set(o,c)}return r}function uP(e){let t=new Set(e.map(r=>r.getAttribute(rt))),n=new Map;for(let r of e){let o=fv(r),i=r.getAttribute(rt);!o||!i||(t.add(o),n.set(o,i))}return{ids:t,renamed:n}}function cP(e,t){for(let n of e.elements){let r=n.getAttribute(rt);if(r&&e.renamable.has(n)&&t.has(r)){n.hasAttribute(cm)||n.setAttribute(cm,r);let o=t.get(r),i=br(n,Nt,!1);i.push({name:rt,localName:rt,namespaceURI:null,before:r,after:o}),n.setAttribute(Nt,JSON.stringify(i)),n.setAttribute(rt,o)}QF(n,t)}}function mv(e,t,n){if(t.length===0)return[];let r=oP(e),o=t.map(rP),i=o.flatMap(({renamable:d})=>[...d]);if(n)for(let d of o)for(let f of d.renamable)n.has(f)&&d.renamable.delete(f);let a=new Map;o.forEach(({renamable:d},f)=>{for(let m of d)a.set(m,f)});let l=sP(r,t,a),s=lP(r,l,a),c=o.map((d,f)=>{let m=uP(t[f].referenceTarget==="document"?[]:d.elements),b=[...s].filter(([h])=>!m.ids.has(h));return new Map([...b,...m.renamed,...l[f]])});c.forEach((d,f)=>{cP(o[f],d)});for(let d of i)n?.add(d);return c}function pv(e,t,n=[]){if(!e||t.size===0&&n.length===0||!e.includes("#")&&!e.includes("[")&&!e.toLowerCase().includes("url("))return e;let r;try{r=Kl.parse(e)}catch{return e}let o=!1,i=new Set(n.filter(l=>l.name===rt).map(l=>l.before)),a=[...t].filter(([l])=>!i.has(l)).map(([l,s])=>({id:l,replacement:`:is(#${an(l)}, #${an(s)})`}));return r.walkRules(l=>{let s=l.selectors.map(c=>hs(c,a,n));s.some((c,d)=>c!==l.selectors[d])&&(l.selectors=s,o=!0)}),r.walkDecls(l=>{let s=dm(l.value,t);s!==l.value&&(l.value=s,o=!0)}),r.walkAtRules(l=>{if(!l.params)return;let s=dm(l.params,t);s!==l.params&&(l.params=s,o=!0)}),o?r.toResult({map:!1}).css:e}function Zl(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function fm(e){let t=e.replace(/[\\u0000-\\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\\//i.test(t):!1:!1}var hv=new Set(["img","video","audio","source"]);function dP(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function fP(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function mP(e){if(Zl(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function mm(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let o=dl(e);return t.set(n,o),o}function pP(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function hP(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function gP(e,t){for(let n of new Set(e)){let r=mm(n,t);for(let[o,i]of Object.entries(r)){let a=mP(i);a!==null&&Te(n)&&n.style.setProperty(`--${o}`,fP(a))}}}function bv(e,t,n=!0){let r=e.getAttribute("data-var-src")?.trim();if(!r)return null;if(!hv.has(e.tagName.toLowerCase()))return n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src on <${e.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(hv).join("/")}.`),null;let o=dP(mm(e,t)[r]);return o===null?null:fm(o)?o:(n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`),null)}function yv(e){return bv(e,new Map,!1)??Wi(e)}var xv=(e,t,n)=>t?[...t.matches(n)?[t]:[],...t.querySelectorAll(n)]:Array.from(e.querySelectorAll(n));function eu(e,t){let n=new Map,r=i=>xv(e,t,i),o=t?null:hP(e);gP([...o?[o]:[],...r("[data-composition-id]")],n);for(let i of r("[data-var-src]")){let a=bv(i,n);a!==null&&Wi(i)!==a&&i.setAttribute("src",a)}Sv(r("[data-var-text]"),n)}function tu(e,t){Sv(xv(e,t,"[data-var-text]"),new Map)}var gv=new WeakSet;function Sv(e,t){for(let n of e){let r=n.getAttribute("data-var-text")?.trim();if(!r||gv.has(n))continue;let o=mm(n,t)[r];Zl(o)&&(pP(n,String(o)),gv.add(n))}}var pm=5e3;window[av]=!0;async function ma(){let e=document.fonts;if(!e)return;document.body?.offsetHeight;for(let o of Array.from(e))o.status==="unloaded"&&o.load().catch(()=>{});let t,n=await Promise.race([e.ready.then(()=>!1),new Promise(o=>t=setTimeout(o,pm,!0))]);if(clearTimeout(t),!n)return;let r=[...new Set(Array.from(e).filter(o=>o.status==="loading").map(o=>o.family))];globalThis.console.warn(`[hyperframes] fonts still loading after ${pm} ms, composition scripts run without them: ${r.join(", ")}`),we({source:"hf-preview",type:"diagnostic",code:"runtime_font_wait_timeout",details:{loadingFamilies:r,timeoutMs:pm}})}function bP(e,t){let n=Object.getOwnPropertyDescriptor(e,"addEventListener"),r=e.addEventListener,o=(i,a,l)=>{if(!a)return;i==="DOMContentLoaded"||i==="load"&&e===window&&document.readyState==="complete"?t.push({target:e,type:i,listener:a}):r.call(e,i,a,l)};return e.addEventListener=o,()=>{e.addEventListener===o&&(n?Object.defineProperty(e,"addEventListener",n):delete e.addEventListener)}}function yP(e){if(!e.isConnected)return;let t=document.createElement("script");for(let{name:r,value:o}of Array.from(e.attributes))t.setAttribute(r,o);let n=Ql(e);return n===null?t.removeAttribute("type"):t.setAttribute("type",n),t.async=e.hasAttribute("async"),t.text=e.textContent??"",e.replaceWith(t),t}var xP=50,SP=()=>!window.__HF_VIRTUAL_TIME__;function EP(){let e=globalThis.scheduler;return typeof e?.yield=="function"?e.yield():new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),t()},n.port2.postMessage(null)})}var vP=e=>new Promise(t=>{e.addEventListener("load",t),e.addEventListener("error",t)});function AP(){let e=document.createElement("script");e.type="module",e.async=!1,e.text=\'document.dispatchEvent(new Event("hf-after-fonts-modules"))\';let t=new Promise(n=>document.addEventListener("hf-after-fonts-modules",n,{once:!0}));return document.body.appendChild(e),t.then(()=>e.remove())}async function nu(e,t){await ma(),tu(document);let n=l=>Ql(l)==="module"||l.matches(sv),r=[],o=[document,window].map(l=>bP(l,r)),i=SP(),a=performance.now();for(let l of[...e.filter(s=>!n(s)),...e.filter(n)]){i&&performance.now()-a>xP&&(await EP(),a=performance.now());let s=yP(l);s?.hasAttribute("src")&&!s.async&&!s.noModule?await vP(s):Ql(l)==="module"&&await AP()}for(let l of o)l();t?.();for(let{target:l,type:s,listener:c}of r){let d=new Event(s);try{typeof c=="function"?c.call(l,d):c.handleEvent(d)}catch(f){reportError(f)}}}var wP=["data-composition-id","data-composition-file","data-start","data-duration","data-end","data-track-index","data-track","data-composition-src","data-hf-authored-duration","data-hf-authored-end"];function Ev(e){let t=e.getAttribute("id")?.trim();for(let n of wP)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var _P=8e3,TP=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,CP=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,RP=["src","href"];function MP(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function Cv(e,t){if(!t)return e;let n=e.trim();if(MP(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function Rv(e,t){return!t||!e?e:e.replace(CP,(n,r,o)=>{let i=Cv(o||"",t);return i===o?n:`url(${r||""}${i}${r||""})`})}function kP(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of RP){let o=n.getAttribute(r);if(o==null)continue;let i=Cv(o,t);i!==o&&n.setAttribute(r,i)}}function LP(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let o=Rv(r,t);o!==r&&n.setAttribute("style",o)}}function NP(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",o=Rv(r,t);o!==r&&(n.textContent=o)}}function Mv(e,t){if(t){kP(e,t),LP(e,t),NP(e,t);for(let n of Array.from(e.querySelectorAll("template")))Mv(n.content,t)}}function vv(e,t){return`${e}__hf${t}`}var FP=e=>new Promise(t=>{let n=!1,r=Date.now(),o=null,i=a=>{n||(n=!0,o!=null&&window.clearTimeout(o),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>i("load"),{once:!0}),e.addEventListener("error",()=>i("error"),{once:!0}),o=window.setTimeout(()=>i("timeout"),_P)});function bm(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function hm(e){for(let t of gS(e))t.remove()}function PP(e){let t=document.importNode(e,!0);Ev(t);let n=Cr(t.getAttribute("data-width")),r=Cr(t.getAttribute("data-height"));return t.style.width=n===null?"100%":`${n}px`,t.style.height=r===null?"100%":`${r}px`,t}function Av(e,t){let n=e.trim();if(!n)return e;try{return TP.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function wv(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function pa(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function IP(e){let t=new Map;for(let n of e){let r=pa(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return yS(t,e),t}function kv(e){let t=pa(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function DP(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function _v(e){return e.hasAttribute("data-composition-src")?!0:kv(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:DP(e):!1}function ru(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:kv(t))}function ym(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(ru().map(n=>pa(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Lv(e,t){let n=IP(e),r=new Set(e.flatMap(a=>{let l=pa(a),s=l.authoredCompositionId?[l.authoredCompositionId]:[];return(t.has(a)||!_v(a))&&l.runtimeCompositionId&&s.push(l.runtimeCompositionId),s})),o=new Map,i=new Map;for(let a of e){let{authoredCompositionId:l,runtimeCompositionId:s}=pa(a),c=!t.has(a)&&_v(a);if(!l){i.set(a,{authoredCompositionId:null,runtimeCompositionId:s});continue}let d=(n.get(l)||0)>1,f=s||l;if(c){let m=d?(o.get(l)||0)+1:0;if(d){for(;r.has(vv(l,m));)m+=1;o.set(l,m)}f=d?vv(l,m):l,r.add(f),d?a.setAttribute("data-hf-original-composition-id",l):a.removeAttribute("data-hf-original-composition-id"),a.setAttribute("data-composition-id",f)}i.set(a,{authoredCompositionId:l,runtimeCompositionId:f})}return ym(),i}async function Nv(e){let t=bS({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=Te(t.innerRoot)?t.innerRoot:null,r=n??e.sourceNode,o=t.authoredCompositionId,i=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let y of t.linkSources){let x=(y.getAttribute("href")||"").trim();if(!x)continue;let E=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&wv(E,e.compositionUrl))continue;let v=y.cloneNode(!0);Ug(v)&&(v.href=E,!lv(document.head,v)&&(document.head.appendChild(v),e.injectedLinks.push(v)))}let c=[];(y=>{for(let x of y){let E=x.cloneNode(!0);if(!Bg(E))continue;o&&(E.textContent=QE(E.textContent||"",o,s,l,{scopeRootSelectors:!0})),document.head.appendChild(E),e.injectedStyles.push(E);let v=E.textContent||"";c.push({element:E,authored:v,applied:v})}})(t.styleSources);let f=y=>{let x=y.getAttribute("type")?.trim()??"",E=y.getAttribute("src")?.trim()??"";if(E){let T=Av(E,e.compositionUrl);return e.compositionUrl&&wv(T,e.compositionUrl)?null:{kind:"external",src:T,type:x}}let v=y.textContent?.trim()??"";return v?{kind:"inline",content:v,type:x,scopeCompositionId:i}:null},m=t.scriptSources.map(f).filter(y=>y!==null);if(n){let y=n.getAttribute("data-width"),x=n.getAttribute("data-height"),E=e.parseDimensionPx(y),v=e.parseDimensionPx(x);y&&e.host.setAttribute("data-width",y),x&&e.host.setAttribute("data-height",x),E&&Te(e.host)&&(e.host.style.width=E),v&&Te(e.host)&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let T=PP(n);!e.authoredCompositionId&&o&&T.setAttribute("data-composition-id",o),hm(T),e.host.appendChild(T)}else if(e.hasTemplate){let y=document.importNode(r,!0);hm(y),e.host.appendChild(y)}else e.host.innerHTML=e.fallbackBodyInnerHtml,hm(e.host);for(let y of t.inertScriptsOutsideRoot)e.host.appendChild(document.importNode(y,!0));a&&HP(e,r,a);let b=Array.from(e.host.childNodes),h=()=>e.host.isConnected&&(b.length>0||e.host.childNodes.length===0)&&b.every(y=>y.parentNode===e.host);return{host:e.host,namespace:a||o||"",styles:c,isCurrent:h,runScripts:async()=>{if(m.length>0&&await ma(),!!h()){tu(document,e.host);for(let y of m){let x=document.createElement("script");if(y.type&&(x.type=y.type),x.async=!1,y.kind==="external")x.src=y.src;else if(y.type.toLowerCase()==="importmap"){let E=nv(y.content,v=>Av(v,e.compositionUrl));x.textContent=E?JSON.stringify(E):y.content}else if(y.type.toLowerCase()==="module"){let E=y.scopeCompositionId?ev(a||y.scopeCompositionId,e.compositionUrl?.href):"";x.textContent=E+y.content}else y.scopeCompositionId?x.textContent=lm(y.content,y.scopeCompositionId,"[HyperFrames] composition script error:",s,a||y.scopeCompositionId,l,e.compositionUrl?.href):x.textContent=`(function(){${y.content}})();`;if(document.body.appendChild(x),e.injectedScripts.push(x),y.kind==="external"){let E=await FP(x);E.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:y.src,loadStatus:E.status,elapsedMs:E.elapsedMs}})}}}}}}async function Tv(e,t){let n=ru();if(ym(),n.length===0)return[];let r=Lv(n,t),o=n.filter(a=>{if(t.has(a)||a.hasAttribute("data-composition-src")||a.children.length>0)return!1;let l=r.get(a)?.authoredCompositionId;return l?!!document.querySelector(`template#${CSS.escape(l)}-template`):!1}),i=[];for(let a of o){let l=r.get(a),s=l?.authoredCompositionId;if(!s)continue;let c=document.querySelector(`template#${CSS.escape(s)}-template`);bm(a);let d=await Nv({host:a,authoredCompositionId:s,runtimeCompositionId:l?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});i.push(d)}return i}async function OP(e){let t=ru();if(ym(),t.length===0)return[];let n=Lv(t,new Set),r=t.filter(i=>i.hasAttribute("data-composition-src"));return(await Promise.all(r.map(async i=>{let a=i.getAttribute("data-composition-src");if(!a)return null;let l=n.get(i),s=l?.authoredCompositionId||null,c=l?.runtimeCompositionId||s||null,d=null;try{d=new URL(a,document.baseURI)}catch{d=null}bm(i);let f=b=>{e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,errorMessage:b instanceof Error?b.message:"unknown_error"}}),bm(i)},m=async b=>{let h=await Nv(b),y=h.runScripts;return h.runScripts=async()=>{try{await y()}catch(x){f(x)}},h};try{let b=s!=null?document.querySelector(`template#${CSS.escape(s)}-template`):null;if(b)return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:b.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});let h=await fetch(a);if(!h.ok)throw new Error(`HTTP ${h.status}`);let y=await h.text(),E=new DOMParser().parseFromString(y,"text/html");Mv(E,d);let v=(s?E.querySelector(`template#${CSS.escape(s)}-template`):null)??E.querySelector("template"),T=v?v.content:E.body;return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:T,hasTemplate:!!v,fallbackBodyInnerHtml:E.body.innerHTML,compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:E.head,declaredVariableDefaults:Gi(E.documentElement),variableDeclarer:E.documentElement,onDiagnostic:e.onDiagnostic})}catch(b){return f(b),null}}))).filter(i=>i!==null)}async function Fv(e){let t=new Set,n={host:document.documentElement,namespace:"",referenceTarget:"document",styles:[...document.querySelectorAll("style")].map(f=>({element:f,authored:f.textContent??"",applied:f.textContent??""}))},r=await OP(e),o=await Tv(e,new Set(r.map(({host:f})=>f))),i=[...r,...o];gm([...i,n],t),await Promise.all(r.map(f=>f.runScripts()));let a=o.filter(f=>{if(f.isCurrent())return!0;for(let m of f.styles)m.element.remove();return window.__hfVariablesByComp&&delete window.__hfVariablesByComp[f.namespace],!1}),l=[...r.filter(f=>f.host.isConnected),...a],s=await Tv(e,new Set(l.map(({host:f})=>f)));s.length&&gm([...l,...s,n],t);let c=new Map([...a,...s].map(f=>[f.host,f]));for(let f of ru()){let m=c.get(f);m&&await m.runScripts()}let d=[...l,...s].filter(f=>f.host.isConnected);gm([...d,n],t)}function gm(e,t){for(let{styles:r}of e)for(let o of r){let i=o.element.textContent??"";i!==o.applied&&(o.authored=i,o.applied=i)}mv(document,e.map(({host:r,namespace:o,styles:i,referenceTarget:a})=>({root:r,namespace:o,referenceTarget:a,exclude:e.filter(l=>l.host!==r&&r.contains(l.host)).map(l=>l.host),cssTexts:i.map(l=>l.authored)})),t).forEach((r,o)=>{let i=br(e[o].host,Nt);if(!(r.size===0&&i.length===0))for(let a of e[o].styles){let l=pv(a.authored,r,i);l!==a.applied&&(a.element.textContent=l),a.applied=l}}),yr()}function HP(e,t,n){let o={...e.declaredVariableDefaults??(Ge(t)?Gi(t):{}),...Ey(e.host)};Zd(e.variableDeclarer??(Ge(t)?t:null),o,n),xy(e.host),Object.keys(o).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=o,ef(e.host,{...yy(e.host,o,window),...ml()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function GP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function BP(e){if(!Array.isArray(e))throw new Error("expected a JSON array");if(!e.every(GP))throw new Error("every array entry must be an object");return e}function UP(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function WP(e){return Te(e)?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function VP(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!Te(r))continue;let o=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;o&&e.push(o)}return e}function $P(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}var Sm=()=>window.gsap,Iv=()=>fetch("caption-overrides.json").then(e=>e.ok?e.json():null),Dv=e=>e===null?[]:BP(e);function Ov(e){let t=e instanceof Error?e.message:String(e);globalThis.console.error(`[HyperFrames] Invalid caption-overrides.json: ${t}`)}function Em(){return Sm()?Iv().then(Dv).catch(e=>(Ov(e),[])):Promise.resolve([])}function vm(e,t){return!Sm()||document.querySelectorAll(".caption-group").length===0?Promise.resolve():Iv().then(n=>Am(Dv(n),e,t)).catch(Ov)}function qP(e,t){return(e.wordId?WP(document.getElementById(e.wordId)):null)??(e.wordIndex!==void 0?t[e.wordIndex]??null:null)}function Pv(e,t){return Object.fromEntries(t.filter(n=>e[n]!==void 0).map(n=>[n,e[n]]))}function xm(e,t){let n=e.style.color;e.style.color=t;let r=getComputedStyle(e).color;return e.style.color=n,r}function zP(e,t){let n=t[0]?.vars.startAt;return xm(e,n?.color===void 0?"":String(n.color))}function jP(e,t,n,r){let o=UP(e);if(o)return o;let i=String(e.vars.color);return/var\\(|currentcolor/i.test(i)?xm(t,i)===n?"dim":"active":(r.has(i)||r.set(i,xm(t,i)),r.get(i)===n?"dim":"active")}function KP(e,t,n){if(e.dimColor)return e.dimColor;if(!(t.length===0||t.some(r=>r.vars.runBackwards)))return n}function YP(e,t,n,r){let o=e.getTweensOf(t).filter(l=>l.vars.color!==void 0).sort((l,s)=>l.startTime()-s.startTime()),i=zP(t,o);for(let l of o){let c=jP(l,t,i,r)==="dim"?n.dimColor:n.activeColor;c&&(l.vars.color=c),l.vars.runBackwards||l.invalidate?.()}let a=KP(n,o,i);a&&e.set(t,{color:a})}function XP(e,t,n,r){let o=Pv(n,["x","y","scale","rotation"]),i=Pv(n,["opacity","fontWeight","fontFamily"]);if(n.fontSize!==void 0&&(i.fontSize=`${n.fontSize}px`),(n.activeColor||n.dimColor)&&YP(e,t,n,r),Object.keys(i).length>0&&e.set(t,i),Object.keys(o).length>0){let a=$P(t);e.set(a,o)}}function Am(e,t,n=()=>{}){let r=Sm();if(!r||e.length===0)return;n();let o=VP(),i=new Map;for(let a of e){let l=qP(a,o);!l||t&&!t.some(s=>s.contains(l))||XP(r,l,a,i)}}var _m="data-hf-edit-base-x",Tm="data-hf-edit-base-y",Zn="data-hf-edit-original-translate",ou=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},JP=e=>{let t=[],n=0,r="";for(let o of e.trim())o==="("&&(n+=1),o===")"&&(n=Math.max(0,n-1)),/\\s/.test(o)&&n===0?(r&&t.push(r),r=""):r+=o;return r&&t.push(r),t},Hv=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,wm=(e,t)=>Hv.test(e)&&Hv.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,QP=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,o,i]=JP(e);if(r===void 0)return`${t} ${n}`;if(o===void 0)return`${wm(r,t)} ${n}`;let a=i===void 0?"":` ${i}`;return`${wm(r,t)} ${wm(o,n)}${a}`},ZP=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},eI=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},iu=new WeakMap;function Vv(e){iu.delete(e)}function tI(e,t){let n=iu.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Rt("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=ou(e.getAttribute("data-x"))-ou(e.getAttribute(_m)),o=ou(e.getAttribute("data-y"))-ou(e.getAttribute(Tm));e.hasAttribute(Zn)||e.setAttribute(Zn,eI(e)),n===void 0&&ZP(e);let i=e.getAttribute(Zn)??"",a=QP(i,`${r}px`,`${o}px`);e.style.setProperty("translate",a),iu.set(e,e.style.getPropertyValue("translate"))}function ha(e,t){let n=e.querySelectorAll(`[${Zn}]:not([${_m}]):not([${Tm}])`);for(let i=0;i<n.length;i++){let a=n[i];if(a===void 0||!Ar(a))continue;let l=a.getAttribute(Zn)??"";l===""?a.style.removeProperty("translate"):a.style.setProperty("translate",l),a.removeAttribute(Zn),iu.delete(a)}let r=e.querySelectorAll(`[${_m}], [${Tm}]`),o=0;for(let i=0;i<r.length;i++){let a=r[i];a===void 0||!Ar(a)||(tI(a,t),o+=1)}return o}var Gv="__hfPositionEditsSeekReapplyWrapped",Bv=new WeakSet,Uv=new WeakMap,Wv=new WeakMap;function $v(e){let t=e,n=()=>{try{ha(t.document)}catch{}},r=f=>typeof f=="function"&&(Bv.has(f)||!!f[Gv]),o=f=>{Bv.add(f);try{Object.defineProperty(f,Gv,{value:!0})}catch{}},i=f=>{if(typeof f!="function"||r(f))return f;let m=function(...b){let h=f.apply(this,b);return n(),h};return o(m),m},a=(f,m)=>{let b=Uv.get(f);if(b?.has(m))return!0;let h=Object.getOwnPropertyDescriptor(f,m);if(h?.configurable===!1){let E=f[m];return typeof E=="function"&&(f[m]=i(E),n()),!1}let y=f[m],x=h?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:h?.enumerable??!0,get:()=>y,set:E=>{y=i(E),x?.call(f,E)}}),y=i(y),b??(b=new Set),b.add(m),Uv.set(f,b),n(),!0},l=(f,m)=>{let b=Wv.get(t),h=Object.getOwnPropertyDescriptor(t,f);if(!b?.has(f)){if(h?.configurable===!1){let E=t[f];return E?a(E,m):!1}let x=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:h?.enumerable??!0,get:()=>x,set:E=>{x=E,x&&a(x,m)}}),b??(b=new Set),b.add(f),Wv.set(t,b)}let y=t[f];return y?a(y,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let c=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}c-=1,c<=0&&t.clearInterval(d)},50)}var ga=Fx,au=Px;function nI(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!zi.includes(e.tagName.toLowerCase())?null:e.getAttribute(au)||null}function rI(e,t,n){let r=typeof n?.closest=="function"?n.closest("[data-composition-id]"):null,o=r?Array.from(r.getElementsByTagName(ga)).find(a=>a.id===t):void 0;if(o)return o;let i=e?.getElementById(t)??null;return i?.tagName.toLowerCase()===ga?i:null}function qv(e,t){let n=e.getAttribute(wo);if(n!==null)return n;let r=nI(e);return r?rI(t,r,e)?.getAttribute(wo)??null:null}function zv(e){let t="__hf-color-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${ga}{display:contents!important}`,e.head.appendChild(n)}var oI=["video","audio","source","script",pn];function Cm(e,t=()=>!1){let n=r=>r.nodeType===Node.ELEMENT_NODE&&(r.matches(e)||r.querySelector(e)!==null||t(r));return r=>r.some(o=>o.type==="attributes"||Array.from(o.addedNodes).some(n)||Array.from(o.removedNodes).some(n))}var jv=e=>Cm([...oI,...e.map(t=>`[${t}]`)].join(","));var iI=3e3,bn=new Map,aI="data-hf-color-grading-canvas",sI="__hf_color_grading_canvas__",lI=1<<24,uI=8192;function aA(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{Te(r)&&(r.hasAttribute(Pr)||r.setAttribute(Pr,r.style.opacity))},n=r=>{if(Ge(r)){r.matches("video, img")&&t(r);for(let o of r.querySelectorAll("video, img"))t(o)}};n(e),new MutationObserver(r=>{for(let o of r)for(let i of o.addedNodes)n(i)}).observe(e,{childList:!0,subtree:!0})}var cI=16,dI=4,Ur={enabled:!1,position:.5,softness:0,lineWidth:2},Rm=["#000000","#ffffff"],fI=["#1a1a1a","#f5f5dc"],Aa=3,mI=Aa-1,pI=5,Hr=`${Jt}.0`,Kv=`${Jt-1}.0`,Yv=`${Aa}.0`,hI=`${(mI+.5)/Aa}`;function ba(e){let t=qv(e,e.ownerDocument);return t==null?null:nS(t,dl(e))}var gI=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`\n`),sA=["#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 sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);","#ifdef HF_STAGE_BLUR"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);","#endif","#ifdef HF_STAGE_KUWAHARA"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }","#endif"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;","#ifdef HF_STAGE_PIXELATE"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }","#endif","#ifdef HF_STAGE_TAPE"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;","#endif"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);","#ifdef HF_STAGE_TAPE"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);","#else"," vec2 tapeUv = sampleUv;","#endif"," vec4 base = samplePrepared(tapeUv);","#ifdef HF_STAGE_TAPE"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }","#endif","#ifdef HF_STAGE_CHROMA_BLEED"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }","#endif"," return base;","}","#ifdef HF_STAGE_CHROMATIC","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","#else","vec4 sampleChromaticMedia(vec2 uv, vec4 center){ return center; }","#endif","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","#ifdef HF_STAGE_GLITCH","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","#else","vec3 applyDigitalGlitch(vec2 uv, vec3 source){ return source; }","#endif","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","#ifdef HF_STAGE_MONO_SCREEN","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","#else","vec3 applyMonoScreen(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_ENGRAVING","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","#else","vec3 applyEngraving(vec3 source, float amount){ return source; }","#endif","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","#ifdef HF_STAGE_CROSSHATCH","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","#else","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_HALFTONE","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","#else","vec3 applyHalftone(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_TWO_INK_PRINT","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","#else","vec3 applyTwoInkPrint(vec3 source, float amount){ return source; }","#endif","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${Kv};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Kv});`,` float y = (row + 0.5) / ${Yv};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Hr}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Hr}, y));`," return mix(before, after, position - lower);","}","vec4 sampleHueCurve(float coordinate){",` float position = fract(coordinate) * ${Hr};`," float lower = floor(position);",` float upper = mod(lower + 1.0, ${Hr});`,` float y = 1.5 / ${Yv};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Hr}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Hr}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Hr}, ${hI}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","#ifdef HF_STAGE_RGB_CURVES","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","#else","vec3 applyRgbCurves(vec3 color){ return color; }","#endif","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","#ifdef HF_STAGE_HUE_CURVES","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleHueCurve(hsv.x).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","#else","vec3 applyHueCurves(vec3 color){ return color; }","#endif","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);","#ifdef HF_STAGE_SECONDARIES"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);","#endif"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","#ifdef HF_STAGE_LUT","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","#else","vec3 applyLut(vec3 color){ return color; }","#endif","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","#ifdef HF_STAGE_DITHER","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","#else","vec3 applyDither(vec3 source, float amount){ return source; }","#endif","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","#ifdef HF_STAGE_ASCII","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","#else","vec3 applyAscii(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_SCANLINES","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","#else","vec3 applyScanlines(vec3 source, float amount){ return source; }","#endif","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);","#ifdef HF_STAGE_CRT"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;","#endif"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);","#ifdef HF_STAGE_GRAIN"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }","#endif","#ifdef HF_STAGE_FILM_ARTIFACTS"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }","#endif"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));","#ifdef HF_STAGE_BLOOM"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;","#endif"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));","#ifdef HF_STAGE_VIGNETTE"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;","#endif","#ifdef HF_STAGE_CRT"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);","#endif"," vec3 graded = clamp(color, 0.0, 1.0);","#ifdef HF_STAGE_COMPARE"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }","#endif"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`\n`),lA=[["HF_STAGE_BLUR",e=>e.effects.blur>0],["HF_STAGE_KUWAHARA",e=>e.effects.kuwahara>0],["HF_STAGE_PIXELATE",e=>e.effects.pixelate>0],["HF_STAGE_TAPE",e=>e.effects.tapeDamage>0],["HF_STAGE_CHROMA_BLEED",e=>e.effects.chromaBleed>0],["HF_STAGE_CHROMATIC",e=>e.effects.chromaticAberration>0],["HF_STAGE_CRT",e=>e.effects.crtCurvature>0],["HF_STAGE_GLITCH",e=>e.effects.digitalGlitch>0],["HF_STAGE_GRAIN",e=>e.details.grain>0],["HF_STAGE_FILM_ARTIFACTS",e=>e.effects.filmArtifacts>0],["HF_STAGE_MONO_SCREEN",e=>e.effects.monoScreen>0],["HF_STAGE_ENGRAVING",e=>e.effects.engraving>0],["HF_STAGE_CROSSHATCH",e=>e.effects.crosshatch>0],["HF_STAGE_HALFTONE",e=>e.effects.halftone>0],["HF_STAGE_TWO_INK_PRINT",e=>e.effects.twoInkPrint>0],["HF_STAGE_DITHER",e=>e.effects.dither>0],["HF_STAGE_ASCII",e=>e.effects.ascii>0],["HF_STAGE_BLOOM",e=>e.effects.bloom>0],["HF_STAGE_SCANLINES",e=>e.effects.scanlines>0],["HF_STAGE_VIGNETTE",e=>e.details.vignette>0],["HF_STAGE_RGB_CURVES",e=>lu(e).rgbCurvesEnabled],["HF_STAGE_HUE_CURVES",e=>lu(e).hueCurvesEnabled],["HF_STAGE_SECONDARIES",e=>lu(e).secondaryCount>0],["HF_STAGE_LUT",e=>e.lut!==null],["HF_STAGE_COMPARE",(e,t)=>t.enabled]];function bI(e,t){let n="";for(let[r,o]of lA)o(e,t)&&(n+=`#define ${r}\n`);return n}var Xv=lA.map(([e])=>`#define ${e}\n`).join(""),uA=32,yI=uA,xI=["#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(`\n`),SI=["#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(`\n`),EI=["#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(`\n`),Jv=zi.flatMap(e=>[`${e}[${wo}]`,`${e}[${au}]`]).join(", ");function tr(e){return Te(e)&&zi.includes(e.localName)}function vI(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Qv(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:($("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function du(e,t=sA){let n=Qv(e,gI,e.VERTEX_SHADER),r=Qv(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let o=e.createProgram();return o?(e.attachShader(o,n),e.attachShader(o,r),e.linkProgram(o),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(o,e.LINK_STATUS)?o:($("runtime.colorGrading.linkProgram",e.getProgramInfoLog(o)),e.deleteProgram(o),null)):null}function su(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 AI(e,t){let n=du(e,xI);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 wI(e,t){let n=du(e,SI);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 _I(e,t){let n=du(e,EI);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 Sa(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=su(e,n,t),o=e.createFramebuffer();if(!r||!o)return r&&e.deleteTexture(r),o&&e.deleteFramebuffer(o),null;e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),i!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(o),null):{texture:r,framebuffer:o,type:t,width:1,height:1}}function uu(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 Mm(e,t,n){let r=[];for(let o of n){let i=e.getUniformLocation(t,`u_${o}`);i!==null&&r.push([o,i])}return r}function Zv(e,t){for(let n of t)n&&e.deleteTexture(n)}function cA(e,t){let n=du(e,t+sA);return n?{program:n,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),bloomSource:e.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:e.getUniformLocation(n,"u_kuwaharaSource"),lut:e.getUniformLocation(n,"u_lut"),advanced:e.getUniformLocation(n,"u_advanced"),resolution:e.getUniformLocation(n,"u_resolution"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),bloomReady:e.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:e.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:e.getUniformLocation(n,"u_lutEnabled"),lutSize:e.getUniformLocation(n,"u_lutSize"),lutTextureSize:e.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:e.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:e.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:e.getUniformLocation(n,"u_lutIntensity"),shadowWheel:e.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:e.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:e.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:e.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:e.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:e.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:Mm(e,n,Cl),detailUniforms:Mm(e,n,_f),effectUniforms:Mm(e,n,Tf),grainSeed:e.getUniformLocation(n,"u_grainSeed"),effectTime:e.getUniformLocation(n,"u_effectTime"),paletteSize:e.getUniformLocation(n,"u_paletteSize"),palette0:e.getUniformLocation(n,"u_palette0"),palette1:e.getUniformLocation(n,"u_palette1"),palette2:e.getUniformLocation(n,"u_palette2"),palette3:e.getUniformLocation(n,"u_palette3"),palette4:e.getUniformLocation(n,"u_palette4"),palette5:e.getUniformLocation(n,"u_palette5"),intensity:e.getUniformLocation(n,"u_intensity"),compareEnabled:e.getUniformLocation(n,"u_compareEnabled"),comparePosition:e.getUniformLocation(n,"u_comparePosition"),compareSoftness:e.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:e.getUniformLocation(n,"u_compareLineWidth")}:null}function TI(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=fu(t);return n?{gl:t,program:n}:null}function fu(e){let t=cA(e,"");if(!t)return null;let n=CI(e);return n?{...n,shaders:new Map([["",t]]),failedStageDefines:new Set}:(e.deleteProgram(t.program),null)}function CI(e){let t=su(e),n=su(e,e.NEAREST),r=su(e,e.NEAREST);if(!t||!n||!r)return Zv(e,[t,n,r]),null;let o=e.createBuffer();return o?(e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),{texture:t,lutTexture:n,advancedTexture:r,advancedSignature:null,quad:o}):(Zv(e,[t,n,r]),null)}function dA(e,t,n,r){let o=fA(e,t,bI(n,r));return e.useProgram(o.program),o}function fA(e,t,n){let r=t.failedStageDefines.has(n)?Xv:n;if(t.failedStageDefines.has(r))throw new Error("Color grading shader failed to compile");let o=t.shaders.get(r);if(o)return t.shaders.delete(r),t.shaders.set(r,o),o;let i=cA(e,r);if(!i)return t.failedStageDefines.add(r),fA(e,t,Xv);if(t.shaders.size>=yI)for(let[a,l]of t.shaders){e.deleteProgram(l.program),t.shaders.delete(a);break}return t.shaders.set(r,i),i}function RI(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function MI(e){if(!RI(e))return{...Ur};let t=(n,r,o,i)=>{let a=typeof n=="number"?n:Number(n);return Math.min(i,Math.max(o,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,Ur.position,0,1),softness:t(e.softness,Ur.softness,0,.25),lineWidth:t(e.lineWidth,Ur.lineWidth,0,12)}}function mA(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 mu(e){return e instanceof Error?e.message:"LUT failed to load"}function kI(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 pA(e){let t=e.id||!sn(e)&&e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return kI(t)}function Fm(e){let t=mA(e);if("error"in t)return{state:"error",message:t.error};let n=bn.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(i=>{if(!i.ok)throw new Error(`Failed to load LUT (${i.status})`);return i.text()}).then(i=>kx(i,{maxSize:wl})),o={state:"pending",promise:r};for(;bn.size>=cI;){let i=bn.keys().next().value;if(!i)break;bn.delete(i)}return bn.set(t.href,o),r.then(i=>{bn.get(t.href)===o&&bn.set(t.href,{state:"ready",lut:i})},i=>{bn.get(t.href)===o&&bn.set(t.href,{state:"error",message:mu(i)})}),o}function eA(e,t,n){if(e.lut?.src===t)return e.lut;let{gl:r,program:o}=e,i=gf(n,r.getParameter(r.MAX_TEXTURE_SIZE)),a=hf(i);try{return hA(r,o.lutTexture,a),e.lut={src:t,size:i.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:a.width,textureHeight:a.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(l){return e.lut=null,e.lutError=mu(l),e.lutLoadingSrc=null,$("runtime.colorGrading.uploadLut",l),null}}async function LI(e){let t=Fm(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function hA(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 NI(e,t,n){let{gl:r,program:o}=e,i=gf(n,r.getParameter(r.MAX_TEXTURE_SIZE)),a=hf(i);return hA(r,o.lutTexture,a),{src:t,size:i.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:a.width,textureHeight:a.height}}function en(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Pm(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),en(e.gl,t.scratch),en(e.gl,t.blur),t.bloom&&en(e.gl,t.bloom),e.effectTargets=null)}function Im(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),en(e.gl,t.moments),en(e.gl,t.output),e.kuwaharaTargets=null)}function xa(e,t=!1){Pm(e),Im(e),FI(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function FI(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad);for(let n of t.shaders.values())e.deleteProgram(n.program);t.shaders.clear()}function PI(e){let t=fu(e.gl);return t?(xa(e),e.program=t,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function II(e,t){let n=fu(t.gl);return n?(xa(e),e.gl=t.gl,e.glCanvas=t.canvas,e.program=n,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function DI(e,t){e.contextLost=!II(e,t),e.drawError=e.contextLost?"WebGL context rebuild failed":null,e.contextLost?Ea(e):dt(e)}function OI(e,t){e.borderlessFrame!==t&&gA(e),e.borderlessFrame=t,t.style.borderStyle="none"}function gA(e){let t=e.borderlessFrame;t&&(e.borderlessFrame=null,t.style.borderStyle=window.getComputedStyle(e.element).borderStyle)}function Ea(e){if(gA(e),!e.sourceHidden)return;e.element.removeAttribute(Fr);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 HI(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=AI(t,e.program.quad),r=Sa(t),o=Sa(t);return!n||!r||!o?(n&&t.deleteProgram(n.program),r&&en(t,r),o&&en(t,o),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:o,bloom:null},e.effectTargets)}function GI(e,t){return t.bloom||(t.bloom=Sa(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function tA(e){let t=e.effectTargets;t?.bloom&&(en(e.gl,t.bloom),t.bloom=null)}function BI(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 o=wI(t,e.program.quad),i=_I(t,e.program.quad),a=Sa(t,n.HALF_FLOAT_OES,t.NEAREST),l=Sa(t);return!o||!i||!a||!l?(UI(t,o,i,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:o,resolveProgram:i,moments:a,output:l},e.kuwaharaTargets)}function UI(e,t,n,r,o){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&en(e,r),o&&en(e,o)}function bA(e,t,n,r,o){let i=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(o));return uu(e,t,i,a),uu(e,n,i,a),{width:i,height:a}}function cu(e,t,n,r,o,i,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,o.width,o.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,o.width,o.height),e.uniform2f(t.direction,i.x,i.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),va(e,t)}function WI(e,t,n,r,o,i,a){let l=bA(e,t.scratch,r,o/2,i/2),s=a/2;cu(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),cu(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function VI(e,t,n,r,o,i,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)cu(e,t.blurProgram,l,t.scratch,o,{x:1,y:0},i),cu(e,t.blurProgram,t.scratch.texture,r,o,{x:0,y:1},i),l=r.texture}function va(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 $I(e,t,n,r,o,i,a,l){uu(e,t.moments,o.width,o.height),uu(e,t.output,o.width,o.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,o.width,o.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/o.width,1/o.height),e.uniform2f(s.uvScale,i.scaleX,i.scaleY),e.uniform2f(s.uvOffset,i.offsetX,i.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),va(e,s);let c=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(c.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(c.moments,0),e.uniform2f(c.texel,1/o.width,1/o.height),e.uniform1f(c.radius,l.kuwaharaRadius),e.uniform1f(c.sharpness,l.kuwaharaSharpness),e.uniform1f(c.saturation,l.kuwaharaSaturation),va(e,c)}function qI(e,t,n,r){if(n<=0)return!1;let o=bA(e.gl,t.scratch,t.blur,r.width,r.height);return VI(e.gl,t,e.program.texture,t.blur,o,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function zI(e,t,n,r,o,i){if(n<=0)return tA(e),null;i||tA(e);let a=i?GI(e,t):t.blur;return a?(WI(e.gl,t,e.program.texture,a,o.width,o.height,r),a.texture):null}function jI(e,t,n,r){let{program:o}=e,i=t.effects.blur,a=t.effects.bloom;if(i<=0&&a<=0)return e.effectTargets&&r&&Pm(e),{blurReady:!1,bloomReady:!1,blurTexture:o.texture,bloomTexture:o.texture};let l=HI(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:o.texture,bloomTexture:o.texture};let s=qI(e,l,i,n),c=zI(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:c!==null,blurTexture:l.blur.texture,bloomTexture:c??o.texture}}function KI(e,t,n,r,o,i,a){let l=t.effects.kuwahara;if(l<=0&&!i)return e.kuwaharaTargets&&a&&Im(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=BI(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:($I(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,o,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function yA(e,t,n,r,o={}){let i=o.releaseIdleTargets??!0;e.effectError=null;let a=jI(e,t,n,i),l=KI(e,t,n,r,a.blurReady,o.preserveKuwahara??!1,i);return{...a,...l}}function YI(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=mA(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 o=Fm(t);return o.state==="ready"?eA(e,r.href,o.lut):o.state==="error"?(e.lutError=o.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,o.promise.then(i=>{e.destroyed||e.grading.lut?.src.trim()!==t||(eA(e,r.href,i),dt(e))},i=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=mu(i),e.lutLoadingSrc=null,dt(e))})),null)}function ya(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&&tr(n))return n;try{let r=document.querySelector(t);return r&&tr(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&tr(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&tr(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&&tr(r)?r:null}catch{return null}}function Dm(e){let[t,n]=Re(e)?[e.videoWidth,e.videoHeight]:et(e)?[e.naturalWidth,e.naturalHeight]:sn(e)?[e.width,e.height]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function xA(e){return Re(e)&&e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||et(e)&&!e.complete?!1:Dm(e)!==null}function XI(e){let t=Pt(e);return t&&xA(t)?t:null}function km(e){return vI(e)||JI(e)}function JI(e){if(!Re(e))return!1;let t=Pt(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function QI(e){return et(e)&&e.classList.contains("__render_frame__")}function ZI(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}var nA=new WeakMap;function SA(e,t){if(!et(e)||window.origin!=="null"||e.crossOrigin!==null||!/^https?:/i.test(e.currentSrc))return e;let n=nA.get(e);if(n?.image.src!==e.currentSrc){let r={image:e.ownerDocument.createElement("img"),waiting:new Set},o=()=>{let i=[...r.waiting];r.waiting.clear(),i.forEach(dt)};r.image.crossOrigin="anonymous",r.image.addEventListener("load",o,{once:!0}),r.image.addEventListener("error",o,{once:!0}),r.image.src=e.currentSrc,nA.set(e,n=r)}return n.image.complete?n.image.naturalWidth>0?n.image:e:(t&&n.waiting.add(t),null)}function EA(e){if(Re(e)){let t=XI(e);if(t)return t}return xA(e)?e:null}function rA(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 eD(e){let t=e.trim().split(/\\s+/).filter(Boolean),n=.5,r=.5;for(let o=0;o<t.length;o++){let i=t[o]??"",a=rA(i,"x"),l=rA(i,"y");if(a!==null&&(i==="left"||i==="right"||i.endsWith("%")&&o===0)){n=a;continue}if(l!==null&&(i==="top"||i==="bottom"||i.endsWith("%")&&o>0)){r=l;continue}}return{x:n,y:r}}function vA(e,t,n,r,o,i){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=o||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let b=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*b,s=r*b,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let c=eD(i||"center"),d=(e-l)*c.x/e,f=1-c.y,m=(t-s)*f/t;return{scaleX:l/e,scaleY:s/t,offsetX:d,offsetY:m}}function tD(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function oA(e,t){return Math.max(0,Math.round(e>0?e:t))}function nD(e,t){let n=Math.min(1,Math.sqrt(lI/(e*t)),uI/Math.max(e,t)),r={width:Math.floor(e*n),height:Math.floor(t*n)};return n<1?r:{width:Math.round(e),height:Math.round(t)}}function rD(e,t){let{element:n,canvas:r}=e,o=n.parentElement;o&&tD(e,o);let i=window.getComputedStyle(t);X0(r.style,i),r.style.borderStyle="none",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(),l=oA(n.offsetWidth,a.width),s=oA(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let c=Math.max(1,window.devicePixelRatio||1),{width:d,height:f}=nD(l*c,s*c);return r.width!==d&&(r.width=d),r.height!==f&&(r.height=f),{width:d,height:f}}function Lo(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 Br(e,t,n,r){e.set(r,(t*Jt+n)*4)}function nr(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Lm(e,t,n){return e.length>=3?yf(e,t,n):new Float32Array(Jt)}function Gr(e,t){return e[t]??0}function oD(e,t,n){let r=Eo(t.red),o=Eo(t.green),i=Eo(t.blue),a=Eo(t.master),l=Lm(n.hueVsHue,-180,180),s=Lm(n.hueVsSaturation,-1,1),c=Lm(n.hueVsLuma,-1,1);for(let d=0;d<Jt;d+=1)Br(e,0,d,[Gr(r,d),Gr(o,d),Gr(i,d),Gr(a,d)]),Br(e,1,d,[nr(Gr(l,d),180),nr(Gr(s,d),1),nr(Gr(c,d),1),1])}function iD(e,t,n){let r=n*pI;Br(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Br(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Br(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Br(e,2,r+3,[nr(t.correction.hueShift,180),nr(t.correction.saturation,1),nr(t.correction.luma,1),nr(t.correction.temperature,1)]),Br(e,2,r+4,[nr(t.correction.tint,1),.5,.5,1])}function aD(e,t,n){let r=new Float32Array(Jt*Aa*4);oD(r,e,t);let o=0;for(let i of n)i.enabled&&(iD(r,i,o),o+=1);return r}var iA=new WeakMap;function sD(e,t,n){let r=iA.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let o=JSON.stringify([e,t,n]);return iA.set(e,{hueCurves:t,secondaries:n,signature:o}),o}function lD(e,t,n,r){let{curves:o,hueCurves:i}=n,a=sD(o,i,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(aD(o,i,r),$i);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,Jt,Aa,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Nm(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function lu(e){let{curves:t,hueCurves:n,secondaries:r}=e;return{rgbCurvesEnabled:Mf(t),hueCurvesEnabled:kf(n),secondaryCount:Lf(r)?r.reduce((o,i)=>o+Number(i.enabled),0):0}}function AA(e,t,n,r,o,i,a,l,s,c,d,f,m){e.uniform1i(n.source,0),e.uniform1i(n.blurSource,1),e.uniform1i(n.lut,2),e.uniform1i(n.kuwaharaSource,3),e.uniform1i(n.bloomSource,4),e.uniform1i(n.advanced,5),e.uniform2f(n.resolution,c.width,c.height),e.uniform2f(n.uvScale,d.scaleX,d.scaleY),e.uniform2f(n.uvOffset,d.offsetX,d.offsetY),e.uniform1f(n.blurReady,i?1:0),e.uniform1f(n.bloomReady,a?1:0),e.uniform1f(n.kuwaharaReady,l?1:0),e.uniform1f(n.lutEnabled,o?1:0),e.uniform1f(n.lutSize,o?.size??2),e.uniform2f(n.lutTextureSize,o?.textureWidth??1,o?.textureHeight??1),e.uniform3f(n.lutDomainMin,o?.domainMin[0]??0,o?.domainMin[1]??0,o?.domainMin[2]??0),e.uniform3f(n.lutDomainMax,o?.domainMax[0]??1,o?.domainMax[1]??1,o?.domainMax[2]??1),e.uniform1f(n.lutIntensity,r.lut?.intensity??0);let{rgbCurvesEnabled:b,hueCurvesEnabled:h,secondaryCount:y}=lu(r);(b||h||y>0)&&lD(e,t,r,r.secondaries),Nm(e,n.shadowWheel,r.wheels.shadows),Nm(e,n.midtoneWheel,r.wheels.midtones),Nm(e,n.highlightWheel,r.wheels.highlights),e.uniform1f(n.rgbCurvesEnabled,b?1:0),e.uniform1f(n.hueCurvesEnabled,h?1:0),e.uniform1f(n.secondaryCount,y);for(let[v,T]of n.adjustUniforms)e.uniform1f(T,r.adjust[v]);for(let[v,T]of n.detailUniforms)e.uniform1f(T,r.details[v]);e.uniform1f(n.grainSeed,f),e.uniform1f(n.effectTime,m);for(let[v,T]of n.effectUniforms)e.uniform1f(T,r.effects[v]);let x=r.palette??(r.effects.engraving>0||r.effects.crosshatch>0?fI:Rm),E=x[x.length-1]??Rm[1];e.uniform1f(n.paletteSize,x.length),Lo(e,n.palette0,x[0]??Rm[0]),Lo(e,n.palette1,x[1]??E),Lo(e,n.palette2,x[2]??E),Lo(e,n.palette3,x[3]??E),Lo(e,n.palette4,x[4]??E),Lo(e,n.palette5,x[5]??E),e.uniform1f(n.intensity,r.intensity),e.uniform1f(n.compareEnabled,s.enabled?1:0),e.uniform1f(n.comparePosition,s.position),e.uniform1f(n.compareSoftness,s.softness),e.uniform1f(n.compareLineWidth,s.lineWidth)}function uD(e){if(!e.sourceHidden){let t=e.element.getAttribute(Pr);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(Fr,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function yn(e){let t=Zx.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var wA=yn("intensity"),_A=yn("lut.intensity"),TA=yn("adjust.exposure"),CA=yn("effects.kuwahara"),RA=[["blur",yn("effects.blur")],["bloom",yn("effects.bloom")],["kuwahara",CA],["pixelate",yn("effects.pixelate")],["ascii",yn("effects.ascii")],["dither",yn("effects.dither")]],MA=[wA,_A,TA,...RA.map(([,e])=>e)];function Wr(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 No(e,t){return t!==null&&(rS(t)||MA.some(n=>Wr(e,n)!==null))}function cD(e,t){let n=null;for(let[r,o]of RA){let i=Wr(e,o);i!==null&&(n??(n={...t.effects}),n[r]=i)}return n}function dD(e){let{element:t,grading:n}=e,r=Wr(t,wA),o=Wr(t,_A),i=Wr(t,TA),a=cD(t,n);if(![r,o,i].some(c=>c!==null)&&a===null)return n;let s={...n,adjust:i===null?n.adjust:{...n.adjust,exposure:i},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&o!==null&&(s.lut={...n.lut,intensity:o}),s}function kA(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 LA(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[o,i]of r.entries())e.activeTexture(e.TEXTURE0+o),e.bindTexture(e.TEXTURE_2D,i)}function fD(e,t){e.glCanvas!==e.canvas&&(e.glCanvas.width<t.width&&(e.glCanvas.width=t.width),e.glCanvas.height<t.height&&(e.glCanvas.height=t.height))}function mD(e,t){if(e.glCanvas===e.canvas)return;let n=e.canvas.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable");let{width:r,height:o}=t;n.clearRect(0,0,r,o),n.drawImage(e.glCanvas,0,e.glCanvas.height-o,r,o,0,0,r,o)}function pD(e){let t=EA(e.element),n=t&&SA(t,e);if(!t||!n)return e.hasDrawn||(e.canvas.style.display="none"),null;let r=Dm(t);return r?{source:t,pixels:n,size:r}:null}function hD(e){if(e.sourceInlineOpacity===null){e.element.style.removeProperty("opacity");return}e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||"")}function gD(e){let{style:t}=e.element;return e.sourceHidden&&t.getPropertyValue("opacity")==="0"&&t.getPropertyPriority("opacity")==="important"}function bD(e,t,n){let r=gD(e),o=e.element.style.getPropertyValue("visibility"),i=r&&!n;i&&hD(e);let a=window.getComputedStyle(n?t:e.element);e.sourceOpacityForCanvas=a.opacity||"1",i&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(n||o!=="hidden")&&a.visibility!=="hidden"}function yD(e){let t=window.__player?.getTime?.();return typeof t=="number"&&Number.isFinite(t)?Math.max(0,t):Re(e)?Math.max(0,e.currentTime):0}function xD(e,t,n,r){let{gl:o,program:i}=e;fD(e,n);let a=dD(e),l=YI(e);kA(o,i.texture,t);let s=Wr(e.element,CA)!==null,c=yA(e,a,n,r,{preserveKuwahara:s});o.bindFramebuffer(o.FRAMEBUFFER,null),o.viewport(0,0,n.width,n.height);let d=dA(o,i,a,e.compare);LA(o,i,c);let f=yD(e.element),m=e.grainSeed+Math.floor(f*60);if(AA(o,i,d,a,l,c.blurReady,c.bloomReady,c.kuwaharaReady,e.compare,n,r,m,f),va(o,{quad:i.quad,position:d.position}),o.drawingBufferWidth<n.width||o.drawingBufferHeight<n.height)throw Ea(e),e.canvas.style.display="none",new Error("The GPU\'s drawing buffer is smaller than the grading canvas");mD(e,n)}function SD(e,t,n){let r=Te(t)?t:e.element,o=rD(e,r);if(!o)return null;let i=window.getComputedStyle(r),a=vA(o.width,o.height,n.width,n.height,i.objectFit,i.objectPosition);return{layout:o,uv:a}}function dt(e){if(e.destroyed||e.contextLost)return!1;let t=pD(e);if(!t)return!1;let{source:n,pixels:r,size:o}=t,i=QI(n);i&&ZI(e,n),bD(e,n,i);let a=SD(e,n,o);if(!a)return!1;let{layout:l,uv:s}=a;try{return xD(e,r,l,s),uD(e),i&&OI(e,n),e.hasDrawn=!0,e.drawError=null,!0}catch(c){return e.drawError=c instanceof Error?c.message:"Shader draw failed",$("runtime.colorGrading.drawEntry",c),!1}}function ED(e,t,n){let r=e.getBoundingClientRect(),o=e.offsetWidth||r.width||t.width,i=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=o>0&&i>0?o/i:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function vD(){let e=document.createElement("canvas"),t=TI(e);return t?{canvas:e,glCanvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function AD(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):Re(e)?Math.max(0,e.currentTime):0}function wD(e,t,n,r){let o=EA(t),i=o&&SA(o,null);if(!o||!i)return null;let a=Dm(o);if(!a)return null;let l=ED(t,a,n);e.canvas.width=l.width,e.canvas.height=l.height;let s=Te(o)?o:t,c=window.getComputedStyle(s),d=vA(l.width,l.height,a.width,a.height,c.objectFit,c.objectPosition);return kA(e.gl,e.program.texture,i),{dimensions:l,uv:d,effectTime:AD(t,r),grainSeed:pA(t)+(Re(t)?Math.floor(t.currentTime*60):0)}}async function _D(e,t,n,r,o=!1){let i=wD(e,t,r,o);if(!i)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:c}=i,d=[];for(let f of n.slice(0,uA)){let m=Rl(f.grading);if(!m){d.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let b=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=NI(e,m.lut.src,await LI(m.lut.src))),b=e.lut),d.push({id:f.id,dataUrl:TD(e,m,b,a,l,s,c)})}catch(h){d.push({id:f.id,dataUrl:null,error:mu(h)})}}return{...a,images:d}}function TD(e,t,n,r,o,i,a){let{canvas:l,gl:s,program:c}=e,d=yA(e,t,r,o,{releaseIdleTargets:!1});s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height);let f=dA(s,c,t,Ur);return LA(s,c,d),n||(e.lut=null),AA(s,c,f,t,n,d.blurReady,d.bloomReady,d.kuwaharaReady,Ur,r,o,i,a),va(s,{quad:c.quad,position:f.position}),l.toDataURL("image/png")}function er(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function CD(e){return sn(e)?!0:Re(e)&&!e.paused&&!e.ended?!1:MA.some(t=>Wr(e,t)!==null)}function RD(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&Re(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Fo(e){if(e.destroyed||!Re(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,dt(e),!e.destroyed&&!t.paused&&!t.ended&&Fo(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,dt(e),!e.destroyed&&!t.paused&&!t.ended&&Fo(e)})}function MD(e){let t=()=>{dt(e)},n=()=>{dt(e),Fo(e)};if(er(e,e.element,"load",t),er(e,e.element,"loadedmetadata",t),er(e,e.element,"loadeddata",n),er(e,e.element,"seeked",n),er(e,e.element,"timeupdate",t),er(e,window,"resize",t),Re(e.element)&&(er(e,e.element,"play",()=>Fo(e)),er(e,e.element,"pause",t)),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let r=()=>{let l=e.element.style;return`${l.transform}|${l.translate}|${l.rotate}|${l.scale}|${l.left}|${l.top}|${l.width}|${l.height}`},o=r(),i=!1,a=new MutationObserver(()=>{i||r()!==o&&(i=!0,requestAnimationFrame(()=>{i=!1,o=r(),dt(e)}))});a.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>a.disconnect())}}function kD(e){if(e.destroyed)return null;e.destroyed=!0,RD(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Pm(e),Im(e),Ea(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,glCanvas:e.glCanvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function NA(e,t){return e.removeAttribute("style"),t.id?e.id=`${Kx}${t.id}`:e.removeAttribute("id"),e.className=sI,e.setAttribute(aI,"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 LD(e){return NA(document.createElement("canvas"),e)}function FA(e){let t=new WeakMap,n=new Set,r=new Set,o=[],i=null,a=null,l=Promise.resolve(),s=!1,c=null,d,f=()=>[...n].flatMap(R=>t.get(R)??[]),m=()=>{if(c)return c;let R=document.createElement("canvas"),k=R.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});return k?(R.addEventListener("webglcontextlost",F=>{F.preventDefault(),o.length=0;for(let _ of f())_.contextLost=!0,_.drawError="WebGL context lost",_.canvas.style.display="none",Ea(_);b(R,k)}),R.addEventListener("webglcontextrestored",()=>{if(c?.canvas===R){clearTimeout(d);for(let F of f())F.contextLost=!PI(F),F.drawError=F.contextLost?"WebGL context restore failed":null,F.contextLost?Ea(F):dt(F);T()}}),c={canvas:R,gl:k},c):null},b=(R,k)=>{clearTimeout(d),d=setTimeout(()=>h(R,k),iI)},h=(R,k)=>{if(s||c?.canvas!==R||!k.isContextLost?.())return;let F=c;c=null;let _=m();if(!_){c=F,b(R,k);return}for(let N of f())DI(N,_);T()},y=R=>{let k=m(),F=k&&fu(k.gl);return!k||!F?null:{canvas:LD(R),glCanvas:k.canvas,gl:k.gl,program:F,effectTargets:null,kuwaharaTargets:null,effectError:null}},x=(R,k,F)=>{r.delete(R);let _=t.get(R);if(_)return _.grading=k,_.source=F,dt(_),Re(R)&&!R.paused&&Fo(_),!0;let N=o.pop();if(N)NA(N.canvas,R);else{let ae=y(R);if(!ae)return!1;N=ae}let j={element:R,...N,grading:k,compare:{...Ur},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:F,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,borderlessFrame:null,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(R).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(R).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:pA(R),destroyed:!1};return t.set(R,j),n.add(R),MD(j),dt(j),Re(R)&&Fo(j),!0},E=(R,k)=>{if(s)return!1;let F=ya(R);if(!F)return!1;let _=t.get(F);if(!_){let N=ba(F);if(!No(F,N)||!x(F,N,"attribute"))return!1;_=t.get(F)}return _?(_.compare=MI(k),dt(_),!0):!1},v=R=>{r.delete(R);let k=t.get(R);if(!k)return;let F=kD(k);F&&(k.contextLost||o.length>=dI?xa(F):o.push(F)),t.delete(R),n.delete(R)},T=()=>{if(s)return 0;let R=new Set;r.clear(),document.querySelectorAll(Jv).forEach(F=>{if(!tr(F))return;R.add(F);let _=ba(F);No(F,_)?km(F)?x(F,_,"attribute"):(v(F),r.add(F)):v(F)});for(let F of n){let _=t.get(F);_&&(!F.isConnected||_.source==="attribute"&&!R.has(F))&&v(F)}return n.size},H=()=>{for(let R of r){if(R.isConnected&&!km(R))continue;r.delete(R);let k=ba(R);R.isConnected&&No(R,k)&&x(R,k,"attribute")}},U=()=>{if(s)return 0;H();let R=0;for(let k of n){let F=t.get(k);F&&dt(F)&&(R+=1)}return R},M=async()=>{let R=new Set;for(let k of n){let F=t.get(k)?.grading.lut;if(!F?.src.trim()||(F.intensity??1)<=0)continue;let _=Fm(F.src);_.state==="pending"&&R.add(_.promise)}return R.size>0&&await Promise.allSettled(R),U(),R.size},L=()=>{if(s)return 0;H();let R=0;for(let k of n){let F=t.get(k);F&&CD(k)&&dt(F)&&(R+=1)}return R},G=(R,k)=>{if(s)return!1;let F=ya(R);if(!F)return!1;let _=Rl(k);return No(F,_)?x(F,_,"live"):(v(F),!0)},C=(R,k)=>{if(!tr(R))return!1;let F=t.get(R);if(!F){if(!k)return!1;let _=ba(R);return No(R,_)&&x(R,_,"attribute")}return F.sourceVisibleForCanvas=k,!k&&F.source==="attribute"&&v(R),!0},B=R=>tr(R)&&t.has(R),O=R=>{let k=ya(R);if(!k)return{state:"missing",message:"Media not found"};let F=t.get(k);if(F)return F.effectError?{state:"unavailable",message:F.effectError}:F.drawError?{state:"unavailable",message:F.drawError}:F.lutError?{state:"unavailable",message:`LUT error: ${F.lutError}`}:F.grading.lut&&F.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:F.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:F.lut?"Shader + LUT active":"Shader active"};let _=ba(k);return No(k,_)?km(k)?{state:"unavailable",message:"WebGL unavailable"}:{state:"pending",message:"Waiting for visible media"}:{state:"inactive",message:"No grading applied"}},Y=async(R,k,F)=>{let _=async()=>{if(s||k.length===0)return null;let j=ya(R);return!j||(a??(a=vD()),!a)?null:_D(a,j,k,F?.maxDimension,F?.useMediaTime)},N=l.then(_,_);return l=N.then(()=>{},()=>{}),N},Z=R=>{let k=ya(R);if(!Re(k))return null;if(!k.paused)return()=>{};let F=k.currentTime,_=k.loop,N=k.muted;return k.loop=!0,k.muted=!0,(k.ended||Number.isFinite(k.duration)&&F>=k.duration)&&(k.currentTime=0),e?.lease(k),k.play().catch(()=>{}),()=>{e?.release(k),k.pause(),k.loop=_,k.muted=N,k.currentTime=Ct(F)}},J=()=>{if(!s){s=!0,clearTimeout(d),i?.disconnect(),i=null;for(let R of n)v(R);r.clear();for(let R of o)xa(R);o.length=0,c?.gl.getExtension("WEBGL_lose_context")?.loseContext(),c=null,a&&(xa(a,!0),a=null)}};if(document.body){let R=Cm(`${Jv}, ${ga}`,k=>Array.from(n).some(F=>k.contains(F)));i=new MutationObserver(k=>{R(k)&&T()}),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[wo,au]})}let D={refresh:T,redraw:U,redrawAnimated:L,waitForActiveLuts:M,setGrading:G,setCompare:E,setSourceVisibility:C,isGraded:B,getStatus:O,renderPreviews:Y,startPreviewPlayback:Z,destroy:J},V=window;return V.__hf=V.__hf||{},V.__hf.colorGrading=D,T(),D}var ND={mulX:374761393,mulY:668265263,mulMix:1274126177,offset:2654435769,shift1:13,shift2:16,divisor:4294967296},{mulX:FD,mulY:PD,mulMix:PA,offset:ID,shift1:DD,shift2:OD,divisor:HD}=ND,GD=20,IA=`#version 300 es\nprecision highp float;\nprecision highp int;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform float u_fractalType;\nuniform float u_noiseType;\nuniform float u_invert;\nuniform float u_contrast;\nuniform float u_brightness;\nuniform float u_scale;\nuniform float u_complexity;\nuniform float u_subInfluence;\nuniform float u_subScaling;\nuniform float u_evolution;\nuniform float u_randomSeed;\nuniform float u_opacity;\n\nfloat hfHashUnit(int ix, int iy, int seed) {\n uint h = ((uint(ix) * ${FD}u) ^ (uint(iy) * ${PD}u) ^ (uint(seed) * ${PA}u)) + ${ID}u;\n h = h ^ (h >> ${DD}u);\n h = h * ${PA}u;\n h = h ^ (h >> ${OD}u);\n return float(h) / ${HD}.0;\n}\n\nfloat hfFade(float f, float noiseType) {\n if (noiseType < 1.5) return 0.0;\n if (noiseType < 2.5) return f;\n if (noiseType < 3.5) return f * f * (3.0 - 2.0 * f);\n return f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n}\n\nfloat hfValueNoise(vec2 p, int seed) {\n vec2 cell = floor(p);\n vec2 f = p - cell;\n int ix = int(cell.x);\n int iy = int(cell.y);\n float sx = hfFade(f.x, u_noiseType);\n float sy = hfFade(f.y, u_noiseType);\n float bottom = mix(hfHashUnit(ix, iy, seed), hfHashUnit(ix + 1, iy, seed), sx);\n float top = mix(hfHashUnit(ix, iy + 1, seed), hfHashUnit(ix + 1, iy + 1, seed), sx);\n return mix(bottom, top, sy);\n}\n\nfloat hfFbm(vec2 p) {\n float lacunarity = 100.0 / max(u_subScaling, 1.0);\n float gain = u_subInfluence / 100.0;\n int seed = int(u_randomSeed);\n float amp = 1.0;\n float freq = 1.0;\n float sum = 0.0;\n float norm = 0.0;\n for (int i = 0; i < ${GD}; i++) {\n if (float(i) >= u_complexity) break;\n sum += amp * hfValueNoise(p * freq, seed + i);\n norm += amp;\n amp *= gain;\n freq *= lacunarity;\n }\n return norm > 0.0 ? sum / norm : 0.0;\n}\n\nvoid main() {\n vec2 px = v_uv * u_size;\n vec2 p = px / max(u_scale, 1.0) + vec2(u_evolution, u_evolution * 0.5);\n float v = hfFbm(p);\n v = (v - 0.5) * (u_contrast / 100.0) + 0.5 + u_brightness / 100.0;\n if (u_invert > 0.5) v = 1.0 - v;\n v = clamp(v, 0.0, 1.0);\n float a = clamp(u_opacity / 100.0, 0.0, 1.0);\n fragColor = vec4(v * a, v * a, v * a, a);\n}\n`;var Om={lumaR:.299,lumaG:.587,lumaB:.114},{lumaR:BD,lumaG:UD,lumaB:WD}=Om,DA=`#version 300 es\nprecision highp float;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform sampler2D u_src2;\n// 1 when the map ref named another element, 0 when the map is the layer\n// itself. Set by the runtime for every pass, from whether a ref resolved.\nuniform float u_hasSrc2;\nuniform float u_useH;\nuniform float u_maxH;\nuniform float u_useV;\nuniform float u_maxV;\nuniform float u_behavior;\nuniform float u_edge;\nuniform float u_expand;\n\nvec4 hfSampleSrc(vec2 uv) {\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);\n return texture(u_src, uv);\n}\n\n// The selector\'s value, in [0, 1]. Half and Off both land on 0.5, which is the\n// "no displacement" midpoint the caller subtracts.\nfloat hfMapChannel(vec4 premultiplied, float selector) {\n vec3 rgb = premultiplied.a > 0.0 ? premultiplied.rgb / premultiplied.a : vec3(0.0);\n if (selector < 1.5) return rgb.r;\n if (selector < 2.5) return rgb.g;\n if (selector < 3.5) return rgb.b;\n if (selector < 4.5) return premultiplied.a;\n if (selector < 8.5) return dot(rgb, vec3(${BD}, ${UD}, ${WD}));\n if (selector < 9.5) return 1.0;\n return 0.5;\n}\n\nvoid main() {\n vec4 mapTexel = u_hasSrc2 > 0.5 ? texture(u_src2, v_uv) : texture(u_src, v_uv);\n float h = hfMapChannel(mapTexel, u_useH);\n float v = hfMapChannel(mapTexel, u_useV);\n vec2 d = vec2((h - 0.5) * 2.0 * u_maxH, (v - 0.5) * 2.0 * u_maxV);\n fragColor = hfSampleSrc(v_uv + d / u_size);\n}\n`;var{lumaR:VD,lumaG:$D,lumaB:qD}=Om;var OA=`#version 300 es\nprecision highp float;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform sampler2D u_src2;\nuniform float u_mode;\n\n// The matte texel is premultiplied, so its rgb is already "over black": the\n// composite After Effects reads a luma matte through.\nfloat hfCoverage(vec4 matte, float mode) {\n if (mode < 1.5) return matte.a;\n if (mode < 2.5) return 1.0 - matte.a;\n float luma = dot(matte.rgb, vec3(${VD}, ${$D}, ${qD}));\n if (mode < 3.5) return luma;\n return 1.0 - luma;\n}\n\nvoid main() {\n vec4 src = texture(u_src, v_uv);\n vec4 matte = texture(u_src2, v_uv);\n fragColor = src * clamp(hfCoverage(matte, u_mode), 0.0, 1.0);\n}\n`;var zD={lcgMulA:1103515245,lcgMulB:12996205,lcgAdd:12345,highMask:32640,lowMask:255,byteScale:32704},{lcgMulA:jD,lcgMulB:KD,lcgAdd:HA,highMask:YD,lowMask:XD,byteScale:JD}=zD,GA=`#version 300 es\nprecision highp float;\n// NOT decoration: a fragment shader\'s default integer precision is mediump,\n// and a mediump uint is only guaranteed 16 bits (ESSL 3.00 \\xA74.5.2). Every step\n// below (the Jenkins mix, both LCG rounds) is defined by 32-bit wraparound,\n// so without this the hash is a different function on any implementation that\n// honours the minimum. ANGLE and SwiftShader both use 32-bit ints, which is\n// exactly why no test on this machine would catch it.\nprecision highp int;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform float u_amount;\nuniform float u_useColorNoise;\nuniform float u_clipping;\n\n// Bob Jenkins\' 1997 integer mix, the six-round shift/xor/subtract sequence the\n// metallib runs verbatim. uint arithmetic wraps in GLSL ES 3.00, which is what\n// makes this bit-identical to the C original.\nuint hfJenkinsMix(uint a, uint b, uint c) {\n a -= b; a -= c; a ^= (c >> 13u);\n b -= c; b -= a; b ^= (a << 8u);\n c -= a; c -= b; c ^= (b >> 13u);\n a -= b; a -= c; a ^= (c >> 12u);\n b -= c; b -= a; b ^= (a << 16u);\n c -= a; c -= b; c ^= (b >> 5u);\n a -= b; a -= c; a ^= (c >> 3u);\n b -= c; b -= a; b ^= (a << 10u);\n c -= a; c -= b; c ^= (b >> 15u);\n return c;\n}\n\n// The hash\'s 15-bit output byte for one channel.\nfloat hfNoiseByte(uint a, uint y, uint seed) {\n uint h = hfJenkinsMix(a, y, seed);\n uint t2 = h * ${jD}u + ${HA}u;\n uint t4 = t2 * ${KD}u + ${HA}u;\n return float(((t4 >> 16u) & ${XD}u) ^ ((t2 >> 9u) & ${YD}u));\n}\n\nvoid main() {\n vec4 src = texture(u_src, v_uv);\n vec2 px = floor(v_uv * u_size);\n uint x = uint(max(px.x, 0.0));\n // After Effects indexes rows from the top; v_uv is y-up.\n uint y = uint(max(u_size.y - 1.0 - px.y, 0.0));\n float frame = floor(u_t * u_fps + 0.5);\n uint seed = uint(max(frame, 0.0)) & 0xFFFFu;\n\n float amount = u_amount * 0.01;\n vec3 nz;\n if (u_useColorNoise > 0.5) {\n uint a = x * 3u;\n nz = vec3(hfNoiseByte(a, y, seed), hfNoiseByte(a + 1u, y, seed), hfNoiseByte(a + 2u, y, seed));\n } else {\n nz = vec3(hfNoiseByte(x, y, seed));\n }\n nz = amount * (nz / ${JD}.0 - 0.5);\n\n vec4 out4 = vec4(src.rgb + nz, src.a);\n // A valid premultiplied colour needs rgb <= a component-wise; noise on a\n // near-transparent texel can push rgb above it, which our fixed 8-bit RGBA\n // storage cannot carry safely the way AE\'s float pipeline can (see the doc\n // comment above). This runs before, and independently of, u_clipping.\n out4.rgb = min(out4.rgb, out4.a);\n fragColor = u_clipping > 0.5 ? clamp(out4, 0.0, 1.0) : out4;\n}\n`;var QD={tau:6.283185307179586,degreesPerTurn:360},{tau:ZD,degreesPerTurn:eO}=QD,BA=`#version 300 es\nprecision highp float;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform float u_waveType;\nuniform float u_height;\nuniform float u_width;\nuniform float u_direction;\nuniform float u_speed;\nuniform float u_pinning;\nuniform float u_phase;\n\n// Outside the layer\'s own box there is nothing to warp in from, so the wave\n// carries transparency rather than a smeared edge pixel.\nvec4 hfSampleSrc(vec2 uv) {\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);\n return texture(u_src, uv);\n}\n\nvoid main() {\n vec2 px = v_uv * u_size;\n float dir = radians(u_direction);\n vec2 travel = vec2(sin(dir), -cos(dir));\n vec2 swing = vec2(-travel.y, travel.x);\n float proj = (px.x + 1.0) * travel.x + px.y * travel.y;\n float turns = proj / max(u_width, 1.0) + u_phase / ${eO}.0 + u_speed * u_t;\n float disp = u_height * sin(${ZD} * turns);\n fragColor = hfSampleSrc((px + swing * disp) / u_size);\n}\n`;var Hm="data-vfx-chain",UA=1,WA=[{value:1,label:"Red"},{value:2,label:"Green"},{value:3,label:"Blue"},{value:4,label:"Alpha"},{value:5,label:"Luminance"},{value:6,label:"Hue"},{value:7,label:"Lightness"},{value:8,label:"Saturation"},{value:9,label:"Full"},{value:10,label:"Half"},{value:11,label:"Off"}],tO=[{id:"fractal-noise",label:"Fractal Noise",ae:"ADBE Fractal Noise",capture:"none",frag:IA,params:[{kind:"enum",key:"fractalType",label:"Fractal Type",options:[{value:1,label:"Basic"}],default:1,hint:"Only Basic is implemented in v1."},{kind:"enum",key:"noiseType",label:"Noise Type",options:[{value:1,label:"Block"},{value:2,label:"Linear"},{value:3,label:"Soft Linear"},{value:4,label:"Spline"}],default:3},{kind:"bool",key:"invert",label:"Invert",default:!1},{kind:"number",key:"contrast",label:"Contrast",unit:"%",min:0,max:1e3,step:1,default:100},{kind:"number",key:"brightness",label:"Brightness",unit:"",min:-1e3,max:1e3,step:1,default:0},{kind:"number",key:"scale",label:"Scale",unit:"%",min:6,max:1e4,step:1,default:100},{kind:"number",key:"complexity",label:"Complexity",unit:"",min:1,max:20,step:1,default:6},{kind:"number",key:"subInfluence",label:"Sub Influence",unit:"%",min:0,max:100,step:1,default:70},{kind:"number",key:"subScaling",label:"Sub Scaling",unit:"%",min:0,max:100,step:1,default:56},{kind:"number",key:"evolution",label:"Evolution",unit:"revolutions",min:-1e4,max:1e4,step:.01,default:0,animatable:!0},{kind:"number",key:"randomSeed",label:"Random Seed",unit:"",min:0,max:99999,step:1,default:0},{kind:"number",key:"opacity",label:"Opacity",unit:"%",min:0,max:100,step:1,default:100,animatable:!0}]},{id:"wave-warp",label:"Wave Warp",ae:"ADBE Wave Warp",capture:"self",frag:BA,params:[{kind:"enum",key:"waveType",label:"Wave Type",options:[{value:1,label:"Sine"}],default:1,hint:"Only Sine is implemented in v1; the exporter marks the others cosmetic."},{kind:"number",key:"height",label:"Wave Height",unit:"px",min:-1e3,max:1e3,step:1,default:10,animatable:!0},{kind:"number",key:"width",label:"Wave Width",unit:"px",min:1,max:1e4,step:1,default:40,animatable:!0},{kind:"number",key:"direction",label:"Direction",unit:"deg",min:-360,max:360,step:1,default:90},{kind:"number",key:"speed",label:"Wave Speed",unit:"waves/s",min:-100,max:100,step:.1,default:1},{kind:"enum",key:"pinning",label:"Pinning",options:[{value:1,label:"None"}],default:1,hint:"Only None is implemented in v1; the exporter marks the others cosmetic."},{kind:"number",key:"phase",label:"Phase",unit:"deg",min:-360,max:360,step:1,default:0,animatable:!0}]},{id:"displacement-map",label:"Displacement Map",ae:"ADBE Displacement Map",capture:"self",frag:DA,params:[{kind:"ref",key:"map",label:"Displacement Map Layer",optional:!0},{kind:"enum",key:"useH",label:"Use For Horizontal Displacement",options:WA,default:1,hint:"Hue, Lightness and Saturation are read as Luminance in v1."},{kind:"number",key:"maxH",label:"Max Horizontal Displacement",unit:"px",min:-32e3,max:32e3,step:1,default:5,animatable:!0},{kind:"enum",key:"useV",label:"Use For Vertical Displacement",options:WA,default:2,hint:"Hue, Lightness and Saturation are read as Luminance in v1."},{kind:"number",key:"maxV",label:"Max Vertical Displacement",unit:"px",min:-32e3,max:32e3,step:1,default:5,animatable:!0},{kind:"enum",key:"behavior",label:"Displacement Map Behavior",options:[{value:1,label:"Center Map"}],default:1,hint:"Only Center Map is implemented in v1."},{kind:"enum",key:"edge",label:"Edge Behavior",options:[{value:0,label:"Off"}],default:0,hint:"Only Off (transparent outside the layer) is implemented in v1."},{kind:"bool",key:"expand",label:"Expand Output",default:!0}]},{id:"luma-matte",label:"Matte",capture:"self",frag:OA,params:[{kind:"ref",key:"matte",label:"Matte Layer"},{kind:"enum",key:"mode",label:"Matte Mode",options:[{value:1,label:"Alpha"},{value:2,label:"Alpha Inverted"},{value:3,label:"Luma"},{value:4,label:"Luma Inverted"}],default:1}]},{id:"noise",label:"Noise",ae:"ADBE Noise",capture:"self",frag:GA,params:[{kind:"number",key:"amount",label:"Amount of Noise",unit:"%",min:0,max:400,step:.1,default:0,animatable:!0},{kind:"bool",key:"useColorNoise",label:"Use Color Noise",default:!1},{kind:"bool",key:"clipping",label:"Clip Result Values",default:!0}]}],pu=new Map(tO.map(e=>[e.id,e]));function qA(e){return pu.get(e)}function zA(e,t){let n=pu.get(e);if(!n)return{};let r={};for(let o of n.params){let i=t?.[o.key];r[o.key]=o.kind==="enum"?nO(o,i):o.kind==="bool"?rO(o,i):o.kind==="ref"?oO(i):iO(o,i)}return r}function jA(e){let t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):Number.NaN;return Number.isFinite(t)?t:void 0}function nO(e,t){let n=jA(t);return n!==void 0&&e.options.some(r=>r.value===n)?n:e.default}function rO(e,t){return typeof t=="boolean"?t:e.default}function oO(e){return typeof e=="string"?e:""}function iO(e,t){let n=jA(t);return n!==void 0?Math.min(e.max,Math.max(e.min,n)):e.default}var Bt=class extends Error{constructor(t){super(t),this.name="VfxChainError"}};function Gm(e){return e.nodes.filter(t=>t.enabled!==!1)}var VA={none:0,self:1,backdrop:2};function KA(e){let t="none";for(let n of Gm(e)){let r=pu.get(n.type);r&&VA[r.capture]>VA[t]&&(t=r.capture)}return t}function YA(e){let t;try{t=JSON.parse(e)}catch(o){throw new Bt(`Chain file is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Bt("Chain file must be a JSON object.");let n=t;if(n.version!==UA)throw new Bt(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Bt("Chain file is missing a `nodes` array.");let r=n.nodes.map(lO);return{version:UA,nodes:r}}function $A(e){return typeof e=="object"&&e!==null}function aO(e,t){if(typeof e.type!="string"||!pu.has(e.type))throw new Bt(`Node ${t} has unknown effect type: ${String(e.type)}`);return e.type}function sO(e,t){if(typeof e.id!="string"||e.id==="")throw new Bt(`Node ${t} is missing an id.`);return e.id}function lO(e,t){if(!$A(e))throw new Bt(`Node ${t} is not an object.`);let n=e,r=aO(n,t),o=sO(n,t),i=$A(n.params)?n.params:{};return uO({type:r,id:o,enabled:n.enabled===!1?!1:void 0,params:i})}function uO(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var XA=\'canvas[layoutsubtree], canvas[content="drawable"]\';function Po(e=window){let t=e.CanvasRenderingContext2D?.prototype;if(!t||!("drawElementImage"in t))return null;let n=e.document.createElement("canvas");return"requestPaint"in n?"layoutSubtree"in n?"layoutsubtree":"updateElementGeometry"in n?"drawable":null:null}function hu(e,t){t==="layoutsubtree"?e.setAttribute("layoutsubtree",""):e.setAttribute("content","drawable")}function gu(e,t){t==="drawable"&&e.setAttribute("drawable","")}function JA(e,t){t==="drawable"&&e.removeAttribute("drawable")}var cO="data-vfx-ref-visible",rw="[HyperFrames] composition script error:",dO={preserveDrawingBuffer:!0,antialias:!1,premultipliedAlpha:!0,alpha:!0},fO=`#version 300 es\nout vec2 v_uv;\nvoid main() {\n vec2 p = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2));\n v_uv = p;\n gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);\n}\n`,xn=[],ow=30,iw=0,Vm=0,aw=-1,Bm=null,Um=null;function At(e){globalThis.console.error(rw,`vfx: ${e}`)}function sw(e){globalThis.console.error(rw,`vfx-frame: ${e}`)}function QA(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(At(`shader failed to compile: ${e.getShaderInfoLog(r)??"(no log)"}`),e.deleteShader(r),null)):null}function mO(e,t){let n=QA(e,e.VERTEX_SHADER,fO),r=n?QA(e,e.FRAGMENT_SHADER,t):null;if(!n||!r)return null;let o=e.createProgram();return o?(e.attachShader(o,n),e.attachShader(o,r),e.linkProgram(o),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(o,e.LINK_STATUS)?o:(At(`program failed to link: ${e.getProgramInfoLog(o)??"(no log)"}`),e.deleteProgram(o),null)):null}var ZA="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;";function pO(e){let t=e.querySelector(":scope > canvas.hf-vfx-out");if(sn(t))return t.style.cssText=ZA+t.style.cssText,t;let n=document.createElement("canvas");return n.className="hf-vfx-out",n.style.cssText=ZA,e.appendChild(n),n}function hO(e,t,n){let r={};for(let o of n.params)o.kind!=="ref"&&(r[o.key]=e.getUniformLocation(t,`u_${o.key}`));return{size:e.getUniformLocation(t,"u_size"),t:e.getUniformLocation(t,"u_t"),fps:e.getUniformLocation(t,"u_fps"),src:e.getUniformLocation(t,"u_src"),src2:e.getUniformLocation(t,"u_src2"),hasSrc2:e.getUniformLocation(t,"u_hasSrc2"),params:r}}function gO(e,t,n,r){return r.optional?{kind:"none"}:(At(`${tn(e)}: node "${t.id}" (${n.id}) needs a "${r.key}" param naming the id of the element to read as its second source.`),{kind:"error"})}function bO(e,t,n,r,o,i){let a=n.params.find(f=>f.kind==="ref");if(!a)return{kind:"none"};let l=r[a.key];if(typeof l!="string"||l==="")return gO(e,t,n,a);let s=e.ownerDocument.getElementById(l);if(!Te(s))return At(`${tn(e)}: node "${t.id}" (${n.id}) names "${a.key}" element #${l}, which is not in the composition.`),{kind:"error"};if(s===e)return a.optional?{kind:"none"}:{kind:"self"};let c=i.get(s);if(c)return{kind:"source",source:c};let d=lw(s,o,`${tn(e)}: "${a.key}" source`);return d?(i.set(s,d),{kind:"source",source:d}):{kind:"error"}}function yO(e,t,n){let r=[],o=new Map;for(let i of Gm(t)){let a=qA(i.type);if(!a)return At(`node "${i.id}" has unknown effect type "${i.type}"`),null;let l=mO(e,a.frag);if(!l)return At(`node "${i.id}" (${a.id}) has no usable program`),null;let s=zA(a.id,i.params),c=bO(n,i,a,s,e,o);if(c.kind==="error")return null;r.push({node:i,def:a,program:l,params:s,locations:hO(e,l,a),...c.kind==="source"?{ref:c.source}:{},selfRef:c.kind==="self"})}return r}function xO(e){let t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),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),t}function SO(e){let t=e.parentElement;if(!t||e.id==="")return null;let n=t.children;for(let r=0;r<n.length;r++){let o=n.item(r);if(sn(o)&&o.classList.contains("hf-vfx-src")&&o.getAttribute("data-vfx-for")===e.id)return o}return null}function EO(e,t){Po()==="drawable"&&(hu(e,"drawable"),gu(t,"drawable"))}function lw(e,t,n){let r=SO(e),o=r??e.querySelector(":scope > canvas.hf-vfx-src"),i=sn(o)?o.querySelector(":scope > .hf-vfx-in"):null;if(!sn(o)||!Te(i)){At(`${n}: a capturing chain needs <canvas layoutsubtree class="hf-vfx-src"><div class="hf-vfx-in">\\u2026</div></canvas> in source: inside the element for its own pixels, or beside it with data-vfx-for="${e.id}" for the layers below it.`);return}if(o.querySelector("canvas.hf-vfx-src")||o.parentElement?.closest("canvas.hf-vfx-src")){At(`${n}: a capture canvas nested inside another capture canvas blocks the renderer\'s main thread in drawElementImage, so this chain is not registered. Keep each .hf-vfx-src out of every other .hf-vfx-src subtree.`);return}let a=o.getContext("2d");if(!a||typeof a.drawElementImage!="function"){At(`${n}: drawElementImage is unavailable, so the layer cannot be captured. In Studio, enable chrome://flags/#canvas-draw-element.`);return}return EO(o,i),{canvas:o,inner:i,ctx:a,texture:xO(t),backdrop:r!==null,visible:o.hasAttribute(cO),emptyBoxReported:!1,laidOutEmpty:rr(i)===null}}function vO(e){e.out.addEventListener("webglcontextlost",t=>{t.preventDefault(),!(!xn.includes(e)||e.contextLost)&&(e.contextLost=!0,At(`${tn(e.host)}: WebGL context lost.`))})}function AO(e){try{return YA(e.getAttribute(Hm)??"")}catch(t){let n=t instanceof Bt?t.message:String(t);return At(`${tn(e)}: ${n}`),null}}function wO(e){let t=AO(e);if(!t)return null;let n=pO(e),r=n.getContext("webgl2",dO);if(!r)return At(`${tn(e)}: WebGL2 is unavailable, so the chain cannot paint.`),n.remove(),null;let o=yO(r,t,e);if(!o)return n.remove(),null;let i=KA(t),a=i==="none"?void 0:lw(e,r,tn(e));if(i!=="none"&&!a)return n.remove(),null;let l=a?.backdrop?"backdrop":i,s={host:e,chain:t,capture:l,out:n,gl:r,passes:o,src:a,contextLost:!1};return vO(s),s}function $m(e){let t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function uw(e){if(getComputedStyle(e.inner).visibility==="hidden")return!1;for(let t=e.inner;t;t=t.parentElement)if(getComputedStyle(t).display==="none")return!1;return!0}function tn(e){return e.id?`#${e.id}`:`<${e.tagName.toLowerCase()}>`}function Io(e){let t=e.src?[e.src]:[];for(let n of e.passes)n.ref&&!t.includes(n.ref)&&t.push(n.ref);return t}function qm(e){return e.src?.backdrop===!0}function wa(e){let t=[];for(let n of e.passes)n.ref?.visible&&!t.includes(n.ref)&&t.push(n.ref);return t}function _O(){for(let e of xn){let{gl:t}=e;for(let n of e.passes)t.deleteProgram(n.program);for(let n of Io(e))t.deleteTexture(n.texture);if(e.ping){for(let n of e.ping.textures)t.deleteTexture(n);for(let n of e.ping.framebuffers)t.deleteFramebuffer(n)}}}function bu(e,t){_O(),xn=[],ow=Number.isFinite(t)&&t>0?t:30;let n=e.querySelectorAll(`[${Hm}]`);for(let r of n){if(!Te(r))continue;let o=wO(r);o&&xn.push(o)}return xn}function rr(e){let t=typeof window>"u"?1:window.devicePixelRatio||1,n=Math.round(e.offsetWidth*t),r=Math.round(e.offsetHeight*t);return n>0&&r>0?{width:n,height:r}:null}function ew(e,t,n){let r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),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);let o=e.createFramebuffer();return e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),[r,o]}function TO(e,t,n){let r=e.ping;if(r&&r.width===t&&r.height===n)return r;let{gl:o}=e;if(r){for(let s of r.textures)o.deleteTexture(s);for(let s of r.framebuffers)o.deleteFramebuffer(s)}let i=ew(o,t,n),a=ew(o,t,n),l={textures:[i[0],a[0]],framebuffers:[i[1],a[1]],width:t,height:n};return e.ping=l,l}function CO(e,t,n){if(e.kind==="ref")return null;if(e.kind==="number"&&e.animatable){let o=n.getPropertyValue(`--vfx-${t.node.id}-${e.key}`).trim(),i=o===""?Number.NaN:Number.parseFloat(o);if(Number.isFinite(i))return Math.min(e.max,Math.max(e.min,i))}let r=t.params[e.key];return typeof r=="boolean"?r?1:0:typeof r=="number"?r:0}function RO(e,t,n,r,o,i){let{gl:a}=e,{locations:l}=t;a.uniform2f(l.size,o,i),a.uniform1f(l.t,r),a.uniform1f(l.fps,ow),a.uniform1f(l.hasSrc2,t.ref||t.selfRef?1:0);for(let s of t.def.params){let c=CO(s,t,n);c!==null&&a.uniform1f(l.params[s.key]??null,c)}}function MO(e,t,n){return e===t||!n?null:n.framebuffers[e%2]??null}function kO(e,t,n){return t===0?e.src?.texture??null:n?.textures[(t-1)%2]??null}function LO(e,t,n,r){let{gl:o}=e,i=e.passes[t];o.bindFramebuffer(o.FRAMEBUFFER,MO(t,n,r));let a=kO(e,t,r);a&&tw(o,i.locations.src,a,0),i.ref?(tw(o,i.locations.src2,i.ref.texture,1),o.activeTexture(o.TEXTURE0)):i.selfRef&&a&&o.uniform1i(i.locations.src2,0)}function tw(e,t,n,r){e.activeTexture(r===0?e.TEXTURE0:e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t,r)}function zm(e,t){let n=rr(e.host);if(!n)return;let{gl:r,out:o,passes:i}=e;o.width!==n.width&&(o.width=n.width),o.height!==n.height&&(o.height=n.height);let a=i.length>1?TO(e,n.width,n.height):null,l=getComputedStyle(e.host),s=i.length-1;for(let c=0;c<=s;c++){let d=i[c];r.useProgram(d.program),LO(e,c,s,a),r.viewport(0,0,n.width,n.height),RO(e,d,l,t,n.width,n.height),r.drawArrays(r.TRIANGLES,0,3)}}function cw(e,t){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.canvas),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0)}var NO={upload:!0,keepBitmap:!1},FO={upload:!1,keepBitmap:!0},PO={upload:!0,keepBitmap:!0},IO={upload:!1,keepBitmap:!0};function dw(e,t){e.canvas.width!==t.width&&(e.canvas.width=t.width),e.canvas.height!==t.height&&(e.canvas.height=t.height)}function nw(e,t,n,r){return dw(t,n),t.ctx.clearRect(0,0,n.width,n.height),r.upload&&cw(e.gl,t),!0}function jm(e,t,n,r,o){if(!uw(t))return nw(e,t,n,o);if(rr(t.inner)===null)return t.emptyBoxReported||(t.emptyBoxReported=!0,sw(`${tn(e.host)}: the .hf-vfx-in wrapper measures 0\\xD70, so its capture would be empty. Inside a layoutsubtree canvas an inset or percentage box has no size, so the wrapper must state an explicit width and height in px.`)),nw(e,t,n,o);dw(t,n),t.ctx.clearRect(0,0,n.width,n.height);try{t.ctx.drawElementImage(t.inner,0,0,n.width,n.height)}catch(i){return r||At(`${tn(e.host)}: drawElementImage failed: ${i.message} In Studio, enable chrome://flags/#canvas-draw-element.`),!1}return o.upload&&cw(e.gl,t),o.keepBitmap||t.ctx.clearRect(0,0,n.width,n.height),!0}function fw(e,t){return e.visible?rr(e.inner)??t:t}function mw(e,t=!1){let n=rr(e.host),r=Io(e);if(!n||r.length===0)return!1;let o=!0;for(let i of r){let a=i.visible?PO:NO;jm(e,i,fw(i,n),t,a)||(o=!1)}return o}function pw(e,t=!1){let n=e.src;if(!n)return!1;let r=rr(e.host)??rr(n.inner);return r?jm(e,n,r,t,FO):!1}function Wm(e,t=!1){let n=!0;for(let r of wa(e)){let o=fw(r,{width:0,height:0});jm(e,r,o,t,IO)||(n=!1)}return n}function DO(e){let t=!1;return qm(e)&&pw(e)&&(t=!0),wa(e).length>0&&Wm(e)&&(t=!0),t}function OO(){let e=!1;for(let t of xn)if(!t.contextLost&&Io(t).length!==0){if(!$m(t.host)){DO(t)&&(e=!0);continue}mw(t)&&(zm(t,iw),e=!0)}return aw=Vm,window.__hf_page_composite_pending=!1,e}function HO(){let e=window,t=e.__hf_page_composite_resolve;t!==Bm&&(Um=typeof t=="function"?t:null,Bm=()=>{let n=Um?Um():!1;return OO()||n},e.__hf_page_composite_resolve=Bm),e.__hf_page_composite_pending=!0}var hw=2e3;function GO(e){return new Promise(t=>{let n=!1,r=a=>{n||(n=!0,clearTimeout(i),e.removeEventListener("paint",o),t(a))},o=()=>r("painted"),i=setTimeout(()=>r("timeout"),hw);e.addEventListener("paint",o,{once:!0});try{e.requestPaint?.()}catch{}if(typeof requestAnimationFrame!="function"){r("painted");return}requestAnimationFrame(()=>requestAnimationFrame(()=>r("painted")))})}async function BO(e,t){return(await Promise.all(t.map(r=>GO(r.canvas)))).includes("timeout")?(sw(`${tn(e.host)}: no paint arrived within ${hw}ms, so this frame\'s capture was skipped (a BeginFrame-controlled compositor without a tick for this frame is a known cause).`),!1):!0}function UO(e){return $m(e.host)?"paint":qm(e)?"passThrough":"refOnly"}function WO(e,t){return(t==="passThrough"?[...e.src?[e.src]:[],...wa(e)]:t==="refOnly"?wa(e):Io(e)).filter(uw)}function VO(e,t){return t!==Vm||aw===t?!1:xn.includes(e)&&!e.contextLost}async function $O(e,t,n,r){let o=UO(e);if(await BO(e,WO(e,o))&&VO(e,n)){if(o==="passThrough"){pw(e,r),Wm(e,r);return}if(o==="refOnly"){Wm(e,r);return}mw(e,r)&&zm(e,t)}}async function qO(e,t,n,r){await Promise.all(e.map(o=>$O(o,t,n,r)))}function zO(){for(let e of xn.flatMap(Io)){let t=rr(e.inner)===null;e.laidOutEmpty&&!t&&e.canvas.insertBefore(e.inner,e.inner.nextSibling),e.laidOutEmpty=t}}function Km(e,t){iw=e;let n=++Vm;zO();let r=[];for(let o of xn)if(!o.contextLost){if(!$m(o.host)){(qm(o)||wa(o).length>0)&&r.push(o);continue}Io(o).length>0?r.push(o):zm(o,e)}r.length!==0&&(t?.engineMode&&HO(),tt(qO(r,e,n,t?.engineMode===!0),"vfx"))}function Jm(e=window){let t=/Chrome\\/(\\d+)/.exec(e.navigator.userAgent);return t?.[1]?Number(t[1]):null}var jO=(e,t)=>t.backface,KO=(e,t)=>Array.from(e.ownerDocument.querySelectorAll("canvas")).some(t.isAccelerated),YO=/^matrix\\(\\s*1,\\s*0,\\s*0,\\s*1,\\s*0,\\s*0\\s*\\)$|^matrix3d\\(\\s*1,\\s*0,\\s*0,\\s*0,\\s*0,\\s*1,\\s*0,\\s*0,\\s*0,\\s*0,\\s*1,\\s*0,\\s*0,\\s*0,\\s*0,\\s*1\\s*\\)$/,Ym=(e,t)=>!!e&&e!=="none"&&!e.split(/\\s+/).every(n=>parseFloat(n)===t),XO=e=>{let t=getComputedStyle(e),n=t.transform.trim();return Ym(t.scale,1)||Ym(t.rotate,0)||Ym(t.translate,0)?!0:n!=="none"&&n!==""&&!YO.test(n)},JO=e=>{let t=getComputedStyle(e).mixBlendMode;return!!t&&t!=="normal"},QO=e=>Number.parseFloat(getComputedStyle(e).opacity)<1,ZO=e=>e.querySelector("iframe, object, embed")!==null||Array.from(e.querySelectorAll("*")).some(t=>t.localName.includes("-")&&customElements.get(t.localName)!==void 0),eH=[{code:"nested-capture-canvas",reason:"the composition already uses html-in-canvas",detect:e=>e.querySelector(XA)!==null},{code:"accelerated-canvas",reason:"the composition draws a WebGL/WebGPU canvas, which html-in-canvas captures frozen",detect:KO},{code:"backface-visibility",reason:"backface-visibility: hidden inside a 3D transform is drawn mirrored by html-in-canvas",detect:jO},{code:"iframe-in-root",reason:"the composition contains an <iframe>, <object>, <embed> or custom element, which is re-initialised when blur wraps the root",detect:ZO},{code:"root-transform",reason:"html-in-canvas can ignore a transform on the composition root",detect:XO},{code:"root-opacity",reason:"html-in-canvas can ignore the composition root\'s own opacity",detect:QO},{code:"root-blend-mode",reason:"html-in-canvas can ignore the composition root\'s own mix-blend-mode",detect:JO}];function yu(e,t){let n=eH.find(r=>r.detect(e,t));return n?{code:n.code,reason:n.reason}:null}var gw=/perspective\\(|rotate3d\\(|rotate[XY]\\(|matrix3d\\(/;function bw(e){return e.getPropertyValue("backface-visibility")==="hidden"||e.getPropertyValue("-webkit-backface-visibility")==="hidden"}var tH=e=>!/^(none|-?[\\d.]+[a-z]+)?$/.test(e.rotate??"")||(e.translate??"").trim().split(/\\s+/).length>2;function nH(e,t){return gw.test(t.transform)||gw.test(e.style.transform)||tH(t)}function rH(e,t){for(let n=e;n;n=n.parentElement){let r=getComputedStyle(n);if(r.transformStyle==="preserve-3d"||nH(n,r)||n!==e&&r.perspective!=="none"&&r.perspective!=="")return!0;if(n===t)break}return!1}var oH=16,Qm="@keyframes ";function iH(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e.charAt(o);i==="("||i==="["?n++:i===")"||i==="]"?n--:i===","&&n===0&&(t.push(e.slice(r,o).trim()),r=o+1)}return t.push(e.slice(r).trim()),t}function aH(e,t){if(t===null)return e;let n=`:is(${t})`;return iH(e).map(r=>r.includes("&")?r.replaceAll("&",n):`${n} ${r}`).join(", ")}function*Xm(e,t,n,r){if(!(r>oH))for(let o of Array.from(e))yield*lH(o,t,n,r)}function sH(e,t){let n="style"in e?e.style:null;return t!==null&&n instanceof CSSStyleDeclaration?{selector:t,style:n}:null}function*lH(e,t,n,r){if(e instanceof CSSStyleRule){let i=aH(e.selectorText,t);yield{selector:i,style:e.style},yield*Xm(e.cssRules,i,n,r+1);return}if(e instanceof CSSImportRule){e.styleSheet&&(yield*yw(e.styleSheet,n,r+1));return}let o=sH(e,t);if(o)yield o;else if("cssRules"in e&&e.cssRules instanceof CSSRuleList){let i=e instanceof CSSKeyframesRule?Qm+e.name:t;yield*Xm(e.cssRules,i,n,r+1)}}function uH(e){try{return e.cssRules}catch{return null}}function*yw(e,t,n){let r=t.has(e)?null:uH(e);t.add(e),r&&(yield*Xm(r,null,t,n))}function cH(e,t){try{let n=Array.from(e.querySelectorAll(t));return e.matches(t)?[e,...n]:n}catch{return[]}}function dH(e){return(document.getAnimations?.()??[]).flatMap(({effect:t})=>{if(!(t instanceof KeyframeEffect))return[];let n=t.target;return t.getKeyframes().some(o=>o.backfaceVisibility==="hidden")&&n instanceof HTMLElement&&e.contains(n)?[n]:[]})}function fH(e,t){return t.length===0?[]:[e,...e.querySelectorAll("*")].filter(n=>getComputedStyle(n).animationName.split(", ").some(r=>t.includes(Qm+r)))}function mH(){let e=new Set,t=[...Array.from(document.styleSheets),...document.adoptedStyleSheets??[]],n=[];for(let r of t)for(let o of yw(r,e,0))bw(o.style)&&n.push(o.selector);return n}function pH(e,t){let n=t.filter(o=>o.startsWith(Qm)),r=new Set([...e.querySelectorAll(\'[style*="backface"]\'),...dH(e),...fH(e,n)]);for(let o of t)for(let i of cH(e,o))r.add(i);return r}function xw(e){let t=mH(),n=new Set,r=()=>{for(let o of n)if(bw(getComputedStyle(o))&&rH(o,e))return!0;return!1};return{scan:()=>(n=new Set([...n,...pH(e,t)]),r()),recheck:r}}function Sw(e){return xw(e).scan()}var hH=10;function Ew(e,t){let n=xw(e),r=null;return{sample:(o,i,a)=>{if(r)return;let l=o%hH===0||o===i,s=yu(e,{isAccelerated:t,backface:l&&n.scan()});s&&(r={...s,reason:`${s.reason} (first seen at t=${a.toFixed(1)}s)`})},result:()=>r,facesNow:n.recheck}}var vw="__HF_PAGE_MOTION_BLUR_OFF__",Aw="__HF_DEVICE_SCALE_FACTOR__";function ww(e=window){return Po(e)!==null}var gH="__hfAcceleratedCanvases";function _w(){let e="__hfAcceleratedCanvases",t=Reflect.get(window,e),n=t instanceof WeakSet?t:new WeakSet;n!==t&&Object.defineProperty(window,e,{value:n});let r=["webgl","webgl2","experimental-webgl","webgpu"],o=(i,a)=>{let l=HTMLCanvasElement.prototype,s=Reflect.get(l,i);if(typeof s!="function"||"__hfAccelTracked"in s)return;let c=function(...d){let f=Reflect.apply(s,this,d);return a(this,d,f),f};Object.defineProperty(c,"__hfAccelTracked",{value:!0}),Object.defineProperty(l,i,{value:c,writable:!0,configurable:!0})};o("getContext",(i,a,l)=>{l&&r.includes(String(a[0]))&&n.add(i)}),o("transferControlToOffscreen",i=>{n.add(i)})}function Tw(e){let t=Reflect.get(window,gH);return t instanceof WeakSet&&t.has(e)}var Do={a:1,b:0,c:0,d:1,e:0,f:0};function xu(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function _a(e,t,n){return xu(e,{a:1,b:0,c:0,d:1,e:t,f:n})}function ep(e){let t=e.a*e.d-e.b*e.c;return!Number.isFinite(t)||Math.abs(t)<1e-12?null:{a:e.d/t,b:-e.b/t,c:-e.c/t,d:e.a/t,e:(e.c*e.f-e.d*e.e)/t,f:(e.b*e.e-e.a*e.f)/t}}function bH(e,t,n){return[[e.e,e.f],[e.a*t+e.e,e.b*t+e.f],[e.c*n+e.e,e.d*n+e.f],[e.a*t+e.c*n+e.e,e.b*t+e.d*n+e.f]]}function yH(e,t,n){let r=Cw(e),o=Cw(t),i=o.angle-r.angle;i>Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI);let a=(l,s)=>l+(s-l)*n;return xH({angle:r.angle+i*n,sx:a(r.sx,o.sx),sy:a(r.sy,o.sy),shear:a(r.shear,o.shear),e:a(e.e,t.e),f:a(e.f,t.f)})}function Cw(e){let t=Math.hypot(e.a,e.b);return t<1e-12?{angle:0,sx:0,sy:e.d,shear:e.c,e:e.e,f:e.f}:{angle:Math.atan2(e.b,e.a),sx:t,sy:(e.a*e.d-e.b*e.c)/t,shear:(e.a*e.c+e.b*e.d)/t,e:e.e,f:e.f}}function xH(e){let t=Math.cos(e.angle),n=Math.sin(e.angle);return{a:e.sx*t,b:e.sx*n,c:e.shear*t-e.sy*n,d:e.shear*n+e.sy*t,e:e.e,f:e.f}}function Su(e,t){if(e.length===0)return[];if(e.length===1)return Array.from({length:t},()=>e[0]);let n=e.length-1;return Array.from({length:t},(r,o)=>{let i=(o+.5)/t*n,a=Math.min(n-1,Math.floor(i));return yH(e[a],e[a+1],i-a)})}function Eu(e,t,n,r,o){let i=1/0,a=1/0,l=-1/0,s=-1/0,c=0,d=null;for(let x of e){let E=bH(x,t,n);for(let[v,T]of E)i=Math.min(i,v),a=Math.min(a,T),l=Math.max(l,v),s=Math.max(s,T);if(d){let v=0;for(let T=0;T<4;T++){let[H,U]=d[T],[M,L]=E[T];v=Math.max(v,Math.hypot(M-H,L-U))}c+=v}d=E}let f=Math.max(0,Math.floor(i)-2),m=Math.max(0,Math.floor(a)-2),b=Math.min(r,Math.ceil(l)+2),h=Math.min(o,Math.ceil(s)+2),y=b>f&&h>m?{x:f,y:m,w:b-f,h:h-m}:null;return{travel:c,rect:y}}function kw(e){let t=Math.floor(255/e),n=255-t*e;return Array.from({length:e},(r,o)=>(t+Math.floor((o+1)*n/e)-Math.floor(o*n/e))/255)}var SH=16;function Lw(e,t,n,r,o,i=2,a=128,l=32){let{travel:s}=Eu(Su(e,SH),t,n,r,o);return Su(e,Math.min(a,Math.max(l,Math.ceil(s/i))))}function Nw(e,t,n=1.5){let r=Math.min(e.length,Math.max(2,Math.ceil(t/n)));return r>=e.length?e:Array.from({length:r},(o,i)=>{let a=Math.round((i+.5)/r*e.length-.5);return e[a]})}function vu(e,t){let n=new Map,r=new Map,o=new Map,i=s=>{if(!t.has(s)&&n.has(s))return n.get(s)??null;let d=getComputedStyle(s),f=Fw([AH(d,s.offsetWidth,s.offsetHeight),tp(d.transform)]),m=null;if(f){let[b=0,h=0]=d.transformOrigin.split(" ").map(y=>parseFloat(y)||0);m=_a(xu(_a(Do,b,h),f),-b,-h)}return t.has(s)||n.set(s,m),m},a=s=>{if(!s||s===e||!Mw(s))return[0,0];let c=r.get(s);if(!c){let d=s.offsetParent,[f,m]=a(d);c=[f+s.offsetLeft+(d?.clientLeft??0),m+s.offsetTop+(d?.clientTop??0)],r.set(s,c)}return c},l=s=>{if(!s||s===e||!Mw(s))return Do;let c=o.get(s);if(!c){let d=s.parentElement,[f,m]=a(s),[b,h]=a(d),[y,x]=EH(d);c=_a(l(d),f-b-y,m-h-x);let E=i(s);E&&(c=xu(c,E)),o.set(s,c)}return c};return{pose:l,reset(){r=new Map,o=new Map}}}function EH(e){return e?[e.scrollLeft,e.scrollTop]:[0,0]}function Fw(e){let t=null;for(let n of e)n&&(t=t?xu(t,n):n);return t}var Zm=e=>e.trim().split(/\\s+(?![^(]*\\))/);function Rw(e,t){let n=0;for(let r of e.matchAll(/([+-]?\\s*[\\d.]+(?:e[+-]?\\d+)?)(px|%)?/g)){let o=Number(r[1]?.replace(/\\s/g,""));n+=r[2]==="%"?o/100*t:o}return n}var vH={deg:Math.PI/180,rad:1,grad:Math.PI/200,turn:2*Math.PI};function AH(e,t,n){let r=e.translate??"none",o=e.rotate??"none",i=e.scale??"none",a=[];if(r!=="none"){let[s="0",c="0"]=Zm(r);a.push({...Do,e:Rw(s,t),f:Rw(c,n)})}let l=/^(-?[\\d.]+)(deg|rad|grad|turn)$/.exec(o);if(l){let s=Number(l[1])*(vH[l[2]??"deg"]??0);a.push({a:Math.cos(s),b:Math.sin(s),c:-Math.sin(s),d:Math.cos(s),e:0,f:0})}if(i!=="none"){let[s=1,c=s]=Zm(i).map(Number);a.push({...Do,a:s,d:c})}return Fw(a)}function Pw(e){let t=e.translate??"none",n=e.rotate??"none";return t!=="none"&&Zm(t).length>2||!/^(none|-?[\\d.]+[a-z]+)$/.test(n)}function tp(e){let t=/^matrix(3d)?\\(([^)]*)\\)$/.exec(e.trim());if(!t)return null;let n=(t[2]??"").split(",").map(Number);if(n.some(d=>!Number.isFinite(d)))return null;let r=t[1]?[0,1,4,5,12,13]:[0,1,2,3,4,5];if(n.length!==(t[1]?16:6))return null;let[o=1,i=0,a=0,l=1,s=0,c=0]=r.map(d=>n[d]??0);return{a:o,b:i,c:a,d:l,e:s,f:c}}function Mw(e){return typeof e.offsetLeft=="number"}function Iw(e,t){let n=new OffscreenCanvas(e,t),r=null;try{r=n.getContext("2d",{colorType:"float16"})}catch{r=null}if(r=r??n.getContext("2d"),!r)throw new Error("capture motion blur: no 2D context for the accumulation buffer");return{canvas:n,ctx:r}}function wH(e,t,n){let{travel:r,rect:o}=Eu(e.taps,e.w,e.h,t,n);return o!==null&&r>=1}function np(e,t,n=1){let r=Math.max(1,Math.round(e*n)),o=Math.max(1,Math.round(t*n)),i=Iw(r,o),a=[],l=e*t*4,s=(b,h,y)=>{let x=Math.ceil(h*n),E=Math.ceil(y*n),v=a[b];return(!v||v.canvas.width<x||v.canvas.height<E)&&(v=Iw(Math.max(x,v?.canvas.width??1),Math.max(E,v?.canvas.height??1)),a[b]=v),v};function c(b){return b.map(h=>ep(h.now)!==null&&h.w*h.h<=l&&wH(h,e,t))}function d(b,h,y){h.forEach((x,E)=>{let v=ep(x.now);if(!y[E]||!v)return;let{w:T,h:H}=x,U=s(E,T,H).ctx;U.setTransform(1,0,0,1,0,0),U.globalCompositeOperation="source-over",U.globalAlpha=1,U.clearRect(0,0,Math.ceil(T*n),Math.ceil(H*n)),U.setTransform(n*v.a,n*v.b,n*v.c,n*v.d,n*v.e,n*v.f),U.drawImage(b,0,0,e,t)})}function f(b,h,y){let{w:x,h:E}=h,{travel:v,rect:T}=Eu(h.taps,x,E,e,t);if(!T)return 0;let H=Nw(h.taps,v),U=Math.max(0,Math.floor(T.x*n)),M=Math.max(0,Math.floor(T.y*n)),L=Math.min(r,Math.ceil((T.x+T.w)*n))-U,G=Math.min(o,Math.ceil((T.y+T.h)*n))-M;if(L<=0||G<=0)return 0;let C=i.ctx;C.setTransform(1,0,0,1,0,0),C.globalCompositeOperation="source-over",C.globalAlpha=1,C.clearRect(U,M,L,G),C.globalCompositeOperation="lighter";let B=kw(H.length);return H.forEach((O,Y)=>{C.globalAlpha=B[Y]??0,C.setTransform(n*O.a,n*O.b,n*O.c,n*O.d,n*O.e,n*O.f),C.drawImage(y.canvas,0,0,x*n,E*n,0,0,x,E)}),b.drawImage(i.canvas,U,M,L,G,U,M,L,G),H.length}function m(b,h,y,x){h.setTransform(1,0,0,1,0,0),h.globalAlpha=1,h.globalCompositeOperation="copy",h.drawImage(b,0,0),h.globalCompositeOperation="source-over";let E={blurred:0,taps:0};return y.forEach((v,T)=>{let H=a[T];if(!x[T]||!H)return;let U=f(h,v,H);U>0&&(E.blurred++,E.taps+=U)}),E}return{plan:c,crop:d,draw:m}}var Ta={enable:"data-motion-blur",shutter:"data-motion-blur-shutter",samples:"data-motion-blur-samples",events:"data-motion-blur-events",tier:"data-motion-blur-tier"},_H={shutterDeg:{min:0,max:720,default:240},samples:{min:2,max:64}},Dw=(e,t,n)=>Math.min(n,Math.max(t,e));function Ow(e){if(e===null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Hw(e){let t=Ow(e(Ta.shutter)),n=Ow(e(Ta.samples)),r=e(Ta.tier),{shutterDeg:o,samples:i}=_H;return{enabled:e(Ta.enable)==="on",shutterDeg:Dw(t??o.default,o.min,o.max),samples:n===null?null:Math.round(Dw(n,i.min,i.max)),events:e(Ta.events)==="on",tier:r==="capture"||r==="filter"?r:"auto"}}var TH=256,CH=64,RH=/(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\\([^)]*\\)/g;function Uw(e){return[...e.replace(RH," ").matchAll(/-?\\d*\\.?\\d+(?=px|\\s|$)/g)].map(t=>Number(t[0]))}function MH(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("?n++:i===")"?n--:i===","&&n===0&&(t.push(e.slice(r,o)),r=o+1)}return t.push(e.slice(r)),t}function Gw(e){return!e||e==="none"?0:Math.max(0,...MH(e).filter(t=>!/\\binset\\b/.test(t)).map(t=>{let[n=0,r=0,o=0,i=0]=Uw(t);return Math.max(Math.abs(n),Math.abs(r))+o+Math.max(0,i)}))}function kH(e){if(!e||e==="none")return 0;let t=0;for(let n of e.matchAll(/drop-shadow\\(((?:[^()]|\\([^)]*\\))*)\\)/g)){let[r=0,o=0,i=0]=Uw(n[1]??"");t=Math.max(t,Math.max(Math.abs(r),Math.abs(o))+i*1.5)}for(let n of e.matchAll(/(?<!-)blur\\(\\s*([\\d.]+)px\\s*\\)/g))t=Math.max(t,Number(n[1])*3);return t}function Bw(e){let t=getComputedStyle(e),n=t.outlineStyle!=="none"?parseFloat(t.outlineWidth)+parseFloat(t.outlineOffset):0;return Math.max(Gw(t.boxShadow),Gw(t.textShadow),kH(t.filter),Number.isFinite(n)?Math.max(0,n):0)}function Ww(e){let t=Bw(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let r=0;r<CH&&n.nextNode();r++){let o=n.currentNode;Te(o)&&(t=Math.max(t,Bw(o)))}return Math.min(TH,Math.ceil(t))}var Vw=2,LH=.5,NH=240,FH=new Set(["transform","translate","rotate","scale","left","top","right","bottom"]),op=e=>e.getAttribute("style")??"";function PH(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.getAttribute("data-motion-blur")==="off")return!0;return!1}function IH(e,t){for(let n=e;n&&n!==t;n=n.parentElement){let r=getComputedStyle(n);if(r.transform.startsWith("matrix3d")||r.transformStyle==="preserve-3d"||r.perspective!=="none"||(r.offsetPath??"none")!=="none"||Pw(r))return!0}return!1}function DH(e,t){let n=[];for(let r=e;r&&r!==t;r=r.parentElement){let o=getComputedStyle(r),i=tp(o.transform);n.push(i?[i.a,i.b,i.c,i.d].map(a=>a.toFixed(3)).join(","):"1,0,0,1"),n.push(o.rotate??"none",o.scale??"none")}return n.join("|")}function OH(e){let t=getComputedStyle(e);return t.transform!=="none"||(t.translate??"none")!=="none"}function HH(e){let t=new Set;if(typeof document.getAnimations!="function")return t;for(let n of document.getAnimations()){let r=n.effect,o=r?.target;if(!Te(o)||!e.contains(o))continue;(typeof r?.getKeyframes=="function"?r.getKeyframes():[]).some(a=>Object.keys(a).some(l=>FH.has(l)))&&t.add(o)}return t}function GH(e){let t=/^rgba\\(.*,\\s*([\\d.]+)\\)$/.exec(e)??/\\/\\s*([\\d.]+)(%?)\\s*\\)$/.exec(e);return t?t[2]?Number(t[1])/100:Number(t[1]):1}var BH=e=>e.tagName==="IMG"||e.tagName==="CANVAS",Ca=32;function UH(e){if("naturalWidth"in e&&!(e.complete&&e.naturalWidth>0))return!0;try{let t=e.ownerDocument.createElement("canvas");t.width=t.height=Ca;let n=t.getContext("2d",{willReadFrequently:!0});if(!n)return!0;n.imageSmoothingQuality="high",n.drawImage(e,0,0,Ca,Ca);let{data:r}=n.getImageData(0,0,Ca,Ca);for(let o=3;o<r.length;o+=4)if((r[o]??0)<255)return!0;return!1}catch{return!0}}function WH(e,t,n){let r=1;for(let o=e;o&&o!==t;o=o.parentElement)r*=parseFloat(getComputedStyle(o).opacity);return r<.05?!1:r<.99?!0:BH(e)?(n.has(e)||n.set(e,UH(e)),n.get(e)===!0):!/^(VIDEO|PICTURE)$/.test(e.tagName)&&VH(e)}function VH(e){let t=getComputedStyle(e);return GH(t.backgroundColor)>=.99?!1:t.backgroundImage==="none"?!0:[...t.backgroundImage.matchAll(/rgba\\([^)]*,\\s*([\\d.]+)\\)/g)].some(n=>Number(n[1])<.99)}function $w(e,t){return!e||!t||!e.width||!t.width?0:Math.max(Math.abs(e.left-t.left),Math.abs(e.top-t.top),Math.abs(e.right-t.right),Math.abs(e.bottom-t.bottom))}function $H(e,t){let n=e.map(op);e.forEach((o,i)=>o.setAttribute("style",t[i]??""));let r=e.map(o=>o.getBoundingClientRect());return e.forEach((o,i)=>o.setAttribute("style",n[i]??"")),r}function rp({scene:e,durationSeconds:t,fps:n,seek:r,onStep:o,onStepBoxes:i}){r(0);let a=[...e.querySelectorAll("*")].filter(Te),l=new Set(HH(e)),s=a.map(op),c=a.map(O=>O.getBoundingClientRect()),d=Math.max(1,Math.round(t*n)),f=Math.min(d,NH),m=d/f,b=new Set,h=new Set,y=new Map,x=new Map,E=new Set,v=O=>{y.set(O,Math.max(y.get(O)??0,Ww(O)));let Y=DH(O,e),Z=x.get(O);Z===void 0?x.set(O,Y):Z!==Y&&E.add(O),OH(O)||E.add(O)},T=new Set,H=new Map,U=e.getBoundingClientRect(),M=U.width*U.height*LH,L=[];for(let O=0;O<=f;O++){O>0&&r(O/f*t),o?.(O,f);let Y=[],Z=[];a.forEach((V,R)=>{!l.has(V)&&op(V)===s[R]||(l.has(V)||Z.push(R),l.add(V),Y[R]=V.getBoundingClientRect())}),i?.(O,Y);let J=Z.filter(V=>$w(c[V],Y[V])/m>=Vw),D=$H(J.map(V=>a[V]),J.map(V=>s[V]??""));if(J.forEach((V,R)=>{L[V]=D[R]}),Y.forEach((V,R)=>{let k=a[R];!k||$w(L[R],V)/m<Vw||(b.has(k)||v(k),b.add(k),V&&M>0&&V.width*V.height>=M&&WH(k,e,H)&&T.add(k))}),O%10===0||O===f)for(let V of b)IH(V,e)&&h.add(V),v(V);L=Y}let G=a.filter(O=>b.has(O)&&!h.has(O)&&!T.has(O)&&!PH(O,e)),C=G.filter(O=>!G.some(Y=>Y!==O&&Y.contains(O))),B=C.length>0&&C.every(O=>!E.has(O));return{movers:C,dynamic:l,pads:y,translationOnly:B}}function qw(e){let t=2166136261,n=r=>{t=Math.imul(t^r,16777619)};return e.forEach((r,o)=>{if(r)for(let i of[o,r.left,r.top,r.width,r.height])n(Math.round(i*64))}),t}function Au({seek:e,events:t,onStep:n,...r}){let o=s=>e(s,!0);if(!t)return{...rp({...r,seek:o,onStep:n}),readEvents:!1};let i=[],a=rp({...r,seek:s=>e(s,!1),onStep:n,onStepBoxes:(s,c)=>{i[s]=qw(c)}}),l=!1;return rp({...r,seek:o,onStepBoxes:(s,c)=>{l||(l=qw(c)!==i[s])}}),{...a,readEvents:l}}var qH=e=>Math.atan2(Math.sin(e),Math.cos(e)),zw=(e,t,n)=>[e.a*(t/2)+e.c*(n/2)+e.e,e.b*(t/2)+e.d*(n/2)+e.f];function jw(e,t,n){let{w:r,h:o,now:i,taps:a}=e,l=i.a*i.d-i.b*i.c,s=Math.sqrt(Math.abs(l));if(a.length<2||!(s>1e-4))return null;let c=zw(i,r,o),d=a.map(Y=>zw(Y,r,o)),f=d.map(([Y,Z])=>{let J=Y-c[0],D=Z-c[1];return[(i.d*J-i.c*D)/l,(-i.b*J+i.a*D)/l]}),m=0;for(let Y=1;Y<d.length;Y++)m+=Math.hypot((d[Y]?.[0]??0)-(d[Y-1]?.[0]??0),(d[Y]?.[1]??0)-(d[Y-1]?.[1]??0));let b=m/(d.length-1),h=Math.max(...a.map(Y=>Math.abs(qH(Math.atan2(Y.b,Y.a)-Math.atan2(i.b,i.a))))),y=Math.max(...a.map(Y=>Math.abs(Math.log(Math.sqrt(Math.abs(Y.a*Y.d-Y.b*Y.c))/s)))),x=Math.sqrt(r*o)*s,E=Math.min(24*(n/1920),.29*Math.min(n/4,x/2)*(h+y)),v=f[0]??[0,0],T=f[f.length-1]??[0,0],H=Math.hypot(T[0]-v[0],T[1]-v[1])||1,U=.35*b/s,M=[Math.hypot(E/s,U*Math.abs(T[0]-v[0])/H),Math.hypot(E/s,U*Math.abs(T[1]-v[1])/H)];if(m<.5&&Math.max(...M)*s<.35)return null;let L=f.map(Y=>Y[0]),G=f.map(Y=>Y[1]),C=t+3*Math.max(...M)+2,B=Math.min(0,...L)-C,O=Math.min(0,...G)-C;return{offsets:f,sigma:M,region:{x:B,y:O,w:r+Math.max(0,...L)+C-B,h:o+Math.max(0,...G)+C-O}}}function wu(e){let{reader:t,shutterSeconds:n,t:r,reads:o,seek:i}=e,a=e.movers.filter(d=>typeof d.checkVisibility!="function"||d.checkVisibility({visibilityProperty:!0}));if(a.length===0||n<=0)return{els:[],frames:[]};let l=r-n/2,s=a.map(()=>[]);for(let d=0;d<o;d++)i(Math.max(0,l+d/(o-1)*n)),t.reset(),a.forEach((f,m)=>s[m]?.push(t.pose(f)));(e.restore??i)(r),t.reset();let c=a.map((d,f)=>{let m=e.pads?.get(d)??0,b=d.offsetWidth+2*m,h=d.offsetHeight+2*m,y=E=>_a(E,-m,-m),x=(s[f]??[Do]).map(y);return{w:b,h,now:y(t.pose(d)),taps:e.taps===null?Lw(x,b,h,e.frameW,e.frameH):Su(x,e.taps)}});return t.reset(),{els:a,frames:c}}var Yw="http://www.w3.org/2000/svg",Xw=32,zH=4,jH=8,Jw="hf-mb",KH=new RegExp(`\\\\s*url\\\\("?#${Jw}-\\\\d+"?\\\\)`,"g");function Ra(e,t,n){let r=document.createElementNS(Yw,t);for(let[o,i]of Object.entries(n))r.setAttribute(o,i);return e.append(r),r}function YH(e,t,n){let r=`${Jw}-${t}`,o=Ra(e,"filter",{id:r,"color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse"}),i=Array.from({length:Xw},(d,f)=>Ra(o,"feOffset",{in:"SourceGraphic",result:`s${f}`})),a=i.map((d,f)=>`s${f}`);for(let d=0;a.length>1;d++){let f=[];for(let m=0;m<a.length;m+=2){let b=`l${d}-${m/2}`;Ra(o,"feComposite",{operator:"arithmetic",in:a[m]??"",in2:a[m+1]??"",k1:"0",k2:"0.5",k3:"0.5",k4:"0",result:b}),f.push(b)}a=f}let l=Ra(o,"feGaussianBlur",{in:a[0]??"",stdDeviation:"0"}),s=n.style.filter;n.style.filter="";let c=getComputedStyle(n).filter;return n.style.filter=s,{filter:o,offsets:i,soften:l,url:`url(#${r})`,css:c&&c!=="none"?c:""}}function XH(e,t){t.offsets.forEach(([a,l],s)=>{e.offsets[s]?.setAttribute("dx",a.toFixed(2)),e.offsets[s]?.setAttribute("dy",l.toFixed(2))}),e.soften.setAttribute("stdDeviation",`${t.sigma[0].toFixed(3)} ${t.sigma[1].toFixed(3)}`);let{x:n,y:r,w:o,h:i}=t.region;e.filter.setAttribute("x",n.toFixed(1)),e.filter.setAttribute("y",r.toFixed(1)),e.filter.setAttribute("width",o.toFixed(1)),e.filter.setAttribute("height",i.toFixed(1))}var Kw=e=>e.style.filter.replace(KH,"").trim();function ip(e,t,n){let{root:r}=e,o=Number(r.getAttribute("data-width"))||r.offsetWidth,i=Number(r.getAttribute("data-height"))||r.offsetHeight,a=J=>e.seek(J,!t.events),l=!1,s=J=>e.seek(J,!l),c=null,d=[],f=new Map,m=null,b,h=0,y=0,x=0,E=!1,v=!1,T=new Map,H=new Set;function U(J){b=e.timeline();let D=performance.now(),V=Au({scene:r,durationSeconds:e.durationSeconds(),fps:e.fps,seek:e.seek,events:t.events});a(J),l=V.readEvents,d=V.movers,f=V.pads,m=vu(r,V.dynamic),h=Math.round(performance.now()-D)}function M(J){let D=Kw(J);D?J.style.filter=D:J.style.removeProperty("filter"),H.delete(J)}function L(){for(let J of[...H])M(J)}function G(J){let D=T.get(J);return D||(c||(c=document.createElementNS(Yw,"svg"),c.setAttribute("width","0"),c.setAttribute("height","0"),c.setAttribute("aria-hidden","true"),c.setAttribute("data-hf-ignore",""),c.style.cssText="position:absolute;left:0;top:0;pointer-events:none",Ra(c,"defs",{}),r.append(c)),D=YH(c.querySelector("defs")??c,T.size,J),T.set(J,D),D)}function C(J,D){let V=G(J);XH(V,D);let R=Kw(J)||V.css;J.style.filter=R?`${R} ${V.url}`:V.url,H.add(J)}function B(J,D){if((!m||e.timeline()!==b)&&U(J),!m)return[];let V=wu({movers:d,reader:m,seek:s,restore:l?void 0:e.holdFrame?.(),t:J,reads:D?jH:zH,shutterSeconds:t.shutterDeg/360/e.fps,taps:Xw,frameW:o,frameH:i}),R=[];return V.els.forEach((k,F)=>{let _=V.frames[F],N=_&&jw(_,f.get(k)??0,o);N&&R.push([k,N])}),R}function O(J,D){if(D&&(E=!0),v)return Promise.resolve();let V=performance.now();try{let R=B(J,D),k=new Set(R.map(([F])=>F));for(let[F,_]of R)C(F,_);for(let F of[...H])k.has(F)||M(F);y++,x+=performance.now()-V}catch(R){$("runtime.captureMotionBlur.filter",R),L()}return Promise.resolve()}function Y(){return{state:"on",tier:"filter",reason:n?.reason??null,reasonCode:n?.code??null,movers:d.length,moverNames:d.map(J=>`${J.tagName.toLowerCase()}${J.id?`#${J.id}`:""}`),scanMs:h,shutterDeg:t.shutterDeg,frames:y,meanMs:y?Math.round(x/y*10)/10:0,failures:0,failedFrames:0}}function Z(){L(),c?.remove(),c=null,T.clear()}return{root:r,paint:O,probe:()=>((!m||e.timeline()!==b)&&U(e.now()),Y()),rest:()=>E?!1:(L(),!0),arm:()=>{},finish:()=>{},teardown:Z,suspend:()=>{v=!0,Z()},report:Y,busy:()=>!1,rediscover:()=>{m=null}}}function Qw(e){if(e.defect?.code==="renderer-off")return"off";let t=e.form&&!e.defect;return e.fallback&&(e.tier==="filter"||!t)?"filter":t?"capture":"off"}var ap="data-hf-motion-blur-hide",or="data-hf-motion-blur-only",Oo="data-hf-motion-blur-mover",JH=4,QH=8,Zw=2e3,ZH=3,eG=25;function tG(e){let t=Hw(a=>e.getAttribute(a));if(!t.enabled)return null;let{shutterDeg:n,samples:r,events:o,tier:i}=t;return{shutterDeg:n,samples:r,events:o,tier:i}}var t_=_w,up=Tw;function nG(e){let t=window[vw];return t?{code:"renderer-off",reason:`the renderer turned it off (${String(t)})`}:ww()?yu(e,{isAccelerated:up,backface:Sw(e)}):{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"}}function rG(e){let t=typeof e.className=="string"&&e.className?`.${e.className.trim().split(/\\s+/).join(".")}`:"";return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:""}${t}`}function oG(e){let t=Number(e.getAttribute("data-width"))||e.offsetWidth,n=Number(e.getAttribute("data-height"))||e.offsetHeight;return{width:Math.max(1,Math.round(t)),height:Math.max(1,Math.round(n))}}function _u(){let e=Number(window[Aw]),t=e>0?e:window.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function e_(e,t,n){let r=document.createElement("canvas");return r.width=Math.max(1,Math.round(e*_u())),r.height=Math.max(1,Math.round(t*_u())),r.setAttribute("data-hf-ignore",""),r.setAttribute("data-hf-motion-blur",n),r.style.cssText=`position:absolute;left:0;top:0;width:${e}px;height:${t}px;`,r}function iG(e,t,n){let{root:r}=e,{width:o,height:i}=oG(r),a=e_(o,i,"capture"),l=e_(o,i,"output");l.style.pointerEvents="none",hu(a,n);let s=a.getContext("2d"),c=l.getContext("2d");if(!s||!c)throw new Error("capture motion blur: no 2D context");let d=s,f=c,m=_u(),b=np(o,i,m),h=document.createElement("style");h.setAttribute("data-hf-ignore",""),h.textContent=[`[${ap}] { opacity: 0 !important; }`,`[${or}] { background: none !important; border-color: transparent !important; box-shadow: none !important; outline-color: transparent !important; }`,`[${or}]::before, [${or}]::after, [${or}] *:not([${Oo}], [${Oo}] *) { visibility: hidden !important; }`,`[${or}] [${Oo}] { visibility: visible !important; }`].join(`\n`);let y=[],x=new Map,E=null,v=null,T=null,H=0,U=0,M=0,L=null,G=null,C=!1,B=[],O=0,Y=0,Z,J=null,D=()=>!1,V=!1,R=new Set,k=!1,F=!1;function _(te){(e.ignoreMutations??(he=>he()))(te),e.seek(e.now(),!0)}function N(){k||(_(()=>{r.before(a),a.append(r),gu(r,n),a.after(l),document.head.append(h)}),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,l.width,l.height),k=!0)}function j(){T?.release(),T=null,v&&(fe(v),v.settle(),v=null),k&&(k=!1,_(()=>{h.remove(),JA(r,n),a.before(r),a.remove(),l.remove()}))}let ae=te=>e.seek(te,!t.events),de=!1,ve=te=>e.seek(te,!de);function z(te){Z=e.timeline();let he=e.durationSeconds(),Ie=Ew(r,up),it=performance.now(),mt=Au({scene:r,durationSeconds:he,fps:e.fps,seek:e.seek,events:t.events,onStep:(Wt,wn)=>Ie.sample(Wt,wn,Wt/wn*he)});ae(te),de=mt.readEvents,J=Ie.result(),D=Ie.facesNow,y=mt.movers,x=mt.pads,V=mt.translationOnly,E=vu(r,mt.dynamic),Y=Math.round(performance.now()-it)}function ee(te,he){return E?wu({movers:y,reader:E,seek:ve,restore:de?void 0:e.holdFrame?.(),t:te,reads:he,shutterSeconds:t.shutterDeg/360/e.fps,taps:t.samples,pads:x,frameW:o,frameH:i}):{els:[],frames:[]}}let Q=()=>{d.reset(),d.drawElementImage(r,0,0)},fe=te=>{r.removeAttribute(or);for(let he of te.els)he.removeAttribute(ap),he.removeAttribute(Oo)},ce=te=>{r.setAttribute(or,""),te.els.forEach((he,Ie)=>te.kept[Ie]&&he.setAttribute(Oo,""))},xe=te=>{r.removeAttribute(or),te.els.forEach((he,Ie)=>{he.removeAttribute(Oo),te.kept[Ie]&&he.setAttribute(ap,"")})};function re(te=!1){let he=v;if(!he||L||!he.armed)return;let Ie=performance.now(),it=!0;try{it=ot(he,te),U=0}catch(mt){ie(mt)}if(he.ms+=performance.now()-Ie,!it&&!L){a.requestPaint();return}B.push(O+he.ms),B.length>600&&B.shift(),Be(he)}function ie(te){U++,$("runtime.captureMotionBlur.compose",te),Me(te instanceof Error?te.message:String(te)),F?j():U>=ZH&&yt(`capture failed ${U} times in a row`,"capture-failures",!0)}function ot(te,he){Q();try{if(te.phase==="sharp")return b.draw(a,f,te.frames,te.kept),!0;if(he)throw new Error(`the ${te.phase} capture did not arrive`);return te.phase==="movers"?(b.crop(a,te.frames,te.kept),xe(te),te.phase="background",!1):(b.draw(a,f,te.frames,te.kept),!0)}finally{d.reset()}}function Be(te){fe(te),v===te&&(v=null),te.settle();let he=T;T=null,he&&!L?Ua(he.t,he.engineMode).then(he.release):he?.release()}let Ee=()=>re();function Me(te){M++,M%eG===1&&globalThis.console.info(`[motion-blur] capture failed (${M} so far): ${te}`)}function Pe(te){Me(`no paint within ${Zw} ms`),j(),Be(te)}a.addEventListener("paint",Ee);function yt(te,he,Ie=!1){L||(L=te,G=he,C=Ie,globalThis.console.warn(`[motion-blur] off: ${te}`),ur())}function ur(){a.removeEventListener("paint",Ee),j()}function An(){!L||C||(L=null,G=null,E=null,a.addEventListener("paint",Ee))}function $r(){L&&e.timeline()!==Z&&An()}function Vu(te,he){if($r(),L)return Promise.resolve();if(he&&(F=!0),!F&&document.visibilityState==="hidden")return j(),Promise.resolve();if(v&&!he){let Ie=T;return new Promise(it=>{T={t:te,engineMode:he,release:()=>{Ie?.release(),it()}}})}return Ua(te,he)}function $u(){let te=_u();if(te!==m){m=te;for(let he of[a,l])he.width=Math.max(1,Math.round(o*m)),he.height=Math.max(1,Math.round(i*m));b=np(o,i,m)}}function Ga(){return L?{code:G??"capture-failures",reason:L}:t.tier==="auto"&&E&&V&&aG()?{code:"translation-only",reason:"every mover only translates, which the filter tier draws as well and far cheaper"}:null}function Ba(te){return(!E||e.timeline()!==Z)&&z(te),J&&yt(J.reason,J.code),L!==null}function qu(te){return j(),M++,R.has(te.code)||(R.add(te.code),globalThis.console.info(`[motion-blur] sharp frame: ${te.code} appeared after a clean scan`)),Promise.resolve()}function Ua(te,he){try{if($u(),Ba(te)||Ga())return Promise.resolve();if(y.length===0)return j(),Promise.resolve();let Ie=yu(r,{isAccelerated:up,backface:D()});if(Ie)return qu(Ie);N();let it=performance.now(),mt=ee(te,he?QH:JH),Wt=b.plan(mt.frames);return O=performance.now()-it,v&&Be(v),new Promise(wn=>{let jo=++H,Ko,Ke=()=>{Ko=setTimeout(()=>{v?.seq===jo?Pe(v):wn()},Zw)};v={seq:jo,els:mt.els,frames:mt.frames,kept:Wt,phase:Wt.some(Boolean)?"movers":"sharp",armed:!he,startTimer:Ke,ms:0,settle:()=>{clearTimeout(Ko),wn()}},v.phase==="movers"&&!he&&ce(v),!he&&(Ke(),a.requestPaint())})}catch(Ie){return $("runtime.captureMotionBlur.paint",Ie),yt(Ie instanceof Error?Ie.message:String(Ie),"capture-failures",!0),Promise.resolve()}}function qr(){let te=B.length?B.reduce((he,Ie)=>he+Ie,0)/B.length:0;return{state:L?"off":"on",tier:L?null:"capture",reason:L,reasonCode:G,movers:y.length,moverNames:y.map(rG),scanMs:Y,shutterDeg:t.shutterDeg,frames:B.length,meanMs:Math.round(te*10)/10,failures:U,failedFrames:M}}function ft(){return $r(),L||Ba(e.now()),qr()}return{root:r,paint:Vu,probe:ft,rest:()=>F?!1:(j(),!0),arm:()=>{!v||v.armed||(v.armed=!0,v.phase==="movers"&&ce(v),v.startTimer(),a.requestPaint())},finish:()=>{v&&(v.armed=!0),re(!0)},teardown:ur,suspend:j,handOff:Ga,report:qr,busy:()=>v!==null,rediscover:()=>{E=null,An()}}}var ke=null,cp=null,dp=null,Tu=!1,mp=!0,aG=()=>mp,n_=!1,sp=null,lp=null;function r_(e){let t=tG(e.root),n=window;if(ke&&(ke.root!==e.root||!t)&&(ke.teardown(),ke=null,delete n.__hfMotionBlur),!!t){if(ke&&Tu&&(ke.teardown(),ke=null,Tu=!1),ke){ke.rediscover();return}cp=e,dp=t,lG(e,t,n),dG(n,t)}}var sG={code:"tier-attribute",reason:\'data-motion-blur-tier="filter"\'};function lG(e,t,n){let r=Po(),o=nG(e.root),i=Qw({tier:t.tier,form:r!==null,defect:o,fallback:mp});i==="filter"?uG(e,t,t.tier==="filter"?sG:o):i==="capture"&&r?ke=iG(e,t,r):cG(n,t,o)}function uG(e,t,n){let r=n??{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"};ke=ip(e,t,r),Tu=!0,globalThis.console.info(`[motion-blur] filter fallback: ${r.reason} (Chrome ${Jm()??"unknown"})`)}function cG(e,t,n){globalThis.console.info(`[motion-blur] off: ${n?.reason??null} (Chrome ${Jm()??"unknown"})`);let r=()=>fp(t,n);e.__hfMotionBlur={report:r,probe:r,suspend:s_}}function fp(e,t){return{state:"off",tier:null,reason:t?.reason??null,reasonCode:t?.code??null,movers:0,moverNames:[],scanMs:0,shutterDeg:e.shutterDeg,frames:0,meanMs:0,failures:0,failedFrames:0}}function dG(e,t){ke&&(e.__hfMotionBlur={report:()=>ke?.report()??fp(t,null),probe:()=>(ke?.probe(),o_(),ke?.probe()??fp(t,null)),suspend:s_})}function o_(){let e=ke?.handOff?.();!mp||!ke||!e||!cp||!dp||(ke.teardown(),ke=ip(cp,dp,e),Tu=!0,globalThis.console.info(`[motion-blur] filter fallback: ${e.reason}`))}function Ho(e,t){if(!ke||n_)return null;let n=t?.engineMode===!0;if(!n&&!t?.playing&&ke.rest())return null;let r=ke.paint(e,n);if(ke.handOff?.()){if(o_(),!n&&!t?.playing&&ke.rest())return null;r=ke.paint(e,n)}return n&&ke.busy()&&fG(),r}function i_(){return ke?.busy()??!1}function a_(){ke?.arm()}function fG(){let e=window,t=e.__hf_page_composite_resolve;t!==lp&&(sp=typeof t=="function"?t:null,lp=()=>(sp&&sp(),ke?.finish(),e.__hf_page_composite_pending=!1,!0),e.__hf_page_composite_resolve=lp),e.__hf_page_composite_pending=!0}function s_(){n_=!0,ke?.suspend()}var mG=500,pG=33,hG=3,Cu=class{constructor(t){be(this,"_baseTime",0);be(this,"_playStartMs",null);be(this,"_rate",1);be(this,"_duration",1/0);be(this,"_playStart",0);be(this,"_playEnd",1/0);be(this,"_playHold",1/0);be(this,"_nowMs");be(this,"_audioSource",null);be(this,"_lastReadMs",null);be(this,"_lastNow",0);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource?r=this._audioSource.currentTimeSeconds:r=this._elementTimeNeverBehind(this._audioSource),r!==null){let o=Math.min(r,this.getEnd());return this._baseTime=Math.max(0,o),this._playStartMs=this._nowMs(),this._lastReadMs=null,this._lastNow=this._baseTime,this._baseTime}}this._applyStallCorrection();let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return this._lastNow=Math.max(0,Math.min(n,this.getEnd())),this._lastNow}_elementTimeNeverBehind(t){let{el:n,compositionStart:r,mediaStart:o,rate:i}=t;if(n.paused||!Number.isFinite(n.currentTime)||n.seeking)return null;let a=i??1,l=cn(a,n.currentTime-o)+r;return l>=this._lastNow?l:!(n.loop&&this._lastNow-l>cn(a,n.duration)/2)&&n.readyState<hG?this._lastNow:null}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>mG&&(this._playStartMs+=n-pG)}this._lastReadMs=t}play(){return this._playStartMs!==null||this._baseTime>=this.getEnd()?!1:(this._playStartMs=this._nowMs(),this._lastNow=this._baseTime,this._lastReadMs=null,!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._lastNow=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs(),this._lastReadMs=null)}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}setPlayRange(t,n,r){this._playStart=Number.isFinite(t)&&t>0?t:0,this._playEnd=n!==null&&Number.isFinite(n)&&n>this._playStart?n:1/0,this._playHold=J0(this._playStart,this._playEnd,r)}getPlayStart(){return this._playStart}getEnd(){return Math.min(this._duration,this._playEnd)}getStopTime(){return this._playEnd<this._duration?this._playHold:this.getEnd()}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._audioSource=null}audioElement(){return this._audioSource&&"el"in this._audioSource?this._audioSource.el:null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}followedClock(){return this.getSource()==="monotonic"?"monotonic":this._audioSource&&"webAudio"in this._audioSource&&this._audioSource.webAudio?"webaudio":"audio"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){let t=this.now();return t>=this.getEnd()||this._playStartMs===null&&t>=this.getStopTime()}};var gG=100,bG=8,yG=4096,pp=e=>e;function xG(e,t,n){return!Qc(e)&&t==="linear"&&!n}function SG(e){let t=Math.ceil(e*gG);return Math.min(yG,Math.max(bG,t))}function EG(e,t,n,r,o){let{scheduledAt:i,elapsed:a,rate:l}=r,s=o??pp,c=v=>i+(v-a)/l,d=e.points[t],f=e.points[t+1],m=c(f.t);if(m<=i)return null;let b=Math.max(i,c(d.t)),h=m-b;if(h<=0)return null;if(xG(d,n,o))return{kind:"ramp",time:m,value:s(f.v)};let y=SG(h),x=F0(e,Math.max(d.t,a),f.t,y,n),E=new Float32Array(y);for(let v=0;v<y;v+=1)E[v]=s(x[v]??0);return{kind:"curve",time:b,duration:h,values:E}}function vG(e,t,n,r){let o=[];for(let a=0;a+1<e.points.length;a+=1){let l=EG(e,a,t,n,r);l&&o.push(l)}let i=o[0];return i?.kind==="curve"&&i.time<=n.scheduledAt||o.unshift({kind:"set",time:n.scheduledAt,value:(r??pp)(jt(e,n.elapsed,t))}),o}function AG(e,t){e.cancelScheduledValues(0);for(let n of t)n.kind==="set"?e.setValueAtTime(n.value,n.time):n.kind==="ramp"?e.linearRampToValueAtTime(n.value,n.time):(e.setValueAtTime(n.values[0]??0,n.time),e.linearRampToValueAtTime(n.values[n.values.length-1]??0,n.time+n.duration))}function wG(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{AG(e,t);return}}function Go(e){for(let t of e)t.param.cancelScheduledValues(0)}function Bo(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function hp(e,t,n,r){if(t.points.length!==0)for(let o of e){if(Go([o]),N0(t)){let i=(o.map??pp)(t.points[0].v);o.param.setValueAtTime(i,r.scheduledAt);continue}wG(o.param,vG(t,n,r,o.map))}}function l_(e,t,n,r,o){let i=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=yi(l.target);if(!s)continue;let c=s.kind==="preset"?o?.[s.presetId]:s.kind==="fx"?i.get(s.nodeId)?.automation?.[s.param]:void 0;if(!c||c.length===0)continue;let d=Zc(l.target,t);d&&(hp(c,l,d.scale,r),a.push(...c))}return a}function u_(e){return e.lanes.find(t=>t.target===ro)??null}var c_=`\nconst TP_OS = 4;\nconst TP_HALF = 64;\nconst TP_BRANCH = 33;\nconst TP_DELAY = 16;\n\nfunction besselI0(x) {\n let sum = 1, term = 1;\n for (let k = 1; k < 40; k++) {\n term *= (x / (2 * k)) * (x / (2 * k));\n sum += term;\n }\n return sum;\n}\n\n/** Kaiser-windowed sinc, one array per polyphase branch, newest tap first. */\nfunction tpBranches() {\n const beta = 6;\n const norm = besselI0(beta);\n const branches = [];\n for (let p = 0; p < TP_OS; p++) {\n const taps = new Float64Array(TP_BRANCH);\n let sum = 0;\n for (let j = 0; j < TP_BRANCH; j++) {\n const k = p + TP_OS * j;\n if (k > 2 * TP_HALF) continue;\n const t = (k - TP_HALF) / TP_OS;\n const sinc = t === 0 ? 1 : Math.sin(Math.PI * t) / (Math.PI * t);\n const r = (k - TP_HALF) / TP_HALF;\n taps[j] = sinc * (besselI0(beta * Math.sqrt(Math.max(0, 1 - r * r))) / norm);\n sum += taps[j];\n }\n // Unity gain at DC on every branch, so a steady level reads as itself.\n for (let j = 0; j < TP_BRANCH; j++) taps[j] /= sum;\n branches.push(taps);\n }\n return branches;\n}\n\nclass HfTruePeak extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.look = Math.max(1, Math.round((this.p.lookahead ?? 3) * sampleRate / 1000));\n this.delayLen = this.look + TP_DELAY;\n this.branches = tpBranches();\n this.setLevels();\n this.clear();\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n if (e.data && e.data.__hfReset) { this.clear(); return; }\n this.p = { ...this.p, ...e.data };\n this.setLevels();\n };\n }\n /** Back to the state of a fresh processor: no audio in the delay line, no gain reduction. */\n clear() {\n this.ch = [];\n this.rel = 1;\n this.dqIdx = new Int32Array(this.look + 2);\n this.dqVal = new Float64Array(this.look + 2);\n this.dqHead = 0;\n this.dqTail = 0;\n this.t = 0;\n this.avgRing = new Float64Array(this.look + 1).fill(1);\n this.avgPos = 0;\n this.avgSum = this.look + 1;\n }\n setLevels() {\n this.ceiling = Math.pow(10, (this.p.ceiling ?? -1) / 20);\n this.relCoef = 1 - Math.exp(-1 / (sampleRate * Math.max(1e-4, (this.p.release ?? 80) / 1000)));\n }\n channel(c) {\n if (!this.ch[c]) {\n this.ch[c] = {\n delay: new Float32Array(this.delayLen),\n w: 0,\n hist: new Float32Array(TP_BRANCH * 2),\n pos: 0,\n };\n }\n return this.ch[c];\n }\n /** Largest interpolated magnitude across channels for the newest sample. */\n peak(chans, inputs, n) {\n let peak = 0;\n for (let c = 0; c < chans; c++) {\n const s = this.channel(c);\n const x = inputs[c][n];\n s.pos = (s.pos + 1) % TP_BRANCH;\n s.hist[s.pos] = x;\n s.hist[s.pos + TP_BRANCH] = x;\n const base = s.pos + TP_BRANCH;\n for (let p = 0; p < TP_OS; p++) {\n const taps = this.branches[p];\n let acc = 0;\n for (let j = 0; j < TP_BRANCH; j++) acc += taps[j] * s.hist[base - j];\n const a = acc < 0 ? -acc : acc;\n if (a > peak) peak = a;\n }\n }\n return peak;\n }\n /** Windowed minimum of the required gain over the last look + 1 values. */\n windowMin(v) {\n const cap = this.dqIdx.length;\n while (this.dqTail !== this.dqHead && this.dqVal[(this.dqTail + cap - 1) % cap] >= v) {\n this.dqTail = (this.dqTail + cap - 1) % cap;\n }\n this.dqIdx[this.dqTail] = this.t;\n this.dqVal[this.dqTail] = v;\n this.dqTail = (this.dqTail + 1) % cap;\n while (this.dqIdx[this.dqHead] <= this.t - (this.look + 1)) {\n this.dqHead = (this.dqHead + 1) % cap;\n }\n this.t++;\n return this.dqVal[this.dqHead];\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const chans = i.length;\n const frames = i[0].length;\n for (let n = 0; n < frames; n++) {\n const peak = this.peak(chans, i, n);\n const need = peak > this.ceiling ? this.ceiling / peak : 1;\n const m = this.windowMin(need);\n this.avgSum += m - this.avgRing[this.avgPos];\n this.avgRing[this.avgPos] = m;\n this.avgPos = (this.avgPos + 1) % this.avgRing.length;\n const target = Math.min(1, this.avgSum / this.avgRing.length);\n const released = this.rel + (1 - this.rel) * this.relCoef;\n this.rel = released < target ? released : target;\n if (target >= 1 && this.rel > 0.9999999) this.rel = 1;\n for (let c = 0; c < chans; c++) {\n const s = this.channel(c);\n o[c][n] = s.delay[s.w] * this.rel;\n s.delay[s.w] = i[c][n];\n s.w = (s.w + 1) % this.delayLen;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-truepeak", HfTruePeak);\n`;var _G=`\nconst dbToLin = (db) => Math.pow(10, db / 20);\n\n/**\n * One-pole envelope followers, one per channel.\n *\n * Per channel matters: the followers advance once per sample, so a single shared\n * follower stepped once per channel per sample. On stereo that ran a 20 ms attack\n * as 10 ms, and gave the right channel a gain computed from an envelope that had\n * already traversed the left, so the two channels ducked by different amounts\n * from the same input and the image pumped.\n */\nclass EnvBank {\n constructor(attackMs, releaseMs) { this.set(attackMs, releaseMs); this.values = []; }\n set(attackMs, releaseMs) {\n this.a = Math.exp(-1 / (sampleRate * Math.max(1e-5, attackMs / 1000)));\n this.r = Math.exp(-1 / (sampleRate * Math.max(1e-5, releaseMs / 1000)));\n }\n push(ch, x) {\n const prev = this.values[ch] ?? 0;\n const m = Math.abs(x);\n const c = m > prev ? this.a : this.r;\n const next = m + c * (prev - m);\n this.values[ch] = next;\n return next;\n }\n}\n\n/** Soft-knee gain computer in dB, matching acompressor\'s shape. */\nfunction kneeGain(envDb, thresholdDb, ratio, kneeDb) {\n const over = envDb - thresholdDb;\n if (kneeDb > 0 && over > -kneeDb && over < kneeDb) {\n const t = (over + kneeDb) / (2 * kneeDb);\n return -((1 - 1 / ratio) * kneeDb * t * t);\n }\n return over > 0 ? -(over * (1 - 1 / ratio)) : 0;\n}\n\n// log10/exp per sample is the single most expensive thing a dynamics processor\n// can do on the audio thread, and every sample below the knee needs neither:\n// its gain is exactly unity. Comparing envelopes in the linear domain lets the\n// quiet majority of samples skip the transcendentals entirely.\nconst LN10_OVER_20 = Math.LN10 / 20;\nconst dbToLinFast = (db) => Math.exp(db * LN10_OVER_20);\n\nclass HfCompressor extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 20, this.p.release ?? 250);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 20, this.p.release ?? 250);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const makeup = dbToLin(p.makeup ?? 0);\n const mix = p.mix ?? 1;\n // Knee is expressed as a ratio in FFmpeg; convert to dB width.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const thresholdDb = p.threshold ?? -24;\n const ratio = p.ratio ?? 4;\n // Below this the gain computer returns unity, so the sample needs no\n // logarithm at all.\n const kneeStartLin = dbToLin(thresholdDb - kneeDb);\n const dry = 1 - mix;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n // Per-channel follower, and the sub-knee shortcut: below the knee the\n // gain is exactly unity, so the sample needs no logarithm at all.\n const env = this.env.push(ch, x);\n if (env <= kneeStartLin) {\n out[n] = x * makeup * mix + x * dry;\n continue;\n }\n const envDb = 20 * Math.log10(env);\n const g = dbToLinFast(kneeGain(envDb, thresholdDb, ratio, kneeDb));\n out[n] = x * g * makeup * mix + x * dry;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-compressor", HfCompressor);\n\nclass HfLimiter extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 5, this.p.release ?? 50);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 5, this.p.release ?? 50);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const ceiling = dbToLin(this.p.limit ?? -1);\n const outGain = dbToLin(this.p.level_out ?? 0);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n // Only ever attenuate: a limiter that can raise level is a compressor.\n const g = env > ceiling ? ceiling / env : 1;\n out[n] = x * g * outGain;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-limiter", HfLimiter);\n\nclass HfGate extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 1, this.p.release ?? 100);\n this.gains = [];\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 1, this.p.release ?? 100);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const threshold = dbToLin(p.threshold ?? -35);\n const floor = dbToLin(p.range ?? -24);\n const ratio = p.ratio ?? 10;\n // Knee is declared in the registry as a ratio, like the compressor\'s; a\n // hard threshold ignored it and chattered on material sitting right at the\n // gate point.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const kneeLin = dbToLin((p.threshold ?? -35) + kneeDb);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n let target = 1;\n // Above the threshold the gate is fully open; skip the pow entirely.\n if (env < threshold) {\n const under = env > 1e-9 ? threshold / env : 1e9;\n target = Math.max(floor, 1 / Math.pow(under, ratio - 1));\n if (!isFinite(target)) target = floor;\n }\n // Smooth toward the target so the gate does not click on every sample.\n const held = this.gains[ch] ?? 1;\n const c = target < held ? this.env.r : this.env.a;\n const smoothed = target + c * (held - target);\n this.gains[ch] = smoothed;\n out[n] = x * smoothed;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-gate", HfGate);\n\nclass HfBitcrush extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.holds = [];\n this.held = [];\n this.start = Math.round((this.p.__hfElapsed ?? 0) * sampleRate);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const levels = Math.pow(2, (p.bits ?? 8) - 1);\n const step = Math.max(1, Math.round(p.samples ?? 1));\n const mix = p.mix ?? 1;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n // Primed from the input: a counter seeded mid-hold would otherwise play 0 until it wraps.\n if (this.held[ch] === undefined) this.held[ch] = Math.round(inp[0] * levels) / levels;\n // The hold counter runs from the file\'s first sample, so a node built part-way in starts where it would be.\n if (this.holds[ch] === undefined) this.holds[ch] = this.start % step;\n for (let n = 0; n < inp.length; n++) {\n // Per channel: advancing one shared counter only on the last channel\n // left every earlier channel either unheld or frozen for a whole\n // 128-sample quantum, clicking once a block.\n if (this.holds[ch] === 0) this.held[ch] = Math.round(inp[n] * levels) / levels;\n out[n] = this.held[ch] * mix + inp[n] * (1 - mix);\n this.holds[ch] = (this.holds[ch] + 1) % step;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-bitcrush", HfBitcrush);\n\n/** Linear-interpolated read, \\`delaySamples\\` behind the write head. */\nfunction readTap(ring, write, delaySamples) {\n const len = ring.length;\n const pos = (write - 1 - delaySamples + len) % len;\n const i0 = Math.floor(pos);\n const frac = pos - i0;\n const i1 = (i0 + 1) % len;\n return ring[i0] * (1 - frac) + ring[i1] * frac;\n}\n\n/** Equal-power-ish crossfade, zero at a tap\'s reset point, which hides the splice. */\nfunction xfade(phase) {\n return Math.sin(Math.PI * phase);\n}\n\n/**\n * Dual-tap granular delay line: two read taps 180\\xB0 apart in a 100 ms grain,\n * each sweeping at a speed relative to the write head that shifts pitch\n * without changing duration. One tap is always fading in as the other fades\n * out, which hides the splice each tap makes when it wraps.\n *\n * write/phase are block-level state, advanced once per SAMPLE across all\n * channels together (not once per channel). Advancing them inside the\n * per-channel loop would move the tap 2x/4x too fast on a stereo/quad input.\n */\nclass HfPitchshift extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.grain = Math.round(sampleRate * 0.1);\n this.buf = [];\n this.write = 0;\n // The taps sweep at a constant rate from the start of the file, so a node built\n // part-way in joins the sweep where it would already be.\n const ratio0 = Math.pow(2, Math.max(-12, Math.min(12, this.p.semitones ?? 0)) / 12);\n const turns = (this.p.__hfElapsed ?? 0) * sampleRate * ((1 - ratio0) / this.grain);\n this.phase = turns - Math.floor(turns);\n // Samples written so far, capped at one grain. The taps read up to a grain\n // behind the write head, so until this fills they would read the ring\'s\n // zeros, so the head of every clip came out attenuated or silent.\n this.filled = 0;\n // How much of the wet (pitch-shifted) path is currently in the output, and\n // where it is heading. Crossing between dry and wet is a ~50 ms jump in the\n // signal, so it is RAMPED rather than switched: a hard swap either way is a\n // click. Ramping in both directions is also what lets a node return to true\n // bypass at semitones 0. A one-way latch left preview stuck with the delay\n // that the render, building a fresh node from the attribute, does not have.\n this.wet = 0;\n this.wetTarget = 0;\n // ~15 ms one-pole, short enough to feel immediate on a slider drag and long\n // enough that the splice is inaudible.\n this.wetCoef = Math.exp(-1 / (sampleRate * 0.015));\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const semitones = Math.max(-12, Math.min(12, p.semitones ?? 0));\n const mix = Math.max(0, Math.min(1, p.mix ?? 1));\n const grain = this.grain;\n const ringLen = grain * 2;\n const n = i[0] ? i[0].length : 0;\n for (let ch = 0; ch < i.length; ch++) {\n if (!this.buf[ch]) this.buf[ch] = new Float32Array(ringLen);\n }\n\n // Nothing to shift, or mixed fully out. The grain delay is ~grain/2\n // whatever the ratio, so at semitones=0 this degenerated into a pure 50 ms\n // delay of the signal, while the copy for that exact setting reads\n // "Unchanged pitch".\n this.wetTarget = semitones === 0 ? 0 : mix;\n\n // Fully dry AND settled: take the cheap transparent path. The ring keeps\n // filling, so a later shift does not start cold.\n if (this.wetTarget === 0 && this.wet < 1e-4) {\n this.wet = 0;\n let w = this.write;\n for (let s = 0; s < n; s++) {\n for (let ch = 0; ch < i.length; ch++) {\n const x = i[ch][s];\n this.buf[ch][w] = x;\n o[ch][s] = x;\n }\n w = (w + 1) % ringLen;\n }\n this.write = w;\n this.filled = Math.min(grain, this.filled + n);\n return true;\n }\n\n const ratio = Math.pow(2, semitones / 12);\n const inc = (1 - ratio) / grain;\n let write = this.write, phase = this.phase, filled = this.filled, wetNow = this.wet;\n const target = this.wetTarget, coef = this.wetCoef;\n for (let s = 0; s < n; s++) {\n phase += inc;\n phase -= Math.floor(phase);\n const phaseB = (phase + 0.5) % 1;\n const gA = xfade(phase), gB = xfade(phaseB);\n // Ramp the wet path in as the ring fills rather than reading zeros:\n // 100 ms of unshifted audio at the head of a clip beats 50 ms of silence.\n const warm = filled >= grain ? 1 : filled / grain;\n wetNow = target + coef * (wetNow - target);\n const wetMix = wetNow * warm;\n for (let ch = 0; ch < i.length; ch++) {\n const ring = this.buf[ch];\n const inp = i[ch], out = o[ch];\n const x = inp[s];\n ring[write] = x;\n const wet =\n readTap(ring, write, phase * grain) * gA + readTap(ring, write, phaseB * grain) * gB;\n out[s] = x * (1 - wetMix) + wet * wetMix;\n }\n write = (write + 1) % ringLen;\n if (filled < grain) filled++;\n }\n this.write = write;\n this.phase = phase;\n this.filled = filled;\n this.wet = wetNow;\n return true;\n }\n}\nregisterProcessor("hf-pitchshift", HfPitchshift);\n`+c_,gp=new WeakMap;function bp(e){return d_.has(e)}var d_=new WeakSet;function yp(e){let t=gp.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable: the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(_G)))}`;await e.audioWorklet.addModule(n),d_.add(e)})().catch(n=>{throw gp.delete(e),n}),gp.set(e,t)),t}function TG(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,o=Math.max(1,Math.floor(e*r)),i=new Float32Array(o),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),c=0,d=0;for(let m=0;m<o;m++){c+=s*(l()-c);let b=c*Math.pow(1-m/o,2.5);i[m]=b,d+=b*b}let f=Math.sqrt(d);if(f>0)for(let m=0;m<o;m++)i[m]=(i[m]??0)/f;return i}var Ne=e=>typeof e=="number"?e:Number(e??0),xp=e=>e/1e3;function h_(e,t,n,r){let o=Math.max(1,Math.round(e.sampleRate)),i=e.createBuffer(1,o,e.sampleRate),a=i.getChannelData(0);for(let c=0;c<o;c++){let d=c/o;a[c]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=i,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(o/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function g_(e){try{e.stop()}catch{}e.disconnect()}function Sp(e,t){return[{param:e},{param:t,map:n=>1-n}]}function b_(e,t,n){e.gain.value=n,t.gain.value=1-n}function Ep(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var CG=new Set(["peaking","highpass","lowpass"]),f_=e=>Math.pow(10,e/20),RG=(e,t)=>{let n=e.createGain(),r=o=>{n.gain.value=f_(Ne(o.gain))};return r(t),Ep(n,r,{gain:[{param:n.gain,map:f_}]})};function Ma(e,t){return(n,r)=>{let o=n.createBiquadFilter();o.type=e;let i=a=>{o.frequency.value=Ne(a.frequency),a.q!==void 0&&(o.Q.value=Ne(a.q)),t&&(o.gain.value=Ne(a.gain))};return i(r),Ep(o,i,{frequency:[{param:o.frequency}],...CG.has(e)?{q:[{param:o.Q}]}:{},...t?{gain:[{param:o.gain}]}:{}})}}function MG(e){return(t,n)=>{let r=Math.tan(Math.PI*Ne(n.frequency)/t.sampleRate),o=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return Ep(o,()=>{})}}function Uo(e,t=!1){return(n,r,o)=>{let i=new AudioWorkletNode(n,e,{processorOptions:{...r,__hfElapsed:o}});return{input:i,output:i,update:a=>i.port.postMessage({...a}),...t?{reset:()=>i.port.postMessage({__hfReset:!0})}:{},dispose:()=>{i.port.postMessage({__hfDispose:!0}),i.disconnect()}}}}var kG={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},LG=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),o=e.createGain();r.connect(n).connect(o);let i=a=>{let l=kG[String(a.type)]??Math.tanh,s=Math.pow(10,Ne(a.threshold)/20),c=8192,d=new Float32Array(c);for(let f=0;f<c;f++){let m=f/(c-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=Ne(a.oversample)>=4?"4x":Ne(a.oversample)>=2?"2x":"none",o.gain.value=Math.pow(10,Ne(a.output)/20)};return i(t),{input:r,output:o,update:i,automation:{output:[{param:o.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),o.disconnect()}}},NG=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createDelay(5),i=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(o),o.connect(i),i.connect(o),o.connect(a).connect(r),n.connect(l).connect(r);let s=c=>{o.delayTime.value=Math.min(5,Ne(c.time)/1e3),i.gain.value=Ne(c.feedback),b_(a,l,Ne(c.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:o.delayTime,map:c=>Math.min(5,xp(c))}],feedback:[{param:i.gain}],mix:Sp(a.gain,l.gain)},dispose:()=>[n,r,o,i,a,l].forEach(c=>c.disconnect())}},FG=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createDelay(.5),a=h_(e,"sine",Ne(t.speed),n),l=e.createGain(),s=e.createGain(),c=e.createGain();a.connect(l).connect(i.delayTime),r.connect(i).connect(s).connect(o),r.connect(c).connect(o);let d=f=>{i.delayTime.value=Ne(f.delay)/1e3,l.gain.value=Ne(f.depth)/1e3,a.playbackRate.value=Ne(f.speed),b_(s,c,Ne(f.mix))};return d(t),{input:r,output:o,update:d,automation:{delay:[{param:i.delayTime,map:xp}],depth:[{param:l.gain,map:xp}],speed:[{param:a.playbackRate}],mix:Sp(s.gain,c.gain)},dispose:()=>{g_(a),[r,o,i,l,s,c].forEach(f=>f.disconnect())}}},PG=6,IG=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createGain(),a=e.createGain(),l=h_(e,String(t.type)==="1"?"sine":"triangle",Ne(t.speed),n),s=e.createGain(),c=e.createGain(),d=e.createGain(),f=[];r.connect(i);let m=i;for(let h=0;h<PG;h++){let y=e.createBiquadFilter();y.type="allpass",y.Q.value=.7071,s.connect(y.frequency),m.connect(y),m=y,f.push(y)}l.connect(s),m.connect(c).connect(a),i.connect(d).connect(a),a.connect(o);let b=h=>{let y=1e3/Math.max(.1,Ne(h.delay));for(let x of f)x.frequency.value=y;s.gain.value=y*Ne(h.decay),l.playbackRate.value=Ne(h.speed),i.gain.value=Ne(h.in_gain),a.gain.value=Ne(h.out_gain),c.gain.value=1,d.gain.value=1};return b(t),{input:r,output:o,update:b,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:i.gain}],out_gain:[{param:a.gain}]},dispose:()=>{g_(l),[r,o,i,a,s,c,d,...f].forEach(h=>h.disconnect())}}},DG=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createConvolver(),i=e.createGain(),a=e.createGain();o.normalize=!1,n.connect(o).connect(i).connect(r),n.connect(a).connect(r);let l="",s=c=>{let d=`${Ne(c.size)}:${Ne(c.damping)}`;if(d!==l){let f=TG(e.sampleRate,Ne(c.size),Ne(c.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),o.buffer=m,l=d}i.gain.value=Ne(c.wet),a.gain.value=Ne(c.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:i.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,o,i,a].forEach(c=>c.disconnect())}},OG={"gain-node":RG,"biquad-peaking":Ma("peaking",!0),"biquad-lowshelf":Ma("lowshelf",!0),"biquad-highshelf":Ma("highshelf",!0),"biquad-highpass":Ma("highpass",!1),"biquad-lowpass":Ma("lowpass",!1),"worklet-compressor":Uo("hf-compressor"),"worklet-limiter":Uo("hf-limiter"),"worklet-truepeak":Uo("hf-truepeak",!0),"worklet-gate":Uo("hf-gate"),"worklet-bitcrush":Uo("hf-bitcrush"),"worklet-pitchshift":Uo("hf-pitchshift"),waveshaper:LG,"delay-feedback":NG,"chorus-lfo":FG,"allpass-phaser":IG,convolver:DG};function y_(e){return e.nodes.some(t=>pi(t.type)?.web.startsWith("worklet-")??!1)}function HG(e,t,n,r=0){let o=pi(t);if(!o)throw new Error(`Unknown effect type: ${t}`);let i=hi(t,n);if((t==="highpass"||t==="lowpass")&&String(i.poles)==="1")return MG(t)(e,i,r);let a=OG[o.web];if(!a)throw new Error(`No Web Audio builder for ${o.web}`);return a(e,i,r)}function m_(e){let t=[];for(let n of e){let r=n.fromPreset,o=t.at(-1);if(o&&o.preset===r)o.nodes.push(n);else{let i=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,i)),nodes:[n]})}}return t}function p_(e){return gi(e).map(t=>{let n=hi(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",o=String(n.poles)==="1"?`@${n.frequency}`:"",i=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"",l=t.type==="truepeak"?`^${n.lookahead}`:"";return`${t.type}${r}${o}${i}${l}${a}`}).join("|")}function x_(e,t,n=0){var f;let r=e.createGain(),o=e.createGain(),i=[],a=[],l=m_(gi(t)),s=r;for(let m of l){let b=null;if(m.preset){let h=e.createGain(),y=e.createGain(),x=e.createGain(),E=e.createGain();x.gain.value=m.amount,y.gain.value=1-m.amount,s.connect(h),h.connect(y).connect(E),b={entry:h,wet:x,dry:y,join:E},s=h}for(let h of m.nodes){let y=HG(e,h.type,h.params??{},n);s.connect(y.input),s=y.output,i.push({...h.id?{id:h.id}:{},type:h.type,handle:y})}b&&m.preset&&(s.connect(b.wet).connect(b.join),a.push({id:m.preset,...b}),s=b.join)}s.connect(o);let c=p_(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Sp(m.wet.gain,m.dry.gain));return{input:r,output:o,presets:d,nodes:i,update(m){if(p_(m)!==c)return!1;gi(m).forEach((h,y)=>{let x=i[y];x&&(x.handle.update(hi(h.type,h.params)),h.id===void 0?delete x.id:x.id=h.id)});let b=0;for(let h of m_(gi(m))){if(!h.preset)continue;let y=a[b++];!y||y.id!==h.preset||(y.wet.gain.value=h.amount,y.dry.gain.value=1-h.amount)}return!0},reset(){for(let{handle:m}of i)m.reset?.()},dispose(){for(let{handle:m}of i)m.dispose();for(let{entry:m,wet:b,dry:h,join:y}of a)m.disconnect(),b.disconnect(),h.disconnect(),y.disconnect();r.disconnect(),o.disconnect()}}}var S_={version:1,nodes:[]},E_={version:1,lanes:[]};function v_(e,t,n=un){let r=(n&&typeof e.getAttribute=="function"?e.getAttribute(n):null)??"";if(!r)return E_;try{return L0(Ps(r),t)}catch{return E_}}function Wo(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Hn):null)??"";if(!t)return{chain:S_,raw:""};try{return{chain:w0(t),raw:t}}catch{return{chain:S_,raw:""}}}function A_(e){return v_(e,Wo(e).chain)}function vp(e,t,n){let r=u_(t);if(!r)return[];let o=C0(r,e.gain?.()??1,e.gainAhead);return hp([{param:e.param}],{...r,points:o},Fs.scale,n),[{param:e.param}]}function GG(e,t){Go([e]),e.param.setValueAtTime(e.gainAhead?1:Ve(e.gain?.()??1),t.scheduledAt)}function Ru(e,t,n,r,o,i={automation:un},a){let{chain:l}=Wo(t),s=null,c=[],d=!1,f=0,m=()=>{try{s?(n.disconnect(s.input),s.output.disconnect(r),s.dispose()):n.disconnect(r)}catch{}s=null},b=(M,L)=>{if(M.nodes.length===0){n.connect(r);return}if(y_(M)&&!bp(e)){n.connect(r);let G=++f;yp(e).then(()=>{d||G!==f||v(Wo(t).chain)}).catch(()=>{});return}try{let G=x_(e,M,L);n.connect(G.input),G.output.connect(r),s=G}catch{n.connect(r)}},h=(M,L)=>{if(!L){c=[];return}let G=v_(t,M,i.automation),C=s?l_(G,M,s.nodes,L,s.presets):[],B=a?vp(a,G,L):[];a&&B.length===0&&c.some(O=>O.param===a.param)&&GG(a,L),c=[...C,...B]},y=o?{...o}:null;b(l,y?.elapsed??0),h(l,y);let x=()=>{if(!y)return null;let M=typeof e.currentTime=="number"?e.currentTime:y.scheduledAt;return{scheduledAt:M,elapsed:y.elapsed+(M-y.scheduledAt)*y.rate,rate:y.rate}},E=M=>{let L=x();L&&(Bo(c,L.scheduledAt),h(M,L))},v=M=>{let L=x();Bo(c,L?.scheduledAt??0),m(),b(M,L?.elapsed??0),h(M,L)},T=null,H=t;typeof MutationObserver<"u"&&typeof H?.nodeType=="number"&&(T=new MutationObserver(()=>{let M=Wo(t);c.length>0&&Go(c),!s||!s.update(M.chain)?v(M.chain):E(M.chain)}),T.observe(H,{attributes:!0,attributeFilter:[Hn,...i.automation?[i.automation]:[],...a?.gain?["data-volume"]:[]]}));let U=M=>{if(d)return;let L=x();L&&Bo(c,L.scheduledAt),y={...M},h(Wo(t).chain,y)};return{reanchor:M=>{d||(s?.reset(),U(M))},retime:U,setRate:M=>{let L=x();d||!L||!Number.isFinite(M)||M<=0||M===L.rate||(y={...L,rate:M},Bo(c,L.scheduledAt),h(Wo(t).chain,y))},dispose:()=>{d=!0,T?.disconnect(),c.length>0&&Bo(c,typeof e.currentTime=="number"?e.currentTime:0),s?.dispose()}}}var w_=new WeakMap;function BG(e){let t=e.currentSrc||e.getAttribute("src")||"";try{return/\\.([a-z0-9]{1,5})$/i.exec(new URL(t,document.baseURI).pathname)?.[1]?.toLowerCase()??null}catch{return null}}function ka(e,t,n,r=null){if(jn(e))return;let o=w_.get(e)??new Set;if(o.has(t))return;o.add(t),w_.set(e,o);let i=e.getAttribute("src")??"",a={asset:i,elementId:e.id||null,kind:e.tagName.toLowerCase(),stage:t,code:n,bytes:r,extension:BG(e)};we({source:"hf-preview",type:"diagnostic",code:ud,details:a}),globalThis.console.info(`[hyperframes] ${ud}: "${i}" failed at ${t}${n===null?"":` (${n})`}.`)}function __(e){let t=n=>{let r=n.target,o=Gg(r)?r.parentElement:r;vr(o)&&ka(o,"element",o.error?.code??null)};return e.addEventListener("error",t,!0),()=>e.removeEventListener("error",t,!0)}function T_(e,t){e.getFloatTimeDomainData(t);let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,Math.abs(t[r]??0));return n}function Ap(e,t){let n=e.createGain();n.channelCount=2,n.channelCountMode="explicit";let r=e.createChannelSplitter(2),o=e.createAnalyser(),i=e.createAnalyser();o.fftSize=i.fftSize=2048,t.connect(n),n.connect(r),r.connect(o,0),r.connect(i,1);let a=new Float32Array(new ArrayBuffer(2048*4)),l=new Float32Array(new ArrayBuffer(2048*4));return{read:()=>({l:T_(o,a),r:T_(i,l)}),dispose:()=>{try{t.disconnect(n),n.disconnect(),r.disconnect()}catch{}}}}var C_="runtime_web_audio_bypass";function wp(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function La(e,t){return wp(e,t)!==null}function UG(e){return La(e,"crossorigin")?!0:e.crossOrigin!=null}function WG(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function VG(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=wp(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let o of Array.from(e.querySelectorAll("source"))){let i=o.getAttribute("src");i&&r.push(i)}return r}function $G(e,t){let n;try{n=new URL(e,WG(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function qG(){return typeof window.origin=="string"?window.origin:window.location.origin}function zG(e,t){if(typeof window>"u")return null;let n=$G(e,t);if(!n)return null;let r=qG(),o=r==="null";return!o&&n.origin===r||UG(t)?null:o?"opaque_document_origin":"cross_origin_no_cors"}function M_(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:La(e,"src")}function Vo(e){for(let t of VG(e)){let n=zG(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function jG(e){let t=[];La(e,Hn)&&t.push("fx-chain"),La(e,un)&&t.push("automation"),La(e,tl)&&t.push("audio-group");let n=Number.parseFloat(wp(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function KG(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var R_=new WeakSet,YG={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document\'s security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},XG={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function $o(e,t){if(t.kind==="web-audio"||KG()||R_.has(e))return;let n=jG(e);R_.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:YG[t.reason]};we({source:"hf-preview",type:"diagnostic",code:C_,details:r});let o=n.length>0?` Native playback cannot reproduce: ${n.join(", ")}. Fix: ${XG[t.reason]}`:"";globalThis.console.info(`[hyperframes] ${C_}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${o}`)}function Mu(e){return new URL(e,document.baseURI).href}var JG={automation:null};function _p(e){return!Number.isFinite(e)||e<=0?1:e}function k_(e){return Ve(e)}function QG(e,t){t||e.paused||!gs().__hfDebug||globalThis.console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function ZG(e,t){let{elapsed:n,mediaStart:r,scheduledAt:o,globalRate:i,mediaRate:a,clipDuration:l,headCut:s}=t,c=Number.isFinite(l)&&l>0,d=Math.max(n,s,0),f=(l-d)*a;if(c&&f<=0)return!1;let m=d>n?o+(d-n)/i:0;return c?e.start(m,d*a+r,f):e.start(m,d*a+r),!0}function e2(e,t,n,r,o){let i=Md(Zs(t),o);if(i.fadeIn<=0&&i.fadeOut<=0||i.fadeOut>0&&!Number.isFinite(o))return null;let a=e.createGain(),l=a.gain,s=d=>el(d,o,i),c=d=>{let f=Math.max(r,d.elapsed),m=b=>d.scheduledAt+Math.max(0,b-d.elapsed)/d.rate;if(l.value=s(f),l.setValueAtTime(s(f),m(f)),i.fadeIn>f&&l.linearRampToValueAtTime(s(i.fadeIn),m(i.fadeIn)),i.fadeOut>0){let b=o-i.fadeOut;b>f&&b>i.fadeIn&&l.setValueAtTime(s(b),m(b)),l.linearRampToValueAtTime(0,m(o))}};return c(n),{node:a,rebook:d=>{l.cancelScheduledValues(0),c(d)}}}function L_(e,t,n,r,o,i){let a=e.createGain();a.connect(r);let l=e.createGain(),s=e2(e,t,o,i.from,i.clipDuration);return s&&n.connect(s.node),(s?.node??n).connect(l),{fx:Ru(e,t,l,a,o,void 0,{param:a.gain,gain:()=>Li(t),gainAhead:!0}),laneNode:a,clipGainNode:l,fades:s}}function Vr(e){return e.sourceKind==="buffer"}var N_=e=>{let t=e.currentSrc||e.getAttribute("src");if(!t)return null;try{return Mu(t)}catch{return t}},Tp=.015,F_=["seeked","error","emptied","abort"],P_=["playing","seeked","ratechange"],t2=1e4,n2=.25,ku=class{constructor(){be(this,"_ctx",null);be(this,"_bufferCache",new Map);be(this,"_decoding",new Map);be(this,"_failedSrcs",new Set);be(this,"_mediaElementSources",new WeakMap);be(this,"_handedOver",new WeakSet);be(this,"_activeSources",[]);be(this,"_masterGain",null);be(this,"_busOut",null);be(this,"_master",null);be(this,"_monitorGain",null);be(this,"_masterVolume",1);be(this,"_masterMuted",!1);be(this,"_groups",new Map);be(this,"_metering",!1);be(this,"_masterTap",null);be(this,"_groupTaps",new Map);be(this,"_rateAnchorCtx",0);be(this,"_rateAnchorComp",0);be(this,"_rate",1);be(this,"_paused",!0);be(this,"_playGeneration",0);be(this,"_playingCaptured",new Set);be(this,"_suspendPending",!1);be(this,"_restTimer",null)}async init(){try{return this._ctx=new AudioContext,this._ctx.onstatechange=()=>this.rest(),this._masterGain=this._ctx.createGain(),this._busOut=this._ctx.createGain(),this._monitorGain=this._ctx.createGain(),this._masterGain.connect(this._busOut),this._busOut.connect(this._monitorGain),this._monitorGain.connect(this._ctx.destination),this.applyMasterGain(),this._metering&&this.attachMasterTap(),!0}catch{return!1}}async wake(){!this._ctx||this._ctx.state==="running"&&!this._suspendPending||(this._suspendPending=!1,await this._ctx.resume())}rest(){this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,!(!this._ctx||this._ctx.state!=="running"||this._suspendPending)&&(this._restTimer=setTimeout(()=>{this._restTimer=null,this.suspendIfIdle()},t2))}suspendIfIdle(){for(let t of this._playingCaptured)t.paused&&this._playingCaptured.delete(t);!this._ctx||!this._paused||this._suspendPending||this._playingCaptured.size>0||(this._suspendPending=!0,this._ctx.suspend().catch(t=>{this._suspendPending=!1,$("webAudioTransport.suspend",t)}))}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}releaseDecodedExcept(t){let n=new Set(t.map(N_));for(let r of[...this._bufferCache.keys()])n.has(r)||this._bufferCache.delete(r)}decodeAudioElement(t){let n=N_(t);if(!n)return Promise.resolve(null);let r=this._decoding.get(n);if(r)return r;let o=this.fetchAndDecode(n,t).finally(()=>this._decoding.delete(n));return this._decoding.set(n,o),o}async fetchAndDecode(t,n){if(this._bufferCache.has(t))return this._bufferCache.get(t);if(this._failedSrcs.has(t)||!this._ctx)return null;let r;try{let o=await fetch(t,{cache:"no-store"});if(!o.ok)return $("webAudioTransport.fetch",new Error(`${o.status} ${t}`)),ka(n,"fetch",o.status),null;r=await o.arrayBuffer()}catch(o){return $("webAudioTransport.fetch",o),ka(n,"fetch",null),null}try{let o=await this._ctx.decodeAudioData(r);return Number.isFinite(n.duration)&&n.duration-o.duration>n2?(this._failedSrcs.add(t),null):(this._bufferCache.set(t,o),o)}catch(o){return this._failedSrcs.add(t),$("webAudioTransport.decode",o),ka(n,"decode",null,r.byteLength),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let a=Vo(t);if(a.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),$o(t,a),null}return n}if(!this._ctx)return null;let r=Vo(t);if(r.kind!=="web-audio")return $o(t,r),null;let o=this._ctx.createMediaElementSource(t);this._mediaElementSources.set(t,o),t.paused||this._playingCaptured.add(t),t.addEventListener("play",()=>{this._playingCaptured.add(t),this.wake()});let i=()=>{this._playingCaptured.delete(t),this.rest()};return t.addEventListener("pause",i),t.addEventListener("emptied",i),o}async scheduleMediaElementPlayback(t,n,r,o,i,a,l=1,s=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(await this.wake(),a!==this._playGeneration)return null;let c=this.acquireMediaElementSource(t);if(!c)return null;c.disconnect();let d=_p(l),f=this._ctx.createGain();f.gain.value=i;let m=this._ctx.currentTime,b=o-n,h={scheduledAt:m,elapsed:b,rate:d};f.connect(this.resolveDestination(t,m,o,d)??this._masterGain);let y=this._ctx.createGain();c.connect(y);let{fx:x,laneNode:E,clipGainNode:v,fades:T}=L_(this._ctx,t,y,f,h,{from:Math.max(b,0),clipDuration:s});this._rate=d,this._rateAnchorCtx=m,this._rateAnchorComp=o;let H={fx:x,fades:T,dipNode:y,el:t,sourceNode:c,sourceKind:"media-element",gainNode:f,laneNode:E,clipGainNode:v,compositionStart:n,mediaStart:r,scheduledAt:m,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:lt(t),bounded:!1,unfollow:this.followElement(t,n,r,x,T)};return t.volume=1,this._activeSources.push(H),this._paused=!1,H}catch(c){return $("webAudioTransport.mediaElementSource",c),null}}followElement(t,n,r,o,i){let a=()=>{if(t.paused||!this._ctx)return;let l=St(t),s=t.currentTime-r,c=t.duration-r;if(t.loop&&c>0){let b=Gn(l,this.getTime()-n);s+=Math.round((b-s)/c)*c}let d=cn(l,s),f=t.playbackRate/xi(l,d);if(!(f>0)||!Number.isFinite(d))return;let m={scheduledAt:this._ctx.currentTime,elapsed:d,rate:f};o?.retime(m),i?.rebook(m)};for(let l of P_)t.addEventListener(l,a);return()=>{for(let l of P_)t.removeEventListener(l,a)}}seekUnderDip(t,n){let r=this._activeSources.find(s=>s.el===t&&s.sourceKind==="media-element"),o=this._ctx;if(!o||!r?.dipNode)return!1;if(r.dipping)return!0;r.dipping=!0;let i=r.dipNode.gain,a=s=>{let c=o.currentTime;i.cancelScheduledValues(c),i.setValueAtTime(i.value,c),i.linearRampToValueAtTime(s,c+Tp)},l=()=>{for(let s of F_)t.removeEventListener(s,l);r.dipping=!1,a(1)};return a(0),setTimeout(()=>{if(this._activeSources.includes(r)){for(let s of F_)t.addEventListener(s,l);try{t.currentTime=Ct(n+Tp*t.playbackRate)}catch(s){$("webAudioTransport.seekUnderDip",s),l()}}},Tp*1e3),!0}groupInput(t,n,r){let o=this._groups.get(t);if(o){if(o.generation!==this._playGeneration)try{o.reanchor(r),o.generation=this._playGeneration}catch(b){$("webAudioTransport.groupReanchor",b)}return o.input}if(!this._ctx||!this._masterGain)return null;let i=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>kd(n,t),s=l(),c=this._ctx.createGain();c.gain.value=s?.hasAttribute("data-hidden")?0:1,c.connect(a);let d=this._ctx.createGain();d.gain.value=k_(Li(s)),d.connect(c);let f={param:d.gain,gain:()=>Li(l())},m=Ru(this._ctx,s??{getAttribute:()=>null},i,d,r,void 0,s?f:void 0);return this._groups.set(t,{input:i,output:a,isPresent:()=>l()!==null,fader:d,muteGain:c,fx:m,generation:this._playGeneration,reanchor:b=>{Go([{param:d.gain}]);let h=l();d.gain.value=k_(Li(h)),c.gain.value=h?.hasAttribute("data-hidden")?0:1,m?.reanchor(b),h&&h!==s&&vp(f,A_(h),b)},dispose:()=>{try{m?.dispose(),i.disconnect(),d.disconnect(),c.disconnect(),a.disconnect()}catch{}}}),this.attachGroupTap(t,a),i}startMetering(){this._metering=!0,this.attachMasterTap();for(let[t,n]of this._groups)this.attachGroupTap(t,n.output)}stopMetering(){this._metering=!1,this._masterTap?.dispose(),this._masterTap=null;for(let t of this._groupTaps.values())t.dispose();this._groupTaps.clear()}readLevels(){let t={};for(let[n,r]of this._groupTaps)this._groups.get(n)?.isPresent()&&(t[n]=r.read());return{master:this._masterTap?.read()??{l:0,r:0},groups:t}}attachMasterTap(){this._ctx&&this._masterGain&&!this._masterTap&&(this._masterTap=Ap(this._ctx,this._busOut??this._masterGain))}attachGroupTap(t,n){this._metering&&this._ctx&&!this._groupTaps.has(t)&&this._groupTaps.set(t,Ap(this._ctx,n))}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(o){$("webAudioTransport.setGroupMuted",o)}}ensureMasterBus(t,n){if(!this._ctx||!this._masterGain||!this._busOut)return;if(this._master){if(this._master.generation===this._playGeneration)return;try{this._master.fx?.reanchor(n),this._master.generation=this._playGeneration}catch(i){$("webAudioTransport.masterReanchor",i)}return}let r=Ld(t);if(!r)return;this._masterGain.disconnect(this._busOut);let o=Ru(this._ctx,r,this._masterGain,this._busOut,n,JG);this._master={fx:o,generation:this._playGeneration}}resolveDestination(t,n,r,o){if(!this._masterGain)return null;let i={scheduledAt:n,elapsed:r,rate:o};this.ensureMasterBus(t.ownerDocument,i);let a=rl(t);return a?this.groupInput(a,t.ownerDocument,i)??this._masterGain:this._masterGain}handleSourceEnded(t,n,r,o){let i=this._activeSources.indexOf(n);if(i!==-1){this._activeSources.splice(i,1),r.muted=o;try{t.disconnect(),n.fx?.dispose(),n.fades?.node.disconnect(),n.clipGainNode.disconnect(),n.laneNode.disconnect(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,o,i,a,l,s=1,c=Number.POSITIVE_INFINITY,d=r){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(await this.wake(),l!==this._playGeneration)return null;let f=i(),m=_p(s),b=lt(t),h=m*b,y=this._ctx.createBufferSource();y.buffer=n,y.playbackRate.value=h;let x=this._ctx.createGain();x.gain.value=a;let E=f-r,v=this._ctx.currentTime,T={scheduledAt:v,elapsed:E,rate:m};x.connect(this.resolveDestination(t,v,f,m)??this._masterGain);let H=d-r,{fx:U,laneNode:M,clipGainNode:L,fades:G}=L_(this._ctx,t,y,x,T,{from:Math.max(E,H,0),clipDuration:c});if(this._rate=m,this._rateAnchorCtx=v,this._rateAnchorComp=f,!ZG(y,{elapsed:E,mediaStart:o,scheduledAt:v,globalRate:m,mediaRate:b,clipDuration:c,headCut:H}))return y.disconnect(),U?.dispose(),G?.node.disconnect(),L.disconnect(),M.disconnect(),x.disconnect(),null;let C=t.muted;t.muted=!0,QG(t,C);let B={fx:U,fades:G,el:t,sourceNode:y,sourceKind:"buffer",gainNode:x,laneNode:M,clipGainNode:L,compositionStart:r,mediaStart:o,scheduledAt:v,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:b,bounded:Number.isFinite(c)&&c>0};return this._activeSources.push(B),this._paused=!1,y.addEventListener("ended",()=>this.handleSourceEnded(y,B,t,C)),B}catch(f){return $("webAudioTransport.schedule",f),null}}releaseRouted(t){let n=this._activeSources.find(r=>r.el===t&&r.sourceKind==="media-element");n&&(this._activeSources.splice(this._activeSources.indexOf(n),1),this.dispose(n),this._handedOver.add(t))}hasHandedOverSources(){return this._activeSources.some(t=>Vr(t)&&this._handedOver.has(t.el))}setRate(t){let n=_p(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)if(Vr(r))try{r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate,r.fx?.setRate(n),this._ctx&&!this._paused&&r.fades?.rebook({scheduledAt:this._ctx.currentTime,elapsed:this.getTime()-r.compositionStart,rate:n})}catch(o){$("webAudioTransport.setRate",o)}return this.setBusRate(n),!0}setBusRate(t){let n=[...this._groups.values(),...this._master?[this._master]:[]];for(let r of n)try{r.fx?.setRate(t)}catch(o){$("webAudioTransport.setRate.bus",o)}}hasBoundedActiveSources(){return this._activeSources.some(t=>Vr(t)&&t.bounded)}stopAll(){for(let t of this._activeSources)this.dispose(t);this._activeSources=[],this._paused=!0,this._playGeneration+=1,this.rest()}releaseDetached(){this._activeSources=this._activeSources.filter(t=>t.el.isConnected?!0:(this.dispose(t,!1),!1))}dispose(t,n=!0){t.unfollow?.();try{Vr(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.fades?.node.disconnect(),t.dipNode?.disconnect(),t.clipGainNode.disconnect(),t.laneNode.disconnect(),t.gainNode.disconnect()}catch{}Vr(t)?t.el.muted=t.priorMuted:(t.el.volume=t.priorVolume,this._ctx&&n&&t.sourceNode.connect(this._ctx.destination))}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n,r=1,o=n){for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=Ve(i.fades?o:n),i.clipGainNode.gain.value=Ve(r)}catch(a){$("webAudioTransport.setElementVolume",a)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._monitorGain&&(this._monitorGain.gain.value=this._masterMuted?0:this._masterVolume)}ownsClock(){return!this._paused&&this._activeSources.some(Vr)}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&Vr(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll(),this.stopMetering();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._master?.fx?.dispose(),this._master=null,this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._playingCaptured.clear(),this._suspendPending=!1,this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._busOut=null,this._monitorGain=null,this._masterVolume=1,this._masterMuted=!1}};var Na="data-hf-studio-manual-edit-gesture";var I_=`[${Na}]`;function D_(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(I_)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(I_)),o=l=>{for(let s of l){let c=s.target;Ge(c)&&(c.hasAttribute(Na)?r.add(c):r.delete(c))}},i=l=>{l.length!==0&&(o(l),t())},a=new n(i);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Na]}),{observing:!0,isActive:()=>{i(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Na))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var Sn=e=>({ok:!1,reason:e});function Cp(e,t){if(e<=0)return Sn("non-positive");let n=e/t;return n<1||n>240?Sn("out-of-range"):{ok:!0,value:{num:e,den:t}}}function r2(e){return Number.isFinite(e)?Number.isInteger(e)?Cp(e,1):Sn("ambiguous-decimal"):Sn("not-a-number")}function o2(e){let t=e.split("/");if(t.length!==2)return Sn("invalid-fraction");let n=Number(t[0]),r=Number(t[1]);return!Number.isFinite(n)||!Number.isFinite(r)?Sn("not-a-number"):!Number.isInteger(n)||!Number.isInteger(r)||r<=0?Sn("invalid-fraction"):Cp(n,r)}function O_(e){if(typeof e=="number")return r2(e);let t=e.trim();return t===""?Sn("empty"):t.includes("/")?o2(t):/^-?\\d+$/.test(t)?Cp(Number(t),1):Sn(/^-?\\d*\\.\\d+$/.test(t)?"ambiguous-decimal":"not-a-number")}var H_=333.3333333333333,Rp=1e3*60/60;function G_(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:e.isPlaying?e.playingPollDue===!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var i2=/^\\s*spring\\(\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*\\)\\s*$/;function B_(e){return Math.max(0,Math.min(1,e))}function U_(e){let t=i2.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?B_(n):null}function W_(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=B_(t),r=12-n*6,o=Math.PI*2*(1+n*1.5),i=1-Math.exp(-r)*Math.cos(o);return(1-Math.exp(-r*e)*Math.cos(o*e))/i}var a2=/^\\s*wiggle\\(\\s*(\\d+)\\s*,\\s*(easeOut|easeInOut|anticipate|uniform)\\s*(?:,\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)\\s*)?\\)\\s*$/,s2=Math.PI*2;function l2(e){let t=a2.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let o=Number(t[3]);return!Number.isFinite(o)||o<0||o>1?null:{wiggles:n,type:r,amplitude:o}}function u2(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),i=n==="easeInOut"?o*Math.sin(Math.PI*e):n==="uniform"?o:o*(1-e);return e+(n==="anticipate"?-1:1)*i*Math.sin(s2*t*e)}function V_(e,t){let n=l2(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,o=t?.get(r);if(o)return o;let i=a=>u2(a,n.wiggles,n.type,n.amplitude);return t?.set(r,i),i}var c2=24,$_=e=>e>=1?1:0,d2=e=>e,Lu=String.raw`([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?)`,f2=new RegExp(String.raw`^\\s*M\\s*0\\s*,\\s*0\\s+C\\s*${Lu}\\s*,\\s*${Lu}\\s+${Lu}\\s*,\\s*${Lu}\\s+1\\s*,\\s*1\\s*$`,"i");function q_(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function m2(e,t,n,r,o){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=0,a=1;for(let l=0;l<c2;l+=1){let s=(i+a)/2;q_(s,t,r)<e?i=s:a=s}return q_((i+a)/2,n,o)}function p2(e){let t=f2.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]),i=Number(t[4]);return Math.min(n,o)<0||Math.max(n,o)>1?null:a=>m2(a,n,r,o,i)}function h2(e,t){if(!e.startsWith("spring("))return null;let n=U_(e);if(n===null)return null;let r=t.get(n);if(r)return r;let o=i=>W_(i,n);return t.set(n,o),o}function g2(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let o=p2(n);return o&&t.set(n,o),o}function z_(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,o=new Map,i=s=>typeof s!="string"?null:s==="hold"?$_:V_(s,o)??h2(s,r)??g2(s,n),a=(s,c,d=[])=>{let f=i(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\\(|$)/.test(s.trim())&&Rt("custom_ease_parse_failed",{ease:s}),t.call(c,s,...d)??d2)};e.parseEase=function(c,...d){return a(c,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",$_);let s=c=>{let d=f=>f;d.config=(...f)=>a(`${c}(${f.join(",")})`,e),l(c,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var kp="first-frame",b2=3;function y2(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function x2(e){if(!y2(e)||e.tagName!=="AUDIO"&&e.tagName!=="VIDEO")return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function S2(e){return e.hasAttribute("data-start")||e.hasAttribute("data-track-index")}function E2(e,t,n){let r=e;for(;r;){if(S2(r)&&!Us(r,{currentTime:0,compositionDuration:Number.POSITIVE_INFINITY,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:t}))return!1;r=r.parentElement}return!0}function j_(e,t,n,r){return t==="all"?!0:E2(e,n,r)}function v2(e,{scope:t="all"}={}){let n=e.defaultView,r=ut({documentRef:e,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),o=e.querySelector(`meta[name="${bs}"]`)!==null,i=Array.from(e.querySelectorAll("video, audio")).filter(x2).filter(s=>j_(s,o&&s.preload!=="auto"?kp:t,r,n?.__timelines??{})).filter(s=>s.readyState<b2),a=Array.from(e.querySelectorAll("img")).filter(s=>j_(s,s.getAttribute("loading")?.toLowerCase()==="lazy"?kp:t,r,n?.__timelines??{})).filter(s=>!s.complete),l=e.fonts?.status==="loading";return{pendingMedia:i,pendingImages:a,fontsLoading:l}}function A2(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},o){let i=t.map(s=>new Promise(c=>{if(s.error){c();return}let d=()=>{s.removeEventListener("canplay",d),s.removeEventListener("error",d),o.removeEventListener("abort",d),c()};s.addEventListener("canplay",d),s.addEventListener("error",d),o.addEventListener("abort",d,{once:!0})})),a=n.map(s=>s.decode?s.decode().catch(()=>{}):Promise.resolve()),l=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...i,...a,l]).then(()=>{})}function w2(e,t,{scope:n="all"}={}){let r=v2(e,{scope:n});return r.pendingMedia.length===0&&r.pendingImages.length===0&&!r.fontsLoading?null:A2(e,r,t)}var _2=50;function T2(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(r=>{let o,i=()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("abort",i),r()};if(t.aborted){i();return}t.addEventListener("abort",i,{once:!0});let a=()=>{if(n.__renderReady){i();return}o=setTimeout(a,_2)};a()})}var C2=50,R2=1.5,M2=2,k2=1500;function Mp(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,o=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener("abort",o,{once:!0}),r=e.requestAnimationFrame(i=>{t.removeEventListener("abort",o),n(i)})})}function L2(e,t){let n=e.defaultView;return n?(async()=>{let r=await Mp(n,t);if(t.aborted)return;let o=await Mp(n,t),i=o-r,a=0;for(;!t.aborted&&a<M2;){if(o-r>=k2)return;let l=await Mp(n,t);if(t.aborted)return;let s=l-o;i=Math.min(i,s),a=s<C2||s<=i*R2?a+1:0,o=l}})():null}var N2=8e3;function F2(e,t,n={}){let r=n.inputs??[(c,d)=>w2(c,d,{scope:n.scope}),T2,L2],o=new AbortController,i=r.map(c=>c(e,o.signal)).filter(c=>c!==null);if(i.length===0){t({timedOut:!1});return}let a=n.timeoutMs??N2,l,s=new Promise(c=>{l=setTimeout(()=>c("timed-out"),a)});Promise.race([Promise.all(i).then(()=>"done"),s]).then(c=>{clearTimeout(l),o.abort(),t({timedOut:c==="timed-out"})})}function K_(e,t,n={}){F2(e,t,{...n,scope:kp})}var Fp=new Map,Fa=new Map,Lp=new Map,Np=()=>{},X_=()=>{},Y_=0;function Pp(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function J_(e){let t=(Lp.get(e)??0)+1;return Lp.set(e,t),t}function Q_(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Y_-=1,Y_)}function Ip(e,t){let n=Fa.get(e);if(!n)return;let r=()=>Lp.get(e)===t.generation&&Fa.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&X_(e,t.requestId)},o=>{r()&&Np(e,t.requestId,o)})}catch(o){r()&&Np(e,t.requestId,o)}}function Z_(e){Np=e}function eT(e){X_=e}function Nu(e,t,n){if(!Pp(e))return;let r={payload:t,requestId:Q_(n),generation:J_(e)};Fp.set(e,r),Ip(e,r)}function Fu(e,t){Pp(e)&&(Fp.delete(e),Ip(e,{payload:void 0,requestId:Q_(t),generation:J_(e)}))}function tT(e,t){if(!Pp(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Fa.set(e,t);let n=Fp.get(e);return n&&Ip(e,n),()=>{Fa.get(e)===t&&Fa.delete(e)}}var nT=!1;function En(e){if(e){if(typeof e.pause!="function"){nT||(nT=!0,Rt("timeline_missing_pause",{}));return}try{e.pause()}catch(t){$("runtime.timeline.pause",t)}}}function D2(e){let t=e;if(typeof t.remove=="function")for(let n of e.getChildren?.(!1,!0,!1)??[])n.data===Ei&&t.remove(n)}function O2(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function H2(){let e=O_(Et()?.getAttribute("data-fps")??"");return e.ok?e.value.num/e.value.den:null}function G2(e,t){return t!==null&&e.length===t.length&&e.every((n,r)=>n===t[r])}function rT(e,t,n){let r=null,o=!0;return()=>{let i=e();if(i.length===0)return r=null,o=!0,!0;if(G2(i,r))return o;r=i,o=!1;let a=i.length===1?i[0]:Promise.all(i);return Promise.resolve(a).then(()=>{r===i&&(o=!0,t())},l=>{r===i&&(o=!0,n(l),t())}),o}}function Ia(e){let t=e.querySelector(`meta[name="${Nn}"]`)?.getAttribute("content");if(!t)return null;try{return JSON.parse(t)}catch{return null}}var Op=e=>JSON.stringify([Array.from(e.attributes,t=>[t.name,t.value]).filter(([t])=>t!==Pr),e.innerHTML]),B2=new Set(["style","preload","src",Pr,Zn,We,...xs]),U2=e=>e.split(/\\s+/).filter(t=>t&&!t.startsWith("__hf-")).join(" "),oT=e=>JSON.stringify([Array.from(e.attributes,({name:t,value:n})=>[t,t==="class"?U2(n):t==="poster"?Zy(e):n]).filter(([t,n])=>!B2.has(t)&&!((t==="class"||t==="poster")&&!n)).sort(([t],[n])=>t<n?-1:1),e.hasAttribute("data-var-src")?null:Wi(e),e.innerHTML]),Da=new WeakMap,aT=e=>e.localName==="video"||e.localName==="audio",Pu=e=>{if(!Ge(e))return;let t=aT(e)?[e]:e.firstElementChild?e.querySelectorAll("video, audio"):[];for(let n of t)Da.has(n)||Da.set(n,Op(n))},Iu=null;function sT(){typeof MutationObserver>"u"||!Ia(document)||(Pu(document.documentElement),Iu=new MutationObserver(e=>{for(let t of e){t.addedNodes.forEach(Pu);let{target:n}=t;Ge(n)&&aT(n)&&Da.set(n,Op(n))}}),Iu.observe(document.documentElement,{childList:!0,subtree:!0}))}function lT(){let e=o=>o?.config?.({force3D:!1}),t=Object.getOwnPropertyDescriptor(window,"gsap"),n=window.gsap;if(e(n),t?.configurable===!1||t?.get?.hfFlat)return;let r=Object.assign(()=>t?.get?t.get.call(window):n,{hfFlat:!0});Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get:r,set:o=>{t?.set?t.set.call(window,o):n=o,e(o)}})}var W2=new Map([["image",["href","xlink:href"]],["object",["data"]]]),V2=1e3,$2=16;function q2(){let e;return()=>e??(e=document.getAnimations())}var Dp=e=>vr(e)||Re(e)&&qs(e)&&yb({volume:Number.parseFloat(e.dataset.volume??""),fxChain:e.getAttribute("data-fx-chain"),automation:e.getAttribute("data-automation"),audioGroup:e.getAttribute("data-audio-group"),masterChain:Wb(e.ownerDocument)}),uT="audio[data-start], video[data-start]",z2=300;function j2(e){return zs()&&vr(e)&&!e.loop&&e.duration<=z2&&typeof St(e)=="number"&<(e)===1}var Pa=e=>Array.from(e.querySelectorAll(uT)).filter(Dp);function iT(e){let t=e.matches(`[${ys}]`)?[e]:Array.from(e.querySelectorAll(`img[${ys}]`)).filter(n=>n.closest("[data-start]")===e);for(let n of t)n.setAttribute("loading","eager")}function cT(){let e=dd(),t=window.parent!==window,n=u=>t&&u.hasAttribute(zt);Iu?.disconnect(),Iu=null,Ia(document)&&Pu(document.documentElement);let r=()=>{};my(we),Z_((u,p,g)=>{we({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:p,message:g instanceof Error?g.message:String(g)})}),eT((u,p)=>{try{r()}catch(g){we({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:p,message:g instanceof Error?g.message:String(g)});return}we({source:"hf-preview",type:"runtime-data-applied",channel:u,requestId:p})}),ha(document),eu(document),Vb(document),zv(document);let o=O2();e.canonicalFps=o.fps??H2()??e.canonicalFps;let i=o.fps??(window.__HF_REPLAY_SKIPPED_FRAMES?e.canonicalFps:void 0);if(Cb(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG){let u=JSON.stringify({canonicalFps:e.canonicalFps,source:o.source,rawFpsSource:o.rawFpsSource,rawFps:o.rawFps,fallbackReason:o.fallbackReason});globalThis.console.info(`[hyperframes] render runtime fps ${u}`)}let a=null,l=null,s=null,c=[],d=new Set,f=null,m=new Set,b=(u,p,g)=>{m.has(u)||(m.add(u),Rt(p,g))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(u){$("runtime.init.site1",u)}let h=new Cu;e.transportClock=h;let y=new ku,x=!1;y.init().then(u=>{x=u}),window.__hf=window.__hf||{};let E=u=>u.closest("[data-hidden]")!==null||nl(u.ownerDocument,u),v=()=>{let u=window.gsap,p=window;if(!(!u?.registerPlugin||p.__hfAutoNoopRegistered))try{u.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(g){b("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),$("runtime.autoMarker.install",g)}},T=()=>{let u=window.gsap;if(!u){b("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{z_(u)||b("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){b("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),$("runtime.customEase.install",p)}};v(),T(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Sy(document)}catch(u){$("runtime.init.cssVariables",u)}if(window.__timelines=window.__timelines||{},Array.isArray(window.__timelines)){let u=window.__timelines,p=Et()?.getAttribute("data-composition-id")??"root",g={};if(u.length===1)g[p]=u[0];else for(let S=0;S<u.length;S++)g[`tl-${S}`]=u[S];window.__timelines=g}let H=Et();H&&!H.hasAttribute("data-start")&&H.setAttribute("data-start","0");let U=u=>{c.push(u)},M=(u,p,g)=>{let S=g??`${u}:${JSON.stringify(p)}`;d.has(S)||(d.add(S),we({source:"hf-preview",type:"diagnostic",code:u,details:p}))},L=u=>{let p={scale:1,focusX:960,focusY:540},g=[],S=[],A={time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:u.play,pause:u.pause,seek:u.seek,getTime:u.getTime,getDuration:u.getDuration,isPlaying:u.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>g,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:u.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>S,getRenderState:()=>({...A,time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying()})}},G=.75,C=.05,B=100,O=240,Y=u=>{if(u instanceof Error)return u.message||String(u);if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u??"")}},Z=u=>{let p=u.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},J=u=>{let p=Cr(u);return p===null?null:`${p}px`},D=null,V=!1,R=()=>{if(!V)return Et();if(Xp(),Ke&&!ft&&D?.revision===nn&&(D.el===null||D.el.isConnected))return D.el;let u=Et();return D={revision:nn,el:u},u},k=()=>{let u=R();if(!u)return;let p=J(u.getAttribute("data-width")),g=J(u.getAttribute("data-height"));p&&(u.style.width=p),g&&(u.style.height=g),p&&u.style.setProperty("--comp-width",p),g&&u.style.setProperty("--comp-height",g),p&&(document.documentElement.style.width=p),g&&(document.documentElement.style.height=g),p&&(document.body.style.width=p),g&&(document.body.style.height=g)},F=()=>{let u=R(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(g=>g.hasAttribute("data-duration")||g.hasAttribute("data-end"));for(let g of p){if(u&&g===u)continue;let S=g.getAttribute("data-duration"),A=g.getAttribute("data-end");S!=null&&!g.hasAttribute(Pn)&&g.setAttribute(Pn,S),A!=null&&!g.hasAttribute(In)&&g.setAttribute(In,A),g.removeAttribute("data-duration"),g.removeAttribute("data-end")}},_=new WeakMap,N=u=>[u.className,u.style.position,u.style.top,u.style.left,u.style.width,u.style.height,u.style.transform,u.getAttribute("data-width"),u.getAttribute("data-height")].join("|"),j=()=>{let u=R();if(!u)return;u.style.position||(u.style.position="relative"),u.style.overflow="hidden";let p=J(u.getAttribute("data-width")),g=J(u.getAttribute("data-height"));p&&(u.style.width=p),g&&(u.style.height=g);let S=Array.from(u.children).filter(w=>{let P=w.tagName.toLowerCase();return P==="script"||P==="style"||P==="link"||P==="meta"||!w.hasAttribute("data-start")||w.hasAttribute(zt)?!1:_.get(w)!==N(w)}),A=S.filter(w=>w.style.getPropertyValue("display")==="none").map(w=>({el:w,priority:w.style.getPropertyPriority("display")}));for(let{el:w}of A)w.style.removeProperty("display");for(let w of S){let P=w.tagName.toLowerCase(),q=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",W=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(w.style.transform);if(q&&W&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let oe=w.style.top,se=w.style.left,me=w.style.width,Qe=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let Ye=window.getComputedStyle(w);Ye.top!=="auto"||Ye.bottom!=="auto"||Ye.left!=="auto"||Ye.right!=="auto"||Ye.width!=="0px"||Ye.height!=="0px"||(w.style.top=oe,w.style.left=se,w.style.width=me,w.style.height=Qe)}let I=window.getComputedStyle(w),X=I.position;if(X!=="absolute"&&X!=="fixed"&&(w.style.position="absolute"),P!=="audio"){let oe=J(w.getAttribute("data-width")),se=J(w.getAttribute("data-height")),me=I.width!=="0px"&&I.width!=="auto",Qe=I.height!=="0px"&&I.height!=="auto";oe?!w.style.width&&!me&&(w.style.width=oe):!w.style.width&&I.width==="0px"&&(w.style.width="100%"),se?!w.style.height&&!Qe&&(w.style.height=se):!w.style.height&&I.height==="0px"&&(w.style.height="100%")}}for(let{el:w,priority:P}of A)w.style.setProperty("display","none",P);if(document.readyState==="complete")for(let w of S)_.set(w,N(w))},ae=u=>ut({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:u}),de=null,ve=u=>{let p=de;de=ae(!0);try{return u()}finally{de=p}},z=u=>u&&de?de:ae(u),ee=(u,p=0,g)=>z(g?.includeAuthoredTimingAttrs??!0).resolveStartForElement(u,p),Q=(u,p)=>z(p?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(u),fe=u=>{let p=u.closest("[data-composition-id]"),g=p?ee(p,0):null,S=p?Q(p,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:p,inheritedStart:g,inheritedDuration:S}},ce=u=>z(!0).resolveHostSlotsForElement(u),xe=(u,p)=>{let g=Ue(u.dataset.duration),S=g!=null&&g>0?p+g:1/0;return Rr({start:p,end:S},ce(u))},re=u=>z(!0).resolveMediaStartForElement(u);window.__hfResolveMediaStartSeconds=re,c.push(()=>{window.__hfResolveMediaStartSeconds===re&&delete window.__hfResolveMediaStartSeconds});let ie=!!document.querySelector("[data-composition-src]"),ot=!1;{let u=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of u){let g=p.getAttribute("data-composition-id");if(g&&p.children.length===0&&document.querySelector(`template#${CSS.escape(g)}-template`)){ot=!0;break}}}let Be=!ie&&!ot,Ee=u=>{let p=dn(u);return p==null?null:Math.max(0,p)},Me=u=>typeof u=="number"&&Number.isFinite(u)&&u>mn,Pe=()=>Array.from(document.querySelectorAll("video[data-start], audio[data-start]")).length===0?null:ve(()=>tb(document,{mediaStart:re,mediaDuration:oo})),yt=()=>{let u=R();if(!u)return null;let p=window.__timelines??{},g=ut({timelineRegistry:p,includeAuthoredTimingAttrs:!0});return nb(u,g)},ur=()=>{let u=window;return!!(u.lottie||u.DotLottie)},An=()=>{let u=R();if(!u)return vi({authoredDurationSeconds:null,clipEndsSeconds:[]});let p=ut({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:!0});return rb(u,p,{unregisteredLottie:ur()})},$r=null,Vu=()=>{if(ft)return An();let u=zr();return $r?.revision!==u&&($r={revision:u,result:An()}),$r.result},$u=(u,p)=>{window.__hf=window.__hf||{},window.__hf.lengthSource=p?{from:"media",tag:p.tagName.toLowerCase(),src:p.getAttribute("src")??p.currentSrc??"",trimmed:p.hasAttribute("data-duration")||p.hasAttribute("data-end")}:{from:u}},Ga=u=>{window.__hf=window.__hf||{},window.__hf.durationSource={source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},u.source==="derived"&&M("composition_duration_derived",{source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},`composition_duration_derived:${u.seconds}`)},Ba=()=>{let u=Pe();return u&&qu(u.seconds)!==null?u:null},qu=u=>typeof u!="number"||!Number.isFinite(u)||u<=mn?null:u,Ua=u=>Me(u)?Math.max(mn,u*G):mn,qr=(u=!1)=>{let p=0;for(let g of e.deterministicAdapters){let S=u?g.getAnimationCycleEndSeconds:g.getInferredDurationSeconds;if(typeof S!="function")continue;let A=null;try{A=S()}catch(w){$("runtime.init.adapterDuration",w)}typeof A=="number"&&Number.isFinite(A)&&A>0&&(p=Math.max(p,A))}return p>mn?p:null},ft=!1,te=()=>ft&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,Ie=[...["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",Os,"data-playback-rate","data-automation","data-playback-start","data-media-start","id","src"],"data-width","data-height"],it=jv(Ie),mt=["loadedmetadata","durationchange","emptied"],Wt=null,wn=-1,jo=null,Ko=Number.NEGATIVE_INFINITY,Ke=null,nn=0,jp=new Map,Wa=u=>{if(!Ke||ft)return Array.from(document.querySelectorAll(u));it(Ke.takeRecords())&&Tn();let p=jp.get(u);if(p?.revision===nn)return p.nodes;let g=Array.from(document.querySelectorAll(u));return jp.set(u,{revision:nn,nodes:g}),g},_n=()=>{},Tn=()=>{nn+=1,_n()},Kp=()=>{let u=Ba();return{media:u?.seconds??null,mediaElement:u?.element??null,authoredComposition:yt()}},jT=()=>{let u=window.__timelines??{},p="";for(let g of Object.keys(u)){let S=u[g];S&&(p+=`${g}=${Ee(S)??"?"};`)}return p},Yp=u=>{let p=u.target;Ce(p)&&Ys(p)||Tn()},KT=(u,p)=>{let g=Ke?.takeRecords()??[];p();let S=Ke?.takeRecords()??[];(it(g)||it(S.filter(A=>A.target!==u)))&&Tn()},YT=u=>{let p=Ke?.takeRecords()??[];u(),Ke?.takeRecords(),it(p)&&Tn()},Xp=()=>{if(!(Ke||typeof MutationObserver>"u")){Ke=new MutationObserver(u=>{it(u)&&Tn()}),Ke.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ie});for(let u of mt)document.addEventListener(u,Yp,!0);c.push(()=>{Ke?.disconnect(),Ke=null,Tn();for(let u of mt)document.removeEventListener(u,Yp,!0)})}};V=!0;let zr=()=>{Xp(),Ke&&it(Ke.takeRecords())&&Tn();let u=Date.now();if(!h.isPlaying()||u-Ko>=Rp){Ko=u;let p=jT();p!==jo&&(jo=p,Tn())}return nn},Jp=u=>ft?Kp():(u??(u=zr()),Wt&&wn===u||(wn=u,Wt=Kp()),Wt),Xe=(u,p=0,g)=>{let S=null,A=null,w=ob({declared:Ue(R()?.getAttribute("data-duration")),timeline:()=>Ee(u),floors:()=>{let P=Jp(g),{media:q,authoredComposition:W}=P;return A=P.mediaElement,[q,W,qr()]},fallback:p,derived:()=>(S=Vu(),S.seconds??0)});return S?Ga(S):window.__hf?.durationSource&&delete window.__hf.durationSource,$u(w.from,w.floorIndex===0?A:null),w.seconds},zu=new WeakMap,Yo=u=>u.__hfReal??u,ju=null,Xo=new Set,Qp=()=>{for(let u of Xo)u===e.capturedTimeline||u===ju?.timeline||(Xo.delete(u),u.kill?.())},Ku=()=>{let u=window.__timelines??{},p=ge=>{let pe=Object.entries(u).filter(le=>!!le[1]&&typeof le[1].play=="function"&&typeof le[1].pause=="function");if(pe.length!==1)return{timeline:null};let K=pe[0];if(!K)return{timeline:null};let[ne,ue]=K;return{timeline:ue,selectedTimelineIds:[ne],selectedDurationSeconds:Ee(ue),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ge,soleTimelineId:ne}}}},g=ut({timelineRegistry:u,includeAuthoredTimingAttrs:!0}),{media:S,authoredComposition:A}=Jp(),w=Math.max(S??0,A??0)||null,P=Ua(w),q=ge=>{let pe=document.querySelector(`[data-composition-id="${CSS.escape(ge)}"]`);return pe?g.resolveStartForElement(pe,0):0},W=(ge,pe)=>{let K=q(pe.compositionId);ge.add(pe.timeline,K),zu.set(Yo(pe.timeline),{hostId:pe.compositionId,parent:ge,at:K})},I=(ge,pe)=>{let K=Yo(pe.timeline),ne=zu.get(K);return ne&&ne.parent===ge&&K.parent===Yo(ge)?ne:null},X=(ge,pe)=>Math.abs(ge.at-q(pe.compositionId))<1e-6,Se=(ge,pe)=>{let K=I(ge,pe);!K||X(K,pe)||W(ge,pe)},oe=ge=>{let pe=window.gsap;if(!pe||typeof pe.timeline!="function")return null;let K=pe.timeline({paused:!0});Xo.add(K);for(let ne of ge)W(K,ne);return wt(me(K,ge)),K},se=(ge,pe)=>{if(!Me(ge))return null;let K=window.gsap;if(!K||typeof K.timeline!="function")return null;let ne=K.timeline({paused:!0});if(Xo.add(ne),pe){try{ne.add(pe,0)}catch(le){$("runtime.init.site2",le)}wt(me(ne,[{timeline:pe}]))}let ue=ne;if(typeof ue.to=="function")try{ue.to({},{duration:ge,data:Ei})}catch(le){$("runtime.init.site3",le)}return ne},me=(ge,pe)=>{if(!ge||typeof ge.getChildren!="function")return[];try{let K=ge.getChildren(!0,!0,!0);return Array.isArray(K)?pe.filter(ne=>K.includes(Yo(ne.timeline))):[]}catch{return[]}},Qe=(ge,pe)=>{let K=ge,ne={addedIds:[],nested:[]};if(typeof K.getChildren!="function")return ne;try{let ue=K.getChildren(!0,!0,!0)??[];if(!Array.isArray(ue))return ne;let le=[];for(let Ae of pe){if(ue.includes(Yo(Ae.timeline))){Se(ge,Ae);continue}try{W(ge,Ae),le.push(Ae.compositionId)}catch(De){$("runtime.init.site4",De)}}return{addedIds:le,nested:me(ge,pe)}}catch{return ne}},Ye=R(),He=Ye?.getAttribute("data-composition-id")??null;if(!He)return p("root_missing_composition_id");let Ze=u[He]??null,$e=(()=>{if(!Ye)return[];let ge=new Set,pe=Array.from(Ye.querySelectorAll("[data-composition-id]")),K=[];for(let ne of pe){let ue=ne.getAttribute("data-composition-id");if(!ue||ue===He||ge.has(ue))continue;ge.add(ue);let le=u[ue]??null;if(!le||typeof le.play!="function"||typeof le.pause!="function")continue;let Ae=Ee(le);K.push({compositionId:ue,timeline:le,durationSeconds:Ae??0})}return K})(),wt=ge=>{for(let pe of ge){let K=pe.timeline;if(typeof K.paused=="function")try{K.paused(!1)}catch(ne){$("runtime.init.site5",ne)}}};if(Ze){let ge=$e.length>0?Qe(Ze,$e):{addedIds:[],nested:[]},pe=ge.addedIds;if(wt(ge.nested),($e.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+He+"\'])"))&&(cr=!0),pe.length>0)try{Ui(Ze,Ze.time(),!1)}catch{}D2(Ze);let K=Ee(Ze);if(!Me(K)&&$e.length>0){let le=$e.map(on=>on.compositionId),Ae=oe($e),De=Ee(Ae);if(Ae&&Me(De))return{timeline:Ae,selectedTimelineIds:le,selectedDurationSeconds:De,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:He,rootDurationSeconds:K,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:De,mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedTimelineIds:le,autoNestedChildren:pe}}};let st=se(w??0,Ze),ht=Ee(st);if(st&&Me(ht))return{timeline:st,selectedTimelineIds:[He],selectedDurationSeconds:ht,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:K,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:ht,selectedTimelineIds:[He],autoNestedChildren:pe}}}}if(!Me(K)&&$e.length===0){let le=se(w??0,Ze),Ae=Ee(le);if(le&&Me(Ae))return{timeline:le,selectedTimelineIds:[He],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:K,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:S,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:Ae,selectedTimelineIds:[He]}}}}let ne=Ue(Ye?.getAttribute("data-duration")),ue=Math.max(Me(ne)?ne:0,A??0);if(ue>0&&Me(ue)&&Me(K)&&ue>=K+.5){let le=Ze;if(typeof le.to=="function")try{le.to({},{duration:0,data:Ei},ue)}catch(De){$("runtime.init.site6",De)}let Ae=Ee(Ze);if(Me(Ae))return{timeline:Ze,selectedTimelineIds:[He],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:He,rootDurationSeconds:K,rootDeclaredDur:ne,authoredCompositionDurationFloorSeconds:A,newDur:Ae}}}}return{timeline:Ze,selectedTimelineIds:[He],selectedDurationSeconds:K,mediaDurationFloorSeconds:S,diagnostics:pe.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:He,selectedDurationSeconds:K,autoNestedChildren:pe}}:void 0}}if($e.length>0){let ge=$e.map(le=>le.compositionId),pe=ju,K=pe?.size===$e.length&&Me(Ee(pe.timeline))&&$e.every(le=>{let Ae=I(pe.timeline,le);return Ae!==null&&X(Ae,le)})?pe.timeline:null,ne=K??oe($e),ue=Ee(ne);if(ne)return K||(ju={timeline:ne,size:$e.length}),{timeline:ne,selectedTimelineIds:ge,selectedDurationSeconds:ue,mediaDurationFloorSeconds:S,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:He,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ue,mediaDurationFloorSeconds:S,selectedTimelineIds:ge}}}}return p("root_composition_id_unmatched_in_registry")},cr=!1,XT=u=>{let p=window.gsap,g=u;if(!(!g||typeof g.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let S of g.getChildren(!0,!0,!0)){let A=S,w=A.timeline;if(!w||!("_ease"in w)||typeof w._ease=="function")continue;let P=A.vars?.keyframes,W=(P&&!Array.isArray(P)?P.ease:void 0)??A.vars?.ease??"none";try{let I=p.parseEase(W);typeof I=="function"&&(w._ease=I)}catch(I){Rt("keyframe_ease_repair_failed",{ease:typeof W=="string"?W:String(W)}),$("runtime.keyframeEase.repair",I)}}},dr=()=>{if(T(),!Be)return!1;let u=e.capturedTimeline,p=Ee(u),g=Me(p);if(u&&g&&cr)return!1;let S=Ku();if(!S.timeline)return!1;if(u&&u===S.timeline)return typeof u.timeScale=="function"&&u.timeScale(e.playbackRate),!1;e.capturedTimeline=S.timeline,Qp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),XT(e.capturedTimeline);let A=Xe(e.capturedTimeline,0);if(A<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),En(e.capturedTimeline)),A>0){try{h.setDuration(A)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let q=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(q,!1),En(e.capturedTimeline)}let P=window.__hfStudioManualEditsApply;typeof P=="function"&&P(),ha(document)}if(S.diagnostics&&we({source:"hf-preview",type:"diagnostic",code:S.diagnostics.code,details:S.diagnostics.details}),we({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:S.selectedTimelineIds??[],selectedDurationSeconds:S.selectedDurationSeconds??null,mediaDurationFloorSeconds:S.mediaDurationFloorSeconds??null}}),t){let P=R(),q=A>0?A:0,W=String(q>0?q:1),I=new Set,X=se=>se.tagName.toLowerCase()===pn,Se=new Set(document.querySelectorAll("[data-start]")),oe=se=>{let me=se.parentElement;for(;me&&me!==P;){if(Se.has(me))return!0;me=me.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let se of e.capturedTimeline.getChildren(!0))if(typeof se.targets=="function")for(let me of se.targets())Te(me)&&me!==P&&(X(me)||me.hasAttribute("data-start")||oe(me)||I.has(me)||(I.add(me),me.setAttribute("data-start","0"),me.setAttribute("data-duration",W),me.setAttribute(zt,"1")))}catch{}if(Te(P))for(let se of P.querySelectorAll("[id]"))Te(se)&&se!==P&&(se.hasAttribute("data-start")||oe(se)||I.has(se)||se.tagName==="SCRIPT"||se.tagName==="STYLE"||se.tagName==="LINK"||X(se)||(I.add(se),se.setAttribute("data-start","0"),se.setAttribute("data-duration",W),se.setAttribute(zt,"1")))}let w=Yu();for(let P of Cn)Jo.delete(P),Xu(P,w);return!0},Zp=()=>{if(e.tornDown)return;let u=Ku();if(!u.timeline){e.capturedTimeline=null,cr=!1,h.setDuration(Xe(null,0)),rn(e.currentTime);return}if(e.capturedTimeline!==u.timeline)cr=!1,dr();else{let p=Xe(e.capturedTimeline,0);p>0&&p!==h.getDuration()&&(h.setDuration(p),at())}rn(e.currentTime)};r=()=>{Zp(),at()},window.__hfForceTimelineRebind=Zp;let JT=()=>{let u=R();if(!Te(u))return;let p=u.getBoundingClientRect(),g=Cr(u.getAttribute("data-width")),S=Cr(u.getAttribute("data-height")),A=window.getComputedStyle(u),w=g!==null&&S!==null,P=p.width<=0||p.height<=0||u.clientWidth<=0||u.clientHeight<=0;!w||!P||M("root_stage_layout_zero",{compositionId:u.getAttribute("data-composition-id")??null,declaredWidth:g,declaredHeight:S,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:u.clientWidth,clientHeight:u.clientHeight,display:A.display,visibility:A.visibility,overflow:A.overflow},`root-stage-layout-zero:${u.getAttribute("data-composition-id")??"unknown"}`)},QT=()=>{e.tornDown||(f!=null&&window.cancelAnimationFrame(f),f=window.requestAnimationFrame(()=>{f=null,JT()}))},ZT=()=>{l=u=>{let p=Y(u.error??u.message).slice(0,O);if(!p)return;let g=Z(p);we({source:"hf-preview",type:"diagnostic",code:g.code,details:{category:g.category,message:p,filename:u.filename||null,line:Number.isFinite(u.lineno)?u.lineno:null,column:Number.isFinite(u.colno)?u.colno:null}})},s=u=>{let p=Y(u.reason).slice(0,O);if(!p)return;let g=Z(p);we({source:"hf-preview",type:"diagnostic",code:`${g.code}_unhandled_rejection`,details:{category:`${g.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",l),window.addEventListener("unhandledrejection",s)},eh=new WeakSet,eC=()=>{let u=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let g of u){if(eh.has(g))continue;eh.add(g);let S=()=>{if(!Ge(g))return;let A=g.tagName.toLowerCase(),w=g.getAttribute("src")??g.getAttribute("href")??g.getAttribute("poster")??null,P=A==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";M(P,{tagName:A,assetUrl:w,currentSrc:(et(g)||Ce(g))&&g.currentSrc||null,readyState:Ce(g)?g.readyState:null,networkState:Ce(g)?g.networkState:null},`${P}:${A}:${w??"unknown"}`)};g.addEventListener("error",S),U(()=>{g.removeEventListener("error",S)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let g=Array.from(p).filter(S=>S.status==="error").map(S=>S.family).filter(S=>!!S).slice(0,10);g.length!==0&&M("runtime_font_load_issue",{failedFamilies:g,totalFaces:Array.from(p).length},`runtime-font-load-issue:${g.join("|")}`)}).catch(()=>{})},tC=(u,p)=>{if(!u.timeline)return!1;let g=e.capturedTimeline;if(g&&g===u.timeline)return!1;let S=Math.max(0,e.currentTime||0);e.capturedTimeline=u.timeline,Qp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{En(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&Ui(e.capturedTimeline,S,!1)}catch(A){$("runtime.init.site7",A)}return we({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:S,selectedTimelineIds:u.selectedTimelineIds??[],selectedDurationSeconds:u.selectedDurationSeconds??null,mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),!0},fr=null,th=!1,Cn=new Set,Jo=new WeakMap,Yu=()=>{let u;return()=>u??(u=Cd(e.capturedTimeline??{}))},Va=()=>{e.tornDown||(fr!=null&&window.clearTimeout(fr),fr=window.setTimeout(()=>{if(e.tornDown||(fr=null,te()))return;let u=Ku();if(!u.timeline||!Me(u.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){dr()&&(at(),Je(!0));return}if(th)return;let g=Ee(e.capturedTimeline),S=u.selectedDurationSeconds??Ee(u.timeline);Me(S)&&(!Me(g)||S>=g+C)&&tC(u,"manual")&&(th=!0,we({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:g??null,selectedDurationSeconds:S??null,selectedTimelineIds:u.selectedTimelineIds??[],mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),at(),Je(!0))},B))},nh=u=>{Ce(u.currentTarget)&&Tx(u.currentTarget)},rh=u=>{let p=u.currentTarget;e.tornDown||h.isPlaying()||!Ce(p)||jn(p)||(Vt=null,e.mediaForceSyncNextTick=!0,xt())},oh=u=>{Ce(u.currentTarget)&&Cx(u.currentTarget)},ih=u=>{Dp(u)&&M_(u)&&$o(u,Vo(u))},ah=u=>{let p=u.currentTarget;Ce(p)&&ih(p)},sh=u=>{u.removeEventListener("loadedmetadata",Va),u.removeEventListener("durationchange",Va),u.removeEventListener("loadedmetadata",nh),u.removeEventListener("loadedmetadata",rh),u.removeEventListener("loadedmetadata",ah),u.removeEventListener("error",oh),Cn.delete(u)},nC=()=>{for(let u of Cn)sh(u)},lh=()=>{for(let u of Cn)u.isConnected||(sh(u),u.pause(),Ad(u),u.remove());y.releaseDetached()},uh=u=>{let p=Number.parseFloat(u.dataset.volume??"");return Number.isFinite(p)?Math.max(0,Math.min(1,p)):null},$a=()=>{if(e.tornDown)return;let u=Array.from(document.querySelectorAll("video, audio")),p=[],g=Yu();for(let S of u){if(Cn.has(S))continue;Cn.add(S);let A=uh(S);A!==null&&(S.volume=A),S.addEventListener("loadedmetadata",Va),S.addEventListener("durationchange",Va),S.addEventListener("loadedmetadata",ah),ih(S),S.addEventListener("loadedmetadata",nh),S.addEventListener("loadedmetadata",rh),S.addEventListener("error",oh),Sx(S),ec(S)?p.push(S):Ks(S),Xu(S,g)}p.length>0&&rn(e.currentTime,p)},Xu=(u,p)=>{Jo.has(u)||Db(u,e.capturedTimeline,Xe(e.capturedTimeline,0),Jo,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE,...p&&{movers:p}})},Ju=new WeakMap,rC=u=>{let p=Ju.get(u);if(p!==void 0)return p;let g=window.getComputedStyle(u).position,S=g==="static"||g==="relative"||g==="sticky";return Ju.set(u,S),S},Qu=new WeakMap,oC=u=>{let p=Qu.get(u);if(p!==void 0)return p;let g=u.querySelector("[data-start]")===null;return Qu.set(u,g),g},iC=()=>{Ju=new WeakMap,Qu=new WeakMap},jr=new WeakMap,ch=(u,p)=>{if(!jr.has(u)){let g=u.style.getPropertyValue("display"),S=u.style.getPropertyPriority("display"),A=p&&g==="none"&&!S;jr.set(u,A?{value:"",priority:""}:{value:g,priority:S})}u.style.display="none"},dh=u=>{let p=jr.get(u);p&&(jr.delete(u),p.value?u.style.setProperty("display",p.value,p.priority):u.style.removeProperty("display"))},qa=new WeakSet,za=!1,fh=u=>Ce(u)&&u.hasAttribute("data-start")&&(Dp(u)||y.routesElement(u)),mh=u=>fh(u)||Array.from(u.querySelectorAll(uT)).some(fh),ph=new WeakMap,aC=(u,p)=>{for(let g of Pa(document)){if(rl(g)!==u||y.routesElement(g)||E(g))continue;let S=re(g),A=Ue(g.dataset.duration),w=A!=null&&A>0?S+A:1/0;if(Number.isFinite(S)&&p<w)return!0}return!1},sC=u=>{let p=!1;for(let g of Wa(pn)){let S=g.hasAttribute("data-hidden"),A=ph.get(g);A!==S&&(ph.set(g,S),g.id&&(y.setGroupMuted(g.id,S),A&&!S&&aC(g.id,u)&&(p=!0)))}return p},hh=u=>{let p=Xe(e.capturedTimeline,0,u);return(g,S)=>Us(g,{currentTime:S,compositionDuration:p,canonicalFps:e.canonicalFps,exportRenderSeek:!!window.__HF_EXPORT_RENDER_SEEK_CONFIG,timelineRegistry:window.__timelines??{},resolver:z(!0)})},gh=(u,p,g,S)=>{for(let A=u;A&&A!==S;A=A.parentElement)if(Ar(A)&&A.hasAttribute("data-start")&&!n(A)&&!g(A,p))return!1;return!0},bh=()=>({canonicalFps:e.canonicalFps,parked:pb(),parkedClips:$s}),yh=Hc(),xh=Es(),lC=m0(u=>Bs(u,{timelineRegistry:window.__timelines??{},resolver:z(!0)})),ja=new Set,Sh=new WeakSet,Ka={revision:-1,starts:new Map},uC=(u,p)=>{Ka.revision!==p&&(Ka={revision:p,starts:new Map});let g=Ka.starts.get(u);return g===void 0&&(g=ee(u,Number.NaN),Ka.starts.set(u,g)),g},cC=(u,p)=>{if(ja.size===0||!h.isPlaying())return;let g=[];for(let w of ja){let P=uC(w,p);!(P<=u+Xa)&&w.isConnected&&w.hasAttribute(We)||(ja.delete(w),w.isConnected&&w.hasAttribute(We)&&P>u&&g.push(w))}if(g.length===0)return;let S=new Set(g.flatMap(w=>w.closest(`[${Ft}]`)??[]));for(let w of S)w.removeAttribute(Ft);let A=Oc(g);getComputedStyle(g[0]).visibility,A();for(let w of S)w.setAttribute(Ft,"");for(let w of g)Sh.add(w)},Ya=u=>!1,Xa=2,Ja=4,Zu=(u,p,g,S=Xa)=>{let A=Ce(u)?re(u):ee(u,Number.NaN),w=A+(Q(u)??Number.NaN);return A>g&&A<=g+S||w<=g&&w>=g-S||p(u,g+S)},Kr=null,ec=u=>xh&&u.hasAttribute("data-start")&&Ys(u),Yr=new WeakMap,tc=new WeakMap,Qo=new WeakSet,nc=new WeakSet,Eh=u=>Ab(u,()=>!e.tornDown&&Yr.get(u)===!0&&re(u)>h.now()),vh=u=>u.parentElement?.closest("[data-composition-id]"),Ah=3,Zo=new Set,ei=new Set,wh=["canplay","suspend","error"],_h=u=>{for(let p of wh)u.removeEventListener(p,Th);return Zo.delete(u)},Th=u=>{let p=u.currentTarget;u.type!=="error"&&p.readyState<3||(_h(p),Ch())},Ch=()=>{let u=Array.from(ei).filter(p=>p.isConnected).sort((p,g)=>re(p)-re(g));for(let p of u){if(Zo.size>=Ah)break;ei.delete(p),rn(e.currentTime,[p])}},Rh=u=>{if(Ks(u),Eh(u),!(Zo.has(u)||u.readyState>=3)){Zo.add(u);for(let p of wh)u.addEventListener(p,Th)}},dC=u=>{let p=co(u,Number.NaN),g=ni(Array.from(Cn).filter(w=>w.isConnected&&co(w,Number.NaN)===p&&vh(w)===vh(u))).mediaClips,S=g.find(w=>w.el===u)?.end??Number.NaN,A;for(let w of g)w.el!==u&&w.start>=S-Si(S)&&!(A&&A.start<=w.start)&&(A=w);!A||!ec(A.el)||(tc.set(A.el,u),Yr.get(A.el)!==!0&&(Yr.set(A.el,!0),ei.delete(A.el),Rh(A.el)))},fC=(u,p,g,S,A)=>{let w=h.isPlaying();p&&w?Qo.has(u)||(Qo.add(u),dC(u)):Qo.delete(u);let P=tc.get(u),q=P!==void 0&&Qo.has(P),W=Yr.get(u),I=!p&&!q&&W!==!0&&Zo.size>=Ah;I&&g?ei.add(u):ei.delete(u);let Se=!p&&!A&&w&&re(u)+(Q(u)??Number.NaN)<=S&&(W!==!0||u.networkState===2&&u.readyState<4),oe=p||q||g&&!I&&!Se;(p||!oe)&&_h(u)&&queueMicrotask(Ch);let se=oe&&!p&&re(u)>h.now(),me=nc.has(u);if(se?nc.add(u):nc.delete(u),W===oe){se&&!me&&Eh(u);return}Yr.set(u,oe),oe?(!p||W===void 0)&&(p?Ks(u):Rh(u)):u.preload!=="none"&&(u.preload="none",W&&KT(u,()=>wb(u,window.__HF_RELEASE_PASSED_MEDIA===!0)))},Mh=(u,p)=>Kr!==null&&h.isPlaying()&&(p(u,Kr)||Zu(u,p,Kr,Ja)),mC=(u,p,g)=>Yr.get(u)===!0&&Zu(u,p,g,Ja)||Mh(u,p),rc=new WeakMap,kh=new WeakSet,oc=new WeakSet,Lh=new WeakMap,Nh=u=>u.style.visibility==="hidden"&&u.style.getPropertyPriority("visibility")!=="important"&&!oc.has(u),ic=new WeakMap,ac=(u,p)=>{for(let g=u.parentElement;g&&g!==p;g=g.parentElement)if(g.hasAttribute("data-start")&&Ar(g)&&Nh(g))return!0;return!1},sc=new Map,Fh=-1,pC=Ja+Xa+1,hC=1,gC=(u,p,g)=>{let S=g(u);if(!S||!Number.isFinite(S.start))return null;let A=[];for(let w of[0,Xa,Ja])A.push(S.start-w,S.end-w,S.end+w);for(let w=u.parentElement;w&&w!==p;w=w.parentElement){if(!w.hasAttribute("data-start"))continue;let P=g(w);if(!P||!Number.isFinite(P.start))return null;A.push(P.start,P.end)}return A.filter(w=>Number.isFinite(w))},bC=(u,p,g,S)=>{if(!g||!(Math.abs(p-u)<=hC))return null;if(Fh!==S)return sc.clear(),Fh=S,null;let A={timelineRegistry:window.__timelines??{},resolver:z(!0)},w=W=>Bs(W,A),P=Math.min(u,p),q=Math.max(u,p);return W=>{let I=rc.get(W);if(I===void 0||Ce(W)&&(tc.has(W)||Qo.has(W))||!W.hasAttribute(zt)&&W.style.visibility!==(I?"visible":"hidden")||ac(W,g)!==(ic.get(W)??!1))return!1;let X=sc.get(W);if(X===void 0&&(X=gC(W,g,w),sc.set(W,X)),!X)return!1;for(let Se of X)if(Se>=P&&Se<=q||Kr!==null&&Math.abs(Se-Kr)<=pC)return!1;return!0}},yC=(u,p,g,S)=>{if(Ya(u))return;let A=R(),w=!1,P=hh(g),q=S===void 0||g===void 0?null:bC(S,u,A,g);for(let I of p){if(!Ar(I))continue;if(I.hasAttribute("data-hidden")){qa.has(I)||(qa.add(I),mh(I)&&(za=!0)),ch(I,!1),(Re(I)||et(I))&&a?.setSourceVisibility(I,!1);continue}if(qa.has(I)&&(dh(I),qa.delete(I),mh(I)&&(za=!0)),!I.hasAttribute("data-start")||q?.(I))continue;let Se=ac(I,A);ic.set(I,Se);let oe=P(I,u)&&gh(I.parentElement,u,P,A)&&!Se;rc.set(I,oe);let se=n(I);if(kh.has(I)||(kh.add(I),I.style.visibility==="hidden"&&oc.add(I)),!se&&!(oe&&Nh(I))){let Qe=I.style,Ye=Qe.getPropertyPriority("visibility")==="important";!oe&&!Ye&&!oc.has(I)&&Lh.set(I,Qe.getPropertyValue("visibility"));let He=oe?Ye&&Lh.get(I)||"visible":"hidden";Qe.setProperty("visibility",He,oe?"":"important")}I.toggleAttribute(We,!se&&!oe),!se&&!oe&&!Sh.has(I)&&ja.add(I);let me=(yh||xh)&&!oe&&Zu(I,P,u);me&&!I.hasAttribute(xr)&&iT(I),I.toggleAttribute(xr,me),Ce(I)&&Cn.has(I)&&ec(I)&&fC(I,oe,me||mC(I,P,u),u,Mh(I,P)),!Ce(I)&&!et(I)&&(w=!0),(Re(I)||et(I))&&a?.setSourceVisibility(I,oe),oe?dh(I):rC(I)&&oC(I)&&ch(I,!0)}w&&e0()&&a?.refresh(),lC(u);let W=sC(u);if((za||W)&&h.isPlaying()){y.stopAll();for(let I of Pa(document))E(I)&&(I.volume=0);Tc()}za=!1},xC=u=>{let p=R(),g=Wa("[data-start]").filter(S=>rc.has(S)&&ac(S,p)!==(ic.get(S)??!1));g.length>0&&rn(u,g)},rn=(u,p=Wa("[data-start], [data-hidden]"),g,S)=>ve(()=>yC(u,p,g,S)),SC=u=>ve(()=>{if(!yh)return[];let p=R(),g=hh();return Array.from(document.images).filter(S=>S.closest(`[data-start]:not([${zt}])[style*="visibility: hidden"]`)!==null&&(S.closest(Ss)!==null||!S.complete)&&gh(S,u,g,p))}),ti=null,Vt=null,mr=[],$t=[],Ph=u=>u.hasAttribute("data-start")||!!fe(u).compositionRoot,ni=u=>ty({elements:u,shouldIncludeElement:Ph,resolveStartSeconds:p=>re(p),resolveDurationSeconds:p=>{let g=fe(p),S=re(p),A=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-S):null,w=Number.isFinite(p.duration)?Kt(p,p.duration):null,P=Ue(p.dataset.duration),q=P!=null&&P>0?P:null;return ey({isVideo:p.tagName==="VIDEO",sourceDuration:w,hostRemaining:A,explicitDuration:q})},resolveHostSlots:ce}),Ih=(u=zr())=>{if(ti&&ti.revision===u)return ti;let p=ni().mediaClips;return ti={revision:u,clips:p,byStart:[...p].sort((g,S)=>g.start-S.start),byEnd:[...p].sort((g,S)=>g.end-S.end)},Vt=null,mr=[],ti},lc=(u,p,g,S)=>{let A=0,w=u.length;for(;A<w;){let q=A+w>>1;p(u[q])<g?A=q+1:w=q}let P=[];for(let q=A;q<u.length&&p(u[q])<=S;q+=1)P.push(u[q]);return P},EC=(u,p,g)=>{let S=Vt;if(S===null)return u.clips.map(W=>W.el);let A=2*Si(Math.max(Math.abs(S),Math.abs(p))),w=Math.min(S,p)-A,P=Math.max(S,p)+A,q=new Set;for(let W of mr)q.add(W.el);for(let W of lc(u.byStart,I=>I.start,w,P+g))q.add(W.el);for(let W of lc(u.byEnd,I=>I.end,w,P))q.add(W.el);if(e.isPlaying&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG)for(let W of lc(u.byStart,I=>I.start,p,p+$d*e.playbackRate))q.add(W.el);return[...q]},Qa=new WeakSet,Dh=u=>{Qa.add(u)},Oh=u=>{Qa.delete(u),_n()};window.__hf.leasePausedMedia=Dh,window.__hf.releasePausedMedia=Oh;let Hh=u=>e.nativeMediaSyncDisabled?null:e.isPlaying?u:u.filter(p=>!Qa.has(p.el));window.__hf.setLoopStart=u=>{Kr=u!=null&&Number.isFinite(u)&&u>=0?u:null};let vC=u=>{let p=zu.get(u)?.hostId,g=p?document.querySelector(`[data-composition-id="${CSS.escape(p)}"]`):null,S=g?Q(g):null;return g&&S?ee(g,0)+S:1/0},Gh=u=>{let p=0;for(let g of u){if(g.data===Ei)continue;let S=g.getChildren?g:g.timeline,A=Number(g.duration?.())/Number(S?.duration?.()),w=S?.getChildren?Gh(S.getChildren(!1,!0,!0))*(Number.isFinite(A)&&A>0?A:1):Number(g.duration?.())||0,P=Math.abs(Number(g.timeScale?.())||1),q=(Number(g.startTime?.())||0)+w/P;q>=uo||(p=Math.max(p,Math.min(q,vC(g))))}return p};window.__hf.animationEnd=()=>{let u=e.capturedTimeline,p=u?.getChildren?Gh(u.getChildren(!1,!0,!0)):Ee(u)??0,g=Math.max(p,qr(!0)??0);return g>0&&g<uo?g:null},window.__hf.audioMeter={start:()=>y.startMetering(),stop:()=>y.stopMetering(),read:()=>y.readLevels()};let AC=()=>{for(let u of document.querySelectorAll("video, audio"))if(Ce(u)&&!u.paused&&Ph(u)&&!Qa.has(u))return!0;return!1},Bh=()=>_n();document.addEventListener("play",Bh,!0),c.push(()=>{document.removeEventListener("play",Bh,!0)}),c.push(__(document));let uc=null,xt=u=>{let p=!ft,g=e.isPlaying&&!e.mediaForceSyncNextTick&&Vt!==null?Math.min(Math.max(0,e.currentTime-Vt),bt*Math.min(1,e.playbackRate)):0,S=ve(()=>{if(!p)return ni().mediaClips;let q=Ih(u);return ni(EC(q,e.currentTime,g)).mediaClips});for(let q of S){let W=Jo.get(q.el);W&&(q.volumeKeyframes=W)}let A=Hh(S),w=e.mediaForceSyncNextTick;w&&(e.mediaForceSyncNextTick=!1),A&&(iy({clips:A,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:w,cueAheadSeconds:g,clockAdvancing:h.getSource()!=="audio"||Vt===null||e.currentTime>Vt,getCompositionDuration:()=>Xe(e.capturedTimeline,0,u),onElementVolume:(q,W,I,X,Se)=>y.setElementVolume(q,I,X,Se),isWebAudioOwned:q=>y.ownsElement(q),isWebAudioRouted:q=>y.routesElement(q),seekUnderDip:(q,W)=>y.seekUnderDip(q,W),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,we({source:"hf-preview",type:"media-autoplay-blocked"}))}}),p?(Vt=e.currentTime,mr=S.filter(q=>fn(e.currentTime,q.start-bt,q.end))):(Vt=null,mr=[]));let P=p&&e.isPlaying&&!w&&uc!==null?uc:void 0;rn(e.currentTime,void 0,u,P),uc=e.currentTime},Je=u=>{u&&_n(),u&&dc&&!h.isPlaying()&&at();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),g=Date.now();(u||p!==e.bridgeLastPostedFrame||(e.isPlaying||$t.length>0)!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||g-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying||$t.length>0,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=g,we({source:"hf-preview",type:"state",frame:p,currentTime:e.currentTime||0,ended:h.reachedEnd(),isPlaying:e.bridgeLastPostedPlaying,buffering:$t.length>0,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},cc="",Uh=!1,Wh=!1,Vh=0,$h="",wC=()=>{let u="";for(let p of document.querySelectorAll("[data-start]"))u+=`${p.id}:${p.tagName}|`;return u},dc=!1,Za=!1,fc=!1,_C=()=>{fc||(fc=!0,zb().then(()=>window.requestAnimationFrame(()=>setTimeout(()=>{fc=!1,Za=!1,e.tornDown||at()}))))},at=()=>{F(),k(),j();let u=R();if(u){let{width:S,height:A}=eb(u);S!==null&&A!==null&&we({source:"hf-preview",type:"stage-size",width:S,height:A})}if(dr(),dc=h.isPlaying(),dc){delete window.__clipTree;return}if(Za&&!ft&&jb())return _C();Za=!1;let p=pd(bh());window.__clipManifest=p,$h=JSON.stringify(p);let g=wC();if(cc!==g&&iC(),!window.__clipTree||cc!==g){let S=window;window.__clipTree=B0({startResolver:ut({timelineRegistry:S.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:S.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),cc=g}we({...p,assetsReady:Wh}),Uh||(Uh=!0,K_(document,({timedOut:S})=>{e.tornDown||(Wh=!0,we({source:"hf-preview",type:"assets-ready",timedOut:S}))})),QT()},TC=()=>{JSON.stringify(pd(bh()))!==$h&&at()},mc=u=>typeof u=="number"&&Number.isFinite(u)&&u>0?u:0,CC=u=>{let p=mc(Number(u));if(p<=0)return;let g=R(),S=mc(Ue(g?.getAttribute("data-duration"))),A=Math.max(Vh,mc(h.getDuration()),S);p<=A||(Vh=p,g?.setAttribute("data-duration",String(p)),h.setDuration(p),at(),Je(!0))},pt=(u,p=0,g)=>{for(let S of e.deterministicAdapters){try{u==="discover"&&S.discover(),u==="pause"&&S.pause({pageAnimations:g}),u==="play"&&S.play&&S.play()}catch(A){$("runtime.init.site8",A)}if(u==="discover")try{S.seek({time:p,suppressEvents:!0})}catch(A){$("runtime.init.site9",A)}}},pr=()=>{window.__renderReady=!1},RC=rT(()=>{let u=[];for(let p of e.deterministicAdapters){let g=p.getReadyPromise;if(typeof g=="function")try{let S=g();S&&u.push(S)}catch(S){$("runtime.init.adapterReady",S)}}return u},()=>pr(),u=>$("runtime.init.adapterReady",u)),MC=rT(()=>{let u=window.__hf?.buildReady;return u?Object.values(u).filter(p=>p!=null&&typeof p.then=="function"):[]},()=>pr(),u=>$("runtime.init.buildReady",u));function pc(){let u=R();u&&r_({root:u,fps:e.canonicalFps,durationSeconds:()=>Xe(e.capturedTimeline,0)||Number(u.getAttribute("data-duration"))||0,timeline:()=>e.capturedTimeline,now:()=>Math.max(0,e.currentTime||0),seek:(p,g)=>{Ac(e.capturedTimeline,p,{suppressEvents:g})},holdFrame:()=>{let p=Ly({scenes:vc().map(([,g])=>g),root:e.capturedTimeline,structureOf:Ec});return g=>p(()=>Ac(e.capturedTimeline,g,{suppressEvents:!0}))},ignoreMutations:YT})}let kC=()=>{$a(),eC();let u=vm();return eu(document),bu(document.body,e.canonicalFps),pc(),u};if(Be)vm();else{let u={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:J,onDiagnostic:({code:p,details:g})=>{we({source:"hf-preview",type:"diagnostic",code:p,details:g})}};Fv(u).finally(()=>{Be=!0,kC(),pr()})}let qh=u=>{let p=new Set,g=S=>{for(let A of(S??"").matchAll(/url\\(\\s*([\'"]?)(.*?)\\1\\s*\\)|@import\\s+([\'"])(.*?)\\3/gi))p.add(A[2]??A[4]);for(let A of(S??"").matchAll(/image-set\\((?:[^()]|\\([^()]*\\))*\\)/gi))for(let w of A[0].matchAll(/([\'"])(.*?)\\1/g))p.add(w[2])};for(let S of u)if(S.tagName==="STYLE"&&g(S.textContent),!(S.tagName==="STYLE"||S.tagName==="SCRIPT"))for(let A of[S,...S.querySelectorAll("*")]){let w=W2.get(A.localName)??[],P=[yv(A),...[...w,"poster","srcset"].map(q=>A.getAttribute(q))];for(let q of P)q&&p.add(q);g(A.getAttribute("style"))}return p},hc=0,LC=(u,p,g)=>{let S=new Map;for(let A of g?u.querySelectorAll("video, audio"):[]){let w=Da.get(A);if(!w||a?.isGraded(A))continue;let{srcObject:P,sinkId:q,mediaKeys:W}=A;P||q||W||S.set(w,[...S.get(w)??[],A])}for(let A of p.querySelectorAll("video, audio")){let w=Op(A),P=S.get(w)?.shift();if(!P||oT(P)!==oT(A)){Da.set(A,w);continue}A.replaceWith(P),window.gsap?.set?.(P,{clearProps:"all"});let q=A.getAttribute("style");q===null?P.removeAttribute("style"):P.setAttribute("style",q),Vv(P);let W=P;W.volume=uh(W)??1,W.muted=e.bridgeMuted||e.mediaOutputMuted||W.defaultMuted,W.defaultPlaybackRate=1,W.playbackRate=e.playbackRate,W.preservesPitch=!0}},es=u=>[u,...u.querySelectorAll("[data-composition-id]")].flatMap(p=>p.getAttribute("data-composition-id")||[]),zh=u=>{let p=new Set([e.capturedTimeline,window.gsap?.globalTimeline,...Xo]);for(let[g,S]of Object.entries(window.__timelines??{}))u.includes(g)||p.add(S);return p},gc=(u,p)=>{let g=zh(p);return(u.getChildren?u.getChildren(!0,!0,!1):[u]).flatMap(A=>(A.targets?.()??[]).filter(w=>typeof w?.totalTime=="function"&&typeof w.kill=="function"&&!g.has(w)))},NC=(u,p,g,S)=>{let A=es(p),w=new Set(A.flatMap(W=>[g[W],...S[W]??[]]));for(let W of w)if(W)for(let I of gc(W,A))w.add(I);let P=new Set([p,...p.querySelectorAll("*")]);for(let W of window.gsap?.globalTimeline?.getChildren?.(!0,!0,!1)??[]){if(!W.targets?.().some(X=>P.has(X)))continue;let I=W;for(;I&&!w.has(I);)I=I.parent;if(!I)throw new Error(`scene ${u} cannot be swapped: an animation outside it moves its elements`)}let q=W=>typeof W?.nodeType=="number"&&!P.has(W);for(let W of w)for(let I of W?[W,...W.getChildren?.(!0,!0,!1)??[]]:[])if(I.targets?.().some(q))throw new Error(`scene ${u} cannot be swapped: its animations write outside the scene`)},jh=async(u,p)=>{let g=window.gsap?.globalTimeline,S=new Set(g?.getChildren?.(!1,!0,!0));await nu(p);let A=window.__hfSceneAnimations,w=u.length===1?es(u[0])[0]:void 0;if(!A||!w||!g?.getChildren)return;await ma(),await new Promise(W=>window.setTimeout(W,0));let P=new Set([...Object.values(A).flat(),...zh([w])]),q=g.getChildren(!1,!0,!0).filter(W=>!S.has(W)&&!P.has(W));(A[w]??(A[w]=[])).push(...q)},Kh=(u,p=()=>{})=>{let g=()=>window.__timelines??(window.__timelines={}),S=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),A=e.capturedTimeline,w=u.flatMap(X=>es(X)),P=new Set,q=X=>{if(!X||P.has(X))return;P.add(X);let Se=X;Se.revert?Se.revert():Se.totalTime?.(0,!0),A?.remove?.(X),Se.revert||Se.kill?.()},W=()=>{let X=P.size,Se=w.flatMap(se=>[...(S()[se]??[]).slice().reverse(),g()[se]]),oe=new Set;for(let se of Se)se&&gc(se,w).forEach(me=>oe.add(me));for(let se of oe)gc(se,w).forEach(me=>oe.add(me));for(let se of[...Se.filter(me=>!oe.has(me)),...oe])q(se);return P.size>X},I=0;for(;W();)if(++I>8)throw new Error("the old scene keeps starting animations as they stop");p();for(let X of w)delete g()[X],delete S()[X]},FC=u=>{let p=kn(e.currentTime);pt("pause",0,p),pt("play"),x&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Cc(u.flatMap(Pa),y.currentGeneration())},Yh=(u,p,g,S=!1)=>{for(let W of u)eu(document,W);$a();let A=()=>{for(let W of p)for(let I of[W,...W.querySelectorAll("[data-composition-id]")]){let X=I.getAttribute("data-composition-id");X&&window.__timelines?.[X]?.totalTime?.(0,!0)}};bu(document.body,e.canonicalFps),pc(),Am(g,p,A),lh(),cr=!1,dr();let w=Yu();for(let W of u)for(let I of W.querySelectorAll("video, audio"))Jo.delete(I),Xu(I,w);let P=Xe(e.capturedTimeline,0);P>0&&h.setDuration(P),pt("discover",e.currentTime),ha(document);let q=h.isPlaying()&&P>0&&e.currentTime>=P;S&&h.isPlaying()&&!q?FC(u):ri.seek(q?P:e.currentTime,{keepPlaying:!q}),rn(e.currentTime),at()},Xh=u=>{let p=P=>Array.from(P.querySelectorAll(`style[${$c}]`)),g=p(document),S=new Set(g.flatMap(P=>qc(P.textContent??""))),A=new Set(p(u).flatMap(P=>qc(P.textContent??"")).filter(P=>!S.has(P)));if(A.size===0)return;let w=document.createElement("style");w.setAttribute($c,""),w.textContent=[...A].join(`\n`),g.length>0?g.at(-1).after(w):document.head.prepend(w)},PC=async(u,p)=>{let g=hc,S=new DOMParser().parseFromString(u,"text/html"),A=Ia(document),w=Ia(S);if(!A||!w)throw new Error("no scene manifest");if(A.shared!==w.shared)throw new Error("the film changed outside its scenes");let P=Object.keys(w.scenes);if(P.length!==Object.keys(A.scenes).length||P.some(K=>!(K in A.scenes)))throw new Error("scenes were added or removed");let q=P.filter(K=>w.scenes[K]!==A.scenes[K]);if(q.length===0)throw new Error("no scene changed");let W=(K,ne)=>Array.from(K.querySelectorAll(`[${gt}="${CSS.escape(ne)}"]`)),I=K=>{let ne=fo(K);return ne!==null&&Un(ne)},X=K=>K.filter(ne=>ne.tagName==="STYLE"),Se=q.filter(I).map(K=>{let ne=W(S,K),ue=ne.find(De=>De.tagName!=="STYLE"&&De.tagName!=="SCRIPT");if(!ue)throw new Error(`scene ${K} cannot be swapped: it has no single host`);let le=ue.getAttribute(Fn);if(le!==null)throw new Error(`scene ${K} cannot be swapped: ${le}`);if(!gd(ue))throw new Error(`scene ${K} cannot be swapped: a clip\'s length is not written`);if(!bd(ue))throw new Error(`scene ${K} cannot be swapped: its start or length is not in seconds`);let Ae=X(W(document,K));if(Ae.length!==X(ne).length)throw new Error(`scene ${K} cannot be swapped: its styles moved`);return{name:K,parts:ne,host:ue,oldStyles:Ae}});Se.length>0&&Xh(S);for(let{name:K,parts:ne,host:ue,oldStyles:le}of Se){let Ae=X(ne);le.forEach((De,st)=>De.replaceWith(document.importNode(Ae[st],!0))),xd(K,ue,ne.filter(De=>De.tagName==="SCRIPT"))}let oe=q.filter(K=>!I(K));if(oe.length===0){document.querySelector(`meta[name="${Nn}"]`)?.setAttribute("content",JSON.stringify(w)),Lt=Ws(),at();return}let se=oe.map(K=>{let ne=eo=>eo.tagName!=="STYLE"&&eo.tagName!=="SCRIPT",ue=W(document,K),le=W(S,K),Ae=ue.filter(ne),De=le.filter(ne),st=Ae[0],ht=De[0];if(!st||!ht||Ae.length>1||De.length>1)throw new Error(`scene ${K} cannot be swapped: it has no single host`);if(st.hasAttribute("data-hf-original-composition-id"))throw new Error(`scene ${K} cannot be swapped: it is a duplicated instance`);let on=st.getAttribute(Fn)??ht.getAttribute(Fn);if(on!==null)throw new Error(`scene ${K} cannot be swapped: ${on}`);let iR=qh(ue);if([...qh(le)].some(eo=>!iR.has(eo)))throw new Error(`scene ${K} cannot be swapped: it loads media this scene has not loaded`);if(X(ue).length!==X(le).length)throw new Error(`scene ${K} cannot be swapped: its styles moved`);return{name:K,oldParts:ue,homes:ue.map(eo=>eo.parentNode),newParts:le,oldHost:st,newHost:ht}}),me=()=>{let K=R(),ne=new Set;for(let ue of document.querySelectorAll(`[${gt}]`)){if(ue.tagName==="STYLE"||ue.tagName==="SCRIPT")continue;let le=ue.parentElement;for(;le;le=le===K?null:le.parentElement)ne.add(le)}return[...ne].flatMap(ue=>[ue,...Array.from(ue.children).filter(le=>!le.hasAttribute("data-hf-ignore")),null])},Qe=me(),Ye=se.some(({newHost:K})=>K.querySelector(".caption-group"))?await Em():[];if(e.tornDown)throw new Error("the preview was torn down during the swap");if(p?.aborted)throw new Error("the swap was cancelled");if(g!==hc)throw new Error("the preview changed while this swap waited");let He=()=>{let K=({oldParts:le,homes:Ae})=>le.some((De,st)=>!De.isConnected||De.parentNode!==Ae[st]),ne=me();if(ne.length!==Qe.length||ne.some((le,Ae)=>le!==Qe[Ae])||se.some(K))throw new Error("a scene changed while this swap waited")};He();let Ze=()=>window.__timelines??(window.__timelines={}),fs=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),$e=()=>{for(let{name:K,oldHost:ne}of se)NC(K,ne,Ze(),fs())};$e(),hc+=1;let wt=[],ge=[];Kh(se.map(({oldHost:K})=>K),()=>{He(),$e()}),y.stopAll(),h.detachAudioSource();for(let{oldParts:K,newParts:ne,oldHost:ue,newHost:le}of se){let Ae=X(ne);X(K).forEach((ht,on)=>ht.replaceWith(document.importNode(Ae[on],!0)));for(let ht of K)ht!==ue&&ht.remove();let De=document.importNode(le,!0),st=ht=>JSON.stringify(ht.flatMap(on=>on.tagName==="SCRIPT"?on.textContent:[]));LC(ue,De,st(K)===st(ne)),ue.replaceWith(De),ge.push(De),De.querySelector(".caption-group")&&wt.push(De)}Xh(S),yr();let pe=se.flatMap(({newParts:K})=>K.filter(ne=>ne.tagName==="SCRIPT").map(ne=>document.body.appendChild(document.importNode(ne,!0))));if(await jh(ge,pe),e.tornDown)throw new Error("the preview was torn down during the swap");document.querySelector(`meta[name="${Nn}"]`)?.setAttribute("content",JSON.stringify(w));for(let{name:K,newParts:ne,newHost:ue}of se)xd(K,ue,ne.filter(le=>le.tagName==="SCRIPT"));Yh(ge,wt,Ye),Lt=Ws()},Lt=Ws(),Xr=new Set(Array.from(document.querySelectorAll(`[${Ln}]`),u=>u.getAttribute(gt))),hr=null,ts="",bc=()=>new Promise(u=>window.setTimeout(u,0)),Jh=(u,p)=>{let g=jr.get(u);g&&jr.set(p,g)},Qh=async u=>{let p=db(u);if(!p)return;let{host:g,placeholder:S,scripts:A}=p;Jh(S,g),Pu(g),yr();let w=g.querySelector(".caption-group")?[g]:[],P=w.length>0?await Em():[];await bc(),await jh([g],A.map(q=>document.body.appendChild(q))),await bc(),Xr.delete(u),e.tornDown||Yh([g],w,P,!0)},IC=u=>{let p=es(u),g=new Set(p.flatMap(S=>window.__hfSceneAnimations?.[S]??[]));return Object.entries(window.__timelines??{}).find(([S,A])=>g.has(A)&&!p.includes(S))?.[0]},DC=u=>{let p=fo(u);if(!p||Un(p)||p.hasAttribute(Fn))return;let g=IC(p);if(g!==void 0){p.setAttribute(Fn,`its script registers a timeline as ${g}`);return}Kh([p]);let S=yd(u);S&&Jh(p,S),Xr.add(u),lh(),y.releaseDecodedExcept(Pa(document)),cr=!1,dr(),at()},yc=new Map,ns=new Set;Ya=u=>{if(Lt.length===0||e.tornDown)return!1;let p=X=>Xr.has(X),g=Lt.find(({name:X,start:Se,end:oe})=>Se<=u&&u<=oe&&p(X));if(hr)return g&&tt(hr.then(()=>hr),"scene-window"),g!==void 0;let S=Vs(Lt,u,h.isPlaying());for(let X of ns)S.add(X);let A=[...S].join(`\n`);if(A===ts)return g!==void 0;let w=Lt.filter(({name:X})=>S.has(X)&&p(X)).sort((X,Se)=>Math.abs(X.start-u)-Math.abs(Se.start-u))[0],P=g??w,q=P?[]:Lt.filter(({name:X})=>!S.has(X)&&!p(X));if(!P&&q.length===0)return ts=A,!1;let W=X=>ns.has(X)||Vs(Lt,e.currentTime,h.isPlaying()).has(X),I=Xr.size;return hr=(async()=>{if(g)await Qh(g.name);else if(P)await bc(),W(P.name)&&await Qh(P.name);else for(let{name:X}of q)DC(X)})().finally(()=>{hr=null,ts=Xr.size===I?A:"",Ya(e.currentTime)}),g&&tt(hr,"scene-window"),g!==void 0};let OC=async(u,p="studio")=>{let g=new Set(u.filter(S=>Lt.some(A=>A.name===S)));g.size?yc.set(p,g):yc.delete(p),ns=new Set([...yc.values()].flatMap(S=>[...S])),ts="";for(let S=0;S<=Lt.length&&!e.tornDown;S++){if(Ya(e.currentTime),![...ns].some(A=>Xr.has(A)))return;await(hr??Promise.resolve())}};Ia(document)&&(window.__hfSwapScenes=PC,window.__hfHoldScenes=OC,window.__hfParkedSceneMarkup=Sd,U(()=>{delete window.__hfSwapScenes,delete window.__hfHoldScenes,delete window.__hfParkedSceneMarkup}));let rs=dS({postMessage:u=>we(u)});rs.installPickerApi(),rn(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let qt=FA({lease:Dh,release:Oh});a=qt,U(()=>{qt.destroy(),a=null}),bu(document.body,e.canonicalFps),pc();let xc=u=>{let p=Number(u);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate)},HC=1e3,Rn=null,Zh=()=>{let u=Rn;Rn=null,u?.apply()},eg=(u,p)=>{y.stopAll(),h.detachAudioSource();let g=h.isPlaying();g&&h.pause(),h.seek(u),e.currentTime=h.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let S=p?.keepPlaying&&g;Za=!S,S||xt();let A=e.capturedTimeline;En(A);let w=kn(e.currentTime);if(S||xC(e.currentTime),pt("pause",0,w),S){ri.play();return}qt.redraw(),Km(e.currentTime);let P=Ho(e.currentTime);P&&tt(P,"motion-blur"),Je(!0)},tg=()=>{y.stopAll(),h.detachAudioSource(),h.pause(),e.isPlaying=!1,e.currentTime=h.now(),e.mediaForceSyncNextTick=!0,Cg(e.currentTime);let u=e.capturedTimeline;En(u),pt("pause"),xt(),qt.redraw(),Ho(e.currentTime),Je(!0)},ri={play:()=>{Zh(),$t=[];let u=e.capturedTimeline;if(h.isPlaying())return;let p=Xe(u,0);if(p>0&&(h.setDuration(p),h.reachedEnd())){let g=h.getPlayStart();h.seek(g),e.currentTime=g,kn(g)}En(u),h.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Cg(h.now()),x&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Tc(),pt("play"),xt(),ny(Ih().clips.map(g=>g.el)),qt.redraw(),Je(!0))},pause:()=>{let u=$t.length>0;$t=[],h.isPlaying()?tg():u&&Je(!0)},seek:(u,p)=>{let g=sd(Math.max(0,Number(u)||0),e.canonicalFps);Rn=null;let S=h.isPlaying()?[]:SC(g);if(S.length===0){eg(g,p);return}let A={time:g,apply:()=>eg(g,p)};Rn=A;for(let I of S){iT(I);for(let X=I.closest(Ss);X;X=I.closest(Ss))X.setAttribute(xr,"")}let w=0,P=new Promise(I=>{w=window.setTimeout(()=>{Rn===A&&$("runtime.init.seekHoldCap",S),I()},HC)}),q=Promise.all(S.map(I=>I.decode?I.decode().catch(()=>{}):void 0)),W=Promise.race([q,P]).then(()=>{window.clearTimeout(w),Rn===A&&Zh()});return tt(W,"image-decode"),W},renderSeek:(u,p)=>{Rn=null,ft=!0;let g=Ll(Math.max(0,Number(u)||0),e.canonicalFps,p);y.stopAll(),h.detachAudioSource(),h.isPlaying()&&h.pause(),h.seek(g),e.currentTime=h.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let S=kn(e.currentTime,{suppressEvents:p?.suppressEvents});pt("pause",0,S),xt(),qt.redraw(),Km(e.currentTime,{engineMode:!0});let A=Ho(e.currentTime,{engineMode:!0});A&&tt(A,"motion-blur"),Je(!0)},getTime:()=>Rn?.time??h.now(),getDuration:()=>{let u=h.getDuration();return Number.isFinite(u)?u:0},isPlaying:()=>h.isPlaying(),setPlaybackRate:u=>{xc(u),h.setRate(e.playbackRate),Mg()},getPlaybackRate:()=>e.playbackRate},ng=Xe(e.capturedTimeline,0);ng>0&&h.setDuration(ng);let gr=mS({getTimeline:()=>e.capturedTimeline,setTimeline:u=>{e.capturedTimeline=u},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:u=>{e.isPlaying!==u&&(e.mediaForceSyncNextTick=!0),e.isPlaying=u},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:xc,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(u,p)=>{e.currentTime=Math.max(0,Number(u)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,xt()},onStatePost:Je,onDeterministicSeek:(u,p)=>{for(let g of e.deterministicAdapters)if(!(g.name==="gsap"&&e.capturedTimeline))try{g.seek({time:Number(u)||0,suppressEvents:p?.suppressEvents})}catch(S){$("runtime.init.site11",S)}},onDeterministicPause:()=>pt("pause"),onDeterministicPlay:()=>pt("play"),onRenderFrameSeek:()=>{qt.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>Xe(e.capturedTimeline,0),transport:ri});window.__player=L(gr),window.__playerReady=!0,Rt("composition_loaded",{duration:gr.getDuration(),compositionId:Et()?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Ky({start:u=>ee(u,0),duration:u=>Q(u),compositionDuration:()=>Xe(e.capturedTimeline,0),canonicalFps:()=>e.canonicalFps,exportRenderSeek:()=>!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}),Qy(),vy({resolveStartSeconds:u=>ee(u,0)}),Py(),Hy({resolveStartSeconds:u=>ee(u,0)}),Gy(),By(),Uy(),Wy(),Vy(),$y(),qy(),Fy({getTimeline:()=>e.capturedTimeline})],Xy(),Jy(),window.__hfReseekGpu=u=>{let p=Math.max(0,Number(u)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,il(p)};let rg=u=>(a_(),Kb(u));window.__hfWaitForSeekCompletion=rg,c.push(()=>{window.__hfWaitForSeekCompletion===rg&&delete window.__hfWaitForSeekCompletion}),ZT(),$a(),pt("discover");let GC=()=>{dr();let u=Xe(e.capturedTimeline,0);if(u>0&&h.setDuration(u),pt("discover",e.currentTime),!e.capturedTimeline){let p=window.__timelines??{},g=Object.keys(p).filter(S=>p[S]);if(g.length>0){let A=R()?.getAttribute("data-composition-id")??null;M("root_timeline_unbound_registry_present",{reason:A?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:A,registeredTimelineKeys:g},"root_timeline_unbound_registry_present"),globalThis.console.warn("[hyperframes] Root timeline not bound, so render will freeze at t=0. "+(A?`Root data-composition-id is "${A}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${g.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${A??"<root-id>"}"] = tl).`)}}rn(e.currentTime,Array.from(document.querySelectorAll("[data-start]:not(video, audio, img)"))),window.__renderReady=!0;try{at()}catch(p){throw window.__renderReady=!1,li(p),p}Je(!0)},Jr=null,BC=()=>{if(Jr)return;let u=()=>{window.removeEventListener("hf-timelines-built",u),Jr=null,pr()};Jr=u,window.addEventListener("hf-timelines-built",u)};U(()=>{Jr&&(window.removeEventListener("hf-timelines-built",Jr),Jr=null)}),pr=()=>{if(!e.tornDown){if(!Be){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,BC();return}if(pt("discover",e.currentTime),!RC()){window.__renderReady=!1;return}if(!MC()){window.__renderReady=!1;return}GC()}},pr(),Be&&setTimeout(()=>{pr()},0);let Sc=0,os=!1,is=Number.NaN,Qr={revision:Number.NaN,time:Number.NEGATIVE_INFINITY},as=null,ss=!1,Mn=null,og=!1,ls=!1,ig="",ag=-1,oi=!1,sg=Number.NEGATIVE_INFINITY,lg=Number.NEGATIVE_INFINITY,ug="",cg=!1,Ec=u=>ft?void 0:{owner:u,version:`${nn}:${u.getChildren?.(!1,!0,!0).length??0}`},dg=new Set,UC=(u,p,g,S)=>{try{let A=S?.suppressEvents===!0;En(p),Ui(p,g,A,Ec(p),i)}catch(A){let w=A instanceof Error?`${A.name}: ${A.message}`:String(A),P=`${u}\n${w}`;if(dg.has(P))return;dg.add(P),globalThis.console.warn(`${Dg} "${u}" ${w}`)}},fg=new Map,WC=u=>{let p=fg.get(u);if(!ft&&p){if(p instanceof WeakRef){let S=p.deref();if(S?.isConnected&&S.getAttribute("data-composition-id")===u)return S}else if(p.missingAt===nn)return null}let g=document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`);return fg.set(u,g?new WeakRef(g):{missingAt:nn}),g},us=new WeakMap,mg=-1,VC=(u,p)=>{if(us.has(p))return us.get(p);let g=WC(u),S=g?ee(g,0):Number.NaN,A=g&&Number.isFinite(S)?{start:S,hiddenFrom:g.hasAttribute("data-start")&&!n(g)?S+(Q(g)??1/0):1/0,playbackStart:Oi(g),rate:St(g),timelineDuration:Ee(p)}:null;return us.set(p,A),A},pg=new WeakMap,$C=(u,p)=>{if(pg.get(u)!==p)return!1;try{return u.paused()===!0&&Number(u.totalTime?.())===p}catch{return!1}},vc=()=>{let u=window.__timelines??{},p=R()?.getAttribute("data-composition-id")??null;return Object.entries(u).filter(g=>!!g[1]&&typeof g[1]=="object"&&g[0]!==p)},qC=(u,p,g)=>{(mg!==p||ft)&&(us=new WeakMap,mg=p);for(let[S,A]of vc()){let w=VC(S,A);if(!w)continue;let P=w.playbackStart+Gn(w.rate,Math.max(0,Math.min(u,w.hiddenFrom)-w.start)),q=Math.max(0,w.timelineDuration!=null&&w.timelineDuration>0?Math.min(w.timelineDuration,P):P);!ft&&$C(A,q)||(UC(S,A,q,g),pg.set(A,q))}},hg=u=>typeof u=="object"&&u!==null,zC=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],gg=(u,p)=>{let g=u[p];if(typeof g!="function")return null;try{let S=Number(g.call(u));return Number.isFinite(S)?S:null}catch(S){return $("runtime.init.gsapCallbackDuration",S),null}},bg=new WeakMap,jC=(u,p)=>{if(!p)return yg(u);let g=bg.get(p.owner);if(g?.version===p.version)return g.value;let S=yg(u);return bg.set(p.owner,{version:p.version,value:S}),S},yg=u=>{if(!("getChildren"in u)||typeof u.getChildren!="function")return!1;let p;try{p=u.getChildren(!0,!0,!0)}catch(g){return $("runtime.init.gsapCallbackChildren",g),!1}if(!Array.isArray(p))return!1;for(let g of p){if(!hg(g))continue;let S=g.vars;if(!hg(S)||!zC.some(q=>typeof S[q]=="function"))continue;let P=gg(g,"totalDuration")??gg(g,"duration");if(P!=null&&P<=1e-6)return!0}return!1};function kn(u,p){let g=e.capturedTimeline,S=Ac(g,u,p);return is=u,as=g,S}function Ac(u,p,g){let S=g?.suppressEvents===!0,A=g?.revision??zr();A!==Qr.revision&&(Qr={revision:A,time:Number.NEGATIVE_INFINITY}),cC(p,A);let w=p>Qr.time,P=w&&u?gb(u,Qr.time,p):null,q=w&&P?.size!==0&&(u||vc().length>0)?Qg(P?I=>P.has(I):void 0):null;if(qC(p,A,g),u){let I=p;if(typeof u.totalDuration=="function")try{let X=Number(u.totalDuration());Number.isFinite(X)&&X>0&&p>X&&(I=X)}catch(X){$("runtime.init.transport.clampDuration",X)}try{if(typeof u.totalTime=="function"){let X=Ec(u);!Ui(u,I,S,X,i)&&!S&&!jC(u,X)&&Bi({totalTime:u.totalTime.bind(u),totalDuration:u.totalDuration?.bind(u),getChildren:u.getChildren?.bind(u)},I,X)}else u.seek(I,S)}catch(X){$("runtime.init.transport.seek",X)}}q?.(),Qr.time=Math.max(Qr.time,p);let W=q2();for(let I of e.deterministicAdapters)if(!(I.name==="gsap"&&u))try{I.seek({time:p,suppressEvents:S,pageAnimations:W})}catch(X){$("runtime.init.transport.adapter",X)}return W}let wc=D_(document,()=>{_n()});c.push(()=>wc.disconnect());let xg=()=>{try{return wc.isActive()}catch{return!1}},KC=()=>!h.isPlaying()&&$t.length===0&&!te()&&wc.observing&&(!ss||xg())&&!oi&&e.currentTime===is&&e.capturedTimeline===as,_c=()=>`${zr()}|${qr()??""}`,Sg=()=>{Mn=window.setTimeout(YC,og&&e.capturedTimeline&&cr?V2:e.bridgeMaxPostIntervalMs)},YC=()=>{if(Mn=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(_c()!==ig){_n();return}Je(!1),Sg()}},Zr=null,Eg=()=>e.transportRafId!=null||Zr!=null,cs=()=>{if(document.visibilityState==="hidden"){Zr=window.setTimeout(()=>{Zr=null,Tg()},$2);return}e.transportRafId=window.requestAnimationFrame(Tg)},vg=()=>{e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),Zr!=null&&(window.clearTimeout(Zr),Zr=null)},Ag=()=>{e.tornDown||!Eg()||(vg(),cs())};document.addEventListener("visibilitychange",Ag);let XC=()=>{if(e.transportRafId=null,e.tornDown)return;let u=ls;if(ls=!1,u||!KC()){cs();return}ig=_c(),Sg()};_n=()=>{e.tornDown||(ls=!0,!(os||Eg())&&(Mn!=null&&(window.clearTimeout(Mn),Mn=null),ls=!1,cs()))};let wg=u=>u.isConnected&&!E(u)&&!sl(u)&&!(u.ended&&!u.loop)&&(u.hasAttribute("src")||u.querySelector("source[src]")!==null),JC=u=>{let p=Wa("audio[data-start]"),g=null;for(let S of u?[u,...p]:p){if(!Ce(S)||!wg(S))continue;let A=re(S),w=xe(S,A);if(!Number.isFinite(A)||!fn(e.currentTime,w.start,w.end))continue;if(S===u)return{el:S,start:A};let P=A+(oo(S)??1/0);(!g||P>g.runsUntil)&&(g={el:S,start:A,runsUntil:P})}return g},QC=3e3,ii=null,ZC=u=>u.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA?(ii=null,!0):(ii?.el!==u&&(ii={el:u,sinceMs:performance.now()}),performance.now()-ii.sinceMs<QC);function _g(){if(h.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&y.ownsClock()&&y.context){let u=y.getTime();u>=0&&h.attachAudioSource({currentTimeSeconds:u,webAudio:!0})}else{let u=JC(h.audioElement());u&&!ZC(u.el)?h.hasAudioSource()&&h.detachAudioSource():u&&!u.el.paused?h.attachAudioSource({el:u.el,compositionStart:u.start,mediaStart:Oi(u.el),rate:St(u.el)}):u&&u.el.readyState<HTMLMediaElement.HAVE_FUTURE_DATA?h.attachAudioSource({currentTimeSeconds:e.currentTime}):h.hasAudioSource()&&h.detachAudioSource()}else ii=null,h.hasAudioSource()&&h.detachAudioSource()}let eR=1,tR=u=>{if(u.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA)return!0;if(u.readyState<HTMLMediaElement.HAVE_CURRENT_DATA)return!1;let p=Math.min(u.currentTime+eR,u.duration)-.01;for(let g=0;g<u.buffered.length;g++)if(u.buffered.start(g)<=u.currentTime&&u.buffered.end(g)>=p)return!0;return!1},nR=u=>e.nativeMediaSyncDisabled?[]:mr.filter(({el:p,start:g,end:S})=>fn(u,g,S)&&!tR(p)&&wg(p)&&!ex(p)&&!y.ownsElement(p)).map(({el:p})=>p),Tg=()=>{if(!(e.tornDown||os)){os=!0;try{Sc+=1;let u=zr();u!==ag&&(ag=u,oi=!0);let p=Date.now(),g=h.isPlaying(),S=g&&p-lg>=Rp,A=cg&&!g;if(cg=g,S){lg=p;let oe=_c();oe!==ug&&(ug=oe,oi=!0)}let w=oi&&p-sg>=H_;w&&(sg=p);let P=oe=>!g&&Sc%oe===0;if(G_({tick:Sc,isPlaying:g,hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:h.now(),compositionChanged:w,playingPollDue:S})){let oe=e.capturedTimeline;if(dr()){e.capturedTimeline&&e.capturedTimeline!==oe&&En(e.capturedTimeline);let se=Xe(e.capturedTimeline,0,u);se>0&&h.setDuration(se),at()}}if(w||P(20)?(at(),oi=!1):A&&TC(),(w||P(30))&&$a(),e.capturedTimeline){let oe=Xe(e.capturedTimeline,0,u);oe>0&&(!h.isPlaying()||oe>=h.getDuration())&&h.setDuration(oe)}_g();let q=h.now();e.currentTime=q,window.__HF_EXPORT_RENDER_SEEK_CONFIG||Pb({nowMs:performance.now(),filmTime:q,fps:e.canonicalFps,rate:e.playbackRate,playing:g,hidden:document.visibilityState==="hidden",waiting:mr.some(({el:oe})=>oe.tagName==="VIDEO"&&!oe.paused&&oe.readyState<3),frozen:ly(mr,q),clock:h.followedClock(),layoutKey:`${window.innerWidth}x${window.innerHeight}@${window.devicePixelRatio}`});let W=h.isPlaying(),I=!W&&xg(),X=W&&i_();if(I?ss=!0:!X&&(W||ss||q!==is||e.capturedTimeline!==as)&&(kn(q,{revision:u}),Ho(q,{playing:W}),W||(ss=!1)),W&&qt.redrawAnimated(),h.isPlaying()&&h.reachedEnd()){y.stopAll(),h.detachAudioSource(),h.pause(),e.isPlaying=!1;let oe=h.getStopTime();Number.isFinite(oe)&&(h.seek(oe),e.currentTime=oe,kn(oe)),pt("pause"),xt(u),Ho(e.currentTime),Je(!0);return}h.isPlaying()?(oR(),xt(u)):AC()&&(Vt=null,xt(u));let Se=nR(e.currentTime);h.isPlaying()&&Se.length>0?($t=Se,tg()):$t.length>0&&!Se.some(oe=>$t.includes(oe))&&ri.play(),Je(!1)}finally{os=!1,XC()}}},Cg=u=>{let p=ve(()=>ni().mediaClips);for(let g of Hh(p)??[]){if(!g.el.isConnected||!fn(u,g.start,g.end))continue;let S=Wn(g,u);if(!(Math.abs(g.el.currentTime-S)<=.001))try{g.el.currentTime=Ct(S)}catch{}}},Tc=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let u=y.startGeneration(),p=Pa(document);y.releaseDecodedExcept(p),Cc(p,u)},rR=10,ds={gen:-1,clips:[]},Rg=()=>h.now()+rR*Math.max(1,e.playbackRate),oR=()=>{let u=ds;if(u.gen!==y.currentGeneration()||u.clips.length===0||e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let p=Rg(),g=u.clips.filter(S=>S.start<=p);g.length!==0&&(u.clips=u.clips.filter(S=>S.start>p),Cc(g.flatMap(({el:S})=>S.isConnected?[S]:[]),u.gen))},Cc=(u,p)=>{ds.gen!==p&&(ds={gen:p,clips:[]});let g=h.now(),S=Rg();for(let A of u){if(E(A))continue;let w=re(A);if(!Number.isFinite(w))continue;let P=Oi(A),q=Number.parseFloat(A.dataset.volume??""),W=Number.isFinite(q)?q:1,I=Ue(A.dataset.duration),X=I!=null&&I>0?I:Number.POSITIVE_INFINITY,{inheritedStart:Se,inheritedDuration:oe}=fe(A);Se!=null&&oe!=null&&oe>0&&(X=Math.min(X,Math.max(0,Se+oe-w)));let se=ce(A),me=Rr({start:w,end:w+X},se);if(se.length>0){if(me.end<=me.start)continue;X=me.end-w}if(me.end<=g)continue;if(me.start>S){ds.clips.push({el:A,start:me.start});continue}let Qe=Vo(A);$o(A,Qe),(Qe.kind==="web-audio"?y.scheduleMediaElementPlayback(A,w,P,h.now(),W,p,e.playbackRate,X):Promise.resolve(null)).then(He=>{let Ze=p!==y.currentGeneration();if(He&&e.playbackRate===1&&j2(A)){y.decodeAudioElement(A).then(async wt=>{if(!wt||!h.isPlaying()||p!==y.currentGeneration())return;await y.schedulePlayback(A,wt,w,P,()=>h.now(),W,p,e.playbackRate,X,me.start)&&y.releaseRouted(A)});return}if(He||!vr(A)||!h.isPlaying()||Ze||typeof St(A)!="number")return;let fs=e.playbackRate*lt(A),$e=A.hasAttribute("data-fx-chain")||A.hasAttribute("data-automation");if(Math.abs(fs-1)>1e-9){Qe.kind==="web-audio"&&$e&&(A.muted=!0);return}y.decodeAudioElement(A).then(wt=>{!wt||!h.isPlaying()||y.schedulePlayback(A,wt,w,P,()=>h.now(),W,p,e.playbackRate,X,me.start)})})}};function Mg(){y.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&x&&h.isPlaying()&&(y.hasBoundedActiveSources()||y.hasHandedOverSources())&&(y.stopAll(),Tc())}if(e.capturedTimeline){let u=Xe(e.capturedTimeline,0);u>0&&h.setDuration(u),En(e.capturedTimeline)}$v(window),cs(),at(),Je(!0),e.controlBridgeHandler=Rb({onPlay:()=>{gr.play(),Rt("composition_played",{time:gr.getTime()})},onPause:()=>{gr.pause(),Rt("composition_paused",{time:gr.getTime()})},onStopMedia:()=>{y.stopAll();let u=document.querySelectorAll("video, audio");for(let p of u)Ce(p)&&!p.paused&&p.pause()},onSeek:(u,p)=>{gr.seek(u),Rt("composition_seeked",{time:u})},onSetMuted:u=>{e.bridgeMuted=u;let p=u||e.mediaOutputMuted;y.setMuted(p);let g=document.querySelectorAll("video, audio");for(let S of g)Ce(S)&&(S.muted=p||S.defaultMuted)},onSetVolume:u=>{e.bridgeVolume=u,y.setVolume(u);let p=document.querySelectorAll("video, audio");for(let g of p){if(!Ce(g))continue;let S=parseFloat(g.dataset.volume??""),A=Number.isFinite(S)?S:1;g.volume=Rs(A*u)}},onSetMediaOutputMuted:u=>{e.mediaOutputMuted=u;let p=u||e.bridgeMuted;y.setMuted(p);let g=document.querySelectorAll("video, audio");for(let S of g)Ce(S)&&(S.muted=p||S.defaultMuted)},onSetNativeMediaSyncDisabled:u=>{e.nativeMediaSyncDisabled!==u&&(e.nativeMediaSyncDisabled=u,e.mediaForceSyncNextTick=!0,u?(y.stopAll(),h.detachAudioSource()):xt())},onSetWebAudioMediaDisabled:u=>{e.webAudioMediaDisabled!==u&&(e.webAudioMediaDisabled=u,e.mediaForceSyncNextTick=!0,u&&(y.stopAll(),h.detachAudioSource()),xt())},onSetPlaybackRate:u=>{xc(u),e.transportClock&&e.transportClock.setRate(e.playbackRate),Mg()},onSetDisplayScale:u=>{mx(u),d0(u),Fb(u)},onRequestPreviewFacts:()=>we({source:"hf-preview",type:"preview-facts",facts:{sceneCount:Lt.length,mountedElementCount:document.body.querySelectorAll("*").length,durationSeconds:h.getDuration(),videos:wx(),lighterAt:Ax(),copiesReady:fy()}}),onSetPreviewQuality:vx,onRetryPreviewCopies:_x,onSetIdleHeartbeat:u=>{og=u,_n()},onSetRootDuration:CC,onSetPlayRange:(u,p)=>{h.setPlayRange(u,p,e.canonicalFps);let g=h.getPlayStart();if(h.isPlaying()&&(h.now()<g||h.reachedEnd())){ri.seek(g,{keepPlaying:!0});return}Je(!0)},onSetColorGrading:(u,p)=>{qt.setGrading(u,p)},onSetColorGradingCompare:(u,p)=>{qt.setCompare(u,p)},onTick:()=>{if(e.tornDown||!h.isPlaying())return;_g();let u=h.now();if(e.currentTime=u,(u!==is||e.capturedTimeline!==as)&&kn(u),h.reachedEnd()){y.stopAll(),h.detachAudioSource(),h.pause(),e.isPlaying=!1;let p=h.getStopTime();Number.isFinite(p)&&(h.seek(p),e.currentTime=p,kn(p)),pt("pause"),xt(),Je(!0)}},onEnablePickMode:()=>rs.enablePickMode(),onDisablePickMode:()=>rs.disablePickMode(),onSetRuntimeData:Nu,onClearRuntimeData:Fu,getCanonicalFps:()=>e.canonicalFps});let Rc=()=>{if(!e.tornDown){e.tornDown=!0,vg(),document.removeEventListener("visibilitychange",Ag),Mn!=null&&(window.clearTimeout(Mn),Mn=null),e.transportClock=null,y.destroy(),fr!=null&&(window.clearTimeout(fr),fr=null),f!=null&&(window.cancelAnimationFrame(f),f=null),nC(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),l&&(window.removeEventListener("error",l),l=null),s&&(window.removeEventListener("unhandledrejection",s),s=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),rs.disablePickMode();for(let u of e.deterministicAdapters)if(!(!u||typeof u.revert!="function"))try{u.revert()}catch(p){$("runtime.init.site12",p)}e.deterministicAdapters=[],window.__hf?.buildReady&&(window.__hf.buildReady={});for(let u of c.splice(0))try{u()}catch(p){$("runtime.init.site13",p)}for(let u of e.injectedCompStyles)try{u.remove()}catch(p){$("runtime.init.site14",p)}e.injectedCompStyles=[];for(let u of e.injectedCompLinks)try{u.remove()}catch(p){$("runtime.init.site15",p)}e.injectedCompLinks=[];for(let u of e.injectedCompScripts)try{u.remove()}catch(p){$("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,r=()=>{},window.__hfRuntimeTeardown===Rc&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Rc,e.beforeUnloadHandler=Rc,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var dT=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Hp=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function K2(e){if(e<=255)return dT[e];let t=0,n=Hp.length-1;for(;t<=n;){let r=t+n>>1,o=Hp[r];if(e<o[0]){n=r-1;continue}if(e>o[1]){t=r+1;continue}return o[2]}return"L"}function Y2(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let c=0;c<t;){let d=e.charCodeAt(c),f=d,m=1;if(d>=55296&&d<=56319&&c+1<t){let h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(f=(d-55296<<10)+(h-56320)+65536,m=2)}let b=K2(f);(b==="R"||b==="AL"||b==="AN")&&(r=!0);for(let h=0;h<m;h++)n[c+h]=b;c+=m}if(!r)return null;let o=0;for(let c=0;c<t;c++){let d=n[c];if(d==="L"){o=0;break}if(d==="R"||d==="AL"){o=1;break}}let i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;let a=o&1?"R":"L",l=a,s=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=s:s=n[c];s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let d;for(d=c-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=c+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let c=0;c<t;c++){let d=n[c];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[c]="ON")}s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let d=c+1;for(;d<t&&n[d]==="ON";)d++;let f=c>0?n[c-1]:l,m=d<t?n[d]:l,b=f!=="L"?"R":"L";if(b===(m!=="L"?"R":"L"))for(let y=c;y<d;y++)n[y]=b;c=d-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=a);for(let c=0;c<t;c++){let d=n[c];(i[c]&1)===0?d==="R"?i[c]++:(d==="AN"||d==="EN")&&(i[c]+=2):(d==="L"||d==="AN"||d==="EN")&&i[c]++}return i}function fT(e,t){let n=Y2(e);if(n===null)return null;let r=new Int8Array(t.length);for(let o=0;o<t.length;o++)r[o]=n[t[o]];return r}var X2=/[ \\t\\n\\r\\f]+/g,J2=/[\\t\\n\\r\\f]| {2,}|^ | $/;function Q2(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function Z2(e){if(!J2.test(e))return e;let t=e.replace(X2," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function eB(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var Gp=null,tB;function nB(){return Gp===null&&(Gp=new Intl.Segmenter(tB,{granularity:"word"})),Gp}var rB=/\\p{Script=Arabic}/u,Du=/\\p{M}/u,ST=/\\p{Nd}/u;function mT(e){return rB.test(e)}function pT(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Ut(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let o=(n-55296<<10)+(r-56320)+65536;if(pT(o))return!0;t++;continue}}if(pT(n))return!0}}return!1}function oB(e){let t=Gu(e);return t!==null&&(Hu.has(t)||ir.has(t))}var iB=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function aB(e){return Ut(e)}function sB(e){let t=Gu(e);return t!==null&&iB.has(t)}function Ou(e){return!oB(e)&&!sB(e)}var Hu=new Set(["\\uFF0C","\\uFF0E","\\uFF01","\\uFF1A","\\uFF1B","\\uFF1F","\\u3001","\\u3002","\\u30FB","\\uFF09","\\u3015","\\u3009","\\u300B","\\u300D","\\u300F","\\u3011","\\u3017","\\u3019","\\u301B","\\u30FC","\\u3005","\\u303B","\\u309D","\\u309E","\\u30FD","\\u30FE"]),Ha=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Up=new Set(["\'","\\u2019"]),ir=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),lB=new Set([":",".","\\u060C","\\u061B"]),uB=new Set(["\\u104F"]),cB=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function dB(e){if(Wp(e))return!0;let t=!1;for(let n of e){if(ir.has(n)){t=!0;continue}if(!(t&&Du.test(n)))return!1}return t}function fB(e){for(let t of e)if(!Hu.has(t)&&!ir.has(t))return!1;return e.length>0}function mB(e){if(Wp(e))return!0;for(let t of e)if(!Ha.has(t)&&!Up.has(t)&&!Du.test(t))return!1;return e.length>0}function Wp(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Du.test(n))){if(Ha.has(n)||ir.has(n)||Up.has(n)){t=!0;continue}return!1}return t}function ET(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let o=n-1;if(o<0)return n;let i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Gu(e){if(e.length===0)return null;let t=ET(e,e.length);return e.slice(t)}function pB(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Du.test(r)){n--;continue}if(Ha.has(r)||Up.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function hB(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function hT(e,t,n,r){let o=t[r],i=e[r];if(o==null)return i;let a=n[r];if(i.length===a)return i;let l=o.repeat(a);return e[r]=l,l}function gT(e,t){return e&&t!==null&&lB.has(t)}function gB(e){let t=Gu(e);return t!==null&&uB.has(t)}function bB(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Bu(e){let t=e.length;for(;t>0;){let n=ET(e,t),r=e.slice(n,t);if(cB.has(r))return!0;if(!ir.has(r))return!1;t=n}return!1}function yB(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var xB=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function kt(e){return e.length===1?e[0]:e.join("")}function SB(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),kt(n)}function EB(e,t,n,r){if(!xB.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let o=[],i=null,a=[],l=n,s=!1,c=0;for(let d of e){let f=yB(d,r),m=f==="text"&&t;if(i!==null&&f===i&&m===s){a.push(d),c+=d.length;continue}i!==null&&o.push({text:kt(a),isWordLike:s,kind:i,start:l}),i=f,a=[d],l=n+c,s=m,c+=d.length}return i!==null&&o.push({text:kt(a),isWordLike:s,kind:i,start:l}),o}function Bp(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var vB=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function AB(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:vB.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function wB(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function _B(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),o=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!AB(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Bp(r[s]);){l.push(t[s]),n[a]=!0;let c=t[s].includes("?");if(r[s]="text",t[s]="",s++,c)break}t[a]=kt(l)}let i=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(i!==a&&(t[i]=l,n[i]=n[a],r[i]=r[a],o[i]=o[a]),i++)}return t.length=i,n.length=i,r.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:r,starts:o}}function TB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i];if(t.push(a),n.push(e.isWordLike[i]),r.push(e.kinds[i]),o.push(e.starts[i]),!wB(a))continue;let l=i+1;if(l>=e.len||Bp(e.kinds[l]))continue;let s=[],c=e.starts[l],d=l;for(;d<e.len&&!Bp(e.kinds[d]);)s.push(e.texts[d]),d++;s.length>0&&(t.push(kt(s)),n.push(!0),r.push("text"),o.push(c),i=d-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}var CB=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),bT=/^[A-Za-z0-9_]+[,:;]*$/,yT=/[,:;]+$/;function vT(e){for(let t of e)if(ST.test(t))return!0;return!1}function Oa(e){if(e.length===0)return!1;for(let t of e)if(!(ST.test(t)||CB.has(t)))return!1;return!0}function RB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i],l=e.kinds[i];if(l==="text"&&Oa(a)&&vT(a)){let s=[a],c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Oa(e.texts[c]);)s.push(e.texts[c]),c++;t.push(kt(s)),n.push(!0),r.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(a),n.push(e.isWordLike[i]),r.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function MB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i],l=e.kinds[i],s=e.isWordLike[i];if(l==="text"&&s&&bT.test(a)){let c=[a],d=yT.test(a),f=i+1;for(;d&&f<e.len&&e.kinds[f]==="text"&&e.isWordLike[f]&&bT.test(e.texts[f]);){let m=e.texts[f];c.push(m),d=yT.test(m),f++}t.push(kt(c)),n.push(!0),r.push("text"),o.push(e.starts[i]),i=f-1;continue}t.push(a),n.push(s),r.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function kB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i];if(e.kinds[i]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let c=0;c<l.length;c++){let d=l[c];if(!s)break;(d.length===0||!vT(d)||!Oa(d))&&(s=!1)}if(s){let c=0;for(let d=0;d<l.length;d++){let f=l[d],m=d<l.length-1?`${f}-`:f;t.push(m),n.push(!0),r.push("text"),o.push(e.starts[i]+c),c+=m.length}continue}}t.push(a),n.push(e.isWordLike[i]),r.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function LB(e){let t=[],n=[],r=[],o=[],i=0;for(;i<e.len;){let a=[e.texts[i]],l=e.isWordLike[i],s=e.kinds[i],c=e.starts[i];if(s==="glue"){let d=[a[0]],f=c;for(i++;i<e.len&&e.kinds[i]==="glue";)d.push(e.texts[i]),i++;let m=kt(d);if(i<e.len&&e.kinds[i]==="text")a[0]=m,a.push(e.texts[i]),l=e.isWordLike[i],s="text",c=f,i++;else{t.push(m),n.push(!1),r.push("glue"),o.push(f);continue}}else i++;if(s==="text")for(;i<e.len&&e.kinds[i]==="glue";){let d=[];for(;i<e.len&&e.kinds[i]==="glue";)d.push(e.texts[i]),i++;let f=kt(d);if(i<e.len&&e.kinds[i]==="text"){a.push(f,e.texts[i]),l=l||e.isWordLike[i],i++;continue}a.push(f)}t.push(kt(a)),n.push(l),r.push(s),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function NB(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(r[i]!=="text"||r[i+1]!=="text"||!Ut(t[i])||!Ut(t[i+1]))continue;let a=pB(t[i]);a!==null&&(t[i]=a.head,t[i+1]=a.tail+t[i+1],o[i+1]=o[i]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function xT(e,t,n){let r=nB(),o=0,i=[],a=[],l=[],s=[],c=[],d=[],f=[],m=[],b=[],h=[],y=[],x=[];for(let M of r.segment(e))for(let L of EB(M.segment,M.isWordLike??!1,M.index,n)){let V=function(){d[D]!==null&&(a[D]=[hT(i,d,f,D)],d[D]=null),a[D].push(L.text),l[D]=l[D]||L.isWordLike,m[D]=m[D]||B,b[D]=b[D]||O,h[D]=Z,y[D]=J,x[D]=gT(b[D],Y)},G=L.kind==="text",C=hB(L.text,L.isWordLike,L.kind),B=Ut(L.text),O=mT(L.text),Y=Gu(L.text),Z=Bu(L.text),J=gB(L.text),D=o-1;t.carryCJKAfterClosingQuote&&G&&o>0&&s[D]==="text"&&B&&m[D]&&h[D]||G&&o>0&&s[D]==="text"&&fB(L.text)&&m[D]||G&&o>0&&s[D]==="text"&&y[D]?V():G&&o>0&&s[D]==="text"&&L.isWordLike&&O&&x[D]?(V(),l[D]=!0):C!==null&&o>0&&s[D]==="text"&&d[D]===C?f[D]=(f[D]??1)+1:G&&!L.isWordLike&&o>0&&s[D]==="text"&&(dB(L.text)||L.text==="-"&&l[D])?V():(i[o]=L.text,a[o]=[L.text],l[o]=L.isWordLike,s[o]=L.kind,c[o]=L.start,d[o]=C,f[o]=C===null?0:1,m[o]=B,b[o]=O,h[o]=Z,y[o]=J,x[o]=gT(O,Y),o++)}for(let M=0;M<o;M++){if(d[M]!==null){i[M]=hT(i,d,f,M);continue}i[M]=kt(a[M])}for(let M=1;M<o;M++)s[M]==="text"&&!l[M]&&Wp(i[M])&&s[M-1]==="text"&&(i[M-1]+=i[M],l[M-1]=l[M-1]||l[M],i[M]="");let E=Array.from({length:o},()=>null),v=-1;for(let M=o-1;M>=0;M--){let L=i[M];if(L.length!==0){if(s[M]==="text"&&!l[M]&&mB(L)&&v>=0&&s[v]==="text"){let G=E[v]??[];G.push(L),E[v]=G,c[v]=c[M],i[M]="";continue}v=M}}for(let M=0;M<o;M++){let L=E[M];L!=null&&(i[M]=SB(L,i[M]))}let T=0;for(let M=0;M<o;M++){let L=i[M];L.length!==0&&(T!==M&&(i[T]=L,l[T]=l[M],s[T]=s[M],c[T]=c[M]),T++)}i.length=T,l.length=T,s.length=T,c.length=T;let H=LB({len:T,texts:i,isWordLike:l,kinds:s,starts:c}),U=NB(MB(kB(RB(TB(_B(H))))));for(let M=0;M<U.len-1;M++){let L=bB(U.texts[M]);L!==null&&(U.kinds[M]!=="space"&&U.kinds[M]!=="preserved-space"||U.kinds[M+1]!=="text"||!mT(U.texts[M+1])||(U.texts[M]=L.space,U.isWordLike[M]=!1,U.kinds[M]=U.kinds[M]==="preserved-space"?"preserved-space":"space",U.texts[M+1]=L.marks+U.texts[M+1],U.starts[M+1]=U.starts[M]+L.space.length))}return U}function FB(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),r=o+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function PB(e){if(e.len<=1)return e;let t=[],n=[],r=[],o=[],i=null,a=!1,l=0,s=!1,c=!1;function d(){i!==null&&(t.push(kt(i)),n.push(a),r.push("text"),o.push(l),i=null)}for(let f=0;f<e.len;f++){let m=e.texts[f],b=e.kinds[f],h=e.isWordLike[f],y=e.starts[f];if(b==="text"){let x=aB(m),E=Ou(m);if(i!==null&&s&&c){i.push(m),a=a||h,s=s||x,c=E;continue}d(),i=[m],a=h,l=y,s=x,c=E;continue}d(),t.push(m),n.push(h),r.push(b),o.push(y)}return d(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function AT(e,t,n="normal",r="normal"){let o=Q2(n),i=o.mode==="pre-wrap"?eB(e):Z2(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?PB(xT(i,t,o)):xT(i,t,o);return{normalized:i,chunks:FB(a,o),...a}}var qo=null,wT=new Map,zo=null,IB=96,DB=/\\p{Emoji_Presentation}/u,OB=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,Vp=null,_T=new Map;function $p(){if(qo!==null)return qo;if(typeof OffscreenCanvas<"u")return qo=new OffscreenCanvas(1,1).getContext("2d"),qo;if(typeof document<"u")return qo=document.createElement("canvas").getContext("2d"),qo;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function HB(e){let t=wT.get(e);return t||(t=new Map,wT.set(e,t)),t}function vn(e,t){let n=t.get(e);return n===void 0&&(n={width:$p().measureText(e).width,containsCJK:Ut(e)},t.set(e,n)),n}function sr(){if(zo!==null)return zo;if(typeof navigator>"u")return zo={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},zo;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return zo={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},zo}function GB(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function TT(){return Vp===null&&(Vp=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Vp}function BB(e){return DB.test(e)||e.includes("\\uFE0F")}function CT(e){return OB.test(e)}function UB(e,t){let n=_T.get(e);if(n!==void 0)return n;let r=$p();r.font=e;let o=r.measureText("\\u{1F600}").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){let i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="\\u{1F600}",document.body.appendChild(i);let a=i.getBoundingClientRect().width;document.body.removeChild(i),o-a>.5&&(n=o-a)}return _T.set(e,n),n}function WB(e){let t=0,n=TT();for(let r of n.segment(e))BB(r.segment)&&t++;return t}function VB(e,t){return t.emojiCount===void 0&&(t.emojiCount=WB(e)),t.emojiCount}function ar(e,t,n){return n===0?t.width:t.width-VB(e,t)*n}function RT(e,t,n,r,o){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let i=TT(),a=[];for(let d of i.segment(e))a.push(d.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){let d=[];for(let f of a){let m=vn(f,n);d.push(ar(f,m,r))}return t.breakableFitAdvances=d,t.breakableFitAdvances}if(o==="pair-context"||a.length>IB){let d=[],f=null,m=0;for(let b of a){let h=vn(b,n),y=ar(b,h,r);if(f===null)d.push(y);else{let x=f+b,E=vn(x,n);d.push(ar(x,E,r)-m)}f=b,m=y}return t.breakableFitAdvances=d,t.breakableFitAdvances}let l=[],s="",c=0;for(let d of a){s+=d;let f=vn(s,n),m=ar(s,f,r);l.push(m-c),c=m}return t.breakableFitAdvances=l,t.breakableFitAdvances}function MT(e,t){let n=$p();n.font=e;let r=HB(e),o=GB(e),i=t?UB(e,o):0;return{cache:r,fontSize:o,emojiCorrection:i}}function $B(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function kT(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function LT(e,t,n,r,o){let i=0,a=t;for(;i<e.length;){let l=a+e[i];if((i+1<e.length?l+o:l)>n+r)break;a=l,i++}return{fitCount:i,fittedWidth:a}}function qB(e,t){let n=0,r=e.chunks.length;for(;n<r;){let o=Math.floor((n+r)/2);t<e.chunks[o].consumedEndSegmentIndex?r=o:n=o+1}return n<e.chunks.length?n:-1}function NT(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let o=e.chunks[t];if(o.startSegmentIndex===o.endSegmentIndex&&r===o.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<o.startSegmentIndex&&(r=o.startSegmentIndex);r<o.endSegmentIndex;){let i=e.kinds[r];if(i!=="space"&&i!=="zero-width-break"&&i!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return o.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=o.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function FT(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=qB(e,t.segmentIndex);return n<0?-1:NT(e,n,t)}function zB(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:NT(e,r,n)}function PT(e,t){return e.simpleLineWalkFastPath?IT(e,t):qp(e,t)}function IT(e,t,n){let{widths:r,kinds:o,breakableFitAdvances:i}=e;if(r.length===0)return 0;let l=sr().lineFitEpsilon,s=t+l,c=0,d=0,f=!1,m=0,b=0,h=0,y=0,x=-1,E=0;function v(){x=-1,E=0}function T(C=h,B=y,O=d){c++,n?.({startSegmentIndex:m,startGraphemeIndex:b,endSegmentIndex:C,endGraphemeIndex:B,width:O}),d=0,f=!1,v()}function H(C,B){f=!0,m=C,b=0,h=C+1,y=0,d=B}function U(C,B,O){f=!0,m=C,b=B,h=C,y=B+1,d=O}function M(C,B){if(!f){H(C,B);return}d+=B,h=C+1,y=0}function L(C,B){let O=i[C];for(let Y=B;Y<O.length;Y++){let Z=O[Y];f?d+Z>s?(T(),U(C,Y,Z)):(d+=Z,h=C,y=Y+1):U(C,Y,Z)}f&&h===C&&y===O.length&&(h=C+1,y=0)}let G=0;for(;G<r.length&&!(!f&&(G=$B(e,G),G>=r.length));){let C=r[G],B=o[G],O=B==="space"||B==="preserved-space"||B==="tab"||B==="zero-width-break"||B==="soft-hyphen";if(!f){C>t&&i[G]!==null?L(G,0):H(G,C),O&&(x=G+1,E=d-C),G++;continue}if(d+C>s){if(O){M(G,C),T(G+1,0,d-C),G++;continue}if(x>=0){if(h>x||h===x&&y>0){T();continue}T(x,0,E);continue}if(C>t&&i[G]!==null){T(),L(G,0),G++;continue}T();continue}M(G,C),O&&(x=G+1,E=d-C),G++}return f&&T(),c}function qp(e,t,n){if(e.simpleLineWalkFastPath)return IT(e,t,n);let{widths:r,lineEndFitAdvances:o,lineEndPaintAdvances:i,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:c,chunks:d}=e;if(r.length===0||d.length===0)return 0;let f=sr(),m=f.lineFitEpsilon,b=t+m,h=0,y=0,x=!1,E=0,v=0,T=0,H=0,U=-1,M=0,L=0,G=null;function C(){U=-1,M=0,L=0,G=null}function B(k=T,F=H,_=y){h++,n?.({startSegmentIndex:E,startGraphemeIndex:v,endSegmentIndex:k,endGraphemeIndex:F,width:_}),y=0,x=!1,C()}function O(k,F){x=!0,E=k,v=0,T=k+1,H=0,y=F}function Y(k,F,_){x=!0,E=k,v=F,T=k,H=F+1,y=_}function Z(k,F){if(!x){O(k,F);return}y+=F,T=k+1,H=0}function J(k,F,_,N){if(!F)return;let j=k==="tab"?0:o[_],ae=k==="tab"?N:i[_];U=_+1,M=y-N+j,L=y-N+ae,G=k}function D(k,F){let _=l[k];for(let N=F;N<_.length;N++){let j=_[N];x?y+j>b?(B(),Y(k,N,j)):(y+=j,T=k,H=N+1):Y(k,N,j)}x&&T===k&&H===_.length&&(T=k+1,H=0)}function V(k){if(G!=="soft-hyphen")return!1;let F=l[k];if(F==null)return!1;let{fitCount:_,fittedWidth:N}=LT(F,y,t,m,s);return _===0?!1:(y=N,T=k,H=_,C(),_===F.length?(T=k+1,H=0,!0):(B(k,_,N+s),D(k,_),!0))}function R(k){h++,n?.({startSegmentIndex:k.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:k.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let k=0;k<d.length;k++){let F=d[k];if(F.startSegmentIndex===F.endSegmentIndex){R(F);continue}x=!1,y=0,E=F.startSegmentIndex,v=0,T=F.startSegmentIndex,H=0,C();let _=F.startSegmentIndex;for(;_<F.endSegmentIndex;){let N=a[_],j=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen",ae=N==="tab"?kT(y,c):r[_];if(N==="soft-hyphen"){x&&(T=_+1,H=0,U=_+1,M=y+s,L=y+s,G=N),_++;continue}if(!x){ae>t&&l[_]!==null?D(_,0):O(_,ae),J(N,j,_,ae),_++;continue}if(y+ae>b){let ve=y+(N==="tab"?0:o[_]),z=y+(N==="tab"?ae:i[_]);if(G==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&M<=b){B(U,0,L);continue}if(G==="soft-hyphen"&&V(_)){_++;continue}if(j&&ve<=b){Z(_,ae),B(_+1,0,z),_++;continue}if(U>=0&&M<=b){if(T>U||T===U&&H>0){B();continue}let ee=U;B(ee,0,L),_=ee;continue}if(ae>t&&l[_]!==null){B(),D(_,0),_++;continue}B();continue}Z(_,ae),J(N,j,_,ae),_++}if(x){let N=U===F.consumedEndSegmentIndex?L:y;B(F.consumedEndSegmentIndex,0,N)}}return h}function DT(e,t,n,r){let o=e.chunks[n];if(o.startSegmentIndex===o.endSegmentIndex)return t.segmentIndex=o.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:i,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:c,discretionaryHyphenWidth:d,tabStopAdvance:f}=e,m=sr(),b=m.lineFitEpsilon,h=r+b,y=0,x=!1,E=t.segmentIndex,v=t.graphemeIndex,T=-1,H=0,U=0,M=null;function L(){T=-1,H=0,U=0,M=null}function G(D=E,V=v,R=y){return x?(t.segmentIndex=D,t.graphemeIndex=V,R):null}function C(D,V){x=!0,E=D+1,v=0,y=V}function B(D,V,R){x=!0,E=D,v=V+1,y=R}function O(D,V){if(!x){C(D,V);return}y+=V,E=D+1,v=0}function Y(D,V,R,k){if(!V)return;let F=D==="tab"?0:a[R],_=D==="tab"?k:l[R];T=R+1,H=y-k+F,U=y-k+_,M=D}function Z(D,V){let R=c[D];for(let k=V;k<R.length;k++){let F=R[k];if(!x)B(D,k,F);else{if(y+F>h)return G();y+=F,E=D,v=k+1}}return x&&E===D&&v===R.length&&(E=D+1,v=0),null}function J(D){if(M!=="soft-hyphen"||T<0)return null;let V=c[D]??null;if(V!==null){let{fitCount:R,fittedWidth:k}=LT(V,y,r,b,d);if(R===V.length)return y=k,E=D+1,v=0,L(),null;if(R>0)return G(D,R,k+d)}return H<=h?G(T,0,U):null}for(let D=t.segmentIndex;D<o.endSegmentIndex;D++){let V=s[D],R=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",k=D===t.segmentIndex?t.graphemeIndex:0,F=V==="tab"?kT(y,f):i[D];if(V==="soft-hyphen"&&k===0){x&&(E=D+1,v=0,T=D+1,H=y+d,U=y+d,M=V);continue}if(!x){if(k>0){let N=Z(D,k);if(N!==null)return N}else if(F>r&&c[D]!==null){let N=Z(D,0);if(N!==null)return N}else C(D,F);Y(V,R,D,F);continue}if(y+F>h){let N=y+(V==="tab"?0:a[D]),j=y+(V==="tab"?F:l[D]);if(M==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&H<=h)return G(T,0,U);let ae=J(D);if(ae!==null)return ae;if(R&&N<=h)return O(D,F),G(D+1,0,j);if(T>=0&&H<=h)return E>T||E===T&&v>0?G():G(T,0,U);if(F>r&&c[D]!==null){let de=G();if(de!==null)return de;let ve=Z(D,0);if(ve!==null)return ve}return G()}O(D,F),Y(V,R,D,F)}return T===o.consumedEndSegmentIndex&&v===0?G(o.consumedEndSegmentIndex,0,U):G(o.consumedEndSegmentIndex,0,y)}function jB(e,t,n){let{widths:r,kinds:o,breakableFitAdvances:i}=e,l=sr().lineFitEpsilon,s=n+l,c=0,d=!1,f=t.segmentIndex,m=t.graphemeIndex,b=-1,h=0;for(let y=t.segmentIndex;y<r.length;y++){let x=r[y],E=o[y],v=E==="space"||E==="preserved-space"||E==="tab"||E==="zero-width-break"||E==="soft-hyphen",T=y===t.segmentIndex?t.graphemeIndex:0,H=i[y];if(!d){if(T>0||x>n&&H!==null){let U=H,M=U[T];d=!0,c=M,f=y,m=T+1;for(let L=T+1;L<U.length;L++){let G=U[L];if(c+G>s)return t.segmentIndex=f,t.graphemeIndex=m,c;c+=G,f=y,m=L+1}f===y&&m===U.length&&(f=y+1,m=0)}else d=!0,c=x,f=y+1,m=0;v&&(b=y+1,h=c-x);continue}if(c+x>s)return v?(t.segmentIndex=y+1,t.graphemeIndex=0,c):b>=0?f>b||f===b&&m>0?(t.segmentIndex=f,t.graphemeIndex=m,c):(t.segmentIndex=b,t.graphemeIndex=0,h):(t.segmentIndex=f,t.graphemeIndex=m,c);c+=x,f=y+1,m=0,v&&(b=y+1,h=c-x)}return d?(t.segmentIndex=f,t.graphemeIndex=m,c):null}function KB(e,t,n){let r=FT(e,t);return r<0?null:e.simpleLineWalkFastPath?jB(e,t,n):DT(e,t,r,n)}function OT(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,o=0;if(!e.simpleLineWalkFastPath){let i=FT(e,n);for(;i>=0;){let a=DT(e,n,i,t);if(a===null)return{lineCount:r,maxLineWidth:o};r++,a>o&&(o=a),i=zB(e,i,n)}return{lineCount:r,maxLineWidth:o}}for(;;){let i=KB(e,n,t);if(i===null)return{lineCount:r,maxLineWidth:o};r++,i>o&&(o=i)}}var zp=null;function YB(){return zp===null&&(zp=new Intl.Segmenter(void 0,{granularity:"grapheme"})),zp}function XB(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function JB(e,t){let n=[],r=[],o=0,i=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:o}),r=[],i=!1,a=!1,l=!1)}function c(f,m,b){r=[f],o=m,i=b,a=Bu(f),l=Ha.has(f)}function d(f,m){r.push(f),i=i||m;let b=Bu(f);f.length===1&&ir.has(f)?a=a||b:a=b,l=!1}for(let f of YB().segment(e)){let m=f.segment,b=Ut(m);if(r.length===0){c(m,f.index,b);continue}if(l||Hu.has(m)||ir.has(m)||t.carryCJKAfterClosingQuote&&b&&a){d(m,b);continue}if(!i&&!b){d(m,b);continue}s(),c(m,f.index,b)}return s(),n}function QB(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,o=Ut(e[0].text),i=Ou(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],c=Ut(s.text),d=Ou(s.text);if(o&&i){n.push(s.text),o=o||c,i=d;continue}a(),n=[s.text],r=s.start,o=c,i=d}return a(),t}function ZB(e,t,n,r){let o=sr(),{cache:i,emojiCorrection:a}=MT(t,CT(e.normalized)),l=ar("-",vn("-",i),a),c=ar(" ",vn(" ",i),a)*8;if(e.len===0)return XB(n);let d=[],f=[],m=[],b=[],h=e.chunks.length<=1,y=n?[]:null,x=[],E=n?[]:null,v=Array.from({length:e.len});function T(L,G,C,B,O,Y,Z){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(h=!1),d.push(G),f.push(C),m.push(B),b.push(O),y?.push(Y),x.push(Z),E!==null&&E.push(L)}function H(L,G,C,B,O){let Y=vn(L,i),Z=ar(L,Y,a),J=G==="space"||G==="preserved-space"||G==="zero-width-break"?0:Z,D=G==="space"||G==="zero-width-break"?0:Z;if(O&&B&&L.length>1){let V="sum-graphemes";Oa(L)?V="pair-context":o.preferPrefixWidthsForBreakableRuns&&(V="segment-prefixes");let R=RT(L,Y,i,a,V);T(L,Z,J,D,G,C,R);return}T(L,Z,J,D,G,C,null)}for(let L=0;L<e.len;L++){v[L]=d.length;let G=e.texts[L],C=e.isWordLike[L],B=e.kinds[L],O=e.starts[L];if(B==="soft-hyphen"){T(G,0,l,l,B,O,null);continue}if(B==="hard-break"){T(G,0,0,0,B,O,null);continue}if(B==="tab"){T(G,0,0,0,B,O,null);continue}let Y=vn(G,i);if(B==="text"&&Y.containsCJK){let Z=JB(G,o),J=r==="keep-all"?QB(Z):Z;for(let D=0;D<J.length;D++){let V=J[D];H(V.text,"text",O+V.start,C,r==="keep-all"||!Ut(V.text))}continue}H(G,B,O,C,!0)}let U=e3(e.chunks,v,d.length),M=y===null?null:fT(e.normalized,y);return E!==null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:b,simpleLineWalkFastPath:h,segLevels:M,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:U,segments:E}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:b,simpleLineWalkFastPath:h,segLevels:M,breakableFitAdvances:x,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:U}}function e3(e,t,n){let r=[];for(let o=0;o<e.length;o++){let i=e[o],a=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,s=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function HT(e,t,n,r){let o=r?.wordBreak??"normal",i=AT(e,sr(),r?.whiteSpace,o);return ZB(i,t,n,o)}function Uu(e,t,n){return HT(e,t,!1,n)}function GT(e,t,n){return HT(e,t,!0,n)}function Wu(e,t,n){let r=PT(e,t);return{lineCount:r,height:r*n}}function t3(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function n3(e,t,n){return e.widths.length===0?0:qp(e,t,r=>{n(t3(r))})}function BT(e,t){return OT(e,t)}function UT(e){let t=0;return n3(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var r3={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function WT(e,t){let n={...r3,...t},r=1.2;for(let o=n.baseFontSize;o>=n.minFontSize;o=Math.max(n.minFontSize,o-n.step)){let i=`${n.fontWeight} ${o}px ${n.fontFamily}`,a=Uu(e,i),{lineCount:l}=Wu(a,n.maxWidth,o*r);if(l<=1)return{fontSize:o,fits:!0};if(o===n.minFontSize)break}return{fontSize:n.minFontSize,fits:!1}}var VT={prepare:Uu,layout:Wu,prepareWithSegments:GT,measureLineStats:BT,measureNaturalWidth:UT};var lr="appifact-film:";function $T(e){let{iframe:t,runnerHtml:n,load:r}=e,o=(t.getAttribute("sandbox")??"").split(/\\s+/);if(!o.includes("allow-scripts")||o.includes("allow-same-origin"))throw new Error(\'Film runners require sandbox="allow-scripts" without allow-same-origin\');let i=0,a=!1,l=!1,s=null,c,d,f=new Promise((T,H)=>{c=T,d=H});f.catch(()=>{});let m=null,b=T=>{s=T,clearTimeout(h),d(T),m&&(clearTimeout(m.timer),m.reject(T),m=null)},h=setTimeout(()=>b(new Error("Film runner did not become ready within 20 s")),2e4),y=T=>{if(T.type!==lr+"frame"&&T.type!==lr+"frame-error"||!("seq"in T)||m===null||m.sequence!==T.seq)return;let H=m;m=null,clearTimeout(H.timer),T.type===lr+"frame-error"?H.reject(new Error("message"in T?String(T.message):"Film frame failed")):H.resolve()},x=T=>{try{let H=t.contentWindow;if(!H)throw new Error("Film runner window is unavailable");H.postMessage(T,"*")}catch(H){b(H instanceof Error?H:new Error(String(H)))}},E=T=>{if(T.type===lr+"hello"){if(a){b(new Error("Film runner reloaded; recreate the bridge before seeking"));return}a=!0,x({...r,type:lr+"load"})}else T.type===lr+"ready"&&a?(clearTimeout(h),c()):T.type===lr+"error"&&b(new Error("message"in T?String(T.message):"Film runner failed"))},v=T=>{if(l||s||T.source!==t.contentWindow||T.origin!=="null")return;let H=T.data;!H||typeof H!="object"||!("type"in H)||(E(H),y(H))};return window.addEventListener("message",v),t.srcdoc=n,{ready:f,async render(T){if(await f,s)throw s;if(m)throw new Error("Film seeks must be serialized; use registerFrameSource");let H=++i;return new Promise((U,M)=>{let L=setTimeout(()=>{b(new Error("Film frame did not arrive within 15 s"))},15e3);m={sequence:H,resolve:U,reject:M,timer:L},x({type:lr+"frame",t:T,seq:H})})},dispose(){l||(l=!0,window.removeEventListener("message",v),b(new Error("Film bridge was disposed")),t.srcdoc="")}}}window.__timelines=window.__timelines||{};aA();sT();lT();t_();window.__hfHasFrameSources=zy;Zg();_b();window.__hyperframes={assetUrl:Mu,fitTextFontSize:WT,getVariables:gy,pretext:VT,registerRuntimeDataHandler:tT,setRuntimeData:Nu,clearRuntimeData:Fu,registerFrameSource:jy,createFilmBridge:$T};function qT(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,t0(),cT())}function zT(){try{fb(),yr();let e=Array.from(document.querySelectorAll(iv));e.length===0?qT():nu(e,qT).catch(t=>{li(t),reportError(t)})}catch(e){throw li(e),e}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",zT,{once:!0}):zT();})();\n';
|
|
40988
|
+
var RUNTIME_IIFE = '"use strict";(()=>{var lR=Object.create;var Lc=Object.defineProperty;var uR=Object.getOwnPropertyDescriptor;var cR=Object.getOwnPropertyNames;var dR=Object.getPrototypeOf,fR=Object.prototype.hasOwnProperty;var mR=(e,t,n)=>t in e?Lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _e=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var pR=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of cR(t))!fR.call(e,o)&&o!==n&&Lc(e,o,{get:()=>t[o],enumerable:!(r=uR(t,o))||r.enumerable});return e};var hR=(e,t,n)=>(n=e!=null?lR(dR(e)):{},pR(t||!e||!e.__esModule?Lc(n,"default",{value:e,enumerable:!0}):n,e));var be=(e,t,n)=>mR(e,typeof t!="symbol"?t+"":t,n);var wS=_e((x$,Gf)=>{var ye=String,AS=function(){return{isColorSupported:!1,reset:ye,bold:ye,dim:ye,italic:ye,underline:ye,inverse:ye,hidden:ye,strikethrough:ye,black:ye,red:ye,green:ye,yellow:ye,blue:ye,magenta:ye,cyan:ye,white:ye,gray:ye,bgBlack:ye,bgRed:ye,bgGreen:ye,bgYellow:ye,bgBlue:ye,bgMagenta:ye,bgCyan:ye,bgWhite:ye,blackBright:ye,redBright:ye,greenBright:ye,yellowBright:ye,blueBright:ye,magentaBright:ye,cyanBright:ye,whiteBright:ye,bgBlackBright:ye,bgRedBright:ye,bgGreenBright:ye,bgYellowBright:ye,bgBlueBright:ye,bgMagentaBright:ye,bgCyanBright:ye,bgWhiteBright:ye}};Gf.exports=AS();Gf.exports.createColors=AS});var Bf=_e(()=>{});var Pl=_e((v$,CS)=>{"use strict";var _S=wS(),TS=Bf(),Qi=class e extends Error{constructor(t,n,r,o,i,a){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),o&&(this.source=o),a&&(this.plugin=a),typeof n<"u"&&typeof r<"u"&&(typeof n=="number"?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(t){if(!this.source)return"";let n=this.source;t==null&&(t=_S.isColorSupported);let r=d=>d,o=d=>d,i=d=>d;if(t){let{bold:d,gray:f,red:m}=_S.createColors(!0);o=g=>d(m(g)),r=g=>f(g),TS&&(i=g=>TS(g))}let a=n.split(/\\r?\\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),c=String(s).length;return a.slice(l,s).map((d,f)=>{let m=l+1+f,g=" "+(" "+m).slice(-c)+" | ";if(m===this.line){if(d.length>160){let y=20,S=Math.max(0,this.column-y),E=Math.max(this.column+y,this.endColumn+y),v=d.slice(S,E),T=r(g.replace(/\\d/g," "))+d.slice(0,Math.min(this.column-1,y-1)).replace(/[^\\t]/g," ");return o(">")+r(g)+i(v)+`\n `+T+o("^")}let h=r(g.replace(/\\d/g," "))+d.slice(0,this.column-1).replace(/[^\\t]/g," ");return o(">")+r(g)+i(d)+`\n `+h+o("^")}return" "+r(g)+i(d)}).join(`\n`)}toString(){let t=this.showSourceCode();return t&&(t=`\n\n`+t+`\n`),this.name+": "+this.message+t}};CS.exports=Qi;Qi.default=Qi});var Uf=_e((A$,NS)=>{"use strict";var eN=/(<)(\\/?style\\b)/gi,tN=/(<)(!--)/g,nN=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/;function Gt(e){return typeof e!="string"||!e.includes("<")?e:e.replace(eN,"\\\\3c $2").replace(tN,"\\\\3c $2")}var RS={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function rN(e){return e[0].toUpperCase()+e.slice(1)}function MS(e,t){let n="@"+t.name,r=t.params?e.rawValue(t,"params"):"",o=t.raws.afterName;return typeof o>"u"?o=r?" ":"":o===""&&r&&!nN.test(r[0])&&(o=" "),n+o+r}function oN(e){if(!e.prop.startsWith("--"))return!1;let t=e.raws.before;return typeof t>"u"||!/\\S$/.test(t)}function LS(e,t,n){let r=n.nodes,o=r.length-1;for(;o>0&&r[o].type==="comment";)o-=1;let i=e.raw(n,"semicolon"),a=n.type==="document";for(let l=r.length-1;l>=0;l--){let s=r[l],c=o!==l||i;!c&&l<r.length-1&&(s.type==="atrule"&&!s.nodes||s.type==="decl"&&oN(s))&&(c=!0),t.push({document:a,node:s,semicolon:c})}}function kS(e,t,n,r){let o=e.raw(n,"between","beforeOpen");e.builder(Gt(r+o)+"{",n,"start");let i=n.nodes&&n.nodes.length,a=()=>{let l=i?e.raw(n,"after"):e.raw(n,"after","emptyBody");l&&e.builder(Gt(l)),e.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&e.builder(Gt(n.raws.ownSemicolon),n,"end")};i?(t.push(a),LS(e,t,n)):a()}var Zi=class e{constructor(t){this.builder=t}atrule(t,n){let r=MS(this,t);if(t.nodes)this.block(t,r);else{let o=(t.raws.between||"")+(n?";":"");this.builder(Gt(r+o),t)}}beforeAfter(t,n){let r;t.type==="decl"?r=this.raw(t,null,"beforeDecl"):t.type==="comment"?r=this.raw(t,null,"beforeComment"):n==="before"?r=this.raw(t,null,"beforeRule"):r=this.raw(t,null,"beforeClose");let o=t.parent,i=0;for(;o&&o.type!=="root";)i+=1,o=o.parent;if(r.includes(`\n`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<i;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(Gt(n+r)+"{",t,"start");let o;t.nodes&&t.nodes.length?(this.body(t),o=this.raw(t,"after")):o=this.raw(t,"after","emptyBody"),o&&this.builder(Gt(o)),this.builder("}",t,"end")}body(t){let n=e.prototype,r=["atrule","block","body","rule","stringify"].every(i=>this[i]===n[i]),o=[];for(LS(this,o,t);o.length>0;){let i=o.pop();if(typeof i=="function"){i();continue}let a=i.node,l=this.raw(a,"before");l&&this.builder(i.document?l:Gt(l)),r&&a.type==="rule"?kS(this,o,a,this.rawValue(a,"selector")):r&&a.type==="atrule"&&a.nodes?kS(this,o,a,MS(this,a)):this.stringify(a,i.semicolon)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(Gt("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,o=this.raw(t,"between","colon"),i=t.prop+o+this.rawValue(t,"value");t.important&&(i+=r.important||" !important"),n&&(i+=";"),this.builder(Gt(i),t)}document(t){this.body(t)}raw(t,n,r){let o;if(r||(r=n),n&&(o=t.raws[n],typeof o<"u"))return o;let i=t.parent;if(r==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return RS[r];let a=t.root(),l=a.rawCache||(a.rawCache={});if(typeof l[r]<"u")return l[r];if(r==="before"||r==="after")return this.beforeAfter(t,r);{let s="raw"+rN(r);this[s]?o=this[s](a,t):a.walk(c=>{if(o=c.raws[n],typeof o<"u")return!1})}return typeof o>"u"&&(o=RS[r]),l[r]=o,o}rawBeforeClose(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return n=r.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(o=>{if(typeof o.raws.before<"u")return r=o.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeDecl"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeDecl(t,n){let r;return t.walkDecls(o=>{if(typeof o.raws.before<"u")return r=o.raws.before,r.includes(`\n`)&&(r=r.replace(/[^\\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(n,null,"beforeRule"):r&&(r=r.replace(/\\S/g,"")),r}rawBeforeOpen(t){let n;return t.walk(r=>{if(r.type!=="decl"&&(n=r.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(t){let n;return t.walk(r=>{if(r.nodes&&(r.parent!==t||t.first!==r)&&typeof r.raws.before<"u")return n=r.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(t){let n;return t.walkDecls(r=>{if(typeof r.raws.between<"u")return n=r.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length===0&&(n=r.raws.after,typeof n<"u"))return!1}),n}rawIndent(t){if(t.raws.indent)return t.raws.indent;let n;return t.walk(r=>{let o=r.parent;if(o&&o!==t&&o.parent&&o.parent===t&&typeof r.raws.before<"u"){let i=r.raws.before.split(`\n`);return n=i[i.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(t){let n;return t.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(n=r.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(t,n){let r=t[n],o=t.raws[n];return o&&o.value===r?o.raw:r}root(t){if(t.source&&t.source.input.hasBOM&&this.builder("\\uFEFF",t,"start"),this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:Gt(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(Gt(t.raws.ownSemicolon),t,"end")}stringify(t,n){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,n)}};NS.exports=Zi;Zi.default=Zi});var ea=_e((w$,FS)=>{"use strict";var iN=Uf();function Wf(e,t){new iN(t).stringify(e)}FS.exports=Wf;Wf.default=Wf});var ta=_e((_$,Vf)=>{"use strict";Vf.exports.isClean=Symbol("isClean");Vf.exports.my=Symbol("my")});var oa=_e((T$,PS)=>{"use strict";var aN=Pl(),sN=Uf(),lN=ea(),{isClean:na,my:uN}=ta();function cN(e,t){let n=new e.constructor,r=[[e,n,t]];for(;r.length>0;){let[o,i,a]=r.pop();for(let l in o){if(!Object.prototype.hasOwnProperty.call(o,l)||l==="proxyCache")continue;let s=o[l],c=typeof s;if(l==="parent"&&c==="object")a&&(i[l]=a);else if(l==="source")i[l]=s;else if(Array.isArray(s)){let d=[];i[l]=d;for(let f of s){let m=new f.constructor;d.push(m),r.push([f,m,i])}}else{if(c==="object"&&s!==null){let d=new s.constructor;r.push([s,d,void 0]),s=d}i[l]=s}}}return n}function Qt(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,o=0;for(let i=0;i<e.length;i++){if(r===t.line&&n===t.column){o=i;break}e[i]===`\n`?(n=1,r+=1):n+=1}return o}var ra=class e{get proxyOf(){return this}constructor(t={}){this.raws={},this[na]=!1,this[uN]=!0;for(let n of Object.keys(t))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"&&r.parent?this.append(r.clone()):this.append(r)}else this[n]=t[n]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\\n\\s{4}at /.test(t.stack)){let n=this.source;t.stack=t.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let n in t)this[n]=t[n];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let n=cN(this);for(let r in t)n[r]=t[r];return n}cloneAfter(t={}){let n=this.clone(t);return this.parent.insertAfter(this,n),n}cloneBefore(t={}){let n=this.clone(t);return this.parent.insertBefore(this,n),n}error(t,n={}){if(this.source){let{end:r,start:o}=this.rangeBy(n);return this.source.input.error(t,{column:o.column,line:o.line},{column:r.column,line:r.line},n)}return new aN(t)}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:n==="root"?()=>t.root().toProxy():t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&t.markDirty()),!0}}}markClean(){this[na]=!0}markDirty(){if(this[na]){this[na]=!1;let t=this;for(;t=t.parent;)t[na]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Qt(n,this.source.start)};if(t.index)r=this.positionInside(t.index);else if(t.word){let i=n.slice(Qt(n,this.source.start),Qt(n,this.source.end)).indexOf(t.word);i!==-1&&(r=this.positionInside(i))}return r}positionInside(t){let n=this.source.start.column,r=this.source.start.line,o="document"in this.source.input?this.source.input.document:this.source.input.css,i=Qt(o,this.source.start),a=i+t;for(let l=i;l<a;l++)o[l]===`\n`?(n=1,r+=1):n+=1;return{column:n,line:r,offset:a}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,r={column:this.source.start.column,line:this.source.start.line,offset:Qt(n,this.source.start)},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:Qt(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Qt(n,this.source.start),Qt(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),o=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Qt(n,t.start)}:typeof t.index=="number"&&(r=this.positionInside(t.index)),t.end?o={column:t.end.column,line:t.end.line,offset:Qt(n,t.end)}:typeof t.endIndex=="number"?o=this.positionInside(t.endIndex):typeof t.index=="number"&&(o=this.positionInside(t.index+1));return(o.line<r.line||o.line===r.line&&o.column<=r.column)&&(o={column:r.column+1,line:r.line,offset:r.offset+1}),{end:o,start:r}}raw(t,n){return new sN().raw(this,t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let n=this,r=!1;for(let o of t)o===this?r=!0:r?(this.parent.insertAfter(n,o),n=o):this.parent.insertBefore(n,o);r||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,n){let r=n==null;n=n||new Map;let o=[],i=[[this,o,0]];for(let l=0;l<i.length;l++){let[s,c,d]=i[l],f={};c[d]=f;for(let m in s){if(!Object.prototype.hasOwnProperty.call(s,m)||m==="parent"||m==="proxyCache")continue;let g=s[m];if(Array.isArray(g)){let h=[];f[m]=h;for(let y=0;y<g.length;y++){let S=g[y];typeof S=="object"&&S.toJSON?S.toJSON===e.prototype.toJSON?i.push([S,h,y]):h[y]=S.toJSON(null,n):h[y]=S}}else if(typeof g=="object"&&g.toJSON)g.toJSON===e.prototype.toJSON?i.push([g,f,m]):f[m]=g.toJSON(null,n);else if(m==="source"){if(g==null)continue;let h=n.get(g.input);h==null&&(h=n.size,n.set(g.input,h)),f[m]={end:g.end,inputId:h,start:g.start}}else f[m]=g}}let a=o[0];return r&&(a.inputs=[...n.keys()].map(l=>l.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=lN){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let o={node:this};for(let i in r)o[i]=r[i];return t.warn(n,o)}};PS.exports=ra;ra.default=ra});var aa=_e((C$,IS)=>{"use strict";var dN=oa(),ia=class extends dN{constructor(t){super(t),this.type="comment"}};IS.exports=ia;ia.default=ia});var la=_e((R$,DS)=>{"use strict";var fN=oa(),sa=class extends fN{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}};DS.exports=sa;sa.default=sa});var bn=_e((M$,$S)=>{"use strict";var HS=aa(),GS=la(),OS=oa(),{isClean:BS,my:US}=ta(),$f,WS,VS,qf;function mN(e){let t=e.slice();for(;t.length>0;){let n=t.pop();if(delete n.source,n.nodes){n.nodes=n.nodes.slice();for(let r of n.nodes)t.push(r)}}return e.slice()}function pN(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[BS]=!1,n.proxyOf.nodes)for(let r of n.proxyOf.nodes)t.push(r)}}var Zt=class e extends OS{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...t){for(let n of t){let r=this.normalize(n,this.last);for(let o of r)this.proxyOf.nodes.push(o)}return this.markDirty(),this}cleanRaws(t){let n=[this];for(;n.length>0;){let r=n.pop();if(r!==this&&r.cleanRaws!==e.prototype.cleanRaws){r.cleanRaws(t);continue}if(OS.prototype.cleanRaws.call(r,t),r.nodes)for(let o of r.nodes)n.push(o)}}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,o;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],o=t(this.proxyOf.nodes[r],r),o!==!1);)this.indexes[n]+=1;return delete this.indexes[n],o}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get(t,n){return n==="proxyOf"?t:t[n]?n==="each"||typeof n=="string"&&n.startsWith("walk")?(...r)=>t[n](...r.map(o=>typeof o=="function"?(i,a)=>o(i.toProxy(),a):o)):n==="every"||n==="some"?r=>t[n]((o,...i)=>r(o.toProxy(),...i)):n==="root"?()=>t.root().toProxy():n==="nodes"?t.nodes.map(r=>r.toProxy()):n==="first"||n==="last"?t[n].toProxy():t[n]:t[n]},set(t,n,r){return t[n]===r||(t[n]=r,(n==="name"||n==="params"||n==="selector")&&t.markDirty()),!0}}}index(t){return typeof t=="number"?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,n){let r=this.index(t),o=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of o)this.proxyOf.nodes.splice(r+1,0,a);let i;for(let a in this.indexes)i=this.indexes[a],r<i&&(this.indexes[a]=i+o.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),o=r===0?"prepend":!1,i=this.normalize(n,this.proxyOf.nodes[r],o).reverse();r=this.index(t);for(let l of i)this.proxyOf.nodes.splice(r,0,l);let a;for(let l in this.indexes)a=this.indexes[l],r<=a&&(this.indexes[l]=a+i.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=mN(WS(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let o of t)o.parent&&o.parent.removeChild(o,"ignore")}else if(t.type)t=[t];else if(t.prop){if(typeof t.value>"u")throw new Error("Value field is missed in node creation");typeof t.value!="string"&&(t.value=String(t.value)),t=[new GS(t)]}else if(t.selector||t.selectors)t=[new qf(t)];else if(t.name)t=[new $f(t)];else if(t.text)t=[new HS(t)];else throw new Error("Unknown node type in node creation");return t.map(o=>(o[US]||e.rebuild(o),o=o.proxyOf,o.parent&&o.parent.removeChild(o),o[BS]&&pN(o),o.raws||(o.raws={}),typeof o.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(o.raws.before=n.raws.before.replace(/\\S/g,"")),o.parent=this.proxyOf,o))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let o of r)this.proxyOf.nodes.unshift(o);for(let o in this.indexes)this.indexes[o]=this.indexes[o]+r.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);let n;for(let r in this.indexes)n=this.indexes[r],n>=t&&(this.indexes[r]=n-1);return this.markDirty(),this}replaceValues(t,n,r){return r||(r=n,n={}),this.walkDecls(o=>{n.props&&!n.props.includes(o.prop)||n.fast&&!o.value.includes(n.fast)||(o.value=o.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){if(!this.proxyOf.nodes)return;let n=[{iterator:this.getIterator(),node:this.proxyOf}];for(;n.length>0;){let{iterator:r,node:o}=n[n.length-1],i=o.indexes[r];if(i>=o.proxyOf.nodes.length){delete o.indexes[r],n.pop();let s=n[n.length-1];s&&(s.node.indexes[s.iterator]+=1);continue}let a=o.proxyOf.nodes[i],l;try{l=t(a,i)}catch(s){throw a.addToError(s)}if(l===!1){for(let s of n)delete s.node.indexes[s.iterator];return!1}a.walk&&a.proxyOf.nodes?n.push({iterator:a.getIterator(),node:a}):o.indexes[r]+=1}}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,o)}):this.walk((r,o)=>{if(r.type==="atrule"&&r.name===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="atrule")return n(r,o)}))}walkComments(t){return this.walk((n,r)=>{if(n.type==="comment")return t(n,r)})}walkDecls(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,o)}):this.walk((r,o)=>{if(r.type==="decl"&&r.prop===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="decl")return n(r,o)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,o)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,o)}):this.walk((r,o)=>{if(r.type==="rule"&&r.selector===t)return n(r,o)}):(n=t,this.walk((r,o)=>{if(r.type==="rule")return n(r,o)}))}};Zt.registerParse=e=>{WS=e};Zt.registerRule=e=>{qf=e};Zt.registerAtRule=e=>{$f=e};Zt.registerRoot=e=>{VS=e};$S.exports=Zt;Zt.default=Zt;Zt.rebuild=e=>{let t=[e];for(;t.length>0;){let n=t.pop();if(n.type==="atrule"?Object.setPrototypeOf(n,$f.prototype):n.type==="rule"?Object.setPrototypeOf(n,qf.prototype):n.type==="decl"?Object.setPrototypeOf(n,GS.prototype):n.type==="comment"?Object.setPrototypeOf(n,HS.prototype):n.type==="root"&&Object.setPrototypeOf(n,VS.prototype),n[US]=!0,n.nodes)for(let r of n.nodes)t.push(r)}}});var Il=_e((k$,zS)=>{"use strict";var qS=bn(),Co=class extends qS{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};zS.exports=Co;Co.default=Co;qS.registerAtRule(Co)});var Dl=_e((L$,YS)=>{"use strict";var hN=bn(),jS,KS,Dr=class extends hN{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new jS(new KS,this,t).stringify()}};Dr.registerLazyResult=e=>{jS=e};Dr.registerProcessor=e=>{KS=e};YS.exports=Dr;Dr.default=Dr});var JS=_e((N$,XS)=>{var gN="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",bN=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o-- >0;)r+=e[Math.random()*e.length|0];return r},yN=(e=21)=>{let t="",n=e|0;for(;n-- >0;)t+=gN[Math.random()*64|0];return t};XS.exports={nanoid:yN,customAlphabet:bN}});var Ol=_e(()=>{});var Hl=_e(()=>{});var zf=_e(()=>{});var QS=_e(()=>{});var jf=_e((U$,nE)=>{"use strict";var{existsSync:xN,readFileSync:SN,realpathSync:EN}=QS(),{dirname:Gl,isAbsolute:vN,join:AN,relative:wN,sep:_N}=Ol(),{SourceMapConsumer:ZS,SourceMapGenerator:eE}=Hl();function tE(e){try{return EN(e)}catch{return e}}function TN(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var ua=class{constructor(t,n){if(n.map===!1)return;n.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let r=n.map?n.map.prev:void 0,o=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Gl(this.mapFile)),o&&(this.text=o)}consumer(){return this.consumerCache||(this.consumerCache=new ZS(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\\/json;charset=utf-?8;base64,/,r=/^data:application\\/json;base64,/,o=/^data:application\\/json;charset=utf-?8,/,i=/^data:application\\/json,/,a=t.match(o)||t.match(i);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return TN(t.substr(l[0].length));let s=t.slice(22);throw s=s.slice(0,s.indexOf(",")),new Error("Unsupported source map encoding "+s)}getAnnotationURL(t){return t.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let n=t.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!n)return;let r=t.lastIndexOf(n.pop()),o=t.indexOf("*/",r);r>-1&&o>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,o)))}loadFile(t,n,r){if(!r&&!this.unsafeMap){if(!/\\.map$/i.test(t)||!n)return;let o=wN(tE(Gl(n)),tE(t));if(o===".."||o.startsWith(".."+_N)||vN(o))return}if(this.root=Gl(t),xN(t))return this.mapFile=t,SN(t,"utf-8").toString().trim()}loadMap(t,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let r=n(t);if(r){let o=this.loadFile(r,t,!0);if(!o)throw new Error("Unable to load previous source map: "+r.toString());return o}}else{if(n instanceof ZS)return eE.fromSourceMap(n).toString();if(n instanceof eE)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;t&&(r=AN(Gl(t),r));let o=this.loadFile(r,t,!1);if(o)try{this.json=JSON.parse(o.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return o}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};nE.exports=ua;ua.default=ua});var ca=_e((W$,sE)=>{"use strict";var{nanoid:CN}=JS(),{isAbsolute:Xf,resolve:Jf}=Ol(),{SourceMapConsumer:RN,SourceMapGenerator:MN}=Hl(),{fileURLToPath:rE,pathToFileURL:Bl}=zf(),oE=Pl(),kN=jf(),Kf=Bf(),Yf=Symbol("lineToIndexCache"),LN=!!(RN&&MN),iE=!!(Jf&&Xf);function aE(e){if(e[Yf])return e[Yf];let t=e.css.split(`\n`),n=new Array(t.length),r=0;for(let o=0,i=t.length;o<i;o++)n[o]=r,r+=t[o].length+1;return e[Yf]=n,n}var Ro=class{get from(){return this.file||this.id}constructor(t,n={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,n.document&&(this.document=n.document.toString()),n.from&&(!iE||/^\\w+:\\/\\//.test(n.from)||Xf(n.from)?this.file=n.from:this.file=Jf(n.from)),iE&&LN){let r=new kN(this.css,n);if(r.text){this.map=r;let o=r.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}}this.file||(this.id="<input css "+CN(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,o={}){let i,a,l,s,c;if(n&&typeof n=="object"){let f=n,m=r;if(typeof f.offset=="number"){s=f.offset;let g=this.fromOffset(s);n=g.line,r=g.col}else n=f.line,r=f.column,s=this.fromLineAndColumn(n,r);if(typeof m.offset=="number"){l=m.offset;let g=this.fromOffset(l);a=g.line,i=g.col}else a=m.line,i=m.column,l=this.fromLineAndColumn(m.line,m.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let f=this.fromOffset(s);n=f.line,r=f.col}let d=this.origin(n,r,a,i);return d?c=new oE(t,d.endLine===void 0?d.line:{column:d.column,line:d.line},d.endLine===void 0?d.column:{column:d.endColumn,line:d.endLine},d.source,d.file,o.plugin):c=new oE(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:i,line:a},this.css,this.file,o.plugin),c.input={column:r,endColumn:i,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(Bl&&(c.input.url=Bl(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,n){return aE(this)[t-1]+n-1}fromOffset(t){let n=aE(this),r=n[n.length-1],o=0;if(t>=r)o=n.length-1;else{let i=n.length-2,a;for(;o<i;)if(a=o+(i-o>>1),t<n[a])i=a-1;else if(t>=n[a+1])o=a+1;else{o=a;break}}return{col:t-n[o]+1,line:o+1}}mapResolve(t){return/^\\w+:\\/\\//.test(t)?t:Jf(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,o){if(!this.map)return!1;let i=this.map.consumer(),a=i.originalPositionFor({column:n-1,line:t});if(!a.source)return!1;let l;if(typeof r=="number"){let f=i.originalPositionFor({column:o-1,line:r});f.source&&(l=f)}let s;Xf(a.source)?s=Bl(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||Bl(this.map.mapFile));let c={column:a.column+1,endColumn:l&&l.column+1,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(rE)c.file=rE(s);else throw new Error("file: protocol is not available in this PostCSS build");let d=i.sourceContentFor(a.source);return d&&(c.source=d),c}toJSON(){let t={};for(let n of["hasBOM","css","file","id"])this[n]!=null&&(t[n]=this[n]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};sE.exports=Ro;Ro.default=Ro;Kf&&Kf.registerInput&&Kf.registerInput(Ro)});var Mo=_e((V$,dE)=>{"use strict";var lE=bn(),uE,cE,Qn=class extends lE{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){let o=new Set;for(let a of Array.isArray(t)?t:[t])a&&typeof a=="object"&&!a.parent&&a.raws&&typeof a.raws.before<"u"&&o.add(a.raws);let i=super.normalize(t);if(n){if(r==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let a of i)o.has(a.raws)||(a.raws.before=n.raws.before)}return i}removeChild(t,n){let r=this.index(t);return!n&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(t)}toResult(t={}){return new uE(new cE,this,t).stringify()}};Qn.registerLazyResult=e=>{uE=e};Qn.registerProcessor=e=>{cE=e};dE.exports=Qn;Qn.default=Qn;lE.registerRoot(Qn)});var Qf=_e(($$,fE)=>{"use strict";var da={comma(e){return da.split(e,[","],!0)},space(e){let t=[" ",`\n`," "];return da.split(e,t)},split(e,t,n){if(typeof e!="string")return[];let r=[],o="",i=!1,a=0,l=!1,s="",c=!1;for(let f of e)if(c?c=!1:f==="\\\\"?c=!0:l?f===s&&(l=!1):f===\'"\'||f==="\'"?(l=!0,s=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&t.includes(f)&&(i=!0),i){let m=o.trim();(n||m!=="")&&r.push(m),o="",i=!1}else o+=f;let d=o.trim();return(n||d!=="")&&r.push(d),r}};fE.exports=da;da.default=da});var Ul=_e((q$,pE)=>{"use strict";var mE=bn(),NN=Qf(),ko=class extends mE{get selectors(){return NN.comma(this.selector)}set selectors(t){let n=this.selector?this.selector.match(/,\\s*/):null,r=n?n[0]:","+this.raw("between","beforeOpen");this.selector=t.join(r)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};pE.exports=ko;ko.default=ko;mE.registerRule(ko)});var bE=_e((z$,gE)=>{"use strict";var FN=Il(),PN=aa(),IN=la(),DN=ca(),ON=jf(),HN=Mo(),GN=Ul();function hE(e,t){return e.inputs?e.inputs.map(n=>{let r={...n,__proto__:DN.prototype};return r.map&&(r.map={...r.map,__proto__:ON.prototype}),r}):t}function BN(e,t,n){let r={...e};if(delete r.inputs,delete r.nodes,r.source){let{inputId:i,...a}=r.source;r.source=a,i!=null&&(r.source.input=t[i])}let o;if(r.type==="root")o=new HN(r);else if(r.type==="decl")o=new IN(r);else if(r.type==="rule")o=new GN(r);else if(r.type==="comment")o=new PN(r);else if(r.type==="atrule")o=new FN(r);else throw new Error("Unknown node type: "+e.type);if(n){o.nodes=n;for(let i of n)i.parent=o}return o}function Wl(e,t){if(Array.isArray(e))return e.map(o=>Wl(o));let n,r=[{childIndex:0,children:[],inputs:hE(e,t),json:e}];for(;r.length>0;){let o=r[r.length-1],i=o.json.nodes;if(i&&o.childIndex<i.length){let l=i[o.childIndex];o.childIndex+=1,r.push({childIndex:0,children:[],inputs:hE(l,o.inputs),json:l});continue}r.pop();let a=BN(o.json,o.inputs,i?o.children:void 0);r.length>0?r[r.length-1].children.push(a):n=a}return n}gE.exports=Wl;Wl.default=Wl});var em=_e((j$,AE)=>{"use strict";var{dirname:Vl,relative:xE,resolve:SE,sep:EE}=Ol(),{SourceMapConsumer:vE,SourceMapGenerator:$l}=Hl(),{pathToFileURL:yE}=zf(),UN=ca(),WN=!!(vE&&$l),VN=!!(Vl&&SE&&xE&&EE),Zf=class{constructor(t,n,r,o){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let n=`\n`;this.css.includes(`\\r\n`)&&(n=`\\r\n`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Vl(t.file),o;this.mapOpts.sourcesContent===!1?(o=new vE(t.text),o.sourcesContent&&(o.sourcesContent=null)):o=t.consumer(),this.map.applySourceMap(o,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let t;for(let n=this.root.nodes.length-1;n>=0;n--)t=this.root.nodes[n],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(n)}else if(this.css){let t="/*# sourceMappingURL=",n;for(;(n=this.css.lastIndexOf(t))!==-1;){let r=this.css.indexOf("*/",n+t.length);if(r===-1)break;for(;n>0&&this.css[n-1]===`\n`;)n--;this.css=this.css.slice(0,n)+this.css.slice(r+2)}}}}generate(){if(this.clearAnnotation(),VN&&WN&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,n=>{t+=n}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=$l.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new $l({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new $l({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,a;this.stringify(this.root,(l,s,c)=>{if(this.css+=l,s&&c!=="end"&&(o.generated.line=t,o.generated.column=n-1,s.source&&s.source.start?(o.source=this.sourcePath(s),o.original.line=s.source.start.line,o.original.column=s.source.start.column-1,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,this.map.addMapping(o))),a=l.match(/\\n/g),a?(t+=a.length,i=l.lastIndexOf(`\n`),n=l.length-i):n+=l.length,s&&c!=="start"){let d=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==d.last||d.raws.semicolon)&&(s.source&&s.source.end?(o.source=this.sourcePath(s),o.original.line=s.source.end.line,o.original.column=s.source.end.column-1,o.generated.line=t,o.generated.column=n-2,this.map.addMapping(o)):(o.source=r,o.original.line=1,o.original.column=0,o.generated.line=t,o.generated.column=n-1,this.map.addMapping(o)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(n=>n.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\\w+:\\/\\//.test(t))return t;let n=this.memoizedPaths.get(t);if(n)return n;let r=this.opts.to?Vl(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Vl(SE(r,this.mapOpts.annotation)));let o=xE(r,t);return this.memoizedPaths.set(t,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let n=t.source.input.map;this.previousMaps.includes(n)||this.previousMaps.push(n)}});else{let t=new UN(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(n=>{if(n.source){let r=n.source.input.from;if(r&&!t[r]){t[r]=!0;let o=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(o,n.source.input.css)}}});else if(this.css){let n=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(n,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let n=this.memoizedFileURLs.get(t);if(n)return n;if(yE){let r=yE(t).toString();return this.memoizedFileURLs.set(t,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let n=this.memoizedURLs.get(t);if(n)return n;EE==="\\\\"&&(t=t.replace(/\\\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};AE.exports=Zf});var TE=_e((K$,_E)=>{"use strict";var ql=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,zl=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,$N=/.[\\r\\n"\'(/\\\\]/,wE=/[\\da-f]/i;_E.exports=function(t,n={}){let r=t.css.valueOf(),o=n.ignoreErrors,i,a,l,s,c,d,f,m,g,h,y=r.length,S=0,E=[],v=[],T=-1;function H(){return S}function U(C){throw t.error("Unclosed "+C,S)}function M(){return v.length===0&&S>=y}function L(C){if(v.length)return v.pop();if(S>=y)return;let B=C?C.ignoreUnclosed:!1;switch(i=r.charCodeAt(S),i){case 10:case 32:case 9:case 13:case 12:{s=S;do s+=1,i=r.charCodeAt(s);while(i===32||i===10||i===9||i===13||i===12);d=["space",r.slice(S,s)],S=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let O=String.fromCharCode(i);d=[O,O,S];break}case 40:{if(h=E.length?E.pop()[1]:"",g=r.charCodeAt(S+1),h==="url"&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){s=S;do{if(f=!1,s=r.indexOf(")",s+1),s===-1)if(o||B){s=S;break}else U("bracket");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["brackets",r.slice(S,s+1),S,s],S=s}else S<=T?d=["(","(",S]:(s=r.indexOf(")",S+1),a=r.slice(S,s+1),s===-1||$N.test(a)?(T=s===-1?y:s,d=["(","(",S]):(d=["brackets",a,S,s],S=s));break}case 39:case 34:{c=i===39?"\'":\'"\',s=S;do{if(f=!1,s=r.indexOf(c,s+1),s===-1)if(o||B){s=S+1;break}else U("string");for(m=s;r.charCodeAt(m-1)===92;)m-=1,f=!f}while(f);d=["string",r.slice(S,s+1),S,s],S=s;break}case 64:{ql.lastIndex=S+1,ql.test(r),ql.lastIndex===0?s=r.length-1:s=ql.lastIndex-2,d=["at-word",r.slice(S,s+1),S,s],S=s;break}case 92:{for(s=S,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(i=r.charCodeAt(s+1),l&&i!==47&&i!==32&&i!==10&&i!==9&&i!==13&&i!==12&&(s+=1,wE.test(r.charAt(s)))){for(;wE.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}d=["word",r.slice(S,s+1),S,s],S=s;break}default:{i===47&&r.charCodeAt(S+1)===42?(s=r.indexOf("*/",S+2)+1,s===0&&(o||B?s=r.length:U("comment")),d=["comment",r.slice(S,s+1),S,s],S=s):(zl.lastIndex=S+1,zl.test(r),zl.lastIndex===0?s=r.length-1:s=zl.lastIndex-2,d=["word",r.slice(S,s+1),S,s],E.push(d),S=s);break}}return S++,d}function G(C){v.push(C)}return{back:G,endOfFile:M,nextToken:L,position:H}}});var kE=_e((Y$,ME)=>{"use strict";var qN=Il(),zN=aa(),jN=la(),KN=Mo(),CE=Ul(),YN=TE(),RE={empty:!0,space:!0};function XN(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}function tm(e,t,n){let r="";for(let o=t;o<n;o++)r+=e[o][1];return r}var nm=class{constructor(t){this.input=t,this.root=new KN,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let n=new qN;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,o,i,a=!1,l=!1,s=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?c.push(r==="("?")":"]"):r==="{"&&c.length>0?c.push("}"):r===c[c.length-1]&&c.pop(),c.length===0)if(r===";"){n.source.end=this.getPosition(t[2]),n.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(s.length>0){for(i=s.length-1,o=s[i];o&&o[0]==="space";)o=s[--i];o&&(n.source.end=this.getPosition(o[3]||o[2]),n.source.end.offset++)}this.end(t);break}else s.push(t);else s.push(t);if(this.tokenizer.endOfFile()){a=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(s),s.length?(n.raws.afterName=this.spacesAndCommentsFromStart(s),this.raw(n,"params",s),a&&(t=s[s.length-1],n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),l&&(n.nodes=[],this.current=n)}checkMissedSemicolon(t){let n=this.colon(t);if(n===!1)return;let r=0,o;for(let i=n-1;i>=0&&(o=t[i],!(o[0]!=="space"&&(r+=1,r===2)));i--);throw this.input.error("Missed semicolon",o[0]==="word"?o[3]+1:o[2])}colon(t){let n=0,r,o,i;for(let[a,l]of t.entries()){if(o=l,i=o[0],i==="("&&(n+=1),i===")"&&(n-=1),n===0&&i===":")if(!r)this.doubleColon(o);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=o}return!1}comment(t){let n=new zN;this.init(n,t[2]),n.source.end=this.getPosition(t[3]||t[2]),n.source.end.offset++;let r=t[1].slice(2,-2);if(!r.trim())n.text="",n.raws.left=r,n.raws.right="";else{let o=r.match(/^(\\s*)([^]*\\S)(\\s*)$/);n.text=o[2],n.raws.left=o[1],n.raws.right=o[3]}}createTokenizer(){this.tokenizer=YN(this.input)}decl(t,n){let r=new jN;this.init(r,t[0][2]);let o=t[t.length-1];o[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(o[3]||o[2]||XN(t)),r.source.end.offset++;let i=0;for(;t[i][0]!=="word";)i===t.length-1&&this.unknownWord([t[i]]),i++;r.raws.before+=tm(t,0,i),r.source.start=this.getPosition(t[i][2]);let a=i;for(;i<t.length;){let m=t[i][0];if(m===":"||m==="space"||m==="comment")break;i++}r.prop=tm(t,a,i);let l=i,s;for(;i<t.length&&(s=t[i],i++,s[0]!==":");)s[0]==="word"&&/\\w/.test(s[1])&&this.unknownWord([s]);r.raws.between=tm(t,l,i),(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let c=i;for(;i<t.length;){let m=t[i][0];if(m!=="space"&&m!=="comment")break;i++}let d=t.slice(c,i);t=t.slice(i),this.precheckMissedSemicolon(t);for(let m=t.length-1;m>=0;m--){if(s=t[m],s[1].toLowerCase()==="!important"){r.important=!0;let g=this.stringFrom(t,m);g=this.spacesFromEnd(t)+g,g!==" !important"&&(r.raws.important=g);break}else if(s[1].toLowerCase()==="important"){let g=t.slice(0),h="";for(let y=m;y>0;y--){let S=g[y][0];if(h.trim().startsWith("!")&&S!=="space")break;h=g.pop()[1]+h}h.trim().startsWith("!")&&(r.important=!0,r.raws.important=h,t=g)}if(s[0]!=="space"&&s[0]!=="comment")break}t.some(m=>m[0]!=="space"&&m[0]!=="comment")&&(r.raws.between+=d.map(m=>m[1]).join(""),d=[]),this.raw(r,"value",d.concat(t),n),r.value.includes(":")&&!n&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let n=new CE;this.init(n,t[2]),n.selector="",n.raws.between="",this.current=n}end(t){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(t){if(this.spaces+=t[1],this.current.nodes){let n=this.current.nodes[this.current.nodes.length-1];n&&n.type==="rule"&&!n.raws.ownSemicolon&&(n.raws.ownSemicolon=this.spaces,this.spaces="",n.source.end=this.getPosition(t[2]),n.source.end.offset++)}}getPosition(t){let n=this.input.fromOffset(t);return{column:n.col,line:n.line,offset:t}}init(t,n){this.current.push(t),t.source={input:this.input,start:this.getPosition(n)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let n=!1,r=null,o=!1,i=null,a=[],l=t[1].startsWith("--"),s=[],c=t;for(;c;){if(r=c[0],s.push(c),r==="("||r==="[")i||(i=c),a.push(r==="("?")":"]");else if(l&&o&&r==="{")i||(i=c),a.push("}");else if(a.length===0)if(r===";")if(o){this.decl(s,l);return}else break;else if(r==="{"){this.rule(s);return}else if(r==="}"){this.tokenizer.back(s.pop()),n=!0;break}else r===":"&&(o=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(i),n&&o){if(!l)for(;s.length&&(c=s[s.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(s.pop());this.decl(s,l)}else this.unknownWord(s)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,n,r,o){let i,a,l=r.length,s="",c=!0,d,f;for(let m=0;m<l;m+=1)i=r[m],a=i[0],a==="space"&&m===l-1&&!o?c=!1:a==="comment"?(f=r[m-1]?r[m-1][0]:"empty",d=r[m+1]?r[m+1][0]:"empty",!RE[f]&&!RE[d]?s.slice(-1)===","?c=!1:s+=i[1]:c=!1):s+=i[1];if(!c){let m=r.reduce((g,h)=>g+h[1],"");t.raws[n]={raw:m,value:s}}t[n]=s}rule(t){t.pop();let n=new CE;this.init(n,t[0][2]),n.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(n,"selector",t),this.current=n}spacesAndCommentsFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],!(n!=="space"&&n!=="comment"));)r=t.pop()[1]+r;return r}spacesAndCommentsFromStart(t){let n,r="";for(;t.length&&(n=t[0][0],!(n!=="space"&&n!=="comment"));)r+=t.shift()[1];return r}spacesFromEnd(t){let n,r="";for(;t.length&&(n=t[t.length-1][0],n==="space");)r=t.pop()[1]+r;return r}stringFrom(t,n){let r="";for(let o=n;o<t.length;o++)r+=t[o][1];return t.splice(n,t.length-n),r}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,n){throw this.input.error("At-rule without name",{offset:n[2]},{offset:n[2]+n[1].length})}};ME.exports=nm});var Kl=_e((X$,LE)=>{"use strict";var JN=bn(),QN=ca(),ZN=kE();function jl(e,t){let n=new QN(e,t),r=new ZN(n);try{r.parse()}catch(o){throw o}return r.root}LE.exports=jl;jl.default=jl;JN.registerParse(jl)});var rm=_e((J$,NE)=>{"use strict";var eF=bn(),{my:tF}=ta(),fa=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){n.node[tF]||eF.rebuild(n.node);let r=n.node.rangeBy(n);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in n)this[r]=n[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};NE.exports=fa;fa.default=fa});var Yl=_e((Q$,FE)=>{"use strict";var nF=rm(),ma=class{get content(){return this.css}constructor(t,n,r){this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css="",this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new nF(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};FE.exports=ma;ma.default=ma});var om=_e((Z$,IE)=>{"use strict";var PE={};IE.exports=function(t){PE[t]||(PE[t]=!0,typeof globalThis.console<"u"&&globalThis.console.warn&&globalThis.console.warn(t))}});var sm=_e((t6,GE)=>{"use strict";var rF=bn(),oF=Dl(),iF=em(),aF=Kl(),DE=Yl(),sF=Mo(),lF=ea(),{isClean:Bt,my:uF}=ta(),e6=om(),cF={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},dF={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},fF={Once:!0,postcssPlugin:!0,prepare:!0},Lo=0;function pa(e){return typeof e=="object"&&typeof e.then=="function"}function im(e){let t=!1,n=cF[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Lo,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Lo,n+"Exit"]:[n,n+"Exit"]}function OE(e){let t;return e.type==="document"?t=["Document",Lo,"DocumentExit"]:e.type==="root"?t=["Root",Lo,"RootExit"]:t=im(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function HE(e){let t=[e];for(;t.length>0;){let n=t.pop();if(n[Bt]=!1,n.nodes)for(let r of n.nodes)t.push(r)}return e}var am={},Zn=class e{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(t,n,r){this.stringified=!1,this.processed=!1;let o;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))o=HE(n);else if(n instanceof e||n instanceof DE)o=HE(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let i=aF;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{o=i(n,r)}catch(a){this.processed=!0,this.error=a}o&&!o[uF]&&rF.rebuild(o)}this.result=new DE(t,o,r),this.helpers={...am,postcss:am,result:this.result},this.plugins=this.processor.plugins.map(i=>typeof i=="object"&&i.prepare?{...i,...i.prepare(this.result)}:i)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,n){let r=this.result.lastPlugin;try{n&&n.addToError(t),this.error=t,t.name==="CssSyntaxError"&&!t.plugin?(t.plugin=r.postcssPlugin,t.setMessage()):r.postcssVersion}catch(o){globalThis.console&&globalThis.console.error&&globalThis.console.error(o)}return t}prepareVisitors(){this.listeners={};let t=(n,r,o)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,o])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!dF[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!fF[r])if(typeof n[r]=="object")for(let o in n[r])o==="*"?t(n,r,n[r][o]):t(n,r+"-"+o.toLowerCase(),n[r][o]);else typeof n[r]=="function"&&t(n,r,n[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let n=this.plugins[t],r=this.runOnRoot(n);if(pa(r))try{await r}catch(o){throw this.handleError(o)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Bt];){t[Bt]=!0;let n=[OE(t)];for(;n.length>0;){let r=this.visitTick(n);if(pa(r))try{await r}catch(o){let i=n[n.length-1].node;throw this.handleError(o,i)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let o=t.nodes.map(i=>r(i,this.helpers));await Promise.all(o)}else await r(t,this.helpers)}catch(o){throw this.handleError(o)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if(typeof t=="object"&&t.Once){if(this.result.root.type==="document"){let n=this.result.root.nodes.map(r=>t.Once(r,this.helpers));return pa(n[0])?Promise.all(n):n}return t.Once(this.result.root,this.helpers)}else if(typeof t=="function")return t(this.result.root,this.result)}catch(n){throw this.handleError(n)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,n=lF;t.syntax&&(n=t.syntax.stringify),t.stringifier&&(n=t.stringifier),n.stringify&&(n=n.stringify);let r=this.result.root.source;if(t.map===void 0&&!(r&&r.input&&r.input.map)){let a="";return n(this.result.root,l=>{a+=l}),this.result.css=a,this.result}let i=new iF(n,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let t of this.plugins){let n=this.runOnRoot(t);if(pa(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Bt];)t[Bt]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type==="document")for(let n of t.nodes)this.visitSync(this.listeners.OnceExit,n);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,n){return this.async().then(t,n)}toString(){return this.css}visitSync(t,n){for(let[r,o]of t){this.result.lastPlugin=r;let i;try{i=o(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(pa(i))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:o}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(o.length>0&&n.visitorIndex<o.length){let[a,l]=o[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===o.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=a;try{return l(r.toProxy(),this.helpers)}catch(s){throw this.handleError(s,r)}}if(n.iterator!==0){let a=n.iterator;n.descending&&(n.descending=!1,r.indexes[a]+=1);let l;for(;l=r.nodes[r.indexes[a]];){if(!l[Bt]){l[Bt]=!0,n.descending=!0,t.push(OE(l));return}r.indexes[a]+=1}n.iterator=0,delete r.indexes[a]}let i=n.events;for(;n.eventIndex<i.length;){let a=i[n.eventIndex];if(n.eventIndex+=1,a===Lo){r.nodes&&r.nodes.length&&(r[Bt]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Bt]=!0;let n=[{eventIndex:0,events:im(t),iterator:0,node:t}];for(;n.length>0;){let r=n[n.length-1],o=r.node;if(r.iterator!==0){let i=r.iterator;r.descending&&(r.descending=!1,o.indexes[i]+=1);let a,l=!1;for(;a=o.nodes[o.indexes[i]];){if(!a[Bt]){a[Bt]=!0,r.descending=!0,n.push({eventIndex:0,events:im(a),iterator:0,node:a}),l=!0;break}o.indexes[i]+=1}if(l)continue;r.iterator=0,delete o.indexes[i]}if(r.eventIndex<r.events.length){let i=r.events[r.eventIndex];if(r.eventIndex+=1,i===Lo)o.nodes&&o.nodes.length&&(r.iterator=o.getIterator());else{let a=this.listeners[i];a&&this.visitSync(a,o.toProxy())&&n.pop()}continue}n.pop()}}warnings(){return this.sync().warnings()}};Zn.registerPostcss=e=>{am=e};GE.exports=Zn;Zn.default=Zn;sF.registerLazyResult(Zn);oF.registerLazyResult(Zn)});var UE=_e((r6,BE)=>{"use strict";var mF=em(),pF=Kl(),hF=Yl(),gF=ea(),n6=om(),ha=class{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let t,n=pF;try{t=n(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,n,r){n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;let o=gF;this.result=new hF(this._processor,void 0,this._opts),this.result.css=n;let i=this;Object.defineProperty(this.result,"root",{get(){return i.root}});let a=new mF(o,void 0,this._opts,n);if(a.isMap()){let[l,s]=a.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,n){return this.async().then(t,n)}toString(){return this._css}warnings(){return[]}};BE.exports=ha;ha.default=ha});var VE=_e((o6,WE)=>{"use strict";var bF=Dl(),yF=sm(),xF=UE(),SF=Mo(),Or=class{constructor(t=[]){this.version="8.5.28",this.plugins=this.normalize(t)}normalize(t){let n=[];for(let r of t)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))n=n.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)n.push(r);else if(typeof r=="function")n.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return n}process(t,n={}){return!this.plugins.length&&!n.parser&&!n.stringifier&&!n.syntax?new xF(this,t,n):new yF(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};WE.exports=Or;Or.default=Or;SF.registerProcessor(Or);bF.registerProcessor(Or)});var JE=_e((i6,XE)=>{"use strict";var $E=Il(),qE=aa(),EF=bn(),vF=Pl(),zE=la(),jE=Dl(),AF=bE(),wF=ca(),_F=sm(),TF=Qf(),CF=oa(),RF=Kl(),lm=VE(),MF=Yl(),KE=Mo(),YE=Ul(),kF=ea(),LF=rm();function Le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new lm(e)}Le.plugin=function(t,n){let r=!1;function o(...a){globalThis.console&&globalThis.console.warn&&!r&&(r=!0,globalThis.console.warn(t+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh")&&globalThis.console.warn(t+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new lm().version,l}let i;return Object.defineProperty(o,"postcss",{get(){return i||(i=o()),i}}),o.process=function(a,l,s){return Le([o(s)]).process(a,l)},o};Le.stringify=kF;Le.parse=RF;Le.fromJSON=AF;Le.list=TF;Le.comment=e=>new qE(e);Le.atRule=e=>new $E(e);Le.decl=e=>new zE(e);Le.rule=e=>new YE(e);Le.root=e=>new KE(e);Le.document=e=>new jE(e);Le.CssSyntaxError=vF;Le.Declaration=zE;Le.Container=EF;Le.Processor=lm;Le.Document=jE;Le.Comment=qE;Le.Warning=LF;Le.AtRule=$E;Le.Result=MF;Le.Input=wF;Le.Rule=YE;Le.Root=KE;Le.Node=CF;_F.registerPostcss(Le);XE.exports=Le;Le.default=Le});function Fg(e){return e?/[\\w-]/.test(e)||e.charCodeAt(0)>=128:!1}function Pg(e){return e===" "||e===" "||e===`\n`||e==="\\r"||e==="\\f"}var gR=/^[0-9a-fA-F]{1,6}/;function bR(e){let t=e>=55296&&e<=57343;return e===0||e>1114111||t?65533:e}function Ig(e,t){return e[t]==="\\r"&&e[t+1]===`\n`?t+2:Pg(e[t])?t+1:t}function Nc(e,t){let n=e[t+1];if(n===void 0||/[\\n\\r\\f]/.test(n))return null;let r=gR.exec(e.slice(t+1,t+7));if(!r)return{value:n,end:t+2};let o=bR(Number.parseInt(r[0],16));return{value:String.fromCodePoint(o),end:Ig(e,t+1+r[0].length)}}function yR(e,t){let n=o=>Fg(o)&&!/[0-9-]/.test(o),r=o=>e[o]==="\\\\"&&Nc(e,o)!==null;return e[t]==="-"?e[t+1]==="-"||n(e[t+1])||r(t+1):n(e[t])||r(t)}function gs(e,t){let n=t;for(;e.startsWith("/*",n);){let r=e.indexOf("*/",n+2);n=r<0?e.length:r+2}return n}function ui(e,t){let n=gs(e,t);for(;Pg(e[n]);)n=gs(e,n+1);return n}function ci(e,t){if(!yR(e,t))return null;let n=t,r="";for(;n<e.length;){let o=e[n];if(o==="\\\\"){let i=Nc(e,n);if(!i)break;r+=i.value,n=i.end;continue}if(!Fg(o))break;r+=o,n+=1}return n===t?null:{value:r,end:n}}var Fc=45;function Dg(e){return e>=48&&e<=57}function xR(e){return e>=128||e===Fc||e===95||Dg(e)||e>=65&&e<=90||e>=97&&e<=122}function SR(e,t){let n=e.charCodeAt(t);return n>=1&&n<=31||n===127?!0:Dg(n)?t===0||t===1&&e.charCodeAt(0)===Fc:!1}function an(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n),o=e[n];r===0?t+="\\uFFFD":SR(e,n)?t+=`\\\\${r.toString(16)} `:n===0&&e.length===1&&r===Fc?t+=`\\\\${o}`:xR(r)?t+=o:t+=`\\\\${o}`}return t}var Og=/\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:[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 ER(e){let t=new Array(e.length).fill(!0);for(let n of e.matchAll(Og)){let r=n.index;t.fill(!1,r,r+n[0].length)}return t}function bs(e,t,n){if(t.length===0||!e.includes("#"))return e;let r=new Set(t),o=ER(e),i="",a=0;for(;a<e.length;){let l=o[a]&&e[a]==="#"?ci(e,a+1):null;l&&r.has(l.value)?(i+=n(l.value),a=l.end):(i+=e[a],a+=1)}return i}function vR(e){let t="";for(let n=0;n<e.length;n+=1){if(e[n]==="\\\\"){let r=e[n+1];if(r!==void 0&&/[\\n\\r\\f]/.test(r)){n=Ig(e,n+1)-1;continue}let o=Nc(e,n);if(o){t+=o.value,n=o.end-1;continue}}t+=e[n]}return t}function Pc(e){return Array.from(e,t=>{let n=t.charCodeAt(0);return n===0?"\\uFFFD":n<32||n===127?`\\\\${n.toString(16)} `:t===\'"\'||t==="\\\\"?`\\\\${t}`:t}).join("")}function AR(e,t){return e?{kind:"any"}:t===void 0?{kind:"none"}:{kind:"named",prefix:t}}function wR(e,t){return e[t]==="|"&&e[t+1]!=="="}function _R(e,t){let n=e[t]==="*",r=n?{value:"*",end:t+1}:ci(e,t),o=gs(e,r?.end??t);if(!wR(e,o))return n?null:r?{token:r,namespace:{kind:"none"}}:null;let i=ci(e,gs(e,o+1));return i?{token:i,namespace:AR(n,r?.value)}:null}function TR(e){if(e[0]!=="[")return null;let t=ui(e,1),n=_R(e,t);if(!n)return null;let{token:r,namespace:o}=n;return{name:r.value,rawName:e.slice(t,r.end),namespace:o,end:r.end}}function CR(e,t){let n=/^(?:"((?:\\\\[\\s\\S]|[^"\\\\])*)"|\'((?:\\\\[\\s\\S]|[^\'\\\\])*)\')/.exec(e.slice(t));return n?{value:vR(n[1]??n[2]),end:t+n[0].length}:ci(e,t)}function RR(e,t){let n=ui(e,t),r=ci(e,n);if(r){if(!/^[is]$/i.test(r.value))return null;n=ui(e,r.end)}return e[n]!=="]"||n!==e.length-1?null:{flag:r?.value}}function Hg(e){let t=TR(e);if(!t)return null;let n=ui(e,t.end),o=["=","~=","|=","^=","$=","*="].find(l=>e.startsWith(l,n));if(!o)return null;let i=CR(e,ui(e,n+o.length));if(!i)return null;let a=RR(e,i.end);return a?{name:t.name,rawName:t.rawName,namespace:t.namespace,operator:o,value:i.value,flag:a.flag}:null}function Ic(e,t){return e.replace(Og,n=>n.startsWith("[")?t(n):n)}var Ft="data-hf-svg-reference-aliases";function ys(e,t,n,r){let o={"=":(f,m)=>f===m,"~=":(f,m)=>f.split(/[ \\t\\r\\n\\f]+/).includes(m),"|=":(f,m)=>f===m||f.startsWith(m+"-"),"^=":(f,m)=>f.startsWith(m),"$=":(f,m)=>f.endsWith(m),"*=":(f,m)=>f.includes(m)},i=(f,m,g)=>!m&&g!=="="&&g!=="|="?!1:o[g](f,m),a=f=>f.replace(/[A-Z]/g,m=>m.toLowerCase()),l=f=>{let m=Hg(f);if(!m)return f;let{name:g,rawName:h,namespace:y,operator:S,value:E,flag:v}=m;if(y.kind==="named"!=(r!==void 0))return f;let T=v?.toLowerCase()==="i"?a:L=>L,H=a(g),U=n.filter(L=>{let G=y.kind==="none"?L.name:L.localName,C=y.kind==="named"?r.get(y.prefix):null;return(y.kind==="any"||L.namespaceURI===C)&&a(G)===H}),M=new Set([f]);for(let L of U)i(T(L.before),T(E),S)&&M.add(`[${h}="${Pc(L.after)}"${v?` ${v}`:""}]`);return M.size===1?f:`:is(${[...M].join(", ")})`};if(r)return Ic(e,l);let s=new Map(t.map(({id:f,replacement:m})=>[f,m])),c=new Map;for(let f of n){if(f.name!=="id"||f.before===f.after||s.has(f.before))continue;let m=c.get(f.before);m||(m=new Set([`#${an(f.before)}`]),c.set(f.before,m)),m.add(`#${an(f.after)}`)}for(let[f,m]of c)s.set(f,`:is(${[...m].join(", ")})`);let d=bs(e,[...s.keys()],f=>s.get(f));return Ic(d,l)}function yr(e,t,n=!0){let r=[],i=(n?[...e.querySelectorAll(`[${t}]`)]:[]).map(l=>l.getAttribute(t)),a=e.getAttribute?.(t);a&&i.unshift(a);for(let l of i){let s;try{s=JSON.parse(l)}catch{continue}if(!Array.isArray(s))continue;let c=s;for(let d of c){if(!kR(d))continue;let{name:f,localName:m,namespaceURI:g,before:h,after:y}=d;r.push({name:f,localName:m,namespaceURI:g,before:h,after:y})}}return r}function kR(e){if(!e||typeof e!="object")return!1;let{name:t,localName:n,namespaceURI:r,before:o,after:i}=e;return typeof t=="string"&&typeof n=="string"&&(r===null||typeof r=="string")&&typeof o=="string"&&typeof i=="string"}function LR(e){let t=[],n=[],r=!1,o,i=new WeakMap,a=(c,d)=>{for(let f of c){if("selectorText"in f){let m=f,g=i.get(m),h=m.selectorText,y=g?.applied===h?g.authored:h,S=ys(y,[],n,d);S!==h&&(m.selectorText=S),S===y?i.delete(m):i.set(m,{authored:y,applied:m.selectorText})}"cssRules"in f&&a(f.cssRules,d)}},l=()=>{if(n.length)for(let c of e.document.styleSheets){let d;try{d=c.cssRules}catch{continue}let f=new Map;for(let m of d){if(!("namespaceURI"in m))continue;let{prefix:g,namespaceURI:h}=m;g&&f.set(g,h||null)}f.size&&a(d,f)}},s={rewrite:(c,d=[])=>{if(typeof c!="string"||!c.includes("#")&&!c.includes("["))return c;let f=ys(c,d.length?[...d,...t]:t,n);if(f!==c){if(!o){let m=e.document.createElement("div");o=m.matches.bind(m)}o(c)}return f},refresh(){n=yr(e.document,Ft).filter(m=>m.before!==m.after);let c=new Set(n.filter(m=>m.name==="id").map(m=>m.before)),d=new Set;t=[];for(let m of e.document.querySelectorAll("[data-hf-authored-id][id]")){let g=m.getAttribute("data-hf-authored-id");if(!g||g===m.id||d.has(g)||c.has(g))continue;d.add(g);let h=Pc(g);t.push({id:g,replacement:`:is(#${an(g)}, [data-hf-authored-id="${h}"])`})}if(l(),r||!t.length&&!n.length)return;let f=e.Element.prototype;f.querySelector=new Proxy(f.querySelector,{apply(m,g,h){return Reflect.apply(m,g,[s.rewrite(h[0])])}}),f.querySelectorAll=new Proxy(f.querySelectorAll,{apply(m,g,h){return Reflect.apply(m,g,[s.rewrite(h[0])])}}),r=!0}};e.__hfSvgSelectorAliases=s,s.refresh()}function xr(){let e=window;e.__hfSvgSelectorAliases?e.__hfSvgSelectorAliases.refresh():LR(e)}function xs(){return globalThis}function di(e){let t="unknown error";try{e instanceof Error?(t=`${e.name}: ${e.message}`,t+=FR(e,t)):t=String(e)}catch(n){$("runtime.startupError",n)}t=t.replace(/\\s+/g," ").trim(),window.__hfStartupError=`HyperFrames runtime failed: ${t}. Check the composition\'s scripts and window.__timelines entries; if they look right, report this as a HyperFrames bug.`}var Gg="[hyperframes] scene timeline callback threw:";function $(e,t){if(typeof window>"u")return;let n=xs(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(o){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&globalThis.console.debug(`[hyperframes] ${e} swallowed:`,t)}function NR(e){let t=/(?:\\(|@|\\bat )(\\S+?):\\d+(?::\\d+)?\\)?$/.exec(e)?.[1];return!t||t.startsWith("hyperframes://")?!1:t.startsWith("hyperframes-composition://")||/\\.html?(?:[?#]|$)/i.test(t)||typeof document<"u"&&t===document.URL}function FR(e,t){try{let n=e.stack;if(typeof n!="string")return"";let i=(n===t||n.startsWith(`${t}\n`)||n.startsWith(`${t}\\r`)?n.slice(t.length):n).split(/[\\r\\n]+/).map(s=>s.trim().replace(/\\s+/g," ")).filter(s=>/^at\\s+\\S/.test(s)||/^[^@]*@.+:\\d+(?::\\d+)?$/.test(s)),a=i.slice(0,3),l=i.find(NR);return l&&!a.includes(l)&&a.push(l),a.length?` [thrown at: ${a.join(" <- ")}]`:""}catch(n){return $("runtime.startupError.stack",n),""}}var Ss="hyperframes-studio-preview",Bg="capture",Sr="data-hf-upcoming",Es="data-hf-preview-lazy";var Er="data-hf-preview-raster",zt="data-hf-autostamped",We="data-hf-clip-hidden",Pt="data-hf-far-scene",Nn="data-hf-parked-scene",vs=[Sr,Pt,Nn,Es,Er,zt];var Ug="http://www.w3.org/1999/xhtml";function Ge(e){return e!=null&&e.nodeType===1}function Te(e){return Ge(e)&&e.namespaceURI===Ug}function vr(e,t){return Te(e)&&e.localName===t}function Re(e){return vr(e,"video")}function Ar(e){return vr(e,"audio")}function Wg(e){return vr(e,"source")}function Ce(e){return Re(e)||Ar(e)}function et(e){return vr(e,"img")}function sn(e){return vr(e,"canvas")}function Vg(e){return vr(e,"style")}function $g(e){return vr(e,"link")}function wr(e){return Ge(e)&&(e.namespaceURI===Ug||e.namespaceURI==="http://www.w3.org/2000/svg")}function qg(e,t=""){return e.style.setProperty("visibility","visible",t),e.hasAttribute(We)?(e.removeAttribute(We),function(){e.setAttribute(We,"")}):()=>{}}function zg(){let e=window;return(e.HyperShader!==void 0||e.__hf?.transitions!==void 0)&&e.__hfClipRevealAware!==!0}var Xg="data-hf-first-pass-hide",jg="[data-start]:not(video, audio, img) { visibility: hidden !important; }",PR=\'img[loading="lazy"] { display: none !important; }\',Hc="data-hf-skip-hidden-images";var Jg=`[data-start]:not(video, audio, img, [${Sr}], [${zt}])`,As=`${Jg}[${We}]`,Qg=`meta[name="${Ss}"]`,Oc="data-hf-hidden-clip-contents",Kg=`[${We}][${We}]`,Yg=`[${We}][style*="visibility: hidden"]`,Zg=e=>`${Jg}${e} img { display: none !important; }`,e0=e=>{let t=[e,`${e} *`].flatMap(n=>[n,`${n}::before`,`${n}::after`]).join(", ");return`${e} * { visibility: hidden !important; } ${t} { filter: none !important; }`};function t0(e=()=>!0){return Gc(Array.from(document.querySelectorAll(`[${We}]`)).filter(e))}function Gc(e){let t=e.map(n=>qg(n));return()=>{for(let n of e)n.style.getPropertyValue("visibility")!=="hidden"&&n.style.setProperty("visibility","hidden","important");for(let n of t)n()}}function Dc(e,t,n){let r=document.createElement("style");r.setAttribute(t,""),r.textContent=n,e.appendChild(r)}function ws(){return document.querySelector(Qg)!==null}function Bc(){return document.querySelector(`style[${Hc}]`)!==null}function n0(){if(typeof document>"u")return;let e=document.head??document.documentElement;if(!e)return;let t=document.querySelector(Qg),n=t!==null,r=t?.getAttribute("content")===Bg;n&&!r&&!Bc()&&Dc(e,Hc,Zg(Kg)),document.querySelector(`style[${Oc}]`)||Dc(e,Oc,e0(Kg));let o=window;if(o.__hfFirstPassHidden||o.__hyperframeRuntimeBootstrapped)return;let i=n?`${jg} ${PR}`:jg;Dc(e,Xg,i),o.__hfFirstPassHidden=!0}function r0(){let e=window;if(!e.__hfFirstPassHidden)return!1;e.__hfFirstPassHidden=!1;for(let t of document.querySelectorAll(`style[${Xg}]`))t.remove();return!0}function o0(){if(!zg())return;let e=document.querySelector(`style[${Hc}]`);e&&(e.textContent=Zg(Yg));let t=document.querySelector(`style[${Oc}]`);t&&(t.textContent=e0(Yg))}var IR=new Set(["transform","translate","rotate","scale"]),_s=`[${Er}]`,DR=`${_s} { will-change: auto !important; }`,i0=new Set([...vs,We]),_r=null,Tr=null,Ts=null,Uc=null,Tt=new Set,a0=new WeakMap;function OR(e){return e.willChange.split(",").every(t=>IR.has(t.trim()))}function Wc(e,t,n=!0){for(let r of n?[null,"::before","::after"]:["::before","::after"]){let o=getComputedStyle(e,r);if(!(r&&o.content==="none")&&(o.position==="fixed"||!t&&(o.zIndex!=="auto"||o.mixBlendMode!=="normal")))return!0}return!1}function HR(e,t){if(t.position==="static")return!1;let n=t.zIndex!=="auto";if(Wc(e,n,!1))return!1;for(let r of e.querySelectorAll("*"))if(Wc(r,n))return!1;return!0}function s0(e,t){return`${t.zIndex}|${e.style?.willChange??""}`}function $c(e,t){if(e===_r)return!1;let n=Tt.has(e);n&&t&&fi(e,!1);let r=getComputedStyle(e),i=(n&&!t||OR(r))&&HR(e,r);return i&&a0.set(e,s0(e,r)),i}function fi(e,t){e.toggleAttribute(Er,t),t?Tt.add(e):Tt.delete(e)}function GR(e){e.hasAttribute(Er)&&Tt.add(e)}function l0(e,t){t!==Tt.has(e)&&fi(e,t)}function BR(e,t){l0(e,$c(e,t))}function u0(e){let t=e.parentElement?.closest(_s);for(;t;)Wc(e,getComputedStyle(t).zIndex!=="auto")&&fi(t,!1),t=t.parentElement?.closest(_s)}function UR(){let e=[],t=(n,r)=>{for(let o of n){let i=o.type===CSSRule.STYLE_RULE;i&&o.style.getPropertyValue("will-change")&&e.push(r?"*":o.selectorText);let a=o.styleSheet;a&&t(a.cssRules,r),"cssRules"in o&&t(o.cssRules,r||i)}};try{for(let n of[...document.styleSheets,...document.adoptedStyleSheets??[]])n!==_r?.sheet&&t(n.cssRules,!1);document.createDocumentFragment().querySelector(e.join(",")||"*")}catch{return"*"}return e.join(",")}function c0(){return Ts??(Ts=UR())}function d0(e){if(Tt.has(e)||e.style?.getPropertyValue("will-change"))return!0;let t=c0();return t!==""&&e.matches(t)}function f0(e,t){let n=[];for(let r of[e,...e.querySelectorAll("*")]){if(t.checked.has(r))continue;t.checked.add(r),GR(r);let o=r===e||t.changed.has(r);n.push([r,d0(r)&&$c(r,o)])}for(let[r,o]of n)l0(r,o);if(Tt.size)for(let[r]of n)u0(r)}function WR(e){if(Tt.has(e)){let t=getComputedStyle(e);(t.position==="static"||s0(e,t)!==a0.get(e))&&BR(e,!0)}u0(e)}function m0(){for(let e of document.querySelectorAll(_s))fi(e,!1);Tt.clear()}function Vc(){m0(),Ts=null;let e=[...document.querySelectorAll("*")].filter(t=>d0(t)&&$c(t,!0));for(let t of e)fi(t,!0);qc()}function VR(e,t){!Ge(e.target)||i0.has(e.attributeName??"")||(e.attributeName==="style"?WR(e.target):f0(e.target,t))}function $R(e){return[...e.addedNodes].filter(t=>Ge(t)&&(t.localName==="style"||t.localName==="link"))}function qR(e){let t=new Set;for(let n of e){let r=n.attributeName;r===null||r==="style"||i0.has(r)||Ge(n.target)&&t.add(n.target)}return t}function qc(){let e=Tt.size>0||c0()!=="";!Tr||e===Uc||(Uc=e,Tr.observe(document.documentElement,{subtree:!0,childList:!0,attributes:e}))}function zR(e){if(e.some(t=>t.removedNodes.length))for(let t of Tt)t.isConnected||Tt.delete(t)}function jR(e){let t=e.flatMap($R);for(let r of t)r.addEventListener("load",()=>Tr&&Vc(),{once:!0});if(t.length)return Vc();zR(e);let n={changed:qR(e),checked:new Set};for(let r of e)if(r.type==="attributes")VR(r,n);else for(let o of r.addedNodes)Ge(o)&&f0(o,n);qc()}function KR(){Tr?.disconnect(),Tr=null,_r?.remove(),_r=null,Ts=null,Uc=null,m0()}function p0(e){if(!(!(e>0)||!Number.isFinite(e))){if(e>=1)return KR();Tr||(_r=document.createElement("style"),_r.textContent=DR,(document.head??document.documentElement).append(_r),Vc(),Tr=new MutationObserver(jR),qc())}}var bt="data-hf-scene",Fn="hf-scene-parts",zc="data-hf-scene-fonts",jc=e=>e.match(/@font-face\\s*\\{[^}]*\\}/gi)??[],Pn="data-hf-scene-no-swap";var YR=`[${bt}]:not(style, script)`,XR=new Set(["absolute","fixed"]);function JR(e,t){let n=e.flatMap((a,l)=>a.start<=t&&t<=a.end?[l]:[]),r=e.filter(a=>a.start<=t).length-1,o=n.length>0?n[0]:r,i=n.length>0?n[n.length-1]:r;return e.map((a,l)=>l>=o-1&&l<=i+1)}function QR(e,t){let n=JR(e.map(r=>r.span),t);return new Set(e.filter((r,o)=>!n[o]).map(r=>r.host))}var h0=(e,t)=>({size:t,outOfFlow:XR.has(getComputedStyle(e).position)});function ZR(){let e=new WeakMap,t=typeof ResizeObserver=="function"?new ResizeObserver(r=>{for(let{target:o,borderBoxSize:i}of r){let a=i?.[0];a&&e.set(o,h0(o,`${Math.round(a.inlineSize)}px ${Math.round(a.blockSize)}px`))}}):null,n=[];return{watch(r){for(let o of n)o.isConnected||t?.unobserve(o);for(let o of r)t?.observe(o);n=r},of:r=>e.get(r)??h0(r,`${r.offsetWidth}px ${r.offsetHeight}px`)}}function g0(e){let t=null,n=null,r=new Map,o=ZR(),i=s=>s.map(c=>({host:c,span:e(c)})).filter(c=>Number.isFinite(c.span?.start)).sort((c,d)=>c.span.start-d.span.start),a=s=>{let c=!1;for(let d of s){if(d.hasAttribute(Pt))continue;let{size:f,outOfFlow:m}=o.of(d);if(!m){s.delete(d);continue}let g=d.getAttribute(bt);c||(c=r.get(g)!==f),r.set(g,f)}return c},l=()=>{n??(n=document.createElement("style")),n.textContent=[`[${Pt}] { content-visibility: hidden; }`,...Array.from(r,([s,c])=>`[${bt}="${CSS.escape(s)}"][${Pt}] { contain-intrinsic-size: ${c}; }`)].join(`\n`),n.isConnected||document.head.appendChild(n)};return s=>{if((!t||t.some(d=>!d.isConnected))&&o.watch(t=Array.from(document.querySelectorAll(YR))),t.length===0)return;let c=QR(i(t),s);(a(c)||!n?.isConnected)&&l();for(let d of t)c.has(d)!==d.hasAttribute(Pt)&&d.toggleAttribute(Pt)}}var In="data-hf-authored-duration",Dn="data-hf-authored-end";function mi(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 no(e){let t=mi(e.start);if(t==null)return null;let n=Math.max(0,t),r=mi(e.duration),o=mi(e.authoredDuration),i=r!=null&&r>0?r:o!=null&&o>0?o:null;if(i!=null)return{start:n,duration:i,end:n+i};let a=mi(e.end),l=mi(e.authoredEnd),s=a!=null&&a>n?a:l!=null&&l>n?l:null;return{start:n,duration:s==null?null:s-n,end:s}}var ro=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),R3=Object.freeze([ro.start,ro.duration,ro.trackIndex]),M3=Object.freeze([ro.derivedEnd]),k3=Object.freeze([ro.derivedEnd,ro.legacyTrack]);function On(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var y0=/^[A-Za-z0-9_.:-]+$/;function x0(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function b0(e,t){let n=t;for(;n>=0&&x0(e,n);)n--;return n}function e1(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function t1(e){let t=e.length-1;if(!x0(e,t))return null;let n=b0(e,t);return e[n]==="."&&(n=b0(e,n-1)),n+1}function n1(e){let t=t1(e);if(t==null)return null;let n=e1(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let o=e.slice(0,n).trim();if(!y0.test(o))return null;let i=Number(e.slice(t));return Number.isFinite(i)?{refId:o,operator:r,magnitude:i}:null}function Cs(e){let t=(e??"").trim();if(!t)return null;let n=On(t);if(n!=null)return{kind:"absolute",value:n};if(y0.test(t))return{kind:"reference",refId:t,offset:0};let r=n1(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var S0=e=>{let t=On(e);return t!==null&&t>=0?t:null};function Rs(e){return S0(e("data-playback-start"))??S0(e("data-media-start"))??0}var pi=.1,hi=10;function Kc(e){return Number.isFinite(e)&&e>0?Math.max(pi,Math.min(hi,e)):1}function E0(e,t=1){let n=Number.parseFloat(e("data-playback-rate")??"");return Kc(Number.isFinite(n)&&n>0?n:t)}function Yc(e){let t=On(e("data-duration"));return t!==null&&t>0?t:null}function v0(e,t){let n=Yc(e);if(n!==null)return n;let r=On(e("data-end"));return r!==null?r-t:null}var r1=3;function Xc(e,t,n){return Number.isFinite(e)?Math.max(0,e-t)/Kc(n):null}function Jc(e){let{tag:t,authoredDurationSeconds:n,sourceDurationSeconds:r,mediaStartSeconds:o,playbackRate:i}=e;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(t==="img")return{seconds:r1,source:"default"};if(r===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=Xc(r,o,i);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var Gn="data-fx-chain",I3=Gn.slice(5),A0=1,gi=(e="frequency",t="Frequency",n=1e3,r=20,o=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:o,step:1,default:n,scale:"log",automatable:!0}),Qc=(e=.707,t="Bandwidth: higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),Ms=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),w0={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},T0=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Ms(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[gi("frequency","Frequency",1e3),Ms(-40,40,0),Qc(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[gi("frequency","Frequency",200,20,2e3),Ms(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[gi("frequency","Frequency",4e3,500,2e4),Ms(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies: the usual fix for rumble on a voice.",params:[gi("frequency","Cutoff",300,20,2e4),Qc(.707),w0],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies, which darkens or muffles a track.",params:[gi("frequency","Cutoff",8e3,100,2e4),Qc(.707),w0],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Peak limiter that follows the signal\'s level. It has no lookahead, so a fast peak or an inter-sample peak can pass the ceiling; use the true-peak limiter for a delivery limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"truepeak",label:"True-peak limiter",group:"dynamics",description:"Lookahead limiter that holds a 4x estimate of the inter-sample peak at a dBTP ceiling; full-band noise can land up to about 1.7 dB above it. Adds lookahead plus about 0.3 ms of latency.",params:[{kind:"number",key:"ceiling",label:"Ceiling",unit:"dBTP",min:-24,max:0,step:.1,default:-1,hint:"Target true peak, measured on a 4x oversampled signal. Dense full-band sound can end up to about 1.7 dB above it."},{kind:"number",key:"lookahead",label:"Lookahead",unit:"ms",min:.5,max:10,step:.1,default:3,hint:"How far ahead the gain starts falling. Longer is smoother and adds the same latency."},{kind:"number",key:"release",label:"Release",unit:"ms",min:10,max:2e3,step:1,default:80,scale:"log"}],web:"worklet-truepeak"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times, a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],Zc=new Map(T0.map(e=>[e.id,e]));function bi(e){return Zc.get(e)}var D3=T0.map(e=>e.id);function yi(e,t){let n=Zc.get(e);if(!n)return{};let r={};for(let o of n.params){let i=t?.[o.key];if(o.kind==="enum"){let l=o.options.some(s=>s.value===i);r[o.key]=l?i:o.default;continue}let a=typeof i=="number"?i:typeof i=="string"&&i.trim()!==""?Number(i):Number.NaN;r[o.key]=Number.isFinite(a)?Math.min(o.max,Math.max(o.min,a)):o.default}return r}var Hn=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function C0(e){let t;try{t=JSON.parse(e)}catch(o){throw new Hn(`Chain file is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Hn("Chain file must be a JSON object.");let n=t;if(n.version!==A0)throw new Hn(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Hn("Chain file is missing a `nodes` array.");let r=n.nodes.map(o1);return{version:A0,nodes:r}}function xi(e){return e.nodes.filter(t=>t.enabled!==!1)}function o1(e,t){if(typeof e!="object"||e===null)throw new Hn(`Node ${t} is not an object.`);let n=e;if(typeof n.type!="string"||!Zc.has(n.type))throw new Hn(`Node ${t} has unknown effect type: ${String(n.type)}`);return a1({type:n.type,id:ks(n.id),fromCarve:_0(n.fromCarve),fromPreset:ks(n.fromPreset),label:ks(n.label),fromEq:ks(n.fromEq),fromLeveller:_0(n.fromLeveller),presetAmount:i1(n.presetAmount),enabled:n.enabled!==!1,params:yi(n.type,n.params??void 0)})}function ks(e){return typeof e=="string"&&e?e:void 0}function _0(e){return e===!0?!0:void 0}function i1(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(1,Math.max(0,e))}function a1(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}function s1(e){return 10**(e/20)}var Cr=s1(12);function Ve(e){return Number.isFinite(e)?Math.max(0,Math.min(Cr,e)):1}function Ns(e,t){return Ve(e*t)}function R0(e,t){return t?1:Ve(e)}function Ls(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function M0(e,t){let n=typeof HTMLMediaElement>"u"?void 0:Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype,"volume"),r=n?.get,o=n?.set;if(!r||!o)return t();let i=Number(r.call(e));Object.defineProperty(e,"volume",{configurable:!0,get:()=>i,set:a=>{i=Number(a),o.call(e,Ls(i))}});try{return t()}finally{delete e.volume,o.call(e,Ls(i))}}var un="data-automation",$3=un.slice(5),Ps=1,l1=512,ln=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},oo="volume",Is="rate";function Ei(e){if(e===oo)return{kind:"volume"};if(e===Is)return{kind:"rate"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===u1){let o=t[2];return o?{kind:"preset",presetId:o}:null}if(t.length!==3||t[0]!=="fx")return null;let[,n,r]=t;return!n||!r?null:{kind:"fx",nodeId:n,param:r}}var u1="preset";var c1={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},Ds={min:0,max:Cr,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function d1(e){return Math.min(4096,Math.max(2,Math.ceil(e*30)))}function ed(e){return!!e.curve||e.viaX!==void 0&&e.viaY!==void 0}function Fs(e,t,n=!1){let r=Ve(t),o=Ns(r,e);return n&&r>0?o/r:o}function k0(e,t,n=!1){let r=[],o=e.points,i=Ve(t);for(let a=0;a<o.length;a+=1){let l=o[a],s=o[a+1];if(!(s!==void 0&&(i*l.v-Cr)*(i*s.v-Cr)<0)){r.push({...l,v:Fs(l.v,t,n)});continue}if(r.push({t:l.t,v:Fs(l.v,t,n)}),ed(l)){let d=d1(s.t-l.t);for(let f=1;f<d;f+=1){let m=l.t+(s.t-l.t)*f/d;r.push({t:m,v:Fs(jt(e,m),t,n)})}}else{let d=l.t+(Cr/i-l.v)/(s.v-l.v)*(s.t-l.t);r.push({t:d,v:Fs(Cr/i,i,n)})}}return r}var L0={min:pi,max:hi,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function td(e,t){let n=Ei(e);if(!n)return null;if(n.kind==="volume")return Ds;if(n.kind==="rate")return L0;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...c1,label:`${n.presetId} \\xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let o=bi(r.type),i=o?.params.find(a=>a.key===n.param);return!i||i.kind!=="number"?null:{min:i.min,max:i.max,step:i.step,unit:i.unit,label:`${o?.label??r.type} \\xB7 ${i.label}`,scale:i.scale==="log"&&i.min>0?"log":"linear",default:i.default}}function Si(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return null}function f1(e){let t=Si(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function N0(e,t){let n=Si(e),r=Si(t);if(n===null||r===null)return null;let o=l=>Math.min(.999,Math.max(.001,l)),i=o(n),a=o(r);return Math.abs(i-a)<1e-6?null:{x:i,y:a}}function m1(e){let t=f1(e?.curve),n=N0(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function p1(e,t){let n=Si(e?.t),r=Si(e?.v);if(n===null||r===null)return null;let o=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:o,...m1(e)}}function F0(e,t){let n=e.map(o=>p1(o,t)).filter(o=>o!==null).sort((o,i)=>o.t-i.t),r=[];for(let o of n)r.length>0&&r[r.length-1].t===o.t?r[r.length-1]=o:r.push(o);return r.slice(0,l1)}function h1(e){let t=[];for(let n of e.lanes){if(!Ei(n.target))continue;let r=n.target===oo?Ds:n.target===Is?L0:null,o=F0(n.points??[],r);o.length>0&&t.push({target:n.target,points:o})}return{version:Ps,lanes:t}}function P0(e,t){let n=[];for(let r of e.lanes){let o=td(r.target,t);if(!o)continue;let i=F0(r.points,o);i.length>0&&n.push({target:r.target,points:i})}return{version:Ps,lanes:n}}function Os(e){let t;try{t=JSON.parse(e)}catch(o){throw new ln(`Automation is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new ln("Automation must be a JSON object.");let n=t;if(n.version!==Ps)throw new ln(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new ln("Automation is missing a `lanes` array.");let r=n.lanes.map((o,i)=>{if(typeof o!="object"||o===null)throw new ln(`Lane ${i} is not an object.`);let a=o;if(typeof a.target!="string"||!Ei(a.target))throw new ln(`Lane ${i} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new ln(`Lane ${i} is missing a \\`points\\` array.`);return{target:a.target,points:a.points}});return h1({version:Ps,lanes:r})}function g1(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function b1(e,t){let n=e-.5,r=t-.5,o=.999,i=1e6,a=n>0?n/(o-e):n<0?-n/(e-(1-o)):0,l=r>0?r/(o-t):r<0?-r/(t-(1-o)):0,s=Math.min(i,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function y1(e,t,n){let{cx:r,cy:o,w:i}=b1(t,n),a=2-2*i,l=e*a-1+2*i*r,s=-e*a-2*i*r,c=x1(l,s,e),d=1-c,f=d*d+2*i*c*d+c*c;return f>0?(2*i*o*c*d+c*c)/f:e}function x1(e,t,n){if(Math.abs(e)<1e-12)return Math.abs(t)<1e-12?n:-n/t;let r=Math.sqrt(Math.max(0,t*t-4*e*n)),o=(-t+r)/(2*e),i=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(o)?Math.min(1,Math.max(0,o)):a(i)?Math.min(1,Math.max(0,i)):n}function S1(e,t){let n=N0(t.viaX,t.viaY);return n?y1(Math.min(1,Math.max(0,e)),n.x,n.y):g1(e,t.curve)}function E1(e,t,n,r){return r==="log"&&e>0&&t>0?Math.exp(Math.log(e)+(Math.log(t)-Math.log(e))*n):e+(t-e)*n}function jt(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let o=r[0];if(t<=o.t)return o.v;let i=r[r.length-1];if(t>=i.t)return i.v;let a=0,l=r.length-1;for(;l-a>1;){let f=a+l>>1;r[f].t<=t?a=f:l=f}let s=r[a],c=r[l],d=c.t-s.t;return d<=0?c.v:E1(s.v,c.v,S1((t-s.t)/d,s),n)}function I0(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function D0(e,t,n,r,o="linear"){let i=Math.max(2,Math.floor(r)),a=new Float32Array(i),l=n-t;for(let s=0;s<i;s+=1)a[s]=jt(e,t+l*s/(i-1),o);return a}var Hs=new Map,v1=64;function nd(e,t=oo){let n=`${t}\\0${e}`,r=Hs.get(n);if(r!==void 0)return r;let o=null;try{o=Os(e).lanes.find(i=>i.target===t)??null}catch{o=null}return Hs.size>v1&&Hs.clear(),Hs.set(n,o),o}function O0(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(un):null)??"";if(!n)return null;let r=nd(n);return!r||r.points.length===0?null:jt(r,t)}var H0=48,G0=new WeakMap;function A1(e){let t=e.points,n=t[0].v,r=t[t.length-1].v,o=[0],i=[0],a=s=>{let c=o[o.length-1];if(s<=c)return;let d=jt(e,c,"log");o.push(s),i.push(i[i.length-1]+(d+jt(e,s,"log"))/2*(s-c))},l=Math.max(0,t[0].t);a(l);for(let s=1;s<t.length;s+=1){let c=t[s-1].t,d=t[s].t;if(!(d<=0))for(let f=1;f<=H0;f+=1)a(Math.max(c,0)+(d-c)*f/H0)}return{ts:Float64Array.from(o),ss:Float64Array.from(i),firstRate:n,lastRate:r}}function B0(e){let t=G0.get(e);return t||(t=A1(e),G0.set(e,t)),t}function rd(e){return typeof e!="number"&&e.points.length>0}function vi(e,t){return typeof e=="number"?e:rd(e)?jt(e,t,"log"):1}function U0(e,t,n){let r=0,o=e.length-1;for(;o-r>1;){let i=r+o>>1;e[i]<=n?r=i:o=i}return t[r]+(t[o]-t[r])*(n-e[r])/(e[o]-e[r])}function Bn(e,t){if(typeof e=="number")return t*e;if(!rd(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=B0(e),a=n.length-1;return t<=0?t*o:t>=n[a]?r[a]+(t-n[a])*i:U0(n,r,t)}function cn(e,t){if(typeof e=="number")return t/e;if(!rd(e))return t;let{ts:n,ss:r,firstRate:o,lastRate:i}=B0(e),a=n.length-1;return t<=0?t/o:t>=r[a]?n[a]+(t-r[a])/i:U0(r,n,t)}function w1(e){return e?nd(e,Is):null}function W0(e,t){return w1(e)??t}var J3=[{id:"montage",label:"Montage",points:[[0,.9],[.15,.3],[.5,2.5],[.85,.3],[1,.9]]},{id:"hero",label:"Hero",points:[[0,1],[.25,1.6],[.5,.25],[.75,1.6],[1,1]]},{id:"bullet",label:"Bullet",points:[[0,3],[.4,3],[.5,.15],[.6,3],[1,3]]},{id:"jump-cut",label:"Jump cut",points:[[0,.5],[.24,.5],[.26,3],[.5,3],[.52,.5],[.74,.5],[.76,3],[1,3]]},{id:"flash-in",label:"Flash in",points:[[0,.3],[.6,.6],[1,5]]},{id:"flash-out",label:"Flash out",points:[[0,5],[.4,.6],[1,.3]]},{id:"ramp-in",label:"Ramp in",points:[[0,.5],[1,1]]},{id:"ramp-out",label:"Ramp out",points:[[0,1],[1,.5]]},{id:"slowmo-middle",label:"Slow-mo middle",points:[[0,1],[1/3,.35],[2/3,.35],[1,1]]}];function Ue(e){return On(e)}function lt(e){return E0(t=>e.getAttribute(t),Ce(e)?e.defaultPlaybackRate:1)}function Et(e){return W0(e.getAttribute("data-automation"),lt(e))}function Ct(e){return Rs(t=>e.getAttribute(t))}function Kt(e,t){return _1(t,Ct(e),Et(e))}function io(e){let t=Jc({tag:"video",authoredDurationSeconds:Yc(n=>e.getAttribute(n)),sourceDurationSeconds:Number.isFinite(e.duration)?e.duration:null,mediaStartSeconds:Ct(e),playbackRate:lt(e)});return t.source==="media"?Kt(e,e.duration):t.seconds}function ao(e,t=0){return!et(e)||!e.hasAttribute("data-start")&&!e.hasAttribute("data-track-index")?null:Jc({tag:"img",authoredDurationSeconds:v0(n=>e.getAttribute(n),t),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function _1(e,t,n){return typeof n=="number"?Xc(e,t,n):Number.isFinite(e)?cn(n,Math.max(0,e-t)):null}var T1=e=>e.paused?.()===!0?(e.startTime?.()??0)+(e.totalDuration?.()??0)/Math.abs(e.timeScale?.()||1):0;function dn(e){try{if(typeof e?.duration!="function")return null;let t=e.getChildren?.(!1,!1,!0),n=Array.isArray(t)?t:[],r=Math.max(Number(e.duration()),...n.map(T1));return Number.isFinite(r)?r:null}catch(t){return $("runtime.timelineDuration",t),null}}function Rr(e){if(e==null||e.trim()==="")return null;let t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function so(e){if(e==null||e.trim()==="")return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>0?t:null}function vt(e=document){let t=e.querySelector(\'[data-composition-id][data-root="true"]\');return Te(t)?t:e.querySelector("[data-composition-id]")}var C1=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function od(e){return e.id||e.getAttribute("data-hf-id")||null}function R1(e){return Ue(e)}function M1(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=dn(t[n]);return r!=null&&r>0?r:null}function k1(e){return Ce(e)?Number.isFinite(e.duration)?Kt(e,e.duration):null:ao(e)}function L1(e,t,n,r){let o=R1(e.getAttribute("data-duration"));return o!=null&&o>0?o:M1(e,t)??k1(e)??Math.max(0,n-r)}function N1(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let o=e.get(r);if(o){n.parentId=o.id,o.children.push(n);break}r=r.parentElement}}}function V0(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,o=new Map,i=vt(),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===i||C1.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(L1(l,n,r,s)<=0)continue;let c={id:od(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};o.set(l,c)}return N1(o),{roots:Array.from(o.values()).filter(l=>l.parentId===null)}}var id="css:root",$0=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],F1=new Set([...$0,"contain","isolation","mask-border","mix-blend-mode","opacity"]),P1=new Set(["absolute","relative"]),I1=new Set(["flex","inline-flex","grid","inline-grid"]),D1=new Set(["layout","paint","strict","content"]),O1=new Set(["size","inline-size"]);function H1(e){return e.position==="fixed"||e.position==="sticky"}function G1(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(P1.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&I1.has(n)}function B1(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:$0.some(r=>{let o=e.getPropertyValue(r);return o!==""&&o!=="none"})}function U1(e){return e.getPropertyValue("contain").split(/\\s+/).some(n=>D1.has(n))?!0:O1.has(e.getPropertyValue("container-type"))}function W1(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>F1.has(t))}function V1(e,t){return e.hasAttribute(Er)||H1(t)||G1(e,t)||B1(t)||U1(t)?!0:W1(t)}function $1(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 Gs(e,t){let n=t?.get(e.parentElement);if(n!==void 0)return n;let r=q1(e);return t?.set(e.parentElement,r),r}function q1(e){let t=e.ownerDocument.defaultView;if(!t)return id;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(V1(n,t.getComputedStyle(n)))return $1(n)}catch{return id}n=n.parentElement}return id}var Bs="data-hf-media-start-basis";function q0(e){return e?.trim().toLowerCase()==="global"?"global":"local"}function z1(e){return q0(e.basis)==="global"?e.authoredStart:e.hostStart+e.authoredStart}function z0(e){return K0(e)?z1({authoredStart:e.authoredStart,hostStart:e.hostStart,basis:e.basis}):e.ordinaryStart()}function j0(e){return K0(e)&&q0(e.basis)==="global"}function K0(e){return!e.hasAutoStart&&e.authoredStart!=null&&e.hostStart!==0}function ad(e){return Rs(t=>e.getAttribute(t))}function Y0(e,t){return e-ad(t)}function Mr(e,t){return t.reduce((n,r)=>{let o=Math.max(n.start,r.start);return{start:o,end:Math.max(o,Math.min(n.end,r.end))}},e)}function ut(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,o=new WeakMap,i=new WeakMap,a=new Set,l=C=>(C.hasAttribute("data-composition-id")?C.parentElement:C)?.closest("[data-composition-id]")??null,s=(C,B)=>{let O=l(B);if(O){for(let Z of O.querySelectorAll(`[id="${C}"]`))if(l(Z)===O)return Z}let Y=r.getElementById(C);return Y||(Array.from(r.querySelectorAll("[data-composition-id]")).find(Z=>Z.getAttribute("data-composition-id")===C)??null)},c=(C,B)=>n?C.getAttribute(B):null,d=C=>no({start:0,duration:C.getAttribute("data-duration"),authoredDuration:c(C,"data-hf-authored-duration")})?.duration??no({start:H(C,0),end:C.getAttribute("data-end"),authoredEnd:c(C,"data-hf-authored-end")})?.duration??null,f=C=>C!=null&&Number.isFinite(C)&&C>0?C:null,m=C=>{let B=C.getAttribute("data-composition-id");return B?f(dn(t[B])):null},g=C=>{let B=i.get(C);if(B!==void 0)return B;let O=d(C)??f(Ce(C)?Kt(C,C.duration):null)??f(ao(C))??m(C);return i.set(C,O),O},h="[data-composition-src], [data-composition-id], [data-composition-file]",y=C=>C.matches(h),S=C=>!C.hasAttribute("data-composition-id")||Cs(C.getAttribute("data-start"))?null:C.parentElement?.closest(`[data-start], ${h}`)??null,E=(C,B)=>Y0(H(C,B),S(C)??C),v=(C,B)=>{let O=C.hasAttribute("data-composition-id")?C.parentElement?.closest("[data-composition-id]"):C.closest("[data-composition-id]");return O?E(O,B):0},T=(C,B)=>{let O=Cs(C.getAttribute("data-start"));if(!O){let V=S(C);return V?H(V,B):B}if(O.kind==="absolute")return v(C,B)+Math.max(0,O.value);let Y=s(O.refId,C);if(!Y)return B;let Z=H(Y,0),J=g(Y)??0,D=Math.min(0,v(C,0));return Math.max(D,Z+J+O.offset)},H=(C,B)=>{let O=o.get(C);if(O!==void 0)return O??B;if(a.has(C))return B;a.add(C);try{let Y=T(C,B);return o.set(C,Y),Y}finally{a.delete(C)}},U=C=>{let B=C.closest("[data-composition-id]");return{authoredStart:Ue(C.getAttribute("data-start")),hostStart:B?E(B,0):0,hasAutoStart:C.hasAttribute("data-hf-auto-start"),basis:C.getAttribute(Bs)}};return{resolveStartForElement:(C,B=0)=>H(C,Math.max(0,B)),resolveDurationForElement:C=>g(C),resolveMediaStartForElement:C=>{let B=U(C);return z0({...B,ordinaryStart:()=>H(C,B.hostStart)})},resolveHostStartForElement:C=>v(C,0),resolveHostSlotsForElement:C=>{let B=[];for(let O=C.parentElement;O;O=O.parentElement){if(!y(O)||S(O)||ad(O)<=0)continue;let Y=H(O,0),Z=d(O);B.push({start:Y,end:Z?Y+Z:1/0})}return B},isRootGlobalMediaStartForElement:C=>Ce(C)&&j0(U(C))}}var Ai=e=>4*Number.EPSILON*Math.max(1,Math.abs(e));function lo(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?e===t:Math.abs(e-t)<=Ai(Math.max(Math.abs(e),Math.abs(t)))}var X0=(e,t)=>e>=t||lo(e,t),fn=(e,t,n)=>X0(e,t)&&e<n&&!lo(e,n),j1=1e-6,uo=(e,t,n,r)=>fn(e,t,n)||X0(e,t)&&r>0&&n>=r-j1;var K1=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-width","border-style","border-color","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function sd(e){return Number.isFinite(e)&&e>0?e:30}function ld(e){return Number.isFinite(e)&&e>0?e:0}function ud(e,t){let n=sd(t);return Math.floor(ld(e)*n+1e-9)/n}function Q0(e,t,n){let r=Number.isInteger(n)?n:1;if(r<=1)return ud(e,t);let o=sd(t)*r;return Math.round(ld(e)*o)/o}function J0(e,t){let n=sd(t),r=ld(e),o=r*n,i=Math.round(o);return Math.abs(o-i)<=.001?i/n:r}function Us(e,t,n){return{start:J0(e,n),end:Number.isFinite(t)?J0(t,n):t}}function Z0(e,t,n=K1){for(let r of n){let o=t.getPropertyValue(r);o&&e.setProperty(r,o)}}function cd(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var wi="hf-runtime-filler",dd="runtime_media_load_failed",Y1=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data","play-range"];function X1(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let o=n%r;n=r,r=o}return n||1}function J1(e){let t=Number.isFinite(e)&&e>0?e:30,n=Math.abs(t*1001-Math.round(t*1001))<1e-6,r=Number.isInteger(t)?1:n?1001:1e6,o=Math.round(t*r),i=X1(o,r);return{numerator:o/i,denominator:r/i}}function eb(e,t,n){return Math.max(e,(Math.ceil(t*n-1e-6)-1)/n)}function fd(e){if(typeof e!="object"||e===null)return null;let t=e;return!Number.isFinite(t.numerator)||!Number.isFinite(t.denominator)||(t.numerator??0)<=0||(t.denominator??0)<=0?null:Number(t.numerator)/Number(t.denominator)}function Ws(e){return{protocolVersion:1,capabilities:Y1,fps:J1(e)}}function Q1(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function tb(e,t=30){if(typeof e!="object"||e===null)return{status:"legacy",fps:t};let n=e;if(n.protocolVersion===void 0)return{status:"legacy",fps:t};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let r=fd(n.fps);return r===null||!Q1(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var nb=e=>e!==null&&Number.isFinite(e)&&e>0;function _i(e){let t=e.clipEndsSeconds.filter(r=>r===null).length;if(nb(e.authoredDurationSeconds))return{seconds:e.authoredDurationSeconds,source:"authored",pendingClips:t};let n=e.clipEndsSeconds.filter(nb);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"}}function md(){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}}var co=7200,mn=1/60,Ti=e=>e!==null&&e>mn?e:null;function rb(e){return{width:so(e.getAttribute("data-width")),height:so(e.getAttribute("data-height"))}}function ob(e,t){let n=null;for(let r of e.querySelectorAll("video[data-start], audio[data-start]")){let o=t.mediaStart(r);if(!Number.isFinite(o))continue;let i=t.mediaDuration(r);if(i==null||i<=mn)continue;let a=Math.max(0,o)+i;(!n||a>n.seconds)&&(n={seconds:a,element:r})}return n&&Ti(n.seconds)!==null?n:null}function ib(e,t){let n=[];for(let o of e.querySelectorAll("[data-composition-id][data-start]")){if(o.parentElement?.closest("[data-composition-id]")!==e)continue;let i=t.resolveStartForElement(o,0),a=t.resolveDurationForElement(o);!Number.isFinite(i)||a==null||a<=0||n.push(Math.max(0,i)+a)}let r=Ue(e.getAttribute("data-duration"));return Ti(_i({authoredDurationSeconds:null,clipEndsSeconds:[r,...n]}).seconds)}var Z1=e=>e.hasAttribute("data-composition-id")||e.hasAttribute("data-composition-src");function ab(e,t,{unregisteredLottie:n}){let r=[];for(let i of e.querySelectorAll("[data-start]")){let a=t.resolveStartForElement(i,0);if(!Number.isFinite(a))continue;let l=t.resolveDurationForElement(i);l!=null?r.push(Math.max(0,a)+l):(Ce(i)||Z1(i))&&r.push(null)}(n||e.querySelector("[data-lottie-src]"))&&r.push(null);let o=_i({authoredDurationSeconds:null,clipEndsSeconds:r});return o.pendingClips>0?{...o,seconds:null,source:"unresolved",reason:"a clip\'s length is pending"}:o}function sb(e){if(e.declared!==null&&Number.isFinite(e.declared)&&e.declared>0)return{seconds:e.declared,from:"declared",floorIndex:null};let t=Ti(e.timeline()),n=e.floors().map(f=>f??0),r=Math.max(0,...n),o=Number.isFinite(e.fallback)&&e.fallback>mn?e.fallback:0,i=Math.max(r,o),l=t!==null&&t>=co&&Ti(i)!==null?null:t,s=r>=o,c=f=>({seconds:f,from:s?"floor":"fallback",floorIndex:s?n.indexOf(r):null});if(l!==null)return l>=i?{seconds:l,from:"timeline",floorIndex:null}:c(i);if(Ti(r)!==null)return c(i);if(o>0)return{seconds:o,from:"fallback",floorIndex:null};let d=e.derived();return{seconds:d>0?d:0,from:"derived",floorIndex:null}}function Vs(e,t){let n=e.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return null;let o=n==="video"||n==="audio"?t.resolver.resolveMediaStartForElement(e):t.resolver.resolveStartForElement(e,0),i=t.resolver.resolveDurationForElement(e),a=e.getAttribute("data-composition-id");if(a){let s=t.timelineRegistry[a],c=dn(s);!(e.hasAttribute("data-duration")||e.hasAttribute("data-end")||e.hasAttribute(In)||e.hasAttribute(Dn))&&(i==null||i<=0)&&c!=null&&c>0&&(i=c)}let l=a!==null&&e===vt(e.ownerDocument);return{start:o,end:!l&&i!=null&&i>0?o+i:Number.POSITIVE_INFINITY}}function $s(e,t){let n=Vs(e,t);if(!n)return!1;let r=t.exportRenderSeek?Us(n.start,n.end,t.canonicalFps):n;return uo(t.currentTime,r.start,r.end,t.compositionDuration)}function Ri(e){return Ue(e)}function Mi(e){let t=e.getAttribute("data-duration"),n=e.getAttribute(In),r=no({start:0,duration:t,authoredDuration:n})?.duration;return r??([t,n].map(Ri).some(i=>i!=null&&i<=0)?0:null)}function lb(e){return no({start:0,end:e.getAttribute("data-end"),authoredEnd:e.getAttribute(Dn)})?.end??null}function pd(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 hd(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function fo(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 ki(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 ub(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return ki(t);let n=e.getAttribute("data-composition-src");if(n)return ki(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?ki(r.getAttribute("src")):null}function tM(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 nM(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 rM(e){let t=e.textContent?.replace(/\\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function Ci(e){let t=e.replace(/\\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\\s+/g," ").trim();return t?t.replace(/\\b\\w/g,n=>n.toUpperCase()):e}function cb(e){return e.getAttribute("data-hf-original-composition-id")??e.getAttribute("data-composition-id")}function oM(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 o=cb(e);if(o)return Ci(o);let i=e.id;if(i)return Ci(i);let a=tM(e);if(a)return Ci(a);let l=nM(ub(e));if(l)return Ci(l);let s=rM(e);return s||`${Ci(t)} ${n+1}`}function gd(e){let t=new Map,r=window.__timelines??{},o=ut({timelineRegistry:r,includeAuthoredTimingAttrs:!0}),i=z=>{if(!z)return null;let ee=dn(r[z]);return ee!=null&&ee>0?ee:null},a=()=>{let z=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(z.length===0)return null;let ee=0;for(let Q of z){let fe=o.resolveMediaStartForElement(Q);if(!Number.isFinite(fe))continue;let ce=io(Q);ce==null||ce<=0||(ee=Math.max(ee,Math.max(0,fe)+ce))}return ee>0?ee:null},l=(z,ee)=>{let Q=[],fe=null,ce=null,xe=null,re=z.parentElement;for(;re;){let ie=re.getAttribute("data-composition-id");ie&&(Q.push(ie),!xe&&re!==ee&&(xe=ie),fe==null&&(fe=o.resolveStartForElement(re,0)),ce==null&&(ce=Ri(re.getAttribute("data-duration"))??i(ie)??null)),re=re.parentElement}return{parentCompositionId:xe,compositionAncestors:Q.reverse(),inheritedStart:fe,inheritedDuration:ce}},s=vt(),c=Array.from(document.querySelectorAll("[data-composition-id]")),d=s?.getAttribute("data-composition-id")??null,f=s?o.resolveStartForElement(s,0):0,m=a(),g=m!=null?Math.max(0,m-Math.max(0,f)):null,h=i(d),y=Mi(s??document.body),S=hd(...c.filter(z=>z!==s).map(z=>{let ee=o.resolveStartForElement(z,0),Q=o.resolveDurationForElement(z)??i(z.getAttribute("data-composition-id"))??null;return!Number.isFinite(ee)||Q==null||Q<=0?null:Math.max(0,ee)+Q})),E=S!=null?Math.max(0,S-Math.max(0,f)):null,v=typeof h=="number"&&Number.isFinite(h)&&h>0?h:null,T=typeof y=="number"&&Number.isFinite(y)&&y>0?y:null,H=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,U=typeof E=="number"&&Number.isFinite(E)&&E>0?E:null,M=hd(H,U),L=v!=null&&M!=null&&v>=co,C=T??(L?M:hd(v,H,U))??null,O=(C!=null?f+C:null)??(typeof m=="number"&&Number.isFinite(m)&&m>0?m:null),Y=(z,ee)=>!Number.isFinite(ee)||ee<=0?0:O==null||!Number.isFinite(O)?ee:!Number.isFinite(z)||z>=O?0:Math.max(0,Math.min(ee,O-z)),Z=[],J=[],D="[data-start], [data-track-index], [data-composition-id], video, audio, img",V=Array.from(document.querySelectorAll(D)),R=0,k=(z,ee)=>{if(z===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(z.tagName))return null;let Q=l(z,s),fe=z.tagName.toLowerCase(),ce=fe==="video"||fe==="audio"?o.resolveMediaStartForElement(z):o.resolveStartForElement(z,Q.inheritedStart??0),xe=z.getAttribute("data-composition-id"),re=!!xe&&xe!==d,ie=Mi(z);if(ie==null&&re&&(ie=i(xe)),ie==null&&Ce(z)&&Number.isFinite(z.duration)&&(ie=Kt(z,z.duration)),ie==null&&(ie=ao(z,ce)),ie==null){let Ee=Q.inheritedDuration;if(Ee!=null&&Ee>0){let Pe=(Q.inheritedStart??0)+Ee;ie=Math.max(0,Pe-ce)}}if(ie==null||ie<=0||(ie=Y(ce,ie),ie<=0))return null;let ot=o.resolveHostSlotsForElement(z);if(ot.length>0){let Ee=Mr({start:ce,end:ce+ie},ot),Me=re;if(Ee.end<=Ee.start&&!Me)return null;ce=Ee.start,ie=Ee.end-Ee.start}let Be=xe&&xe!==d?"composition":fe==="video"?"video":fe==="audio"?"audio":fe==="img"?"image":"element";return{id:od(z)??xe??null,label:oM(z,Be,Z.length),start:ce,duration:ie,track:fo(z,ee),zIndex:pd(z),stackingContextId:Gs(z,t),kind:Be,tagName:fe,compositionId:z.getAttribute("data-composition-id"),compositionAncestors:Q.compositionAncestors,parentCompositionId:Q.parentCompositionId,nodePath:null,compositionSrc:ki(z.getAttribute("data-composition-src")),playbackStart:Ct(z),playbackRate:lt(z),assetUrl:ub(z),timelineRole:z.getAttribute("data-timeline-role"),timelineLabel:z.getAttribute("data-timeline-label"),timelineGroup:z.getAttribute("data-timeline-group"),timelinePriority:Ri(z.getAttribute("data-timeline-priority"))}},F=z=>{Z.push(z),R=Math.max(R,z.start+z.duration)};for(let[z,ee]of V.entries()){let Q=k(ee,z);Q&&F(Q)}for(let z of e.parked??[]){let ee=e.parkedClips?.get(z.name);if(!ee){let Q=V.length;ee=Array.from(z.host().querySelectorAll(D)).flatMap((fe,ce)=>k(fe,Q+ce)??[]),e.parkedClips?.set(z.name,ee)}for(let Q of ee)F(Q)}let _=new Set(Z.map(z=>z.id)),N=s?.getAttribute("data-composition-id")??null,j=N?r[N]??null:null;if(j&&s){let z=j;if(typeof z.getChildren=="function")try{let ee=z.getChildren(!0,!0,!1)??[],Q=new Map;for(let xe of s.children){let re=xe;if(!re.id)continue;let ie=re.tagName.toLowerCase();ie==="script"||ie==="style"||ie==="link"||Q.set(re,{id:re.id,start:1/0,end:-1/0})}let fe=xe=>{let re=xe;for(;re;){if(Q.has(re))return re;if(re===s)return null;re=re.parentElement}return null};for(let xe of ee){if(typeof xe.targets!="function"||typeof xe.startTime!="function"||typeof xe.duration!="function")continue;let re=xe.startTime(),ie=xe.parent;for(;ie&&ie!==j&&typeof ie.startTime=="function";)re+=ie.startTime(),ie=ie.parent;let ot=re+xe.duration();if(!(!Number.isFinite(re)||!Number.isFinite(ot)))for(let Be of xe.targets()){if(!Ge(Be))continue;let Ee=fe(Be);if(!Ee)continue;let Me=Q.get(Ee);Me&&(Me.start=Math.min(Me.start,re),Me.end=Math.max(Me.end,ot))}}let ce=Z.length>0?Math.max(...Z.map(xe=>xe.track))+1:0;for(let[xe,re]of Q){if(re.start===1/0||re.end===-1/0)continue;let ie=xe;if(_.has(ie.id))continue;let ot=Math.max(0,re.end-re.start);if(ot<=0)continue;let Be=Y(re.start,ot);Be<=0||(R=Math.max(R,re.start+Be),Z.push({id:ie.id,label:ie.getAttribute("data-timeline-label")??ie.getAttribute("data-label")??ie.getAttribute("aria-label")??ie.id,start:re.start,duration:Be,track:fo(ie,ce),zIndex:pd(ie),stackingContextId:Gs(ie,t),kind:"element",tagName:ie.tagName.toLowerCase(),compositionId:ie.getAttribute("data-composition-id"),compositionAncestors:N?[N]:[],parentCompositionId:N,nodePath:null,compositionSrc:null,playbackStart:Ct(ie),playbackRate:lt(ie),assetUrl:null,timelineRole:ie.getAttribute("data-timeline-role"),timelineLabel:ie.getAttribute("data-timeline-label"),timelineGroup:ie.getAttribute("data-timeline-group"),timelinePriority:Ri(ie.getAttribute("data-timeline-priority"))}),_.add(ie.id))}}catch(ee){$("runtime.timeline.site1",ee)}}if(s&&C!=null&&C>0){let z=Z.length>0?Math.max(...Z.map(ee=>ee.track))+1:0;for(let ee of s.children){let Q=ee;if(!Q.id||_.has(Q.id))continue;let fe=Q.getAttribute("data-timeline-role");if(fe!=="overlay"&&fe!=="persistent-overlay")continue;let ce=Q.tagName.toLowerCase();if(ce==="script"||ce==="style"||ce==="link"||ce==="meta"||window.getComputedStyle(Q).display==="none")continue;let re=Y(0,C);re<=0||(R=Math.max(R,re),Z.push({id:Q.id,label:Q.getAttribute("data-timeline-label")??Q.getAttribute("data-label")??Q.getAttribute("aria-label")??Q.id,start:0,duration:re,track:fo(Q,z),zIndex:pd(Q),stackingContextId:Gs(Q,t),kind:"element",tagName:ce,compositionId:Q.getAttribute("data-composition-id"),compositionAncestors:N?[N]:[],parentCompositionId:N,nodePath:null,compositionSrc:null,playbackStart:Ct(Q),playbackRate:lt(Q),assetUrl:null,timelineRole:fe,timelineLabel:Q.getAttribute("data-timeline-label"),timelineGroup:Q.getAttribute("data-timeline-group"),timelinePriority:Ri(Q.getAttribute("data-timeline-priority"))}),_.add(Q.id))}}for(let z of c){if(z===s)continue;let ee=z.getAttribute("data-composition-id");if(!ee||!cd(ee))continue;let Q=o.resolveStartForElement(z,0),fe=Mi(z);if((fe==null||fe<=0)&&lb(z)!=null){let ie=lb(z);fe=Math.max(0,ie-Q)}let ce=i(ee),xe=fe&&fe>0?fe:ce;if(xe==null||xe<=0)continue;let re=Y(Q,xe);re<=0||J.push({id:ee,label:z.getAttribute("data-label")??cb(z)??ee,start:Q,duration:re,thumbnailUrl:ki(z.getAttribute("data-thumbnail-url")),avatarName:null})}let ae=Math.max(R||0,C??0),de=ae>0?ae:1,ve=Math.max(1,Math.ceil(de*Math.max(1,e.canonicalFps)));return{...Ws(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:de,durationInFrames:ve,clips:Z,scenes:J,compositionWidth:so(s?.getAttribute("data-width"))??1920,compositionHeight:so(s?.getAttribute("data-height"))??1080}}var Un=new Map,bd=(e,t="")=>`${t}[${bt}="${CSS.escape(e)}"]`,fb=e=>Mi(e)??0,yd=e=>Array.from(e.querySelectorAll("video, audio, [data-composition-id]")).every(t=>fb(t)>0),iM=e=>{let t=e.parentElement;return!e.hasAttribute(Pn)&&!e.hasAttribute("data-hf-original-composition-id")&&(Wn(e)||yd(e))&&t?.hasAttribute("data-composition-id")===!0&&t.closest(`[${bt}]`)===null};function xd(e){let t=Number(e.getAttribute("data-start")?.trim()||Number.NaN),n=fb(e);return Number.isFinite(t)&&n>0?{start:t,end:t+n}:null}function mb(){return document.querySelector(`meta[name="${Fn}"]`)?Array.from(document.querySelectorAll(`[${bt}]:not(style, script)`)).flatMap(e=>{let t=iM(e)?xd(e):null;return t?[{name:e.getAttribute(bt),host:e,...t}]:[]}).sort((e,t)=>e.start-t.start):[]}var qs=()=>mb().filter(({name:e})=>Un.has(e)).map(({name:e,start:t,end:n})=>({name:e,start:t,end:n})),aM=10;function zs(e,t,n){let r=e.find(i=>i.start>t),o=i=>i.start<=t?t<=i.end:n?i.start<=t+aM:i===r;return new Set(e.filter(o).map(i=>i.name))}var mo=e=>document.querySelector(`${bd(e)}:not(style, script)`),Wn=e=>e.hasAttribute(Nn);function Sd(e){let t=mo(e);if(!t||Wn(t))return t;for(let r of document.querySelectorAll(bd(e,"script")))r.remove();let n=t.cloneNode(!1);return n.setAttribute(Nn,""),t.replaceWith(n),n}function pb(e){let t=mo(e),n=Un.get(e);if(!t||!Wn(t)||!n)return null;let r=document.createElement("template");r.innerHTML=n.html;let o=document.importNode(r.content.firstElementChild,!0);for(let{name:i,value:a}of Array.from(t.attributes))i!==Nn&&o.setAttribute(i,a);return t.replaceWith(o),{host:o,placeholder:t,scripts:n.scripts.map(i=>i.cloneNode(!0))}}function hb(e=0){Un.clear(),js.clear();let t=mb(),n=zs(t,e,!1);for(let{name:r,host:o}of t){let i=Array.from(document.querySelectorAll(bd(r,"script")));Un.set(r,{html:o.outerHTML,scripts:i.map(a=>a.cloneNode(!0))}),n.has(r)||Sd(r)}}var db={"data-duration":In,"data-end":Dn};function sM(e,t,n){let r=new Set([...t.getAttributeNames(),...n.getAttributeNames()].filter(o=>t.getAttribute(o)!==n.getAttribute(o)));for(let o of r){let i=n.getAttribute(o);i===null?e.removeAttribute(o):e.setAttribute(o,i),o in db&&e.removeAttribute(db[o])}}function Ed(e,t,n){let r=Un.get(e);if(!r)return;js.delete(e);let o=mo(e);if(o&&Wn(o)){let i=document.createElement("template");i.innerHTML=r.html,sM(o,i.content.firstElementChild,t)}Un.set(e,{html:t.outerHTML,scripts:n.map(i=>i.cloneNode(!0))})}var js=new Map,gb=e=>{let t=Wn(e)?e.getAttribute(bt):null;return t!==null&&Un.has(t)&&e.parentElement?t:null};function vd(e){let t=gb(e);if(t===null)return null;let n=e.parentElement.cloneNode(!1),r=document.createElement("template");return r.innerHTML=Un.get(t).html,n.append(r.content),n.firstElementChild}var bb=()=>Array.from(document.querySelectorAll(`[${Nn}]`)).flatMap(e=>{let t=gb(e);return t===null?[]:[{name:t,host:()=>vd(e)}]});var lM=e=>(e.timeScale?.()??1)===1&&(e.repeat?.()??0)===0,yb=(e,t)=>t+(e.startTime?.()??0),uM=(e,t)=>t+(e.totalDuration?.()??1/0),cM=e=>e.targets?.()??[];function dM(e,t){for(let n=Ge(e)?e:null;n;n=n.parentElement)n.hasAttribute(We)&&t.add(n)}function xb(e,t,n){let r=new Set,o=(c,d)=>d>t&&c<=n,i=c=>c.getChildren?.(!1,!1,!0)??[],a=(c,d)=>c.getChildren?.(!1,!0,!1,t-d)??[],l=(c,d)=>{let f=yb(c,d);if(f>t&&f<=n)for(let m of cM(c))dM(m,r)},s=(c,d)=>{let f=i(c).every(m=>{let g=yb(m,d);return lM(m)&&(!o(g,uM(m,g))||s(m,g))});if(f)for(let m of a(c,d))l(m,d);return f};return s(e,0)?r:null}var Sb=\':not([muted]):is(:not([data-has-audio]),[data-has-audio="true"])\',RW=`audio[data-start], video[data-start]${Sb}`;function Ks(e){if(e.tagName.toLowerCase()!=="video"||e.hasAttribute("muted"))return!1;let t=e.getAttribute("data-has-audio");return t===null||t==="true"}function Eb(e){return(e.volume??1)>1||!!(e.fxChain||e.automation||e.audioGroup||e.masterChain)}var Li="data-hf-render-id",vb="data-hf-group-render-id";function Ad(e){return e.getAttribute(Li)||e.id||null}var fM="__render_frame_",mM="__";function pM(e){return`${fM}${e}${mM}`}function hM(e){let t=Ad(e);return t?pM(t):null}function It(e){let t=hM(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),et(r)?r:null}function Rt(e){return e+1e-5}function Ab(){let{userAgent:e,maxTouchPoints:t}=navigator;return/iP(hone|ad|od)/.test(e)||/Macintosh/.test(e)&&t>1}function po(){let{userAgent:e}=navigator;return/AppleWebKit/.test(e)&&!/Chrom(e|ium)\\/|Edg\\/|Android/.test(e)}var wb=.1;function Ys(e){let t=window.__HF_RENDER_FRAME_VIDEO_IDS;return e.tagName==="VIDEO"&&t?.includes(Ad(e)??"")===!0}function Xs(e){if(Ys(e))return;e.preload!=="auto"&&(e.preload="auto");let t=e.tagName==="VIDEO"&&e.networkState===2;e.readyState<3&&!t&&e.load()}var wd=new WeakMap;function _b(e){wd.get(e)?.()}function Tb(e,t){if(_b(e),e.tagName!=="VIDEO"||Ys(e))return;let n=()=>{if(!e.isConnected||!e.paused||e.seeking||!t())return;let i=Ct(e);if(!(Math.abs(e.currentTime-i)<=.02))try{e.currentTime=Rt(i)}catch(a){$("runtime.preload.playbackStart",a)}};if(e.readyState>0){n();return}let r=()=>{e.removeEventListener("loadedmetadata",o),e.removeEventListener("error",r),e.removeEventListener("abort",r),wd.delete(e)},o=()=>{r(),n()};wd.set(e,r),e.addEventListener("loadedmetadata",o),e.addEventListener("error",r),e.addEventListener("abort",r)}function _d(e){_b(e);for(let t of e.querySelectorAll("source"))t.remove();e.removeAttribute("src"),e.load()}function gM(e){let{buffered:t,duration:n}=e;return Number.isFinite(n)&&n>0&&t.length===1&&t.start(0)<=wb&&t.end(0)>=n-wb}function Cb(e,t=!1){if(e.querySelector("source")||!t&&gM(e))return;let n=e.getAttribute("src");_d(e),n!==null&&e.setAttribute("src",n)}function Js(e){return Ue(e.getAttribute("data-duration"))!=null}function Rb(){let e=window;if(e.__hfMediaDeferral?.disconnect(),e.__hfMediaDeferral=void 0,!ws())return;let t=(n,r)=>{Ue(n.getAttribute("data-start"))!=null&&Js(n)&&r(n)>0&&(n.preload="none")};e.__hfMediaDeferral=new MutationObserver(n=>{let r=ut({}).resolveMediaStartForElement;for(let o of n)for(let i of o.addedNodes){if(i.nodeType!==1)continue;let a=i;a.matches("video, audio")&&t(a,r);for(let l of a.querySelectorAll("video, audio"))t(l,r)}}),e.__hfMediaDeferral.observe(document.documentElement,{childList:!0,subtree:!0})}var Mb=30;function kb(e){Mb=Number.isFinite(e)&&e>0?e:30}function we(e){try{window.parent.postMessage({...e,...Ws(Mb)},"*")}catch(t){$("bridge.postMessage",t)}}var bM=new Map(Object.entries({play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(yM(e,t),e.seekMode??"commit"),tick:(e,t)=>t.onTick(),"set-muted":(e,t)=>t.onSetMuted(!!e.muted),"set-volume":(e,t)=>t.onSetVolume(Math.max(0,Math.min(1,Number(e.volume??1)))),"set-media-output-muted":(e,t)=>t.onSetMediaOutputMuted(!!e.muted),"set-native-media-sync-disabled":(e,t)=>t.onSetNativeMediaSyncDisabled(!!e.disabled),"set-web-audio-media-disabled":(e,t)=>t.onSetWebAudioMediaDisabled(!!e.disabled),"set-playback-rate":(e,t)=>t.onSetPlaybackRate(Number(e.playbackRate??1)),"set-idle-heartbeat":(e,t)=>t.onSetIdleHeartbeat(!!e.slow),"set-display-scale":(e,t)=>t.onSetDisplayScale?.(Number(e.scale)),"set-preview-quality":(e,t)=>t.onSetPreviewQuality?.(Number(e.level)),"retry-preview-copies":(e,t)=>t.onRetryPreviewCopies?.(),"request-preview-facts":(e,t)=>t.onRequestPreviewFacts?.(),"set-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"set-play-range":(e,t)=>t.onSetPlayRange(Number(e.startSeconds??0),e.endSeconds==null?null:Number(e.endSeconds)),"set-color-grading":(e,t)=>t.onSetColorGrading(e.target??null,e.grading??null),"set-color-grading-compare":(e,t)=>t.onSetColorGradingCompare(e.target??null,e.compare??null),"enable-pick-mode":(e,t)=>t.onEnablePickMode(),"disable-pick-mode":(e,t)=>t.onDisablePickMode(),"flash-elements":e=>SM(e),"set-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onSetRuntimeData?.(e.channel,e.payload,e.requestId)},"clear-runtime-data":(e,t)=>{typeof e.channel=="string"&&t.onClearRuntimeData?.(e.channel,e.requestId)}}));function yM(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let o=fd(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/o}function xM(e){let t=tb(e);return t.status!=="unsupported"?!1:(we({source:"hf-preview",type:"diagnostic",code:`runtime.protocol.${t.code}`,details:{receivedVersion:typeof t.receivedVersion=="string"||typeof t.receivedVersion=="number"?t.receivedVersion:null}}),!0)}function SM(e){let t=e.selectors,n=e.duration||800;t&&EM(t,n)}function Lb(e){let t=n=>{if(n.source!==window.parent&&n.source!==window)return;let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||xM(r))return;let o=r.action;if(typeof o!="string")return;let i=bM.get(o);i&&i(r,e)};return window.addEventListener("message",t),we({source:"hf-preview",type:"ready"}),t}function EM(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`\n .__hf-flash {\n outline: 2px solid rgba(59, 130, 246, 0.6) !important;\n outline-offset: 2px !important;\n animation: __hf-flash-pulse ${t}ms ease-out forwards !important;\n }\n @keyframes __hf-flash-pulse {\n 0% { outline-color: rgba(59, 130, 246, 0.8); }\n 100% { outline-color: transparent; }\n }\n `,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(o=>{o.classList.add("__hf-flash"),setTimeout(()=>o.classList.remove("__hf-flash"),t)})}catch(r){$("bridge.flashElements.querySelector",r)}}var Ni={windowSeconds:3,choppyShare:.25,warmupSeconds:1,reportEveryMs:1e3},vM=.5,Dt=[],Qs=null,Td=0,Nb="",Cd=!1,Rd=0,Pb="monotonic";function Ib(e){we({source:"hf-preview",type:"preview-health",health:e})}function Fi(){Dt=[],Qs=null,Cd&&Ib(null),Cd=!1,Rd=0}var Fb=null;function Db(e){e!==Fb&&(Fb=e,Fi())}function Zs(){Fi()}function AM(e,t,n){let r=Ni.windowSeconds*1e3;for(;Dt[0]&&Dt[0].atMs<e-r;)Dt.shift();let o=Dt[0];if(!o)return;let i=e-(o.atMs-o.gapMs);if(i<r||e-Rd<Ni.reportEveryMs)return;let a=Dt.filter(h=>h.drawn).length,l=i/1e3*t*n,s=l>0?1-Math.min(a,l)/l:0,c=Dt.reduce((h,y)=>h+(y.waiting?y.gapMs:0),0),d=Dt.reduce((h,y)=>h+(y.frozen?y.gapMs:0),0),f=Math.max(s,c/i),m=Dt.map(h=>h.gapMs).sort((h,y)=>h-y),g=h=>Math.round(m[Math.ceil(h*m.length)-1]??0);Cd=!0,Rd=e,Ib({droppedShare:Math.round(f*1e3)/1e3,seconds:Math.round(i/100)/10,choppy:f>=Ni.choppyShare,fps:Math.round(a/(i/1e3)*10)/10,worstFrameMs:Math.round(Math.max(...Dt.map(h=>h.gapMs))),skippedShare:Math.round(s*1e3)/1e3,waitingShare:Math.round(c/i*1e3)/1e3,frozenShare:Math.round(d/i*1e3)/1e3,gapP50Ms:g(.5),gapP95Ms:g(.95),clockSource:Pb,mode:"play"})}function Ob(e){let{nowMs:t,filmTime:n,fps:r,rate:o}=e,i=`${r}|${o}|${e.layoutKey}`;if(!e.playing||e.hidden){Fi();return}i!==Nb&&(Nb=i,Fi());let a=Math.floor(n*r+1e-6),l=Qs;if(Qs={ms:t,film:n,frame:a},!l){Td=t+Ni.warmupSeconds*1e3;return}let s=t-l.ms,c=l.film+s/1e3*o;if(n<l.film||n>c+vM){Fi(),Qs={ms:t,film:n,frame:a},Td=t+Ni.warmupSeconds*1e3;return}t<Td||(Pb=e.clock,Dt.push({atMs:t,gapMs:s,drawn:a!==l.frame,waiting:e.waiting,frozen:e.frozen===!0}),AM(t,r,o))}function wM(e,t,n){let r=e.filter(i=>Number.isFinite(i.time)&&Number.isFinite(i.volume)).map(i=>({time:Math.max(0,i.time-t),volume:Ve(i.volume)})).sort((i,a)=>i.time-a.time),o=[];for(let i of r){let a=o.at(-1);a&&Math.abs(a.time-i.time)<1e-9?a.volume=i.volume:o.push(i)}return o.length===0||o[0].time>0&&o.unshift({time:0,volume:Ve(n)}),o}function Hb(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],o=e[n+1]??r,i=o.time-r.time,a=i<=0?0:Math.min(1,Math.max(0,(t-r.time)/i));return r.volume+(o.volume-r.volume)*a}function _M(e,t,n,r){let o=e.at(-1);!o||Math.abs(o.volume-n.volume)>1e-4?(o&&t&&t.time>o.time&&e.push(t),e.push(n)):r&&n.time>o.time&&e.push(n)}function TM(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function CM(e,t){let n=ut({timelineRegistry:window.__timelines,includeAuthoredTimingAttrs:!0}).resolveMediaStartForElement(e),r=Ue(e.dataset.end)??void 0,o=Ue(e.dataset.duration)??void 0,i=t;o!==void 0&&o>0?i=n+o:r!==void 0&&r>n&&(i=r);let a=TM(e.dataset.volume)??1;return{start:n,end:i,staticVolume:Ve(a)}}function RM(e,t,n,r,{start:o,end:i,staticVolume:a}){let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,o),c=Math.min(n,i),d=M0(e,()=>{e.volume=a;let m=[],g;for(let h=s;h<=c+1e-6;h=Math.min(c,h+l)){t(h);let y=Number(e.volume);if(Number.isFinite(y)){let S={time:Number(h.toFixed(6)),volume:Number(Ve(y).toFixed(6))};_M(m,g,S,h===c),g=S}if(h===c)break}return m});return d.some(m=>Math.abs(m.volume-a)>1e-4)?d:null}function el(e,t,n=0){return n>3||e===null||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>el(r,t,n+1)):Object.getPrototypeOf(e)!==Object.prototype?!1:Object.entries(e).some(([r,o])=>t(r)||el(o,t,n+1))}var MM=e=>typeof e?.nodeType=="number";function kM(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 Md(e){let t={elements:new Set,anySetter:!1,unknown:!0};if(typeof e.getChildren!="function")return t;try{let n={elements:new Set,anySetter:!1,unknown:!1};for(let r of e.getChildren(!0,!0,!1)){let o=r.targets?.()??[];for(let i of o)MM(i)?el(r.vars,a=>a==="volume")&&n.elements.add(i):!n.anySetter&&el(r.vars,a=>kM(i,a))&&(n.anySetter=!0)}return n}catch{return t}}var LM=(e,t)=>e.unknown||e.anySetter||e.elements.has(t);function Gb(e,t,n,r,o={}){if(o.allowLiveTimelineSeek===!1||!t||!Ce(e)||n<=0||!LM(o.movers?.()??Md(t),e))return;let i=c=>{try{typeof t.totalTime=="function"?t.totalTime(c,!0):typeof t.seek=="function"&&t.seek(c,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=CM(e,n),s=RM(e,i,n,60,l);if(Number.isFinite(a)&&i(a),s){let c=wM(s,l.start,l.staticVolume);c.length>0&&r.set(e,c)}}var Wb="data-fade-in",Vb="data-fade-out",ZW=Wb.slice(5),eV=Vb.slice(5),$b=Object.freeze({fadeIn:0,fadeOut:0});function kd(e){return Number.isFinite(e)&&e>0?e:0}function Bb(e){return e==null||e===""?0:kd(Number.parseFloat(e))}function tl(e){return{fadeIn:Bb(e.getAttribute(Wb)),fadeOut:Bb(e.getAttribute(Vb))}}function Ld(e,t){let n=kd(e.fadeIn),r=kd(e.fadeOut);if(!Number.isFinite(t)||t<=0)return{fadeIn:n,fadeOut:r};let o=n+r;if(o<=t)return{fadeIn:n,fadeOut:r};let i=t/o;return{fadeIn:n*i,fadeOut:r*i}}function nl(e,t,n){if(!Number.isFinite(e))return 1;let{fadeIn:r,fadeOut:o}=Ld(n,t),i=1;return r>0&&(i*=Ub(e/r)),o>0&&Number.isFinite(t)&&(i*=Ub((t-e)/o)),i}function Ub(e){return!Number.isFinite(e)||e<0?0:e>1?1:e}var pn="hf-audio-group",rl="data-audio-group";function Pi(e){let t=e?.getAttribute("data-volume"),n=t?parseFloat(t):1;return Number.isFinite(n)?n:1}function Nd(e,t){let n=Array.from(e?.querySelectorAll?.(`${pn}[${Li}]`)??[]).find(o=>o.getAttribute(Li)===t);if(n)return n;let r=e?.getElementById(t)??null;return r&&r.tagName?.toLowerCase()===pn?r:null}function ol(e,t){let n=t?.getAttribute?.(vb)??t?.getAttribute?.(rl);return n?Nd(e,n)?.hasAttribute("data-hidden")??!1:!1}function Fd(e){let t=e.querySelector("[data-composition-id]");return t&&!t.parentElement?.closest("[data-composition-id]")?t:null}function qb(e){return Fd(e)?.getAttribute(Gn)||void 0}function il(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!NM(e)?null:e.getAttribute(rl)||null}function NM(e){return e.tagName.toLowerCase()==="audio"?!0:typeof e.hasAttribute=="function"&&Ks(e)}function zb(e){let t="__hf-audio-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${pn}{display:contents!important}${pn}[data-hidden]{display:none!important}`,e.head.appendChild(n)}var Pd=-1,go=new Map,ho,Id=0;function jb(e){let t=[],n=!0,r={time:e,waitUntil:o=>{if(!n)throw new Error("hf-seek waitUntil() must be called synchronously from the event listener");t.push(o)}};try{window.dispatchEvent(new CustomEvent("hf-seek",{detail:r}))}catch(o){$("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}t.length!==0&&tt(Promise.all(t),"hf-seek")}function tt(e,t){let n=e.then(()=>({status:"fulfilled"})).catch(r=>({status:"rejected",reason:r}));go.set(n,t),n.then(r=>{go.delete(n)&&r.status==="rejected"&&ho===void 0&&(ho={reason:r.reason})})}function al(e){e!==Pd&&(Pd=e,jb(e))}function sl(e){Pd=e,jb(e)}function Kb(){return Id>0}async function Yb(){for(let e=[...go.keys()];e.length>0;e=[...go.keys()])await Promise.all(e)}function Xb(){return go.size>0}async function FM(e,t){if(t===void 0)return Promise.all(e);let n,r=new Promise(o=>{n=setTimeout(()=>o(null),Math.max(0,t-Date.now()))});try{return await Promise.race([Promise.all(e),r])}finally{clearTimeout(n)}}async function Jb(e){let t=()=>[...go].filter(([,i])=>e?.videoFrames!==!1||i!=="video-frame"),n=e?.timeoutMs,r=n===void 0?void 0:Date.now()+n;Id+=1;let o=ho;try{await Promise.resolve();for(let a=t();a.length>0;a=t()){let l=r===void 0||Date.now()<r?await FM(a.map(([c])=>c),r):null;if(!l){let c=[...new Set(t().map(([,d])=>d))].join(", ");throw Object.assign(new Error(`seek did not settle within ${n} ms: still waiting on ${c}`),{name:"SeekNotSettledError"})}let s=l.find(c=>c.status==="rejected");o===void 0&&s?.status==="rejected"&&(o={reason:s.reason})}let i=ho;if(o===void 0&&(o=i),ho===i&&(ho=void 0),o)throw o.reason}finally{Id-=1}}var yt=.04,kr=.5,PM=.03,IM=[[.3,.25],[.1,.1]],DM=.01,OM=.1,HM=.1,GM=.65,bo=new WeakMap,Ii=new WeakSet;function Dd(e){Ii.add(e)}function Qb(e,t,n,r,o=e.tagName==="AUDIO"){let i=Math.abs(t);if(o&&po())return bo.delete(e),{rate:n,seek:r&&i>GM};r&&i<=yt&&Ii.delete(e);let a=!Ii.has(e)||i>kr;if(o&&r&&i>HM&&a)return bo.delete(e),Ii.add(e),{rate:n,seek:!0};let l=Math.sign(t),s=bo.get(e);if(i>yt)bo.set(e,l);else if(s!==l||i<=DM)return bo.delete(e),{rate:n,seek:!1};let c=IM.find(([f])=>i>f)?.[1]??PM,d=o?Math.min(c,OM):c;return{rate:n*(1+l*d),seek:!1}}function Od(e){bo.delete(e),Ii.delete(e)}function Bi(e){return Ct(e)}var Zb=["seeked","loadeddata","error","emptied","abort"],Vd=5e3,ll=new WeakMap;function ey(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)||It(e)||(ll.get(e)?.(),tt(new Promise(n=>{let r=i=>{if(!(i?.type==="loadeddata"&&e.seeking)){clearTimeout(o);for(let a of Zb)e.removeEventListener(a,r,!0);ll.get(e)===r&&ll.delete(e),n()}},o=setTimeout(r,Vd);for(let i of Zb)e.addEventListener(i,r,!0);ll.set(e,r)}),"video-frame"))}function ry(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 oy(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=[],o=[],i=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=Bi(a),c=lt(a),d=Et(a),f=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,cn(d,m-s)));let y=Number.isFinite(g)&&g>=0?l+g:Number.POSITIVE_INFINITY,S=l,E=Mr({start:l,end:y},e?.resolveHostSlots?.(a)??[]);(E.start!==l||E.end!==y)&&({start:l,end:y}=E,g=y-l);let v=Number.parseFloat(a.dataset.volume??""),T={el:a,start:l,origin:S,mediaStart:s,duration:Number.isFinite(y)?g:Number.POSITIVE_INFINITY,end:y,volume:Number.isFinite(v)?v:null,playbackRate:c,rate:d,loop:f,sourceDuration:m,fades:tl(a)};r.push(T),a.tagName==="VIDEO"&&o.push(T),Number.isFinite(y)&&(i=Math.max(i,y))}return{timedMediaEls:n,mediaClips:r,videoClips:o,maxMediaEnd:i}}var Bd=new WeakMap,Oi=new WeakMap,Di=new WeakMap,Ud=new WeakSet,Nr=new WeakSet,Hd=new WeakSet;function BM(e){if(Nr.has(e))return;Nr.add(e);let t=()=>Nr.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}function iy(e){if(Ab())for(let t of e)t.defaultMuted||!t.paused||Nr.has(t)||ul(t)||(t.play().catch(()=>{}),t.pause())}var UM=3;function ul(e){return e.error!=null||e.networkState===UM}var Wd=new WeakMap;function Gd(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function cl(e){Bd.delete(e),Oi.delete(e),Di.delete(e),Ud.delete(e),Wd.delete(e),Od(e),Lr.delete(e),sy(e),Gi.delete(e)}function $d(e){return Oi.has(e)}var qd=1.5;function Vn(e,t){let n=Math.max(0,Math.min(t,e.end)-(e.origin??e.start)),r=e.mediaStart+Bn(e.rate??e.playbackRate,n);if(e.sourceDuration==null)return r;let o=e.sourceDuration-e.mediaStart;return e.loop&&o>0&&r>=e.sourceDuration?e.mediaStart+(r-e.mediaStart)%o:!e.loop&&e.el.tagName==="VIDEO"?Math.min(r,e.sourceDuration):r}function WM(e,t,n,r){let{el:o}=e,i=e.start-t;if(!n||i<=0||i>qd*r||!o.paused||o.seeking||o.readyState<o.HAVE_METADATA||It(o)||"__HF_EXPORT_RENDER_SEEK_CONFIG"in window&&window.__HF_EXPORT_RENDER_SEEK_CONFIG)return;let a=Vn(e,e.start);if(!(!Number.isFinite(a)||a<0||Math.abs(o.currentTime-a)<=.001))try{o.currentTime=Rt(a)}catch(l){$("runtime.media.preseek",l)}}var ty=1/16,ay=.1,Lr=new WeakSet,VM=.5,yo=new WeakMap,zd=new WeakMap,jd=new WeakMap,$M=e=>typeof e.requestVideoFrameCallback=="function";function qM(e,t){if(yo.get(e)===t)return;yo.set(e,t);let n=null,r=Number.POSITIVE_INFINITY,o=0,i=(a,l)=>{if(yo.get(e)!==t)return;if(e.paused){yo.delete(e);return}let s=n===null?Number.NaN:l.mediaTime-n;if(s>0&&s<ay){r=Math.min(r,s),o=Math.max(o,s);let c=Math.floor((t-.001-l.mediaTime)/r);jd.set(e,{outPoint:t,at:l.mediaTime+c*r})}if(n=l.mediaTime,l.mediaTime+(o||yt)<t-.001){e.requestVideoFrameCallback(i);return}yo.delete(e),zd.set(e,t),Lr.add(e),e.pause()};e.requestVideoFrameCallback(i)}function sy(e){yo.delete(e),zd.delete(e),jd.delete(e)}function zM(e,t,n){if(!n)return t-yt;let r=jd.get(e);return r?.outPoint===t?r.at:t}var Hi=null,Gi=new WeakMap,ny=!1;function jM(e,t,n,r){let o=Gi.get(e);if(!o||t<o.at)return;Gi.delete(e);let i=((n-o.offset)/r+o.lead)*o.weight,a=Hi===null?i:(Hi+i)/2;Hi=Math.min(.1,Math.max(0,a))}function ly(e){let t=!!(e.outputMuted||e.userMuted),n=ny?1:.5;ny=e.playing&&e.clockAdvancing!==!1;for(let r of e.clips){let{el:o}=r;if(!o.isConnected)continue;let i=r.rate??r.playbackRate,a=r.origin??r.start,l=o.tagName==="VIDEO"&&!r.loop,s=fn(e.timeSeconds,r.start,r.end),c=r.start-e.timeSeconds,d=o.tagName==="AUDIO"?e.cueAheadSeconds??0:e.playing&&Hi!==null?Hi*e.playbackRate+(e.cueAheadSeconds??0)/2:0,f=!s&&c>0&&c*Math.max(1,vi(i,r.start-a))<=Math.max(d,Hd.has(o)?yt:0);f?Hd.add(o):Hd.delete(o);let m=l&&!s&&(e.timeSeconds>=r.end||lo(e.timeSeconds,r.end))&&uo(e.timeSeconds,r.start,r.end,e.getCompositionDuration()),g=Vn(r,e.timeSeconds),h=m||l&&r.sourceDuration!=null&&g>=r.sourceDuration&&s,y=Oi.get(o),S=o.tagName==="AUDIO"&&(y===void 0||g<y-.04),E=!r.loop&&r.sourceDuration!=null&&g>=r.mediaStart&&g<r.sourceDuration&&(l||S);if((s||m||f)&&g>=0&&(!o.ended||r.loop||h||E)){Oi.set(o,g);let H=Gd(e.userVolume??1),U=Ve(r.volume??1),M=Wd.get(o),L=Gd(o.volume),G,C=O0(o,e.timeSeconds-a),B=e.isWebAudioRouted?.(o)===!0,O=C===null&&(r.volumeKeyframes?.length??0)>0,Y=B?R0(U,O):1;if(C!==null)G=B?1:Ns(U,C);else if(r.volumeKeyframes&&r.volumeKeyframes.length>0){let Pe=e.timeSeconds-a;G=Ve(Hb(r.volumeKeyframes,Pe))}else B?G=1:M===void 0?G=U>1?U:L:Math.abs(L-M)>1e-4?G=L:G=U;let Z=G,J=r.fades??$b;(J.fadeIn>0||J.fadeOut>0)&&(G*=nl(e.timeSeconds-a,r.duration+r.start-a,J));let V=o.closest("[data-hidden]")!==null||ol(o.ownerDocument,o)?0:Gd(G*H);Math.abs(o.volume-V)>1e-6&&(o.volume=V),Wd.set(o,V),Z===G?e.onElementVolume?.(o,V,G,Y):e.onElementVolume?.(o,V,G,Y,Z),(t||e.isWebAudioOwned?.(o))&&!o.muted&&(o.muted=!0),o.preload!=="auto"&&!Ys(o)&&(o.preload="auto");let R=vi(i,e.timeSeconds-a)*e.playbackRate,k=e.playing&&R>=ty,F=2,_=o.currentTime||0,N=Math.abs(_-g),j=g-_,ae=Bd.get(o);Bd.set(o,j);let de=ae===void 0,ve=!de&&Math.abs(j-ae)>.5,z=N>3,ee=o.tagName==="AUDIO"&&de&&_-g>yt,Q=h&&N>.001||o.ended&&E&&N>.001||ee||N>kr&&(de||ve||z);if(o.tagName==="VIDEO"&&!h){let Pe=Vn(r,r.end),xt=$M(o);xt&&k&&!r.loop&&!o.paused&&Pe-_<=VM*R&&qM(o,Pe);let cr=zd.get(o)===Pe,wn=!r.loop&&(j<-ay||cr||_>=zM(o,Pe,xt));!k||!wn&&j>=-yt?Lr.delete(o):wn&&(!o.paused||cr)&&(Lr.add(o),o.paused||o.pause())}let fe=Lr.has(o),ce=!o.paused&&k;ce&&jM(o,e.timeSeconds,j,R);let re=e.playing&&!k||ae!==void 0&&Math.abs(j-ae)<.004,ie=!1;if(!ce&&!e.keepLateMedia&&!fe&&!Q&&!de&&re&&N>yt){let Pe=(Di.get(o)??0)+1;Di.set(o,Pe),Pe>=F&&(ie=!0,Di.set(o,0))}else N<=yt&&Di.set(o,0);let ot=!ce&&!fe&&e.forceSync&&N>.02,Be=ce&&!Q?Qb(o,j,R,re):null,Ee=Be?.seek===!0,Me=Ee&&e.seekUnderDip?.(o,g)===!0;try{Be||Od(o);let Pe=Math.max(ty,Be?.rate??R);Math.abs(o.playbackRate-Pe)>1e-6&&(o.playbackRate=Pe)}catch(Pe){$("runtime.media.site1",Pe)}if(Q||ie||ot||Ee&&!Me){if(!(o.tagName==="VIDEO"&&!!It(o))){try{o.currentTime=Rt(g)}catch(xt){$("runtime.media.site2",xt)}if(Math.abs(o.currentTime-g)>.5&&!Ud.has(o)){Ud.add(o),o.load();try{o.currentTime=Rt(g)}catch(xt){$("runtime.media.site3",xt)}}ey(o),Dd(o)}Nr.delete(o),Lr.delete(o),sy(o),Gi.delete(o)}else k||ey(o);h?o.paused||o.pause():k&&!Lr.has(o)&&e.clockAdvancing!==!1&&o.paused&&!Nr.has(o)&&!ul(o)?(BM(o),Dd(o),l&&Gi.set(o,{weight:n,offset:g-(o.currentTime||0),lead:Math.max(0,r.start-e.timeSeconds)/e.playbackRate,at:Math.max(e.timeSeconds,r.start)+.25*e.playbackRate}),o.play().catch(Pe=>{Nr.delete(o),(Pe&&typeof Pe=="object"&&"name"in Pe?String(Pe.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!k&&!o.paused&&o.pause();continue}let T=fn(e.timeSeconds,r.start,r.end);cl(o),T&&Oi.set(o,g),o.paused||o.pause(),WM(r,e.timeSeconds,e.playing,e.playbackRate)}}var Kd={lookSeconds:1,movedShare:.1,minDueSeconds:.05},KM=2,cy=new WeakMap,dl=new WeakSet;function uy(e,t){cy.set(e,{film:t,time:e.currentTime})}function YM(e,t,n,r){let o=Vn(e,r)-Vn(e,n.film),i=t.currentTime-n.time;o>=Kd.minDueSeconds&&i<o*Kd.movedShare?dl.add(t):dl.delete(t)}function dy(e,t){let n=!1;for(let r of e){let o=r.el;if(!Re(o))continue;let i=cy.get(o);!i||t<i.film?(uy(o,t),dl.delete(o)):t-i.film>=Kd.lookSeconds&&(YM(r,o,i,t),uy(o,t)),(o.readyState<KM||dl.has(o))&&(n=!0)}return n}var XM=1e3,Fr=new Map,Yd=!1,fy=!1,Ui,fl=!1;function JM(){for(let r of Fr.keys())r.isConnected||Fr.delete(r);let e=[...Fr.values()],t=Yd&&e.length>0;if(!t&&!fy)return!1;fy=t;let n=e.reduce((r,o)=>r+(o.state==="ready"?1:o.progress??0),0);return we({source:"hf-preview",type:"preview-copies",copies:t?{total:e.length,ready:e.filter(r=>r.state==="ready").length,failed:e.filter(r=>r.state==="failed").length,progress:n/e.length,error:e.some(r=>r.state==="failed")?"failed":null}:null}),!0}function Xd(){if(Ui!==void 0){fl=!0;return}JM()&&(Ui=setTimeout(()=>{Ui=void 0,fl&&(fl=!1,Xd())},XM))}function my(e){Fr.clear(),Yd=e<1,clearTimeout(Ui),Ui=void 0,fl=!1,Xd()}function hn(e,t,n=null){Yd&&(Fr.set(e,{state:t,progress:n}),Xd())}function py(){return[...Fr].filter(([,e])=>e.state==="failed").map(([e])=>e)}function hy(){return[...Fr.values()].every(e=>e.state==="ready")}var Jd=null;function gy(e){Jd=e}function Mt(e,t){if(Jd)try{Jd({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){$("runtime.analytics.site1",n)}}function QM(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 o=t.slice(n,r);return o.length>0?o:"node"}function xo(e){return`--${QM(e)}`}function by(e){let t=new Map;for(let n of e){let r=xo(n),o=t.get(r);o?o.includes(n)||o.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function Qd(e){let n=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"";return n?window.__hfVariablesByComp?.[n]:void 0}function ml(e){let t=window,n=Qd(e);if(n)return n;let r=t.__hyperframes?.getVariables?.();return r&&typeof r=="object"?r:t.__hfVariables??{}}function xy(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let o of Array.from(document.querySelectorAll("[data-composition-variables]")))Qd(o)||e.add(o);let t={};for(let o of e)Object.assign(t,Wi(o));let n=hl(),r={...t,...n};for(let o of e)ef(o,r);return r}var yy=new Set;function Sy(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 ZM(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function ek(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 tk(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=ek(e);return r.length===0||r.some(o=>String(o)===String(n))?null:{id:e.id,value:n,allowed:r}}function ef(e,t,n){if(!e)return;let r=Sy(e);if(r.length===0)return;let o=ZM(e,n);for(let i of r){let a=tk(i,t);if(!a)continue;let l=`${o}|${a.id}|${String(a.value)}`;if(yy.has(l))continue;yy.add(l);let s="default"in i?JSON.stringify(i.default):"the composition default";globalThis.console.warn(`[hyperframes] runtime_unknown_enum_value: ${o} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function Wi(e){let t={};for(let n of Sy(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Zd="data-hf-css-vars";function pl(e){return"style"in e&&typeof e.style?.setProperty=="function"}function tf(e,t){if(!pl(e))return;let n=[];for(let[r,o]of Object.entries(t))if(typeof o=="string"&&o!==""||typeof o=="number"){let i=xo(r);e.style.setProperty(i,String(o)),n.push(i)}n.length>0&&e.setAttribute(Zd,n.join(" "))}function Ey(e,t,n){let r={};for(let[o,i]of Object.entries(t)){let a=xo(o);((pl(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[o]=i)}return r}function vy(e){if(!pl(e))return;let t=e.getAttribute(Zd);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Zd)}}function Ay(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let o of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(o);let n=hl(),r=[];for(let o of t)r.push(...nk(o,n,e.defaultView));for(let o of by(r))globalThis.console.warn(`composition variables ${o.join(", ")} collapse to the same CSS property ${xo(o[0]??"")}. Rename one to avoid cross-talk`)}function nk(e,t,n){if(!pl(e))return[];let r=Wi(e),o={};for(let[i,a]of Object.entries(r)){if(i in t)continue;let l=xo(i);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(o[i]=a)}for(let[i,a]of Object.entries(t))i in r&&(o[i]=a);return tf(e,o),Object.keys(r)}function wy(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 hl(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function gl(e,t,n,r){let o=!1;try{e.pause()}catch(i){o=!0,$(r,i)}try{e.currentTime=t}catch(i){$(n,i)}if(o)try{e.pause()}catch(i){$(r,i)}}function _y(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 y of n(document,m)){if(h&&!(y instanceof CSSAnimation))continue;let S=y.effect;if(!S?.target||S.pseudoElement)continue;let E=g.get(S.target);E?E.push(y):g.set(S.target,[y])}return g},o=(m=[],g=[])=>[...g,...m.filter(h=>!g.includes(h)&&h.playState!=="idle")],i=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=v=>(v||"").split(",").map(T=>Number.parseFloat(T)/(T.trim().endsWith("ms")?1e3:1)),h=g(m.animationDuration),y=g(m.animationDelay),S=m.animationName.split(","),E=0;return S.forEach((v,T)=>{if(v.trim()==="none")return;let H=y[T%y.length]+h[T%h.length];H>E&&(E=H)}),{cycleSeconds:E,delays:S.map((v,T)=>y[T%y.length]||0)}},l=(m,g)=>{let h=null;try{h=m.effect?.getComputedTiming?.()??null}catch(S){$("runtime.adapters.css.site5",S)}if(!h)return{};let y=Number(h.endTime);return Number.isFinite(y)?{endSeconds:g+y/1e3}:{unbounded:!0}},s=(m,g)=>{for(let h of m)gl(h,g,"runtime.adapters.css.site1","runtime.adapters.css.site2")},c=m=>{for(let g of m)try{g.play()}catch(h){$("runtime.adapters.css.site3",h)}},d=m=>{for(let g of m)try{g.pause()}catch(h){$("runtime.adapters.css.site4",h)}},f=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)f(h);let m=new Map(t.map(h=>[h.el,h.handles]));t=[];let g=document.querySelectorAll("*");for(let h of g){if(!Te(h))continue;let y=window.getComputedStyle(h);!y.animationName||y.animationName==="none"||t.push({el:h,baseDelay:h.style.animationDelay||"",basePlayState:h.style.animationPlayState||"",...a(y),handles:m.get(h)})}},getAnimationCycleEndSeconds:()=>{let m=0;for(let g of t)!g.el.isConnected||g.cycleSeconds<=0||(m=Math.max(m,i(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=i(g.el);for(let y of n(g.el)){let S=l(y,h);S.endSeconds!=null&&(m=Math.max(m,S.endSeconds))}}return m>0?m:null},seek:m=>{let g=Number(m.time)||0,h=r(m.pageAnimations);for(let y of t)y.handles=o(y.handles,h.get(y.el));for(let y of t){if(!y.el.isConnected)continue;let S=i(y.el),E=Math.max(0,g-S)*1e3;if(y.handles?.length){y.el.style.animationDelay!==y.baseDelay&&f(y),s(y.handles,E);continue}y.el.style.animationPlayState="paused",y.el.style.animationDelay=y.delays.map(v=>`${Number((v-E/1e3).toFixed(3))}s`).join(", ")}},pause:m=>{let g=r(m?.pageAnimations);for(let h of t){if(!h.el.isConnected)continue;let y=g.get(h.el);y&&(d(y),f(h))}},play:()=>{let m=r();for(let g of t)g.el.isConnected&&(f(g),c(m.get(g.el)??[]))},revert:()=>{t=[]}}}function Vi(e,t,n){e.totalDuration?.();let r=e.getChildren?.(!1,!0,!0)??[],o=xk(e,n,t).map(s=>[s,s.ratio,s._zTime,s._act]),i=Ly(r,t).map(s=>[s,s._ts]),a=new Set;for(let[s]of i)for(let c=s.parent;c&&!a.has(c);c=c.parent)a.add(c);let l=[...a].map(s=>[s,s._dur,s._tDur,s._end,s._dirty]);for(let[s]of i)s._ts=0;try{rk(e,r,t,n)}finally{for(let[s,c]of i)s._ts=c;for(let[s,c,d,f,m]of l)Object.assign(s,{_dur:c,_tDur:d,_end:f,_dirty:m})}for(let[s,c,d,f]of o)s.ratio=c,s._zTime=d,s._act=f}function rk(e,t,n,r){let o=n>=bl;e.totalTime(o?n-bl:n+bl,!0),Iy(t,n,o?bl:0),e.totalTime(n,!0),o||ky(e,r??ok(t),n)}function ok(e){let t=e[0]?.parent;return t?{owner:t,version:""}:void 0}function ky(e,t,n){if(t)for(let r of bk(e,t,n)){let{ratio:o,_zTime:i,_act:a}=r;r.render(0,!0,!0),Object.assign(r,{ratio:o,_zTime:i,_act:a})}}function ik(e){let t=e,[n]="_first"in t?t._first?[t._first]:[]:e.getChildren?.(!1,!0,!0)??[],r=n?.parent;return r!==void 0&&!r._initted}var Ty=new WeakMap,Cy=new WeakMap,ak=new Set(["duration","ease","delay","repeat","repeatDelay","yoyo","yoyoEase","repeatRefresh","stagger","overwrite","immediateRender","lazy","id","paused","reversed","callbackScope","runBackwards","data","inherit","defaults"]),sk=new Set(["keyframes","startAt","transform"]),lk={scaleX:"scale",scaleY:"scale",autoAlpha:"opacity",rotate:"rotation"};function uk(e){let t=new Set;for(let n of Object.keys(e)){if(sk.has(n))return null;!n.startsWith("on")&&!ak.has(n)&&t.add(lk[n]??n)}return t}function ck([e,t],n){let r=Number(n._ts);if(!r)return null;let[o,i]=n._repeat||r<0?[0,Number(n.totalDuration?.()??1/0)]:[e,t];return[Number(n._start)+o/Math.abs(r),i/Math.abs(r)]}function dk(e,t){let n=[Number(e._start),Number(e.totalDuration?.()??0)];for(let r=e.parent;n&&r&&r!==t;r=r.parent)n=ck(n,r);return n&&{start:n[0],end:n[0]+n[1],properties:uk(e.vars??{})}}function fk(e){let t=new Map;for(let n of e.getChildren?.(!0,!0,!1)??[]){let r=n,o=dk(r,e);if(o)for(let i of r.targets?.()??[])t.set(i,[...t.get(i)??[],o])}return[...t.values()].flatMap(pk)}function mk(e,t){return!e.properties||!t.properties||[...e.properties].some(n=>t.properties.has(n))}function pk(e){let t=[];return e.sort((n,r)=>n.start-r.start),e.forEach((n,r)=>{for(let o of e.slice(r+1)){if(o.start>=n.end)break;mk(n,o)&&t.push([o.start,Math.min(n.end,o.end)])}}),t}function hk(e,t,n,r=""){let o=Ty.get(e);Ty.set(e,t);let i=o===void 0?Math.floor(t*n+1e-6):Math.ceil((t-o)*n-1e-6)-1;if(i<1)return[];let a=Cy.get(e);a?.version!==r&&(a={version:r,spans:fk(e)},Cy.set(e,a));let l=new Set;for(let[s,c]of a.spans){let d=Math.max(1,Math.ceil((t-c)*n-1e-6)-1),f=Math.min(i,Math.floor((t-s)*n+1e-6)+1);for(let m=d;m<=f;m++)l.add(m)}return[...l].sort((s,c)=>c-s).map(s=>t-s/n)}function $i(e,t,n,r,o){if(typeof e.totalTime!="function")return typeof e.seek=="function"&&e.seek(t,n),!1;if(o)for(let a of hk(e,t,o,r?.version))e.totalTime(a,n);let i=Number(e.totalTime());return e.totalTime(t,n),t<i&&r&&ky(e,r,t),i!==t||!ik(e)?!1:(Vi({totalTime:e.totalTime.bind(e),totalDuration:e.totalDuration?.bind(e),getChildren:e.getChildren?.bind(e)},t,r),!0)}var nf=1e-6;function Ly(e,t,n=[]){for(let r of e)r.startTime()>t+nf?n.push(r):r.getChildren&&r.endTime()>=t&&Ly(r.getChildren(!1,!0,!0),r.time(),n);return n}function rf(e){return(e.getChildren?.(!0,!0,!0)??[]).filter(t=>{let n=t;return typeof n.getChildren=="function"||n.totalDuration?.()===0})}var Ry=new WeakMap,My=.05;function gk(e,t){let n=Number(e._start);for(let r=e.parent;r&&r!==t;r=r.parent){if(r._repeat||!r._ts)return null;n=Number(r._start)+n/r._ts}return Number.isFinite(n)?n:null}function Ny(e,t){let n={version:t.version,always:[],points:[]};for(let r of rf(e)){let o=r,i=typeof o.getChildren=="function"?null:gk(o,t.owner);i===null?n.always.push(r):n.points.push({at:i,mark:r})}return n.points.sort((r,o)=>r.at-o.at),n}function Fy(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>1;e[o].at<t?n=o+1:r=o}return n}function of(e,t){let n=Ry.get(t.owner);return n?.version!==t.version&&(n=Ny(e,t),Ry.set(t.owner,n)),n}function bk(e,t,n){let{points:r}=t.version?of(e,t):Ny(e,t),o=[];for(let i=Fy(r,n-nf);i<r.length&&!(r[i].at>n+nf);i++)o.push(r[i].mark);return o}function yk(e,t){let n=t?of(e,t):null,o=(n?[...n.always,...n.points.map(i=>i.mark)]:rf(e)).map(i=>[i,i.ratio,i._zTime,i._act]);return()=>{for(let[i,a,l,s]of o)i.ratio=a,i._zTime=l,i._act=s}}function Py({scenes:e,root:t,structureOf:n}){let r=t?[...e,t]:e,o=r.map(i=>yk(i,n(i)));return i=>{i();for(let a of r)a.totalTime&&!n(a)&&Vi({totalTime:a.totalTime.bind(a),totalDuration:a.totalDuration?.bind(a),getChildren:a.getChildren?.bind(a)},Number(a.totalTime()));for(let a of o)a()}}function xk(e,t,n){if(!t)return rf(e);let r=of(e,t),{points:o}=r,i=[...r.always],a=n+My;for(let l=Fy(o,n-My);l<o.length&&!(o[l].at>a);l++)i.push(o[l].mark);return i}var yl=2e-8,bl=.001,Sk=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 Ek(e){return e.vars?.keyframes&&(e.render(yl,!0),e.render(-yl,!0)),e._startAt&&e._startAt.render(yl,!0,!0),!!(e.vars?.keyframes||e._startAt)}function Iy(e,t,n){for(let r of e.filter(Sk)){let o=(t-r.startTime())*r.timeScale();Math.abs(o)<1e-9&&Ek(r)||o>0&&vk(r,o,n*r.timeScale())}}function vk(e,t,n){t<n&&e._startAt&&e._startAt.render(yl,!0,!0);let r=e.getChildren?e:e.timeline;r?.getChildren&&t<=e.totalDuration()&&Iy(r.getChildren(!1,!0,!0),t,n)}function Dy(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),o=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r,o),Vi({totalTime:n.totalTime.bind(n),totalDuration:n.totalDuration?.bind(n),getChildren:n.getChildren?.bind(n)},r)):n.seek(r,o)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function Oy(){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 o of t)r.has(o)||n.push(o);window.__hfAnime=n}catch(e){$("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(o){$("runtime.adapters.animejs.site2",o)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){$("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){$("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Uy(e){let t=r=>{let o=Gy(r),i=o&&typeof o.closest=="function"?o.closest("[data-composition-id]"):null;return i&&e?.resolveStartSeconds?e.resolveStartSeconds(i):0},n=(r,o)=>Math.max(0,o-t(r));return{name:"lottie",discover:()=>{try{let r=window.lottie;if(r&&typeof r.getRegisteredAnimations=="function"){let o=r.getRegisteredAnimations();if(Array.isArray(o)&&o.length>0){let i=window.__hfLottie??[],a=new Set(i);for(let l of o)a.has(l)||i.push(l);window.__hfLottie=i}}}catch(r){$("runtime.adapters.lottie.site1",r)}},seek:r=>{let o=Math.max(0,Number(r.time)||0),i=window.__hfLottie;if(!(!i||i.length===0))for(let a of i)try{let l=n(a,o),s=a.loop===!0;if(xl(a)){let c=l*a.frameRate;a.totalFrames>0&&s?a.goToAndStop(af(c,a.totalFrames),!0):a.totalFrames>0&&c>=a.totalFrames?a.goToAndStop(a.totalFrames-1,!0):a.goToAndStop(l*1e3,!1)}else if(sf(a)){if(typeof a.setFrame=="function"){let c=a.totalFrames??0,d=a.duration??0;if(!Number.isFinite(c)||c<=0||!Number.isFinite(d)||d<=0)continue;let f=l*c/d;a.setFrame(Math.min(s?af(f,c):f,c-1))}else if(typeof a.setCurrentRawFrameValue=="function"){let c=a.totalFrames??0,d=a.frameRate??30,f=s&&c>0?af(l*d,c):l*d;c>0&&a.setCurrentRawFrameValue(Math.min(f,c-1))}else if(typeof a.seek=="function"){let c=a.duration??0;if(Number.isFinite(c)&&c>0){let d=Math.min(100,(s?l%c:l)/c*100);a.seek(d)}}}}catch(l){$("runtime.adapters.lottie.site2",l)}},pause:()=>{let r=window.__hfLottie;if(!(!r||r.length===0))for(let o of r)try{(xl(o)||sf(o))&&o.pause()}catch(i){$("runtime.adapters.lottie.site3",i)}},revert:()=>{},getInferredDurationSeconds:()=>Hy((r,o)=>o),getAnimationCycleEndSeconds:()=>Hy((r,o)=>Gy(r)?.isConnected===!1?null:t(r)+o)}}function Hy(e){let t=window.__hfLottie;if(!t||t.length===0)return null;let n=0,r=!1;for(let o of t){let i=null;try{let a=Ak(o);i=a==null?null:e(o,a)}catch(a){$("runtime.adapters.lottie.site4",a)}i!=null&&(r=!0,n=Math.max(n,i))}return r?n:null}function Gy(e){return xl(e)?e.wrapper:e.canvas}function af(e,t){let n=e%t;return t-n<1e-6?0:n}function By(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Ak(e){return xl(e)?By(e.totalFrames,e.frameRate):sf(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:By(e.totalFrames,e.frameRate):null}function xl(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function sf(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}function Wy(){let e=null,t=0,n=null,r=null,o=null,i=null,a=()=>{if(typeof window>"u")return null;let d=window.THREE?.DefaultLoadingManager;return!d||typeof d!="object"||typeof d.itemsLoaded!="number"||typeof d.itemsTotal!="number"?null:d},l=c=>{i||c.itemsTotal<=c.itemsLoaded||(i=new Promise(d=>{c.onLoad=function(){try{o?.call(this)}finally{i=null,c.onLoad=o??null,d()}}}))},s=c=>{n!==c&&(n=c,r=c.onStart??null,o=c.onLoad??null,c.onStart=function(d,f,m){try{r?.call(this,d,f,m)}finally{l(c)}})};return{name:"three",discover:()=>{let c=a();c&&(s(c),l(c))},seek:c=>{e=Math.max(0,Number(c.time)||0),t=e,window.__hfThreeTime=e,al(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let c=a();return!c||c.itemsTotal<=c.itemsLoaded?null:(i||l(c),i)}}}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 o=r.filter(i=>!n.has(i));return o.length===0?null:t||(t=Promise.allSettled(o.map(i=>e.waitFor(i).then(()=>{n.add(i)}))).then(()=>{t=null}),t)}}}function Vy(){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 $y(){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 qy(){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 zy(){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 jy(){return Yt({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var wk=250;function Ky(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},o=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(Kb()||(window.__hfTypegpuTime=e,sl(e)))},wk))};return{name:"typegpu",discover:()=>{},seek:i=>{e=Math.max(0,Number(i.time)||0),t=e,window.__hfTypegpuTime=e,al(e)},pause:()=>{e==null&&(e=Math.max(0,t)),o()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}var So=new Map,Yy=()=>So.size>0;function Xy(e){if(So.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(c=>{n.signal.addEventListener("abort",()=>c(),{once:!0})}),o=Promise.race([Promise.resolve(e.ready),r]);o.catch(()=>{});let i=null,a=null,l=async()=>{let c;try{for(await o;!n.signal.aborted&&i!==null;){let d=i;i=null;try{await Promise.race([e.render(d,n.signal),r])}catch(f){c??(c={reason:f})}}if(c)throw c.reason}finally{i=null,a=null}},s={element:e.element,ready:o,seek(c){return i=t?t.start+Math.min(Math.max(0,c),Math.max(0,t.duration-1/t.fps)):c,a??(a=l()),a},dispose(){n.signal.aborted||(n.abort(),i=null,So.delete(e.element),e.dispose?.())}};return So.set(e.element,s),s.dispose}function Jy(e){let t=new Set,n=[],r=null,o=()=>{for(let l of t)So.get(l.element)!==l&&t.delete(l);let a=[];for(let[l,s]of So){if(!l.isConnected){s.dispose();continue}t.has(s)||(t.add(s),tt(s.ready,"frame-source")),a.push([l,s])}return a},i=new MutationObserver(()=>{o()});return i.observe(document,{childList:!0,subtree:!0}),{name:"frame-source",discover:()=>{o()},pause:()=>{},seek:({time:a})=>{for(let[l,s]of o()){let c=e.start(l),d=e.duration(l),f=c+(d??1/0),m=e.exportRenderSeek()?Us(c,f,e.canonicalFps()):{start:c,end:f};if(!uo(a,m.start,m.end,e.compositionDuration()))continue;let g=Math.max(0,a-c),h=Ct(l)+Bn(Et(l),g);tt(s.seek(h),"frame-source")}},getReadyPromise:()=>{let a=o().map(([,l])=>l);return a.length===0?null:((a.length!==n.length||a.some((l,s)=>l!==n[s]))&&(n=a,r=Promise.all(a.map(l=>l.ready))),r)},revert:()=>{i.disconnect();for(let a of t)a.dispose();t.clear()}}}function Qy(e){let t=e.nextElementSibling;if(et(t)&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;let n=It(e);return n&&n.complete&&n.naturalWidth>0?n:null}function Zy(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,o){if(Re(n?.source)){let i=Qy(n.source);if(i)return t.call(this,{...n,source:i},r,o)}return t.call(this,n,r,o)}}function ex(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let o of t){let i=r[o];if(typeof i!="function"||i.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,c=l[s];if(Re(c)){let d=Qy(c);d&&(l[s]=d)}return i.apply(this,l)};a.__hfVideoPatched=!0,r[o]=a}}}var _k=e=>typeof CSSAnimation<"u"&&e instanceof CSSAnimation||typeof CSSTransition<"u"&&e instanceof CSSTransition;function tx(){let e=!1,t=0,n=!1,r,o,i,a=new Set,l=new WeakMap,s=(S=()=>document.getAnimations())=>{if(!document.getAnimations)return[];try{return S()}catch{return[]}},c=S=>{let E=Number(S.currentTime);return Number.isFinite(E)&&E>0?E:0},d=(S,E)=>E<=0?S:S>=E?Math.max(0,S-E):S,f=(S,E)=>{let v=l.get(S);if(v)return v;let T={compositionTimeMs:E,animationTimeMs:e?d(c(S),E):c(S)};return l.set(S,T),T},m=(S,E)=>{if(!a.has(S)){a.add(S);let v=()=>{a.delete(S)};try{S.addEventListener("finish",v,{once:!0}),S.addEventListener("cancel",v,{once:!0})}catch(T){$("runtime.adapters.waapi.site4",T)}}f(S,E)},g=(S,E)=>{for(let v of S)m(v,E)},h=()=>{if(n||typeof Element>"u")return;let S=Element.prototype;if(typeof S.animate!="function"||S.__hfOriginalAnimate)return;let E=S.animate;try{Object.defineProperty(S,"__hfOriginalAnimate",{value:E,configurable:!0});let v=function(...T){let H=E.apply(this,T);return m(H,t),H};S.animate=v,r=S,o=E,i=v,n=!0}catch{}},y=S=>{let E=null;try{E=S.effect?.getComputedTiming?.()??null}catch(H){$("runtime.adapters.waapi.site4",H)}if(!E)return{};let v=Number(E.endTime);return Number.isFinite(v)?{endSeconds:(l.get(S)?.compositionTimeMs??0)/1e3+v/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,h(),g(s(),t)},seek:S=>{let E=Math.max(0,(Number(S.time)||0)*1e3);t=E,(!e||a.size>0)&&g(s(S.pageAnimations),e?E:0);for(let v of a){if(v.playState==="idle"&&_k(v)){a.delete(v);continue}let T=e?f(v,E):f(v,0),H=T.animationTimeMs+Math.max(0,E-T.compositionTimeMs);gl(v,H,"runtime.adapters.waapi.site1","runtime.adapters.waapi.site2")}},pause:S=>{e||g(s(S?.pageAnimations),t);for(let E of a)try{E.pause()}catch(v){$("runtime.adapters.waapi.site3",v)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&o&&i&&r.animate===i)try{r.animate=o,r.__hfOriginalAnimate===o&&delete r.__hfOriginalAnimate}catch(S){$("runtime.adapters.waapi.site5",S)}r=void 0,o=void 0,i=void 0,n=!1},getInferredDurationSeconds:()=>{let S=0;for(let E of s()){let v=y(E);v.endSeconds!=null&&(S=Math.max(S,v.endSeconds))}return S>0?S:null}}}var Ot=new WeakMap;function qi(e){return Ot.has(e)?Ot.get(e)??null:e.getAttribute("src")}var $n=new WeakMap;function nx(e){return $n.has(e)?$n.get(e)?.poster??null:e.getAttribute("poster")}var Tk=2e3;function rx(e){let t=$n.get(e);return t!==void 0&&performance.now()-t.since<Tk}var ix="hf-proxy-box",ax="hf-proxy-light",Sl="hf-proxy-retry",sx="X-HF-Proxy-Progress",lx="X-HF-Proxy-Priority",Ck=[256,304,362,430,512,608,724,862,1024,1218,1448,1722,2048,2436,2896,3444,4096,4870,5792,6888,8192];function ox(e){return e>0?Ck.find(t=>t>=e)??null:null}function lf(e,t){let n=ox(e),r=ox(t);return n&&r?{width:n,height:r}:null}function ux(e){return`${e.width}x${e.height}`}var uf=[1,.5,.25,.125];function cx(e){return uf.some(t=>t===e)}var Rk=.5,Mk=4e7;function El(e,t){return lf(e.width*t,e.height*t)??e}function vl(e,t){return t.width*t.height<=Rk*e.width*e.height||e.bitDepth>8||e.bitrate>=Mk}var kk=3;function Lk(e){let t=new URL(e,document.baseURI);return t.searchParams.delete(Sl),t.href}function Nk(e){let t={Range:"bytes=0-0"};return e&&(t[lx]="1"),t}function Fk(e,t){let n=e?.status===202?e.headers.get(sx):null;n!==null&&Number.isFinite(Number(n))&&t?.(Math.min(1,Math.max(0,Number(n))))}async function cf(e,t,n,r=()=>!1){let o=0,i=e;for(;t();){let a=Nk(r()),l=await fetch(i,{headers:a,cache:"no-store"}).catch(()=>null);i=Lk(e),l?.body?.cancel().catch(()=>{});let s=l?.status===202||l?.status===503;if(Fk(l,n),!s&&l?.ok)return!0;if(!s&&++o>kk)return!1;let c=Math.min(Number(l?.headers.get("Retry-After"))||2,30);await new Promise(d=>setTimeout(d,c*1e3))}return!1}var Pk="hf-proxy",dx="runtime_media_proxy_fallback",fx="runtime_media_proxy_unavailable",mx=new WeakSet,Xt=new WeakMap;function Al(e){return e.currentSrc||e.src}var gn=1,ff=new WeakSet,mf=new WeakSet,kt=window.parent===window?1:null,hx=()=>{},Ik=new Promise(e=>hx=e),Dk=1e3,jn=new Map,qn=new WeakMap;function Ok(){return kt!==null?Promise.resolve(kt):Promise.race([Ik.then(()=>kt),new Promise(e=>setTimeout(()=>e(null),Dk))])}function pf(e,t){if(getComputedStyle(e).objectFit==="none")return null;let n=e.getBoundingClientRect(),r=document.documentElement,o=t*(window.devicePixelRatio||1);return lf(Math.max(n.width,r.clientWidth)*o,Math.max(n.height,r.clientHeight)*o)}function gx(e){if(!(!(e>0)||!Number.isFinite(e))){kt=e,hx();for(let t of jn.keys())_l(t,e)}}function bx(e){let t=window.__HF_MEDIA_CODEC_MAP__,n=Eo(e);return t&&n!==null?vo(n,t):null}function wl(e){let t=window.__HF_MEDIA_SOURCE_FACTS__,n=Eo(e);return t&&n!==null?vo(n,t):null}function _l(e,t){let n=jn.get(e);if(!n)return;if(!e.isConnected||e.getAttribute("src")!==n.href){jn.delete(e);return}let r=pf(e,t),o=gn<1,i=r&&o?El(r,gn):r;if(!(o&&!i)){if(i&&o&&n.light&&Gk(e,i))return yx(e);if(Bk(n.box,i,o))return Hk(e);Wk(e,n,o||!i?i:Uk(i,n.box))}}function Hk(e){qn.delete(e)&&hn(e,"ready")}function Gk(e,t){let n=wl(e);return n!==null&&!vl(n,t)}function Bk(e,t,n){return n?t?.width===e.width&&t.height===e.height:t!==null&&t.width<=e.width&&t.height<=e.height}function Uk(e,t){return{width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)}}function Wk(e,t,n){let r=vx(t.originalSrc,t.variant,n,t.light,mf.delete(e));if(qn.get(e)===r)return;qn.set(e,r);let o=()=>qn.get(e)===r&&e.isConnected&&e.getAttribute("src")===t.href;hn(e,"making"),cf(r,o,i=>o()&&hn(e,"making",i),()=>$d(e)).then(i=>{o()&&hn(e,i?"ready":"failed"),i&&o()&&Ex(e,r,t.originalSrc,t.variant,n,t.light),qn.get(e)===r&&qn.delete(e)})}function yx(e){let t=Ot.get(e)??null;for(let n of[jn,qn,Xt,Ot])n.delete(e);ff.delete(e),cl(e),Zs(),t===null?(df.get(e)?.(),e.removeAttribute("src")):(Sx(e),e.setAttribute("src",t)),e.load()}var Vk=640,xx=2,px=["loadeddata","seeked","error"],df=new WeakMap;function Sx(e){if(!Re(e)||$n.has(e))return;let t=$k(e);if(!t)return;$n.set(e,{poster:e.getAttribute("poster"),since:performance.now()}),e.setAttribute("poster",t);let n=()=>{for(let i of px)e.removeEventListener(i,r);df.delete(e);let o=$n.get(e)?.poster??null;$n.delete(e),o===null?e.removeAttribute("poster"):e.setAttribute("poster",o)},r=o=>{(o.type==="error"||e.readyState>=xx&&!e.seeking)&&n()};for(let o of px)e.addEventListener(o,r);df.set(e,n)}function $k(e){if(e.readyState<xx||!e.videoWidth||!e.videoHeight)return null;let t=Math.min(1,Vk/e.videoWidth),n=document.createElement("canvas");n.width=Math.max(1,Math.round(e.videoWidth*t)),n.height=Math.max(1,Math.round(e.videoHeight*t));try{let r=n.getContext("2d");return r?(r.drawImage(e,0,0,n.width,n.height),n.toDataURL("image/jpeg",.85)):null}catch{return null}}function Ex(e,t,n,r,o,i=!1){o?jn.set(e,{originalSrc:n,variant:r,href:t,box:o,light:i}):jn.delete(e),cl(e),Zs(),Sx(e),e.src=t,e.load()}function Kn(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:Re(e)&&!!It(e)}function Eo(e){let t=Al(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 qk(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 zk(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,o=null,i=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,o=l,i=!1):s.length===r&&(i=!0))}return i?null:o}function vo(e,t){return t[e]??qk(e,t)??zk(e,t)}function vx(e,t,n,r=!1,o=!1){let i=new URL(e,document.baseURI);return i.searchParams.set(Pk,t),n&&i.searchParams.set(ix,ux(n)),r&&n&&i.searchParams.set(ax,"1"),o&&i.searchParams.set(Sl,"1"),i.href}var jk={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 zn(e,t,n){if(mx.has(e))return;mx.add(e);let r=jk[t];we({source:"hf-preview",type:"diagnostic",code:fx,details:{asset:n,codecName:null,reason:t,note:r}}),globalThis.console.info(`[hyperframes] ${fx}: "${n}" (${t}): ${r}`)}async function Kk(e,t,n){let{originalSrc:r,originalAttr:o,variant:i,lightFacts:a,level:l,live:s}=t,c=n===null?null:pf(e,n),d=c&&l<1?El(c,l):c;if(a&&!(d&&vl(a,d))){Xt.get(e)===o&&Xt.delete(e);return}let f=vx(r,i,d,a!==void 0,mf.delete(e));hn(e,"making");let m=await cf(f,s,g=>hn(e,"making",g),()=>$d(e));if(!s()){Xt.get(e)===o&&Xt.delete(e),a&&e.isConnected&&e.getAttribute("src")===o&&wx(e);return}if(!m){hn(e,"failed"),zn(e,"proxy_playback_failed",r);return}return hn(e,"ready"),Ot.set(e,o),a&&ff.add(e),Ex(e,f,r,i,d,a!==void 0),kt!==null&&_l(e,kt),new Promise(g=>{e.addEventListener("loadeddata",g,{once:!0}),e.addEventListener("error",g,{once:!0})})}function zi(e,t=null,n="reactive",r){if(Ot.has(e)||Xt.has(e)&&Xt.get(e)===e.getAttribute("src"))return;let o=Al(e),i=t?t.hasAlpha?"vp8":"h264":"auto";try{new URL(o,document.baseURI)}catch(g){$("runtime.mediaProxy.swap",g),zn(e,"invalid_source_url",o);return}let a=e.getAttribute("src");Xt.set(e,a);let l=gn,c={originalSrc:o,originalAttr:a,variant:i,lightFacts:r,level:l,live:()=>e.isConnected&&e.getAttribute("src")===a&&(!r||gn===l)},d=Ok().then(g=>Kk(e,c,g));if(r)return;tt(Promise.race([d,new Promise(g=>setTimeout(g,Vd))]),"video-frame");let f=t?.codecName??null;we({source:"hf-preview",type:"diagnostic",code:dx,details:{asset:o,codecName:f,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),globalThis.console.info(`[hyperframes] ${dx}: "${o}" uses a codec (${f??"unknown"}) this browser can\'t decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Ax(e){if(Kn(e)||!Re(e)||Ot.has(e))return;let t=bx(e),n=t?.representativeMime?e.canPlayType(t.representativeMime):"",r=n==="probably"||n==="maybe";t?.browserHostile&&!r?zi(e,t,"proactive"):gn<1&&hf(e,t)}function hf(e,t){if(Ot.has(e)||Xt.has(e))return;let n=wl(e);n&&zi(e,t,"light",n)}function wx(e){if(!(Kn(e)||!Re(e))){if(gn===1&&ff.has(e))return yx(e);if(jn.has(e)&&kt!==null)return _l(e,kt);gn<1&&hf(e,bx(e))}}function _x(e){if(!(!cx(e)||e===gn)){gn=e,my(e),Zs();for(let t of document.querySelectorAll("video"))wx(t)}}function Tx(){if(kt===null)return[];let e=[...document.querySelectorAll("video")].flatMap(t=>{let n=wl(t),r=n&&pf(t,kt??1);return n&&r?[{facts:n,shown:r}]:[]});return uf.filter(t=>t<1&&e.some(({facts:n,shown:r})=>vl(n,El(r,t))))}function Cx(){let e=new Map;for(let t of document.querySelectorAll("video")){let n=Eo(t),r=window.__HF_MEDIA_CODEC_MAP__,{width:o=0,height:i=0,bitDepth:a=0,codec:l}=wl(t)??{},s=r&&n!==null?vo(n,r)?.codecName:void 0,c=l??s??"unknown",d=`${c}|${o}|${i}|${a}`,f=e.get(d)??{codec:c,width:o,height:i,bitDepth:a,count:0};f.count+=1,e.set(d,f)}return[...e.values()]}function Rx(){for(let e of py()){mf.add(e),Xt.delete(e),qn.delete(e);let t=window.__HF_MEDIA_CODEC_MAP__,n=Eo(e),r=t&&n!==null?vo(n,t):null;jn.has(e)&&kt!==null?_l(e,kt):r?.browserHostile?zi(e,r,"reactive"):hf(e,r)}}function Mx(e){if(Kn(e)||!Re(e)||e.videoWidth!==0)return;let t=Al(e);if(Ot.has(e)){zn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Eo(e);if(r===null){zn(e,"cross_origin",t);return}let o=vo(r,n);if(o&&!o.browserHostile){zn(e,"browser_safe_codec",t);return}zi(e,o,"reactive")}function kx(e){if(Kn(e)||!Re(e))return;let t=Al(e);if(Ot.has(e)){zn(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Eo(e);if(r===null){zn(e,"cross_origin",t);return}let o=vo(r,n);if(o&&!o.browserHostile){zn(e,"browser_safe_codec",t);return}zi(e,o,"tertiary")}var qe=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);be(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},Yk=[0,0,0],Xk=[1,1,1],Tl=65;function Jk(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 Yn(e,t){let n=Number(e);if(!Number.isFinite(n))throw new qe(`Invalid number "${e}"`,t);return n}function Lx(e,t,n){if(e.length!==3)throw new qe(`${t} expects three numbers`,n);return[Yn(e[0],n),Yn(e[1],n),Yn(e[2],n)]}function Nx(e,t,n){if(!e)throw new qe(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new qe(`${t} must be an integer greater than 1`,n);return r}function Qk(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new qe("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Zk(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 eL(e){return/^[+-]?(?:\\d|\\.\\d)/.test(e)}function Fx(e,t={}){let n=t.maxSize??Tl,r=null,o=Yk,i=Xk,a=null,l=null,s=[],c=e.replace(/^\\uFEFF/,"").split(/\\r?\\n/);for(let f=0;f<c.length;f++){let m=f+1,g=Jk(c[f]??"").trim();if(!g)continue;let h=g.split(/\\s+/),y=(h[0]??"").toUpperCase(),S=h.slice(1);if(y==="TITLE"){r=Zk(g);continue}if(y==="DOMAIN_MIN"){o=Lx(S,y,m);continue}if(y==="DOMAIN_MAX"){i=Lx(S,y,m);continue}if(y==="LUT_3D_INPUT_RANGE"){if(S.length!==2)throw new qe(`${y} expects two numbers`,m);let E=Yn(S[0],m),v=Yn(S[1],m);if(v<=E)throw new qe("LUT_3D_INPUT_RANGE max must exceed min",m);o=[E,E,E],i=[v,v,v];continue}if(y==="LUT_1D_SIZE"){a=Nx(S[0],y,m);continue}if(y==="LUT_3D_SIZE"){if(l=Nx(S[0],y,m),l>n)throw new qe(`LUT_3D_SIZE ${l} exceeds max ${n}`,m);continue}if(!eL(y)){if(y.startsWith("LUT_"))throw new qe(`Unsupported cube keyword ${y}`,m);continue}if(!l)throw a?new qe("1D cube LUTs are not supported yet",m):new qe("LUT data appears before LUT_3D_SIZE",m);if(h.length!==3)throw new qe("LUT data rows must contain three numbers",m);s.push(Yn(h[0],m),Yn(h[1],m),Yn(h[2],m))}if(a&&l)throw new qe("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new qe("1D cube LUTs are not supported yet"):new qe("Missing LUT_3D_SIZE");Qk(o,i);let d=l*l*l;if(s.length!==d*3)throw new qe(`Expected ${d} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:o,domainMax:i,data:new Float32Array(s)}}function tL(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function ji(e){return Math.round(tL(e)*255)}function gf(e){let t=e.size,n=t*t,r=t,o=new Uint8Array(n*r*4);for(let i=0;i<t;i++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((i*t+a)*t+l)*3,c=(a*n+i*t+l)*4;o[c]=ji(e.data[s]??0),o[c+1]=ji(e.data[s+1]??0),o[c+2]=ji(e.data[s+2]??0),o[c+3]=255}return{width:n,height:r,data:o}}function bf(e,t){if(!(t>=4)||e.size*e.size<=t)return e;let n=Math.max(2,Math.floor(Math.sqrt(t))),r=new Float32Array(n*n*n*3),o=e.size-1,i=(l,s,c,d)=>e.data[((c*e.size+s)*e.size+l)*3+d]??0,a=(l,s,c)=>l+(s-l)*c;for(let l=0;l<n;l++)for(let s=0;s<n;s++)for(let c=0;c<n;c++){let d=c/(n-1)*o,f=s/(n-1)*o,m=l/(n-1)*o,g=Math.floor(d),h=Math.floor(f),y=Math.floor(m),S=Math.min(o,g+1),E=Math.min(o,h+1),v=Math.min(o,y+1);for(let T=0;T<3;T++){let H=U=>a(a(i(g,h,U,T),i(S,h,U,T),d-g),a(i(g,E,U,T),i(S,E,U,T),d-g),f-h);r[((l*n+s)*n+c)*3+T]=a(H(y),H(v),m-y)}}return{...e,size:n,data:r}}var Px="rec709";var Ix=["video","img","canvas"],Dx="hf-color-group",Ox="data-color-group",Fe={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 Hx=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"];var Gx=["shadows","midtones","highlights"],Bx=["master","red","green","blue"],Ux=["hueVsHue","hueVsSaturation","hueVsLuma"];var Wx=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],Vx=["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 q5=Fe.unit,z5=Fe.signedUnit,j5=Fe.effects;var Jt=1024,Ki=16;function $x(e,t,n,r){let o=((2*e+t)*n-e*r)/(e+t);return Math.sign(o)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(o)>3*Math.abs(n)?3*n:o}function ze(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function nL(e){let t=[],n=[],r=ze(e,0);for(let a of e.slice(1)){let l=a[0]-r[0];t.push(l),n.push((a[1]-r[1])/l),r=a}let o=ze(n,0);if(e.length===2)return[o,o];let i=new Array(e.length);i[0]=$x(ze(t,0),ze(t,1),o,ze(n,1)),i[i.length-1]=$x(ze(t,t.length-1),ze(t,t.length-2),ze(n,n.length-1),ze(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ze(n,a-1),s=ze(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){i[a]=0;continue}let c=ze(t,a-1),d=ze(t,a),f=2*d+c,m=d+2*c;i[a]=(f+m)/(f/l+m/s)}return i}function qx(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,o]of e){if(!Number.isFinite(r)||!Number.isFinite(o))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 rL(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 oL(e,t,n,r,o){let i=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/i)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*i*r+(-2*s+3*l)*n[1]+(s-l)*i*o}function zx(e,t,n,r,o){rL(e,r,o);let i=nL(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let c=n(s);for(;l<e.length-2&&c>ze(e,l+1)[0];)l+=1;let d=ze(e,l),f=ze(e,l+1),m=oL(c,d,f,ze(i,l),ze(i,l+1));a[s]=Math.min(o,Math.max(r,m))}return a}function Ao(e,t=Jt){if(qx(e,t),e.length>Ki)throw new RangeError(`A color curve supports at most ${Ki} 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 zx(e,t,n=>n/(t-1),0,1)}function xf(e,t,n,r=Jt){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>Ki)throw new RangeError(`A hue curve supports at most ${Ki} points`);let o=[...e].sort((s,c)=>s[0]-c[0]);for(let s=0;s<o.length;s+=1){let c=o[s];if(!c||c[0]<0||c[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&c[0]===o[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let i=o.slice(-2).map(([s,c])=>[s-360,c]),a=o.slice(0,2).map(([s,c])=>[s+360,c]),l=[...i,...o,...a];return qx(l,r),zx(l,r,s=>s/r*360,t,n)}var To="data-color-grading",Pr="data-hf-color-grading-source-hidden",Ir="data-hf-authored-opacity",Jx="__hf_color_grading_",aL=Px,Yi=Ix,vf={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Af={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},wf={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 Ml=Hx,Qx=Gx,Zx=Bx,eS=Ux,Tf=Wx,Cf=Vx,jx={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},Kx={vignette:.18};function je(e,t,n={},r={},o={},i=1){return{id:e,label:t,intensity:i,adjust:{...vf,...n},details:{...Af,...r},effects:{...wf,...o}}}var Rf=[je("neutral","Neutral"),je("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),je("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),je("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),je("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),je("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),je("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),je("vintage-wash","Vintage Wash",jx,Kx),je("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),je("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),je("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),je("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),je("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),je("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),je("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}),je("home-movie-8mm","8mm Home Movie",jx,{...Kx,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),je("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),je("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],sL=new Map(Rf.map(e=>[e.id,e])),lL=/^\\$(?:\\{([A-Za-z0-9_.:-]+)\\}|([A-Za-z0-9_.:-]+))$/,uL={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}},wo={hue:0,amount:0,level:0},Yx={amount:Fe.unit,level:Fe.signedUnit},Xn=[[0,0],[1,1]],_o=[],cL={hueVsHue:Fe.secondaryHueShift,hueVsSaturation:Fe.signedUnit,hueVsLuma:Fe.signedUnit},Sf={center:0,range:180,softness:0},Ef={min:0,max:1,softness:.05},dL={vignette:Fe.unit,vignetteMidpoint:Fe.unit,vignetteRoundness:Fe.signedUnit,vignetteFeather:Fe.unit,grain:Fe.unit,grainSize:Fe.unit,grainRoughness:Fe.unit},_f=Fe.unit,fL=Fe.effects,tS=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var mL=Rf.filter(e=>tS.some(t=>e.effects[t]>1e-4)),n$=Rf.filter(e=>!mL.includes(e)),r$={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}},nS=[{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 pL=/^#[0-9a-f]{6}$/i;function hL(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&pL.test(t))?null:e.map(t=>t.toLowerCase())}function nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Rl(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function rS(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function ct(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Rl(n,t.min,t.max):0}function Mf(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function gL(e){let t=nt(e)?e:{};return Qx.reduce((n,r)=>{let o=nt(t[r])?t[r]:{};return n[r]={hue:Mf(o.hue,wo.hue),amount:ct(o.amount??wo.amount,Yx.amount),level:ct(o.level??wo.level,Yx.level)},n},{shadows:{...wo},midtones:{...wo},highlights:{...wo}})}function bL(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)?[Rl(t,0,1),Rl(n,0,1)]:null}function oS(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function yL(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function xL(e){if(!Array.isArray(e)||e.length<2)return Xn;let t=[];for(let n of e){let r=bL(n);if(!r)return Xn;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),oS(t)||(yL(t),t.length>16)?Xn:t}function SL(e){let t=nt(e)?e:{};return Zx.reduce((n,r)=>(n[r]=xL(t[r]),n),{master:Xn,red:Xn,green:Xn,blue:Xn})}function EL(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)?[Mf(n),Rl(r,t.min,t.max)]:null}function vL(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return _o;let n=[];for(let r of e){let o=EL(r,t);if(!o)return _o;n.push(o)}return n.sort((r,o)=>r[0]-o[0]),oS(n)?_o:n}function AL(e){let t=nt(e)?e:{};return eS.reduce((n,r)=>(n[r]=vL(t[r],cL[r]),n),{hueVsHue:_o,hueVsSaturation:_o,hueVsLuma:_o})}function Xx(e){let t=nt(e)?e:{},n=ct(t.min??Ef.min,_f),r=ct(t.max??Ef.max,_f);return{min:Math.min(n,r),max:Math.max(n,r),softness:ct(t.softness??Ef.softness,Fe.secondarySoftRangeSoftness)}}function wL(e){let t=nt(e)?e:{},n=ct(t.range??Sf.range,Fe.secondaryHueRange);return{center:Mf(t.center,Sf.center),range:n,softness:ct(t.softness??Sf.softness,{min:Fe.secondaryHueSoftness.min,max:Fe.secondaryHueCombinedMax-n})}}function _L(e){return{hueShift:ct(e.hueShift??0,Fe.secondaryHueShift),saturation:ct(e.saturation??0,Fe.signedUnit),luma:ct(e.luma??0,Fe.signedUnit),temperature:ct(e.temperature??0,Fe.signedUnit),tint:ct(e.tint??0,Fe.signedUnit)}}function TL(e){return!nt(e)||!nt(e.key)||!nt(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:wL(e.key.hue),saturation:Xx(e.key.saturation),luma:Xx(e.key.luma)},correction:_L(e.correction)}}function CL(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=TL(n);r&&t.push(r)}return t}function RL(e){if(e==null)return null;let t=String(e).trim();return t||null}function ML(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!nt(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:rS(e.intensity,1)}}function kL(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return nt(n)?n:null}catch{return null}return{preset:t}}return nt(e)?e:null}function LL(e,t){let n=e.trim().match(lL);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Cl(e,t){if(typeof e=="string"){let r=LL(e,t);if(r!==e)return r;let o=e.trim();if(!o.startsWith("{"))return e;try{return Cl(JSON.parse(o),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Cl(r,t));if(!nt(e))return e;let n={};for(let[r,o]of Object.entries(e))n[r]=Cl(o,t);return n}function NL(e){return e?sL.get(e)??null:null}function kl(e){let t=kL(e);if(!t||t.enabled===!1)return null;let n=RL(t.preset),r=NL(n),o=r?.adjust??vf,i=r?.details??Af,a=r?.effects??wf,l=nt(t.adjust)?t.adjust:{},s=nt(t.details)?t.details:{},c=nt(t.effects)?t.effects:{},d=Ml.reduce((g,h)=>(g[h]=ct(l[h]??o[h],uL[h]),g),{...vf}),f=Tf.reduce((g,h)=>(g[h]=ct(s[h]??i[h],dL[h]),g),{...Af}),m=Cf.reduce((g,h)=>(g[h]=ct(c[h]??a[h],fL[h]??_f),g),{...wf});return{enabled:!0,preset:n,intensity:rS(t.intensity,r?.intensity??1),adjust:d,wheels:gL(t.wheels),curves:SL(t.curves),hueCurves:AL(t.hueCurves),secondaries:CL(t.secondaries),details:f,effects:m,palette:hL(t.palette),lut:ML(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():aL}}function iS(e,t){return kl(Cl(e,t))}function FL(e){return Qx.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function kf(e){return Zx.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Lf(e){return eS.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function Nf(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function aS(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||tS.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Ml.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?FL(e.wheels):!1)||(e.curves?kf(e.curves):!1)||(e.hueCurves?Lf(e.hueCurves):!1)||(e.secondaries?Nf(e.secondaries):!1):!1}var Ll=/^(|transparent|rgba\\(.*,\\s*0\\)|.*\\/\\s*0%?\\s*\\))$/,PL=new Set(["IMG","VIDEO","IFRAME","EMBED","OBJECT","CANVAS"]),sS="http://www.w3.org/2000/svg",IL=new Set(["svg","g","foreignObject"]),DL=["Top","Right","Bottom","Left"],OL={left:-1/0,right:1/0,top:-1/0,bottom:1/0},lS=e=>!!e.backgroundImage&&e.backgroundImage!=="none"||!Ll.test(e.backgroundColor),HL=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!Ll.test(t)||n>0&&!Ll.test(r)},uS=e=>DL.map(t=>e[`border${t}Style`]!=="none"&&!Ll.test(e[`border${t}Color`])&&Number.parseFloat(e[`border${t}Width`])||0),Nl=e=>e.bottom-e.top,Ff=(e,t,n)=>t>=e.left&&t<=e.right&&n>=e.top&&n<=e.bottom,cS=(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)}),GL=(e,t)=>t.display==="none"||t.position==="absolute"||t.position==="fixed"||Number.parseFloat(t.opacity)<=.01&&!e.hasAttribute(Pr);function BL(e,t,n){if(e.width<=0&&e.height<=0)return!1;let r=3*(Number.parseFloat(t.fontSize)||16),o=Math.max(r,Math.min(2*e.height,20*r/3));return n<e.top-o||n>e.bottom+o}function UL(e,t,n,r){let[o,i,a,l]=uS(t);if(!(o||i||a||l))return!1;let s=e.getBoundingClientRect(),{offsetWidth:c,offsetHeight:d}=e,f=c>0?s.width/c:1,m=d>0?s.height/d:1,g={left:s.left+l*f,right:s.right-i*f,top:s.top+o*m,bottom:s.bottom-a*m};return!Ff(g,n,r)}function WL(e){let t=[];for(let n of[...e].sort((r,o)=>r.left-o.left)){let r=t.findIndex(o=>n.top<o.bottom&&n.bottom>o.top&&n.left-o.right<=2*Math.max(Nl(o),Nl(n)));r<0?t.push(n):t[r]=cS(t[r],n)}return t}function VL(e){let t=[...e].sort((n,r)=>n.top-r.top);return t.flatMap((n,r)=>t.slice(r+1).flatMap(o=>{let i=o.left<n.right&&o.right>n.left,a=o.top-n.bottom<=2*Math.min(Nl(n),Nl(o));return i&&a&&o.top>n.bottom?[cS(n,o)]:[]}))}function dS(e,t,n){let r=e.defaultView,o=typeof e.createRange().getClientRects=="function",i=e.createRange(),a=new Map,l=new Map,s=new Map,c=S=>{let E=l.get(S);if(E===void 0){let v=r.getComputedStyle(S);E=GL(S,v)||o&&BL(S.getBoundingClientRect(),v,n),l.set(S,E)}return E},d=S=>{let E=s.get(S);if(E===void 0){let v=S.parentElement,T=v&&S.nodeValue?.trim()?r.getComputedStyle(v):null;E=!!T&&T.visibility!=="hidden"&&HL(T),s.set(S,E)}return E},f=S=>{if(!o)return[OL];let E=[];i.selectNodeContents(S);for(let v of i.getClientRects()){let T=v.bottom-v.top;v.width>0&&T>0&&n>=v.top-2*T&&n<=v.bottom+2*T&&E.push(v)}return E},m=S=>{let E=a.get(S);if(E)return E;E=[];for(let v of S.childNodes)v.nodeType===3?d(v)&&E.push(...f(v)):v.nodeType===1&&v.hasChildNodes()&&!c(v)&&E.push(...m(v));return a.set(S,E),E};function g(S){let E=WL(m(S));return E.some(v=>Ff(v,t,n))||VL(E).some(v=>Ff(v,t,n))}function h(S,E){let v=r.getComputedStyle(S,E);return!v.content||v.content==="none"||v.content==="normal"||v.display==="none"?!1:v.content!==\'""\'||lS(v)||uS(v).some(T=>T>0)}let y=(S,E)=>/inset/.test(E.boxShadow)||UL(S,E,t,n)||h(S,"::before")||h(S,"::after");return S=>{if(PL.has(S.tagName)||!(S.namespaceURI!==sS||IL.has(S.localName))||!r)return!0;let v=r.getComputedStyle(S);return lS(v)||y(S,v)||S.namespaceURI!==sS&&g(S)}}var $L=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),qL=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(","),fS="[data-hf-inner-root],[data-composition-id]:not([data-composition-id] *)",mS=`${fS}{pointer-events:auto!important}`,zL=`@layer hf-picker{${mS}}`;function pS(e){let t=!1,n=null,r=null,o=null,i=null,a,l=new Set;function s(_,N){try{window.dispatchEvent(new CustomEvent(_,{detail:N}))}catch(j){$("runtime.picker.site1",j)}}function c(_){o=_,s("hyperframe:picker:hovered",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function d(_){i=_,s("hyperframe:picker:selected",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function f(_){if(l=new Set(Array.from(document.querySelectorAll(fS)).filter(ae=>getComputedStyle(ae).pointerEvents==="none")),l.size===0)return _();let N=m(),j=N?g(N):h();try{return _()}finally{j(),l=new Set}}function m(){if(a!==void 0)return a;if(a=null,!Array.isArray(document.adoptedStyleSheets)||typeof CSSStyleSheet>"u")return null;try{let _=new CSSStyleSheet;_.replaceSync(zL),a=_}catch(_){$("runtime.picker.site2",_)}return a}function g(_){return document.adoptedStyleSheets=[...document.adoptedStyleSheets,_],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(N=>N!==_)}}function h(){let _=document.createElement("style");return _.textContent=mS,(document.head??document.documentElement).appendChild(_),()=>_.remove()}function y(_,N){let j=N.getComputedStyle(_),ae=Number.parseFloat(j.opacity||"1");if(Number.isFinite(ae)&&ae<.2&&!(_.textContent??"").trim()){let ve=j.backgroundImage;if(ve&&ve!=="none")return!0}return H(_,N)}function S(_){if(_.namespaceURI!=="http://www.w3.org/2000/svg")return!1;let N=_.tagName.toLowerCase();return N==="filter"||N==="defs"||N.startsWith("fe")}function E(_){if(_.namespaceURI!=="http://www.w3.org/2000/svg"||_.tagName.toLowerCase()!=="rect")return!1;let N=(_.getAttribute("filter")??"").trim();return N&&N!=="none"?!0:(_.ownerDocument.defaultView?.getComputedStyle(_).filter??"none").startsWith("url(")}function v(_){if((_.textContent??"").trim())return!1;if(S(_)||E(_))return!0;let N=[..._.children];return N.length>0&&N.every(j=>v(j))}function T(_,N){let j=Number.parseFloat(N.getComputedStyle(_).opacity||"1");return Number.isFinite(j)&&j<.2}function H(_,N){if(!v(_))return!1;for(let j=_;j&&j!==document.body&&j!==document.documentElement;j=j.parentElement)if(T(j,N)&&v(j))return!0;return!1}function U(_){let N=_.ownerDocument.defaultView;if(!N)return!1;let j=_;if(N.getComputedStyle(_).visibility==="hidden"||y(_,N))return!0;for(;j&&j!==document.body&&j!==document.documentElement;){let ae=N.getComputedStyle(j);if(ae.display==="none"||ae.pointerEvents==="none")return!0;let de=Number.parseFloat(ae.opacity);if(Number.isFinite(de)&&de<=.01&&!j.hasAttribute(Pr))return!0;j=j.parentElement}return!1}function M(_){if(!_||_===document.body||_===document.documentElement)return!1;let N=_.tagName.toLowerCase();return!(N==="script"||N==="style"||N==="link"||N==="meta"||l.has(_)||_.closest($L)||U(_))}function L(_){return!!_?.closest(qL)}function G(_){let N=_.parentElement?.getAttribute("data-composition-id");return!_.hasAttribute("data-hf-inner-root")||!N?null:`[data-composition-id="${CSS.escape(N)}"] > [data-hf-inner-root]`}function C(_){let N=G(_);if(N)return N;let j=_;if(j.id)return`#${CSS.escape(j.id)}`;let ae=_.getAttribute("data-composition-id");if(ae)return`[data-composition-id="${CSS.escape(ae)}"]`;let de=_.getAttribute("data-composition-src");if(de)return`[data-composition-src="${CSS.escape(de)}"]`;let ve=_.getAttribute("data-track-index");if(ve)return`[data-track-index="${CSS.escape(ve)}"]`;let z=_.tagName.toLowerCase(),ee=_.parentElement;if(!ee)return z;let Q=ee.querySelectorAll(`:scope > ${z}`);if(Q.length===1)return z;for(let fe=0;fe<Q.length;fe+=1)if(Q[fe]===_)return`${z}:nth-of-type(${fe+1})`;return z}function B(_){let N=_.tagName.toLowerCase(),j=(_.textContent??"").trim().replace(/\\s+/g," "),ae=(ve,z)=>{let ee=Array.from(ve);return ee.length>z?`${ee.slice(0,z-1).join("")}\\u2026`:ve},de=/^h[1-6]$/.test(N);return de||N==="p"||N==="span"||N==="div"?j.length>0?ae(j,56):de?"Heading":"Text":N==="img"?"Image":N==="video"?"Video":N==="audio"?"Audio":N==="svg"?"Shape":_.getAttribute("data-composition-src")?"Composition":N==="section"?"Section":`${N.charAt(0).toUpperCase()}${N.slice(1)}`}function O(_,N,j){let ae=typeof j=="number"&&j>0?j:8,de=[];if(document.elementsFromPoint)de=document.elementsFromPoint(_,N);else if(document.elementFromPoint){let fe=document.elementFromPoint(_,N);de=fe?[fe]:[]}if(L(de[0]??null))return[];let ve={},z=[],ee=[],Q=dS(document,_,N);for(let[fe,ce]of de.entries()){if(!M(ce))continue;let xe=`${ce.tagName}::${ce.id||""}::${fe}`;if(!ve[xe]&&(ve[xe]=!0,z.push(ce),(ee.some(re=>ce.contains(re))||Q(ce))&&(ee.push(ce),ee.length>=ae)))break}return ee.length>0?ee:z.slice(0,ae)}function Y(_){let N=_.getBoundingClientRect(),j={};for(let de of Array.from(_.attributes))de.name.startsWith("data-")&&(j[de.name]=de.value);return{id:_.id||null,tagName:_.tagName.toLowerCase(),selector:C(_),label:B(_),boundingBox:{x:N.left,y:N.top,width:N.width,height:N.height},textContent:_.textContent?_.textContent.trim().slice(0,200):null,src:_.getAttribute("src")||_.getAttribute("data-composition-src")||null,dataAttributes:j}}function Z(_,N,j){return f(()=>O(_,N,j)).map(Y)}function J(_){if(!t)return;let N=f(()=>{let ae=O(_.clientX,_.clientY,1)[0]??(Ge(_.target)?_.target:null);return M(ae)?ae:null});if(!N||n===N)return;n&&n.classList.remove("__hf-pick-highlight"),n=N,N.classList.add("__hf-pick-highlight");let j=Y(N);c(j),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:j})}function D(_){if(!t)return;_.preventDefault(),_.stopPropagation(),_.stopImmediatePropagation();let N=Z(_.clientX,_.clientY,8);N.length!==0&&(c(N[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:N,selectedIndex:0,point:{x:_.clientX,y:_.clientY}}))}function V(_){_.key==="Escape"&&(k(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function R(){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(`\n`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",J,!0),document.addEventListener("click",D,!0),document.addEventListener("keydown",V,!0),s("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function k(){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",J,!0),document.removeEventListener("click",D,!0),document.removeEventListener("keydown",V,!0),s("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function F(){window.__HF_PICKER_API={enable:R,disable:k,isActive:()=>t,getHovered:()=>o,getSelected:()=>i,getCandidatesAtPoint:(_,N,j)=>Number.isFinite(_)&&Number.isFinite(N)?Z(_,N,j):[],pickAtPoint:(_,N,j)=>{if(!Number.isFinite(_)||!Number.isFinite(N))return null;let ae=Z(_,N,8);if(!ae.length)return null;let de=Math.max(0,Math.min(ae.length-1,Number(j??0))),ve=ae[de]??null;return ve?(d(ve),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:ve}),k(),ve):null},describe:_=>Ge(_)?Y(_):null,pickManyAtPoint:(_,N,j)=>{if(!Number.isFinite(_)||!Number.isFinite(N))return[];let ae=Z(_,N,8);if(!ae.length)return[];let de=[],ve=Array.isArray(j)?j:[0];for(let z of ve){let ee=Math.max(0,Math.min(ae.length-1,Math.floor(Number(z)))),Q=ae[ee];if(!Q)continue;de.some(ce=>ce.selector===Q.selector&&ce.tagName===Q.tagName)||de.push(Q)}return de.length?(d(de[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:de}),k(),de):[]}},s("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:R,disablePickMode:k,installPickerApi:F}}function Xi(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&&$("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Ht(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&$("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function Ji(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(o){$("runtime.player.site1",o)}}}function Fl(e,t,n){return n?.exact===!0?Number.isFinite(e)&&e>0?e:0:Q0(e,t,n?.subFrameDivisions)}function hS(e,t,n,r){let o=Fl(t,n,r),i=r?.suppressEvents===!0;return Ht(e,"pause"),typeof e.totalTime=="function"?e.totalTime(o,i):typeof e.seek=="function"&&e.seek(o,i),o}function jL(e,t,n,r,o){let i=[];Ji(e,t,a=>{Ht(a,"play"),i.push(a)});try{return hS(t,n,r,o)}finally{for(let a of i)try{Ht(a,"pause")}catch(l){$("runtime.player.site2",l)}}}function KL(e,t){Ji(e,t,n=>{Ht(n,"play")})}function gS(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?.()??Xi(n,"duration",0))||0);r>0&&Math.max(0,Xi(n,"time",0))>=r&&(Ht(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()),Ht(n,"play"),Ji(e.getTimelineRegistry?.(),n,o=>{typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Ht(o,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Ht(n,"pause"),Ji(e.getTimelineRegistry?.(),n,o=>{Ht(o,"pause")});let r=Math.max(0,Xi(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 o=e.getTimeline();if(!o)return;let i=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=jL(e.getTimelineRegistry?.(),o,i,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof o.timeScale=="function"&&o.timeScale(e.getPlaybackRate()),Ht(o,"play"),Ji(e.getTimelineRegistry?.(),o,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Ht(s,"play")}),e.onDeterministicPlay(),e.onShowNativeVideos(),e.onSyncMedia(l,!0)):(e.setIsPlaying(!1),e.onSyncMedia(l,!1)),e.onRenderFrameSeek(l),e.onStatePost(!0)},renderSeek:(n,r)=>{let o=e.getTimeline(),i=e.getCanonicalFps(),a=o?(KL(e.getTimelineRegistry?.(),o),hS(o,n,i,r)):Fl(Math.max(0,Number(n)||0),i,r);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>Xi(e.getTimeline(),"time",0),getDuration:()=>Xi(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}var If="data-composition-id",YL="data-composition-src",XL=`[${If}]`,g$=`[${YL}]`,Df="style",bS="script",Of=\'link[rel="stylesheet"], link[rel="preconnect"]\',JL=new Set(["","application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"]),QL=e=>(e.getAttribute("type")||"").trim().toLowerCase();function yS(e){let t=QL(e);return t==="module"||t==="importmap"?!0:JL.has(t)&&e.getAttribute("nomodule")===null}function Pf(e){return Jn(e?.querySelectorAll(bS)).filter(t=>!yS(t))}function Hf(e){return Jn(e?.querySelectorAll(bS)).filter(yS)}function xS(e){return[...Jn(e.querySelectorAll(`${Df}, ${Of}`)),...Hf(e)]}function Jn(e){return e?Array.from(e):[]}function SS(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:o,compositionId:i}=e,a=Jn(t.querySelectorAll(XL)),l=i?a.find(f=>f.getAttribute(If)===i)??null:a[0]??null,s=(l??a[0])?.getAttribute(If)?.trim()||"",c=o?null:n??null,d=l?Pf(l):[];return{innerRoot:l,authoredCompositionId:i||s||null,scriptCompositionId:s||i||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Jn(c?.querySelectorAll(Df)),...Jn(t.querySelectorAll(Df))],scriptSources:[...Hf(c),...Hf(t)],linkSources:[...Jn(n?.querySelectorAll(Of)),...Jn(t.querySelectorAll(Of))],inertScriptsOutsideRoot:[...Pf(c),...l?Pf(t).filter(f=>!d.includes(f)):[]],variableDefaultCarriers:[r,l].filter(f=>f!=null)}}function ES(e,t){let n=t[0]?.ownerDocument.querySelector("[data-composition-id]"),r=n&&!t.includes(n)?n.getAttribute("data-composition-id"):null,o=r?e.get(r):void 0;r&&o&&e.set(r,o+1)}var ZL=\'"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 vS(){return ZL}var Oe=hR(JE(),1),Xl=Oe.default,a6=Oe.default.stringify,s6=Oe.default.fromJSON,l6=Oe.default.plugin,u6=Oe.default.parse,c6=Oe.default.list,d6=Oe.default.document,f6=Oe.default.comment,m6=Oe.default.atRule,p6=Oe.default.rule,h6=Oe.default.decl,g6=Oe.default.root,b6=Oe.default.CssSyntaxError,y6=Oe.default.Declaration,x6=Oe.default.Container,S6=Oe.default.Processor,E6=Oe.default.Document,v6=Oe.default.Comment,A6=Oe.default.Warning,w6=Oe.default.AtRule,_6=Oe.default.Result,T6=Oe.default.Input,C6=Oe.default.Rule,R6=Oe.default.Root,M6=Oe.default.Node;var Jl="data-hf-authored-id",QE="data-hf-inner-root";function Hr(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function Ql(e){return e.replace(/\\\\/g,"\\\\\\\\").replace(/"/g,\'\\\\"\')}function NF(e){let t=e.trim();return t?Array.from(new Set([t,an(t)])).filter(Boolean):[]}function FF(e,t,n){let r=NF(t);return bs(e,r,()=>n)}function ev(e,t){let n=t?.trim();return n?FF(e,n,`[${Jl}="${Ql(n)}"]`):e}function ZE(e){return`${e}:not(:has([${QE}])), ${e} > [${QE}]`}function PF(e,t,n){let r=t?.trim();if(!r)return e;let o=Hr(`[${Jl}="${Ql(r)}"]`),i=Hr(n),a=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${i}"|\'${i}\')\\s*\\]`;return e.replace(new RegExp(`(${o})${a}|${a}(${o})`,"g"),"$1$2")}function IF(e,t,n,r,o,i){let a=ev(e,r),l=PF(a,r,n),s=c=>DF(c,t,n,r,o,i);return l===a?s(e):`${s(a).trim()}, ${s(l).trim()}`}function DF(e,t,n,r,o,i){let a=ev(e,r),l=OF(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return i?ZE(t):e;let c=new RegExp(`\\\\[\\\\s*data-composition-id\\\\s*[\\\\^\\\\*\\\\$]?=\\\\s*(["\'])${Hr(n)}\\\\1\\\\s*\\\\]`,"g");if(c.test(s))return s.replace(c,"").trim()===""?ZE(t):l.replace(c,t);let d=l.match(/^\\s*/)?.[0]??"",f=l.match(/\\s*$/)?.[0]??"";if(o){let m=r?`[${Jl}="${Ql(r)}"]`:null;if(m&&s.startsWith(m)){let g=s.slice(m.length);return`${d}${t}${m}${g}${f}`}}return`${d}${t} ${s}${f}`}function OF(e,t,n){let r=Hr(n),o=String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${r}"|\'${r}\')\\s*\\]`,i=String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`;return e.replace(new RegExp(`${o}(?:${i})+`,"g"),t).replace(new RegExp(`(?:${i})+${o}`,"g"),t)}var HF=new Set(["keyframes","-webkit-keyframes","font-face"]);function GF(e){return e?.type==="atrule"}function BF(e){let t=e.parent;for(;t;){if(GF(t)&&HF.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function UF(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function tv(e,t,n,r,o){let i=t.trim();if(!e||!i)return e;let a=n||`[data-composition-id="${Ql(i)}"]`,l=WF(e);return l?$F(l,a,i,r,o):""}function WF(e){try{return Xl.parse(e)}catch{return null}}function VF(e,t){e.walkRules(n=>{BF(n)||UF(n)||t(n)})}function $F(e,t,n,r,o){return VF(e,i=>{i.selectors=i.selectors.map(a=>IF(a,t,n,r,o?.compoundAuthoredRoot,o?.scopeRootSelectors))}),e.toResult({map:!1}).css}var qF="hf-scope-placeholder",I6=`[data-composition-id="${qF}"]`;function At(e){return JSON.stringify(e).replace(/</g,"\\\\u003c")}var nv=`!__hfBaseHyperframes\n ? __hfBaseHyperframes\n : Object.assign({}, __hfBaseHyperframes, {\n assetUrl: function(path) {\n var page = window.document.baseURI;\n return new URL(path, __hfCompositionSrc ? new URL(__hfCompositionSrc, page) : page).href;\n },\n getVariables: function() {\n var byComp = window.__hfVariablesByComp;\n var scoped = byComp && __hfTimelineCompId ? byComp[__hfTimelineCompId] : null;\n return scoped ? Object.assign({}, scoped) : {};\n },\n })`,zF="/*hf-authored-begin*/",jF="/*hf-authored-end*/";function rv(e,t){return`const __hyperframes = (function(__hfBaseHyperframes, __hfTimelineCompId, __hfCompositionSrc) {\n return ${nv};\n})(window.__hyperframes, ${At(e)}, ${At(t?.trim()||null)});\n${um("",e)}\n`}function um(e,t,n="[HyperFrames] composition script error:",r,o=t,i,a){let l=At(t),s=At(o),c=At(n),d=Hr(t),f=At(i?.trim()||null),m=At(r??null),g=At(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${d}"|\'${d}\')\\s*\\]`),h=At(String.raw`\\[\\s*data-composition-id\\s*=\\s*(?:"${Hr(o)}"|\'${Hr(o)}\')\\s*\\]`),y=At(String.raw`\\s*\\[\\s*data-(?:start|duration)\\s*=\\s*(?:"[^"]*"|\'[^\']*\')\\s*\\]`);return`(function(){\n ${`(function(){ ${vS()} })();`}\n var __hfCompId = ${l};\n var __hfTimelineCompId = ${s};\n var __hfErrorLabel = ${c};\n var __hfAuthoredRootId = ${f};\n var __hfCompositionSrc = ${At(a?.trim()||null)};\n var __hfAuthoredRootAttr = ${At(Jl)};\n var __hfEscapeAttr = function(value) {\n return (value + "").replace(/\\\\\\\\/g, "\\\\\\\\\\\\\\\\").replace(/"/g, "\\\\\\\\\\\\"");\n };\n var __hfRootSelector = ${m} || (__hfCompId\n ? \'[data-composition-id="\' + __hfEscapeAttr(__hfCompId) + \'"]\'\n : "");\n var __hfRoot = null;\n var __hfRootSelectorPattern = ${g};\n var __hfTimelineRootSelectorPattern = ${h};\n var __hfTimingSelectorPattern = ${y};\n var __hfAuthoredRootSelector = __hfAuthoredRootId\n ? "[" + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(__hfAuthoredRootId) + \'"]\'\n : "";\n var __hfAuthoredRootEntries = __hfAuthoredRootSelector\n ? [{ id: __hfAuthoredRootId, replacement: __hfAuthoredRootSelector }]\n : [];\n var __hfNormalizeSelector = function(selector) {\n if (!__hfCompId || typeof selector !== "string") return selector;\n var normalized = selector\n .replace(new RegExp(__hfRootSelectorPattern + \'(?:\' + __hfTimingSelectorPattern + \')+\', \'g\'), __hfRootSelector)\n .replace(new RegExp(\'(?:\' + __hfTimingSelectorPattern + \')+\' + __hfRootSelectorPattern, \'g\'), __hfRootSelector)\n .replace(new RegExp(__hfRootSelectorPattern, \'g\'), __hfRootSelector);\n if (__hfTimelineCompId !== __hfCompId) {\n normalized = normalized.replace(new RegExp(__hfTimelineRootSelectorPattern, \'g\'), __hfRootSelector);\n }\n return window.__hfSvgSelectorAliases.rewrite(normalized, __hfAuthoredRootEntries);\n };\n var __hfFindRoot = function() {\n if (!__hfRoot && __hfRootSelector) {\n __hfRoot = window.document.querySelector(__hfRootSelector);\n }\n return __hfRoot;\n };\n var __hfContains = function(node) {\n var root = __hfFindRoot();\n return !root || node === root || root.contains(node);\n };\n var __hfQueryAll = function(selector) {\n var root = __hfFindRoot();\n if (!root || typeof selector !== "string") {\n return window.document.querySelectorAll(selector);\n }\n return Array.prototype.filter.call(window.document.querySelectorAll(__hfNormalizeSelector(selector)), function(node) {\n return __hfContains(node);\n });\n };\n var __hfQueryOne = function(selector) {\n var matches = __hfQueryAll(selector);\n return matches[0] || null;\n };\n var __hfGetElementById = function(id) {\n var found = window.document.getElementById(id);\n if (found && __hfContains(found)) return found;\n var root = __hfFindRoot();\n if (!root) return found || null;\n var idValue = id + "";\n if (__hfAuthoredRootId && __hfAuthoredRootId === idValue && root.getAttribute && root.getAttribute(__hfAuthoredRootAttr) === idValue) {\n return root;\n }\n if (root.id === idValue) return root;\n if (typeof root.querySelector !== "function") return null;\n try {\n var authoredRootMatch = root.querySelector(\'[\' + __hfAuthoredRootAttr + \'="\' + __hfEscapeAttr(idValue) + \'"]\');\n if (authoredRootMatch) return authoredRootMatch;\n } catch {}\n if (typeof CSS !== "undefined" && CSS && typeof CSS.escape === "function") {\n try {\n return root.querySelector("#" + CSS.escape(idValue)) || null;\n } catch {}\n }\n try {\n return root.querySelector(\'[id="\' + __hfEscapeAttr(idValue) + \'"]\') || null;\n } catch {}\n return null;\n };\n var __hfScopedDocument = typeof Proxy === "function"\n ? new Proxy(window.document, {\n get: function(target, prop, receiver) {\n if (prop === "querySelector") return __hfQueryOne;\n if (prop === "querySelectorAll") return __hfQueryAll;\n if (prop === "getElementById") return __hfGetElementById;\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n })\n : window.document;\n var __hfTimelineRegistryProxy = null;\n var __hfGetTimelineRegistry = function() {\n window.__timelines = window.__timelines || {};\n if (!__hfCompId || __hfCompId === __hfTimelineCompId || typeof Proxy !== "function") {\n return window.__timelines;\n }\n if (!__hfTimelineRegistryProxy) {\n __hfTimelineRegistryProxy = new Proxy(window.__timelines, {\n get: function(target, prop, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.get(target, prop, target);\n }\n var runtimeValue = Reflect.get(target, __hfTimelineCompId, target);\n return runtimeValue === undefined ? Reflect.get(target, prop, target) : runtimeValue;\n },\n set: function(target, prop, value, receiver) {\n if (prop !== __hfCompId) {\n return Reflect.set(target, prop, value, target);\n }\n // The authored node remains in the compiled DOM when its local id\n // differs from the runtime mount id, so readiness legitimately sees\n // both compositions. Publish the same timeline under both identities,\n // unless another mount of the same file already owns the authored one.\n var authoredValue = Reflect.get(target, __hfCompId, target);\n var ownsAuthored =\n authoredValue === undefined ||\n authoredValue === Reflect.get(target, __hfTimelineCompId, target);\n var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);\n if (!ownsAuthored) return runtimeSet;\n return Reflect.set(target, __hfCompId, value, target) && runtimeSet;\n },\n });\n }\n return __hfTimelineRegistryProxy;\n };\n var __hfScopedWindow = typeof Proxy === "function"\n ? new Proxy(window, {\n get: function(target, prop, receiver) {\n if (prop === "__timelines") return __hfGetTimelineRegistry();\n // Inside a sub-composition, __hyperframes is passed as a bare script\n // param bound to the SCOPED variant (per-comp getVariables). But\n // authors routinely write the documented window.__hyperframes.\n // getVariables() form, which would otherwise fall through to the host\n // page\'s base __hyperframes and return the WRONG (or empty) variables\n // for this instance. Route it to the scoped variant too so both\n // spellings resolve to this composition\'s own variables.\n // (__hfScopedHyperframes is a hoisted var assigned below, before any\n // sub-comp script -- the only code that reads this -- runs.)\n if (prop === "__hyperframes") return __hfScopedHyperframes;\n // Native window methods must stay bound to the real window. Handed\n // back unbound, "this" at call time is this Proxy and Chrome rejects\n // it with "Illegal invocation", which broke window.addEventListener,\n // setTimeout, matchMedia and getComputedStyle inside every\n // sub-composition -- including the window.addEventListener("hf-seek",\n // ...) form the Three.js and TypeGPU adapters document. The sibling\n // document and gsap proxies here already bind.\n //\n // Only bind non-constructors. Function.prototype.bind drops static\n // members, so binding a class exposed on window (window.Texts and\n // friends) would silently strip its statics. Built-in methods have\n // no .prototype; classes and constructor functions do.\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" && value.prototype === undefined\n ? value.bind(target)\n : value;\n },\n set: function(target, prop, value, receiver) {\n if (prop === "__timelines") {\n // Common authoring boilerplate assigns the registry back to\n // itself (window.__timelines = window.__timelines || {}). The\n // getter above returns our proxy; do not replace the canonical\n // registry with that proxy or later wrappers will stack proxies.\n if (value === __hfTimelineRegistryProxy) return true;\n target.__timelines = value || {};\n __hfTimelineRegistryProxy = null;\n return true;\n }\n return Reflect.set(target, prop, value, target);\n },\n })\n : window;\n var __hfResolveGsapTarget = function(target) {\n if (typeof target !== "string" && !Array.isArray(target)) return target;\n var resolved = typeof target === "string" ? __hfQueryAll(target) : target.reduce(function(resolved, item) {\n if (typeof item === "string") {\n return resolved.concat(Array.prototype.slice.call(__hfQueryAll(item)));\n }\n resolved.push(item);\n return resolved;\n }, []);\n if (!resolved.length) {\n // GSAP warns "GSAP target " + targets + " not found"; a bare empty match list prints an\n // empty name. Keep the authored selector as the text while still targeting nothing here.\n var originalTarget = String(target);\n resolved = [];\n resolved.toString = function() { return originalTarget; };\n }\n return resolved;\n };\n var __hfScopeTimeline = function(timeline) {\n if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;\n ["to", "from", "fromTo", "set"].forEach(function(method) {\n var original = timeline[method];\n if (typeof original !== "function") return;\n timeline[method] = function(target) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(target);\n return original.apply(timeline, args);\n };\n });\n try {\n Object.defineProperty(timeline, "__hfScopedCompositionRoot", {\n value: __hfFindRoot(),\n configurable: true,\n });\n } catch {\n // Best-effort: timelines coming from user code may have a frozen target\n // or a non-extensible defineProperty path. Swallow \\u2014 the scoped root\n // is an enrichment, not a correctness invariant for playback.\n }\n return timeline;\n };\n var __hfBaseGsap = typeof gsap === "undefined" ? window.gsap : gsap;\n var __hfScopedGsap = !__hfBaseGsap || typeof Proxy !== "function"\n ? __hfBaseGsap\n : new Proxy(__hfBaseGsap, {\n get: function(target, prop, receiver) {\n if (prop === "timeline") {\n return function() {\n return __hfScopeTimeline(target.timeline.apply(target, arguments));\n };\n }\n if (prop === "to" || prop === "from" || prop === "fromTo" || prop === "set") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return target[prop].apply(target, args);\n };\n }\n if (prop === "utils" && target.utils && typeof Proxy === "function") {\n return new Proxy(target.utils, {\n get: function(utilsTarget, utilsProp, utilsReceiver) {\n if (utilsProp === "toArray") {\n return function(firstArg) {\n var args = Array.prototype.slice.call(arguments);\n args[0] = __hfResolveGsapTarget(firstArg);\n return utilsTarget.toArray.apply(utilsTarget, args);\n };\n }\n if (utilsProp === "selector") {\n return function(base) {\n var baseEl = typeof base === "string" ? __hfQueryOne(base) : base;\n var root = baseEl || __hfFindRoot();\n return function(selector) {\n if (!root || typeof selector !== "string") return [];\n return Array.prototype.filter.call(\n window.document.querySelectorAll(__hfNormalizeSelector(selector)),\n function(node) {\n return node === root || (typeof root.contains === "function" && root.contains(node));\n },\n );\n };\n };\n }\n var value = Reflect.get(utilsTarget, utilsProp, utilsTarget);\n return typeof value === "function" ? value.bind(utilsTarget) : value;\n },\n });\n }\n var value = Reflect.get(target, prop, target);\n return typeof value === "function" ? value.bind(target) : value;\n },\n });\n var __hfBaseHyperframes = window.__hyperframes;\n var __hfScopedHyperframes = ${nv};\n var __hfRun = function() {\n var report = window.__hfScriptState;\n if (typeof report === "function") report("start", __hfCompositionSrc || "index.html");\n try {\n (function(document, gsap, window, __hyperframes) {\n${zF}\n${e.replace(/<\\/(script)/gi,"<\\\\/$1")}\n${jF}\n }).call(window, __hfScopedDocument, __hfScopedGsap, __hfScopedWindow, __hfScopedHyperframes);\n } catch (_err) {\n console.error(__hfErrorLabel, __hfCompId, _err);\n } finally {\n if (typeof report === "function") report("finish", __hfCompositionSrc || "index.html");\n }\n };\n // What the script started on the global gsap timeline, by any route, for a scene swap to revert.\n // Only a page with a scene manifest can swap; elsewhere the first script stores null and none records.\n var __hfRecordAnimations = function(run) {\n if (window.__hfSceneAnimations === undefined) {\n window.__hfSceneAnimations = window.document.querySelector(${At(`meta[name="${Fn}"]`)})\n ? {}\n : null;\n }\n var byComp = window.__hfSceneAnimations;\n var globalTimeline = __hfBaseGsap && __hfBaseGsap.globalTimeline;\n if (!byComp || !globalTimeline || !__hfTimelineCompId) return run();\n var before = globalTimeline.getChildren(false);\n // A set completes as it is made and would leave the timeline before the diff below.\n var autoRemove = globalTimeline.autoRemoveChildren;\n globalTimeline.autoRemoveChildren = false;\n run();\n globalTimeline.autoRemoveChildren = autoRemove;\n var recorded = (byComp[__hfTimelineCompId] = byComp[__hfTimelineCompId] || []);\n globalTimeline.getChildren(false).forEach(function(animation) {\n if (before.indexOf(animation) >= 0) return;\n recorded.push(animation);\n // Dropped as the timeline drops a finished tween (it keeps a paused one); moved back, a tween re-adds itself.\n if (autoRemove && !animation.getChildren && animation.totalProgress() === 1) globalTimeline.remove(animation);\n });\n };\n __hfFindRoot();\n __hfRecordAnimations(__hfRun);\n})();`}function Zl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function KF(e){return Zl(e)&&Object.values(e).every(Zl)}var ov=(e,t)=>e&&Object.fromEntries(Object.entries(e).map(([n,r])=>[n,typeof r=="string"?t(r):null]));function iv(e,t){let n;try{n=JSON.parse(e)}catch{return null}if(!Zl(n))return null;let{imports:r,scopes:o}=n;return r!==void 0&&!Zl(r)||o!==void 0&&!KF(o)?null:{imports:ov(r,t),scopes:o&&Object.fromEntries(Object.entries(o).map(([i,a])=>[t(i),ov(a,t)??{}]))}}var cm="text/hf-after-fonts",sv=`${cm}+module`,lv=`script[type="${cm}"], script[type="${sv}"]`,uv="__hfAfterFontsClaimed",YF="data-hf-inlined-src";var cv=`[defer][src], [defer][${YF}]`;function eu(e){let t=e.getAttribute("type");return t===cm?null:t===sv?"module":t}function XF(e){let t=e.getAttribute("type")??"",n=e.tagName.toLowerCase()==="link"?t.split(";")[0].trim():t;if(n!==""&&n.toLowerCase()!=="text/css")return;let r=(e.getAttribute("media")??"").trim().toLowerCase();return JSON.stringify([r==="all"?"":r,e.getAttribute("title")??""])}var B6=JSON.stringify(["",""]);function av(e){return JSON.stringify([e.getAttribute("href"),(e.getAttribute("rel")??"").trim().toLowerCase(),XF(e)??e.getAttribute("type"),e.hasAttribute("disabled")])}function dv(e,t){let n=av(t);return[...e.querySelectorAll("link[href]")].some(r=>!r.closest("noscript")&&av(r)===n)}var rt="id",dm="data-hf-authored-id",No=/(url\\(\\s*)(["\']?)#([^"\')\\s]+)\\2(\\s*\\))/gi;function mv(e){return e==="href"||e.endsWith(":href")}function JF(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function fm(e,t){return!e||!e.toLowerCase().includes("url(")?e:e.replace(No,(n,r,o,i,a)=>{let l=t.get(i);return l?`${r}${o}#${l}${o}${a}`:n})}function QF(e,t,n){if(mv(e)&&t.startsWith("#")){let o=n.get(t.slice(1));return o?`#${o}`:t}No.lastIndex=0;let r=No.test(t);return No.lastIndex=0,r?fm(t,n):null}function ZF(e,t,n){if(e.name===Ft||e.name===rt)return{kind:"skip"};let r=t&&e.value===t.after?t.before:e.value,o=QF(e.name,r,n);return o!==null?{kind:"managed",before:r,after:o}:t?{kind:"retain",alias:t}:{kind:"skip"}}function eP(e,t,n,r){let o=e.namespaceURI===void 0&&e.name==="xlink:href"&&r;return{name:e.name,localName:o?"href":e.localName,namespaceURI:o?"http://www.w3.org/1999/xlink":e.namespaceURI??null,before:t,after:n}}function tP(e,t){let n=new Map(yr(e,Ft,!1).map(i=>[i.name,i])),r=[...n.values()].filter(i=>i.name===rt),o=!!e.closest("svg");for(let i of e.attributes?Array.from(e.attributes):[]){let a=ZF(i,n.get(i.name),t);if(a.kind!=="skip"){if(a.kind==="retain"){r.push(a.alias);continue}a.after!==i.value&&(i.namespaceURI?e.setAttributeNS(i.namespaceURI,i.name,a.after):e.setAttribute(i.name,a.after)),r.push(eP(i,a.before,a.after,o))}}r.length&&e.setAttribute(Ft,JSON.stringify(r))}function fv(e,t,n){let r;for(No.lastIndex=0;r=No.exec(e);){let o=r[3];t.has(o)&&n.add(o)}}function nP(e,t,n){if(mv(e.name)&&e.value.startsWith("#")){let r=e.value.slice(1);t.has(r)&&n.add(r)}}function rP(e,t,n){let r=new Set;for(let o of e)for(let i of o.attributes?Array.from(o.attributes):[])!i.value||i.name===Ft||(nP(i,n,r),i.value.toLowerCase().includes("url(")&&fv(i.value,n,r));for(let o of t)o.toLowerCase().includes("url(")&&fv(o,n,r);return r}function pv(e,t){return t.some(n=>n===e||n.contains(e))}function oP(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("*")],r=t.length?n.filter(o=>!pv(o,t)):n;return[e.root,...r]}function iP(e){let t=e.exclude??[],n=[...e.root.querySelectorAll("svg [id], svg[id]")];return t.length?n.filter(r=>!pv(r,t)):n}function aP(e){let t=oP(e),n=new Set;if(!e.namespace)return{elements:t,renamable:n};let r=iP(e),o=new Set;for(let a of r){let l=a.getAttribute(rt);l&&o.add(l)}if(o.size===0)return{elements:t,renamable:n};let i=rP(t,e.cssTexts??[],o);for(let a of r){let l=a.getAttribute(rt);l&&i.has(l)&&n.add(a)}return{elements:t,renamable:n}}function hv(e){if(!e.closest("svg"))return null;let t=yr(e,Ft,!1).find(n=>n.name===rt);return t?e.getAttribute(rt)===t.after?t.before:null:e.getAttribute(dm)}function sP(e){let t=new Map,n=new Set;for(let r of e.querySelectorAll("[id]")){let o=r.getAttribute(rt);if(!o)continue;n.add(o);let i=t.get(o);i?i.push(r):t.set(o,[r]);let a=hv(r);if(a&&a!==o){let l=t.get(a);l?l.push(r):t.set(a,[r])}}return{elementsById:t,usedIds:n}}function lP(e,t,n){let r=`${JF(e)}--${t}`,o=r;for(let i=2;n.has(o);i+=1)o=`${r}-${i}`;return n.add(o),o}function uP(e,t,n){let r=t.find(a=>!n.has(a))??t[0],i=t.filter(a=>a!==r&&a.getAttribute(rt)===e).map(a=>n.get(a));return new Set(i.filter(a=>a!==void 0))}function cP(e,t,n){let r=t.map(()=>new Map);for(let[o,i]of e.elementsById)if(!(i.length<2))for(let a of uP(o,i,n))r[a].set(o,lP(t[a].namespace,o,e.usedIds));return r}function dP(e,t,n){let r=new Map;for(let[o,i]of e.elementsById){let a=i[0],l=a.getAttribute(rt);if(l!==o){r.set(o,l);continue}let s=n.get(a),c=s===void 0?void 0:t[s].get(o);c&&r.set(o,c)}return r}function fP(e){let t=new Set(e.map(r=>r.getAttribute(rt))),n=new Map;for(let r of e){let o=hv(r),i=r.getAttribute(rt);!o||!i||(t.add(o),n.set(o,i))}return{ids:t,renamed:n}}function mP(e,t){for(let n of e.elements){let r=n.getAttribute(rt);if(r&&e.renamable.has(n)&&t.has(r)){n.hasAttribute(dm)||n.setAttribute(dm,r);let o=t.get(r),i=yr(n,Ft,!1);i.push({name:rt,localName:rt,namespaceURI:null,before:r,after:o}),n.setAttribute(Ft,JSON.stringify(i)),n.setAttribute(rt,o)}tP(n,t)}}function gv(e,t,n){if(t.length===0)return[];let r=sP(e),o=t.map(aP),i=o.flatMap(({renamable:d})=>[...d]);if(n)for(let d of o)for(let f of d.renamable)n.has(f)&&d.renamable.delete(f);let a=new Map;o.forEach(({renamable:d},f)=>{for(let m of d)a.set(m,f)});let l=cP(r,t,a),s=dP(r,l,a),c=o.map((d,f)=>{let m=fP(t[f].referenceTarget==="document"?[]:d.elements),g=[...s].filter(([h])=>!m.ids.has(h));return new Map([...g,...m.renamed,...l[f]])});c.forEach((d,f)=>{mP(o[f],d)});for(let d of i)n?.add(d);return c}function bv(e,t,n=[]){if(!e||t.size===0&&n.length===0||!e.includes("#")&&!e.includes("[")&&!e.toLowerCase().includes("url("))return e;let r;try{r=Xl.parse(e)}catch{return e}let o=!1,i=new Set(n.filter(l=>l.name===rt).map(l=>l.before)),a=[...t].filter(([l])=>!i.has(l)).map(([l,s])=>({id:l,replacement:`:is(#${an(l)}, #${an(s)})`}));return r.walkRules(l=>{let s=l.selectors.map(c=>ys(c,a,n));s.some((c,d)=>c!==l.selectors[d])&&(l.selectors=s,o=!0)}),r.walkDecls(l=>{let s=fm(l.value,t);s!==l.value&&(l.value=s,o=!0)}),r.walkAtRules(l=>{if(!l.params)return;let s=fm(l.params,t);s!==l.params&&(l.params=s,o=!0)}),o?r.toResult({map:!1}).css:e}function tu(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function mm(e){let t=e.replace(/[\\u0000-\\u0020]/g,""),n=/^([a-z][a-z0-9+.-]*):/i.exec(t);if(!n)return!0;let r=n[1]?.toLowerCase();return r?r==="https"||r==="http"||r==="blob"?!0:r==="data"?/^data:image\\//i.test(t):!1:!1}var yv=new Set(["img","video","audio","source"]);function pP(e){if(typeof e=="string"&&e.length>0)return e;if(e!==null&&typeof e=="object"){let t=e.url;if(typeof t=="string"&&t.length>0)return t}return null}function hP(e){return e.replace(/[;{}<>\\r\\n]/g,"")}function gP(e){if(tu(e))return String(e);if(e!==null&&typeof e=="object"){let t=e.name;if(typeof t=="string"&&t.length>0)return t}return null}function pm(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let o=ml(e);return t.set(n,o),o}function bP(e,t){if(e.childElementCount===0){e.textContent=t;return}let n=!1;for(let r of Array.from(e.childNodes))r.nodeType===Node.TEXT_NODE&&(r.nodeValue=n?"":t,n=!0);n||e.insertBefore(e.ownerDocument.createTextNode(t),e.firstChild)}function yP(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function xP(e,t){for(let n of new Set(e)){let r=pm(n,t);for(let[o,i]of Object.entries(r)){let a=gP(i);a!==null&&Te(n)&&n.style.setProperty(`--${o}`,hP(a))}}}function Sv(e,t,n=!0){let r=e.getAttribute("data-var-src")?.trim();if(!r)return null;if(!yv.has(e.tagName.toLowerCase()))return n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src on <${e.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(yv).join("/")}.`),null;let o=pP(pm(e,t)[r]);return o===null?null:mm(o)?o:(n&&globalThis.console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`),null)}function Ev(e){return Sv(e,new Map,!1)??qi(e)}var vv=(e,t,n)=>t?[...t.matches(n)?[t]:[],...t.querySelectorAll(n)]:Array.from(e.querySelectorAll(n));function nu(e,t){let n=new Map,r=i=>vv(e,t,i),o=t?null:yP(e);xP([...o?[o]:[],...r("[data-composition-id]")],n);for(let i of r("[data-var-src]")){let a=Sv(i,n);a!==null&&qi(i)!==a&&i.setAttribute("src",a)}Av(r("[data-var-text]"),n)}function ru(e,t){Av(vv(e,t,"[data-var-text]"),new Map)}var xv=new WeakSet;function Av(e,t){for(let n of e){let r=n.getAttribute("data-var-text")?.trim();if(!r||xv.has(n))continue;let o=pm(n,t)[r];tu(o)&&(bP(n,String(o)),xv.add(n))}}var hm=5e3;window[uv]=!0;async function ga(){let e=document.fonts;if(!e)return;document.body?.offsetHeight;for(let o of Array.from(e))o.status==="unloaded"&&o.load().catch(()=>{});let t,n=await Promise.race([e.ready.then(()=>!1),new Promise(o=>t=setTimeout(o,hm,!0))]);if(clearTimeout(t),!n)return;let r=[...new Set(Array.from(e).filter(o=>o.status==="loading").map(o=>o.family))];globalThis.console.warn(`[hyperframes] fonts still loading after ${hm} ms, composition scripts run without them: ${r.join(", ")}`),we({source:"hf-preview",type:"diagnostic",code:"runtime_font_wait_timeout",details:{loadingFamilies:r,timeoutMs:hm}})}function SP(e,t){let n=Object.getOwnPropertyDescriptor(e,"addEventListener"),r=e.addEventListener,o=(i,a,l)=>{if(!a)return;i==="DOMContentLoaded"||i==="load"&&e===window&&document.readyState==="complete"?t.push({target:e,type:i,listener:a}):r.call(e,i,a,l)};return e.addEventListener=o,()=>{e.addEventListener===o&&(n?Object.defineProperty(e,"addEventListener",n):delete e.addEventListener)}}function EP(e){if(!e.isConnected)return;let t=document.createElement("script");for(let{name:r,value:o}of Array.from(e.attributes))t.setAttribute(r,o);let n=eu(e);return n===null?t.removeAttribute("type"):t.setAttribute("type",n),t.async=e.hasAttribute("async"),t.text=e.textContent??"",e.replaceWith(t),t}var vP=50,AP=()=>!window.__HF_VIRTUAL_TIME__;function wP(){let e=globalThis.scheduler;return typeof e?.yield=="function"?e.yield():new Promise(t=>{let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),t()},n.port2.postMessage(null)})}var _P=e=>new Promise(t=>{e.addEventListener("load",t),e.addEventListener("error",t)});function TP(){let e=document.createElement("script");e.type="module",e.async=!1,e.text=\'document.dispatchEvent(new Event("hf-after-fonts-modules"))\';let t=new Promise(n=>document.addEventListener("hf-after-fonts-modules",n,{once:!0}));return document.body.appendChild(e),t.then(()=>e.remove())}async function ou(e,t){await ga(),ru(document);let n=l=>eu(l)==="module"||l.matches(cv),r=[],o=[document,window].map(l=>SP(l,r)),i=AP(),a=performance.now();for(let l of[...e.filter(s=>!n(s)),...e.filter(n)]){i&&performance.now()-a>vP&&(await wP(),a=performance.now());let s=EP(l);s?.hasAttribute("src")&&!s.async&&!s.noModule?await _P(s):eu(l)==="module"&&await TP()}for(let l of o)l();t?.();for(let{target:l,type:s,listener:c}of r){let d=new Event(s);try{typeof c=="function"?c.call(l,d):c.handleEvent(d)}catch(f){reportError(f)}}}var CP=["data-composition-id","data-composition-file","data-start","data-duration","data-end","data-track-index","data-track","data-composition-src","data-hf-authored-duration","data-hf-authored-end"];function wv(e){let t=e.getAttribute("id")?.trim();for(let n of CP)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var RP=8e3,MP=/^(?![a-zA-Z][a-zA-Z\\d+\\-.]*:)(?!\\/\\/)(?!\\/)(?!\\.\\.?\\/).+/,kP=/\\burl\\(\\s*(["\']?)([^)"\']+)\\1\\s*\\)/g,LP=["src","href"];function NP(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function kv(e,t){if(!t)return e;let n=e.trim();if(NP(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function Lv(e,t){return!t||!e?e:e.replace(kP,(n,r,o)=>{let i=kv(o||"",t);return i===o?n:`url(${r||""}${i}${r||""})`})}function FP(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of LP){let o=n.getAttribute(r);if(o==null)continue;let i=kv(o,t);i!==o&&n.setAttribute(r,i)}}function PP(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let o=Lv(r,t);o!==r&&n.setAttribute("style",o)}}function IP(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",o=Lv(r,t);o!==r&&(n.textContent=o)}}function Nv(e,t){if(t){FP(e,t),PP(e,t),IP(e,t);for(let n of Array.from(e.querySelectorAll("template")))Nv(n.content,t)}}function _v(e,t){return`${e}__hf${t}`}var DP=e=>new Promise(t=>{let n=!1,r=Date.now(),o=null,i=a=>{n||(n=!0,o!=null&&window.clearTimeout(o),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>i("load"),{once:!0}),e.addEventListener("error",()=>i("error"),{once:!0}),o=window.setTimeout(()=>i("timeout"),RP)});function ym(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function gm(e){for(let t of xS(e))t.remove()}function OP(e){let t=document.importNode(e,!0);wv(t);let n=Rr(t.getAttribute("data-width")),r=Rr(t.getAttribute("data-height"));return t.style.width=n===null?"100%":`${n}px`,t.style.height=r===null?"100%":`${r}px`,t}function Tv(e,t){let n=e.trim();if(!n)return e;try{return MP.test(n)&&!n.startsWith("#")&&!n.startsWith("?")?new URL(n,document.baseURI).toString():t?new URL(n,t).toString():new URL(n,document.baseURI).toString()}catch{return e}}function Cv(e,t){try{let n=new URL(e),r=new URL(t);return n.search="",n.hash="",r.search="",r.hash="",n.href===r.href}catch{return!1}}function ba(e){let t=(e.getAttribute("data-composition-id")||"").trim()||null;return{authoredCompositionId:(e.getAttribute("data-hf-original-composition-id")||t||"").trim()||null,runtimeCompositionId:t}}function HP(e){let t=new Map;for(let n of e){let r=ba(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return ES(t,e),t}function Fv(e){let t=ba(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function GP(e){return!!e.querySelector(\'[data-hf-inner-root="true"]\')}function Rv(e){return e.hasAttribute("data-composition-src")?!0:Fv(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:GP(e):!1}function iu(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:Fv(t))}function xm(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(iu().map(n=>ba(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Pv(e,t){let n=HP(e),r=new Set(e.flatMap(a=>{let l=ba(a),s=l.authoredCompositionId?[l.authoredCompositionId]:[];return(t.has(a)||!Rv(a))&&l.runtimeCompositionId&&s.push(l.runtimeCompositionId),s})),o=new Map,i=new Map;for(let a of e){let{authoredCompositionId:l,runtimeCompositionId:s}=ba(a),c=!t.has(a)&&Rv(a);if(!l){i.set(a,{authoredCompositionId:null,runtimeCompositionId:s});continue}let d=(n.get(l)||0)>1,f=s||l;if(c){let m=d?(o.get(l)||0)+1:0;if(d){for(;r.has(_v(l,m));)m+=1;o.set(l,m)}f=d?_v(l,m):l,r.add(f),d?a.setAttribute("data-hf-original-composition-id",l):a.removeAttribute("data-hf-original-composition-id"),a.setAttribute("data-composition-id",f)}i.set(a,{authoredCompositionId:l,runtimeCompositionId:f})}return xm(),i}async function Iv(e){let t=SS({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=Te(t.innerRoot)?t.innerRoot:null,r=n??e.sourceNode,o=t.authoredCompositionId,i=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let y of t.linkSources){let S=(y.getAttribute("href")||"").trim();if(!S)continue;let E=e.compositionUrl?new URL(S,e.compositionUrl).href:S;if(e.compositionUrl&&Cv(E,e.compositionUrl))continue;let v=y.cloneNode(!0);$g(v)&&(v.href=E,!dv(document.head,v)&&(document.head.appendChild(v),e.injectedLinks.push(v)))}let c=[];(y=>{for(let S of y){let E=S.cloneNode(!0);if(!Vg(E))continue;o&&(E.textContent=tv(E.textContent||"",o,s,l,{scopeRootSelectors:!0})),document.head.appendChild(E),e.injectedStyles.push(E);let v=E.textContent||"";c.push({element:E,authored:v,applied:v})}})(t.styleSources);let f=y=>{let S=y.getAttribute("type")?.trim()??"",E=y.getAttribute("src")?.trim()??"";if(E){let T=Tv(E,e.compositionUrl);return e.compositionUrl&&Cv(T,e.compositionUrl)?null:{kind:"external",src:T,type:S}}let v=y.textContent?.trim()??"";return v?{kind:"inline",content:v,type:S,scopeCompositionId:i}:null},m=t.scriptSources.map(f).filter(y=>y!==null);if(n){let y=n.getAttribute("data-width"),S=n.getAttribute("data-height"),E=e.parseDimensionPx(y),v=e.parseDimensionPx(S);y&&e.host.setAttribute("data-width",y),S&&e.host.setAttribute("data-height",S),E&&Te(e.host)&&(e.host.style.width=E),v&&Te(e.host)&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let T=OP(n);!e.authoredCompositionId&&o&&T.setAttribute("data-composition-id",o),gm(T),e.host.appendChild(T)}else if(e.hasTemplate){let y=document.importNode(r,!0);gm(y),e.host.appendChild(y)}else e.host.innerHTML=e.fallbackBodyInnerHtml,gm(e.host);for(let y of t.inertScriptsOutsideRoot)e.host.appendChild(document.importNode(y,!0));a&&UP(e,r,a);let g=Array.from(e.host.childNodes),h=()=>e.host.isConnected&&(g.length>0||e.host.childNodes.length===0)&&g.every(y=>y.parentNode===e.host);return{host:e.host,namespace:a||o||"",styles:c,isCurrent:h,runScripts:async()=>{if(m.length>0&&await ga(),!!h()){ru(document,e.host);for(let y of m){let S=document.createElement("script");if(y.type&&(S.type=y.type),S.async=!1,y.kind==="external")S.src=y.src;else if(y.type.toLowerCase()==="importmap"){let E=iv(y.content,v=>Tv(v,e.compositionUrl));S.textContent=E?JSON.stringify(E):y.content}else if(y.type.toLowerCase()==="module"){let E=y.scopeCompositionId?rv(a||y.scopeCompositionId,e.compositionUrl?.href):"";S.textContent=E+y.content}else y.scopeCompositionId?S.textContent=um(y.content,y.scopeCompositionId,"[HyperFrames] composition script error:",s,a||y.scopeCompositionId,l,e.compositionUrl?.href):S.textContent=`(function(){${y.content}})();`;if(document.body.appendChild(S),e.injectedScripts.push(S),y.kind==="external"){let E=await DP(S);E.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:y.src,loadStatus:E.status,elapsedMs:E.elapsedMs}})}}}}}}async function Mv(e,t){let n=iu();if(xm(),n.length===0)return[];let r=Pv(n,t),o=n.filter(a=>{if(t.has(a)||a.hasAttribute("data-composition-src")||a.children.length>0)return!1;let l=r.get(a)?.authoredCompositionId;return l?!!document.querySelector(`template#${CSS.escape(l)}-template`):!1}),i=[];for(let a of o){let l=r.get(a),s=l?.authoredCompositionId;if(!s)continue;let c=document.querySelector(`template#${CSS.escape(s)}-template`);ym(a);let d=await Iv({host:a,authoredCompositionId:s,runtimeCompositionId:l?.runtimeCompositionId||s,hostCompositionSrc:`template#${s}-template`,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});i.push(d)}return i}async function BP(e){let t=iu();if(xm(),t.length===0)return[];let n=Pv(t,new Set),r=t.filter(i=>i.hasAttribute("data-composition-src"));return(await Promise.all(r.map(async i=>{let a=i.getAttribute("data-composition-src");if(!a)return null;let l=n.get(i),s=l?.authoredCompositionId||null,c=l?.runtimeCompositionId||s||null,d=null;try{d=new URL(a,document.baseURI)}catch{d=null}ym(i);let f=g=>{e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,errorMessage:g instanceof Error?g.message:"unknown_error"}}),ym(i)},m=async g=>{let h=await Iv(g),y=h.runScripts;return h.runScripts=async()=>{try{await y()}catch(S){f(S)}},h};try{let g=s!=null?document.querySelector(`template#${CSS.escape(s)}-template`):null;if(g)return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:g.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});let h=await fetch(a);if(!h.ok)throw new Error(`HTTP ${h.status}`);let y=await h.text(),E=new DOMParser().parseFromString(y,"text/html");Nv(E,d);let v=(s?E.querySelector(`template#${CSS.escape(s)}-template`):null)??E.querySelector("template"),T=v?v.content:E.body;return await m({host:i,authoredCompositionId:s,runtimeCompositionId:c,hostCompositionSrc:a,sourceNode:T,hasTemplate:!!v,fallbackBodyInnerHtml:E.body.innerHTML,compositionUrl:d,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:E.head,declaredVariableDefaults:Wi(E.documentElement),variableDeclarer:E.documentElement,onDiagnostic:e.onDiagnostic})}catch(g){return f(g),null}}))).filter(i=>i!==null)}async function Dv(e){let t=new Set,n={host:document.documentElement,namespace:"",referenceTarget:"document",styles:[...document.querySelectorAll("style")].map(f=>({element:f,authored:f.textContent??"",applied:f.textContent??""}))},r=await BP(e),o=await Mv(e,new Set(r.map(({host:f})=>f))),i=[...r,...o];bm([...i,n],t),await Promise.all(r.map(f=>f.runScripts()));let a=o.filter(f=>{if(f.isCurrent())return!0;for(let m of f.styles)m.element.remove();return window.__hfVariablesByComp&&delete window.__hfVariablesByComp[f.namespace],!1}),l=[...r.filter(f=>f.host.isConnected),...a],s=await Mv(e,new Set(l.map(({host:f})=>f)));s.length&&bm([...l,...s,n],t);let c=new Map([...a,...s].map(f=>[f.host,f]));for(let f of iu()){let m=c.get(f);m&&await m.runScripts()}let d=[...l,...s].filter(f=>f.host.isConnected);bm([...d,n],t)}function bm(e,t){for(let{styles:r}of e)for(let o of r){let i=o.element.textContent??"";i!==o.applied&&(o.authored=i,o.applied=i)}gv(document,e.map(({host:r,namespace:o,styles:i,referenceTarget:a})=>({root:r,namespace:o,referenceTarget:a,exclude:e.filter(l=>l.host!==r&&r.contains(l.host)).map(l=>l.host),cssTexts:i.map(l=>l.authored)})),t).forEach((r,o)=>{let i=yr(e[o].host,Ft);if(!(r.size===0&&i.length===0))for(let a of e[o].styles){let l=bv(a.authored,r,i);l!==a.applied&&(a.element.textContent=l),a.applied=l}}),xr()}function UP(e,t,n){let o={...e.declaredVariableDefaults??(Ge(t)?Wi(t):{}),...wy(e.host)};ef(e.variableDeclarer??(Ge(t)?t:null),o,n),vy(e.host),Object.keys(o).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=o,tf(e.host,{...Ey(e.host,o,window),...hl()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function WP(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function VP(e){if(!Array.isArray(e))throw new Error("expected a JSON array");if(!e.every(WP))throw new Error("every array entry must be an object");return e}function $P(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function qP(e){return Te(e)?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function zP(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!Te(r))continue;let o=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;o&&e.push(o)}return e}function jP(e){let t=e.parentElement;if(t?.dataset.captionWrapper==="true")return t;let n=document.createElement("span");return n.style.display="inline-block",n.dataset.captionWrapper="true",e.parentNode?.insertBefore(n,e),n.appendChild(e),n}var Em=()=>window.gsap,Hv=()=>fetch("caption-overrides.json").then(e=>e.ok?e.json():null),Gv=e=>e===null?[]:VP(e);function Bv(e){let t=e instanceof Error?e.message:String(e);globalThis.console.error(`[HyperFrames] Invalid caption-overrides.json: ${t}`)}function vm(){return Em()?Hv().then(Gv).catch(e=>(Bv(e),[])):Promise.resolve([])}function Am(e,t){return!Em()||document.querySelectorAll(".caption-group").length===0?Promise.resolve():Hv().then(n=>wm(Gv(n),e,t)).catch(Bv)}function KP(e,t){return(e.wordId?qP(document.getElementById(e.wordId)):null)??(e.wordIndex!==void 0?t[e.wordIndex]??null:null)}function Ov(e,t){return Object.fromEntries(t.filter(n=>e[n]!==void 0).map(n=>[n,e[n]]))}function Sm(e,t){let n=e.style.color;e.style.color=t;let r=getComputedStyle(e).color;return e.style.color=n,r}function YP(e,t){let n=t[0]?.vars.startAt;return Sm(e,n?.color===void 0?"":String(n.color))}function XP(e,t,n,r){let o=$P(e);if(o)return o;let i=String(e.vars.color);return/var\\(|currentcolor/i.test(i)?Sm(t,i)===n?"dim":"active":(r.has(i)||r.set(i,Sm(t,i)),r.get(i)===n?"dim":"active")}function JP(e,t,n){if(e.dimColor)return e.dimColor;if(!(t.length===0||t.some(r=>r.vars.runBackwards)))return n}function QP(e,t,n,r){let o=e.getTweensOf(t).filter(l=>l.vars.color!==void 0).sort((l,s)=>l.startTime()-s.startTime()),i=YP(t,o);for(let l of o){let c=XP(l,t,i,r)==="dim"?n.dimColor:n.activeColor;c&&(l.vars.color=c),l.vars.runBackwards||l.invalidate?.()}let a=JP(n,o,i);a&&e.set(t,{color:a})}function ZP(e,t,n,r){let o=Ov(n,["x","y","scale","rotation"]),i=Ov(n,["opacity","fontWeight","fontFamily"]);if(n.fontSize!==void 0&&(i.fontSize=`${n.fontSize}px`),(n.activeColor||n.dimColor)&&QP(e,t,n,r),Object.keys(i).length>0&&e.set(t,i),Object.keys(o).length>0){let a=jP(t);e.set(a,o)}}function wm(e,t,n=()=>{}){let r=Em();if(!r||e.length===0)return;n();let o=zP(),i=new Map;for(let a of e){let l=KP(a,o);!l||t&&!t.some(s=>s.contains(l))||ZP(r,l,a,i)}}var Tm="data-hf-edit-base-x",Cm="data-hf-edit-base-y",er="data-hf-edit-original-translate",au=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},eI=e=>{let t=[],n=0,r="";for(let o of e.trim())o==="("&&(n+=1),o===")"&&(n=Math.max(0,n-1)),/\\s/.test(o)&&n===0?(r&&t.push(r),r=""):r+=o;return r&&t.push(r),t},Uv=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,_m=(e,t)=>Uv.test(e)&&Uv.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,tI=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,o,i]=eI(e);if(r===void 0)return`${t} ${n}`;if(o===void 0)return`${_m(r,t)} ${n}`;let a=i===void 0?"":` ${i}`;return`${_m(r,t)} ${_m(o,n)}${a}`},nI=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},rI=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let n=e.ownerDocument.defaultView,r=n?n.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},su=new WeakMap;function zv(e){su.delete(e)}function oI(e,t){let n=su.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Mt("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=au(e.getAttribute("data-x"))-au(e.getAttribute(Tm)),o=au(e.getAttribute("data-y"))-au(e.getAttribute(Cm));e.hasAttribute(er)||e.setAttribute(er,rI(e)),n===void 0&&nI(e);let i=e.getAttribute(er)??"",a=tI(i,`${r}px`,`${o}px`);e.style.setProperty("translate",a),su.set(e,e.style.getPropertyValue("translate"))}function ya(e,t){let n=e.querySelectorAll(`[${er}]:not([${Tm}]):not([${Cm}])`);for(let i=0;i<n.length;i++){let a=n[i];if(a===void 0||!wr(a))continue;let l=a.getAttribute(er)??"";l===""?a.style.removeProperty("translate"):a.style.setProperty("translate",l),a.removeAttribute(er),su.delete(a)}let r=e.querySelectorAll(`[${Tm}], [${Cm}]`),o=0;for(let i=0;i<r.length;i++){let a=r[i];a===void 0||!wr(a)||(oI(a,t),o+=1)}return o}var Wv="__hfPositionEditsSeekReapplyWrapped",Vv=new WeakSet,$v=new WeakMap,qv=new WeakMap;function jv(e){let t=e,n=()=>{try{ya(t.document)}catch{}},r=f=>typeof f=="function"&&(Vv.has(f)||!!f[Wv]),o=f=>{Vv.add(f);try{Object.defineProperty(f,Wv,{value:!0})}catch{}},i=f=>{if(typeof f!="function"||r(f))return f;let m=function(...g){let h=f.apply(this,g);return n(),h};return o(m),m},a=(f,m)=>{let g=$v.get(f);if(g?.has(m))return!0;let h=Object.getOwnPropertyDescriptor(f,m);if(h?.configurable===!1){let E=f[m];return typeof E=="function"&&(f[m]=i(E),n()),!1}let y=f[m],S=h?.set;return Object.defineProperty(f,m,{configurable:!0,enumerable:h?.enumerable??!0,get:()=>y,set:E=>{y=i(E),S?.call(f,E)}}),y=i(y),g??(g=new Set),g.add(m),$v.set(f,g),n(),!0},l=(f,m)=>{let g=qv.get(t),h=Object.getOwnPropertyDescriptor(t,f);if(!g?.has(f)){if(h?.configurable===!1){let E=t[f];return E?a(E,m):!1}let S=t[f];Object.defineProperty(t,f,{configurable:!0,enumerable:h?.enumerable??!0,get:()=>S,set:E=>{S=E,S&&a(S,m)}}),g??(g=new Set),g.add(f),qv.set(t,g)}let y=t[f];return y?a(y,m):!1},s=()=>{let f=l("__hf","seek"),m=l("__player","renderSeek");return f&&m};if(s())return;let c=120,d=t.setInterval(()=>{if(s()){t.clearInterval(d);return}c-=1,c<=0&&t.clearInterval(d)},50)}var xa=Dx,lu=Ox;function iI(e){return typeof e.tagName!="string"||typeof e.getAttribute!="function"||!Yi.includes(e.tagName.toLowerCase())?null:e.getAttribute(lu)||null}function aI(e,t,n){let r=typeof n?.closest=="function"?n.closest("[data-composition-id]"):null,o=r?Array.from(r.getElementsByTagName(xa)).find(a=>a.id===t):void 0;if(o)return o;let i=e?.getElementById(t)??null;return i?.tagName.toLowerCase()===xa?i:null}function Kv(e,t){let n=e.getAttribute(To);if(n!==null)return n;let r=iI(e);return r?aI(t,r,e)?.getAttribute(To)??null:null}function Yv(e){let t="__hf-color-group-inert";if(!e?.head||e.getElementById(t))return;let n=e.createElement("style");n.id=t,n.textContent=`${xa}{display:contents!important}`,e.head.appendChild(n)}var sI=["video","audio","source","script",pn];function Rm(e,t=()=>!1){let n=r=>r.nodeType===Node.ELEMENT_NODE&&(r.matches(e)||r.querySelector(e)!==null||t(r));return r=>r.some(o=>o.type==="attributes"||Array.from(o.addedNodes).some(n)||Array.from(o.removedNodes).some(n))}var Xv=e=>Rm([...sI,...e.map(t=>`[${t}]`)].join(","));var lI=3e3,yn=new Map,uI="data-hf-color-grading-canvas",cI="__hf_color_grading_canvas__",dI=1<<24,fI=8192;function uA(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{Te(r)&&(r.hasAttribute(Ir)||r.setAttribute(Ir,r.style.opacity))},n=r=>{if(Ge(r)){r.matches("video, img")&&t(r);for(let o of r.querySelectorAll("video, img"))t(o)}};n(e),new MutationObserver(r=>{for(let o of r)for(let i of o.addedNodes)n(i)}).observe(e,{childList:!0,subtree:!0})}var mI=16,pI=4,Wr={enabled:!1,position:.5,softness:0,lineWidth:2},Mm=["#000000","#ffffff"],hI=["#1a1a1a","#f5f5dc"],Ta=3,gI=Ta-1,bI=5,Gr=`${Jt}.0`,Jv=`${Jt-1}.0`,Qv=`${Ta}.0`,yI=`${(gI+.5)/Ta}`;function Sa(e){let t=Kv(e,e.ownerDocument);return t==null?null:iS(t,ml(e))}var xI=["attribute vec2 a_pos;","varying vec2 v_uv;","void main(){"," v_uv = a_pos * 0.5 + 0.5;"," gl_Position = vec4(a_pos, 0.0, 1.0);","}"].join(`\n`),cA=["#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 sampler2D u_bloomSource;","uniform sampler2D u_kuwaharaSource;","uniform sampler2D u_lut;","uniform sampler2D u_advanced;","uniform vec2 u_resolution;","uniform vec2 u_uvScale;","uniform vec2 u_uvOffset;","uniform float u_blurReady;","uniform float u_bloomReady;","uniform float u_kuwaharaReady;","uniform float u_lutEnabled;","uniform float u_lutSize;","uniform vec2 u_lutTextureSize;","uniform vec3 u_lutDomainMin;","uniform vec3 u_lutDomainMax;","uniform float u_lutIntensity;","uniform vec3 u_shadowWheel;","uniform vec3 u_midtoneWheel;","uniform vec3 u_highlightWheel;","uniform float u_rgbCurvesEnabled;","uniform float u_hueCurvesEnabled;","uniform float u_secondaryCount;","uniform float u_exposure;","uniform float u_contrast;","uniform float u_highlights;","uniform float u_shadows;","uniform float u_whites;","uniform float u_blacks;","uniform float u_temperature;","uniform float u_tint;","uniform float u_vibrance;","uniform float u_saturation;","uniform float u_vignette;","uniform float u_vignetteMidpoint;","uniform float u_vignetteRoundness;","uniform float u_vignetteFeather;","uniform float u_grain;","uniform float u_grainSize;","uniform float u_grainRoughness;","uniform float u_grainSeed;","uniform float u_effectTime;","uniform float u_blur;","uniform float u_bloom;","uniform float u_kuwahara;","uniform float u_pixelate;","uniform float u_chromaBleed;","uniform float u_tapeDamage;","uniform float u_tapeTracking;","uniform float u_tapeNoise;","uniform float u_tapeSpeed;","uniform float u_filmArtifacts;","uniform float u_halftone;","uniform float u_halftoneSize;","uniform float u_twoInkPrint;","uniform float u_twoInkPrintSize;","uniform float u_ascii;","uniform float u_asciiSize;","uniform float u_asciiInvert;","uniform float u_asciiStyle;","uniform float u_asciiColor;","uniform float u_asciiRotation;","uniform float u_dither;","uniform float u_ditherSize;","uniform float u_monoScreen;","uniform float u_monoScreenSize;","uniform float u_monoScreenAngle;","uniform float u_monoScreenSpread;","uniform float u_monoScreenShape;","uniform float u_monoScreenInvert;","uniform float u_scanlines;","uniform float u_scanlineCount;","uniform float u_scanlineSoftness;","uniform float u_chromaticAberration;","uniform float u_chromaticAngle;","uniform float u_crtCurvature;","uniform float u_digitalGlitch;","uniform float u_digitalGlitchColorSplit;","uniform float u_digitalGlitchLineTear;","uniform float u_digitalGlitchPixelate;","uniform float u_digitalGlitchBlockAmount;","uniform float u_digitalGlitchBlockDisplacement;","uniform float u_digitalGlitchBlockOpacity;","uniform float u_digitalGlitchSpeed;","uniform float u_engraving;","uniform float u_engravingSpacing;","uniform float u_engravingMinThickness;","uniform float u_engravingMaxThickness;","uniform float u_engravingAngle;","uniform float u_engravingContrast;","uniform float u_engravingSharpness;","uniform float u_engravingWave;","uniform float u_engravingWaveFrequency;","uniform float u_crosshatch;","uniform float u_crosshatchSpacing;","uniform float u_crosshatchThickness;","uniform float u_crosshatchAngle;","uniform float u_crosshatchContrast;","uniform float u_crosshatchEdges;","uniform float u_crosshatchLineWeight;","uniform float u_crosshatchWave;","uniform float u_crosshatchWaveFrequency;","uniform float u_paletteSize;","uniform vec3 u_palette0;","uniform vec3 u_palette1;","uniform vec3 u_palette2;","uniform vec3 u_palette3;","uniform vec3 u_palette4;","uniform vec3 u_palette5;","uniform float u_intensity;","uniform float u_compareEnabled;","uniform float u_comparePosition;","uniform float u_compareSoftness;","uniform float u_compareLineWidth;","const float PI = 3.14159265359;","float lumaOf(vec3 c){ return dot(c, vec3(0.2126, 0.7152, 0.0722)); }","float bt601Luma(vec3 c){ return dot(c, vec3(0.299, 0.587, 0.114)); }","float grainHash(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123); }","float digitalHash(vec2 p){"," vec2 q = mod(floor(p), 251.0);"," float x = mod(q.x * q.x * 157.0 + q.x * 89.0, 251.0);"," float y = mod(q.y * q.y * 113.0 + q.y * 47.0, 251.0);"," float xy = mod(q.x * q.y * 71.0, 251.0);"," return mod(x + y + xy + 19.0, 251.0) / 251.0;","}","float colorSaturation(vec3 c){ return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); }","vec2 clampUv(vec2 uv){ return clamp(uv, vec2(0.0), vec2(1.0)); }","vec2 applyCrtWarp(vec2 uv){"," vec2 centered = uv * 2.0 - 1.0;"," float curvature = clamp(u_crtCurvature, 0.0, 1.0) * 0.5;"," float dist = dot(centered, centered);"," centered *= 1.0 + curvature * dist;"," return centered * 0.5 + 0.5;","}","vec4 sampleSource(vec2 uv){ return texture2D(u_source, clampUv(uv)); }","vec4 sampleBlur(vec2 uv){ return texture2D(u_blurSource, clampUv(uv)); }","vec3 sampleBloom(vec2 uv){ return texture2D(u_bloomSource, clampUv(uv)).rgb; }","vec3 sampleKuwahara(vec2 uv){"," vec2 displayUv = uv * u_uvScale + u_uvOffset;"," return texture2D(u_kuwaharaSource, clampUv(displayUv)).rgb;","}","vec4 samplePrepared(vec2 uv){"," vec4 base = sampleSource(uv);","#ifdef HF_STAGE_BLUR"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);","#endif","#ifdef HF_STAGE_KUWAHARA"," float kuwahara = clamp(u_kuwahara, 0.0, 1.0);"," if (kuwahara > 0.0 && u_kuwaharaReady > 0.5) {"," base.rgb = mix(base.rgb, sampleKuwahara(uv), kuwahara);"," }","#endif"," return base;","}","float tapeTrackingBand(float y, float center, float width){"," float offset = fract(y - center + 0.5) - 0.5;"," float triangle = max(0.0, 1.0 - abs(offset) / max(width, 0.0001));"," return triangle * triangle * (3.0 - 2.0 * triangle);","}","vec4 sampleMedia(vec2 uv){"," float pixel = clamp(u_pixelate, 0.0, 1.0);"," vec2 sampleUv = uv;","#ifdef HF_STAGE_PIXELATE"," if (pixel > 0.0) {"," float blockSize = mix(1.0, 48.0, pixel);"," vec2 cells = max(u_resolution / blockSize, vec2(1.0));"," sampleUv = (floor(clamp(uv, vec2(0.0), vec2(0.999999)) * cells) + 0.5) / cells;"," }","#endif","#ifdef HF_STAGE_TAPE"," float tapeDamage = clamp(u_tapeDamage, 0.0, 1.0);"," float tapeTracking = clamp(u_tapeTracking, 0.0, 1.0);"," float tapeNoise = clamp(u_tapeNoise, 0.0, 1.0);"," float tapeTime = u_effectTime * mix(0.0, 2.0, clamp(u_tapeSpeed, 0.0, 1.0));"," float tapeFrame = floor(tapeTime * 60.0);"," float tapeLine = floor(sampleUv.y * u_resolution.y * 0.5);"," float lineJitter = (digitalHash(vec2(tapeLine, floor(tapeFrame * 0.5))) - 0.5) * 1.8 * tapeNoise;"," float slowWobble = sin(sampleUv.y * 32.0 + tapeTime * 2.6) * 0.55;"," float headSwitch = smoothstep(0.88, 1.0, sampleUv.y) * sin(sampleUv.y * 240.0 + tapeTime * 8.0) * 4.0;"," float trackingShift = tapeTrackingBand(sampleUv.y, fract(0.08 + tapeTime * 0.083), 0.035);"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.28 + tapeTime * 0.061), 0.03) * 0.8;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.5 + tapeTime * 0.047), 0.04) * 0.75;"," trackingShift -= tapeTrackingBand(sampleUv.y, fract(0.72 + tapeTime * 0.037), 0.028) * 0.65;"," trackingShift += tapeTrackingBand(sampleUv.y, fract(0.89 + tapeTime * 0.029), 0.032) * 0.55;"," trackingShift *= tapeTracking * 48.0;"," float tapeShift = (lineJitter + slowWobble + headSwitch + trackingShift) * tapeDamage;","#endif"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);","#ifdef HF_STAGE_TAPE"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);","#else"," vec2 tapeUv = sampleUv;","#endif"," vec4 base = samplePrepared(tapeUv);","#ifdef HF_STAGE_TAPE"," if (tapeDamage > 0.0) {"," vec2 lumaStep = vec2(texelX * mix(1.0, 3.5, tapeDamage), 0.0);"," vec3 leftTape = samplePrepared(tapeUv - lumaStep).rgb;"," vec3 rightTape = samplePrepared(tapeUv + lumaStep).rgb;"," float tapeLuma = (bt601Luma(leftTape) + bt601Luma(base.rgb) * 2.0 + bt601Luma(rightTape)) * 0.25;"," vec3 centerChroma = base.rgb - vec3(bt601Luma(base.rgb));"," vec3 tapeColor = vec3(tapeLuma) + centerChroma;"," vec3 ghost = samplePrepared(tapeUv - vec2(texelX * 12.0, 0.0)).rgb;"," tapeColor = mix(tapeColor, ghost, 0.045 * tapeDamage);"," float fineNoise = digitalHash(floor(gl_FragCoord.xy) + vec2(tapeFrame * 17.0, tapeFrame * 3.0)) - 0.5;"," float band = digitalHash(vec2(floor(sampleUv.y * 92.0), floor(tapeFrame / 3.0)));"," float dropout = smoothstep(0.985, 1.0, band) * (digitalHash(vec2(floor(sampleUv.x * 18.0), tapeLine)) - 0.5);"," tapeColor += (fineNoise * 0.035 + dropout * 0.12) * tapeDamage * tapeNoise;"," base.rgb = mix(base.rgb, clamp(tapeColor, 0.0, 1.0), tapeDamage);"," }","#endif","#ifdef HF_STAGE_CHROMA_BLEED"," float chromaBleed = clamp(u_chromaBleed, 0.0, 1.0);"," if (chromaBleed > 0.0) {"," float radius = mix(1.0, 4.0, chromaBleed);"," vec2 stepUv = vec2(texelX * radius, 0.0);"," vec3 c0 = base.rgb;"," vec3 c1 = samplePrepared(tapeUv - stepUv).rgb;"," vec3 c2 = samplePrepared(tapeUv + stepUv).rgb;"," vec3 c3 = samplePrepared(tapeUv - stepUv * 2.0).rgb;"," vec3 c4 = samplePrepared(tapeUv + stepUv * 2.0).rgb;"," float centerLuma = lumaOf(base.rgb);"," vec3 blurredChroma = ((c0 - vec3(lumaOf(c0))) * 6.0 + (c1 - vec3(lumaOf(c1))) * 4.0 + (c2 - vec3(lumaOf(c2))) * 4.0 + (c3 - vec3(lumaOf(c3))) + (c4 - vec3(lumaOf(c4)))) / 16.0;"," base.rgb = mix(base.rgb, clamp(vec3(centerLuma) + blurredChroma, 0.0, 1.0), chromaBleed);"," }","#endif"," return base;","}","#ifdef HF_STAGE_CHROMATIC","vec4 sampleChromaticMedia(vec2 uv, vec4 center){"," float amount = clamp(u_chromaticAberration, 0.0, 1.0);"," if (amount <= 0.0) return center;"," float angle = clamp(u_chromaticAngle, 0.0, 1.0) * PI * 2.0;"," vec2 offset = vec2(cos(angle), sin(angle)) * amount * 0.02;"," vec4 positive = sampleMedia(uv + offset);"," vec4 negative = sampleMedia(uv - offset);"," vec3 split = vec3(positive.r, center.g, negative.b);"," return vec4(split, center.a);","}","#else","vec4 sampleChromaticMedia(vec2 uv, vec4 center){ return center; }","#endif","vec3 sampleDigitalSplit(vec2 uv, vec2 block, float time, float amount){"," float split = amount * 0.06;"," float direction = digitalHash(block * 0.4 + vec2(floor(time * 3.7), floor(time * 5.3)));"," vec2 axis = direction > 0.66 ? vec2(1.0, 0.0) : direction > 0.33 ? vec2(0.0, 1.0) : vec2(0.7071);"," vec4 center = sampleMedia(uv);"," return vec3(sampleMedia(uv + axis * split).r, center.g, sampleMedia(uv - axis * split).b);","}","#ifdef HF_STAGE_GLITCH","vec3 applyDigitalGlitch(vec2 uv, vec3 source){"," float amount = clamp(u_digitalGlitch, 0.0, 1.0);"," if (amount <= 0.0) return source;"," float colorSplit = clamp(u_digitalGlitchColorSplit, 0.0, 1.0) * 2.0;"," float lineTear = clamp(u_digitalGlitchLineTear, 0.0, 1.0) * 2.0;"," float pixelate = clamp(u_digitalGlitchPixelate, 0.0, 1.0) * 2.0;"," float blockAmount = clamp(u_digitalGlitchBlockAmount, 0.0, 1.0);"," float blockDisplacement = clamp(u_digitalGlitchBlockDisplacement, 0.0, 1.0) * 2.0;"," float blockOpacity = clamp(u_digitalGlitchBlockOpacity, 0.0, 1.0);"," float speed = clamp(u_digitalGlitchSpeed, 0.0, 1.0) * 2.0;"," float time = u_effectTime * speed;"," float blockCount = 8.0 + blockAmount * 60.0;"," vec2 block = floor(uv * blockCount);"," float randomA = digitalHash(block + vec2(floor(time * 7.3), floor(time * 11.1)));"," float randomB = digitalHash(block * 0.7 + vec2(17.3 + floor(time * 6.6), 29.1));"," float randomC = digitalHash(block + vec2(floor(time * 5.7) * 13.0, 41.0));"," float randomD = digitalHash(block * 1.3 + vec2(7.0, floor(time * 3.2) * 7.0));"," vec2 displaced = uv;"," if (blockDisplacement > 0.0 && blockOpacity > 0.0) {"," float threshold = 1.0 - blockDisplacement * 0.4;"," if (randomA > threshold) {"," displaced += vec2((randomB - 0.5) * blockDisplacement * 0.5, (randomC - 0.5) * blockDisplacement * 0.3);"," }"," if (randomD > 0.92 && blockDisplacement > 0.5) {"," displaced.x += (digitalHash(vec2(block.y, floor(time * 8.0))) - 0.5) * blockDisplacement;"," }"," displaced = mix(uv, displaced, blockOpacity);"," }"," if (lineTear > 0.0) {"," float row = floor(uv.y * (50.0 + lineTear * 150.0));"," float tearA = digitalHash(vec2(row * 7.3 + floor(time * 12.0 + row * 0.1) * 3.7, 13.0));"," float tearB = digitalHash(vec2(row * 13.7 + floor(time * 8.3) * 5.1, 31.0));"," if (tearA > 1.0 - lineTear * 0.5) displaced.x += (tearB - 0.5) * lineTear * 0.4;"," if (tearB > 0.95 && lineTear > 0.3) displaced.x += (tearA - 0.5) * lineTear * 0.8;"," }"," if (pixelate > 0.0) {"," float pixelRandom = digitalHash(block * 0.5 + vec2(floor(time * 4.9), 53.0));"," if (pixelRandom > 1.0 - pixelate * 0.35) {"," float cells = 4.0 + (1.0 - pixelRandom) * pixelate * 40.0;"," displaced = (floor(clampUv(displaced) * cells) + 0.5) / cells;"," }"," }"," displaced = clampUv(displaced);"," vec3 glitch = sampleDigitalSplit(displaced, block, time, colorSplit);"," if (blockDisplacement > 0.2 && blockOpacity > 0.0) {"," float corruption = digitalHash(block * 1.1 + vec2(floor(time * 11.9), 67.0));"," vec3 changed = glitch;"," if (corruption > 0.9) changed = 1.0 - glitch;"," else if (corruption > 0.85) changed = corruption > 0.875 ? glitch.gbr : glitch.brg;"," else if (corruption > 0.8) {"," float channel = digitalHash(block + vec2(73.0));"," if (channel > 0.66) changed.r = min(changed.r * 2.0, 1.0);"," else if (channel > 0.33) changed.g = min(changed.g * 2.0, 1.0);"," else changed.b = min(changed.b * 2.0, 1.0);"," }"," glitch = mix(glitch, changed, blockOpacity);"," }"," if (blockOpacity > 0.0) {"," float flash = digitalHash(block * 0.8 + vec2(floor(time * 14.7), 83.0));"," vec3 flashed = flash > 0.97 ? min(glitch * 1.8, vec3(1.0)) : flash > 0.94 ? glitch * 0.3 : glitch;"," glitch = mix(glitch, flashed, blockOpacity * 0.6);"," }"," if (lineTear > 0.1) {"," float interference = pow(sin(uv.y * (300.0 + randomA * 200.0) + time * 30.0) * 0.5 + 0.5, 6.0);"," glitch -= interference * 0.08 * lineTear;"," }"," return mix(source, clamp(glitch, 0.0, 1.0), amount);","}","#else","vec3 applyDigitalGlitch(vec2 uv, vec3 source){ return source; }","#endif","float dustMask(vec2 uv, float frameBucket){"," vec2 grid = vec2(128.0, 72.0);"," vec2 cell = floor(uv * grid);"," vec2 local = fract(uv * grid) - 0.5;"," float chance = grainHash(cell + frameBucket * 19.13);"," float radius = mix(0.05, 0.34, grainHash(cell + 7.1));"," return step(0.9975, chance) * (1.0 - smoothstep(radius, radius + 0.08, length(local)));","}","float screenDot(vec2 p, float ink, float angle, float sharpness){"," float c = cos(angle);"," float s = sin(angle);"," vec2 q = mat2(c, -s, s, c) * p;"," vec2 d = fract(q) - 0.5;"," float radius = sqrt(clamp(ink, 0.0, 1.0)) * 0.68;"," float edge = mix(0.16, 0.025, sharpness);"," return 1.0 - smoothstep(radius - edge, radius + edge, length(d));","}","vec3 paletteColor(float index);","float monoScreenMask(vec2 local, float radius, float shape, float softness){"," vec2 centered = local - 0.5;"," float distanceToInk = length(centered);"," if (shape > 0.5 && shape < 1.5) distanceToInk = max(abs(centered.x), abs(centered.y));"," if (shape > 1.5 && shape < 2.5) distanceToInk = abs(centered.x) + abs(centered.y);"," if (shape > 2.5 && shape < 3.5) distanceToInk = max(abs(centered.x) * 0.86 + centered.y * 0.5, -centered.y);"," if (shape > 3.5) distanceToInk = abs(centered.y);"," float shapeRadius = shape > 3.5 ? radius * 0.45 : radius;"," return 1.0 - smoothstep(shapeRadius, shapeRadius + softness, distanceToInk);","}","#ifdef HF_STAGE_MONO_SCREEN","vec3 applyMonoScreen(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float invert = step(0.5, u_monoScreenInvert);"," float coverage = mix(1.0 - lumaOf(source), lumaOf(source), invert);"," coverage = pow(clamp(coverage, 0.0, 1.0), mix(1.7, 0.58, clamp(u_monoScreenSpread, 0.0, 1.0)));"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellPx = mix(4.0, 18.0, clamp(u_monoScreenSize, 0.0, 1.0)) * scale;"," float angle = clamp(u_monoScreenAngle, 0.0, 1.0) * PI * 0.5;"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 point = mat2(cosine, -sine, sine, cosine) * gl_FragCoord.xy / max(cellPx, 1.0);"," float radius = sqrt(coverage) * 0.68;"," float inkMask = monoScreenMask(fract(point), radius, floor(u_monoScreenShape + 0.5), 0.035);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","#else","vec3 applyMonoScreen(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_ENGRAVING","vec3 applyEngraving(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(3.0, 20.0, clamp(u_engravingSpacing, 0.0, 1.0));"," float minThickness = mix(0.0, 2.0, clamp(u_engravingMinThickness, 0.0, 1.0));"," float maxThickness = mix(1.0, 8.0, clamp(u_engravingMaxThickness, 0.0, 1.0));"," float angle = clamp(u_engravingAngle, 0.0, 1.0) * PI;"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(gl_FragCoord.xy, alongAxis);"," float across = dot(gl_FragCoord.xy, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_engravingWaveFrequency, 0.0, 1.0));"," float wave = sin(along * frequency * 0.01);"," across += wave * clamp(u_engravingWave, 0.0, 1.0) * 3.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float lineDistance = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float contrast = mix(0.5, 2.0, clamp(u_engravingContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," float variation = mix(0.88, 1.12, digitalHash(vec2(lineIndex, 73.0)));"," float thickness = mix(minThickness, maxThickness, darkness) * variation;"," float edge = mix(1.0, 0.3, clamp(u_engravingSharpness, 0.0, 1.0));"," float inkMask = 1.0 - smoothstep(max(thickness * 0.5 - edge, 0.0), thickness * 0.5 + edge, lineDistance);"," inkMask *= smoothstep(0.015, 0.12, darkness);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," return mix(source, mix(paper, ink, inkMask), amount);","}","#else","vec3 applyEngraving(vec3 source, float amount){ return source; }","#endif","float crosshatchLine(vec2 pixel, float angle, float spacing, float thickness, float seed){"," vec2 alongAxis = vec2(cos(angle), sin(angle));"," vec2 acrossAxis = vec2(-alongAxis.y, alongAxis.x);"," float along = dot(pixel, alongAxis);"," float across = dot(pixel, acrossAxis);"," float frequency = mix(1.0, 10.0, clamp(u_crosshatchWaveFrequency, 0.0, 1.0));"," across += sin(along * frequency * 0.02 + u_effectTime + seed) * clamp(u_crosshatchWave, 0.0, 1.0) * 5.0;"," float lineIndex = floor(across / max(spacing, 1.0));"," float distanceToLine = abs(fract(across / max(spacing, 1.0)) - 0.5) * spacing;"," float variation = mix(1.0, 0.5 + digitalHash(vec2(lineIndex, seed)), clamp(u_crosshatchLineWeight, 0.0, 1.0));"," float halfWidth = thickness * variation * 0.5;"," return 1.0 - smoothstep(max(halfWidth - 0.5, 0.0), halfWidth + 0.5, distanceToLine);","}","float crosshatchEdge(vec2 uv){"," vec2 texel = 1.0 / max(u_resolution * u_uvScale, vec2(1.0));"," float tl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, -1.0)).rgb);"," float tc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, -1.0)).rgb);"," float tr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, -1.0)).rgb);"," float ml = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 0.0)).rgb);"," float mr = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 0.0)).rgb);"," float bl = lumaOf(sampleMedia(uv + texel * vec2(-1.0, 1.0)).rgb);"," float bc = lumaOf(sampleMedia(uv + texel * vec2( 0.0, 1.0)).rgb);"," float br = lumaOf(sampleMedia(uv + texel * vec2( 1.0, 1.0)).rgb);"," float gx = -tl - 2.0 * ml - bl + tr + 2.0 * mr + br;"," float gy = -tl - 2.0 * tc - tr + bl + 2.0 * bc + br;"," return length(vec2(gx, gy));","}","#ifdef HF_STAGE_CROSSHATCH","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){"," if (amount <= 0.0) return source;"," float spacing = mix(5.0, 30.0, clamp(u_crosshatchSpacing, 0.0, 1.0));"," float thickness = mix(1.0, 5.0, clamp(u_crosshatchThickness, 0.0, 1.0));"," float baseAngle = -clamp(u_crosshatchAngle, 0.0, 1.0) * PI;"," float contrast = mix(0.5, 2.0, clamp(u_crosshatchContrast, 0.0, 1.0));"," float darkness = 1.0 - pow(clamp(lumaOf(source), 0.0, 1.0), contrast);"," vec3 ink = paletteColor(0.0);"," vec3 paper = paletteColor(max(u_paletteSize - 1.0, 1.0));"," vec3 result = paper;"," float layer = crosshatchLine(gl_FragCoord.xy, baseAngle, spacing, thickness, 1.0) * smoothstep(0.2, 0.4, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.5, spacing * 0.95, thickness * 0.9, 2.0) * smoothstep(0.4, 0.6, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle + PI * 0.25, spacing * 0.9, thickness * 0.8, 3.0) * smoothstep(0.6, 0.8, darkness);"," result = mix(result, ink, layer);"," layer = crosshatchLine(gl_FragCoord.xy, baseAngle - PI * 0.25, spacing * 0.85, thickness * 0.7, 4.0) * smoothstep(0.75, 0.9, darkness);"," result = mix(result, ink, layer);"," result = mix(result, ink, smoothstep(0.9, 1.0, darkness) * 0.8);"," float edgeStrength = mix(0.0, 2.0, clamp(u_crosshatchEdges, 0.0, 1.0));"," float edge = smoothstep(0.1, 0.3, crosshatchEdge(uv)) * edgeStrength;"," result = mix(result, ink, clamp(edge, 0.0, 1.0));"," return mix(source, result, amount);","}","#else","vec3 applyCrosshatch(vec2 uv, vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_HALFTONE","vec3 applyHalftone(vec3 source, float amount){"," if (amount <= 0.0) return source;"," vec3 cmy = 1.0 - source;"," float k = min(cmy.r, min(cmy.g, cmy.b));"," vec3 inks = max(cmy - vec3(k * 0.72), 0.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(5.0, 14.0, clamp(u_halftoneSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float cyan = screenDot(p, inks.r, 0.261799, 0.78);"," float magenta = screenDot(p, inks.g, 1.308997, 0.78);"," float yellow = screenDot(p, inks.b, 0.0, 0.78);"," float blackInk = screenDot(p, k, 0.785398, 0.82);"," vec3 printColor = vec3(0.975, 0.962, 0.925);"," printColor *= mix(vec3(1.0), vec3(0.05, 0.79, 0.86), cyan);"," printColor *= mix(vec3(1.0), vec3(0.91, 0.08, 0.48), magenta);"," printColor *= mix(vec3(1.0), vec3(0.98, 0.83, 0.08), yellow);"," printColor *= mix(vec3(1.0), vec3(0.035), blackInk * 0.92);"," return mix(source, printColor, amount);","}","#else","vec3 applyHalftone(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_TWO_INK_PRINT","vec3 applyTwoInkPrint(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float sourceLuma = lumaOf(source);"," float darkness = 1.0 - sourceLuma;"," float warmBias = clamp(source.r - (source.g + source.b) * 0.5, -0.35, 0.35);"," float coolBias = clamp((source.g + source.b) * 0.5 - source.r, -0.35, 0.35);"," float redTone = smoothstep(0.08, 0.72, darkness) * (1.0 - 0.68 * smoothstep(0.66, 1.0, darkness));"," float tealTone = smoothstep(0.30, 0.92, darkness);"," float redCoverage = clamp(redTone + warmBias * 1.35 - coolBias * 0.35, 0.0, 1.0);"," float tealCoverage = clamp(tealTone + coolBias * 1.1 - warmBias * 0.45, 0.0, 1.0);"," float scale = min(u_resolution.x, u_resolution.y) / 540.0;"," float cellPx = mix(4.5, 12.0, clamp(u_twoInkPrintSize, 0.0, 1.0)) * max(scale, 0.25);"," vec2 p = gl_FragCoord.xy / max(cellPx, 1.0);"," float redDot = screenDot(p, redCoverage, 0.261799, 0.84);"," float tealDot = screenDot(p + vec2(0.12, -0.08), tealCoverage, 1.308997, 0.84);"," float paperNoise = grainHash(floor(gl_FragCoord.xy * 0.5)) - 0.5;"," vec3 paper = vec3(0.955, 0.910, 0.795) + paperNoise * 0.018;"," vec3 vermilion = vec3(0.88, 0.13, 0.075);"," vec3 teal = vec3(0.035, 0.285, 0.355);"," vec3 overprint = vec3(0.045, 0.055, 0.052);"," vec3 printColor = paper * (1.0 - redDot) * (1.0 - tealDot);"," printColor += vermilion * redDot * (1.0 - tealDot);"," printColor += teal * (1.0 - redDot) * tealDot;"," printColor += overprint * redDot * tealDot;"," return mix(source, clamp(printColor, 0.0, 1.0), amount);","}","#else","vec3 applyTwoInkPrint(vec3 source, float amount){ return source; }","#endif","vec3 paletteColor(float index){"," if (index < 0.5) return u_palette0;"," if (index < 1.5) return u_palette1;"," if (index < 2.5) return u_palette2;"," if (index < 3.5) return u_palette3;"," if (index < 4.5) return u_palette4;"," return u_palette5;","}","float bayer4(vec2 point){"," vec2 cell = mod(floor(point), 4.0);"," if (cell.y < 0.5) {"," if (cell.x < 0.5) return 0.5 / 16.0;"," if (cell.x < 1.5) return 8.5 / 16.0;"," if (cell.x < 2.5) return 2.5 / 16.0;"," return 10.5 / 16.0;"," }"," if (cell.y < 1.5) {"," if (cell.x < 0.5) return 12.5 / 16.0;"," if (cell.x < 1.5) return 4.5 / 16.0;"," if (cell.x < 2.5) return 14.5 / 16.0;"," return 6.5 / 16.0;"," }"," if (cell.y < 2.5) {"," if (cell.x < 0.5) return 3.5 / 16.0;"," if (cell.x < 1.5) return 11.5 / 16.0;"," if (cell.x < 2.5) return 1.5 / 16.0;"," return 9.5 / 16.0;"," }"," if (cell.x < 0.5) return 15.5 / 16.0;"," if (cell.x < 1.5) return 7.5 / 16.0;"," if (cell.x < 2.5) return 13.5 / 16.0;"," return 5.5 / 16.0;","}","float standardAsciiSample(float brightness, vec2 grid){"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.3) return grid.x == 2.0 && (grid.y == 2.0 || grid.y == 4.0) ? 1.0 : 0.0;"," if (brightness < 0.4) return (grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) {"," bool cross = (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0);"," bool diagonals = (grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0);"," return cross || diagonals ? 1.0 : 0.0;"," }"," if (brightness < 0.6) {"," bool ring = ((grid.y == 2.0 || grid.y == 4.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y == 3.0);"," return ring ? 1.0 : 0.0;"," }"," bool outline = ((grid.y == 1.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 0.0 || grid.x == 4.0) && grid.y >= 2.0 && grid.y <= 4.0) || ((grid.x == 1.0 || grid.x == 3.0) && grid.y >= 1.0 && grid.y <= 5.0);"," if (brightness < 0.7) return outline ? 1.0 : 0.0;"," if (brightness < 0.8) {"," bool slash = abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.x >= 1.0 && grid.x <= 3.0;"," return outline || slash ? 1.0 : 0.0;"," }"," if (brightness < 0.9) {"," bool loops = ((grid.y == 1.0 || grid.y == 3.0 || grid.y == 5.0) && grid.x >= 1.0 && grid.x <= 3.0) || ((grid.x == 1.0 || grid.x == 3.0) && (grid.y == 2.0 || grid.y == 4.0));"," return loops ? 1.0 : 0.0;"," }"," return 1.0;","}","float asciiStyleSample(float style, float brightness, vec2 uv){"," vec2 grid = floor(uv * vec2(5.0, 7.0));"," if (style < 0.5) return standardAsciiSample(brightness, grid);"," if (style < 1.5) {"," float checker = mod(grid.x + grid.y, 2.0);"," float ruled = mod(grid.x, 2.0) == 0.0 || mod(grid.y, 2.0) == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return checker == 0.0 ? 0.5 : 0.0;"," if (brightness < 0.375) return ruled * 0.6;"," if (brightness < 0.5) return checker == 0.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return ruled > 0.5 ? 1.0 : 0.3;"," if (brightness < 0.75) return checker == 0.0 ? 1.0 : 0.7;"," if (brightness < 0.875) return ruled > 0.5 ? 1.0 : 0.85;"," return 1.0;"," }"," if (style < 2.5) {"," if (brightness < 0.14) return 0.0;"," if (brightness < 0.28) return grid.x == 2.0 && grid.y == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.42) return grid.x == 2.0 && grid.y == 5.0 ? 1.0 : 0.0;"," if (brightness < 0.56) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.7) return (grid.x == 2.0 && grid.y >= 2.0 && grid.y <= 4.0) || (grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0) ? 1.0 : 0.0;"," if (brightness < 0.84) return abs(grid.x - 2.0) == abs(grid.y - 3.0) && grid.y >= 2.0 && grid.y <= 4.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 3.5) return grid.y >= 6.0 - brightness * 7.0 ? 1.0 : 0.0;"," if (style < 4.5) {"," vec2 dots = floor(uv * vec2(2.0, 4.0));"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return dots.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return dots.y >= 2.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return dots.y >= 1.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return dots.y >= 1.0 || dots.x == 1.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return 1.0;"," if (brightness < 0.875) return mod(grid.x + grid.y, 2.0) < 1.5 ? 1.0 : 0.7;"," return 1.0;"," }"," if (style < 5.5) {"," if (brightness < 0.125) return 0.0;"," if (brightness < 0.25) return grid.x == 2.0 && grid.y == 3.0 ? 1.0 : 0.0;"," if (brightness < 0.375) return grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.5) return grid.x + grid.y == 5.0 || grid.x + grid.y == 6.0 ? 1.0 : 0.0;"," if (brightness < 0.625) return grid.x == 2.0 ? 1.0 : 0.0;"," if (brightness < 0.75) return abs(grid.x - grid.y / 1.4) < 0.7 && grid.x >= 1.0 && grid.x <= 3.0 ? 1.0 : 0.0;"," if (brightness < 0.875) return grid.x == 2.0 || grid.y == 3.0 ? 1.0 : 0.0;"," return grid.x == 1.0 || grid.x == 3.0 || grid.y == 2.0 || grid.y == 4.0 ? 1.0 : 0.0;"," }"," if (style < 6.5) {"," bool top = grid.y == 0.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool topLeft = grid.x == 1.0 && grid.y <= 3.0;"," bool topRight = grid.x == 3.0 && grid.y <= 3.0;"," bool middle = grid.y == 3.0 && grid.x >= 1.0 && grid.x <= 3.0;"," bool bottomLeft = grid.x == 1.0 && grid.y >= 3.0;"," bool bottomRight = grid.x == 3.0 && grid.y >= 3.0;"," bool bottom = grid.y == 6.0 && grid.x >= 1.0 && grid.x <= 3.0;"," if (brightness < 0.1) return 0.0;"," if (brightness < 0.2) return topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.3) return top || topRight || middle || bottomLeft || bottom ? 1.0 : 0.0;"," if (brightness < 0.4) return top || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.5) return topLeft || middle || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.6) return top || topLeft || middle || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.7) return top || topLeft || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," if (brightness < 0.8) return top || topRight || bottomRight ? 1.0 : 0.0;"," if (brightness < 0.9) return top || topLeft || topRight || middle || bottomLeft || bottomRight || bottom ? 1.0 : 0.0;"," return top || topLeft || topRight || middle || bottomRight || bottom ? 1.0 : 0.0;"," }"," float slash = grid.x - grid.y;"," float backslash = grid.x + grid.y;"," if (brightness < 0.16) return 0.0;"," if (brightness < 0.33) return mod(slash, 3.0) < 0.5 ? 1.0 : 0.0;"," if (brightness < 0.5) return mod(slash, 2.0) < 0.5 ? 1.0 : 0.0;"," bool diagonalA = mod(slash, 2.0) < 0.5;"," bool diagonalB = mod(backslash, 2.0) < 0.5;"," if (brightness < 0.66) return diagonalA || diagonalB ? 1.0 : 0.0;"," if (brightness < 0.83) return mod(slash, 1.5) < 0.5 || mod(backslash, 1.5) < 0.5 ? 1.0 : 0.2;"," return mod(slash, 1.0) < 0.6 || mod(backslash, 1.0) < 0.6 ? 1.0 : 0.5;","}","vec3 rgbToHsv(vec3 color){"," float maximum = max(max(color.r, color.g), color.b);"," float minimum = min(min(color.r, color.g), color.b);"," float delta = maximum - minimum;"," float hue = 0.0;"," if (delta > 0.00001) {"," if (maximum == color.r) hue = mod((color.g - color.b) / delta, 6.0);"," else if (maximum == color.g) hue = (color.b - color.r) / delta + 2.0;"," else hue = (color.r - color.g) / delta + 4.0;"," hue = fract(hue / 6.0);"," }"," return vec3(hue, maximum > 0.00001 ? delta / maximum : 0.0, maximum);","}","vec3 hsvToRgb(vec3 color){"," vec3 bands = abs(fract(color.xxx + vec3(0.0, 0.6666667, 0.3333333)) * 6.0 - 3.0);"," return color.z * mix(vec3(1.0), clamp(bands - 1.0, 0.0, 1.0), color.y);","}","vec4 sampleAdvancedCurve(float coordinate, float row){",` float position = clamp(coordinate, 0.0, 1.0) * ${Jv};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Jv});`,` float y = (row + 0.5) / ${Qv};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Gr}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Gr}, y));`," return mix(before, after, position - lower);","}","vec4 sampleHueCurve(float coordinate){",` float position = fract(coordinate) * ${Gr};`," float lower = floor(position);",` float upper = mod(lower + 1.0, ${Gr});`,` float y = 1.5 / ${Qv};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Gr}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Gr}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Gr}, ${yI}));`,"}","vec3 wheelDirection(float hue){"," vec3 direction = hsvToRgb(vec3(fract(hue), 1.0, 1.0));"," direction -= vec3(lumaOf(direction));"," return direction / max(max(max(abs(direction.r), abs(direction.g)), abs(direction.b)), 0.0001);","}","vec3 applyTonalWheels(vec3 color){"," float luma = lumaOf(color);"," float shadows = 1.0 - smoothstep(0.0, 0.6, luma);"," float highlights = smoothstep(0.4, 1.0, luma);"," float midtones = max(0.0, 1.0 - shadows - highlights);"," float total = max(shadows + midtones + highlights, 0.0001);"," vec3 weights = vec3(shadows, midtones, highlights) / total;"," color += wheelDirection(u_shadowWheel.x) * u_shadowWheel.y * weights.x * 0.18;"," color += wheelDirection(u_midtoneWheel.x) * u_midtoneWheel.y * weights.y * 0.18;"," color += wheelDirection(u_highlightWheel.x) * u_highlightWheel.y * weights.z * 0.18;"," color += u_shadowWheel.z * weights.x * 0.25;"," color += u_midtoneWheel.z * weights.y * 0.25;"," color += u_highlightWheel.z * weights.z * 0.25;"," return color;","}","#ifdef HF_STAGE_RGB_CURVES","vec3 applyRgbCurves(vec3 color){"," if (u_rgbCurvesEnabled < 0.5) return color;"," vec3 master = vec3("," sampleAdvancedCurve(color.r, 0.0).a,"," sampleAdvancedCurve(color.g, 0.0).a,"," sampleAdvancedCurve(color.b, 0.0).a"," );"," return vec3("," sampleAdvancedCurve(master.r, 0.0).r,"," sampleAdvancedCurve(master.g, 0.0).g,"," sampleAdvancedCurve(master.b, 0.0).b"," );","}","#else","vec3 applyRgbCurves(vec3 color){ return color; }","#endif","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","#ifdef HF_STAGE_HUE_CURVES","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleHueCurve(hsv.x).rgb;"," float originalLuma = lumaOf(color);"," hsv.x = fract(hsv.x + decodeSigned(curves.r) * 0.5);"," hsv.y = clamp(hsv.y * max(0.0, 1.0 + decodeSigned(curves.g)), 0.0, 1.0);"," vec3 shifted = hsvToRgb(hsv);"," shifted += vec3(originalLuma - lumaOf(shifted) + decodeSigned(curves.b));"," return shifted;","}","#else","vec3 applyHueCurves(vec3 color){ return color; }","#endif","float softRangeMask(float value, float minimum, float maximum, float softness){"," if (value < minimum) {"," if (softness <= 0.0) return 0.0;"," return smoothstep(minimum - softness, minimum, value);"," }"," if (value > maximum) {"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(maximum, maximum + softness, value);"," }"," return 1.0;","}","float hueRangeMask(float hue, float saturation, vec3 key){"," float distance = abs(fract(hue - key.x + 0.5) - 0.5) * 360.0;"," float range = key.y * 180.0;"," float softness = key.z * 180.0;"," if (range < 179.999 && saturation < 0.001) return 0.0;"," if (distance <= range) return 1.0;"," if (softness <= 0.0) return 0.0;"," return 1.0 - smoothstep(range, range + softness, distance);","}","vec3 applySecondary(vec3 color, float index){"," float base = index * 5.0;"," vec4 hueKey = advancedConfig(base);"," vec4 saturationKey = advancedConfig(base + 1.0);"," vec4 lumaKey = advancedConfig(base + 2.0);"," vec4 correction = advancedConfig(base + 3.0);"," vec4 tintCorrection = advancedConfig(base + 4.0);"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," float luma = lumaOf(color);"," float mask = hueRangeMask(hsv.x, hsv.y, hueKey.rgb);"," mask *= softRangeMask(hsv.y, saturationKey.x, saturationKey.y, saturationKey.z * 0.5);"," mask *= softRangeMask(luma, lumaKey.x, lumaKey.y, lumaKey.z * 0.5);"," if (mask <= 0.0) return color;"," hsv.x = fract(hsv.x + decodeSigned(correction.x) * 0.5);"," vec3 corrected = hsvToRgb(hsv);"," float correctedLuma = lumaOf(corrected);"," corrected = mix(vec3(correctedLuma), corrected, max(0.0, 1.0 + decodeSigned(correction.y)));"," corrected += vec3(decodeSigned(correction.z));"," float temperature = decodeSigned(correction.w);"," float tint = decodeSigned(tintCorrection.x);"," corrected.r += temperature * 0.08 + tint * 0.04;"," corrected.b -= temperature * 0.08 - tint * 0.04;"," corrected.g -= tint * 0.08;"," return mix(color, corrected, mask);","}","vec3 applyAdvancedGrade(vec3 color){"," color = applyTonalWheels(color);"," color = applyRgbCurves(color);"," color = applyHueCurves(color);","#ifdef HF_STAGE_SECONDARIES"," if (u_secondaryCount > 0.5) color = applySecondary(color, 0.0);"," if (u_secondaryCount > 1.5) color = applySecondary(color, 1.0);"," if (u_secondaryCount > 2.5) color = applySecondary(color, 2.0);"," if (u_secondaryCount > 3.5) color = applySecondary(color, 3.0);","#endif"," return color;","}","vec3 sampleLut(float r, float g, float b){"," float size = max(u_lutSize, 2.0);"," float x = (r + b * size + 0.5) / max(u_lutTextureSize.x, 1.0);"," float y = (g + 0.5) / max(u_lutTextureSize.y, 1.0);"," return texture2D(u_lut, vec2(x, y)).rgb;","}","#ifdef HF_STAGE_LUT","vec3 applyLut(vec3 color){"," if (u_lutEnabled < 0.5) return color;"," float size = max(u_lutSize, 2.0);"," vec3 span = max(u_lutDomainMax - u_lutDomainMin, vec3(0.00001));"," vec3 scaled = clamp((color - u_lutDomainMin) / span, 0.0, 1.0) * (size - 1.0);"," vec3 lo = floor(scaled);"," vec3 hi = min(lo + 1.0, vec3(size - 1.0));"," vec3 f = scaled - lo;"," vec3 c000 = sampleLut(lo.r, lo.g, lo.b);"," vec3 c100 = sampleLut(hi.r, lo.g, lo.b);"," vec3 c010 = sampleLut(lo.r, hi.g, lo.b);"," vec3 c110 = sampleLut(hi.r, hi.g, lo.b);"," vec3 c001 = sampleLut(lo.r, lo.g, hi.b);"," vec3 c101 = sampleLut(hi.r, lo.g, hi.b);"," vec3 c011 = sampleLut(lo.r, hi.g, hi.b);"," vec3 c111 = sampleLut(hi.r, hi.g, hi.b);"," vec3 c00 = mix(c000, c100, f.r);"," vec3 c10 = mix(c010, c110, f.r);"," vec3 c01 = mix(c001, c101, f.r);"," vec3 c11 = mix(c011, c111, f.r);"," vec3 c0 = mix(c00, c10, f.g);"," vec3 c1 = mix(c01, c11, f.g);"," vec3 lutColor = mix(c0, c1, f.b);"," return mix(color, lutColor, clamp(u_lutIntensity, 0.0, 1.0));","}","#else","vec3 applyLut(vec3 color){ return color; }","#endif","vec3 applyPrimaryGrade(vec3 color){"," color *= pow(2.0, u_exposure);"," float y = lumaOf(color);"," float shadowMask = 1.0 - smoothstep(0.0, 0.65, y);"," float highlightMask = smoothstep(0.35, 1.0, y);"," color += u_shadows * 0.35 * shadowMask;"," color += u_highlights * 0.35 * highlightMask;"," float blackPoint = clamp(u_blacks * 0.18, -0.18, 0.18);"," float whitePoint = clamp(1.0 - u_whites * 0.18, 0.82, 1.18);"," color = (color - blackPoint) / max(whitePoint - blackPoint, 0.2);"," color.r += u_temperature * 0.08 + u_tint * 0.04;"," color.b -= u_temperature * 0.08 - u_tint * 0.04;"," color.g -= u_tint * 0.08;"," color = (color - 0.5) * max(0.0, 1.0 + u_contrast) + 0.5;"," float satLuma = lumaOf(color);"," float currentSat = clamp(colorSaturation(color), 0.0, 1.0);"," float skinLike = smoothstep(0.02, 0.18, color.r - color.g) * smoothstep(0.0, 0.16, color.g - color.b) * smoothstep(0.18, 0.82, satLuma);"," float vibranceWeight = (1.0 - currentSat * 0.72) * mix(1.0, 0.55, skinLike);"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_vibrance * vibranceWeight));"," color = mix(vec3(satLuma), color, max(0.0, 1.0 + u_saturation));"," return color;","}","vec3 applyColorGrade(vec3 color){"," color = applyPrimaryGrade(color);"," color = applyAdvancedGrade(color);"," return clamp(applyLut(clamp(color, 0.0, 1.0)), 0.0, 1.0);","}","#ifdef HF_STAGE_DITHER","vec3 applyDither(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float pixelSize = mix(1.0, 5.0, clamp(u_ditherSize, 0.0, 1.0)) * scale;"," vec2 block = floor(gl_FragCoord.xy / max(pixelSize, 1.0));"," float levels = clamp(u_paletteSize, 2.0, 6.0);"," float index = floor(clamp(lumaOf(source) * (levels - 1.0) + bayer4(block), 0.0, levels - 1.0));"," return mix(source, paletteColor(index), amount);","}","#else","vec3 applyDither(vec3 source, float amount){ return source; }","#endif","vec2 asciiEdgeDirection(vec2 uv, vec2 stepUv){"," float topLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, -stepUv.y)).rgb);"," float top = bt601Luma(sampleMedia(uv + vec2(0.0, -stepUv.y)).rgb);"," float topRight = bt601Luma(sampleMedia(uv + vec2(stepUv.x, -stepUv.y)).rgb);"," float left = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, 0.0)).rgb);"," float right = bt601Luma(sampleMedia(uv + vec2(stepUv.x, 0.0)).rgb);"," float bottomLeft = bt601Luma(sampleMedia(uv + vec2(-stepUv.x, stepUv.y)).rgb);"," float bottom = bt601Luma(sampleMedia(uv + vec2(0.0, stepUv.y)).rgb);"," float bottomRight = bt601Luma(sampleMedia(uv + stepUv).rgb);"," float x = -topLeft - 2.0 * left - bottomLeft + topRight + 2.0 * right + bottomRight;"," float y = -topLeft - 2.0 * top - topRight + bottomLeft + 2.0 * bottom + bottomRight;"," return vec2(x, y);","}","vec2 rotateAsciiUv(vec2 uv, float angle){"," float cosine = cos(angle);"," float sine = sin(angle);"," vec2 centered = uv - 0.5;"," return vec2(centered.x * cosine - centered.y * sine, centered.x * sine + centered.y * cosine) + 0.5;","}","#ifdef HF_STAGE_ASCII","vec3 applyAscii(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float scale = max(min(u_resolution.x, u_resolution.y) / 540.0, 0.25);"," float cellHeight = mix(4.0, 80.0, clamp(u_asciiSize, 0.0, 1.0)) * scale;"," vec2 cellSize = vec2(cellHeight);"," vec2 cell = floor(gl_FragCoord.xy / cellSize);"," vec2 cellVuv = (cell + 0.5) * cellSize / max(u_resolution, vec2(1.0));"," vec2 cellUv = (cellVuv - u_uvOffset) / u_uvScale;"," cellUv = applyCrtWarp(cellUv);"," vec3 cellColor = applyColorGrade(sampleMedia(cellUv).rgb);"," float brightness = bt601Luma(cellColor);"," float invert = step(0.5, u_asciiInvert);"," brightness = mix(brightness, 1.0 - brightness, invert);"," vec2 glyphUv = fract(gl_FragCoord.xy / cellSize);"," float rotation = clamp(u_asciiRotation, 0.0, 1.0);"," if (rotation > 0.0) {"," vec2 cellStepUv = cellSize / max(u_resolution * u_uvScale, vec2(1.0));"," vec2 edge = asciiEdgeDirection(cellUv, cellStepUv);"," if (length(edge) > 0.1) glyphUv = mix(glyphUv, rotateAsciiUv(glyphUv, atan(edge.y, edge.x)), rotation);"," }"," float ink = asciiStyleSample(floor(u_asciiStyle + 0.5), brightness, glyphUv);"," vec3 background = paletteColor(0.0);"," vec3 inkColor = mix(paletteColor(max(u_paletteSize - 1.0, 1.0)), cellColor, clamp(u_asciiColor, 0.0, 1.0));"," vec3 asciiColor = mix(background, inkColor, ink);"," return mix(source, asciiColor, amount);","}","#else","vec3 applyAscii(vec3 source, float amount){ return source; }","#endif","#ifdef HF_STAGE_SCANLINES","vec3 applyScanlines(vec3 source, float amount){"," if (amount <= 0.0) return source;"," float count = mix(50.0, 500.0, clamp(u_scanlineCount, 0.0, 1.0));"," float softness = clamp(u_scanlineSoftness, 0.0, 1.0);"," float wave = 0.5 + 0.5 * sin(v_uv.y * count * PI);"," float line = mix(1.0 - wave, pow(1.0 - wave, 2.2), softness);"," return source * (1.0 - line * amount);","}","#else","vec3 applyScanlines(vec3 source, float amount){ return source; }","#endif","void main(){"," vec2 uv = (v_uv - u_uvOffset) / u_uvScale;"," if (uv.x < 0.0 || uv.y < 0.0 || uv.x > 1.0 || uv.y > 1.0) {"," gl_FragColor = vec4(0.0);"," return;"," }"," vec4 originalSample = sampleSource(uv);"," uv = applyCrtWarp(uv);","#ifdef HF_STAGE_CRT"," vec2 displayEdge = smoothstep(vec2(0.0), vec2(0.006), uv) * (1.0 - smoothstep(vec2(0.994), vec2(1.0), uv));"," float displayMask = displayEdge.x * displayEdge.y;","#endif"," vec4 sampleColor = sampleMedia(uv);"," sampleColor = sampleChromaticMedia(uv, sampleColor);"," sampleColor.rgb = applyDigitalGlitch(uv, sampleColor.rgb);"," vec3 original = originalSample.rgb;"," vec3 color = mix(sampleColor.rgb, applyColorGrade(sampleColor.rgb), u_intensity);","#ifdef HF_STAGE_GRAIN"," float grainAmount = clamp(u_grain, 0.0, 1.0);"," if (grainAmount > 0.0) {"," float grainPixelSize = mix(1.0, 6.0, clamp(u_grainSize, 0.0, 1.0));"," vec2 grainCoord = floor(gl_FragCoord.xy / grainPixelSize) + vec2(u_grainSeed, u_grainSeed * 1.37);"," float grainBase = grainHash(grainCoord) - grainHash(grainCoord + vec2(19.19, 73.31));"," float grainFine = grainHash(gl_FragCoord.xy + vec2(u_grainSeed * 2.11, u_grainSeed * 0.71)) - 0.5;"," float grain = mix(grainBase * 0.7, grainBase + grainFine * 0.35, clamp(u_grainRoughness, 0.0, 1.0));"," float grainLuma = lumaOf(color);"," float grainMask = smoothstep(0.02, 0.55, grainLuma) * (1.0 - smoothstep(0.88, 1.0, grainLuma));"," color += grain * grainAmount * mix(0.025, 0.08, grainMask);"," }","#endif","#ifdef HF_STAGE_FILM_ARTIFACTS"," float filmArtifacts = clamp(u_filmArtifacts, 0.0, 1.0);"," if (filmArtifacts > 0.0) {"," float filmFrame = floor(u_grainSeed);"," float dust = dustMask(v_uv, floor(filmFrame / 3.0));"," float dustTone = grainHash(vec2(floor(filmFrame / 3.0), 8.0));"," color = mix(color, vec3(dustTone > 0.5 ? 0.95 : 0.02), dust * 0.72 * filmArtifacts);"," float scratchBucket = floor(filmFrame / 12.0);"," float scratchX = grainHash(vec2(scratchBucket, 4.2));"," float scratchLife = step(0.78, grainHash(vec2(scratchBucket, 8.4)));"," float scratch = (1.0 - smoothstep(0.0, 1.4 / max(u_resolution.x, 1.0), abs(v_uv.x - scratchX))) * scratchLife;"," color = mix(color, vec3(0.94, 0.88, 0.76), scratch * 0.28 * filmArtifacts);"," }","#endif"," color = applyMonoScreen(clamp(color, 0.0, 1.0), clamp(u_monoScreen, 0.0, 1.0));"," color = applyEngraving(clamp(color, 0.0, 1.0), clamp(u_engraving, 0.0, 1.0));"," color = applyCrosshatch(uv, clamp(color, 0.0, 1.0), clamp(u_crosshatch, 0.0, 1.0));"," color = applyHalftone(clamp(color, 0.0, 1.0), clamp(u_halftone, 0.0, 1.0));"," color = applyTwoInkPrint(clamp(color, 0.0, 1.0), clamp(u_twoInkPrint, 0.0, 1.0));"," color = applyDither(clamp(color, 0.0, 1.0), clamp(u_dither, 0.0, 1.0));"," color = applyAscii(clamp(color, 0.0, 1.0), clamp(u_ascii, 0.0, 1.0));","#ifdef HF_STAGE_BLOOM"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;","#endif"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));","#ifdef HF_STAGE_VIGNETTE"," vec2 vignetteAspect = u_resolution.x > u_resolution.y"," ? vec2(u_resolution.x / max(u_resolution.y, 1.0), 1.0)"," : vec2(1.0, u_resolution.y / max(u_resolution.x, 1.0));"," vec2 vignetteUv = abs((v_uv - vec2(0.5)) * 2.0) * vignetteAspect;"," float vignettePower = mix(8.0, 1.8, clamp(u_vignetteRoundness * 0.5 + 0.5, 0.0, 1.0));"," float vignetteDistance = pow(pow(vignetteUv.x, vignettePower) + pow(vignetteUv.y, vignettePower), 1.0 / vignettePower);"," float vignetteMidpoint = mix(0.22, 1.08, clamp(u_vignetteMidpoint, 0.0, 1.0));"," float vignetteFeather = mix(0.08, 0.72, clamp(u_vignetteFeather, 0.0, 1.0));"," float vignetteMask = smoothstep(vignetteMidpoint, vignetteMidpoint + vignetteFeather, vignetteDistance);"," color *= 1.0 - vignetteMask * clamp(u_vignette, 0.0, 1.0) * 0.75;","#endif","#ifdef HF_STAGE_CRT"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);","#endif"," vec3 graded = clamp(color, 0.0, 1.0);","#ifdef HF_STAGE_COMPARE"," if (u_compareEnabled > 0.5) {"," float pos = clamp(u_comparePosition, 0.0, 1.0);"," float softness = max(u_compareSoftness, 0.00001);"," float afterMask = smoothstep(pos - softness, pos + softness, v_uv.x);"," vec3 splitColor = mix(original, graded, afterMask);"," float lineMask = 0.0;"," if (u_compareLineWidth > 0.0) {"," float lineWidth = max(u_compareLineWidth / max(u_resolution.x, 1.0), 0.00001);"," lineMask = 1.0 - smoothstep(lineWidth, lineWidth * 1.8, abs(v_uv.x - pos));"," }"," gl_FragColor = vec4(mix(splitColor, vec3(1.0), lineMask * 0.82), sampleColor.a);"," return;"," }","#endif"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`\n`),dA=[["HF_STAGE_BLUR",e=>e.effects.blur>0],["HF_STAGE_KUWAHARA",e=>e.effects.kuwahara>0],["HF_STAGE_PIXELATE",e=>e.effects.pixelate>0],["HF_STAGE_TAPE",e=>e.effects.tapeDamage>0],["HF_STAGE_CHROMA_BLEED",e=>e.effects.chromaBleed>0],["HF_STAGE_CHROMATIC",e=>e.effects.chromaticAberration>0],["HF_STAGE_CRT",e=>e.effects.crtCurvature>0],["HF_STAGE_GLITCH",e=>e.effects.digitalGlitch>0],["HF_STAGE_GRAIN",e=>e.details.grain>0],["HF_STAGE_FILM_ARTIFACTS",e=>e.effects.filmArtifacts>0],["HF_STAGE_MONO_SCREEN",e=>e.effects.monoScreen>0],["HF_STAGE_ENGRAVING",e=>e.effects.engraving>0],["HF_STAGE_CROSSHATCH",e=>e.effects.crosshatch>0],["HF_STAGE_HALFTONE",e=>e.effects.halftone>0],["HF_STAGE_TWO_INK_PRINT",e=>e.effects.twoInkPrint>0],["HF_STAGE_DITHER",e=>e.effects.dither>0],["HF_STAGE_ASCII",e=>e.effects.ascii>0],["HF_STAGE_BLOOM",e=>e.effects.bloom>0],["HF_STAGE_SCANLINES",e=>e.effects.scanlines>0],["HF_STAGE_VIGNETTE",e=>e.details.vignette>0],["HF_STAGE_RGB_CURVES",e=>cu(e).rgbCurvesEnabled],["HF_STAGE_HUE_CURVES",e=>cu(e).hueCurvesEnabled],["HF_STAGE_SECONDARIES",e=>cu(e).secondaryCount>0],["HF_STAGE_LUT",e=>e.lut!==null],["HF_STAGE_COMPARE",(e,t)=>t.enabled]];function SI(e,t){let n="";for(let[r,o]of dA)o(e,t)&&(n+=`#define ${r}\n`);return n}var Zv=dA.map(([e])=>`#define ${e}\n`).join(""),fA=32,EI=fA,vI=["#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(`\n`),AI=["#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(`\n`),wI=["#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(`\n`),eA=Yi.flatMap(e=>[`${e}[${To}]`,`${e}[${lu}]`]).join(", ");function nr(e){return Te(e)&&Yi.includes(e.localName)}function _I(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function tA(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:($("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function mu(e,t=cA){let n=tA(e,xI,e.VERTEX_SHADER),r=tA(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let o=e.createProgram();return o?(e.attachShader(o,n),e.attachShader(o,r),e.linkProgram(o),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(o,e.LINK_STATUS)?o:($("runtime.colorGrading.linkProgram",e.getProgramInfoLog(o)),e.deleteProgram(o),null)):null}function uu(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 TI(e,t){let n=mu(e,vI);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 CI(e,t){let n=mu(e,AI);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 RI(e,t){let n=mu(e,wI);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 Aa(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=uu(e,n,t),o=e.createFramebuffer();if(!r||!o)return r&&e.deleteTexture(r),o&&e.deleteFramebuffer(o),null;e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let i=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),i!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(o),null):{texture:r,framebuffer:o,type:t,width:1,height:1}}function du(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 km(e,t,n){let r=[];for(let o of n){let i=e.getUniformLocation(t,`u_${o}`);i!==null&&r.push([o,i])}return r}function nA(e,t){for(let n of t)n&&e.deleteTexture(n)}function mA(e,t){let n=mu(e,t+cA);return n?{program:n,position:e.getAttribLocation(n,"a_pos"),source:e.getUniformLocation(n,"u_source"),blurSource:e.getUniformLocation(n,"u_blurSource"),bloomSource:e.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:e.getUniformLocation(n,"u_kuwaharaSource"),lut:e.getUniformLocation(n,"u_lut"),advanced:e.getUniformLocation(n,"u_advanced"),resolution:e.getUniformLocation(n,"u_resolution"),uvScale:e.getUniformLocation(n,"u_uvScale"),uvOffset:e.getUniformLocation(n,"u_uvOffset"),blurReady:e.getUniformLocation(n,"u_blurReady"),bloomReady:e.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:e.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:e.getUniformLocation(n,"u_lutEnabled"),lutSize:e.getUniformLocation(n,"u_lutSize"),lutTextureSize:e.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:e.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:e.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:e.getUniformLocation(n,"u_lutIntensity"),shadowWheel:e.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:e.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:e.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:e.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:e.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:e.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:km(e,n,Ml),detailUniforms:km(e,n,Tf),effectUniforms:km(e,n,Cf),grainSeed:e.getUniformLocation(n,"u_grainSeed"),effectTime:e.getUniformLocation(n,"u_effectTime"),paletteSize:e.getUniformLocation(n,"u_paletteSize"),palette0:e.getUniformLocation(n,"u_palette0"),palette1:e.getUniformLocation(n,"u_palette1"),palette2:e.getUniformLocation(n,"u_palette2"),palette3:e.getUniformLocation(n,"u_palette3"),palette4:e.getUniformLocation(n,"u_palette4"),palette5:e.getUniformLocation(n,"u_palette5"),intensity:e.getUniformLocation(n,"u_intensity"),compareEnabled:e.getUniformLocation(n,"u_compareEnabled"),comparePosition:e.getUniformLocation(n,"u_comparePosition"),compareSoftness:e.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:e.getUniformLocation(n,"u_compareLineWidth")}:null}function MI(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=pu(t);return n?{gl:t,program:n}:null}function pu(e){let t=mA(e,"");if(!t)return null;let n=kI(e);return n?{...n,shaders:new Map([["",t]]),failedStageDefines:new Set}:(e.deleteProgram(t.program),null)}function kI(e){let t=uu(e),n=uu(e,e.NEAREST),r=uu(e,e.NEAREST);if(!t||!n||!r)return nA(e,[t,n,r]),null;let o=e.createBuffer();return o?(e.bindBuffer(e.ARRAY_BUFFER,o),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),{texture:t,lutTexture:n,advancedTexture:r,advancedSignature:null,quad:o}):(nA(e,[t,n,r]),null)}function pA(e,t,n,r){let o=hA(e,t,SI(n,r));return e.useProgram(o.program),o}function hA(e,t,n){let r=t.failedStageDefines.has(n)?Zv:n;if(t.failedStageDefines.has(r))throw new Error("Color grading shader failed to compile");let o=t.shaders.get(r);if(o)return t.shaders.delete(r),t.shaders.set(r,o),o;let i=mA(e,r);if(!i)return t.failedStageDefines.add(r),hA(e,t,Zv);if(t.shaders.size>=EI)for(let[a,l]of t.shaders){e.deleteProgram(l.program),t.shaders.delete(a);break}return t.shaders.set(r,i),i}function LI(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function NI(e){if(!LI(e))return{...Wr};let t=(n,r,o,i)=>{let a=typeof n=="number"?n:Number(n);return Math.min(i,Math.max(o,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,Wr.position,0,1),softness:t(e.softness,Wr.softness,0,.25),lineWidth:t(e.lineWidth,Wr.lineWidth,0,12)}}function gA(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 hu(e){return e instanceof Error?e.message:"LUT failed to load"}function FI(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 bA(e){let t=e.id||!sn(e)&&e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return FI(t)}function Pm(e){let t=gA(e);if("error"in t)return{state:"error",message:t.error};let n=yn.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(i=>{if(!i.ok)throw new Error(`Failed to load LUT (${i.status})`);return i.text()}).then(i=>Fx(i,{maxSize:Tl})),o={state:"pending",promise:r};for(;yn.size>=mI;){let i=yn.keys().next().value;if(!i)break;yn.delete(i)}return yn.set(t.href,o),r.then(i=>{yn.get(t.href)===o&&yn.set(t.href,{state:"ready",lut:i})},i=>{yn.get(t.href)===o&&yn.set(t.href,{state:"error",message:hu(i)})}),o}function rA(e,t,n){if(e.lut?.src===t)return e.lut;let{gl:r,program:o}=e,i=bf(n,r.getParameter(r.MAX_TEXTURE_SIZE)),a=gf(i);try{return yA(r,o.lutTexture,a),e.lut={src:t,size:i.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:a.width,textureHeight:a.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(l){return e.lut=null,e.lutError=hu(l),e.lutLoadingSrc=null,$("runtime.colorGrading.uploadLut",l),null}}async function PI(e){let t=Pm(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function yA(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 II(e,t,n){let{gl:r,program:o}=e,i=bf(n,r.getParameter(r.MAX_TEXTURE_SIZE)),a=gf(i);return yA(r,o.lutTexture,a),{src:t,size:i.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:a.width,textureHeight:a.height}}function en(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Im(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),en(e.gl,t.scratch),en(e.gl,t.blur),t.bloom&&en(e.gl,t.bloom),e.effectTargets=null)}function Dm(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),en(e.gl,t.moments),en(e.gl,t.output),e.kuwaharaTargets=null)}function va(e,t=!1){Im(e),Dm(e),DI(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function DI(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad);for(let n of t.shaders.values())e.deleteProgram(n.program);t.shaders.clear()}function OI(e){let t=pu(e.gl);return t?(va(e),e.program=t,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function HI(e,t){let n=pu(t.gl);return n?(va(e),e.gl=t.gl,e.glCanvas=t.canvas,e.program=n,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function GI(e,t){e.contextLost=!HI(e,t),e.drawError=e.contextLost?"WebGL context rebuild failed":null,e.contextLost?wa(e):dt(e)}function BI(e,t){e.borderlessFrame!==t&&xA(e),e.borderlessFrame=t,t.style.borderStyle="none"}function xA(e){let t=e.borderlessFrame;t&&(e.borderlessFrame=null,t.style.borderStyle=window.getComputedStyle(e.element).borderStyle)}function wa(e){if(xA(e),!e.sourceHidden)return;e.element.removeAttribute(Pr);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 UI(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=TI(t,e.program.quad),r=Aa(t),o=Aa(t);return!n||!r||!o?(n&&t.deleteProgram(n.program),r&&en(t,r),o&&en(t,o),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:o,bloom:null},e.effectTargets)}function WI(e,t){return t.bloom||(t.bloom=Aa(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function oA(e){let t=e.effectTargets;t?.bloom&&(en(e.gl,t.bloom),t.bloom=null)}function VI(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 o=CI(t,e.program.quad),i=RI(t,e.program.quad),a=Aa(t,n.HALF_FLOAT_OES,t.NEAREST),l=Aa(t);return!o||!i||!a||!l?($I(t,o,i,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:o,resolveProgram:i,moments:a,output:l},e.kuwaharaTargets)}function $I(e,t,n,r,o){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&en(e,r),o&&en(e,o)}function SA(e,t,n,r,o){let i=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(o));return du(e,t,i,a),du(e,n,i,a),{width:i,height:a}}function fu(e,t,n,r,o,i,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,o.width,o.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,o.width,o.height),e.uniform2f(t.direction,i.x,i.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),_a(e,t)}function qI(e,t,n,r,o,i,a){let l=SA(e,t.scratch,r,o/2,i/2),s=a/2;fu(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),fu(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function zI(e,t,n,r,o,i,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)fu(e,t.blurProgram,l,t.scratch,o,{x:1,y:0},i),fu(e,t.blurProgram,t.scratch.texture,r,o,{x:0,y:1},i),l=r.texture}function _a(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 jI(e,t,n,r,o,i,a,l){du(e,t.moments,o.width,o.height),du(e,t.output,o.width,o.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,o.width,o.height),e.useProgram(s.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,r),e.uniform1i(s.source,0),e.uniform1i(s.blurSource,1),e.uniform2f(s.texel,1/o.width,1/o.height),e.uniform2f(s.uvScale,i.scaleX,i.scaleY),e.uniform2f(s.uvOffset,i.offsetX,i.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),_a(e,s);let c=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(c.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(c.moments,0),e.uniform2f(c.texel,1/o.width,1/o.height),e.uniform1f(c.radius,l.kuwaharaRadius),e.uniform1f(c.sharpness,l.kuwaharaSharpness),e.uniform1f(c.saturation,l.kuwaharaSaturation),_a(e,c)}function KI(e,t,n,r){if(n<=0)return!1;let o=SA(e.gl,t.scratch,t.blur,r.width,r.height);return zI(e.gl,t,e.program.texture,t.blur,o,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function YI(e,t,n,r,o,i){if(n<=0)return oA(e),null;i||oA(e);let a=i?WI(e,t):t.blur;return a?(qI(e.gl,t,e.program.texture,a,o.width,o.height,r),a.texture):null}function XI(e,t,n,r){let{program:o}=e,i=t.effects.blur,a=t.effects.bloom;if(i<=0&&a<=0)return e.effectTargets&&r&&Im(e),{blurReady:!1,bloomReady:!1,blurTexture:o.texture,bloomTexture:o.texture};let l=UI(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:o.texture,bloomTexture:o.texture};let s=KI(e,l,i,n),c=YI(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:c!==null,blurTexture:l.blur.texture,bloomTexture:c??o.texture}}function JI(e,t,n,r,o,i,a){let l=t.effects.kuwahara;if(l<=0&&!i)return e.kuwaharaTargets&&a&&Dm(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=VI(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(jI(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,o,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function EA(e,t,n,r,o={}){let i=o.releaseIdleTargets??!0;e.effectError=null;let a=XI(e,t,n,i),l=JI(e,t,n,r,a.blurReady,o.preserveKuwahara??!1,i);return{...a,...l}}function QI(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=gA(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 o=Pm(t);return o.state==="ready"?rA(e,r.href,o.lut):o.state==="error"?(e.lutError=o.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,o.promise.then(i=>{e.destroyed||e.grading.lut?.src.trim()!==t||(rA(e,r.href,i),dt(e))},i=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=hu(i),e.lutLoadingSrc=null,dt(e))})),null)}function Ea(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&&nr(n))return n;try{let r=document.querySelector(t);return r&&nr(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&nr(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&nr(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&&nr(r)?r:null}catch{return null}}function Om(e){let[t,n]=Re(e)?[e.videoWidth,e.videoHeight]:et(e)?[e.naturalWidth,e.naturalHeight]:sn(e)?[e.width,e.height]:[0,0];return t>0&&n>0?{width:t,height:n}:null}function vA(e){return Re(e)&&e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||et(e)&&!e.complete?!1:Om(e)!==null}function ZI(e){let t=It(e);return t&&vA(t)?t:null}function Lm(e){return _I(e)||eD(e)}function eD(e){if(!Re(e))return!1;let t=It(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function tD(e){return et(e)&&e.classList.contains("__render_frame__")}function nD(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}var iA=new WeakMap;function AA(e,t){if(!et(e)||window.origin!=="null"||e.crossOrigin!==null||!/^https?:/i.test(e.currentSrc))return e;let n=iA.get(e);if(n?.image.src!==e.currentSrc){let r={image:e.ownerDocument.createElement("img"),waiting:new Set},o=()=>{let i=[...r.waiting];r.waiting.clear(),i.forEach(dt)};r.image.crossOrigin="anonymous",r.image.addEventListener("load",o,{once:!0}),r.image.addEventListener("error",o,{once:!0}),r.image.src=e.currentSrc,iA.set(e,n=r)}return n.image.complete?n.image.naturalWidth>0?n.image:e:(t&&n.waiting.add(t),null)}function wA(e){if(Re(e)){let t=ZI(e);if(t)return t}return vA(e)?e:null}function aA(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 rD(e){let t=e.trim().split(/\\s+/).filter(Boolean),n=.5,r=.5;for(let o=0;o<t.length;o++){let i=t[o]??"",a=aA(i,"x"),l=aA(i,"y");if(a!==null&&(i==="left"||i==="right"||i.endsWith("%")&&o===0)){n=a;continue}if(l!==null&&(i==="top"||i==="bottom"||i.endsWith("%")&&o>0)){r=l;continue}}return{x:n,y:r}}function _A(e,t,n,r,o,i){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=o||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let g=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*g,s=r*g,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let c=rD(i||"center"),d=(e-l)*c.x/e,f=1-c.y,m=(t-s)*f/t;return{scaleX:l/e,scaleY:s/t,offsetX:d,offsetY:m}}function oD(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function sA(e,t){return Math.max(0,Math.round(e>0?e:t))}function iD(e,t){let n=Math.min(1,Math.sqrt(dI/(e*t)),fI/Math.max(e,t)),r={width:Math.floor(e*n),height:Math.floor(t*n)};return n<1?r:{width:Math.round(e),height:Math.round(t)}}function aD(e,t){let{element:n,canvas:r}=e,o=n.parentElement;o&&oD(e,o);let i=window.getComputedStyle(t);Z0(r.style,i),r.style.borderStyle="none",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(),l=sA(n.offsetWidth,a.width),s=sA(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let c=Math.max(1,window.devicePixelRatio||1),{width:d,height:f}=iD(l*c,s*c);return r.width!==d&&(r.width=d),r.height!==f&&(r.height=f),{width:d,height:f}}function Fo(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 Ur(e,t,n,r){e.set(r,(t*Jt+n)*4)}function rr(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function Nm(e,t,n){return e.length>=3?xf(e,t,n):new Float32Array(Jt)}function Br(e,t){return e[t]??0}function sD(e,t,n){let r=Ao(t.red),o=Ao(t.green),i=Ao(t.blue),a=Ao(t.master),l=Nm(n.hueVsHue,-180,180),s=Nm(n.hueVsSaturation,-1,1),c=Nm(n.hueVsLuma,-1,1);for(let d=0;d<Jt;d+=1)Ur(e,0,d,[Br(r,d),Br(o,d),Br(i,d),Br(a,d)]),Ur(e,1,d,[rr(Br(l,d),180),rr(Br(s,d),1),rr(Br(c,d),1),1])}function lD(e,t,n){let r=n*bI;Ur(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),Ur(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),Ur(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),Ur(e,2,r+3,[rr(t.correction.hueShift,180),rr(t.correction.saturation,1),rr(t.correction.luma,1),rr(t.correction.temperature,1)]),Ur(e,2,r+4,[rr(t.correction.tint,1),.5,.5,1])}function uD(e,t,n){let r=new Float32Array(Jt*Ta*4);sD(r,e,t);let o=0;for(let i of n)i.enabled&&(lD(r,i,o),o+=1);return r}var lA=new WeakMap;function cD(e,t,n){let r=lA.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let o=JSON.stringify([e,t,n]);return lA.set(e,{hueCurves:t,secondaries:n,signature:o}),o}function dD(e,t,n,r){let{curves:o,hueCurves:i}=n,a=cD(o,i,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(uD(o,i,r),ji);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,Jt,Ta,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Fm(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function cu(e){let{curves:t,hueCurves:n,secondaries:r}=e;return{rgbCurvesEnabled:kf(t),hueCurvesEnabled:Lf(n),secondaryCount:Nf(r)?r.reduce((o,i)=>o+Number(i.enabled),0):0}}function TA(e,t,n,r,o,i,a,l,s,c,d,f,m){e.uniform1i(n.source,0),e.uniform1i(n.blurSource,1),e.uniform1i(n.lut,2),e.uniform1i(n.kuwaharaSource,3),e.uniform1i(n.bloomSource,4),e.uniform1i(n.advanced,5),e.uniform2f(n.resolution,c.width,c.height),e.uniform2f(n.uvScale,d.scaleX,d.scaleY),e.uniform2f(n.uvOffset,d.offsetX,d.offsetY),e.uniform1f(n.blurReady,i?1:0),e.uniform1f(n.bloomReady,a?1:0),e.uniform1f(n.kuwaharaReady,l?1:0),e.uniform1f(n.lutEnabled,o?1:0),e.uniform1f(n.lutSize,o?.size??2),e.uniform2f(n.lutTextureSize,o?.textureWidth??1,o?.textureHeight??1),e.uniform3f(n.lutDomainMin,o?.domainMin[0]??0,o?.domainMin[1]??0,o?.domainMin[2]??0),e.uniform3f(n.lutDomainMax,o?.domainMax[0]??1,o?.domainMax[1]??1,o?.domainMax[2]??1),e.uniform1f(n.lutIntensity,r.lut?.intensity??0);let{rgbCurvesEnabled:g,hueCurvesEnabled:h,secondaryCount:y}=cu(r);(g||h||y>0)&&dD(e,t,r,r.secondaries),Fm(e,n.shadowWheel,r.wheels.shadows),Fm(e,n.midtoneWheel,r.wheels.midtones),Fm(e,n.highlightWheel,r.wheels.highlights),e.uniform1f(n.rgbCurvesEnabled,g?1:0),e.uniform1f(n.hueCurvesEnabled,h?1:0),e.uniform1f(n.secondaryCount,y);for(let[v,T]of n.adjustUniforms)e.uniform1f(T,r.adjust[v]);for(let[v,T]of n.detailUniforms)e.uniform1f(T,r.details[v]);e.uniform1f(n.grainSeed,f),e.uniform1f(n.effectTime,m);for(let[v,T]of n.effectUniforms)e.uniform1f(T,r.effects[v]);let S=r.palette??(r.effects.engraving>0||r.effects.crosshatch>0?hI:Mm),E=S[S.length-1]??Mm[1];e.uniform1f(n.paletteSize,S.length),Fo(e,n.palette0,S[0]??Mm[0]),Fo(e,n.palette1,S[1]??E),Fo(e,n.palette2,S[2]??E),Fo(e,n.palette3,S[3]??E),Fo(e,n.palette4,S[4]??E),Fo(e,n.palette5,S[5]??E),e.uniform1f(n.intensity,r.intensity),e.uniform1f(n.compareEnabled,s.enabled?1:0),e.uniform1f(n.comparePosition,s.position),e.uniform1f(n.compareSoftness,s.softness),e.uniform1f(n.compareLineWidth,s.lineWidth)}function fD(e){if(!e.sourceHidden){let t=e.element.getAttribute(Ir);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(Pr,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function xn(e){let t=nS.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var CA=xn("intensity"),RA=xn("lut.intensity"),MA=xn("adjust.exposure"),kA=xn("effects.kuwahara"),LA=[["blur",xn("effects.blur")],["bloom",xn("effects.bloom")],["kuwahara",kA],["pixelate",xn("effects.pixelate")],["ascii",xn("effects.ascii")],["dither",xn("effects.dither")]],NA=[CA,RA,MA,...LA.map(([,e])=>e)];function Vr(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 Po(e,t){return t!==null&&(aS(t)||NA.some(n=>Vr(e,n)!==null))}function mD(e,t){let n=null;for(let[r,o]of LA){let i=Vr(e,o);i!==null&&(n??(n={...t.effects}),n[r]=i)}return n}function pD(e){let{element:t,grading:n}=e,r=Vr(t,CA),o=Vr(t,RA),i=Vr(t,MA),a=mD(t,n);if(![r,o,i].some(c=>c!==null)&&a===null)return n;let s={...n,adjust:i===null?n.adjust:{...n.adjust,exposure:i},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&o!==null&&(s.lut={...n.lut,intensity:o}),s}function FA(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 PA(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[o,i]of r.entries())e.activeTexture(e.TEXTURE0+o),e.bindTexture(e.TEXTURE_2D,i)}function hD(e,t){e.glCanvas!==e.canvas&&(e.glCanvas.width<t.width&&(e.glCanvas.width=t.width),e.glCanvas.height<t.height&&(e.glCanvas.height=t.height))}function gD(e,t){if(e.glCanvas===e.canvas)return;let n=e.canvas.getContext("2d");if(!n)throw new Error("Canvas 2D is unavailable");let{width:r,height:o}=t;n.clearRect(0,0,r,o),n.drawImage(e.glCanvas,0,e.glCanvas.height-o,r,o,0,0,r,o)}function bD(e){let t=wA(e.element),n=t&&AA(t,e);if(!t||!n)return e.hasDrawn||(e.canvas.style.display="none"),null;let r=Om(t);return r?{source:t,pixels:n,size:r}:null}function yD(e){if(e.sourceInlineOpacity===null){e.element.style.removeProperty("opacity");return}e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority||"")}function xD(e){let{style:t}=e.element;return e.sourceHidden&&t.getPropertyValue("opacity")==="0"&&t.getPropertyPriority("opacity")==="important"}function SD(e,t,n){let r=xD(e),o=e.element.style.getPropertyValue("visibility"),i=r&&!n;i&&yD(e);let a=window.getComputedStyle(n?t:e.element);e.sourceOpacityForCanvas=a.opacity||"1",i&&e.element.style.setProperty("opacity","0","important"),e.sourceVisibleForCanvas=(n||o!=="hidden")&&a.visibility!=="hidden"}function ED(e){let t=window.__player?.getTime?.();return typeof t=="number"&&Number.isFinite(t)?Math.max(0,t):Re(e)?Math.max(0,e.currentTime):0}function vD(e,t,n,r){let{gl:o,program:i}=e;hD(e,n);let a=pD(e),l=QI(e);FA(o,i.texture,t);let s=Vr(e.element,kA)!==null,c=EA(e,a,n,r,{preserveKuwahara:s});o.bindFramebuffer(o.FRAMEBUFFER,null),o.viewport(0,0,n.width,n.height);let d=pA(o,i,a,e.compare);PA(o,i,c);let f=ED(e.element),m=e.grainSeed+Math.floor(f*60);if(TA(o,i,d,a,l,c.blurReady,c.bloomReady,c.kuwaharaReady,e.compare,n,r,m,f),_a(o,{quad:i.quad,position:d.position}),o.drawingBufferWidth<n.width||o.drawingBufferHeight<n.height)throw wa(e),e.canvas.style.display="none",new Error("The GPU\'s drawing buffer is smaller than the grading canvas");gD(e,n)}function AD(e,t,n){let r=Te(t)?t:e.element,o=aD(e,r);if(!o)return null;let i=window.getComputedStyle(r),a=_A(o.width,o.height,n.width,n.height,i.objectFit,i.objectPosition);return{layout:o,uv:a}}function dt(e){if(e.destroyed||e.contextLost)return!1;let t=bD(e);if(!t)return!1;let{source:n,pixels:r,size:o}=t,i=tD(n);i&&nD(e,n),SD(e,n,i);let a=AD(e,n,o);if(!a)return!1;let{layout:l,uv:s}=a;try{return vD(e,r,l,s),fD(e),i&&BI(e,n),e.hasDrawn=!0,e.drawError=null,!0}catch(c){return e.drawError=c instanceof Error?c.message:"Shader draw failed",$("runtime.colorGrading.drawEntry",c),!1}}function wD(e,t,n){let r=e.getBoundingClientRect(),o=e.offsetWidth||r.width||t.width,i=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=o>0&&i>0?o/i:t.width/t.height;return l>=1?{width:a,height:Math.max(1,Math.round(a/l))}:{width:Math.max(1,Math.round(a*l)),height:a}}function _D(){let e=document.createElement("canvas"),t=MI(e);return t?{canvas:e,glCanvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function TD(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):Re(e)?Math.max(0,e.currentTime):0}function CD(e,t,n,r){let o=wA(t),i=o&&AA(o,null);if(!o||!i)return null;let a=Om(o);if(!a)return null;let l=wD(t,a,n);e.canvas.width=l.width,e.canvas.height=l.height;let s=Te(o)?o:t,c=window.getComputedStyle(s),d=_A(l.width,l.height,a.width,a.height,c.objectFit,c.objectPosition);return FA(e.gl,e.program.texture,i),{dimensions:l,uv:d,effectTime:TD(t,r),grainSeed:bA(t)+(Re(t)?Math.floor(t.currentTime*60):0)}}async function RD(e,t,n,r,o=!1){let i=CD(e,t,r,o);if(!i)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:c}=i,d=[];for(let f of n.slice(0,fA)){let m=kl(f.grading);if(!m){d.push({id:f.id,dataUrl:null,error:"Invalid grading"});continue}let g=null;try{m.lut&&(e.lut?.src!==m.lut.src&&(e.lut=II(e,m.lut.src,await PI(m.lut.src))),g=e.lut),d.push({id:f.id,dataUrl:MD(e,m,g,a,l,s,c)})}catch(h){d.push({id:f.id,dataUrl:null,error:hu(h)})}}return{...a,images:d}}function MD(e,t,n,r,o,i,a){let{canvas:l,gl:s,program:c}=e,d=EA(e,t,r,o,{releaseIdleTargets:!1});s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height);let f=pA(s,c,t,Wr);return PA(s,c,d),n||(e.lut=null),TA(s,c,f,t,n,d.blurReady,d.bloomReady,d.kuwaharaReady,Wr,r,o,i,a),_a(s,{quad:c.quad,position:f.position}),l.toDataURL("image/png")}function tr(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function kD(e){return sn(e)?!0:Re(e)&&!e.paused&&!e.ended?!1:NA.some(t=>Vr(e,t)!==null)}function LD(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&Re(e.element)&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Io(e){if(e.destroyed||!Re(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,dt(e),!e.destroyed&&!t.paused&&!t.ended&&Io(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,dt(e),!e.destroyed&&!t.paused&&!t.ended&&Io(e)})}function ND(e){let t=()=>{dt(e)},n=()=>{dt(e),Io(e)};if(tr(e,e.element,"load",t),tr(e,e.element,"loadedmetadata",t),tr(e,e.element,"loadeddata",n),tr(e,e.element,"seeked",n),tr(e,e.element,"timeupdate",t),tr(e,window,"resize",t),Re(e.element)&&(tr(e,e.element,"play",()=>Io(e)),tr(e,e.element,"pause",t)),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let r=()=>{let l=e.element.style;return`${l.transform}|${l.translate}|${l.rotate}|${l.scale}|${l.left}|${l.top}|${l.width}|${l.height}`},o=r(),i=!1,a=new MutationObserver(()=>{i||r()!==o&&(i=!0,requestAnimationFrame(()=>{i=!1,o=r(),dt(e)}))});a.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>a.disconnect())}}function FD(e){if(e.destroyed)return null;e.destroyed=!0,LD(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Im(e),Dm(e),wa(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,glCanvas:e.glCanvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function IA(e,t){return e.removeAttribute("style"),t.id?e.id=`${Jx}${t.id}`:e.removeAttribute("id"),e.className=cI,e.setAttribute(uI,"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 PD(e){return IA(document.createElement("canvas"),e)}function DA(e){let t=new WeakMap,n=new Set,r=new Set,o=[],i=null,a=null,l=Promise.resolve(),s=!1,c=null,d,f=()=>[...n].flatMap(R=>t.get(R)??[]),m=()=>{if(c)return c;let R=document.createElement("canvas"),k=R.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});return k?(R.addEventListener("webglcontextlost",F=>{F.preventDefault(),o.length=0;for(let _ of f())_.contextLost=!0,_.drawError="WebGL context lost",_.canvas.style.display="none",wa(_);g(R,k)}),R.addEventListener("webglcontextrestored",()=>{if(c?.canvas===R){clearTimeout(d);for(let F of f())F.contextLost=!OI(F),F.drawError=F.contextLost?"WebGL context restore failed":null,F.contextLost?wa(F):dt(F);T()}}),c={canvas:R,gl:k},c):null},g=(R,k)=>{clearTimeout(d),d=setTimeout(()=>h(R,k),lI)},h=(R,k)=>{if(s||c?.canvas!==R||!k.isContextLost?.())return;let F=c;c=null;let _=m();if(!_){c=F,g(R,k);return}for(let N of f())GI(N,_);T()},y=R=>{let k=m(),F=k&&pu(k.gl);return!k||!F?null:{canvas:PD(R),glCanvas:k.canvas,gl:k.gl,program:F,effectTargets:null,kuwaharaTargets:null,effectError:null}},S=(R,k,F)=>{r.delete(R);let _=t.get(R);if(_)return _.grading=k,_.source=F,dt(_),Re(R)&&!R.paused&&Io(_),!0;let N=o.pop();if(N)IA(N.canvas,R);else{let ae=y(R);if(!ae)return!1;N=ae}let j={element:R,...N,grading:k,compare:{...Wr},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:F,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,borderlessFrame:null,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(R).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(R).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:bA(R),destroyed:!1};return t.set(R,j),n.add(R),ND(j),dt(j),Re(R)&&Io(j),!0},E=(R,k)=>{if(s)return!1;let F=Ea(R);if(!F)return!1;let _=t.get(F);if(!_){let N=Sa(F);if(!Po(F,N)||!S(F,N,"attribute"))return!1;_=t.get(F)}return _?(_.compare=NI(k),dt(_),!0):!1},v=R=>{r.delete(R);let k=t.get(R);if(!k)return;let F=FD(k);F&&(k.contextLost||o.length>=pI?va(F):o.push(F)),t.delete(R),n.delete(R)},T=()=>{if(s)return 0;let R=new Set;r.clear(),document.querySelectorAll(eA).forEach(F=>{if(!nr(F))return;R.add(F);let _=Sa(F);Po(F,_)?Lm(F)?S(F,_,"attribute"):(v(F),r.add(F)):v(F)});for(let F of n){let _=t.get(F);_&&(!F.isConnected||_.source==="attribute"&&!R.has(F))&&v(F)}return n.size},H=()=>{for(let R of r){if(R.isConnected&&!Lm(R))continue;r.delete(R);let k=Sa(R);R.isConnected&&Po(R,k)&&S(R,k,"attribute")}},U=()=>{if(s)return 0;H();let R=0;for(let k of n){let F=t.get(k);F&&dt(F)&&(R+=1)}return R},M=async()=>{let R=new Set;for(let k of n){let F=t.get(k)?.grading.lut;if(!F?.src.trim()||(F.intensity??1)<=0)continue;let _=Pm(F.src);_.state==="pending"&&R.add(_.promise)}return R.size>0&&await Promise.allSettled(R),U(),R.size},L=()=>{if(s)return 0;H();let R=0;for(let k of n){let F=t.get(k);F&&kD(k)&&dt(F)&&(R+=1)}return R},G=(R,k)=>{if(s)return!1;let F=Ea(R);if(!F)return!1;let _=kl(k);return Po(F,_)?S(F,_,"live"):(v(F),!0)},C=(R,k)=>{if(!nr(R))return!1;let F=t.get(R);if(!F){if(!k)return!1;let _=Sa(R);return Po(R,_)&&S(R,_,"attribute")}return F.sourceVisibleForCanvas=k,!k&&F.source==="attribute"&&v(R),!0},B=R=>nr(R)&&t.has(R),O=R=>{let k=Ea(R);if(!k)return{state:"missing",message:"Media not found"};let F=t.get(k);if(F)return F.effectError?{state:"unavailable",message:F.effectError}:F.drawError?{state:"unavailable",message:F.drawError}:F.lutError?{state:"unavailable",message:`LUT error: ${F.lutError}`}:F.grading.lut&&F.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:F.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:F.lut?"Shader + LUT active":"Shader active"};let _=Sa(k);return Po(k,_)?Lm(k)?{state:"unavailable",message:"WebGL unavailable"}:{state:"pending",message:"Waiting for visible media"}:{state:"inactive",message:"No grading applied"}},Y=async(R,k,F)=>{let _=async()=>{if(s||k.length===0)return null;let j=Ea(R);return!j||(a??(a=_D()),!a)?null:RD(a,j,k,F?.maxDimension,F?.useMediaTime)},N=l.then(_,_);return l=N.then(()=>{},()=>{}),N},Z=R=>{let k=Ea(R);if(!Re(k))return null;if(!k.paused)return()=>{};let F=k.currentTime,_=k.loop,N=k.muted;return k.loop=!0,k.muted=!0,(k.ended||Number.isFinite(k.duration)&&F>=k.duration)&&(k.currentTime=0),e?.lease(k),k.play().catch(()=>{}),()=>{e?.release(k),k.pause(),k.loop=_,k.muted=N,k.currentTime=Rt(F)}},J=()=>{if(!s){s=!0,clearTimeout(d),i?.disconnect(),i=null;for(let R of n)v(R);r.clear();for(let R of o)va(R);o.length=0,c?.gl.getExtension("WEBGL_lose_context")?.loseContext(),c=null,a&&(va(a,!0),a=null)}};if(document.body){let R=Rm(`${eA}, ${xa}`,k=>Array.from(n).some(F=>k.contains(F)));i=new MutationObserver(k=>{R(k)&&T()}),i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[To,lu]})}let D={refresh:T,redraw:U,redrawAnimated:L,waitForActiveLuts:M,setGrading:G,setCompare:E,setSourceVisibility:C,isGraded:B,getStatus:O,renderPreviews:Y,startPreviewPlayback:Z,destroy:J},V=window;return V.__hf=V.__hf||{},V.__hf.colorGrading=D,T(),D}var ID={mulX:374761393,mulY:668265263,mulMix:1274126177,offset:2654435769,shift1:13,shift2:16,divisor:4294967296},{mulX:DD,mulY:OD,mulMix:OA,offset:HD,shift1:GD,shift2:BD,divisor:UD}=ID,WD=20,HA=`#version 300 es\nprecision highp float;\nprecision highp int;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform float u_fractalType;\nuniform float u_noiseType;\nuniform float u_invert;\nuniform float u_contrast;\nuniform float u_brightness;\nuniform float u_scale;\nuniform float u_complexity;\nuniform float u_subInfluence;\nuniform float u_subScaling;\nuniform float u_evolution;\nuniform float u_randomSeed;\nuniform float u_opacity;\n\nfloat hfHashUnit(int ix, int iy, int seed) {\n uint h = ((uint(ix) * ${DD}u) ^ (uint(iy) * ${OD}u) ^ (uint(seed) * ${OA}u)) + ${HD}u;\n h = h ^ (h >> ${GD}u);\n h = h * ${OA}u;\n h = h ^ (h >> ${BD}u);\n return float(h) / ${UD}.0;\n}\n\nfloat hfFade(float f, float noiseType) {\n if (noiseType < 1.5) return 0.0;\n if (noiseType < 2.5) return f;\n if (noiseType < 3.5) return f * f * (3.0 - 2.0 * f);\n return f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n}\n\nfloat hfValueNoise(vec2 p, int seed) {\n vec2 cell = floor(p);\n vec2 f = p - cell;\n int ix = int(cell.x);\n int iy = int(cell.y);\n float sx = hfFade(f.x, u_noiseType);\n float sy = hfFade(f.y, u_noiseType);\n float bottom = mix(hfHashUnit(ix, iy, seed), hfHashUnit(ix + 1, iy, seed), sx);\n float top = mix(hfHashUnit(ix, iy + 1, seed), hfHashUnit(ix + 1, iy + 1, seed), sx);\n return mix(bottom, top, sy);\n}\n\nfloat hfFbm(vec2 p) {\n float lacunarity = 100.0 / max(u_subScaling, 1.0);\n float gain = u_subInfluence / 100.0;\n int seed = int(u_randomSeed);\n float amp = 1.0;\n float freq = 1.0;\n float sum = 0.0;\n float norm = 0.0;\n for (int i = 0; i < ${WD}; i++) {\n if (float(i) >= u_complexity) break;\n sum += amp * hfValueNoise(p * freq, seed + i);\n norm += amp;\n amp *= gain;\n freq *= lacunarity;\n }\n return norm > 0.0 ? sum / norm : 0.0;\n}\n\nvoid main() {\n vec2 px = v_uv * u_size;\n vec2 p = px / max(u_scale, 1.0) + vec2(u_evolution, u_evolution * 0.5);\n float v = hfFbm(p);\n v = (v - 0.5) * (u_contrast / 100.0) + 0.5 + u_brightness / 100.0;\n if (u_invert > 0.5) v = 1.0 - v;\n v = clamp(v, 0.0, 1.0);\n float a = clamp(u_opacity / 100.0, 0.0, 1.0);\n fragColor = vec4(v * a, v * a, v * a, a);\n}\n`;var Hm={lumaR:.299,lumaG:.587,lumaB:.114},{lumaR:VD,lumaG:$D,lumaB:qD}=Hm,GA=`#version 300 es\nprecision highp float;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform sampler2D u_src2;\n// 1 when the map ref named another element, 0 when the map is the layer\n// itself. Set by the runtime for every pass, from whether a ref resolved.\nuniform float u_hasSrc2;\nuniform float u_useH;\nuniform float u_maxH;\nuniform float u_useV;\nuniform float u_maxV;\nuniform float u_behavior;\nuniform float u_edge;\nuniform float u_expand;\n\nvec4 hfSampleSrc(vec2 uv) {\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);\n return texture(u_src, uv);\n}\n\n// The selector\'s value, in [0, 1]. Half and Off both land on 0.5, which is the\n// "no displacement" midpoint the caller subtracts.\nfloat hfMapChannel(vec4 premultiplied, float selector) {\n vec3 rgb = premultiplied.a > 0.0 ? premultiplied.rgb / premultiplied.a : vec3(0.0);\n if (selector < 1.5) return rgb.r;\n if (selector < 2.5) return rgb.g;\n if (selector < 3.5) return rgb.b;\n if (selector < 4.5) return premultiplied.a;\n if (selector < 8.5) return dot(rgb, vec3(${VD}, ${$D}, ${qD}));\n if (selector < 9.5) return 1.0;\n return 0.5;\n}\n\nvoid main() {\n vec4 mapTexel = u_hasSrc2 > 0.5 ? texture(u_src2, v_uv) : texture(u_src, v_uv);\n float h = hfMapChannel(mapTexel, u_useH);\n float v = hfMapChannel(mapTexel, u_useV);\n vec2 d = vec2((h - 0.5) * 2.0 * u_maxH, (v - 0.5) * 2.0 * u_maxV);\n fragColor = hfSampleSrc(v_uv + d / u_size);\n}\n`;var{lumaR:zD,lumaG:jD,lumaB:KD}=Hm;var BA=`#version 300 es\nprecision highp float;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform sampler2D u_src2;\nuniform float u_mode;\n\n// The matte texel is premultiplied, so its rgb is already "over black": the\n// composite After Effects reads a luma matte through.\nfloat hfCoverage(vec4 matte, float mode) {\n if (mode < 1.5) return matte.a;\n if (mode < 2.5) return 1.0 - matte.a;\n float luma = dot(matte.rgb, vec3(${zD}, ${jD}, ${KD}));\n if (mode < 3.5) return luma;\n return 1.0 - luma;\n}\n\nvoid main() {\n vec4 src = texture(u_src, v_uv);\n vec4 matte = texture(u_src2, v_uv);\n fragColor = src * clamp(hfCoverage(matte, u_mode), 0.0, 1.0);\n}\n`;var YD={lcgMulA:1103515245,lcgMulB:12996205,lcgAdd:12345,highMask:32640,lowMask:255,byteScale:32704},{lcgMulA:XD,lcgMulB:JD,lcgAdd:UA,highMask:QD,lowMask:ZD,byteScale:eO}=YD,WA=`#version 300 es\nprecision highp float;\n// NOT decoration: a fragment shader\'s default integer precision is mediump,\n// and a mediump uint is only guaranteed 16 bits (ESSL 3.00 \\xA74.5.2). Every step\n// below (the Jenkins mix, both LCG rounds) is defined by 32-bit wraparound,\n// so without this the hash is a different function on any implementation that\n// honours the minimum. ANGLE and SwiftShader both use 32-bit ints, which is\n// exactly why no test on this machine would catch it.\nprecision highp int;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform float u_amount;\nuniform float u_useColorNoise;\nuniform float u_clipping;\n\n// Bob Jenkins\' 1997 integer mix, the six-round shift/xor/subtract sequence the\n// metallib runs verbatim. uint arithmetic wraps in GLSL ES 3.00, which is what\n// makes this bit-identical to the C original.\nuint hfJenkinsMix(uint a, uint b, uint c) {\n a -= b; a -= c; a ^= (c >> 13u);\n b -= c; b -= a; b ^= (a << 8u);\n c -= a; c -= b; c ^= (b >> 13u);\n a -= b; a -= c; a ^= (c >> 12u);\n b -= c; b -= a; b ^= (a << 16u);\n c -= a; c -= b; c ^= (b >> 5u);\n a -= b; a -= c; a ^= (c >> 3u);\n b -= c; b -= a; b ^= (a << 10u);\n c -= a; c -= b; c ^= (b >> 15u);\n return c;\n}\n\n// The hash\'s 15-bit output byte for one channel.\nfloat hfNoiseByte(uint a, uint y, uint seed) {\n uint h = hfJenkinsMix(a, y, seed);\n uint t2 = h * ${XD}u + ${UA}u;\n uint t4 = t2 * ${JD}u + ${UA}u;\n return float(((t4 >> 16u) & ${ZD}u) ^ ((t2 >> 9u) & ${QD}u));\n}\n\nvoid main() {\n vec4 src = texture(u_src, v_uv);\n vec2 px = floor(v_uv * u_size);\n uint x = uint(max(px.x, 0.0));\n // After Effects indexes rows from the top; v_uv is y-up.\n uint y = uint(max(u_size.y - 1.0 - px.y, 0.0));\n float frame = floor(u_t * u_fps + 0.5);\n uint seed = uint(max(frame, 0.0)) & 0xFFFFu;\n\n float amount = u_amount * 0.01;\n vec3 nz;\n if (u_useColorNoise > 0.5) {\n uint a = x * 3u;\n nz = vec3(hfNoiseByte(a, y, seed), hfNoiseByte(a + 1u, y, seed), hfNoiseByte(a + 2u, y, seed));\n } else {\n nz = vec3(hfNoiseByte(x, y, seed));\n }\n nz = amount * (nz / ${eO}.0 - 0.5);\n\n vec4 out4 = vec4(src.rgb + nz, src.a);\n // A valid premultiplied colour needs rgb <= a component-wise; noise on a\n // near-transparent texel can push rgb above it, which our fixed 8-bit RGBA\n // storage cannot carry safely the way AE\'s float pipeline can (see the doc\n // comment above). This runs before, and independently of, u_clipping.\n out4.rgb = min(out4.rgb, out4.a);\n fragColor = u_clipping > 0.5 ? clamp(out4, 0.0, 1.0) : out4;\n}\n`;var tO={tau:6.283185307179586,degreesPerTurn:360},{tau:nO,degreesPerTurn:rO}=tO,VA=`#version 300 es\nprecision highp float;\n\nin vec2 v_uv;\nout vec4 fragColor;\n\nuniform vec2 u_size;\nuniform float u_t;\nuniform float u_fps;\nuniform sampler2D u_src;\nuniform float u_waveType;\nuniform float u_height;\nuniform float u_width;\nuniform float u_direction;\nuniform float u_speed;\nuniform float u_pinning;\nuniform float u_phase;\n\n// Outside the layer\'s own box there is nothing to warp in from, so the wave\n// carries transparency rather than a smeared edge pixel.\nvec4 hfSampleSrc(vec2 uv) {\n if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);\n return texture(u_src, uv);\n}\n\nvoid main() {\n vec2 px = v_uv * u_size;\n float dir = radians(u_direction);\n vec2 travel = vec2(sin(dir), -cos(dir));\n vec2 swing = vec2(-travel.y, travel.x);\n float proj = (px.x + 1.0) * travel.x + px.y * travel.y;\n float turns = proj / max(u_width, 1.0) + u_phase / ${rO}.0 + u_speed * u_t;\n float disp = u_height * sin(${nO} * turns);\n fragColor = hfSampleSrc((px + swing * disp) / u_size);\n}\n`;var Gm="data-vfx-chain",$A=1,qA=[{value:1,label:"Red"},{value:2,label:"Green"},{value:3,label:"Blue"},{value:4,label:"Alpha"},{value:5,label:"Luminance"},{value:6,label:"Hue"},{value:7,label:"Lightness"},{value:8,label:"Saturation"},{value:9,label:"Full"},{value:10,label:"Half"},{value:11,label:"Off"}],oO=[{id:"fractal-noise",label:"Fractal Noise",ae:"ADBE Fractal Noise",capture:"none",frag:HA,params:[{kind:"enum",key:"fractalType",label:"Fractal Type",options:[{value:1,label:"Basic"}],default:1,hint:"Only Basic is implemented in v1."},{kind:"enum",key:"noiseType",label:"Noise Type",options:[{value:1,label:"Block"},{value:2,label:"Linear"},{value:3,label:"Soft Linear"},{value:4,label:"Spline"}],default:3},{kind:"bool",key:"invert",label:"Invert",default:!1},{kind:"number",key:"contrast",label:"Contrast",unit:"%",min:0,max:1e3,step:1,default:100},{kind:"number",key:"brightness",label:"Brightness",unit:"",min:-1e3,max:1e3,step:1,default:0},{kind:"number",key:"scale",label:"Scale",unit:"%",min:6,max:1e4,step:1,default:100},{kind:"number",key:"complexity",label:"Complexity",unit:"",min:1,max:20,step:1,default:6},{kind:"number",key:"subInfluence",label:"Sub Influence",unit:"%",min:0,max:100,step:1,default:70},{kind:"number",key:"subScaling",label:"Sub Scaling",unit:"%",min:0,max:100,step:1,default:56},{kind:"number",key:"evolution",label:"Evolution",unit:"revolutions",min:-1e4,max:1e4,step:.01,default:0,animatable:!0},{kind:"number",key:"randomSeed",label:"Random Seed",unit:"",min:0,max:99999,step:1,default:0},{kind:"number",key:"opacity",label:"Opacity",unit:"%",min:0,max:100,step:1,default:100,animatable:!0}]},{id:"wave-warp",label:"Wave Warp",ae:"ADBE Wave Warp",capture:"self",frag:VA,params:[{kind:"enum",key:"waveType",label:"Wave Type",options:[{value:1,label:"Sine"}],default:1,hint:"Only Sine is implemented in v1; the exporter marks the others cosmetic."},{kind:"number",key:"height",label:"Wave Height",unit:"px",min:-1e3,max:1e3,step:1,default:10,animatable:!0},{kind:"number",key:"width",label:"Wave Width",unit:"px",min:1,max:1e4,step:1,default:40,animatable:!0},{kind:"number",key:"direction",label:"Direction",unit:"deg",min:-360,max:360,step:1,default:90},{kind:"number",key:"speed",label:"Wave Speed",unit:"waves/s",min:-100,max:100,step:.1,default:1},{kind:"enum",key:"pinning",label:"Pinning",options:[{value:1,label:"None"}],default:1,hint:"Only None is implemented in v1; the exporter marks the others cosmetic."},{kind:"number",key:"phase",label:"Phase",unit:"deg",min:-360,max:360,step:1,default:0,animatable:!0}]},{id:"displacement-map",label:"Displacement Map",ae:"ADBE Displacement Map",capture:"self",frag:GA,params:[{kind:"ref",key:"map",label:"Displacement Map Layer",optional:!0},{kind:"enum",key:"useH",label:"Use For Horizontal Displacement",options:qA,default:1,hint:"Hue, Lightness and Saturation are read as Luminance in v1."},{kind:"number",key:"maxH",label:"Max Horizontal Displacement",unit:"px",min:-32e3,max:32e3,step:1,default:5,animatable:!0},{kind:"enum",key:"useV",label:"Use For Vertical Displacement",options:qA,default:2,hint:"Hue, Lightness and Saturation are read as Luminance in v1."},{kind:"number",key:"maxV",label:"Max Vertical Displacement",unit:"px",min:-32e3,max:32e3,step:1,default:5,animatable:!0},{kind:"enum",key:"behavior",label:"Displacement Map Behavior",options:[{value:1,label:"Center Map"}],default:1,hint:"Only Center Map is implemented in v1."},{kind:"enum",key:"edge",label:"Edge Behavior",options:[{value:0,label:"Off"}],default:0,hint:"Only Off (transparent outside the layer) is implemented in v1."},{kind:"bool",key:"expand",label:"Expand Output",default:!0}]},{id:"luma-matte",label:"Matte",capture:"self",frag:BA,params:[{kind:"ref",key:"matte",label:"Matte Layer"},{kind:"enum",key:"mode",label:"Matte Mode",options:[{value:1,label:"Alpha"},{value:2,label:"Alpha Inverted"},{value:3,label:"Luma"},{value:4,label:"Luma Inverted"}],default:1}]},{id:"noise",label:"Noise",ae:"ADBE Noise",capture:"self",frag:WA,params:[{kind:"number",key:"amount",label:"Amount of Noise",unit:"%",min:0,max:400,step:.1,default:0,animatable:!0},{kind:"bool",key:"useColorNoise",label:"Use Color Noise",default:!1},{kind:"bool",key:"clipping",label:"Clip Result Values",default:!0}]}],gu=new Map(oO.map(e=>[e.id,e]));function KA(e){return gu.get(e)}function YA(e,t){let n=gu.get(e);if(!n)return{};let r={};for(let o of n.params){let i=t?.[o.key];r[o.key]=o.kind==="enum"?iO(o,i):o.kind==="bool"?aO(o,i):o.kind==="ref"?sO(i):lO(o,i)}return r}function XA(e){let t=typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):Number.NaN;return Number.isFinite(t)?t:void 0}function iO(e,t){let n=XA(t);return n!==void 0&&e.options.some(r=>r.value===n)?n:e.default}function aO(e,t){return typeof t=="boolean"?t:e.default}function sO(e){return typeof e=="string"?e:""}function lO(e,t){let n=XA(t);return n!==void 0?Math.min(e.max,Math.max(e.min,n)):e.default}var Ut=class extends Error{constructor(t){super(t),this.name="VfxChainError"}};function Bm(e){return e.nodes.filter(t=>t.enabled!==!1)}var zA={none:0,self:1,backdrop:2};function JA(e){let t="none";for(let n of Bm(e)){let r=gu.get(n.type);r&&zA[r.capture]>zA[t]&&(t=r.capture)}return t}function QA(e){let t;try{t=JSON.parse(e)}catch(o){throw new Ut(`Chain file is not valid JSON: ${o.message}`)}if(typeof t!="object"||t===null)throw new Ut("Chain file must be a JSON object.");let n=t;if(n.version!==$A)throw new Ut(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new Ut("Chain file is missing a `nodes` array.");let r=n.nodes.map(dO);return{version:$A,nodes:r}}function jA(e){return typeof e=="object"&&e!==null}function uO(e,t){if(typeof e.type!="string"||!gu.has(e.type))throw new Ut(`Node ${t} has unknown effect type: ${String(e.type)}`);return e.type}function cO(e,t){if(typeof e.id!="string"||e.id==="")throw new Ut(`Node ${t} is missing an id.`);return e.id}function dO(e,t){if(!jA(e))throw new Ut(`Node ${t} is not an object.`);let n=e,r=uO(n,t),o=cO(n,t),i=jA(n.params)?n.params:{};return fO({type:r,id:o,enabled:n.enabled===!1?!1:void 0,params:i})}function fO(e){for(let t of Object.keys(e))e[t]===void 0&&delete e[t];return e}var ZA=\'canvas[layoutsubtree], canvas[content="drawable"]\';function Do(e=window){let t=e.CanvasRenderingContext2D?.prototype;if(!t||!("drawElementImage"in t))return null;let n=e.document.createElement("canvas");return"requestPaint"in n?"layoutSubtree"in n?"layoutsubtree":"updateElementGeometry"in n?"drawable":null:null}function bu(e,t){t==="layoutsubtree"?e.setAttribute("layoutsubtree",""):e.setAttribute("content","drawable")}function yu(e,t){t==="drawable"&&e.setAttribute("drawable","")}function ew(e,t){t==="drawable"&&e.removeAttribute("drawable")}var mO="data-vfx-ref-visible",aw="[HyperFrames] composition script error:",pO={preserveDrawingBuffer:!0,antialias:!1,premultipliedAlpha:!0,alpha:!0},hO=`#version 300 es\nout vec2 v_uv;\nvoid main() {\n vec2 p = vec2(float((gl_VertexID << 1) & 2), float(gl_VertexID & 2));\n v_uv = p;\n gl_Position = vec4(p * 2.0 - 1.0, 0.0, 1.0);\n}\n`,Sn=[],sw=30,lw=0,$m=0,uw=-1,Um=null,Wm=null;function wt(e){globalThis.console.error(aw,`vfx: ${e}`)}function cw(e){globalThis.console.error(aw,`vfx-frame: ${e}`)}function tw(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(wt(`shader failed to compile: ${e.getShaderInfoLog(r)??"(no log)"}`),e.deleteShader(r),null)):null}function gO(e,t){let n=tw(e,e.VERTEX_SHADER,hO),r=n?tw(e,e.FRAGMENT_SHADER,t):null;if(!n||!r)return null;let o=e.createProgram();return o?(e.attachShader(o,n),e.attachShader(o,r),e.linkProgram(o),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(o,e.LINK_STATUS)?o:(wt(`program failed to link: ${e.getProgramInfoLog(o)??"(no log)"}`),e.deleteProgram(o),null)):null}var nw="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;";function bO(e){let t=e.querySelector(":scope > canvas.hf-vfx-out");if(sn(t))return t.style.cssText=nw+t.style.cssText,t;let n=document.createElement("canvas");return n.className="hf-vfx-out",n.style.cssText=nw,e.appendChild(n),n}function yO(e,t,n){let r={};for(let o of n.params)o.kind!=="ref"&&(r[o.key]=e.getUniformLocation(t,`u_${o.key}`));return{size:e.getUniformLocation(t,"u_size"),t:e.getUniformLocation(t,"u_t"),fps:e.getUniformLocation(t,"u_fps"),src:e.getUniformLocation(t,"u_src"),src2:e.getUniformLocation(t,"u_src2"),hasSrc2:e.getUniformLocation(t,"u_hasSrc2"),params:r}}function xO(e,t,n,r){return r.optional?{kind:"none"}:(wt(`${tn(e)}: node "${t.id}" (${n.id}) needs a "${r.key}" param naming the id of the element to read as its second source.`),{kind:"error"})}function SO(e,t,n,r,o,i){let a=n.params.find(f=>f.kind==="ref");if(!a)return{kind:"none"};let l=r[a.key];if(typeof l!="string"||l==="")return xO(e,t,n,a);let s=e.ownerDocument.getElementById(l);if(!Te(s))return wt(`${tn(e)}: node "${t.id}" (${n.id}) names "${a.key}" element #${l}, which is not in the composition.`),{kind:"error"};if(s===e)return a.optional?{kind:"none"}:{kind:"self"};let c=i.get(s);if(c)return{kind:"source",source:c};let d=dw(s,o,`${tn(e)}: "${a.key}" source`);return d?(i.set(s,d),{kind:"source",source:d}):{kind:"error"}}function EO(e,t,n){let r=[],o=new Map;for(let i of Bm(t)){let a=KA(i.type);if(!a)return wt(`node "${i.id}" has unknown effect type "${i.type}"`),null;let l=gO(e,a.frag);if(!l)return wt(`node "${i.id}" (${a.id}) has no usable program`),null;let s=YA(a.id,i.params),c=SO(n,i,a,s,e,o);if(c.kind==="error")return null;r.push({node:i,def:a,program:l,params:s,locations:yO(e,l,a),...c.kind==="source"?{ref:c.source}:{},selfRef:c.kind==="self"})}return r}function vO(e){let t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),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),t}function AO(e){let t=e.parentElement;if(!t||e.id==="")return null;let n=t.children;for(let r=0;r<n.length;r++){let o=n.item(r);if(sn(o)&&o.classList.contains("hf-vfx-src")&&o.getAttribute("data-vfx-for")===e.id)return o}return null}function wO(e,t){Do()==="drawable"&&(bu(e,"drawable"),yu(t,"drawable"))}function dw(e,t,n){let r=AO(e),o=r??e.querySelector(":scope > canvas.hf-vfx-src"),i=sn(o)?o.querySelector(":scope > .hf-vfx-in"):null;if(!sn(o)||!Te(i)){wt(`${n}: a capturing chain needs <canvas layoutsubtree class="hf-vfx-src"><div class="hf-vfx-in">\\u2026</div></canvas> in source: inside the element for its own pixels, or beside it with data-vfx-for="${e.id}" for the layers below it.`);return}if(o.querySelector("canvas.hf-vfx-src")||o.parentElement?.closest("canvas.hf-vfx-src")){wt(`${n}: a capture canvas nested inside another capture canvas blocks the renderer\'s main thread in drawElementImage, so this chain is not registered. Keep each .hf-vfx-src out of every other .hf-vfx-src subtree.`);return}let a=o.getContext("2d");if(!a||typeof a.drawElementImage!="function"){wt(`${n}: drawElementImage is unavailable, so the layer cannot be captured. In Studio, enable chrome://flags/#canvas-draw-element.`);return}return wO(o,i),{canvas:o,inner:i,ctx:a,texture:vO(t),backdrop:r!==null,visible:o.hasAttribute(mO),emptyBoxReported:!1,laidOutEmpty:or(i)===null}}function _O(e){e.out.addEventListener("webglcontextlost",t=>{t.preventDefault(),!(!Sn.includes(e)||e.contextLost)&&(e.contextLost=!0,wt(`${tn(e.host)}: WebGL context lost.`))})}function TO(e){try{return QA(e.getAttribute(Gm)??"")}catch(t){let n=t instanceof Ut?t.message:String(t);return wt(`${tn(e)}: ${n}`),null}}function CO(e){let t=TO(e);if(!t)return null;let n=bO(e),r=n.getContext("webgl2",pO);if(!r)return wt(`${tn(e)}: WebGL2 is unavailable, so the chain cannot paint.`),n.remove(),null;let o=EO(r,t,e);if(!o)return n.remove(),null;let i=JA(t),a=i==="none"?void 0:dw(e,r,tn(e));if(i!=="none"&&!a)return n.remove(),null;let l=a?.backdrop?"backdrop":i,s={host:e,chain:t,capture:l,out:n,gl:r,passes:o,src:a,contextLost:!1};return _O(s),s}function qm(e){let t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function fw(e){if(getComputedStyle(e.inner).visibility==="hidden")return!1;for(let t=e.inner;t;t=t.parentElement)if(getComputedStyle(t).display==="none")return!1;return!0}function tn(e){return e.id?`#${e.id}`:`<${e.tagName.toLowerCase()}>`}function Oo(e){let t=e.src?[e.src]:[];for(let n of e.passes)n.ref&&!t.includes(n.ref)&&t.push(n.ref);return t}function zm(e){return e.src?.backdrop===!0}function Ca(e){let t=[];for(let n of e.passes)n.ref?.visible&&!t.includes(n.ref)&&t.push(n.ref);return t}function RO(){for(let e of Sn){let{gl:t}=e;for(let n of e.passes)t.deleteProgram(n.program);for(let n of Oo(e))t.deleteTexture(n.texture);if(e.ping){for(let n of e.ping.textures)t.deleteTexture(n);for(let n of e.ping.framebuffers)t.deleteFramebuffer(n)}}}function xu(e,t){RO(),Sn=[],sw=Number.isFinite(t)&&t>0?t:30;let n=e.querySelectorAll(`[${Gm}]`);for(let r of n){if(!Te(r))continue;let o=CO(r);o&&Sn.push(o)}return Sn}function or(e){let t=typeof window>"u"?1:window.devicePixelRatio||1,n=Math.round(e.offsetWidth*t),r=Math.round(e.offsetHeight*t);return n>0&&r>0?{width:n,height:r}:null}function rw(e,t,n){let r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),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);let o=e.createFramebuffer();return e.bindFramebuffer(e.FRAMEBUFFER,o),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),[r,o]}function MO(e,t,n){let r=e.ping;if(r&&r.width===t&&r.height===n)return r;let{gl:o}=e;if(r){for(let s of r.textures)o.deleteTexture(s);for(let s of r.framebuffers)o.deleteFramebuffer(s)}let i=rw(o,t,n),a=rw(o,t,n),l={textures:[i[0],a[0]],framebuffers:[i[1],a[1]],width:t,height:n};return e.ping=l,l}function kO(e,t,n){if(e.kind==="ref")return null;if(e.kind==="number"&&e.animatable){let o=n.getPropertyValue(`--vfx-${t.node.id}-${e.key}`).trim(),i=o===""?Number.NaN:Number.parseFloat(o);if(Number.isFinite(i))return Math.min(e.max,Math.max(e.min,i))}let r=t.params[e.key];return typeof r=="boolean"?r?1:0:typeof r=="number"?r:0}function LO(e,t,n,r,o,i){let{gl:a}=e,{locations:l}=t;a.uniform2f(l.size,o,i),a.uniform1f(l.t,r),a.uniform1f(l.fps,sw),a.uniform1f(l.hasSrc2,t.ref||t.selfRef?1:0);for(let s of t.def.params){let c=kO(s,t,n);c!==null&&a.uniform1f(l.params[s.key]??null,c)}}function NO(e,t,n){return e===t||!n?null:n.framebuffers[e%2]??null}function FO(e,t,n){return t===0?e.src?.texture??null:n?.textures[(t-1)%2]??null}function PO(e,t,n,r){let{gl:o}=e,i=e.passes[t];o.bindFramebuffer(o.FRAMEBUFFER,NO(t,n,r));let a=FO(e,t,r);a&&ow(o,i.locations.src,a,0),i.ref?(ow(o,i.locations.src2,i.ref.texture,1),o.activeTexture(o.TEXTURE0)):i.selfRef&&a&&o.uniform1i(i.locations.src2,0)}function ow(e,t,n,r){e.activeTexture(r===0?e.TEXTURE0:e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t,r)}function jm(e,t){let n=or(e.host);if(!n)return;let{gl:r,out:o,passes:i}=e;o.width!==n.width&&(o.width=n.width),o.height!==n.height&&(o.height=n.height);let a=i.length>1?MO(e,n.width,n.height):null,l=getComputedStyle(e.host),s=i.length-1;for(let c=0;c<=s;c++){let d=i[c];r.useProgram(d.program),PO(e,c,s,a),r.viewport(0,0,n.width,n.height),LO(e,d,l,t,n.width,n.height),r.drawArrays(r.TRIANGLES,0,3)}}function mw(e,t){e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t.canvas),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0)}var IO={upload:!0,keepBitmap:!1},DO={upload:!1,keepBitmap:!0},OO={upload:!0,keepBitmap:!0},HO={upload:!1,keepBitmap:!0};function pw(e,t){e.canvas.width!==t.width&&(e.canvas.width=t.width),e.canvas.height!==t.height&&(e.canvas.height=t.height)}function iw(e,t,n,r){return pw(t,n),t.ctx.clearRect(0,0,n.width,n.height),r.upload&&mw(e.gl,t),!0}function Km(e,t,n,r,o){if(!fw(t))return iw(e,t,n,o);if(or(t.inner)===null)return t.emptyBoxReported||(t.emptyBoxReported=!0,cw(`${tn(e.host)}: the .hf-vfx-in wrapper measures 0\\xD70, so its capture would be empty. Inside a layoutsubtree canvas an inset or percentage box has no size, so the wrapper must state an explicit width and height in px.`)),iw(e,t,n,o);pw(t,n),t.ctx.clearRect(0,0,n.width,n.height);try{t.ctx.drawElementImage(t.inner,0,0,n.width,n.height)}catch(i){return r||wt(`${tn(e.host)}: drawElementImage failed: ${i.message} In Studio, enable chrome://flags/#canvas-draw-element.`),!1}return o.upload&&mw(e.gl,t),o.keepBitmap||t.ctx.clearRect(0,0,n.width,n.height),!0}function hw(e,t){return e.visible?or(e.inner)??t:t}function gw(e,t=!1){let n=or(e.host),r=Oo(e);if(!n||r.length===0)return!1;let o=!0;for(let i of r){let a=i.visible?OO:IO;Km(e,i,hw(i,n),t,a)||(o=!1)}return o}function bw(e,t=!1){let n=e.src;if(!n)return!1;let r=or(e.host)??or(n.inner);return r?Km(e,n,r,t,DO):!1}function Vm(e,t=!1){let n=!0;for(let r of Ca(e)){let o=hw(r,{width:0,height:0});Km(e,r,o,t,HO)||(n=!1)}return n}function GO(e){let t=!1;return zm(e)&&bw(e)&&(t=!0),Ca(e).length>0&&Vm(e)&&(t=!0),t}function BO(){let e=!1;for(let t of Sn)if(!t.contextLost&&Oo(t).length!==0){if(!qm(t.host)){GO(t)&&(e=!0);continue}gw(t)&&(jm(t,lw),e=!0)}return uw=$m,window.__hf_page_composite_pending=!1,e}function UO(){let e=window,t=e.__hf_page_composite_resolve;t!==Um&&(Wm=typeof t=="function"?t:null,Um=()=>{let n=Wm?Wm():!1;return BO()||n},e.__hf_page_composite_resolve=Um),e.__hf_page_composite_pending=!0}var yw=2e3;function WO(e){return new Promise(t=>{let n=!1,r=a=>{n||(n=!0,clearTimeout(i),e.removeEventListener("paint",o),t(a))},o=()=>r("painted"),i=setTimeout(()=>r("timeout"),yw);e.addEventListener("paint",o,{once:!0});try{e.requestPaint?.()}catch{}if(typeof requestAnimationFrame!="function"){r("painted");return}requestAnimationFrame(()=>requestAnimationFrame(()=>r("painted")))})}async function VO(e,t){return(await Promise.all(t.map(r=>WO(r.canvas)))).includes("timeout")?(cw(`${tn(e.host)}: no paint arrived within ${yw}ms, so this frame\'s capture was skipped (a BeginFrame-controlled compositor without a tick for this frame is a known cause).`),!1):!0}function $O(e){return qm(e.host)?"paint":zm(e)?"passThrough":"refOnly"}function qO(e,t){return(t==="passThrough"?[...e.src?[e.src]:[],...Ca(e)]:t==="refOnly"?Ca(e):Oo(e)).filter(fw)}function zO(e,t){return t!==$m||uw===t?!1:Sn.includes(e)&&!e.contextLost}async function jO(e,t,n,r){let o=$O(e);if(await VO(e,qO(e,o))&&zO(e,n)){if(o==="passThrough"){bw(e,r),Vm(e,r);return}if(o==="refOnly"){Vm(e,r);return}gw(e,r)&&jm(e,t)}}async function KO(e,t,n,r){await Promise.all(e.map(o=>jO(o,t,n,r)))}function YO(){for(let e of Sn.flatMap(Oo)){let t=or(e.inner)===null;e.laidOutEmpty&&!t&&e.canvas.insertBefore(e.inner,e.inner.nextSibling),e.laidOutEmpty=t}}function Ym(e,t){lw=e;let n=++$m;YO();let r=[];for(let o of Sn)if(!o.contextLost){if(!qm(o.host)){(zm(o)||Ca(o).length>0)&&r.push(o);continue}Oo(o).length>0?r.push(o):jm(o,e)}r.length!==0&&(t?.engineMode&&UO(),tt(KO(r,e,n,t?.engineMode===!0),"vfx"))}function Qm(e=window){let t=/Chrome\\/(\\d+)/.exec(e.navigator.userAgent);return t?.[1]?Number(t[1]):null}var XO=(e,t)=>t.backface,JO=(e,t)=>Array.from(e.ownerDocument.querySelectorAll("canvas")).some(t.isAccelerated),QO=/^matrix\\(\\s*1,\\s*0,\\s*0,\\s*1,\\s*0,\\s*0\\s*\\)$|^matrix3d\\(\\s*1,\\s*0,\\s*0,\\s*0,\\s*0,\\s*1,\\s*0,\\s*0,\\s*0,\\s*0,\\s*1,\\s*0,\\s*0,\\s*0,\\s*0,\\s*1\\s*\\)$/,Xm=(e,t)=>!!e&&e!=="none"&&!e.split(/\\s+/).every(n=>parseFloat(n)===t),ZO=e=>{let t=getComputedStyle(e),n=t.transform.trim();return Xm(t.scale,1)||Xm(t.rotate,0)||Xm(t.translate,0)?!0:n!=="none"&&n!==""&&!QO.test(n)},eH=e=>{let t=getComputedStyle(e).mixBlendMode;return!!t&&t!=="normal"},tH=e=>Number.parseFloat(getComputedStyle(e).opacity)<1,nH=e=>e.querySelector("iframe, object, embed")!==null||Array.from(e.querySelectorAll("*")).some(t=>t.localName.includes("-")&&customElements.get(t.localName)!==void 0),rH=[{code:"nested-capture-canvas",reason:"the composition already uses html-in-canvas",detect:e=>e.querySelector(ZA)!==null},{code:"accelerated-canvas",reason:"the composition draws a WebGL/WebGPU canvas, which html-in-canvas captures frozen",detect:JO},{code:"backface-visibility",reason:"backface-visibility: hidden inside a 3D transform is drawn mirrored by html-in-canvas",detect:XO},{code:"iframe-in-root",reason:"the composition contains an <iframe>, <object>, <embed> or custom element, which is re-initialised when blur wraps the root",detect:nH},{code:"root-transform",reason:"html-in-canvas can ignore a transform on the composition root",detect:ZO},{code:"root-opacity",reason:"html-in-canvas can ignore the composition root\'s own opacity",detect:tH},{code:"root-blend-mode",reason:"html-in-canvas can ignore the composition root\'s own mix-blend-mode",detect:eH}];function Su(e,t){let n=rH.find(r=>r.detect(e,t));return n?{code:n.code,reason:n.reason}:null}var xw=/perspective\\(|rotate3d\\(|rotate[XY]\\(|matrix3d\\(/;function Sw(e){return e.getPropertyValue("backface-visibility")==="hidden"||e.getPropertyValue("-webkit-backface-visibility")==="hidden"}var oH=e=>!/^(none|-?[\\d.]+[a-z]+)?$/.test(e.rotate??"")||(e.translate??"").trim().split(/\\s+/).length>2;function iH(e,t){return xw.test(t.transform)||xw.test(e.style.transform)||oH(t)}function aH(e,t){for(let n=e;n;n=n.parentElement){let r=getComputedStyle(n);if(r.transformStyle==="preserve-3d"||iH(n,r)||n!==e&&r.perspective!=="none"&&r.perspective!=="")return!0;if(n===t)break}return!1}var sH=16,Zm="@keyframes ";function lH(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e.charAt(o);i==="("||i==="["?n++:i===")"||i==="]"?n--:i===","&&n===0&&(t.push(e.slice(r,o).trim()),r=o+1)}return t.push(e.slice(r).trim()),t}function uH(e,t){if(t===null)return e;let n=`:is(${t})`;return lH(e).map(r=>r.includes("&")?r.replaceAll("&",n):`${n} ${r}`).join(", ")}function*Jm(e,t,n,r){if(!(r>sH))for(let o of Array.from(e))yield*dH(o,t,n,r)}function cH(e,t){let n="style"in e?e.style:null;return t!==null&&n instanceof CSSStyleDeclaration?{selector:t,style:n}:null}function*dH(e,t,n,r){if(e instanceof CSSStyleRule){let i=uH(e.selectorText,t);yield{selector:i,style:e.style},yield*Jm(e.cssRules,i,n,r+1);return}if(e instanceof CSSImportRule){e.styleSheet&&(yield*Ew(e.styleSheet,n,r+1));return}let o=cH(e,t);if(o)yield o;else if("cssRules"in e&&e.cssRules instanceof CSSRuleList){let i=e instanceof CSSKeyframesRule?Zm+e.name:t;yield*Jm(e.cssRules,i,n,r+1)}}function fH(e){try{return e.cssRules}catch{return null}}function*Ew(e,t,n){let r=t.has(e)?null:fH(e);t.add(e),r&&(yield*Jm(r,null,t,n))}function mH(e,t){try{let n=Array.from(e.querySelectorAll(t));return e.matches(t)?[e,...n]:n}catch{return[]}}function pH(e){return(document.getAnimations?.()??[]).flatMap(({effect:t})=>{if(!(t instanceof KeyframeEffect))return[];let n=t.target;return t.getKeyframes().some(o=>o.backfaceVisibility==="hidden")&&n instanceof HTMLElement&&e.contains(n)?[n]:[]})}function hH(e,t){return t.length===0?[]:[e,...e.querySelectorAll("*")].filter(n=>getComputedStyle(n).animationName.split(", ").some(r=>t.includes(Zm+r)))}function gH(){let e=new Set,t=[...Array.from(document.styleSheets),...document.adoptedStyleSheets??[]],n=[];for(let r of t)for(let o of Ew(r,e,0))Sw(o.style)&&n.push(o.selector);return n}function bH(e,t){let n=t.filter(o=>o.startsWith(Zm)),r=new Set([...e.querySelectorAll(\'[style*="backface"]\'),...pH(e),...hH(e,n)]);for(let o of t)for(let i of mH(e,o))r.add(i);return r}function vw(e){let t=gH(),n=new Set,r=()=>{for(let o of n)if(Sw(getComputedStyle(o))&&aH(o,e))return!0;return!1};return{scan:()=>(n=new Set([...n,...bH(e,t)]),r()),recheck:r}}function Aw(e){return vw(e).scan()}var yH=10;function ww(e,t){let n=vw(e),r=null;return{sample:(o,i,a)=>{if(r)return;let l=o%yH===0||o===i,s=Su(e,{isAccelerated:t,backface:l&&n.scan()});s&&(r={...s,reason:`${s.reason} (first seen at t=${a.toFixed(1)}s)`})},result:()=>r,facesNow:n.recheck}}var _w="__HF_PAGE_MOTION_BLUR_OFF__",Tw="__HF_DEVICE_SCALE_FACTOR__";function Cw(e=window){return Do(e)!==null}var xH="__hfAcceleratedCanvases";function Rw(){let e="__hfAcceleratedCanvases",t=Reflect.get(window,e),n=t instanceof WeakSet?t:new WeakSet;n!==t&&Object.defineProperty(window,e,{value:n});let r=["webgl","webgl2","experimental-webgl","webgpu"],o=(i,a)=>{let l=HTMLCanvasElement.prototype,s=Reflect.get(l,i);if(typeof s!="function"||"__hfAccelTracked"in s)return;let c=function(...d){let f=Reflect.apply(s,this,d);return a(this,d,f),f};Object.defineProperty(c,"__hfAccelTracked",{value:!0}),Object.defineProperty(l,i,{value:c,writable:!0,configurable:!0})};o("getContext",(i,a,l)=>{l&&r.includes(String(a[0]))&&n.add(i)}),o("transferControlToOffscreen",i=>{n.add(i)})}function Mw(e){let t=Reflect.get(window,xH);return t instanceof WeakSet&&t.has(e)}var Ho={a:1,b:0,c:0,d:1,e:0,f:0};function Eu(e,t){return{a:e.a*t.a+e.c*t.b,b:e.b*t.a+e.d*t.b,c:e.a*t.c+e.c*t.d,d:e.b*t.c+e.d*t.d,e:e.a*t.e+e.c*t.f+e.e,f:e.b*t.e+e.d*t.f+e.f}}function Ra(e,t,n){return Eu(e,{a:1,b:0,c:0,d:1,e:t,f:n})}function tp(e){let t=e.a*e.d-e.b*e.c;return!Number.isFinite(t)||Math.abs(t)<1e-12?null:{a:e.d/t,b:-e.b/t,c:-e.c/t,d:e.a/t,e:(e.c*e.f-e.d*e.e)/t,f:(e.b*e.e-e.a*e.f)/t}}function SH(e,t,n){return[[e.e,e.f],[e.a*t+e.e,e.b*t+e.f],[e.c*n+e.e,e.d*n+e.f],[e.a*t+e.c*n+e.e,e.b*t+e.d*n+e.f]]}function EH(e,t,n){let r=kw(e),o=kw(t),i=o.angle-r.angle;i>Math.PI?i-=2*Math.PI:i<-Math.PI&&(i+=2*Math.PI);let a=(l,s)=>l+(s-l)*n;return vH({angle:r.angle+i*n,sx:a(r.sx,o.sx),sy:a(r.sy,o.sy),shear:a(r.shear,o.shear),e:a(e.e,t.e),f:a(e.f,t.f)})}function kw(e){let t=Math.hypot(e.a,e.b);return t<1e-12?{angle:0,sx:0,sy:e.d,shear:e.c,e:e.e,f:e.f}:{angle:Math.atan2(e.b,e.a),sx:t,sy:(e.a*e.d-e.b*e.c)/t,shear:(e.a*e.c+e.b*e.d)/t,e:e.e,f:e.f}}function vH(e){let t=Math.cos(e.angle),n=Math.sin(e.angle);return{a:e.sx*t,b:e.sx*n,c:e.shear*t-e.sy*n,d:e.shear*n+e.sy*t,e:e.e,f:e.f}}function vu(e,t){if(e.length===0)return[];if(e.length===1)return Array.from({length:t},()=>e[0]);let n=e.length-1;return Array.from({length:t},(r,o)=>{let i=(o+.5)/t*n,a=Math.min(n-1,Math.floor(i));return EH(e[a],e[a+1],i-a)})}function Au(e,t,n,r,o){let i=1/0,a=1/0,l=-1/0,s=-1/0,c=0,d=null;for(let S of e){let E=SH(S,t,n);for(let[v,T]of E)i=Math.min(i,v),a=Math.min(a,T),l=Math.max(l,v),s=Math.max(s,T);if(d){let v=0;for(let T=0;T<4;T++){let[H,U]=d[T],[M,L]=E[T];v=Math.max(v,Math.hypot(M-H,L-U))}c+=v}d=E}let f=Math.max(0,Math.floor(i)-2),m=Math.max(0,Math.floor(a)-2),g=Math.min(r,Math.ceil(l)+2),h=Math.min(o,Math.ceil(s)+2),y=g>f&&h>m?{x:f,y:m,w:g-f,h:h-m}:null;return{travel:c,rect:y}}function Fw(e){let t=Math.floor(255/e),n=255-t*e;return Array.from({length:e},(r,o)=>(t+Math.floor((o+1)*n/e)-Math.floor(o*n/e))/255)}var AH=16;function Pw(e,t,n,r,o,i=2,a=128,l=32){let{travel:s}=Au(vu(e,AH),t,n,r,o);return vu(e,Math.min(a,Math.max(l,Math.ceil(s/i))))}function Iw(e,t,n=1.5){let r=Math.min(e.length,Math.max(2,Math.ceil(t/n)));return r>=e.length?e:Array.from({length:r},(o,i)=>{let a=Math.round((i+.5)/r*e.length-.5);return e[a]})}function wu(e,t){let n=new Map,r=new Map,o=new Map,i=s=>{if(!t.has(s)&&n.has(s))return n.get(s)??null;let d=getComputedStyle(s),f=Dw([TH(d,s.offsetWidth,s.offsetHeight),np(d.transform)]),m=null;if(f){let[g=0,h=0]=d.transformOrigin.split(" ").map(y=>parseFloat(y)||0);m=Ra(Eu(Ra(Ho,g,h),f),-g,-h)}return t.has(s)||n.set(s,m),m},a=s=>{if(!s||s===e||!Nw(s))return[0,0];let c=r.get(s);if(!c){let d=s.offsetParent,[f,m]=a(d);c=[f+s.offsetLeft+(d?.clientLeft??0),m+s.offsetTop+(d?.clientTop??0)],r.set(s,c)}return c},l=s=>{if(!s||s===e||!Nw(s))return Ho;let c=o.get(s);if(!c){let d=s.parentElement,[f,m]=a(s),[g,h]=a(d),[y,S]=wH(d);c=Ra(l(d),f-g-y,m-h-S);let E=i(s);E&&(c=Eu(c,E)),o.set(s,c)}return c};return{pose:l,reset(){r=new Map,o=new Map}}}function wH(e){return e?[e.scrollLeft,e.scrollTop]:[0,0]}function Dw(e){let t=null;for(let n of e)n&&(t=t?Eu(t,n):n);return t}var ep=e=>e.trim().split(/\\s+(?![^(]*\\))/);function Lw(e,t){let n=0;for(let r of e.matchAll(/([+-]?\\s*[\\d.]+(?:e[+-]?\\d+)?)(px|%)?/g)){let o=Number(r[1]?.replace(/\\s/g,""));n+=r[2]==="%"?o/100*t:o}return n}var _H={deg:Math.PI/180,rad:1,grad:Math.PI/200,turn:2*Math.PI};function TH(e,t,n){let r=e.translate??"none",o=e.rotate??"none",i=e.scale??"none",a=[];if(r!=="none"){let[s="0",c="0"]=ep(r);a.push({...Ho,e:Lw(s,t),f:Lw(c,n)})}let l=/^(-?[\\d.]+)(deg|rad|grad|turn)$/.exec(o);if(l){let s=Number(l[1])*(_H[l[2]??"deg"]??0);a.push({a:Math.cos(s),b:Math.sin(s),c:-Math.sin(s),d:Math.cos(s),e:0,f:0})}if(i!=="none"){let[s=1,c=s]=ep(i).map(Number);a.push({...Ho,a:s,d:c})}return Dw(a)}function Ow(e){let t=e.translate??"none",n=e.rotate??"none";return t!=="none"&&ep(t).length>2||!/^(none|-?[\\d.]+[a-z]+)$/.test(n)}function np(e){let t=/^matrix(3d)?\\(([^)]*)\\)$/.exec(e.trim());if(!t)return null;let n=(t[2]??"").split(",").map(Number);if(n.some(d=>!Number.isFinite(d)))return null;let r=t[1]?[0,1,4,5,12,13]:[0,1,2,3,4,5];if(n.length!==(t[1]?16:6))return null;let[o=1,i=0,a=0,l=1,s=0,c=0]=r.map(d=>n[d]??0);return{a:o,b:i,c:a,d:l,e:s,f:c}}function Nw(e){return typeof e.offsetLeft=="number"}function Hw(e,t){let n=new OffscreenCanvas(e,t),r=null;try{r=n.getContext("2d",{colorType:"float16"})}catch{r=null}if(r=r??n.getContext("2d"),!r)throw new Error("capture motion blur: no 2D context for the accumulation buffer");return{canvas:n,ctx:r}}function CH(e,t,n){let{travel:r,rect:o}=Au(e.taps,e.w,e.h,t,n);return o!==null&&r>=1}function rp(e,t,n=1){let r=Math.max(1,Math.round(e*n)),o=Math.max(1,Math.round(t*n)),i=Hw(r,o),a=[],l=e*t*4,s=(g,h,y)=>{let S=Math.ceil(h*n),E=Math.ceil(y*n),v=a[g];return(!v||v.canvas.width<S||v.canvas.height<E)&&(v=Hw(Math.max(S,v?.canvas.width??1),Math.max(E,v?.canvas.height??1)),a[g]=v),v};function c(g){return g.map(h=>tp(h.now)!==null&&h.w*h.h<=l&&CH(h,e,t))}function d(g,h,y){h.forEach((S,E)=>{let v=tp(S.now);if(!y[E]||!v)return;let{w:T,h:H}=S,U=s(E,T,H).ctx;U.setTransform(1,0,0,1,0,0),U.globalCompositeOperation="source-over",U.globalAlpha=1,U.clearRect(0,0,Math.ceil(T*n),Math.ceil(H*n)),U.setTransform(n*v.a,n*v.b,n*v.c,n*v.d,n*v.e,n*v.f),U.drawImage(g,0,0,e,t)})}function f(g,h,y){let{w:S,h:E}=h,{travel:v,rect:T}=Au(h.taps,S,E,e,t);if(!T)return 0;let H=Iw(h.taps,v),U=Math.max(0,Math.floor(T.x*n)),M=Math.max(0,Math.floor(T.y*n)),L=Math.min(r,Math.ceil((T.x+T.w)*n))-U,G=Math.min(o,Math.ceil((T.y+T.h)*n))-M;if(L<=0||G<=0)return 0;let C=i.ctx;C.setTransform(1,0,0,1,0,0),C.globalCompositeOperation="source-over",C.globalAlpha=1,C.clearRect(U,M,L,G),C.globalCompositeOperation="lighter";let B=Fw(H.length);return H.forEach((O,Y)=>{C.globalAlpha=B[Y]??0,C.setTransform(n*O.a,n*O.b,n*O.c,n*O.d,n*O.e,n*O.f),C.drawImage(y.canvas,0,0,S*n,E*n,0,0,S,E)}),g.drawImage(i.canvas,U,M,L,G,U,M,L,G),H.length}function m(g,h,y,S){h.setTransform(1,0,0,1,0,0),h.globalAlpha=1,h.globalCompositeOperation="copy",h.drawImage(g,0,0),h.globalCompositeOperation="source-over";let E={blurred:0,taps:0};return y.forEach((v,T)=>{let H=a[T];if(!S[T]||!H)return;let U=f(h,v,H);U>0&&(E.blurred++,E.taps+=U)}),E}return{plan:c,crop:d,draw:m}}var Ma={enable:"data-motion-blur",shutter:"data-motion-blur-shutter",samples:"data-motion-blur-samples",events:"data-motion-blur-events",tier:"data-motion-blur-tier"},RH={shutterDeg:{min:0,max:720,default:240},samples:{min:2,max:64}},Gw=(e,t,n)=>Math.min(n,Math.max(t,e));function Bw(e){if(e===null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Uw(e){let t=Bw(e(Ma.shutter)),n=Bw(e(Ma.samples)),r=e(Ma.tier),{shutterDeg:o,samples:i}=RH;return{enabled:e(Ma.enable)==="on",shutterDeg:Gw(t??o.default,o.min,o.max),samples:n===null?null:Math.round(Gw(n,i.min,i.max)),events:e(Ma.events)==="on",tier:r==="capture"||r==="filter"?r:"auto"}}var MH=256,kH=64,LH=/(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\\([^)]*\\)/g;function $w(e){return[...e.replace(LH," ").matchAll(/-?\\d*\\.?\\d+(?=px|\\s|$)/g)].map(t=>Number(t[0]))}function NH(e){let t=[],n=0,r=0;for(let o=0;o<e.length;o++){let i=e[o];i==="("?n++:i===")"?n--:i===","&&n===0&&(t.push(e.slice(r,o)),r=o+1)}return t.push(e.slice(r)),t}function Ww(e){return!e||e==="none"?0:Math.max(0,...NH(e).filter(t=>!/\\binset\\b/.test(t)).map(t=>{let[n=0,r=0,o=0,i=0]=$w(t);return Math.max(Math.abs(n),Math.abs(r))+o+Math.max(0,i)}))}function FH(e){if(!e||e==="none")return 0;let t=0;for(let n of e.matchAll(/drop-shadow\\(((?:[^()]|\\([^)]*\\))*)\\)/g)){let[r=0,o=0,i=0]=$w(n[1]??"");t=Math.max(t,Math.max(Math.abs(r),Math.abs(o))+i*1.5)}for(let n of e.matchAll(/(?<!-)blur\\(\\s*([\\d.]+)px\\s*\\)/g))t=Math.max(t,Number(n[1])*3);return t}function Vw(e){let t=getComputedStyle(e),n=t.outlineStyle!=="none"?parseFloat(t.outlineWidth)+parseFloat(t.outlineOffset):0;return Math.max(Ww(t.boxShadow),Ww(t.textShadow),FH(t.filter),Number.isFinite(n)?Math.max(0,n):0)}function qw(e){let t=Vw(e),n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let r=0;r<kH&&n.nextNode();r++){let o=n.currentNode;Te(o)&&(t=Math.max(t,Vw(o)))}return Math.min(MH,Math.ceil(t))}var zw=2,PH=.5,IH=240,DH=new Set(["transform","translate","rotate","scale","left","top","right","bottom"]),ip=e=>e.getAttribute("style")??"";function OH(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.getAttribute("data-motion-blur")==="off")return!0;return!1}function HH(e,t){for(let n=e;n&&n!==t;n=n.parentElement){let r=getComputedStyle(n);if(r.transform.startsWith("matrix3d")||r.transformStyle==="preserve-3d"||r.perspective!=="none"||(r.offsetPath??"none")!=="none"||Ow(r))return!0}return!1}function GH(e,t){let n=[];for(let r=e;r&&r!==t;r=r.parentElement){let o=getComputedStyle(r),i=np(o.transform);n.push(i?[i.a,i.b,i.c,i.d].map(a=>a.toFixed(3)).join(","):"1,0,0,1"),n.push(o.rotate??"none",o.scale??"none")}return n.join("|")}function BH(e){let t=getComputedStyle(e);return t.transform!=="none"||(t.translate??"none")!=="none"}function UH(e){let t=new Set;if(typeof document.getAnimations!="function")return t;for(let n of document.getAnimations()){let r=n.effect,o=r?.target;if(!Te(o)||!e.contains(o))continue;(typeof r?.getKeyframes=="function"?r.getKeyframes():[]).some(a=>Object.keys(a).some(l=>DH.has(l)))&&t.add(o)}return t}function WH(e){let t=/^rgba\\(.*,\\s*([\\d.]+)\\)$/.exec(e)??/\\/\\s*([\\d.]+)(%?)\\s*\\)$/.exec(e);return t?t[2]?Number(t[1])/100:Number(t[1]):1}var VH=e=>e.tagName==="IMG"||e.tagName==="CANVAS",ka=32;function $H(e){if("naturalWidth"in e&&!(e.complete&&e.naturalWidth>0))return!0;try{let t=e.ownerDocument.createElement("canvas");t.width=t.height=ka;let n=t.getContext("2d",{willReadFrequently:!0});if(!n)return!0;n.imageSmoothingQuality="high",n.drawImage(e,0,0,ka,ka);let{data:r}=n.getImageData(0,0,ka,ka);for(let o=3;o<r.length;o+=4)if((r[o]??0)<255)return!0;return!1}catch{return!0}}function qH(e,t,n){let r=1;for(let o=e;o&&o!==t;o=o.parentElement)r*=parseFloat(getComputedStyle(o).opacity);return r<.05?!1:r<.99?!0:VH(e)?(n.has(e)||n.set(e,$H(e)),n.get(e)===!0):!/^(VIDEO|PICTURE)$/.test(e.tagName)&&zH(e)}function zH(e){let t=getComputedStyle(e);return WH(t.backgroundColor)>=.99?!1:t.backgroundImage==="none"?!0:[...t.backgroundImage.matchAll(/rgba\\([^)]*,\\s*([\\d.]+)\\)/g)].some(n=>Number(n[1])<.99)}function jw(e,t){return!e||!t||!e.width||!t.width?0:Math.max(Math.abs(e.left-t.left),Math.abs(e.top-t.top),Math.abs(e.right-t.right),Math.abs(e.bottom-t.bottom))}function jH(e,t){let n=e.map(ip);e.forEach((o,i)=>o.setAttribute("style",t[i]??""));let r=e.map(o=>o.getBoundingClientRect());return e.forEach((o,i)=>o.setAttribute("style",n[i]??"")),r}function op({scene:e,durationSeconds:t,fps:n,seek:r,onStep:o,onStepBoxes:i}){r(0);let a=[...e.querySelectorAll("*")].filter(Te),l=new Set(UH(e)),s=a.map(ip),c=a.map(O=>O.getBoundingClientRect()),d=Math.max(1,Math.round(t*n)),f=Math.min(d,IH),m=d/f,g=new Set,h=new Set,y=new Map,S=new Map,E=new Set,v=O=>{y.set(O,Math.max(y.get(O)??0,qw(O)));let Y=GH(O,e),Z=S.get(O);Z===void 0?S.set(O,Y):Z!==Y&&E.add(O),BH(O)||E.add(O)},T=new Set,H=new Map,U=e.getBoundingClientRect(),M=U.width*U.height*PH,L=[];for(let O=0;O<=f;O++){O>0&&r(O/f*t),o?.(O,f);let Y=[],Z=[];a.forEach((V,R)=>{!l.has(V)&&ip(V)===s[R]||(l.has(V)||Z.push(R),l.add(V),Y[R]=V.getBoundingClientRect())}),i?.(O,Y);let J=Z.filter(V=>jw(c[V],Y[V])/m>=zw),D=jH(J.map(V=>a[V]),J.map(V=>s[V]??""));if(J.forEach((V,R)=>{L[V]=D[R]}),Y.forEach((V,R)=>{let k=a[R];!k||jw(L[R],V)/m<zw||(g.has(k)||v(k),g.add(k),V&&M>0&&V.width*V.height>=M&&qH(k,e,H)&&T.add(k))}),O%10===0||O===f)for(let V of g)HH(V,e)&&h.add(V),v(V);L=Y}let G=a.filter(O=>g.has(O)&&!h.has(O)&&!T.has(O)&&!OH(O,e)),C=G.filter(O=>!G.some(Y=>Y!==O&&Y.contains(O))),B=C.length>0&&C.every(O=>!E.has(O));return{movers:C,dynamic:l,pads:y,translationOnly:B}}function Kw(e){let t=2166136261,n=r=>{t=Math.imul(t^r,16777619)};return e.forEach((r,o)=>{if(r)for(let i of[o,r.left,r.top,r.width,r.height])n(Math.round(i*64))}),t}function _u({seek:e,events:t,onStep:n,...r}){let o=s=>e(s,!0);if(!t)return{...op({...r,seek:o,onStep:n}),readEvents:!1};let i=[],a=op({...r,seek:s=>e(s,!1),onStep:n,onStepBoxes:(s,c)=>{i[s]=Kw(c)}}),l=!1;return op({...r,seek:o,onStepBoxes:(s,c)=>{l||(l=Kw(c)!==i[s])}}),{...a,readEvents:l}}var KH=e=>Math.atan2(Math.sin(e),Math.cos(e)),Yw=(e,t,n)=>[e.a*(t/2)+e.c*(n/2)+e.e,e.b*(t/2)+e.d*(n/2)+e.f];function Xw(e,t,n){let{w:r,h:o,now:i,taps:a}=e,l=i.a*i.d-i.b*i.c,s=Math.sqrt(Math.abs(l));if(a.length<2||!(s>1e-4))return null;let c=Yw(i,r,o),d=a.map(Y=>Yw(Y,r,o)),f=d.map(([Y,Z])=>{let J=Y-c[0],D=Z-c[1];return[(i.d*J-i.c*D)/l,(-i.b*J+i.a*D)/l]}),m=0;for(let Y=1;Y<d.length;Y++)m+=Math.hypot((d[Y]?.[0]??0)-(d[Y-1]?.[0]??0),(d[Y]?.[1]??0)-(d[Y-1]?.[1]??0));let g=m/(d.length-1),h=Math.max(...a.map(Y=>Math.abs(KH(Math.atan2(Y.b,Y.a)-Math.atan2(i.b,i.a))))),y=Math.max(...a.map(Y=>Math.abs(Math.log(Math.sqrt(Math.abs(Y.a*Y.d-Y.b*Y.c))/s)))),S=Math.sqrt(r*o)*s,E=Math.min(24*(n/1920),.29*Math.min(n/4,S/2)*(h+y)),v=f[0]??[0,0],T=f[f.length-1]??[0,0],H=Math.hypot(T[0]-v[0],T[1]-v[1])||1,U=.35*g/s,M=[Math.hypot(E/s,U*Math.abs(T[0]-v[0])/H),Math.hypot(E/s,U*Math.abs(T[1]-v[1])/H)];if(m<.5&&Math.max(...M)*s<.35)return null;let L=f.map(Y=>Y[0]),G=f.map(Y=>Y[1]),C=t+3*Math.max(...M)+2,B=Math.min(0,...L)-C,O=Math.min(0,...G)-C;return{offsets:f,sigma:M,region:{x:B,y:O,w:r+Math.max(0,...L)+C-B,h:o+Math.max(0,...G)+C-O}}}function Tu(e){let{reader:t,shutterSeconds:n,t:r,reads:o,seek:i}=e,a=e.movers.filter(d=>typeof d.checkVisibility!="function"||d.checkVisibility({visibilityProperty:!0}));if(a.length===0||n<=0)return{els:[],frames:[]};let l=r-n/2,s=a.map(()=>[]);for(let d=0;d<o;d++)i(Math.max(0,l+d/(o-1)*n)),t.reset(),a.forEach((f,m)=>s[m]?.push(t.pose(f)));(e.restore??i)(r),t.reset();let c=a.map((d,f)=>{let m=e.pads?.get(d)??0,g=d.offsetWidth+2*m,h=d.offsetHeight+2*m,y=E=>Ra(E,-m,-m),S=(s[f]??[Ho]).map(y);return{w:g,h,now:y(t.pose(d)),taps:e.taps===null?Pw(S,g,h,e.frameW,e.frameH):vu(S,e.taps)}});return t.reset(),{els:a,frames:c}}var Qw="http://www.w3.org/2000/svg",Zw=32,YH=4,XH=8,e_="hf-mb",JH=new RegExp(`\\\\s*url\\\\("?#${e_}-\\\\d+"?\\\\)`,"g");function La(e,t,n){let r=document.createElementNS(Qw,t);for(let[o,i]of Object.entries(n))r.setAttribute(o,i);return e.append(r),r}function QH(e,t,n){let r=`${e_}-${t}`,o=La(e,"filter",{id:r,"color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse"}),i=Array.from({length:Zw},(d,f)=>La(o,"feOffset",{in:"SourceGraphic",result:`s${f}`})),a=i.map((d,f)=>`s${f}`);for(let d=0;a.length>1;d++){let f=[];for(let m=0;m<a.length;m+=2){let g=`l${d}-${m/2}`;La(o,"feComposite",{operator:"arithmetic",in:a[m]??"",in2:a[m+1]??"",k1:"0",k2:"0.5",k3:"0.5",k4:"0",result:g}),f.push(g)}a=f}let l=La(o,"feGaussianBlur",{in:a[0]??"",stdDeviation:"0"}),s=n.style.filter;n.style.filter="";let c=getComputedStyle(n).filter;return n.style.filter=s,{filter:o,offsets:i,soften:l,url:`url(#${r})`,css:c&&c!=="none"?c:""}}function ZH(e,t){t.offsets.forEach(([a,l],s)=>{e.offsets[s]?.setAttribute("dx",a.toFixed(2)),e.offsets[s]?.setAttribute("dy",l.toFixed(2))}),e.soften.setAttribute("stdDeviation",`${t.sigma[0].toFixed(3)} ${t.sigma[1].toFixed(3)}`);let{x:n,y:r,w:o,h:i}=t.region;e.filter.setAttribute("x",n.toFixed(1)),e.filter.setAttribute("y",r.toFixed(1)),e.filter.setAttribute("width",o.toFixed(1)),e.filter.setAttribute("height",i.toFixed(1))}var Jw=e=>e.style.filter.replace(JH,"").trim();function ap(e,t,n){let{root:r}=e,o=Number(r.getAttribute("data-width"))||r.offsetWidth,i=Number(r.getAttribute("data-height"))||r.offsetHeight,a=J=>e.seek(J,!t.events),l=!1,s=J=>e.seek(J,!l),c=null,d=[],f=new Map,m=null,g,h=0,y=0,S=0,E=!1,v=!1,T=new Map,H=new Set;function U(J){g=e.timeline();let D=performance.now(),V=_u({scene:r,durationSeconds:e.durationSeconds(),fps:e.fps,seek:e.seek,events:t.events});a(J),l=V.readEvents,d=V.movers,f=V.pads,m=wu(r,V.dynamic),h=Math.round(performance.now()-D)}function M(J){let D=Jw(J);D?J.style.filter=D:J.style.removeProperty("filter"),H.delete(J)}function L(){for(let J of[...H])M(J)}function G(J){let D=T.get(J);return D||(c||(c=document.createElementNS(Qw,"svg"),c.setAttribute("width","0"),c.setAttribute("height","0"),c.setAttribute("aria-hidden","true"),c.setAttribute("data-hf-ignore",""),c.style.cssText="position:absolute;left:0;top:0;pointer-events:none",La(c,"defs",{}),r.append(c)),D=QH(c.querySelector("defs")??c,T.size,J),T.set(J,D),D)}function C(J,D){let V=G(J);ZH(V,D);let R=Jw(J)||V.css;J.style.filter=R?`${R} ${V.url}`:V.url,H.add(J)}function B(J,D){if((!m||e.timeline()!==g)&&U(J),!m)return[];let V=Tu({movers:d,reader:m,seek:s,restore:l?void 0:e.holdFrame?.(),t:J,reads:D?XH:YH,shutterSeconds:t.shutterDeg/360/e.fps,taps:Zw,frameW:o,frameH:i}),R=[];return V.els.forEach((k,F)=>{let _=V.frames[F],N=_&&Xw(_,f.get(k)??0,o);N&&R.push([k,N])}),R}function O(J,D){if(D&&(E=!0),v)return Promise.resolve();let V=performance.now();try{let R=B(J,D),k=new Set(R.map(([F])=>F));for(let[F,_]of R)C(F,_);for(let F of[...H])k.has(F)||M(F);y++,S+=performance.now()-V}catch(R){$("runtime.captureMotionBlur.filter",R),L()}return Promise.resolve()}function Y(){return{state:"on",tier:"filter",reason:n?.reason??null,reasonCode:n?.code??null,movers:d.length,moverNames:d.map(J=>`${J.tagName.toLowerCase()}${J.id?`#${J.id}`:""}`),scanMs:h,shutterDeg:t.shutterDeg,frames:y,meanMs:y?Math.round(S/y*10)/10:0,failures:0,failedFrames:0}}function Z(){L(),c?.remove(),c=null,T.clear()}return{root:r,paint:O,probe:()=>((!m||e.timeline()!==g)&&U(e.now()),Y()),rest:()=>E?!1:(L(),!0),arm:()=>{},finish:()=>{},teardown:Z,suspend:()=>{v=!0,Z()},report:Y,busy:()=>!1,rediscover:()=>{m=null}}}function t_(e){if(e.defect?.code==="renderer-off")return"off";let t=e.form&&!e.defect;return e.fallback&&(e.tier==="filter"||!t)?"filter":t?"capture":"off"}var sp="data-hf-motion-blur-hide",ir="data-hf-motion-blur-only",Go="data-hf-motion-blur-mover",eG=4,tG=8,n_=2e3,nG=3,rG=25;function oG(e){let t=Uw(a=>e.getAttribute(a));if(!t.enabled)return null;let{shutterDeg:n,samples:r,events:o,tier:i}=t;return{shutterDeg:n,samples:r,events:o,tier:i}}var o_=Rw,cp=Mw;function iG(e){let t=window[_w];return t?{code:"renderer-off",reason:`the renderer turned it off (${String(t)})`}:Cw()?Su(e,{isAccelerated:cp,backface:Aw(e)}):{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"}}function aG(e){let t=typeof e.className=="string"&&e.className?`.${e.className.trim().split(/\\s+/).join(".")}`:"";return`${e.tagName.toLowerCase()}${e.id?`#${e.id}`:""}${t}`}function sG(e){let t=Number(e.getAttribute("data-width"))||e.offsetWidth,n=Number(e.getAttribute("data-height"))||e.offsetHeight;return{width:Math.max(1,Math.round(t)),height:Math.max(1,Math.round(n))}}function Cu(){let e=Number(window[Tw]),t=e>0?e:window.devicePixelRatio;return Number.isFinite(t)&&t>0?t:1}function r_(e,t,n){let r=document.createElement("canvas");return r.width=Math.max(1,Math.round(e*Cu())),r.height=Math.max(1,Math.round(t*Cu())),r.setAttribute("data-hf-ignore",""),r.setAttribute("data-hf-motion-blur",n),r.style.cssText=`position:absolute;left:0;top:0;width:${e}px;height:${t}px;`,r}function lG(e,t,n){let{root:r}=e,{width:o,height:i}=sG(r),a=r_(o,i,"capture"),l=r_(o,i,"output");l.style.pointerEvents="none",bu(a,n);let s=a.getContext("2d"),c=l.getContext("2d");if(!s||!c)throw new Error("capture motion blur: no 2D context");let d=s,f=c,m=Cu(),g=rp(o,i,m),h=document.createElement("style");h.setAttribute("data-hf-ignore",""),h.textContent=[`[${sp}] { opacity: 0 !important; }`,`[${ir}] { background: none !important; border-color: transparent !important; box-shadow: none !important; outline-color: transparent !important; }`,`[${ir}]::before, [${ir}]::after, [${ir}] *:not([${Go}], [${Go}] *) { visibility: hidden !important; }`,`[${ir}] [${Go}] { visibility: visible !important; }`].join(`\n`);let y=[],S=new Map,E=null,v=null,T=null,H=0,U=0,M=0,L=null,G=null,C=!1,B=[],O=0,Y=0,Z,J=null,D=()=>!1,V=!1,R=new Set,k=!1,F=!1;function _(te){(e.ignoreMutations??(he=>he()))(te),e.seek(e.now(),!0)}function N(){k||(_(()=>{r.before(a),a.append(r),yu(r,n),a.after(l),document.head.append(h)}),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,l.width,l.height),k=!0)}function j(){T?.release(),T=null,v&&(fe(v),v.settle(),v=null),k&&(k=!1,_(()=>{h.remove(),ew(r,n),a.before(r),a.remove(),l.remove()}))}let ae=te=>e.seek(te,!t.events),de=!1,ve=te=>e.seek(te,!de);function z(te){Z=e.timeline();let he=e.durationSeconds(),Ie=ww(r,cp),it=performance.now(),mt=_u({scene:r,durationSeconds:he,fps:e.fps,seek:e.seek,events:t.events,onStep:(Vt,_n)=>Ie.sample(Vt,_n,Vt/_n*he)});ae(te),de=mt.readEvents,J=Ie.result(),D=Ie.facesNow,y=mt.movers,S=mt.pads,V=mt.translationOnly,E=wu(r,mt.dynamic),Y=Math.round(performance.now()-it)}function ee(te,he){return E?Tu({movers:y,reader:E,seek:ve,restore:de?void 0:e.holdFrame?.(),t:te,reads:he,shutterSeconds:t.shutterDeg/360/e.fps,taps:t.samples,pads:S,frameW:o,frameH:i}):{els:[],frames:[]}}let Q=()=>{d.reset(),d.drawElementImage(r,0,0)},fe=te=>{r.removeAttribute(ir);for(let he of te.els)he.removeAttribute(sp),he.removeAttribute(Go)},ce=te=>{r.setAttribute(ir,""),te.els.forEach((he,Ie)=>te.kept[Ie]&&he.setAttribute(Go,""))},xe=te=>{r.removeAttribute(ir),te.els.forEach((he,Ie)=>{he.removeAttribute(Go),te.kept[Ie]&&he.setAttribute(sp,"")})};function re(te=!1){let he=v;if(!he||L||!he.armed)return;let Ie=performance.now(),it=!0;try{it=ot(he,te),U=0}catch(mt){ie(mt)}if(he.ms+=performance.now()-Ie,!it&&!L){a.requestPaint();return}B.push(O+he.ms),B.length>600&&B.shift(),Be(he)}function ie(te){U++,$("runtime.captureMotionBlur.compose",te),Me(te instanceof Error?te.message:String(te)),F?j():U>=nG&&xt(`capture failed ${U} times in a row`,"capture-failures",!0)}function ot(te,he){Q();try{if(te.phase==="sharp")return g.draw(a,f,te.frames,te.kept),!0;if(he)throw new Error(`the ${te.phase} capture did not arrive`);return te.phase==="movers"?(g.crop(a,te.frames,te.kept),xe(te),te.phase="background",!1):(g.draw(a,f,te.frames,te.kept),!0)}finally{d.reset()}}function Be(te){fe(te),v===te&&(v=null),te.settle();let he=T;T=null,he&&!L?$a(he.t,he.engineMode).then(he.release):he?.release()}let Ee=()=>re();function Me(te){M++,M%rG===1&&globalThis.console.info(`[motion-blur] capture failed (${M} so far): ${te}`)}function Pe(te){Me(`no paint within ${n_} ms`),j(),Be(te)}a.addEventListener("paint",Ee);function xt(te,he,Ie=!1){L||(L=te,G=he,C=Ie,globalThis.console.warn(`[motion-blur] off: ${te}`),cr())}function cr(){a.removeEventListener("paint",Ee),j()}function wn(){!L||C||(L=null,G=null,E=null,a.addEventListener("paint",Ee))}function qr(){L&&e.timeline()!==Z&&wn()}function qu(te,he){if(qr(),L)return Promise.resolve();if(he&&(F=!0),!F&&document.visibilityState==="hidden")return j(),Promise.resolve();if(v&&!he){let Ie=T;return new Promise(it=>{T={t:te,engineMode:he,release:()=>{Ie?.release(),it()}}})}return $a(te,he)}function zu(){let te=Cu();if(te!==m){m=te;for(let he of[a,l])he.width=Math.max(1,Math.round(o*m)),he.height=Math.max(1,Math.round(i*m));g=rp(o,i,m)}}function Wa(){return L?{code:G??"capture-failures",reason:L}:t.tier==="auto"&&E&&V&&uG()?{code:"translation-only",reason:"every mover only translates, which the filter tier draws as well and far cheaper"}:null}function Va(te){return(!E||e.timeline()!==Z)&&z(te),J&&xt(J.reason,J.code),L!==null}function ju(te){return j(),M++,R.has(te.code)||(R.add(te.code),globalThis.console.info(`[motion-blur] sharp frame: ${te.code} appeared after a clean scan`)),Promise.resolve()}function $a(te,he){try{if(zu(),Va(te)||Wa())return Promise.resolve();if(y.length===0)return j(),Promise.resolve();let Ie=Su(r,{isAccelerated:cp,backface:D()});if(Ie)return ju(Ie);N();let it=performance.now(),mt=ee(te,he?tG:eG),Vt=g.plan(mt.frames);return O=performance.now()-it,v&&Be(v),new Promise(_n=>{let Yo=++H,Xo,Ke=()=>{Xo=setTimeout(()=>{v?.seq===Yo?Pe(v):_n()},n_)};v={seq:Yo,els:mt.els,frames:mt.frames,kept:Vt,phase:Vt.some(Boolean)?"movers":"sharp",armed:!he,startTimer:Ke,ms:0,settle:()=>{clearTimeout(Xo),_n()}},v.phase==="movers"&&!he&&ce(v),!he&&(Ke(),a.requestPaint())})}catch(Ie){return $("runtime.captureMotionBlur.paint",Ie),xt(Ie instanceof Error?Ie.message:String(Ie),"capture-failures",!0),Promise.resolve()}}function zr(){let te=B.length?B.reduce((he,Ie)=>he+Ie,0)/B.length:0;return{state:L?"off":"on",tier:L?null:"capture",reason:L,reasonCode:G,movers:y.length,moverNames:y.map(aG),scanMs:Y,shutterDeg:t.shutterDeg,frames:B.length,meanMs:Math.round(te*10)/10,failures:U,failedFrames:M}}function ft(){return qr(),L||Va(e.now()),zr()}return{root:r,paint:qu,probe:ft,rest:()=>F?!1:(j(),!0),arm:()=>{!v||v.armed||(v.armed=!0,v.phase==="movers"&&ce(v),v.startTimer(),a.requestPaint())},finish:()=>{v&&(v.armed=!0),re(!0)},teardown:cr,suspend:j,handOff:Wa,report:zr,busy:()=>v!==null,rediscover:()=>{E=null,wn()}}}var ke=null,dp=null,fp=null,Ru=!1,pp=!0,uG=()=>pp,i_=!1,lp=null,up=null;function a_(e){let t=oG(e.root),n=window;if(ke&&(ke.root!==e.root||!t)&&(ke.teardown(),ke=null,delete n.__hfMotionBlur),!!t){if(ke&&Ru&&(ke.teardown(),ke=null,Ru=!1),ke){ke.rediscover();return}dp=e,fp=t,dG(e,t,n),pG(n,t)}}var cG={code:"tier-attribute",reason:\'data-motion-blur-tier="filter"\'};function dG(e,t,n){let r=Do(),o=iG(e.root),i=t_({tier:t.tier,form:r!==null,defect:o,fallback:pp});i==="filter"?fG(e,t,t.tier==="filter"?cG:o):i==="capture"&&r?ke=lG(e,t,r):mG(n,t,o)}function fG(e,t,n){let r=n??{code:"unsupported-browser",reason:"html-in-canvas (drawElementImage) is unavailable in this browser"};ke=ap(e,t,r),Ru=!0,globalThis.console.info(`[motion-blur] filter fallback: ${r.reason} (Chrome ${Qm()??"unknown"})`)}function mG(e,t,n){globalThis.console.info(`[motion-blur] off: ${n?.reason??null} (Chrome ${Qm()??"unknown"})`);let r=()=>mp(t,n);e.__hfMotionBlur={report:r,probe:r,suspend:c_}}function mp(e,t){return{state:"off",tier:null,reason:t?.reason??null,reasonCode:t?.code??null,movers:0,moverNames:[],scanMs:0,shutterDeg:e.shutterDeg,frames:0,meanMs:0,failures:0,failedFrames:0}}function pG(e,t){ke&&(e.__hfMotionBlur={report:()=>ke?.report()??mp(t,null),probe:()=>(ke?.probe(),s_(),ke?.probe()??mp(t,null)),suspend:c_})}function s_(){let e=ke?.handOff?.();!pp||!ke||!e||!dp||!fp||(ke.teardown(),ke=ap(dp,fp,e),Ru=!0,globalThis.console.info(`[motion-blur] filter fallback: ${e.reason}`))}function Bo(e,t){if(!ke||i_)return null;let n=t?.engineMode===!0;if(!n&&!t?.playing&&ke.rest())return null;let r=ke.paint(e,n);if(ke.handOff?.()){if(s_(),!n&&!t?.playing&&ke.rest())return null;r=ke.paint(e,n)}return n&&ke.busy()&&hG(),r}function l_(){return ke?.busy()??!1}function u_(){ke?.arm()}function hG(){let e=window,t=e.__hf_page_composite_resolve;t!==up&&(lp=typeof t=="function"?t:null,up=()=>(lp&&lp(),ke?.finish(),e.__hf_page_composite_pending=!1,!0),e.__hf_page_composite_resolve=up),e.__hf_page_composite_pending=!0}function c_(){i_=!0,ke?.suspend()}var gG=500,bG=33,yG=3,Mu=class{constructor(t){be(this,"_baseTime",0);be(this,"_playStartMs",null);be(this,"_rate",1);be(this,"_duration",1/0);be(this,"_playStart",0);be(this,"_playEnd",1/0);be(this,"_playHold",1/0);be(this,"_nowMs");be(this,"_audioSource",null);be(this,"_lastReadMs",null);be(this,"_lastNow",0);this._baseTime=t?.initialTime??0,this._rate=t?.rate??1,this._duration=t?.duration??1/0,this._nowMs=t?.nowMs??(()=>performance.now())}now(){if(this._playStartMs===null)return this._baseTime;if(this._audioSource){let r=null;if("currentTimeSeconds"in this._audioSource?r=this._audioSource.currentTimeSeconds:r=this._elementTimeNeverBehind(this._audioSource),r!==null){let o=Math.min(r,this.getEnd());return this._baseTime=Math.max(0,o),this._playStartMs=this._nowMs(),this._lastReadMs=null,this._lastNow=this._baseTime,this._baseTime}}this._applyStallCorrection();let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return this._lastNow=Math.max(0,Math.min(n,this.getEnd())),this._lastNow}_elementTimeNeverBehind(t){let{el:n,compositionStart:r,mediaStart:o,rate:i}=t;if(n.paused||!Number.isFinite(n.currentTime)||n.seeking)return null;let a=i??1,l=cn(a,n.currentTime-o)+r;return l>=this._lastNow?l:!(n.loop&&this._lastNow-l>cn(a,n.duration)/2)&&n.readyState<yG?this._lastNow:null}_applyStallCorrection(){if(this._playStartMs===null)return;let t=this._nowMs();if(this._lastReadMs!==null){let n=t-this._lastReadMs;n>gG&&(this._playStartMs+=n-bG)}this._lastReadMs=t}play(){return this._playStartMs!==null||this._baseTime>=this.getEnd()?!1:(this._playStartMs=this._nowMs(),this._lastNow=this._baseTime,this._lastReadMs=null,!0)}pause(){return this._playStartMs===null?!1:(this._baseTime=this.now(),this._playStartMs=null,!0)}seek(t){let n=Number.isFinite(this._duration)?Math.max(0,Math.min(t,this._duration)):Math.max(0,t);this._baseTime=n,this._lastNow=n,this._playStartMs!==null&&(this._playStartMs=this._nowMs(),this._lastReadMs=null)}isPlaying(){return this._playStartMs!==null}setRate(t){let n=Number.isFinite(t)&&t>0?Math.max(.1,Math.min(5,t)):1;this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._rate=n}getRate(){return this._rate}setDuration(t){this._duration=Number.isFinite(t)&&t>0?t:1/0,this._baseTime>this._duration&&(this._baseTime=this._duration)}getDuration(){return this._duration}setPlayRange(t,n,r){this._playStart=Number.isFinite(t)&&t>0?t:0,this._playEnd=n!==null&&Number.isFinite(n)&&n>this._playStart?n:1/0,this._playHold=eb(this._playStart,this._playEnd,r)}getPlayStart(){return this._playStart}getEnd(){return Math.min(this._duration,this._playEnd)}getStopTime(){return this._playEnd<this._duration?this._playHold:this.getEnd()}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs(),this._lastReadMs=null),this._audioSource=null}audioElement(){return this._audioSource&&"el"in this._audioSource?this._audioSource.el:null}hasAudioSource(){return this._audioSource!==null}getSource(){if(this._audioSource&&this._playStartMs!==null){if("currentTimeSeconds"in this._audioSource)return"audio";let{el:t}=this._audioSource;if(!t.paused&&Number.isFinite(t.currentTime))return"audio"}return"monotonic"}followedClock(){return this.getSource()==="monotonic"?"monotonic":this._audioSource&&"webAudio"in this._audioSource&&this._audioSource.webAudio?"webaudio":"audio"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){let t=this.now();return t>=this.getEnd()||this._playStartMs===null&&t>=this.getStopTime()}};var xG=100,SG=8,EG=4096,hp=e=>e;function vG(e,t,n){return!ed(e)&&t==="linear"&&!n}function AG(e){let t=Math.ceil(e*xG);return Math.min(EG,Math.max(SG,t))}function wG(e,t,n,r,o){let{scheduledAt:i,elapsed:a,rate:l}=r,s=o??hp,c=v=>i+(v-a)/l,d=e.points[t],f=e.points[t+1],m=c(f.t);if(m<=i)return null;let g=Math.max(i,c(d.t)),h=m-g;if(h<=0)return null;if(vG(d,n,o))return{kind:"ramp",time:m,value:s(f.v)};let y=AG(h),S=D0(e,Math.max(d.t,a),f.t,y,n),E=new Float32Array(y);for(let v=0;v<y;v+=1)E[v]=s(S[v]??0);return{kind:"curve",time:g,duration:h,values:E}}function _G(e,t,n,r){let o=[];for(let a=0;a+1<e.points.length;a+=1){let l=wG(e,a,t,n,r);l&&o.push(l)}let i=o[0];return i?.kind==="curve"&&i.time<=n.scheduledAt||o.unshift({kind:"set",time:n.scheduledAt,value:(r??hp)(jt(e,n.elapsed,t))}),o}function TG(e,t){e.cancelScheduledValues(0);for(let n of t)n.kind==="set"?e.setValueAtTime(n.value,n.time):n.kind==="ramp"?e.linearRampToValueAtTime(n.value,n.time):(e.setValueAtTime(n.values[0]??0,n.time),e.linearRampToValueAtTime(n.values[n.values.length-1]??0,n.time+n.duration))}function CG(e,t){for(let n of t)if(n.kind==="set")e.setValueAtTime(n.value,n.time);else if(n.kind==="ramp")e.linearRampToValueAtTime(n.value,n.time);else try{e.setValueCurveAtTime(n.values,n.time,n.duration)}catch{TG(e,t);return}}function Uo(e){for(let t of e)t.param.cancelScheduledValues(0)}function Wo(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function gp(e,t,n,r){if(t.points.length!==0)for(let o of e){if(Uo([o]),I0(t)){let i=(o.map??hp)(t.points[0].v);o.param.setValueAtTime(i,r.scheduledAt);continue}CG(o.param,_G(t,n,r,o.map))}}function d_(e,t,n,r,o){let i=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=Ei(l.target);if(!s)continue;let c=s.kind==="preset"?o?.[s.presetId]:s.kind==="fx"?i.get(s.nodeId)?.automation?.[s.param]:void 0;if(!c||c.length===0)continue;let d=td(l.target,t);d&&(gp(c,l,d.scale,r),a.push(...c))}return a}function f_(e){return e.lanes.find(t=>t.target===oo)??null}var m_=`\nconst TP_OS = 4;\nconst TP_HALF = 64;\nconst TP_BRANCH = 33;\nconst TP_DELAY = 16;\n\nfunction besselI0(x) {\n let sum = 1, term = 1;\n for (let k = 1; k < 40; k++) {\n term *= (x / (2 * k)) * (x / (2 * k));\n sum += term;\n }\n return sum;\n}\n\n/** Kaiser-windowed sinc, one array per polyphase branch, newest tap first. */\nfunction tpBranches() {\n const beta = 6;\n const norm = besselI0(beta);\n const branches = [];\n for (let p = 0; p < TP_OS; p++) {\n const taps = new Float64Array(TP_BRANCH);\n let sum = 0;\n for (let j = 0; j < TP_BRANCH; j++) {\n const k = p + TP_OS * j;\n if (k > 2 * TP_HALF) continue;\n const t = (k - TP_HALF) / TP_OS;\n const sinc = t === 0 ? 1 : Math.sin(Math.PI * t) / (Math.PI * t);\n const r = (k - TP_HALF) / TP_HALF;\n taps[j] = sinc * (besselI0(beta * Math.sqrt(Math.max(0, 1 - r * r))) / norm);\n sum += taps[j];\n }\n // Unity gain at DC on every branch, so a steady level reads as itself.\n for (let j = 0; j < TP_BRANCH; j++) taps[j] /= sum;\n branches.push(taps);\n }\n return branches;\n}\n\nclass HfTruePeak extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.look = Math.max(1, Math.round((this.p.lookahead ?? 3) * sampleRate / 1000));\n this.delayLen = this.look + TP_DELAY;\n this.branches = tpBranches();\n this.setLevels();\n this.clear();\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n if (e.data && e.data.__hfReset) { this.clear(); return; }\n this.p = { ...this.p, ...e.data };\n this.setLevels();\n };\n }\n /** Back to the state of a fresh processor: no audio in the delay line, no gain reduction. */\n clear() {\n this.ch = [];\n this.rel = 1;\n this.dqIdx = new Int32Array(this.look + 2);\n this.dqVal = new Float64Array(this.look + 2);\n this.dqHead = 0;\n this.dqTail = 0;\n this.t = 0;\n this.avgRing = new Float64Array(this.look + 1).fill(1);\n this.avgPos = 0;\n this.avgSum = this.look + 1;\n }\n setLevels() {\n this.ceiling = Math.pow(10, (this.p.ceiling ?? -1) / 20);\n this.relCoef = 1 - Math.exp(-1 / (sampleRate * Math.max(1e-4, (this.p.release ?? 80) / 1000)));\n }\n channel(c) {\n if (!this.ch[c]) {\n this.ch[c] = {\n delay: new Float32Array(this.delayLen),\n w: 0,\n hist: new Float32Array(TP_BRANCH * 2),\n pos: 0,\n };\n }\n return this.ch[c];\n }\n /** Largest interpolated magnitude across channels for the newest sample. */\n peak(chans, inputs, n) {\n let peak = 0;\n for (let c = 0; c < chans; c++) {\n const s = this.channel(c);\n const x = inputs[c][n];\n s.pos = (s.pos + 1) % TP_BRANCH;\n s.hist[s.pos] = x;\n s.hist[s.pos + TP_BRANCH] = x;\n const base = s.pos + TP_BRANCH;\n for (let p = 0; p < TP_OS; p++) {\n const taps = this.branches[p];\n let acc = 0;\n for (let j = 0; j < TP_BRANCH; j++) acc += taps[j] * s.hist[base - j];\n const a = acc < 0 ? -acc : acc;\n if (a > peak) peak = a;\n }\n }\n return peak;\n }\n /** Windowed minimum of the required gain over the last look + 1 values. */\n windowMin(v) {\n const cap = this.dqIdx.length;\n while (this.dqTail !== this.dqHead && this.dqVal[(this.dqTail + cap - 1) % cap] >= v) {\n this.dqTail = (this.dqTail + cap - 1) % cap;\n }\n this.dqIdx[this.dqTail] = this.t;\n this.dqVal[this.dqTail] = v;\n this.dqTail = (this.dqTail + 1) % cap;\n while (this.dqIdx[this.dqHead] <= this.t - (this.look + 1)) {\n this.dqHead = (this.dqHead + 1) % cap;\n }\n this.t++;\n return this.dqVal[this.dqHead];\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const chans = i.length;\n const frames = i[0].length;\n for (let n = 0; n < frames; n++) {\n const peak = this.peak(chans, i, n);\n const need = peak > this.ceiling ? this.ceiling / peak : 1;\n const m = this.windowMin(need);\n this.avgSum += m - this.avgRing[this.avgPos];\n this.avgRing[this.avgPos] = m;\n this.avgPos = (this.avgPos + 1) % this.avgRing.length;\n const target = Math.min(1, this.avgSum / this.avgRing.length);\n const released = this.rel + (1 - this.rel) * this.relCoef;\n this.rel = released < target ? released : target;\n if (target >= 1 && this.rel > 0.9999999) this.rel = 1;\n for (let c = 0; c < chans; c++) {\n const s = this.channel(c);\n o[c][n] = s.delay[s.w] * this.rel;\n s.delay[s.w] = i[c][n];\n s.w = (s.w + 1) % this.delayLen;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-truepeak", HfTruePeak);\n`;var RG=`\nconst dbToLin = (db) => Math.pow(10, db / 20);\n\n/**\n * One-pole envelope followers, one per channel.\n *\n * Per channel matters: the followers advance once per sample, so a single shared\n * follower stepped once per channel per sample. On stereo that ran a 20 ms attack\n * as 10 ms, and gave the right channel a gain computed from an envelope that had\n * already traversed the left, so the two channels ducked by different amounts\n * from the same input and the image pumped.\n */\nclass EnvBank {\n constructor(attackMs, releaseMs) { this.set(attackMs, releaseMs); this.values = []; }\n set(attackMs, releaseMs) {\n this.a = Math.exp(-1 / (sampleRate * Math.max(1e-5, attackMs / 1000)));\n this.r = Math.exp(-1 / (sampleRate * Math.max(1e-5, releaseMs / 1000)));\n }\n push(ch, x) {\n const prev = this.values[ch] ?? 0;\n const m = Math.abs(x);\n const c = m > prev ? this.a : this.r;\n const next = m + c * (prev - m);\n this.values[ch] = next;\n return next;\n }\n}\n\n/** Soft-knee gain computer in dB, matching acompressor\'s shape. */\nfunction kneeGain(envDb, thresholdDb, ratio, kneeDb) {\n const over = envDb - thresholdDb;\n if (kneeDb > 0 && over > -kneeDb && over < kneeDb) {\n const t = (over + kneeDb) / (2 * kneeDb);\n return -((1 - 1 / ratio) * kneeDb * t * t);\n }\n return over > 0 ? -(over * (1 - 1 / ratio)) : 0;\n}\n\n// log10/exp per sample is the single most expensive thing a dynamics processor\n// can do on the audio thread, and every sample below the knee needs neither:\n// its gain is exactly unity. Comparing envelopes in the linear domain lets the\n// quiet majority of samples skip the transcendentals entirely.\nconst LN10_OVER_20 = Math.LN10 / 20;\nconst dbToLinFast = (db) => Math.exp(db * LN10_OVER_20);\n\nclass HfCompressor extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 20, this.p.release ?? 250);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 20, this.p.release ?? 250);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const makeup = dbToLin(p.makeup ?? 0);\n const mix = p.mix ?? 1;\n // Knee is expressed as a ratio in FFmpeg; convert to dB width.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const thresholdDb = p.threshold ?? -24;\n const ratio = p.ratio ?? 4;\n // Below this the gain computer returns unity, so the sample needs no\n // logarithm at all.\n const kneeStartLin = dbToLin(thresholdDb - kneeDb);\n const dry = 1 - mix;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n // Per-channel follower, and the sub-knee shortcut: below the knee the\n // gain is exactly unity, so the sample needs no logarithm at all.\n const env = this.env.push(ch, x);\n if (env <= kneeStartLin) {\n out[n] = x * makeup * mix + x * dry;\n continue;\n }\n const envDb = 20 * Math.log10(env);\n const g = dbToLinFast(kneeGain(envDb, thresholdDb, ratio, kneeDb));\n out[n] = x * g * makeup * mix + x * dry;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-compressor", HfCompressor);\n\nclass HfLimiter extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 5, this.p.release ?? 50);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 5, this.p.release ?? 50);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const ceiling = dbToLin(this.p.limit ?? -1);\n const outGain = dbToLin(this.p.level_out ?? 0);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n // Only ever attenuate: a limiter that can raise level is a compressor.\n const g = env > ceiling ? ceiling / env : 1;\n out[n] = x * g * outGain;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-limiter", HfLimiter);\n\nclass HfGate extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.env = new EnvBank(this.p.attack ?? 1, this.p.release ?? 100);\n this.gains = [];\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n this.env.set(this.p.attack ?? 1, this.p.release ?? 100);\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const threshold = dbToLin(p.threshold ?? -35);\n const floor = dbToLin(p.range ?? -24);\n const ratio = p.ratio ?? 10;\n // Knee is declared in the registry as a ratio, like the compressor\'s; a\n // hard threshold ignored it and chattered on material sitting right at the\n // gate point.\n const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));\n const kneeLin = dbToLin((p.threshold ?? -35) + kneeDb);\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n for (let n = 0; n < inp.length; n++) {\n const x = inp[n];\n const env = this.env.push(ch, x);\n let target = 1;\n // Above the threshold the gate is fully open; skip the pow entirely.\n if (env < threshold) {\n const under = env > 1e-9 ? threshold / env : 1e9;\n target = Math.max(floor, 1 / Math.pow(under, ratio - 1));\n if (!isFinite(target)) target = floor;\n }\n // Smooth toward the target so the gate does not click on every sample.\n const held = this.gains[ch] ?? 1;\n const c = target < held ? this.env.r : this.env.a;\n const smoothed = target + c * (held - target);\n this.gains[ch] = smoothed;\n out[n] = x * smoothed;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-gate", HfGate);\n\nclass HfBitcrush extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.holds = [];\n this.held = [];\n this.start = Math.round((this.p.__hfElapsed ?? 0) * sampleRate);\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const levels = Math.pow(2, (p.bits ?? 8) - 1);\n const step = Math.max(1, Math.round(p.samples ?? 1));\n const mix = p.mix ?? 1;\n for (let ch = 0; ch < i.length; ch++) {\n const inp = i[ch], out = o[ch];\n // Primed from the input: a counter seeded mid-hold would otherwise play 0 until it wraps.\n if (this.held[ch] === undefined) this.held[ch] = Math.round(inp[0] * levels) / levels;\n // The hold counter runs from the file\'s first sample, so a node built part-way in starts where it would be.\n if (this.holds[ch] === undefined) this.holds[ch] = this.start % step;\n for (let n = 0; n < inp.length; n++) {\n // Per channel: advancing one shared counter only on the last channel\n // left every earlier channel either unheld or frozen for a whole\n // 128-sample quantum, clicking once a block.\n if (this.holds[ch] === 0) this.held[ch] = Math.round(inp[n] * levels) / levels;\n out[n] = this.held[ch] * mix + inp[n] * (1 - mix);\n this.holds[ch] = (this.holds[ch] + 1) % step;\n }\n }\n return true;\n }\n}\nregisterProcessor("hf-bitcrush", HfBitcrush);\n\n/** Linear-interpolated read, \\`delaySamples\\` behind the write head. */\nfunction readTap(ring, write, delaySamples) {\n const len = ring.length;\n const pos = (write - 1 - delaySamples + len) % len;\n const i0 = Math.floor(pos);\n const frac = pos - i0;\n const i1 = (i0 + 1) % len;\n return ring[i0] * (1 - frac) + ring[i1] * frac;\n}\n\n/** Equal-power-ish crossfade, zero at a tap\'s reset point, which hides the splice. */\nfunction xfade(phase) {\n return Math.sin(Math.PI * phase);\n}\n\n/**\n * Dual-tap granular delay line: two read taps 180\\xB0 apart in a 100 ms grain,\n * each sweeping at a speed relative to the write head that shifts pitch\n * without changing duration. One tap is always fading in as the other fades\n * out, which hides the splice each tap makes when it wraps.\n *\n * write/phase are block-level state, advanced once per SAMPLE across all\n * channels together (not once per channel). Advancing them inside the\n * per-channel loop would move the tap 2x/4x too fast on a stereo/quad input.\n */\nclass HfPitchshift extends AudioWorkletProcessor {\n constructor(o) {\n super();\n this.p = o.processorOptions || {};\n this.grain = Math.round(sampleRate * 0.1);\n this.buf = [];\n this.write = 0;\n // The taps sweep at a constant rate from the start of the file, so a node built\n // part-way in joins the sweep where it would already be.\n const ratio0 = Math.pow(2, Math.max(-12, Math.min(12, this.p.semitones ?? 0)) / 12);\n const turns = (this.p.__hfElapsed ?? 0) * sampleRate * ((1 - ratio0) / this.grain);\n this.phase = turns - Math.floor(turns);\n // Samples written so far, capped at one grain. The taps read up to a grain\n // behind the write head, so until this fills they would read the ring\'s\n // zeros, so the head of every clip came out attenuated or silent.\n this.filled = 0;\n // How much of the wet (pitch-shifted) path is currently in the output, and\n // where it is heading. Crossing between dry and wet is a ~50 ms jump in the\n // signal, so it is RAMPED rather than switched: a hard swap either way is a\n // click. Ramping in both directions is also what lets a node return to true\n // bypass at semitones 0. A one-way latch left preview stuck with the delay\n // that the render, building a fresh node from the attribute, does not have.\n this.wet = 0;\n this.wetTarget = 0;\n // ~15 ms one-pole, short enough to feel immediate on a slider drag and long\n // enough that the splice is inaudible.\n this.wetCoef = Math.exp(-1 / (sampleRate * 0.015));\n this.port.onmessage = (e) => {\n if (e.data && e.data.__hfDispose) { this.dead = true; return; }\n this.p = { ...this.p, ...e.data };\n };\n }\n process(inputs, outputs) {\n if (this.dead) return false;\n const i = inputs[0], o = outputs[0];\n if (!i || !i.length) return true;\n const p = this.p;\n const semitones = Math.max(-12, Math.min(12, p.semitones ?? 0));\n const mix = Math.max(0, Math.min(1, p.mix ?? 1));\n const grain = this.grain;\n const ringLen = grain * 2;\n const n = i[0] ? i[0].length : 0;\n for (let ch = 0; ch < i.length; ch++) {\n if (!this.buf[ch]) this.buf[ch] = new Float32Array(ringLen);\n }\n\n // Nothing to shift, or mixed fully out. The grain delay is ~grain/2\n // whatever the ratio, so at semitones=0 this degenerated into a pure 50 ms\n // delay of the signal, while the copy for that exact setting reads\n // "Unchanged pitch".\n this.wetTarget = semitones === 0 ? 0 : mix;\n\n // Fully dry AND settled: take the cheap transparent path. The ring keeps\n // filling, so a later shift does not start cold.\n if (this.wetTarget === 0 && this.wet < 1e-4) {\n this.wet = 0;\n let w = this.write;\n for (let s = 0; s < n; s++) {\n for (let ch = 0; ch < i.length; ch++) {\n const x = i[ch][s];\n this.buf[ch][w] = x;\n o[ch][s] = x;\n }\n w = (w + 1) % ringLen;\n }\n this.write = w;\n this.filled = Math.min(grain, this.filled + n);\n return true;\n }\n\n const ratio = Math.pow(2, semitones / 12);\n const inc = (1 - ratio) / grain;\n let write = this.write, phase = this.phase, filled = this.filled, wetNow = this.wet;\n const target = this.wetTarget, coef = this.wetCoef;\n for (let s = 0; s < n; s++) {\n phase += inc;\n phase -= Math.floor(phase);\n const phaseB = (phase + 0.5) % 1;\n const gA = xfade(phase), gB = xfade(phaseB);\n // Ramp the wet path in as the ring fills rather than reading zeros:\n // 100 ms of unshifted audio at the head of a clip beats 50 ms of silence.\n const warm = filled >= grain ? 1 : filled / grain;\n wetNow = target + coef * (wetNow - target);\n const wetMix = wetNow * warm;\n for (let ch = 0; ch < i.length; ch++) {\n const ring = this.buf[ch];\n const inp = i[ch], out = o[ch];\n const x = inp[s];\n ring[write] = x;\n const wet =\n readTap(ring, write, phase * grain) * gA + readTap(ring, write, phaseB * grain) * gB;\n out[s] = x * (1 - wetMix) + wet * wetMix;\n }\n write = (write + 1) % ringLen;\n if (filled < grain) filled++;\n }\n this.write = write;\n this.phase = phase;\n this.filled = filled;\n this.wet = wetNow;\n return true;\n }\n}\nregisterProcessor("hf-pitchshift", HfPitchshift);\n`+m_,bp=new WeakMap;function yp(e){return p_.has(e)}var p_=new WeakSet;function xp(e){let t=bp.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable: the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(RG)))}`;await e.audioWorklet.addModule(n),p_.add(e)})().catch(n=>{throw bp.delete(e),n}),bp.set(e,t)),t}function MG(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,o=Math.max(1,Math.floor(e*r)),i=new Float32Array(o),a=Math.round(t*1e3)*2654435761+Math.round(n*1e3)*40503>>>0,l=()=>(a=a*1664525+1013904223>>>0,a/4294967295*2-1),s=Math.max(.001,1-Math.max(0,Math.min(1,n))),c=0,d=0;for(let m=0;m<o;m++){c+=s*(l()-c);let g=c*Math.pow(1-m/o,2.5);i[m]=g,d+=g*g}let f=Math.sqrt(d);if(f>0)for(let m=0;m<o;m++)i[m]=(i[m]??0)/f;return i}var Ne=e=>typeof e=="number"?e:Number(e??0),Sp=e=>e/1e3;function y_(e,t,n,r){let o=Math.max(1,Math.round(e.sampleRate)),i=e.createBuffer(1,o,e.sampleRate),a=i.getChannelData(0);for(let c=0;c<o;c++){let d=c/o;a[c]=t==="sine"?Math.sin(2*Math.PI*d):4*Math.abs((d+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=i,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(o/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function x_(e){try{e.stop()}catch{}e.disconnect()}function Ep(e,t){return[{param:e},{param:t,map:n=>1-n}]}function S_(e,t,n){e.gain.value=n,t.gain.value=1-n}function vp(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var kG=new Set(["peaking","highpass","lowpass"]),h_=e=>Math.pow(10,e/20),LG=(e,t)=>{let n=e.createGain(),r=o=>{n.gain.value=h_(Ne(o.gain))};return r(t),vp(n,r,{gain:[{param:n.gain,map:h_}]})};function Na(e,t){return(n,r)=>{let o=n.createBiquadFilter();o.type=e;let i=a=>{o.frequency.value=Ne(a.frequency),a.q!==void 0&&(o.Q.value=Ne(a.q)),t&&(o.gain.value=Ne(a.gain))};return i(r),vp(o,i,{frequency:[{param:o.frequency}],...kG.has(e)?{q:[{param:o.Q}]}:{},...t?{gain:[{param:o.gain}]}:{}})}}function NG(e){return(t,n)=>{let r=Math.tan(Math.PI*Ne(n.frequency)/t.sampleRate),o=e==="highpass"?t.createIIRFilter([1/(1+r),-1/(1+r)],[1,(r-1)/(r+1)]):t.createIIRFilter([r/(1+r),r/(1+r)],[1,(r-1)/(r+1)]);return vp(o,()=>{})}}function Vo(e,t=!1){return(n,r,o)=>{let i=new AudioWorkletNode(n,e,{processorOptions:{...r,__hfElapsed:o}});return{input:i,output:i,update:a=>i.port.postMessage({...a}),...t?{reset:()=>i.port.postMessage({__hfReset:!0})}:{},dispose:()=>{i.port.postMessage({__hfDispose:!0}),i.disconnect()}}}}var FG={tanh:Math.tanh,atan:e=>2/Math.PI*Math.atan(Math.PI/2*e),cubic:e=>Math.abs(e)>=1?Math.sign(e):e-e**3/3,exp:e=>Math.sign(e)*(1-Math.exp(-Math.abs(e))),alg:e=>e/Math.sqrt(1+e*e),quintic:e=>Math.abs(e)>=1?Math.sign(e):e-e**5/5,sin:e=>Math.abs(e)>=1?Math.sign(e):Math.sin(Math.PI/2*e),erf:e=>Math.tanh(1.20211*e),hard:e=>Math.max(-1,Math.min(1,e))},PG=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),o=e.createGain();r.connect(n).connect(o);let i=a=>{let l=FG[String(a.type)]??Math.tanh,s=Math.pow(10,Ne(a.threshold)/20),c=8192,d=new Float32Array(c);for(let f=0;f<c;f++){let m=f/(c-1)*2-1;d[f]=l(m/Math.max(1e-6,s))*s}n.curve=d,n.oversample=Ne(a.oversample)>=4?"4x":Ne(a.oversample)>=2?"2x":"none",o.gain.value=Math.pow(10,Ne(a.output)/20)};return i(t),{input:r,output:o,update:i,automation:{output:[{param:o.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),o.disconnect()}}},IG=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createDelay(5),i=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(o),o.connect(i),i.connect(o),o.connect(a).connect(r),n.connect(l).connect(r);let s=c=>{o.delayTime.value=Math.min(5,Ne(c.time)/1e3),i.gain.value=Ne(c.feedback),S_(a,l,Ne(c.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:o.delayTime,map:c=>Math.min(5,Sp(c))}],feedback:[{param:i.gain}],mix:Ep(a.gain,l.gain)},dispose:()=>[n,r,o,i,a,l].forEach(c=>c.disconnect())}},DG=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createDelay(.5),a=y_(e,"sine",Ne(t.speed),n),l=e.createGain(),s=e.createGain(),c=e.createGain();a.connect(l).connect(i.delayTime),r.connect(i).connect(s).connect(o),r.connect(c).connect(o);let d=f=>{i.delayTime.value=Ne(f.delay)/1e3,l.gain.value=Ne(f.depth)/1e3,a.playbackRate.value=Ne(f.speed),S_(s,c,Ne(f.mix))};return d(t),{input:r,output:o,update:d,automation:{delay:[{param:i.delayTime,map:Sp}],depth:[{param:l.gain,map:Sp}],speed:[{param:a.playbackRate}],mix:Ep(s.gain,c.gain)},dispose:()=>{x_(a),[r,o,i,l,s,c].forEach(f=>f.disconnect())}}},OG=6,HG=(e,t,n)=>{let r=e.createGain(),o=e.createGain(),i=e.createGain(),a=e.createGain(),l=y_(e,String(t.type)==="1"?"sine":"triangle",Ne(t.speed),n),s=e.createGain(),c=e.createGain(),d=e.createGain(),f=[];r.connect(i);let m=i;for(let h=0;h<OG;h++){let y=e.createBiquadFilter();y.type="allpass",y.Q.value=.7071,s.connect(y.frequency),m.connect(y),m=y,f.push(y)}l.connect(s),m.connect(c).connect(a),i.connect(d).connect(a),a.connect(o);let g=h=>{let y=1e3/Math.max(.1,Ne(h.delay));for(let S of f)S.frequency.value=y;s.gain.value=y*Ne(h.decay),l.playbackRate.value=Ne(h.speed),i.gain.value=Ne(h.in_gain),a.gain.value=Ne(h.out_gain),c.gain.value=1,d.gain.value=1};return g(t),{input:r,output:o,update:g,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:i.gain}],out_gain:[{param:a.gain}]},dispose:()=>{x_(l),[r,o,i,a,s,c,d,...f].forEach(h=>h.disconnect())}}},GG=(e,t)=>{let n=e.createGain(),r=e.createGain(),o=e.createConvolver(),i=e.createGain(),a=e.createGain();o.normalize=!1,n.connect(o).connect(i).connect(r),n.connect(a).connect(r);let l="",s=c=>{let d=`${Ne(c.size)}:${Ne(c.damping)}`;if(d!==l){let f=MG(e.sampleRate,Ne(c.size),Ne(c.damping)),m=e.createBuffer(1,f.length,e.sampleRate);m.getChannelData(0).set(f),o.buffer=m,l=d}i.gain.value=Ne(c.wet),a.gain.value=Ne(c.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:i.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,o,i,a].forEach(c=>c.disconnect())}},BG={"gain-node":LG,"biquad-peaking":Na("peaking",!0),"biquad-lowshelf":Na("lowshelf",!0),"biquad-highshelf":Na("highshelf",!0),"biquad-highpass":Na("highpass",!1),"biquad-lowpass":Na("lowpass",!1),"worklet-compressor":Vo("hf-compressor"),"worklet-limiter":Vo("hf-limiter"),"worklet-truepeak":Vo("hf-truepeak",!0),"worklet-gate":Vo("hf-gate"),"worklet-bitcrush":Vo("hf-bitcrush"),"worklet-pitchshift":Vo("hf-pitchshift"),waveshaper:PG,"delay-feedback":IG,"chorus-lfo":DG,"allpass-phaser":HG,convolver:GG};function E_(e){return e.nodes.some(t=>bi(t.type)?.web.startsWith("worklet-")??!1)}function UG(e,t,n,r=0){let o=bi(t);if(!o)throw new Error(`Unknown effect type: ${t}`);let i=yi(t,n);if((t==="highpass"||t==="lowpass")&&String(i.poles)==="1")return NG(t)(e,i,r);let a=BG[o.web];if(!a)throw new Error(`No Web Audio builder for ${o.web}`);return a(e,i,r)}function g_(e){let t=[];for(let n of e){let r=n.fromPreset,o=t.at(-1);if(o&&o.preset===r)o.nodes.push(n);else{let i=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,i)),nodes:[n]})}}return t}function b_(e){return xi(e).map(t=>{let n=yi(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",o=String(n.poles)==="1"?`@${n.frequency}`:"",i=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"",l=t.type==="truepeak"?`^${n.lookahead}`:"";return`${t.type}${r}${o}${i}${l}${a}`}).join("|")}function v_(e,t,n=0){var f;let r=e.createGain(),o=e.createGain(),i=[],a=[],l=g_(xi(t)),s=r;for(let m of l){let g=null;if(m.preset){let h=e.createGain(),y=e.createGain(),S=e.createGain(),E=e.createGain();S.gain.value=m.amount,y.gain.value=1-m.amount,s.connect(h),h.connect(y).connect(E),g={entry:h,wet:S,dry:y,join:E},s=h}for(let h of m.nodes){let y=UG(e,h.type,h.params??{},n);s.connect(y.input),s=y.output,i.push({...h.id?{id:h.id}:{},type:h.type,handle:y})}g&&m.preset&&(s.connect(g.wet).connect(g.join),a.push({id:m.preset,...g}),s=g.join)}s.connect(o);let c=b_(t),d={};for(let m of a)(d[f=m.id]??(d[f]=[])).push(...Ep(m.wet.gain,m.dry.gain));return{input:r,output:o,presets:d,nodes:i,update(m){if(b_(m)!==c)return!1;xi(m).forEach((h,y)=>{let S=i[y];S&&(S.handle.update(yi(h.type,h.params)),h.id===void 0?delete S.id:S.id=h.id)});let g=0;for(let h of g_(xi(m))){if(!h.preset)continue;let y=a[g++];!y||y.id!==h.preset||(y.wet.gain.value=h.amount,y.dry.gain.value=1-h.amount)}return!0},reset(){for(let{handle:m}of i)m.reset?.()},dispose(){for(let{handle:m}of i)m.dispose();for(let{entry:m,wet:g,dry:h,join:y}of a)m.disconnect(),g.disconnect(),h.disconnect(),y.disconnect();r.disconnect(),o.disconnect()}}}var A_={version:1,nodes:[]},w_={version:1,lanes:[]};function __(e,t,n=un){let r=(n&&typeof e.getAttribute=="function"?e.getAttribute(n):null)??"";if(!r)return w_;try{return P0(Os(r),t)}catch{return w_}}function $o(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(Gn):null)??"";if(!t)return{chain:A_,raw:""};try{return{chain:C0(t),raw:t}}catch{return{chain:A_,raw:""}}}function T_(e){return __(e,$o(e).chain)}function Ap(e,t,n){let r=f_(t);if(!r)return[];let o=k0(r,e.gain?.()??1,e.gainAhead);return gp([{param:e.param}],{...r,points:o},Ds.scale,n),[{param:e.param}]}function WG(e,t){Uo([e]),e.param.setValueAtTime(e.gainAhead?1:Ve(e.gain?.()??1),t.scheduledAt)}function ku(e,t,n,r,o,i={automation:un},a){let{chain:l}=$o(t),s=null,c=[],d=!1,f=0,m=()=>{try{s?(n.disconnect(s.input),s.output.disconnect(r),s.dispose()):n.disconnect(r)}catch{}s=null},g=(M,L)=>{if(M.nodes.length===0){n.connect(r);return}if(E_(M)&&!yp(e)){n.connect(r);let G=++f;xp(e).then(()=>{d||G!==f||v($o(t).chain)}).catch(()=>{});return}try{let G=v_(e,M,L);n.connect(G.input),G.output.connect(r),s=G}catch{n.connect(r)}},h=(M,L)=>{if(!L){c=[];return}let G=__(t,M,i.automation),C=s?d_(G,M,s.nodes,L,s.presets):[],B=a?Ap(a,G,L):[];a&&B.length===0&&c.some(O=>O.param===a.param)&&WG(a,L),c=[...C,...B]},y=o?{...o}:null;g(l,y?.elapsed??0),h(l,y);let S=()=>{if(!y)return null;let M=typeof e.currentTime=="number"?e.currentTime:y.scheduledAt;return{scheduledAt:M,elapsed:y.elapsed+(M-y.scheduledAt)*y.rate,rate:y.rate}},E=M=>{let L=S();L&&(Wo(c,L.scheduledAt),h(M,L))},v=M=>{let L=S();Wo(c,L?.scheduledAt??0),m(),g(M,L?.elapsed??0),h(M,L)},T=null,H=t;typeof MutationObserver<"u"&&typeof H?.nodeType=="number"&&(T=new MutationObserver(()=>{let M=$o(t);c.length>0&&Uo(c),!s||!s.update(M.chain)?v(M.chain):E(M.chain)}),T.observe(H,{attributes:!0,attributeFilter:[Gn,...i.automation?[i.automation]:[],...a?.gain?["data-volume"]:[]]}));let U=M=>{if(d)return;let L=S();L&&Wo(c,L.scheduledAt),y={...M},h($o(t).chain,y)};return{reanchor:M=>{d||(s?.reset(),U(M))},retime:U,setRate:M=>{let L=S();d||!L||!Number.isFinite(M)||M<=0||M===L.rate||(y={...L,rate:M},Wo(c,L.scheduledAt),h($o(t).chain,y))},dispose:()=>{d=!0,T?.disconnect(),c.length>0&&Wo(c,typeof e.currentTime=="number"?e.currentTime:0),s?.dispose()}}}var C_=new WeakMap;function VG(e){let t=e.currentSrc||e.getAttribute("src")||"";try{return/\\.([a-z0-9]{1,5})$/i.exec(new URL(t,document.baseURI).pathname)?.[1]?.toLowerCase()??null}catch{return null}}function Fa(e,t,n,r=null){if(Kn(e))return;let o=C_.get(e)??new Set;if(o.has(t))return;o.add(t),C_.set(e,o);let i=e.getAttribute("src")??"",a={asset:i,elementId:e.id||null,kind:e.tagName.toLowerCase(),stage:t,code:n,bytes:r,extension:VG(e)};we({source:"hf-preview",type:"diagnostic",code:dd,details:a}),globalThis.console.info(`[hyperframes] ${dd}: "${i}" failed at ${t}${n===null?"":` (${n})`}.`)}function R_(e){let t=n=>{let r=n.target,o=Wg(r)?r.parentElement:r;Ar(o)&&Fa(o,"element",o.error?.code??null)};return e.addEventListener("error",t,!0),()=>e.removeEventListener("error",t,!0)}function M_(e,t){e.getFloatTimeDomainData(t);let n=0;for(let r=0;r<t.length;r++)n=Math.max(n,Math.abs(t[r]??0));return n}function wp(e,t){let n=e.createGain();n.channelCount=2,n.channelCountMode="explicit";let r=e.createChannelSplitter(2),o=e.createAnalyser(),i=e.createAnalyser();o.fftSize=i.fftSize=2048,t.connect(n),n.connect(r),r.connect(o,0),r.connect(i,1);let a=new Float32Array(new ArrayBuffer(2048*4)),l=new Float32Array(new ArrayBuffer(2048*4));return{read:()=>({l:M_(o,a),r:M_(i,l)}),dispose:()=>{try{t.disconnect(n),n.disconnect(),r.disconnect()}catch{}}}}var k_="runtime_web_audio_bypass";function _p(e,t){return typeof e.getAttribute=="function"?e.getAttribute(t):null}function Pa(e,t){return _p(e,t)!==null}function $G(e){return Pa(e,"crossorigin")?!0:e.crossOrigin!=null}function qG(e){return typeof e.baseURI=="string"&&e.baseURI?e.baseURI:typeof document<"u"?document.baseURI:""}function zG(e){let t=typeof e.currentSrc=="string"?e.currentSrc:"";if(t)return[t];let n=_p(e,"src");if(n)return[n];if(typeof e.querySelectorAll!="function")return[];let r=[];for(let o of Array.from(e.querySelectorAll("source"))){let i=o.getAttribute("src");i&&r.push(i)}return r}function jG(e,t){let n;try{n=new URL(e,qG(t))}catch{return null}return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}function KG(){return typeof window.origin=="string"?window.origin:window.location.origin}function YG(e,t){if(typeof window>"u")return null;let n=jG(e,t);if(!n)return null;let r=KG(),o=r==="null";return!o&&n.origin===r||$G(t)?null:o?"opaque_document_origin":"cross_origin_no_cors"}function N_(e){return(typeof e.currentSrc=="string"?e.currentSrc:"")?!0:Pa(e,"src")}function qo(e){for(let t of zG(e)){let n=YG(t,e);if(n)return{kind:"decode-only",reason:n,asset:t}}return{kind:"web-audio"}}function XG(e){let t=[];Pa(e,Gn)&&t.push("fx-chain"),Pa(e,un)&&t.push("automation"),Pa(e,rl)&&t.push("audio-group");let n=Number.parseFloat(_p(e,"data-volume")??"");return Number.isFinite(n)&&n>1&&t.push("above-unity-gain"),t}function JG(){return typeof window<"u"&&!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}var L_=new WeakSet,QG={cross_origin_no_cors:"cross-origin media without a `crossorigin` opt-in is silent through createMediaElementSource (Web Audio spec); using native playback instead",opaque_document_origin:"this document\'s security origin is opaque (a sandbox without `allow-same-origin`), so no media is same-origin with it and createMediaElementSource would be silent (Web Audio spec); using native playback instead"},ZG={cross_origin_no_cors:"proxy or download the asset to a same-origin URL to keep it.",opaque_document_origin:"add `allow-same-origin` to the sandbox, or serve the asset with a `crossorigin` attribute and an `Access-Control-Allow-Origin` of `null` or `*`, to keep it."};function zo(e,t){if(t.kind==="web-audio"||JG()||L_.has(e))return;let n=XG(e);L_.add(e);let r={asset:t.asset,reason:t.reason,lostProcessing:n,note:QG[t.reason]};we({source:"hf-preview",type:"diagnostic",code:k_,details:r});let o=n.length>0?` Native playback cannot reproduce: ${n.join(", ")}. Fix: ${ZG[t.reason]}`:"";globalThis.console.info(`[hyperframes] ${k_}: "${t.asset}" (${t.reason}): Web Audio capture withheld; the track plays through native HTMLMediaElement output.${o}`)}function Lu(e){return new URL(e,document.baseURI).href}var e2={automation:null};function Tp(e){return!Number.isFinite(e)||e<=0?1:e}function F_(e){return Ve(e)}function t2(e,t){t||e.paused||!xs().__hfDebug||globalThis.console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function n2(e,t){let{elapsed:n,mediaStart:r,scheduledAt:o,globalRate:i,mediaRate:a,clipDuration:l,headCut:s}=t,c=Number.isFinite(l)&&l>0,d=Math.max(n,s,0),f=(l-d)*a;if(c&&f<=0)return!1;let m=d>n?o+(d-n)/i:0;return c?e.start(m,d*a+r,f):e.start(m,d*a+r),!0}function r2(e,t,n,r,o){let i=Ld(tl(t),o);if(i.fadeIn<=0&&i.fadeOut<=0||i.fadeOut>0&&!Number.isFinite(o))return null;let a=e.createGain(),l=a.gain,s=d=>nl(d,o,i),c=d=>{let f=Math.max(r,d.elapsed),m=g=>d.scheduledAt+Math.max(0,g-d.elapsed)/d.rate;if(l.value=s(f),l.setValueAtTime(s(f),m(f)),i.fadeIn>f&&l.linearRampToValueAtTime(s(i.fadeIn),m(i.fadeIn)),i.fadeOut>0){let g=o-i.fadeOut;g>f&&g>i.fadeIn&&l.setValueAtTime(s(g),m(g)),l.linearRampToValueAtTime(0,m(o))}};return c(n),{node:a,rebook:d=>{l.cancelScheduledValues(0),c(d)}}}function P_(e,t,n,r,o,i){let a=e.createGain();a.connect(r);let l=e.createGain(),s=r2(e,t,o,i.from,i.clipDuration);return s&&n.connect(s.node),(s?.node??n).connect(l),{fx:ku(e,t,l,a,o,void 0,{param:a.gain,gain:()=>Pi(t),gainAhead:!0}),laneNode:a,clipGainNode:l,fades:s}}function $r(e){return e.sourceKind==="buffer"}var I_=e=>{let t=e.currentSrc||e.getAttribute("src");if(!t)return null;try{return Lu(t)}catch{return t}},Cp=.015,D_=["seeked","error","emptied","abort"],O_=["playing","seeked","ratechange"],o2=1e4,i2=.25,Nu=class{constructor(){be(this,"_ctx",null);be(this,"_bufferCache",new Map);be(this,"_decoding",new Map);be(this,"_failedSrcs",new Set);be(this,"_mediaElementSources",new WeakMap);be(this,"_handedOver",new WeakSet);be(this,"_activeSources",[]);be(this,"_masterGain",null);be(this,"_busOut",null);be(this,"_master",null);be(this,"_monitorGain",null);be(this,"_masterVolume",1);be(this,"_masterMuted",!1);be(this,"_groups",new Map);be(this,"_metering",!1);be(this,"_masterTap",null);be(this,"_groupTaps",new Map);be(this,"_rateAnchorCtx",0);be(this,"_rateAnchorComp",0);be(this,"_rate",1);be(this,"_paused",!0);be(this,"_playGeneration",0);be(this,"_playingCaptured",new Set);be(this,"_suspendPending",!1);be(this,"_restTimer",null)}async init(){try{return this._ctx=new AudioContext,this._ctx.onstatechange=()=>this.rest(),this._masterGain=this._ctx.createGain(),this._busOut=this._ctx.createGain(),this._monitorGain=this._ctx.createGain(),this._masterGain.connect(this._busOut),this._busOut.connect(this._monitorGain),this._monitorGain.connect(this._ctx.destination),this.applyMasterGain(),this._metering&&this.attachMasterTap(),!0}catch{return!1}}async wake(){!this._ctx||this._ctx.state==="running"&&!this._suspendPending||(this._suspendPending=!1,await this._ctx.resume())}rest(){this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,!(!this._ctx||this._ctx.state!=="running"||this._suspendPending)&&(this._restTimer=setTimeout(()=>{this._restTimer=null,this.suspendIfIdle()},o2))}suspendIfIdle(){for(let t of this._playingCaptured)t.paused&&this._playingCaptured.delete(t);!this._ctx||!this._paused||this._suspendPending||this._playingCaptured.size>0||(this._suspendPending=!0,this._ctx.suspend().catch(t=>{this._suspendPending=!1,$("webAudioTransport.suspend",t)}))}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}releaseDecodedExcept(t){let n=new Set(t.map(I_));for(let r of[...this._bufferCache.keys()])n.has(r)||this._bufferCache.delete(r)}decodeAudioElement(t){let n=I_(t);if(!n)return Promise.resolve(null);let r=this._decoding.get(n);if(r)return r;let o=this.fetchAndDecode(n,t).finally(()=>this._decoding.delete(n));return this._decoding.set(n,o),o}async fetchAndDecode(t,n){if(this._bufferCache.has(t))return this._bufferCache.get(t);if(this._failedSrcs.has(t)||!this._ctx)return null;let r;try{let o=await fetch(t,{cache:"no-store"});if(!o.ok)return $("webAudioTransport.fetch",new Error(`${o.status} ${t}`)),Fa(n,"fetch",o.status),null;r=await o.arrayBuffer()}catch(o){return $("webAudioTransport.fetch",o),Fa(n,"fetch",null),null}try{let o=await this._ctx.decodeAudioData(r);return Number.isFinite(n.duration)&&n.duration-o.duration>i2?(this._failedSrcs.add(t),null):(this._bufferCache.set(t,o),o)}catch(o){return this._failedSrcs.add(t),$("webAudioTransport.decode",o),Fa(n,"decode",null,r.byteLength),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}acquireMediaElementSource(t){let n=this._mediaElementSources.get(t);if(n){let a=qo(t);if(a.kind!=="web-audio"){try{n.disconnect()}catch{}return this._mediaElementSources.delete(t),zo(t,a),null}return n}if(!this._ctx)return null;let r=qo(t);if(r.kind!=="web-audio")return zo(t,r),null;let o=this._ctx.createMediaElementSource(t);this._mediaElementSources.set(t,o),t.paused||this._playingCaptured.add(t),t.addEventListener("play",()=>{this._playingCaptured.add(t),this.wake()});let i=()=>{this._playingCaptured.delete(t),this.rest()};return t.addEventListener("pause",i),t.addEventListener("emptied",i),o}async scheduleMediaElementPlayback(t,n,r,o,i,a,l=1,s=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||a!==this._playGeneration)return null;try{if(await this.wake(),a!==this._playGeneration)return null;let c=this.acquireMediaElementSource(t);if(!c)return null;c.disconnect();let d=Tp(l),f=this._ctx.createGain();f.gain.value=i;let m=this._ctx.currentTime,g=o-n,h={scheduledAt:m,elapsed:g,rate:d};f.connect(this.resolveDestination(t,m,o,d)??this._masterGain);let y=this._ctx.createGain();c.connect(y);let{fx:S,laneNode:E,clipGainNode:v,fades:T}=P_(this._ctx,t,y,f,h,{from:Math.max(g,0),clipDuration:s});this._rate=d,this._rateAnchorCtx=m,this._rateAnchorComp=o;let H={fx:S,fades:T,dipNode:y,el:t,sourceNode:c,sourceKind:"media-element",gainNode:f,laneNode:E,clipGainNode:v,compositionStart:n,mediaStart:r,scheduledAt:m,priorMuted:t.muted,priorVolume:t.volume,mediaPlaybackRate:lt(t),bounded:!1,unfollow:this.followElement(t,n,r,S,T)};return t.volume=1,this._activeSources.push(H),this._paused=!1,H}catch(c){return $("webAudioTransport.mediaElementSource",c),null}}followElement(t,n,r,o,i){let a=()=>{if(t.paused||!this._ctx)return;let l=Et(t),s=t.currentTime-r,c=t.duration-r;if(t.loop&&c>0){let g=Bn(l,this.getTime()-n);s+=Math.round((g-s)/c)*c}let d=cn(l,s),f=t.playbackRate/vi(l,d);if(!(f>0)||!Number.isFinite(d))return;let m={scheduledAt:this._ctx.currentTime,elapsed:d,rate:f};o?.retime(m),i?.rebook(m)};for(let l of O_)t.addEventListener(l,a);return()=>{for(let l of O_)t.removeEventListener(l,a)}}seekUnderDip(t,n){let r=this._activeSources.find(s=>s.el===t&&s.sourceKind==="media-element"),o=this._ctx;if(!o||!r?.dipNode)return!1;if(r.dipping)return!0;r.dipping=!0;let i=r.dipNode.gain,a=s=>{let c=o.currentTime;i.cancelScheduledValues(c),i.setValueAtTime(i.value,c),i.linearRampToValueAtTime(s,c+Cp)},l=()=>{for(let s of D_)t.removeEventListener(s,l);r.dipping=!1,a(1)};return a(0),setTimeout(()=>{if(this._activeSources.includes(r)){for(let s of D_)t.addEventListener(s,l);try{t.currentTime=Rt(n+Cp*t.playbackRate)}catch(s){$("webAudioTransport.seekUnderDip",s),l()}}},Cp*1e3),!0}groupInput(t,n,r){let o=this._groups.get(t);if(o){if(o.generation!==this._playGeneration)try{o.reanchor(r),o.generation=this._playGeneration}catch(g){$("webAudioTransport.groupReanchor",g)}return o.input}if(!this._ctx||!this._masterGain)return null;let i=this._ctx.createGain(),a=this._ctx.createGain();a.connect(this._masterGain);let l=()=>Nd(n,t),s=l(),c=this._ctx.createGain();c.gain.value=s?.hasAttribute("data-hidden")?0:1,c.connect(a);let d=this._ctx.createGain();d.gain.value=F_(Pi(s)),d.connect(c);let f={param:d.gain,gain:()=>Pi(l())},m=ku(this._ctx,s??{getAttribute:()=>null},i,d,r,void 0,s?f:void 0);return this._groups.set(t,{input:i,output:a,isPresent:()=>l()!==null,fader:d,muteGain:c,fx:m,generation:this._playGeneration,reanchor:g=>{Uo([{param:d.gain}]);let h=l();d.gain.value=F_(Pi(h)),c.gain.value=h?.hasAttribute("data-hidden")?0:1,m?.reanchor(g),h&&h!==s&&Ap(f,T_(h),g)},dispose:()=>{try{m?.dispose(),i.disconnect(),d.disconnect(),c.disconnect(),a.disconnect()}catch{}}}),this.attachGroupTap(t,a),i}startMetering(){this._metering=!0,this.attachMasterTap();for(let[t,n]of this._groups)this.attachGroupTap(t,n.output)}stopMetering(){this._metering=!1,this._masterTap?.dispose(),this._masterTap=null;for(let t of this._groupTaps.values())t.dispose();this._groupTaps.clear()}readLevels(){let t={};for(let[n,r]of this._groupTaps)this._groups.get(n)?.isPresent()&&(t[n]=r.read());return{master:this._masterTap?.read()??{l:0,r:0},groups:t}}attachMasterTap(){this._ctx&&this._masterGain&&!this._masterTap&&(this._masterTap=wp(this._ctx,this._busOut??this._masterGain))}attachGroupTap(t,n){this._metering&&this._ctx&&!this._groupTaps.has(t)&&this._groupTaps.set(t,wp(this._ctx,n))}setGroupMuted(t,n){let r=this._groups.get(t);if(r)try{r.muteGain.gain.value=n?0:1}catch(o){$("webAudioTransport.setGroupMuted",o)}}ensureMasterBus(t,n){if(!this._ctx||!this._masterGain||!this._busOut)return;if(this._master){if(this._master.generation===this._playGeneration)return;try{this._master.fx?.reanchor(n),this._master.generation=this._playGeneration}catch(i){$("webAudioTransport.masterReanchor",i)}return}let r=Fd(t);if(!r)return;this._masterGain.disconnect(this._busOut);let o=ku(this._ctx,r,this._masterGain,this._busOut,n,e2);this._master={fx:o,generation:this._playGeneration}}resolveDestination(t,n,r,o){if(!this._masterGain)return null;let i={scheduledAt:n,elapsed:r,rate:o};this.ensureMasterBus(t.ownerDocument,i);let a=il(t);return a?this.groupInput(a,t.ownerDocument,i)??this._masterGain:this._masterGain}handleSourceEnded(t,n,r,o){let i=this._activeSources.indexOf(n);if(i!==-1){this._activeSources.splice(i,1),r.muted=o;try{t.disconnect(),n.fx?.dispose(),n.fades?.node.disconnect(),n.clipGainNode.disconnect(),n.laneNode.disconnect(),n.gainNode.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}async schedulePlayback(t,n,r,o,i,a,l,s=1,c=Number.POSITIVE_INFINITY,d=r){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(await this.wake(),l!==this._playGeneration)return null;let f=i(),m=Tp(s),g=lt(t),h=m*g,y=this._ctx.createBufferSource();y.buffer=n,y.playbackRate.value=h;let S=this._ctx.createGain();S.gain.value=a;let E=f-r,v=this._ctx.currentTime,T={scheduledAt:v,elapsed:E,rate:m};S.connect(this.resolveDestination(t,v,f,m)??this._masterGain);let H=d-r,{fx:U,laneNode:M,clipGainNode:L,fades:G}=P_(this._ctx,t,y,S,T,{from:Math.max(E,H,0),clipDuration:c});if(this._rate=m,this._rateAnchorCtx=v,this._rateAnchorComp=f,!n2(y,{elapsed:E,mediaStart:o,scheduledAt:v,globalRate:m,mediaRate:g,clipDuration:c,headCut:H}))return y.disconnect(),U?.dispose(),G?.node.disconnect(),L.disconnect(),M.disconnect(),S.disconnect(),null;let C=t.muted;t.muted=!0,t2(t,C);let B={fx:U,fades:G,el:t,sourceNode:y,sourceKind:"buffer",gainNode:S,laneNode:M,clipGainNode:L,compositionStart:r,mediaStart:o,scheduledAt:v,priorMuted:C,priorVolume:t.volume,mediaPlaybackRate:g,bounded:Number.isFinite(c)&&c>0};return this._activeSources.push(B),this._paused=!1,y.addEventListener("ended",()=>this.handleSourceEnded(y,B,t,C)),B}catch(f){return $("webAudioTransport.schedule",f),null}}releaseRouted(t){let n=this._activeSources.find(r=>r.el===t&&r.sourceKind==="media-element");n&&(this._activeSources.splice(this._activeSources.indexOf(n),1),this.dispose(n),this._handedOver.add(t))}hasHandedOverSources(){return this._activeSources.some(t=>$r(t)&&this._handedOver.has(t.el))}setRate(t){let n=Tp(t);if(n===this._rate)return!1;this._ctx&&!this._paused&&(this._rateAnchorComp=this.getTime(),this._rateAnchorCtx=this._ctx.currentTime),this._rate=n;for(let r of this._activeSources)if($r(r))try{r.sourceNode.playbackRate.value=n*r.mediaPlaybackRate,r.fx?.setRate(n),this._ctx&&!this._paused&&r.fades?.rebook({scheduledAt:this._ctx.currentTime,elapsed:this.getTime()-r.compositionStart,rate:n})}catch(o){$("webAudioTransport.setRate",o)}return this.setBusRate(n),!0}setBusRate(t){let n=[...this._groups.values(),...this._master?[this._master]:[]];for(let r of n)try{r.fx?.setRate(t)}catch(o){$("webAudioTransport.setRate.bus",o)}}hasBoundedActiveSources(){return this._activeSources.some(t=>$r(t)&&t.bounded)}stopAll(){for(let t of this._activeSources)this.dispose(t);this._activeSources=[],this._paused=!0,this._playGeneration+=1,this.rest()}releaseDetached(){this._activeSources=this._activeSources.filter(t=>t.el.isConnected?!0:(this.dispose(t,!1),!1))}dispose(t,n=!0){t.unfollow?.();try{$r(t)&&t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.fades?.node.disconnect(),t.dipNode?.disconnect(),t.clipGainNode.disconnect(),t.laneNode.disconnect(),t.gainNode.disconnect()}catch{}$r(t)?t.el.muted=t.priorMuted:(t.el.volume=t.priorVolume,this._ctx&&n&&t.sourceNode.connect(this._ctx.destination))}setVolume(t){this._masterVolume=Math.max(0,Math.min(1,t)),this.applyMasterGain()}setElementVolume(t,n,r=1,o=n){for(let i of this._activeSources)if(i.el===t)try{i.sourceKind==="media-element"&&(i.el.volume=1),i.gainNode.gain.value=Ve(i.fades?o:n),i.clipGainNode.gain.value=Ve(r)}catch(a){$("webAudioTransport.setElementVolume",a)}}setMuted(t){this._masterMuted=t,this.applyMasterGain()}applyMasterGain(){this._monitorGain&&(this._monitorGain.gain.value=this._masterMuted?0:this._masterVolume)}ownsClock(){return!this._paused&&this._activeSources.some($r)}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t&&$r(n))}routesElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){this.stopAll(),this.stopMetering();for(let t of this._groups.values())t.dispose();if(this._groups.clear(),this._master?.fx?.dispose(),this._master=null,this._bufferCache.clear(),this._failedSrcs.clear(),this._mediaElementSources=new WeakMap,this._playingCaptured.clear(),this._suspendPending=!1,this._restTimer!==null&&clearTimeout(this._restTimer),this._restTimer=null,this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null,this._busOut=null,this._monitorGain=null,this._masterVolume=1,this._masterMuted=!1}};var Ia="data-hf-studio-manual-edit-gesture";var H_=`[${Ia}]`;function G_(e,t){let n=e.defaultView?.MutationObserver??globalThis.MutationObserver;if(!n||!e.documentElement)return{isActive:()=>e.querySelector(H_)!=null,observing:!1,disconnect:()=>{}};let r=new Set(e.querySelectorAll(H_)),o=l=>{for(let s of l){let c=s.target;Ge(c)&&(c.hasAttribute(Ia)?r.add(c):r.delete(c))}},i=l=>{l.length!==0&&(o(l),t())},a=new n(i);return a.observe(e.documentElement,{subtree:!0,attributes:!0,attributeFilter:[Ia]}),{observing:!0,isActive:()=>{i(a.takeRecords());for(let l of r){if(l.isConnected&&l.hasAttribute(Ia))return!0;r.delete(l)}return!1},disconnect:()=>{a.disconnect(),r.clear()}}}var En=e=>({ok:!1,reason:e});function Rp(e,t){if(e<=0)return En("non-positive");let n=e/t;return n<1||n>240?En("out-of-range"):{ok:!0,value:{num:e,den:t}}}function a2(e){return Number.isFinite(e)?Number.isInteger(e)?Rp(e,1):En("ambiguous-decimal"):En("not-a-number")}function s2(e){let t=e.split("/");if(t.length!==2)return En("invalid-fraction");let n=Number(t[0]),r=Number(t[1]);return!Number.isFinite(n)||!Number.isFinite(r)?En("not-a-number"):!Number.isInteger(n)||!Number.isInteger(r)||r<=0?En("invalid-fraction"):Rp(n,r)}function B_(e){if(typeof e=="number")return a2(e);let t=e.trim();return t===""?En("empty"):t.includes("/")?s2(t):/^-?\\d+$/.test(t)?Rp(Number(t),1):En(/^-?\\d*\\.\\d+$/.test(t)?"ambiguous-decimal":"not-a-number")}var U_=333.3333333333333,Mp=1e3*60/60;function W_(e){return e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2?!1:e.compositionChanged===!0?!0:e.isPlaying?e.playingPollDue===!0:Number.isInteger(e.tick)&&e.tick>0&&e.tick%60===0}var l2=/^\\s*spring\\(\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*\\)\\s*$/;function V_(e){return Math.max(0,Math.min(1,e))}function $_(e){let t=l2.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?V_(n):null}function q_(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=V_(t),r=12-n*6,o=Math.PI*2*(1+n*1.5),i=1-Math.exp(-r)*Math.cos(o);return(1-Math.exp(-r*e)*Math.cos(o*e))/i}var u2=/^\\s*wiggle\\(\\s*(\\d+)\\s*,\\s*(easeOut|easeInOut|anticipate|uniform)\\s*(?:,\\s*([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)\\s*)?\\)\\s*$/,c2=Math.PI*2;function d2(e){let t=u2.exec(e);if(!t)return null;let n=Number(t[1]);if(!Number.isSafeInteger(n)||n<1)return null;let r=t[2];if(r!=="easeOut"&&r!=="easeInOut"&&r!=="anticipate"&&r!=="uniform")return null;if(t[3]===void 0)return{wiggles:n,type:r};let o=Number(t[3]);return!Number.isFinite(o)||o<0||o>1?null:{wiggles:n,type:r,amplitude:o}}function f2(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),i=n==="easeInOut"?o*Math.sin(Math.PI*e):n==="uniform"?o:o*(1-e);return e+(n==="anticipate"?-1:1)*i*Math.sin(c2*t*e)}function z_(e,t){let n=d2(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,o=t?.get(r);if(o)return o;let i=a=>f2(a,n.wiggles,n.type,n.amplitude);return t?.set(r,i),i}var m2=24,j_=e=>e>=1?1:0,p2=e=>e,Fu=String.raw`([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?)`,h2=new RegExp(String.raw`^\\s*M\\s*0\\s*,\\s*0\\s+C\\s*${Fu}\\s*,\\s*${Fu}\\s+${Fu}\\s*,\\s*${Fu}\\s+1\\s*,\\s*1\\s*$`,"i");function K_(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function g2(e,t,n,r,o){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=0,a=1;for(let l=0;l<m2;l+=1){let s=(i+a)/2;K_(s,t,r)<e?i=s:a=s}return K_((i+a)/2,n,o)}function b2(e){let t=h2.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]),i=Number(t[4]);return Math.min(n,o)<0||Math.max(n,o)>1?null:a=>g2(a,n,r,o,i)}function y2(e,t){if(!e.startsWith("spring("))return null;let n=$_(e);if(n===null)return null;let r=t.get(n);if(r)return r;let o=i=>q_(i,n);return t.set(n,o),o}function x2(e,t){if(!e.startsWith("custom(")||!e.endsWith(")"))return null;let n=e.slice(7,-1),r=t.get(n);if(r)return r;let o=b2(n);return o&&t.set(n,o),o}function Y_(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,o=new Map,i=s=>typeof s!="string"?null:s==="hold"?j_:z_(s,o)??y2(s,r)??x2(s,n),a=(s,c,d=[])=>{let f=i(s);return f||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\\(|$)/.test(s.trim())&&Mt("custom_ease_parse_failed",{ease:s}),t.call(c,s,...d)??p2)};e.parseEase=function(c,...d){return a(c,this,d)};let l=e.registerEase;if(typeof l=="function"){l("hold",j_);let s=c=>{let d=f=>f;d.config=(...f)=>a(`${c}(${f.join(",")})`,e),l(c,d)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Lp="first-frame",S2=3;function E2(e){let t=e.ownerDocument?.defaultView;return t&&e instanceof t.Element?!0:e instanceof Element}function v2(e){if(!E2(e)||e.tagName!=="AUDIO"&&e.tagName!=="VIDEO")return!1;let t=e.ownerDocument?.defaultView;return t&&e instanceof t.HTMLMediaElement?!0:e instanceof HTMLMediaElement}function A2(e){return e.hasAttribute("data-start")||e.hasAttribute("data-track-index")}function w2(e,t,n){let r=e;for(;r;){if(A2(r)&&!$s(r,{currentTime:0,compositionDuration:Number.POSITIVE_INFINITY,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:t}))return!1;r=r.parentElement}return!0}function X_(e,t,n,r){return t==="all"?!0:w2(e,n,r)}function _2(e,{scope:t="all"}={}){let n=e.defaultView,r=ut({documentRef:e,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),o=e.querySelector(`meta[name="${Ss}"]`)!==null,i=Array.from(e.querySelectorAll("video, audio")).filter(v2).filter(s=>X_(s,o&&s.preload!=="auto"?Lp:t,r,n?.__timelines??{})).filter(s=>s.readyState<S2),a=Array.from(e.querySelectorAll("img")).filter(s=>X_(s,s.getAttribute("loading")?.toLowerCase()==="lazy"?Lp:t,r,n?.__timelines??{})).filter(s=>!s.complete),l=e.fonts?.status==="loading";return{pendingMedia:i,pendingImages:a,fontsLoading:l}}function T2(e,{pendingMedia:t,pendingImages:n,fontsLoading:r},o){let i=t.map(s=>new Promise(c=>{if(s.error){c();return}let d=()=>{s.removeEventListener("canplay",d),s.removeEventListener("error",d),o.removeEventListener("abort",d),c()};s.addEventListener("canplay",d),s.addEventListener("error",d),o.addEventListener("abort",d,{once:!0})})),a=n.map(s=>s.decode?s.decode().catch(()=>{}):Promise.resolve()),l=r&&e.fonts?e.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...i,...a,l]).then(()=>{})}function C2(e,t,{scope:n="all"}={}){let r=_2(e,{scope:n});return r.pendingMedia.length===0&&r.pendingImages.length===0&&!r.fontsLoading?null:T2(e,r,t)}var R2=50;function M2(e,t){let n=e.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(r=>{let o,i=()=>{o!==void 0&&clearTimeout(o),t.removeEventListener("abort",i),r()};if(t.aborted){i();return}t.addEventListener("abort",i,{once:!0});let a=()=>{if(n.__renderReady){i();return}o=setTimeout(a,R2)};a()})}var k2=50,L2=1.5,N2=2,F2=1500;function kp(e,t){return new Promise(n=>{if(t.aborted){n(-1);return}let r=0,o=()=>{e.cancelAnimationFrame?.(r),n(-1)};t.addEventListener("abort",o,{once:!0}),r=e.requestAnimationFrame(i=>{t.removeEventListener("abort",o),n(i)})})}function P2(e,t){let n=e.defaultView;return n?(async()=>{let r=await kp(n,t);if(t.aborted)return;let o=await kp(n,t),i=o-r,a=0;for(;!t.aborted&&a<N2;){if(o-r>=F2)return;let l=await kp(n,t);if(t.aborted)return;let s=l-o;i=Math.min(i,s),a=s<k2||s<=i*L2?a+1:0,o=l}})():null}var I2=8e3;function D2(e,t,n={}){let r=n.inputs??[(c,d)=>C2(c,d,{scope:n.scope}),M2,P2],o=new AbortController,i=r.map(c=>c(e,o.signal)).filter(c=>c!==null);if(i.length===0){t({timedOut:!1});return}let a=n.timeoutMs??I2,l,s=new Promise(c=>{l=setTimeout(()=>c("timed-out"),a)});Promise.race([Promise.all(i).then(()=>"done"),s]).then(c=>{clearTimeout(l),o.abort(),t({timedOut:c==="timed-out"})})}function J_(e,t,n={}){D2(e,t,{...n,scope:Lp})}var Pp=new Map,Da=new Map,Np=new Map,Fp=()=>{},Z_=()=>{},Q_=0;function Ip(e){return/^[a-z][a-z0-9-]{0,63}$/.test(e)}function eT(e){let t=(Np.get(e)??0)+1;return Np.set(e,t),t}function tT(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?e:(Q_-=1,Q_)}function Dp(e,t){let n=Da.get(e);if(!n)return;let r=()=>Np.get(e)===t.generation&&Da.get(e)===n;try{Promise.resolve(n(t.payload)).then(()=>{r()&&Z_(e,t.requestId)},o=>{r()&&Fp(e,t.requestId,o)})}catch(o){r()&&Fp(e,t.requestId,o)}}function nT(e){Fp=e}function rT(e){Z_=e}function Pu(e,t,n){if(!Ip(e))return;let r={payload:t,requestId:tT(n),generation:eT(e)};Pp.set(e,r),Dp(e,r)}function Iu(e,t){Ip(e)&&(Pp.delete(e),Dp(e,{payload:void 0,requestId:tT(t),generation:eT(e)}))}function oT(e,t){if(!Ip(e))throw new Error(`Invalid HyperFrames runtime-data channel: ${e}`);Da.set(e,t);let n=Pp.get(e);return n&&Dp(e,n),()=>{Da.get(e)===t&&Da.delete(e)}}var iT=!1;function vn(e){if(e){if(typeof e.pause!="function"){iT||(iT=!0,Mt("timeline_missing_pause",{}));return}try{e.pause()}catch(t){$("runtime.timeline.pause",t)}}}function G2(e){let t=e;if(typeof t.remove=="function")for(let n of e.getChildren?.(!1,!0,!1)??[])n.data===wi&&t.remove(n)}function B2(){let e=window.__HF_EXPORT_RENDER_SEEK_CONFIG,t=e?.fps,n=e?.fpsSource,r=Number(t);return!e||t==null?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"missing"}:!Number.isFinite(r)||r<=0?{fps:null,source:"default",rawFpsSource:n,rawFps:t,fallbackReason:"invalid"}:{fps:r,source:n==="render-options"||n==="default"?n:"unknown",rawFpsSource:n,rawFps:t,fallbackReason:e.fpsFallbackReason}}function U2(){let e=B_(vt()?.getAttribute("data-fps")??"");return e.ok?e.value.num/e.value.den:null}function W2(e,t){return t!==null&&e.length===t.length&&e.every((n,r)=>n===t[r])}function aT(e,t,n){let r=null,o=!0;return()=>{let i=e();if(i.length===0)return r=null,o=!0,!0;if(W2(i,r))return o;r=i,o=!1;let a=i.length===1?i[0]:Promise.all(i);return Promise.resolve(a).then(()=>{r===i&&(o=!0,t())},l=>{r===i&&(o=!0,n(l),t())}),o}}function Ha(e){let t=e.querySelector(`meta[name="${Fn}"]`)?.getAttribute("content");if(!t)return null;try{return JSON.parse(t)}catch{return null}}var Hp=e=>JSON.stringify([Array.from(e.attributes,t=>[t.name,t.value]).filter(([t])=>t!==Ir),e.innerHTML]),V2=new Set(["style","preload","src",Ir,er,We,...vs]),$2=e=>e.split(/\\s+/).filter(t=>t&&!t.startsWith("__hf-")).join(" "),sT=e=>JSON.stringify([Array.from(e.attributes,({name:t,value:n})=>[t,t==="class"?$2(n):t==="poster"?nx(e):n]).filter(([t,n])=>!V2.has(t)&&!((t==="class"||t==="poster")&&!n)).sort(([t],[n])=>t<n?-1:1),e.hasAttribute("data-var-src")?null:qi(e),e.innerHTML]),Ga=new WeakMap,uT=e=>e.localName==="video"||e.localName==="audio",Du=e=>{if(!Ge(e))return;let t=uT(e)?[e]:e.firstElementChild?e.querySelectorAll("video, audio"):[];for(let n of t)Ga.has(n)||Ga.set(n,Hp(n))},Ou=null;function cT(){typeof MutationObserver>"u"||!Ha(document)||(Du(document.documentElement),Ou=new MutationObserver(e=>{for(let t of e){t.addedNodes.forEach(Du);let{target:n}=t;Ge(n)&&uT(n)&&Ga.set(n,Hp(n))}}),Ou.observe(document.documentElement,{childList:!0,subtree:!0}))}function dT(){let e=o=>o?.config?.({force3D:!1}),t=Object.getOwnPropertyDescriptor(window,"gsap"),n=window.gsap;if(e(n),t?.configurable===!1||t?.get?.hfFlat)return;let r=Object.assign(()=>t?.get?t.get.call(window):n,{hfFlat:!0});Object.defineProperty(window,"gsap",{configurable:!0,enumerable:!0,get:r,set:o=>{t?.set?t.set.call(window,o):n=o,e(o)}})}var q2=new Map([["image",["href","xlink:href"]],["object",["data"]]]),z2=1e3,j2=16;function K2(){let e;return()=>e??(e=document.getAnimations())}var Op=e=>Ar(e)||Re(e)&&Ks(e)&&Eb({volume:Number.parseFloat(e.dataset.volume??""),fxChain:e.getAttribute("data-fx-chain"),automation:e.getAttribute("data-automation"),audioGroup:e.getAttribute("data-audio-group"),masterChain:qb(e.ownerDocument)}),fT="audio[data-start], video[data-start]",Y2=300;function X2(e){return po()&&Ar(e)&&!e.loop&&e.duration<=Y2&&typeof Et(e)=="number"&<(e)===1}var Oa=e=>Array.from(e.querySelectorAll(fT)).filter(Op);function lT(e){let t=e.matches(`[${Es}]`)?[e]:Array.from(e.querySelectorAll(`img[${Es}]`)).filter(n=>n.closest("[data-start]")===e);for(let n of t)n.setAttribute("loading","eager")}function mT(){let e=md(),t=window.parent!==window,n=u=>t&&u.hasAttribute(zt);Ou?.disconnect(),Ou=null,Ha(document)&&Du(document.documentElement);let r=()=>{};gy(we),nT((u,p,b)=>{we({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:p,message:b instanceof Error?b.message:String(b)})}),rT((u,p)=>{try{r()}catch(b){we({source:"hf-preview",type:"runtime-data-error",channel:u,requestId:p,message:b instanceof Error?b.message:String(b)});return}we({source:"hf-preview",type:"runtime-data-applied",channel:u,requestId:p})}),ya(document),nu(document),zb(document),Yv(document);let o=B2();e.canonicalFps=o.fps??U2()??e.canonicalFps;let i=o.fps??(window.__HF_REPLAY_SKIPPED_FRAMES?e.canonicalFps:void 0);if(kb(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG){let u=JSON.stringify({canonicalFps:e.canonicalFps,source:o.source,rawFpsSource:o.rawFpsSource,rawFps:o.rawFps,fallbackReason:o.fallbackReason});globalThis.console.info(`[hyperframes] render runtime fps ${u}`)}let a=null,l=null,s=null,c=[],d=new Set,f=null,m=new Set,g=(u,p,b)=>{m.has(u)||(m.add(u),Mt(p,b))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(u){$("runtime.init.site1",u)}let h=new Mu;e.transportClock=h;let y=new Nu,S=!1;y.init().then(u=>{S=u}),window.__hf=window.__hf||{};let E=u=>u.closest("[data-hidden]")!==null||ol(u.ownerDocument,u),v=()=>{let u=window.gsap,p=window;if(!(!u?.registerPlugin||p.__hfAutoNoopRegistered))try{u.registerPlugin({name:"_auto",init:()=>!1}),p.__hfAutoNoopRegistered=!0}catch(b){g("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),$("runtime.autoMarker.install",b)}},T=()=>{let u=window.gsap;if(!u){g("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Y_(u)||g("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(p){g("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),$("runtime.customEase.install",p)}};v(),T(),document.documentElement&&(document.documentElement.style.margin="0",document.documentElement.style.padding="0",document.documentElement.style.overflow="hidden"),document.body&&(document.body.style.margin="0",document.body.style.padding="0",document.body.style.overflow="hidden");try{Ay(document)}catch(u){$("runtime.init.cssVariables",u)}if(window.__timelines=window.__timelines||{},Array.isArray(window.__timelines)){let u=window.__timelines,p=vt()?.getAttribute("data-composition-id")??"root",b={};if(u.length===1)b[p]=u[0];else for(let x=0;x<u.length;x++)b[`tl-${x}`]=u[x];window.__timelines=b}let H=vt();H&&!H.hasAttribute("data-start")&&H.setAttribute("data-start","0");let U=u=>{c.push(u)},M=(u,p,b)=>{let x=b??`${u}:${JSON.stringify(p)}`;d.has(x)||(d.add(x),we({source:"hf-preview",type:"diagnostic",code:u,details:p}))},L=u=>{let p={scale:1,focusX:960,focusY:540},b=[],x=[],A={time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:u.play,pause:u.pause,seek:u.seek,getTime:u.getTime,getDuration:u.getDuration,isPlaying:u.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>p,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>b,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:u.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>x,getRenderState:()=>({...A,time:u.getTime(),duration:u.getDuration(),isPlaying:u.isPlaying()})}},G=.75,C=.05,B=100,O=240,Y=u=>{if(u instanceof Error)return u.message||String(u);if(typeof u=="string")return u;try{return JSON.stringify(u)}catch{return String(u??"")}},Z=u=>{let p=u.toLowerCase();return p.includes("cannot read properties of null")||p.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:p.includes("failed to execute \'queryselector\'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:p.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},J=u=>{let p=Rr(u);return p===null?null:`${p}px`},D=null,V=!1,R=()=>{if(!V)return vt();if(Jp(),Ke&&!ft&&D?.revision===nn&&(D.el===null||D.el.isConnected))return D.el;let u=vt();return D={revision:nn,el:u},u},k=()=>{let u=R();if(!u)return;let p=J(u.getAttribute("data-width")),b=J(u.getAttribute("data-height"));p&&(u.style.width=p),b&&(u.style.height=b),p&&u.style.setProperty("--comp-width",p),b&&u.style.setProperty("--comp-height",b),p&&(document.documentElement.style.width=p),b&&(document.documentElement.style.height=b),p&&(document.body.style.width=p),b&&(document.body.style.height=b)},F=()=>{let u=R(),p=Array.from(document.querySelectorAll("[data-composition-id]")).filter(b=>b.hasAttribute("data-duration")||b.hasAttribute("data-end"));for(let b of p){if(u&&b===u)continue;let x=b.getAttribute("data-duration"),A=b.getAttribute("data-end");x!=null&&!b.hasAttribute(In)&&b.setAttribute(In,x),A!=null&&!b.hasAttribute(Dn)&&b.setAttribute(Dn,A),b.removeAttribute("data-duration"),b.removeAttribute("data-end")}},_=new WeakMap,N=u=>[u.className,u.style.position,u.style.top,u.style.left,u.style.width,u.style.height,u.style.transform,u.getAttribute("data-width"),u.getAttribute("data-height")].join("|"),j=()=>{let u=R();if(!u)return;u.style.position||(u.style.position="relative"),u.style.overflow="hidden";let p=J(u.getAttribute("data-width")),b=J(u.getAttribute("data-height"));p&&(u.style.width=p),b&&(u.style.height=b);let x=Array.from(u.children).filter(w=>{let P=w.tagName.toLowerCase();return P==="script"||P==="style"||P==="link"||P==="meta"||!w.hasAttribute("data-start")||w.hasAttribute(zt)?!1:_.get(w)!==N(w)}),A=x.filter(w=>w.style.getPropertyValue("display")==="none").map(w=>({el:w,priority:w.style.getPropertyPriority("display")}));for(let{el:w}of A)w.style.removeProperty("display");for(let w of x){let P=w.tagName.toLowerCase(),q=(w.style.top==="0px"||w.style.top==="0")&&(w.style.left==="0px"||w.style.left==="0")&&w.style.width==="100%"&&w.style.height==="100%",W=/translate\\(\\s*-50%\\s*,\\s*-50%\\s*\\)/.test(w.style.transform);if(q&&W&&!w.hasAttribute("data-width")&&!w.hasAttribute("data-height")){let oe=w.style.top,se=w.style.left,me=w.style.width,Qe=w.style.height;w.style.top="",w.style.left="",w.style.width="",w.style.height="";let Ye=window.getComputedStyle(w);Ye.top!=="auto"||Ye.bottom!=="auto"||Ye.left!=="auto"||Ye.right!=="auto"||Ye.width!=="0px"||Ye.height!=="0px"||(w.style.top=oe,w.style.left=se,w.style.width=me,w.style.height=Qe)}let I=window.getComputedStyle(w),X=I.position;if(X!=="absolute"&&X!=="fixed"&&(w.style.position="absolute"),P!=="audio"){let oe=J(w.getAttribute("data-width")),se=J(w.getAttribute("data-height")),me=I.width!=="0px"&&I.width!=="auto",Qe=I.height!=="0px"&&I.height!=="auto";oe?!w.style.width&&!me&&(w.style.width=oe):!w.style.width&&I.width==="0px"&&(w.style.width="100%"),se?!w.style.height&&!Qe&&(w.style.height=se):!w.style.height&&I.height==="0px"&&(w.style.height="100%")}}for(let{el:w,priority:P}of A)w.style.setProperty("display","none",P);if(document.readyState==="complete")for(let w of x)_.set(w,N(w))},ae=u=>ut({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:u}),de=null,ve=u=>{let p=de;de=ae(!0);try{return u()}finally{de=p}},z=u=>u&&de?de:ae(u),ee=(u,p=0,b)=>z(b?.includeAuthoredTimingAttrs??!0).resolveStartForElement(u,p),Q=(u,p)=>z(p?.includeAuthoredTimingAttrs??!0).resolveDurationForElement(u),fe=u=>{let p=u.closest("[data-composition-id]"),b=p?ee(p,0):null,x=p?Q(p,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:p,inheritedStart:b,inheritedDuration:x}},ce=u=>z(!0).resolveHostSlotsForElement(u),xe=(u,p)=>{let b=Ue(u.dataset.duration),x=b!=null&&b>0?p+b:1/0;return Mr({start:p,end:x},ce(u))},re=u=>z(!0).resolveMediaStartForElement(u);window.__hfResolveMediaStartSeconds=re,c.push(()=>{window.__hfResolveMediaStartSeconds===re&&delete window.__hfResolveMediaStartSeconds});let ie=!!document.querySelector("[data-composition-src]"),ot=!1;{let u=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let p of u){let b=p.getAttribute("data-composition-id");if(b&&p.children.length===0&&document.querySelector(`template#${CSS.escape(b)}-template`)){ot=!0;break}}}let Be=!ie&&!ot,Ee=u=>{let p=dn(u);return p==null?null:Math.max(0,p)},Me=u=>typeof u=="number"&&Number.isFinite(u)&&u>mn,Pe=()=>Array.from(document.querySelectorAll("video[data-start], audio[data-start]")).length===0?null:ve(()=>ob(document,{mediaStart:re,mediaDuration:io})),xt=()=>{let u=R();if(!u)return null;let p=window.__timelines??{},b=ut({timelineRegistry:p,includeAuthoredTimingAttrs:!0});return ib(u,b)},cr=()=>{let u=window;return!!(u.lottie||u.DotLottie)},wn=()=>{let u=R();if(!u)return _i({authoredDurationSeconds:null,clipEndsSeconds:[]});let p=ut({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:!0});return ab(u,p,{unregisteredLottie:cr()})},qr=null,qu=()=>{if(ft)return wn();let u=jr();return qr?.revision!==u&&(qr={revision:u,result:wn()}),qr.result},zu=(u,p)=>{window.__hf=window.__hf||{},window.__hf.lengthSource=p?{from:"media",tag:p.tagName.toLowerCase(),src:p.getAttribute("src")??p.currentSrc??"",trimmed:p.hasAttribute("data-duration")||p.hasAttribute("data-end")}:{from:u}},Wa=u=>{window.__hf=window.__hf||{},window.__hf.durationSource={source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},u.source==="derived"&&M("composition_duration_derived",{source:u.source,seconds:u.seconds,pendingClips:u.pendingClips},`composition_duration_derived:${u.seconds}`)},Va=()=>{let u=Pe();return u&&ju(u.seconds)!==null?u:null},ju=u=>typeof u!="number"||!Number.isFinite(u)||u<=mn?null:u,$a=u=>Me(u)?Math.max(mn,u*G):mn,zr=(u=!1)=>{let p=0;for(let b of e.deterministicAdapters){let x=u?b.getAnimationCycleEndSeconds:b.getInferredDurationSeconds;if(typeof x!="function")continue;let A=null;try{A=x()}catch(w){$("runtime.init.adapterDuration",w)}typeof A=="number"&&Number.isFinite(A)&&A>0&&(p=Math.max(p,A))}return p>mn?p:null},ft=!1,te=()=>ft&&window.__HF_EXPORT_RENDER_SEEK_CONFIG!=null,Ie=[...["data-start","data-duration","data-end","data-composition-id","data-composition-src","data-composition-file","data-root","data-hf-authored-duration","data-hf-authored-end","data-hf-auto-start",Bs,"data-playback-rate","data-automation","data-playback-start","data-media-start","id","src"],"data-width","data-height"],it=Xv(Ie),mt=["loadedmetadata","durationchange","emptied"],Vt=null,_n=-1,Yo=null,Xo=Number.NEGATIVE_INFINITY,Ke=null,nn=0,Kp=new Map,qa=u=>{if(!Ke||ft)return Array.from(document.querySelectorAll(u));it(Ke.takeRecords())&&Cn();let p=Kp.get(u);if(p?.revision===nn)return p.nodes;let b=Array.from(document.querySelectorAll(u));return Kp.set(u,{revision:nn,nodes:b}),b},Tn=()=>{},Cn=()=>{nn+=1,Tn()},Yp=()=>{let u=Va();return{media:u?.seconds??null,mediaElement:u?.element??null,authoredComposition:xt()}},XT=()=>{let u=window.__timelines??{},p="";for(let b of Object.keys(u)){let x=u[b];x&&(p+=`${b}=${Ee(x)??"?"};`)}return p},Xp=u=>{let p=u.target;Ce(p)&&Js(p)||Cn()},JT=(u,p)=>{let b=Ke?.takeRecords()??[];p();let x=Ke?.takeRecords()??[];(it(b)||it(x.filter(A=>A.target!==u)))&&Cn()},QT=u=>{let p=Ke?.takeRecords()??[];u(),Ke?.takeRecords(),it(p)&&Cn()},Jp=()=>{if(!(Ke||typeof MutationObserver>"u")){Ke=new MutationObserver(u=>{it(u)&&Cn()}),Ke.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:Ie});for(let u of mt)document.addEventListener(u,Xp,!0);c.push(()=>{Ke?.disconnect(),Ke=null,Cn();for(let u of mt)document.removeEventListener(u,Xp,!0)})}};V=!0;let jr=()=>{Jp(),Ke&&it(Ke.takeRecords())&&Cn();let u=Date.now();if(!h.isPlaying()||u-Xo>=Mp){Xo=u;let p=XT();p!==Yo&&(Yo=p,Cn())}return nn},Qp=u=>ft?Yp():(u??(u=jr()),Vt&&_n===u||(_n=u,Vt=Yp()),Vt),Xe=(u,p=0,b)=>{let x=null,A=null,w=sb({declared:Ue(R()?.getAttribute("data-duration")),timeline:()=>Ee(u),floors:()=>{let P=Qp(b),{media:q,authoredComposition:W}=P;return A=P.mediaElement,[q,W,zr()]},fallback:p,derived:()=>(x=qu(),x.seconds??0)});return x?Wa(x):window.__hf?.durationSource&&delete window.__hf.durationSource,zu(w.from,w.floorIndex===0?A:null),w.seconds},Ku=new WeakMap,Jo=u=>u.__hfReal??u,Yu=null,Qo=new Set,Zp=()=>{for(let u of Qo)u===e.capturedTimeline||u===Yu?.timeline||(Qo.delete(u),u.kill?.())},Xu=()=>{let u=window.__timelines??{},p=ge=>{let pe=Object.entries(u).filter(le=>!!le[1]&&typeof le[1].play=="function"&&typeof le[1].pause=="function");if(pe.length!==1)return{timeline:null};let K=pe[0];if(!K)return{timeline:null};let[ne,ue]=K;return{timeline:ue,selectedTimelineIds:[ne],selectedDurationSeconds:Ee(ue),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:ge,soleTimelineId:ne}}}},b=ut({timelineRegistry:u,includeAuthoredTimingAttrs:!0}),{media:x,authoredComposition:A}=Qp(),w=Math.max(x??0,A??0)||null,P=$a(w),q=ge=>{let pe=document.querySelector(`[data-composition-id="${CSS.escape(ge)}"]`);return pe?b.resolveStartForElement(pe,0):0},W=(ge,pe)=>{let K=q(pe.compositionId);ge.add(pe.timeline,K),Ku.set(Jo(pe.timeline),{hostId:pe.compositionId,parent:ge,at:K})},I=(ge,pe)=>{let K=Jo(pe.timeline),ne=Ku.get(K);return ne&&ne.parent===ge&&K.parent===Jo(ge)?ne:null},X=(ge,pe)=>Math.abs(ge.at-q(pe.compositionId))<1e-6,Se=(ge,pe)=>{let K=I(ge,pe);!K||X(K,pe)||W(ge,pe)},oe=ge=>{let pe=window.gsap;if(!pe||typeof pe.timeline!="function")return null;let K=pe.timeline({paused:!0});Qo.add(K);for(let ne of ge)W(K,ne);return _t(me(K,ge)),K},se=(ge,pe)=>{if(!Me(ge))return null;let K=window.gsap;if(!K||typeof K.timeline!="function")return null;let ne=K.timeline({paused:!0});if(Qo.add(ne),pe){try{ne.add(pe,0)}catch(le){$("runtime.init.site2",le)}_t(me(ne,[{timeline:pe}]))}let ue=ne;if(typeof ue.to=="function")try{ue.to({},{duration:ge,data:wi})}catch(le){$("runtime.init.site3",le)}return ne},me=(ge,pe)=>{if(!ge||typeof ge.getChildren!="function")return[];try{let K=ge.getChildren(!0,!0,!0);return Array.isArray(K)?pe.filter(ne=>K.includes(Jo(ne.timeline))):[]}catch{return[]}},Qe=(ge,pe)=>{let K=ge,ne={addedIds:[],nested:[]};if(typeof K.getChildren!="function")return ne;try{let ue=K.getChildren(!0,!0,!0)??[];if(!Array.isArray(ue))return ne;let le=[];for(let Ae of pe){if(ue.includes(Jo(Ae.timeline))){Se(ge,Ae);continue}try{W(ge,Ae),le.push(Ae.compositionId)}catch(De){$("runtime.init.site4",De)}}return{addedIds:le,nested:me(ge,pe)}}catch{return ne}},Ye=R(),He=Ye?.getAttribute("data-composition-id")??null;if(!He)return p("root_missing_composition_id");let Ze=u[He]??null,$e=(()=>{if(!Ye)return[];let ge=new Set,pe=Array.from(Ye.querySelectorAll("[data-composition-id]")),K=[];for(let ne of pe){let ue=ne.getAttribute("data-composition-id");if(!ue||ue===He||ge.has(ue))continue;ge.add(ue);let le=u[ue]??null;if(!le||typeof le.play!="function"||typeof le.pause!="function")continue;let Ae=Ee(le);K.push({compositionId:ue,timeline:le,durationSeconds:Ae??0})}return K})(),_t=ge=>{for(let pe of ge){let K=pe.timeline;if(typeof K.paused=="function")try{K.paused(!1)}catch(ne){$("runtime.init.site5",ne)}}};if(Ze){let ge=$e.length>0?Qe(Ze,$e):{addedIds:[],nested:[]},pe=ge.addedIds;if(_t(ge.nested),($e.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id=\'"+He+"\'])"))&&(dr=!0),pe.length>0)try{$i(Ze,Ze.time(),!1)}catch{}G2(Ze);let K=Ee(Ze);if(!Me(K)&&$e.length>0){let le=$e.map(on=>on.compositionId),Ae=oe($e),De=Ee(Ae);if(Ae&&Me(De))return{timeline:Ae,selectedTimelineIds:le,selectedDurationSeconds:De,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:He,rootDurationSeconds:K,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:De,mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:A,selectedTimelineIds:le,autoNestedChildren:pe}}};let st=se(w??0,Ze),gt=Ee(st);if(st&&Me(gt))return{timeline:st,selectedTimelineIds:[He],selectedDurationSeconds:gt,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:K,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:gt,selectedTimelineIds:[He],autoNestedChildren:pe}}}}if(!Me(K)&&$e.length===0){let le=se(w??0,Ze),Ae=Ee(le);if(le&&Me(Ae))return{timeline:le,selectedTimelineIds:[He],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:He,rootDurationSeconds:K,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:x,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:Ae,selectedTimelineIds:[He]}}}}let ne=Ue(Ye?.getAttribute("data-duration")),ue=Math.max(Me(ne)?ne:0,A??0);if(ue>0&&Me(ue)&&Me(K)&&ue>=K+.5){let le=Ze;if(typeof le.to=="function")try{le.to({},{duration:0,data:wi},ue)}catch(De){$("runtime.init.site6",De)}let Ae=Ee(Ze);if(Me(Ae))return{timeline:Ze,selectedTimelineIds:[He],selectedDurationSeconds:Ae,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:He,rootDurationSeconds:K,rootDeclaredDur:ne,authoredCompositionDurationFloorSeconds:A,newDur:Ae}}}}return{timeline:Ze,selectedTimelineIds:[He],selectedDurationSeconds:K,mediaDurationFloorSeconds:x,diagnostics:pe.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:He,selectedDurationSeconds:K,autoNestedChildren:pe}}:void 0}}if($e.length>0){let ge=$e.map(le=>le.compositionId),pe=Yu,K=pe?.size===$e.length&&Me(Ee(pe.timeline))&&$e.every(le=>{let Ae=I(pe.timeline,le);return Ae!==null&&X(Ae,le)})?pe.timeline:null,ne=K??oe($e),ue=Ee(ne);if(ne)return K||(Yu={timeline:ne,size:$e.length}),{timeline:ne,selectedTimelineIds:ge,selectedDurationSeconds:ue,mediaDurationFloorSeconds:x,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:He,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:P,selectedDurationSeconds:ue,mediaDurationFloorSeconds:x,selectedTimelineIds:ge}}}}return p("root_composition_id_unmatched_in_registry")},dr=!1,ZT=u=>{let p=window.gsap,b=u;if(!(!b||typeof b.getChildren!="function"||!p||typeof p.parseEase!="function"))for(let x of b.getChildren(!0,!0,!0)){let A=x,w=A.timeline;if(!w||!("_ease"in w)||typeof w._ease=="function")continue;let P=A.vars?.keyframes,W=(P&&!Array.isArray(P)?P.ease:void 0)??A.vars?.ease??"none";try{let I=p.parseEase(W);typeof I=="function"&&(w._ease=I)}catch(I){Mt("keyframe_ease_repair_failed",{ease:typeof W=="string"?W:String(W)}),$("runtime.keyframeEase.repair",I)}}},fr=()=>{if(T(),!Be)return!1;let u=e.capturedTimeline,p=Ee(u),b=Me(p);if(u&&b&&dr)return!1;let x=Xu();if(!x.timeline)return!1;if(u&&u===x.timeline)return typeof u.timeScale=="function"&&u.timeScale(e.playbackRate),!1;e.capturedTimeline=x.timeline,Zp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),ZT(e.capturedTimeline);let A=Xe(e.capturedTimeline,0);if(A<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),vn(e.capturedTimeline)),A>0){try{h.setDuration(A)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let q=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(q,!1),vn(e.capturedTimeline)}let P=window.__hfStudioManualEditsApply;typeof P=="function"&&P(),ya(document)}if(x.diagnostics&&we({source:"hf-preview",type:"diagnostic",code:x.diagnostics.code,details:x.diagnostics.details}),we({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:x.selectedTimelineIds??[],selectedDurationSeconds:x.selectedDurationSeconds??null,mediaDurationFloorSeconds:x.mediaDurationFloorSeconds??null}}),t){let P=R(),q=A>0?A:0,W=String(q>0?q:1),I=new Set,X=se=>se.tagName.toLowerCase()===pn,Se=new Set(document.querySelectorAll("[data-start]")),oe=se=>{let me=se.parentElement;for(;me&&me!==P;){if(Se.has(me))return!0;me=me.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let se of e.capturedTimeline.getChildren(!0))if(typeof se.targets=="function")for(let me of se.targets())Te(me)&&me!==P&&(X(me)||me.hasAttribute("data-start")||oe(me)||I.has(me)||(I.add(me),me.setAttribute("data-start","0"),me.setAttribute("data-duration",W),me.setAttribute(zt,"1")))}catch{}if(Te(P))for(let se of P.querySelectorAll("[id]"))Te(se)&&se!==P&&(se.hasAttribute("data-start")||oe(se)||I.has(se)||se.tagName==="SCRIPT"||se.tagName==="STYLE"||se.tagName==="LINK"||X(se)||(I.add(se),se.setAttribute("data-start","0"),se.setAttribute("data-duration",W),se.setAttribute(zt,"1")))}let w=Ju();for(let P of Rn)Zo.delete(P),Qu(P,w);return!0},eh=()=>{if(e.tornDown)return;let u=Xu();if(!u.timeline){e.capturedTimeline=null,dr=!1,h.setDuration(Xe(null,0)),rn(e.currentTime);return}if(e.capturedTimeline!==u.timeline)dr=!1,fr();else{let p=Xe(e.capturedTimeline,0);p>0&&p!==h.getDuration()&&(h.setDuration(p),at())}rn(e.currentTime)};r=()=>{eh(),at()},window.__hfForceTimelineRebind=eh;let eC=()=>{let u=R();if(!Te(u))return;let p=u.getBoundingClientRect(),b=Rr(u.getAttribute("data-width")),x=Rr(u.getAttribute("data-height")),A=window.getComputedStyle(u),w=b!==null&&x!==null,P=p.width<=0||p.height<=0||u.clientWidth<=0||u.clientHeight<=0;!w||!P||M("root_stage_layout_zero",{compositionId:u.getAttribute("data-composition-id")??null,declaredWidth:b,declaredHeight:x,rectWidth:Math.round(p.width),rectHeight:Math.round(p.height),clientWidth:u.clientWidth,clientHeight:u.clientHeight,display:A.display,visibility:A.visibility,overflow:A.overflow},`root-stage-layout-zero:${u.getAttribute("data-composition-id")??"unknown"}`)},tC=()=>{e.tornDown||(f!=null&&window.cancelAnimationFrame(f),f=window.requestAnimationFrame(()=>{f=null,eC()}))},nC=()=>{l=u=>{let p=Y(u.error??u.message).slice(0,O);if(!p)return;let b=Z(p);we({source:"hf-preview",type:"diagnostic",code:b.code,details:{category:b.category,message:p,filename:u.filename||null,line:Number.isFinite(u.lineno)?u.lineno:null,column:Number.isFinite(u.colno)?u.colno:null}})},s=u=>{let p=Y(u.reason).slice(0,O);if(!p)return;let b=Z(p);we({source:"hf-preview",type:"diagnostic",code:`${b.code}_unhandled_rejection`,details:{category:`${b.category}-unhandled-rejection`,message:p}})},window.addEventListener("error",l),window.addEventListener("unhandledrejection",s)},th=new WeakSet,rC=()=>{let u=Array.from(document.querySelectorAll("img, video, audio, source, link[rel=\'stylesheet\']"));for(let b of u){if(th.has(b))continue;th.add(b);let x=()=>{if(!Ge(b))return;let A=b.tagName.toLowerCase(),w=b.getAttribute("src")??b.getAttribute("href")??b.getAttribute("poster")??null,P=A==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";M(P,{tagName:A,assetUrl:w,currentSrc:(et(b)||Ce(b))&&b.currentSrc||null,readyState:Ce(b)?b.readyState:null,networkState:Ce(b)?b.networkState:null},`${P}:${A}:${w??"unknown"}`)};b.addEventListener("error",x),U(()=>{b.removeEventListener("error",x)})}let p=document.fonts;p&&p.ready.then(()=>{if(e.tornDown)return;let b=Array.from(p).filter(x=>x.status==="error").map(x=>x.family).filter(x=>!!x).slice(0,10);b.length!==0&&M("runtime_font_load_issue",{failedFamilies:b,totalFaces:Array.from(p).length},`runtime-font-load-issue:${b.join("|")}`)}).catch(()=>{})},oC=(u,p)=>{if(!u.timeline)return!1;let b=e.capturedTimeline;if(b&&b===u.timeline)return!1;let x=Math.max(0,e.currentTime||0);e.capturedTimeline=u.timeline,Zp(),typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{vn(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&$i(e.capturedTimeline,x,!1)}catch(A){$("runtime.init.site7",A)}return we({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:p,previousTime:x,selectedTimelineIds:u.selectedTimelineIds??[],selectedDurationSeconds:u.selectedDurationSeconds??null,mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),!0},mr=null,nh=!1,Rn=new Set,Zo=new WeakMap,Ju=()=>{let u;return()=>u??(u=Md(e.capturedTimeline??{}))},za=()=>{e.tornDown||(mr!=null&&window.clearTimeout(mr),mr=window.setTimeout(()=>{if(e.tornDown||(mr=null,te()))return;let u=Xu();if(!u.timeline||!Me(u.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){fr()&&(at(),Je(!0));return}if(nh)return;let b=Ee(e.capturedTimeline),x=u.selectedDurationSeconds??Ee(u.timeline);Me(x)&&(!Me(b)||x>=b+C)&&oC(u,"manual")&&(nh=!0,we({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:b??null,selectedDurationSeconds:x??null,selectedTimelineIds:u.selectedTimelineIds??[],mediaDurationFloorSeconds:u.mediaDurationFloorSeconds??null}}),at(),Je(!0))},B))},rh=u=>{Ce(u.currentTarget)&&Mx(u.currentTarget)},oh=u=>{let p=u.currentTarget;e.tornDown||h.isPlaying()||!Ce(p)||Kn(p)||($t=null,e.mediaForceSyncNextTick=!0,St())},ih=u=>{Ce(u.currentTarget)&&kx(u.currentTarget)},ah=u=>{Op(u)&&N_(u)&&zo(u,qo(u))},sh=u=>{let p=u.currentTarget;Ce(p)&&ah(p)},lh=u=>{u.removeEventListener("loadedmetadata",za),u.removeEventListener("durationchange",za),u.removeEventListener("loadedmetadata",rh),u.removeEventListener("loadedmetadata",oh),u.removeEventListener("loadedmetadata",sh),u.removeEventListener("error",ih),Rn.delete(u)},iC=()=>{for(let u of Rn)lh(u)},uh=()=>{for(let u of Rn)u.isConnected||(lh(u),u.pause(),_d(u),u.remove());y.releaseDetached()},ch=u=>{let p=Number.parseFloat(u.dataset.volume??"");return Number.isFinite(p)?Math.max(0,Math.min(1,p)):null},ja=()=>{if(e.tornDown)return;let u=Array.from(document.querySelectorAll("video, audio")),p=[],b=Ju();for(let x of u){if(Rn.has(x))continue;Rn.add(x);let A=ch(x);A!==null&&(x.volume=A),x.addEventListener("loadedmetadata",za),x.addEventListener("durationchange",za),x.addEventListener("loadedmetadata",sh),ah(x),x.addEventListener("loadedmetadata",rh),x.addEventListener("loadedmetadata",oh),x.addEventListener("error",ih),Ax(x),nc(x)?p.push(x):Xs(x),Qu(x,b)}p.length>0&&rn(e.currentTime,p)},Qu=(u,p)=>{Zo.has(u)||Gb(u,e.capturedTimeline,Xe(e.capturedTimeline,0),Zo,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE,...p&&{movers:p}})},Zu=new WeakMap,aC=u=>{let p=Zu.get(u);if(p!==void 0)return p;let b=window.getComputedStyle(u).position,x=b==="static"||b==="relative"||b==="sticky";return Zu.set(u,x),x},ec=new WeakMap,sC=u=>{let p=ec.get(u);if(p!==void 0)return p;let b=u.querySelector("[data-start]")===null;return ec.set(u,b),b},lC=()=>{Zu=new WeakMap,ec=new WeakMap},Kr=new WeakMap,dh=(u,p)=>{if(!Kr.has(u)){let b=u.style.getPropertyValue("display"),x=u.style.getPropertyPriority("display"),A=p&&b==="none"&&!x;Kr.set(u,A?{value:"",priority:""}:{value:b,priority:x})}u.style.display="none"},fh=u=>{let p=Kr.get(u);p&&(Kr.delete(u),p.value?u.style.setProperty("display",p.value,p.priority):u.style.removeProperty("display"))},Ka=new WeakSet,Ya=!1,mh=u=>Ce(u)&&u.hasAttribute("data-start")&&(Op(u)||y.routesElement(u)),ph=u=>mh(u)||Array.from(u.querySelectorAll(fT)).some(mh),hh=new WeakMap,uC=(u,p)=>{for(let b of Oa(document)){if(il(b)!==u||y.routesElement(b)||E(b))continue;let x=re(b),A=Ue(b.dataset.duration),w=A!=null&&A>0?x+A:1/0;if(Number.isFinite(x)&&p<w)return!0}return!1},cC=u=>{let p=!1;for(let b of qa(pn)){let x=b.hasAttribute("data-hidden"),A=hh.get(b);A!==x&&(hh.set(b,x),b.id&&(y.setGroupMuted(b.id,x),A&&!x&&uC(b.id,u)&&(p=!0)))}return p},gh=u=>{let p=Xe(e.capturedTimeline,0,u);return(b,x)=>$s(b,{currentTime:x,compositionDuration:p,canonicalFps:e.canonicalFps,exportRenderSeek:!!window.__HF_EXPORT_RENDER_SEEK_CONFIG,timelineRegistry:window.__timelines??{},resolver:z(!0)})},bh=(u,p,b,x)=>{for(let A=u;A&&A!==x;A=A.parentElement)if(wr(A)&&A.hasAttribute("data-start")&&!n(A)&&!b(A,p))return!1;return!0},yh=()=>({canonicalFps:e.canonicalFps,parked:bb(),parkedClips:js}),xh=Bc(),Sh=ws(),dC=g0(u=>Vs(u,{timelineRegistry:window.__timelines??{},resolver:z(!0)})),Xa=new Set,Eh=new WeakSet,Ja={revision:-1,starts:new Map},fC=(u,p)=>{Ja.revision!==p&&(Ja={revision:p,starts:new Map});let b=Ja.starts.get(u);return b===void 0&&(b=ee(u,Number.NaN),Ja.starts.set(u,b)),b},mC=(u,p)=>{if(Xa.size===0||!h.isPlaying())return;let b=[];for(let w of Xa){let P=fC(w,p);!(P<=u+Za)&&w.isConnected&&w.hasAttribute(We)||(Xa.delete(w),w.isConnected&&w.hasAttribute(We)&&P>u&&b.push(w))}if(b.length===0)return;let x=new Set(b.flatMap(w=>w.closest(`[${Pt}]`)??[]));for(let w of x)w.removeAttribute(Pt);let A=Gc(b);getComputedStyle(b[0]).visibility,A();for(let w of x)w.setAttribute(Pt,"");for(let w of b)Eh.add(w)},Qa=u=>!1,Za=2,es=4,tc=(u,p,b,x=Za)=>{let A=Ce(u)?re(u):ee(u,Number.NaN),w=A+(Q(u)??Number.NaN);return A>b&&A<=b+x||w<=b&&w>=b-x||p(u,b+x)},Yr=null,nc=u=>Sh&&u.hasAttribute("data-start")&&Js(u),Xr=new WeakMap,rc=new WeakMap,ei=new WeakSet,oc=new WeakSet,vh=u=>Tb(u,()=>!e.tornDown&&Xr.get(u)===!0&&re(u)>h.now()),Ah=u=>u.parentElement?.closest("[data-composition-id]"),wh=3,ti=new Set,ni=new Set,_h=["canplay","suspend","error"],Th=u=>{for(let p of _h)u.removeEventListener(p,Ch);return ti.delete(u)},Ch=u=>{let p=u.currentTarget;u.type!=="error"&&p.readyState<3||(Th(p),Rh())},Rh=()=>{let u=Array.from(ni).filter(p=>p.isConnected).sort((p,b)=>re(p)-re(b));for(let p of u){if(ti.size>=wh)break;ni.delete(p),rn(e.currentTime,[p])}},Mh=u=>{if(Xs(u),vh(u),!(ti.has(u)||u.readyState>=3)){ti.add(u);for(let p of _h)u.addEventListener(p,Ch)}},pC=u=>{let p=fo(u,Number.NaN),b=ii(Array.from(Rn).filter(w=>w.isConnected&&fo(w,Number.NaN)===p&&Ah(w)===Ah(u))).mediaClips,x=b.find(w=>w.el===u)?.end??Number.NaN,A;for(let w of b)w.el!==u&&w.start>=x-Ai(x)&&!(A&&A.start<=w.start)&&(A=w);!A||!nc(A.el)||(rc.set(A.el,u),Xr.get(A.el)!==!0&&(Xr.set(A.el,!0),ni.delete(A.el),Mh(A.el)))},pt=[],ri=!1,hC=(u,p,b,x,A)=>{let w=h.isPlaying()||pt.length>0;p&&w?ei.has(u)||(ei.add(u),pC(u)):ei.delete(u);let P=rc.get(u),q=P!==void 0&&ei.has(P),W=Xr.get(u),I=!p&&!q&&W!==!0&&ti.size>=wh;I&&b?ni.add(u):ni.delete(u);let Se=!p&&!A&&w&&re(u)+(Q(u)??Number.NaN)<=x&&(W!==!0||u.networkState===2&&u.readyState<4),oe=p||q||b&&!I&&!Se;(p||!oe)&&Th(u)&&queueMicrotask(Rh);let se=oe&&!p&&re(u)>h.now(),me=oc.has(u);if(se?oc.add(u):oc.delete(u),W===oe){se&&!me&&vh(u);return}Xr.set(u,oe),oe?(!p||W===void 0)&&(p?Xs(u):Mh(u)):u.preload!=="none"&&(u.preload="none",W&&JT(u,()=>Cb(u,window.__HF_RELEASE_PASSED_MEDIA===!0)))},kh=(u,p)=>Yr!==null&&h.isPlaying()&&(p(u,Yr)||tc(u,p,Yr,es)),gC=(u,p,b)=>Xr.get(u)===!0&&tc(u,p,b,es)||kh(u,p),ic=new WeakMap,Lh=new WeakSet,ac=new WeakSet,Nh=new WeakMap,Fh=u=>u.style.visibility==="hidden"&&u.style.getPropertyPriority("visibility")!=="important"&&!ac.has(u),sc=new WeakMap,lc=(u,p)=>{for(let b=u.parentElement;b&&b!==p;b=b.parentElement)if(b.hasAttribute("data-start")&&wr(b)&&Fh(b))return!0;return!1},uc=new Map,Ph=-1,bC=es+Za+1,yC=1,xC=(u,p,b)=>{let x=b(u);if(!x||!Number.isFinite(x.start))return null;let A=[];for(let w of[0,Za,es])A.push(x.start-w,x.end-w,x.end+w);for(let w=u.parentElement;w&&w!==p;w=w.parentElement){if(!w.hasAttribute("data-start"))continue;let P=b(w);if(!P||!Number.isFinite(P.start))return null;A.push(P.start,P.end)}return A.filter(w=>Number.isFinite(w))},SC=(u,p,b,x)=>{if(!b||!(Math.abs(p-u)<=yC))return null;if(Ph!==x)return uc.clear(),Ph=x,null;let A={timelineRegistry:window.__timelines??{},resolver:z(!0)},w=W=>Vs(W,A),P=Math.min(u,p),q=Math.max(u,p);return W=>{let I=ic.get(W);if(I===void 0||Ce(W)&&(rc.has(W)||ei.has(W))||!W.hasAttribute(zt)&&W.style.visibility!==(I?"visible":"hidden")||lc(W,b)!==(sc.get(W)??!1))return!1;let X=uc.get(W);if(X===void 0&&(X=xC(W,b,w),uc.set(W,X)),!X)return!1;for(let Se of X)if(Se>=P&&Se<=q||Yr!==null&&Math.abs(Se-Yr)<=bC)return!1;return!0}},EC=(u,p,b,x)=>{if(Qa(u))return;let A=R(),w=!1,P=gh(b),q=x===void 0||b===void 0?null:SC(x,u,A,b);for(let I of p){if(!wr(I))continue;if(I.hasAttribute("data-hidden")){Ka.has(I)||(Ka.add(I),ph(I)&&(Ya=!0)),dh(I,!1),(Re(I)||et(I))&&a?.setSourceVisibility(I,!1);continue}if(Ka.has(I)&&(fh(I),Ka.delete(I),ph(I)&&(Ya=!0)),!I.hasAttribute("data-start")||q?.(I))continue;let Se=lc(I,A);sc.set(I,Se);let oe=P(I,u)&&bh(I.parentElement,u,P,A)&&!Se;ic.set(I,oe);let se=n(I);if(Lh.has(I)||(Lh.add(I),I.style.visibility==="hidden"&&ac.add(I)),!se&&!(oe&&Fh(I))){let Qe=I.style,Ye=Qe.getPropertyPriority("visibility")==="important";!oe&&!Ye&&!ac.has(I)&&Nh.set(I,Qe.getPropertyValue("visibility"));let He=oe?Ye&&Nh.get(I)||"visible":"hidden";Qe.setProperty("visibility",He,oe?"":"important")}I.toggleAttribute(We,!se&&!oe),!se&&!oe&&!Eh.has(I)&&Xa.add(I);let me=(xh||Sh)&&!oe&&tc(I,P,u);me&&!I.hasAttribute(Sr)&&lT(I),I.toggleAttribute(Sr,me),Ce(I)&&Rn.has(I)&&nc(I)&&hC(I,oe,me||gC(I,P,u),u,kh(I,P)),!Ce(I)&&!et(I)&&(w=!0),(Re(I)||et(I))&&a?.setSourceVisibility(I,oe),oe?fh(I):aC(I)&&sC(I)&&dh(I,!0)}w&&r0()&&a?.refresh(),dC(u);let W=cC(u);if((Ya||W)&&h.isPlaying()){y.stopAll();for(let I of Oa(document))E(I)&&(I.volume=0);Rc()}Ya=!1},vC=u=>{let p=R(),b=qa("[data-start]").filter(x=>ic.has(x)&&lc(x,p)!==(sc.get(x)??!1));b.length>0&&rn(u,b)},rn=(u,p=qa("[data-start], [data-hidden]"),b,x)=>ve(()=>EC(u,p,b,x)),AC=u=>ve(()=>{if(!xh)return[];let p=R(),b=gh();return Array.from(document.images).filter(x=>x.closest(`[data-start]:not([${zt}])[style*="visibility: hidden"]`)!==null&&(x.closest(As)!==null||!x.complete)&&bh(x,u,b,p))}),oi=null,$t=null,pr=[],Ih=u=>u.hasAttribute("data-start")||!!fe(u).compositionRoot,ii=u=>oy({elements:u,shouldIncludeElement:Ih,resolveStartSeconds:p=>re(p),resolveDurationSeconds:p=>{let b=fe(p),x=re(p),A=b.inheritedStart!=null&&b.inheritedDuration!=null&&b.inheritedDuration>0?Math.max(0,b.inheritedStart+b.inheritedDuration-x):null,w=Number.isFinite(p.duration)?Kt(p,p.duration):null,P=Ue(p.dataset.duration),q=P!=null&&P>0?P:null;return ry({isVideo:p.tagName==="VIDEO",sourceDuration:w,hostRemaining:A,explicitDuration:q})},resolveHostSlots:ce}),Dh=(u=jr())=>{if(oi&&oi.revision===u)return oi;let p=ii().mediaClips;return oi={revision:u,clips:p,byStart:[...p].sort((b,x)=>b.start-x.start),byEnd:[...p].sort((b,x)=>b.end-x.end)},$t=null,pr=[],oi},cc=(u,p,b,x)=>{let A=0,w=u.length;for(;A<w;){let q=A+w>>1;p(u[q])<b?A=q+1:w=q}let P=[];for(let q=A;q<u.length&&p(u[q])<=x;q+=1)P.push(u[q]);return P},wC=(u,p,b)=>{let x=$t;if(x===null)return u.clips.map(W=>W.el);let A=2*Ai(Math.max(Math.abs(x),Math.abs(p))),w=Math.min(x,p)-A,P=Math.max(x,p)+A,q=new Set;for(let W of pr)q.add(W.el);for(let W of cc(u.byStart,I=>I.start,w,P+b))q.add(W.el);for(let W of cc(u.byEnd,I=>I.end,w,P))q.add(W.el);if(e.isPlaying&&!window.__HF_EXPORT_RENDER_SEEK_CONFIG)for(let W of cc(u.byStart,I=>I.start,p,p+qd*e.playbackRate))q.add(W.el);return[...q]},ts=new WeakSet,Oh=u=>{ts.add(u)},Hh=u=>{ts.delete(u),Tn()};window.__hf.leasePausedMedia=Oh,window.__hf.releasePausedMedia=Hh;let Gh=u=>e.nativeMediaSyncDisabled?null:e.isPlaying?u:u.filter(p=>!ts.has(p.el));window.__hf.setLoopStart=u=>{Yr=u!=null&&Number.isFinite(u)&&u>=0?u:null};let _C=u=>{let p=Ku.get(u)?.hostId,b=p?document.querySelector(`[data-composition-id="${CSS.escape(p)}"]`):null,x=b?Q(b):null;return b&&x?ee(b,0)+x:1/0},Bh=u=>{let p=0;for(let b of u){if(b.data===wi)continue;let x=b.getChildren?b:b.timeline,A=Number(b.duration?.())/Number(x?.duration?.()),w=x?.getChildren?Bh(x.getChildren(!1,!0,!0))*(Number.isFinite(A)&&A>0?A:1):Number(b.duration?.())||0,P=Math.abs(Number(b.timeScale?.())||1),q=(Number(b.startTime?.())||0)+w/P;q>=co||(p=Math.max(p,Math.min(q,_C(b))))}return p};window.__hf.animationEnd=()=>{let u=e.capturedTimeline,p=u?.getChildren?Bh(u.getChildren(!1,!0,!0)):Ee(u)??0,b=Math.max(p,zr(!0)??0);return b>0&&b<co?b:null},window.__hf.audioMeter={start:()=>y.startMetering(),stop:()=>y.stopMetering(),read:()=>y.readLevels()};let TC=()=>{for(let u of document.querySelectorAll("video, audio"))if(Ce(u)&&!u.paused&&Ih(u)&&!ts.has(u))return!0;return!1},Uh=()=>Tn();document.addEventListener("play",Uh,!0),c.push(()=>{document.removeEventListener("play",Uh,!0)}),c.push(R_(document));let dc=null,St=u=>{let p=!ft,b=e.isPlaying&&!e.mediaForceSyncNextTick&&$t!==null?Math.min(Math.max(0,e.currentTime-$t),yt*Math.min(1,e.playbackRate)):0,x=ve(()=>{if(!p)return ii().mediaClips;let q=Dh(u);return ii(wC(q,e.currentTime,b)).mediaClips});for(let q of x){let W=Zo.get(q.el);W&&(q.volumeKeyframes=W)}let A=Gh(x),w=e.mediaForceSyncNextTick;w&&(e.mediaForceSyncNextTick=!1),A&&(ly({clips:A,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted,userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:w,keepLateMedia:ri,cueAheadSeconds:b,clockAdvancing:h.getSource()!=="audio"||$t===null||e.currentTime>$t,getCompositionDuration:()=>Xe(e.capturedTimeline,0,u),onElementVolume:(q,W,I,X,Se)=>y.setElementVolume(q,I,X,Se),isWebAudioOwned:q=>y.ownsElement(q),isWebAudioRouted:q=>y.routesElement(q),seekUnderDip:(q,W)=>y.seekUnderDip(q,W),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,we({source:"hf-preview",type:"media-autoplay-blocked"}))}}),p?($t=e.currentTime,pr=x.filter(q=>fn(e.currentTime,q.start-yt,q.end))):($t=null,pr=[]));let P=p&&e.isPlaying&&!w&&dc!==null?dc:void 0;rn(e.currentTime,void 0,u,P),dc=e.currentTime},Je=u=>{u&&Tn(),u&&mc&&!h.isPlaying()&&at();let p=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),b=Date.now();(u||p!==e.bridgeLastPostedFrame||(e.isPlaying||pt.length>0)!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||b-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=p,e.bridgeLastPostedPlaying=e.isPlaying||pt.length>0,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=b,we({source:"hf-preview",type:"state",frame:p,currentTime:e.currentTime||0,ended:h.reachedEnd(),isPlaying:e.bridgeLastPostedPlaying,buffering:pt.length>0,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},fc="",Wh=!1,Vh=!1,$h=0,qh="",CC=()=>{let u="";for(let p of document.querySelectorAll("[data-start]"))u+=`${p.id}:${p.tagName}|`;return u},mc=!1,ns=!1,pc=!1,RC=()=>{pc||(pc=!0,Yb().then(()=>window.requestAnimationFrame(()=>setTimeout(()=>{pc=!1,ns=!1,e.tornDown||at()}))))},at=()=>{F(),k(),j();let u=R();if(u){let{width:x,height:A}=rb(u);x!==null&&A!==null&&we({source:"hf-preview",type:"stage-size",width:x,height:A})}if(fr(),mc=h.isPlaying(),mc){delete window.__clipTree;return}if(ns&&!ft&&Xb())return RC();ns=!1;let p=gd(yh());window.__clipManifest=p,qh=JSON.stringify(p);let b=CC();if(fc!==b&&lC(),!window.__clipTree||fc!==b){let x=window;window.__clipTree=V0({startResolver:ut({timelineRegistry:x.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:x.__timelines??{},rootDuration:p.durationInFrames/e.canonicalFps}),fc=b}we({...p,assetsReady:Vh}),Wh||(Wh=!0,J_(document,({timedOut:x})=>{e.tornDown||(Vh=!0,we({source:"hf-preview",type:"assets-ready",timedOut:x}))})),tC()},MC=()=>{JSON.stringify(gd(yh()))!==qh&&at()},hc=u=>typeof u=="number"&&Number.isFinite(u)&&u>0?u:0,kC=u=>{let p=hc(Number(u));if(p<=0)return;let b=R(),x=hc(Ue(b?.getAttribute("data-duration"))),A=Math.max($h,hc(h.getDuration()),x);p<=A||($h=p,b?.setAttribute("data-duration",String(p)),h.setDuration(p),at(),Je(!0))},ht=(u,p=0,b)=>{for(let x of e.deterministicAdapters){try{u==="discover"&&x.discover(),u==="pause"&&x.pause({pageAnimations:b}),u==="play"&&x.play&&x.play()}catch(A){$("runtime.init.site8",A)}if(u==="discover")try{x.seek({time:p,suppressEvents:!0})}catch(A){$("runtime.init.site9",A)}}},hr=()=>{window.__renderReady=!1},LC=aT(()=>{let u=[];for(let p of e.deterministicAdapters){let b=p.getReadyPromise;if(typeof b=="function")try{let x=b();x&&u.push(x)}catch(x){$("runtime.init.adapterReady",x)}}return u},()=>hr(),u=>$("runtime.init.adapterReady",u)),NC=aT(()=>{let u=window.__hf?.buildReady;return u?Object.values(u).filter(p=>p!=null&&typeof p.then=="function"):[]},()=>hr(),u=>$("runtime.init.buildReady",u));function gc(){let u=R();u&&a_({root:u,fps:e.canonicalFps,durationSeconds:()=>Xe(e.capturedTimeline,0)||Number(u.getAttribute("data-duration"))||0,timeline:()=>e.capturedTimeline,now:()=>Math.max(0,e.currentTime||0),seek:(p,b)=>{_c(e.capturedTimeline,p,{suppressEvents:b})},holdFrame:()=>{let p=Py({scenes:wc().map(([,b])=>b),root:e.capturedTimeline,structureOf:Ac});return b=>p(()=>_c(e.capturedTimeline,b,{suppressEvents:!0}))},ignoreMutations:QT})}let FC=()=>{ja(),rC();let u=Am();return nu(document),xu(document.body,e.canonicalFps),gc(),u};if(Be)Am();else{let u={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:J,onDiagnostic:({code:p,details:b})=>{we({source:"hf-preview",type:"diagnostic",code:p,details:b})}};Dv(u).finally(()=>{Be=!0,FC(),hr()})}let zh=u=>{let p=new Set,b=x=>{for(let A of(x??"").matchAll(/url\\(\\s*([\'"]?)(.*?)\\1\\s*\\)|@import\\s+([\'"])(.*?)\\3/gi))p.add(A[2]??A[4]);for(let A of(x??"").matchAll(/image-set\\((?:[^()]|\\([^()]*\\))*\\)/gi))for(let w of A[0].matchAll(/([\'"])(.*?)\\1/g))p.add(w[2])};for(let x of u)if(x.tagName==="STYLE"&&b(x.textContent),!(x.tagName==="STYLE"||x.tagName==="SCRIPT"))for(let A of[x,...x.querySelectorAll("*")]){let w=q2.get(A.localName)??[],P=[Ev(A),...[...w,"poster","srcset"].map(q=>A.getAttribute(q))];for(let q of P)q&&p.add(q);b(A.getAttribute("style"))}return p},bc=0,PC=(u,p,b)=>{let x=new Map;for(let A of b?u.querySelectorAll("video, audio"):[]){let w=Ga.get(A);if(!w||a?.isGraded(A))continue;let{srcObject:P,sinkId:q,mediaKeys:W}=A;P||q||W||x.set(w,[...x.get(w)??[],A])}for(let A of p.querySelectorAll("video, audio")){let w=Hp(A),P=x.get(w)?.shift();if(!P||sT(P)!==sT(A)){Ga.set(A,w);continue}A.replaceWith(P),window.gsap?.set?.(P,{clearProps:"all"});let q=A.getAttribute("style");q===null?P.removeAttribute("style"):P.setAttribute("style",q),zv(P);let W=P;W.volume=ch(W)??1,W.muted=e.bridgeMuted||e.mediaOutputMuted||W.defaultMuted,W.defaultPlaybackRate=1,W.playbackRate=e.playbackRate,W.preservesPitch=!0}},rs=u=>[u,...u.querySelectorAll("[data-composition-id]")].flatMap(p=>p.getAttribute("data-composition-id")||[]),jh=u=>{let p=new Set([e.capturedTimeline,window.gsap?.globalTimeline,...Qo]);for(let[b,x]of Object.entries(window.__timelines??{}))u.includes(b)||p.add(x);return p},yc=(u,p)=>{let b=jh(p);return(u.getChildren?u.getChildren(!0,!0,!1):[u]).flatMap(A=>(A.targets?.()??[]).filter(w=>typeof w?.totalTime=="function"&&typeof w.kill=="function"&&!b.has(w)))},IC=(u,p,b,x)=>{let A=rs(p),w=new Set(A.flatMap(W=>[b[W],...x[W]??[]]));for(let W of w)if(W)for(let I of yc(W,A))w.add(I);let P=new Set([p,...p.querySelectorAll("*")]);for(let W of window.gsap?.globalTimeline?.getChildren?.(!0,!0,!1)??[]){if(!W.targets?.().some(X=>P.has(X)))continue;let I=W;for(;I&&!w.has(I);)I=I.parent;if(!I)throw new Error(`scene ${u} cannot be swapped: an animation outside it moves its elements`)}let q=W=>typeof W?.nodeType=="number"&&!P.has(W);for(let W of w)for(let I of W?[W,...W.getChildren?.(!0,!0,!1)??[]]:[])if(I.targets?.().some(q))throw new Error(`scene ${u} cannot be swapped: its animations write outside the scene`)},Kh=async(u,p)=>{let b=window.gsap?.globalTimeline,x=new Set(b?.getChildren?.(!1,!0,!0));await ou(p);let A=window.__hfSceneAnimations,w=u.length===1?rs(u[0])[0]:void 0;if(!A||!w||!b?.getChildren)return;await ga(),await new Promise(W=>window.setTimeout(W,0));let P=new Set([...Object.values(A).flat(),...jh([w])]),q=b.getChildren(!1,!0,!0).filter(W=>!x.has(W)&&!P.has(W));(A[w]??(A[w]=[])).push(...q)},Yh=(u,p=()=>{})=>{let b=()=>window.__timelines??(window.__timelines={}),x=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),A=e.capturedTimeline,w=u.flatMap(X=>rs(X)),P=new Set,q=X=>{if(!X||P.has(X))return;P.add(X);let Se=X;Se.revert?Se.revert():Se.totalTime?.(0,!0),A?.remove?.(X),Se.revert||Se.kill?.()},W=()=>{let X=P.size,Se=w.flatMap(se=>[...(x()[se]??[]).slice().reverse(),b()[se]]),oe=new Set;for(let se of Se)se&&yc(se,w).forEach(me=>oe.add(me));for(let se of oe)yc(se,w).forEach(me=>oe.add(me));for(let se of[...Se.filter(me=>!oe.has(me)),...oe])q(se);return P.size>X},I=0;for(;W();)if(++I>8)throw new Error("the old scene keeps starting animations as they stop");p();for(let X of w)delete b()[X],delete x()[X]},DC=u=>{let p=Ln(e.currentTime);ht("pause",0,p),ht("play"),S&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Mc(u.flatMap(Oa),y.currentGeneration())},Xh=(u,p,b,x=!1)=>{for(let W of u)nu(document,W);ja();let A=()=>{for(let W of p)for(let I of[W,...W.querySelectorAll("[data-composition-id]")]){let X=I.getAttribute("data-composition-id");X&&window.__timelines?.[X]?.totalTime?.(0,!0)}};xu(document.body,e.canonicalFps),gc(),wm(b,p,A),uh(),dr=!1,fr();let w=Ju();for(let W of u)for(let I of W.querySelectorAll("video, audio"))Zo.delete(I),Qu(I,w);let P=Xe(e.capturedTimeline,0);P>0&&h.setDuration(P),ht("discover",e.currentTime),ya(document);let q=h.isPlaying()&&P>0&&e.currentTime>=P;x&&h.isPlaying()&&!q?DC(u):ai.seek(q?P:e.currentTime,{keepPlaying:!q}),rn(e.currentTime),at()},Jh=u=>{let p=P=>Array.from(P.querySelectorAll(`style[${zc}]`)),b=p(document),x=new Set(b.flatMap(P=>jc(P.textContent??""))),A=new Set(p(u).flatMap(P=>jc(P.textContent??"")).filter(P=>!x.has(P)));if(A.size===0)return;let w=document.createElement("style");w.setAttribute(zc,""),w.textContent=[...A].join(`\n`),b.length>0?b.at(-1).after(w):document.head.prepend(w)},OC=async(u,p)=>{let b=bc,x=new DOMParser().parseFromString(u,"text/html"),A=Ha(document),w=Ha(x);if(!A||!w)throw new Error("no scene manifest");if(A.shared!==w.shared)throw new Error("the film changed outside its scenes");let P=Object.keys(w.scenes);if(P.length!==Object.keys(A.scenes).length||P.some(K=>!(K in A.scenes)))throw new Error("scenes were added or removed");let q=P.filter(K=>w.scenes[K]!==A.scenes[K]);if(q.length===0)throw new Error("no scene changed");let W=(K,ne)=>Array.from(K.querySelectorAll(`[${bt}="${CSS.escape(ne)}"]`)),I=K=>{let ne=mo(K);return ne!==null&&Wn(ne)},X=K=>K.filter(ne=>ne.tagName==="STYLE"),Se=q.filter(I).map(K=>{let ne=W(x,K),ue=ne.find(De=>De.tagName!=="STYLE"&&De.tagName!=="SCRIPT");if(!ue)throw new Error(`scene ${K} cannot be swapped: it has no single host`);let le=ue.getAttribute(Pn);if(le!==null)throw new Error(`scene ${K} cannot be swapped: ${le}`);if(!yd(ue))throw new Error(`scene ${K} cannot be swapped: a clip\'s length is not written`);if(!xd(ue))throw new Error(`scene ${K} cannot be swapped: its start or length is not in seconds`);let Ae=X(W(document,K));if(Ae.length!==X(ne).length)throw new Error(`scene ${K} cannot be swapped: its styles moved`);return{name:K,parts:ne,host:ue,oldStyles:Ae}});Se.length>0&&Jh(x);for(let{name:K,parts:ne,host:ue,oldStyles:le}of Se){let Ae=X(ne);le.forEach((De,st)=>De.replaceWith(document.importNode(Ae[st],!0))),Ed(K,ue,ne.filter(De=>De.tagName==="SCRIPT"))}let oe=q.filter(K=>!I(K));if(oe.length===0){document.querySelector(`meta[name="${Fn}"]`)?.setAttribute("content",JSON.stringify(w)),Nt=qs(),at();return}let se=oe.map(K=>{let ne=to=>to.tagName!=="STYLE"&&to.tagName!=="SCRIPT",ue=W(document,K),le=W(x,K),Ae=ue.filter(ne),De=le.filter(ne),st=Ae[0],gt=De[0];if(!st||!gt||Ae.length>1||De.length>1)throw new Error(`scene ${K} cannot be swapped: it has no single host`);if(st.hasAttribute("data-hf-original-composition-id"))throw new Error(`scene ${K} cannot be swapped: it is a duplicated instance`);let on=st.getAttribute(Pn)??gt.getAttribute(Pn);if(on!==null)throw new Error(`scene ${K} cannot be swapped: ${on}`);let sR=zh(ue);if([...zh(le)].some(to=>!sR.has(to)))throw new Error(`scene ${K} cannot be swapped: it loads media this scene has not loaded`);if(X(ue).length!==X(le).length)throw new Error(`scene ${K} cannot be swapped: its styles moved`);return{name:K,oldParts:ue,homes:ue.map(to=>to.parentNode),newParts:le,oldHost:st,newHost:gt}}),me=()=>{let K=R(),ne=new Set;for(let ue of document.querySelectorAll(`[${bt}]`)){if(ue.tagName==="STYLE"||ue.tagName==="SCRIPT")continue;let le=ue.parentElement;for(;le;le=le===K?null:le.parentElement)ne.add(le)}return[...ne].flatMap(ue=>[ue,...Array.from(ue.children).filter(le=>!le.hasAttribute("data-hf-ignore")),null])},Qe=me(),Ye=se.some(({newHost:K})=>K.querySelector(".caption-group"))?await vm():[];if(e.tornDown)throw new Error("the preview was torn down during the swap");if(p?.aborted)throw new Error("the swap was cancelled");if(b!==bc)throw new Error("the preview changed while this swap waited");let He=()=>{let K=({oldParts:le,homes:Ae})=>le.some((De,st)=>!De.isConnected||De.parentNode!==Ae[st]),ne=me();if(ne.length!==Qe.length||ne.some((le,Ae)=>le!==Qe[Ae])||se.some(K))throw new Error("a scene changed while this swap waited")};He();let Ze=()=>window.__timelines??(window.__timelines={}),hs=()=>window.__hfSceneAnimations??(window.__hfSceneAnimations={}),$e=()=>{for(let{name:K,oldHost:ne}of se)IC(K,ne,Ze(),hs())};$e(),bc+=1;let _t=[],ge=[];Yh(se.map(({oldHost:K})=>K),()=>{He(),$e()}),y.stopAll(),h.detachAudioSource();for(let{oldParts:K,newParts:ne,oldHost:ue,newHost:le}of se){let Ae=X(ne);X(K).forEach((gt,on)=>gt.replaceWith(document.importNode(Ae[on],!0)));for(let gt of K)gt!==ue&>.remove();let De=document.importNode(le,!0),st=gt=>JSON.stringify(gt.flatMap(on=>on.tagName==="SCRIPT"?on.textContent:[]));PC(ue,De,st(K)===st(ne)),ue.replaceWith(De),ge.push(De),De.querySelector(".caption-group")&&_t.push(De)}Jh(x),xr();let pe=se.flatMap(({newParts:K})=>K.filter(ne=>ne.tagName==="SCRIPT").map(ne=>document.body.appendChild(document.importNode(ne,!0))));if(await Kh(ge,pe),e.tornDown)throw new Error("the preview was torn down during the swap");document.querySelector(`meta[name="${Fn}"]`)?.setAttribute("content",JSON.stringify(w));for(let{name:K,newParts:ne,newHost:ue}of se)Ed(K,ue,ne.filter(le=>le.tagName==="SCRIPT"));Xh(ge,_t,Ye),Nt=qs()},Nt=qs(),Jr=new Set(Array.from(document.querySelectorAll(`[${Nn}]`),u=>u.getAttribute(bt))),gr=null,os="",xc=()=>new Promise(u=>window.setTimeout(u,0)),Qh=(u,p)=>{let b=Kr.get(u);b&&Kr.set(p,b)},Zh=async u=>{let p=pb(u);if(!p)return;let{host:b,placeholder:x,scripts:A}=p;Qh(x,b),Du(b),xr();let w=b.querySelector(".caption-group")?[b]:[],P=w.length>0?await vm():[];await xc(),await Kh([b],A.map(q=>document.body.appendChild(q))),await xc(),Jr.delete(u),e.tornDown||Xh([b],w,P,!0)},HC=u=>{let p=rs(u),b=new Set(p.flatMap(x=>window.__hfSceneAnimations?.[x]??[]));return Object.entries(window.__timelines??{}).find(([x,A])=>b.has(A)&&!p.includes(x))?.[0]},GC=u=>{let p=mo(u);if(!p||Wn(p)||p.hasAttribute(Pn))return;let b=HC(p);if(b!==void 0){p.setAttribute(Pn,`its script registers a timeline as ${b}`);return}Yh([p]);let x=Sd(u);x&&Qh(p,x),Jr.add(u),uh(),y.releaseDecodedExcept(Oa(document)),dr=!1,fr(),at()},Sc=new Map,is=new Set;Qa=u=>{if(Nt.length===0||e.tornDown)return!1;let p=X=>Jr.has(X),b=Nt.find(({name:X,start:Se,end:oe})=>Se<=u&&u<=oe&&p(X));if(gr)return b&&tt(gr.then(()=>gr),"scene-window"),b!==void 0;let x=zs(Nt,u,h.isPlaying());for(let X of is)x.add(X);let A=[...x].join(`\n`);if(A===os)return b!==void 0;let w=Nt.filter(({name:X})=>x.has(X)&&p(X)).sort((X,Se)=>Math.abs(X.start-u)-Math.abs(Se.start-u))[0],P=b??w,q=P?[]:Nt.filter(({name:X})=>!x.has(X)&&!p(X));if(!P&&q.length===0)return os=A,!1;let W=X=>is.has(X)||zs(Nt,e.currentTime,h.isPlaying()).has(X),I=Jr.size;return gr=(async()=>{if(b)await Zh(b.name);else if(P)await xc(),W(P.name)&&await Zh(P.name);else for(let{name:X}of q)GC(X)})().finally(()=>{gr=null,os=Jr.size===I?A:"",Qa(e.currentTime)}),b&&tt(gr,"scene-window"),b!==void 0};let BC=async(u,p="studio")=>{let b=new Set(u.filter(x=>Nt.some(A=>A.name===x)));b.size?Sc.set(p,b):Sc.delete(p),is=new Set([...Sc.values()].flatMap(x=>[...x])),os="";for(let x=0;x<=Nt.length&&!e.tornDown;x++){if(Qa(e.currentTime),![...is].some(A=>Jr.has(A)))return;await(gr??Promise.resolve())}};Ha(document)&&(window.__hfSwapScenes=OC,window.__hfHoldScenes=BC,window.__hfParkedSceneMarkup=vd,U(()=>{delete window.__hfSwapScenes,delete window.__hfHoldScenes,delete window.__hfParkedSceneMarkup}));let as=pS({postMessage:u=>we(u)});as.installPickerApi(),rn(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let qt=DA({lease:Oh,release:Hh});a=qt,U(()=>{qt.destroy(),a=null}),xu(document.body,e.canonicalFps),gc();let Ec=u=>{let p=Number(u);!Number.isFinite(p)||p<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,p)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate)},UC=1e3,Mn=null,eg=()=>{let u=Mn;Mn=null,u?.apply()},tg=(u,p)=>{y.stopAll(),h.detachAudioSource();let b=h.isPlaying();b&&h.pause(),h.seek(u),e.currentTime=h.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let x=p?.keepPlaying&&b;ns=!x,x||St();let A=e.capturedTimeline;vn(A);let w=Ln(e.currentTime);if(x||vC(e.currentTime),ht("pause",0,w),x){ai.play();return}qt.redraw(),Ym(e.currentTime);let P=Bo(e.currentTime);P&&tt(P,"motion-blur"),Je(!0)},ng=(u=!1)=>{y.stopAll(),h.detachAudioSource(),h.pause(),e.isPlaying=!1,e.currentTime=h.now(),e.mediaForceSyncNextTick=!u,ri=u,kg(e.currentTime,u?kr:void 0);let p=e.capturedTimeline;vn(p),ht("pause"),St(),ri=!1,qt.redraw(),Bo(e.currentTime),Je(!0)},ai={play:()=>{eg();let u=pt.length>0;pt=[];let p=e.capturedTimeline;if(h.isPlaying())return;let b=Xe(p,0);if(b>0&&(h.setDuration(b),h.reachedEnd())){let x=h.getPlayStart();h.seek(x),e.currentTime=x,Ln(x)}vn(p),h.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!u,ri=u,kg(h.now(),u?kr:void 0),S&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&Rc(),ht("play"),St(),ri=!1,iy(Dh().clips.map(x=>x.el)),qt.redraw(),Je(!0))},pause:()=>{let u=pt.length>0;pt=[],h.isPlaying()?ng():u&&Je(!0)},seek:(u,p)=>{let b=ud(Math.max(0,Number(u)||0),e.canonicalFps);Mn=null;let x=h.isPlaying()?[]:AC(b);if(x.length===0){tg(b,p);return}let A={time:b,apply:()=>tg(b,p)};Mn=A;for(let I of x){lT(I);for(let X=I.closest(As);X;X=I.closest(As))X.setAttribute(Sr,"")}let w=0,P=new Promise(I=>{w=window.setTimeout(()=>{Mn===A&&$("runtime.init.seekHoldCap",x),I()},UC)}),q=Promise.all(x.map(I=>I.decode?I.decode().catch(()=>{}):void 0)),W=Promise.race([q,P]).then(()=>{window.clearTimeout(w),Mn===A&&eg()});return tt(W,"image-decode"),W},renderSeek:(u,p)=>{Mn=null,ft=!0;let b=Fl(Math.max(0,Number(u)||0),e.canonicalFps,p);y.stopAll(),h.detachAudioSource(),h.isPlaying()&&h.pause(),h.seek(b),e.currentTime=h.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let x=Ln(e.currentTime,{suppressEvents:p?.suppressEvents});ht("pause",0,x),St(),qt.redraw(),Ym(e.currentTime,{engineMode:!0});let A=Bo(e.currentTime,{engineMode:!0});A&&tt(A,"motion-blur"),Je(!0)},getTime:()=>Mn?.time??h.now(),getDuration:()=>{let u=h.getDuration();return Number.isFinite(u)?u:0},isPlaying:()=>h.isPlaying(),setPlaybackRate:u=>{Ec(u),h.setRate(e.playbackRate),Ng()},getPlaybackRate:()=>e.playbackRate},rg=Xe(e.capturedTimeline,0);rg>0&&h.setDuration(rg);let br=gS({getTimeline:()=>e.capturedTimeline,setTimeline:u=>{e.capturedTimeline=u},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:u=>{e.isPlaying!==u&&(e.mediaForceSyncNextTick=!0),e.isPlaying=u},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:Ec,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(u,p)=>{e.currentTime=Math.max(0,Number(u)||0),e.isPlaying!==p&&(e.mediaForceSyncNextTick=!0),e.isPlaying=p,St()},onStatePost:Je,onDeterministicSeek:(u,p)=>{for(let b of e.deterministicAdapters)if(!(b.name==="gsap"&&e.capturedTimeline))try{b.seek({time:Number(u)||0,suppressEvents:p?.suppressEvents})}catch(x){$("runtime.init.site11",x)}},onDeterministicPause:()=>ht("pause"),onDeterministicPlay:()=>ht("play"),onRenderFrameSeek:()=>{qt.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>Xe(e.capturedTimeline,0),transport:ai});window.__player=L(br),window.__playerReady=!0,Mt("composition_loaded",{duration:br.getDuration(),compositionId:vt()?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Jy({start:u=>ee(u,0),duration:u=>Q(u),compositionDuration:()=>Xe(e.capturedTimeline,0),canonicalFps:()=>e.canonicalFps,exportRenderSeek:()=>!!window.__HF_EXPORT_RENDER_SEEK_CONFIG}),tx(),_y({resolveStartSeconds:u=>ee(u,0)}),Oy(),Uy({resolveStartSeconds:u=>ee(u,0)}),Wy(),Vy(),$y(),qy(),zy(),jy(),Ky(),Dy({getTimeline:()=>e.capturedTimeline})],Zy(),ex(),window.__hfReseekGpu=u=>{let p=Math.max(0,Number(u)||0);window.__hfThreeTime=p,window.__hfTypegpuTime=p,sl(p)};let og=u=>(u_(),Jb(u));window.__hfWaitForSeekCompletion=og,c.push(()=>{window.__hfWaitForSeekCompletion===og&&delete window.__hfWaitForSeekCompletion}),nC(),ja(),ht("discover");let WC=()=>{fr();let u=Xe(e.capturedTimeline,0);if(u>0&&h.setDuration(u),ht("discover",e.currentTime),!e.capturedTimeline){let p=window.__timelines??{},b=Object.keys(p).filter(x=>p[x]);if(b.length>0){let A=R()?.getAttribute("data-composition-id")??null;M("root_timeline_unbound_registry_present",{reason:A?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:A,registeredTimelineKeys:b},"root_timeline_unbound_registry_present"),globalThis.console.warn("[hyperframes] Root timeline not bound, so render will freeze at t=0. "+(A?`Root data-composition-id is "${A}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${b.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${A??"<root-id>"}"] = tl).`)}}rn(e.currentTime,Array.from(document.querySelectorAll("[data-start]:not(video, audio, img)"))),window.__renderReady=!0;try{at()}catch(p){throw window.__renderReady=!1,di(p),p}Je(!0)},Qr=null,VC=()=>{if(Qr)return;let u=()=>{window.removeEventListener("hf-timelines-built",u),Qr=null,hr()};Qr=u,window.addEventListener("hf-timelines-built",u)};U(()=>{Qr&&(window.removeEventListener("hf-timelines-built",Qr),Qr=null)}),hr=()=>{if(!e.tornDown){if(!Be){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,VC();return}if(ht("discover",e.currentTime),!LC()){window.__renderReady=!1;return}if(!NC()){window.__renderReady=!1;return}WC()}},hr(),Be&&setTimeout(()=>{hr()},0);let vc=0,ss=!1,ls=Number.NaN,Zr={revision:Number.NaN,time:Number.NEGATIVE_INFINITY},us=null,cs=!1,kn=null,ig=!1,ds=!1,ag="",sg=-1,si=!1,lg=Number.NEGATIVE_INFINITY,ug=Number.NEGATIVE_INFINITY,cg="",dg=!1,Ac=u=>ft?void 0:{owner:u,version:`${nn}:${u.getChildren?.(!1,!0,!0).length??0}`},fg=new Set,$C=(u,p,b,x)=>{try{let A=x?.suppressEvents===!0;vn(p),$i(p,b,A,Ac(p),i)}catch(A){let w=A instanceof Error?`${A.name}: ${A.message}`:String(A),P=`${u}\n${w}`;if(fg.has(P))return;fg.add(P),globalThis.console.warn(`${Gg} "${u}" ${w}`)}},mg=new Map,qC=u=>{let p=mg.get(u);if(!ft&&p){if(p instanceof WeakRef){let x=p.deref();if(x?.isConnected&&x.getAttribute("data-composition-id")===u)return x}else if(p.missingAt===nn)return null}let b=document.querySelector(`[data-composition-id="${CSS.escape(u)}"]`);return mg.set(u,b?new WeakRef(b):{missingAt:nn}),b},fs=new WeakMap,pg=-1,zC=(u,p)=>{if(fs.has(p))return fs.get(p);let b=qC(u),x=b?ee(b,0):Number.NaN,A=b&&Number.isFinite(x)?{start:x,hiddenFrom:b.hasAttribute("data-start")&&!n(b)?x+(Q(b)??1/0):1/0,playbackStart:Bi(b),rate:Et(b),timelineDuration:Ee(p)}:null;return fs.set(p,A),A},hg=new WeakMap,jC=(u,p)=>{if(hg.get(u)!==p)return!1;try{return u.paused()===!0&&Number(u.totalTime?.())===p}catch{return!1}},wc=()=>{let u=window.__timelines??{},p=R()?.getAttribute("data-composition-id")??null;return Object.entries(u).filter(b=>!!b[1]&&typeof b[1]=="object"&&b[0]!==p)},KC=(u,p,b)=>{(pg!==p||ft)&&(fs=new WeakMap,pg=p);for(let[x,A]of wc()){let w=zC(x,A);if(!w)continue;let P=w.playbackStart+Bn(w.rate,Math.max(0,Math.min(u,w.hiddenFrom)-w.start)),q=Math.max(0,w.timelineDuration!=null&&w.timelineDuration>0?Math.min(w.timelineDuration,P):P);!ft&&jC(A,q)||($C(x,A,q,b),hg.set(A,q))}},gg=u=>typeof u=="object"&&u!==null,YC=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],bg=(u,p)=>{let b=u[p];if(typeof b!="function")return null;try{let x=Number(b.call(u));return Number.isFinite(x)?x:null}catch(x){return $("runtime.init.gsapCallbackDuration",x),null}},yg=new WeakMap,XC=(u,p)=>{if(!p)return xg(u);let b=yg.get(p.owner);if(b?.version===p.version)return b.value;let x=xg(u);return yg.set(p.owner,{version:p.version,value:x}),x},xg=u=>{if(!("getChildren"in u)||typeof u.getChildren!="function")return!1;let p;try{p=u.getChildren(!0,!0,!0)}catch(b){return $("runtime.init.gsapCallbackChildren",b),!1}if(!Array.isArray(p))return!1;for(let b of p){if(!gg(b))continue;let x=b.vars;if(!gg(x)||!YC.some(q=>typeof x[q]=="function"))continue;let P=bg(b,"totalDuration")??bg(b,"duration");if(P!=null&&P<=1e-6)return!0}return!1};function Ln(u,p){let b=e.capturedTimeline,x=_c(b,u,p);return ls=u,us=b,x}function _c(u,p,b){let x=b?.suppressEvents===!0,A=b?.revision??jr();A!==Zr.revision&&(Zr={revision:A,time:Number.NEGATIVE_INFINITY}),mC(p,A);let w=p>Zr.time,P=w&&u?xb(u,Zr.time,p):null,q=w&&P?.size!==0&&(u||wc().length>0)?t0(P?I=>P.has(I):void 0):null;if(KC(p,A,b),u){let I=p;if(typeof u.totalDuration=="function")try{let X=Number(u.totalDuration());Number.isFinite(X)&&X>0&&p>X&&(I=X)}catch(X){$("runtime.init.transport.clampDuration",X)}try{if(typeof u.totalTime=="function"){let X=Ac(u);!$i(u,I,x,X,i)&&!x&&!XC(u,X)&&Vi({totalTime:u.totalTime.bind(u),totalDuration:u.totalDuration?.bind(u),getChildren:u.getChildren?.bind(u)},I,X)}else u.seek(I,x)}catch(X){$("runtime.init.transport.seek",X)}}q?.(),Zr.time=Math.max(Zr.time,p);let W=K2();for(let I of e.deterministicAdapters)if(!(I.name==="gsap"&&u))try{I.seek({time:p,suppressEvents:x,pageAnimations:W})}catch(X){$("runtime.init.transport.adapter",X)}return W}let Tc=G_(document,()=>{Tn()});c.push(()=>Tc.disconnect());let Sg=()=>{try{return Tc.isActive()}catch{return!1}},JC=()=>!h.isPlaying()&&pt.length===0&&!te()&&Tc.observing&&(!cs||Sg())&&!si&&e.currentTime===ls&&e.capturedTimeline===us,Cc=()=>`${jr()}|${zr()??""}`,Eg=()=>{kn=window.setTimeout(QC,ig&&e.capturedTimeline&&dr?z2:e.bridgeMaxPostIntervalMs)},QC=()=>{if(kn=null,!e.tornDown&&!(typeof window>"u"||typeof document>"u")){if(Cc()!==ag){Tn();return}Je(!1),Eg()}},eo=null,vg=()=>e.transportRafId!=null||eo!=null,ms=()=>{if(document.visibilityState==="hidden"){eo=window.setTimeout(()=>{eo=null,Mg()},j2);return}e.transportRafId=window.requestAnimationFrame(Mg)},Ag=()=>{e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),eo!=null&&(window.clearTimeout(eo),eo=null)},wg=()=>{e.tornDown||!vg()||(Ag(),ms())};document.addEventListener("visibilitychange",wg);let ZC=()=>{if(e.transportRafId=null,e.tornDown)return;let u=ds;if(ds=!1,u||!JC()){ms();return}ag=Cc(),Eg()};Tn=()=>{e.tornDown||(ds=!0,!(ss||vg())&&(kn!=null&&(window.clearTimeout(kn),kn=null),ds=!1,ms()))};let _g=u=>u.isConnected&&!E(u)&&!ul(u)&&!(u.ended&&!u.loop)&&(u.hasAttribute("src")||u.querySelector("source[src]")!==null),eR=u=>{let p=qa("audio[data-start]"),b=null;for(let x of u?[u,...p]:p){if(!Ce(x)||!_g(x))continue;let A=re(x),w=xe(x,A);if(!Number.isFinite(A)||!fn(e.currentTime,w.start,w.end))continue;if(x===u)return{el:x,start:A};let P=A+(io(x)??1/0);(!b||P>b.runsUntil)&&(b={el:x,start:A,runsUntil:P})}return b},tR=3e3,li=null,nR=u=>u.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA?(li=null,!0):(li?.el!==u&&(li={el:u,sinceMs:performance.now()}),performance.now()-li.sinceMs<tR);function Tg(){if(h.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&y.ownsClock()&&y.context){let u=y.getTime();u>=0&&h.attachAudioSource({currentTimeSeconds:u,webAudio:!0})}else{let u=eR(h.audioElement());u&&!nR(u.el)?h.hasAudioSource()&&h.detachAudioSource():u&&!u.el.paused?h.attachAudioSource({el:u.el,compositionStart:u.start,mediaStart:Bi(u.el),rate:Et(u.el)}):u&&u.el.readyState<HTMLMediaElement.HAVE_FUTURE_DATA?h.attachAudioSource({currentTimeSeconds:e.currentTime}):h.hasAudioSource()&&h.detachAudioSource()}else li=null,h.hasAudioSource()&&h.detachAudioSource()}let rR=1,oR=u=>u.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA||po()&&Cg(u),Cg=u=>{if(u.readyState>=HTMLMediaElement.HAVE_ENOUGH_DATA)return!0;let p=po()?HTMLMediaElement.HAVE_CURRENT_DATA:HTMLMediaElement.HAVE_FUTURE_DATA;if(u.readyState<p)return!1;let b=Math.min(u.currentTime+rR,u.duration)-.01;for(let x=0;x<u.buffered.length;x++)if(u.buffered.start(x)<=u.currentTime&&u.buffered.end(x)>=b)return!0;return!1},Rg=(u,p=oR)=>e.nativeMediaSyncDisabled?[]:pr.filter(({el:b,start:x,end:A})=>fn(u,x,A)&&!p(b)&&_g(b)&&!rx(b)&&!y.ownsElement(b)).map(({el:b})=>b),Mg=()=>{if(!(e.tornDown||ss)){ss=!0;try{vc+=1;let u=jr();u!==sg&&(sg=u,si=!0);let p=Date.now(),b=h.isPlaying(),x=b&&p-ug>=Mp,A=dg&&!b;if(dg=b,x){ug=p;let oe=Cc();oe!==cg&&(cg=oe,si=!0)}let w=si&&p-lg>=U_;w&&(lg=p);let P=oe=>!b&&vc%oe===0;if(W_({tick:vc,isPlaying:b,hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:h.now(),compositionChanged:w,playingPollDue:x})){let oe=e.capturedTimeline;if(fr()){e.capturedTimeline&&e.capturedTimeline!==oe&&vn(e.capturedTimeline);let se=Xe(e.capturedTimeline,0,u);se>0&&h.setDuration(se),at()}}if(w||P(20)?(at(),si=!1):A&&MC(),(w||P(30))&&ja(),e.capturedTimeline){let oe=Xe(e.capturedTimeline,0,u);oe>0&&(!h.isPlaying()||oe>=h.getDuration())&&h.setDuration(oe)}Tg();let q=h.now();e.currentTime=q,window.__HF_EXPORT_RENDER_SEEK_CONFIG||Ob({nowMs:performance.now(),filmTime:q,fps:e.canonicalFps,rate:e.playbackRate,playing:b||pt.length>0,hidden:document.visibilityState==="hidden",waiting:pt.length>0||pr.some(({el:oe})=>oe.tagName==="VIDEO"&&!oe.paused&&oe.readyState<3),frozen:dy(pr,q),clock:h.followedClock(),layoutKey:`${window.innerWidth}x${window.innerHeight}@${window.devicePixelRatio}`});let W=h.isPlaying(),I=!W&&Sg(),X=W&&l_();if(I?cs=!0:!X&&(W||cs||q!==ls||e.capturedTimeline!==us)&&(Ln(q,{revision:u}),Bo(q,{playing:W}),W||(cs=!1)),W&&qt.redrawAnimated(),h.isPlaying()&&h.reachedEnd()){y.stopAll(),h.detachAudioSource(),h.pause(),e.isPlaying=!1;let oe=h.getStopTime();Number.isFinite(oe)&&(h.seek(oe),e.currentTime=oe,Ln(oe)),ht("pause"),St(u),Bo(e.currentTime),Je(!0);return}h.isPlaying()?(aR(),St(u)):TC()&&($t=null,St(u));let Se=Rg(e.currentTime);h.isPlaying()&&Se.length>0?(pt=Se,ng(!0)):pt.length>0&&!Rg(e.currentTime,Cg).some(oe=>pt.includes(oe))&&ai.play(),Je(!1)}finally{ss=!1,ZC()}}},kg=(u,p=.001)=>{let b=ve(()=>ii().mediaClips);for(let x of Gh(b)??[]){if(!x.el.isConnected||!fn(u,x.start,x.end))continue;let A=Vn(x,u);if(!(Math.abs(x.el.currentTime-A)<=p))try{x.el.currentTime=Rt(A)}catch{}}},Rc=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let u=y.startGeneration(),p=Oa(document);y.releaseDecodedExcept(p),Mc(p,u)},iR=10,ps={gen:-1,clips:[]},Lg=()=>h.now()+iR*Math.max(1,e.playbackRate),aR=()=>{let u=ps;if(u.gen!==y.currentGeneration()||u.clips.length===0||e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let p=Lg(),b=u.clips.filter(x=>x.start<=p);b.length!==0&&(u.clips=u.clips.filter(x=>x.start>p),Mc(b.flatMap(({el:x})=>x.isConnected?[x]:[]),u.gen))},Mc=(u,p)=>{ps.gen!==p&&(ps={gen:p,clips:[]});let b=h.now(),x=Lg();for(let A of u){if(E(A))continue;let w=re(A);if(!Number.isFinite(w))continue;let P=Bi(A),q=Number.parseFloat(A.dataset.volume??""),W=Number.isFinite(q)?q:1,I=Ue(A.dataset.duration),X=I!=null&&I>0?I:Number.POSITIVE_INFINITY,{inheritedStart:Se,inheritedDuration:oe}=fe(A);Se!=null&&oe!=null&&oe>0&&(X=Math.min(X,Math.max(0,Se+oe-w)));let se=ce(A),me=Mr({start:w,end:w+X},se);if(se.length>0){if(me.end<=me.start)continue;X=me.end-w}if(me.end<=b)continue;if(me.start>x){ps.clips.push({el:A,start:me.start});continue}let Qe=qo(A);zo(A,Qe),(Qe.kind==="web-audio"?y.scheduleMediaElementPlayback(A,w,P,h.now(),W,p,e.playbackRate,X):Promise.resolve(null)).then(He=>{let Ze=p!==y.currentGeneration();if(He&&e.playbackRate===1&&X2(A)){y.decodeAudioElement(A).then(async _t=>{if(!_t||!h.isPlaying()||p!==y.currentGeneration())return;await y.schedulePlayback(A,_t,w,P,()=>h.now(),W,p,e.playbackRate,X,me.start)&&y.releaseRouted(A)});return}if(He||!Ar(A)||!h.isPlaying()||Ze||typeof Et(A)!="number")return;let hs=e.playbackRate*lt(A),$e=A.hasAttribute("data-fx-chain")||A.hasAttribute("data-automation");if(Math.abs(hs-1)>1e-9){Qe.kind==="web-audio"&&$e&&(A.muted=!0);return}y.decodeAudioElement(A).then(_t=>{!_t||!h.isPlaying()||y.schedulePlayback(A,_t,w,P,()=>h.now(),W,p,e.playbackRate,X,me.start)})})}};function Ng(){y.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&S&&h.isPlaying()&&(y.hasBoundedActiveSources()||y.hasHandedOverSources())&&(y.stopAll(),Rc())}if(e.capturedTimeline){let u=Xe(e.capturedTimeline,0);u>0&&h.setDuration(u),vn(e.capturedTimeline)}jv(window),ms(),at(),Je(!0),e.controlBridgeHandler=Lb({onPlay:()=>{br.play(),Mt("composition_played",{time:br.getTime()})},onPause:()=>{br.pause(),Mt("composition_paused",{time:br.getTime()})},onStopMedia:()=>{y.stopAll();let u=document.querySelectorAll("video, audio");for(let p of u)Ce(p)&&!p.paused&&p.pause()},onSeek:(u,p)=>{br.seek(u),Mt("composition_seeked",{time:u})},onSetMuted:u=>{e.bridgeMuted=u;let p=u||e.mediaOutputMuted;y.setMuted(p);let b=document.querySelectorAll("video, audio");for(let x of b)Ce(x)&&(x.muted=p||x.defaultMuted)},onSetVolume:u=>{e.bridgeVolume=u,y.setVolume(u);let p=document.querySelectorAll("video, audio");for(let b of p){if(!Ce(b))continue;let x=parseFloat(b.dataset.volume??""),A=Number.isFinite(x)?x:1;b.volume=Ls(A*u)}},onSetMediaOutputMuted:u=>{e.mediaOutputMuted=u;let p=u||e.bridgeMuted;y.setMuted(p);let b=document.querySelectorAll("video, audio");for(let x of b)Ce(x)&&(x.muted=p||x.defaultMuted)},onSetNativeMediaSyncDisabled:u=>{e.nativeMediaSyncDisabled!==u&&(e.nativeMediaSyncDisabled=u,e.mediaForceSyncNextTick=!0,u?(y.stopAll(),h.detachAudioSource()):St())},onSetWebAudioMediaDisabled:u=>{e.webAudioMediaDisabled!==u&&(e.webAudioMediaDisabled=u,e.mediaForceSyncNextTick=!0,u&&(y.stopAll(),h.detachAudioSource()),St())},onSetPlaybackRate:u=>{Ec(u),e.transportClock&&e.transportClock.setRate(e.playbackRate),Ng()},onSetDisplayScale:u=>{gx(u),p0(u),Db(u)},onRequestPreviewFacts:()=>we({source:"hf-preview",type:"preview-facts",facts:{sceneCount:Nt.length,mountedElementCount:document.body.querySelectorAll("*").length,durationSeconds:h.getDuration(),videos:Cx(),lighterAt:Tx(),copiesReady:hy()}}),onSetPreviewQuality:_x,onRetryPreviewCopies:Rx,onSetIdleHeartbeat:u=>{ig=u,Tn()},onSetRootDuration:kC,onSetPlayRange:(u,p)=>{h.setPlayRange(u,p,e.canonicalFps);let b=h.getPlayStart();if(h.isPlaying()&&(h.now()<b||h.reachedEnd())){ai.seek(b,{keepPlaying:!0});return}Je(!0)},onSetColorGrading:(u,p)=>{qt.setGrading(u,p)},onSetColorGradingCompare:(u,p)=>{qt.setCompare(u,p)},onTick:()=>{if(e.tornDown||!h.isPlaying())return;Tg();let u=h.now();if(e.currentTime=u,(u!==ls||e.capturedTimeline!==us)&&Ln(u),h.reachedEnd()){y.stopAll(),h.detachAudioSource(),h.pause(),e.isPlaying=!1;let p=h.getStopTime();Number.isFinite(p)&&(h.seek(p),e.currentTime=p,Ln(p)),ht("pause"),St(),Je(!0)}},onEnablePickMode:()=>as.enablePickMode(),onDisablePickMode:()=>as.disablePickMode(),onSetRuntimeData:Pu,onClearRuntimeData:Iu,getCanonicalFps:()=>e.canonicalFps});let kc=()=>{if(!e.tornDown){e.tornDown=!0,Ag(),document.removeEventListener("visibilitychange",wg),kn!=null&&(window.clearTimeout(kn),kn=null),e.transportClock=null,y.destroy(),mr!=null&&(window.clearTimeout(mr),mr=null),f!=null&&(window.cancelAnimationFrame(f),f=null),iC(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),l&&(window.removeEventListener("error",l),l=null),s&&(window.removeEventListener("unhandledrejection",s),s=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),as.disablePickMode();for(let u of e.deterministicAdapters)if(!(!u||typeof u.revert!="function"))try{u.revert()}catch(p){$("runtime.init.site12",p)}e.deterministicAdapters=[],window.__hf?.buildReady&&(window.__hf.buildReady={});for(let u of c.splice(0))try{u()}catch(p){$("runtime.init.site13",p)}for(let u of e.injectedCompStyles)try{u.remove()}catch(p){$("runtime.init.site14",p)}e.injectedCompStyles=[];for(let u of e.injectedCompLinks)try{u.remove()}catch(p){$("runtime.init.site15",p)}e.injectedCompLinks=[];for(let u of e.injectedCompScripts)try{u.remove()}catch(p){$("runtime.init.site16",p)}e.injectedCompScripts=[],e.capturedTimeline=null,r=()=>{},window.__hfRuntimeTeardown===kc&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=kc,e.beforeUnloadHandler=kc,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var pT=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],Gp=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function J2(e){if(e<=255)return pT[e];let t=0,n=Gp.length-1;for(;t<=n;){let r=t+n>>1,o=Gp[r];if(e<o[0]){n=r-1;continue}if(e>o[1]){t=r+1;continue}return o[2]}return"L"}function Q2(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let c=0;c<t;){let d=e.charCodeAt(c),f=d,m=1;if(d>=55296&&d<=56319&&c+1<t){let h=e.charCodeAt(c+1);h>=56320&&h<=57343&&(f=(d-55296<<10)+(h-56320)+65536,m=2)}let g=J2(f);(g==="R"||g==="AL"||g==="AN")&&(r=!0);for(let h=0;h<m;h++)n[c+h]=g;c+=m}if(!r)return null;let o=0;for(let c=0;c<t;c++){let d=n[c];if(d==="L"){o=0;break}if(d==="R"||d==="AL"){o=1;break}}let i=new Int8Array(t);for(let c=0;c<t;c++)i[c]=o;let a=o&1?"R":"L",l=a,s=l;for(let c=0;c<t;c++)n[c]==="NSM"?n[c]=s:s=n[c];s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="AL"?"AN":"EN":(d==="R"||d==="L"||d==="AL")&&(s=d)}for(let c=0;c<t;c++)n[c]==="AL"&&(n[c]="R");for(let c=1;c<t-1;c++)n[c]==="ES"&&n[c-1]==="EN"&&n[c+1]==="EN"&&(n[c]="EN"),n[c]==="CS"&&(n[c-1]==="EN"||n[c-1]==="AN")&&n[c+1]===n[c-1]&&(n[c]=n[c-1]);for(let c=0;c<t;c++){if(n[c]!=="EN")continue;let d;for(d=c-1;d>=0&&n[d]==="ET";d--)n[d]="EN";for(d=c+1;d<t&&n[d]==="ET";d++)n[d]="EN"}for(let c=0;c<t;c++){let d=n[c];(d==="WS"||d==="ES"||d==="ET"||d==="CS")&&(n[c]="ON")}s=l;for(let c=0;c<t;c++){let d=n[c];d==="EN"?n[c]=s==="L"?"L":"EN":(d==="R"||d==="L")&&(s=d)}for(let c=0;c<t;c++){if(n[c]!=="ON")continue;let d=c+1;for(;d<t&&n[d]==="ON";)d++;let f=c>0?n[c-1]:l,m=d<t?n[d]:l,g=f!=="L"?"R":"L";if(g===(m!=="L"?"R":"L"))for(let y=c;y<d;y++)n[y]=g;c=d-1}for(let c=0;c<t;c++)n[c]==="ON"&&(n[c]=a);for(let c=0;c<t;c++){let d=n[c];(i[c]&1)===0?d==="R"?i[c]++:(d==="AN"||d==="EN")&&(i[c]+=2):(d==="L"||d==="AN"||d==="EN")&&i[c]++}return i}function hT(e,t){let n=Q2(e);if(n===null)return null;let r=new Int8Array(t.length);for(let o=0;o<t.length;o++)r[o]=n[t[o]];return r}var Z2=/[ \\t\\n\\r\\f]+/g,eB=/[\\t\\n\\r\\f]| {2,}|^ | $/;function tB(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function nB(e){if(!eB.test(e))return e;let t=e.replace(Z2," ");return t.charCodeAt(0)===32&&(t=t.slice(1)),t.length>0&&t.charCodeAt(t.length-1)===32&&(t=t.slice(0,-1)),t}function rB(e){return/[\\r\\f]/.test(e)?e.replace(/\\r\\n/g,`\n`).replace(/[\\r\\f]/g,`\n`):e.replace(/\\r\\n/g,`\n`)}var Bp=null,oB;function iB(){return Bp===null&&(Bp=new Intl.Segmenter(oB,{granularity:"word"})),Bp}var aB=/\\p{Script=Arabic}/u,Hu=/\\p{M}/u,AT=/\\p{Nd}/u;function gT(e){return aB.test(e)}function bT(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519}function Wt(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n<12288)){if(n>=55296&&n<=56319&&t+1<e.length){let r=e.charCodeAt(t+1);if(r>=56320&&r<=57343){let o=(n-55296<<10)+(r-56320)+65536;if(bT(o))return!0;t++;continue}}if(bT(n))return!0}}return!1}function sB(e){let t=Uu(e);return t!==null&&(Bu.has(t)||ar.has(t))}var lB=new Set(["\\xA0","\\u202F","\\u2060","\\uFEFF"]);function uB(e){return Wt(e)}function cB(e){let t=Uu(e);return t!==null&&lB.has(t)}function Gu(e){return!sB(e)&&!cB(e)}var Bu=new Set(["\\uFF0C","\\uFF0E","\\uFF01","\\uFF1A","\\uFF1B","\\uFF1F","\\u3001","\\u3002","\\u30FB","\\uFF09","\\u3015","\\u3009","\\u300B","\\u300D","\\u300F","\\u3011","\\u3017","\\u3019","\\u301B","\\u30FC","\\u3005","\\u303B","\\u309D","\\u309E","\\u30FD","\\u30FE"]),Ua=new Set([\'"\',"(","[","{","\\u201C","\\u2018","\\xAB","\\u2039","\\uFF08","\\u3014","\\u3008","\\u300A","\\u300C","\\u300E","\\u3010","\\u3016","\\u3018","\\u301A"]),Wp=new Set(["\'","\\u2019"]),ar=new Set([".",",","!","?",":",";","\\u060C","\\u061B","\\u061F","\\u0964","\\u0965","\\u104A","\\u104B","\\u104C","\\u104D","\\u104F",")","]","}","%",\'"\',"\\u201D","\\u2019","\\xBB","\\u203A","\\u2026"]),dB=new Set([":",".","\\u060C","\\u061B"]),fB=new Set(["\\u104F"]),mB=new Set(["\\u201D","\\u2019","\\xBB","\\u203A","\\u300D","\\u300F","\\u3011","\\u300B","\\u3009","\\u3015","\\uFF09"]);function pB(e){if(Vp(e))return!0;let t=!1;for(let n of e){if(ar.has(n)){t=!0;continue}if(!(t&&Hu.test(n)))return!1}return t}function hB(e){for(let t of e)if(!Bu.has(t)&&!ar.has(t))return!1;return e.length>0}function gB(e){if(Vp(e))return!0;for(let t of e)if(!Ua.has(t)&&!Wp.has(t)&&!Hu.test(t))return!1;return e.length>0}function Vp(e){let t=!1;for(let n of e)if(!(n==="\\\\"||Hu.test(n))){if(Ua.has(n)||ar.has(n)||Wp.has(n)){t=!0;continue}return!1}return t}function wT(e,t){let n=t-1;if(n<=0)return Math.max(n,0);let r=e.charCodeAt(n);if(r<56320||r>57343)return n;let o=n-1;if(o<0)return n;let i=e.charCodeAt(o);return i>=55296&&i<=56319?o:n}function Uu(e){if(e.length===0)return null;let t=wT(e,e.length);return e.slice(t)}function bB(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(Hu.test(r)){n--;continue}if(Ua.has(r)||Wp.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function yB(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\\u2014"?e:null}function yT(e,t,n,r){let o=t[r],i=e[r];if(o==null)return i;let a=n[r];if(i.length===a)return i;let l=o.repeat(a);return e[r]=l,l}function xT(e,t){return e&&t!==null&&dB.has(t)}function xB(e){let t=Uu(e);return t!==null&&fB.has(t)}function SB(e){if(e.length<2||e[0]!==" ")return null;let t=e.slice(1);return/^\\p{M}+$/u.test(t)?{space:" ",marks:t}:null}function Wu(e){let t=e.length;for(;t>0;){let n=wT(e,t),r=e.slice(n,t);if(mB.has(r))return!0;if(!ar.has(r))return!1;t=n}return!1}function EB(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`\n`)return"hard-break"}return e===" "?"space":e==="\\xA0"||e==="\\u202F"||e==="\\u2060"||e==="\\uFEFF"?"glue":e==="\\u200B"?"zero-width-break":e==="\\xAD"?"soft-hyphen":"text"}var vB=/[\\x20\\t\\n\\xA0\\xAD\\u200B\\u202F\\u2060\\uFEFF]/;function Lt(e){return e.length===1?e[0]:e.join("")}function AB(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Lt(n)}function wB(e,t,n,r){if(!vB.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let o=[],i=null,a=[],l=n,s=!1,c=0;for(let d of e){let f=EB(d,r),m=f==="text"&&t;if(i!==null&&f===i&&m===s){a.push(d),c+=d.length;continue}i!==null&&o.push({text:Lt(a),isWordLike:s,kind:i,start:l}),i=f,a=[d],l=n+c,s=m,c+=d.length}return i!==null&&o.push({text:Lt(a),isWordLike:s,kind:i,start:l}),o}function Up(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var _B=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function TB(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:_B.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function CB(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function RB(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),o=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!TB(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Up(r[s]);){l.push(t[s]),n[a]=!0;let c=t[s].includes("?");if(r[s]="text",t[s]="",s++,c)break}t[a]=Lt(l)}let i=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(i!==a&&(t[i]=l,n[i]=n[a],r[i]=r[a],o[i]=o[a]),i++)}return t.length=i,n.length=i,r.length=i,o.length=i,{len:i,texts:t,isWordLike:n,kinds:r,starts:o}}function MB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i];if(t.push(a),n.push(e.isWordLike[i]),r.push(e.kinds[i]),o.push(e.starts[i]),!CB(a))continue;let l=i+1;if(l>=e.len||Up(e.kinds[l]))continue;let s=[],c=e.starts[l],d=l;for(;d<e.len&&!Up(e.kinds[d]);)s.push(e.texts[d]),d++;s.length>0&&(t.push(Lt(s)),n.push(!0),r.push("text"),o.push(c),i=d-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}var kB=new Set([":","-","/","\\xD7",",",".","+","\\u2013","\\u2014"]),ST=/^[A-Za-z0-9_]+[,:;]*$/,ET=/[,:;]+$/;function _T(e){for(let t of e)if(AT.test(t))return!0;return!1}function Ba(e){if(e.length===0)return!1;for(let t of e)if(!(AT.test(t)||kB.has(t)))return!1;return!0}function LB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i],l=e.kinds[i];if(l==="text"&&Ba(a)&&_T(a)){let s=[a],c=i+1;for(;c<e.len&&e.kinds[c]==="text"&&Ba(e.texts[c]);)s.push(e.texts[c]),c++;t.push(Lt(s)),n.push(!0),r.push("text"),o.push(e.starts[i]),i=c-1;continue}t.push(a),n.push(e.isWordLike[i]),r.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function NB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i],l=e.kinds[i],s=e.isWordLike[i];if(l==="text"&&s&&ST.test(a)){let c=[a],d=ET.test(a),f=i+1;for(;d&&f<e.len&&e.kinds[f]==="text"&&e.isWordLike[f]&&ST.test(e.texts[f]);){let m=e.texts[f];c.push(m),d=ET.test(m),f++}t.push(Lt(c)),n.push(!0),r.push("text"),o.push(e.starts[i]),i=f-1;continue}t.push(a),n.push(s),r.push(l),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function FB(e){let t=[],n=[],r=[],o=[];for(let i=0;i<e.len;i++){let a=e.texts[i];if(e.kinds[i]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let c=0;c<l.length;c++){let d=l[c];if(!s)break;(d.length===0||!_T(d)||!Ba(d))&&(s=!1)}if(s){let c=0;for(let d=0;d<l.length;d++){let f=l[d],m=d<l.length-1?`${f}-`:f;t.push(m),n.push(!0),r.push("text"),o.push(e.starts[i]+c),c+=m.length}continue}}t.push(a),n.push(e.isWordLike[i]),r.push(e.kinds[i]),o.push(e.starts[i])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function PB(e){let t=[],n=[],r=[],o=[],i=0;for(;i<e.len;){let a=[e.texts[i]],l=e.isWordLike[i],s=e.kinds[i],c=e.starts[i];if(s==="glue"){let d=[a[0]],f=c;for(i++;i<e.len&&e.kinds[i]==="glue";)d.push(e.texts[i]),i++;let m=Lt(d);if(i<e.len&&e.kinds[i]==="text")a[0]=m,a.push(e.texts[i]),l=e.isWordLike[i],s="text",c=f,i++;else{t.push(m),n.push(!1),r.push("glue"),o.push(f);continue}}else i++;if(s==="text")for(;i<e.len&&e.kinds[i]==="glue";){let d=[];for(;i<e.len&&e.kinds[i]==="glue";)d.push(e.texts[i]),i++;let f=Lt(d);if(i<e.len&&e.kinds[i]==="text"){a.push(f,e.texts[i]),l=l||e.isWordLike[i],i++;continue}a.push(f)}t.push(Lt(a)),n.push(l),r.push(s),o.push(c)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function IB(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),o=e.starts.slice();for(let i=0;i<t.length-1;i++){if(r[i]!=="text"||r[i+1]!=="text"||!Wt(t[i])||!Wt(t[i+1]))continue;let a=bB(t[i]);a!==null&&(t[i]=a.head,t[i+1]=a.tail+t[i+1],o[i+1]=o[i]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function vT(e,t,n){let r=iB(),o=0,i=[],a=[],l=[],s=[],c=[],d=[],f=[],m=[],g=[],h=[],y=[],S=[];for(let M of r.segment(e))for(let L of wB(M.segment,M.isWordLike??!1,M.index,n)){let V=function(){d[D]!==null&&(a[D]=[yT(i,d,f,D)],d[D]=null),a[D].push(L.text),l[D]=l[D]||L.isWordLike,m[D]=m[D]||B,g[D]=g[D]||O,h[D]=Z,y[D]=J,S[D]=xT(g[D],Y)},G=L.kind==="text",C=yB(L.text,L.isWordLike,L.kind),B=Wt(L.text),O=gT(L.text),Y=Uu(L.text),Z=Wu(L.text),J=xB(L.text),D=o-1;t.carryCJKAfterClosingQuote&&G&&o>0&&s[D]==="text"&&B&&m[D]&&h[D]||G&&o>0&&s[D]==="text"&&hB(L.text)&&m[D]||G&&o>0&&s[D]==="text"&&y[D]?V():G&&o>0&&s[D]==="text"&&L.isWordLike&&O&&S[D]?(V(),l[D]=!0):C!==null&&o>0&&s[D]==="text"&&d[D]===C?f[D]=(f[D]??1)+1:G&&!L.isWordLike&&o>0&&s[D]==="text"&&(pB(L.text)||L.text==="-"&&l[D])?V():(i[o]=L.text,a[o]=[L.text],l[o]=L.isWordLike,s[o]=L.kind,c[o]=L.start,d[o]=C,f[o]=C===null?0:1,m[o]=B,g[o]=O,h[o]=Z,y[o]=J,S[o]=xT(O,Y),o++)}for(let M=0;M<o;M++){if(d[M]!==null){i[M]=yT(i,d,f,M);continue}i[M]=Lt(a[M])}for(let M=1;M<o;M++)s[M]==="text"&&!l[M]&&Vp(i[M])&&s[M-1]==="text"&&(i[M-1]+=i[M],l[M-1]=l[M-1]||l[M],i[M]="");let E=Array.from({length:o},()=>null),v=-1;for(let M=o-1;M>=0;M--){let L=i[M];if(L.length!==0){if(s[M]==="text"&&!l[M]&&gB(L)&&v>=0&&s[v]==="text"){let G=E[v]??[];G.push(L),E[v]=G,c[v]=c[M],i[M]="";continue}v=M}}for(let M=0;M<o;M++){let L=E[M];L!=null&&(i[M]=AB(L,i[M]))}let T=0;for(let M=0;M<o;M++){let L=i[M];L.length!==0&&(T!==M&&(i[T]=L,l[T]=l[M],s[T]=s[M],c[T]=c[M]),T++)}i.length=T,l.length=T,s.length=T,c.length=T;let H=PB({len:T,texts:i,isWordLike:l,kinds:s,starts:c}),U=IB(NB(FB(LB(MB(RB(H))))));for(let M=0;M<U.len-1;M++){let L=SB(U.texts[M]);L!==null&&(U.kinds[M]!=="space"&&U.kinds[M]!=="preserved-space"||U.kinds[M+1]!=="text"||!gT(U.texts[M+1])||(U.texts[M]=L.space,U.isWordLike[M]=!1,U.kinds[M]=U.kinds[M]==="preserved-space"?"preserved-space":"space",U.texts[M+1]=L.marks+U.texts[M+1],U.starts[M+1]=U.starts[M]+L.space.length))}return U}function DB(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];let n=[],r=0;for(let o=0;o<e.len;o++)e.kinds[o]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:o,consumedEndSegmentIndex:o+1}),r=o+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function OB(e){if(e.len<=1)return e;let t=[],n=[],r=[],o=[],i=null,a=!1,l=0,s=!1,c=!1;function d(){i!==null&&(t.push(Lt(i)),n.push(a),r.push("text"),o.push(l),i=null)}for(let f=0;f<e.len;f++){let m=e.texts[f],g=e.kinds[f],h=e.isWordLike[f],y=e.starts[f];if(g==="text"){let S=uB(m),E=Gu(m);if(i!==null&&s&&c){i.push(m),a=a||h,s=s||S,c=E;continue}d(),i=[m],a=h,l=y,s=S,c=E;continue}d(),t.push(m),n.push(h),r.push(g),o.push(y)}return d(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:o}}function TT(e,t,n="normal",r="normal"){let o=tB(n),i=o.mode==="pre-wrap"?rB(e):nB(e);if(i.length===0)return{normalized:i,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?OB(vT(i,t,o)):vT(i,t,o);return{normalized:i,chunks:DB(a,o),...a}}var jo=null,CT=new Map,Ko=null,HB=96,GB=/\\p{Emoji_Presentation}/u,BB=/[\\p{Emoji_Presentation}\\p{Extended_Pictographic}\\p{Regional_Indicator}\\uFE0F\\u20E3]/u,$p=null,RT=new Map;function qp(){if(jo!==null)return jo;if(typeof OffscreenCanvas<"u")return jo=new OffscreenCanvas(1,1).getContext("2d"),jo;if(typeof document<"u")return jo=document.createElement("canvas").getContext("2d"),jo;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function UB(e){let t=CT.get(e);return t||(t=new Map,CT.set(e,t)),t}function An(e,t){let n=t.get(e);return n===void 0&&(n={width:qp().measureText(e).width,containsCJK:Wt(e)},t.set(e,n)),n}function lr(){if(Ko!==null)return Ko;if(typeof navigator>"u")return Ko={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Ko;let e=navigator.userAgent,n=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),r=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return Ko={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Ko}function WB(e){let t=e.match(/(\\d+(?:\\.\\d+)?)\\s*px/);return t?parseFloat(t[1]):16}function MT(){return $p===null&&($p=new Intl.Segmenter(void 0,{granularity:"grapheme"})),$p}function VB(e){return GB.test(e)||e.includes("\\uFE0F")}function kT(e){return BB.test(e)}function $B(e,t){let n=RT.get(e);if(n!==void 0)return n;let r=qp();r.font=e;let o=r.measureText("\\u{1F600}").width;if(n=0,o>t+.5&&typeof document<"u"&&document.body!==null){let i=document.createElement("span");i.style.font=e,i.style.display="inline-block",i.style.visibility="hidden",i.style.position="absolute",i.textContent="\\u{1F600}",document.body.appendChild(i);let a=i.getBoundingClientRect().width;document.body.removeChild(i),o-a>.5&&(n=o-a)}return RT.set(e,n),n}function qB(e){let t=0,n=MT();for(let r of n.segment(e))VB(r.segment)&&t++;return t}function zB(e,t){return t.emojiCount===void 0&&(t.emojiCount=qB(e)),t.emojiCount}function sr(e,t,n){return n===0?t.width:t.width-zB(e,t)*n}function LT(e,t,n,r,o){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let i=MT(),a=[];for(let d of i.segment(e))a.push(d.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(o==="sum-graphemes"){let d=[];for(let f of a){let m=An(f,n);d.push(sr(f,m,r))}return t.breakableFitAdvances=d,t.breakableFitAdvances}if(o==="pair-context"||a.length>HB){let d=[],f=null,m=0;for(let g of a){let h=An(g,n),y=sr(g,h,r);if(f===null)d.push(y);else{let S=f+g,E=An(S,n);d.push(sr(S,E,r)-m)}f=g,m=y}return t.breakableFitAdvances=d,t.breakableFitAdvances}let l=[],s="",c=0;for(let d of a){s+=d;let f=An(s,n),m=sr(s,f,r);l.push(m-c),c=m}return t.breakableFitAdvances=l,t.breakableFitAdvances}function NT(e,t){let n=qp();n.font=e;let r=UB(e),o=WB(e),i=t?$B(e,o):0;return{cache:r,fontSize:o,emojiCorrection:i}}function jB(e,t){for(;t<e.widths.length;){let n=e.kinds[t];if(n!=="space"&&n!=="zero-width-break"&&n!=="soft-hyphen")break;t++}return t}function FT(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function PT(e,t,n,r,o){let i=0,a=t;for(;i<e.length;){let l=a+e[i];if((i+1<e.length?l+o:l)>n+r)break;a=l,i++}return{fitCount:i,fittedWidth:a}}function KB(e,t){let n=0,r=e.chunks.length;for(;n<r;){let o=Math.floor((n+r)/2);t<e.chunks[o].consumedEndSegmentIndex?r=o:n=o+1}return n<e.chunks.length?n:-1}function IT(e,t,n){let r=n.segmentIndex;if(n.graphemeIndex>0)return t;let o=e.chunks[t];if(o.startSegmentIndex===o.endSegmentIndex&&r===o.startSegmentIndex)return n.segmentIndex=r,n.graphemeIndex=0,t;for(r<o.startSegmentIndex&&(r=o.startSegmentIndex);r<o.endSegmentIndex;){let i=e.kinds[r];if(i!=="space"&&i!=="zero-width-break"&&i!=="soft-hyphen")return n.segmentIndex=r,n.graphemeIndex=0,t;r++}return o.consumedEndSegmentIndex>=e.widths.length?-1:(n.segmentIndex=o.consumedEndSegmentIndex,n.graphemeIndex=0,t+1)}function DT(e,t){if(t.segmentIndex>=e.widths.length)return-1;let n=KB(e,t.segmentIndex);return n<0?-1:IT(e,n,t)}function YB(e,t,n){if(n.segmentIndex>=e.widths.length)return-1;let r=t;for(;r<e.chunks.length&&n.segmentIndex>=e.chunks[r].consumedEndSegmentIndex;)r++;return r>=e.chunks.length?-1:IT(e,r,n)}function OT(e,t){return e.simpleLineWalkFastPath?HT(e,t):zp(e,t)}function HT(e,t,n){let{widths:r,kinds:o,breakableFitAdvances:i}=e;if(r.length===0)return 0;let l=lr().lineFitEpsilon,s=t+l,c=0,d=0,f=!1,m=0,g=0,h=0,y=0,S=-1,E=0;function v(){S=-1,E=0}function T(C=h,B=y,O=d){c++,n?.({startSegmentIndex:m,startGraphemeIndex:g,endSegmentIndex:C,endGraphemeIndex:B,width:O}),d=0,f=!1,v()}function H(C,B){f=!0,m=C,g=0,h=C+1,y=0,d=B}function U(C,B,O){f=!0,m=C,g=B,h=C,y=B+1,d=O}function M(C,B){if(!f){H(C,B);return}d+=B,h=C+1,y=0}function L(C,B){let O=i[C];for(let Y=B;Y<O.length;Y++){let Z=O[Y];f?d+Z>s?(T(),U(C,Y,Z)):(d+=Z,h=C,y=Y+1):U(C,Y,Z)}f&&h===C&&y===O.length&&(h=C+1,y=0)}let G=0;for(;G<r.length&&!(!f&&(G=jB(e,G),G>=r.length));){let C=r[G],B=o[G],O=B==="space"||B==="preserved-space"||B==="tab"||B==="zero-width-break"||B==="soft-hyphen";if(!f){C>t&&i[G]!==null?L(G,0):H(G,C),O&&(S=G+1,E=d-C),G++;continue}if(d+C>s){if(O){M(G,C),T(G+1,0,d-C),G++;continue}if(S>=0){if(h>S||h===S&&y>0){T();continue}T(S,0,E);continue}if(C>t&&i[G]!==null){T(),L(G,0),G++;continue}T();continue}M(G,C),O&&(S=G+1,E=d-C),G++}return f&&T(),c}function zp(e,t,n){if(e.simpleLineWalkFastPath)return HT(e,t,n);let{widths:r,lineEndFitAdvances:o,lineEndPaintAdvances:i,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:c,chunks:d}=e;if(r.length===0||d.length===0)return 0;let f=lr(),m=f.lineFitEpsilon,g=t+m,h=0,y=0,S=!1,E=0,v=0,T=0,H=0,U=-1,M=0,L=0,G=null;function C(){U=-1,M=0,L=0,G=null}function B(k=T,F=H,_=y){h++,n?.({startSegmentIndex:E,startGraphemeIndex:v,endSegmentIndex:k,endGraphemeIndex:F,width:_}),y=0,S=!1,C()}function O(k,F){S=!0,E=k,v=0,T=k+1,H=0,y=F}function Y(k,F,_){S=!0,E=k,v=F,T=k,H=F+1,y=_}function Z(k,F){if(!S){O(k,F);return}y+=F,T=k+1,H=0}function J(k,F,_,N){if(!F)return;let j=k==="tab"?0:o[_],ae=k==="tab"?N:i[_];U=_+1,M=y-N+j,L=y-N+ae,G=k}function D(k,F){let _=l[k];for(let N=F;N<_.length;N++){let j=_[N];S?y+j>g?(B(),Y(k,N,j)):(y+=j,T=k,H=N+1):Y(k,N,j)}S&&T===k&&H===_.length&&(T=k+1,H=0)}function V(k){if(G!=="soft-hyphen")return!1;let F=l[k];if(F==null)return!1;let{fitCount:_,fittedWidth:N}=PT(F,y,t,m,s);return _===0?!1:(y=N,T=k,H=_,C(),_===F.length?(T=k+1,H=0,!0):(B(k,_,N+s),D(k,_),!0))}function R(k){h++,n?.({startSegmentIndex:k.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:k.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),C()}for(let k=0;k<d.length;k++){let F=d[k];if(F.startSegmentIndex===F.endSegmentIndex){R(F);continue}S=!1,y=0,E=F.startSegmentIndex,v=0,T=F.startSegmentIndex,H=0,C();let _=F.startSegmentIndex;for(;_<F.endSegmentIndex;){let N=a[_],j=N==="space"||N==="preserved-space"||N==="tab"||N==="zero-width-break"||N==="soft-hyphen",ae=N==="tab"?FT(y,c):r[_];if(N==="soft-hyphen"){S&&(T=_+1,H=0,U=_+1,M=y+s,L=y+s,G=N),_++;continue}if(!S){ae>t&&l[_]!==null?D(_,0):O(_,ae),J(N,j,_,ae),_++;continue}if(y+ae>g){let ve=y+(N==="tab"?0:o[_]),z=y+(N==="tab"?ae:i[_]);if(G==="soft-hyphen"&&f.preferEarlySoftHyphenBreak&&M<=g){B(U,0,L);continue}if(G==="soft-hyphen"&&V(_)){_++;continue}if(j&&ve<=g){Z(_,ae),B(_+1,0,z),_++;continue}if(U>=0&&M<=g){if(T>U||T===U&&H>0){B();continue}let ee=U;B(ee,0,L),_=ee;continue}if(ae>t&&l[_]!==null){B(),D(_,0),_++;continue}B();continue}Z(_,ae),J(N,j,_,ae),_++}if(S){let N=U===F.consumedEndSegmentIndex?L:y;B(F.consumedEndSegmentIndex,0,N)}}return h}function GT(e,t,n,r){let o=e.chunks[n];if(o.startSegmentIndex===o.endSegmentIndex)return t.segmentIndex=o.consumedEndSegmentIndex,t.graphemeIndex=0,0;let{widths:i,lineEndFitAdvances:a,lineEndPaintAdvances:l,kinds:s,breakableFitAdvances:c,discretionaryHyphenWidth:d,tabStopAdvance:f}=e,m=lr(),g=m.lineFitEpsilon,h=r+g,y=0,S=!1,E=t.segmentIndex,v=t.graphemeIndex,T=-1,H=0,U=0,M=null;function L(){T=-1,H=0,U=0,M=null}function G(D=E,V=v,R=y){return S?(t.segmentIndex=D,t.graphemeIndex=V,R):null}function C(D,V){S=!0,E=D+1,v=0,y=V}function B(D,V,R){S=!0,E=D,v=V+1,y=R}function O(D,V){if(!S){C(D,V);return}y+=V,E=D+1,v=0}function Y(D,V,R,k){if(!V)return;let F=D==="tab"?0:a[R],_=D==="tab"?k:l[R];T=R+1,H=y-k+F,U=y-k+_,M=D}function Z(D,V){let R=c[D];for(let k=V;k<R.length;k++){let F=R[k];if(!S)B(D,k,F);else{if(y+F>h)return G();y+=F,E=D,v=k+1}}return S&&E===D&&v===R.length&&(E=D+1,v=0),null}function J(D){if(M!=="soft-hyphen"||T<0)return null;let V=c[D]??null;if(V!==null){let{fitCount:R,fittedWidth:k}=PT(V,y,r,g,d);if(R===V.length)return y=k,E=D+1,v=0,L(),null;if(R>0)return G(D,R,k+d)}return H<=h?G(T,0,U):null}for(let D=t.segmentIndex;D<o.endSegmentIndex;D++){let V=s[D],R=V==="space"||V==="preserved-space"||V==="tab"||V==="zero-width-break"||V==="soft-hyphen",k=D===t.segmentIndex?t.graphemeIndex:0,F=V==="tab"?FT(y,f):i[D];if(V==="soft-hyphen"&&k===0){S&&(E=D+1,v=0,T=D+1,H=y+d,U=y+d,M=V);continue}if(!S){if(k>0){let N=Z(D,k);if(N!==null)return N}else if(F>r&&c[D]!==null){let N=Z(D,0);if(N!==null)return N}else C(D,F);Y(V,R,D,F);continue}if(y+F>h){let N=y+(V==="tab"?0:a[D]),j=y+(V==="tab"?F:l[D]);if(M==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&H<=h)return G(T,0,U);let ae=J(D);if(ae!==null)return ae;if(R&&N<=h)return O(D,F),G(D+1,0,j);if(T>=0&&H<=h)return E>T||E===T&&v>0?G():G(T,0,U);if(F>r&&c[D]!==null){let de=G();if(de!==null)return de;let ve=Z(D,0);if(ve!==null)return ve}return G()}O(D,F),Y(V,R,D,F)}return T===o.consumedEndSegmentIndex&&v===0?G(o.consumedEndSegmentIndex,0,U):G(o.consumedEndSegmentIndex,0,y)}function XB(e,t,n){let{widths:r,kinds:o,breakableFitAdvances:i}=e,l=lr().lineFitEpsilon,s=n+l,c=0,d=!1,f=t.segmentIndex,m=t.graphemeIndex,g=-1,h=0;for(let y=t.segmentIndex;y<r.length;y++){let S=r[y],E=o[y],v=E==="space"||E==="preserved-space"||E==="tab"||E==="zero-width-break"||E==="soft-hyphen",T=y===t.segmentIndex?t.graphemeIndex:0,H=i[y];if(!d){if(T>0||S>n&&H!==null){let U=H,M=U[T];d=!0,c=M,f=y,m=T+1;for(let L=T+1;L<U.length;L++){let G=U[L];if(c+G>s)return t.segmentIndex=f,t.graphemeIndex=m,c;c+=G,f=y,m=L+1}f===y&&m===U.length&&(f=y+1,m=0)}else d=!0,c=S,f=y+1,m=0;v&&(g=y+1,h=c-S);continue}if(c+S>s)return v?(t.segmentIndex=y+1,t.graphemeIndex=0,c):g>=0?f>g||f===g&&m>0?(t.segmentIndex=f,t.graphemeIndex=m,c):(t.segmentIndex=g,t.graphemeIndex=0,h):(t.segmentIndex=f,t.graphemeIndex=m,c);c+=S,f=y+1,m=0,v&&(g=y+1,h=c-S)}return d?(t.segmentIndex=f,t.graphemeIndex=m,c):null}function JB(e,t,n){let r=DT(e,t);return r<0?null:e.simpleLineWalkFastPath?XB(e,t,n):GT(e,t,r,n)}function BT(e,t){if(e.widths.length===0)return{lineCount:0,maxLineWidth:0};let n={segmentIndex:0,graphemeIndex:0},r=0,o=0;if(!e.simpleLineWalkFastPath){let i=DT(e,n);for(;i>=0;){let a=GT(e,n,i,t);if(a===null)return{lineCount:r,maxLineWidth:o};r++,a>o&&(o=a),i=YB(e,i,n)}return{lineCount:r,maxLineWidth:o}}for(;;){let i=JB(e,n,t);if(i===null)return{lineCount:r,maxLineWidth:o};r++,i>o&&(o=i)}}var jp=null;function QB(){return jp===null&&(jp=new Intl.Segmenter(void 0,{granularity:"grapheme"})),jp}function ZB(e){return e?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]}}function e3(e,t){let n=[],r=[],o=0,i=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:o}),r=[],i=!1,a=!1,l=!1)}function c(f,m,g){r=[f],o=m,i=g,a=Wu(f),l=Ua.has(f)}function d(f,m){r.push(f),i=i||m;let g=Wu(f);f.length===1&&ar.has(f)?a=a||g:a=g,l=!1}for(let f of QB().segment(e)){let m=f.segment,g=Wt(m);if(r.length===0){c(m,f.index,g);continue}if(l||Bu.has(m)||ar.has(m)||t.carryCJKAfterClosingQuote&&g&&a){d(m,g);continue}if(!i&&!g){d(m,g);continue}s(),c(m,f.index,g)}return s(),n}function t3(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,o=Wt(e[0].text),i=Gu(e[0].text);function a(){t.push({text:n.length===1?n[0]:n.join(""),start:r})}for(let l=1;l<e.length;l++){let s=e[l],c=Wt(s.text),d=Gu(s.text);if(o&&i){n.push(s.text),o=o||c,i=d;continue}a(),n=[s.text],r=s.start,o=c,i=d}return a(),t}function n3(e,t,n,r){let o=lr(),{cache:i,emojiCorrection:a}=NT(t,kT(e.normalized)),l=sr("-",An("-",i),a),c=sr(" ",An(" ",i),a)*8;if(e.len===0)return ZB(n);let d=[],f=[],m=[],g=[],h=e.chunks.length<=1,y=n?[]:null,S=[],E=n?[]:null,v=Array.from({length:e.len});function T(L,G,C,B,O,Y,Z){O!=="text"&&O!=="space"&&O!=="zero-width-break"&&(h=!1),d.push(G),f.push(C),m.push(B),g.push(O),y?.push(Y),S.push(Z),E!==null&&E.push(L)}function H(L,G,C,B,O){let Y=An(L,i),Z=sr(L,Y,a),J=G==="space"||G==="preserved-space"||G==="zero-width-break"?0:Z,D=G==="space"||G==="zero-width-break"?0:Z;if(O&&B&&L.length>1){let V="sum-graphemes";Ba(L)?V="pair-context":o.preferPrefixWidthsForBreakableRuns&&(V="segment-prefixes");let R=LT(L,Y,i,a,V);T(L,Z,J,D,G,C,R);return}T(L,Z,J,D,G,C,null)}for(let L=0;L<e.len;L++){v[L]=d.length;let G=e.texts[L],C=e.isWordLike[L],B=e.kinds[L],O=e.starts[L];if(B==="soft-hyphen"){T(G,0,l,l,B,O,null);continue}if(B==="hard-break"){T(G,0,0,0,B,O,null);continue}if(B==="tab"){T(G,0,0,0,B,O,null);continue}let Y=An(G,i);if(B==="text"&&Y.containsCJK){let Z=e3(G,o),J=r==="keep-all"?t3(Z):Z;for(let D=0;D<J.length;D++){let V=J[D];H(V.text,"text",O+V.start,C,r==="keep-all"||!Wt(V.text))}continue}H(G,B,O,C,!0)}let U=r3(e.chunks,v,d.length),M=y===null?null:hT(e.normalized,y);return E!==null?{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:g,simpleLineWalkFastPath:h,segLevels:M,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:U,segments:E}:{widths:d,lineEndFitAdvances:f,lineEndPaintAdvances:m,kinds:g,simpleLineWalkFastPath:h,segLevels:M,breakableFitAdvances:S,discretionaryHyphenWidth:l,tabStopAdvance:c,chunks:U}}function r3(e,t,n){let r=[];for(let o=0;o<e.length;o++){let i=e[o],a=i.startSegmentIndex<t.length?t[i.startSegmentIndex]:n,l=i.endSegmentIndex<t.length?t[i.endSegmentIndex]:n,s=i.consumedEndSegmentIndex<t.length?t[i.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function UT(e,t,n,r){let o=r?.wordBreak??"normal",i=TT(e,lr(),r?.whiteSpace,o);return n3(i,t,n,o)}function Vu(e,t,n){return UT(e,t,!1,n)}function WT(e,t,n){return UT(e,t,!0,n)}function $u(e,t,n){let r=OT(e,t);return{lineCount:r,height:r*n}}function o3(e){return{width:e.width,start:{segmentIndex:e.startSegmentIndex,graphemeIndex:e.startGraphemeIndex},end:{segmentIndex:e.endSegmentIndex,graphemeIndex:e.endGraphemeIndex}}}function i3(e,t,n){return e.widths.length===0?0:zp(e,t,r=>{n(o3(r))})}function VT(e,t){return BT(e,t)}function $T(e){let t=0;return i3(e,Number.POSITIVE_INFINITY,n=>{n.width>t&&(t=n.width)}),t}var a3={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function qT(e,t){let n={...a3,...t},r=1.2;for(let o=n.baseFontSize;o>=n.minFontSize;o=Math.max(n.minFontSize,o-n.step)){let i=`${n.fontWeight} ${o}px ${n.fontFamily}`,a=Vu(e,i),{lineCount:l}=$u(a,n.maxWidth,o*r);if(l<=1)return{fontSize:o,fits:!0};if(o===n.minFontSize)break}return{fontSize:n.minFontSize,fits:!1}}var zT={prepare:Vu,layout:$u,prepareWithSegments:WT,measureLineStats:VT,measureNaturalWidth:$T};var ur="appifact-film:";function jT(e){let{iframe:t,runnerHtml:n,load:r}=e,o=(t.getAttribute("sandbox")??"").split(/\\s+/);if(!o.includes("allow-scripts")||o.includes("allow-same-origin"))throw new Error(\'Film runners require sandbox="allow-scripts" without allow-same-origin\');let i=0,a=!1,l=!1,s=null,c,d,f=new Promise((T,H)=>{c=T,d=H});f.catch(()=>{});let m=null,g=T=>{s=T,clearTimeout(h),d(T),m&&(clearTimeout(m.timer),m.reject(T),m=null)},h=setTimeout(()=>g(new Error("Film runner did not become ready within 20 s")),2e4),y=T=>{if(T.type!==ur+"frame"&&T.type!==ur+"frame-error"||!("seq"in T)||m===null||m.sequence!==T.seq)return;let H=m;m=null,clearTimeout(H.timer),T.type===ur+"frame-error"?H.reject(new Error("message"in T?String(T.message):"Film frame failed")):H.resolve()},S=T=>{try{let H=t.contentWindow;if(!H)throw new Error("Film runner window is unavailable");H.postMessage(T,"*")}catch(H){g(H instanceof Error?H:new Error(String(H)))}},E=T=>{if(T.type===ur+"hello"){if(a){g(new Error("Film runner reloaded; recreate the bridge before seeking"));return}a=!0,S({...r,type:ur+"load"})}else T.type===ur+"ready"&&a?(clearTimeout(h),c()):T.type===ur+"error"&&g(new Error("message"in T?String(T.message):"Film runner failed"))},v=T=>{if(l||s||T.source!==t.contentWindow||T.origin!=="null")return;let H=T.data;!H||typeof H!="object"||!("type"in H)||(E(H),y(H))};return window.addEventListener("message",v),t.srcdoc=n,{ready:f,async render(T){if(await f,s)throw s;if(m)throw new Error("Film seeks must be serialized; use registerFrameSource");let H=++i;return new Promise((U,M)=>{let L=setTimeout(()=>{g(new Error("Film frame did not arrive within 15 s"))},15e3);m={sequence:H,resolve:U,reject:M,timer:L},S({type:ur+"frame",t:T,seq:H})})},dispose(){l||(l=!0,window.removeEventListener("message",v),g(new Error("Film bridge was disposed")),t.srcdoc="")}}}window.__timelines=window.__timelines||{};uA();cT();dT();o_();window.__hfHasFrameSources=Yy;n0();Rb();window.__hyperframes={assetUrl:Lu,fitTextFontSize:qT,getVariables:xy,pretext:zT,registerRuntimeDataHandler:oT,setRuntimeData:Pu,clearRuntimeData:Iu,registerFrameSource:Xy,createFilmBridge:jT};function KT(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,o0(),mT())}function YT(){try{hb(),xr();let e=Array.from(document.querySelectorAll(lv));e.length===0?KT():ou(e,KT).catch(t=>{di(t),reportError(t)})}catch(e){throw di(e),e}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",YT,{once:!0}):YT();})();\n';
|
|
40989
40989
|
function getHyperframeRuntimeScript() {
|
|
40990
40990
|
return RUNTIME_IIFE;
|
|
40991
40991
|
}
|