hyperframes 0.7.106 → 0.7.108
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/cli.js +3382 -1238
- package/dist/hyperframe-runtime.js +238 -28
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +238 -28
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/skills/hyperframes/SKILL.md +1 -0
- package/dist/studio/assets/{hyperframes-player-CvVcx_CV.js → hyperframes-player-QqavTWRK.js} +1 -1
- package/dist/studio/assets/{index-CRzCCuPH.js → index-BQjXA1pz.js} +1 -1
- package/dist/studio/assets/{index-BbYg_isc.js → index-BhHHMprP.js} +1 -1
- package/dist/studio/assets/index-DNkh9mbV.css +1 -0
- package/dist/studio/assets/index-GqONLcOl.js +428 -0
- package/dist/studio/{chunk-OBAG3GWK.js → chunk-AZYHQC6V.js} +6 -7
- package/dist/studio/chunk-AZYHQC6V.js.map +1 -0
- package/dist/studio/{domEditingLayers-AT7G6F4L.js → domEditingLayers-7AMZ7GFI.js} +4 -2
- package/dist/studio/index.d.ts +86 -3
- package/dist/studio/index.html +2 -2
- package/dist/studio/index.js +24325 -17831
- package/dist/studio/index.js.map +1 -1
- package/dist/templates/_shared/AGENTS.md +1 -1
- package/dist/templates/_shared/CLAUDE.md +1 -1
- package/package.json +1 -1
- package/dist/studio/assets/index-DerI0ikN.js +0 -428
- package/dist/studio/assets/index-tBPidglp.css +0 -1
- package/dist/studio/chunk-OBAG3GWK.js.map +0 -1
- /package/dist/studio/{domEditingLayers-AT7G6F4L.js.map → domEditingLayers-7AMZ7GFI.js.map} +0 -0
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`+
|
|
3
|
-
`+
|
|
1
|
+
"use strict";(()=>{var Ff=Object.create;var vi=Object.defineProperty;var Mf=Object.getOwnPropertyDescriptor;var Nf=Object.getOwnPropertyNames;var Lf=Object.getPrototypeOf,Df=Object.prototype.hasOwnProperty;var If=(e,t,n)=>t in e?vi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Nf(t))!Df.call(e,i)&&i!==n&&vi(e,i,{get:()=>t[i],enumerable:!(r=Mf(t,i))||r.enumerable});return e};var Of=(e,t,n)=>(n=e!=null?Ff(Lf(e)):{},Pf(t||!e||!e.__esModule?vi(n,"default",{value:e,enumerable:!0}):n,e));var ge=(e,t,n)=>If(e,typeof t!="symbol"?t+"":t,n);var Pl=ee((dS,go)=>{var Y=String,Il=function(){return{isColorSupported:!1,reset:Y,bold:Y,dim:Y,italic:Y,underline:Y,inverse:Y,hidden:Y,strikethrough:Y,black:Y,red:Y,green:Y,yellow:Y,blue:Y,magenta:Y,cyan:Y,white:Y,gray:Y,bgBlack:Y,bgRed:Y,bgGreen:Y,bgYellow:Y,bgBlue:Y,bgMagenta:Y,bgCyan:Y,bgWhite:Y,blackBright:Y,redBright:Y,greenBright:Y,yellowBright:Y,blueBright:Y,magentaBright:Y,cyanBright:Y,whiteBright:Y,bgBlackBright:Y,bgRedBright:Y,bgGreenBright:Y,bgYellowBright:Y,bgBlueBright:Y,bgMagentaBright:Y,bgCyanBright:Y,bgWhiteBright:Y}};go.exports=Il();go.exports.createColors=Il});var bo=ee(()=>{});var Tr=ee((pS,Gl)=>{"use strict";var Ol=Pl(),Hl=bo(),wn=class e extends Error{constructor(t,n,r,i,o,a){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),i&&(this.source=i),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=Ol.isColorSupported);let r=c=>c,i=c=>c,o=c=>c;if(t){let{bold:c,gray:m,red:f}=Ol.createColors(!0);i=g=>c(f(g)),r=g=>m(g),Hl&&(o=g=>Hl(g))}let a=n.split(/\r?\n/),l=Math.max(this.line-3,0),s=Math.min(this.line+2,a.length),u=String(s).length;return a.slice(l,s).map((c,m)=>{let f=l+1+m,g=" "+(" "+f).slice(-u)+" | ";if(f===this.line){if(c.length>160){let v=20,y=Math.max(0,this.column-v),_=Math.max(this.column+v,this.endColumn+v),R=c.slice(y,_),T=r(g.replace(/\d/g," "))+c.slice(0,Math.min(this.column-1,v-1)).replace(/[^\t]/g," ");return i(">")+r(g)+o(R)+`
|
|
2
|
+
`+T+i("^")}let x=r(g.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(g)+o(c)+`
|
|
3
|
+
`+x+i("^")}return" "+r(g)+o(c)}).join(`
|
|
4
4
|
`)}toString(){let t=this.showSourceCode();return t&&(t=`
|
|
5
5
|
|
|
6
6
|
`+t+`
|
|
7
|
-
`),this.name+": "+this.message+t}};
|
|
7
|
+
`),this.name+": "+this.message+t}};Gl.exports=wn;wn.default=wn});var xo=ee((hS,Ul)=>{"use strict";var Qp=/(<)(\/?style\b)/gi,Zp=/(<)(!--)/g;function ut(e){return typeof e!="string"||!e.includes("<")?e:e.replace(Qp,"\\3c $2").replace(Zp,"\\3c $2")}var Bl={after:`
|
|
8
8
|
`,beforeClose:`
|
|
9
9
|
`,beforeComment:`
|
|
10
10
|
`,beforeDecl:`
|
|
11
11
|
`,beforeOpen:" ",beforeRule:`
|
|
12
|
-
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function
|
|
13
|
-
`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(
|
|
12
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function e0(e){return e[0].toUpperCase()+e.slice(1)}var _n=class{constructor(t){this.builder=t}atrule(t,n){let r=t.raws,i="@"+t.name,o=t.params?this.rawValue(t,"params"):"";if(typeof r.afterName<"u"?i+=r.afterName:o&&(i+=" "),t.nodes)this.block(t,i+o);else{let a=(r.between||"")+(n?";":"");this.builder(ut(i+o+a),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 i=t.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(`
|
|
13
|
+
`)){let a=this.raw(t,null,"indent");if(a.length)for(let l=0;l<o;l++)r+=a}return r}block(t,n){let r=this.raw(t,"between","beforeOpen");this.builder(ut(n+r)+"{",t,"start");let i;t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(ut(i)),this.builder("}",t,"end")}body(t){let n=t.nodes,r=n.length-1;for(;r>0&&n[r].type==="comment";)r-=1;let i=this.raw(t,"semicolon"),o=t.type==="document";for(let a=0;a<n.length;a++){let l=n[a],s=this.raw(l,"before");s&&this.builder(o?s:ut(s)),this.stringify(l,r!==a||i)}}comment(t){let n=this.raw(t,"left","commentLeft"),r=this.raw(t,"right","commentRight");this.builder(ut("/*"+n+t.text+r+"*/"),t)}decl(t,n){let r=t.raws,i=this.raw(t,"between","colon"),o=t.prop+i+this.rawValue(t,"value");t.important&&(o+=r.important||" !important"),n&&(o+=";"),this.builder(ut(o),t)}document(t){this.body(t)}raw(t,n,r){let i;if(r||(r=n),n&&(i=t.raws[n],typeof i<"u"))return i;let o=t.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===t||o&&o.type==="document"))return"";if(!o)return Bl[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"+e0(r);this[s]?i=this[s](a,t):a.walk(u=>{if(i=u.raws[n],typeof i<"u")return!1})}return typeof i>"u"&&(i=Bl[r]),l[r]=i,i}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(`
|
|
14
14
|
`)&&(n=n.replace(/[^\n]+$/,"")),!1}),n&&(n=n.replace(/\S/g,"")),n}rawBeforeComment(t,n){let r;return t.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
15
15
|
`)&&(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(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
|
|
16
16
|
`)&&(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(`
|
|
17
17
|
`)&&(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 i=r.parent;if(i&&i!==t&&i.parent&&i.parent===t&&typeof r.raws.before<"u"){let o=r.raws.before.split(`
|
|
18
|
-
`);return n=o[o.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],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:
|
|
19
|
-
`?(n=1,r+=1):n+=1}return i}var
|
|
20
|
-
`?(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:Je(n,this.source.start)},i=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:Je(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Je(n,this.source.start),Je(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Je(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:Je(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new Dm().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 i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);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={},i=n==null;n=n||new Map;let o=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let l=this[a];if(Array.isArray(l))r[a]=l.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof l=="object"&&l.toJSON)r[a]=l.toJSON(null,n);else if(a==="source"){if(l==null)continue;let s=n.get(l.input);s==null&&(s=o,n.set(l.input,o),o++),r[a]={end:l.end,inputId:s,start:l.start}}else r[a]=l}return i&&(r.inputs=[...n.keys()].map(a=>a.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=Im){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Js.exports=gn;gn.default=gn});var yn=Z((by,Qs)=>{"use strict";var Om=xn(),bn=class extends Om{constructor(t){super(t),this.type="comment"}};Qs.exports=bn;bn.default=bn});var vn=Z((yy,Zs)=>{"use strict";var Gm=xn(),Sn=class extends Gm{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"}};Zs.exports=Sn;Sn.default=Sn});var at=Z((Sy,ll)=>{"use strict";var el=yn(),tl=vn(),Hm=xn(),{isClean:nl,my:rl}=ar(),Yi,il,ol,Xi;function al(e){return e.map(t=>(t.nodes&&(t.nodes=al(t.nodes)),delete t.source,t))}function sl(e){if(e[nl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)sl(t)}var Ue=class e extends Hm{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 i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}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(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):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),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)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+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=al(il(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"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 tl(t)]}else if(t.selector||t.selectors)t=[new Xi(t)];else if(t.name)t=[new Yi(t)];else if(t.text)t=[new el(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[rl]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[nl]&&sl(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}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,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};Ue.registerParse=e=>{il=e};Ue.registerRule=e=>{Xi=e};Ue.registerAtRule=e=>{Yi=e};Ue.registerRoot=e=>{ol=e};ll.exports=Ue;Ue.default=Ue;Ue.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Yi.prototype):e.type==="rule"?Object.setPrototypeOf(e,Xi.prototype):e.type==="decl"?Object.setPrototypeOf(e,tl.prototype):e.type==="comment"?Object.setPrototypeOf(e,el.prototype):e.type==="root"&&Object.setPrototypeOf(e,ol.prototype),e[rl]=!0,e.nodes&&e.nodes.forEach(t=>{Ue.rebuild(t)})}});var sr=Z((vy,cl)=>{"use strict";var ul=at(),It=class extends ul{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)}};cl.exports=It;It.default=It;ul.registerAtRule(It)});var lr=Z((Ey,ml)=>{"use strict";var Bm=at(),dl,fl,xt=class extends Bm{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new dl(new fl,this,t).stringify()}};xt.registerLazyResult=e=>{dl=e};xt.registerProcessor=e=>{fl=e};ml.exports=xt;xt.default=xt});var hl=Z((Cy,pl)=>{var Um="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Wm=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},Vm=(e=21)=>{let t="",n=e|0;for(;n--;)t+=Um[Math.random()*64|0];return t};pl.exports={nanoid:Vm,customAlphabet:Wm}});var ur=Z(()=>{});var cr=Z(()=>{});var Ji=Z(()=>{});var gl=Z(()=>{});var Zi=Z((ky,yl)=>{"use strict";var{existsSync:zm,readFileSync:$m}=gl(),{dirname:Qi,join:qm}=ur(),{SourceMapConsumer:xl,SourceMapGenerator:bl}=cr();function jm(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var En=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,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=Qi(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new xl(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return jm(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()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!(!r&&!this.unsafeMap&&!/\.map$/i.test(t))&&(this.root=Qi(t),zm(t)))return this.mapFile=t,$m(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 i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof xl)return bl.fromSourceMap(n).toString();if(n instanceof bl)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=qm(Qi(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};yl.exports=En;En.default=En});var Cn=Z((My,_l)=>{"use strict";var{nanoid:Km}=hl(),{isAbsolute:no,resolve:ro}=ur(),{SourceMapConsumer:Ym,SourceMapGenerator:Xm}=cr(),{fileURLToPath:Sl,pathToFileURL:dr}=Ji(),vl=or(),Jm=Zi(),eo=zi(),to=Symbol("lineToIndexCache"),Qm=!!(Ym&&Xm),El=!!(ro&&no);function Cl(e){if(e[to])return e[to];let t=e.css.split(`
|
|
21
|
-
`),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[
|
|
22
|
-
`," "];return
|
|
18
|
+
`);return n=o[o.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],i=t.raws[n];return i&&i.value===r?i.raw:r}root(t){if(this.body(t),t.raws.after){let n=t.raws.after,r=t.parent&&t.parent.type==="document";this.builder(r?n:ut(n))}}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(ut(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)}};Ul.exports=_n;_n.default=_n});var Tn=ee((gS,Wl)=>{"use strict";var t0=xo();function yo(e,t){new t0(t).stringify(e)}Wl.exports=yo;yo.default=yo});var Rr=ee((bS,So)=>{"use strict";So.exports.isClean=Symbol("isClean");So.exports.my=Symbol("my")});var Fn=ee((xS,Vl)=>{"use strict";var n0=Tr(),r0=xo(),i0=Tn(),{isClean:Rn,my:o0}=Rr();function vo(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r==="proxyCache")continue;let i=e[r],o=typeof i;r==="parent"&&o==="object"?t&&(n[r]=t):r==="source"?n[r]=i:Array.isArray(i)?n[r]=i.map(a=>vo(a,n)):(o==="object"&&i!==null&&(i=vo(i)),n[r]=i)}return n}function Ze(e,t){if(t&&typeof t.offset<"u")return t.offset;let n=1,r=1,i=0;for(let o=0;o<e.length;o++){if(r===t.line&&n===t.column){i=o;break}e[o]===`
|
|
19
|
+
`?(n=1,r+=1):n+=1}return i}var kn=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[Rn]=!1,this[o0]=!0;for(let n in t)if(n==="nodes"){this.nodes=[];for(let r of t[n])typeof r.clone=="function"?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=vo(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:i}=this.rangeBy(n);return this.source.input.error(t,{column:i.column,line:i.line},{column:r.column,line:r.line},n)}return new n0(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[Rn]=!0}markDirty(){if(this[Rn]){this[Rn]=!1;let t=this;for(;t=t.parent;)t[Rn]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let n=this.source.start;if(t.index)n=this.positionInside(t.index);else if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,o=r.slice(Ze(r,this.source.start),Ze(r,this.source.end)).indexOf(t.word);o!==-1&&(n=this.positionInside(o))}return n}positionInside(t){let n=this.source.start.column,r=this.source.start.line,i="document"in this.source.input?this.source.input.document:this.source.input.css,o=Ze(i,this.source.start),a=o+t;for(let l=o;l<a;l++)i[l]===`
|
|
20
|
+
`?(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:Ze(n,this.source.start)},i=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:Ze(n,this.source.end)+1}:{column:r.column+1,line:r.line,offset:r.offset+1};if(t.word){let a=n.slice(Ze(n,this.source.start),Ze(n,this.source.end)).indexOf(t.word);a!==-1&&(r=this.positionInside(a),i=this.positionInside(a+t.word.length))}else t.start?r={column:t.start.column,line:t.start.line,offset:Ze(n,t.start)}:t.index&&(r=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line,offset:Ze(n,t.end)}:typeof t.endIndex=="number"?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<r.line||i.line===r.line&&i.column<=r.column)&&(i={column:r.column+1,line:r.line,offset:r.offset+1}),{end:i,start:r}}raw(t,n){return new r0().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 i of t)i===this?r=!0:r?(this.parent.insertAfter(n,i),n=i):this.parent.insertBefore(n,i);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={},i=n==null;n=n||new Map;let o=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let l=this[a];if(Array.isArray(l))r[a]=l.map(s=>typeof s=="object"&&s.toJSON?s.toJSON(null,n):s);else if(typeof l=="object"&&l.toJSON)r[a]=l.toJSON(null,n);else if(a==="source"){if(l==null)continue;let s=n.get(l.input);s==null&&(s=o,n.set(l.input,o),o++),r[a]={end:l.end,inputId:s,start:l.start}}else r[a]=l}return i&&(r.inputs=[...n.keys()].map(a=>a.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=i0){t.stringify&&(t=t.stringify);let n="";return t(this,r=>{n+=r}),n}warn(t,n,r={}){let i={node:this};for(let o in r)i[o]=r[o];return t.warn(n,i)}};Vl.exports=kn;kn.default=kn});var Nn=ee((yS,zl)=>{"use strict";var a0=Fn(),Mn=class extends a0{constructor(t){super(t),this.type="comment"}};zl.exports=Mn;Mn.default=Mn});var Dn=ee((SS,ql)=>{"use strict";var s0=Fn(),Ln=class extends s0{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"}};ql.exports=Ln;Ln.default=Ln});var ct=ee((vS,eu)=>{"use strict";var $l=Nn(),jl=Dn(),l0=Fn(),{isClean:Kl,my:Yl}=Rr(),Eo,Xl,Jl,Ao;function Ql(e){return e.map(t=>(t.nodes&&(t.nodes=Ql(t.nodes)),delete t.source,t))}function Zl(e){if(e[Kl]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Zl(t)}var We=class e extends l0{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 i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let n of this.nodes)n.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let n=this.getIterator(),r,i;for(;this.indexes[n]<this.proxyOf.nodes.length&&(r=this.indexes[n],i=t(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[n]+=1;return delete this.indexes[n],i}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(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):n==="every"||n==="some"?r=>t[n]((i,...o)=>r(i.toProxy(),...o)):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),i=this.normalize(n,this.proxyOf.nodes[r]).reverse();r=this.index(t);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(t,n){let r=this.index(t),i=r===0?"prepend":!1,o=this.normalize(n,this.proxyOf.nodes[r],i).reverse();r=this.index(t);for(let l of o)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+o.length);return this.markDirty(),this}normalize(t,n){if(typeof t=="string")t=Ql(Xl(t).nodes);else if(typeof t>"u")t=[];else if(Array.isArray(t)){t=t.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"ignore")}else if(t.type==="root"&&this.type!=="document"){t=t.nodes.slice(0);for(let i of t)i.parent&&i.parent.removeChild(i,"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 jl(t)]}else if(t.selector||t.selectors)t=[new Ao(t)];else if(t.name)t=[new Eo(t)];else if(t.text)t=[new $l(t)];else throw new Error("Unknown node type in node creation");return t.map(i=>(i[Yl]||e.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Kl]&&Zl(i),i.raws||(i.raws={}),typeof i.raws.before>"u"&&n&&typeof n.raws.before<"u"&&(i.raws.before=n.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...t){t=t.reverse();for(let n of t){let r=this.normalize(n,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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(i=>{n.props&&!n.props.includes(i.prop)||n.fast&&!i.value.includes(n.fast)||(i.value=i.value.replace(t,r))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((n,r)=>{let i;try{i=t(n,r)}catch(o){throw n.addToError(o)}return i!==!1&&n.walk&&(i=n.walk(t)),i})}walkAtRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&t.test(r.name))return n(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="atrule")return n(r,i)}))}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,i)=>{if(r.type==="decl"&&t.test(r.prop))return n(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="decl")return n(r,i)}))}walkRules(t,n){return n?t instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&t.test(r.selector))return n(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===t)return n(r,i)}):(n=t,this.walk((r,i)=>{if(r.type==="rule")return n(r,i)}))}};We.registerParse=e=>{Xl=e};We.registerRule=e=>{Ao=e};We.registerAtRule=e=>{Eo=e};We.registerRoot=e=>{Jl=e};eu.exports=We;We.default=We;We.rebuild=e=>{e.type==="atrule"?Object.setPrototypeOf(e,Eo.prototype):e.type==="rule"?Object.setPrototypeOf(e,Ao.prototype):e.type==="decl"?Object.setPrototypeOf(e,jl.prototype):e.type==="comment"?Object.setPrototypeOf(e,$l.prototype):e.type==="root"&&Object.setPrototypeOf(e,Jl.prototype),e[Yl]=!0,e.nodes&&e.nodes.forEach(t=>{We.rebuild(t)})}});var kr=ee((ES,nu)=>{"use strict";var tu=ct(),Wt=class extends tu{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)}};nu.exports=Wt;Wt.default=Wt;tu.registerAtRule(Wt)});var Fr=ee((AS,ou)=>{"use strict";var u0=ct(),ru,iu,vt=class extends u0{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new ru(new iu,this,t).stringify()}};vt.registerLazyResult=e=>{ru=e};vt.registerProcessor=e=>{iu=e};ou.exports=vt;vt.default=vt});var su=ee((CS,au)=>{var c0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",d0=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r},f0=(e=21)=>{let t="",n=e|0;for(;n--;)t+=c0[Math.random()*64|0];return t};au.exports={nanoid:f0,customAlphabet:d0}});var Mr=ee(()=>{});var Nr=ee(()=>{});var Co=ee(()=>{});var lu=ee(()=>{});var _o=ee((LS,du)=>{"use strict";var{existsSync:m0,readFileSync:p0}=lu(),{dirname:wo,join:h0}=Mr(),{SourceMapConsumer:uu,SourceMapGenerator:cu}=Nr();function g0(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}var In=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,i=this.loadMap(n.from,r);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=wo(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new uu(this.json||this.text)),this.consumerCache}decodeInline(t){let n=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/,a=t.match(i)||t.match(o);if(a)return decodeURIComponent(t.substr(a[0].length));let l=t.match(n)||t.match(r);if(l)return g0(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()),i=t.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(t.substring(r,i)))}loadFile(t,n,r){if(!(!r&&!this.unsafeMap&&!/\.map$/i.test(t))&&(this.root=wo(t),m0(t)))return this.mapFile=t,p0(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 i=this.loadFile(r,t,!0);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(n instanceof uu)return cu.fromSourceMap(n).toString();if(n instanceof cu)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=h0(wo(t),r));let i=this.loadFile(r,t,!1);if(i)try{this.json=JSON.parse(i.replace(/^\)]}'[^\n]*\n/,""))}catch{return}return i}}}startWith(t,n){return t?t.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};du.exports=In;In.default=In});var Pn=ee((DS,gu)=>{"use strict";var{nanoid:b0}=su(),{isAbsolute:ko,resolve:Fo}=Mr(),{SourceMapConsumer:x0,SourceMapGenerator:y0}=Nr(),{fileURLToPath:fu,pathToFileURL:Lr}=Co(),mu=Tr(),S0=_o(),To=bo(),Ro=Symbol("lineToIndexCache"),v0=!!(x0&&y0),pu=!!(Fo&&ko);function hu(e){if(e[Ro])return e[Ro];let t=e.css.split(`
|
|
21
|
+
`),n=new Array(t.length),r=0;for(let i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;return e[Ro]=n,n}var Vt=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&&(!pu||/^\w+:\/\//.test(n.from)||ko(n.from)?this.file=n.from:this.file=Fo(n.from)),pu&&v0){let r=new S0(this.css,n);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+b0(6)+">"),this.map&&(this.map.file=this.from)}error(t,n,r,i={}){let o,a,l,s,u;if(n&&typeof n=="object"){let m=n,f=r;if(typeof m.offset=="number"){s=m.offset;let g=this.fromOffset(s);n=g.line,r=g.col}else n=m.line,r=m.column,s=this.fromLineAndColumn(n,r);if(typeof f.offset=="number"){l=f.offset;let g=this.fromOffset(l);a=g.line,o=g.col}else a=f.line,o=f.column,l=this.fromLineAndColumn(f.line,f.column)}else if(r)s=this.fromLineAndColumn(n,r);else{s=n;let m=this.fromOffset(s);n=m.line,r=m.col}let c=this.origin(n,r,a,o);return c?u=new mu(t,c.endLine===void 0?c.line:{column:c.column,line:c.line},c.endLine===void 0?c.column:{column:c.endColumn,line:c.endLine},c.source,c.file,i.plugin):u=new mu(t,a===void 0?n:{column:r,line:n},a===void 0?r:{column:o,line:a},this.css,this.file,i.plugin),u.input={column:r,endColumn:o,endLine:a,endOffset:l,line:n,offset:s,source:this.css},this.file&&(Lr&&(u.input.url=Lr(this.file).toString()),u.input.file=this.file),u}fromLineAndColumn(t,n){return hu(this)[t-1]+n-1}fromOffset(t){let n=hu(this),r=n[n.length-1],i=0;if(t>=r)i=n.length-1;else{let o=n.length-2,a;for(;i<o;)if(a=i+(o-i>>1),t<n[a])o=a-1;else if(t>=n[a+1])i=a+1;else{i=a;break}}return{col:t-n[i]+1,line:i+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Fo(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,n,r,i){if(!this.map)return!1;let o=this.map.consumer(),a=o.originalPositionFor({column:n,line:t});if(!a.source)return!1;let l;typeof r=="number"&&(l=o.originalPositionFor({column:i,line:r}));let s;ko(a.source)?s=Lr(a.source):s=new URL(a.source,this.map.consumer().sourceRoot||Lr(this.map.mapFile));let u={column:a.column,endColumn:l&&l.column,endLine:l&&l.line,line:a.line,url:s.toString()};if(s.protocol==="file:")if(fu)u.file=fu(s);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(a.source);return c&&(u.source=c),u}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}};gu.exports=Vt;Vt.default=Vt;To&&To.registerInput&&To.registerInput(Vt)});var zt=ee((IS,Su)=>{"use strict";var bu=ct(),xu,yu,dt=class extends bu{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,n,r){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 o of i)o.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 xu(new yu,this,t).stringify()}};dt.registerLazyResult=e=>{xu=e};dt.registerProcessor=e=>{yu=e};Su.exports=dt;dt.default=dt;bu.registerRoot(dt)});var Mo=ee((PS,vu)=>{"use strict";var On={comma(e){return On.split(e,[","],!0)},space(e){let t=[" ",`
|
|
22
|
+
`," "];return On.split(e,t)},split(e,t,n){let r=[],i="",o=!1,a=0,l=!1,s="",u=!1;for(let c of e)u?u=!1:c==="\\"?u=!0:l?c===s&&(l=!1):c==='"'||c==="'"?(l=!0,s=c):c==="("?a+=1:c===")"?a>0&&(a-=1):a===0&&t.includes(c)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=c;return(n||i!=="")&&r.push(i.trim()),r}};vu.exports=On;On.default=On});var Dr=ee((OS,Au)=>{"use strict";var Eu=ct(),E0=Mo(),qt=class extends Eu{get selectors(){return E0.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=[])}};Au.exports=qt;qt.default=qt;Eu.registerRule(qt)});var wu=ee((HS,Cu)=>{"use strict";var A0=kr(),C0=Nn(),w0=Dn(),_0=Pn(),T0=_o(),R0=zt(),k0=Dr();function Hn(e,t){if(Array.isArray(e))return e.map(i=>Hn(i));let{inputs:n,...r}=e;if(n){t=[];for(let i of n){let o={...i,__proto__:_0.prototype};o.map&&(o.map={...o.map,__proto__:T0.prototype}),t.push(o)}}if(r.nodes&&(r.nodes=e.nodes.map(i=>Hn(i,t))),r.source){let{inputId:i,...o}=r.source;r.source=o,i!=null&&(r.source.input=t[i])}if(r.type==="root")return new R0(r);if(r.type==="decl")return new w0(r);if(r.type==="rule")return new k0(r);if(r.type==="comment")return new C0(r);if(r.type==="atrule")return new A0(r);throw new Error("Unknown node type: "+e.type)}Cu.exports=Hn;Hn.default=Hn});var Lo=ee((GS,Mu)=>{"use strict";var{dirname:Ir,relative:Tu,resolve:Ru,sep:ku}=Mr(),{SourceMapConsumer:Fu,SourceMapGenerator:Pr}=Nr(),{pathToFileURL:_u}=Co(),F0=Pn(),M0=!!(Fu&&Pr),N0=!!(Ir&&Ru&&Tu&&ku),No=class{constructor(t,n,r,i){this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,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=`
|
|
23
23
|
`;this.css.includes(`\r
|
|
24
24
|
`)&&(n=`\r
|
|
25
|
-
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||
|
|
26
|
-
`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),
|
|
27
|
-
`),n=l.length-o):n+=l.length,s&&u!=="start"){let c=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==c.last||c.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}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?mr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=mr(Pl(r,this.mapOpts.annotation)));let i=Il(r,t);return this.memoizedPaths.set(t,i),i}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 sp(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,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(Dl){let r=Dl(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;Ol==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};Hl.exports=oo});var Wl=Z((Hy,Ul)=>{"use strict";var hr=/[\t\n\f\r "#'()/;[\\\]{}]/g,gr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,cp=/.[\r\n"'(/\\]/,Bl=/[\da-f]/i;Ul.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,m,f,x,v,C=r.length,y=0,w=[],T=[],k=-1;function D(){return y}function P(A){throw t.error("Unclosed "+A,y)}function _(){return T.length===0&&y>=C}function b(A){if(T.length)return T.pop();if(y>=C)return;let R=A?A.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case 10:case 32:case 9:case 13:case 12:{s=y;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(y,s)],y=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let N=String.fromCharCode(o);c=[N,N,y];break}case 40:{if(v=w.length?w.pop()[1]:"",x=r.charCodeAt(y+1),v==="url"&&x!==39&&x!==34&&x!==32&&x!==10&&x!==9&&x!==12&&x!==13){s=y;do{if(m=!1,s=r.indexOf(")",s+1),s===-1)if(i||R){s=y;break}else P("bracket");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["brackets",r.slice(y,s+1),y,s],y=s}else y<=k?c=["(","(",y]:(s=r.indexOf(")",y+1),a=r.slice(y,s+1),s===-1||cp.test(a)?(k=s===-1?C:s,c=["(","(",y]):(c=["brackets",a,y,s],y=s));break}case 39:case 34:{u=o===39?"'":'"',s=y;do{if(m=!1,s=r.indexOf(u,s+1),s===-1)if(i||R){s=y+1;break}else P("string");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["string",r.slice(y,s+1),y,s],y=s;break}case 64:{hr.lastIndex=y+1,hr.test(r),hr.lastIndex===0?s=r.length-1:s=hr.lastIndex-2,c=["at-word",r.slice(y,s+1),y,s],y=s;break}case 92:{for(s=y,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,Bl.test(r.charAt(s)))){for(;Bl.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===47&&r.charCodeAt(y+1)===42?(s=r.indexOf("*/",y+2)+1,s===0&&(i||R?s=r.length:P("comment")),c=["comment",r.slice(y,s+1),y,s],y=s):(gr.lastIndex=y+1,gr.test(r),gr.lastIndex===0?s=r.length-1:s=gr.lastIndex-2,c=["word",r.slice(y,s+1),y,s],w.push(c),y=s);break}}return y++,c}function S(A){T.push(A)}return{back:S,endOfFile:_,nextToken:b,position:D}}});var ql=Z((By,$l)=>{"use strict";var dp=sr(),fp=yn(),mp=vn(),pp=Ot(),Vl=fr(),hp=Wl(),zl={empty:!0,space:!0};function gp(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var so=class{constructor(t){this.input=t,this.root=new pp,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 dp;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.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(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[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,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new fp;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 i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=hp(this.input)}decl(t,n){let r=new mp;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||gp(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],l;for(;t.length&&(l=t[0][0],!(l!=="space"&&l!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),m="";for(let f=u;f>0;f--){let x=c[f][0];if(m.trim().startsWith("!")&&x!=="space")break;m=c.pop()[1]+m}m.trim().startsWith("!")&&(r.important=!0,r.raws.important=m,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=a.map(u=>u[1]).join(""),a=[]),this.raw(r,"value",a.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 Vl;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+=n.raws.ownSemicolon.length)}}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,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){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===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="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,i){let o,a,l=r.length,s="",u=!0,c,m;for(let f=0;f<l;f+=1)o=r[f],a=o[0],a==="space"&&f===l-1&&!i?u=!1:a==="comment"?(m=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!zl[m]&&!zl[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let f=r.reduce((x,v)=>x+v[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Vl;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 i=n;i<t.length;i++)r+=t[i][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})}};$l.exports=so});var br=Z((Uy,jl)=>{"use strict";var xp=at(),bp=Cn(),yp=ql();function xr(e,t){let n=new bp(e,t),r=new yp(n);try{r.parse()}catch(i){throw i}return r.root}jl.exports=xr;xr.default=xr;xp.registerParse(xr)});var lo=Z((Wy,Kl)=>{"use strict";var wn=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){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}};Kl.exports=wn;wn.default=wn});var yr=Z((Vy,Yl)=>{"use strict";var Sp=lo(),Tn=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 Sp(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Yl.exports=Tn;Tn.default=Tn});var uo=Z((zy,Jl)=>{"use strict";var Xl={};Jl.exports=function(t){Xl[t]||(Xl[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var mo=Z((qy,tu)=>{"use strict";var vp=at(),Ep=lr(),Cp=ao(),_p=br(),Ql=yr(),Ap=Ot(),wp=pn(),{isClean:Ke,my:Tp}=ar(),$y=uo(),Rp={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Fp={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},Lp={Once:!0,postcssPlugin:!0,prepare:!0},Ht=0;function Rn(e){return typeof e=="object"&&typeof e.then=="function"}function eu(e){let t=!1,n=Rp[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,Ht,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,Ht,n+"Exit"]:[n,n+"Exit"]}function Zl(e){let t;return e.type==="document"?t=["Document",Ht,"DocumentExit"]:e.type==="root"?t=["Root",Ht,"RootExit"]:t=eu(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function co(e){return e[Ke]=!1,e.nodes&&e.nodes.forEach(t=>co(t)),e}var fo={},lt=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 i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=co(n);else if(n instanceof e||n instanceof Ql)i=co(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=_p;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[Tp]&&vp.rebuild(i)}this.result=new Ql(t,i,r),this.helpers={...fo,postcss:fo,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!Fp[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Lp[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);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(Rn(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];){t[Ke]=!0;let n=[Zl(t)];for(;n.length>0;){let r=this.visitTick(n);if(Rn(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}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 Rn(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=wp;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 o=new Cp(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[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(Rn(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ke];)t[Ke]=!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,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Rn(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.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,l;for(;l=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!l[Ke]){l[Ke]=!0,t.push(Zl(l));return}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===Ht){r.nodes&&r.nodes.length&&(r[Ke]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ke]=!0;let n=eu(t);for(let r of n)if(r===Ht)t.nodes&&t.each(i=>{i[Ke]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};lt.registerPostcss=e=>{fo=e};tu.exports=lt;lt.default=lt;Ap.registerLazyResult(lt);Ep.registerLazyResult(lt)});var ru=Z((Ky,nu)=>{"use strict";var Np=ao(),kp=br(),Mp=yr(),Dp=pn(),jy=uo(),Fn=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=kp;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 i=Dp;this.result=new Mp(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Np(i,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[]}};nu.exports=Fn;Fn.default=Fn});var ou=Z((Yy,iu)=>{"use strict";var Ip=lr(),Pp=mo(),Op=ru(),Gp=Ot(),bt=class{constructor(t=[]){this.version="8.5.14",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 Op(this,t,n):new Pp(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};iu.exports=bt;bt.default=bt;Gp.registerProcessor(bt);Ip.registerProcessor(bt)});var mu=Z((Xy,fu)=>{"use strict";var au=sr(),su=yn(),Hp=at(),Bp=or(),lu=vn(),uu=lr(),Up=Ml(),Wp=Cn(),Vp=mo(),zp=io(),$p=xn(),qp=br(),po=ou(),jp=yr(),cu=Ot(),du=fr(),Kp=pn(),Yp=lo();function le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new po(e)}le.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
25
|
+
`),this.css+=n+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let n=this.toUrl(this.path(t.file)),r=t.root||Ir(t.file),i;this.mapOpts.sourcesContent===!1?(i=new Fu(t.text),i.sourcesContent&&(i.sourcesContent=null)):i=t.consumer(),this.map.applySourceMap(i,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;for(;(t=this.css.lastIndexOf("/*#"))!==-1;){let n=this.css.indexOf("*/",t+3);if(n===-1)break;for(;t>0&&this.css[t-1]===`
|
|
26
|
+
`;)t--;this.css=this.css.slice(0,t)+this.css.slice(n+2)}}}}generate(){if(this.clearAnnotation(),N0&&M0&&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=Pr.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Pr({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 Pr({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,n=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,a;this.stringify(this.root,(l,s,u)=>{if(this.css+=l,s&&u!=="end"&&(i.generated.line=t,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=l.match(/\n/g),a?(t+=a.length,o=l.lastIndexOf(`
|
|
27
|
+
`),n=l.length-o):n+=l.length,s&&u!=="start"){let c=s.parent||{raws:{}};(!(s.type==="decl"||s.type==="atrule"&&!s.nodes)||s!==c.last||c.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=t,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=t,i.generated.column=n-1,this.map.addMapping(i)))}})}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?Ir(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ir(Ru(r,this.mapOpts.annotation)));let i=Tu(r,t);return this.memoizedPaths.set(t,i),i}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 F0(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,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(_u){let r=_u(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;ku==="\\"&&(t=t.replace(/\\/g,"/"));let r=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,r),r}};Mu.exports=No});var Du=ee((BS,Lu)=>{"use strict";var Or=/[\t\n\f\r "#'()/;[\\\]{}]/g,Hr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,L0=/.[\r\n"'(/\\]/,Nu=/[\da-f]/i;Lu.exports=function(t,n={}){let r=t.css.valueOf(),i=n.ignoreErrors,o,a,l,s,u,c,m,f,g,x,v=r.length,y=0,_=[],R=[],T=-1;function F(){return y}function D(w){throw t.error("Unclosed "+w,y)}function C(){return R.length===0&&y>=v}function S(w){if(R.length)return R.pop();if(y>=v)return;let k=w?w.ignoreUnclosed:!1;switch(o=r.charCodeAt(y),o){case 10:case 32:case 9:case 13:case 12:{s=y;do s+=1,o=r.charCodeAt(s);while(o===32||o===10||o===9||o===13||o===12);c=["space",r.slice(y,s)],y=s-1;break}case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let L=String.fromCharCode(o);c=[L,L,y];break}case 40:{if(x=_.length?_.pop()[1]:"",g=r.charCodeAt(y+1),x==="url"&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){s=y;do{if(m=!1,s=r.indexOf(")",s+1),s===-1)if(i||k){s=y;break}else D("bracket");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["brackets",r.slice(y,s+1),y,s],y=s}else y<=T?c=["(","(",y]:(s=r.indexOf(")",y+1),a=r.slice(y,s+1),s===-1||L0.test(a)?(T=s===-1?v:s,c=["(","(",y]):(c=["brackets",a,y,s],y=s));break}case 39:case 34:{u=o===39?"'":'"',s=y;do{if(m=!1,s=r.indexOf(u,s+1),s===-1)if(i||k){s=y+1;break}else D("string");for(f=s;r.charCodeAt(f-1)===92;)f-=1,m=!m}while(m);c=["string",r.slice(y,s+1),y,s],y=s;break}case 64:{Or.lastIndex=y+1,Or.test(r),Or.lastIndex===0?s=r.length-1:s=Or.lastIndex-2,c=["at-word",r.slice(y,s+1),y,s],y=s;break}case 92:{for(s=y,l=!0;r.charCodeAt(s+1)===92;)s+=1,l=!l;if(o=r.charCodeAt(s+1),l&&o!==47&&o!==32&&o!==10&&o!==9&&o!==13&&o!==12&&(s+=1,Nu.test(r.charAt(s)))){for(;Nu.test(r.charAt(s+1));)s+=1;r.charCodeAt(s+1)===32&&(s+=1)}c=["word",r.slice(y,s+1),y,s],y=s;break}default:{o===47&&r.charCodeAt(y+1)===42?(s=r.indexOf("*/",y+2)+1,s===0&&(i||k?s=r.length:D("comment")),c=["comment",r.slice(y,s+1),y,s],y=s):(Hr.lastIndex=y+1,Hr.test(r),Hr.lastIndex===0?s=r.length-1:s=Hr.lastIndex-2,c=["word",r.slice(y,s+1),y,s],_.push(c),y=s);break}}return y++,c}function E(w){R.push(w)}return{back:E,endOfFile:C,nextToken:S,position:F}}});var Hu=ee((US,Ou)=>{"use strict";var D0=kr(),I0=Nn(),P0=Dn(),O0=zt(),Iu=Dr(),H0=Du(),Pu={empty:!0,space:!0};function G0(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}var Do=class{constructor(t){this.input=t,this.root=new O0,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 D0;n.name=t[1].slice(1),n.name===""&&this.unnamedAtrule(n,t),this.init(n,t[2]);let r,i,o,a=!1,l=!1,s=[],u=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),r=t[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.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(o=s.length-1,i=s[o];i&&i[0]==="space";)i=s[--o];i&&(n.source.end=this.getPosition(i[3]||i[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,i;for(let o=n-1;o>=0&&(i=t[o],!(i[0]!=="space"&&(r+=1,r===2)));o--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(t){let n=0,r,i,o;for(let[a,l]of t.entries()){if(i=l,o=i[0],o==="("&&(n+=1),o===")"&&(n-=1),n===0&&o===":")if(!r)this.doubleColon(i);else{if(r[0]==="word"&&r[1]==="progid")continue;return a}r=i}return!1}comment(t){let n=new I0;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 i=r.match(/^(\s*)([^]*\S)(\s*)$/);n.text=i[2],n.raws.left=i[1],n.raws.right=i[3]}}createTokenizer(){this.tokenizer=H0(this.input)}decl(t,n){let r=new P0;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===";"&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||G0(t)),r.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop="";t.length;){let u=t[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=t.shift()[1]}r.raws.between="";let o;for(;t.length;)if(o=t.shift(),o[0]===":"){r.raws.between+=o[1];break}else o[0]==="word"&&/\w/.test(o[1])&&this.unknownWord([o]),r.raws.between+=o[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let a=[],l;for(;t.length&&(l=t[0][0],!(l!=="space"&&l!=="comment"));)a.push(t.shift());this.precheckMissedSemicolon(t);for(let u=t.length-1;u>=0;u--){if(o=t[u],o[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(t,u);c=this.spacesFromEnd(t)+c,c!==" !important"&&(r.raws.important=c);break}else if(o[1].toLowerCase()==="important"){let c=t.slice(0),m="";for(let f=u;f>0;f--){let g=c[f][0];if(m.trim().startsWith("!")&&g!=="space")break;m=c.pop()[1]+m}m.trim().startsWith("!")&&(r.important=!0,r.raws.important=m,t=c)}if(o[0]!=="space"&&o[0]!=="comment")break}t.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=a.map(u=>u[1]).join(""),a=[]),this.raw(r,"value",a.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 Iu;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+=n.raws.ownSemicolon.length)}}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,i=!1,o=null,a=[],l=t[1].startsWith("--"),s=[],u=t;for(;u;){if(r=u[0],s.push(u),r==="("||r==="[")o||(o=u),a.push(r==="("?")":"]");else if(l&&i&&r==="{")o||(o=u),a.push("}");else if(a.length===0)if(r===";")if(i){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===":"&&(i=!0);else r===a[a.length-1]&&(a.pop(),a.length===0&&(o=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),a.length>0&&this.unclosedBracket(o),n&&i){if(!l)for(;s.length&&(u=s[s.length-1][0],!(u!=="space"&&u!=="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,i){let o,a,l=r.length,s="",u=!0,c,m;for(let f=0;f<l;f+=1)o=r[f],a=o[0],a==="space"&&f===l-1&&!i?u=!1:a==="comment"?(m=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Pu[m]&&!Pu[c]?s.slice(-1)===","?u=!1:s+=o[1]:u=!1):s+=o[1];if(!u){let f=r.reduce((g,x)=>g+x[1],"");t.raws[n]={raw:f,value:s}}t[n]=s}rule(t){t.pop();let n=new Iu;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 i=n;i<t.length;i++)r+=t[i][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})}};Ou.exports=Do});var Br=ee((WS,Gu)=>{"use strict";var B0=ct(),U0=Pn(),W0=Hu();function Gr(e,t){let n=new U0(e,t),r=new W0(n);try{r.parse()}catch(i){throw i}return r.root}Gu.exports=Gr;Gr.default=Gr;B0.registerParse(Gr)});var Io=ee((VS,Bu)=>{"use strict";var Gn=class{constructor(t,n={}){if(this.type="warning",this.text=t,n.node&&n.node.source){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}};Bu.exports=Gn;Gn.default=Gn});var Ur=ee((zS,Uu)=>{"use strict";var V0=Io(),Bn=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 V0(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(t=>t.type==="warning")}};Uu.exports=Bn;Bn.default=Bn});var Po=ee((qS,Vu)=>{"use strict";var Wu={};Vu.exports=function(t){Wu[t]||(Wu[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))}});var Go=ee((jS,ju)=>{"use strict";var z0=ct(),q0=Fr(),$0=Lo(),j0=Br(),zu=Ur(),K0=zt(),Y0=Tn(),{isClean:Ye,my:X0}=Rr(),$S=Po(),J0={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Q0={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},Z0={Once:!0,postcssPlugin:!0,prepare:!0},$t=0;function Un(e){return typeof e=="object"&&typeof e.then=="function"}function $u(e){let t=!1,n=J0[e.type];return e.type==="decl"?t=e.prop.toLowerCase():e.type==="atrule"&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,$t,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,$t,n+"Exit"]:[n,n+"Exit"]}function qu(e){let t;return e.type==="document"?t=["Document",$t,"DocumentExit"]:e.type==="root"?t=["Root",$t,"RootExit"]:t=$u(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Oo(e){return e[Ye]=!1,e.nodes&&e.nodes.forEach(t=>Oo(t)),e}var Ho={},ft=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 i;if(typeof n=="object"&&n!==null&&(n.type==="root"||n.type==="document"))i=Oo(n);else if(n instanceof e||n instanceof zu)i=Oo(n.root),n.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let o=j0;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(n,r)}catch(a){this.processed=!0,this.error=a}i&&!i[X0]&&z0.rebuild(i)}this.result=new zu(t,i,r),this.helpers={...Ho,postcss:Ho,result:this.result},this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?{...o,...o.prepare(this.result)}:o)}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(i){console&&console.error&&console.error(i)}return t}prepareVisitors(){this.listeners={};let t=(n,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([n,i])};for(let n of this.plugins)if(typeof n=="object")for(let r in n){if(!Q0[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Z0[r])if(typeof n[r]=="object")for(let i in n[r])i==="*"?t(n,r,n[r][i]):t(n,r+"-"+i.toLowerCase(),n[r][i]);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(Un(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ye];){t[Ye]=!0;let n=[qu(t)];for(;n.length>0;){let r=this.visitTick(n);if(Un(r))try{await r}catch(i){let o=n[n.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[n,r]of this.listeners.OnceExit){this.result.lastPlugin=n;try{if(t.type==="document"){let i=t.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(t,this.helpers)}catch(i){throw this.handleError(i)}}}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 Un(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=Y0;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 o=new $0(n,this.result.root,this.result.opts).generate();return this.result.css=o[0],this.result.map=o[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(Un(n))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ye];)t[Ye]=!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,i]of t){this.result.lastPlugin=r;let o;try{o=i(n,this.helpers)}catch(a){throw this.handleError(a,n.proxyOf)}if(n.type!=="root"&&n.type!=="document"&&!n.parent)return!0;if(Un(o))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!=="root"&&r.type!=="document"&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[a,l]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.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,l;for(;l=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!l[Ye]){l[Ye]=!0,t.push(qu(l));return}n.iterator=0,delete r.indexes[a]}let o=n.events;for(;n.eventIndex<o.length;){let a=o[n.eventIndex];if(n.eventIndex+=1,a===$t){r.nodes&&r.nodes.length&&(r[Ye]=!0,n.iterator=r.getIterator());return}else if(this.listeners[a]){n.visitors=this.listeners[a];return}}t.pop()}walkSync(t){t[Ye]=!0;let n=$u(t);for(let r of n)if(r===$t)t.nodes&&t.each(i=>{i[Ye]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,t.toProxy()))return}}warnings(){return this.sync().warnings()}};ft.registerPostcss=e=>{Ho=e};ju.exports=ft;ft.default=ft;K0.registerLazyResult(ft);q0.registerLazyResult(ft)});var Yu=ee((YS,Ku)=>{"use strict";var eh=Lo(),th=Br(),nh=Ur(),rh=Tn(),KS=Po(),Wn=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=th;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 i=rh;this.result=new nh(this._processor,void 0,this._opts),this.result.css=n;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new eh(i,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[]}};Ku.exports=Wn;Wn.default=Wn});var Ju=ee((XS,Xu)=>{"use strict";var ih=Fr(),oh=Go(),ah=Yu(),sh=zt(),Et=class{constructor(t=[]){this.version="8.5.14",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 ah(this,t,n):new oh(this,t,n)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};Xu.exports=Et;Et.default=Et;sh.registerProcessor(Et);ih.registerProcessor(Et)});var oc=ee((JS,ic)=>{"use strict";var Qu=kr(),Zu=Nn(),lh=ct(),uh=Tr(),ec=Dn(),tc=Fr(),ch=wu(),dh=Pn(),fh=Go(),mh=Mo(),ph=Fn(),hh=Br(),Bo=Ju(),gh=Ur(),nc=zt(),rc=Dr(),bh=Tn(),xh=Io();function le(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new Bo(e)}le.plugin=function(t,n){let r=!1;function i(...a){console&&console.warn&&!r&&(r=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
|
|
28
28
|
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
29
|
-
https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new
|
|
29
|
+
https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.postcssVersion=new Bo().version,l}let o;return Object.defineProperty(i,"postcss",{get(){return o||(o=i()),o}}),i.process=function(a,l,s){return le([i(s)]).process(a,l)},i};le.stringify=bh;le.parse=hh;le.fromJSON=ch;le.list=mh;le.comment=e=>new Zu(e);le.atRule=e=>new Qu(e);le.decl=e=>new ec(e);le.rule=e=>new rc(e);le.root=e=>new nc(e);le.document=e=>new tc(e);le.CssSyntaxError=uh;le.Declaration=ec;le.Container=lh;le.Processor=Bo;le.Document=tc;le.Comment=Zu;le.Warning=xh;le.AtRule=Qu;le.Result=gh;le.Input=dh;le.Rule=rc;le.Root=nc;le.Node=ph;fh.registerPostcss(le);ic.exports=le;le.default=le});function or(){return globalThis}function M(e,t){if(typeof window>"u")return;let n=or(),r=n.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(i){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var Hf=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1"];function Gf(e,t){let n=Math.abs(e),r=Math.abs(t);for(;r!==0;){let i=n%r;n=r,r=i}return n||1}function Bf(e){let t=Number.isFinite(e)&&e>0?e:30,n=Number.isInteger(t)?1:1e6,r=Math.round(t*n),i=Gf(r,n);return{numerator:r/i,denominator:n/i}}function Ei(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 ar(e){return{protocolVersion:1,capabilities:Hf,fps:Bf(e)}}function Uf(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function $a(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=Ei(n.fps);return r===null||!Uf(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:r,metadata:n}}var ja=30;function Ka(e){ja=Number.isFinite(e)&&e>0?e:30}function xe(e){try{window.parent.postMessage({...e,...ar(ja)},"*")}catch(t){M("bridge.postMessage",t)}}var Wf={play:(e,t)=>t.onPlay(),pause:(e,t)=>t.onPause(),"stop-media":(e,t)=>t.onStopMedia(),seek:(e,t)=>t.onSeek(Vf(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-root-duration":(e,t)=>t.onSetRootDuration(Number(e.durationSeconds??0)),"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=>qf(e)};function Vf(e,t){let n=Number(e.timeSeconds);if(Number.isFinite(n))return Math.max(0,n);let i=Ei(e.fps)??t.getCanonicalFps();return Math.max(0,Number(e.frame??0))/i}function zf(e){let t=$a(e);return t.status!=="unsupported"?!1:(xe({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 qf(e){let t=e.selectors,n=e.duration||800;t&&$f(t,n)}function Ya(e){let t=n=>{let r=n.data;if(!r||r.source!=="hf-parent"||r.type!=="control"||zf(r))return;let i=r.action;if(typeof i!="string")return;let o=Wf[i];o&&o(r,e)};return window.addEventListener("message",t),xe({source:"hf-preview",type:"ready"}),t}function $f(e,t){if(!document.getElementById("__hf-flash-styles")){let n=document.createElement("style");n.id="__hf-flash-styles",n.textContent=`
|
|
30
30
|
.__hf-flash {
|
|
31
31
|
outline: 2px solid rgba(59, 130, 246, 0.6) !important;
|
|
32
32
|
outline-offset: 2px !important;
|
|
@@ -36,13 +36,13 @@ https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.p
|
|
|
36
36
|
0% { outline-color: rgba(59, 130, 246, 0.8); }
|
|
37
37
|
100% { outline-color: transparent; }
|
|
38
38
|
}
|
|
39
|
-
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){F("bridge.flashElements.querySelector",r)}}var ei=null;function ha(e){ei=e}function Ne(e,t){if(ei)try{ei({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){F("runtime.analytics.site1",n)}}function Gd(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function At(e){return`--${Gd(e)}`}function ga(e){let t=new Map;for(let n of e){let r=At(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function ba(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,Zt(i));let n=qn(),r={...t,...n};for(let i of e)ni(i,r);return r}var xa=new Set;function ya(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 Hd(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function Bd(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 Ud(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=Bd(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function ni(e,t,n){if(!e)return;let r=ya(e);if(r.length===0)return;let i=Hd(e,n);for(let o of r){let a=Ud(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(xa.has(l))continue;xa.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function Zt(e){let t={};for(let n of ya(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var ti="data-hf-css-vars";function $n(e){return"style"in e&&typeof e.style?.setProperty=="function"}function ri(e,t){if(!$n(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=At(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(ti,n.join(" "))}function Sa(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=At(i);(($n(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function va(e){if(!$n(e))return;let t=e.getAttribute(ti);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(ti)}}function Ea(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=qn(),r=[];for(let i of t)r.push(...Wd(i,n,e.defaultView));for(let i of ga(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${At(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function Wd(e,t,n){if(!$n(e))return[];let r=Zt(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=At(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return ri(e,i),Object.keys(r)}function Ca(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 qn(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function _a(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(x){F("runtime.adapters.css.site5",x)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){F("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){F("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){F("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){F("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let x=i(f,m);x.endSeconds!=null&&(u=Math.max(u,x.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),x=Math.max(0,c-f)*1e3,v=m.animations;if(v.length>0){o(v,x);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(x/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function Aa(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function wa(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){F("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){F("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){F("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){F("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function Ra(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){F("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(ii(r))r.goToAndStop(t*1e3,!1);else if(oi(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){F("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(ii(t)||oi(t))&&t.pause()}catch(n){F("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=Vd(r)}catch(o){F("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function Ta(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Vd(e){return ii(e)?Ta(e.totalFrames,e.frameRate):oi(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:Ta(e.totalFrames,e.frameRate):null}function ii(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function oi(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ai=-1,jn=new Set,wt,si=0;function Fa(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){F("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));jn.add(i),i.then(o=>{jn.delete(i)&&o.status==="rejected"&&wt===void 0&&(wt={reason:o.reason})})}function Kn(e){e!==ai&&(ai=e,Fa(e))}function Yn(e){ai=e,Fa(e)}function La(){return si>0}async function li(){si+=1;let e=wt;try{for(await Promise.resolve();jn.size>0;){let r=(await Promise.all([...jn])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=wt;if(e===void 0&&(e=t),wt===t&&(wt=void 0),e)throw e.reason}finally{si-=1}}function Na(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,Kn(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function $e(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function ka(){return $e({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 Ma(){return $e({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 Da(){return $e({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 Ia(){return $e({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 Pa(){return $e({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var zd=250;function Oa(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(La()||(window.__hfTypegpuTime=e,Yn(e)))},zd))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,Kn(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}function Ga(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;if(e.id){let n=document.getElementById(`__render_frame_${e.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function Ha(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=Ga(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function Ba(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=Ga(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function Ua(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=y=>{let w=Number(y.currentTime);return Number.isFinite(w)&&w>0?w:0},c=(y,w)=>w<=0?y:y>=w?Math.max(0,y-w):y,m=(y,w)=>{let T=l.get(y);if(T)return T;let k={compositionTimeMs:w,animationTimeMs:e?c(u(y),w):u(y)};return l.set(y,k),k},f=(y,w)=>{if(!a.has(y)){a.add(y);let T=()=>{a.delete(y)};try{y.addEventListener("finish",T,{once:!0}),y.addEventListener("cancel",T,{once:!0})}catch(k){F("runtime.adapters.waapi.site4",k)}}m(y,w)},x=(y,w)=>{for(let T of y)f(T,w)},v=()=>{if(n||typeof Element>"u")return;let y=Element.prototype;if(typeof y.animate!="function"||y.__hfOriginalAnimate)return;let w=y.animate;try{Object.defineProperty(y,"__hfOriginalAnimate",{value:w,configurable:!0});let T=function(...k){let D=w.apply(this,k);return f(D,t),D};y.animate=T,r=y,i=w,o=T,n=!0}catch{}},C=y=>{let w=null;try{w=y.effect?.getComputedTiming?.()??null}catch(D){F("runtime.adapters.waapi.site4",D)}if(!w)return{};let T=Number(w.endTime);return Number.isFinite(T)?{endSeconds:(l.get(y)?.compositionTimeMs??0)/1e3+T/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,v(),x(s(),t)},seek:y=>{let w=Math.max(0,(Number(y.time)||0)*1e3);t=w,(!e||a.size>0)&&x(s(),e?w:0);for(let T of a){let k=e?m(T,w):m(T,0),D=k.animationTimeMs+Math.max(0,w-k.compositionTimeMs);try{T.currentTime=D}catch(P){F("runtime.adapters.waapi.site1",P)}try{T.pause()}catch(P){F("runtime.adapters.waapi.site2",P)}}},pause:()=>{e||x(s(),t);for(let y of a)try{y.pause()}catch(w){F("runtime.adapters.waapi.site3",w)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(y){F("runtime.adapters.waapi.site5",y)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let y=0;for(let w of s()){let T=C(w);T.endSeconds!=null&&(y=Math.max(y,T.endSeconds))}return y>0?y:null}}}function Wa(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function $d(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function Xn(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function qd(e,t){let n=Xn(e.dataset.start)??0,r=Xn(e.dataset.end),i=Xn(e.dataset.duration),o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=Xn(e.dataset.volume)??1,l=Math.max(0,Math.min(1,a));return{start:n,end:o,staticVolume:l}}function jd(e,t,n,r){let{start:i,end:o,staticVolume:a}=qd(e,n);e.volume=a;let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=[],m;for(let x=s;x<=u+1e-6;x=Math.min(u,x+l)){t(x);let v=Number(e.volume);if(Number.isFinite(v)){let C=Math.max(0,Math.min(1,v)),y={time:Number(x.toFixed(6)),volume:Number(C.toFixed(6))};$d(c,m,y,x===u),m=y}if(x===u)break}return c.some(x=>Math.abs(x.volume-a)>1e-4)?c:null}function Va(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=jd(e,o,n,60);Number.isFinite(a)&&o(a),l&&r.set(e,l)}function za(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function qe(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return za(n)}function Rt(e){let t=Number.parseFloat(e.getAttribute("data-playback-start")??e.getAttribute("data-media-start")??"");return Number.isFinite(t)&&t>=0?t:0}function $a(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 qa(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,u=qe(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-s)/u));let x=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,v=Number.parseFloat(a.dataset.volume??""),C={el:a,start:l,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:x,volume:Number.isFinite(v)?v:null,playbackRate:u,loop:c,sourceDuration:m};r.push(C),a.tagName==="VIDEO"&&i.push(C),Number.isFinite(x)&&(o=Math.max(o,x))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var ui=new WeakMap,tn=new WeakMap,ci=new WeakSet,Tt=new WeakSet;function Kd(e){if(Tt.has(e))return;Tt.add(e);let t=()=>Tt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var Yd=3;function Xd(e){return e.error!=null||e.networkState===Yd}var di=new WeakMap;function en(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function fi(e){ui.delete(e),tn.delete(e),ci.delete(e),di.delete(e)}function ja(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=o&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||l)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let U=n.sourceDuration-n.mediaStart;U>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%U)}let u=en(e.userVolume??1),c=en(n.volume??1),m=di.get(r),f=en(r.volume),x;n.volumeKeyframes&&n.volumeKeyframes.length>0?x=en(Wa(n.volumeKeyframes,i)):m===void 0||Math.abs(f-m)>1e-4?x=f:x=c;let v=en(x*u);r.volume=v,di.set(r,v),e.onElementVolume?.(r,v),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(U){F("runtime.media.site1",U)}let C=.04,y=2,w=r.currentTime||0,T=Math.abs(w-i),k=i-w,D=ui.get(r);ui.set(r,k);let P=D===void 0,_=!P&&Math.abs(k-D)>.5,b=T>3,S=a&&T>.001||r.ended&&l&&T>.001||T>.5&&(P||_||b),A=r.tagName==="VIDEO"&&!r.paused,R=D!==void 0&&Math.abs(k-D)<.004,N=!1;if(!A&&!S&&!P&&R&&T>C){let U=(tn.get(r)??0)+1;tn.set(r,U),U>=y&&(N=!0,tn.set(r,0))}else T<=C&&tn.set(r,0);let G=!A&&e.forceSync&&T>.02;if(S||N||G){if(!(r.tagName==="VIDEO"&&r.id&&!!document.getElementById(`__render_frame_${r.id}__`))){try{r.currentTime=i}catch(ne){F("runtime.media.site2",ne)}if(Math.abs(r.currentTime-i)>.5&&!ci.has(r)){ci.add(r),r.load();try{r.currentTime=i}catch(ne){F("runtime.media.site3",ne)}}}Tt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!Tt.has(r)&&!Xd(r)?(Kd(r),r.play().catch(U=>{Tt.delete(r),(U&&typeof U=="object"&&"name"in U?String(U.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}fi(r),r.paused||r.pause()}}var Jd="hf-proxy",Ka="runtime_media_proxy_fallback",Ya="runtime_media_proxy_unavailable",nn=new WeakSet,Xa=new WeakSet;function Jn(e){return e.currentSrc||e.src}function mi(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!e.id&&!!document.getElementById(`__render_frame_${e.id}__`)}function pi(e){let t=Jn(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 Qd(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 Zd(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function hi(e,t){return t[e]??Qd(e,t)??Zd(e,t)}function ef(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(Jd,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var tf={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 gt(e,t,n){if(Xa.has(e))return;Xa.add(e);let r=tf[t];xe({source:"hf-preview",type:"diagnostic",code:Ya,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Ya}: "${n}" (${t}): ${r}`)}function gi(e,t=null,n="reactive"){if(nn.has(e))return;let r=Jn(e),i;try{i=ef(r,t)}catch(l){F("runtime.mediaProxy.swap",l),gt(e,"invalid_source_url",r);return}nn.add(e),fi(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Ka,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Ka}: "${r}" uses a codec (${o??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Ja(e){if(mi(e)||!(e instanceof HTMLVideoElement)||nn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=pi(e);if(n===null)return;let r=hi(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||gi(e,r,"proactive")}function Qa(e){if(mi(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=Jn(e);if(nn.has(e)){gt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=pi(e);if(r===null){gt(e,"cross_origin",t);return}let i=hi(r,n);if(i&&!i.browserHostile){gt(e,"browser_safe_codec",t);return}gi(e,i,"reactive")}function Za(e){if(mi(e)||!(e instanceof HTMLVideoElement))return;let t=Jn(e);if(nn.has(e)){gt(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=pi(e);if(r===null){gt(e,"cross_origin",t);return}let i=hi(r,n);if(i&&!i.browserHostile){gt(e,"browser_safe_codec",t);return}gi(e,i,"tertiary")}var be=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);he(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},nf=[0,0,0],rf=[1,1,1],Qn=64;function of(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 nt(e,t){let n=Number(e);if(!Number.isFinite(n))throw new be(`Invalid number "${e}"`,t);return n}function es(e,t,n){if(e.length!==3)throw new be(`${t} expects three numbers`,n);return[nt(e[0],n),nt(e[1],n),nt(e[2],n)]}function ts(e,t,n){if(!e)throw new be(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new be(`${t} must be an integer greater than 1`,n);return r}function af(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new be("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function sf(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 lf(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function ns(e,t={}){let n=t.maxSize??Qn,r=null,i=nf,o=rf,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let m=0;m<u.length;m++){let f=m+1,x=of(u[m]??"").trim();if(!x)continue;let v=x.split(/\s+/),C=(v[0]??"").toUpperCase(),y=v.slice(1);if(C==="TITLE"){r=sf(x);continue}if(C==="DOMAIN_MIN"){i=es(y,C,f);continue}if(C==="DOMAIN_MAX"){o=es(y,C,f);continue}if(C==="LUT_3D_INPUT_RANGE"){if(y.length!==2)throw new be(`${C} expects two numbers`,f);let w=nt(y[0],f),T=nt(y[1],f);if(T<=w)throw new be("LUT_3D_INPUT_RANGE max must exceed min",f);i=[w,w,w],o=[T,T,T];continue}if(C==="LUT_1D_SIZE"){a=ts(y[0],C,f);continue}if(C==="LUT_3D_SIZE"){if(l=ts(y[0],C,f),l>n)throw new be(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!lf(C)){if(C.startsWith("LUT_"))throw new be(`Unsupported cube keyword ${C}`,f);continue}if(!l)throw a?new be("1D cube LUTs are not supported yet",f):new be("LUT data appears before LUT_3D_SIZE",f);if(v.length!==3)throw new be("LUT data rows must contain three numbers",f);s.push(nt(v[0],f),nt(v[1],f),nt(v[2],f))}if(a&&l)throw new be("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new be("1D cube LUTs are not supported yet"):new be("Missing LUT_3D_SIZE");af(i,o);let c=l*l*l;if(s.length!==c*3)throw new be(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function uf(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function rn(e){return Math.round(uf(e)*255)}function xi(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=rn(e.data[s]??0),i[u+1]=rn(e.data[s+1]??0),i[u+2]=rn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var rs="rec709";var ce={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 is=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],os=["shadows","midtones","highlights"],as=["master","red","green","blue"],ss=["hueVsHue","hueVsSaturation","hueVsLuma"];var ls=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],us=["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 ub=ce.unit,cb=ce.signedUnit,db=ce.effects;var je=1024,on=16;function cs(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function ye(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function cf(e){let t=[],n=[],r=ye(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 i=ye(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=cs(ye(t,0),ye(t,1),i,ye(n,1)),o[o.length-1]=cs(ye(t,t.length-1),ye(t,t.length-2),ye(n,n.length-1),ye(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=ye(n,a-1),s=ye(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=ye(t,a-1),c=ye(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function ds(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function df(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 ff(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function fs(e,t,n,r,i){df(e,r,i);let o=cf(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>ye(e,l+1)[0];)l+=1;let c=ye(e,l),m=ye(e,l+1),f=ff(u,c,m,ye(o,l),ye(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function Ft(e,t=je){if(ds(e,t),e.length>on)throw new RangeError(`A color curve supports at most ${on} 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 fs(e,t,n=>n/(t-1),0,1)}function yi(e,t,n,r=je){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>on)throw new RangeError(`A hue curve supports at most ${on} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return ds(l,r),fs(l,r,s=>s/r*360,t,n)}var an="data-color-grading",sn="data-hf-color-grading-source-hidden",tr="data-hf-authored-opacity",xs="__hf_color_grading_",pf=rs,Ei={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Ci={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},_i={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 nr=is,bs=os,ys=as,Ss=ss,wi=ls,Ti=us,ms={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},ps={vignette:.18};function Se(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ei,...n},details:{...Ci,...r},effects:{..._i,...i}}}var Ri=[Se("neutral","Neutral"),Se("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),Se("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),Se("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),Se("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),Se("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),Se("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),Se("vintage-wash","Vintage Wash",ms,ps),Se("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),Se("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),Se("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),Se("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),Se("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),Se("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),Se("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}),Se("home-movie-8mm","8mm Home Movie",ms,{...ps,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),Se("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),Se("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],hf=new Map(Ri.map(e=>[e.id,e])),gf=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,xf={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}},Lt={hue:0,amount:0,level:0},hs={amount:ce.unit,level:ce.signedUnit},rt=[[0,0],[1,1]],Nt=[],bf={hueVsHue:ce.secondaryHueShift,hueVsSaturation:ce.signedUnit,hueVsLuma:ce.signedUnit},Si={center:0,range:180,softness:0},vi={min:0,max:1,softness:.05},yf={vignette:ce.unit,vignetteMidpoint:ce.unit,vignetteRoundness:ce.signedUnit,vignetteFeather:ce.unit,grain:ce.unit,grainSize:ce.unit,grainRoughness:ce.unit},Ai=ce.unit,Sf=ce.effects,vs=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var vf=Ri.filter(e=>vs.some(t=>e.effects[t]>1e-4)),yb=Ri.filter(e=>!vf.includes(e)),Sb={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}},Es=[{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 Ef=/^#[0-9a-f]{6}$/i;function Cf(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&Ef.test(t))?null:e.map(t=>t.toLowerCase())}function Ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function er(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function Cs(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function we(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?er(n,t.min,t.max):0}function Fi(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function _f(e){let t=Ce(e)?e:{};return bs.reduce((n,r)=>{let i=Ce(t[r])?t[r]:{};return n[r]={hue:Fi(i.hue,Lt.hue),amount:we(i.amount??Lt.amount,hs.amount),level:we(i.level??Lt.level,hs.level)},n},{shadows:{...Lt},midtones:{...Lt},highlights:{...Lt}})}function Af(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)?[er(t,0,1),er(n,0,1)]:null}function _s(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function wf(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function Tf(e){if(!Array.isArray(e)||e.length<2)return rt;let t=[];for(let n of e){let r=Af(n);if(!r)return rt;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),_s(t)||(wf(t),t.length>16)?rt:t}function Rf(e){let t=Ce(e)?e:{};return ys.reduce((n,r)=>(n[r]=Tf(t[r]),n),{master:rt,red:rt,green:rt,blue:rt})}function Ff(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)?[Fi(n),er(r,t.min,t.max)]:null}function Lf(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return Nt;let n=[];for(let r of e){let i=Ff(r,t);if(!i)return Nt;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),_s(n)?Nt:n}function Nf(e){let t=Ce(e)?e:{};return Ss.reduce((n,r)=>(n[r]=Lf(t[r],bf[r]),n),{hueVsHue:Nt,hueVsSaturation:Nt,hueVsLuma:Nt})}function gs(e){let t=Ce(e)?e:{},n=we(t.min??vi.min,Ai),r=we(t.max??vi.max,Ai);return{min:Math.min(n,r),max:Math.max(n,r),softness:we(t.softness??vi.softness,ce.secondarySoftRangeSoftness)}}function kf(e){let t=Ce(e)?e:{},n=we(t.range??Si.range,ce.secondaryHueRange);return{center:Fi(t.center,Si.center),range:n,softness:we(t.softness??Si.softness,{min:ce.secondaryHueSoftness.min,max:ce.secondaryHueCombinedMax-n})}}function Mf(e){return{hueShift:we(e.hueShift??0,ce.secondaryHueShift),saturation:we(e.saturation??0,ce.signedUnit),luma:we(e.luma??0,ce.signedUnit),temperature:we(e.temperature??0,ce.signedUnit),tint:we(e.tint??0,ce.signedUnit)}}function Df(e){return!Ce(e)||!Ce(e.key)||!Ce(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:kf(e.key.hue),saturation:gs(e.key.saturation),luma:gs(e.key.luma)},correction:Mf(e.correction)}}function If(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=Df(n);r&&t.push(r)}return t}function Pf(e){if(e==null)return null;let t=String(e).trim();return t||null}function Of(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ce(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:Cs(e.intensity,1)}}function Gf(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ce(n)?n:null}catch{return null}return{preset:t}}return Ce(e)?e:null}function Hf(e,t){let n=e.trim().match(gf);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function Zn(e,t){if(typeof e=="string"){let r=Hf(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return Zn(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>Zn(r,t));if(!Ce(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=Zn(i,t);return n}function Bf(e){return e?hf.get(e)??null:null}function rr(e){let t=Gf(e);if(!t||t.enabled===!1)return null;let n=Pf(t.preset),r=Bf(n),i=r?.adjust??Ei,o=r?.details??Ci,a=r?.effects??_i,l=Ce(t.adjust)?t.adjust:{},s=Ce(t.details)?t.details:{},u=Ce(t.effects)?t.effects:{},c=nr.reduce((x,v)=>(x[v]=we(l[v]??i[v],xf[v]),x),{...Ei}),m=wi.reduce((x,v)=>(x[v]=we(s[v]??o[v],yf[v]),x),{...Ci}),f=Ti.reduce((x,v)=>(x[v]=we(u[v]??a[v],Sf[v]??Ai),x),{..._i});return{enabled:!0,preset:n,intensity:Cs(t.intensity,r?.intensity??1),adjust:c,wheels:_f(t.wheels),curves:Rf(t.curves),hueCurves:Nf(t.hueCurves),secondaries:If(t.secondaries),details:m,effects:f,palette:Cf(t.palette),lut:Of(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():pf}}function As(e,t){return rr(Zn(e,t))}function Uf(e){return bs.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function Li(e){return ys.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function Ni(e){return Ss.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function ki(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function ws(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||vs.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:nr.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?Uf(e.wheels):!1)||(e.curves?Li(e.curves):!1)||(e.hueCurves?Ni(e.hueCurves):!1)||(e.secondaries?ki(e.secondaries):!1):!1}var Wf=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),Vf=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function Ts(e){let t=!1,n=null,r=null,i=null,o=null;function a(b,S){try{window.dispatchEvent(new CustomEvent(b,{detail:S}))}catch(A){F("runtime.picker.site1",A)}}function l(b){i=b,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(b){o=b,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(b){let S=b.ownerDocument.defaultView;if(!S)return!1;let A=b;for(;A&&A!==document.body&&A!==document.documentElement;){let R=S.getComputedStyle(A);if(R.display==="none"||R.visibility==="hidden"||R.pointerEvents==="none")return!0;let N=Number.parseFloat(R.opacity);if(Number.isFinite(N)&&N<=.01&&!A.hasAttribute(sn))return!0;A=A.parentElement}return!1}function c(b){if(!b||b===document.body||b===document.documentElement)return!1;let S=b.tagName.toLowerCase();return!(S==="script"||S==="style"||S==="link"||S==="meta"||b.classList.contains("__hf-pick-highlight")||b.closest(Wf)||u(b))}function m(b){return!!b?.closest(Vf)}function f(b){let S=b;if(S.id)return`#${CSS.escape(S.id)}`;let A=b.getAttribute("data-composition-id");if(A)return`[data-composition-id="${CSS.escape(A)}"]`;let R=b.getAttribute("data-composition-src");if(R)return`[data-composition-src="${CSS.escape(R)}"]`;let N=b.getAttribute("data-track-index");if(N)return`[data-track-index="${CSS.escape(N)}"]`;let G=b.tagName.toLowerCase(),U=b.parentElement;if(!U)return G;let ne=U.querySelectorAll(`:scope > ${G}`);if(ne.length===1)return G;for(let H=0;H<ne.length;H+=1)if(ne[H]===b)return`${G}:nth-of-type(${H+1})`;return G}function x(b){let S=b.tagName.toLowerCase(),A=(b.textContent??"").trim().replace(/\s+/g," "),R=(N,G)=>N.length>G?`${N.slice(0,G-1)}\u2026`:N;return S==="h1"||S==="h2"||S==="h3"?"Heading":S==="p"||S==="span"||S==="div"?A.length>0?R(A,56):"Text":S==="img"?"Image":S==="video"?"Video":S==="audio"?"Audio":S==="svg"?"Shape":b.getAttribute("data-composition-src")?"Composition":S==="section"?"Section":`${S.charAt(0).toUpperCase()}${S.slice(1)}`}function v(b,S,A){let R=typeof A=="number"&&A>0?A:8,N=[];if(document.elementsFromPoint)N=document.elementsFromPoint(b,S);else if(document.elementFromPoint){let ne=document.elementFromPoint(b,S);N=ne?[ne]:[]}if(m(N[0]??null))return[];let G={},U=[];for(let[ne,H]of N.entries()){if(!c(H))continue;let J=`${H.tagName}::${H.id||""}::${ne}`;if(!G[J]&&(G[J]=!0,U.push(H),U.length>=R))break}return U}function C(b){let S=b.getBoundingClientRect(),A={};for(let N of Array.from(b.attributes))N.name.startsWith("data-")&&(A[N.name]=N.value);return{id:b.id||null,tagName:b.tagName.toLowerCase(),selector:f(b),label:x(b),boundingBox:{x:S.left,y:S.top,width:S.width,height:S.height},textContent:b.textContent?b.textContent.trim().slice(0,200):null,src:b.getAttribute("src")||b.getAttribute("data-composition-src")||null,dataAttributes:A}}function y(b,S,A){return v(b,S,A).map(C)}function w(b){if(!t)return;let A=v(b.clientX,b.clientY,1)[0]??(b.target instanceof Element?b.target:null);if(!c(A)||n===A)return;n&&n.classList.remove("__hf-pick-highlight"),n=A,A.classList.add("__hf-pick-highlight");let R=C(A);l(R),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:R})}function T(b){if(!t)return;b.preventDefault(),b.stopPropagation(),b.stopImmediatePropagation();let S=y(b.clientX,b.clientY,8);S.length!==0&&(l(S[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:S,selectedIndex:0,point:{x:b.clientX,y:b.clientY}}))}function k(b){b.key==="Escape"&&(P(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function D(){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(`
|
|
40
|
-
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",w,!0),document.addEventListener("click",T,!0),document.addEventListener("keydown",k,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function P(){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",w,!0),document.removeEventListener("click",T,!0),document.removeEventListener("keydown",k,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function _(){window.__HF_PICKER_API={enable:D,disable:P,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(b,S,A)=>Number.isFinite(b)&&Number.isFinite(S)?y(b,S,A):[],pickAtPoint:(b,S,A)=>{if(!Number.isFinite(b)||!Number.isFinite(S))return null;let R=y(b,S,8);if(!R.length)return null;let N=Math.max(0,Math.min(R.length-1,Number(A??0))),G=R[N]??null;return G?(s(G),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:G}),P(),G):null},pickManyAtPoint:(b,S,A)=>{if(!Number.isFinite(b)||!Number.isFinite(S))return[];let R=y(b,S,8);if(!R.length)return[];let N=[],G=Array.isArray(A)?A:[0];for(let U of G){let ne=Math.max(0,Math.min(R.length-1,Math.floor(Number(U)))),H=R[ne];if(!H)continue;N.some(_e=>_e.selector===H.selector&&_e.tagName===H.tagName)||N.push(H)}return N.length?(s(N[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:N}),P(),N):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:D,disablePickMode:P,installPickerApi:_}}var zf=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function kt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function Rs(e,t,n=zf){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function ln(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&&F("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Be(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&F("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function un(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){F("runtime.player.site1",i)}}}function Fs(e,t,n,r){let i=kt(t,n),o=r?.suppressEvents===!0;return Be(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function $f(e,t,n,r,i){let o=[];un(e,t,a=>{Be(a,"play"),o.push(a)});try{return Fs(t,n,r,i)}finally{for(let a of o)try{Be(a,"pause")}catch(l){F("runtime.player.site2",l)}}}function qf(e,t){un(e,t,n=>{Be(n,"play")})}function Ls(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?.()??ln(n,"duration",0))||0);r>0&&Math.max(0,ln(n,"time",0))>=r&&(Be(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()),Be(n,"play"),un(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Be(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Be(n,"pause"),un(e.getTimelineRegistry?.(),n,i=>{Be(i,"pause")});let r=Math.max(0,ln(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=$f(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Be(i,"play"),un(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Be(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 i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(qf(e.getTimelineRegistry?.(),i),Fs(i,n,o,r)):kt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>ln(e.getTimeline(),"time",0),getDuration:()=>ln(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Ns(){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 jf=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function Di(e){return e.id||e.getAttribute("data-hf-id")||null}function Mi(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function Kf(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function Yf(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=Mi(e.getAttribute("data-playback-start"))??Mi(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function Xf(e,t,n,r){let i=Mi(e.getAttribute("data-duration"));return i!=null&&i>0?i:Kf(e,t)??Yf(e)??Math.max(0,n-r)}function Jf(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function ks(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||jf.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(Xf(l,n,r,s)<=0)continue;let u={id:Di(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Jf(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var Ii="css:root",Ms=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],Qf=new Set([...Ms,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Zf=new Set(["absolute","relative"]),em=new Set(["flex","inline-flex","grid","inline-grid"]),tm=new Set(["layout","paint","strict","content"]),nm=new Set(["size","inline-size"]);function rm(e){return e.position==="fixed"||e.position==="sticky"}function im(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Zf.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&em.has(n)}function om(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:Ms.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function am(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>tm.has(n))?!0:nm.has(e.getPropertyValue("container-type"))}function sm(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>Qf.has(t))}function lm(e,t){return rm(t)||im(e,t)||om(t)||am(t)?!0:sm(t)}function um(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 ir(e){let t=e.ownerDocument.defaultView;if(!t)return Ii;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(lm(n,t.getComputedStyle(n)))return um(n)}catch{return Ii}n=n.parentElement}return Ii}var Mt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),Mb=Object.freeze([Mt.start,Mt.duration,Mt.trackIndex]),Db=Object.freeze([Mt.derivedEnd]),Ib=Object.freeze([Mt.derivedEnd,Mt.legacyTrack]);function ke(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Is=/^[A-Za-z0-9_.:-]+$/;function Ps(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function Ds(e,t){let n=t;for(;n>=0&&Ps(e,n);)n--;return n}function cm(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function dm(e){let t=e.length-1;if(!Ps(e,t))return null;let n=Ds(e,t);return e[n]==="."&&(n=Ds(e,n-1)),n+1}function fm(e){let t=dm(e);if(t==null)return null;let n=cm(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!Is.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function Pi(e){let t=(e??"").trim();if(!t)return null;let n=ke(t);if(n!=null)return{kind:"absolute",value:n};if(Is.test(t))return{kind:"reference",refId:t,offset:0};let r=fm(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var mm="data-hf-authored-duration",pm="data-hf-authored-end";function hm(e){return ke(e.getAttribute("data-duration"))}function gm(e){return ke(e.getAttribute("data-end"))}function xm(e){return ke(e.getAttribute(mm))}function bm(e){return ke(e.getAttribute(pm))}function it(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let x=r.getElementById(f);return x||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let x=f.ownerDocument.defaultView?.HTMLMediaElement;return x?f instanceof x:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let x=o.get(f);if(x!==void 0)return x;let v=null,C=hm(f)??(n?xm(f):null);if(C!=null&&C>0&&(v=C),v==null||v<=0){let y=gm(f)??(n?bm(f):null);if(y!=null){let w=m(f,0),T=y-w;Number.isFinite(T)&&T>0&&(v=T)}}if((v==null||v<=0)&&s(f)){let y=ke(f.getAttribute("data-playback-start"))??ke(f.getAttribute("data-media-start"))??0;Number.isFinite(f.duration)&&f.duration>y&&(v=(f.duration-y)/qe(f))}if(v==null||v<=0){let y=f.getAttribute("data-composition-id");if(y){let w=t[y]??null;if(w&&typeof w.duration=="function")try{let T=Number(w.duration());Number.isFinite(T)&&T>0&&(v=T)}catch(T){F("runtime.startResolver.site1",T)}}}return v!=null&&Number.isFinite(v)&&v>0?(o.set(f,v),v):(o.set(f,null),null)},c=(f,x)=>{if(f.hasAttribute("data-composition-id")){let C=f.parentElement?.closest("[data-composition-id]");return C?m(C,x):0}let v=f.closest("[data-composition-id]");return v?m(v,x):0},m=(f,x)=>{let v=i.get(f);if(v!==void 0)return v??x;if(a.has(f))return x;a.add(f);try{let C=Pi(f.getAttribute("data-start"));if(!C){if(f.hasAttribute("data-composition-id")){let D=f.parentElement;if(D&&(D.hasAttribute("data-composition-src")||D.hasAttribute("data-composition-id")||D.hasAttribute("data-composition-file"))){let P=m(D,x);return i.set(f,P),P}}return i.set(f,x),x}if(C.kind==="absolute"){let D=Math.max(0,C.value),P=Math.max(0,c(f,x)+D);return i.set(f,P),P}let y=l(C.refId);if(!y)return i.set(f,x),x;let w=m(y,0),T=u(y);if(T==null||T<=0){let D=Math.max(0,w+C.offset);return i.set(f,D),D}let k=Math.max(0,w+T+C.offset);return i.set(f,k),k}finally{a.delete(f)}};return{resolveStartForElement:(f,x=0)=>m(f,Math.max(0,x)),resolveDurationForElement:f=>u(f)}}function Oi(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Sm="data-hf-authored-duration",vm="data-hf-authored-end";function Te(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function Gi(e){return Te(e.getAttribute("data-duration"))??Te(e.getAttribute(Sm))}function Os(e){return Te(e.getAttribute("data-end"))??Te(e.getAttribute(vm))}function Hi(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 Bi(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function Ui(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 dn(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 Gs(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return dn(t);let n=e.getAttribute("data-composition-src");if(n)return dn(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?dn(r.getAttribute("src")):null}function Em(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 Cm(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function _m(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function cn(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Am(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return cn(i);let o=e.id;if(o)return cn(o);let a=Em(e);if(a)return cn(a);let l=Cm(Gs(e));if(l)return cn(l);let s=_m(e);return s||`${cn(t)} ${n+1}`}function Hs(e){let n=window.__timelines??{},r=it({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=B=>{if(!B)return null;let M=n[B]??null;if(!M||typeof M.duration!="function")return null;try{let I=Number(M.duration());return Number.isFinite(I)&&I>0?I:null}catch{return null}},o=B=>{let M=Te(B.getAttribute("data-duration"));if(M!=null&&M>0)return M;let I=Te(B.getAttribute("data-playback-start"))??Te(B.getAttribute("data-media-start"))??0;return Number.isFinite(B.duration)&&B.duration>I?Math.max(0,(B.duration-I)/qe(B)):null},a=()=>{let B=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(B.length===0)return null;let M=0;for(let I of B){let ue=I.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(I,0):Math.max(0,Number(I.getAttribute("data-start")??0)||0);if(!Number.isFinite(ue))continue;let ae=o(I);ae==null||ae<=0||(M=Math.max(M,Math.max(0,ue)+ae))}return M>0?M:null},l=(B,M)=>{let I=[],ue=null,ae=null,$=null,q=B.parentElement;for(;q;){let j=q.getAttribute("data-composition-id");j&&(I.push(j),!$&&q!==M&&($=j),ue==null&&(ue=r.resolveStartForElement(q,0)),ae==null&&(ae=Te(q.getAttribute("data-duration"))??i(j)??null)),q=q.parentElement}return{parentCompositionId:$,compositionAncestors:I.reverse(),inheritedStart:ue,inheritedDuration:ae}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),x=f!=null?Math.max(0,f-Math.max(0,m)):null,v=i(c),C=Gi(s??document.body),y=Bi(...u.filter(B=>B!==s).map(B=>{let M=r.resolveStartForElement(B,0),I=r.resolveDurationForElement(B)??i(B.getAttribute("data-composition-id"))??null;return!Number.isFinite(M)||I==null||I<=0?null:Math.max(0,M)+I})),w=y!=null?Math.max(0,y-Math.max(0,m)):null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,k=typeof C=="number"&&Number.isFinite(C)&&C>0?C:null,D=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,P=typeof w=="number"&&Number.isFinite(w)&&w>0?w:null,_=Bi(D,P),b=T!=null&&_!=null&&T>_+1,A=k??(b?_:Bi(T,D,P))??null,N=(A!=null?m+A:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),G=(B,M)=>!Number.isFinite(M)||M<=0?0:N==null||!Number.isFinite(N)?M:!Number.isFinite(B)||B>=N?0:Math.max(0,Math.min(M,N-B)),U=[],ne=[],H=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),J=0;for(let[B,M]of H.entries()){if(M===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(M.tagName))continue;let I=l(M,s),ue=r.resolveStartForElement(M,I.inheritedStart??0),ae=M.getAttribute("data-composition-id"),$=Gi(M);if(($==null||$<=0)&&ae&&ae!==c&&($=i(ae)),($==null||$<=0)&&M instanceof HTMLMediaElement){let me=Te(M.getAttribute("data-playback-start"))??Te(M.getAttribute("data-media-start"))??0;Number.isFinite(M.duration)&&M.duration>0&&($=Math.max(0,M.duration-me))}if($==null||$<=0){let me=I.inheritedDuration;if(me!=null&&me>0){let Ie=(I.inheritedStart??0)+me;$=Math.max(0,Ie-ue)}}if($==null||$<=0||($=G(ue,$),$<=0))continue;let q=ue+$;J=Math.max(J,q);let j=M.tagName.toLowerCase(),Ve=ae&&ae!==c?"composition":j==="video"?"video":j==="audio"?"audio":j==="img"?"image":"element";U.push({id:Di(M)??ae??null,label:Am(M,Ve,U.length),start:ue,duration:$,track:Ui(M,B),zIndex:Hi(M),stackingContextId:ir(M),kind:Ve,tagName:j,compositionId:M.getAttribute("data-composition-id"),compositionAncestors:I.compositionAncestors,parentCompositionId:I.parentCompositionId,nodePath:null,compositionSrc:dn(M.getAttribute("data-composition-src")),playbackStart:Rt(M),playbackRate:qe(M),assetUrl:Gs(M),timelineRole:M.getAttribute("data-timeline-role"),timelineLabel:M.getAttribute("data-timeline-label"),timelineGroup:M.getAttribute("data-timeline-group"),timelinePriority:Te(M.getAttribute("data-timeline-priority"))})}let _e=new Set(U.map(B=>B.id)),z=s?.getAttribute("data-composition-id")??null,Y=z?n[z]??null:null;if(Y&&s){let B=Y;if(typeof B.getChildren=="function")try{let M=B.getChildren(!0,!0,!1)??[],I=new Map;for(let $ of s.children){let q=$;if(!q.id)continue;let j=q.tagName.toLowerCase();j==="script"||j==="style"||j==="link"||I.set(q,{id:q.id,start:1/0,end:-1/0})}let ue=$=>{let q=$;for(;q;){if(I.has(q))return q;if(q===s)return null;q=q.parentElement}return null};for(let $ of M){if(typeof $.targets!="function"||typeof $.startTime!="function"||typeof $.duration!="function")continue;let q=$.startTime(),j=$.parent;for(;j&&j!==Y&&typeof j.startTime=="function";)q+=j.startTime(),j=j.parent;let Ve=q+$.duration();if(!(!Number.isFinite(q)||!Number.isFinite(Ve)))for(let me of $.targets()){if(!(me instanceof Element))continue;let Ct=ue(me);if(!Ct)continue;let Ie=I.get(Ct);Ie&&(Ie.start=Math.min(Ie.start,q),Ie.end=Math.max(Ie.end,Ve))}}let ae=U.length>0?Math.max(...U.map($=>$.track))+1:0;for(let[$,q]of I){if(q.start===1/0||q.end===-1/0)continue;let j=$;if(_e.has(j.id))continue;let Ve=Math.max(0,q.end-q.start);if(Ve<=0)continue;let me=G(q.start,Ve);me<=0||(J=Math.max(J,q.start+me),U.push({id:j.id,label:j.getAttribute("data-timeline-label")??j.getAttribute("data-label")??j.getAttribute("aria-label")??j.id,start:q.start,duration:me,track:Ui(j,ae),zIndex:Hi(j),stackingContextId:ir(j),kind:"element",tagName:j.tagName.toLowerCase(),compositionId:j.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:Rt(j),playbackRate:qe(j),assetUrl:null,timelineRole:j.getAttribute("data-timeline-role"),timelineLabel:j.getAttribute("data-timeline-label"),timelineGroup:j.getAttribute("data-timeline-group"),timelinePriority:Te(j.getAttribute("data-timeline-priority"))}),_e.add(j.id))}}catch(M){F("runtime.timeline.site1",M)}}if(s&&A!=null&&A>0){let B=U.length>0?Math.max(...U.map(M=>M.track))+1:0;for(let M of s.children){let I=M;if(!I.id||_e.has(I.id))continue;let ue=I.getAttribute("data-timeline-role");if(ue!=="overlay"&&ue!=="persistent-overlay")continue;let ae=I.tagName.toLowerCase();if(ae==="script"||ae==="style"||ae==="link"||ae==="meta"||window.getComputedStyle(I).display==="none")continue;let q=G(0,A);q<=0||(J=Math.max(J,q),U.push({id:I.id,label:I.getAttribute("data-timeline-label")??I.getAttribute("data-label")??I.getAttribute("aria-label")??I.id,start:0,duration:q,track:Ui(I,B),zIndex:Hi(I),stackingContextId:ir(I),kind:"element",tagName:ae,compositionId:I.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:Rt(I),playbackRate:qe(I),assetUrl:null,timelineRole:ue,timelineLabel:I.getAttribute("data-timeline-label"),timelineGroup:I.getAttribute("data-timeline-group"),timelinePriority:Te(I.getAttribute("data-timeline-priority"))}),_e.add(I.id))}}for(let B of u){if(B===s)continue;let M=B.getAttribute("data-composition-id");if(!M||!Oi(M))continue;let I=r.resolveStartForElement(B,0),ue=Gi(B);if((ue==null||ue<=0)&&Os(B)!=null){let j=Os(B);ue=Math.max(0,j-I)}let ae=i(M),$=ue&&ue>0?ue:ae;if($==null||$<=0)continue;let q=G(I,$);q<=0||ne.push({id:M,label:B.getAttribute("data-label")??M,start:I,duration:q,thumbnailUrl:dn(B.getAttribute("data-thumbnail-url")),avatarName:null})}let V=Math.max(1,J||1,A??0),ee=b&&k==null,Ae=ee?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(V*Math.max(1,e.canonicalFps)));return{...zn(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:ee?Number.POSITIVE_INFINITY:V,durationInFrames:Ae,clips:U,scenes:ne,compositionWidth:Te(s?.getAttribute("data-width"))??1920,compositionHeight:Te(s?.getAttribute("data-height"))??1080}}var Wi="data-composition-id",wm="data-composition-src",Tm=`[${Wi}]`,ly=`[${wm}]`,Bs="style",Us="script",Rm='link[rel="stylesheet"], link[rel="preconnect"]';function Dt(e){return e?Array.from(e):[]}function Ws(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=Dt(t.querySelectorAll(Tm)),l=o?a.find(c=>c.getAttribute(Wi)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(Wi)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Dt(u?.querySelectorAll(Bs)),...Dt(t.querySelectorAll(Bs))],scriptSources:[...Dt(u?.querySelectorAll(Us)),...Dt(t.querySelectorAll(Us))],linkSources:Dt(n?.querySelectorAll(Rm)),variableDefaultCarriers:[r,l].filter(c=>c!=null)}}var de=Rd(mu(),1),pu=de.default,Jy=de.default.stringify,Qy=de.default.fromJSON,Zy=de.default.plugin,eS=de.default.parse,tS=de.default.list,nS=de.default.document,rS=de.default.comment,iS=de.default.atRule,oS=de.default.rule,aS=de.default.decl,sS=de.default.root,lS=de.default.CssSyntaxError,uS=de.default.Declaration,cS=de.default.Container,dS=de.default.Processor,fS=de.default.Document,mS=de.default.Comment,pS=de.default.Warning,hS=de.default.AtRule,gS=de.default.Result,xS=de.default.Input,bS=de.default.Rule,yS=de.default.Root,SS=de.default.Node;var ho="data-hf-authored-id",hu="data-hf-inner-root";function go(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xo(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Xp(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function xu(e){let t=e.trim();return t?Array.from(new Set([t,Xp(t)])).filter(Boolean):[]}function Jp(e){return!!e&&/[\w-]/.test(e)}function Qp(e,t,n){let r=xu(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!Jp(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function Zp(e,t){let n=t?.trim();return n?Qp(e,n,`[${ho}="${xo(n)}"]`):e}function gu(e){return`${e}:not(:has([${hu}])), ${e} > [${hu}]`}function e0(e,t,n,r,i,o){let a=Zp(e,r),l=t0(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?gu(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${go(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?gu(t):l.replace(u,t);let c=l.match(/^\s*/)?.[0]??"",m=l.match(/\s*$/)?.[0]??"";if(i){let f=r?`[${ho}="${xo(r)}"]`:null;if(f&&s.startsWith(f)){let x=s.slice(f.length);return`${c}${t}${f}${x}${m}`}}return`${c}${t} ${s}${m}`}function t0(e,t,n){let r=go(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var n0=new Set(["keyframes","-webkit-keyframes","font-face"]);function r0(e){return e?.type==="atrule"}function i0(e){let t=e.parent;for(;t;){if(r0(t)&&n0.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function o0(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function bu(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${xo(o)}"]`,l=pu.parse(e);return l.walkRules(s=>{i0(s)||o0(s)||(s.selectors=s.selectors.map(u=>e0(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function yu(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=JSON.stringify(t),l=JSON.stringify(i),s=JSON.stringify(n),u=go(t),c=JSON.stringify(o?.trim()||null),m=JSON.stringify(r??null),f=JSON.stringify(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),x=JSON.stringify(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),v=JSON.stringify(xu(o?.trim()||""));return`(function(){
|
|
39
|
+
`,document.head.appendChild(n)}for(let n of e)try{document.querySelectorAll(n).forEach(i=>{i.classList.add("__hf-flash"),setTimeout(()=>i.classList.remove("__hf-flash"),t)})}catch(r){M("bridge.flashElements.querySelector",r)}}var Ai=null;function Xa(e){Ai=e}function Ne(e,t){if(Ai)try{Ai({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(n){M("runtime.analytics.site1",n)}}function jf(e){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-"),n=0,r=t.length;for(;n<r&&t[n]==="-";)n++;for(;r>n&&t[r-1]==="-";)r--;let i=t.slice(n,r);return i.length>0?i:"node"}function kt(e){return`--${jf(e)}`}function Ja(e){let t=new Map;for(let n of e){let r=kt(n),i=t.get(r);i?i.includes(n)||i.push(n):t.set(r,[n])}return[...t.values()].filter(n=>n.length>1)}function Za(){if(typeof document>"u")return{};let e=new Set;document.documentElement?.hasAttribute("data-composition-variables")&&e.add(document.documentElement);for(let i of Array.from(document.querySelectorAll("[data-composition-variables]")))e.add(i);let t={};for(let i of e)Object.assign(t,sn(i));let n=lr(),r={...t,...n};for(let i of e)wi(i,r);return r}var Qa=new Set;function es(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 Kf(e,t){return t?.trim()||e.getAttribute("data-composition-id")?.trim()||e.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()||"composition"}function Yf(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 Xf(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=Yf(e);return r.length===0||r.some(i=>String(i)===String(n))?null:{id:e.id,value:n,allowed:r}}function wi(e,t,n){if(!e)return;let r=es(e);if(r.length===0)return;let i=Kf(e,n);for(let o of r){let a=Xf(o,t);if(!a)continue;let l=`${i}|${a.id}|${String(a.value)}`;if(Qa.has(l))continue;Qa.add(l);let s="default"in o?JSON.stringify(o.default):"the composition default";console.warn(`[hyperframes] runtime_unknown_enum_value: ${i} variable "${a.id}" got ${JSON.stringify(a.value)}, which is not a declared option (${a.allowed.join(", ")}). Rendering ${s} instead.`)}}function sn(e){let t={};for(let n of es(e))typeof n.id!="string"||!("default"in n)||(t[n.id]=n.default);return t}var Ci="data-hf-css-vars";function sr(e){return"style"in e&&typeof e.style?.setProperty=="function"}function _i(e,t){if(!sr(e))return;let n=[];for(let[r,i]of Object.entries(t))if(typeof i=="string"&&i!==""||typeof i=="number"){let o=kt(r);e.style.setProperty(o,String(i)),n.push(o)}n.length>0&&e.setAttribute(Ci,n.join(" "))}function ts(e,t,n){let r={};for(let[i,o]of Object.entries(t)){let a=kt(i);((sr(e)?e.style.getPropertyValue(a):"")||(n?n.getComputedStyle(e).getPropertyValue(a):"")).trim()===""&&(r[i]=o)}return r}function ns(e){if(!sr(e))return;let t=e.getAttribute(Ci);if(t){for(let n of t.split(" "))n.startsWith("--")&&e.style.removeProperty(n);e.removeAttribute(Ci)}}function rs(e){let t=new Set;e.documentElement?.hasAttribute("data-composition-variables")&&t.add(e.documentElement);for(let i of Array.from(e.querySelectorAll("[data-composition-variables]")))t.add(i);let n=lr(),r=[];for(let i of t)r.push(...Jf(i,n,e.defaultView));for(let i of Ja(r))console.warn(`composition variables ${i.join(", ")} collapse to the same CSS property ${kt(i[0]??"")} \u2014 rename one to avoid cross-talk`)}function Jf(e,t,n){if(!sr(e))return[];let r=sn(e),i={};for(let[o,a]of Object.entries(r)){if(o in t)continue;let l=kt(o);(e.style.getPropertyValue(l)||(n?n.getComputedStyle(e).getPropertyValue(l):"")).trim()===""&&(i[o]=a)}for(let[o,a]of Object.entries(t))o in r&&(i[o]=a);return _i(e,i),Object.keys(r)}function is(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 lr(){if(typeof window>"u")return{};let e=window.__hfVariables;return!e||typeof e!="object"||Array.isArray(e)?{}:e}function os(e){let t=[],n=u=>{if(typeof u.getAnimations!="function")return[];try{return u.getAnimations()}catch{return[]}},r=u=>e?.resolveStartSeconds?e.resolveStartSeconds(u):Number.parseFloat(u.getAttribute("data-start")??"0")||0,i=(u,c)=>{let m=null;try{m=u.effect?.getComputedTiming?.()??null}catch(g){M("runtime.adapters.css.site5",g)}if(!m)return{};let f=Number(m.endTime);return Number.isFinite(f)?{endSeconds:c+f/1e3}:{unbounded:!0}},o=(u,c)=>{for(let m of u){try{m.currentTime=c}catch(f){M("runtime.adapters.css.site1",f)}try{m.pause()}catch(f){M("runtime.adapters.css.site2",f)}}},a=u=>{for(let c of u)try{c.play()}catch(m){M("runtime.adapters.css.site3",m)}},l=u=>{for(let c of u)try{c.pause()}catch(m){M("runtime.adapters.css.site4",m)}},s=u=>{u.baseDelay?u.el.style.animationDelay=u.baseDelay:u.el.style.removeProperty("animation-delay"),u.basePlayState?u.el.style.animationPlayState=u.basePlayState:u.el.style.removeProperty("animation-play-state")};return{name:"css",discover:()=>{t=[];let u=document.querySelectorAll("*");for(let c of u){if(!(c instanceof HTMLElement))continue;let m=window.getComputedStyle(c);!m.animationName||m.animationName==="none"||t.push({el:c,baseDelay:c.style.animationDelay||"",basePlayState:c.style.animationPlayState||"",animations:n(c)})}},getInferredDurationSeconds:()=>{let u=0;for(let c of t){if(!c.el.isConnected)continue;let m=r(c.el);for(let f of n(c.el)){let g=i(f,m);g.endSeconds!=null&&(u=Math.max(u,g.endSeconds))}}return u>0?u:null},seek:u=>{let c=Number(u.time)||0;for(let m of t){if(!m.el.isConnected)continue;let f=r(m.el),g=Math.max(0,c-f)*1e3,x=m.animations;if(x.length>0){o(x,g);continue}m.el.style.animationPlayState="paused",m.el.style.animationDelay=`-${(g/1e3).toFixed(3)}s`}},pause:()=>{for(let u of t){if(!u.el.isConnected)continue;let c=u.animations;c.length>0&&l(c),s(u)}},play:()=>{for(let u of t)u.el.isConnected&&(s(u),a(u.animations))},revert:()=>{t=[]}}}function as(e){return{name:"gsap",discover:()=>{},seek:t=>{let n=e.getTimeline();if(!n)return;n.pause();let r=Math.max(0,Number(t.time)||0),i=t.suppressEvents===!0;typeof n.totalTime=="function"?(n.totalTime(r+.001,!0),n.totalTime(r,i)):n.seek(r,i)},pause:()=>{let t=e.getTimeline();t&&t.pause()}}}function ss(){return{name:"animejs",discover:()=>{try{let e=window.anime;if(!e||typeof e.running>"u")return;let t=e.running;if(!Array.isArray(t)||t.length===0)return;let n=window.__hfAnime??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfAnime=n}catch(e){M("runtime.adapters.animejs.site1",e)}},seek:e=>{let t=Math.max(0,(Number(e.time)||0)*1e3),n=window.__hfAnime;if(!(!n||n.length===0))for(let r of n)try{typeof r.seek=="function"&&r.seek(t)}catch(i){M("runtime.adapters.animejs.site2",i)}},pause:()=>{let e=window.__hfAnime;if(!(!e||e.length===0))for(let t of e)try{typeof t.pause=="function"&&t.pause()}catch(n){M("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){M("runtime.adapters.animejs.site4",n)}},revert:()=>{}}}function us(){return{name:"lottie",discover:()=>{try{let e=window.lottie;if(e&&typeof e.getRegisteredAnimations=="function"){let t=e.getRegisteredAnimations();if(Array.isArray(t)&&t.length>0){let n=window.__hfLottie??[],r=new Set(n);for(let i of t)r.has(i)||n.push(i);window.__hfLottie=n}}}catch(e){M("runtime.adapters.lottie.site1",e)}},seek:e=>{let t=Math.max(0,Number(e.time)||0),n=window.__hfLottie;if(!(!n||n.length===0))for(let r of n)try{if(Ti(r))r.goToAndStop(t*1e3,!1);else if(Ri(r)){if(typeof r.setCurrentRawFrameValue=="function"){let i=r.totalFrames??0,o=r.frameRate??30,a=t*o;i>0&&r.setCurrentRawFrameValue(Math.min(a,i-1))}else if(typeof r.seek=="function"){let i=r.duration??1,o=Math.min(100,t/i*100);r.seek(o)}}}catch(i){M("runtime.adapters.lottie.site2",i)}},pause:()=>{let e=window.__hfLottie;if(!(!e||e.length===0))for(let t of e)try{(Ti(t)||Ri(t))&&t.pause()}catch(n){M("runtime.adapters.lottie.site3",n)}},revert:()=>{},getInferredDurationSeconds:()=>{let e=window.__hfLottie;if(!e||e.length===0)return null;let t=0,n=!1;for(let r of e){let i=null;try{i=Qf(r)}catch(o){M("runtime.adapters.lottie.site4",o)}i!=null&&(n=!0,t=Math.max(t,i))}return n?t:null}}}function ls(e,t){return!Number.isFinite(e)||!e||e<=0||!Number.isFinite(t)||!t||t<=0?null:e/t}function Qf(e){return Ti(e)?ls(e.totalFrames,e.frameRate):Ri(e)?Number.isFinite(e.duration)&&(e.duration??0)>0?e.duration??null:ls(e.totalFrames,e.frameRate):null}function Ti(e){return typeof e=="object"&&e!==null&&typeof e.goToAndStop=="function"}function Ri(e){return typeof e=="object"&&e!==null&&typeof e.pause=="function"&&("totalFrames"in e||"duration"in e)}var ki=-1,ur=new Set,Ft,Fi=0;function cs(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){M("runtime.adapters.seek-dispatch.site1",o)}finally{n=!1}if(t.length===0)return;let i=Promise.all(t).then(()=>({status:"fulfilled"})).catch(o=>({status:"rejected",reason:o}));ur.add(i),i.then(o=>{ur.delete(i)&&o.status==="rejected"&&Ft===void 0&&(Ft={reason:o.reason})})}function cr(e){e!==ki&&(ki=e,cs(e))}function dr(e){ki=e,cs(e)}function ds(){return Fi>0}async function Mi(){Fi+=1;let e=Ft;try{for(await Promise.resolve();ur.size>0;){let r=(await Promise.all([...ur])).find(i=>i.status==="rejected");e===void 0&&r?.status==="rejected"&&(e={reason:r.reason})}let t=Ft;if(e===void 0&&(e=t),Ft===t&&(Ft=void 0),e)throw e.reason}finally{Fi-=1}}function fs(){let e=null,t=0,n=null,r=null,i=null,o=null,a=()=>{if(typeof window>"u")return null;let c=window.THREE?.DefaultLoadingManager;return!c||typeof c!="object"||typeof c.itemsLoaded!="number"||typeof c.itemsTotal!="number"?null:c},l=u=>{o||u.itemsTotal<=u.itemsLoaded||(o=new Promise(c=>{u.onLoad=function(){try{i?.call(this)}finally{o=null,u.onLoad=i??null,c()}}}))},s=u=>{n!==u&&(n=u,r=u.onStart??null,i=u.onLoad??null,u.onStart=function(c,m,f){try{r?.call(this,c,m,f)}finally{l(u)}})};return{name:"three",discover:()=>{let u=a();u&&(s(u),l(u))},seek:u=>{e=Math.max(0,Number(u.time)||0),t=e,window.__hfThreeTime=e,cr(e)},pause:()=>{e==null&&(e=Math.max(0,t))},play:()=>{e=null},revert:()=>{e=null,t=0},getReadyPromise:()=>{let u=a();return!u||u.itemsTotal<=u.itemsLoaded?null:(o||l(u),o)}}}function $e(e){let t=null,n=new WeakSet;return{name:e.name,discover:()=>{},seek:()=>{},pause:()=>{},play:()=>{},revert:()=>{},getReadyPromise:()=>{let r=e.getInstances();if(r.length===0)return null;let i=r.filter(o=>!n.has(o));return i.length===0?null:t||(t=Promise.allSettled(i.map(o=>e.waitFor(o).then(()=>{n.add(o)}))).then(()=>{t=null}),t)}}}function ms(){return $e({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 ps(){return $e({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 hs(){return $e({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 gs(){return $e({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 bs(){return $e({name:"d3",getInstances:()=>{if(typeof window>"u")return[];let e=window.__hfD3;return Array.isArray(e)?e:[]},waitFor:e=>e.end()})}var Zf=250;function xs(){let e=null,t=0,n=null,r=()=>{n!==null&&(window.clearInterval(n),n=null)},i=()=>{n===null&&document.querySelector("[data-composition-id][data-requires-webgpu]")&&(n=window.setInterval(()=>{e!==null&&(ds()||(window.__hfTypegpuTime=e,dr(e)))},Zf))};return{name:"typegpu",discover:()=>{},seek:o=>{e=Math.max(0,Number(o.time)||0),t=e,window.__hfTypegpuTime=e,cr(e)},pause:()=>{e==null&&(e=Math.max(0,t)),i()},play:()=>{r(),e=null},revert:()=>{r(),e=null,t=0}}}function ys(e){let t=e.nextElementSibling;if(t instanceof HTMLImageElement&&t.classList.contains("__render_frame__")&&t.complete&&t.naturalWidth>0)return t;if(e.id){let n=document.getElementById(`__render_frame_${e.id}__`);if(n instanceof HTMLImageElement&&n.complete&&n.naturalWidth>0)return n}return null}function Ss(){let e=globalThis.GPUQueue;if(!e?.prototype?.copyExternalImageToTexture)return;let t=e.prototype.copyExternalImageToTexture;e.prototype.copyExternalImageToTexture=function(n,r,i){if(n?.source instanceof HTMLVideoElement){let o=ys(n.source);if(o)return t.call(this,{...n,source:o},r,i)}return t.call(this,n,r,i)}}function vs(){let e=[globalThis.WebGL2RenderingContext,globalThis.WebGLRenderingContext],t=["texImage2D","texSubImage2D"];for(let n of e){let r=n?.prototype;if(r)for(let i of t){let o=r[i];if(typeof o!="function"||o.__hfVideoPatched)continue;let a=function(...l){let s=l.length-1,u=l[s];if(u instanceof HTMLVideoElement){let c=ys(u);c&&(l[s]=c)}return o.apply(this,l)};a.__hfVideoPatched=!0,r[i]=a}}}function Es(){let e=!1,t=0,n=!1,r,i,o,a=new Set,l=new WeakMap,s=()=>{if(!document.getAnimations)return[];try{return document.getAnimations()}catch{return[]}},u=y=>{let _=Number(y.currentTime);return Number.isFinite(_)&&_>0?_:0},c=(y,_)=>_<=0?y:y>=_?Math.max(0,y-_):y,m=(y,_)=>{let R=l.get(y);if(R)return R;let T={compositionTimeMs:_,animationTimeMs:e?c(u(y),_):u(y)};return l.set(y,T),T},f=(y,_)=>{if(!a.has(y)){a.add(y);let R=()=>{a.delete(y)};try{y.addEventListener("finish",R,{once:!0}),y.addEventListener("cancel",R,{once:!0})}catch(T){M("runtime.adapters.waapi.site4",T)}}m(y,_)},g=(y,_)=>{for(let R of y)f(R,_)},x=()=>{if(n||typeof Element>"u")return;let y=Element.prototype;if(typeof y.animate!="function"||y.__hfOriginalAnimate)return;let _=y.animate;try{Object.defineProperty(y,"__hfOriginalAnimate",{value:_,configurable:!0});let R=function(...T){let F=_.apply(this,T);return f(F,t),F};y.animate=R,r=y,i=_,o=R,n=!0}catch{}},v=y=>{let _=null;try{_=y.effect?.getComputedTiming?.()??null}catch(F){M("runtime.adapters.waapi.site4",F)}if(!_)return{};let R=Number(_.endTime);return Number.isFinite(R)?{endSeconds:(l.get(y)?.compositionTimeMs??0)/1e3+R/1e3}:{unbounded:!0}};return{name:"waapi",discover:()=>{e=!0,x(),g(s(),t)},seek:y=>{let _=Math.max(0,(Number(y.time)||0)*1e3);t=_,(!e||a.size>0)&&g(s(),e?_:0);for(let R of a){let T=e?m(R,_):m(R,0),F=T.animationTimeMs+Math.max(0,_-T.compositionTimeMs);try{R.currentTime=F}catch(D){M("runtime.adapters.waapi.site1",D)}try{R.pause()}catch(D){M("runtime.adapters.waapi.site2",D)}}},pause:()=>{e||g(s(),t);for(let y of a)try{y.pause()}catch(_){M("runtime.adapters.waapi.site3",_)}},revert:()=>{if(a.clear(),l=new WeakMap,e=!1,t=0,r&&i&&o&&r.animate===o)try{r.animate=i,r.__hfOriginalAnimate===i&&delete r.__hfOriginalAnimate}catch(y){M("runtime.adapters.waapi.site5",y)}r=void 0,i=void 0,o=void 0,n=!1},getInferredDurationSeconds:()=>{let y=0;for(let _ of s()){let R=v(_);R.endSeconds!=null&&(y=Math.max(y,R.endSeconds))}return y>0?y:null}}}function em(e,t,n){let r=e.filter(o=>Number.isFinite(o.time)&&Number.isFinite(o.volume)).map(o=>({time:Math.max(0,o.time-t),volume:Math.max(0,Math.min(1,o.volume))})).sort((o,a)=>o.time-a.time),i=[];for(let o of r){let a=i.at(-1);a&&Math.abs(a.time-o.time)<1e-9?a.volume=o.volume:i.push(o)}return i.length===0||i[0].time>0&&i.unshift({time:0,volume:Math.max(0,Math.min(1,n))}),i}function As(e,t){if(e.length===0)return 1;let n=0;for(;n<e.length-2&&t>=e[n+1].time;)n+=1;let r=e[n],i=e[n+1]??r,o=i.time-r.time,a=o<=0?0:Math.min(1,Math.max(0,(t-r.time)/o));return r.volume+(i.volume-r.volume)*a}function tm(e,t,n,r){let i=e.at(-1);!i||Math.abs(i.volume-n.volume)>1e-4?(i&&t&&t.time>i.time&&e.push(t),e.push(n)):r&&n.time>i.time&&e.push(n)}function fr(e){let t=Number.parseFloat(e??"");return Number.isFinite(t)?t:void 0}function Cs(e,t){let n=fr(e.dataset.start)??0,r=fr(e.dataset.end),i=fr(e.dataset.duration),o=t;i!==void 0&&i>0?o=n+i:r!==void 0&&r>n&&(o=r);let a=fr(e.dataset.volume)??1,l=Math.max(0,Math.min(1,a));return{start:n,end:o,staticVolume:l}}function nm(e,t,n,r){let{start:i,end:o,staticVolume:a}=Cs(e,n);e.volume=a;let l=1/Math.min(60,Math.max(1,r)),s=Math.max(0,i),u=Math.min(n,o),c=[],m;for(let g=s;g<=u+1e-6;g=Math.min(u,g+l)){t(g);let x=Number(e.volume);if(Number.isFinite(x)){let v=Math.max(0,Math.min(1,x)),y={time:Number(g.toFixed(6)),volume:Number(v.toFixed(6))};tm(c,m,y,g===u),m=y}if(g===u)break}return c.some(g=>Math.abs(g.volume-a)>1e-4)?c:null}function ws(e,t,n,r,i={}){if(i.allowLiveTimelineSeek===!1||!t||!(e instanceof HTMLAudioElement)&&!(e instanceof HTMLVideoElement)||n<=0)return;let o=s=>{try{typeof t.totalTime=="function"?t.totalTime(s,!0):typeof t.seek=="function"&&t.seek(s,!0)}catch{}},a=typeof t.totalTime=="function"?Number(t.totalTime()):typeof t.seek=="function"?Number(t.seek()):0,l=nm(e,o,n,60);if(Number.isFinite(a)&&o(a),l){let{start:s,staticVolume:u}=Cs(e,n),c=em(l,s,u);c.length>0&&r.set(e,c)}}var pr="data-fx-chain",zy=pr.slice(5),_s=1,ln=(e="frequency",t="Frequency",n=1e3,r=20,i=2e4)=>({kind:"number",key:e,label:t,unit:"Hz",min:r,max:i,step:1,default:n,scale:"log",automatable:!0}),Ni=(e=.707,t="Bandwidth \u2014 higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:e,scale:"log",automatable:!0,hint:t}),mr=(e=-40,t=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:e,max:t,step:.1,default:n,automatable:!0}),Ts={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."},Rs=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[mr(-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:[ln("frequency","Frequency",1e3),mr(-40,40,0),Ni(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[ln("frequency","Frequency",200,20,2e3),mr(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[ln("frequency","Frequency",4e3,500,2e4),mr(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies \u2014 the usual fix for rumble on a voice.",params:[ln("frequency","Cutoff",300,20,2e4),Ni(.707),Ts],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies \u2014 darkens or muffles a track.",params:[ln("frequency","Cutoff",8e3,100,2e4),Ni(.707),Ts],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:"Hard ceiling \u2014 nothing gets past the 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:"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 \u2014 a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{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"}],Li=new Map(Rs.map(e=>[e.id,e]));function un(e){return Li.get(e)}var qy=Rs.map(e=>e.id);function cn(e,t){let n=Li.get(e);if(!n)return{};let r={};for(let i of n.params){let o=t?.[i.key];if(i.kind==="enum"){let l=i.options.some(s=>s.value===o);r[i.key]=l?o:i.default;continue}let a=typeof o=="number"?o:typeof o=="string"&&o.trim()!==""?Number(o):Number.NaN;r[i.key]=Number.isFinite(a)?Math.min(i.max,Math.max(i.min,a)):i.default}return r}var ot=class extends Error{constructor(t){super(t),this.name="AudioFxChainError"}};function ks(e){let t;try{t=JSON.parse(e)}catch(i){throw new ot(`Chain file is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new ot("Chain file must be a JSON object.");let n=t;if(n.version!==_s)throw new ot(`Unsupported chain version: ${String(n.version)}`);if(!Array.isArray(n.nodes))throw new ot("Chain file is missing a `nodes` array.");let r=n.nodes.map((i,o)=>{if(typeof i!="object"||i===null)throw new ot(`Node ${o} is not an object.`);let a=i;if(typeof a.type!="string"||!Li.has(a.type))throw new ot(`Node ${o} has unknown effect type: ${String(a.type)}`);return{type:a.type,...typeof a.id=="string"&&a.id?{id:a.id}:{},...a.fromCarve===!0?{fromCarve:!0}:{},...typeof a.fromPreset=="string"&&a.fromPreset?{fromPreset:a.fromPreset}:{},...typeof a.label=="string"&&a.label?{label:a.label}:{},...typeof a.fromEq=="string"&&a.fromEq?{fromEq:a.fromEq}:{},...a.fromLeveller===!0?{fromLeveller:!0}:{},...typeof a.presetAmount=="number"&&Number.isFinite(a.presetAmount)?{presetAmount:Math.min(1,Math.max(0,a.presetAmount))}:{},enabled:a.enabled!==!1,params:cn(a.type,a.params??void 0)}});return{version:_s,nodes:r}}function dn(e){return e.nodes.filter(t=>t.enabled!==!1)}var Mt="data-automation",Ky=Mt.slice(5),hr=1,rm=512,Qe=class extends Error{constructor(t){super(t),this.name="AudioAutomationError"}},Nt="volume";function mn(e){if(e===Nt)return{kind:"volume"};let t=e.split(".");if(t.length===3&&t[0]==="fx"&&t[1]===im){let i=t[2];return i?{kind:"preset",presetId:i}: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 im="preset";var om={min:0,max:1,step:.01,unit:"",label:"Amount",scale:"linear",default:1},gr={min:0,max:1,step:.01,unit:"",label:"Volume",scale:"linear",default:1};function Di(e,t){let n=mn(e);if(!n)return null;if(n.kind==="volume")return gr;if(n.kind==="preset")return t?.nodes.some(l=>l.fromPreset===n.presetId)?{...om,label:`${n.presetId} \xB7 Amount`}:null;let r=t?.nodes.find(a=>a.id===n.nodeId);if(!r)return null;let i=un(r.type),o=i?.params.find(a=>a.key===n.param);return!o||o.kind!=="number"?null:{min:o.min,max:o.max,step:o.step,unit:o.unit,label:`${i?.label??r.type} \xB7 ${o.label}`,scale:o.scale==="log"&&o.min>0?"log":"linear",default:o.default}}function fn(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 am(e){let t=fn(e);return t===null||t===0?0:Math.min(1,Math.max(-1,t))}function Fs(e,t){let n=fn(e),r=fn(t);if(n===null||r===null)return null;let i=l=>Math.min(.999,Math.max(.001,l)),o=i(n),a=i(r);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function sm(e){let t=am(e?.curve),n=Fs(e?.viaX,e?.viaY);return{...t?{curve:t}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function lm(e,t){let n=fn(e?.t),r=fn(e?.v);if(n===null||r===null)return null;let i=t?Math.min(t.max,Math.max(t.min,r)):r;return{t:Math.max(0,n),v:i,...sm(e)}}function Ms(e,t){let n=e.map(i=>lm(i,t)).filter(i=>i!==null).sort((i,o)=>i.t-o.t),r=[];for(let i of n)r.length>0&&r[r.length-1].t===i.t?r[r.length-1]=i:r.push(i);return r.slice(0,rm)}function um(e){let t=[];for(let n of e.lanes){if(!mn(n.target))continue;let r=n.target===Nt?gr:null,i=Ms(n.points??[],r);i.length>0&&t.push({target:n.target,points:i})}return{version:hr,lanes:t}}function Ns(e,t){let n=[];for(let r of e.lanes){let i=Di(r.target,t);if(!i)continue;let o=Ms(r.points,i);o.length>0&&n.push({target:r.target,points:o})}return{version:hr,lanes:n}}function br(e){let t;try{t=JSON.parse(e)}catch(i){throw new Qe(`Automation is not valid JSON: ${i.message}`)}if(typeof t!="object"||t===null)throw new Qe("Automation must be a JSON object.");let n=t;if(n.version!==hr)throw new Qe(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new Qe("Automation is missing a `lanes` array.");let r=n.lanes.map((i,o)=>{if(typeof i!="object"||i===null)throw new Qe(`Lane ${o} is not an object.`);let a=i;if(typeof a.target!="string"||!mn(a.target))throw new Qe(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new Qe(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return um({version:hr,lanes:r})}function cm(e,t){return t?Math.pow(e,Math.pow(2,2*t)):e}function dm(e,t){let n=e-.5,r=t-.5,i=.999,o=1e6,a=n>0?n/(i-e):n<0?-n/(e-(1-i)):0,l=r>0?r/(i-t):r<0?-r/(t-(1-i)):0,s=Math.min(o,Math.max(1,a,l));return{cx:e+n/s,cy:t+r/s,w:s}}function fm(e,t,n){let{cx:r,cy:i,w:o}=dm(t,n),a=2-2*o,l=e*a-1+2*o*r,s=-e*a-2*o*r,u=mm(l,s,e),c=1-u,m=c*c+2*o*u*c+u*u;return m>0?(2*o*i*u*c+u*u)/m:e}function mm(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)),i=(-t+r)/(2*e),o=(-t-r)/(2*e),a=l=>l>=-1e-9&&l<=1+1e-9;return a(i)?Math.min(1,Math.max(0,i)):a(o)?Math.min(1,Math.max(0,o)):n}function pm(e,t){let n=Fs(t.viaX,t.viaY);return n?fm(Math.min(1,Math.max(0,e)),n.x,n.y):cm(e,t.curve)}function hm(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 pn(e,t,n="linear"){let r=e.points;if(r.length===0)return 0;let i=r[0];if(t<=i.t)return i.v;let o=r[r.length-1];if(t>=o.t)return o.v;let a=0,l=r.length-1;for(;l-a>1;){let m=a+l>>1;r[m].t<=t?a=m:l=m}let s=r[a],u=r[l],c=u.t-s.t;return c<=0?u.v:hm(s.v,u.v,pm((t-s.t)/c,s),n)}function Ls(e){return e.points.length<=1||e.points.every(t=>t.v===e.points[0].v)}function Ds(e,t,n,r,i="linear"){let o=Math.max(2,Math.floor(r)),a=new Float32Array(o),l=n-t;for(let s=0;s<o;s+=1)a[s]=pn(e,t+l*s/(o-1),i);return a}var xr=new Map,gm=64;function bm(e){let t=xr.get(e);if(t!==void 0)return t;let n=null;try{n=br(e).lanes.find(r=>r.target===Nt)??null}catch{n=null}return xr.size>gm&&xr.clear(),xr.set(e,n),n}function Is(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(Mt):null)??"";if(!n)return null;let r=bm(n);return!r||r.points.length===0?null:pn(r,t)}function Ps(e){return Number.isFinite(e)&&e>0?Math.max(.1,Math.min(5,e)):1}function je(e){let t=Number.parseFloat(e.getAttribute("data-playback-rate")??""),n=Number.isFinite(t)&&t>0?t:e instanceof HTMLMediaElement?e.defaultPlaybackRate:1;return Ps(n)}function It(e){let t=Number.parseFloat(e.getAttribute("data-playback-start")??e.getAttribute("data-media-start")??"");return Number.isFinite(t)&&t>=0?t:0}function Os(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 Hs(e){let t=Array.from(document.querySelectorAll("video, audio")),n=e?.shouldIncludeElement?t.filter(a=>e.shouldIncludeElement?.(a)):t.filter(a=>a.hasAttribute("data-start")),r=[],i=[],o=0;for(let a of n){let l=e?.resolveStartSeconds?e.resolveStartSeconds(a):Number.parseFloat(a.dataset.start??"0");if(!Number.isFinite(l))continue;let s=Number.parseFloat(a.dataset.playbackStart??a.dataset.mediaStart??"0")||0,u=je(a),c=a.loop,m=Number.isFinite(a.duration)&&a.duration>0?a.duration:null,f=e?.resolveDurationSeconds?.(a)??Number.parseFloat(a.dataset.duration??"");(!Number.isFinite(f)||f<=0)&&m!=null&&(f=Math.max(0,(m-s)/u));let g=Number.isFinite(f)&&f>0?l+f:Number.POSITIVE_INFINITY,x=Number.parseFloat(a.dataset.volume??""),v={el:a,start:l,mediaStart:s,duration:Number.isFinite(f)&&f>0?f:Number.POSITIVE_INFINITY,end:g,volume:Number.isFinite(x)?x:null,playbackRate:u,loop:c,sourceDuration:m};r.push(v),a.tagName==="VIDEO"&&i.push(v),Number.isFinite(g)&&(o=Math.max(o,g))}return{timedMediaEls:n,mediaClips:r,videoClips:i,maxMediaEnd:o}}var Ii=new WeakMap,hn=new WeakMap,Pi=new WeakSet,Dt=new WeakSet;function xm(e){if(Dt.has(e))return;Dt.add(e);let t=()=>Dt.delete(e);e.addEventListener("playing",t,{once:!0}),e.addEventListener("pause",t,{once:!0}),e.addEventListener("error",t,{once:!0})}var ym=3;function Sm(e){return e.error!=null||e.networkState===ym}var Oi=new WeakMap;function Lt(e){return Number.isFinite(e)?Math.max(0,Math.min(1,e)):1}function Hi(e){Ii.delete(e),hn.delete(e),Pi.delete(e),Oi.delete(e)}function Gs(e){let t=!!(e.outputMuted||e.userMuted);for(let n of e.clips){let{el:r}=n;if(!r.isConnected)continue;let i=(e.timeSeconds-n.start)*n.playbackRate+n.mediaStart,o=r.tagName==="VIDEO"&&!n.loop,a=o&&n.sourceDuration!=null&&i>=n.sourceDuration&&e.timeSeconds>=n.start&&e.timeSeconds<n.end;a&&n.sourceDuration!=null&&(i=n.sourceDuration);let l=o&&n.sourceDuration!=null&&i>=n.mediaStart&&i<n.sourceDuration;if(e.timeSeconds>=n.start&&e.timeSeconds<n.end&&i>=0&&(!r.ended||n.loop||a||l)){if(n.loop&&n.sourceDuration!=null&&n.sourceDuration>0){let j=n.sourceDuration-n.mediaStart;j>0&&i>=n.sourceDuration&&(i=n.mediaStart+(i-n.mediaStart)%j)}let u=Lt(e.userVolume??1),c=Lt(n.volume??1),m=Oi.get(r),f=Lt(r.volume),g,x=Is(r,e.timeSeconds-n.start);if(x!==null)g=Lt(x);else if(n.volumeKeyframes&&n.volumeKeyframes.length>0){let j=e.timeSeconds-n.start;g=Lt(As(n.volumeKeyframes,j))}else m===void 0||Math.abs(f-m)>1e-4?g=f:g=c;let v=Lt(g*u);r.volume=v,Oi.set(r,v),e.onElementVolume?.(r,v),(t||e.isWebAudioOwned?.(r))&&(r.muted=!0),r.preload!=="auto"&&(r.preload="auto");try{r.playbackRate=n.playbackRate*e.playbackRate}catch(j){M("runtime.media.site1",j)}let y=.04,_=2,R=r.currentTime||0,T=Math.abs(R-i),F=i-R,D=Ii.get(r);Ii.set(r,F);let C=D===void 0,S=!C&&Math.abs(F-D)>.5,E=T>3,w=a&&T>.001||r.ended&&l&&T>.001||T>.5&&(C||S||E),k=r.tagName==="VIDEO"&&!r.paused,L=D!==void 0&&Math.abs(F-D)<.004,H=!1;if(!k&&!w&&!C&&L&&T>y){let j=(hn.get(r)??0)+1;hn.set(r,j),j>=_&&(H=!0,hn.set(r,0))}else T<=y&&hn.set(r,0);let V=!k&&e.forceSync&&T>.02;if(w||H||V){if(!(r.tagName==="VIDEO"&&r.id&&!!document.getElementById(`__render_frame_${r.id}__`))){try{r.currentTime=i}catch(O){M("runtime.media.site2",O)}if(Math.abs(r.currentTime-i)>.5&&!Pi.has(r)){Pi.add(r),r.load();try{r.currentTime=i}catch(O){M("runtime.media.site3",O)}}}Dt.delete(r)}a?r.paused||r.pause():e.playing&&r.paused&&!Dt.has(r)&&!Sm(r)?(xm(r),r.play().catch(j=>{Dt.delete(r),(j&&typeof j=="object"&&"name"in j?String(j.name??""):"")==="NotAllowedError"&&e.onAutoplayBlocked?.()})):!e.playing&&!r.paused&&r.pause();continue}Hi(r),r.paused||r.pause()}}var vm="hf-proxy",Bs="runtime_media_proxy_fallback",Us="runtime_media_proxy_unavailable",gn=new WeakSet,Ws=new WeakSet;function yr(e){return e.currentSrc||e.src}function Gi(e){return window.__HF_EXPORT_RENDER_SEEK_CONFIG?!0:e instanceof HTMLVideoElement&&!!e.id&&!!document.getElementById(`__render_frame_${e.id}__`)}function Bi(e){let t=yr(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 Em(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 Am(e,t){let n=e.normalize("NFC").toLowerCase(),r=-1,i=null,o=!1;for(let[a,l]of Object.entries(t)){let s=a.normalize("NFC").toLowerCase();n.endsWith(s)&&(s.length>r?(r=s.length,i=l,o=!1):s.length===r&&(o=!0))}return o?null:i}function Ui(e,t){return t[e]??Em(e,t)??Am(e,t)}function Cm(e,t){let n=new URL(e,document.baseURI);return n.searchParams.set(vm,t?t.hasAlpha?"vp8":"h264":"auto"),n.href}var wm={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 St(e,t,n){if(Ws.has(e))return;Ws.add(e);let r=wm[t];xe({source:"hf-preview",type:"diagnostic",code:Us,details:{asset:n,codecName:null,reason:t,note:r}}),console.info(`[hyperframes] ${Us}: "${n}" (${t}): ${r}`)}function Wi(e,t=null,n="reactive"){if(gn.has(e))return;let r=yr(e),i;try{i=Cm(r,t)}catch(l){M("runtime.mediaProxy.swap",l),St(e,"invalid_source_url",r);return}gn.add(e),Hi(e),e.src=i,e.load();let o=t?.codecName??null;xe({source:"hf-preview",type:"diagnostic",code:Bs,details:{asset:r,codecName:o,trigger:n,note:"render output is unaffected; only this preview element was swapped to an authoring proxy"}}),console.info(`[hyperframes] ${Bs}: "${r}" uses a codec (${o??"unknown"}) this browser can't decode; auto-swapped to an authoring proxy for this preview only. Render output is unaffected.`)}function Vs(e){if(Gi(e)||!(e instanceof HTMLVideoElement)||gn.has(e))return;let t=window.__HF_MEDIA_CODEC_MAP__;if(!t)return;let n=Bi(e);if(n===null)return;let r=Ui(n,t);if(!r||!r.browserHostile)return;let i=r.representativeMime?e.canPlayType(r.representativeMime):"";i==="probably"||i==="maybe"||Wi(e,r,"proactive")}function zs(e){if(Gi(e)||!(e instanceof HTMLVideoElement)||e.videoWidth!==0)return;let t=yr(e);if(gn.has(e)){St(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Bi(e);if(r===null){St(e,"cross_origin",t);return}let i=Ui(r,n);if(i&&!i.browserHostile){St(e,"browser_safe_codec",t);return}Wi(e,i,"reactive")}function qs(e){if(Gi(e)||!(e instanceof HTMLVideoElement))return;let t=yr(e);if(gn.has(e)){St(e,"proxy_playback_failed",t);return}let n=window.__HF_MEDIA_CODEC_MAP__;if(!n)return;let r=Bi(e);if(r===null){St(e,"cross_origin",t);return}let i=Ui(r,n);if(i&&!i.browserHostile){St(e,"browser_safe_codec",t);return}Wi(e,i,"tertiary")}var ye=class extends Error{constructor(n,r=null){super(r==null?n:`${n} at line ${r}`);ge(this,"lineNumber");this.name="CubeLutParseError",this.lineNumber=r}},_m=[0,0,0],Tm=[1,1,1],Sr=64;function Rm(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 at(e,t){let n=Number(e);if(!Number.isFinite(n))throw new ye(`Invalid number "${e}"`,t);return n}function $s(e,t,n){if(e.length!==3)throw new ye(`${t} expects three numbers`,n);return[at(e[0],n),at(e[1],n),at(e[2],n)]}function js(e,t,n){if(!e)throw new ye(`${t} expects a size`,n);let r=Number(e);if(!Number.isInteger(r)||r<2)throw new ye(`${t} must be an integer greater than 1`,n);return r}function km(e,t){if(t[0]<=e[0]||t[1]<=e[1]||t[2]<=e[2])throw new ye("DOMAIN_MAX values must be greater than DOMAIN_MIN values")}function Fm(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 Mm(e){return/^[+-]?(?:\d|\.\d)/.test(e)}function Ks(e,t={}){let n=t.maxSize??Sr,r=null,i=_m,o=Tm,a=null,l=null,s=[],u=e.replace(/^\uFEFF/,"").split(/\r?\n/);for(let m=0;m<u.length;m++){let f=m+1,g=Rm(u[m]??"").trim();if(!g)continue;let x=g.split(/\s+/),v=(x[0]??"").toUpperCase(),y=x.slice(1);if(v==="TITLE"){r=Fm(g);continue}if(v==="DOMAIN_MIN"){i=$s(y,v,f);continue}if(v==="DOMAIN_MAX"){o=$s(y,v,f);continue}if(v==="LUT_3D_INPUT_RANGE"){if(y.length!==2)throw new ye(`${v} expects two numbers`,f);let _=at(y[0],f),R=at(y[1],f);if(R<=_)throw new ye("LUT_3D_INPUT_RANGE max must exceed min",f);i=[_,_,_],o=[R,R,R];continue}if(v==="LUT_1D_SIZE"){a=js(y[0],v,f);continue}if(v==="LUT_3D_SIZE"){if(l=js(y[0],v,f),l>n)throw new ye(`LUT_3D_SIZE ${l} exceeds max ${n}`,f);continue}if(!Mm(v)){if(v.startsWith("LUT_"))throw new ye(`Unsupported cube keyword ${v}`,f);continue}if(!l)throw a?new ye("1D cube LUTs are not supported yet",f):new ye("LUT data appears before LUT_3D_SIZE",f);if(x.length!==3)throw new ye("LUT data rows must contain three numbers",f);s.push(at(x[0],f),at(x[1],f),at(x[2],f))}if(a&&l)throw new ye("Mixed 1D and 3D cube LUTs are not supported yet");if(!l)throw a?new ye("1D cube LUTs are not supported yet"):new ye("Missing LUT_3D_SIZE");km(i,o);let c=l*l*l;if(s.length!==c*3)throw new ye(`Expected ${c} LUT rows for size ${l}, found ${s.length/3}`);return{title:r,size:l,domainMin:i,domainMax:o,data:new Float32Array(s)}}function Nm(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):0}function bn(e){return Math.round(Nm(e)*255)}function Vi(e){let t=e.size,n=t*t,r=t,i=new Uint8Array(n*r*4);for(let o=0;o<t;o++)for(let a=0;a<t;a++)for(let l=0;l<t;l++){let s=((o*t+a)*t+l)*3,u=(a*n+o*t+l)*4;i[u]=bn(e.data[s]??0),i[u+1]=bn(e.data[s+1]??0),i[u+2]=bn(e.data[s+2]??0),i[u+3]=255}return{width:n,height:r,data:i}}var Ys="rec709";var de={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 Xs=["exposure","contrast","highlights","shadows","whites","blacks","temperature","tint","vibrance","saturation"],Js=["shadows","midtones","highlights"],Qs=["master","red","green","blue"],Zs=["hueVsHue","hueVsSaturation","hueVsLuma"];var el=["vignette","vignetteMidpoint","vignetteRoundness","vignetteFeather","grain","grainSize","grainRoughness"],tl=["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 c1=de.unit,d1=de.signedUnit,f1=de.effects;var Ke=1024,xn=16;function nl(e,t,n,r){let i=((2*e+t)*n-e*r)/(e+t);return Math.sign(i)!==Math.sign(n)?0:Math.sign(n)!==Math.sign(r)&&Math.abs(i)>3*Math.abs(n)?3*n:i}function Se(e,t){let n=e[t];if(n===void 0)throw new RangeError("Color curve points must be contiguous");return n}function Lm(e){let t=[],n=[],r=Se(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 i=Se(n,0);if(e.length===2)return[i,i];let o=new Array(e.length);o[0]=nl(Se(t,0),Se(t,1),i,Se(n,1)),o[o.length-1]=nl(Se(t,t.length-1),Se(t,t.length-2),Se(n,n.length-1),Se(n,n.length-2));for(let a=1;a<e.length-1;a+=1){let l=Se(n,a-1),s=Se(n,a);if(l===0||s===0||Math.sign(l)!==Math.sign(s)){o[a]=0;continue}let u=Se(t,a-1),c=Se(t,a),m=2*c+u,f=c+2*u;o[a]=(m+f)/(m/l+f/s)}return o}function rl(e,t){if(e.length<2)throw new RangeError("A color curve requires at least two points");if(!Number.isInteger(t)||t<2)throw new RangeError("Curve LUT size must be at least 2");let n=Number.NEGATIVE_INFINITY;for(let[r,i]of e){if(!Number.isFinite(r)||!Number.isFinite(i))throw new TypeError("Color curve points must be finite");if(r<=n)throw new RangeError("Color curve inputs must be strictly increasing");n=r}}function Dm(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 Im(e,t,n,r,i){let o=n[0]-t[0],a=Math.min(1,Math.max(0,(e-t[0])/o)),l=a*a,s=l*a;return(2*s-3*l+1)*t[1]+(s-2*l+a)*o*r+(-2*s+3*l)*n[1]+(s-l)*o*i}function il(e,t,n,r,i){Dm(e,r,i);let o=Lm(e),a=new Float32Array(t),l=0;for(let s=0;s<t;s+=1){let u=n(s);for(;l<e.length-2&&u>Se(e,l+1)[0];)l+=1;let c=Se(e,l),m=Se(e,l+1),f=Im(u,c,m,Se(o,l),Se(o,l+1));a[s]=Math.min(i,Math.max(r,f))}return a}function Pt(e,t=Ke){if(rl(e,t),e.length>xn)throw new RangeError(`A color curve supports at most ${xn} 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 il(e,t,n=>n/(t-1),0,1)}function qi(e,t,n,r=Ke){if(e.length<3)throw new RangeError("A hue curve requires at least three points");if(e.length>xn)throw new RangeError(`A hue curve supports at most ${xn} points`);let i=[...e].sort((s,u)=>s[0]-u[0]);for(let s=0;s<i.length;s+=1){let u=i[s];if(!u||u[0]<0||u[0]>=360)throw new RangeError("Hue curve inputs must be from 0 up to 360 degrees");if(s>0&&u[0]===i[s-1]?.[0])throw new RangeError("Hue curve inputs must be unique")}let o=i.slice(-2).map(([s,u])=>[s-360,u]),a=i.slice(0,2).map(([s,u])=>[s+360,u]),l=[...o,...i,...a];return rl(l,r),il(l,r,s=>s/r*360,t,n)}var yn="data-color-grading",Sn="data-hf-color-grading-source-hidden",Ar="data-hf-authored-opacity",ul="__hf_color_grading_",Om=Ys,Ki={exposure:0,contrast:0,highlights:0,shadows:0,whites:0,blacks:0,temperature:0,tint:0,vibrance:0,saturation:0},Yi={vignette:0,vignetteMidpoint:.5,vignetteRoundness:0,vignetteFeather:.65,grain:0,grainSize:.25,grainRoughness:.5},Xi={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 Cr=Xs,cl=Js,dl=Qs,fl=Zs,Qi=el,Zi=tl,ol={exposure:.03,contrast:-.12,highlights:-.1,shadows:.16,whites:-.04,blacks:.08,temperature:.13,vibrance:-.08,saturation:-.08},al={vignette:.18};function ve(e,t,n={},r={},i={},o=1){return{id:e,label:t,intensity:o,adjust:{...Ki,...n},details:{...Yi,...r},effects:{...Xi,...i}}}var eo=[ve("neutral","Neutral"),ve("warm-daylight","Warm Daylight",{exposure:.06,contrast:.07,highlights:-.06,shadows:.08,temperature:.18,saturation:.08}),ve("clean-studio","Clean Studio",{contrast:.08,highlights:-.08,shadows:.06,temperature:-.08,tint:.03,saturation:.04}),ve("skin-soft","Skin Soft",{exposure:.04,contrast:-.03,highlights:-.12,shadows:.12,temperature:.08,tint:.02,saturation:.04}),ve("food-pop","Food Pop",{exposure:.06,contrast:.1,shadows:.06,temperature:.14,vibrance:.1,saturation:.18}),ve("night-lift","Night Lift",{exposure:.08,contrast:.08,highlights:-.18,shadows:.2,blacks:-.08,saturation:.04},{vignette:.12}),ve("muted-editorial","Muted Editorial",{exposure:-.02,contrast:.08,highlights:-.08,shadows:.06,blacks:-.05,temperature:-.03,saturation:-.12},{vignette:.1}),ve("vintage-wash","Vintage Wash",ol,al),ve("mono-clean","Mono Clean",{contrast:.12,highlights:-.04,shadows:.04,blacks:-.08,saturation:-1}),ve("mono-fade","Mono Fade",{contrast:-.04,highlights:-.06,shadows:.1,blacks:.12,saturation:-1},{vignette:.08}),ve("soft-boost","Soft Boost",{exposure:.06,contrast:-.04,highlights:-.14,shadows:.16,vibrance:.08,saturation:.1}),ve("bright-pop","Bright Pop",{exposure:.12,contrast:.12,whites:.08,blacks:-.04,vibrance:.08,saturation:.14}),ve("deep-contrast","Deep Contrast",{exposure:-.03,contrast:.2,highlights:-.08,shadows:-.08,blacks:-.12,saturation:.06}),ve("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),ve("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}),ve("home-movie-8mm","8mm Home Movie",ol,{...al,vignette:.28,vignetteMidpoint:.54,vignetteFeather:.72,grain:.34,grainSize:.18,grainRoughness:.72},{filmArtifacts:.62},.72),ve("editorial-halftone","Editorial Halftone",{contrast:.04,saturation:.04},{},{halftone:.94,halftoneSize:.36}),ve("two-ink-print","Two-Ink Print",{contrast:.08,highlights:-.06,shadows:.04},{},{twoInkPrint:1,twoInkPrintSize:.42})],Hm=new Map(eo.map(e=>[e.id,e])),Gm=/^\$(?:\{([A-Za-z0-9_.:-]+)\}|([A-Za-z0-9_.:-]+))$/,Bm={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}},Ot={hue:0,amount:0,level:0},sl={amount:de.unit,level:de.signedUnit},st=[[0,0],[1,1]],Ht=[],Um={hueVsHue:de.secondaryHueShift,hueVsSaturation:de.signedUnit,hueVsLuma:de.signedUnit},$i={center:0,range:180,softness:0},ji={min:0,max:1,softness:.05},Wm={vignette:de.unit,vignetteMidpoint:de.unit,vignetteRoundness:de.signedUnit,vignetteFeather:de.unit,grain:de.unit,grainSize:de.unit,grainRoughness:de.unit},Ji=de.unit,Vm=de.effects,ml=["blur","pixelate","chromaBleed","tapeDamage","filmArtifacts","halftone","twoInkPrint","ascii","dither","bloom","monoScreen","scanlines","chromaticAberration","crtCurvature","digitalGlitch","engraving","crosshatch","kuwahara"];var zm=eo.filter(e=>ml.some(t=>e.effects[t]>1e-4)),S1=eo.filter(e=>!zm.includes(e)),v1={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}},pl=[{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 qm=/^#[0-9a-f]{6}$/i;function $m(e){return!Array.isArray(e)||e.length<2||e.length>6||!e.every(t=>typeof t=="string"&&qm.test(t))?null:e.map(t=>t.toLowerCase())}function Ce(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Er(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,e)):0}function hl(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Math.min(1,Math.max(0,n)):t}function Te(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?Er(n,t.min,t.max):0}function to(e,t=0){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?(n%360+360)%360:t}function jm(e){let t=Ce(e)?e:{};return cl.reduce((n,r)=>{let i=Ce(t[r])?t[r]:{};return n[r]={hue:to(i.hue,Ot.hue),amount:Te(i.amount??Ot.amount,sl.amount),level:Te(i.level??Ot.level,sl.level)},n},{shadows:{...Ot},midtones:{...Ot},highlights:{...Ot}})}function Km(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)?[Er(t,0,1),Er(n,0,1)]:null}function gl(e){return e.some((t,n)=>n>0&&t[0]===e[n-1]?.[0])}function Ym(e){(e[0]?.[0]??0)>0&&e.unshift([0,0]),(e.at(-1)?.[0]??1)<1&&e.push([1,1])}function Xm(e){if(!Array.isArray(e)||e.length<2)return st;let t=[];for(let n of e){let r=Km(n);if(!r)return st;t.push(r)}return t.sort((n,r)=>n[0]-r[0]),gl(t)||(Ym(t),t.length>16)?st:t}function Jm(e){let t=Ce(e)?e:{};return dl.reduce((n,r)=>(n[r]=Xm(t[r]),n),{master:st,red:st,green:st,blue:st})}function Qm(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)?[to(n),Er(r,t.min,t.max)]:null}function Zm(e,t){if(!Array.isArray(e)||e.length<3||e.length>16)return Ht;let n=[];for(let r of e){let i=Qm(r,t);if(!i)return Ht;n.push(i)}return n.sort((r,i)=>r[0]-i[0]),gl(n)?Ht:n}function ep(e){let t=Ce(e)?e:{};return fl.reduce((n,r)=>(n[r]=Zm(t[r],Um[r]),n),{hueVsHue:Ht,hueVsSaturation:Ht,hueVsLuma:Ht})}function ll(e){let t=Ce(e)?e:{},n=Te(t.min??ji.min,Ji),r=Te(t.max??ji.max,Ji);return{min:Math.min(n,r),max:Math.max(n,r),softness:Te(t.softness??ji.softness,de.secondarySoftRangeSoftness)}}function tp(e){let t=Ce(e)?e:{},n=Te(t.range??$i.range,de.secondaryHueRange);return{center:to(t.center,$i.center),range:n,softness:Te(t.softness??$i.softness,{min:de.secondaryHueSoftness.min,max:de.secondaryHueCombinedMax-n})}}function np(e){return{hueShift:Te(e.hueShift??0,de.secondaryHueShift),saturation:Te(e.saturation??0,de.signedUnit),luma:Te(e.luma??0,de.signedUnit),temperature:Te(e.temperature??0,de.signedUnit),tint:Te(e.tint??0,de.signedUnit)}}function rp(e){return!Ce(e)||!Ce(e.key)||!Ce(e.correction)?null:{enabled:e.enabled!==!1,key:{hue:tp(e.key.hue),saturation:ll(e.key.saturation),luma:ll(e.key.luma)},correction:np(e.correction)}}function ip(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,4)){let r=rp(n);r&&t.push(r)}return t}function op(e){if(e==null)return null;let t=String(e).trim();return t||null}function ap(e){if(e==null)return null;if(typeof e=="string"){let n=e.trim();return n?{src:n,intensity:1}:null}if(!Ce(e))return null;let t=e.src;return typeof t!="string"||t.trim()===""?null:{src:t.trim(),intensity:hl(e.intensity,1)}}function sp(e){if(typeof e=="string"){let t=e.trim();if(!t)return null;if(t.startsWith("{"))try{let n=JSON.parse(t);return Ce(n)?n:null}catch{return null}return{preset:t}}return Ce(e)?e:null}function lp(e,t){let n=e.trim().match(Gm);if(!n)return e;let r=n[1]??n[2]??"";return r&&Object.hasOwn(t,r)?t[r]:e}function vr(e,t){if(typeof e=="string"){let r=lp(e,t);if(r!==e)return r;let i=e.trim();if(!i.startsWith("{"))return e;try{return vr(JSON.parse(i),t)}catch{return e}}if(Array.isArray(e))return e.map(r=>vr(r,t));if(!Ce(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=vr(i,t);return n}function up(e){return e?Hm.get(e)??null:null}function wr(e){let t=sp(e);if(!t||t.enabled===!1)return null;let n=op(t.preset),r=up(n),i=r?.adjust??Ki,o=r?.details??Yi,a=r?.effects??Xi,l=Ce(t.adjust)?t.adjust:{},s=Ce(t.details)?t.details:{},u=Ce(t.effects)?t.effects:{},c=Cr.reduce((g,x)=>(g[x]=Te(l[x]??i[x],Bm[x]),g),{...Ki}),m=Qi.reduce((g,x)=>(g[x]=Te(s[x]??o[x],Wm[x]),g),{...Yi}),f=Zi.reduce((g,x)=>(g[x]=Te(u[x]??a[x],Vm[x]??Ji),g),{...Xi});return{enabled:!0,preset:n,intensity:hl(t.intensity,r?.intensity??1),adjust:c,wheels:jm(t.wheels),curves:Jm(t.curves),hueCurves:ep(t.hueCurves),secondaries:ip(t.secondaries),details:m,effects:f,palette:$m(t.palette),lut:ap(t.lut),colorSpace:typeof t.colorSpace=="string"&&t.colorSpace.trim()?t.colorSpace.trim():Om}}function bl(e,t){return wr(vr(e,t))}function cp(e){return cl.some(t=>Math.abs(e[t].amount)>1e-4||Math.abs(e[t].level)>1e-4)}function no(e){return dl.some(t=>e[t].some(([n,r])=>Math.abs(n-r)>1e-4))}function ro(e){return fl.some(t=>e[t].some(([,n])=>Math.abs(n)>1e-4))}function io(e){return e.some(t=>t.enabled&&Object.values(t.correction).some(n=>Math.abs(n)>1e-4))}function xl(e){return e?.enabled?Math.abs(e.details.vignette)>1e-4||Math.abs(e.details.grain)>1e-4||ml.some(n=>Math.abs(e.effects[n])>1e-4)?!0:e.intensity===0?!1:e.lut&&e.lut.intensity!==0?!0:Cr.some(n=>Math.abs(e.adjust[n])>1e-4)||(e.wheels?cp(e.wheels):!1)||(e.curves?no(e.curves):!1)||(e.hueCurves?ro(e.hueCurves):!1)||(e.secondaries?io(e.secondaries):!1):!1}var dp=["[data-hyperframes-ignore]","[data-hyperframes-picker-ignore]","[data-hf-ignore]","[data-no-inspect]","[data-no-pick]","[data-hyper-shader-loading]"].join(","),fp=["[data-hyperframes-picker-block]","[data-hyper-shader-loading]"].join(",");function yl(e){let t=!1,n=null,r=null,i=null,o=null;function a(S,E){try{window.dispatchEvent(new CustomEvent(S,{detail:E}))}catch(w){M("runtime.picker.site1",w)}}function l(S){i=S,a("hyperframe:picker:hovered",{elementInfo:i,isPickMode:t,timestamp:Date.now()})}function s(S){o=S,a("hyperframe:picker:selected",{elementInfo:o,isPickMode:t,timestamp:Date.now()})}function u(S){let E=S.ownerDocument.defaultView;if(!E)return!1;let w=S;for(;w&&w!==document.body&&w!==document.documentElement;){let k=E.getComputedStyle(w);if(k.display==="none"||k.visibility==="hidden"||k.pointerEvents==="none")return!0;let L=Number.parseFloat(k.opacity);if(Number.isFinite(L)&&L<=.01&&!w.hasAttribute(Sn))return!0;w=w.parentElement}return!1}function c(S){if(!S||S===document.body||S===document.documentElement)return!1;let E=S.tagName.toLowerCase();return!(E==="script"||E==="style"||E==="link"||E==="meta"||S.classList.contains("__hf-pick-highlight")||S.closest(dp)||u(S))}function m(S){return!!S?.closest(fp)}function f(S){let E=S;if(E.id)return`#${CSS.escape(E.id)}`;let w=S.getAttribute("data-composition-id");if(w)return`[data-composition-id="${CSS.escape(w)}"]`;let k=S.getAttribute("data-composition-src");if(k)return`[data-composition-src="${CSS.escape(k)}"]`;let L=S.getAttribute("data-track-index");if(L)return`[data-track-index="${CSS.escape(L)}"]`;let H=S.tagName.toLowerCase(),V=S.parentElement;if(!V)return H;let j=V.querySelectorAll(`:scope > ${H}`);if(j.length===1)return H;for(let O=0;O<j.length;O+=1)if(j[O]===S)return`${H}:nth-of-type(${O+1})`;return H}function g(S){let E=S.tagName.toLowerCase(),w=(S.textContent??"").trim().replace(/\s+/g," "),k=(L,H)=>L.length>H?`${L.slice(0,H-1)}\u2026`:L;return E==="h1"||E==="h2"||E==="h3"?"Heading":E==="p"||E==="span"||E==="div"?w.length>0?k(w,56):"Text":E==="img"?"Image":E==="video"?"Video":E==="audio"?"Audio":E==="svg"?"Shape":S.getAttribute("data-composition-src")?"Composition":E==="section"?"Section":`${E.charAt(0).toUpperCase()}${E.slice(1)}`}function x(S,E,w){let k=typeof w=="number"&&w>0?w:8,L=[];if(document.elementsFromPoint)L=document.elementsFromPoint(S,E);else if(document.elementFromPoint){let j=document.elementFromPoint(S,E);L=j?[j]:[]}if(m(L[0]??null))return[];let H={},V=[];for(let[j,O]of L.entries()){if(!c(O))continue;let Q=`${O.tagName}::${O.id||""}::${j}`;if(!H[Q]&&(H[Q]=!0,V.push(O),V.length>=k))break}return V}function v(S){let E=S.getBoundingClientRect(),w={};for(let L of Array.from(S.attributes))L.name.startsWith("data-")&&(w[L.name]=L.value);return{id:S.id||null,tagName:S.tagName.toLowerCase(),selector:f(S),label:g(S),boundingBox:{x:E.left,y:E.top,width:E.width,height:E.height},textContent:S.textContent?S.textContent.trim().slice(0,200):null,src:S.getAttribute("src")||S.getAttribute("data-composition-src")||null,dataAttributes:w}}function y(S,E,w){return x(S,E,w).map(v)}function _(S){if(!t)return;let w=x(S.clientX,S.clientY,1)[0]??(S.target instanceof Element?S.target:null);if(!c(w)||n===w)return;n&&n.classList.remove("__hf-pick-highlight"),n=w,w.classList.add("__hf-pick-highlight");let k=v(w);l(k),e.postMessage({source:"hf-preview",type:"element-hovered",elementInfo:k})}function R(S){if(!t)return;S.preventDefault(),S.stopPropagation(),S.stopImmediatePropagation();let E=y(S.clientX,S.clientY,8);E.length!==0&&(l(E[0]??null),e.postMessage({source:"hf-preview",type:"element-pick-candidates",candidates:E,selectedIndex:0,point:{x:S.clientX,y:S.clientY}}))}function T(S){S.key==="Escape"&&(D(),e.postMessage({source:"hf-preview",type:"pick-mode-cancelled"}))}function F(){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(`
|
|
40
|
+
`),document.head.appendChild(r),document.body.classList.add("__hf-pick-active"),document.addEventListener("mousemove",_,!0),document.addEventListener("click",R,!0),document.addEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!0,timestamp:Date.now()}))}function D(){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",_,!0),document.removeEventListener("click",R,!0),document.removeEventListener("keydown",T,!0),a("hyperframe:picker:mode",{isPickMode:!1,timestamp:Date.now()}))}function C(){window.__HF_PICKER_API={enable:F,disable:D,isActive:()=>t,getHovered:()=>i,getSelected:()=>o,getCandidatesAtPoint:(S,E,w)=>Number.isFinite(S)&&Number.isFinite(E)?y(S,E,w):[],pickAtPoint:(S,E,w)=>{if(!Number.isFinite(S)||!Number.isFinite(E))return null;let k=y(S,E,8);if(!k.length)return null;let L=Math.max(0,Math.min(k.length-1,Number(w??0))),H=k[L]??null;return H?(s(H),e.postMessage({source:"hf-preview",type:"element-picked",elementInfo:H}),D(),H):null},pickManyAtPoint:(S,E,w)=>{if(!Number.isFinite(S)||!Number.isFinite(E))return[];let k=y(S,E,8);if(!k.length)return[];let L=[],H=Array.isArray(w)?w:[0];for(let V of H){let j=Math.max(0,Math.min(k.length-1,Math.floor(Number(V)))),O=k[j];if(!O)continue;L.some(we=>we.selector===O.selector&&we.tagName===O.tagName)||L.push(O)}return L.length?(s(L[0]??null),e.postMessage({source:"hf-preview",type:"element-picked-many",elementInfos:L}),D(),L):[]}},a("hyperframe:picker:api-ready",{hasApi:!0,timestamp:Date.now()})}return{enablePickMode:F,disablePickMode:D,installPickerApi:C}}var mp=["width","height","top","left","right","bottom","inset","object-fit","object-position","z-index","opacity","visibility","filter","mix-blend-mode","backdrop-filter","border-radius","overflow","clip-path","mask","mask-image","mask-size","mask-position","mask-repeat","transform","transform-origin","translate","rotate","scale","box-sizing"];function Gt(e,t){let n=Number.isFinite(t)&&t>0?t:30,r=Number.isFinite(e)&&e>0?e:0;return Math.floor(r*n+1e-9)/n}function Sl(e,t,n=mp){for(let r of n){let i=t.getPropertyValue(r);i&&e.setProperty(r,i)}}function vn(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&&M("runtime.player.nonConformantNum",{prop:t,actual:typeof r}),n)}function Ue(e,t){let n=e?.[t];if(typeof n=="function"){n.call(e);return}n!==void 0&&M("runtime.player.nonConformantVoid",{method:t,actual:typeof n})}function En(e,t,n){if(e){for(let r of Object.values(e))if(!(!r||r===t))try{n(r)}catch(i){M("runtime.player.site1",i)}}}function vl(e,t,n,r){let i=Gt(t,n),o=r?.suppressEvents===!0;return Ue(e,"pause"),typeof e.totalTime=="function"?e.totalTime(i,o):typeof e.seek=="function"&&e.seek(i,o),i}function pp(e,t,n,r,i){let o=[];En(e,t,a=>{Ue(a,"play"),o.push(a)});try{return vl(t,n,r,i)}finally{for(let a of o)try{Ue(a,"pause")}catch(l){M("runtime.player.site2",l)}}}function hp(e,t){En(e,t,n=>{Ue(n,"play")})}function El(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?.()??vn(n,"duration",0))||0);r>0&&Math.max(0,vn(n,"time",0))>=r&&(Ue(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()),Ue(n,"play"),En(e.getTimelineRegistry?.(),n,i=>{typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ue(i,"play")}),e.onDeterministicPlay(),e.setIsPlaying(!0),e.onShowNativeVideos(),e.onStatePost(!0)},pause:()=>{let n=e.getTimeline();if(!n)return;Ue(n,"pause"),En(e.getTimelineRegistry?.(),n,i=>{Ue(i,"pause")});let r=Math.max(0,vn(n,"time",0));e.onDeterministicSeek(r),e.onDeterministicPause(),e.setIsPlaying(!1),e.onSyncMedia(r,!1),e.onRenderFrameSeek(r),e.onStatePost(!0)},seek:(n,r)=>{let i=e.getTimeline();if(!i)return;let o=Math.max(0,Number(n)||0),a=e.getIsPlaying(),l=pp(e.getTimelineRegistry?.(),i,o,e.getCanonicalFps());e.onDeterministicSeek(l),r?.keepPlaying&&a?(typeof i.timeScale=="function"&&i.timeScale(e.getPlaybackRate()),Ue(i,"play"),En(e.getTimelineRegistry?.(),i,s=>{typeof s.timeScale=="function"&&s.timeScale(e.getPlaybackRate()),Ue(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 i=e.getTimeline(),o=e.getCanonicalFps(),a=i?(hp(e.getTimelineRegistry?.(),i),vl(i,n,o,r)):Gt(Math.max(0,Number(n)||0),o);e.onDeterministicSeek(a,r),e.setIsPlaying(!1),e.onSyncMedia(a,!1),e.onRenderFrameSeek(a),e.onStatePost(!0)},getTime:()=>vn(e.getTimeline(),"time",0),getDuration:()=>vn(e.getTimeline(),"duration",0),isPlaying:()=>e.getIsPlaying(),setPlaybackRate:n=>e.setPlaybackRate(n),getPlaybackRate:()=>e.getPlaybackRate()}}function Al(){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 gp=new Set(["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"]);function ao(e){return e.id||e.getAttribute("data-hf-id")||null}function oo(e){if(e==null)return null;let t=Number(e);return Number.isFinite(t)?t:null}function bp(e,t){let n=e.getAttribute("data-composition-id");if(!n)return null;let r=Number(t[n]?.duration?.());return Number.isFinite(r)&&r>0?r:null}function xp(e){if(!(e instanceof HTMLMediaElement)||!Number.isFinite(e.duration))return null;let t=oo(e.getAttribute("data-playback-start"))??oo(e.getAttribute("data-media-start"))??0;return e.duration>t?e.duration-t:null}function yp(e,t,n,r){let i=oo(e.getAttribute("data-duration"));return i!=null&&i>0?i:bp(e,t)??xp(e)??Math.max(0,n-r)}function Sp(e){for(let[t,n]of e){let r=t.parentElement;for(;r;){let i=e.get(r);if(i){n.parentId=i.id,i.children.push(n);break}r=r.parentElement}}}function Cl(e){let{startResolver:t,timelineRegistry:n,rootDuration:r}=e,i=new Map,o=document.querySelector("[data-composition-id]"),a=0;for(let l of document.querySelectorAll("[data-start]")){if(l===o||gp.has(l.tagName))continue;let s=t.resolveStartForElement(l,0);if(yp(l,n,r,s)<=0)continue;let u={id:ao(l)??`__clip-${a++}`,element:l,parentId:null,children:[]};i.set(l,u)}return Sp(i),{roots:Array.from(i.values()).filter(l=>l.parentId===null)}}var so="css:root",wl=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],vp=new Set([...wl,"contain","isolation","mask-border","mix-blend-mode","opacity"]),Ep=new Set(["absolute","relative"]),Ap=new Set(["flex","inline-flex","grid","inline-grid"]),Cp=new Set(["layout","paint","strict","content"]),wp=new Set(["size","inline-size"]);function _p(e){return e.position==="fixed"||e.position==="sticky"}function Tp(e,t){if(t.zIndex==="auto"||t.zIndex==="")return!1;if(Ep.has(t.position))return!0;let n=e.parentElement?e.ownerDocument.defaultView?.getComputedStyle(e.parentElement).display:null;return n!=null&&Ap.has(n)}function Rp(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:wl.some(r=>{let i=e.getPropertyValue(r);return i!==""&&i!=="none"})}function kp(e){return e.getPropertyValue("contain").split(/\s+/).some(n=>Cp.has(n))?!0:wp.has(e.getPropertyValue("container-type"))}function Fp(e){return e.getPropertyValue("will-change").split(",").map(t=>t.trim()).some(t=>vp.has(t))}function Mp(e,t){return _p(t)||Tp(e,t)||Rp(t)||kp(t)?!0:Fp(t)}function Np(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 _r(e){let t=e.ownerDocument.defaultView;if(!t)return so;let n=e.parentElement;for(;n&&n!==e.ownerDocument.documentElement;){try{if(Mp(n,t.getComputedStyle(n)))return Np(n)}catch{return so}n=n.parentElement}return so}var Bt=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),D1=Object.freeze([Bt.start,Bt.duration,Bt.trackIndex]),I1=Object.freeze([Bt.derivedEnd]),P1=Object.freeze([Bt.derivedEnd,Bt.legacyTrack]);function Le(e){if(e==null||e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}var Tl=/^[A-Za-z0-9_.:-]+$/;function Rl(e,t){let n=e.charCodeAt(t);return n>=48&&n<=57}function _l(e,t){let n=t;for(;n>=0&&Rl(e,n);)n--;return n}function Lp(e,t){let n=t;for(;n>=0&&(e[n]??"").trim()==="";)n--;return n}function Dp(e){let t=e.length-1;if(!Rl(e,t))return null;let n=_l(e,t);return e[n]==="."&&(n=_l(e,n-1)),n+1}function Ip(e){let t=Dp(e);if(t==null)return null;let n=Lp(e,t-1),r=e[n];if(r!=="+"&&r!=="-")return null;let i=e.slice(0,n).trim();if(!Tl.test(i))return null;let o=Number(e.slice(t));return Number.isFinite(o)?{refId:i,operator:r,magnitude:o}:null}function lo(e){let t=(e??"").trim();if(!t)return null;let n=Le(t);if(n!=null)return{kind:"absolute",value:n};if(Tl.test(t))return{kind:"reference",refId:t,offset:0};let r=Ip(t);return r?{kind:"reference",refId:r.refId,offset:r.operator==="-"?-r.magnitude:r.magnitude}:null}var Pp="data-hf-authored-duration",Op="data-hf-authored-end";function Hp(e){return Le(e.getAttribute("data-duration"))}function Gp(e){return Le(e.getAttribute("data-end"))}function Bp(e){return Le(e.getAttribute(Pp))}function Up(e){return Le(e.getAttribute(Op))}function lt(e){let t=e.timelineRegistry??{},n=e.includeAuthoredTimingAttrs??!1,r=e.documentRef??document,i=new WeakMap,o=new WeakMap,a=new Set,l=f=>{let g=r.getElementById(f);return g||(r.querySelector(`[data-composition-id="${CSS.escape(f)}"]`)??null)},s=f=>{let g=f.ownerDocument.defaultView?.HTMLMediaElement;return g?f instanceof g:typeof HTMLMediaElement<"u"&&f instanceof HTMLMediaElement},u=f=>{let g=o.get(f);if(g!==void 0)return g;let x=null,v=Hp(f)??(n?Bp(f):null);if(v!=null&&v>0&&(x=v),x==null||x<=0){let y=Gp(f)??(n?Up(f):null);if(y!=null){let _=m(f,0),R=y-_;Number.isFinite(R)&&R>0&&(x=R)}}if((x==null||x<=0)&&s(f)){let y=Le(f.getAttribute("data-playback-start"))??Le(f.getAttribute("data-media-start"))??0;Number.isFinite(f.duration)&&f.duration>y&&(x=(f.duration-y)/je(f))}if(x==null||x<=0){let y=f.getAttribute("data-composition-id");if(y){let _=t[y]??null;if(_&&typeof _.duration=="function")try{let R=Number(_.duration());Number.isFinite(R)&&R>0&&(x=R)}catch(R){M("runtime.startResolver.site1",R)}}}return x!=null&&Number.isFinite(x)&&x>0?(o.set(f,x),x):(o.set(f,null),null)},c=(f,g)=>{if(f.hasAttribute("data-composition-id")){let v=f.parentElement?.closest("[data-composition-id]");return v?m(v,g):0}let x=f.closest("[data-composition-id]");return x?m(x,g):0},m=(f,g)=>{let x=i.get(f);if(x!==void 0)return x??g;if(a.has(f))return g;a.add(f);try{let v=lo(f.getAttribute("data-start"));if(!v){if(f.hasAttribute("data-composition-id")){let F=f.parentElement;if(F&&(F.hasAttribute("data-composition-src")||F.hasAttribute("data-composition-id")||F.hasAttribute("data-composition-file"))){let D=m(F,g);return i.set(f,D),D}}return i.set(f,g),g}if(v.kind==="absolute"){let F=Math.max(0,v.value),D=Math.max(0,c(f,g)+F);return i.set(f,D),D}let y=l(v.refId);if(!y)return i.set(f,g),g;let _=m(y,0),R=u(y);if(R==null||R<=0){let F=Math.max(0,_+v.offset);return i.set(f,F),F}let T=Math.max(0,_+R+v.offset);return i.set(f,T),T}finally{a.delete(f)}};return{resolveStartForElement:(f,g=0)=>m(f,Math.max(0,g)),resolveDurationForElement:f=>u(f)}}function uo(e){let t=e.trim().toLowerCase();return!(!t||t==="main"||t.includes("caption")||t.includes("ambient"))}var Vp="data-hf-authored-duration",zp="data-hf-authored-end";function Re(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function co(e){return Re(e.getAttribute("data-duration"))??Re(e.getAttribute(Vp))}function kl(e){return Re(e.getAttribute("data-end"))??Re(e.getAttribute(zp))}function fo(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 mo(...e){let t=e.filter(n=>Number.isFinite(n??null));return t.length===0?null:Math.max(...t)}function po(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 Cn(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 Fl(e){let t=e.getAttribute("src")??e.getAttribute("data-src");if(t)return Cn(t);let n=e.getAttribute("data-composition-src");if(n)return Cn(n);let r=e.querySelector("img[src], video[src], audio[src], source[src]");return r?Cn(r.getAttribute("src")):null}function qp(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 $p(e){if(!e)return null;try{return new URL(e,document.baseURI).pathname.split("/").filter(Boolean).at(-1)??null}catch{return e.split(/[\\/]/).filter(Boolean).at(-1)??null}}function jp(e){let t=e.textContent?.replace(/\s+/g," ").trim();return t?t.length>32?`${t.slice(0,31)}...`:t:null}function An(e){let t=e.replace(/\.[^.]+$/i,"").replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t?t.replace(/\b\w/g,n=>n.toUpperCase()):e}function Kp(e,t,n){let r=e.getAttribute("data-timeline-label")??e.getAttribute("data-label")??e.getAttribute("aria-label")??null;if(r?.trim())return r.trim();let i=e.getAttribute("data-composition-id");if(i)return An(i);let o=e.id;if(o)return An(o);let a=qp(e);if(a)return An(a);let l=$p(Fl(e));if(l)return An(l);let s=jp(e);return s||`${An(t)} ${n+1}`}function Ml(e){let n=window.__timelines??{},r=lt({timelineRegistry:n,includeAuthoredTimingAttrs:!0}),i=B=>{if(!B)return null;let I=n[B]??null;if(!I||typeof I.duration!="function")return null;try{let P=Number(I.duration());return Number.isFinite(P)&&P>0?P:null}catch{return null}},o=B=>{let I=Re(B.getAttribute("data-duration"));if(I!=null&&I>0)return I;let P=Re(B.getAttribute("data-playback-start"))??Re(B.getAttribute("data-media-start"))??0;return Number.isFinite(B.duration)&&B.duration>P?Math.max(0,(B.duration-P)/je(B)):null},a=()=>{let B=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(B.length===0)return null;let I=0;for(let P of B){let ce=P.hasAttribute("data-hf-auto-start")?r.resolveStartForElement(P,0):Math.max(0,Number(P.getAttribute("data-start")??0)||0);if(!Number.isFinite(ce))continue;let ae=o(P);ae==null||ae<=0||(I=Math.max(I,Math.max(0,ce)+ae))}return I>0?I:null},l=(B,I)=>{let P=[],ce=null,ae=null,q=null,$=B.parentElement;for(;$;){let K=$.getAttribute("data-composition-id");K&&(P.push(K),!q&&$!==I&&(q=K),ce==null&&(ce=r.resolveStartForElement($,0)),ae==null&&(ae=Re($.getAttribute("data-duration"))??i(K)??null)),$=$.parentElement}return{parentCompositionId:q,compositionAncestors:P.reverse(),inheritedStart:ce,inheritedDuration:ae}},s=document.querySelector("[data-composition-id]"),u=Array.from(document.querySelectorAll("[data-composition-id]")),c=s?.getAttribute("data-composition-id")??null,m=s?r.resolveStartForElement(s,0):0,f=a(),g=f!=null?Math.max(0,f-Math.max(0,m)):null,x=i(c),v=co(s??document.body),y=mo(...u.filter(B=>B!==s).map(B=>{let I=r.resolveStartForElement(B,0),P=r.resolveDurationForElement(B)??i(B.getAttribute("data-composition-id"))??null;return!Number.isFinite(I)||P==null||P<=0?null:Math.max(0,I)+P})),_=y!=null?Math.max(0,y-Math.max(0,m)):null,R=typeof x=="number"&&Number.isFinite(x)&&x>0?x:null,T=typeof v=="number"&&Number.isFinite(v)&&v>0?v:null,F=typeof g=="number"&&Number.isFinite(g)&&g>0?g:null,D=typeof _=="number"&&Number.isFinite(_)&&_>0?_:null,C=mo(F,D),S=R!=null&&C!=null&&R>C+1,w=T??(S?C:mo(R,F,D))??null,L=(w!=null?m+w:null)??(typeof f=="number"&&Number.isFinite(f)&&f>0?f:null),H=(B,I)=>!Number.isFinite(I)||I<=0?0:L==null||!Number.isFinite(L)?I:!Number.isFinite(B)||B>=L?0:Math.max(0,Math.min(I,L-B)),V=[],j=[],O=Array.from(document.querySelectorAll("[data-start], [data-track-index], [data-composition-id], video, audio, img")),Q=0;for(let[B,I]of O.entries()){if(I===s||["SCRIPT","STYLE","LINK","META","TEMPLATE","NOSCRIPT"].includes(I.tagName))continue;let P=l(I,s),ce=r.resolveStartForElement(I,P.inheritedStart??0),ae=I.getAttribute("data-composition-id"),q=co(I);if((q==null||q<=0)&&ae&&ae!==c&&(q=i(ae)),(q==null||q<=0)&&I instanceof HTMLMediaElement){let pe=Re(I.getAttribute("data-playback-start"))??Re(I.getAttribute("data-media-start"))??0;Number.isFinite(I.duration)&&I.duration>0&&(q=Math.max(0,I.duration-pe))}if(q==null||q<=0){let pe=P.inheritedDuration;if(pe!=null&&pe>0){let Pe=(P.inheritedStart??0)+pe;q=Math.max(0,Pe-ce)}}if(q==null||q<=0||(q=H(ce,q),q<=0))continue;let $=ce+q;Q=Math.max(Q,$);let K=I.tagName.toLowerCase(),ze=ae&&ae!==c?"composition":K==="video"?"video":K==="audio"?"audio":K==="img"?"image":"element";V.push({id:ao(I)??ae??null,label:Kp(I,ze,V.length),start:ce,duration:q,track:po(I,B),zIndex:fo(I),stackingContextId:_r(I),kind:ze,tagName:K,compositionId:I.getAttribute("data-composition-id"),compositionAncestors:P.compositionAncestors,parentCompositionId:P.parentCompositionId,nodePath:null,compositionSrc:Cn(I.getAttribute("data-composition-src")),playbackStart:It(I),playbackRate:je(I),assetUrl:Fl(I),timelineRole:I.getAttribute("data-timeline-role"),timelineLabel:I.getAttribute("data-timeline-label"),timelineGroup:I.getAttribute("data-timeline-group"),timelinePriority:Re(I.getAttribute("data-timeline-priority"))})}let we=new Set(V.map(B=>B.id)),z=s?.getAttribute("data-composition-id")??null,X=z?n[z]??null:null;if(X&&s){let B=X;if(typeof B.getChildren=="function")try{let I=B.getChildren(!0,!0,!1)??[],P=new Map;for(let q of s.children){let $=q;if(!$.id)continue;let K=$.tagName.toLowerCase();K==="script"||K==="style"||K==="link"||P.set($,{id:$.id,start:1/0,end:-1/0})}let ce=q=>{let $=q;for(;$;){if(P.has($))return $;if($===s)return null;$=$.parentElement}return null};for(let q of I){if(typeof q.targets!="function"||typeof q.startTime!="function"||typeof q.duration!="function")continue;let $=q.startTime(),K=q.parent;for(;K&&K!==X&&typeof K.startTime=="function";)$+=K.startTime(),K=K.parent;let ze=$+q.duration();if(!(!Number.isFinite($)||!Number.isFinite(ze)))for(let pe of q.targets()){if(!(pe instanceof Element))continue;let Tt=ce(pe);if(!Tt)continue;let Pe=P.get(Tt);Pe&&(Pe.start=Math.min(Pe.start,$),Pe.end=Math.max(Pe.end,ze))}}let ae=V.length>0?Math.max(...V.map(q=>q.track))+1:0;for(let[q,$]of P){if($.start===1/0||$.end===-1/0)continue;let K=q;if(we.has(K.id))continue;let ze=Math.max(0,$.end-$.start);if(ze<=0)continue;let pe=H($.start,ze);pe<=0||(Q=Math.max(Q,$.start+pe),V.push({id:K.id,label:K.getAttribute("data-timeline-label")??K.getAttribute("data-label")??K.getAttribute("aria-label")??K.id,start:$.start,duration:pe,track:po(K,ae),zIndex:fo(K),stackingContextId:_r(K),kind:"element",tagName:K.tagName.toLowerCase(),compositionId:K.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:It(K),playbackRate:je(K),assetUrl:null,timelineRole:K.getAttribute("data-timeline-role"),timelineLabel:K.getAttribute("data-timeline-label"),timelineGroup:K.getAttribute("data-timeline-group"),timelinePriority:Re(K.getAttribute("data-timeline-priority"))}),we.add(K.id))}}catch(I){M("runtime.timeline.site1",I)}}if(s&&w!=null&&w>0){let B=V.length>0?Math.max(...V.map(I=>I.track))+1:0;for(let I of s.children){let P=I;if(!P.id||we.has(P.id))continue;let ce=P.getAttribute("data-timeline-role");if(ce!=="overlay"&&ce!=="persistent-overlay")continue;let ae=P.tagName.toLowerCase();if(ae==="script"||ae==="style"||ae==="link"||ae==="meta"||window.getComputedStyle(P).display==="none")continue;let $=H(0,w);$<=0||(Q=Math.max(Q,$),V.push({id:P.id,label:P.getAttribute("data-timeline-label")??P.getAttribute("data-label")??P.getAttribute("aria-label")??P.id,start:0,duration:$,track:po(P,B),zIndex:fo(P),stackingContextId:_r(P),kind:"element",tagName:ae,compositionId:P.getAttribute("data-composition-id"),compositionAncestors:z?[z]:[],parentCompositionId:z,nodePath:null,compositionSrc:null,playbackStart:It(P),playbackRate:je(P),assetUrl:null,timelineRole:ce,timelineLabel:P.getAttribute("data-timeline-label"),timelineGroup:P.getAttribute("data-timeline-group"),timelinePriority:Re(P.getAttribute("data-timeline-priority"))}),we.add(P.id))}}for(let B of u){if(B===s)continue;let I=B.getAttribute("data-composition-id");if(!I||!uo(I))continue;let P=r.resolveStartForElement(B,0),ce=co(B);if((ce==null||ce<=0)&&kl(B)!=null){let K=kl(B);ce=Math.max(0,K-P)}let ae=i(I),q=ce&&ce>0?ce:ae;if(q==null||q<=0)continue;let $=H(P,q);$<=0||j.push({id:I,label:B.getAttribute("data-label")??I,start:P,duration:$,thumbnailUrl:Cn(B.getAttribute("data-thumbnail-url")),avatarName:null})}let W=Math.max(1,Q||1,w??0),te=S&&T==null,_e=te?Number.POSITIVE_INFINITY:Math.max(1,Math.ceil(W*Math.max(1,e.canonicalFps)));return{...ar(e.canonicalFps),source:"hf-preview",type:"timeline",compositionContractVersion:1,durationSeconds:te?Number.POSITIVE_INFINITY:W,durationInFrames:_e,clips:V,scenes:j,compositionWidth:Re(s?.getAttribute("data-width"))??1920,compositionHeight:Re(s?.getAttribute("data-height"))??1080}}var ho="data-composition-id",Yp="data-composition-src",Xp=`[${ho}]`,uS=`[${Yp}]`,Nl="style",Ll="script",Jp='link[rel="stylesheet"], link[rel="preconnect"]';function Ut(e){return e?Array.from(e):[]}function Dl(e){let{contentNode:t,head:n,documentElement:r,hasTemplate:i,compositionId:o}=e,a=Ut(t.querySelectorAll(Xp)),l=o?a.find(c=>c.getAttribute(ho)===o)??null:a[0]??null,s=(l??a[0])?.getAttribute(ho)?.trim()||"",u=i?null:n??null;return{innerRoot:l,authoredCompositionId:o||s||null,scriptCompositionId:s||o||null,authoredRootId:l?.getAttribute("id")?.trim()||null,styleSources:[...Ut(u?.querySelectorAll(Nl)),...Ut(t.querySelectorAll(Nl))],scriptSources:[...Ut(u?.querySelectorAll(Ll)),...Ut(t.querySelectorAll(Ll))],linkSources:Ut(n?.querySelectorAll(Jp)),variableDefaultCarriers:[r,l].filter(c=>c!=null)}}var fe=Of(oc(),1),ac=fe.default,QS=fe.default.stringify,ZS=fe.default.fromJSON,ev=fe.default.plugin,tv=fe.default.parse,nv=fe.default.list,rv=fe.default.document,iv=fe.default.comment,ov=fe.default.atRule,av=fe.default.rule,sv=fe.default.decl,lv=fe.default.root,uv=fe.default.CssSyntaxError,cv=fe.default.Declaration,dv=fe.default.Container,fv=fe.default.Processor,mv=fe.default.Document,pv=fe.default.Comment,hv=fe.default.Warning,gv=fe.default.AtRule,bv=fe.default.Result,xv=fe.default.Input,yv=fe.default.Rule,Sv=fe.default.Root,vv=fe.default.Node;var Uo="data-hf-authored-id",sc="data-hf-inner-root";function Wo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vo(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function yh(e){return e&&e.replace(/[^a-zA-Z0-9_-]/g,n=>`\\${n}`).replace(/^-?\d/,n=>`\\${n}`)}function uc(e){let t=e.trim();return t?Array.from(new Set([t,yh(t)])).filter(Boolean):[]}function Sh(e){return!!e&&/[\w-]/.test(e)}function vh(e,t,n){let r=uc(t).sort((l,s)=>s.length-l.length);if(r.length===0)return e;let i="",o=0,a=null;for(let l=0;l<e.length;l+=1){let s=e[l],u=l>0?e[l-1]:"";if(a){i+=s,s===a&&u!=="\\"&&(a=null);continue}if(s==='"'||s==="'"){a=s,i+=s;continue}if(s==="["){o+=1,i+=s;continue}if(s==="]"){o=Math.max(0,o-1),i+=s;continue}if(s==="#"&&o===0){let c=r.find(m=>e.startsWith(m,l+1));if(c){let m=e[l+1+c.length];if(!Sh(m)){i+=n,l+=c.length;continue}}}i+=s}return i}function Eh(e,t){let n=t?.trim();return n?vh(e,n,`[${Uo}="${Vo(n)}"]`):e}function lc(e){return`${e}:not(:has([${sc}])), ${e} > [${sc}]`}function Ah(e,t,n,r,i,o){let a=Eh(e,r),l=Ch(a,t,n),s=l.trim();if(!s||s==="*")return e;if(/^(html|body|:root)$/i.test(s))return o?lc(t):e;let u=new RegExp(`\\[\\s*data-composition-id\\s*=\\s*(["'])${Wo(n)}\\1\\s*\\]`,"g");if(u.test(s))return s.replace(u,"").trim()===""?lc(t):l.replace(u,t);let c=l.match(/^\s*/)?.[0]??"",m=l.match(/\s*$/)?.[0]??"";if(i){let f=r?`[${Uo}="${Vo(r)}"]`:null;if(f&&s.startsWith(f)){let g=s.slice(f.length);return`${c}${t}${f}${g}${m}`}}return`${c}${t} ${s}${m}`}function Ch(e,t,n){let r=Wo(n),i=String.raw`\[\s*data-composition-id\s*=\s*(?:"${r}"|'${r}')\s*\]`,o=String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`;return e.replace(new RegExp(`${i}(?:${o})+`,"g"),t).replace(new RegExp(`(?:${o})+${i}`,"g"),t)}var wh=new Set(["keyframes","-webkit-keyframes","font-face"]);function _h(e){return e?.type==="atrule"}function Th(e){let t=e.parent;for(;t;){if(_h(t)&&wh.has(t.name.toLowerCase()))return!0;t=t.parent}return!1}function Rh(e){let t=e.parent;for(;t;){if(t.type==="rule")return!0;t=t.parent}return!1}function cc(e,t,n,r,i){let o=t.trim();if(!e||!o)return e;let a=n||`[data-composition-id="${Vo(o)}"]`,l=ac.parse(e);return l.walkRules(s=>{Th(s)||Rh(s)||(s.selectors=s.selectors.map(u=>Ah(u,a,o,r,i?.compoundAuthoredRoot,i?.scopeRootSelectors)))}),l.toResult({map:!1}).css}function et(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function dc(e,t,n="[HyperFrames] composition script error:",r,i=t,o){let a=et(t),l=et(i),s=et(n),u=Wo(t),c=et(o?.trim()||null),m=et(r??null),f=et(String.raw`\[\s*data-composition-id\s*=\s*(?:"${u}"|'${u}')\s*\]`),g=et(String.raw`\s*\[\s*data-(?:start|duration)\s*=\s*(?:"[^"]*"|'[^']*')\s*\]`),x=et(uc(o?.trim()||""));return`(function(){
|
|
41
41
|
var __hfCompId = ${a};
|
|
42
42
|
var __hfTimelineCompId = ${l};
|
|
43
43
|
var __hfErrorLabel = ${s};
|
|
44
44
|
var __hfAuthoredRootId = ${c};
|
|
45
|
-
var __hfAuthoredRootAttr = ${
|
|
45
|
+
var __hfAuthoredRootAttr = ${et(Uo)};
|
|
46
46
|
var __hfEscapeAttr = function(value) {
|
|
47
47
|
return (value + "").replace(/\\\\/g, "\\\\\\\\").replace(/"/g, "\\\\\\"");
|
|
48
48
|
};
|
|
@@ -51,8 +51,8 @@ https://www.w3ctech.com/topic/2226`));let l=n(...a);return l.postcssPlugin=t,l.p
|
|
|
51
51
|
: "");
|
|
52
52
|
var __hfRoot = null;
|
|
53
53
|
var __hfRootSelectorPattern = ${f};
|
|
54
|
-
var __hfTimingSelectorPattern = ${
|
|
55
|
-
var __hfAuthoredRootIdForms = ${
|
|
54
|
+
var __hfTimingSelectorPattern = ${g};
|
|
55
|
+
var __hfAuthoredRootIdForms = ${x};
|
|
56
56
|
var __hfAuthoredRootSelector = __hfAuthoredRootId
|
|
57
57
|
? "[" + __hfAuthoredRootAttr + '="' + __hfEscapeAttr(__hfAuthoredRootId) + '"]'
|
|
58
58
|
: "";
|
|
@@ -345,14 +345,224 @@ ${e.replace(/<\/(script)/gi,"<\\/$1")}
|
|
|
345
345
|
};
|
|
346
346
|
__hfFindRoot();
|
|
347
347
|
__hfRun();
|
|
348
|
-
})();`}var a0=["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 Su(e){let t=e.getAttribute("id")?.trim();for(let n of a0)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var s0=8e3,l0=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,u0=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,c0=["src","href"];function d0(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function Cu(e,t){if(!t)return e;let n=e.trim();if(d0(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function _u(e,t){return!t||!e?e:e.replace(u0,(n,r,i)=>{let o=Cu(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function f0(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of c0){let i=n.getAttribute(r);if(i==null)continue;let o=Cu(i,t);o!==i&&n.setAttribute(r,o)}}function m0(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=_u(r,t);i!==r&&n.setAttribute("style",i)}}function p0(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=_u(r,t);i!==r&&(n.textContent=i)}}function Au(e,t){if(t){f0(e,t),m0(e,t),p0(e,t);for(let n of Array.from(e.querySelectorAll("template")))Au(n.content,t)}}function h0(e,t){return`${e}__hf${t}`}var g0=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),s0)});function bo(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function vu(e){for(let t of Array.from(e.querySelectorAll("style, script")))t.remove()}function x0(e){let t=document.importNode(e,!0);Su(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function b0(e,t){let n=e.trim();if(!n)return e;try{return l0.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 Eu(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 Sr(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 y0(e){let t=new Map;for(let n of e){let r=Sr(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function wu(e){let t=Sr(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function S0(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function v0(e){return e.hasAttribute("data-composition-src")?!0:wu(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:S0(e):!1}function So(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:wu(t))}function Tu(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set(So().map(n=>Sr(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Ru(e,t=y0(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=Sr(i),l=v0(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let c=s?(n.get(o)||0)+1:0;s&&n.set(o,c),u=s?h0(o,c):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function yo(e){let t=Ws({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=t.innerRoot instanceof HTMLElement?t.innerRoot:null,r=n??e.sourceNode,i=t.authoredCompositionId,o=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let f of t.linkSources){let x=(f.getAttribute("href")||"").trim();if(!x)continue;let v=e.compositionUrl?new URL(x,e.compositionUrl).href:x;if(e.compositionUrl&&Eu(v,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(v)}"]`))continue;let C=f.cloneNode(!0);C instanceof HTMLLinkElement&&(C.href=v,document.head.appendChild(C),e.injectedLinks.push(C))}(f=>{for(let x of f){let v=x.cloneNode(!0);v instanceof HTMLStyleElement&&(i&&(v.textContent=bu(v.textContent||"",i,s,l,{scopeRootSelectors:!0})),document.head.appendChild(v),e.injectedStyles.push(v))}})(t.styleSources);let c=f=>{let x=f.getAttribute("type")?.trim()??"",v=f.getAttribute("src")?.trim()??"";if(v){let y=b0(v,e.compositionUrl);return e.compositionUrl&&Eu(y,e.compositionUrl)?null:{kind:"external",src:y,type:x}}let C=f.textContent?.trim()??"";return C?{kind:"inline",content:C,type:x,scopeCompositionId:o}:null},m=t.scriptSources.map(c).filter(f=>f!==null);if(n){let f=n.getAttribute("data-width"),x=n.getAttribute("data-height"),v=e.parseDimensionPx(f),C=e.parseDimensionPx(x);f&&e.host.setAttribute("data-width",f),x&&e.host.setAttribute("data-height",x),v&&e.host instanceof HTMLElement&&(e.host.style.width=v),C&&e.host instanceof HTMLElement&&(e.host.style.height=C),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let y=x0(n);!e.authoredCompositionId&&i&&y.setAttribute("data-composition-id",i),vu(y),e.host.appendChild(y)}else if(e.hasTemplate){let f=document.importNode(r,!0);vu(f),e.host.appendChild(f)}else e.host.innerHTML=e.fallbackBodyInnerHtml;a&&E0(e,r,a);for(let f of m){let x=document.createElement("script");if(f.type&&(x.type=f.type),x.async=!1,f.kind==="external"?x.src=f.src:f.type.toLowerCase()==="module"?x.textContent=f.content:f.scopeCompositionId?x.textContent=yu(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",s,a||f.scopeCompositionId,l):x.textContent=`(function(){${f.content}})();`,document.body.appendChild(x),e.injectedScripts.push(x),f.kind==="external"){let v=await g0(x);v.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:v.status,elapsedMs:v.elapsedMs}})}}}async function Fu(e){let t=So();if(Tu(),t.length===0)return;let n=Ru(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);bo(i),await yo({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function Lu(e){let t=So();if(Tu(),t.length===0)return;let n=Ru(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}bo(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await yo({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),v=new DOMParser().parseFromString(f,"text/html");Au(v,u);let C=(l?v.querySelector(`template#${CSS.escape(l)}-template`):null)??v.querySelector("template"),y=C?C.content:v.body;await yo({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:y,hasTemplate:!!C,fallbackBodyInnerHtml:v.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:v.head,declaredVariableDefaults:Zt(v.documentElement),variableDeclarer:v.documentElement,onDiagnostic:e.onDiagnostic})}catch(c){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:c instanceof Error?c.message:"unknown_error"}}),bo(i)}}))}function E0(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?Zt(t):{}),...Ca(e.host)};ni(e.variableDeclarer??(t instanceof Element?t:null),i,n),va(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,ri(e.host,{...Sa(e.host,i,window),...qn()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function vo(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function C0(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function _0(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!(r instanceof HTMLElement))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function A0(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}function Eo(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=_0();for(let r of t){let i=null;if(r.wordId&&(i=C0(document.getElementById(r.wordId))),!i&&r.wordIndex!==void 0&&(i=n[r.wordIndex]??null),!i)continue;let o={},a={};if(r.x!==void 0&&(o.x=r.x),r.y!==void 0&&(o.y=r.y),r.scale!==void 0&&(o.scale=r.scale),r.rotation!==void 0&&(o.rotation=r.rotation),r.opacity!==void 0&&(a.opacity=r.opacity),r.fontSize!==void 0&&(a.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(a.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(a.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let s=e.getTweensOf(i).filter(m=>m.vars.color!==void 0).sort((m,f)=>m.startTime()-f.startTime()),u=s.find(m=>vo(m)==="dim")??s.find(m=>vo(m)===void 0),c=u?String(u.vars.color):"";for(let m of s)(vo(m)??(String(m.vars.color)===c?"dim":"active"))==="dim"?r.dimColor&&(m.vars.color=r.dimColor):r.activeColor&&(m.vars.color=r.activeColor);r.dimColor&&e.set(i,{color:r.dimColor})}if(Object.keys(a).length>0&&e.set(i,a),Object.keys(o).length>0){let l=A0(i);e.set(l,o)}}}).catch(()=>{})}var _o="data-hf-edit-base-x",Ao="data-hf-edit-base-y",Bt="data-hf-edit-original-translate",vr=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},w0=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},Nu=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,Co=(e,t)=>Nu.test(e)&&Nu.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,T0=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=w0(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${Co(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${Co(r,t)} ${Co(i,n)}${a}`},R0=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},F0=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""}},wo=new WeakMap;function L0(e,t){let n=wo.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ne("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=vr(e.getAttribute("data-x"))-vr(e.getAttribute(_o)),i=vr(e.getAttribute("data-y"))-vr(e.getAttribute(Ao));e.hasAttribute(Bt)||e.setAttribute(Bt,F0(e)),n===void 0&&R0(e);let o=e.getAttribute(Bt)??"",a=T0(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),wo.set(e,e.style.getPropertyValue("translate"))}function Er(e,t){let n=e.defaultView?.HTMLElement,r=e.defaultView?.SVGElement,i=s=>n||r?n!==void 0&&s instanceof n||r!==void 0&&s instanceof r:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${Bt}]:not([${_o}]):not([${Ao}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(Bt)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(Bt),wo.delete(u)}let a=e.querySelectorAll(`[${_o}], [${Ao}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(L0(u,t),l+=1)}return l}var ku="__hfPositionEditsSeekReapplyWrapped",Mu=new WeakSet,Du=new WeakMap,Iu=new WeakMap;function Pu(e){let t=e,n=()=>{try{Er(t.document)}catch{}},r=m=>typeof m=="function"&&(Mu.has(m)||!!m[ku]),i=m=>{Mu.add(m);try{Object.defineProperty(m,ku,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||r(m))return m;let f=function(...x){let v=m.apply(this,x);return n(),v};return i(f),f},a=(m,f)=>{let x=Du.get(m);if(x?.has(f))return!0;let v=Object.getOwnPropertyDescriptor(m,f);if(v?.configurable===!1){let w=m[f];return typeof w=="function"&&(m[f]=o(w),n()),!1}let C=m[f],y=v?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:v?.enumerable??!0,get:()=>C,set:w=>{C=o(w),y?.call(m,w)}}),C=o(C),x??(x=new Set),x.add(f),Du.set(m,x),n(),!0},l=(m,f)=>{let x=Iu.get(t),v=Object.getOwnPropertyDescriptor(t,m);if(!x?.has(m)){if(v?.configurable===!1){let w=t[m];return w?a(w,f):!1}let y=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:v?.enumerable??!0,get:()=>y,set:w=>{y=w,y&&a(y,f)}}),x??(x=new Set),x.add(m),Iu.set(t,x)}let C=t[m];return C?a(C,f):!1},s=()=>{let m=l("__hf","seek"),f=l("__player","renderSeek");return m&&f};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function Cr(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function _r(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Ou=new Set(["img","video","audio","source"]);function N0(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 k0(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}function M0(e){return e.replace(/[;{}<>\r\n]/g,"")}function D0(e){if(_r(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 To(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=Cr(e);return t.set(n,i),i}function I0(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 P0(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function O0(e,t){let n=new Set,r=P0(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=To(i,t);for(let[a,l]of Object.entries(o)){let s=D0(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,M0(s))}}}function Ro(e){let t=new Map;O0(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!Ou.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(Ou).join("/")}.`);continue}let i=N0(To(n,t)[r]);if(i!==null){if(!k0(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=To(n,t)[r];_r(i)&&I0(n,String(i))}}var Qe=new Map,G0="data-hf-color-grading-canvas",H0="__hf_color_grading_canvas__";function Ku(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute(tr)||r.setAttribute(tr,r.style.opacity))},n=r=>{if(r instanceof Element){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var B0=16,U0=4,Wt={enabled:!1,position:.5,softness:0,lineWidth:2},Fo=["#000000","#ffffff"],W0=["#1a1a1a","#f5f5dc"],In=3,V0=In-1,z0=5,Lo=`${je}.0`,Gu=`${je-1}.0`,$0=`${In}.0`,q0=`${(V0+.5)/In}`;function Ar(e){let t=e.getAttribute(an);return t==null?null:As(t,Cr(e))}var j0=["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(`
|
|
349
|
-
`),K0=["#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);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," 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);"," }"," 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;"," 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;"," }"," 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;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," 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);"," }"," 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);"," }"," return base;","}","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);","}","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);","}","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);","}","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);","}","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);","}","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);","}","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));","}","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);","}","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);","}","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);","}","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) * ${Gu};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Gu});`,` float y = (row + 0.5) / ${$0};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${Lo}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${Lo}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${Lo}, ${q0}));`,"}","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;","}","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"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).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;","}","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);"," 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);"," 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;","}","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));","}","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);","}","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);","}","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;","}","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);","}","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);","}","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);"," 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;"," 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);"," 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);"," }"," 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);"," }"," 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));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," 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;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," 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;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`
|
|
350
|
-
`),
|
|
351
|
-
`),
|
|
352
|
-
`),
|
|
353
|
-
`);function St(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Hu(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Bu(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(F("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Lr(e,t=K0){let n=Bu(e,j0,e.VERTEX_SHADER),r=Bu(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(F("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function wr(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 Q0(e,t){let n=Lr(e,Y0);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 Z0(e,t){let n=Lr(e,X0);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 eh(e,t){let n=Lr(e,J0);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 kn(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=wr(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function Rr(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 No(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Uu(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function Io(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Lr(t),r=wr(t),i=wr(t,t.NEAREST),o=wr(t,t.NEAREST);if(!n||!r||!i||!o)return Uu(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:No(t,n,nr),detailUniforms:No(t,n,wi),effectUniforms:No(t,n,Ti),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Uu(t,n,[r,i,o]),null)}function th(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function nh(e){if(!th(e))return{...Wt};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,Wt.position,0,1),softness:t(e.softness,Wt.softness,0,.25),lineWidth:t(e.lineWidth,Wt.lineWidth,0,12)}}function Yu(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 Nr(e){return e instanceof Error?e.message:"LUT failed to load"}function rh(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 Xu(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return rh(t)}function Po(e){let t=Yu(e);if("error"in t)return{state:"error",message:t.error};let n=Qe.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>ns(o,{maxSize:Qn})),i={state:"pending",promise:r};for(;Qe.size>=B0;){let o=Qe.keys().next().value;if(!o)break;Qe.delete(o)}return Qe.set(t.href,i),r.then(o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"ready",lut:o})},o=>{Qe.get(t.href)===i&&Qe.set(t.href,{state:"error",message:Nr(o)})}),i}function Wu(e,t,n){if(e.lut?.src===t)return e.lut;let r=xi(n),{gl:i,program:o}=e;try{return Ju(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Nr(a),e.lutLoadingSrc=null,F("runtime.colorGrading.uploadLut",a),null}}async function ih(e){let t=Po(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Ju(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 oh(e,t,n){let r=xi(n),{gl:i,program:o}=e;return Ju(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Xe(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function Oo(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Xe(e.gl,t.scratch),Xe(e.gl,t.blur),t.bloom&&Xe(e.gl,t.bloom),e.effectTargets=null)}function Go(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Xe(e.gl,t.moments),Xe(e.gl,t.output),e.kuwaharaTargets=null)}function Tr(e,t=!1){Oo(e),Go(e),ah(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function ah(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function sh(e){let t=Io(e.canvas);return t?(Tr(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function Do(e){if(!e.sourceHidden)return;e.element.removeAttribute(sn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function lh(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=Q0(t,e.program.quad),r=kn(t),i=kn(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Xe(t,r),i&&Xe(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function uh(e,t){return t.bloom||(t.bloom=kn(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Vu(e){let t=e.effectTargets;t?.bloom&&(Xe(e.gl,t.bloom),t.bloom=null)}function ch(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=Z0(t,e.program.quad),o=eh(t,e.program.quad),a=kn(t,n.HALF_FLOAT_OES,t.NEAREST),l=kn(t);return!i||!o||!a||!l?(dh(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function dh(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Xe(e,r),i&&Xe(e,i)}function Qu(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return Rr(e,t,o,a),Rr(e,n,o,a),{width:o,height:a}}function Fr(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),Mn(e,t)}function fh(e,t,n,r,i,o,a){let l=Qu(e,t.scratch,r,i/2,o/2),s=a/2;Fr(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),Fr(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function mh(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)Fr(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),Fr(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function Mn(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 ph(e,t,n,r,i,o,a,l){Rr(e,t.moments,i.width,i.height),Rr(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.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/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),Mn(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),Mn(e,u)}function hh(e,t,n,r){if(n<=0)return!1;let i=Qu(e.gl,t.scratch,t.blur,r.width,r.height);return mh(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function gh(e,t,n,r,i,o){if(n<=0)return Vu(e),null;o||Vu(e);let a=o?uh(e,t):t.blur;return a?(fh(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function xh(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&Oo(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=lh(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=hh(e,l,o,n),u=gh(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function bh(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&Go(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=ch(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(ph(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function Zu(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=xh(e,t,n,o),l=bh(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function yh(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=Yu(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=Po(t);return i.state==="ready"?Wu(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(Wu(e,r.href,o),Me(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Nr(o),e.lutLoadingSrc=null,Me(e))})),null)}function Ln(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&&St(n))return n;try{let r=document.querySelector(t);return r&&St(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&St(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&St(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&&St(r)?r:null}catch{return null}}function ec(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function tc(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function nc(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&tc(t)?t:null}function zu(e){if(!(e instanceof HTMLVideoElement))return!1;let t=nc(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function Sh(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function vh(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function rc(e){if(e instanceof HTMLVideoElement){let t=nc(e);if(t)return t}return tc(e)?e:null}function $u(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 Eh(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=$u(o,"x"),l=$u(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function ic(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=Eh(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function Ch(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function qu(e,t){return Math.max(0,Math.round(e>0?e:t))}function _h(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&Ch(e,i);let o=window.getComputedStyle(t);Rs(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=qu(n.offsetWidth,a.width),s=qu(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function Ut(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 vt(e,t,n,r){e.set(r,(t*je+n)*4)}function ut(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function ko(e,t,n){return e.length>=3?yi(e,t,n):new Float32Array(je)}function yt(e,t){return e[t]??0}function Ah(e,t,n){let r=Ft(t.red),i=Ft(t.green),o=Ft(t.blue),a=Ft(t.master),l=ko(n.hueVsHue,-180,180),s=ko(n.hueVsSaturation,-1,1),u=ko(n.hueVsLuma,-1,1);for(let c=0;c<je;c+=1)vt(e,0,c,[yt(r,c),yt(i,c),yt(o,c),yt(a,c)]),vt(e,1,c,[ut(yt(l,c),180),ut(yt(s,c),1),ut(yt(u,c),1),1])}function wh(e,t,n){let r=n*z0;vt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),vt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),vt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),vt(e,2,r+3,[ut(t.correction.hueShift,180),ut(t.correction.saturation,1),ut(t.correction.luma,1),ut(t.correction.temperature,1)]),vt(e,2,r+4,[ut(t.correction.tint,1),.5,.5,1])}function Th(e,t,n){let r=new Float32Array(je*In*4);Ah(r,e,t);let i=0;for(let o of n)o.enabled&&(wh(r,o,i),i+=1);return r}var ju=new WeakMap;function Rh(e,t,n){let r=ju.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return ju.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function Fh(e,t,n,r){let{curves:i,hueCurves:o}=n,a=Rh(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(Th(i,o,r),rn);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,je,In,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function Mo(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function oc(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:x,secondaries:v}=n,C=Li(f),y=Ni(x),w=ki(v)?v.reduce((D,P)=>D+Number(P.enabled),0):0;(C||y||w>0)&&Fh(e,t,n,v),Mo(e,t.shadowWheel,n.wheels.shadows),Mo(e,t.midtoneWheel,n.wheels.midtones),Mo(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,C?1:0),e.uniform1f(t.hueCurvesEnabled,y?1:0),e.uniform1f(t.secondaryCount,w);for(let[D,P]of t.adjustUniforms)e.uniform1f(P,n.adjust[D]);for(let[D,P]of t.detailUniforms)e.uniform1f(P,n.details[D]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[D,P]of t.effectUniforms)e.uniform1f(P,n.effects[D]);let T=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?W0:Fo),k=T[T.length-1]??Fo[1];e.uniform1f(t.paletteSize,T.length),Ut(e,t.palette0,T[0]??Fo[0]),Ut(e,t.palette1,T[1]??k),Ut(e,t.palette2,T[2]??k),Ut(e,t.palette3,T[3]??k),Ut(e,t.palette4,T[4]??k),Ut(e,t.palette5,T[5]??k),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function Lh(e){if(!e.sourceHidden){let t=e.element.getAttribute(tr);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(sn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function Ze(e){let t=Es.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var ac=Ze("intensity"),sc=Ze("lut.intensity"),lc=Ze("adjust.exposure"),uc=Ze("effects.kuwahara"),cc=[["blur",Ze("effects.blur")],["bloom",Ze("effects.bloom")],["kuwahara",uc],["pixelate",Ze("effects.pixelate")],["ascii",Ze("effects.ascii")],["dither",Ze("effects.dither")]],dc=[ac,sc,lc,...cc.map(([,e])=>e)];function Et(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function Nn(e,t){return t!==null&&(ws(t)||dc.some(n=>Et(e,n)!==null))}function Nh(e,t){let n=null;for(let[r,i]of cc){let o=Et(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function kh(e){let{element:t,grading:n}=e,r=Et(t,ac),i=Et(t,sc),o=Et(t,lc),a=Nh(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function fc(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 mc(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function Me(e){if(e.destroyed||e.contextLost)return!1;let t=rc(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=ec(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=Sh(t);if(s&&vh(e,t),s||!a){let v=window.getComputedStyle(s?t:e.element);e.sourceOpacityForCanvas=v.opacity||"1",e.sourceVisibleForCanvas=(s||l!=="hidden")&&v.visibility!=="hidden"}let u=_h(e,r);if(!u)return!1;let c=window.getComputedStyle(r),m=ic(u.width,u.height,n.width,n.height,c.objectFit,c.objectPosition),{gl:f,program:x}=e;try{let v=kh(e),C=yh(e);fc(f,x.texture,t);let y=Et(e.element,uc)!==null,w=Zu(e,v,u,m,{preserveKuwahara:y});f.bindFramebuffer(f.FRAMEBUFFER,null),f.viewport(0,0,u.width,u.height),f.useProgram(x.program),mc(f,x,w);let T=window.__player?.getTime?.(),k=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(k*60);return oc(f,x,v,C,w.blurReady,w.bloomReady,w.kuwaharaReady,e.compare,u,m,D,k),Mn(f,x),Lh(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",F("runtime.colorGrading.drawEntry",v),!1}}function Mh(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o: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 Dh(){let e=document.createElement("canvas"),t=Io(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function Ih(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function Ph(e,t,n,r){let i=rc(t);if(!i)return null;let o=ec(i);if(!o)return null;let a=Mh(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=ic(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return fc(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:Ih(t,r),grainSeed:Xu(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function Oh(e,t,n,r,i=!1){let o=Ph(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=rr(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let x=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=oh(e,f.lut.src,await ih(f.lut.src))),x=e.lut),c.push({id:m.id,dataUrl:Gh(e,f,x,a,l,s,u)})}catch(v){c.push({id:m.id,dataUrl:null,error:Nr(v)})}}return{...a,images:c}}function Gh(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=Zu(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),mc(s,u,c),n||(e.lut=null),oc(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,Wt,r,i,o,a),Mn(s,u),l.toDataURL("image/png")}function Ye(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function Hh(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function Dn(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||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,Me(e),!e.destroyed&&!t.paused&&!t.ended&&Dn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,Me(e),!e.destroyed&&!t.paused&&!t.ended&&Dn(e)})}function Bh(e){let t=()=>{Me(e)};if(Ye(e,e.element,"load",t),Ye(e,e.element,"loadedmetadata",t),Ye(e,e.element,"loadeddata",t),Ye(e,e.element,"seeked",t),Ye(e,e.element,"timeupdate",t),Ye(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Ye(e,e.element,"play",()=>Dn(e)),Ye(e,e.element,"pause",t)),Ye(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",Do(e)}),Ye(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!sh(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",Do(e);return}e.drawError=null,Me(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),Me(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function Uh(e){if(e.destroyed)return null;e.destroyed=!0,Hh(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),Oo(e),Go(e),Do(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function pc(e,t){return e.removeAttribute("style"),t.id?e.id=`${xs}${t.id}`:e.removeAttribute("id"),e.className=H0,e.setAttribute(G0,"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 Wh(e){return pc(document.createElement("canvas"),e)}function hc(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(_,b,S)=>{let A=e.get(_);if(A)return A.grading=b,A.source=S,Me(A),_ instanceof HTMLVideoElement&&!_.paused&&Dn(A),!0;let R=n.pop();if(R)pc(R.canvas,_);else{let G=Wh(_),U=Io(G);if(!U)return G.remove(),!1;R={canvas:G,gl:U.gl,program:U.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let N={element:_,...R,grading:b,compare:{...Wt},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:S,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(_).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(_).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Xu(_),destroyed:!1};return e.set(_,N),t.add(_),Bh(N),Me(N),_ instanceof HTMLVideoElement&&!_.paused&&Dn(N),!0},s=(_,b)=>{if(a)return!1;let S=Ln(_);if(!S)return!1;let A=e.get(S);if(!A){let R=Ar(S);if(!Nn(S,R)||!l(S,R,"attribute"))return!1;A=e.get(S)}return A?(A.compare=nh(b),Me(A),!0):!1},u=_=>{let b=e.get(_);if(!b)return;let S=Uh(b);S&&(b.contextLost||n.length>=U0?Tr(S,!0):n.push(S)),e.delete(_),t.delete(_)},c=()=>{if(a)return 0;let _=new Set;document.querySelectorAll(`video[${an}], img[${an}]`).forEach(S=>{if(!St(S))return;_.add(S);let A=Ar(S);Nn(S,A)&&(Hu(S)||zu(S))?l(S,A,"attribute"):u(S)});for(let S of t){let A=e.get(S);A&&(!S.isConnected||A.source==="attribute"&&!_.has(S))&&u(S)}return t.size},m=()=>{if(a)return 0;let _=0;for(let b of t){let S=e.get(b);S&&Me(S)&&(_+=1)}return _},f=async()=>{let _=new Set;for(let b of t){let S=e.get(b)?.grading.lut;if(!S?.src.trim()||(S.intensity??1)<=0)continue;let A=Po(S.src);A.state==="pending"&&_.add(A.promise)}return _.size>0&&await Promise.allSettled(_),m(),_.size},x=()=>{if(a)return 0;let _=0;for(let b of t){let S=e.get(b);!S||!dc.some(R=>Et(b,R)!==null)||b instanceof HTMLVideoElement&&!b.paused&&!b.ended||Me(S)&&(_+=1)}return _},v=(_,b)=>{if(a)return!1;let S=Ln(_);if(!S)return!1;let A=rr(b);return Nn(S,A)?l(S,A,"live"):(u(S),!0)},C=(_,b)=>{if(!St(_))return!1;let S=e.get(_);if(!S){if(!b)return!1;let A=Ar(_);return Nn(_,A)&&l(_,A,"attribute")}return S.sourceVisibleForCanvas=b,!b&&S.source==="attribute"&&u(_),!0},y=_=>{let b=Ln(_);if(!b)return{state:"missing",message:"Media not found"};let S=e.get(b);if(S)return S.effectError?{state:"unavailable",message:S.effectError}:S.drawError?{state:"unavailable",message:S.drawError}:S.lutError?{state:"unavailable",message:`LUT error: ${S.lutError}`}:S.grading.lut&&S.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:S.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:S.lut?"Shader + LUT active":"Shader active"};let A=Ar(b);return Nn(b,A)?!Hu(b)&&!zu(b)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},w=async(_,b,S)=>{let A=async()=>{if(a||b.length===0)return null;let N=Ln(_);return!N||(i??(i=Dh()),!i)?null:Oh(i,N,b,S?.maxDimension,S?.useMediaTime)},R=o.then(A,A);return o=R.then(()=>{},()=>{}),R},T=_=>{let b=Ln(_);if(!(b instanceof HTMLVideoElement))return null;if(!b.paused)return()=>{};let S=b.currentTime,A=b.loop,R=b.muted;return b.loop=!0,b.muted=!0,(b.ended||Number.isFinite(b.duration)&&S>=b.duration)&&(b.currentTime=0),b.play().catch(()=>{}),()=>{b.pause(),b.loop=A,b.muted=R,b.currentTime=S}},k=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let _ of t)u(_);for(let _ of n)Tr(_,!0);n.length=0,i&&(Tr(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[an]}));let D={refresh:c,redraw:m,redrawAnimated:x,waitForActiveLuts:f,setGrading:v,setCompare:s,setSourceVisibility:C,getStatus:y,renderPreviews:w,startPreviewPlayback:T,destroy:k},P=window;return P.__hf=P.__hf||{},P.__hf.colorGrading=D,c(),D}var kr=class{constructor(t){he(this,"_baseTime",0);he(this,"_playStartMs",null);he(this,"_rate",1);he(this,"_duration",1/0);he(this,"_nowMs");he(this,"_audioSource",null);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;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!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._playStartMs!==null&&(this._playStartMs=this._nowMs())}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._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}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=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"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};function gc(e){return!Number.isFinite(e)||e<=0?1:e}function Vh(e,t){t||e.paused||!Vn().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function zh(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,safeRate:o,clipDuration:a}=t,l=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let c=s-n;return l&&c<=0?!1:(l?e.start(0,n+r,c):e.start(0,n+r),!0)}let u=-n/o;return l?e.start(i+u,r,s):e.start(i+u,r),!0}var Mr=class{constructor(){he(this,"_ctx",null);he(this,"_bufferCache",new Map);he(this,"_failedSrcs",new Set);he(this,"_activeSources",[]);he(this,"_masterGain",null);he(this,"_rateAnchorCtx",0);he(this,"_rateAnchorComp",0);he(this,"_rate",1);he(this,"_paused",!0);he(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return F("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return F("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),F("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let c=gc(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=c;let f=this._ctx.createGain();f.gain.value=a,m.connect(f),f.connect(this._masterGain);let x=o-r,v=this._ctx.currentTime;if(this._rate=c,this._rateAnchorCtx=v,this._rateAnchorComp=o,!zh(m,{elapsed:x,mediaStart:i,scheduledAt:v,safeRate:c,clipDuration:u}))return m.disconnect(),f.disconnect(),null;let C=t.muted;t.muted=!0,Vh(t,C);let y={el:t,sourceNode:m,gainNode:f,compositionStart:r,mediaStart:i,scheduledAt:v,priorMuted:C,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(y),this._paused=!1,m.addEventListener("ended",()=>{let w=this._activeSources.indexOf(y);w!==-1&&(this._activeSources.splice(w,1),t.muted=C,this._activeSources.length===0&&(this._paused=!0))}),y}catch(c){return F("webAudioTransport.schedule",c),null}}setRate(t){let n=gc(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)try{r.sourceNode.playbackRate.value=n}catch(i){F("webAudioTransport.setRate",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>t.bounded)}stopAll(){for(let t of this._activeSources){try{t.sourceNode.stop(),t.sourceNode.disconnect(),t.gainNode.disconnect()}catch{}t.el.muted=t.priorMuted}this._activeSources=[],this._paused=!0}setVolume(t){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,t)))}setElementVolume(t,n){let r=Math.max(0,Math.min(1,n));for(let i of this._activeSources)if(i.el===t)try{i.gainNode.gain.value=r}catch(o){F("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterGain&&(this._masterGain.gain.value=t?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var xc="data-hf-studio-manual-edit-gesture";function bc(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var $h=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function yc(e){return Math.max(0,Math.min(1,e))}function Sc(e){let t=$h.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?yc(n):null}function vc(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=yc(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var qh=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,jh=Math.PI*2;function Kh(e){let t=qh.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 i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Yh(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(jh*t*e)}function Ec(e,t){let n=Kh(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Yh(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Xh=24,Cc=e=>e>=1?1:0,Jh=e=>e,Dr=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,Qh=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${Dr}\s*,\s*${Dr}\s+${Dr}\s*,\s*${Dr}\s+1\s*,\s*1\s*$`,"i");function _c(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function Zh(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<Xh;l+=1){let s=(o+a)/2;_c(s,t,r)<e?o=s:a=s}return _c((o+a)/2,n,i)}function eg(e){let t=Qh.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>Zh(a,n,r,i,o)}function tg(e,t){if(!e.startsWith("spring("))return null;let n=Sc(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>vc(o,n);return t.set(n,i),i}function ng(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 i=eg(n);return i&&t.set(n,i),i}function Ac(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?Cc:Ec(s,i)??tg(s,r)??ng(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??Jh)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",Cc);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Ho="data-hf-authored-duration",Bo="data-hf-authored-end",wc=!1;function et(e){if(e){if(typeof e.pause!="function"){wc||(wc=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){F("runtime.timeline.pause",t)}}}function rg(){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 Tc(){let e=Ns();ha(xe),Er(document),Ro(document);let t=rg();e.canonicalFps=t.fps??e.canonicalFps,ma(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,h,p)=>{s.has(d)||(s.add(d),Ne(h,p))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){F("runtime.init.site1",d)}let c=new kr;e.transportClock=c;let m=new Mr,f=!1;m.init().then(d=>{f=d});let x=()=>{let d=window.gsap,h=window;if(!(!d?.registerPlugin||h.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(p){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),F("runtime.autoMarker.install",p)}},v=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Ac(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),F("runtime.customEase.install",h)}};x(),v(),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{Ea(document)}catch(d){F("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let C=()=>{let d=document.querySelector('[data-composition-id][data-root="true"]');if(d instanceof HTMLElement)return d;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(p=>!p.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,h=C()?.getAttribute("data-composition-id")??"root",p={};if(d.length===1)p[h]=d[0];else for(let g=0;g<d.length;g++)p[`tl-${g}`]=d[g];window.__timelines=p}let y=C();y&&!y.hasAttribute("data-start")&&y.setAttribute("data-start","0");let w=d=>{o.push(d)},T=(d,h,p)=>{let g=p??`${d}:${JSON.stringify(h)}`;a.has(g)||(a.add(g),xe({source:"hf-preview",type:"diagnostic",code:d,details:h}))},k=d=>{let h={scale:1,focusX:960,focusY:540},p=[],g=[],E={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>p,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>g,getRenderState:()=>({...E,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},D=1/60,P=.75,_=.05,b=100,S=240,A=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},R=d=>{let h=d.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},N=d=>{if(d==null||d.trim()==="")return null;let h=Number.parseFloat(d);return!Number.isFinite(h)||h<=0?null:`${h}px`},G=()=>C(),U=()=>{let d=G();if(!d)return;let h=N(d.getAttribute("data-width")),p=N(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p),h&&d.style.setProperty("--comp-width",h),p&&d.style.setProperty("--comp-height",p)},ne=()=>{let d=G(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(p=>p.hasAttribute("data-duration")||p.hasAttribute("data-end"));for(let p of h){if(d&&p===d)continue;let g=p.getAttribute("data-duration"),E=p.getAttribute("data-end");g!=null&&!p.hasAttribute(Ho)&&p.setAttribute(Ho,g),E!=null&&!p.hasAttribute(Bo)&&p.setAttribute(Bo,E),p.removeAttribute("data-duration"),p.removeAttribute("data-end")}},H=()=>{let d=G();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let h=N(d.getAttribute("data-width")),p=N(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p);let g=Array.from(d.children);for(let E of g){let L=E.tagName.toLowerCase();if(L==="script"||L==="style"||L==="link"||L==="meta"||!E.hasAttribute("data-start")||E.hasAttribute("data-hf-autostamped"))continue;let O=(E.style.top==="0px"||E.style.top==="0")&&(E.style.left==="0px"||E.style.left==="0")&&E.style.width==="100%"&&E.style.height==="100%",X=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(E.style.transform);if(O&&X&&!E.hasAttribute("data-width")&&!E.hasAttribute("data-height")){let ve=E.style.top,Jt=E.style.left,Ee=E.style.width,Qt=E.style.height;E.style.top="",E.style.left="",E.style.width="",E.style.height="";let re=window.getComputedStyle(E);re.top!=="auto"||re.bottom!=="auto"||re.left!=="auto"||re.right!=="auto"||re.width!=="0px"||re.height!=="0px"||(E.style.top=ve,E.style.left=Jt,E.style.width=Ee,E.style.height=Qt)}let W=window.getComputedStyle(E),se=W.position;if(se!=="absolute"&&se!=="fixed"&&(E.style.position="absolute"),!!E.style.top||!!E.style.bottom||W.top!=="auto"||W.bottom!=="auto"||(E.style.top="0"),!!E.style.left||!!E.style.right||W.left!=="auto"||W.right!=="auto"||(E.style.left="0"),L!=="audio"){let ve=N(E.getAttribute("data-width")),Jt=N(E.getAttribute("data-height")),Ee=W.width!=="0px"&&W.width!=="auto",Qt=W.height!=="0px"&&W.height!=="auto";ve?!E.style.width&&!Ee&&(E.style.width=ve):!E.style.width&&W.width==="0px"&&(E.style.width="100%"),Jt?!E.style.height&&!Qt&&(E.style.height=Jt):!E.style.height&&W.height==="0px"&&(E.style.height="100%")}}},J=(d,h=0,p)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,h),_e=(d,h)=>it({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),z=d=>{let h=d.closest("[data-composition-id]"),p=h?J(h,0):null,g=h?_e(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:p,inheritedDuration:g}},Y=d=>{let h=z(d),p=h.inheritedStart??0,g=ke(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||g==null||p<=0)return J(d,p);let E=ke(d.getAttribute("data-duration")),L=h.inheritedDuration,O=L!=null&&L>0?p+L:null,X=E!=null&&E>0?g+E:g;return(O==null?g>=p:g<O&&(X>p||g===p))?g:p+g};window.__hfResolveMediaStartSeconds=Y,o.push(()=>{window.__hfResolveMediaStartSeconds===Y&&delete window.__hfResolveMediaStartSeconds});let V=(d,h)=>{let p=d.tagName.toLowerCase();if(p==="script"||p==="style"||p==="link"||p==="meta")return!1;let E=p==="video"||p==="audio"?Y(d):J(d,0),L=_e(d),O=d.getAttribute("data-composition-id");if(O){let W=(window.__timelines??{})[O],se=null;if(W&&typeof W.duration=="function"){let ie=Number(W.duration());Number.isFinite(ie)&&ie>0&&(se=ie)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(Ho)||d.hasAttribute(Bo))&&(L==null||L<=0)&&se!=null&&(L=se)}let X=L!=null&&L>0?E+L:Number.POSITIVE_INFINITY;return h>=E&&(Number.isFinite(X)?h<X:!0)},ee=!!document.querySelector("[data-composition-src]"),Ae=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of d){let p=h.getAttribute("data-composition-id");if(p&&h.children.length===0&&document.querySelector(`template#${CSS.escape(p)}-template`)){Ae=!0;break}}}let B=!ee&&!Ae,M=d=>{if(!d||typeof d.duration!="function")return null;try{let h=Number(d.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},I=d=>typeof d=="number"&&Number.isFinite(d)&&d>D,ue=d=>{let h=Number(d.getAttribute("data-duration"));if(Number.isFinite(h)&&h>0)return h;let p=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),g=Number.isFinite(p)?Math.max(0,p):0;return Number.isFinite(d.duration)&&d.duration>g?Math.max(0,d.duration-g):null},ae=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let h=0;for(let p of d){let g=Y(p);if(!Number.isFinite(g))continue;let E=ue(p);E==null||E<=D||(h=Math.max(h,Math.max(0,g)+E))}return h>D?h:null},$=()=>{let d=G();if(!d)return null;let h=window.__timelines??{},p=it({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),g=0,E=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(E)&&E>0&&(g=E);let L=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let O of L){if(!(O instanceof Element)||O.parentElement?.closest("[data-composition-id]")!==d)continue;let W=p.resolveStartForElement(O,0),se=p.resolveDurationForElement(O);!Number.isFinite(W)||se==null||se<=0||(g=Math.max(g,Math.max(0,W)+se))}return g>D?g:null},q=()=>{let d=ae();return typeof d!="number"||!Number.isFinite(d)||d<=D?null:d},j=d=>I(d)?Math.max(D,d*P):D,Ve=()=>{let d=0;for(let h of e.deterministicAdapters){let p=h.getInferredDurationSeconds;if(typeof p!="function")continue;let g=null;try{g=p()}catch(E){F("runtime.init.adapterDuration",E)}typeof g=="number"&&Number.isFinite(g)&&g>0&&(d=Math.max(d,g))}return d>D?d:null},me=(d,h=0)=>{let p=M(d),g=q(),E=$(),L=Ve(),O=Math.max(g??0,E??0,L??0),X=Number.isFinite(h)&&h>D?h:0,W=0;return I(p)?W=Math.max(p,O,X):I(O)?W=Math.max(O,X):W=X,W>0?Math.max(0,W):0},Ct=()=>{let d=window.__timelines??{},h=re=>{let Q=Object.entries(d).filter(oe=>!!oe[1]&&typeof oe[1].play=="function"&&typeof oe[1].pause=="function");if(Q.length!==1)return{timeline:null};let fe=Q[0];if(!fe)return{timeline:null};let[pe,ge]=fe;return{timeline:ge,selectedTimelineIds:[pe],selectedDurationSeconds:M(ge),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:re,soleTimelineId:pe}}}},p=it({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),g=q(),E=$(),L=Math.max(g??0,E??0)||null,O=j(L),X=re=>{let Q=document.querySelector(`[data-composition-id="${CSS.escape(re)}"]`);return Q?p.resolveStartForElement(Q,0):0},W=re=>{let Q=window.gsap;if(!Q||typeof Q.timeline!="function")return null;let fe=Q.timeline({paused:!0});for(let pe of re)fe.add(pe.timeline,X(pe.compositionId));return fe},se=(re,Q)=>{if(!I(re))return null;let fe=window.gsap;if(!fe||typeof fe.timeline!="function")return null;let pe=fe.timeline({paused:!0});if(Q)try{pe.add(Q,0)}catch(oe){F("runtime.init.site2",oe)}let ge=pe;if(typeof ge.to=="function")try{ge.to({},{duration:re})}catch(oe){F("runtime.init.site3",oe)}return pe},Le=(re,Q)=>{let fe=re;if(typeof fe.getChildren!="function")return[];try{let pe=fe.getChildren(!0,!0,!0)??[];if(!Array.isArray(pe))return[];let ge=[];for(let oe of Q)if(!pe.some(He=>He===oe.timeline))try{let He=X(oe.compositionId);re.add(oe.timeline,He),ge.push(oe.compositionId)}catch(He){F("runtime.init.site4",He)}return ge}catch{return[]}},ie=G(),te=ie?.getAttribute("data-composition-id")??null;if(!te)return h("root_missing_composition_id");let ve=d[te]??null,Ee=(()=>{if(!ie)return[];let re=new Set,Q=Array.from(ie.querySelectorAll("[data-composition-id]")),fe=[];for(let pe of Q){let ge=pe.getAttribute("data-composition-id");if(!ge||ge===te||re.has(ge))continue;re.add(ge);let oe=d[ge]??null;if(!oe||typeof oe.play!="function"||typeof oe.pause!="function")continue;let Re=M(oe);fe.push({compositionId:ge,timeline:oe,durationSeconds:Re??0})}return fe})(),Qt=re=>{for(let Q of re){let fe=Q.timeline;if(typeof fe.paused=="function")try{fe.paused(!1)}catch(pe){F("runtime.init.site5",pe)}}};if(Ee.length>0&&Qt(Ee),ve){let re=Ee.length>0?Le(ve,Ee):[];if((Ee.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+te+"'])"))&&(Ie=!0),re.length>0)try{let oe=ve.time();ve.seek(oe,!1)}catch{}let Q=M(ve);if(!I(Q)&&Ee.length>0){let oe=Ee.map(Sd=>Sd.compositionId),Re=W(Ee),He=M(Re);if(Re&&I(He))return{timeline:Re,selectedTimelineIds:oe,selectedDurationSeconds:He,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:He,mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:E,selectedTimelineIds:oe,autoNestedChildren:re}}};let Xr=se(L??0,ve),Jr=M(Xr);if(Xr&&I(Jr))return{timeline:Xr,selectedTimelineIds:[te],selectedDurationSeconds:Jr,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Jr,selectedTimelineIds:[te],autoNestedChildren:re}}}}if(!I(Q)&&Ee.length===0){let oe=se(L??0,ve),Re=M(oe);if(oe&&I(Re))return{timeline:oe,selectedTimelineIds:[te],selectedDurationSeconds:Re,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:te,rootDurationSeconds:Q,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:g,authoredCompositionDurationFloorSeconds:E,selectedDurationSeconds:Re,selectedTimelineIds:[te]}}}}let fe=ie?.getAttribute("data-duration"),pe=fe?parseFloat(fe):null,ge=Math.max(I(pe)?pe:0,E??0);if(ge>0&&I(ge)&&I(Q)&&ge>=Q+.5){let oe=ve;if(typeof oe.to=="function")try{oe.to({},{duration:0},ge)}catch(He){F("runtime.init.site6",He)}let Re=M(ve);if(I(Re))return{timeline:ve,selectedTimelineIds:[te],selectedDurationSeconds:Re,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:te,rootDurationSeconds:Q,rootDeclaredDur:pe,authoredCompositionDurationFloorSeconds:E,newDur:Re}}}}return{timeline:ve,selectedTimelineIds:[te],selectedDurationSeconds:Q,mediaDurationFloorSeconds:g,diagnostics:re.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:te,selectedDurationSeconds:Q,autoNestedChildren:re}}:void 0}}if(Ee.length>0){let re=Ee.map(pe=>pe.compositionId),Q=W(Ee),fe=M(Q);if(Q)return{timeline:Q,selectedTimelineIds:re,selectedDurationSeconds:fe,mediaDurationFloorSeconds:g,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:te,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:O,selectedDurationSeconds:fe,mediaDurationFloorSeconds:g,selectedTimelineIds:re}}}}return h("root_composition_id_unmatched_in_registry")},Ie=!1,ed=d=>{let h=window.gsap,p=d;if(!(!p||typeof p.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let g of p.getChildren(!0,!0,!0)){let E=g,L=E.timeline;if(!L||!("_ease"in L)||typeof L._ease=="function")continue;let O=E.vars?.keyframes,W=(O&&!Array.isArray(O)?O.ease:void 0)??E.vars?.ease??"none";try{let se=h.parseEase(W);typeof se=="function"&&(L._ease=se)}catch(se){Ne("keyframe_ease_repair_failed",{ease:typeof W=="string"?W:String(W)}),F("runtime.keyframeEase.repair",se)}}},qt=()=>{if(v(),!B)return!1;let d=e.capturedTimeline,h=M(d),p=I(h);if(d&&p&&Ie)return!1;let g=Ct();if(!g.timeline)return!1;if(d&&d===g.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=g.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),ed(e.capturedTimeline);let E=me(e.capturedTimeline,0);if(E<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),et(e.capturedTimeline)),E>0){try{c.setDuration(E)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let O=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(O,!1),et(e.capturedTimeline)}let L=window.__hfStudioManualEditsApply;typeof L=="function"&&L(),Er(document)}if(g.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:g.diagnostics.code,details:g.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:g.selectedTimelineIds??[],selectedDurationSeconds:g.selectedDurationSeconds??null,mediaDurationFloorSeconds:g.mediaDurationFloorSeconds??null}}),window.parent!==window){let L=G(),O=E>0?E:0,X=String(O>0?O:1),W=new Set,se=new Set(document.querySelectorAll("[data-start]")),Le=ie=>{let te=ie.parentElement;for(;te&&te!==L;){if(se.has(te))return!0;te=te.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ie of e.capturedTimeline.getChildren(!0))if(typeof ie.targets=="function")for(let te of ie.targets())te instanceof HTMLElement&&te!==L&&(te.hasAttribute("data-start")||Le(te)||W.has(te)||(W.add(te),te.setAttribute("data-start","0"),te.setAttribute("data-duration",X),te.setAttribute("data-hf-autostamped","1")))}catch{}if(L instanceof HTMLElement)for(let ie of L.querySelectorAll("[id]"))ie instanceof HTMLElement&&ie!==L&&(ie.hasAttribute("data-start")||Le(ie)||W.has(ie)||ie.tagName==="SCRIPT"||ie.tagName==="STYLE"||ie.tagName==="LINK"||(W.add(ie),ie.setAttribute("data-start","0"),ie.setAttribute("data-duration",X),ie.setAttribute("data-hf-autostamped","1")))}for(let L of jt)Gn.delete(L),Zo(L);return!0};window.__hfForceTimelineRebind=()=>{Ie=!1,qt(),zr(e.currentTime)};let td=()=>{let d=G();if(!(d instanceof HTMLElement))return;let h=d.getBoundingClientRect(),p=Number(d.getAttribute("data-width")),g=Number(d.getAttribute("data-height")),E=window.getComputedStyle(d),L=Number.isFinite(p)&&p>0&&Number.isFinite(g)&&g>0,O=h.width<=0||h.height<=0||d.clientWidth<=0||d.clientHeight<=0;!L||!O||T("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:p,declaredHeight:g,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:E.display,visibility:E.visibility,overflow:E.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},nd=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,td()}))},rd=()=>{r=d=>{let h=A(d.error??d.message).slice(0,S);if(!h)return;let p=R(h);xe({source:"hf-preview",type:"diagnostic",code:p.code,details:{category:p.category,message:h,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let h=A(d.reason).slice(0,S);if(!h)return;let p=R(h);xe({source:"hf-preview",type:"diagnostic",code:`${p.code}_unhandled_rejection`,details:{category:`${p.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},id=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let p of d){let g=()=>{if(!(p instanceof Element))return;let E=p.tagName.toLowerCase(),L=p.getAttribute("src")??p.getAttribute("href")??p.getAttribute("poster")??null,O=E==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";T(O,{tagName:E,assetUrl:L,currentSrc:(p instanceof HTMLImageElement||p instanceof HTMLMediaElement)&&p.currentSrc||null,readyState:p instanceof HTMLMediaElement?p.readyState:null,networkState:p instanceof HTMLMediaElement?p.networkState:null},`${O}:${E}:${L??"unknown"}`)};p.addEventListener("error",g),w(()=>{p.removeEventListener("error",g)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let p=Array.from(h).filter(g=>g.status==="error").map(g=>g.family).filter(g=>!!g).slice(0,10);p.length!==0&&T("runtime_font_load_issue",{failedFamilies:p,totalFaces:Array.from(h).length},`runtime-font-load-issue:${p.join("|")}`)}).catch(()=>{})},od=(d,h)=>{if(!d.timeline)return!1;let p=e.capturedTimeline;if(p&&p===d.timeline)return!1;let g=Math.max(0,e.currentTime||0),E=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{et(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(g,!1),E&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(L){F("runtime.init.site7",L)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:g,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},ft=null,Yo=!1,Xo=!1,jt=new Set,Gn=new WeakMap,Hn=()=>{e.tornDown||(ft!=null&&window.clearTimeout(ft),ft=window.setTimeout(()=>{if(e.tornDown||(ft=null,Xo&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Ct();if(!d.timeline||!I(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){qt()&&(mt(),Fe(!0));return}if(Yo)return;let p=M(e.capturedTimeline),g=d.selectedDurationSeconds??M(d.timeline);I(g)&&(!I(p)||g>=p+_)&&od(d,"manual")&&(Yo=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:p??null,selectedDurationSeconds:g??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),mt(),Fe(!0))},b))},Jo=d=>{d.currentTarget instanceof HTMLMediaElement&&Qa(d.currentTarget)},Qo=d=>{d.currentTarget instanceof HTMLMediaElement&&Za(d.currentTarget)},ad=()=>{for(let d of jt)d.removeEventListener("loadedmetadata",Hn),d.removeEventListener("durationchange",Hn),d.removeEventListener("loadedmetadata",Jo),d.removeEventListener("error",Qo);jt.clear()},Br=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let h of d){if(jt.has(h))continue;jt.add(h);let p=Number.parseFloat(h.dataset.volume??"");Number.isFinite(p)&&(h.volume=Math.max(0,Math.min(1,p))),h.addEventListener("loadedmetadata",Hn),h.addEventListener("durationchange",Hn),h.addEventListener("loadedmetadata",Jo),h.addEventListener("error",Qo),Ja(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),Zo(h)}},Zo=d=>{Gn.has(d)||Va(d,e.capturedTimeline,me(e.capturedTimeline,0),Gn,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},Ur=new WeakMap,ea=d=>{let h=Ur.get(d);if(h!==void 0)return h;let p=window.getComputedStyle(d).position,g=p==="static"||p==="relative"||p==="sticky";return Ur.set(d,g),g},Wr=new WeakMap,sd=d=>{let h=Wr.get(d);if(h!==void 0)return h;let p=d.querySelector("[data-start]")===null;return Wr.set(d,p),p},ld=()=>{Ur=new WeakMap,Wr=new WeakMap},Vr=new WeakMap,Bn=new WeakSet,zr=(d,h=Array.from(document.querySelectorAll("[data-start]")))=>{let p=G();for(let g of h){if(!(g instanceof HTMLElement))continue;if(g.hasAttribute("data-hidden")){Bn.has(g)||(Vr.set(g,g.style.getPropertyValue("display")),Bn.add(g)),g.style.display="none",(g instanceof HTMLVideoElement||g instanceof HTMLImageElement)&&n?.setSourceVisibility(g,!1);continue}if(Bn.has(g)){let L=Vr.get(g);L?g.style.display=L:g.style.removeProperty("display"),Vr.delete(g),Bn.delete(g)}let E=V(g,d);if(E){let L=g.parentElement;for(;L&&L!==p;){if(L instanceof HTMLElement&&L.hasAttribute("data-start")&&!V(L,d)){E=!1;break}L=L.parentElement}}g.style.visibility=E?"visible":"hidden",(g instanceof HTMLVideoElement||g instanceof HTMLImageElement)&&n?.setSourceVisibility(g,E),E?ea(g)&&g.style.removeProperty("display"):ea(g)&&sd(g)&&(g.style.display="none")}},Pe=()=>{let d=qa({shouldIncludeElement:p=>p.hasAttribute("data-start")||!!z(p).compositionRoot,resolveStartSeconds:p=>Y(p),resolveDurationSeconds:p=>{let g=z(p),E=Y(p),L=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,O=g.inheritedStart!=null&&g.inheritedDuration!=null&&g.inheritedDuration>0?Math.max(0,g.inheritedStart+g.inheritedDuration-E):null,X=Number.isFinite(p.duration)&&p.duration>L?Math.max(0,p.duration-L):null,W=Number.parseFloat(p.dataset.duration??""),se=Number.isFinite(W)&&W>0?W:null;return $a({isVideo:p.tagName==="VIDEO",sourceDuration:X,hostRemaining:O,explicitDuration:se})}});for(let p of d.mediaClips){let g=Gn.get(p.el);g&&(p.volumeKeyframes=g)}let h=e.mediaForceSyncNextTick;h&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||ja({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted||!e.webAudioMediaDisabled&&!e.nativeMediaSyncDisabled&&m.isActive(),userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:h,onElementVolume:(p,g)=>m.setElementVolume(p,g),isWebAudioOwned:p=>m.ownsElement(p),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),zr(e.currentTime)},Fe=d=>{let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),p=Date.now();(d||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||p-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=p,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},$r="",ta=0,ud=()=>{let d="";for(let h of document.querySelectorAll("[data-start]"))d+=`${h.id}:${h.tagName}|`;return d},mt=()=>{ne(),U(),H();let d=G();if(d){let g=N(d.getAttribute("data-width")),E=N(d.getAttribute("data-height")),L=g?parseInt(g,10):0,O=E?parseInt(E,10):0;L>0&&O>0&&xe({source:"hf-preview",type:"stage-size",width:L,height:O})}qt();let h=Hs({canonicalFps:e.canonicalFps});window.__clipManifest=h;let p=ud();if($r!==p&&ld(),!window.__clipTree||$r!==p){let g=window;window.__clipTree=ks({startResolver:it({timelineRegistry:g.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:g.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),$r=p}xe(h),nd()},qr=d=>Number.isFinite(d)&&d>0?d:0,cd=d=>{let h=qr(Number(d));if(h<=0)return;let p=G(),g=qr(Number.parseFloat(p?.getAttribute("data-duration")??"")),E=Math.max(ta,qr(c.getDuration()),g);h<=E||(ta=h,p?.setAttribute("data-duration",String(h)),c.setDuration(h),mt(),Fe(!0))},Oe=(d,h=0)=>{for(let p of e.deterministicAdapters){try{d==="discover"&&p.discover(),d==="pause"&&p.pause(),d==="play"&&p.play&&p.play()}catch(g){F("runtime.init.site8",g)}if(d==="discover")try{p.seek({time:h,suppressEvents:!0})}catch(g){F("runtime.init.site9",g)}}},pt=()=>{window.__renderReady=!1},Kt=null,Yt=!0,dd=()=>{let d=[];for(let h of e.deterministicAdapters){let p=h.getReadyPromise;if(typeof p=="function")try{let g=p();g&&d.push(g)}catch(g){F("runtime.init.adapterReady",g)}}return d},fd=()=>{let d=dd();if(d.length===0)return Kt=null,Yt=!0,!0;let h=d[0];if(!h)return!0;let p=d.length===1?h:Promise.all(d);return p!==Kt&&(Kt=p,Yt=!1,Promise.resolve(p).then(()=>{Kt===p&&(Yt=!0,pt())},g=>{Kt===p&&(Yt=!0,F("runtime.init.adapterReady",g),pt())})),Yt};if(B)Eo();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:N,onDiagnostic:({code:h,details:p})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:p})}};Lu(d).then(()=>Fu(d)).finally(()=>{B=!0,Br(),id(),Eo(),Ro(document),pt()})}let Un=Ts({postMessage:d=>xe(d)});Un.installPickerApi(),zr(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let ze=hc();n=ze,w(()=>{ze.destroy(),n=null});let jr=d=>{let h=Number(d);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let p=document.querySelectorAll("video, audio");for(let g of p)if(g instanceof HTMLMediaElement)try{g.playbackRate=e.playbackRate}catch(E){F("runtime.init.site10",E)}},na={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let h=me(d,0);if(h>0)c.setDuration(h),c.reachedEnd()&&(c.seek(0),e.currentTime=0,ht(0));else{let p=G(),g=Number(p?.getAttribute("data-duration")??0);g>0&&c.setDuration(g)}et(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,la(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&ua(),Oe("play"),Pe(),ze.redraw(),Fe(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,la(e.currentTime);let d=e.capturedTimeline;et(d),Oe("pause"),Pe(),ze.redraw(),Fe(!0)},seek:(d,h)=>{let p=kt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let g=c.isPlaying();g&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let E=e.capturedTimeline;if(et(E),ht(e.currentTime),Oe("pause"),h?.keepPlaying&&g){na.play();return}Pe(),ze.redraw(),Fe(!0)},renderSeek:(d,h)=>{Xo=!0;let p=kt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,ht(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),Oe("pause"),Pe(),ze.redraw(),Fe(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{jr(d),c.setRate(e.playbackRate),ca()},getPlaybackRate:()=>e.playbackRate},ra=me(e.capturedTimeline,0);ra>0&&c.setDuration(ra);let Ge=Ls({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:jr,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,h)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Pe()},onStatePost:Fe,onDeterministicSeek:(d,h)=>{for(let p of e.deterministicAdapters)if(!(p.name==="gsap"&&e.capturedTimeline))try{p.seek({time:Number(d)||0,suppressEvents:h?.suppressEvents})}catch(g){F("runtime.init.site11",g)}},onDeterministicPause:()=>Oe("pause"),onDeterministicPlay:()=>Oe("play"),onRenderFrameSeek:()=>{ze.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>me(e.capturedTimeline,0),transport:na});window.__player=k(Ge),window.__playerReady=!0,Ne("composition_loaded",{duration:Ge.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Ua(),_a({resolveStartSeconds:d=>J(d,0)}),wa(),Ra(),Na(),ka(),Ma(),Da(),Ia(),Pa(),Oa(),Aa({getTimeline:()=>e.capturedTimeline})],Ha(),Ba(),window.__hfReseekGpu=d=>{let h=Math.max(0,Number(d)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,Yn(h)},window.__hfWaitForSeekCompletion=li,o.push(()=>{window.__hfWaitForSeekCompletion===li&&delete window.__hfWaitForSeekCompletion}),rd(),Br(),Oe("discover");let md=()=>{let d=e.capturedTimeline,h=qt();e.capturedTimeline&&(h||e.capturedTimeline!==d||!Ge._timeline)&&(Ge._timeline=e.capturedTimeline);let p=me(e.capturedTimeline,0);if(p>0&&c.setDuration(p),Oe("discover",e.currentTime),!e.capturedTimeline){let g=window.__timelines??{},E=Object.keys(g).filter(L=>g[L]);if(E.length>0){let O=G()?.getAttribute("data-composition-id")??null;T("root_timeline_unbound_registry_present",{reason:O?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:O,registeredTimelineKeys:E},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(O?`Root data-composition-id is "${O}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${E.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${O??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,mt(),Fe(!0)},_t=null,pd=()=>{if(_t)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),_t=null,pt()};_t=d,window.addEventListener("hf-timelines-built",d)};w(()=>{_t&&(window.removeEventListener("hf-timelines-built",_t),_t=null)}),pt=()=>{if(!B){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,pd();return}if(Oe("discover",e.currentTime),!fd()){window.__renderReady=!1;return}md()},pt(),B&&setTimeout(()=>{pt()},0);let Wn=0,Kr=!1,hd=(d,h,p,g)=>{try{let E=g?.suppressEvents===!0;et(d),typeof d.totalTime=="function"?d.totalTime(h,E):d.seek(h,E)}catch(E){F(p,E)}},gd=(d,h)=>{let p=window.__timelines??{},g=G()?.getAttribute("data-composition-id")??null;for(let[E,L]of Object.entries(p)){if(!L||E===g)continue;let O=document.querySelector(`[data-composition-id="${CSS.escape(E)}"]`);if(!O)continue;let X=J(O,0);if(!Number.isFinite(X))continue;let W=M(L),se=Rt(O)+Math.max(0,d-X)*qe(O),Le=Math.max(0,W!=null&&W>0?Math.min(W,se):se);hd(L,Le,"runtime.init.transport.childTimeline",h)}},ia=d=>{let h=window.__timelines??{};for(let p of Object.values(h))if(!(!p||p===d))try{p.play()}catch(g){F("runtime.init.activateSiblings",g)}},oa=d=>typeof d=="object"&&d!==null,Xt=new WeakMap,xd=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],aa=(d,h)=>{let p=d[h];if(typeof p!="function")return null;try{let g=Number(p.call(d));return Number.isFinite(g)?g:null}catch(g){return F("runtime.init.gsapCallbackDuration",g),null}},bd=d=>{let h=Xt.get(d);if(h!=null)return h;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let p;try{p=d.getChildren(!0,!0,!0)}catch(g){return F("runtime.init.gsapCallbackChildren",g),Xt.set(d,!1),!1}if(!Array.isArray(p))return Xt.set(d,!1),!1;for(let g of p){if(!oa(g))continue;let E=g.vars;if(!oa(E)||!xd.some(W=>typeof E[W]=="function"))continue;let X=aa(g,"totalDuration")??aa(g,"duration");if(X!=null&&X<=1e-6)return Xt.set(d,!0),!0}return Xt.set(d,!1),!1};function ht(d,h){let p=e.capturedTimeline,g=h?.suppressEvents===!0;if(p){h?.activateChildren&&ia(p);let E=p,L=d;if(typeof E.totalDuration=="function")try{let O=Number(E.totalDuration());Number.isFinite(O)&&O>0&&d>O&&(L=O)}catch(O){F("runtime.init.transport.clampDuration",O)}try{typeof p.totalTime=="function"?(p.totalTime(L,g),!g&&!bd(p)&&(p.totalTime(L+.001,!0),p.totalTime(L,!0))):p.seek(L,g)}catch(O){F("runtime.init.transport.seek",O)}}gd(d,h),p&&h?.activateChildren&&ia(p);for(let E of e.deterministicAdapters)if(!(E.name==="gsap"&&p))try{E.seek({time:d,suppressEvents:g})}catch(L){F("runtime.init.transport.adapter",L)}}let yd=()=>{try{return document.querySelector(`[${xc}]`)!=null}catch{return!1}},sa=()=>{if(!(e.tornDown||Kr)){Kr=!0;try{if(e.transportRafId=window.requestAnimationFrame(sa),Wn+=1,bc({tick:Wn,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let h=e.capturedTimeline;if(qt()){e.capturedTimeline&&!Ge._timeline&&(Ge._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==h&&et(e.capturedTimeline);let p=me(e.capturedTimeline,0);p>0&&c.setDuration(p),mt()}}if(Wn%20===0&&mt(),Wn%30===0&&Br(),e.capturedTimeline){let h=me(e.capturedTimeline,0);h>0&&(!c.isPlaying()||h>=c.getDuration())&&c.setDuration(h)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let h=m.getTime();h>=0&&c.attachAudioSource({currentTimeSeconds:h})}else{let h=document.querySelectorAll("audio[data-start]"),p=!1;for(let g of h){if(!(g instanceof HTMLMediaElement)||!g.isConnected)continue;let E=Number.parseFloat(g.dataset.start??""),L=Number.parseFloat(g.dataset.duration??""),O=Number.isFinite(L)&&L>0?E+L:1/0,X=Number.parseFloat(g.dataset.playbackStart??g.dataset.mediaStart??"0")||0;if(Number.isFinite(E)&&e.currentTime>=E&&e.currentTime<O){g.paused?!g.error&&g.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),p=!0):(c.attachAudioSource({el:g,compositionStart:E,mediaStart:X}),p=!0);break}}!p&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!yd())&&ht(d),c.isPlaying()&&ze.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,ht(h)),Oe("pause"),Pe(),Fe(!0);return}c.isPlaying()&&Pe(),Fe(!1)}finally{Kr=!1}}},la=d=>{let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let g=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(g))continue;let E=Number.parseFloat(p.dataset.duration??""),L=Number.isFinite(E)&&E>0?g+E:1/0;if(d<g||d>=L)continue;let O=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,X=d-g+O;if(X>=0)try{p.currentTime=X}catch{}}},ua=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let g=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(g))continue;let E=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,L=Number.parseFloat(p.dataset.volume??""),O=Number.isFinite(L)?L:1,X=Number.parseFloat(p.dataset.duration??""),W=Number.isFinite(X)&&X>0?X:Number.POSITIVE_INFINITY,se=p.closest("[data-composition-id]");if(se){let Le=J(se,0),ie=_e(se,{includeAuthoredTimingAttrs:!0});ie!=null&&ie>0&&(W=Math.min(W,Math.max(0,Le+ie-g)))}m.decodeAudioElement(p).then(Le=>{!Le||!c.isPlaying()||m.schedulePlayback(p,Le,g,E,c.now(),O*e.bridgeVolume,d,e.playbackRate,W)})}};function ca(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),ua())}if(e.capturedTimeline){let d=me(e.capturedTimeline,0);d>0&&c.setDuration(d),et(e.capturedTimeline)}Pu(window),e.transportRafId=window.requestAnimationFrame(sa),mt(),Fe(!0),e.controlBridgeHandler=pa({onPlay:()=>{Ge.play(),Ne("composition_played",{time:Ge.getTime()})},onPause:()=>{Ge.pause(),Ne("composition_paused",{time:Ge.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let h of d)h instanceof HTMLMediaElement&&!h.paused&&h.pause()},onSeek:(d,h)=>{Ge.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let h=d||e.mediaOutputMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let g of p)g instanceof HTMLMediaElement&&(g.muted=h||g.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement))continue;let g=parseFloat(p.dataset.volume??""),E=Number.isFinite(g)?g:1;p.volume=E*d}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let h=d||e.bridgeMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let g of p)g instanceof HTMLMediaElement&&(g.muted=h||g.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Pe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Pe())},onSetPlaybackRate:d=>{jr(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),ca()},onSetRootDuration:cd,onSetColorGrading:(d,h)=>{ze.setGrading(d,h)},onSetColorGradingCompare:(d,h)=>{ze.setCompare(d,h)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,ht(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,ht(h)),Oe("pause"),Pe(),Fe(!0)}},onEnablePickMode:()=>Un.enablePickMode(),onDisablePickMode:()=>Un.disablePickMode(),getCanonicalFps:()=>e.canonicalFps});let Yr=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),ft!=null&&(window.clearTimeout(ft),ft=null),l!=null&&(window.cancelAnimationFrame(l),l=null),ad(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),Un.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(h){F("runtime.init.site12",h)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(h){F("runtime.init.site13",h)}for(let d of e.injectedCompStyles)try{d.remove()}catch(h){F("runtime.init.site14",h)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(h){F("runtime.init.site15",h)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(h){F("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===Yr&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=Yr,e.beforeUnloadHandler=Yr,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Rc=["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"],Uo=[[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 ig(e){if(e<=255)return Rc[e];let t=0,n=Uo.length-1;for(;t<=n;){let r=t+n>>1,i=Uo[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function og(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let v=e.charCodeAt(u+1);v>=56320&&v<=57343&&(m=(c-55296<<10)+(v-56320)+65536,f=2)}let x=ig(m);(x==="R"||x==="AL"||x==="AN")&&(r=!0);for(let v=0;v<f;v++)n[u+v]=x;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,x=m!=="L"?"R":"L";if(x===(f!=="L"?"R":"L"))for(let C=u;C<c;C++)n[C]=x;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function Fc(e,t){let n=og(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var ag=/[ \t\n\r\f]+/g,sg=/[\t\n\r\f]| {2,}|^ | $/;function lg(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function ug(e){if(!sg.test(e))return e;let t=e.replace(ag," ");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 cg(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
348
|
+
})();`}var kh=["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 fc(e){let t=e.getAttribute("id")?.trim();for(let n of kh)e.removeAttribute(n);t&&(e.removeAttribute("id"),e.setAttribute("data-hf-authored-id",t)),e.setAttribute("data-hf-inner-root","true")}var Fh=8e3,Mh=/^(?![a-zA-Z][a-zA-Z\d+\-.]*:)(?!\/\/)(?!\/)(?!\.\.?\/).+/,Nh=/\burl\(\s*(["']?)([^)"']+)\1\s*\)/g,Lh=["src","href"];function Dh(e){return!e||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/")}function hc(e,t){if(!t)return e;let n=e.trim();if(Dh(n)||!n.startsWith("../")&&n!=="..")return e;try{return new URL(n,t).href}catch{return e}}function gc(e,t){return!t||!e?e:e.replace(Nh,(n,r,i)=>{let o=hc(i||"",t);return o===i?n:`url(${r||""}${o}${r||""})`})}function Ih(e,t){for(let n of Array.from(e.querySelectorAll("[src], [href]")))for(let r of Lh){let i=n.getAttribute(r);if(i==null)continue;let o=hc(i,t);o!==i&&n.setAttribute(r,o)}}function Ph(e,t){for(let n of Array.from(e.querySelectorAll("[style]"))){let r=n.getAttribute("style");if(r==null)continue;let i=gc(r,t);i!==r&&n.setAttribute("style",i)}}function Oh(e,t){for(let n of Array.from(e.querySelectorAll("style"))){let r=n.textContent||"",i=gc(r,t);i!==r&&(n.textContent=i)}}function bc(e,t){if(t){Ih(e,t),Ph(e,t),Oh(e,t);for(let n of Array.from(e.querySelectorAll("template")))bc(n.content,t)}}function Hh(e,t){return`${e}__hf${t}`}var Gh=e=>new Promise(t=>{let n=!1,r=Date.now(),i=null,o=a=>{n||(n=!0,i!=null&&window.clearTimeout(i),t({status:a,elapsedMs:Math.max(0,Date.now()-r)}))};e.addEventListener("load",()=>o("load"),{once:!0}),e.addEventListener("error",()=>o("error"),{once:!0}),i=window.setTimeout(()=>o("timeout"),Fh)});function zo(e){for(;e.firstChild;)e.removeChild(e.firstChild);e.textContent=""}function mc(e){for(let t of Array.from(e.querySelectorAll("style, script")))t.remove()}function Bh(e){let t=document.importNode(e,!0);fc(t);let n=t.getAttribute("data-width"),r=t.getAttribute("data-height");return t.style.width=n?`${n}px`:"100%",t.style.height=r?`${r}px`:"100%",t}function Uh(e,t){let n=e.trim();if(!n)return e;try{return Mh.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 pc(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 Wr(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 Wh(e){let t=new Map;for(let n of e){let r=Wr(n).authoredCompositionId||"";r&&t.set(r,(t.get(r)||0)+1)}return t}function xc(e){let t=Wr(e).authoredCompositionId;return t?!!document.querySelector(`template#${CSS.escape(t)}-template`):!1}function Vh(e){return!!e.querySelector('[data-hf-inner-root="true"]')}function zh(e){return e.hasAttribute("data-composition-src")?!0:xc(e)?e.children.length===0||e.hasAttribute("data-hf-original-composition-id")?!0:Vh(e):!1}function $o(){return Array.from(document.querySelectorAll("[data-composition-src], [data-composition-id]")).filter(t=>t.hasAttribute("data-composition-src")?!0:xc(t))}function yc(){let e=window.__hfVariablesByComp;if(!e)return;let t=new Set($o().map(n=>Wr(n).runtimeCompositionId).filter(n=>!!n));for(let n of Object.keys(e))t.has(n)||delete e[n]}function Sc(e,t=Wh(e)){let n=new Map,r=new Map;for(let i of e){let{authoredCompositionId:o,runtimeCompositionId:a}=Wr(i),l=zh(i);if(!o){r.set(i,{authoredCompositionId:null,runtimeCompositionId:a});continue}let s=(t.get(o)||0)>1,u=a||o;if(l){let c=s?(n.get(o)||0)+1:0;s&&n.set(o,c),u=s?Hh(o,c):o,s?i.setAttribute("data-hf-original-composition-id",o):i.removeAttribute("data-hf-original-composition-id"),i.setAttribute("data-composition-id",u),a&&a!==u&&window.__hfVariablesByComp&&delete window.__hfVariablesByComp[a]}r.set(i,{authoredCompositionId:o,runtimeCompositionId:u})}return r}async function qo(e){let t=Dl({contentNode:e.sourceNode,head:e.head,hasTemplate:e.hasTemplate,compositionId:e.authoredCompositionId}),n=t.innerRoot instanceof HTMLElement?t.innerRoot:null,r=n??e.sourceNode,i=t.authoredCompositionId,o=t.scriptCompositionId,a=e.runtimeCompositionId||null,l=t.authoredRootId,s=a?`[data-composition-id="${CSS.escape(a)}"]`:void 0;for(let f of t.linkSources){let g=(f.getAttribute("href")||"").trim();if(!g)continue;let x=e.compositionUrl?new URL(g,e.compositionUrl).href:g;if(e.compositionUrl&&pc(x,e.compositionUrl)||document.head.querySelector(`link[href="${CSS.escape(x)}"]`))continue;let v=f.cloneNode(!0);v instanceof HTMLLinkElement&&(v.href=x,document.head.appendChild(v),e.injectedLinks.push(v))}(f=>{for(let g of f){let x=g.cloneNode(!0);x instanceof HTMLStyleElement&&(i&&(x.textContent=cc(x.textContent||"",i,s,l,{scopeRootSelectors:!0})),document.head.appendChild(x),e.injectedStyles.push(x))}})(t.styleSources);let c=f=>{let g=f.getAttribute("type")?.trim()??"",x=f.getAttribute("src")?.trim()??"";if(x){let y=Uh(x,e.compositionUrl);return e.compositionUrl&&pc(y,e.compositionUrl)?null:{kind:"external",src:y,type:g}}let v=f.textContent?.trim()??"";return v?{kind:"inline",content:v,type:g,scopeCompositionId:o}:null},m=t.scriptSources.map(c).filter(f=>f!==null);if(n){let f=n.getAttribute("data-width"),g=n.getAttribute("data-height"),x=e.parseDimensionPx(f),v=e.parseDimensionPx(g);f&&e.host.setAttribute("data-width",f),g&&e.host.setAttribute("data-height",g),x&&e.host instanceof HTMLElement&&(e.host.style.width=x),v&&e.host instanceof HTMLElement&&(e.host.style.height=v),n.hasAttribute("data-timeline-locked")&&e.host.setAttribute("data-timeline-locked","");let y=Bh(n);!e.authoredCompositionId&&i&&y.setAttribute("data-composition-id",i),mc(y),e.host.appendChild(y)}else if(e.hasTemplate){let f=document.importNode(r,!0);mc(f),e.host.appendChild(f)}else e.host.innerHTML=e.fallbackBodyInnerHtml;a&&qh(e,r,a);for(let f of m){let g=document.createElement("script");if(f.type&&(g.type=f.type),g.async=!1,f.kind==="external"?g.src=f.src:f.type.toLowerCase()==="module"?g.textContent=f.content:f.scopeCompositionId?g.textContent=dc(f.content,f.scopeCompositionId,"[HyperFrames] composition script error:",s,a||f.scopeCompositionId,l):g.textContent=`(function(){${f.content}})();`,document.body.appendChild(g),e.injectedScripts.push(g),f.kind==="external"){let x=await Gh(g);x.status!=="load"&&e.onDiagnostic?.({code:"external_composition_script_load_issue",details:{hostCompositionId:e.authoredCompositionId,runtimeCompositionId:e.runtimeCompositionId,hostCompositionSrc:e.hostCompositionSrc,resolvedScriptSrc:f.src,loadStatus:x.status,elapsedMs:x.elapsedMs}})}}}async function vc(e){let t=$o();if(yc(),t.length===0)return;let n=Sc(t),r=t.filter(i=>{if(i.hasAttribute("data-composition-src")||i.children.length>0)return!1;let o=n.get(i)?.authoredCompositionId;return o?!!document.querySelector(`template#${CSS.escape(o)}-template`):!1});if(r.length!==0)for(let i of r){let o=n.get(i),a=o?.authoredCompositionId;if(!a)continue;let l=document.querySelector(`template#${CSS.escape(a)}-template`);zo(i),await qo({host:i,authoredCompositionId:a,runtimeCompositionId:o?.runtimeCompositionId||a,hostCompositionSrc:`template#${a}-template`,sourceNode:l.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:null,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic})}}async function Ec(e){let t=$o();if(yc(),t.length===0)return;let n=Sc(t),r=t.filter(i=>i.hasAttribute("data-composition-src"));r.length!==0&&await Promise.all(r.map(async i=>{let o=i.getAttribute("data-composition-src");if(!o)return;let a=n.get(i),l=a?.authoredCompositionId||null,s=a?.runtimeCompositionId||l||null,u=null;try{u=new URL(o,document.baseURI)}catch{u=null}zo(i);try{let c=l!=null?document.querySelector(`template#${CSS.escape(l)}-template`):null;if(c){await qo({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:c.content,hasTemplate:!0,fallbackBodyInnerHtml:"",compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,onDiagnostic:e.onDiagnostic});return}let m=await fetch(o);if(!m.ok)throw new Error(`HTTP ${m.status}`);let f=await m.text(),x=new DOMParser().parseFromString(f,"text/html");bc(x,u);let v=(l?x.querySelector(`template#${CSS.escape(l)}-template`):null)??x.querySelector("template"),y=v?v.content:x.body;await qo({host:i,authoredCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,sourceNode:y,hasTemplate:!!v,fallbackBodyInnerHtml:x.body.innerHTML,compositionUrl:u,injectedStyles:e.injectedStyles,injectedScripts:e.injectedScripts,injectedLinks:e.injectedLinks,parseDimensionPx:e.parseDimensionPx,head:x.head,declaredVariableDefaults:sn(x.documentElement),variableDeclarer:x.documentElement,onDiagnostic:e.onDiagnostic})}catch(c){e.onDiagnostic?.({code:"external_composition_load_failed",details:{hostCompositionId:l,runtimeCompositionId:s,hostCompositionSrc:o,errorMessage:c instanceof Error?c.message:"unknown_error"}}),zo(i)}}))}function qh(e,t,n){let i={...e.declaredVariableDefaults??(t instanceof Element?sn(t):{}),...is(e.host)};wi(e.variableDeclarer??(t instanceof Element?t:null),i,n),ns(e.host),Object.keys(i).length>0?(window.__hfVariablesByComp||(window.__hfVariablesByComp={}),window.__hfVariablesByComp[n]=i,_i(e.host,{...ts(e.host,i,window),...lr()})):window.__hfVariablesByComp&&delete window.__hfVariablesByComp[n]}function jo(e){let n=e.vars.data?.captionState;return n==="dim"||n==="active"?n:void 0}function $h(e){return e instanceof HTMLElement?e.dataset.captionWrapper!=="true"?e:e.querySelector(":scope > span")??null:null}function jh(){let e=[],t=document.querySelectorAll(".caption-group");for(let n of t)for(let r of n.children){if(!(r instanceof HTMLElement))continue;let i=r.dataset.captionWrapper==="true"?r.querySelector(":scope > span"):r.tagName==="SPAN"?r:null;i&&e.push(i)}return e}function Kh(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}function Ko(){let e=window.gsap;e&&document.querySelectorAll(".caption-group").length!==0&&fetch("caption-overrides.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!Array.isArray(t)||t.length===0)return;let n=jh();for(let r of t){let i=null;if(r.wordId&&(i=$h(document.getElementById(r.wordId))),!i&&r.wordIndex!==void 0&&(i=n[r.wordIndex]??null),!i)continue;let o={},a={};if(r.x!==void 0&&(o.x=r.x),r.y!==void 0&&(o.y=r.y),r.scale!==void 0&&(o.scale=r.scale),r.rotation!==void 0&&(o.rotation=r.rotation),r.opacity!==void 0&&(a.opacity=r.opacity),r.fontSize!==void 0&&(a.fontSize=`${r.fontSize}px`),r.fontWeight!==void 0&&(a.fontWeight=r.fontWeight),r.fontFamily!==void 0&&(a.fontFamily=r.fontFamily),r.activeColor||r.dimColor){let s=e.getTweensOf(i).filter(m=>m.vars.color!==void 0).sort((m,f)=>m.startTime()-f.startTime()),u=s.find(m=>jo(m)==="dim")??s.find(m=>jo(m)===void 0),c=u?String(u.vars.color):"";for(let m of s)(jo(m)??(String(m.vars.color)===c?"dim":"active"))==="dim"?r.dimColor&&(m.vars.color=r.dimColor):r.activeColor&&(m.vars.color=r.activeColor);r.dimColor&&e.set(i,{color:r.dimColor})}if(Object.keys(a).length>0&&e.set(i,a),Object.keys(o).length>0){let l=Kh(i);e.set(l,o)}}}).catch(()=>{})}var Xo="data-hf-edit-base-x",Jo="data-hf-edit-base-y",jt="data-hf-edit-original-translate",Vr=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},Yh=e=>{let t=[],n=0,r="";for(let i of e.trim())i==="("&&(n+=1),i===")"&&(n=Math.max(0,n-1)),/\s/.test(i)&&n===0?(r&&t.push(r),r=""):r+=i;return r&&t.push(r),t},Ac=/^-?(?:\d+(?:\.\d+)?|\.\d+)px$/,Yo=(e,t)=>Ac.test(e)&&Ac.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,Xh=(e,t,n)=>{if(!e||e==="none")return`${t} ${n}`;let[r,i,o]=Yh(e);if(r===void 0)return`${t} ${n}`;if(i===void 0)return`${Yo(r,t)} ${n}`;let a=o===void 0?"":` ${o}`;return`${Yo(r,t)} ${Yo(i,n)}${a}`},Jh=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},Qh=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""}},Qo=new WeakMap;function Zh(e,t){let n=Qo.get(e);if(!t?.force&&n!==void 0&&e.style.getPropertyValue("translate")!==n){Ne("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=Vr(e.getAttribute("data-x"))-Vr(e.getAttribute(Xo)),i=Vr(e.getAttribute("data-y"))-Vr(e.getAttribute(Jo));e.hasAttribute(jt)||e.setAttribute(jt,Qh(e)),n===void 0&&Jh(e);let o=e.getAttribute(jt)??"",a=Xh(o,`${r}px`,`${i}px`);e.style.setProperty("translate",a),Qo.set(e,e.style.getPropertyValue("translate"))}function zr(e,t){let n=e.defaultView?.HTMLElement,r=e.defaultView?.SVGElement,i=s=>n||r?n!==void 0&&s instanceof n||r!==void 0&&s instanceof r:typeof s.style?.setProperty=="function",o=e.querySelectorAll(`[${jt}]:not([${Xo}]):not([${Jo}])`);for(let s=0;s<o.length;s++){let u=o[s];if(u===void 0||!i(u))continue;let c=u.getAttribute(jt)??"";c===""?u.style.removeProperty("translate"):u.style.setProperty("translate",c),u.removeAttribute(jt),Qo.delete(u)}let a=e.querySelectorAll(`[${Xo}], [${Jo}]`),l=0;for(let s=0;s<a.length;s++){let u=a[s];u===void 0||!i(u)||(Zh(u,t),l+=1)}return l}var Cc="__hfPositionEditsSeekReapplyWrapped",wc=new WeakSet,_c=new WeakMap,Tc=new WeakMap;function Rc(e){let t=e,n=()=>{try{zr(t.document)}catch{}},r=m=>typeof m=="function"&&(wc.has(m)||!!m[Cc]),i=m=>{wc.add(m);try{Object.defineProperty(m,Cc,{value:!0})}catch{}},o=m=>{if(typeof m!="function"||r(m))return m;let f=function(...g){let x=m.apply(this,g);return n(),x};return i(f),f},a=(m,f)=>{let g=_c.get(m);if(g?.has(f))return!0;let x=Object.getOwnPropertyDescriptor(m,f);if(x?.configurable===!1){let _=m[f];return typeof _=="function"&&(m[f]=o(_),n()),!1}let v=m[f],y=x?.set;return Object.defineProperty(m,f,{configurable:!0,enumerable:x?.enumerable??!0,get:()=>v,set:_=>{v=o(_),y?.call(m,_)}}),v=o(v),g??(g=new Set),g.add(f),_c.set(m,g),n(),!0},l=(m,f)=>{let g=Tc.get(t),x=Object.getOwnPropertyDescriptor(t,m);if(!g?.has(m)){if(x?.configurable===!1){let _=t[m];return _?a(_,f):!1}let y=t[m];Object.defineProperty(t,m,{configurable:!0,enumerable:x?.enumerable??!0,get:()=>y,set:_=>{y=_,y&&a(y,f)}}),g??(g=new Set),g.add(m),Tc.set(t,g)}let v=t[m];return v?a(v,f):!1},s=()=>{let m=l("__hf","seek"),f=l("__player","renderSeek");return m&&f};if(s())return;let u=120,c=t.setInterval(()=>{if(s()){t.clearInterval(c);return}u-=1,u<=0&&t.clearInterval(c)},50)}function qr(e){let t=window,r=e.closest("[data-composition-id]")?.getAttribute("data-composition-id")?.trim()??"",i=r?t.__hfVariablesByComp?.[r]:void 0;if(i)return i;let o=t.__hyperframes?.getVariables?.();return o&&typeof o=="object"?o:t.__hfVariables??{}}function $r(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var kc=new Set(["img","video","audio","source"]);function eg(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 tg(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}function ng(e){return e.replace(/[;{}<>\r\n]/g,"")}function rg(e){if($r(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 Zo(e,t){let n=e.closest("[data-composition-id]"),r=t.get(n);if(r)return r;let i=qr(e);return t.set(n,i),i}function ig(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 og(e){return e.querySelector("[data-hf-root]")??e.getElementById("stage")??e.body?.firstElementChild??e.body}function ag(e,t){let n=new Set,r=og(e);r&&n.add(r);for(let i of Array.from(e.querySelectorAll("[data-composition-id]")))n.add(i);for(let i of n){let o=Zo(i,t);for(let[a,l]of Object.entries(o)){let s=rg(l);s!==null&&i instanceof HTMLElement&&i.style.setProperty(`--${a}`,ng(s))}}}function ea(e){let t=new Map;ag(e,t);for(let n of Array.from(e.querySelectorAll("[data-var-src]"))){let r=n.getAttribute("data-var-src")?.trim();if(!r)continue;if(!kc.has(n.tagName.toLowerCase())){console.warn(`[hyperframes] Ignoring data-var-src on <${n.tagName.toLowerCase()}>: variable-bound src is only allowed on ${Array.from(kc).join("/")}.`);continue}let i=eg(Zo(n,t)[r]);if(i!==null){if(!tg(i)){console.warn(`[hyperframes] Ignoring data-var-src="${r}": unsafe URL protocol.`);continue}n.setAttribute("src",i)}}for(let n of Array.from(e.querySelectorAll("[data-var-text]"))){let r=n.getAttribute("data-var-text")?.trim();if(!r)continue;let i=Zo(n,t)[r];$r(i)&&ig(n,String(i))}}var tt=new Map,sg="data-hf-color-grading-canvas",lg="__hf_color_grading_canvas__";function Bc(){if(typeof MutationObserver>"u"||typeof document>"u")return;let e=document.documentElement;if(!e)return;let t=r=>{r instanceof HTMLElement&&(r.hasAttribute(Ar)||r.setAttribute(Ar,r.style.opacity))},n=r=>{if(r instanceof Element){r.matches("video, img")&&t(r);for(let i of r.querySelectorAll("video, img"))t(i)}};n(e),new MutationObserver(r=>{for(let i of r)for(let o of i.addedNodes)n(o)}).observe(e,{childList:!0,subtree:!0})}var ug=16,cg=4,Yt={enabled:!1,position:.5,softness:0,lineWidth:2},ta=["#000000","#ffffff"],dg=["#1a1a1a","#f5f5dc"],Kn=3,fg=Kn-1,mg=5,na=`${Ke}.0`,Fc=`${Ke-1}.0`,pg=`${Kn}.0`,hg=`${(fg+.5)/Kn}`;function jr(e){let t=e.getAttribute(yn);return t==null?null:bl(t,qr(e))}var gg=["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(`
|
|
349
|
+
`),bg=["#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);"," float blur = clamp(u_blur, 0.0, 1.0);"," if (blur > 0.0 && u_blurReady > 0.5) base = mix(base, sampleBlur(uv), blur);"," 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);"," }"," 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;"," 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;"," }"," 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;"," float texelX = 1.0 / max(u_resolution.x * max(u_uvScale.x, 0.00001), 1.0);"," vec2 tapeUv = sampleUv + vec2(tapeShift * texelX, 0.0);"," vec4 base = samplePrepared(tapeUv);"," 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);"," }"," 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);"," }"," return base;","}","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);","}","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);","}","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);","}","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);","}","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);","}","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);","}","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));","}","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);","}","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);","}","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);","}","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) * ${Fc};`," float lower = floor(position);",` float upper = min(lower + 1.0, ${Fc});`,` float y = (row + 0.5) / ${pg};`,` vec4 before = texture2D(u_advanced, vec2((lower + 0.5) / ${na}, y));`,` vec4 after = texture2D(u_advanced, vec2((upper + 0.5) / ${na}, y));`," return mix(before, after, position - lower);","}","vec4 advancedConfig(float index){",` return texture2D(u_advanced, vec2((index + 0.5) / ${na}, ${hg}));`,"}","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;","}","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"," );","}","float decodeSigned(float value){ return (value * 255.0 - 128.0) / 127.0; }","vec3 applyHueCurves(vec3 color){"," if (u_hueCurvesEnabled < 0.5) return color;"," vec3 hsv = rgbToHsv(clamp(color, 0.0, 1.0));"," vec3 curves = sampleAdvancedCurve(hsv.x, 1.0).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;","}","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);"," 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);"," 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;","}","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));","}","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);","}","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);","}","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;","}","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);","}","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);","}","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);"," 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;"," 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);"," 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);"," }"," 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);"," }"," 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));"," if (u_bloomReady > 0.5 && u_bloom > 0.0) color += sampleBloom(uv) * u_bloom;"," color = applyScanlines(clamp(color, 0.0, 1.0), clamp(u_scanlines, 0.0, 1.0));"," 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;"," float warpActive = step(0.0001, u_crtCurvature);"," color *= mix(1.0, displayMask, warpActive);"," vec3 graded = clamp(color, 0.0, 1.0);"," 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;"," }"," gl_FragColor = vec4(graded, sampleColor.a);","}"].join(`
|
|
350
|
+
`),xg=["#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(`
|
|
351
|
+
`),yg=["#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(`
|
|
352
|
+
`),Sg=["#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(`
|
|
353
|
+
`);function Ct(e){return e instanceof HTMLVideoElement||e instanceof HTMLImageElement}function Mc(e){let t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}function Nc(e,t,n){let r=e.createShader(n);return r?(e.shaderSource(r,t),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(M("runtime.colorGrading.compileShader",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function Qr(e,t=bg){let n=Nc(e,gg,e.VERTEX_SHADER),r=Nc(e,t,e.FRAGMENT_SHADER);if(!n||!r)return n&&e.deleteShader(n),r&&e.deleteShader(r),null;let i=e.createProgram();return i?(e.attachShader(i,n),e.attachShader(i,r),e.linkProgram(i),e.deleteShader(n),e.deleteShader(r),e.getProgramParameter(i,e.LINK_STATUS)?i:(M("runtime.colorGrading.linkProgram",e.getProgramInfoLog(i)),e.deleteProgram(i),null)):null}function Kr(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 vg(e,t){let n=Qr(e,xg);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 Eg(e,t){let n=Qr(e,yg);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 Ag(e,t){let n=Qr(e,Sg);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 qn(e,t=e.UNSIGNED_BYTE,n=e.LINEAR){let r=Kr(e,n,t),i=e.createFramebuffer();if(!r||!i)return r&&e.deleteTexture(r),i&&e.deleteFramebuffer(i),null;e.bindFramebuffer(e.FRAMEBUFFER,i),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);let o=e.checkFramebufferStatus(e.FRAMEBUFFER);return e.bindFramebuffer(e.FRAMEBUFFER,null),o!==e.FRAMEBUFFER_COMPLETE?(e.deleteTexture(r),e.deleteFramebuffer(i),null):{texture:r,framebuffer:i,type:t,width:1,height:1}}function Xr(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 ra(e,t,n){let r=[];for(let i of n){let o=e.getUniformLocation(t,`u_${i}`);o!==null&&r.push([i,o])}return r}function Lc(e,t,n){t&&e.deleteProgram(t);for(let r of n)r&&e.deleteTexture(r)}function sa(e){let t=e.getContext("webgl",{alpha:!0,premultipliedAlpha:!1});if(!t)return null;let n=Qr(t),r=Kr(t),i=Kr(t,t.NEAREST),o=Kr(t,t.NEAREST);if(!n||!r||!i||!o)return Lc(t,n,[r,i,o]),null;let a=t.createBuffer();return a?(t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),t.STATIC_DRAW),{gl:t,program:{program:n,texture:r,lutTexture:i,advancedTexture:o,advancedSignature:null,quad:a,position:t.getAttribLocation(n,"a_pos"),source:t.getUniformLocation(n,"u_source"),blurSource:t.getUniformLocation(n,"u_blurSource"),bloomSource:t.getUniformLocation(n,"u_bloomSource"),kuwaharaSource:t.getUniformLocation(n,"u_kuwaharaSource"),lut:t.getUniformLocation(n,"u_lut"),advanced:t.getUniformLocation(n,"u_advanced"),resolution:t.getUniformLocation(n,"u_resolution"),uvScale:t.getUniformLocation(n,"u_uvScale"),uvOffset:t.getUniformLocation(n,"u_uvOffset"),blurReady:t.getUniformLocation(n,"u_blurReady"),bloomReady:t.getUniformLocation(n,"u_bloomReady"),kuwaharaReady:t.getUniformLocation(n,"u_kuwaharaReady"),lutEnabled:t.getUniformLocation(n,"u_lutEnabled"),lutSize:t.getUniformLocation(n,"u_lutSize"),lutTextureSize:t.getUniformLocation(n,"u_lutTextureSize"),lutDomainMin:t.getUniformLocation(n,"u_lutDomainMin"),lutDomainMax:t.getUniformLocation(n,"u_lutDomainMax"),lutIntensity:t.getUniformLocation(n,"u_lutIntensity"),shadowWheel:t.getUniformLocation(n,"u_shadowWheel"),midtoneWheel:t.getUniformLocation(n,"u_midtoneWheel"),highlightWheel:t.getUniformLocation(n,"u_highlightWheel"),rgbCurvesEnabled:t.getUniformLocation(n,"u_rgbCurvesEnabled"),hueCurvesEnabled:t.getUniformLocation(n,"u_hueCurvesEnabled"),secondaryCount:t.getUniformLocation(n,"u_secondaryCount"),adjustUniforms:ra(t,n,Cr),detailUniforms:ra(t,n,Qi),effectUniforms:ra(t,n,Zi),grainSeed:t.getUniformLocation(n,"u_grainSeed"),effectTime:t.getUniformLocation(n,"u_effectTime"),paletteSize:t.getUniformLocation(n,"u_paletteSize"),palette0:t.getUniformLocation(n,"u_palette0"),palette1:t.getUniformLocation(n,"u_palette1"),palette2:t.getUniformLocation(n,"u_palette2"),palette3:t.getUniformLocation(n,"u_palette3"),palette4:t.getUniformLocation(n,"u_palette4"),palette5:t.getUniformLocation(n,"u_palette5"),intensity:t.getUniformLocation(n,"u_intensity"),compareEnabled:t.getUniformLocation(n,"u_compareEnabled"),comparePosition:t.getUniformLocation(n,"u_comparePosition"),compareSoftness:t.getUniformLocation(n,"u_compareSoftness"),compareLineWidth:t.getUniformLocation(n,"u_compareLineWidth")}}):(Lc(t,n,[r,i,o]),null)}function Cg(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wg(e){if(!Cg(e))return{...Yt};let t=(n,r,i,o)=>{let a=typeof n=="number"?n:Number(n);return Math.min(o,Math.max(i,Number.isFinite(a)?a:r))};return{enabled:e.enabled===!0,position:t(e.position,Yt.position,0,1),softness:t(e.softness,Yt.softness,0,.25),lineWidth:t(e.lineWidth,Yt.lineWidth,0,12)}}function Uc(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 Zr(e){return e instanceof Error?e.message:"LUT failed to load"}function _g(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 Wc(e){let t=e.id||e.currentSrc||e.getAttribute("src")||`${e.tagName}:${Array.prototype.indexOf.call(e.parentNode?.children??[],e)}`;return _g(t)}function la(e){let t=Uc(e);if("error"in t)return{state:"error",message:t.error};let n=tt.get(t.href);if(n)return n;let r=fetch(t.href,{credentials:"same-origin"}).then(o=>{if(!o.ok)throw new Error(`Failed to load LUT (${o.status})`);return o.text()}).then(o=>Ks(o,{maxSize:Sr})),i={state:"pending",promise:r};for(;tt.size>=ug;){let o=tt.keys().next().value;if(!o)break;tt.delete(o)}return tt.set(t.href,i),r.then(o=>{tt.get(t.href)===i&&tt.set(t.href,{state:"ready",lut:o})},o=>{tt.get(t.href)===i&&tt.set(t.href,{state:"error",message:Zr(o)})}),i}function Dc(e,t,n){if(e.lut?.src===t)return e.lut;let r=Vi(n),{gl:i,program:o}=e;try{return Vc(i,o.lutTexture,r),e.lut={src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height},e.lutError=null,e.lutLoadingSrc=null,e.lut}catch(a){return e.lut=null,e.lutError=Zr(a),e.lutLoadingSrc=null,M("runtime.colorGrading.uploadLut",a),null}}async function Tg(e){let t=la(e);if(t.state==="ready")return t.lut;if(t.state==="pending")return t.promise;throw new Error(t.message)}function Vc(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 Rg(e,t,n){let r=Vi(n),{gl:i,program:o}=e;return Vc(i,o.lutTexture,r),{src:t,size:n.size,domainMin:n.domainMin,domainMax:n.domainMax,textureWidth:r.width,textureHeight:r.height}}function Je(e,t){e.deleteTexture(t.texture),e.deleteFramebuffer(t.framebuffer)}function ua(e){let t=e.effectTargets;t&&(e.gl.deleteProgram(t.blurProgram.program),Je(e.gl,t.scratch),Je(e.gl,t.blur),t.bloom&&Je(e.gl,t.bloom),e.effectTargets=null)}function ca(e){let t=e.kuwaharaTargets;t&&(e.gl.deleteProgram(t.horizontalProgram.program),e.gl.deleteProgram(t.resolveProgram.program),Je(e.gl,t.moments),Je(e.gl,t.output),e.kuwaharaTargets=null)}function Yr(e,t=!1){ua(e),ca(e),kg(e.gl,e.program),t&&e.gl.getExtension("WEBGL_lose_context")?.loseContext()}function kg(e,t){e.deleteTexture(t.texture),e.deleteTexture(t.lutTexture),e.deleteTexture(t.advancedTexture),e.deleteBuffer(t.quad),e.deleteProgram(t.program)}function Fg(e){let t=sa(e.canvas);return t?(Yr(e),e.gl=t.gl,e.program=t.program,e.lut=null,e.lutLoadingSrc=null,e.lutError=null,e.effectError=null,!0):!1}function aa(e){if(!e.sourceHidden)return;e.element.removeAttribute(Sn);let t=e.element.style.getPropertyValue("opacity"),n=e.element.style.getPropertyPriority("opacity");t==="0"&&n==="important"&&(e.sourceInlineOpacity===null?e.element.style.removeProperty("opacity"):e.element.style.setProperty("opacity",e.sourceInlineOpacity,e.sourceInlineOpacityPriority)),e.sourceHidden=!1}function Mg(e){if(e.effectTargets)return e.effectTargets;let{gl:t}=e,n=vg(t,e.program.quad),r=qn(t),i=qn(t);return!n||!r||!i?(n&&t.deleteProgram(n.program),r&&Je(t,r),i&&Je(t,i),e.effectError="Framebuffer effects unavailable",null):(e.effectError=null,e.effectTargets={blurProgram:n,scratch:r,blur:i,bloom:null},e.effectTargets)}function Ng(e,t){return t.bloom||(t.bloom=qn(e.gl),e.effectError=t.bloom?null:"Framebuffer effects unavailable"),t.bloom}function Ic(e){let t=e.effectTargets;t?.bloom&&(Je(e.gl,t.bloom),t.bloom=null)}function Lg(e){if(e.kuwaharaTargets)return e.kuwaharaTargets;let{gl:t}=e,n=t.getExtension("OES_texture_half_float"),r=t.getExtension("EXT_color_buffer_half_float");if(!n||!r)return e.effectError="Kuwahara requires half-float framebuffer support",null;let i=Eg(t,e.program.quad),o=Ag(t,e.program.quad),a=qn(t,n.HALF_FLOAT_OES,t.NEAREST),l=qn(t);return!i||!o||!a||!l?(Dg(t,i,o,a,l),e.effectError="Kuwahara framebuffer effects unavailable",null):(e.kuwaharaTargets={horizontalProgram:i,resolveProgram:o,moments:a,output:l},e.kuwaharaTargets)}function Dg(e,t,n,r,i){t&&e.deleteProgram(t.program),n&&e.deleteProgram(n.program),r&&Je(e,r),i&&Je(e,i)}function zc(e,t,n,r,i){let o=Math.max(1,Math.ceil(r)),a=Math.max(1,Math.ceil(i));return Xr(e,t,o,a),Xr(e,n,o,a),{width:o,height:a}}function Jr(e,t,n,r,i,o,a,l=!1,s=-1){e.bindFramebuffer(e.FRAMEBUFFER,r.framebuffer),e.viewport(0,0,i.width,i.height),e.useProgram(t.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(t.source,0),e.uniform2f(t.resolution,i.width,i.height),e.uniform2f(t.direction,o.x,o.y),e.uniform1f(t.radius,a),e.uniform1f(t.bloomPass,l?1:0),e.uniform1f(t.threshold,s),$n(e,t)}function Ig(e,t,n,r,i,o,a){let l=zc(e,t.scratch,r,i/2,o/2),s=a/2;Jr(e,t.blurProgram,n,t.scratch,l,{x:1,y:0},s,!0,.5),Jr(e,t.blurProgram,t.scratch.texture,r,l,{x:0,y:1},s,!0)}function Pg(e,t,n,r,i,o,a){let l=n;for(let s=0;s<Math.max(1,Math.floor(a));s++)Jr(e,t.blurProgram,l,t.scratch,i,{x:1,y:0},o),Jr(e,t.blurProgram,t.scratch.texture,r,i,{x:0,y:1},o),l=r.texture}function $n(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 Og(e,t,n,r,i,o,a,l){Xr(e,t.moments,i.width,i.height),Xr(e,t.output,i.width,i.height);let s=t.horizontalProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.moments.framebuffer),e.viewport(0,0,i.width,i.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/i.width,1/i.height),e.uniform2f(s.uvScale,o.scaleX,o.scaleY),e.uniform2f(s.uvOffset,o.offsetX,o.offsetY),e.uniform1f(s.blurReady,a?1:0),e.uniform1f(s.blur,l.blur),e.uniform1f(s.radius,l.kuwaharaRadius),$n(e,s);let u=t.resolveProgram;e.bindFramebuffer(e.FRAMEBUFFER,t.output.framebuffer),e.useProgram(u.program),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.moments.texture),e.uniform1i(u.moments,0),e.uniform2f(u.texel,1/i.width,1/i.height),e.uniform1f(u.radius,l.kuwaharaRadius),e.uniform1f(u.sharpness,l.kuwaharaSharpness),e.uniform1f(u.saturation,l.kuwaharaSaturation),$n(e,u)}function Hg(e,t,n,r){if(n<=0)return!1;let i=zc(e.gl,t.scratch,t.blur,r.width,r.height);return Pg(e.gl,t,e.program.texture,t.blur,i,.75+Math.pow(n,1.35)*32,n>.55?3:2),!0}function Gg(e,t,n,r,i,o){if(n<=0)return Ic(e),null;o||Ic(e);let a=o?Ng(e,t):t.blur;return a?(Ig(e.gl,t,e.program.texture,a,i.width,i.height,r),a.texture):null}function Bg(e,t,n,r){let{program:i}=e,o=t.effects.blur,a=t.effects.bloom;if(o<=0&&a<=0)return e.effectTargets&&r&&ua(e),{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let l=Mg(e);if(!l)return{blurReady:!1,bloomReady:!1,blurTexture:i.texture,bloomTexture:i.texture};let s=Hg(e,l,o,n),u=Gg(e,l,a,t.effects.bloomRadius,n,s);return{blurReady:s,bloomReady:u!==null,blurTexture:l.blur.texture,bloomTexture:u??i.texture}}function Ug(e,t,n,r,i,o,a){let l=t.effects.kuwahara;if(l<=0&&!o)return e.kuwaharaTargets&&a&&ca(e),{kuwaharaReady:!1,kuwaharaTexture:e.program.texture};let s=Lg(e);return!s||l<=0?{kuwaharaReady:!1,kuwaharaTexture:s?.output.texture??e.program.texture}:(Og(e.gl,s,e.program.texture,e.effectTargets?.blur.texture??e.program.texture,n,r,i,t.effects),{kuwaharaReady:!0,kuwaharaTexture:s.output.texture})}function qc(e,t,n,r,i={}){let o=i.releaseIdleTargets??!0;e.effectError=null;let a=Bg(e,t,n,o),l=Ug(e,t,n,r,a.blurReady,i.preserveKuwahara??!1,o);return{...a,...l}}function Wg(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=Uc(t);if("error"in r)return e.lut=null,e.lutLoadingSrc=null,e.lutError=r.error,null;if(e.lut?.src===r.href)return e.lut;e.lut=null;let i=la(t);return i.state==="ready"?Dc(e,r.href,i.lut):i.state==="error"?(e.lutError=i.message,e.lutLoadingSrc=null,null):(e.lutLoadingSrc!==r.href&&(e.lutLoadingSrc=r.href,e.lutError=null,i.promise.then(o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(Dc(e,r.href,o),De(e))},o=>{e.destroyed||e.grading.lut?.src.trim()!==t||(e.lut=null,e.lutError=Zr(o),e.lutLoadingSrc=null,De(e))})),null)}function Vn(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&&Ct(n))return n;try{let r=document.querySelector(t);return r&&Ct(r)?r:null}catch{return null}}if(e.hfId){let t=document.querySelector(`[data-hf-id="${CSS.escape(e.hfId)}"]`);if(t&&Ct(t))return t}if(e.id){let t=document.getElementById(e.id);if(t&&Ct(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&&Ct(r)?r:null}catch{return null}}function $c(e){return e instanceof HTMLVideoElement?e.videoWidth>0&&e.videoHeight>0?{width:e.videoWidth,height:e.videoHeight}:null:e instanceof HTMLImageElement&&e.naturalWidth>0&&e.naturalHeight>0?{width:e.naturalWidth,height:e.naturalHeight}:null}function jc(e){return e instanceof HTMLVideoElement?e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&e.videoWidth>0&&e.videoHeight>0:e instanceof HTMLImageElement?e.complete&&e.naturalWidth>0&&e.naturalHeight>0:!1}function Kc(e){if(!e.id)return null;let t=document.getElementById(`__render_frame_${e.id}__`);return t instanceof HTMLImageElement&&jc(t)?t:null}function Pc(e){if(!(e instanceof HTMLVideoElement))return!1;let t=Kc(e);if(!t)return!1;let n=window.getComputedStyle(t);return n.display!=="none"&&n.visibility!=="hidden"}function Vg(e){return e instanceof HTMLImageElement&&e.classList.contains("__render_frame__")}function zg(e,t){t.parentNode&&t.nextSibling!==e.canvas&&t.parentNode.insertBefore(e.canvas,t.nextSibling)}function Yc(e){if(e instanceof HTMLVideoElement){let t=Kc(e);if(t)return t}return jc(e)?e:null}function Oc(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 qg(e){let t=e.trim().split(/\s+/).filter(Boolean),n=.5,r=.5;for(let i=0;i<t.length;i++){let o=t[i]??"",a=Oc(o,"x"),l=Oc(o,"y");if(a!==null&&(o==="left"||o==="right"||o.endsWith("%")&&i===0)){n=a;continue}if(l!==null&&(o==="top"||o==="bottom"||o.endsWith("%")&&i>0)){r=l;continue}}return{x:n,y:r}}function Xc(e,t,n,r,i,o){if(e<=0||t<=0||n<=0||r<=0)return{scaleX:1,scaleY:1,offsetX:0,offsetY:0};let a=i||"fill",l=e,s=t;if(a==="contain"||a==="cover"||a==="scale-down"){let f=a==="cover"?Math.max(e/n,t/r):Math.min(e/n,t/r);l=n*f,s=r*f,a==="scale-down"&&l>n&&s>r&&(l=n,s=r)}else a==="none"&&(l=n,s=r);let u=qg(o||"center"),c=(e-l)*u.x/e,m=(t-s)*u.y/t;return{scaleX:l/e,scaleY:s/t,offsetX:c,offsetY:m}}function $g(e,t){window.getComputedStyle(t).position==="static"&&(e.touchedParent||(e.touchedParent=t,e.parentInlinePosition=t.style.position||null),t.style.position="relative")}function Hc(e,t){return Math.max(0,Math.round(e>0?e:t))}function jg(e,t){let{element:n,canvas:r}=e,i=n.parentElement;i&&$g(e,i);let o=window.getComputedStyle(t);Sl(r.style,o),r.style.pointerEvents="none",r.style.position="absolute",r.style.inset="auto",r.style.left=`${n.offsetLeft}px`,r.style.top=`${n.offsetTop}px`,r.style.right="auto",r.style.bottom="auto",r.style.width=`${n.offsetWidth}px`,r.style.height=`${n.offsetHeight}px`,r.style.display="block",r.style.opacity=e.sourceOpacityForCanvas,r.style.visibility=e.sourceVisibleForCanvas?"visible":"hidden";let a=n.getBoundingClientRect(),l=Hc(n.offsetWidth,a.width),s=Hc(n.offsetHeight,a.height);if(l<=0||s<=0)return r.style.display="none",null;let u=Math.max(1,window.devicePixelRatio||1),c=Math.round(l*u),m=Math.round(s*u);return r.width!==c&&(r.width=c),r.height!==m&&(r.height=m),{width:c,height:m}}function Kt(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 wt(e,t,n,r){e.set(r,(t*Ke+n)*4)}function mt(e,t){return Math.min(1,Math.max(1/255,(e*(127/t)+128)/255))}function ia(e,t,n){return e.length>=3?qi(e,t,n):new Float32Array(Ke)}function At(e,t){return e[t]??0}function Kg(e,t,n){let r=Pt(t.red),i=Pt(t.green),o=Pt(t.blue),a=Pt(t.master),l=ia(n.hueVsHue,-180,180),s=ia(n.hueVsSaturation,-1,1),u=ia(n.hueVsLuma,-1,1);for(let c=0;c<Ke;c+=1)wt(e,0,c,[At(r,c),At(i,c),At(o,c),At(a,c)]),wt(e,1,c,[mt(At(l,c),180),mt(At(s,c),1),mt(At(u,c),1),1])}function Yg(e,t,n){let r=n*mg;wt(e,2,r,[t.key.hue.center/360,t.key.hue.range/180,t.key.hue.softness/180,1]),wt(e,2,r+1,[t.key.saturation.min,t.key.saturation.max,t.key.saturation.softness/.5,0]),wt(e,2,r+2,[t.key.luma.min,t.key.luma.max,t.key.luma.softness/.5,0]),wt(e,2,r+3,[mt(t.correction.hueShift,180),mt(t.correction.saturation,1),mt(t.correction.luma,1),mt(t.correction.temperature,1)]),wt(e,2,r+4,[mt(t.correction.tint,1),.5,.5,1])}function Xg(e,t,n){let r=new Float32Array(Ke*Kn*4);Kg(r,e,t);let i=0;for(let o of n)o.enabled&&(Yg(r,o,i),i+=1);return r}var Gc=new WeakMap;function Jg(e,t,n){let r=Gc.get(e);if(r?.hueCurves===t&&r.secondaries===n)return r.signature;let i=JSON.stringify([e,t,n]);return Gc.set(e,{hueCurves:t,secondaries:n,signature:i}),i}function Qg(e,t,n,r){let{curves:i,hueCurves:o}=n,a=Jg(i,o,r);if(t.advancedSignature===a)return;let l=Uint8Array.from(Xg(i,o,r),bn);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,Ke,Kn,0,e.RGBA,e.UNSIGNED_BYTE,l),t.advancedSignature=a}function oa(e,t,n){e.uniform3f(t,n.hue/360,n.amount,n.level)}function Jc(e,t,n,r,i,o,a,l,s,u,c,m){e.uniform1i(t.source,0),e.uniform1i(t.blurSource,1),e.uniform1i(t.lut,2),e.uniform1i(t.kuwaharaSource,3),e.uniform1i(t.bloomSource,4),e.uniform1i(t.advanced,5),e.uniform2f(t.resolution,s.width,s.height),e.uniform2f(t.uvScale,u.scaleX,u.scaleY),e.uniform2f(t.uvOffset,u.offsetX,u.offsetY),e.uniform1f(t.blurReady,i?1:0),e.uniform1f(t.bloomReady,o?1:0),e.uniform1f(t.kuwaharaReady,a?1:0),e.uniform1f(t.lutEnabled,r?1:0),e.uniform1f(t.lutSize,r?.size??2),e.uniform2f(t.lutTextureSize,r?.textureWidth??1,r?.textureHeight??1),e.uniform3f(t.lutDomainMin,r?.domainMin[0]??0,r?.domainMin[1]??0,r?.domainMin[2]??0),e.uniform3f(t.lutDomainMax,r?.domainMax[0]??1,r?.domainMax[1]??1,r?.domainMax[2]??1),e.uniform1f(t.lutIntensity,n.lut?.intensity??0);let{curves:f,hueCurves:g,secondaries:x}=n,v=no(f),y=ro(g),_=io(x)?x.reduce((F,D)=>F+Number(D.enabled),0):0;(v||y||_>0)&&Qg(e,t,n,x),oa(e,t.shadowWheel,n.wheels.shadows),oa(e,t.midtoneWheel,n.wheels.midtones),oa(e,t.highlightWheel,n.wheels.highlights),e.uniform1f(t.rgbCurvesEnabled,v?1:0),e.uniform1f(t.hueCurvesEnabled,y?1:0),e.uniform1f(t.secondaryCount,_);for(let[F,D]of t.adjustUniforms)e.uniform1f(D,n.adjust[F]);for(let[F,D]of t.detailUniforms)e.uniform1f(D,n.details[F]);e.uniform1f(t.grainSeed,c),e.uniform1f(t.effectTime,m);for(let[F,D]of t.effectUniforms)e.uniform1f(D,n.effects[F]);let R=n.palette??(n.effects.engraving>0||n.effects.crosshatch>0?dg:ta),T=R[R.length-1]??ta[1];e.uniform1f(t.paletteSize,R.length),Kt(e,t.palette0,R[0]??ta[0]),Kt(e,t.palette1,R[1]??T),Kt(e,t.palette2,R[2]??T),Kt(e,t.palette3,R[3]??T),Kt(e,t.palette4,R[4]??T),Kt(e,t.palette5,R[5]??T),e.uniform1f(t.intensity,n.intensity),e.uniform1f(t.compareEnabled,l.enabled?1:0),e.uniform1f(t.comparePosition,l.position),e.uniform1f(t.compareSoftness,l.softness),e.uniform1f(t.compareLineWidth,l.lineWidth)}function Zg(e){if(!e.sourceHidden){let t=e.element.getAttribute(Ar);t!==null?(e.sourceInlineOpacity=t===""?null:t,e.sourceInlineOpacityPriority=""):(e.sourceInlineOpacity=e.element.style.getPropertyValue("opacity")||null,e.sourceInlineOpacityPriority=e.element.style.getPropertyPriority("opacity"))}e.element.setAttribute(Sn,"true"),e.element.style.setProperty("opacity","0","important"),e.sourceHidden=!0}function nt(e){let t=pl.find(n=>n.path===e);if(!t)throw new Error(`Missing color-grading animation property: ${e}`);return t}var Qc=nt("intensity"),Zc=nt("lut.intensity"),ed=nt("adjust.exposure"),td=nt("effects.kuwahara"),nd=[["blur",nt("effects.blur")],["bloom",nt("effects.bloom")],["kuwahara",td],["pixelate",nt("effects.pixelate")],["ascii",nt("effects.ascii")],["dither",nt("effects.dither")]],rd=[Qc,Zc,ed,...nd.map(([,e])=>e)];function _t(e,t){let n=e.style.getPropertyValue(t.name);if(!n)return null;let r=Number(n);return Number.isFinite(r)?Math.min(t.max,Math.max(t.min,r)):null}function zn(e,t){return t!==null&&(xl(t)||rd.some(n=>_t(e,n)!==null))}function eb(e,t){let n=null;for(let[r,i]of nd){let o=_t(e,i);o!==null&&(n??(n={...t.effects}),n[r]=o)}return n}function tb(e){let{element:t,grading:n}=e,r=_t(t,Qc),i=_t(t,Zc),o=_t(t,ed),a=eb(t,n);if(![r,i,o].some(u=>u!==null)&&a===null)return n;let s={...n,adjust:o===null?n.adjust:{...n.adjust,exposure:o},effects:a??n.effects};return r!==null&&(s.intensity=r),n.lut&&i!==null&&(s.lut={...n.lut,intensity:i}),s}function id(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 od(e,t,n){let r=[t.texture,n.blurTexture,t.lutTexture,n.kuwaharaTexture,n.bloomTexture,t.advancedTexture];for(let[i,o]of r.entries())e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,o)}function De(e){if(e.destroyed||e.contextLost)return!1;let t=Yc(e.element);if(!t)return e.hasDrawn||(e.canvas.style.display="none"),!1;let n=$c(t);if(!n)return!1;let r=t instanceof HTMLElement?t:e.element,i=e.element.style.getPropertyValue("opacity"),o=e.element.style.getPropertyPriority("opacity"),a=e.sourceHidden&&i==="0"&&o==="important",l=e.element.style.getPropertyValue("visibility"),s=Vg(t);s&&zg(e,t);let u=window.getComputedStyle(s?t:e.element);(s||!a)&&(e.sourceOpacityForCanvas=u.opacity||"1"),e.sourceVisibleForCanvas=(s||l!=="hidden")&&u.visibility!=="hidden";let c=jg(e,r);if(!c)return!1;let m=window.getComputedStyle(r),f=Xc(c.width,c.height,n.width,n.height,m.objectFit,m.objectPosition),{gl:g,program:x}=e;try{let v=tb(e),y=Wg(e);id(g,x.texture,t);let _=_t(e.element,td)!==null,R=qc(e,v,c,f,{preserveKuwahara:_});g.bindFramebuffer(g.FRAMEBUFFER,null),g.viewport(0,0,c.width,c.height),g.useProgram(x.program),od(g,x,R);let T=window.__player?.getTime?.(),F=typeof T=="number"&&Number.isFinite(T)?Math.max(0,T):e.element instanceof HTMLVideoElement?Math.max(0,e.element.currentTime):0,D=e.grainSeed+Math.floor(F*60);return Jc(g,x,v,y,R.blurReady,R.bloomReady,R.kuwaharaReady,e.compare,c,f,D,F),$n(g,x),Zg(e),e.hasDrawn=!0,e.drawError=null,!0}catch(v){return e.drawError=v instanceof Error?v.message:"Shader draw failed",M("runtime.colorGrading.drawEntry",v),!1}}function nb(e,t,n){let r=e.getBoundingClientRect(),i=e.offsetWidth||r.width||t.width,o=e.offsetHeight||r.height||t.height,a=Math.min(320,Math.max(64,Math.round(n??160))),l=i>0&&o>0?i/o: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 rb(){let e=document.createElement("canvas"),t=sa(e);return t?{canvas:e,...t,lut:null,effectTargets:null,kuwaharaTargets:null,effectError:null}:null}function ib(e,t){let n=t?void 0:window.__player?.getTime?.();return typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):e instanceof HTMLVideoElement?Math.max(0,e.currentTime):0}function ob(e,t,n,r){let i=Yc(t);if(!i)return null;let o=$c(i);if(!o)return null;let a=nb(t,o,n);e.canvas.width=a.width,e.canvas.height=a.height;let l=i instanceof HTMLElement?i:t,s=window.getComputedStyle(l),u=Xc(a.width,a.height,o.width,o.height,s.objectFit,s.objectPosition);return id(e.gl,e.program.texture,i),{dimensions:a,uv:u,effectTime:ib(t,r),grainSeed:Wc(t)+(t instanceof HTMLVideoElement?Math.floor(t.currentTime*60):0)}}async function ab(e,t,n,r,i=!1){let o=ob(e,t,r,i);if(!o)return null;let{dimensions:a,uv:l,grainSeed:s,effectTime:u}=o,c=[];for(let m of n.slice(0,32)){let f=wr(m.grading);if(!f){c.push({id:m.id,dataUrl:null,error:"Invalid grading"});continue}let g=null;try{f.lut&&(e.lut?.src!==f.lut.src&&(e.lut=Rg(e,f.lut.src,await Tg(f.lut.src))),g=e.lut),c.push({id:m.id,dataUrl:sb(e,f,g,a,l,s,u)})}catch(x){c.push({id:m.id,dataUrl:null,error:Zr(x)})}}return{...a,images:c}}function sb(e,t,n,r,i,o,a){let{canvas:l,gl:s,program:u}=e,c=qc(e,t,r,i,{releaseIdleTargets:!1});return s.bindFramebuffer(s.FRAMEBUFFER,null),s.viewport(0,0,r.width,r.height),s.useProgram(u.program),od(s,u,c),n||(e.lut=null),Jc(s,u,t,n,c.blurReady,c.bloomReady,c.kuwaharaReady,Yt,r,i,o,a),$n(s,u),l.toDataURL("image/png")}function Xe(e,t,n,r){t.addEventListener(n,r),e.cleanup.push(()=>t.removeEventListener(n,r))}function lb(e){e.animationFrame!==null&&(window.cancelAnimationFrame(e.animationFrame),e.animationFrame=null),e.videoFrameHandle!==null&&e.element instanceof HTMLVideoElement&&(e.element.cancelVideoFrameCallback?.(e.videoFrameHandle),e.videoFrameHandle=null)}function jn(e){if(e.destroyed||!(e.element instanceof HTMLVideoElement)||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,De(e),!e.destroyed&&!t.paused&&!t.ended&&jn(e)});return}e.animationFrame=window.requestAnimationFrame(()=>{e.animationFrame=null,De(e),!e.destroyed&&!t.paused&&!t.ended&&jn(e)})}function ub(e){let t=()=>{De(e)};if(Xe(e,e.element,"load",t),Xe(e,e.element,"loadedmetadata",t),Xe(e,e.element,"loadeddata",t),Xe(e,e.element,"seeked",t),Xe(e,e.element,"timeupdate",t),Xe(e,window,"resize",t),e.element instanceof HTMLVideoElement&&(Xe(e,e.element,"play",()=>jn(e)),Xe(e,e.element,"pause",t)),Xe(e,e.canvas,"webglcontextlost",n=>{n.preventDefault(),e.contextLost=!0,e.drawError="WebGL context lost",e.canvas.style.display="none",aa(e)}),Xe(e,e.canvas,"webglcontextrestored",()=>{if(e.contextLost=!1,!Fg(e)){e.contextLost=!0,e.drawError="WebGL context restore failed",aa(e);return}e.drawError=null,De(e)}),typeof ResizeObserver<"u"&&(e.resizeObserver=new ResizeObserver(t),e.resizeObserver.observe(e.element)),typeof MutationObserver<"u"){let n=()=>{let a=e.element.style;return`${a.transform}|${a.translate}|${a.rotate}|${a.scale}|${a.left}|${a.top}|${a.width}|${a.height}`},r=n(),i=!1,o=new MutationObserver(()=>{i||n()!==r&&(i=!0,requestAnimationFrame(()=>{i=!1,r=n(),De(e)}))});o.observe(e.element,{attributes:!0,attributeFilter:["style"]}),e.cleanup.push(()=>o.disconnect())}}function cb(e){if(e.destroyed)return null;e.destroyed=!0,lb(e),e.resizeObserver?.disconnect();for(let t of e.cleanup)t();return e.cleanup.length=0,e.canvas.remove(),ua(e),ca(e),aa(e),e.touchedParent&&(e.parentInlinePosition===null?e.touchedParent.style.removeProperty("position"):e.touchedParent.style.position=e.parentInlinePosition),{canvas:e.canvas,gl:e.gl,program:e.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}function ad(e,t){return e.removeAttribute("style"),t.id?e.id=`${ul}${t.id}`:e.removeAttribute("id"),e.className=lg,e.setAttribute(sg,"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 db(e){return ad(document.createElement("canvas"),e)}function sd(){let e=new WeakMap,t=new Set,n=[],r=null,i=null,o=Promise.resolve(),a=!1,l=(C,S,E)=>{let w=e.get(C);if(w)return w.grading=S,w.source=E,De(w),C instanceof HTMLVideoElement&&!C.paused&&jn(w),!0;let k=n.pop();if(k)ad(k.canvas,C);else{let H=db(C),V=sa(H);if(!V)return H.remove(),!1;k={canvas:H,gl:V.gl,program:V.program,effectTargets:null,kuwaharaTargets:null,effectError:null}}let L={element:C,...k,grading:S,compare:{...Yt},lut:null,lutLoadingSrc:null,lutError:null,drawError:null,effectTargets:null,kuwaharaTargets:null,effectError:null,source:E,animationFrame:null,videoFrameHandle:null,resizeObserver:null,cleanup:[],touchedParent:null,parentInlinePosition:null,sourceHidden:!1,sourceInlineOpacity:null,sourceInlineOpacityPriority:"",sourceOpacityForCanvas:window.getComputedStyle(C).opacity||"1",sourceVisibleForCanvas:window.getComputedStyle(C).visibility!=="hidden",hasDrawn:!1,contextLost:!1,grainSeed:Wc(C),destroyed:!1};return e.set(C,L),t.add(C),ub(L),De(L),C instanceof HTMLVideoElement&&!C.paused&&jn(L),!0},s=(C,S)=>{if(a)return!1;let E=Vn(C);if(!E)return!1;let w=e.get(E);if(!w){let k=jr(E);if(!zn(E,k)||!l(E,k,"attribute"))return!1;w=e.get(E)}return w?(w.compare=wg(S),De(w),!0):!1},u=C=>{let S=e.get(C);if(!S)return;let E=cb(S);E&&(S.contextLost||n.length>=cg?Yr(E,!0):n.push(E)),e.delete(C),t.delete(C)},c=()=>{if(a)return 0;let C=new Set;document.querySelectorAll(`video[${yn}], img[${yn}]`).forEach(E=>{if(!Ct(E))return;C.add(E);let w=jr(E);zn(E,w)&&(Mc(E)||Pc(E))?l(E,w,"attribute"):u(E)});for(let E of t){let w=e.get(E);w&&(!E.isConnected||w.source==="attribute"&&!C.has(E))&&u(E)}return t.size},m=()=>{if(a)return 0;let C=0;for(let S of t){let E=e.get(S);E&&De(E)&&(C+=1)}return C},f=async()=>{let C=new Set;for(let S of t){let E=e.get(S)?.grading.lut;if(!E?.src.trim()||(E.intensity??1)<=0)continue;let w=la(E.src);w.state==="pending"&&C.add(w.promise)}return C.size>0&&await Promise.allSettled(C),m(),C.size},g=()=>{if(a)return 0;let C=0;for(let S of t){let E=e.get(S);!E||!rd.some(k=>_t(S,k)!==null)||S instanceof HTMLVideoElement&&!S.paused&&!S.ended||De(E)&&(C+=1)}return C},x=(C,S)=>{if(a)return!1;let E=Vn(C);if(!E)return!1;let w=wr(S);return zn(E,w)?l(E,w,"live"):(u(E),!0)},v=(C,S)=>{if(!Ct(C))return!1;let E=e.get(C);if(!E){if(!S)return!1;let w=jr(C);return zn(C,w)&&l(C,w,"attribute")}return E.sourceVisibleForCanvas=S,!S&&E.source==="attribute"&&u(C),!0},y=C=>{let S=Vn(C);if(!S)return{state:"missing",message:"Media not found"};let E=e.get(S);if(E)return E.effectError?{state:"unavailable",message:E.effectError}:E.drawError?{state:"unavailable",message:E.drawError}:E.lutError?{state:"unavailable",message:`LUT error: ${E.lutError}`}:E.grading.lut&&E.lutLoadingSrc?{state:"pending",message:"Loading LUT"}:E.canvas.style.display==="none"?{state:"pending",message:"Waiting for media frame"}:{state:"active",message:E.lut?"Shader + LUT active":"Shader active"};let w=jr(S);return zn(S,w)?!Mc(S)&&!Pc(S)?{state:"pending",message:"Waiting for visible media"}:{state:"unavailable",message:"WebGL unavailable"}:{state:"inactive",message:"No grading applied"}},_=async(C,S,E)=>{let w=async()=>{if(a||S.length===0)return null;let L=Vn(C);return!L||(i??(i=rb()),!i)?null:ab(i,L,S,E?.maxDimension,E?.useMediaTime)},k=o.then(w,w);return o=k.then(()=>{},()=>{}),k},R=C=>{let S=Vn(C);if(!(S instanceof HTMLVideoElement))return null;if(!S.paused)return()=>{};let E=S.currentTime,w=S.loop,k=S.muted;return S.loop=!0,S.muted=!0,(S.ended||Number.isFinite(S.duration)&&E>=S.duration)&&(S.currentTime=0),S.play().catch(()=>{}),()=>{S.pause(),S.loop=w,S.muted=k,S.currentTime=E}},T=()=>{if(!a){a=!0,r?.disconnect(),r=null;for(let C of t)u(C);for(let C of n)Yr(C,!0);n.length=0,i&&(Yr(i,!0),i=null)}};document.body&&(r=new MutationObserver(()=>c()),r.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[yn]}));let F={refresh:c,redraw:m,redrawAnimated:g,waitForActiveLuts:f,setGrading:x,setCompare:s,setSourceVisibility:v,getStatus:y,renderPreviews:_,startPreviewPlayback:R,destroy:T},D=window;return D.__hf=D.__hf||{},D.__hf.colorGrading=F,c(),F}var ei=class{constructor(t){ge(this,"_baseTime",0);ge(this,"_playStartMs",null);ge(this,"_rate",1);ge(this,"_duration",1/0);ge(this,"_nowMs");ge(this,"_audioSource",null);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;else{let{el:i,compositionStart:o,mediaStart:a}=this._audioSource;!i.paused&&Number.isFinite(i.currentTime)&&(r=(i.currentTime-a)/(i.playbackRate>0?i.playbackRate:1)*this._rate+o)}if(r!==null)return Number.isFinite(this._duration)&&r>=this._duration?this._duration:Math.max(0,r)}let t=(this._nowMs()-this._playStartMs)/1e3,n=this._baseTime+t*this._rate;return Number.isFinite(this._duration)&&n>=this._duration?this._duration:Math.max(0,n)}play(){return this._playStartMs!==null||Number.isFinite(this._duration)&&this._baseTime>=this._duration?!1:(this._playStartMs=this._nowMs(),!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._playStartMs!==null&&(this._playStartMs=this._nowMs())}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._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}attachAudioSource(t){this._audioSource=t}detachAudioSource(){this._audioSource&&this._playStartMs!==null&&(this._baseTime=this.now(),this._playStartMs=this._nowMs()),this._audioSource=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"}snapshot(){return{time:this.now(),playing:this.isPlaying(),rate:this._rate,duration:this._duration,source:this.getSource()}}reachedEnd(){return Number.isFinite(this._duration)&&this.now()>=this._duration}};var fb=100,mb=8,pb=4096,da=e=>e;function hb(e,t,n){return!(!!e.curve||e.viaX!==void 0&&e.viaY!==void 0)&&t==="linear"&&!n}function gb(e){let t=Math.ceil(e*fb);return Math.min(pb,Math.max(mb,t))}function bb(e,t,n,r,i){let{scheduledAt:o,elapsed:a,rate:l}=r,s=i??da,u=R=>o+(R-a)/l,c=e.points[t],m=e.points[t+1],f=u(m.t);if(f<=o)return null;let g=Math.max(o,u(c.t)),x=f-g;if(x<=0)return null;if(hb(c,n,i))return{kind:"ramp",time:f,value:s(m.v)};let v=gb(x),y=Ds(e,Math.max(c.t,a),m.t,v,n),_=new Float32Array(v);for(let R=0;R<v;R+=1)_[R]=s(y[R]??0);return{kind:"curve",time:g,duration:x,values:_}}function xb(e,t,n,r){let i=[];for(let a=0;a+1<e.points.length;a+=1){let l=bb(e,a,t,n,r);l&&i.push(l)}let o=i[0];return o?.kind==="curve"&&o.time<=n.scheduledAt||i.unshift({kind:"set",time:n.scheduledAt,value:(r??da)(pn(e,n.elapsed,t))}),i}function yb(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{let r=n.values[n.values.length-1]??0;e.linearRampToValueAtTime(r,n.time+n.duration)}}function fa(e){for(let t of e)t.param.cancelScheduledValues(0)}function Yn(e,t){for(let n of e)typeof n.param.cancelAndHoldAtTime=="function"?n.param.cancelAndHoldAtTime(t):n.param.cancelScheduledValues(t)}function ma(e,t,n,r){if(t.points.length!==0)for(let i of e){if(fa([i]),Ls(t)){let o=(i.map??da)(t.points[0].v);i.param.setValueAtTime(o,r.scheduledAt);continue}yb(i.param,xb(t,n,r,i.map))}}function ld(e,t,n,r,i){let o=new Map(n.filter(l=>l.id).map(l=>[l.id,l.handle])),a=[];for(let l of e.lanes){let s=mn(l.target);if(!s)continue;let u=s.kind==="preset"?i?.[s.presetId]:s.kind==="fx"?o.get(s.nodeId)?.automation?.[s.param]:void 0;if(!u||u.length===0)continue;let c=Di(l.target,t);c&&(ma(u,l,c.scale,r),a.push(...u))}return a}function ud(e){return e.lanes.find(t=>t.target===Nt)??null}var Sb=`
|
|
354
|
+
const dbToLin = (db) => Math.pow(10, db / 20);
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* One-pole envelope followers, one per channel.
|
|
358
|
+
*
|
|
359
|
+
* Per channel matters: the followers advance once per sample, so a single shared
|
|
360
|
+
* follower stepped once per channel per sample. On stereo that ran a 20 ms attack
|
|
361
|
+
* as 10 ms, and gave the right channel a gain computed from an envelope that had
|
|
362
|
+
* already traversed the left \u2014 so the two channels ducked by different amounts
|
|
363
|
+
* from the same input and the image pumped.
|
|
364
|
+
*/
|
|
365
|
+
class EnvBank {
|
|
366
|
+
constructor(attackMs, releaseMs) { this.set(attackMs, releaseMs); this.values = []; }
|
|
367
|
+
set(attackMs, releaseMs) {
|
|
368
|
+
this.a = Math.exp(-1 / (sampleRate * Math.max(1e-5, attackMs / 1000)));
|
|
369
|
+
this.r = Math.exp(-1 / (sampleRate * Math.max(1e-5, releaseMs / 1000)));
|
|
370
|
+
}
|
|
371
|
+
push(ch, x) {
|
|
372
|
+
const prev = this.values[ch] ?? 0;
|
|
373
|
+
const m = Math.abs(x);
|
|
374
|
+
const c = m > prev ? this.a : this.r;
|
|
375
|
+
const next = m + c * (prev - m);
|
|
376
|
+
this.values[ch] = next;
|
|
377
|
+
return next;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** Soft-knee gain computer in dB, matching acompressor's shape. */
|
|
382
|
+
function kneeGain(envDb, thresholdDb, ratio, kneeDb) {
|
|
383
|
+
const over = envDb - thresholdDb;
|
|
384
|
+
if (kneeDb > 0 && over > -kneeDb && over < kneeDb) {
|
|
385
|
+
const t = (over + kneeDb) / (2 * kneeDb);
|
|
386
|
+
return -((1 - 1 / ratio) * kneeDb * t * t);
|
|
387
|
+
}
|
|
388
|
+
return over > 0 ? -(over * (1 - 1 / ratio)) : 0;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// log10/exp per sample is the single most expensive thing a dynamics processor
|
|
392
|
+
// can do on the audio thread, and every sample below the knee needs neither:
|
|
393
|
+
// its gain is exactly unity. Comparing envelopes in the linear domain lets the
|
|
394
|
+
// quiet majority of samples skip the transcendentals entirely.
|
|
395
|
+
const LN10_OVER_20 = Math.LN10 / 20;
|
|
396
|
+
const dbToLinFast = (db) => Math.exp(db * LN10_OVER_20);
|
|
397
|
+
|
|
398
|
+
class HfCompressor extends AudioWorkletProcessor {
|
|
399
|
+
constructor(o) {
|
|
400
|
+
super();
|
|
401
|
+
this.p = o.processorOptions || {};
|
|
402
|
+
this.env = new EnvBank(this.p.attack ?? 20, this.p.release ?? 250);
|
|
403
|
+
this.port.onmessage = (e) => {
|
|
404
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
405
|
+
this.p = { ...this.p, ...e.data };
|
|
406
|
+
this.env.set(this.p.attack ?? 20, this.p.release ?? 250);
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
process(inputs, outputs) {
|
|
410
|
+
if (this.dead) return false;
|
|
411
|
+
const i = inputs[0], o = outputs[0];
|
|
412
|
+
if (!i || !i.length) return true;
|
|
413
|
+
const p = this.p;
|
|
414
|
+
const makeup = dbToLin(p.makeup ?? 0);
|
|
415
|
+
const mix = p.mix ?? 1;
|
|
416
|
+
// Knee is expressed as a ratio in FFmpeg; convert to dB width.
|
|
417
|
+
const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));
|
|
418
|
+
const thresholdDb = p.threshold ?? -24;
|
|
419
|
+
const ratio = p.ratio ?? 4;
|
|
420
|
+
// Below this the gain computer returns unity, so the sample needs no
|
|
421
|
+
// logarithm at all.
|
|
422
|
+
const kneeStartLin = dbToLin(thresholdDb - kneeDb);
|
|
423
|
+
const dry = 1 - mix;
|
|
424
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
425
|
+
const inp = i[ch], out = o[ch];
|
|
426
|
+
for (let n = 0; n < inp.length; n++) {
|
|
427
|
+
const x = inp[n];
|
|
428
|
+
// Per-channel follower, and the sub-knee shortcut: below the knee the
|
|
429
|
+
// gain is exactly unity, so the sample needs no logarithm at all.
|
|
430
|
+
const env = this.env.push(ch, x);
|
|
431
|
+
if (env <= kneeStartLin) {
|
|
432
|
+
out[n] = x * makeup * mix + x * dry;
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
const envDb = 20 * Math.log10(env);
|
|
436
|
+
const g = dbToLinFast(kneeGain(envDb, thresholdDb, ratio, kneeDb));
|
|
437
|
+
out[n] = x * g * makeup * mix + x * dry;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return true;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
registerProcessor("hf-compressor", HfCompressor);
|
|
444
|
+
|
|
445
|
+
class HfLimiter extends AudioWorkletProcessor {
|
|
446
|
+
constructor(o) {
|
|
447
|
+
super();
|
|
448
|
+
this.p = o.processorOptions || {};
|
|
449
|
+
this.env = new EnvBank(this.p.attack ?? 5, this.p.release ?? 50);
|
|
450
|
+
this.port.onmessage = (e) => {
|
|
451
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
452
|
+
this.p = { ...this.p, ...e.data };
|
|
453
|
+
this.env.set(this.p.attack ?? 5, this.p.release ?? 50);
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
process(inputs, outputs) {
|
|
457
|
+
if (this.dead) return false;
|
|
458
|
+
const i = inputs[0], o = outputs[0];
|
|
459
|
+
if (!i || !i.length) return true;
|
|
460
|
+
const ceiling = dbToLin(this.p.limit ?? -1);
|
|
461
|
+
const outGain = dbToLin(this.p.level_out ?? 0);
|
|
462
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
463
|
+
const inp = i[ch], out = o[ch];
|
|
464
|
+
for (let n = 0; n < inp.length; n++) {
|
|
465
|
+
const x = inp[n];
|
|
466
|
+
const env = this.env.push(ch, x);
|
|
467
|
+
// Only ever attenuate: a limiter that can raise level is a compressor.
|
|
468
|
+
const g = env > ceiling ? ceiling / env : 1;
|
|
469
|
+
out[n] = x * g * outGain;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
return true;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
registerProcessor("hf-limiter", HfLimiter);
|
|
476
|
+
|
|
477
|
+
class HfGate extends AudioWorkletProcessor {
|
|
478
|
+
constructor(o) {
|
|
479
|
+
super();
|
|
480
|
+
this.p = o.processorOptions || {};
|
|
481
|
+
this.env = new EnvBank(this.p.attack ?? 1, this.p.release ?? 100);
|
|
482
|
+
this.gains = [];
|
|
483
|
+
this.port.onmessage = (e) => {
|
|
484
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
485
|
+
this.p = { ...this.p, ...e.data };
|
|
486
|
+
this.env.set(this.p.attack ?? 1, this.p.release ?? 100);
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
process(inputs, outputs) {
|
|
490
|
+
if (this.dead) return false;
|
|
491
|
+
const i = inputs[0], o = outputs[0];
|
|
492
|
+
if (!i || !i.length) return true;
|
|
493
|
+
const p = this.p;
|
|
494
|
+
const threshold = dbToLin(p.threshold ?? -35);
|
|
495
|
+
const floor = dbToLin(p.range ?? -24);
|
|
496
|
+
const ratio = p.ratio ?? 10;
|
|
497
|
+
// Knee is declared in the registry as a ratio, like the compressor's; a
|
|
498
|
+
// hard threshold ignored it and chattered on material sitting right at the
|
|
499
|
+
// gate point.
|
|
500
|
+
const kneeDb = 20 * Math.log10(Math.max(1.0001, p.knee ?? 2.83));
|
|
501
|
+
const kneeLin = dbToLin((p.threshold ?? -35) + kneeDb);
|
|
502
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
503
|
+
const inp = i[ch], out = o[ch];
|
|
504
|
+
for (let n = 0; n < inp.length; n++) {
|
|
505
|
+
const x = inp[n];
|
|
506
|
+
const env = this.env.push(ch, x);
|
|
507
|
+
let target = 1;
|
|
508
|
+
// Above the threshold the gate is fully open; skip the pow entirely.
|
|
509
|
+
if (env < threshold) {
|
|
510
|
+
const under = env > 1e-9 ? threshold / env : 1e9;
|
|
511
|
+
target = Math.max(floor, 1 / Math.pow(under, ratio - 1));
|
|
512
|
+
if (!isFinite(target)) target = floor;
|
|
513
|
+
}
|
|
514
|
+
// Smooth toward the target so the gate does not click on every sample.
|
|
515
|
+
const held = this.gains[ch] ?? 1;
|
|
516
|
+
const c = target < held ? this.env.r : this.env.a;
|
|
517
|
+
const smoothed = target + c * (held - target);
|
|
518
|
+
this.gains[ch] = smoothed;
|
|
519
|
+
out[n] = x * smoothed;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
return true;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
registerProcessor("hf-gate", HfGate);
|
|
526
|
+
|
|
527
|
+
class HfBitcrush extends AudioWorkletProcessor {
|
|
528
|
+
constructor(o) {
|
|
529
|
+
super();
|
|
530
|
+
this.p = o.processorOptions || {};
|
|
531
|
+
this.holds = [];
|
|
532
|
+
this.held = [];
|
|
533
|
+
this.port.onmessage = (e) => {
|
|
534
|
+
if (e.data && e.data.__hfDispose) { this.dead = true; return; }
|
|
535
|
+
this.p = { ...this.p, ...e.data };
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
process(inputs, outputs) {
|
|
539
|
+
if (this.dead) return false;
|
|
540
|
+
const i = inputs[0], o = outputs[0];
|
|
541
|
+
if (!i || !i.length) return true;
|
|
542
|
+
const p = this.p;
|
|
543
|
+
const levels = Math.pow(2, (p.bits ?? 8) - 1);
|
|
544
|
+
const step = Math.max(1, Math.round(p.samples ?? 1));
|
|
545
|
+
const mix = p.mix ?? 1;
|
|
546
|
+
for (let ch = 0; ch < i.length; ch++) {
|
|
547
|
+
const inp = i[ch], out = o[ch];
|
|
548
|
+
if (this.held[ch] === undefined) this.held[ch] = 0;
|
|
549
|
+
if (this.holds[ch] === undefined) this.holds[ch] = 0;
|
|
550
|
+
for (let n = 0; n < inp.length; n++) {
|
|
551
|
+
// Per channel: advancing one shared counter only on the last channel
|
|
552
|
+
// left every earlier channel either unheld or frozen for a whole
|
|
553
|
+
// 128-sample quantum, clicking once a block.
|
|
554
|
+
if (this.holds[ch] === 0) this.held[ch] = Math.round(inp[n] * levels) / levels;
|
|
555
|
+
out[n] = this.held[ch] * mix + inp[n] * (1 - mix);
|
|
556
|
+
this.holds[ch] = (this.holds[ch] + 1) % step;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return true;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
registerProcessor("hf-bitcrush", HfBitcrush);
|
|
563
|
+
`,pa=new WeakMap;function ha(e){return cd.has(e)}var cd=new WeakSet;function ga(e){let t=pa.get(e);return t||(t=(async()=>{if(!e.audioWorklet)throw new Error("AudioWorklet is unavailable \u2014 the page needs a secure context (https, localhost or file://)");let n=`data:text/javascript;base64,${btoa(String.fromCharCode(...new TextEncoder().encode(Sb)))}`;await e.audioWorklet.addModule(n),cd.add(e)})().catch(n=>{throw pa.delete(e),n}),pa.set(e,t)),t}function vb(e,t,n){let r=.6+Math.max(0,Math.min(1,t))*2.6,i=Math.max(1,Math.floor(e*r)),o=new Float32Array(i),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))),u=0,c=0;for(let f=0;f<i;f++){u+=s*(l()-u);let g=u*Math.pow(1-f/i,2.5);o[f]=g,c+=g*g}let m=Math.sqrt(c);if(m>0)for(let f=0;f<i;f++)o[f]=(o[f]??0)/m;return o}var ue=e=>typeof e=="number"?e:Number(e??0),ba=e=>e/1e3;function pd(e,t,n,r){let i=Math.max(1,Math.round(e.sampleRate)),o=e.createBuffer(1,i,e.sampleRate),a=o.getChannelData(0);for(let u=0;u<i;u++){let c=u/i;a[u]=t==="sine"?Math.sin(2*Math.PI*c):4*Math.abs((c+.75)%1-.5)-1}let l=e.createBufferSource();l.buffer=o,l.loop=!0,l.playbackRate.value=n;let s=(r*n%1+1)%1*(i/e.sampleRate);return l.start(typeof e.currentTime=="number"?e.currentTime:0,s),l}function hd(e){try{e.stop()}catch{}e.disconnect()}function xa(e,t){return[{param:e},{param:t,map:n=>1-n}]}function gd(e,t,n){e.gain.value=n,t.gain.value=1-n}function ya(e,t,n){return{input:e,output:e,update:t,automation:n,dispose:()=>e.disconnect()}}var Eb=new Set(["peaking","highpass","lowpass"]),dd=e=>Math.pow(10,e/20),Ab=(e,t)=>{let n=e.createGain(),r=i=>{n.gain.value=dd(ue(i.gain))};return r(t),ya(n,r,{gain:[{param:n.gain,map:dd}]})};function Xn(e,t){return(n,r)=>{let i=n.createBiquadFilter();i.type=e;let o=a=>{i.frequency.value=ue(a.frequency),a.q!==void 0&&(i.Q.value=ue(a.q)),t&&(i.gain.value=ue(a.gain))};return o(r),ya(i,o,{frequency:[{param:i.frequency}],...Eb.has(e)?{q:[{param:i.Q}]}:{},...t?{gain:[{param:i.gain}]}:{}})}}function Cb(e){return(t,n)=>{let r=Math.tan(Math.PI*ue(n.frequency)/t.sampleRate),i=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 ya(i,()=>{})}}function ti(e){return(t,n)=>{let r=new AudioWorkletNode(t,e,{processorOptions:{...n}});return{input:r,output:r,update:i=>r.port.postMessage({...i}),dispose:()=>{r.port.postMessage({__hfDispose:!0}),r.disconnect()}}}}var wb={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))},_b=(e,t)=>{let n=e.createWaveShaper(),r=e.createGain(),i=e.createGain();r.connect(n).connect(i);let o=a=>{let l=wb[String(a.type)]??Math.tanh,s=Math.pow(10,ue(a.threshold)/20),u=8192,c=new Float32Array(u);for(let m=0;m<u;m++){let f=m/(u-1)*2-1;c[m]=l(f/Math.max(1e-6,s))*s}n.curve=c,n.oversample=ue(a.oversample)>=4?"4x":ue(a.oversample)>=2?"2x":"none",i.gain.value=Math.pow(10,ue(a.output)/20)};return o(t),{input:r,output:i,update:o,automation:{output:[{param:i.gain,map:a=>Math.pow(10,a/20)}]},dispose:()=>{r.disconnect(),n.disconnect(),i.disconnect()}}},Tb=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createDelay(5),o=e.createGain(),a=e.createGain(),l=e.createGain();n.connect(i),i.connect(o),o.connect(i),i.connect(a).connect(r),n.connect(l).connect(r);let s=u=>{i.delayTime.value=Math.min(5,ue(u.time)/1e3),o.gain.value=ue(u.feedback),gd(a,l,ue(u.mix))};return s(t),{input:n,output:r,update:s,automation:{time:[{param:i.delayTime,map:u=>Math.min(5,ba(u))}],feedback:[{param:o.gain}],mix:xa(a.gain,l.gain)},dispose:()=>[n,r,i,o,a,l].forEach(u=>u.disconnect())}},Rb=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createDelay(.5),a=pd(e,"sine",ue(t.speed),n),l=e.createGain(),s=e.createGain(),u=e.createGain();a.connect(l).connect(o.delayTime),r.connect(o).connect(s).connect(i),r.connect(u).connect(i);let c=m=>{o.delayTime.value=ue(m.delay)/1e3,l.gain.value=ue(m.depth)/1e3,a.playbackRate.value=ue(m.speed),gd(s,u,ue(m.mix))};return c(t),{input:r,output:i,update:c,automation:{delay:[{param:o.delayTime,map:ba}],depth:[{param:l.gain,map:ba}],speed:[{param:a.playbackRate}],mix:xa(s.gain,u.gain)},dispose:()=>{hd(a),[r,i,o,l,s,u].forEach(m=>m.disconnect())}}},kb=6,Fb=(e,t,n)=>{let r=e.createGain(),i=e.createGain(),o=e.createGain(),a=e.createGain(),l=pd(e,String(t.type)==="1"?"sine":"triangle",ue(t.speed),n),s=e.createGain(),u=e.createGain(),c=e.createGain(),m=[];r.connect(o);let f=o;for(let x=0;x<kb;x++){let v=e.createBiquadFilter();v.type="allpass",v.Q.value=.7071,s.connect(v.frequency),f.connect(v),f=v,m.push(v)}l.connect(s),f.connect(u).connect(a),o.connect(c).connect(a),a.connect(i);let g=x=>{let v=1e3/Math.max(.1,ue(x.delay));for(let y of m)y.frequency.value=v;s.gain.value=v*ue(x.decay),l.playbackRate.value=ue(x.speed),o.gain.value=ue(x.in_gain),a.gain.value=ue(x.out_gain),u.gain.value=1,c.gain.value=1};return g(t),{input:r,output:i,update:g,automation:{speed:[{param:l.playbackRate}],in_gain:[{param:o.gain}],out_gain:[{param:a.gain}]},dispose:()=>{hd(l),[r,i,o,a,s,u,c,...m].forEach(x=>x.disconnect())}}},Mb=(e,t)=>{let n=e.createGain(),r=e.createGain(),i=e.createConvolver(),o=e.createGain(),a=e.createGain();i.normalize=!1,n.connect(i).connect(o).connect(r),n.connect(a).connect(r);let l="",s=u=>{let c=`${ue(u.size)}:${ue(u.damping)}`;if(c!==l){let m=vb(e.sampleRate,ue(u.size),ue(u.damping)),f=e.createBuffer(1,m.length,e.sampleRate);f.getChannelData(0).set(m),i.buffer=f,l=c}o.gain.value=ue(u.wet),a.gain.value=ue(u.dry)};return s(t),{input:n,output:r,update:s,automation:{wet:[{param:o.gain}],dry:[{param:a.gain}]},dispose:()=>[n,r,i,o,a].forEach(u=>u.disconnect())}},Nb={"gain-node":Ab,"biquad-peaking":Xn("peaking",!0),"biquad-lowshelf":Xn("lowshelf",!0),"biquad-highshelf":Xn("highshelf",!0),"biquad-highpass":Xn("highpass",!1),"biquad-lowpass":Xn("lowpass",!1),"worklet-compressor":ti("hf-compressor"),"worklet-limiter":ti("hf-limiter"),"worklet-gate":ti("hf-gate"),"worklet-bitcrush":ti("hf-bitcrush"),waveshaper:_b,"delay-feedback":Tb,"chorus-lfo":Rb,"allpass-phaser":Fb,convolver:Mb};function bd(e){return e.nodes.some(t=>un(t.type)?.web.startsWith("worklet-")??!1)}function Lb(e,t,n,r=0){let i=un(t);if(!i)throw new Error(`Unknown effect type: ${t}`);let o=cn(t,n);if((t==="highpass"||t==="lowpass")&&String(o.poles)==="1")return Cb(t)(e,o,r);let a=Nb[i.web];if(!a)throw new Error(`No Web Audio builder for ${i.web}`);return a(e,o,r)}function fd(e){let t=[];for(let n of e){let r=n.fromPreset,i=t.at(-1);if(i&&i.preset===r)i.nodes.push(n);else{let o=typeof n.presetAmount=="number"?n.presetAmount:1;t.push({...r?{preset:r}:{},amount:Math.min(1,Math.max(0,o)),nodes:[n]})}}return t}function md(e){return dn(e).map(t=>{let n=cn(t.type,t.params),r=n.poles!==void 0?`:${n.poles}`:"",i=String(n.poles)==="1"?`@${n.frequency}`:"",o=t.type==="phaser"?`~${n.type}`:"",a=t.fromPreset?`%${t.fromPreset}`:"";return`${t.type}${r}${i}${o}${a}`}).join("|")}function xd(e,t,n=0){var m;let r=e.createGain(),i=e.createGain(),o=[],a=[],l=fd(dn(t)),s=r;for(let f of l){let g=null;if(f.preset){let x=e.createGain(),v=e.createGain(),y=e.createGain(),_=e.createGain();y.gain.value=f.amount,v.gain.value=1-f.amount,s.connect(x),x.connect(v).connect(_),g={entry:x,wet:y,dry:v,join:_},s=x}for(let x of f.nodes){let v=Lb(e,x.type,x.params??{},n);s.connect(v.input),s=v.output,o.push({...x.id?{id:x.id}:{},type:x.type,handle:v})}g&&f.preset&&(s.connect(g.wet).connect(g.join),a.push({id:f.preset,...g}),s=g.join)}s.connect(i);let u=md(t),c={};for(let f of a)(c[m=f.id]??(c[m]=[])).push(...xa(f.wet.gain,f.dry.gain));return{input:r,output:i,presets:c,nodes:o,update(f){if(md(f)!==u)return!1;dn(f).forEach((x,v)=>{let y=o[v];y&&(y.handle.update(cn(x.type,x.params)),x.id===void 0?delete y.id:y.id=x.id)});let g=0;for(let x of fd(dn(f))){if(!x.preset)continue;let v=a[g++];!v||v.id!==x.preset||(v.wet.gain.value=x.amount,v.dry.gain.value=1-x.amount)}return!0},dispose(){for(let{handle:f}of o)f.dispose();for(let{entry:f,wet:g,dry:x,join:v}of a)f.disconnect(),g.disconnect(),x.disconnect(),v.disconnect();r.disconnect(),i.disconnect()}}}var yd={version:1,nodes:[]},Sd={version:1,lanes:[]};function vd(e,t){let n=(typeof e.getAttribute=="function"?e.getAttribute(Mt):null)??"";if(!n)return Sd;try{return Ns(br(n),t)}catch{return Sd}}function Jn(e){let t=(typeof e.getAttribute=="function"?e.getAttribute(pr):null)??"";if(!t)return{chain:yd,raw:""};try{return{chain:ks(t),raw:t}}catch{return{chain:yd,raw:""}}}function Ed(e){return vd(e,Jn(e).chain)}function Ad(e,t,n,r,i){let{chain:o}=Jn(t),a=null,l=[],s=!1,u=0,c=()=>{try{a?(n.disconnect(a.input),a.output.disconnect(r),a.dispose()):n.disconnect(r)}catch{}a=null},m=(T,F)=>{if(T.nodes.length===0){n.connect(r);return}if(bd(T)&&!ha(e)){n.connect(r);let D=++u;ga(e).then(()=>{s||D!==u||y(Jn(t).chain)}).catch(()=>{});return}try{let D=xd(e,T,F);n.connect(D.input),D.output.connect(r),a=D}catch{n.connect(r)}},f=(T,F)=>{l=F&&a?ld(vd(t,T),T,a.nodes,F,a.presets):[]},g=i?{...i}:null;m(o,g?.elapsed??0),f(o,g);let x=()=>{if(!g)return null;let T=typeof e.currentTime=="number"?e.currentTime:g.scheduledAt;return{scheduledAt:T,elapsed:g.elapsed+(T-g.scheduledAt)*g.rate,rate:g.rate}},v=T=>{let F=x();F&&(Yn(l,F.scheduledAt),f(T,F))},y=T=>{let F=x();Yn(l,F?.scheduledAt??0),c(),m(T,F?.elapsed??0),f(T,F)},_=null,R=t;return typeof MutationObserver<"u"&&typeof R?.nodeType=="number"&&(_=new MutationObserver(()=>{let T=Jn(t);l.length>0&&fa(l),!a||!a.update(T.chain)?y(T.chain):v(T.chain)}),_.observe(R,{attributes:!0,attributeFilter:[pr,Mt]})),{setRate:T=>{let F=x();s||!F||!Number.isFinite(T)||T<=0||T===F.rate||(g={...F,rate:T},Yn(l,F.scheduledAt),f(Jn(t).chain,g))},dispose:()=>{s=!0,_?.disconnect(),l.length>0&&Yn(l,typeof e.currentTime=="number"?e.currentTime:0),a?.dispose()}}}function Cd(e){return!Number.isFinite(e)||e<=0?1:e}function Db(e,t){t||e.paused||!or().__hfDebug||console.debug("[hyperframes] webAudioTransport claimed fallback-playing element:",e.currentSrc||e.getAttribute("src")||"")}function Ib(e,t){let{elapsed:n,mediaStart:r,scheduledAt:i,safeRate:o,clipDuration:a}=t,l=Number.isFinite(a)&&a>0,s=a*o;if(n>=0){let c=s-n;return l&&c<=0?!1:(l?e.start(0,n+r,c):e.start(0,n+r),!0)}let u=-n/o;return l?e.start(i+u,r,s):e.start(i+u,r),!0}function Pb(e,t,n){let r=ud(Ed(e));r&&ma([{param:t.gain}],r,gr.scale,n)}var ni=class{constructor(){ge(this,"_ctx",null);ge(this,"_bufferCache",new Map);ge(this,"_failedSrcs",new Set);ge(this,"_activeSources",[]);ge(this,"_masterGain",null);ge(this,"_rateAnchorCtx",0);ge(this,"_rateAnchorComp",0);ge(this,"_rate",1);ge(this,"_paused",!0);ge(this,"_playGeneration",0)}async init(){try{return this._ctx=new AudioContext,this._masterGain=this._ctx.createGain(),this._masterGain.connect(this._ctx.destination),!0}catch{return!1}}get context(){return this._ctx}getTime(){return!this._ctx||this._paused?-1:this._rateAnchorComp+(this._ctx.currentTime-this._rateAnchorCtx)*this._rate}async decodeAudioElement(t){let n=t.currentSrc||t.getAttribute("src");if(!n)return null;if(this._bufferCache.has(n))return this._bufferCache.get(n);if(this._failedSrcs.has(n)||!this._ctx)return null;let r;try{let i=await fetch(n,{cache:"no-store"});if(!i.ok)return M("webAudioTransport.fetch",new Error(`${i.status} ${n}`)),null;r=await i.arrayBuffer()}catch(i){return M("webAudioTransport.fetch",i),null}try{let i=await this._ctx.decodeAudioData(r);return this._bufferCache.set(n,i),i}catch(i){return this._failedSrcs.add(n),M("webAudioTransport.decode",i),null}}startGeneration(){return this._playGeneration+=1,this._playGeneration}currentGeneration(){return this._playGeneration}async schedulePlayback(t,n,r,i,o,a,l,s=1,u=Number.POSITIVE_INFINITY){if(!this._ctx||!this._masterGain||l!==this._playGeneration)return null;try{if(this._ctx.state==="suspended"&&await this._ctx.resume(),l!==this._playGeneration)return null;let c=Cd(s),m=this._ctx.createBufferSource();m.buffer=n,m.playbackRate.value=c;let f=this._ctx.createGain();f.gain.value=a;let g=o-r,x=this._ctx.currentTime,v={scheduledAt:x,elapsed:g,rate:c},y=Ad(this._ctx,t,m,f,v);if(f.connect(this._masterGain),Pb(t,f,v),this._rate=c,this._rateAnchorCtx=x,this._rateAnchorComp=o,!Ib(m,{elapsed:g,mediaStart:i,scheduledAt:x,safeRate:c,clipDuration:u}))return m.disconnect(),y?.dispose(),f.disconnect(),null;let _=t.muted;t.muted=!0,Db(t,_);let R={fx:y,el:t,sourceNode:m,gainNode:f,compositionStart:r,mediaStart:i,scheduledAt:x,priorMuted:_,bounded:Number.isFinite(u)&&u>0};return this._activeSources.push(R),this._paused=!1,m.addEventListener("ended",()=>{let T=this._activeSources.indexOf(R);if(T!==-1){this._activeSources.splice(T,1),t.muted=_;try{m.disconnect(),y?.dispose(),f.disconnect()}catch{}this._activeSources.length===0&&(this._paused=!0)}}),R}catch(c){return M("webAudioTransport.schedule",c),null}}setRate(t){let n=Cd(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)try{r.sourceNode.playbackRate.value=n,r.fx?.setRate(n)}catch(i){M("webAudioTransport.setRate",i)}return!0}hasBoundedActiveSources(){return this._activeSources.some(t=>t.bounded)}stopAll(){for(let t of this._activeSources){try{t.sourceNode.stop(),t.sourceNode.disconnect(),t.fx?.dispose(),t.gainNode.disconnect()}catch{}t.el.muted=t.priorMuted}this._activeSources=[],this._paused=!0}setVolume(t){this._masterGain&&(this._masterGain.gain.value=Math.max(0,Math.min(1,t)))}setElementVolume(t,n){let r=Math.max(0,Math.min(1,n));for(let i of this._activeSources)if(i.el===t)try{i.gainNode.gain.value=r}catch(o){M("webAudioTransport.setElementVolume",o)}}setMuted(t){this._masterGain&&(this._masterGain.gain.value=t?0:1)}isActive(){return this._activeSources.length>0&&!this._paused}ownsElement(t){return!this._paused&&this._activeSources.some(n=>n.el===t)}destroy(){if(this.stopAll(),this._bufferCache.clear(),this._failedSrcs.clear(),this._ctx)try{this._ctx.close()}catch{}this._ctx=null,this._masterGain=null}};var wd="data-hf-studio-manual-edit-gesture";function _d(e){return!Number.isInteger(e.tick)||e.tick<=0||e.tick%60!==0?!1:!(e.isPlaying&&e.hasCapturedTimeline&&e.currentTimeSeconds<2)}var Ob=/^\s*spring\(\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+))\s*\)\s*$/;function Td(e){return Math.max(0,Math.min(1,e))}function Rd(e){let t=Ob.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)?Td(n):null}function kd(e,t){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let n=Td(t),r=12-n*6,i=Math.PI*2*(1+n*1.5),o=1-Math.exp(-r)*Math.cos(i);return(1-Math.exp(-r*e)*Math.cos(i*e))/o}var Hb=/^\s*wiggle\(\s*(\d+)\s*,\s*(easeOut|easeInOut|anticipate|uniform)\s*(?:,\s*([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?)\s*)?\)\s*$/,Gb=Math.PI*2;function Bb(e){let t=Hb.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 i=Number(t[3]);return!Number.isFinite(i)||i<0||i>1?null:{wiggles:n,type:r,amplitude:i}}function Ub(e,t,n,r){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let i=r??(n==="easeInOut"?.08:n==="uniform"?.14:n==="anticipate"?.12:.16),o=n==="easeInOut"?i*Math.sin(Math.PI*e):n==="uniform"?i:i*(1-e);return e+(n==="anticipate"?-1:1)*o*Math.sin(Gb*t*e)}function Fd(e,t){let n=Bb(e);if(!n)return null;let r=`${n.wiggles}:${n.type}:${n.amplitude??"default"}`,i=t?.get(r);if(i)return i;let o=a=>Ub(a,n.wiggles,n.type,n.amplitude);return t?.set(r,o),o}var Wb=24,Md=e=>e>=1?1:0,Vb=e=>e,ri=String.raw`([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)`,zb=new RegExp(String.raw`^\s*M\s*0\s*,\s*0\s+C\s*${ri}\s*,\s*${ri}\s+${ri}\s*,\s*${ri}\s+1\s*,\s*1\s*$`,"i");function Nd(e,t,n){let r=1-e;return 3*r*r*e*t+3*r*e*e*n+e*e*e}function qb(e,t,n,r,i){if(!Number.isFinite(e))return e;if(e<=0)return 0;if(e>=1)return 1;let o=0,a=1;for(let l=0;l<Wb;l+=1){let s=(o+a)/2;Nd(s,t,r)<e?o=s:a=s}return Nd((o+a)/2,n,i)}function $b(e){let t=zb.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),o=Number(t[4]);return Math.min(n,i)<0||Math.max(n,i)>1?null:a=>qb(a,n,r,i,o)}function jb(e,t){if(!e.startsWith("spring("))return null;let n=Rd(e);if(n===null)return null;let r=t.get(n);if(r)return r;let i=o=>kd(o,n);return t.set(n,i),i}function Kb(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 i=$b(n);return i&&t.set(n,i),i}function Ld(e){if(e.__hfCustomEaseInstalled)return!0;let t=e.parseEase;if(!t)return!1;let n=new Map,r=new Map,i=new Map,o=s=>typeof s!="string"?null:s==="hold"?Md:Fd(s,i)??jb(s,r)??Kb(s,n),a=(s,u,c=[])=>{let m=o(s);return m||(typeof s=="string"&&/^(?:hold|spring|wiggle|custom)(?:\(|$)/.test(s.trim())&&Ne("custom_ease_parse_failed",{ease:s}),t.call(u,s,...c)??Vb)};e.parseEase=function(u,...c){return a(u,this,c)};let l=e.registerEase;if(typeof l=="function"){l("hold",Md);let s=u=>{let c=m=>m;c.config=(...m)=>a(`${u}(${m.join(",")})`,e),l(u,c)};s("spring"),s("wiggle"),s("custom")}return e.__hfCustomEaseInstalled=!0,!0}var Sa="data-hf-authored-duration",va="data-hf-authored-end",Dd=!1;function rt(e){if(e){if(typeof e.pause!="function"){Dd||(Dd=!0,Ne("timeline_missing_pause",{}));return}try{e.pause()}catch(t){M("runtime.timeline.pause",t)}}}function Yb(){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 Id(){let e=Al();Xa(xe),zr(document),ea(document);let t=Yb();e.canonicalFps=t.fps??e.canonicalFps,Ka(e.canonicalFps),window.__HF_EXPORT_RENDER_SEEK_CONFIG&&console.info("[hyperframes] render runtime fps",{canonicalFps:e.canonicalFps,source:t.source,rawFpsSource:t.rawFpsSource,rawFps:t.rawFps,fallbackReason:t.fallbackReason});let n=null,r=null,i=null,o=[],a=new Set,l=null,s=new Set,u=(d,h,p)=>{s.has(d)||(s.add(d),Ne(h,p))};if(typeof window.__hfRuntimeTeardown=="function")try{window.__hfRuntimeTeardown()}catch(d){M("runtime.init.site1",d)}let c=new ei;e.transportClock=c;let m=new ni,f=!1;m.init().then(d=>{f=d});let g=()=>{let d=window.gsap,h=window;if(!(!d?.registerPlugin||h.__hfAutoNoopRegistered))try{d.registerPlugin({name:"_auto",init:()=>!1}),h.__hfAutoNoopRegistered=!0}catch(p){u("auto_marker_install_failed","auto_marker_install_failed",{reason:"threw"}),M("runtime.autoMarker.install",p)}},x=()=>{let d=window.gsap;if(!d){u("custom_ease_missing_gsap","custom_ease_install_failed",{reason:"missing_gsap"});return}try{Ld(d)||u("custom_ease_no_parse_ease","custom_ease_install_failed",{reason:"no_parseEase"})}catch(h){u("custom_ease_install_threw","custom_ease_install_failed",{reason:"threw"}),M("runtime.customEase.install",h)}};g(),x(),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{rs(document)}catch(d){M("runtime.init.cssVariables",d)}window.__timelines=window.__timelines||{};let v=()=>{let d=document.querySelector('[data-composition-id][data-root="true"]');if(d instanceof HTMLElement)return d;let h=Array.from(document.querySelectorAll("[data-composition-id]"));return h.find(p=>!p.parentElement?.closest("[data-composition-id]"))??h[0]??null};if(Array.isArray(window.__timelines)){let d=window.__timelines,h=v()?.getAttribute("data-composition-id")??"root",p={};if(d.length===1)p[h]=d[0];else for(let b=0;b<d.length;b++)p[`tl-${b}`]=d[b];window.__timelines=p}let y=v();y&&!y.hasAttribute("data-start")&&y.setAttribute("data-start","0");let _=d=>{o.push(d)},R=(d,h,p)=>{let b=p??`${d}:${JSON.stringify(h)}`;a.has(b)||(a.add(b),xe({source:"hf-preview",type:"diagnostic",code:d,details:h}))},T=d=>{let h={scale:1,focusX:960,focusY:540},p=[],b=[],A={time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying(),renderMode:!1,timelineDirty:!1};return{play:d.play,pause:d.pause,seek:d.seek,getTime:d.getTime,getDuration:d.getDuration,isPlaying:d.isPlaying,getMainTimeline:()=>null,getElementBounds:()=>{},getElementsAtPoint:()=>{},setElementPosition:()=>{},previewElementPosition:()=>{},setElementKeyframes:()=>{},setElementScale:()=>{},setElementFontSize:()=>{},setElementTextContent:()=>{},setElementTextColor:()=>{},setElementTextShadow:()=>{},setElementTextFontWeight:()=>{},setElementTextFontFamily:()=>{},setElementTextOutline:()=>{},setElementTextHighlight:()=>{},setElementVolume:()=>{},setStageZoom:()=>{},getStageZoom:()=>h,setStageZoomKeyframes:()=>{},getStageZoomKeyframes:()=>p,addElement:()=>!1,removeElement:()=>!1,updateElementTiming:()=>!1,setElementTiming:()=>{},updateElementSrc:()=>!1,updateElementLayer:()=>!1,updateElementBasePosition:()=>!1,markTimelineDirty:()=>{},isTimelineDirty:()=>!1,rebuildTimeline:()=>{},ensureTimeline:()=>{},enableRenderMode:()=>{},disableRenderMode:()=>{},renderSeek:d.renderSeek,getElementVisibility:()=>({visible:!1}),getVisibleElements:()=>b,getRenderState:()=>({...A,time:d.getTime(),duration:d.getDuration(),isPlaying:d.isPlaying()})}},F=1/60,D=.75,C=.05,S=100,E=240,w=d=>{if(d instanceof Error)return d.message||String(d);if(typeof d=="string")return d;try{return JSON.stringify(d)}catch{return String(d??"")}},k=d=>{let h=d.toLowerCase();return h.includes("cannot read properties of null")||h.includes("cannot set properties of null")?{code:"runtime_null_dom_access",category:"dom-null-access"}:h.includes("failed to execute 'queryselector'")?{code:"runtime_invalid_selector",category:"selector-invalid"}:h.includes("is not defined")?{code:"runtime_reference_missing",category:"reference-missing"}:{code:"runtime_script_error",category:"script-error"}},L=d=>{if(d==null||d.trim()==="")return null;let h=Number.parseFloat(d);return!Number.isFinite(h)||h<=0?null:`${h}px`},H=()=>v(),V=()=>{let d=H();if(!d)return;let h=L(d.getAttribute("data-width")),p=L(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p),h&&d.style.setProperty("--comp-width",h),p&&d.style.setProperty("--comp-height",p)},j=()=>{let d=H(),h=Array.from(document.querySelectorAll("[data-composition-id]")).filter(p=>p.hasAttribute("data-duration")||p.hasAttribute("data-end"));for(let p of h){if(d&&p===d)continue;let b=p.getAttribute("data-duration"),A=p.getAttribute("data-end");b!=null&&!p.hasAttribute(Sa)&&p.setAttribute(Sa,b),A!=null&&!p.hasAttribute(va)&&p.setAttribute(va,A),p.removeAttribute("data-duration"),p.removeAttribute("data-end")}},O=()=>{let d=H();if(!d)return;d.style.position||(d.style.position="relative"),d.style.overflow="hidden";let h=L(d.getAttribute("data-width")),p=L(d.getAttribute("data-height"));h&&(d.style.width=h),p&&(d.style.height=p);let b=Array.from(d.children);for(let A of b){let N=A.tagName.toLowerCase();if(N==="script"||N==="style"||N==="link"||N==="meta"||!A.hasAttribute("data-start")||A.hasAttribute("data-hf-autostamped"))continue;let G=(A.style.top==="0px"||A.style.top==="0")&&(A.style.left==="0px"||A.style.left==="0")&&A.style.width==="100%"&&A.style.height==="100%",J=/translate\(\s*-50%\s*,\s*-50%\s*\)/.test(A.style.transform);if(G&&J&&!A.hasAttribute("data-width")&&!A.hasAttribute("data-height")){let Ee=A.style.top,on=A.style.left,Ae=A.style.width,an=A.style.height;A.style.top="",A.style.left="",A.style.width="",A.style.height="";let re=window.getComputedStyle(A);re.top!=="auto"||re.bottom!=="auto"||re.left!=="auto"||re.right!=="auto"||re.width!=="0px"||re.height!=="0px"||(A.style.top=Ee,A.style.left=on,A.style.width=Ae,A.style.height=an)}let U=window.getComputedStyle(A),se=U.position;if(se!=="absolute"&&se!=="fixed"&&(A.style.position="absolute"),!!A.style.top||!!A.style.bottom||U.top!=="auto"||U.bottom!=="auto"||(A.style.top="0"),!!A.style.left||!!A.style.right||U.left!=="auto"||U.right!=="auto"||(A.style.left="0"),N!=="audio"){let Ee=L(A.getAttribute("data-width")),on=L(A.getAttribute("data-height")),Ae=U.width!=="0px"&&U.width!=="auto",an=U.height!=="0px"&&U.height!=="auto";Ee?!A.style.width&&!Ae&&(A.style.width=Ee):!A.style.width&&U.width==="0px"&&(A.style.width="100%"),on?!A.style.height&&!an&&(A.style.height=on):!A.style.height&&U.height==="0px"&&(A.style.height="100%")}}},Q=(d,h=0,p)=>lt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:p?.includeAuthoredTimingAttrs??!0}).resolveStartForElement(d,h),we=(d,h)=>lt({timelineRegistry:window.__timelines??{},includeAuthoredTimingAttrs:h?.includeAuthoredTimingAttrs??!0}).resolveDurationForElement(d),z=d=>{let h=d.closest("[data-composition-id]"),p=h?Q(h,0):null,b=h?we(h,{includeAuthoredTimingAttrs:!0}):null;return{compositionRoot:h,inheritedStart:p,inheritedDuration:b}},X=d=>{let h=z(d),p=h.inheritedStart??0,b=Le(d.getAttribute("data-start"));if(d.hasAttribute("data-hf-auto-start")||b==null||p<=0)return Q(d,p);let A=Le(d.getAttribute("data-duration")),N=h.inheritedDuration,G=N!=null&&N>0?p+N:null,J=A!=null&&A>0?b+A:b;return(G==null?b>=p:b<G&&(J>p||b===p))?b:p+b};window.__hfResolveMediaStartSeconds=X,o.push(()=>{window.__hfResolveMediaStartSeconds===X&&delete window.__hfResolveMediaStartSeconds});let W=(d,h)=>{let p=d.tagName.toLowerCase();if(p==="script"||p==="style"||p==="link"||p==="meta")return!1;let A=p==="video"||p==="audio"?X(d):Q(d,0),N=we(d),G=d.getAttribute("data-composition-id");if(G){let U=(window.__timelines??{})[G],se=null;if(U&&typeof U.duration=="function"){let ie=Number(U.duration());Number.isFinite(ie)&&ie>0&&(se=ie)}!(d.hasAttribute("data-duration")||d.hasAttribute("data-end")||d.hasAttribute(Sa)||d.hasAttribute(va))&&(N==null||N<=0)&&se!=null&&(N=se)}let J=N!=null&&N>0?A+N:Number.POSITIVE_INFINITY;return h>=A&&(Number.isFinite(J)?h<J:!0)},te=!!document.querySelector("[data-composition-src]"),_e=!1;{let d=document.querySelectorAll("[data-composition-id]:not([data-composition-src])");for(let h of d){let p=h.getAttribute("data-composition-id");if(p&&h.children.length===0&&document.querySelector(`template#${CSS.escape(p)}-template`)){_e=!0;break}}}let B=!te&&!_e,I=d=>{if(!d||typeof d.duration!="function")return null;try{let h=Number(d.duration());return Number.isFinite(h)?Math.max(0,h):null}catch{return null}},P=d=>typeof d=="number"&&Number.isFinite(d)&&d>F,ce=d=>{let h=Number(d.getAttribute("data-duration"));if(Number.isFinite(h)&&h>0)return h;let p=Number(d.getAttribute("data-playback-start")??d.getAttribute("data-media-start")??"0"),b=Number.isFinite(p)?Math.max(0,p):0;return Number.isFinite(d.duration)&&d.duration>b?Math.max(0,d.duration-b):null},ae=()=>{let d=Array.from(document.querySelectorAll("video[data-start], audio[data-start]"));if(d.length===0)return null;let h=0;for(let p of d){let b=X(p);if(!Number.isFinite(b))continue;let A=ce(p);A==null||A<=F||(h=Math.max(h,Math.max(0,b)+A))}return h>F?h:null},q=()=>{let d=H();if(!d)return null;let h=window.__timelines??{},p=lt({timelineRegistry:h,includeAuthoredTimingAttrs:!0}),b=0,A=Number.parseFloat(d.getAttribute("data-duration")??"");Number.isFinite(A)&&A>0&&(b=A);let N=Array.from(d.querySelectorAll("[data-composition-id][data-start]"));for(let G of N){if(!(G instanceof Element)||G.parentElement?.closest("[data-composition-id]")!==d)continue;let U=p.resolveStartForElement(G,0),se=p.resolveDurationForElement(G);!Number.isFinite(U)||se==null||se<=0||(b=Math.max(b,Math.max(0,U)+se))}return b>F?b:null},$=()=>{let d=ae();return typeof d!="number"||!Number.isFinite(d)||d<=F?null:d},K=d=>P(d)?Math.max(F,d*D):F,ze=()=>{let d=0;for(let h of e.deterministicAdapters){let p=h.getInferredDurationSeconds;if(typeof p!="function")continue;let b=null;try{b=p()}catch(A){M("runtime.init.adapterDuration",A)}typeof b=="number"&&Number.isFinite(b)&&b>0&&(d=Math.max(d,b))}return d>F?d:null},pe=(d,h=0)=>{let p=I(d),b=$(),A=q(),N=ze(),G=Math.max(b??0,A??0,N??0),J=Number.isFinite(h)&&h>F?h:0,U=0;return P(p)?U=Math.max(p,G,J):P(G)?U=Math.max(G,J):U=J,U>0?Math.max(0,U):0},Tt=()=>{let d=window.__timelines??{},h=re=>{let Z=Object.entries(d).filter(oe=>!!oe[1]&&typeof oe[1].play=="function"&&typeof oe[1].pause=="function");if(Z.length!==1)return{timeline:null};let me=Z[0];if(!me)return{timeline:null};let[he,be]=me;return{timeline:be,selectedTimelineIds:[he],selectedDurationSeconds:I(be),diagnostics:{code:"root_timeline_sole_registered_fallback",details:{reason:re,soleTimelineId:he}}}},p=lt({timelineRegistry:d,includeAuthoredTimingAttrs:!0}),b=$(),A=q(),N=Math.max(b??0,A??0)||null,G=K(N),J=re=>{let Z=document.querySelector(`[data-composition-id="${CSS.escape(re)}"]`);return Z?p.resolveStartForElement(Z,0):0},U=re=>{let Z=window.gsap;if(!Z||typeof Z.timeline!="function")return null;let me=Z.timeline({paused:!0});for(let he of re)me.add(he.timeline,J(he.compositionId));return me},se=(re,Z)=>{if(!P(re))return null;let me=window.gsap;if(!me||typeof me.timeline!="function")return null;let he=me.timeline({paused:!0});if(Z)try{he.add(Z,0)}catch(oe){M("runtime.init.site2",oe)}let be=he;if(typeof be.to=="function")try{be.to({},{duration:re})}catch(oe){M("runtime.init.site3",oe)}return he},Me=(re,Z)=>{let me=re;if(typeof me.getChildren!="function")return[];try{let he=me.getChildren(!0,!0,!0)??[];if(!Array.isArray(he))return[];let be=[];for(let oe of Z)if(!he.some(Be=>Be===oe.timeline))try{let Be=J(oe.compositionId);re.add(oe.timeline,Be),be.push(oe.compositionId)}catch(Be){M("runtime.init.site4",Be)}return be}catch{return[]}},ie=H(),ne=ie?.getAttribute("data-composition-id")??null;if(!ne)return h("root_missing_composition_id");let Ee=d[ne]??null,Ae=(()=>{if(!ie)return[];let re=new Set,Z=Array.from(ie.querySelectorAll("[data-composition-id]")),me=[];for(let he of Z){let be=he.getAttribute("data-composition-id");if(!be||be===ne||re.has(be))continue;re.add(be);let oe=d[be]??null;if(!oe||typeof oe.play!="function"||typeof oe.pause!="function")continue;let ke=I(oe);me.push({compositionId:be,timeline:oe,durationSeconds:ke??0})}return me})(),an=re=>{for(let Z of re){let me=Z.timeline;if(typeof me.paused=="function")try{me.paused(!1)}catch(he){M("runtime.init.site5",he)}}};if(Ae.length>0&&an(Ae),Ee){let re=Ae.length>0?Me(Ee,Ae):[];if((Ae.length>0||!document.querySelector("[data-composition-id]:not([data-composition-id='"+ne+"'])"))&&(Pe=!0),re.length>0)try{let oe=Ee.time();Ee.seek(oe,!1)}catch{}let Z=I(Ee);if(!P(Z)&&Ae.length>0){let oe=Ae.map(kf=>kf.compositionId),ke=U(Ae),Be=I(ke);if(ke&&P(Be))return{timeline:ke,selectedTimelineIds:oe,selectedDurationSeconds:Be,mediaDurationFloorSeconds:b,diagnostics:{code:"root_timeline_unusable_fallback",details:{rootCompositionId:ne,rootDurationSeconds:Z,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:G,selectedDurationSeconds:Be,mediaDurationFloorSeconds:b,authoredCompositionDurationFloorSeconds:A,selectedTimelineIds:oe,autoNestedChildren:re}}};let yi=se(N??0,Ee),Si=I(yi);if(yi&&P(Si))return{timeline:yi,selectedTimelineIds:[ne],selectedDurationSeconds:Si,mediaDurationFloorSeconds:b,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:ne,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:b,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:Si,selectedTimelineIds:[ne],autoNestedChildren:re}}}}if(!P(Z)&&Ae.length===0){let oe=se(N??0,Ee),ke=I(oe);if(oe&&P(ke))return{timeline:oe,selectedTimelineIds:[ne],selectedDurationSeconds:ke,mediaDurationFloorSeconds:b,diagnostics:{code:"root_timeline_unusable_media_floor_fallback",details:{rootCompositionId:ne,rootDurationSeconds:Z,fallbackKind:"media_duration_floor",mediaDurationFloorSeconds:b,authoredCompositionDurationFloorSeconds:A,selectedDurationSeconds:ke,selectedTimelineIds:[ne]}}}}let me=ie?.getAttribute("data-duration"),he=me?parseFloat(me):null,be=Math.max(P(he)?he:0,A??0);if(be>0&&P(be)&&P(Z)&&be>=Z+.5){let oe=Ee;if(typeof oe.to=="function")try{oe.to({},{duration:0},be)}catch(Be){M("runtime.init.site6",Be)}let ke=I(Ee);if(P(ke))return{timeline:Ee,selectedTimelineIds:[ne],selectedDurationSeconds:ke,mediaDurationFloorSeconds:b,diagnostics:{code:"root_timeline_padded_to_declared_duration",details:{rootCompositionId:ne,rootDurationSeconds:Z,rootDeclaredDur:he,authoredCompositionDurationFloorSeconds:A,newDur:ke}}}}return{timeline:Ee,selectedTimelineIds:[ne],selectedDurationSeconds:Z,mediaDurationFloorSeconds:b,diagnostics:re.length>0?{code:"root_timeline_auto_nested_children",details:{rootCompositionId:ne,selectedDurationSeconds:Z,autoNestedChildren:re}}:void 0}}if(Ae.length>0){let re=Ae.map(he=>he.compositionId),Z=U(Ae),me=I(Z);if(Z)return{timeline:Z,selectedTimelineIds:re,selectedDurationSeconds:me,mediaDurationFloorSeconds:b,diagnostics:{code:"root_timeline_missing_fallback",details:{rootCompositionId:ne,fallbackKind:"composite_by_root_children",minCandidateDurationSeconds:G,selectedDurationSeconds:me,mediaDurationFloorSeconds:b,selectedTimelineIds:re}}}}return h("root_composition_id_unmatched_in_registry")},Pe=!1,uf=d=>{let h=window.gsap,p=d;if(!(!p||typeof p.getChildren!="function"||!h||typeof h.parseEase!="function"))for(let b of p.getChildren(!0,!0,!0)){let A=b,N=A.timeline;if(!N||!("_ease"in N)||typeof N._ease=="function")continue;let G=A.vars?.keyframes,U=(G&&!Array.isArray(G)?G.ease:void 0)??A.vars?.ease??"none";try{let se=h.parseEase(U);typeof se=="function"&&(N._ease=se)}catch(se){Ne("keyframe_ease_repair_failed",{ease:typeof U=="string"?U:String(U)}),M("runtime.keyframeEase.repair",se)}}},Zt=()=>{if(x(),!B)return!1;let d=e.capturedTimeline,h=I(d),p=P(h);if(d&&p&&Pe)return!1;let b=Tt();if(!b.timeline)return!1;if(d&&d===b.timeline)return typeof d.timeScale=="function"&&d.timeScale(e.playbackRate),!1;e.capturedTimeline=b.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate),uf(e.capturedTimeline);let A=pe(e.capturedTimeline,0);if(A<=0&&typeof e.capturedTimeline.progress=="function"&&(e.capturedTimeline.progress(1,!0),e.capturedTimeline.progress(0,!1),rt(e.capturedTimeline)),A>0){try{c.setDuration(A)}catch{}if(typeof e.capturedTimeline.totalTime=="function"){typeof e.capturedTimeline.progress=="function"&&e.capturedTimeline.progress(1e-4,!0);let G=Math.max(0,e.currentTime||0);e.capturedTimeline.totalTime(G,!1),rt(e.capturedTimeline)}let N=window.__hfStudioManualEditsApply;typeof N=="function"&&N(),zr(document)}if(b.diagnostics&&xe({source:"hf-preview",type:"diagnostic",code:b.diagnostics.code,details:b.diagnostics.details}),xe({source:"hf-preview",type:"diagnostic",code:"timeline_bound",details:{selectedTimelineIds:b.selectedTimelineIds??[],selectedDurationSeconds:b.selectedDurationSeconds??null,mediaDurationFloorSeconds:b.mediaDurationFloorSeconds??null}}),window.parent!==window){let N=H(),G=A>0?A:0,J=String(G>0?G:1),U=new Set,se=new Set(document.querySelectorAll("[data-start]")),Me=ie=>{let ne=ie.parentElement;for(;ne&&ne!==N;){if(se.has(ne))return!0;ne=ne.parentElement}return!1};if(e.capturedTimeline.getChildren)try{for(let ie of e.capturedTimeline.getChildren(!0))if(typeof ie.targets=="function")for(let ne of ie.targets())ne instanceof HTMLElement&&ne!==N&&(ne.hasAttribute("data-start")||Me(ne)||U.has(ne)||(U.add(ne),ne.setAttribute("data-start","0"),ne.setAttribute("data-duration",J),ne.setAttribute("data-hf-autostamped","1")))}catch{}if(N instanceof HTMLElement)for(let ie of N.querySelectorAll("[id]"))ie instanceof HTMLElement&&ie!==N&&(ie.hasAttribute("data-start")||Me(ie)||U.has(ie)||ie.tagName==="SCRIPT"||ie.tagName==="STYLE"||ie.tagName==="LINK"||(U.add(ie),ie.setAttribute("data-start","0"),ie.setAttribute("data-duration",J),ie.setAttribute("data-hf-autostamped","1")))}for(let N of en)er.delete(N),Da(N);return!0};window.__hfForceTimelineRebind=()=>{Pe=!1,Zt(),mi(e.currentTime)};let cf=()=>{let d=H();if(!(d instanceof HTMLElement))return;let h=d.getBoundingClientRect(),p=Number(d.getAttribute("data-width")),b=Number(d.getAttribute("data-height")),A=window.getComputedStyle(d),N=Number.isFinite(p)&&p>0&&Number.isFinite(b)&&b>0,G=h.width<=0||h.height<=0||d.clientWidth<=0||d.clientHeight<=0;!N||!G||R("root_stage_layout_zero",{compositionId:d.getAttribute("data-composition-id")??null,declaredWidth:p,declaredHeight:b,rectWidth:Math.round(h.width),rectHeight:Math.round(h.height),clientWidth:d.clientWidth,clientHeight:d.clientHeight,display:A.display,visibility:A.visibility,overflow:A.overflow},`root-stage-layout-zero:${d.getAttribute("data-composition-id")??"unknown"}`)},df=()=>{e.tornDown||(l!=null&&window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{l=null,cf()}))},ff=()=>{r=d=>{let h=w(d.error??d.message).slice(0,E);if(!h)return;let p=k(h);xe({source:"hf-preview",type:"diagnostic",code:p.code,details:{category:p.category,message:h,filename:d.filename||null,line:Number.isFinite(d.lineno)?d.lineno:null,column:Number.isFinite(d.colno)?d.colno:null}})},i=d=>{let h=w(d.reason).slice(0,E);if(!h)return;let p=k(h);xe({source:"hf-preview",type:"diagnostic",code:`${p.code}_unhandled_rejection`,details:{category:`${p.category}-unhandled-rejection`,message:h}})},window.addEventListener("error",r),window.addEventListener("unhandledrejection",i)},mf=()=>{let d=Array.from(document.querySelectorAll("img, video, audio, source, link[rel='stylesheet']"));for(let p of d){let b=()=>{if(!(p instanceof Element))return;let A=p.tagName.toLowerCase(),N=p.getAttribute("src")??p.getAttribute("href")??p.getAttribute("poster")??null,G=A==="link"?"runtime_stylesheet_load_failed":"runtime_asset_load_failed";R(G,{tagName:A,assetUrl:N,currentSrc:(p instanceof HTMLImageElement||p instanceof HTMLMediaElement)&&p.currentSrc||null,readyState:p instanceof HTMLMediaElement?p.readyState:null,networkState:p instanceof HTMLMediaElement?p.networkState:null},`${G}:${A}:${N??"unknown"}`)};p.addEventListener("error",b),_(()=>{p.removeEventListener("error",b)})}let h=document.fonts;h&&h.ready.then(()=>{if(e.tornDown)return;let p=Array.from(h).filter(b=>b.status==="error").map(b=>b.family).filter(b=>!!b).slice(0,10);p.length!==0&&R("runtime_font_load_issue",{failedFamilies:p,totalFaces:Array.from(h).length},`runtime-font-load-issue:${p.join("|")}`)}).catch(()=>{})},pf=(d,h)=>{if(!d.timeline)return!1;let p=e.capturedTimeline;if(p&&p===d.timeline)return!1;let b=Math.max(0,e.currentTime||0),A=e.isPlaying;e.capturedTimeline=d.timeline,typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);try{rt(e.capturedTimeline),typeof e.capturedTimeline.seek=="function"&&e.capturedTimeline.seek(b,!1),A&&typeof e.capturedTimeline.play=="function"&&e.capturedTimeline.play()}catch(N){M("runtime.init.site7",N)}return xe({source:"hf-preview",type:"diagnostic",code:"timeline_loop_guard_rebind",details:{reason:h,previousTime:b,selectedTimelineIds:d.selectedTimelineIds??[],selectedDurationSeconds:d.selectedDurationSeconds??null,mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),!0},gt=null,Fa=!1,Ma=!1,en=new Set,er=new WeakMap,tr=()=>{e.tornDown||(gt!=null&&window.clearTimeout(gt),gt=window.setTimeout(()=>{if(e.tornDown||(gt=null,Ma&&window.__HF_EXPORT_RENDER_SEEK_CONFIG))return;let d=Tt();if(!d.timeline||!P(d.mediaDurationFloorSeconds??null))return;if(!e.capturedTimeline){Zt()&&(bt(),Fe(!0));return}if(Fa)return;let p=I(e.capturedTimeline),b=d.selectedDurationSeconds??I(d.timeline);P(b)&&(!P(p)||b>=p+C)&&pf(d,"manual")&&(Fa=!0,xe({source:"hf-preview",type:"diagnostic",code:"timeline_rebind_after_media_metadata",details:{previousDurationSeconds:p??null,selectedDurationSeconds:b??null,selectedTimelineIds:d.selectedTimelineIds??[],mediaDurationFloorSeconds:d.mediaDurationFloorSeconds??null}}),bt(),Fe(!0))},S))},Na=d=>{d.currentTarget instanceof HTMLMediaElement&&zs(d.currentTarget)},La=d=>{d.currentTarget instanceof HTMLMediaElement&&qs(d.currentTarget)},hf=()=>{for(let d of en)d.removeEventListener("loadedmetadata",tr),d.removeEventListener("durationchange",tr),d.removeEventListener("loadedmetadata",Na),d.removeEventListener("error",La);en.clear()},ui=()=>{if(e.tornDown)return;let d=Array.from(document.querySelectorAll("video, audio"));for(let h of d){if(en.has(h))continue;en.add(h);let p=Number.parseFloat(h.dataset.volume??"");Number.isFinite(p)&&(h.volume=Math.max(0,Math.min(1,p))),h.addEventListener("loadedmetadata",tr),h.addEventListener("durationchange",tr),h.addEventListener("loadedmetadata",Na),h.addEventListener("error",La),Vs(h),h.preload!=="auto"&&(h.preload="auto"),h.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&h.load(),Da(h)}},Da=d=>{er.has(d)||ws(d,e.capturedTimeline,pe(e.capturedTimeline,0),er,{allowLiveTimelineSeek:!window.__HF_RENDER_CAPTURE_MODE})},ci=new WeakMap,Ia=d=>{let h=ci.get(d);if(h!==void 0)return h;let p=window.getComputedStyle(d).position,b=p==="static"||p==="relative"||p==="sticky";return ci.set(d,b),b},di=new WeakMap,gf=d=>{let h=di.get(d);if(h!==void 0)return h;let p=d.querySelector("[data-start]")===null;return di.set(d,p),p},bf=()=>{ci=new WeakMap,di=new WeakMap},fi=new WeakMap,nr=new WeakSet,mi=(d,h=Array.from(document.querySelectorAll("[data-start]")))=>{let p=H();for(let b of h){if(!(b instanceof HTMLElement))continue;if(b.hasAttribute("data-hidden")){nr.has(b)||(fi.set(b,b.style.getPropertyValue("display")),nr.add(b)),b.style.display="none",(b instanceof HTMLVideoElement||b instanceof HTMLImageElement)&&n?.setSourceVisibility(b,!1);continue}if(nr.has(b)){let N=fi.get(b);N?b.style.display=N:b.style.removeProperty("display"),fi.delete(b),nr.delete(b)}let A=W(b,d);if(A){let N=b.parentElement;for(;N&&N!==p;){if(N instanceof HTMLElement&&N.hasAttribute("data-start")&&!W(N,d)){A=!1;break}N=N.parentElement}}b.style.visibility=A?"visible":"hidden",(b instanceof HTMLVideoElement||b instanceof HTMLImageElement)&&n?.setSourceVisibility(b,A),A?Ia(b)&&b.style.removeProperty("display"):Ia(b)&&gf(b)&&(b.style.display="none")}},Oe=()=>{let d=Hs({shouldIncludeElement:p=>p.hasAttribute("data-start")||!!z(p).compositionRoot,resolveStartSeconds:p=>X(p),resolveDurationSeconds:p=>{let b=z(p),A=X(p),N=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,G=b.inheritedStart!=null&&b.inheritedDuration!=null&&b.inheritedDuration>0?Math.max(0,b.inheritedStart+b.inheritedDuration-A):null,J=Number.isFinite(p.duration)&&p.duration>N?Math.max(0,p.duration-N):null,U=Number.parseFloat(p.dataset.duration??""),se=Number.isFinite(U)&&U>0?U:null;return Os({isVideo:p.tagName==="VIDEO",sourceDuration:J,hostRemaining:G,explicitDuration:se})}});for(let p of d.mediaClips){let b=er.get(p.el);b&&(p.volumeKeyframes=b)}let h=e.mediaForceSyncNextTick;h&&(e.mediaForceSyncNextTick=!1),e.nativeMediaSyncDisabled||Gs({clips:d.mediaClips,timeSeconds:e.currentTime,playing:e.isPlaying,playbackRate:e.playbackRate,outputMuted:e.mediaOutputMuted||!e.webAudioMediaDisabled&&!e.nativeMediaSyncDisabled&&m.isActive(),userMuted:e.bridgeMuted,userVolume:e.bridgeVolume,forceSync:h,onElementVolume:(p,b)=>m.setElementVolume(p,b),isWebAudioOwned:p=>m.ownsElement(p),onAutoplayBlocked:()=>{e.mediaAutoplayBlockedPosted||(e.mediaAutoplayBlockedPosted=!0,xe({source:"hf-preview",type:"media-autoplay-blocked"}))}}),mi(e.currentTime)},Fe=d=>{let h=Math.max(0,Math.round((e.currentTime||0)*e.canonicalFps)),p=Date.now();(d||h!==e.bridgeLastPostedFrame||e.isPlaying!==e.bridgeLastPostedPlaying||e.bridgeMuted!==e.bridgeLastPostedMuted||p-e.bridgeLastPostedAt>=e.bridgeMaxPostIntervalMs)&&(e.bridgeLastPostedFrame=h,e.bridgeLastPostedPlaying=e.isPlaying,e.bridgeLastPostedMuted=e.bridgeMuted,e.bridgeLastPostedAt=p,xe({source:"hf-preview",type:"state",frame:h,isPlaying:e.isPlaying,muted:e.bridgeMuted,playbackRate:e.playbackRate}))},pi="",Pa=0,xf=()=>{let d="";for(let h of document.querySelectorAll("[data-start]"))d+=`${h.id}:${h.tagName}|`;return d},bt=()=>{j(),V(),O();let d=H();if(d){let b=L(d.getAttribute("data-width")),A=L(d.getAttribute("data-height")),N=b?parseInt(b,10):0,G=A?parseInt(A,10):0;N>0&&G>0&&xe({source:"hf-preview",type:"stage-size",width:N,height:G})}Zt();let h=Ml({canonicalFps:e.canonicalFps});window.__clipManifest=h;let p=xf();if(pi!==p&&bf(),!window.__clipTree||pi!==p){let b=window;window.__clipTree=Cl({startResolver:lt({timelineRegistry:b.__timelines??{},includeAuthoredTimingAttrs:!0}),timelineRegistry:b.__timelines??{},rootDuration:h.durationInFrames/e.canonicalFps}),pi=p}xe(h),df()},hi=d=>Number.isFinite(d)&&d>0?d:0,yf=d=>{let h=hi(Number(d));if(h<=0)return;let p=H(),b=hi(Number.parseFloat(p?.getAttribute("data-duration")??"")),A=Math.max(Pa,hi(c.getDuration()),b);h<=A||(Pa=h,p?.setAttribute("data-duration",String(h)),c.setDuration(h),bt(),Fe(!0))},He=(d,h=0)=>{for(let p of e.deterministicAdapters){try{d==="discover"&&p.discover(),d==="pause"&&p.pause(),d==="play"&&p.play&&p.play()}catch(b){M("runtime.init.site8",b)}if(d==="discover")try{p.seek({time:h,suppressEvents:!0})}catch(b){M("runtime.init.site9",b)}}},xt=()=>{window.__renderReady=!1},tn=null,nn=!0,Sf=()=>{let d=[];for(let h of e.deterministicAdapters){let p=h.getReadyPromise;if(typeof p=="function")try{let b=p();b&&d.push(b)}catch(b){M("runtime.init.adapterReady",b)}}return d},vf=()=>{let d=Sf();if(d.length===0)return tn=null,nn=!0,!0;let h=d[0];if(!h)return!0;let p=d.length===1?h:Promise.all(d);return p!==tn&&(tn=p,nn=!1,Promise.resolve(p).then(()=>{tn===p&&(nn=!0,xt())},b=>{tn===p&&(nn=!0,M("runtime.init.adapterReady",b),xt())})),nn};if(B)Ko();else{let d={injectedStyles:e.injectedCompStyles,injectedScripts:e.injectedCompScripts,injectedLinks:e.injectedCompLinks,parseDimensionPx:L,onDiagnostic:({code:h,details:p})=>{xe({source:"hf-preview",type:"diagnostic",code:h,details:p})}};Ec(d).then(()=>vc(d)).finally(()=>{B=!0,ui(),mf(),Ko(),ea(document),xt()})}let rr=yl({postMessage:d=>xe(d)});rr.installPickerApi(),mi(e.currentTime,Array.from(document.querySelectorAll("video[data-start], img[data-start]")));let qe=sd();n=qe,_(()=>{qe.destroy(),n=null});let gi=d=>{let h=Number(d);!Number.isFinite(h)||h<=0?e.playbackRate=1:e.playbackRate=Math.max(.1,Math.min(5,h)),e.mediaForceSyncNextTick=!0,e.capturedTimeline&&typeof e.capturedTimeline.timeScale=="function"&&e.capturedTimeline.timeScale(e.playbackRate);let p=document.querySelectorAll("video, audio");for(let b of p)if(b instanceof HTMLMediaElement)try{b.playbackRate=e.playbackRate}catch(A){M("runtime.init.site10",A)}},Oa={play:()=>{let d=e.capturedTimeline;if(c.isPlaying())return;let h=pe(d,0);if(h>0)c.setDuration(h),c.reachedEnd()&&(c.seek(0),e.currentTime=0,yt(0));else{let p=H(),b=Number(p?.getAttribute("data-duration")??0);b>0&&c.setDuration(b)}rt(d),c.play()&&(e.isPlaying=!0,e.mediaForceSyncNextTick=!0,Va(c.now()),f&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&za(),He("play"),Oe(),qe.redraw(),Fe(!0))},pause:()=>{if(!c.isPlaying())return;m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1,e.currentTime=c.now(),e.mediaForceSyncNextTick=!0,Va(e.currentTime);let d=e.capturedTimeline;rt(d),He("pause"),Oe(),qe.redraw(),Fe(!0)},seek:(d,h)=>{let p=Gt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource();let b=c.isPlaying();b&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0;let A=e.capturedTimeline;if(rt(A),yt(e.currentTime),He("pause"),h?.keepPlaying&&b){Oa.play();return}Oe(),qe.redraw(),Fe(!0)},renderSeek:(d,h)=>{Ma=!0;let p=Gt(Math.max(0,Number(d)||0),e.canonicalFps);m.stopAll(),c.detachAudioSource(),c.isPlaying()&&c.pause(),c.seek(p),e.currentTime=c.now(),e.isPlaying=!1,e.mediaForceSyncNextTick=!0,yt(e.currentTime,{activateChildren:!0,suppressEvents:h?.suppressEvents}),He("pause"),Oe(),qe.redraw(),Fe(!0)},getTime:()=>c.now(),getDuration:()=>{let d=c.getDuration();return Number.isFinite(d)?d:0},isPlaying:()=>c.isPlaying(),setPlaybackRate:d=>{gi(d),c.setRate(e.playbackRate),qa()},getPlaybackRate:()=>e.playbackRate},Ha=pe(e.capturedTimeline,0);Ha>0&&c.setDuration(Ha);let Ge=El({getTimeline:()=>e.capturedTimeline,setTimeline:d=>{e.capturedTimeline=d},getTimelineRegistry:()=>window.__timelines??{},getIsPlaying:()=>e.isPlaying,setIsPlaying:d=>{e.isPlaying!==d&&(e.mediaForceSyncNextTick=!0),e.isPlaying=d},getPlaybackRate:()=>e.playbackRate,setPlaybackRate:gi,getCanonicalFps:()=>e.canonicalFps,onSyncMedia:(d,h)=>{e.currentTime=Math.max(0,Number(d)||0),e.isPlaying!==h&&(e.mediaForceSyncNextTick=!0),e.isPlaying=h,Oe()},onStatePost:Fe,onDeterministicSeek:(d,h)=>{for(let p of e.deterministicAdapters)if(!(p.name==="gsap"&&e.capturedTimeline))try{p.seek({time:Number(d)||0,suppressEvents:h?.suppressEvents})}catch(b){M("runtime.init.site11",b)}},onDeterministicPause:()=>He("pause"),onDeterministicPlay:()=>He("play"),onRenderFrameSeek:()=>{qe.redraw()},onShowNativeVideos:()=>{},getSafeDuration:()=>pe(e.capturedTimeline,0),transport:Oa});window.__player=T(Ge),window.__playerReady=!0,Ne("composition_loaded",{duration:Ge.getDuration(),compositionId:document.querySelector("[data-composition-id]")?.getAttribute("data-composition-id")??null}),e.deterministicAdapters=[Es(),os({resolveStartSeconds:d=>Q(d,0)}),ss(),us(),fs(),ms(),ps(),hs(),gs(),bs(),xs(),as({getTimeline:()=>e.capturedTimeline})],Ss(),vs(),window.__hfReseekGpu=d=>{let h=Math.max(0,Number(d)||0);window.__hfThreeTime=h,window.__hfTypegpuTime=h,dr(h)},window.__hfWaitForSeekCompletion=Mi,o.push(()=>{window.__hfWaitForSeekCompletion===Mi&&delete window.__hfWaitForSeekCompletion}),ff(),ui(),He("discover");let Ef=()=>{let d=e.capturedTimeline,h=Zt();e.capturedTimeline&&(h||e.capturedTimeline!==d||!Ge._timeline)&&(Ge._timeline=e.capturedTimeline);let p=pe(e.capturedTimeline,0);if(p>0&&c.setDuration(p),He("discover",e.currentTime),!e.capturedTimeline){let b=window.__timelines??{},A=Object.keys(b).filter(N=>b[N]);if(A.length>0){let G=H()?.getAttribute("data-composition-id")??null;R("root_timeline_unbound_registry_present",{reason:G?"root data-composition-id has no matching key in window.__timelines":"root composition element has no data-composition-id attribute",rootCompositionId:G,registeredTimelineKeys:A},"root_timeline_unbound_registry_present"),console.warn("[hyperframes] Root timeline not bound \u2014 render will freeze at t=0. "+(G?`Root data-composition-id is "${G}" but window.__timelines has no such key. `:"Root composition element has no data-composition-id. ")+`Registered timeline keys: [${A.join(", ")}]. Register the root timeline under its data-composition-id (window.__timelines["${G??"<root-id>"}"] = tl).`)}}window.__renderReady=!0,bt(),Fe(!0)},Rt=null,Af=()=>{if(Rt)return;let d=()=>{window.removeEventListener("hf-timelines-built",d),Rt=null,xt()};Rt=d,window.addEventListener("hf-timelines-built",d)};_(()=>{Rt&&(window.removeEventListener("hf-timelines-built",Rt),Rt=null)}),xt=()=>{if(!B){window.__renderReady=!1;return}if(window.__hfTimelinesBuilding){window.__renderReady=!1,Af();return}if(He("discover",e.currentTime),!vf()){window.__renderReady=!1;return}Ef()},xt(),B&&setTimeout(()=>{xt()},0);let ir=0,bi=!1,Cf=(d,h,p,b)=>{try{let A=b?.suppressEvents===!0;rt(d),typeof d.totalTime=="function"?d.totalTime(h,A):d.seek(h,A)}catch(A){M(p,A)}},wf=(d,h)=>{let p=window.__timelines??{},b=H()?.getAttribute("data-composition-id")??null;for(let[A,N]of Object.entries(p)){if(!N||A===b)continue;let G=document.querySelector(`[data-composition-id="${CSS.escape(A)}"]`);if(!G)continue;let J=Q(G,0);if(!Number.isFinite(J))continue;let U=I(N),se=It(G)+Math.max(0,d-J)*je(G),Me=Math.max(0,U!=null&&U>0?Math.min(U,se):se);Cf(N,Me,"runtime.init.transport.childTimeline",h)}},Ga=d=>{let h=window.__timelines??{};for(let p of Object.values(h))if(!(!p||p===d))try{p.play()}catch(b){M("runtime.init.activateSiblings",b)}},Ba=d=>typeof d=="object"&&d!==null,rn=new WeakMap,_f=["onStart","onUpdate","onComplete","onReverseComplete","onRepeat"],Ua=(d,h)=>{let p=d[h];if(typeof p!="function")return null;try{let b=Number(p.call(d));return Number.isFinite(b)?b:null}catch(b){return M("runtime.init.gsapCallbackDuration",b),null}},Tf=d=>{let h=rn.get(d);if(h!=null)return h;if(!("getChildren"in d)||typeof d.getChildren!="function")return!1;let p;try{p=d.getChildren(!0,!0,!0)}catch(b){return M("runtime.init.gsapCallbackChildren",b),rn.set(d,!1),!1}if(!Array.isArray(p))return rn.set(d,!1),!1;for(let b of p){if(!Ba(b))continue;let A=b.vars;if(!Ba(A)||!_f.some(U=>typeof A[U]=="function"))continue;let J=Ua(b,"totalDuration")??Ua(b,"duration");if(J!=null&&J<=1e-6)return rn.set(d,!0),!0}return rn.set(d,!1),!1};function yt(d,h){let p=e.capturedTimeline,b=h?.suppressEvents===!0;if(p){h?.activateChildren&&Ga(p);let A=p,N=d;if(typeof A.totalDuration=="function")try{let G=Number(A.totalDuration());Number.isFinite(G)&&G>0&&d>G&&(N=G)}catch(G){M("runtime.init.transport.clampDuration",G)}try{typeof p.totalTime=="function"?(p.totalTime(N,b),!b&&!Tf(p)&&(p.totalTime(N+.001,!0),p.totalTime(N,!0))):p.seek(N,b)}catch(G){M("runtime.init.transport.seek",G)}}wf(d,h),p&&h?.activateChildren&&Ga(p);for(let A of e.deterministicAdapters)if(!(A.name==="gsap"&&p))try{A.seek({time:d,suppressEvents:b})}catch(N){M("runtime.init.transport.adapter",N)}}let Rf=()=>{try{return document.querySelector(`[${wd}]`)!=null}catch{return!1}},Wa=()=>{if(!(e.tornDown||bi)){bi=!0;try{if(e.transportRafId=window.requestAnimationFrame(Wa),ir+=1,_d({tick:ir,isPlaying:c.isPlaying(),hasCapturedTimeline:e.capturedTimeline!=null,currentTimeSeconds:c.now()})){let h=e.capturedTimeline;if(Zt()){e.capturedTimeline&&!Ge._timeline&&(Ge._timeline=e.capturedTimeline),e.capturedTimeline&&e.capturedTimeline!==h&&rt(e.capturedTimeline);let p=pe(e.capturedTimeline,0);p>0&&c.setDuration(p),bt()}}if(ir%20===0&&bt(),ir%30===0&&ui(),e.capturedTimeline){let h=pe(e.capturedTimeline,0);h>0&&(!c.isPlaying()||h>=c.getDuration())&&c.setDuration(h)}if(c.isPlaying()&&!e.mediaOutputMuted)if(!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&m.isActive()&&m.context){let h=m.getTime();h>=0&&c.attachAudioSource({currentTimeSeconds:h})}else{let h=document.querySelectorAll("audio[data-start]"),p=!1;for(let b of h){if(!(b instanceof HTMLMediaElement)||!b.isConnected)continue;let A=Number.parseFloat(b.dataset.start??""),N=Number.parseFloat(b.dataset.duration??""),G=Number.isFinite(N)&&N>0?A+N:1/0,J=Number.parseFloat(b.dataset.playbackStart??b.dataset.mediaStart??"0")||0;if(Number.isFinite(A)&&e.currentTime>=A&&e.currentTime<G){b.paused?!b.error&&b.readyState<HTMLMediaElement.HAVE_FUTURE_DATA&&(c.attachAudioSource({currentTimeSeconds:e.currentTime}),p=!0):(c.attachAudioSource({el:b,compositionStart:A,mediaStart:J}),p=!0);break}}!p&&c.hasAudioSource()&&c.detachAudioSource()}else c.hasAudioSource()&&c.detachAudioSource();let d=c.now();if(e.currentTime=d,(c.isPlaying()||!Rf())&&yt(d),c.isPlaying()&&qe.redrawAnimated(),c.isPlaying()&&c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,yt(h)),He("pause"),Oe(),Fe(!0);return}c.isPlaying()&&Oe(),Fe(!1)}finally{bi=!1}}},Va=d=>{let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let b=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(b))continue;let A=Number.parseFloat(p.dataset.duration??""),N=Number.isFinite(A)&&A>0?b+A:1/0;if(d<b||d>=N)continue;let G=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,J=d-b+G;if(J>=0)try{p.currentTime=J}catch{}}},za=()=>{if(e.nativeMediaSyncDisabled||e.webAudioMediaDisabled)return;let d=m.startGeneration(),h=document.querySelectorAll("audio[data-start]");for(let p of h){if(!(p instanceof HTMLMediaElement)||!p.isConnected)continue;let b=Number.parseFloat(p.dataset.start??"");if(!Number.isFinite(b))continue;let A=Number.parseFloat(p.dataset.playbackStart??p.dataset.mediaStart??"0")||0,N=Number.parseFloat(p.dataset.volume??""),G=Number.isFinite(N)?N:1,J=Number.parseFloat(p.dataset.duration??""),U=Number.isFinite(J)&&J>0?J:Number.POSITIVE_INFINITY,se=p.closest("[data-composition-id]");if(se){let Me=Q(se,0),ie=we(se,{includeAuthoredTimingAttrs:!0});ie!=null&&ie>0&&(U=Math.min(U,Math.max(0,Me+ie-b)))}m.decodeAudioElement(p).then(Me=>{!Me||!c.isPlaying()||m.schedulePlayback(p,Me,b,A,c.now(),G*e.bridgeVolume,d,e.playbackRate,U)})}};function qa(){m.setRate(e.playbackRate)&&!e.nativeMediaSyncDisabled&&!e.webAudioMediaDisabled&&f&&c.isPlaying()&&m.hasBoundedActiveSources()&&(m.stopAll(),za())}if(e.capturedTimeline){let d=pe(e.capturedTimeline,0);d>0&&c.setDuration(d),rt(e.capturedTimeline)}Rc(window),e.transportRafId=window.requestAnimationFrame(Wa),bt(),Fe(!0),e.controlBridgeHandler=Ya({onPlay:()=>{Ge.play(),Ne("composition_played",{time:Ge.getTime()})},onPause:()=>{Ge.pause(),Ne("composition_paused",{time:Ge.getTime()})},onStopMedia:()=>{m.stopAll();let d=document.querySelectorAll("video, audio");for(let h of d)h instanceof HTMLMediaElement&&!h.paused&&h.pause()},onSeek:(d,h)=>{Ge.seek(d),Ne("composition_seeked",{time:d})},onSetMuted:d=>{e.bridgeMuted=d;let h=d||e.mediaOutputMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let b of p)b instanceof HTMLMediaElement&&(b.muted=h||b.defaultMuted)},onSetVolume:d=>{e.bridgeVolume=d,m.setVolume(d);let h=document.querySelectorAll("video, audio");for(let p of h){if(!(p instanceof HTMLMediaElement))continue;let b=parseFloat(p.dataset.volume??""),A=Number.isFinite(b)?b:1;p.volume=A*d}},onSetMediaOutputMuted:d=>{e.mediaOutputMuted=d;let h=d||e.bridgeMuted;m.setMuted(h);let p=document.querySelectorAll("video, audio");for(let b of p)b instanceof HTMLMediaElement&&(b.muted=h||b.defaultMuted)},onSetNativeMediaSyncDisabled:d=>{e.nativeMediaSyncDisabled!==d&&(e.nativeMediaSyncDisabled=d,e.mediaForceSyncNextTick=!0,d?(m.stopAll(),c.detachAudioSource()):Oe())},onSetWebAudioMediaDisabled:d=>{e.webAudioMediaDisabled!==d&&(e.webAudioMediaDisabled=d,e.mediaForceSyncNextTick=!0,d&&(m.stopAll(),c.detachAudioSource()),Oe())},onSetPlaybackRate:d=>{gi(d),e.transportClock&&e.transportClock.setRate(e.playbackRate),qa()},onSetRootDuration:yf,onSetColorGrading:(d,h)=>{qe.setGrading(d,h)},onSetColorGradingCompare:(d,h)=>{qe.setCompare(d,h)},onTick:()=>{if(e.tornDown||!c.isPlaying())return;let d=c.now();if(e.currentTime=d,yt(d),c.reachedEnd()){m.stopAll(),c.detachAudioSource(),c.pause(),e.isPlaying=!1;let h=c.getDuration();Number.isFinite(h)&&(c.seek(h),e.currentTime=h,yt(h)),He("pause"),Oe(),Fe(!0)}},onEnablePickMode:()=>rr.enablePickMode(),onDisablePickMode:()=>rr.disablePickMode(),getCanonicalFps:()=>e.canonicalFps});let xi=()=>{if(!e.tornDown){e.tornDown=!0,e.transportRafId!=null&&(window.cancelAnimationFrame(e.transportRafId),e.transportRafId=null),e.transportClock=null,m.destroy(),gt!=null&&(window.clearTimeout(gt),gt=null),l!=null&&(window.cancelAnimationFrame(l),l=null),hf(),e.controlBridgeHandler&&(window.removeEventListener("message",e.controlBridgeHandler),e.controlBridgeHandler=null),r&&(window.removeEventListener("error",r),r=null),i&&(window.removeEventListener("unhandledrejection",i),i=null),e.beforeUnloadHandler&&(window.removeEventListener("beforeunload",e.beforeUnloadHandler),e.beforeUnloadHandler=null),rr.disablePickMode();for(let d of e.deterministicAdapters)if(!(!d||typeof d.revert!="function"))try{d.revert()}catch(h){M("runtime.init.site12",h)}e.deterministicAdapters=[];for(let d of o.splice(0))try{d()}catch(h){M("runtime.init.site13",h)}for(let d of e.injectedCompStyles)try{d.remove()}catch(h){M("runtime.init.site14",h)}e.injectedCompStyles=[];for(let d of e.injectedCompLinks)try{d.remove()}catch(h){M("runtime.init.site15",h)}e.injectedCompLinks=[];for(let d of e.injectedCompScripts)try{d.remove()}catch(h){M("runtime.init.site16",h)}e.injectedCompScripts=[],e.capturedTimeline=null,window.__hfRuntimeTeardown===xi&&(window.__hfRuntimeTeardown=null)}};window.__hfRuntimeTeardown=xi,e.beforeUnloadHandler=xi,window.addEventListener("beforeunload",e.beforeUnloadHandler)}var Pd=["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"],Ea=[[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 Xb(e){if(e<=255)return Pd[e];let t=0,n=Ea.length-1;for(;t<=n;){let r=t+n>>1,i=Ea[r];if(e<i[0]){n=r-1;continue}if(e>i[1]){t=r+1;continue}return i[2]}return"L"}function Jb(e){let t=e.length;if(t===0)return null;let n=new Array(t),r=!1;for(let u=0;u<t;){let c=e.charCodeAt(u),m=c,f=1;if(c>=55296&&c<=56319&&u+1<t){let x=e.charCodeAt(u+1);x>=56320&&x<=57343&&(m=(c-55296<<10)+(x-56320)+65536,f=2)}let g=Xb(m);(g==="R"||g==="AL"||g==="AN")&&(r=!0);for(let x=0;x<f;x++)n[u+x]=g;u+=f}if(!r)return null;let i=0;for(let u=0;u<t;u++){let c=n[u];if(c==="L"){i=0;break}if(c==="R"||c==="AL"){i=1;break}}let o=new Int8Array(t);for(let u=0;u<t;u++)o[u]=i;let a=i&1?"R":"L",l=a,s=l;for(let u=0;u<t;u++)n[u]==="NSM"?n[u]=s:s=n[u];s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="AL"?"AN":"EN":(c==="R"||c==="L"||c==="AL")&&(s=c)}for(let u=0;u<t;u++)n[u]==="AL"&&(n[u]="R");for(let u=1;u<t-1;u++)n[u]==="ES"&&n[u-1]==="EN"&&n[u+1]==="EN"&&(n[u]="EN"),n[u]==="CS"&&(n[u-1]==="EN"||n[u-1]==="AN")&&n[u+1]===n[u-1]&&(n[u]=n[u-1]);for(let u=0;u<t;u++){if(n[u]!=="EN")continue;let c;for(c=u-1;c>=0&&n[c]==="ET";c--)n[c]="EN";for(c=u+1;c<t&&n[c]==="ET";c++)n[c]="EN"}for(let u=0;u<t;u++){let c=n[u];(c==="WS"||c==="ES"||c==="ET"||c==="CS")&&(n[u]="ON")}s=l;for(let u=0;u<t;u++){let c=n[u];c==="EN"?n[u]=s==="L"?"L":"EN":(c==="R"||c==="L")&&(s=c)}for(let u=0;u<t;u++){if(n[u]!=="ON")continue;let c=u+1;for(;c<t&&n[c]==="ON";)c++;let m=u>0?n[u-1]:l,f=c<t?n[c]:l,g=m!=="L"?"R":"L";if(g===(f!=="L"?"R":"L"))for(let v=u;v<c;v++)n[v]=g;u=c-1}for(let u=0;u<t;u++)n[u]==="ON"&&(n[u]=a);for(let u=0;u<t;u++){let c=n[u];(o[u]&1)===0?c==="R"?o[u]++:(c==="AN"||c==="EN")&&(o[u]+=2):(c==="L"||c==="AN"||c==="EN")&&o[u]++}return o}function Od(e,t){let n=Jb(e);if(n===null)return null;let r=new Int8Array(t.length);for(let i=0;i<t.length;i++)r[i]=n[t[i]];return r}var Qb=/[ \t\n\r\f]+/g,Zb=/[\t\n\r\f]| {2,}|^ | $/;function ex(e){let t=e??"normal";return t==="pre-wrap"?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}function tx(e){if(!Zb.test(e))return e;let t=e.replace(Qb," ");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 nx(e){return/[\r\f]/.test(e)?e.replace(/\r\n/g,`
|
|
354
564
|
`).replace(/[\r\f]/g,`
|
|
355
565
|
`):e.replace(/\r\n/g,`
|
|
356
|
-
`)}var
|
|
357
|
-
`)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 Fg=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function De(e){return e.length===1?e[0]:e.join("")}function Lg(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),De(n)}function Ng(e,t,n,r){if(!Fg.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=Rg(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:De(a),isWordLike:s,kind:o,start:l}),i}function Vo(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var kg=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Mg(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:kg.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function Dg(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Ig(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!Mg(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Vo(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=De(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function Pg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!Dg(a))continue;let l=o+1;if(l>=e.len||Vo(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!Vo(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(De(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var Og=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Dc=/^[A-Za-z0-9_]+[,:;]*$/,Ic=/[,:;]+$/;function Hc(e){for(let t of e)if(Oc.test(t))return!0;return!1}function Pn(e){if(e.length===0)return!1;for(let t of e)if(!(Oc.test(t)||Og.has(t)))return!1;return!0}function Gg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&Pn(a)&&Hc(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Pn(e.texts[u]);)s.push(e.texts[u]),u++;t.push(De(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Hg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Dc.test(a)){let u=[a],c=Ic.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&Dc.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=Ic.test(f),m++}t.push(De(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Bg(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!Hc(c)||!Pn(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Ug(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=De(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=De(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(De(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Wg(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!We(t[o])||!We(t[o+1]))continue;let a=_g(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Pc(e,t,n){let r=fg(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],x=[],v=[],C=[],y=[];for(let _ of r.segment(e))for(let b of Ng(_.segment,_.isWordLike??!1,_.index,n)){let J=function(){c[H]!==null&&(a[H]=[kc(o,c,m,H)],c[H]=null),a[H].push(b.text),l[H]=l[H]||b.isWordLike,f[H]=f[H]||R,x[H]=x[H]||N,v[H]=U,C[H]=ne,y[H]=Mc(x[H],G)},S=b.kind==="text",A=Ag(b.text,b.isWordLike,b.kind),R=We(b.text),N=Lc(b.text),G=Gr(b.text),U=Hr(b.text),ne=wg(b.text),H=i-1;t.carryCJKAfterClosingQuote&&S&&i>0&&s[H]==="text"&&R&&f[H]&&v[H]||S&&i>0&&s[H]==="text"&&Eg(b.text)&&f[H]||S&&i>0&&s[H]==="text"&&C[H]?J():S&&i>0&&s[H]==="text"&&b.isWordLike&&N&&y[H]?(J(),l[H]=!0):A!==null&&i>0&&s[H]==="text"&&c[H]===A?m[H]=(m[H]??1)+1:S&&!b.isWordLike&&i>0&&s[H]==="text"&&(vg(b.text)||b.text==="-"&&l[H])?J():(o[i]=b.text,a[i]=[b.text],l[i]=b.isWordLike,s[i]=b.kind,u[i]=b.start,c[i]=A,m[i]=A===null?0:1,f[i]=R,x[i]=N,v[i]=U,C[i]=ne,y[i]=Mc(N,G),i++)}for(let _=0;_<i;_++){if(c[_]!==null){o[_]=kc(o,c,m,_);continue}o[_]=De(a[_])}for(let _=1;_<i;_++)s[_]==="text"&&!l[_]&&$o(o[_])&&s[_-1]==="text"&&(o[_-1]+=o[_],l[_-1]=l[_-1]||l[_],o[_]="");let w=Array.from({length:i},()=>null),T=-1;for(let _=i-1;_>=0;_--){let b=o[_];if(b.length!==0){if(s[_]==="text"&&!l[_]&&Cg(b)&&T>=0&&s[T]==="text"){let S=w[T]??[];S.push(b),w[T]=S,u[T]=u[_],o[_]="";continue}T=_}}for(let _=0;_<i;_++){let b=w[_];b!=null&&(o[_]=Lg(b,o[_]))}let k=0;for(let _=0;_<i;_++){let b=o[_];b.length!==0&&(k!==_&&(o[k]=b,l[k]=l[_],s[k]=s[_],u[k]=u[_]),k++)}o.length=k,l.length=k,s.length=k,u.length=k;let D=Ug({len:k,texts:o,isWordLike:l,kinds:s,starts:u}),P=Wg(Hg(Bg(Gg(Pg(Ig(D))))));for(let _=0;_<P.len-1;_++){let b=Tg(P.texts[_]);b!==null&&(P.kinds[_]!=="space"&&P.kinds[_]!=="preserved-space"||P.kinds[_+1]!=="text"||!Lc(P.texts[_+1])||(P.texts[_]=b.space,P.isWordLike[_]=!1,P.kinds[_]=P.kinds[_]==="preserved-space"?"preserved-space":"space",P.texts[_+1]=b.marks+P.texts[_+1],P.starts[_+1]=P.starts[_]+b.space.length))}return P}function Vg(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 i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function zg(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(De(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],x=e.kinds[m],v=e.isWordLike[m],C=e.starts[m];if(x==="text"){let y=gg(f),w=Pr(f);if(o!==null&&s&&u){o.push(f),a=a||v,s=s||y,u=w;continue}c(),o=[f],a=v,l=C,s=y,u=w;continue}c(),t.push(f),n.push(v),r.push(x),i.push(C)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Bc(e,t,n="normal",r="normal"){let i=lg(n),o=i.mode==="pre-wrap"?cg(e):ug(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?zg(Pc(o,t,i)):Pc(o,t,i);return{normalized:o,chunks:Vg(a,i),...a}}var Vt=null,Uc=new Map,zt=null,$g=96,qg=/\p{Emoji_Presentation}/u,jg=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,qo=null,Wc=new Map;function jo(){if(Vt!==null)return Vt;if(typeof OffscreenCanvas<"u")return Vt=new OffscreenCanvas(1,1).getContext("2d"),Vt;if(typeof document<"u")return Vt=document.createElement("canvas").getContext("2d"),Vt;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Kg(e){let t=Uc.get(e);return t||(t=new Map,Uc.set(e,t)),t}function tt(e,t){let n=t.get(e);return n===void 0&&(n={width:jo().measureText(e).width,containsCJK:We(e)},t.set(e,n)),n}function $t(){if(zt!==null)return zt;if(typeof navigator>"u")return zt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},zt;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 zt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},zt}function Yg(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Vc(){return qo===null&&(qo=new Intl.Segmenter(void 0,{granularity:"grapheme"})),qo}function Xg(e){return qg.test(e)||e.includes("\uFE0F")}function zc(e){return jg.test(e)}function Jg(e,t){let n=Wc.get(e);if(n!==void 0)return n;let r=jo();r.font=e;let i=r.measureText("\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return Wc.set(e,n),n}function Qg(e){let t=0,n=Vc();for(let r of n.segment(e))Xg(r.segment)&&t++;return t}function Zg(e,t){return t.emojiCount===void 0&&(t.emojiCount=Qg(e)),t.emojiCount}function dt(e,t,n){return n===0?t.width:t.width-Zg(e,t)*n}function $c(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Vc(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=tt(m,n);c.push(dt(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>$g){let c=[],m=null,f=0;for(let x of a){let v=tt(x,n),C=dt(x,v,r);if(m===null)c.push(C);else{let y=m+x,w=tt(y,n);c.push(dt(y,w,r)-f)}m=x,f=C}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=tt(s,n),f=dt(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function qc(e,t){let n=jo();n.font=e;let r=Kg(e),i=Yg(e),o=t?Jg(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function ex(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 tx(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function nx(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function jc(e,t){return e.simpleLineWalkFastPath?Kc(e,t):Yc(e,t)}function Kc(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=$t().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,x=0,v=0,C=0,y=-1,w=0;function T(){y=-1,w=0}function k(A=v,R=C,N=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:x,endSegmentIndex:A,endGraphemeIndex:R,width:N}),c=0,m=!1,T()}function D(A,R){m=!0,f=A,x=0,v=A+1,C=0,c=R}function P(A,R,N){m=!0,f=A,x=R,v=A,C=R+1,c=N}function _(A,R){if(!m){D(A,R);return}c+=R,v=A+1,C=0}function b(A,R){let N=o[A];for(let G=R;G<N.length;G++){let U=N[G];m?c+U>s?(k(),P(A,G,U)):(c+=U,v=A,C=G+1):P(A,G,U)}m&&v===A&&C===N.length&&(v=A+1,C=0)}let S=0;for(;S<r.length&&!(!m&&(S=ex(e,S),S>=r.length));){let A=r[S],R=i[S],N=R==="space"||R==="preserved-space"||R==="tab"||R==="zero-width-break"||R==="soft-hyphen";if(!m){A>t&&o[S]!==null?b(S,0):D(S,A),N&&(y=S+1,w=c-A),S++;continue}if(c+A>s){if(N){_(S,A),k(S+1,0,c-A),S++;continue}if(y>=0){if(v>y||v===y&&C>0){k();continue}k(y,0,w);continue}if(A>t&&o[S]!==null){k(),b(S,0),S++;continue}k();continue}_(S,A),N&&(y=S+1,w=c-A),S++}return m&&k(),u}function Yc(e,t,n){if(e.simpleLineWalkFastPath)return Kc(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=$t(),f=m.lineFitEpsilon,x=t+f,v=0,C=0,y=!1,w=0,T=0,k=0,D=0,P=-1,_=0,b=0,S=null;function A(){P=-1,_=0,b=0,S=null}function R(z=k,Y=D,V=C){v++,n?.({startSegmentIndex:w,startGraphemeIndex:T,endSegmentIndex:z,endGraphemeIndex:Y,width:V}),C=0,y=!1,A()}function N(z,Y){y=!0,w=z,T=0,k=z+1,D=0,C=Y}function G(z,Y,V){y=!0,w=z,T=Y,k=z,D=Y+1,C=V}function U(z,Y){if(!y){N(z,Y);return}C+=Y,k=z+1,D=0}function ne(z,Y,V,ee){if(!Y)return;let Ae=z==="tab"?0:i[V],B=z==="tab"?ee:o[V];P=V+1,_=C-ee+Ae,b=C-ee+B,S=z}function H(z,Y){let V=l[z];for(let ee=Y;ee<V.length;ee++){let Ae=V[ee];y?C+Ae>x?(R(),G(z,ee,Ae)):(C+=Ae,k=z,D=ee+1):G(z,ee,Ae)}y&&k===z&&D===V.length&&(k=z+1,D=0)}function J(z){if(S!=="soft-hyphen")return!1;let Y=l[z];if(Y==null)return!1;let{fitCount:V,fittedWidth:ee}=nx(Y,C,t,f,s);return V===0?!1:(C=ee,k=z,D=V,A(),V===Y.length?(k=z+1,D=0,!0):(R(z,V,ee+s),H(z,V),!0))}function _e(z){v++,n?.({startSegmentIndex:z.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:z.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),A()}for(let z=0;z<c.length;z++){let Y=c[z];if(Y.startSegmentIndex===Y.endSegmentIndex){_e(Y);continue}y=!1,C=0,w=Y.startSegmentIndex,T=0,k=Y.startSegmentIndex,D=0,A();let V=Y.startSegmentIndex;for(;V<Y.endSegmentIndex;){let ee=a[V],Ae=ee==="space"||ee==="preserved-space"||ee==="tab"||ee==="zero-width-break"||ee==="soft-hyphen",B=ee==="tab"?tx(C,u):r[V];if(ee==="soft-hyphen"){y&&(k=V+1,D=0,P=V+1,_=C+s,b=C+s,S=ee),V++;continue}if(!y){B>t&&l[V]!==null?H(V,0):N(V,B),ne(ee,Ae,V,B),V++;continue}if(C+B>x){let I=C+(ee==="tab"?0:i[V]),ue=C+(ee==="tab"?B:o[V]);if(S==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&_<=x){R(P,0,b);continue}if(S==="soft-hyphen"&&J(V)){V++;continue}if(Ae&&I<=x){U(V,B),R(V+1,0,ue),V++;continue}if(P>=0&&_<=x){if(k>P||k===P&&D>0){R();continue}let ae=P;R(ae,0,b),V=ae;continue}if(B>t&&l[V]!==null){R(),H(V,0),V++;continue}R();continue}U(V,B),ne(ee,Ae,V,B),V++}if(y){let ee=P===Y.consumedEndSegmentIndex?b:C;R(Y.consumedEndSegmentIndex,0,ee)}}return v}var Ko=null;function rx(){return Ko===null&&(Ko=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ko}function ix(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 ox(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,x){r=[m],i=f,o=x,a=Hr(m),l=On.has(m)}function c(m,f){r.push(m),o=o||f;let x=Hr(m);m.length===1&&ct.has(m)?a=a||x:a=x,l=!1}for(let m of rx().segment(e)){let f=m.segment,x=We(f);if(r.length===0){u(f,m.index,x);continue}if(l||Or.has(f)||ct.has(f)||t.carryCJKAfterClosingQuote&&x&&a){c(f,x);continue}if(!o&&!x){c(f,x);continue}s(),u(f,m.index,x)}return s(),n}function ax(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=We(e[0].text),o=Pr(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],u=We(s.text),c=Pr(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function sx(e,t,n,r){let i=$t(),{cache:o,emojiCorrection:a}=qc(t,zc(e.normalized)),l=dt("-",tt("-",o),a),u=dt(" ",tt(" ",o),a)*8;if(e.len===0)return ix(n);let c=[],m=[],f=[],x=[],v=e.chunks.length<=1,C=n?[]:null,y=[],w=n?[]:null,T=Array.from({length:e.len});function k(b,S,A,R,N,G,U){N!=="text"&&N!=="space"&&N!=="zero-width-break"&&(v=!1),c.push(S),m.push(A),f.push(R),x.push(N),C?.push(G),y.push(U),w!==null&&w.push(b)}function D(b,S,A,R,N){let G=tt(b,o),U=dt(b,G,a),ne=S==="space"||S==="preserved-space"||S==="zero-width-break"?0:U,H=S==="space"||S==="zero-width-break"?0:U;if(N&&R&&b.length>1){let J="sum-graphemes";Pn(b)?J="pair-context":i.preferPrefixWidthsForBreakableRuns&&(J="segment-prefixes");let _e=$c(b,G,o,a,J);k(b,U,ne,H,S,A,_e);return}k(b,U,ne,H,S,A,null)}for(let b=0;b<e.len;b++){T[b]=c.length;let S=e.texts[b],A=e.isWordLike[b],R=e.kinds[b],N=e.starts[b];if(R==="soft-hyphen"){k(S,0,l,l,R,N,null);continue}if(R==="hard-break"){k(S,0,0,0,R,N,null);continue}if(R==="tab"){k(S,0,0,0,R,N,null);continue}let G=tt(S,o);if(R==="text"&&G.containsCJK){let U=ox(S,i),ne=r==="keep-all"?ax(U):U;for(let H=0;H<ne.length;H++){let J=ne[H];D(J.text,"text",N+J.start,A,r==="keep-all"||!We(J.text))}continue}D(S,R,N,A,!0)}let P=lx(e.chunks,T,c.length),_=C===null?null:Fc(e.normalized,C);return w!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:v,segLevels:_,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P,segments:w}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:x,simpleLineWalkFastPath:v,segLevels:_,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:P}}function lx(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function ux(e,t,n,r){let i=r?.wordBreak??"normal",o=Bc(e,$t(),r?.whiteSpace,i);return sx(o,t,n,i)}function Xc(e,t,n){return ux(e,t,!1,n)}function Jc(e,t,n){let r=jc(e,t);return{lineCount:r,height:r*n}}var cx={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function Qc(e,t){let n={...cx,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=Xc(e,o),{lineCount:l}=Jc(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};Ku();window.__hyperframes={fitTextFontSize:Qc,getVariables:ba};function Zc(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Tc())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Zc,{once:!0}):Zc();})();
|
|
566
|
+
`)}var Aa=null,rx;function ix(){return Aa===null&&(Aa=new Intl.Segmenter(rx,{granularity:"word"})),Aa}var ox=/\p{Script=Arabic}/u,ii=/\p{M}/u,qd=/\p{Nd}/u;function Hd(e){return ox.test(e)}function Gd(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 Ve(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 i=(n-55296<<10)+(r-56320)+65536;if(Gd(i))return!0;t++;continue}}if(Gd(n))return!0}}return!1}function ax(e){let t=si(e);return t!==null&&(ai.has(t)||pt.has(t))}var sx=new Set(["\xA0","\u202F","\u2060","\uFEFF"]);function lx(e){return Ve(e)}function ux(e){let t=si(e);return t!==null&&sx.has(t)}function oi(e){return!ax(e)&&!ux(e)}var ai=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"]),Zn=new Set(['"',"(","[","{","\u201C","\u2018","\xAB","\u2039","\uFF08","\u3014","\u3008","\u300A","\u300C","\u300E","\u3010","\u3016","\u3018","\u301A"]),wa=new Set(["'","\u2019"]),pt=new Set([".",",","!","?",":",";","\u060C","\u061B","\u061F","\u0964","\u0965","\u104A","\u104B","\u104C","\u104D","\u104F",")","]","}","%",'"',"\u201D","\u2019","\xBB","\u203A","\u2026"]),cx=new Set([":",".","\u060C","\u061B"]),dx=new Set(["\u104F"]),fx=new Set(["\u201D","\u2019","\xBB","\u203A","\u300D","\u300F","\u3011","\u300B","\u3009","\u3015","\uFF09"]);function mx(e){if(_a(e))return!0;let t=!1;for(let n of e){if(pt.has(n)){t=!0;continue}if(!(t&&ii.test(n)))return!1}return t}function px(e){for(let t of e)if(!ai.has(t)&&!pt.has(t))return!1;return e.length>0}function hx(e){if(_a(e))return!0;for(let t of e)if(!Zn.has(t)&&!wa.has(t)&&!ii.test(t))return!1;return e.length>0}function _a(e){let t=!1;for(let n of e)if(!(n==="\\"||ii.test(n))){if(Zn.has(n)||pt.has(n)||wa.has(n)){t=!0;continue}return!1}return t}function $d(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 i=n-1;if(i<0)return n;let o=e.charCodeAt(i);return o>=55296&&o<=56319?i:n}function si(e){if(e.length===0)return null;let t=$d(e,e.length);return e.slice(t)}function gx(e){let t=Array.from(e),n=t.length;for(;n>0;){let r=t[n-1];if(ii.test(r)){n--;continue}if(Zn.has(r)||wa.has(r)){n--;continue}break}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function bx(e,t,n){return n==="text"&&!t&&e.length===1&&e!=="-"&&e!=="\u2014"?e:null}function Bd(e,t,n,r){let i=t[r],o=e[r];if(i==null)return o;let a=n[r];if(o.length===a)return o;let l=i.repeat(a);return e[r]=l,l}function Ud(e,t){return e&&t!==null&&cx.has(t)}function xx(e){let t=si(e);return t!==null&&dx.has(t)}function yx(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 li(e){let t=e.length;for(;t>0;){let n=$d(e,t),r=e.slice(n,t);if(fx.has(r))return!0;if(!pt.has(r))return!1;t=n}return!1}function Sx(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===`
|
|
567
|
+
`)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 vx=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Ie(e){return e.length===1?e[0]:e.join("")}function Ex(e,t){let n=[];for(let r=e.length-1;r>=0;r--)n.push(e[r]);return n.push(t),Ie(n)}function Ax(e,t,n,r){if(!vx.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];let i=[],o=null,a=[],l=n,s=!1,u=0;for(let c of e){let m=Sx(c,r),f=m==="text"&&t;if(o!==null&&m===o&&f===s){a.push(c),u+=c.length;continue}o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),o=m,a=[c],l=n+u,s=f,u+=c.length}return o!==null&&i.push({text:Ie(a),isWordLike:s,kind:o,start:l}),i}function Ca(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}var Cx=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function wx(e,t){let n=e.texts[t];return n.startsWith("www.")?!0:Cx.test(n)&&t+1<e.len&&e.kinds[t+1]==="text"&&e.texts[t+1]==="//"}function _x(e){return e.includes("?")&&(e.includes("://")||e.startsWith("www."))}function Tx(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let a=0;a<e.len;a++){if(r[a]!=="text"||!wx(e,a))continue;let l=[t[a]],s=a+1;for(;s<e.len&&!Ca(r[s]);){l.push(t[s]),n[a]=!0;let u=t[s].includes("?");if(r[s]="text",t[s]="",s++,u)break}t[a]=Ie(l)}let o=0;for(let a=0;a<t.length;a++){let l=t[a];l.length!==0&&(o!==a&&(t[o]=l,n[o]=n[a],r[o]=r[a],i[o]=i[a]),o++)}return t.length=o,n.length=o,r.length=o,i.length=o,{len:o,texts:t,isWordLike:n,kinds:r,starts:i}}function Rx(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o]),!_x(a))continue;let l=o+1;if(l>=e.len||Ca(e.kinds[l]))continue;let s=[],u=e.starts[l],c=l;for(;c<e.len&&!Ca(e.kinds[c]);)s.push(e.texts[c]),c++;s.length>0&&(t.push(Ie(s)),n.push(!0),r.push("text"),i.push(u),o=c-1)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}var kx=new Set([":","-","/","\xD7",",",".","+","\u2013","\u2014"]),Wd=/^[A-Za-z0-9_]+[,:;]*$/,Vd=/[,:;]+$/;function jd(e){for(let t of e)if(qd.test(t))return!0;return!1}function Qn(e){if(e.length===0)return!1;for(let t of e)if(!(qd.test(t)||kx.has(t)))return!1;return!0}function Fx(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o];if(l==="text"&&Qn(a)&&jd(a)){let s=[a],u=o+1;for(;u<e.len&&e.kinds[u]==="text"&&Qn(e.texts[u]);)s.push(e.texts[u]),u++;t.push(Ie(s)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=u-1;continue}t.push(a),n.push(e.isWordLike[o]),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Mx(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o],l=e.kinds[o],s=e.isWordLike[o];if(l==="text"&&s&&Wd.test(a)){let u=[a],c=Vd.test(a),m=o+1;for(;c&&m<e.len&&e.kinds[m]==="text"&&e.isWordLike[m]&&Wd.test(e.texts[m]);){let f=e.texts[m];u.push(f),c=Vd.test(f),m++}t.push(Ie(u)),n.push(!0),r.push("text"),i.push(e.starts[o]),o=m-1;continue}t.push(a),n.push(s),r.push(l),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Nx(e){let t=[],n=[],r=[],i=[];for(let o=0;o<e.len;o++){let a=e.texts[o];if(e.kinds[o]==="text"&&a.includes("-")){let l=a.split("-"),s=l.length>1;for(let u=0;u<l.length;u++){let c=l[u];if(!s)break;(c.length===0||!jd(c)||!Qn(c))&&(s=!1)}if(s){let u=0;for(let c=0;c<l.length;c++){let m=l[c],f=c<l.length-1?`${m}-`:m;t.push(f),n.push(!0),r.push("text"),i.push(e.starts[o]+u),u+=f.length}continue}}t.push(a),n.push(e.isWordLike[o]),r.push(e.kinds[o]),i.push(e.starts[o])}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Lx(e){let t=[],n=[],r=[],i=[],o=0;for(;o<e.len;){let a=[e.texts[o]],l=e.isWordLike[o],s=e.kinds[o],u=e.starts[o];if(s==="glue"){let c=[a[0]],m=u;for(o++;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let f=Ie(c);if(o<e.len&&e.kinds[o]==="text")a[0]=f,a.push(e.texts[o]),l=e.isWordLike[o],s="text",u=m,o++;else{t.push(f),n.push(!1),r.push("glue"),i.push(m);continue}}else o++;if(s==="text")for(;o<e.len&&e.kinds[o]==="glue";){let c=[];for(;o<e.len&&e.kinds[o]==="glue";)c.push(e.texts[o]),o++;let m=Ie(c);if(o<e.len&&e.kinds[o]==="text"){a.push(m,e.texts[o]),l=l||e.isWordLike[o],o++;continue}a.push(m)}t.push(Ie(a)),n.push(l),r.push(s),i.push(u)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Dx(e){let t=e.texts.slice(),n=e.isWordLike.slice(),r=e.kinds.slice(),i=e.starts.slice();for(let o=0;o<t.length-1;o++){if(r[o]!=="text"||r[o+1]!=="text"||!Ve(t[o])||!Ve(t[o+1]))continue;let a=gx(t[o]);a!==null&&(t[o]=a.head,t[o+1]=a.tail+t[o+1],i[o+1]=i[o]+a.head.length)}return{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function zd(e,t,n){let r=ix(),i=0,o=[],a=[],l=[],s=[],u=[],c=[],m=[],f=[],g=[],x=[],v=[],y=[];for(let C of r.segment(e))for(let S of Ax(C.segment,C.isWordLike??!1,C.index,n)){let Q=function(){c[O]!==null&&(a[O]=[Bd(o,c,m,O)],c[O]=null),a[O].push(S.text),l[O]=l[O]||S.isWordLike,f[O]=f[O]||k,g[O]=g[O]||L,x[O]=V,v[O]=j,y[O]=Ud(g[O],H)},E=S.kind==="text",w=bx(S.text,S.isWordLike,S.kind),k=Ve(S.text),L=Hd(S.text),H=si(S.text),V=li(S.text),j=xx(S.text),O=i-1;t.carryCJKAfterClosingQuote&&E&&i>0&&s[O]==="text"&&k&&f[O]&&x[O]||E&&i>0&&s[O]==="text"&&px(S.text)&&f[O]||E&&i>0&&s[O]==="text"&&v[O]?Q():E&&i>0&&s[O]==="text"&&S.isWordLike&&L&&y[O]?(Q(),l[O]=!0):w!==null&&i>0&&s[O]==="text"&&c[O]===w?m[O]=(m[O]??1)+1:E&&!S.isWordLike&&i>0&&s[O]==="text"&&(mx(S.text)||S.text==="-"&&l[O])?Q():(o[i]=S.text,a[i]=[S.text],l[i]=S.isWordLike,s[i]=S.kind,u[i]=S.start,c[i]=w,m[i]=w===null?0:1,f[i]=k,g[i]=L,x[i]=V,v[i]=j,y[i]=Ud(L,H),i++)}for(let C=0;C<i;C++){if(c[C]!==null){o[C]=Bd(o,c,m,C);continue}o[C]=Ie(a[C])}for(let C=1;C<i;C++)s[C]==="text"&&!l[C]&&_a(o[C])&&s[C-1]==="text"&&(o[C-1]+=o[C],l[C-1]=l[C-1]||l[C],o[C]="");let _=Array.from({length:i},()=>null),R=-1;for(let C=i-1;C>=0;C--){let S=o[C];if(S.length!==0){if(s[C]==="text"&&!l[C]&&hx(S)&&R>=0&&s[R]==="text"){let E=_[R]??[];E.push(S),_[R]=E,u[R]=u[C],o[C]="";continue}R=C}}for(let C=0;C<i;C++){let S=_[C];S!=null&&(o[C]=Ex(S,o[C]))}let T=0;for(let C=0;C<i;C++){let S=o[C];S.length!==0&&(T!==C&&(o[T]=S,l[T]=l[C],s[T]=s[C],u[T]=u[C]),T++)}o.length=T,l.length=T,s.length=T,u.length=T;let F=Lx({len:T,texts:o,isWordLike:l,kinds:s,starts:u}),D=Dx(Mx(Nx(Fx(Rx(Tx(F))))));for(let C=0;C<D.len-1;C++){let S=yx(D.texts[C]);S!==null&&(D.kinds[C]!=="space"&&D.kinds[C]!=="preserved-space"||D.kinds[C+1]!=="text"||!Hd(D.texts[C+1])||(D.texts[C]=S.space,D.isWordLike[C]=!1,D.kinds[C]=D.kinds[C]==="preserved-space"?"preserved-space":"space",D.texts[C+1]=S.marks+D.texts[C+1],D.starts[C+1]=D.starts[C]+S.space.length))}return D}function Ix(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 i=0;i<e.len;i++)e.kinds[i]==="hard-break"&&(n.push({startSegmentIndex:r,endSegmentIndex:i,consumedEndSegmentIndex:i+1}),r=i+1);return r<e.len&&n.push({startSegmentIndex:r,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}),n}function Px(e){if(e.len<=1)return e;let t=[],n=[],r=[],i=[],o=null,a=!1,l=0,s=!1,u=!1;function c(){o!==null&&(t.push(Ie(o)),n.push(a),r.push("text"),i.push(l),o=null)}for(let m=0;m<e.len;m++){let f=e.texts[m],g=e.kinds[m],x=e.isWordLike[m],v=e.starts[m];if(g==="text"){let y=lx(f),_=oi(f);if(o!==null&&s&&u){o.push(f),a=a||x,s=s||y,u=_;continue}c(),o=[f],a=x,l=v,s=y,u=_;continue}c(),t.push(f),n.push(x),r.push(g),i.push(v)}return c(),{len:t.length,texts:t,isWordLike:n,kinds:r,starts:i}}function Kd(e,t,n="normal",r="normal"){let i=ex(n),o=i.mode==="pre-wrap"?nx(e):tx(e);if(o.length===0)return{normalized:o,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let a=r==="keep-all"?Px(zd(o,t,i)):zd(o,t,i);return{normalized:o,chunks:Ix(a,i),...a}}var Xt=null,Yd=new Map,Jt=null,Ox=96,Hx=/\p{Emoji_Presentation}/u,Gx=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u,Ta=null,Xd=new Map;function Ra(){if(Xt!==null)return Xt;if(typeof OffscreenCanvas<"u")return Xt=new OffscreenCanvas(1,1).getContext("2d"),Xt;if(typeof document<"u")return Xt=document.createElement("canvas").getContext("2d"),Xt;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Bx(e){let t=Yd.get(e);return t||(t=new Map,Yd.set(e,t)),t}function it(e,t){let n=t.get(e);return n===void 0&&(n={width:Ra().measureText(e).width,containsCJK:Ve(e)},t.set(e,n)),n}function Qt(){if(Jt!==null)return Jt;if(typeof navigator>"u")return Jt={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},Jt;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 Jt={lineFitEpsilon:n?1/64:.005,carryCJKAfterClosingQuote:r,preferPrefixWidthsForBreakableRuns:n,preferEarlySoftHyphenBreak:n},Jt}function Ux(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}function Jd(){return Ta===null&&(Ta=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Ta}function Wx(e){return Hx.test(e)||e.includes("\uFE0F")}function Qd(e){return Gx.test(e)}function Vx(e,t){let n=Xd.get(e);if(n!==void 0)return n;let r=Ra();r.font=e;let i=r.measureText("\u{1F600}").width;if(n=0,i>t+.5&&typeof document<"u"&&document.body!==null){let o=document.createElement("span");o.style.font=e,o.style.display="inline-block",o.style.visibility="hidden",o.style.position="absolute",o.textContent="\u{1F600}",document.body.appendChild(o);let a=o.getBoundingClientRect().width;document.body.removeChild(o),i-a>.5&&(n=i-a)}return Xd.set(e,n),n}function zx(e){let t=0,n=Jd();for(let r of n.segment(e))Wx(r.segment)&&t++;return t}function qx(e,t){return t.emojiCount===void 0&&(t.emojiCount=zx(e)),t.emojiCount}function ht(e,t,n){return n===0?t.width:t.width-qx(e,t)*n}function Zd(e,t,n,r,i){if(t.breakableFitAdvances!==void 0)return t.breakableFitAdvances;let o=Jd(),a=[];for(let c of o.segment(e))a.push(c.segment);if(a.length<=1)return t.breakableFitAdvances=null,t.breakableFitAdvances;if(i==="sum-graphemes"){let c=[];for(let m of a){let f=it(m,n);c.push(ht(m,f,r))}return t.breakableFitAdvances=c,t.breakableFitAdvances}if(i==="pair-context"||a.length>Ox){let c=[],m=null,f=0;for(let g of a){let x=it(g,n),v=ht(g,x,r);if(m===null)c.push(v);else{let y=m+g,_=it(y,n);c.push(ht(y,_,r)-f)}m=g,f=v}return t.breakableFitAdvances=c,t.breakableFitAdvances}let l=[],s="",u=0;for(let c of a){s+=c;let m=it(s,n),f=ht(s,m,r);l.push(f-u),u=f}return t.breakableFitAdvances=l,t.breakableFitAdvances}function ef(e,t){let n=Ra();n.font=e;let r=Bx(e),i=Ux(e),o=t?Vx(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}function $x(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 jx(e,t){if(t<=0)return 0;let n=e%t;return Math.abs(n)<=1e-6?t:t-n}function Kx(e,t,n,r,i){let o=0,a=t;for(;o<e.length;){let l=a+e[o];if((o+1<e.length?l+i:l)>n+r)break;a=l,o++}return{fitCount:o,fittedWidth:a}}function tf(e,t){return e.simpleLineWalkFastPath?nf(e,t):rf(e,t)}function nf(e,t,n){let{widths:r,kinds:i,breakableFitAdvances:o}=e;if(r.length===0)return 0;let l=Qt().lineFitEpsilon,s=t+l,u=0,c=0,m=!1,f=0,g=0,x=0,v=0,y=-1,_=0;function R(){y=-1,_=0}function T(w=x,k=v,L=c){u++,n?.({startSegmentIndex:f,startGraphemeIndex:g,endSegmentIndex:w,endGraphemeIndex:k,width:L}),c=0,m=!1,R()}function F(w,k){m=!0,f=w,g=0,x=w+1,v=0,c=k}function D(w,k,L){m=!0,f=w,g=k,x=w,v=k+1,c=L}function C(w,k){if(!m){F(w,k);return}c+=k,x=w+1,v=0}function S(w,k){let L=o[w];for(let H=k;H<L.length;H++){let V=L[H];m?c+V>s?(T(),D(w,H,V)):(c+=V,x=w,v=H+1):D(w,H,V)}m&&x===w&&v===L.length&&(x=w+1,v=0)}let E=0;for(;E<r.length&&!(!m&&(E=$x(e,E),E>=r.length));){let w=r[E],k=i[E],L=k==="space"||k==="preserved-space"||k==="tab"||k==="zero-width-break"||k==="soft-hyphen";if(!m){w>t&&o[E]!==null?S(E,0):F(E,w),L&&(y=E+1,_=c-w),E++;continue}if(c+w>s){if(L){C(E,w),T(E+1,0,c-w),E++;continue}if(y>=0){if(x>y||x===y&&v>0){T();continue}T(y,0,_);continue}if(w>t&&o[E]!==null){T(),S(E,0),E++;continue}T();continue}C(E,w),L&&(y=E+1,_=c-w),E++}return m&&T(),u}function rf(e,t,n){if(e.simpleLineWalkFastPath)return nf(e,t,n);let{widths:r,lineEndFitAdvances:i,lineEndPaintAdvances:o,kinds:a,breakableFitAdvances:l,discretionaryHyphenWidth:s,tabStopAdvance:u,chunks:c}=e;if(r.length===0||c.length===0)return 0;let m=Qt(),f=m.lineFitEpsilon,g=t+f,x=0,v=0,y=!1,_=0,R=0,T=0,F=0,D=-1,C=0,S=0,E=null;function w(){D=-1,C=0,S=0,E=null}function k(z=T,X=F,W=v){x++,n?.({startSegmentIndex:_,startGraphemeIndex:R,endSegmentIndex:z,endGraphemeIndex:X,width:W}),v=0,y=!1,w()}function L(z,X){y=!0,_=z,R=0,T=z+1,F=0,v=X}function H(z,X,W){y=!0,_=z,R=X,T=z,F=X+1,v=W}function V(z,X){if(!y){L(z,X);return}v+=X,T=z+1,F=0}function j(z,X,W,te){if(!X)return;let _e=z==="tab"?0:i[W],B=z==="tab"?te:o[W];D=W+1,C=v-te+_e,S=v-te+B,E=z}function O(z,X){let W=l[z];for(let te=X;te<W.length;te++){let _e=W[te];y?v+_e>g?(k(),H(z,te,_e)):(v+=_e,T=z,F=te+1):H(z,te,_e)}y&&T===z&&F===W.length&&(T=z+1,F=0)}function Q(z){if(E!=="soft-hyphen")return!1;let X=l[z];if(X==null)return!1;let{fitCount:W,fittedWidth:te}=Kx(X,v,t,f,s);return W===0?!1:(v=te,T=z,F=W,w(),W===X.length?(T=z+1,F=0,!0):(k(z,W,te+s),O(z,W),!0))}function we(z){x++,n?.({startSegmentIndex:z.startSegmentIndex,startGraphemeIndex:0,endSegmentIndex:z.consumedEndSegmentIndex,endGraphemeIndex:0,width:0}),w()}for(let z=0;z<c.length;z++){let X=c[z];if(X.startSegmentIndex===X.endSegmentIndex){we(X);continue}y=!1,v=0,_=X.startSegmentIndex,R=0,T=X.startSegmentIndex,F=0,w();let W=X.startSegmentIndex;for(;W<X.endSegmentIndex;){let te=a[W],_e=te==="space"||te==="preserved-space"||te==="tab"||te==="zero-width-break"||te==="soft-hyphen",B=te==="tab"?jx(v,u):r[W];if(te==="soft-hyphen"){y&&(T=W+1,F=0,D=W+1,C=v+s,S=v+s,E=te),W++;continue}if(!y){B>t&&l[W]!==null?O(W,0):L(W,B),j(te,_e,W,B),W++;continue}if(v+B>g){let P=v+(te==="tab"?0:i[W]),ce=v+(te==="tab"?B:o[W]);if(E==="soft-hyphen"&&m.preferEarlySoftHyphenBreak&&C<=g){k(D,0,S);continue}if(E==="soft-hyphen"&&Q(W)){W++;continue}if(_e&&P<=g){V(W,B),k(W+1,0,ce),W++;continue}if(D>=0&&C<=g){if(T>D||T===D&&F>0){k();continue}let ae=D;k(ae,0,S),W=ae;continue}if(B>t&&l[W]!==null){k(),O(W,0),W++;continue}k();continue}V(W,B),j(te,_e,W,B),W++}if(y){let te=D===X.consumedEndSegmentIndex?S:v;k(X.consumedEndSegmentIndex,0,te)}}return x}var ka=null;function Yx(){return ka===null&&(ka=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ka}function Xx(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 Jx(e,t){let n=[],r=[],i=0,o=!1,a=!1,l=!1;function s(){r.length!==0&&(n.push({text:r.length===1?r[0]:r.join(""),start:i}),r=[],o=!1,a=!1,l=!1)}function u(m,f,g){r=[m],i=f,o=g,a=li(m),l=Zn.has(m)}function c(m,f){r.push(m),o=o||f;let g=li(m);m.length===1&&pt.has(m)?a=a||g:a=g,l=!1}for(let m of Yx().segment(e)){let f=m.segment,g=Ve(f);if(r.length===0){u(f,m.index,g);continue}if(l||ai.has(f)||pt.has(f)||t.carryCJKAfterClosingQuote&&g&&a){c(f,g);continue}if(!o&&!g){c(f,g);continue}s(),u(f,m.index,g)}return s(),n}function Qx(e){if(e.length<=1)return e;let t=[],n=[e[0].text],r=e[0].start,i=Ve(e[0].text),o=oi(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],u=Ve(s.text),c=oi(s.text);if(i&&o){n.push(s.text),i=i||u,o=c;continue}a(),n=[s.text],r=s.start,i=u,o=c}return a(),t}function Zx(e,t,n,r){let i=Qt(),{cache:o,emojiCorrection:a}=ef(t,Qd(e.normalized)),l=ht("-",it("-",o),a),u=ht(" ",it(" ",o),a)*8;if(e.len===0)return Xx(n);let c=[],m=[],f=[],g=[],x=e.chunks.length<=1,v=n?[]:null,y=[],_=n?[]:null,R=Array.from({length:e.len});function T(S,E,w,k,L,H,V){L!=="text"&&L!=="space"&&L!=="zero-width-break"&&(x=!1),c.push(E),m.push(w),f.push(k),g.push(L),v?.push(H),y.push(V),_!==null&&_.push(S)}function F(S,E,w,k,L){let H=it(S,o),V=ht(S,H,a),j=E==="space"||E==="preserved-space"||E==="zero-width-break"?0:V,O=E==="space"||E==="zero-width-break"?0:V;if(L&&k&&S.length>1){let Q="sum-graphemes";Qn(S)?Q="pair-context":i.preferPrefixWidthsForBreakableRuns&&(Q="segment-prefixes");let we=Zd(S,H,o,a,Q);T(S,V,j,O,E,w,we);return}T(S,V,j,O,E,w,null)}for(let S=0;S<e.len;S++){R[S]=c.length;let E=e.texts[S],w=e.isWordLike[S],k=e.kinds[S],L=e.starts[S];if(k==="soft-hyphen"){T(E,0,l,l,k,L,null);continue}if(k==="hard-break"){T(E,0,0,0,k,L,null);continue}if(k==="tab"){T(E,0,0,0,k,L,null);continue}let H=it(E,o);if(k==="text"&&H.containsCJK){let V=Jx(E,i),j=r==="keep-all"?Qx(V):V;for(let O=0;O<j.length;O++){let Q=j[O];F(Q.text,"text",L+Q.start,w,r==="keep-all"||!Ve(Q.text))}continue}F(E,k,L,w,!0)}let D=ey(e.chunks,R,c.length),C=v===null?null:Od(e.normalized,v);return _!==null?{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:g,simpleLineWalkFastPath:x,segLevels:C,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:D,segments:_}:{widths:c,lineEndFitAdvances:m,lineEndPaintAdvances:f,kinds:g,simpleLineWalkFastPath:x,segLevels:C,breakableFitAdvances:y,discretionaryHyphenWidth:l,tabStopAdvance:u,chunks:D}}function ey(e,t,n){let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=o.startSegmentIndex<t.length?t[o.startSegmentIndex]:n,l=o.endSegmentIndex<t.length?t[o.endSegmentIndex]:n,s=o.consumedEndSegmentIndex<t.length?t[o.consumedEndSegmentIndex]:n;r.push({startSegmentIndex:a,endSegmentIndex:l,consumedEndSegmentIndex:s})}return r}function ty(e,t,n,r){let i=r?.wordBreak??"normal",o=Kd(e,Qt(),r?.whiteSpace,i);return Zx(o,t,n,i)}function of(e,t,n){return ty(e,t,!1,n)}function af(e,t,n){let r=tf(e,t);return{lineCount:r,height:r*n}}var ny={maxWidth:1600,baseFontSize:78,minFontSize:42,fontWeight:900,fontFamily:"Outfit",step:2};function sf(e,t){let n={...ny,...t},r=1.2;for(let i=n.baseFontSize;i>=n.minFontSize;i-=n.step){let o=`${n.fontWeight} ${i}px ${n.fontFamily}`,a=of(e,o),{lineCount:l}=af(a,n.maxWidth,i*r);if(l<=1)return{fontSize:i,fits:!0}}return{fontSize:n.minFontSize,fits:!1}}window.__timelines=window.__timelines||{};Bc();window.__hyperframes={fitTextFontSize:sf,getVariables:Za};function lf(){let e=window;e.__hyperframeRuntimeBootstrapped||(e.__hyperframeRuntimeBootstrapped=!0,Id())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",lf,{once:!0}):lf();})();
|
|
358
568
|
|